From 0ab040816a696c2035104461ffee0a83c1820edf Mon Sep 17 00:00:00 2001 From: Dan <46821332+nsadeveloper789@users.noreply.github.com> Date: Thu, 5 Dec 2024 08:29:10 -0500 Subject: [PATCH] GP-1978: Delete Deprecated plugins, GADP --- .../Debug/Debugger-agent-dbgeng/build.gradle | 23 - .../DbgEngInJvmDebuggerModelFactory.java | 95 - .../agent/dbgeng/dbgeng/COMUtilsExtra.java | 72 - .../main/java/agent/dbgeng/dbgeng/DbgEng.java | 163 - .../agent/dbgeng/dbgeng/DebugAdvanced.java | 83 - .../agent/dbgeng/dbgeng/DebugBreakpoint.java | 137 - .../java/agent/dbgeng/dbgeng/DebugClient.java | 434 - .../dbgeng/dbgeng/DebugClientReentrant.java | 46 - .../agent/dbgeng/dbgeng/DebugControl.java | 447 - .../dbgeng/dbgeng/DebugControlReentrant.java | 27 - .../agent/dbgeng/dbgeng/DebugDataSpaces.java | 290 - .../dbgeng/dbgeng/DebugEventCallbacks.java | 116 - .../dbgeng/dbgeng/DebugEventInformation.java | 70 - .../DebugExceptionFilterInformation.java | 42 - .../dbgeng/dbgeng/DebugExceptionRecord64.java | 41 - .../dbgeng/dbgeng/DebugFilterInformation.java | 42 - .../dbgeng/dbgeng/DebugInputCallbacks.java | 31 - .../java/agent/dbgeng/dbgeng/DebugModule.java | 47 - .../agent/dbgeng/dbgeng/DebugModuleInfo.java | 64 - .../dbgeng/dbgeng/DebugOutputCallbacks.java | 32 - .../agent/dbgeng/dbgeng/DebugProcessId.java | 38 - .../agent/dbgeng/dbgeng/DebugProcessInfo.java | 36 - .../dbgeng/dbgeng/DebugProcessRecord.java | 34 - .../agent/dbgeng/dbgeng/DebugRegisters.java | 158 - .../dbgeng/dbgeng/DebugRunningProcess.java | 123 - .../agent/dbgeng/dbgeng/DebugServerId.java | 58 - .../agent/dbgeng/dbgeng/DebugSessionId.java | 38 - .../dbgeng/dbgeng/DebugSessionRecord.java | 34 - .../DebugSpecificFilterInformation.java | 42 - .../dbgeng/dbgeng/DebugStackInformation.java | 37 - .../agent/dbgeng/dbgeng/DebugSymbolEntry.java | 56 - .../agent/dbgeng/dbgeng/DebugSymbolId.java | 34 - .../agent/dbgeng/dbgeng/DebugSymbolName.java | 34 - .../agent/dbgeng/dbgeng/DebugSymbols.java | 85 - .../dbgeng/dbgeng/DebugSystemObjects.java | 116 - .../dbgeng/DebugSystemProcessRecord.java | 34 - .../dbgeng/DebugSystemSessionRecord.java | 34 - .../dbgeng/DebugSystemThreadRecord.java | 34 - .../agent/dbgeng/dbgeng/DebugThreadId.java | 39 - .../agent/dbgeng/dbgeng/DebugThreadInfo.java | 43 - .../dbgeng/dbgeng/DebugThreadRecord.java | 34 - .../java/agent/dbgeng/dbgeng/DebugValue.java | 457 - .../dbgeng/dbgeng/err/DbgEngException.java | 29 - .../dbgeng/err/DbgEngRuntimeException.java | 29 - .../agent/dbgeng/dbgeng/ext/JavaProvider.java | 49 - .../util/DebugEventCallbacksAdapter.java | 125 - .../gadp/DbgEngGadpDebuggerModelFactory.java | 97 - .../agent/dbgeng/gadp/DbgEngGadpServer.java | 236 - .../gadp/DbgEngGadpServerLaunchShim.java | 37 - .../impl/AbstractClientThreadExecutor.java | 244 - .../gadp/impl/DbgEngClientThreadExecutor.java | 63 - .../gadp/impl/DbgEngGadpServerImpl.java | 64 - .../agent/dbgeng/impl/dbgeng/DbgEngUtil.java | 93 - .../impl/dbgeng/DebugRunningProcessImpl.java | 66 - .../dbgeng/advanced/DebugAdvancedImpl1.java | 38 - .../dbgeng/advanced/DebugAdvancedImpl2.java | 85 - .../dbgeng/advanced/DebugAdvancedImpl3.java | 28 - .../advanced/DebugAdvancedInternal.java | 84 - .../breakpoint/DebugBreakpointImpl1.java | 195 - .../breakpoint/DebugBreakpointImpl2.java | 56 - .../breakpoint/DebugBreakpointImpl3.java | 34 - .../breakpoint/DebugBreakpointInternal.java | 60 - .../impl/dbgeng/client/DebugClientImpl1.java | 333 - .../impl/dbgeng/client/DebugClientImpl2.java | 50 - .../impl/dbgeng/client/DebugClientImpl3.java | 76 - .../impl/dbgeng/client/DebugClientImpl4.java | 39 - .../impl/dbgeng/client/DebugClientImpl5.java | 103 - .../impl/dbgeng/client/DebugClientImpl6.java | 35 - .../impl/dbgeng/client/DebugClientImpl7.java | 28 - .../dbgeng/client/DebugClientInternal.java | 92 - .../dbgeng/control/DebugControlImpl1.java | 445 - .../dbgeng/control/DebugControlImpl2.java | 28 - .../dbgeng/control/DebugControlImpl3.java | 28 - .../dbgeng/control/DebugControlImpl4.java | 128 - .../dbgeng/control/DebugControlImpl5.java | 28 - .../dbgeng/control/DebugControlImpl6.java | 28 - .../dbgeng/control/DebugControlImpl7.java | 28 - .../dbgeng/control/DebugControlInternal.java | 77 - .../dataspaces/DebugDataSpacesImpl1.java | 276 - .../dataspaces/DebugDataSpacesImpl2.java | 69 - .../dataspaces/DebugDataSpacesImpl3.java | 28 - .../dataspaces/DebugDataSpacesImpl4.java | 28 - .../dataspaces/DebugDataSpacesInternal.java | 59 - .../WrapCallbackIDebugEventCallbacks.java | 298 - .../WrapCallbackIDebugEventCallbacksWide.java | 297 - .../io/WrapCallbackIDebugInputCallbacks.java | 96 - .../io/WrapCallbackIDebugOutputCallbacks.java | 82 - ...WrapCallbackIDebugOutputCallbacksWide.java | 84 - .../dbgeng/registers/DebugRegistersImpl1.java | 154 - .../dbgeng/registers/DebugRegistersImpl2.java | 50 - .../registers/DebugRegistersInternal.java | 49 - .../impl/dbgeng/symbols/DebugModuleImpl.java | 72 - .../dbgeng/symbols/DebugSymbolsImpl1.java | 232 - .../dbgeng/symbols/DebugSymbolsImpl2.java | 48 - .../dbgeng/symbols/DebugSymbolsImpl3.java | 115 - .../dbgeng/symbols/DebugSymbolsImpl4.java | 28 - .../dbgeng/symbols/DebugSymbolsImpl5.java | 28 - .../dbgeng/symbols/DebugSymbolsInternal.java | 71 - .../sysobj/DebugSystemObjectsImpl1.java | 323 - .../sysobj/DebugSystemObjectsImpl2.java | 75 - .../sysobj/DebugSystemObjectsImpl3.java | 99 - .../sysobj/DebugSystemObjectsImpl4.java | 28 - .../sysobj/DebugSystemObjectsInternal.java | 63 - .../agent/dbgeng/jna/dbgeng/DbgEngNative.java | 524 - .../dbgeng/jna/dbgeng/Kernel32Extra.java | 126 - .../agent/dbgeng/jna/dbgeng/ToolhelpUtil.java | 107 - .../dbgeng/jna/dbgeng/UnknownWithUtils.java | 47 - .../agent/dbgeng/jna/dbgeng/WinNTExtra.java | 281 - .../jna/dbgeng/advanced/IDebugAdvanced.java | 46 - .../jna/dbgeng/advanced/IDebugAdvanced2.java | 60 - .../jna/dbgeng/advanced/IDebugAdvanced3.java | 53 - .../dbgeng/advanced/WrapIDebugAdvanced.java | 45 - .../dbgeng/advanced/WrapIDebugAdvanced2.java | 70 - .../dbgeng/advanced/WrapIDebugAdvanced3.java | 56 - .../dbgeng/breakpoint/IDebugBreakpoint.java | 105 - .../dbgeng/breakpoint/IDebugBreakpoint2.java | 52 - .../dbgeng/breakpoint/IDebugBreakpoint3.java | 40 - .../breakpoint/WrapIDebugBreakpoint.java | 143 - .../breakpoint/WrapIDebugBreakpoint2.java | 56 - .../breakpoint/WrapIDebugBreakpoint3.java | 38 - .../jna/dbgeng/client/IDebugClient.java | 184 - .../jna/dbgeng/client/IDebugClient2.java | 62 - .../jna/dbgeng/client/IDebugClient3.java | 54 - .../jna/dbgeng/client/IDebugClient4.java | 59 - .../jna/dbgeng/client/IDebugClient5.java | 137 - .../jna/dbgeng/client/IDebugClient6.java | 40 - .../jna/dbgeng/client/IDebugClient7.java | 41 - .../jna/dbgeng/client/WrapIDebugClient.java | 281 - .../jna/dbgeng/client/WrapIDebugClient2.java | 79 - .../jna/dbgeng/client/WrapIDebugClient3.java | 64 - .../jna/dbgeng/client/WrapIDebugClient4.java | 72 - .../jna/dbgeng/client/WrapIDebugClient5.java | 208 - .../jna/dbgeng/client/WrapIDebugClient6.java | 42 - .../jna/dbgeng/client/WrapIDebugClient7.java | 41 - .../jna/dbgeng/control/IDebugControl.java | 220 - .../jna/dbgeng/control/IDebugControl2.java | 43 - .../jna/dbgeng/control/IDebugControl3.java | 48 - .../jna/dbgeng/control/IDebugControl4.java | 109 - .../jna/dbgeng/control/IDebugControl5.java | 40 - .../jna/dbgeng/control/IDebugControl6.java | 41 - .../jna/dbgeng/control/IDebugControl7.java | 36 - .../jna/dbgeng/control/WrapIDebugControl.java | 258 - .../dbgeng/control/WrapIDebugControl2.java | 31 - .../dbgeng/control/WrapIDebugControl3.java | 31 - .../dbgeng/control/WrapIDebugControl4.java | 85 - .../dbgeng/control/WrapIDebugControl5.java | 31 - .../dbgeng/control/WrapIDebugControl6.java | 38 - .../dbgeng/control/WrapIDebugControl7.java | 31 - .../dbgeng/dataspaces/IDebugDataSpaces.java | 104 - .../dbgeng/dataspaces/IDebugDataSpaces2.java | 49 - .../dbgeng/dataspaces/IDebugDataSpaces3.java | 40 - .../dbgeng/dataspaces/IDebugDataSpaces4.java | 45 - .../dataspaces/WrapIDebugDataSpaces.java | 141 - .../dataspaces/WrapIDebugDataSpaces2.java | 50 - .../dataspaces/WrapIDebugDataSpaces3.java | 34 - .../dataspaces/WrapIDebugDataSpaces4.java | 34 - .../event/CallbackIDebugEventCallbacks.java | 21 - .../CallbackIDebugEventCallbacksWide.java | 22 - .../CallbackIDebugEventContextCallbacks.java | 22 - .../dbgeng/event/IDebugEventCallbacks.java | 59 - .../event/IDebugEventCallbacksWide.java | 60 - .../event/IDebugEventContextCallbacks.java | 66 - .../event/ListenerIDebugEventCallbacks.java | 184 - .../ListenerIDebugEventCallbacksWide.java | 185 - .../ListenerIDebugEventContextCallbacks.java | 198 - .../dbgeng/event/MarkerEventCallbacks.java | 20 - .../event/VTableIDebugEventCallbacks.java | 127 - .../event/VTableIDebugEventCallbacksWide.java | 126 - .../VTableIDebugEventContextCallbacks.java | 132 - .../io/CallbackIDebugInputCallbacks.java | 21 - .../io/CallbackIDebugOutputCallbacks.java | 21 - .../io/CallbackIDebugOutputCallbacks2.java | 21 - .../io/CallbackIDebugOutputCallbacksWide.java | 22 - .../jna/dbgeng/io/IDebugInputCallbacks.java | 28 - .../jna/dbgeng/io/IDebugOutputCallbacks.java | 26 - .../jna/dbgeng/io/IDebugOutputCallbacks2.java | 29 - .../dbgeng/io/IDebugOutputCallbacksWide.java | 27 - .../io/ListenerIDebugInputCallbacks.java | 72 - .../io/ListenerIDebugOutputCallbacks.java | 64 - .../io/ListenerIDebugOutputCallbacks2.java | 81 - .../io/ListenerIDebugOutputCallbacksWide.java | 65 - .../jna/dbgeng/io/MarkerInputCallbacks.java | 20 - .../jna/dbgeng/io/MarkerOutputCallbacks.java | 20 - .../dbgeng/io/VTableIDebugInputCallbacks.java | 66 - .../io/VTableIDebugOutputCallbacks.java | 61 - .../io/VTableIDebugOutputCallbacks2.java | 50 - .../io/VTableIDebugOutputCallbacksWide.java | 60 - .../jna/dbgeng/registers/IDebugRegisters.java | 75 - .../dbgeng/registers/IDebugRegisters2.java | 92 - .../dbgeng/registers/WrapIDebugRegisters.java | 94 - .../registers/WrapIDebugRegisters2.java | 124 - .../jna/dbgeng/symbols/IDebugSymbolGroup.java | 22 - .../dbgeng/symbols/IDebugSymbolGroup2.java | 22 - .../jna/dbgeng/symbols/IDebugSymbols.java | 123 - .../jna/dbgeng/symbols/IDebugSymbols2.java | 48 - .../jna/dbgeng/symbols/IDebugSymbols3.java | 130 - .../jna/dbgeng/symbols/IDebugSymbols4.java | 42 - .../jna/dbgeng/symbols/IDebugSymbols5.java | 37 - .../jna/dbgeng/symbols/WrapIDebugSymbols.java | 116 - .../dbgeng/symbols/WrapIDebugSymbols2.java | 40 - .../dbgeng/symbols/WrapIDebugSymbols3.java | 93 - .../dbgeng/symbols/WrapIDebugSymbols4.java | 31 - .../dbgeng/symbols/WrapIDebugSymbols5.java | 31 - .../dbgeng/sysobj/IDebugSystemObjects.java | 108 - .../dbgeng/sysobj/IDebugSystemObjects2.java | 52 - .../dbgeng/sysobj/IDebugSystemObjects3.java | 57 - .../dbgeng/sysobj/IDebugSystemObjects4.java | 37 - .../sysobj/WrapIDebugSystemObjects.java | 142 - .../sysobj/WrapIDebugSystemObjects2.java | 59 - .../sysobj/WrapIDebugSystemObjects3.java | 63 - .../sysobj/WrapIDebugSystemObjects4.java | 33 - .../jna/javaprovider/JavaProviderNative.java | 25 - .../java/agent/dbgeng/manager/DbgCause.java | 33 - .../java/agent/dbgeng/manager/DbgCommand.java | 79 - .../java/agent/dbgeng/manager/DbgEvent.java | 63 - .../agent/dbgeng/manager/DbgEventFilter.java | 36 - .../agent/dbgeng/manager/DbgEventHandler.java | 62 - .../dbgeng/manager/DbgEventsListener.java | 262 - .../manager/DbgEventsListenerAdapter.java | 157 - .../dbgeng/manager/DbgExceptionFilter.java | 23 - .../java/agent/dbgeng/manager/DbgManager.java | 398 - .../dbgeng/manager/DbgMemoryOperations.java | 70 - .../java/agent/dbgeng/manager/DbgModule.java | 43 - .../agent/dbgeng/manager/DbgModuleMemory.java | 51 - .../dbgeng/manager/DbgModuleSection.java | 38 - .../java/agent/dbgeng/manager/DbgProcess.java | 254 - .../java/agent/dbgeng/manager/DbgReason.java | 44 - .../java/agent/dbgeng/manager/DbgSession.java | 73 - .../agent/dbgeng/manager/DbgStackFrame.java | 71 - .../manager/DbgStackFrameOperations.java | 72 - .../java/agent/dbgeng/manager/DbgState.java | 89 - .../dbgeng/manager/DbgStateListener.java | 36 - .../java/agent/dbgeng/manager/DbgThread.java | 169 - .../manager/breakpoint/DbgBreakpointDisp.java | 32 - .../manager/breakpoint/DbgBreakpointInfo.java | 310 - .../breakpoint/DbgBreakpointInsertions.java | 84 - .../breakpoint/DbgBreakpointLocation.java | 138 - .../manager/breakpoint/DbgBreakpointType.java | 65 - .../manager/cmd/AbstractDbgCommand.java | 124 - .../cmd/AbstractDbgExecToAddressCommand.java | 73 - .../manager/cmd/AbstractDbgReadCommand.java | 53 - .../manager/cmd/DbgAddProcessCommand.java | 37 - .../manager/cmd/DbgAddSessionCommand.java | 37 - .../dbgeng/manager/cmd/DbgAttachCommand.java | 82 - .../manager/cmd/DbgAttachKernelCommand.java | 72 - .../dbgeng/manager/cmd/DbgCommandError.java | 55 - .../manager/cmd/DbgConsoleExecCommand.java | 70 - .../manager/cmd/DbgContinueCommand.java | 52 - .../cmd/DbgDeleteBreakpointsCommand.java | 44 - .../dbgeng/manager/cmd/DbgDetachCommand.java | 54 - .../cmd/DbgDisableBreakpointsCommand.java | 44 - .../cmd/DbgEnableBreakpointsCommand.java | 43 - .../manager/cmd/DbgEvaluateCommand.java | 42 - .../cmd/DbgFileExecAndSymbolsCommand.java | 37 - .../cmd/DbgInsertBreakpointCommand.java | 95 - .../dbgeng/manager/cmd/DbgKillCommand.java | 39 - .../manager/cmd/DbgLaunchProcessCommand.java | 110 - .../cmd/DbgListAvailableProcessesCommand.java | 58 - .../cmd/DbgListBreakpointsCommand.java | 50 - .../cmd/DbgListEventFiltersCommand.java | 58 - .../cmd/DbgListExceptionFiltersCommand.java | 79 - .../DbgListKernelMemoryRegionsCommand.java | 98 - .../manager/cmd/DbgListMappingsCommand.java | 69 - .../cmd/DbgListMemoryRegionsCommand.java | 118 - .../manager/cmd/DbgListModulesCommand.java | 85 - .../cmd/DbgListOSMemoryRegionsCommand.java | 115 - .../cmd/DbgListOSProcessesCommand.java | 100 - .../manager/cmd/DbgListOSThreadsCommand.java | 98 - .../manager/cmd/DbgListProcessesCommand.java | 87 - .../DbgListRegisterDescriptionsCommand.java | 48 - .../manager/cmd/DbgListSessionsCommand.java | 66 - .../manager/cmd/DbgListSymbolsCommand.java | 67 - .../manager/cmd/DbgListThreadsCommand.java | 89 - .../manager/cmd/DbgOpenDumpCommand.java | 73 - .../dbgeng/manager/cmd/DbgPendingCommand.java | 205 - .../manager/cmd/DbgReadBusDataCommand.java | 45 - .../manager/cmd/DbgReadControlCommand.java | 40 - .../cmd/DbgReadDebuggerDataCommand.java | 36 - .../dbgeng/manager/cmd/DbgReadIoCommand.java | 45 - .../manager/cmd/DbgReadMemoryCommand.java | 36 - .../cmd/DbgReadPhysicalMemoryCommand.java | 37 - .../manager/cmd/DbgReadRegistersCommand.java | 71 - .../manager/cmd/DbgRemoveProcessCommand.java | 37 - .../manager/cmd/DbgRemoveSessionCommand.java | 37 - .../cmd/DbgRequestActivationCommand.java | 45 - .../manager/cmd/DbgRequestFocusCommand.java | 45 - .../manager/cmd/DbgResolveProcessCommand.java | 101 - .../manager/cmd/DbgResolveThreadCommand.java | 100 - .../dbgeng/manager/cmd/DbgRunCommand.java | 61 - .../cmd/DbgSetActiveProcessCommand.java | 108 - .../cmd/DbgSetActiveSessionCommand.java | 45 - .../cmd/DbgSetActiveThreadCommand.java | 106 - .../cmd/DbgSetFilterArgumentCommand.java | 39 - .../cmd/DbgSetFilterCommandCommand.java | 39 - .../DbgSetFilterSecondChanceCmdCommand.java | 39 - .../cmd/DbgStackListFramesCommand.java | 70 - .../cmd/DbgStackListOSFramesCommand.java | 119 - .../dbgeng/manager/cmd/DbgStepCommand.java | 115 - .../manager/cmd/DbgStepToAddressCommand.java | 31 - .../manager/cmd/DbgThreadHoldCommand.java | 75 - .../cmd/DbgToggleContinuationCommand.java | 60 - .../cmd/DbgToggleExecutionCommand.java | 60 - .../manager/cmd/DbgTraceToAddressCommand.java | 31 - .../manager/cmd/DbgWriteBusDataCommand.java | 52 - .../manager/cmd/DbgWriteControlCommand.java | 47 - .../dbgeng/manager/cmd/DbgWriteIoCommand.java | 52 - .../manager/cmd/DbgWriteMemoryCommand.java | 44 - .../cmd/DbgWritePhysicalMemoryCommand.java | 45 - .../manager/cmd/DbgWriteRegistersCommand.java | 71 - .../evt/AbstractDbgCompletedCommandEvent.java | 40 - .../dbgeng/manager/evt/AbstractDbgEvent.java | 85 - .../evt/DbgBreakpointCreatedEvent.java | 42 - .../evt/DbgBreakpointDeletedEvent.java | 41 - .../manager/evt/DbgBreakpointEvent.java | 25 - .../evt/DbgBreakpointModifiedEvent.java | 51 - .../manager/evt/DbgCommandDoneEvent.java | 43 - .../manager/evt/DbgCommandErrorEvent.java | 45 - .../manager/evt/DbgCommandRunningEvent.java | 30 - .../manager/evt/DbgConsoleOutputEvent.java | 34 - .../evt/DbgDebuggeeStateChangeEvent.java | 48 - .../dbgeng/manager/evt/DbgExceptionEvent.java | 25 - .../evt/DbgInitialBreakpointEvent.java | 25 - .../evt/DbgInitialModuleLoadEvent.java | 25 - .../manager/evt/DbgModuleLoadedEvent.java | 25 - .../manager/evt/DbgModuleUnloadedEvent.java | 25 - .../manager/evt/DbgProcessCreatedEvent.java | 25 - .../manager/evt/DbgProcessExitedEvent.java | 31 - .../manager/evt/DbgProcessSelectedEvent.java | 49 - .../manager/evt/DbgPromptChangedEvent.java | 26 - .../dbgeng/manager/evt/DbgRunningEvent.java | 48 - .../manager/evt/DbgSessionSelectedEvent.java | 49 - .../manager/evt/DbgStateChangedEvent.java | 53 - .../dbgeng/manager/evt/DbgStoppedEvent.java | 59 - .../manager/evt/DbgSystemErrorEvent.java | 41 - .../dbgeng/manager/evt/DbgSystemsEvent.java | 31 - .../manager/evt/DbgThreadCreatedEvent.java | 25 - .../manager/evt/DbgThreadExitedEvent.java | 24 - .../manager/evt/DbgThreadSelectedEvent.java | 65 - .../impl/DbgDebugEventCallbacksAdapter.java | 156 - .../manager/impl/DbgDebugInputCallbacks.java | 43 - .../manager/impl/DbgDebugOutputCallbacks.java | 34 - .../manager/impl/DbgEventFilterImpl.java | 79 - .../manager/impl/DbgExceptionFilterImpl.java | 41 - .../dbgeng/manager/impl/DbgManagerImpl.java | 1806 - .../dbgeng/manager/impl/DbgMinimalSymbol.java | 65 - .../dbgeng/manager/impl/DbgModuleImpl.java | 110 - .../manager/impl/DbgModuleMemoryImpl.java | 151 - .../dbgeng/manager/impl/DbgProcessImpl.java | 413 - .../dbgeng/manager/impl/DbgRegister.java | 89 - .../dbgeng/manager/impl/DbgRegisterSet.java | 68 - .../dbgeng/manager/impl/DbgSectionImpl.java | 54 - .../dbgeng/manager/impl/DbgSessionImpl.java | 154 - .../manager/impl/DbgStackFrameImpl.java | 162 - .../dbgeng/manager/impl/DbgThreadImpl.java | 301 - .../reason/DbgEndSteppingRangeReason.java | 34 - .../manager/reason/DbgExitNormallyReason.java | 34 - .../manager/reason/DbgExitedReason.java | 45 - .../reason/DbgSignalReceivedReason.java | 45 - .../agent/dbgeng/model/AbstractDbgModel.java | 49 - .../iface1/DbgModelSelectableObject.java | 62 - .../DbgModelTargetAccessConditioned.java | 36 - .../iface1/DbgModelTargetActiveScope.java | 68 - .../iface1/DbgModelTargetAttachable.java | 31 - .../model/iface1/DbgModelTargetAttacher.java | 60 - .../model/iface1/DbgModelTargetBptHelper.java | 44 - .../iface1/DbgModelTargetConfigurable.java | 28 - .../model/iface1/DbgModelTargetDeletable.java | 35 - .../iface1/DbgModelTargetDetachable.java | 39 - .../iface1/DbgModelTargetEnvironment.java | 40 - .../iface1/DbgModelTargetEventScope.java | 28 - .../DbgModelTargetExecutionStateful.java | 53 - .../iface1/DbgModelTargetFocusScope.java | 78 - .../iface1/DbgModelTargetInterpreter.java | 44 - .../iface1/DbgModelTargetInterruptible.java | 38 - .../model/iface1/DbgModelTargetKillable.java | 39 - .../model/iface1/DbgModelTargetLauncher.java | 41 - .../model/iface1/DbgModelTargetMethod.java | 28 - .../model/iface1/DbgModelTargetResumable.java | 43 - .../model/iface1/DbgModelTargetSteppable.java | 89 - .../model/iface2/DbgModelTargetAvailable.java | 28 - .../DbgModelTargetAvailableContainer.java | 22 - .../DbgModelTargetBreakpointContainer.java | 95 - .../DbgModelTargetBreakpointLocation.java | 27 - .../iface2/DbgModelTargetBreakpointSpec.java | 214 - .../model/iface2/DbgModelTargetConnector.java | 41 - .../DbgModelTargetConnectorContainer.java | 22 - .../iface2/DbgModelTargetDebugContainer.java | 22 - .../iface2/DbgModelTargetEnvironmentEx.java | 41 - .../model/iface2/DbgModelTargetEvent.java | 36 - .../iface2/DbgModelTargetEventContainer.java | 30 - .../iface2/DbgModelTargetEventOption.java | 28 - .../model/iface2/DbgModelTargetException.java | 24 - .../DbgModelTargetExceptionContainer.java | 30 - .../iface2/DbgModelTargetMemoryContainer.java | 37 - .../iface2/DbgModelTargetMemoryRegion.java | 35 - .../model/iface2/DbgModelTargetModule.java | 75 - .../iface2/DbgModelTargetModuleContainer.java | 36 - .../iface2/DbgModelTargetModuleSection.java | 26 - .../DbgModelTargetModuleSectionContainer.java | 23 - .../model/iface2/DbgModelTargetObject.java | 80 - .../model/iface2/DbgModelTargetProcess.java | 95 - .../DbgModelTargetProcessContainer.java | 32 - .../model/iface2/DbgModelTargetRegister.java | 37 - .../iface2/DbgModelTargetRegisterBank.java | 151 - .../DbgModelTargetRegisterContainer.java | 26 - ...bgModelTargetRegisterContainerAndBank.java | 29 - .../model/iface2/DbgModelTargetRoot.java | 35 - .../model/iface2/DbgModelTargetSession.java | 107 - .../DbgModelTargetSessionAttributes.java | 26 - ...bgModelTargetSessionAttributesMachine.java | 24 - .../DbgModelTargetSessionContainer.java | 34 - .../model/iface2/DbgModelTargetStack.java | 26 - .../iface2/DbgModelTargetStackFrame.java | 114 - .../model/iface2/DbgModelTargetSymbol.java | 31 - .../iface2/DbgModelTargetSymbolContainer.java | 26 - .../model/iface2/DbgModelTargetTTD.java | 56 - .../model/iface2/DbgModelTargetThread.java | 95 - .../iface2/DbgModelTargetThreadContainer.java | 34 - .../impl/DbgModelDefaultTargetModelRoot.java | 33 - .../agent/dbgeng/model/impl/DbgModelImpl.java | 197 - .../dbgeng/model/impl/DbgModelImplUtils.java | 34 - .../DbgModelTargetAvailableContainerImpl.java | 96 - .../impl/DbgModelTargetAvailableImpl.java | 83 - ...DbgModelTargetBreakpointContainerImpl.java | 126 - .../DbgModelTargetBreakpointSpecImpl.java | 169 - .../DbgModelTargetConnectorContainerImpl.java | 93 - .../DbgModelTargetContinuationOptionImpl.java | 91 - .../DbgModelTargetDebugContainerImpl.java | 71 - .../DbgModelTargetEventContainerImpl.java | 87 - .../model/impl/DbgModelTargetEventImpl.java | 209 - .../DbgModelTargetExceptionContainerImpl.java | 88 - .../impl/DbgModelTargetExceptionImpl.java | 177 - .../DbgModelTargetExecutionOptionImpl.java | 91 - .../DbgModelTargetKernelConnectorImpl.java | 90 - .../DbgModelTargetMemoryContainerImpl.java | 312 - .../impl/DbgModelTargetMemoryRegionImpl.java | 149 - .../DbgModelTargetModuleContainerImpl.java | 130 - .../model/impl/DbgModelTargetModuleImpl.java | 106 - ...ModelTargetModuleSectionContainerImpl.java | 67 - .../impl/DbgModelTargetModuleSectionImpl.java | 59 - .../model/impl/DbgModelTargetObjectImpl.java | 208 - ...ModelTargetProcessAttachConnectorImpl.java | 89 - .../DbgModelTargetProcessContainerImpl.java | 235 - .../model/impl/DbgModelTargetProcessImpl.java | 304 - ...ModelTargetProcessLaunchConnectorImpl.java | 95 - .../DbgModelTargetRegisterContainerImpl.java | 195 - .../impl/DbgModelTargetRegisterImpl.java | 82 - .../model/impl/DbgModelTargetRootImpl.java | 286 - .../DbgModelTargetSessionAttributesImpl.java | 89 - ...delTargetSessionAttributesMachineImpl.java | 97 - .../DbgModelTargetSessionContainerImpl.java | 90 - .../model/impl/DbgModelTargetSessionImpl.java | 117 - .../impl/DbgModelTargetStackFrameImpl.java | 172 - .../model/impl/DbgModelTargetStackImpl.java | 95 - .../DbgModelTargetSymbolContainerImpl.java | 71 - .../model/impl/DbgModelTargetSymbolImpl.java | 97 - .../DbgModelTargetThreadContainerImpl.java | 204 - .../model/impl/DbgModelTargetThreadImpl.java | 215 - ...bgModelTargetTraceOrDumpConnectorImpl.java | 93 - .../java/agent/dbgeng/dbgeng/DbgEngTest.java | 905 - .../manager/impl/AbstractDbgManagerTest.java | 447 - .../manager/impl/SpawnedDbgManagerTest.java | 30 - .../dbgeng/model/AbstractDbgengModelHost.java | 27 - ...AbstractModelForDbgengBreakpointsTest.java | 171 - .../AbstractModelForDbgengFactoryTest.java | 28 - ...ractModelForDbgengFrameActivationTest.java | 116 - ...AbstractModelForDbgengInterpreterTest.java | 81 - ...ctModelForDbgengProcessActivationTest.java | 83 - ...bstractModelForDbgengRootAttacherTest.java | 58 - ...bstractModelForDbgengRootLauncherTest.java | 72 - ...ctModelForDbgengScenarioCloneExitTest.java | 32 - ...actModelForDbgengScenarioForkExitTest.java | 49 - ...tractModelForDbgengScenarioMemoryTest.java | 72 - ...stractModelForDbgengScenarioStackTest.java | 66 - ...odelForDbgengScenarioX64RegistersTest.java | 52 - ...ctModelForDbgengSessionActivationTest.java | 33 - .../AbstractModelForDbgengSteppableTest.java | 39 - ...actModelForDbgengThreadActivationTest.java | 84 - ...bstractModelForDbgengX64RegistersTest.java | 52 - .../agent/dbgeng/model/WindowsSpecimen.java | 124 - .../model/gadp/GadpDbgengModelHost.java | 29 - .../GadpModelForDbgengBreakpointsTest.java | 37 - .../gadp/GadpModelForDbgengFactoryTest.java | 28 - ...GadpModelForDbgengFrameActivationTest.java | 37 - .../GadpModelForDbgengInterpreterTest.java | 40 - ...dpModelForDbgengProcessActivationTest.java | 50 - .../GadpModelForDbgengRootAttacherTest.java | 31 - .../GadpModelForDbgengRootLauncherTest.java | 28 - ...dpModelForDbgengScenarioCloneExitTest.java | 29 - ...adpModelForDbgengScenarioForkExitTest.java | 37 - .../GadpModelForDbgengScenarioMemoryTest.java | 31 - .../GadpModelForDbgengScenarioStackTest.java | 28 - ...odelForDbgengScenarioX64RegistersTest.java | 29 - ...dpModelForDbgengSessionActivationTest.java | 29 - .../gadp/GadpModelForDbgengSteppableTest.java | 28 - ...adpModelForDbgengThreadActivationTest.java | 49 - .../GadpModelForDbgengX64RegistersTest.java | 31 - .../model/invm/InVmDbgengModelHost.java | 32 - .../InVmModelForDbgengBreakpointsTest.java | 38 - .../invm/InVmModelForDbgengFactoryTest.java | 28 - ...InVmModelForDbgengFrameActivationTest.java | 37 - .../InVmModelForDbgengInterpreterTest.java | 45 - ...VmModelForDbgengProcessActivationTest.java | 50 - .../InVmModelForDbgengRootAttacherTest.java | 37 - .../InVmModelForDbgengRootLauncherTest.java | 28 - ...VmModelForDbgengScenarioCloneExitTest.java | 29 - ...nVmModelForDbgengScenarioForkExitTest.java | 37 - .../InVmModelForDbgengScenarioMemoryTest.java | 28 - .../InVmModelForDbgengScenarioStackTest.java | 28 - ...odelForDbgengScenarioX64RegistersTest.java | 29 - ...VmModelForDbgengSessionActivationTest.java | 29 - .../invm/InVmModelForDbgengSteppableTest.java | 28 - ...nVmModelForDbgengThreadActivationTest.java | 50 - .../InVmModelForDbgengX64RegistersTest.java | 29 - .../Module.manifest | 0 .../README.md | 1 - .../build.gradle | 28 - .../certification.manifest | 4 - .../ghidra_scripts/BangAddressToMemory.java | 159 - .../ghidra_scripts/PopulateMemviewLocal.java | 283 - .../ghidra_scripts/PopulateTraceLocal.java | 406 - .../ghidra_scripts/PopulateTraceRemote.java | 173 - .../Debugger-agent-dbgmodel/Module.manifest | 0 .../Debug/Debugger-agent-dbgmodel/README.md | 1 - .../Debugger-agent-dbgmodel/build.gradle | 47 - .../certification.manifest | 6 - .../src/javaprovider/cpp/javaprovider.cpp | 224 - .../src/javaprovider/def/javaprovider.def | 13 - .../src/javaprovider/headers/afxres.h | 16 - .../src/javaprovider/headers/resource.h | 31 - .../src/javaprovider/rc/javaprovider.rc | 0 .../DbgModelInJvmDebuggerModelFactory.java | 93 - .../dbgmodel/dbgmodel/COMUtilsExtra.java | 72 - .../agent/dbgmodel/dbgmodel/DbgModel.java | 196 - .../agent/dbgmodel/dbgmodel/UnknownEx.java | 24 - .../dbgmodel/bridge/HostDataModelAccess.java | 38 - .../dbgmodel/concept/ComparableConcept.java | 26 - .../dbgmodel/dbgmodel/concept/Concept.java | 27 - .../dbgmodel/concept/DataModelConcept.java | 31 - .../DynamicConceptProviderConcept.java | 40 - .../concept/DynamicKeyProviderConcept.java | 32 - .../dbgmodel/concept/EquatableConcept.java | 27 - .../dbgmodel/concept/IndexableConcept.java | 31 - .../dbgmodel/concept/IterableConcept.java | 30 - .../concept/PreferredRuntimeTypeConcept.java | 26 - .../concept/StringDisplayableConcept.java | 28 - .../dbgmodel/datamodel/DataModelManager1.java | 84 - .../dbgmodel/datamodel/DataModelManager2.java | 36 - .../datamodel/script/DataModelNameBinder.java | 36 - .../datamodel/script/DataModelScript.java | 42 - .../script/DataModelScriptClient.java | 29 - .../script/DataModelScriptHostContext.java | 29 - .../script/DataModelScriptManager.java | 37 - .../script/DataModelScriptProvider.java | 34 - .../DataModelScriptProviderEnumerator.java | 28 - .../script/DataModelScriptTemplate.java | 30 - .../DataModelScriptTemplateEnumerator.java | 28 - .../script/debug/DataModelScriptDebug1.java | 24 - .../script/debug/DataModelScriptDebug2.java | 22 - .../debug/DataModelScriptDebugBreakpoint.java | 24 - ...aModelScriptDebugBreakpointEnumerator.java | 24 - .../debug/DataModelScriptDebugClient.java | 24 - .../debug/DataModelScriptDebugStack.java | 24 - .../debug/DataModelScriptDebugStackFrame.java | 24 - ...ModelScriptDebugVariableSetEnumerator.java | 24 - .../dbgmodel/debughost/DebugHost.java | 40 - .../dbgmodel/debughost/DebugHostBase.java | 45 - .../debughost/DebugHostBaseClass.java | 24 - .../dbgmodel/debughost/DebugHostConstant.java | 26 - .../dbgmodel/debughost/DebugHostContext.java | 26 - .../dbgmodel/debughost/DebugHostData.java | 32 - .../debughost/DebugHostErrorSink.java | 29 - .../debughost/DebugHostEvaluator1.java | 34 - .../debughost/DebugHostEvaluator2.java | 26 - .../debughost/DebugHostExtensability.java | 31 - .../dbgmodel/debughost/DebugHostField.java | 34 - .../dbgmodel/debughost/DebugHostMemory1.java | 42 - .../dbgmodel/debughost/DebugHostMemory2.java | 27 - .../dbgmodel/debughost/DebugHostModule1.java | 39 - .../dbgmodel/debughost/DebugHostModule2.java | 25 - .../debughost/DebugHostModuleSignature.java | 27 - .../dbgmodel/debughost/DebugHostPublic.java | 30 - .../debughost/DebugHostScriptHost.java | 28 - .../dbgmodel/debughost/DebugHostStatus.java | 27 - .../dbgmodel/debughost/DebugHostSymbol1.java | 37 - .../dbgmodel/debughost/DebugHostSymbol2.java | 29 - .../debughost/DebugHostSymbolEnumerator.java | 28 - .../dbgmodel/debughost/DebugHostSymbols.java | 45 - .../dbgmodel/debughost/DebugHostType1.java | 61 - .../dbgmodel/debughost/DebugHostType2.java | 33 - .../debughost/DebugHostTypeSignature.java | 32 - .../dbgmodel/dbgmodel/main/KeyEnumerator.java | 30 - .../dbgmodel/dbgmodel/main/KeyStore.java | 36 - .../dbgmodel/dbgmodel/main/ModelIterator.java | 30 - .../dbgmodel/main/ModelKeyReference1.java | 38 - .../dbgmodel/main/ModelKeyReference2.java | 24 - .../dbgmodel/dbgmodel/main/ModelMethod.java | 29 - .../dbgmodel/dbgmodel/main/ModelObject.java | 147 - .../dbgmodel/main/ModelPropertyAccessor.java | 28 - .../dbgmodel/dbgmodel/main/RawEnumerator.java | 34 - .../DbgModelGadpDebuggerModelFactory.java | 54 - .../dbgmodel/gadp/DbgModelGadpServer.java | 119 - .../gadp/DbgModelGadpServerLaunchShim.java | 37 - .../impl/DbgModelClientThreadExecutor.java | 78 - .../gadp/impl/DbgModelGadpServerImpl.java | 63 - .../dbgmodel/gadp/impl/WrappedDbgModel.java | 1066 - .../dbgmodel/DebugRunningProcessImpl.java | 66 - .../dbgmodel/impl/dbgmodel/UnknownExImpl.java | 45 - .../impl/dbgmodel/UnknownExInternal.java | 45 - .../impl/dbgmodel/bridge/HDMAUtil.java | 278 - .../bridge/HostDataModelAccessImpl.java | 105 - .../bridge/HostDataModelAccessInternal.java | 46 - .../concept/ComparableConceptImpl.java | 64 - .../concept/ComparableConceptInternal.java | 45 - .../concept/DataModelConceptImpl.java | 79 - .../concept/DataModelConceptInternal.java | 45 - .../DynamicConceptProviderConceptImpl.java | 128 - ...DynamicConceptProviderConceptInternal.java | 48 - .../DynamicKeyProviderConceptImpl.java | 101 - .../DynamicKeyProviderConceptInternal.java | 46 - .../concept/EquatableConceptImpl.java | 64 - .../concept/EquatableConceptInternal.java | 45 - .../concept/IndexableConceptImpl.java | 85 - .../concept/IndexableConceptInternal.java | 45 - .../dbgmodel/concept/IterableConceptImpl.java | 99 - .../concept/IterableConceptInternal.java | 45 - .../PreferredRuntimeTypeConceptImpl.java | 70 - .../PreferredRuntimeTypeConceptInternal.java | 46 - .../concept/StringDisplayableConceptImpl.java | 68 - .../StringDisplayableConceptInternal.java | 46 - .../datamodel/DataModelManagerImpl1.java | 341 - .../datamodel/DataModelManagerImpl2.java | 82 - .../datamodel/DataModelManagerInternal.java | 49 - .../script/DataModelNameBinderImpl.java | 136 - .../script/DataModelNameBinderInternal.java | 46 - .../script/DataModelScriptClientImpl.java | 53 - .../script/DataModelScriptClientInternal.java | 46 - .../DataModelScriptHostContextImpl.java | 67 - .../DataModelScriptHostContextInternal.java | 46 - .../datamodel/script/DataModelScriptImpl.java | 90 - .../script/DataModelScriptInternal.java | 46 - .../script/DataModelScriptManagerImpl.java | 114 - .../DataModelScriptManagerInternal.java | 46 - ...DataModelScriptProviderEnumeratorImpl.java | 68 - ...ModelScriptProviderEnumeratorInternal.java | 50 - .../script/DataModelScriptProviderImpl.java | 111 - .../DataModelScriptProviderInternal.java | 46 - ...DataModelScriptTemplateEnumeratorImpl.java | 69 - ...ModelScriptTemplateEnumeratorInternal.java | 50 - .../script/DataModelScriptTemplateImpl.java | 80 - .../DataModelScriptTemplateInternal.java | 46 - ...elScriptDebugBreakpointEnumeratorImpl.java | 103 - ...riptDebugBreakpointEnumeratorInternal.java | 53 - .../DataModelScriptDebugBreakpointImpl.java | 101 - ...ataModelScriptDebugBreakpointInternal.java | 50 - .../debug/DataModelScriptDebugClientImpl.java | 101 - .../DataModelScriptDebugClientInternal.java | 47 - .../debug/DataModelScriptDebugImpl.java | 101 - .../debug/DataModelScriptDebugImpl2.java | 98 - .../debug/DataModelScriptDebugInternal.java | 47 - .../DataModelScriptDebugStackFrameImpl.java | 101 - ...ataModelScriptDebugStackFrameInternal.java | 48 - .../debug/DataModelScriptDebugStackImpl.java | 101 - .../DataModelScriptDebugStackInternal.java | 47 - ...lScriptDebugVariableSetEnumeratorImpl.java | 103 - ...iptDebugVariableSetEnumeratorInternal.java | 54 - .../debughost/DebugHostBaseClassImpl.java | 138 - .../debughost/DebugHostBaseClassInternal.java | 47 - .../debughost/DebugHostConstantImpl.java | 47 - .../debughost/DebugHostConstantInternal.java | 46 - .../debughost/DebugHostContextImpl.java | 54 - .../debughost/DebugHostContextInternal.java | 46 - .../dbgmodel/debughost/DebugHostDataImpl.java | 62 - .../debughost/DebugHostDataInternal.java | 45 - .../debughost/DebugHostErrorSinkImpl.java | 49 - .../debughost/DebugHostErrorSinkInternal.java | 46 - .../debughost/DebugHostEvaluatorImpl1.java | 69 - .../debughost/DebugHostEvaluatorImpl2.java | 53 - .../debughost/DebugHostEvaluatorInternal.java | 51 - .../debughost/DebugHostExtensabilityImpl.java | 53 - .../DebugHostExtensabilityInternal.java | 46 - .../debughost/DebugHostFieldImpl.java | 70 - .../debughost/DebugHostFieldInternal.java | 45 - .../dbgmodel/debughost/DebugHostImpl.java | 111 - .../dbgmodel/debughost/DebugHostInternal.java | 45 - .../debughost/DebugHostMemoryImpl1.java | 119 - .../debughost/DebugHostMemoryImpl2.java | 46 - .../debughost/DebugHostMemoryInternal.java | 49 - .../debughost/DebugHostModuleImpl1.java | 149 - .../debughost/DebugHostModuleImpl2.java | 67 - .../debughost/DebugHostModuleInternal.java | 49 - .../DebugHostModuleSignatureImpl.java | 50 - .../DebugHostModuleSignatureInternal.java | 46 - .../debughost/DebugHostPublicImpl.java | 55 - .../debughost/DebugHostPublicInternal.java | 45 - .../debughost/DebugHostScriptHostImpl.java | 59 - .../DebugHostScriptHostInternal.java | 46 - .../debughost/DebugHostStatusImpl.java | 48 - .../debughost/DebugHostStatusInternal.java | 45 - .../DebugHostSymbolEnumeratorImpl.java | 72 - .../DebugHostSymbolEnumeratorInternal.java | 46 - .../debughost/DebugHostSymbolImpl1.java | 81 - .../debughost/DebugHostSymbolImpl2.java | 65 - .../debughost/DebugHostSymbolInternal.java | 49 - .../debughost/DebugHostSymbolsImpl.java | 171 - .../debughost/DebugHostSymbolsInternal.java | 45 - .../debughost/DebugHostTypeImpl1.java | 265 - .../debughost/DebugHostTypeImpl2.java | 100 - .../debughost/DebugHostTypeInternal.java | 49 - .../debughost/DebugHostTypeSignatureImpl.java | 85 - .../DebugHostTypeSignatureInternal.java | 46 - .../debughost/X_DebugHostBaseClassImpl.java | 51 - .../X_DebugHostBaseClassInternal.java | 46 - .../impl/dbgmodel/main/KeyEnumeratorImpl.java | 90 - .../dbgmodel/main/KeyEnumeratorInternal.java | 45 - .../impl/dbgmodel/main/KeyStoreImpl.java | 80 - .../impl/dbgmodel/main/KeyStoreInternal.java | 45 - .../impl/dbgmodel/main/ModelIteratorImpl.java | 83 - .../dbgmodel/main/ModelIteratorInternal.java | 45 - .../dbgmodel/main/ModelKeyReferenceImpl1.java | 117 - .../dbgmodel/main/ModelKeyReferenceImpl2.java | 45 - .../main/ModelKeyReferenceInternal.java | 49 - .../impl/dbgmodel/main/ModelMethodImpl.java | 56 - .../dbgmodel/main/ModelMethodInternal.java | 45 - .../impl/dbgmodel/main/ModelObjectImpl.java | 1023 - .../dbgmodel/main/ModelObjectInternal.java | 45 - .../main/ModelPropertyAccessorImpl.java | 73 - .../main/ModelPropertyAccessorInternal.java | 46 - .../impl/dbgmodel/main/RawEnumeratorImpl.java | 96 - .../dbgmodel/main/RawEnumeratorInternal.java | 45 - .../jna/cmd/DbgApplyMethodsCommand.java | 57 - .../jna/cmd/DbgGetRegisterMapCommand.java | 63 - .../jna/cmd/DbgListAttributesCommand.java | 80 - .../jna/cmd/DbgListElementsCommand.java | 75 - .../dbgmodel/jna/dbgmodel/DbgModelNative.java | 183 - .../dbgmodel/jna/dbgmodel/IDebugClientEx.java | 26 - .../dbgmodel/jna/dbgmodel/IUnknownEx.java | 25 - .../jna/dbgmodel/UnknownWithUtils.java | 303 - .../dbgmodel/jna/dbgmodel/WrapIUnknownEx.java | 33 - .../dbgmodel/bridge/IHostDataModelAccess.java | 42 - .../bridge/WrapIHostDataModelAccess.java | 41 - .../dbgmodel/concept/IComparableConcept.java | 44 - .../dbgmodel/concept/IDataModelConcept.java | 47 - .../IDynamicConceptProviderConcept.java | 60 - .../concept/IDynamicKeyProviderConcept.java | 52 - .../dbgmodel/concept/IEquatableConcept.java | 43 - .../dbgmodel/concept/IIndexableConcept.java | 53 - .../dbgmodel/concept/IIterableConcept.java | 48 - .../concept/IPreferredRuntimeTypeConcept.java | 43 - .../concept/IStringDisplayableConcept.java | 43 - .../concept/WrapIComparableConcept.java | 43 - .../concept/WrapIDataModelConcept.java | 48 - .../WrapIDynamicConceptProviderConcept.java | 70 - .../WrapIDynamicKeyProviderConcept.java | 55 - .../concept/WrapIEquatableConcept.java | 43 - .../concept/WrapIIndexableConcept.java | 57 - .../concept/WrapIIterableConcept.java | 48 - .../WrapIPreferredRuntimeTypeConcept.java | 44 - .../WrapIStringDisplayableConcept.java | 45 - .../datamodel/IDataModelManager1.java | 109 - .../datamodel/IDataModelManager2.java | 49 - .../datamodel/WrapIDataModelManager1.java | 159 - .../datamodel/WrapIDataModelManager2.java | 49 - .../script/IDataModelNameBinder.java | 55 - .../datamodel/script/IDataModelScript.java | 63 - .../script/IDataModelScriptClient.java | 44 - .../script/IDataModelScriptHostContext.java | 47 - .../script/IDataModelScriptManager.java | 59 - .../script/IDataModelScriptProvider.java | 55 - .../IDataModelScriptProviderEnumerator.java | 46 - .../script/IDataModelScriptTemplate.java | 49 - .../IDataModelScriptTemplateEnumerator.java | 46 - .../script/WrapIDataModelNameBinder.java | 59 - .../script/WrapIDataModelScript.java | 71 - .../script/WrapIDataModelScriptClient.java | 43 - .../WrapIDataModelScriptHostContext.java | 49 - .../script/WrapIDataModelScriptManager.java | 70 - .../script/WrapIDataModelScriptProvider.java | 64 - ...rapIDataModelScriptProviderEnumerator.java | 48 - .../script/WrapIDataModelScriptTemplate.java | 54 - ...rapIDataModelScriptTemplateEnumerator.java | 48 - .../script/debug/IDataModelScriptDebug.java | 75 - .../script/debug/IDataModelScriptDebug2.java | 42 - .../IDataModelScriptDebugBreakpoint.java | 59 - ...aModelScriptDebugBreakpointEnumerator.java | 46 - .../debug/IDataModelScriptDebugClient.java | 43 - .../debug/IDataModelScriptDebugStack.java | 46 - .../IDataModelScriptDebugStackFrame.java | 66 - ...ModelScriptDebugVariableSetEnumerator.java | 48 - .../debug/WrapIDataModelScriptDebug.java | 98 - .../debug/WrapIDataModelScriptDebug2.java | 41 - .../WrapIDataModelScriptDebugBreakpoint.java | 66 - ...aModelScriptDebugBreakpointEnumerator.java | 48 - .../WrapIDataModelScriptDebugClient.java | 44 - .../debug/WrapIDataModelScriptDebugStack.java | 49 - .../WrapIDataModelScriptDebugStackFrame.java | 77 - ...ModelScriptDebugVariableSetEnumerator.java | 51 - .../jna/dbgmodel/debughost/IDebugHost.java | 47 - .../debughost/IDebugHostBaseClass.java | 63 - .../debughost/IDebugHostConstant.java | 41 - .../dbgmodel/debughost/IDebugHostContext.java | 43 - .../dbgmodel/debughost/IDebugHostData.java | 49 - .../debughost/IDebugHostErrorSink.java | 43 - .../debughost/IDebugHostEvaluator1.java | 49 - .../debughost/IDebugHostEvaluator2.java | 43 - .../debughost/IDebugHostExtensability.java | 46 - .../dbgmodel/debughost/IDebugHostField.java | 53 - .../dbgmodel/debughost/IDebugHostMemory1.java | 64 - .../dbgmodel/debughost/IDebugHostMemory2.java | 43 - .../dbgmodel/debughost/IDebugHostModule1.java | 60 - .../dbgmodel/debughost/IDebugHostModule2.java | 44 - .../debughost/IDebugHostModuleSignature.java | 43 - .../dbgmodel/debughost/IDebugHostPublic.java | 45 - .../debughost/IDebugHostScriptHost.java | 43 - .../dbgmodel/debughost/IDebugHostStatus.java | 42 - .../dbgmodel/debughost/IDebugHostSymbol1.java | 44 - .../dbgmodel/debughost/IDebugHostSymbol2.java | 48 - .../debughost/IDebugHostSymbolEnumerator.java | 45 - .../dbgmodel/debughost/IDebugHostSymbols.java | 68 - .../dbgmodel/debughost/IDebugHostType1.java | 99 - .../dbgmodel/debughost/IDebugHostType2.java | 55 - .../debughost/IDebugHostTypeSignature.java | 50 - .../dbgmodel/debughost/WrapIDebugHost.java | 51 - .../debughost/WrapIDebugHostBaseClass.java | 73 - .../debughost/WrapIDebugHostConstant.java | 40 - .../debughost/WrapIDebugHostContext.java | 41 - .../debughost/WrapIDebugHostData.java | 52 - .../debughost/WrapIDebugHostErrorSink.java | 40 - .../debughost/WrapIDebugHostEvaluator1.java | 50 - .../debughost/WrapIDebugHostEvaluator2.java | 43 - .../WrapIDebugHostExtensability.java | 46 - .../debughost/WrapIDebugHostField.java | 58 - .../debughost/WrapIDebugHostMemory1.java | 79 - .../debughost/WrapIDebugHostMemory2.java | 42 - .../debughost/WrapIDebugHostModule1.java | 68 - .../debughost/WrapIDebugHostModule2.java | 43 - .../WrapIDebugHostModuleSignature.java | 43 - .../debughost/WrapIDebugHostPublic.java | 46 - .../debughost/WrapIDebugHostScriptHost.java | 42 - .../debughost/WrapIDebugHostStatus.java | 41 - .../debughost/WrapIDebugHostSymbol1.java | 42 - .../debughost/WrapIDebugHostSymbol2.java | 49 - .../WrapIDebugHostSymbolEnumerator.java | 48 - .../debughost/WrapIDebugHostSymbols.java | 83 - .../debughost/WrapIDebugHostType1.java | 136 - .../debughost/WrapIDebugHostType2.java | 62 - .../WrapIDebugHostTypeSignature.java | 56 - .../debughost/X_IDebugHostBaseClass.java | 40 - .../debughost/X_WrapIDebugHostBaseClass.java | 41 - .../jna/dbgmodel/main/IKeyEnumerator.java | 46 - .../dbgmodel/jna/dbgmodel/main/IKeyStore.java | 56 - .../jna/dbgmodel/main/IModelIterator.java | 47 - .../jna/dbgmodel/main/IModelKeyReference.java | 62 - .../dbgmodel/main/IModelKeyReference2.java | 41 - .../jna/dbgmodel/main/IModelMethod.java | 45 - .../jna/dbgmodel/main/IModelObject.java | 150 - .../dbgmodel/main/IModelPropertyAccessor.java | 47 - .../jna/dbgmodel/main/IRawEnumerator.java | 47 - .../jna/dbgmodel/main/WrapIKeyEnumerator.java | 48 - .../jna/dbgmodel/main/WrapIKeyStore.java | 61 - .../jna/dbgmodel/main/WrapIModelIterator.java | 49 - .../main/WrapIModelKeyReference1.java | 73 - .../main/WrapIModelKeyReference2.java | 40 - .../jna/dbgmodel/main/WrapIModelMethod.java | 44 - .../jna/dbgmodel/main/WrapIModelObject.java | 220 - .../main/WrapIModelPropertyAccessor.java | 46 - .../jna/dbgmodel/main/WrapIRawEnumerator.java | 48 - .../jna/javaprovider/JavaProviderNative.java | 25 - .../dbgmodel/manager/DbgManager2Impl.java | 138 - .../impl/DbgModel2DefaultTargetModelRoot.java | 32 - .../dbgmodel/model/impl/DbgModel2Impl.java | 211 - ...DbgModel2TargetAvailableContainerImpl.java | 69 - .../impl/DbgModel2TargetAvailableImpl.java | 74 - .../model/impl/DbgModel2TargetObjectImpl.java | 592 - .../model/impl/DbgModel2TargetProxy.java | 25 - .../model/impl/DbgModel2TargetRootImpl.java | 648 - .../impl/DbgModel2TargetSystemMarkerImpl.java | 41 - .../impl/DelegateDbgModel2TargetObject.java | 469 - .../dbgmodel/model/impl/dbgmodel_schema.xml | 625 - .../src/sctldbg/cpp/sctldbg.cpp | 316 - .../dbgmodel/DbgModelSetContextMWETest.java | 332 - .../agent/dbgmodel/dbgmodel/DbgModelTest.java | 1132 - .../NoisyDebugEventCallbacksAdapter.java | 118 - .../agent/dbgmodel/dbgmodel/ProcMaker.java | 116 - .../model/invm/InVmDbgmodelModelHost.java | 29 - .../InVmModelForDbgmodelBreakpointsTest.java | 37 - .../invm/InVmModelForDbgmodelFactoryTest.java | 51 - ...VmModelForDbgmodelFrameActivationTest.java | 38 - .../InVmModelForDbgmodelInterpreterTest.java | 89 - ...ModelForDbgmodelProcessActivationTest.java | 67 - .../InVmModelForDbgmodelRootAttacherTest.java | 37 - .../InVmModelForDbgmodelRootLauncherTest.java | 28 - ...ModelForDbgmodelScenarioCloneExitTest.java | 29 - ...mModelForDbgmodelScenarioForkExitTest.java | 37 - ...nVmModelForDbgmodelScenarioMemoryTest.java | 49 - ...InVmModelForDbgmodelScenarioStackTest.java | 38 - ...elForDbgmodelScenarioX64RegistersTest.java | 30 - ...ModelForDbgmodelSessionActivationTest.java | 29 - .../InVmModelForDbgmodelSteppableTest.java | 29 - ...mModelForDbgmodelThreadActivationTest.java | 68 - .../InVmModelForDbgmodelX64RegistersTest.java | 60 - .../Debugger-agent-frida/Module.manifest | 0 Ghidra/Debug/Debugger-agent-frida/README.md | 58 - .../Debug/Debugger-agent-frida/build.gradle | 55 - .../certification.manifest | 12 - .../data/scripts/onAccess.js | 5 - .../data/scripts/onAccessExt.js | 18 - .../data/scripts/onCallSummary.js | 1 - .../data/scripts/onEnter.js | 2 - .../data/scripts/onLeave.js | 2 - .../data/scripts/onReceive.js | 1 - .../ghidra_scripts/FridaTestScript.java | 24 - .../src/main/cpp/ghidra_wrapper.c | 216 - .../frida/FridaInJvmDebuggerModelFactory.java | 55 - .../java/agent/frida/frida/FridaClient.java | 397 - .../agent/frida/frida/FridaClientImpl.java | 228 - .../frida/frida/FridaClientReentrant.java | 31 - .../main/java/agent/frida/frida/FridaEng.java | 351 - .../agent/frida/frida/FridaModuleInfo.java | 84 - .../agent/frida/frida/FridaProcessInfo.java | 43 - .../agent/frida/frida/FridaRegionInfo.java | 76 - .../java/agent/frida/frida/FridaServerId.java | 58 - .../agent/frida/frida/FridaSessionInfo.java | 40 - .../agent/frida/frida/FridaThreadInfo.java | 41 - .../gadp/FridaGadpDebuggerModelFactory.java | 63 - .../agent/frida/gadp/FridaGadpServer.java | 192 - .../impl/AbstractClientThreadExecutor.java | 199 - .../gadp/impl/FridaClientThreadExecutor.java | 64 - .../frida/gadp/impl/FridaGadpServerImpl.java | 64 - .../java/agent/frida/jna/FridaNative.java | 338 - .../agent/frida/manager/FridaApplication.java | 52 - .../java/agent/frida/manager/FridaCause.java | 33 - .../agent/frida/manager/FridaCommand.java | 82 - .../agent/frida/manager/FridaContext.java | 42 - .../agent/frida/manager/FridaDebugger.java | 26 - .../java/agent/frida/manager/FridaError.java | 45 - .../java/agent/frida/manager/FridaEvent.java | 63 - .../frida/manager/FridaEventsListener.java | 224 - .../manager/FridaEventsListenerAdapter.java | 146 - .../java/agent/frida/manager/FridaExport.java | 57 - .../agent/frida/manager/FridaFileSpec.java | 62 - .../java/agent/frida/manager/FridaFrame.java | 66 - .../agent/frida/manager/FridaFunction.java | 68 - .../java/agent/frida/manager/FridaImport.java | 75 - .../manager/FridaKernelMemoryRegionInfo.java | 36 - .../frida/manager/FridaKernelModule.java | 28 - .../agent/frida/manager/FridaManager.java | 405 - .../frida/manager/FridaMemoryRegionInfo.java | 99 - .../java/agent/frida/manager/FridaModule.java | 66 - .../java/agent/frida/manager/FridaOS.java | 43 - .../agent/frida/manager/FridaPointer.java | 35 - .../agent/frida/manager/FridaProcess.java | 96 - .../java/agent/frida/manager/FridaReason.java | 44 - .../java/agent/frida/manager/FridaScript.java | 37 - .../agent/frida/manager/FridaSection.java | 98 - .../agent/frida/manager/FridaSession.java | 75 - .../java/agent/frida/manager/FridaState.java | 55 - .../frida/manager/FridaStateListener.java | 36 - .../java/agent/frida/manager/FridaSymbol.java | 84 - .../java/agent/frida/manager/FridaTarget.java | 88 - .../java/agent/frida/manager/FridaThread.java | 61 - .../java/agent/frida/manager/FridaValue.java | 47 - .../manager/cmd/AbstractFridaCommand.java | 158 - .../manager/cmd/AbstractFridaReadCommand.java | 59 - .../manager/cmd/FridaAddProcessCommand.java | 37 - .../manager/cmd/FridaAddSessionCommand.java | 37 - .../frida/manager/cmd/FridaAttachCommand.java | 91 - .../cmd/FridaAttachDeviceByIdCommand.java | 52 - .../cmd/FridaAttachDeviceByTypeCommand.java | 52 - .../frida/manager/cmd/FridaCommandError.java | 59 - .../manager/cmd/FridaConsoleExecCommand.java | 81 - .../manager/cmd/FridaContinueCommand.java | 72 - .../manager/cmd/FridaDestroyCommand.java | 38 - .../frida/manager/cmd/FridaDetachCommand.java | 60 - .../cmd/FridaGetSessionAttributesCommand.java | 69 - .../cmd/FridaInterceptFunctionCommand.java | 70 - .../frida/manager/cmd/FridaKillCommand.java | 39 - .../cmd/FridaLaunchProcessCommand.java | 88 - .../FridaLaunchProcessWithOptionsCommand.java | 124 - .../cmd/FridaListAvailableDevicesCommand.java | 53 - .../FridaListAvailableProcessesCommand.java | 51 - .../FridaListHeapMemoryRegionsCommand.java | 63 - .../FridaListKernelMemoryRegionsCommand.java | 53 - .../cmd/FridaListKernelModulesCommand.java | 53 - .../cmd/FridaListMemoryRegionsCommand.java | 62 - .../cmd/FridaListModuleExportsCommand.java | 63 - .../cmd/FridaListModuleImportsCommand.java | 68 - .../cmd/FridaListModuleSectionsCommand.java | 69 - .../cmd/FridaListModuleSymbolsCommand.java | 70 - .../manager/cmd/FridaListModulesCommand.java | 57 - .../cmd/FridaListProcessesCommand.java | 63 - .../cmd/FridaListRegistersCommand.java | 45 - .../manager/cmd/FridaListSessionsCommand.java | 61 - .../cmd/FridaListStackFramesCommand.java | 62 - .../manager/cmd/FridaListThreadsCommand.java | 62 - .../manager/cmd/FridaPendingCommand.java | 211 - .../cmd/FridaReadKernelMemoryCommand.java | 37 - .../manager/cmd/FridaReadMemoryCommand.java | 36 - .../cmd/FridaRemoveProcessCommand.java | 35 - .../FridaRepeatableWatchMemoryCommand.java | 65 - .../cmd/FridaRequestActivationCommand.java | 46 - .../manager/cmd/FridaRequestFocusCommand.java | 45 - .../cmd/FridaSetExceptionHandlerCommand.java | 37 - .../manager/cmd/FridaStalkThreadCommand.java | 75 - .../manager/cmd/FridaWatchMemoryCommand.java | 68 - .../cmd/FridaWriteKernelMemoryCommand.java | 51 - .../manager/cmd/FridaWriteMemoryCommand.java | 51 - .../AbstractFridaCompletedCommandEvent.java | 34 - .../frida/manager/evt/AbstractFridaEvent.java | 84 - .../manager/evt/FridaCommandDoneEvent.java | 46 - .../manager/evt/FridaCommandErrorEvent.java | 45 - .../manager/evt/FridaConsoleOutputEvent.java | 41 - .../manager/evt/FridaInterruptEvent.java | 26 - .../evt/FridaMemoryRegionAddedEvent.java | 28 - .../evt/FridaMemoryRegionRemovedEvent.java | 28 - .../evt/FridaMemoryRegionReplacedEvent.java | 28 - .../manager/evt/FridaModuleLoadedEvent.java | 28 - .../manager/evt/FridaModuleReplacedEvent.java | 28 - .../manager/evt/FridaModuleUnloadedEvent.java | 28 - .../manager/evt/FridaProcessCreatedEvent.java | 32 - .../manager/evt/FridaProcessExitedEvent.java | 31 - .../evt/FridaProcessReplacedEvent.java | 38 - .../evt/FridaProcessSelectedEvent.java | 44 - .../frida/manager/evt/FridaRunningEvent.java | 49 - .../evt/FridaSelectedFrameChangedEvent.java | 62 - .../manager/evt/FridaSessionCreatedEvent.java | 25 - .../manager/evt/FridaSessionExitedEvent.java | 36 - .../evt/FridaSessionReplacedEvent.java | 26 - .../evt/FridaSessionSelectedEvent.java | 49 - .../manager/evt/FridaStateChangedEvent.java | 53 - .../frida/manager/evt/FridaStoppedEvent.java | 60 - .../manager/evt/FridaThreadCreatedEvent.java | 26 - .../manager/evt/FridaThreadExitedEvent.java | 24 - .../manager/evt/FridaThreadReplacedEvent.java | 26 - .../manager/evt/FridaThreadResumedEvent.java | 28 - .../manager/evt/FridaThreadSelectedEvent.java | 62 - .../evt/FridaThreadStackChangedEvent.java | 28 - .../evt/FridaThreadSuspendedEvent.java | 28 - .../frida/manager/impl/FridaManagerImpl.java | 1322 - .../agent/frida/model/AbstractFridaModel.java | 45 - .../iface1/FridaModelSelectableObject.java | 35 - .../FridaModelTargetAccessConditioned.java | 36 - .../iface1/FridaModelTargetActiveScope.java | 68 - .../iface1/FridaModelTargetAttachable.java | 32 - .../iface1/FridaModelTargetAttacher.java | 40 - .../iface1/FridaModelTargetConfigurable.java | 28 - .../iface1/FridaModelTargetDeletable.java | 35 - .../iface1/FridaModelTargetDetachable.java | 35 - .../iface1/FridaModelTargetEnvironment.java | 38 - .../iface1/FridaModelTargetEventScope.java | 28 - .../FridaModelTargetExecutionStateful.java | 44 - .../iface1/FridaModelTargetFocusScope.java | 78 - .../iface1/FridaModelTargetInterpreter.java | 44 - .../iface1/FridaModelTargetKillable.java | 37 - .../iface1/FridaModelTargetLauncher.java | 36 - .../model/iface1/FridaModelTargetMethod.java | 28 - .../iface1/FridaModelTargetResumable.java | 35 - .../iface1/FridaModelTargetSteppable.java | 30 - .../FridaModelTargetAvailableDevice.java | 27 - ...aModelTargetAvailableDevicesContainer.java | 22 - .../FridaModelTargetAvailableProcess.java | 27 - ...odelTargetAvailableProcessesContainer.java | 22 - .../iface2/FridaModelTargetConnector.java | 41 - .../FridaModelTargetConnectorContainer.java | 22 - .../model/iface2/FridaModelTargetExport.java | 28 - .../FridaModelTargetExportContainer.java | 26 - .../iface2/FridaModelTargetFileSpec.java | 22 - .../iface2/FridaModelTargetFunction.java | 20 - .../model/iface2/FridaModelTargetImport.java | 29 - .../FridaModelTargetImportContainer.java | 26 - .../FridaModelTargetMemoryContainer.java | 42 - .../iface2/FridaModelTargetMemoryRegion.java | 35 - .../model/iface2/FridaModelTargetModule.java | 73 - .../FridaModelTargetModuleContainer.java | 42 - .../iface2/FridaModelTargetModuleSection.java | 26 - ...ridaModelTargetModuleSectionContainer.java | 23 - .../model/iface2/FridaModelTargetObject.java | 83 - .../model/iface2/FridaModelTargetProcess.java | 55 - .../FridaModelTargetProcessContainer.java | 28 - .../iface2/FridaModelTargetRegister.java | 37 - .../iface2/FridaModelTargetRegisterBank.java | 61 - .../FridaModelTargetRegisterContainer.java | 23 - ...daModelTargetRegisterContainerAndBank.java | 31 - .../model/iface2/FridaModelTargetRoot.java | 35 - .../model/iface2/FridaModelTargetSession.java | 63 - .../FridaModelTargetSessionAttributes.java | 25 - ...delTargetSessionAttributesEnvironment.java | 24 - ...aModelTargetSessionAttributesPlatform.java | 24 - .../FridaModelTargetSessionContainer.java | 36 - .../model/iface2/FridaModelTargetStack.java | 26 - .../iface2/FridaModelTargetStackFrame.java | 102 - .../FridaModelTargetStackFrameRegister.java | 50 - ...ridaModelTargetStackFrameRegisterBank.java | 40 - ...odelTargetStackFrameRegisterContainer.java | 47 - .../model/iface2/FridaModelTargetSymbol.java | 31 - .../FridaModelTargetSymbolContainer.java | 27 - .../model/iface2/FridaModelTargetThread.java | 57 - .../FridaModelTargetThreadContainer.java | 33 - .../FridaModelDefaultTargetModelRoot.java | 33 - .../frida/model/impl/FridaModelImpl.java | 185 - .../FridaModelTargetAvailableDeviceImpl.java | 85 - ...elTargetAvailableDevicesContainerImpl.java | 102 - .../FridaModelTargetAvailableProcessImpl.java | 91 - ...TargetAvailableProcessesContainerImpl.java | 102 - ...ridaModelTargetConnectorContainerImpl.java | 106 - ...elTargetDeviceAttachByIdConnectorImpl.java | 86 - ...TargetDeviceAttachByTypeConnectorImpl.java | 93 - .../FridaModelTargetExportContainerImpl.java | 74 - .../impl/FridaModelTargetExportImpl.java | 101 - .../impl/FridaModelTargetFileSpecImpl.java | 62 - .../impl/FridaModelTargetFunctionImpl.java | 64 - ...idaModelTargetHeapMemoryContainerImpl.java | 46 - .../FridaModelTargetImportContainerImpl.java | 74 - .../impl/FridaModelTargetImportImpl.java | 113 - .../impl/FridaModelTargetKernelImpl.java | 70 - ...aModelTargetKernelMemoryContainerImpl.java | 202 - ...aModelTargetKernelModuleContainerImpl.java | 125 - .../FridaModelTargetKernelModuleImpl.java | 103 - .../FridaModelTargetMemoryContainerImpl.java | 221 - .../FridaModelTargetMemoryRegionImpl.java | 136 - .../FridaModelTargetModuleContainerImpl.java | 142 - .../impl/FridaModelTargetModuleImpl.java | 146 - ...ModelTargetModuleSectionContainerImpl.java | 108 - .../FridaModelTargetModuleSectionImpl.java | 99 - .../impl/FridaModelTargetObjectImpl.java | 264 - ...TargetProcessAttachByPidConnectorImpl.java | 86 - .../FridaModelTargetProcessContainerImpl.java | 150 - .../impl/FridaModelTargetProcessImpl.java | 272 - ...ModelTargetProcessLaunchConnectorImpl.java | 97 - ...ProcessLaunchWithOptionsConnectorImpl.java | 160 - ...FridaModelTargetRegisterContainerImpl.java | 153 - .../impl/FridaModelTargetRegisterImpl.java | 123 - .../model/impl/FridaModelTargetRootImpl.java | 184 - ...argetSessionAttributesEnvironmentImpl.java | 58 - ...FridaModelTargetSessionAttributesImpl.java | 71 - ...elTargetSessionAttributesPlatformImpl.java | 58 - .../FridaModelTargetSessionContainerImpl.java | 94 - .../impl/FridaModelTargetSessionImpl.java | 147 - .../impl/FridaModelTargetStackFrameImpl.java | 182 - .../model/impl/FridaModelTargetStackImpl.java | 101 - .../FridaModelTargetSymbolContainerImpl.java | 88 - .../impl/FridaModelTargetSymbolImpl.java | 122 - .../FridaModelTargetThreadContainerImpl.java | 176 - .../impl/FridaModelTargetThreadImpl.java | 196 - ...idaModelTargetFunctionInterceptorImpl.java | 88 - .../FridaModelTargetMemoryPatchImpl.java | 78 - .../FridaModelTargetMemoryProtectImpl.java | 77 - .../FridaModelTargetMemoryScanImpl.java | 100 - .../FridaModelTargetMemoryWatchImpl.java | 77 - .../FridaModelTargetModuleInitImpl.java | 66 - ...FridaModelTargetModuleInterceptorImpl.java | 81 - .../FridaModelTargetModuleLoadImpl.java | 66 - ...FridaModelTargetSymbolFromAddressImpl.java | 70 - .../FridaModelTargetSymbolFromNameImpl.java | 67 - .../FridaModelTargetSymbolLoadImpl.java | 66 - .../FridaModelTargetThreadSleepImpl.java | 66 - .../FridaModelTargetThreadStalkImpl.java | 116 - .../FridaModelTargetUnloadScriptImpl.java | 71 - .../src/main/sh/execjar.sh | 22 - .../frida/model/AbstractFridaModelHost.java | 27 - .../AbstractModelForFridaActivationTest.java | 127 - .../AbstractModelForFridaFactoryTest.java | 73 - .../AbstractModelForFridaInterpreterTest.java | 101 - .../AbstractModelForFridaMethodsTest.java | 301 - ...AbstractModelForFridaRootAttacherTest.java | 164 - ...AbstractModelForFridaRootLauncherTest.java | 130 - ...bstractModelForFridaScenarioStackTest.java | 143 - ...AbstractModelForFridaX64RegistersTest.java | 186 - .../agent/frida/model/FridaLinuxSpecimen.java | 126 - .../frida/model/gadp/GadpFridaModelHost.java | 31 - .../gadp/GadpModelForFridaFactoryTest.java | 28 - .../GadpModelForFridaInterpreterTest.java | 64 - .../GadpModelForFridaRootLauncherTest.java | 28 - .../GadpModelForFridaScenarioStackTest.java | 28 - .../GadpModelForFridaX64RegistersTest.java | 30 - .../frida/model/invm/InVmFridaModelHost.java | 27 - .../invm/InVmModelForFridaFactoryTest.java | 31 - .../InVmModelForFridaInterpreterTest.java | 67 - .../invm/InVmModelForFridaMethodsTest.java | 31 - .../InVmModelForFridaRootAttacherTest.java | 44 - .../InVmModelForFridaRootLauncherTest.java | 31 - .../InVmModelForFridaScenarioStackTest.java | 31 - .../InVmModelForFridaX64RegistersTest.java | 33 - Ghidra/Debug/Debugger-agent-gdb/build.gradle | 32 +- .../main/java/agent/gdb/GdbCompatibility.java | 51 - .../gdb/GdbInJvmDebuggerModelFactory.java | 109 - .../gdb/GdbOverSshDebuggerModelFactory.java | 164 - .../gdb/gadp/GdbGadpDebuggerModelFactory.java | 103 - .../java/agent/gdb/gadp/GdbGadpServer.java | 211 - .../gdb/gadp/GdbGadpServerLaunchShim.java | 37 - .../gdb/gadp/impl/GdbGadpServerImpl.java | 68 - .../main/java/agent/gdb/manager/GdbCause.java | 36 - .../gdb/manager/GdbConsoleOperations.java | 70 - .../gdb/manager/GdbConsoleOutputListener.java | 28 - .../gdb/manager/GdbContextualOperations.java | 50 - .../agent/gdb/manager/GdbEventsListener.java | 197 - .../gdb/manager/GdbEventsListenerAdapter.java | 99 - .../java/agent/gdb/manager/GdbInferior.java | 328 - .../gdb/manager/GdbInferiorThreadGroup.java | 54 - .../java/agent/gdb/manager/GdbLibraryId.java | 27 - .../java/agent/gdb/manager/GdbManager.java | 518 - .../gdb/manager/GdbMemoryOperations.java | 70 - .../java/agent/gdb/manager/GdbModule.java | 35 - .../agent/gdb/manager/GdbModuleSection.java | 30 - .../gdb/manager/GdbProcessThreadGroup.java | 50 - .../java/agent/gdb/manager/GdbRegister.java | 77 - .../agent/gdb/manager/GdbRegisterSet.java | 73 - .../java/agent/gdb/manager/GdbStackFrame.java | 73 - .../main/java/agent/gdb/manager/GdbState.java | 79 - .../agent/gdb/manager/GdbStateListener.java | 36 - .../main/java/agent/gdb/manager/GdbTable.java | 320 - .../gdb/manager/GdbTargetOutputListener.java | 31 - .../java/agent/gdb/manager/GdbThread.java | 172 - .../manager/breakpoint/GdbBreakpointDisp.java | 68 - .../manager/breakpoint/GdbBreakpointInfo.java | 403 - .../breakpoint/GdbBreakpointInsertions.java | 78 - .../breakpoint/GdbBreakpointLocation.java | 145 - .../manager/breakpoint/GdbBreakpointType.java | 92 - .../evt/AbstractGdbCompletedCommandEvent.java | 65 - .../gdb/manager/evt/AbstractGdbEvent.java | 99 - .../evt/AbstractGdbEventWithFields.java | 50 - .../evt/AbstractGdbEventWithStateChange.java | 53 - .../evt/AbstractGdbEventWithString.java | 49 - .../manager/evt/AbstractGdbLibraryEvent.java | 102 - .../manager/evt/AbstractGdbOutputEvent.java | 71 - .../manager/evt/AbstractGdbThreadEvent.java | 60 - .../evt/AbstractGdbThreadGroupEvent.java | 49 - .../evt/GdbBreakpointCreatedEvent.java | 50 - .../evt/GdbBreakpointDeletedEvent.java | 48 - .../evt/GdbBreakpointModifiedEvent.java | 48 - .../manager/evt/GdbCommandConnectedEvent.java | 34 - .../gdb/manager/evt/GdbCommandDoneEvent.java | 227 - .../gdb/manager/evt/GdbCommandEchoEvent.java | 43 - .../evt/GdbCommandEchoInterruptEvent.java | 46 - .../gdb/manager/evt/GdbCommandErrorEvent.java | 55 - .../gdb/manager/evt/GdbCommandExitEvent.java | 40 - .../manager/evt/GdbCommandRunningEvent.java | 48 - .../manager/evt/GdbConsoleOutputEvent.java | 55 - .../gdb/manager/evt/GdbDebugOutputEvent.java | 34 - .../manager/evt/GdbLibraryLoadedEvent.java | 37 - .../manager/evt/GdbLibraryUnloadedEvent.java | 37 - .../manager/evt/GdbMemoryChangedEvent.java | 71 - .../gdb/manager/evt/GdbParamChangedEvent.java | 59 - .../gdb/manager/evt/GdbRunningEvent.java | 49 - .../gdb/manager/evt/GdbStoppedEvent.java | 77 - .../gdb/manager/evt/GdbTargetOutputEvent.java | 34 - .../manager/evt/GdbThreadCreatedEvent.java | 36 - .../gdb/manager/evt/GdbThreadExitedEvent.java | 36 - .../manager/evt/GdbThreadGroupAddedEvent.java | 36 - .../evt/GdbThreadGroupExitedEvent.java | 63 - .../evt/GdbThreadGroupRemovedEvent.java | 36 - .../evt/GdbThreadGroupStartedEvent.java | 48 - .../manager/evt/GdbThreadSelectedEvent.java | 62 - .../agent/gdb/manager/impl/GdbCommand.java | 128 - .../java/agent/gdb/manager/impl/GdbEvent.java | 69 - .../agent/gdb/manager/impl/GdbFrameInfo.java | 116 - .../gdb/manager/impl/GdbInferiorImpl.java | 520 - .../gdb/manager/impl/GdbManagerImpl.java | 1928 - .../gdb/manager/impl/GdbMemoryMapping.java | 153 - .../gdb/manager/impl/GdbMinimalSymbol.java | 48 - .../agent/gdb/manager/impl/GdbModuleImpl.java | 197 - .../manager/impl/GdbModuleSectionImpl.java | 62 - .../gdb/manager/impl/GdbPendingCommand.java | 245 - .../gdb/manager/impl/GdbStackFrameImpl.java | 176 - .../agent/gdb/manager/impl/GdbThreadImpl.java | 319 - .../agent/gdb/manager/impl/GdbThreadInfo.java | 165 - .../manager/impl/cmd/AbstractGdbCommand.java | 105 - ...bstractGdbCommandWithThreadAndFrameId.java | 82 - .../cmd/AbstractGdbCommandWithThreadId.java | 78 - .../impl/cmd/AbstractLaunchGdbCommand.java | 59 - .../impl/cmd/GdbAddInferiorCommand.java | 43 - .../manager/impl/cmd/GdbAttachCommand.java | 66 - .../gdb/manager/impl/cmd/GdbClaimStopped.java | 60 - .../gdb/manager/impl/cmd/GdbCommandError.java | 55 - .../impl/cmd/GdbConsoleExecCommand.java | 180 - .../manager/impl/cmd/GdbContinueCommand.java | 54 - .../impl/cmd/GdbDeleteBreakpointsCommand.java | 62 - .../manager/impl/cmd/GdbDetachCommand.java | 69 - .../cmd/GdbDisableBreakpointsCommand.java | 61 - .../impl/cmd/GdbEnableBreakpointsCommand.java | 61 - .../manager/impl/cmd/GdbEvaluateCommand.java | 52 - .../cmd/GdbFileExecAndSymbolsCommand.java | 47 - .../impl/cmd/GdbGetThreadInfoCommand.java | 49 - .../manager/impl/cmd/GdbGetVarCommand.java | 44 - .../impl/cmd/GdbInferiorSelectCommand.java | 68 - .../manager/impl/cmd/GdbInfoOsCommand.java | 45 - .../impl/cmd/GdbInsertBreakpointCommand.java | 97 - .../gdb/manager/impl/cmd/GdbKillCommand.java | 55 - .../cmd/GdbListAvailableProcessesCommand.java | 42 - .../impl/cmd/GdbListBreakpointsCommand.java | 82 - .../impl/cmd/GdbListInferiorsCommand.java | 67 - .../impl/cmd/GdbListRegisterNamesCommand.java | 44 - .../impl/cmd/GdbListThreadsCommand.java | 64 - .../impl/cmd/GdbReadMemoryCommand.java | 82 - .../impl/cmd/GdbReadRegistersCommand.java | 217 - .../impl/cmd/GdbRemoveInferiorCommand.java | 52 - .../gdb/manager/impl/cmd/GdbRunCommand.java | 43 - .../impl/cmd/GdbSetActiveFrameCommand.java | 67 - .../impl/cmd/GdbSetActiveThreadCommand.java | 66 - .../impl/cmd/GdbSetInferiorTtyCommand.java | 44 - .../manager/impl/cmd/GdbSetVarCommand.java | 46 - .../impl/cmd/GdbStackListFramesCommand.java | 51 - .../gdb/manager/impl/cmd/GdbStartCommand.java | 43 - .../impl/cmd/GdbStartInstructionCommand.java | 43 - .../impl/cmd/GdbStateChangeRecord.java | 108 - .../gdb/manager/impl/cmd/GdbStepCommand.java | 58 - .../impl/cmd/GdbWriteMemoryCommand.java | 66 - .../impl/cmd/GdbWriteRegistersCommand.java | 130 - .../impl/cmd/MixinResumeInCliGdbCommand.java | 93 - .../gdb/manager/parsing/GdbCValueParser.java | 328 - .../gdb/manager/parsing/GdbMiParser.java | 486 - .../gdb/manager/parsing/GdbParsingUtils.java | 175 - .../reason/GdbBreakpointHitReason.java | 77 - .../reason/GdbEndSteppingRangeReason.java | 32 - .../manager/reason/GdbExitNormallyReason.java | 33 - .../gdb/manager/reason/GdbExitedReason.java | 47 - .../agent/gdb/manager/reason/GdbReason.java | 91 - .../reason/GdbSignalReceivedReason.java | 43 - .../agent/gdb/model/impl/GdbModelImpl.java | 209 - .../gdb/model/impl/GdbModelImplUtils.java | 56 - .../model/impl/GdbModelSelectableObject.java | 30 - .../model/impl/GdbModelTargetAttachable.java | 87 - .../GdbModelTargetAvailableContainer.java | 92 - .../GdbModelTargetBreakpointContainer.java | 194 - .../GdbModelTargetBreakpointLocation.java | 186 - ...odelTargetBreakpointLocationContainer.java | 55 - .../impl/GdbModelTargetBreakpointSpec.java | 292 - .../model/impl/GdbModelTargetEnvironment.java | 217 - .../model/impl/GdbModelTargetInferior.java | 480 - .../impl/GdbModelTargetInferiorContainer.java | 192 - .../impl/GdbModelTargetMemoryRegion.java | 154 - .../gdb/model/impl/GdbModelTargetModule.java | 148 - .../impl/GdbModelTargetModuleContainer.java | 141 - .../impl/GdbModelTargetProcessMemory.java | 228 - .../model/impl/GdbModelTargetRegister.java | 86 - .../impl/GdbModelTargetRegisterContainer.java | 107 - .../gdb/model/impl/GdbModelTargetSection.java | 100 - .../impl/GdbModelTargetSectionContainer.java | 79 - .../gdb/model/impl/GdbModelTargetSession.java | 361 - .../gdb/model/impl/GdbModelTargetStack.java | 107 - .../model/impl/GdbModelTargetStackFrame.java | 141 - .../GdbModelTargetStackFrameRegister.java | 92 - ...odelTargetStackFrameRegisterContainer.java | 200 - .../gdb/model/impl/GdbModelTargetSymbol.java | 85 - .../impl/GdbModelTargetSymbolContainer.java | 72 - .../gdb/model/impl/GdbModelTargetThread.java | 273 - .../impl/GdbModelTargetThreadContainer.java | 190 - .../java/agent/gdb/manager/GdbTableTest.java | 175 - .../manager/impl/AbstractGdbManagerTest.java | 478 - .../gdb/manager/impl/GdbCValueParserTest.java | 240 - .../impl/GdbReadRegistersCommandTest.java | 71 - .../manager/impl/JoinedGdbManagerTest.java | 82 - .../impl/SpawnedCliGdbManagerTest.java | 37 - .../SpawnedMi2Gdb7Dot6Dot1ManagerTest.java | 43 - .../SpawnedMi2GdbHomeLocalManagerTest.java | 44 - .../impl/SpawnedMi2GdbSystemManagerTest.java | 37 - .../impl/SpawnedWindowsMi2GdbManagerTest.java | 37 - .../gdb/manager/parsing/GdbMiParserTest.java | 117 - .../agent/gdb/model/AbstractGdbModelHost.java | 29 - ...AbstractModelForGdbAmd64RegistersTest.java | 59 - .../AbstractModelForGdbAttacherTest.java | 84 - .../AbstractModelForGdbBreakpointsTest.java | 177 - .../model/AbstractModelForGdbFactoryTest.java | 28 - ...bstractModelForGdbFrameActivationTest.java | 88 - ...ractModelForGdbInferiorActivationTest.java | 79 - ...stractModelForGdbInferiorAttacherTest.java | 36 - ...stractModelForGdbInferiorLauncherTest.java | 36 - .../AbstractModelForGdbInterpreterTest.java | 64 - .../AbstractModelForGdbLauncherTest.java | 95 - ...ModelForGdbScenarioAmd64RegistersTest.java | 55 - ...tractModelForGdbScenarioCloneExitTest.java | 32 - ...stractModelForGdbScenarioForkExitTest.java | 52 - ...AbstractModelForGdbScenarioMemoryTest.java | 73 - .../AbstractModelForGdbScenarioStackTest.java | 66 - ...bstractModelForGdbSessionAttacherTest.java | 26 - ...bstractModelForGdbSessionLauncherTest.java | 27 - .../AbstractModelForGdbSteppableTest.java | 44 - ...stractModelForGdbThreadActivationTest.java | 92 - .../agent/gdb/model/GdbLinuxSpecimen.java | 115 - .../gdb/model/gadp/GadpGdbModelHost.java | 35 - .../gadp/GadpModelForGdbBreakpointsTest.java | 28 - .../gadp/GadpModelForGdbFactoryTest.java | 28 - .../GadpModelForGdbInferiorAttacherTest.java | 28 - .../GadpModelForGdbInferiorLauncherTest.java | 28 - .../gadp/GadpModelForGdbInterpreterTest.java | 28 - .../GadpModelForGdbScenarioForkExitTest.java | 28 - .../GadpModelForGdbSessionAttacherTest.java | 28 - .../GadpModelForGdbSessionLauncherTest.java | 28 - .../gdb/model/invm/InVmGdbModelHost.java | 32 - .../InVmModelForGdbAmd64RegistersTest.java | 31 - .../invm/InVmModelForGdbBreakpointsTest.java | 31 - .../invm/InVmModelForGdbFactoryTest.java | 28 - .../InVmModelForGdbFrameActivationTest.java | 31 - ...InVmModelForGdbInferiorActivationTest.java | 29 - .../InVmModelForGdbInferiorAttacherTest.java | 56 - .../InVmModelForGdbInferiorLauncherTest.java | 31 - .../invm/InVmModelForGdbInterpreterTest.java | 31 - ...ModelForGdbScenarioAmd64RegistersTest.java | 32 - .../InVmModelForGdbScenarioCloneExitTest.java | 31 - .../InVmModelForGdbScenarioForkExitTest.java | 28 - .../InVmModelForGdbScenarioMemoryTest.java | 28 - .../InVmModelForGdbScenarioStackTest.java | 28 - .../InVmModelForGdbSessionAttacherTest.java | 28 - .../InVmModelForGdbSessionLauncherTest.java | 31 - .../invm/InVmModelForGdbSteppableTest.java | 31 - .../InVmModelForGdbThreadActivationTest.java | 28 - .../agent/gdb/model/ssh/SshGdbModelHost.java | 42 - .../gdb/model/ssh/SshJoinGdbModelHost.java | 44 - .../ssh/SshJoinModelForGdbFactoryTest.java | 38 - ...SshJoinModelForGdbSessionLauncherTest.java | 41 - .../model/ssh/SshModelForGdbFactoryTest.java | 38 - Ghidra/Debug/Debugger-agent-lldb/build.gradle | 34 +- .../lldb/bindings/java/java-typemaps.swig | 18 - .../llvm-project/lldb/bindings/java/java.swig | 22 - .../lldb/LldbInJvmDebuggerModelFactory.java | 56 - .../gadp/LldbGadpDebuggerModelFactory.java | 63 - .../java/agent/lldb/gadp/LldbGadpServer.java | 192 - .../impl/AbstractClientThreadExecutor.java | 201 - .../gadp/impl/LldbClientThreadExecutor.java | 64 - .../lldb/gadp/impl/LldbGadpServerImpl.java | 64 - .../java/agent/lldb/lldb/DebugBreakpoint.java | 86 - .../agent/lldb/lldb/DebugBreakpointInfo.java | 39 - .../java/agent/lldb/lldb/DebugClient.java | 432 - .../java/agent/lldb/lldb/DebugClientImpl.java | 544 - .../agent/lldb/lldb/DebugClientReentrant.java | 40 - .../agent/lldb/lldb/DebugEventCallbacks.java | 118 - .../java/agent/lldb/lldb/DebugEventInfo.java | 58 - .../java/agent/lldb/lldb/DebugModuleInfo.java | 93 - .../agent/lldb/lldb/DebugOutputCallbacks.java | 24 - .../agent/lldb/lldb/DebugProcessInfo.java | 68 - .../java/agent/lldb/lldb/DebugRegisters.java | 162 - .../java/agent/lldb/lldb/DebugServerId.java | 58 - .../agent/lldb/lldb/DebugSessionInfo.java | 54 - .../java/agent/lldb/lldb/DebugThreadInfo.java | 55 - .../main/java/agent/lldb/lldb/DebugValue.java | 452 - .../lldb/util/DebugEventCallbacksAdapter.java | 139 - .../java/agent/lldb/manager/LldbCause.java | 31 - .../java/agent/lldb/manager/LldbCommand.java | 76 - .../java/agent/lldb/manager/LldbEvent.java | 64 - .../lldb/manager/LldbEventsListener.java | 229 - .../manager/LldbEventsListenerAdapter.java | 147 - .../java/agent/lldb/manager/LldbManager.java | 436 - .../java/agent/lldb/manager/LldbReason.java | 44 - .../agent/lldb/manager/LldbStateListener.java | 37 - .../breakpoint/LldbBreakpointDisp.java | 32 - .../breakpoint/LldbBreakpointInfo.java | 212 - .../breakpoint/LldbBreakpointInsertions.java | 84 - .../breakpoint/LldbBreakpointType.java | 59 - .../lldb/manager/cmd/AbstractLldbCommand.java | 65 - .../manager/cmd/LldbAddProcessCommand.java | 36 - .../manager/cmd/LldbAddSessionCommand.java | 36 - .../lldb/manager/cmd/LldbAttachCommand.java | 91 - .../manager/cmd/LldbAttachKernelCommand.java | 73 - .../lldb/manager/cmd/LldbCommandError.java | 59 - .../manager/cmd/LldbConsoleExecCommand.java | 67 - .../lldb/manager/cmd/LldbContinueCommand.java | 74 - .../cmd/LldbDeleteBreakpointsCommand.java | 57 - .../lldb/manager/cmd/LldbDestroyCommand.java | 38 - .../lldb/manager/cmd/LldbDetachCommand.java | 51 - .../cmd/LldbDisableBreakpointsCommand.java | 60 - .../cmd/LldbEnableBreakpointsCommand.java | 60 - .../lldb/manager/cmd/LldbEvaluateCommand.java | 41 - .../cmd/LldbInsertBreakpointCommand.java | 102 - .../lldb/manager/cmd/LldbKillCommand.java | 38 - .../manager/cmd/LldbLaunchProcessCommand.java | 89 - .../LldbLaunchProcessWithOptionsCommand.java | 122 - .../LldbListAvailableProcessesCommand.java | 66 - .../LldbListBreakpointLocationsCommand.java | 54 - .../cmd/LldbListBreakpointsCommand.java | 73 - .../cmd/LldbListEnvironmentCommand.java | 48 - .../cmd/LldbListMemoryRegionsCommand.java | 51 - .../cmd/LldbListModuleSectionsCommand.java | 49 - .../cmd/LldbListModuleSymbolsCommand.java | 49 - .../manager/cmd/LldbListModulesCommand.java | 62 - .../manager/cmd/LldbListProcessesCommand.java | 65 - .../manager/cmd/LldbListSessionsCommand.java | 62 - ...ldbListStackFrameRegisterBanksCommand.java | 50 - .../LldbListStackFrameRegistersCommand.java | 49 - .../cmd/LldbListStackFramesCommand.java | 49 - .../manager/cmd/LldbListThreadsCommand.java | 64 - .../lldb/manager/cmd/LldbOpenDumpCommand.java | 70 - .../lldb/manager/cmd/LldbPendingCommand.java | 211 - .../manager/cmd/LldbReadMemoryCommand.java | 83 - .../cmd/LldbRemoteConnectionCommand.java | 85 - .../manager/cmd/LldbRemoveProcessCommand.java | 38 - .../cmd/LldbRequestActivationCommand.java | 46 - .../manager/cmd/LldbRequestFocusCommand.java | 45 - .../manager/cmd/LldbRunToAddressCommand.java | 64 - .../cmd/LldbSetActiveProcessCommand.java | 46 - .../cmd/LldbSetActiveSessionCommand.java | 45 - .../cmd/LldbSetActiveThreadCommand.java | 46 - .../lldb/manager/cmd/LldbStepCommand.java | 110 - .../manager/cmd/LldbThreadHoldCommand.java | 66 - .../manager/cmd/LldbWriteMemoryCommand.java | 63 - .../AbstractLldbCompletedCommandEvent.java | 34 - .../lldb/manager/evt/AbstractLldbEvent.java | 84 - ...ldbBreakpointAutoContinueChangedEvent.java | 47 - .../LldbBreakpointCommandChangedEvent.java | 47 - .../LldbBreakpointConditionChangedEvent.java | 47 - .../evt/LldbBreakpointCreatedEvent.java | 47 - .../evt/LldbBreakpointDeletedEvent.java | 36 - .../evt/LldbBreakpointDisabledEvent.java | 47 - .../evt/LldbBreakpointEnabledEvent.java | 47 - .../manager/evt/LldbBreakpointHitEvent.java | 25 - .../evt/LldbBreakpointIgnoreChangedEvent.java | 47 - .../evt/LldbBreakpointInvalidatedEvent.java | 47 - .../LldbBreakpointLocationsAddedEvent.java | 47 - .../LldbBreakpointLocationsRemovedEvent.java | 47 - .../LldbBreakpointLocationsResolvedEvent.java | 47 - .../evt/LldbBreakpointModifiedEvent.java | 57 - .../evt/LldbBreakpointThreadChangedEvent.java | 47 - .../evt/LldbBreakpointTypeChangedEvent.java | 45 - .../manager/evt/LldbCommandDoneEvent.java | 46 - .../manager/evt/LldbCommandErrorEvent.java | 45 - .../manager/evt/LldbCommandRunningEvent.java | 33 - .../manager/evt/LldbConsoleOutputEvent.java | 58 - .../lldb/manager/evt/LldbExceptionEvent.java | 25 - .../lldb/manager/evt/LldbInterruptEvent.java | 34 - .../manager/evt/LldbModuleLoadedEvent.java | 28 - .../manager/evt/LldbModuleUnloadedEvent.java | 28 - .../manager/evt/LldbProcessCreatedEvent.java | 33 - .../manager/evt/LldbProcessExitedEvent.java | 31 - .../manager/evt/LldbProcessReplacedEvent.java | 38 - .../manager/evt/LldbProcessSelectedEvent.java | 49 - .../manager/evt/LldbProfileDataEvent.java | 34 - .../lldb/manager/evt/LldbRunningEvent.java | 49 - .../evt/LldbSelectedFrameChangedEvent.java | 66 - .../manager/evt/LldbSessionCreatedEvent.java | 25 - .../manager/evt/LldbSessionExitedEvent.java | 36 - .../manager/evt/LldbSessionReplacedEvent.java | 26 - .../manager/evt/LldbSessionSelectedEvent.java | 49 - .../manager/evt/LldbStateChangedEvent.java | 65 - .../lldb/manager/evt/LldbStoppedEvent.java | 58 - .../manager/evt/LldbStructuredDataEvent.java | 34 - .../manager/evt/LldbSymbolsLoadedEvent.java | 34 - .../lldb/manager/evt/LldbSystemsEvent.java | 29 - .../manager/evt/LldbThreadCreatedEvent.java | 26 - .../manager/evt/LldbThreadExitedEvent.java | 24 - .../manager/evt/LldbThreadReplacedEvent.java | 26 - .../manager/evt/LldbThreadResumedEvent.java | 28 - .../manager/evt/LldbThreadSelectedEvent.java | 66 - .../evt/LldbThreadStackChangedEvent.java | 28 - .../manager/evt/LldbThreadSuspendedEvent.java | 28 - .../manager/evt/LldbWatchpointHitEvent.java | 25 - .../impl/LldbDebugOutputCallbacks.java | 33 - .../lldb/manager/impl/LldbManagerImpl.java | 1711 - .../agent/lldb/model/AbstractLldbModel.java | 45 - .../iface1/LldbModelSelectableObject.java | 35 - .../LldbModelTargetAccessConditioned.java | 36 - .../iface1/LldbModelTargetActiveScope.java | 68 - .../iface1/LldbModelTargetAttachable.java | 31 - .../model/iface1/LldbModelTargetAttacher.java | 40 - .../iface1/LldbModelTargetConfigurable.java | 28 - .../iface1/LldbModelTargetDeletable.java | 35 - .../iface1/LldbModelTargetDetachable.java | 35 - .../iface1/LldbModelTargetEnvironment.java | 40 - .../iface1/LldbModelTargetEventScope.java | 28 - .../LldbModelTargetExecutionStateful.java | 44 - .../iface1/LldbModelTargetFocusScope.java | 78 - .../iface1/LldbModelTargetInterpreter.java | 44 - .../iface1/LldbModelTargetInterruptible.java | 38 - .../model/iface1/LldbModelTargetKillable.java | 37 - .../model/iface1/LldbModelTargetLauncher.java | 36 - .../model/iface1/LldbModelTargetMethod.java | 28 - .../iface1/LldbModelTargetResumable.java | 35 - .../iface1/LldbModelTargetSteppable.java | 30 - .../iface2/LldbModelTargetAvailable.java | 28 - .../LldbModelTargetAvailableContainer.java | 22 - .../LldbModelTargetBreakpointContainer.java | 97 - .../LldbModelTargetBreakpointLocation.java | 28 - ...odelTargetBreakpointLocationContainer.java | 39 - .../iface2/LldbModelTargetBreakpointSpec.java | 97 - .../iface2/LldbModelTargetConnector.java | 41 - .../LldbModelTargetConnectorContainer.java | 22 - .../iface2/LldbModelTargetDebugContainer.java | 24 - .../model/iface2/LldbModelTargetFunction.java | 20 - .../LldbModelTargetMemoryContainer.java | 34 - .../iface2/LldbModelTargetMemoryRegion.java | 35 - .../model/iface2/LldbModelTargetModule.java | 73 - .../LldbModelTargetModuleContainer.java | 38 - .../iface2/LldbModelTargetModuleSection.java | 26 - ...LldbModelTargetModuleSectionContainer.java | 23 - .../model/iface2/LldbModelTargetObject.java | 83 - .../model/iface2/LldbModelTargetProcess.java | 52 - .../LldbModelTargetProcessContainer.java | 28 - .../model/iface2/LldbModelTargetRegister.java | 37 - .../iface2/LldbModelTargetRegisterBank.java | 61 - .../LldbModelTargetRegisterContainer.java | 23 - ...dbModelTargetRegisterContainerAndBank.java | 29 - .../model/iface2/LldbModelTargetRoot.java | 40 - .../model/iface2/LldbModelTargetSession.java | 66 - .../LldbModelTargetSessionAttributes.java | 25 - ...delTargetSessionAttributesEnvironment.java | 24 - ...bModelTargetSessionAttributesPlatform.java | 24 - .../LldbModelTargetSessionContainer.java | 36 - .../model/iface2/LldbModelTargetStack.java | 26 - .../iface2/LldbModelTargetStackFrame.java | 108 - .../LldbModelTargetStackFrameRegister.java | 50 - ...LldbModelTargetStackFrameRegisterBank.java | 38 - ...odelTargetStackFrameRegisterContainer.java | 46 - .../model/iface2/LldbModelTargetSymbol.java | 31 - .../LldbModelTargetSymbolContainer.java | 27 - .../model/iface2/LldbModelTargetThread.java | 63 - .../LldbModelTargetThreadContainer.java | 34 - .../impl/LldbModelDefaultTargetModelRoot.java | 33 - .../agent/lldb/model/impl/LldbModelImpl.java | 197 - .../LldbModelTargetAbstractXpointSpec.java | 175 - ...LldbModelTargetAvailableContainerImpl.java | 101 - .../impl/LldbModelTargetAvailableImpl.java | 91 - ...ldbModelTargetBreakpointContainerImpl.java | 158 - ...TargetBreakpointLocationContainerImpl.java | 91 - ...LldbModelTargetBreakpointLocationImpl.java | 146 - .../LldbModelTargetBreakpointSpecImpl.java | 139 - ...LldbModelTargetConnectorContainerImpl.java | 129 - .../LldbModelTargetDebugContainerImpl.java | 57 - .../impl/LldbModelTargetFunctionImpl.java | 96 - .../LldbModelTargetKernelConnectorImpl.java | 94 - .../LldbModelTargetMemoryContainerImpl.java | 145 - .../impl/LldbModelTargetMemoryRegionImpl.java | 118 - .../LldbModelTargetModuleContainerImpl.java | 120 - .../model/impl/LldbModelTargetModuleImpl.java | 124 - ...ModelTargetModuleSectionContainerImpl.java | 104 - .../LldbModelTargetModuleSectionImpl.java | 87 - .../model/impl/LldbModelTargetObjectImpl.java | 270 - ...argetProcessAttachByNameConnectorImpl.java | 90 - ...argetProcessAttachByPathConnectorImpl.java | 94 - ...TargetProcessAttachByPidConnectorImpl.java | 86 - .../LldbModelTargetProcessContainerImpl.java | 192 - .../impl/LldbModelTargetProcessImpl.java | 293 - ...ModelTargetProcessLaunchConnectorImpl.java | 97 - ...ProcessLaunchWithOptionsConnectorImpl.java | 160 - ...ModelTargetProcessRemoteConnectorImpl.java | 103 - .../model/impl/LldbModelTargetRootImpl.java | 169 - ...argetSessionAttributesEnvironmentImpl.java | 47 - .../LldbModelTargetSessionAttributesImpl.java | 102 - ...elTargetSessionAttributesPlatformImpl.java | 127 - .../LldbModelTargetSessionContainerImpl.java | 90 - .../impl/LldbModelTargetSessionImpl.java | 142 - .../impl/LldbModelTargetStackFrameImpl.java | 205 - ...ModelTargetStackFrameRegisterBankImpl.java | 168 - ...TargetStackFrameRegisterContainerImpl.java | 108 - ...LldbModelTargetStackFrameRegisterImpl.java | 129 - .../model/impl/LldbModelTargetStackImpl.java | 99 - .../LldbModelTargetSymbolContainerImpl.java | 72 - .../model/impl/LldbModelTargetSymbolImpl.java | 109 - .../LldbModelTargetThreadContainerImpl.java | 179 - .../model/impl/LldbModelTargetThreadImpl.java | 216 - ...dbModelTargetTraceOrDumpConnectorImpl.java | 84 - .../LldbModelTargetWatchpointSpecImpl.java | 89 - .../src/main/sh/execjar.sh | 22 - .../test/java/agent/lldb/lldb/LLDBTest.java | 977 - .../lldb/model/AbstractLldbModelHost.java | 27 - .../AbstractModelForLldbActivationTest.java | 113 - .../AbstractModelForLldbBreakpointsTest.java | 200 - .../AbstractModelForLldbFactoryTest.java | 28 - ...stractModelForLldbFrameActivationTest.java | 77 - .../AbstractModelForLldbInterpreterTest.java | 84 - ...ractModelForLldbProcessActivationTest.java | 176 - .../AbstractModelForLldbRootAttacherTest.java | 94 - .../AbstractModelForLldbRootLauncherTest.java | 72 - ...ractModelForLldbScenarioCloneExitTest.java | 32 - ...bstractModelForLldbScenarioMemoryTest.java | 73 - ...AbstractModelForLldbScenarioStackTest.java | 67 - ...tModelForLldbScenarioX64RegistersTest.java | 70 - ...ractModelForLldbSessionActivationTest.java | 182 - .../AbstractModelForLldbSteppableTest.java | 39 - ...tractModelForLldbThreadActivationTest.java | 87 - .../AbstractModelForLldbX64RegistersTest.java | 167 - ...tractModelForlldbScenarioForkExitTest.java | 49 - .../java/agent/lldb/model/MacOSSpecimen.java | 141 - .../lldb/model/invm/InVmLldbModelHost.java | 29 - .../invm/InVmModelForLldbBreakpointsTest.java | 113 - .../invm/InVmModelForLldbFactoryTest.java | 28 - .../InVmModelForLldbFrameActivationTest.java | 52 - .../invm/InVmModelForLldbInterpreterTest.java | 64 - ...InVmModelForLldbProcessActivationTest.java | 66 - .../InVmModelForLldbRootAttacherTest.java | 41 - .../InVmModelForLldbRootLauncherTest.java | 28 - ...InVmModelForLldbScenarioCloneExitTest.java | 29 - .../InVmModelForLldbScenarioForkExitTest.java | 37 - .../InVmModelForLldbScenarioMemoryTest.java | 28 - .../InVmModelForLldbScenarioStackTest.java | 28 - ...mModelForLldbScenarioX64RegistersTest.java | 29 - ...InVmModelForLldbSessionActivationTest.java | 66 - .../invm/InVmModelForLldbSteppableTest.java | 28 - .../InVmModelForLldbThreadActivationTest.java | 59 - .../InVmModelForLldbX64RegistersTest.java | 30 - .../services/DebuggerInterpreterService.java | 30 - .../app/services/DebuggerModelService.java | 5 +- .../DebuggerInterpreterConnection.java | 30 - .../debug/api/model/DebuggerMappingOffer.java | 5 +- .../api/model/DebuggerMappingOpinion.java | 5 +- .../debug/api/model/DebuggerMemoryMapper.java | 5 +- .../api/model/DebuggerProgramLaunchOffer.java | 1 + .../api/model/DebuggerRegisterMapper.java | 5 +- .../api/model/DebuggerTargetTraceMapper.java | 5 +- .../ghidra/debug/api/model/TraceRecorder.java | 5 +- .../api/model/TraceRecorderListener.java | 5 +- Ghidra/Debug/Debugger-gadp/Module.manifest | 0 Ghidra/Debug/Debugger-gadp/README.md | 1 - Ghidra/Debug/Debugger-gadp/build.gradle | 33 - .../Debugger-gadp/certification.manifest | 3 - .../java/ghidra/dbg/gadp/GadpRegistry.java | 114 - .../java/ghidra/dbg/gadp/GadpVersion.java | 49 - .../DelegateGadpClientTargetObject.java | 293 - .../ghidra/dbg/gadp/client/GadpClient.java | 605 - .../GadpClientTargetAccessConditioned.java | 23 - .../client/GadpClientTargetActiveScope.java | 45 - .../client/GadpClientTargetAggregate.java | 22 - .../client/GadpClientTargetAttachable.java | 22 - .../gadp/client/GadpClientTargetAttacher.java | 42 - .../GadpClientTargetBreakpointLocation.java | 23 - ...ientTargetBreakpointLocationContainer.java | 23 - .../GadpClientTargetBreakpointSpec.java | 58 - ...dpClientTargetBreakpointSpecContainer.java | 84 - .../client/GadpClientTargetConfigurable.java | 34 - .../gadp/client/GadpClientTargetConsole.java | 36 - .../GadpClientTargetDataTypeMember.java | 23 - .../GadpClientTargetDataTypeNamespace.java | 23 - .../client/GadpClientTargetDeletable.java | 31 - .../client/GadpClientTargetDetachable.java | 31 - .../client/GadpClientTargetEnvironment.java | 22 - .../client/GadpClientTargetEventScope.java | 38 - .../GadpClientTargetExecutionStateful.java | 23 - .../client/GadpClientTargetFocusScope.java | 42 - .../client/GadpClientTargetInterpreter.java | 45 - .../client/GadpClientTargetInterruptible.java | 31 - .../gadp/client/GadpClientTargetKillable.java | 31 - .../gadp/client/GadpClientTargetLauncher.java | 40 - .../gadp/client/GadpClientTargetMemory.java | 103 - .../client/GadpClientTargetMemoryRegion.java | 22 - .../gadp/client/GadpClientTargetMethod.java | 35 - .../gadp/client/GadpClientTargetModule.java | 22 - .../GadpClientTargetModuleContainer.java | 23 - .../client/GadpClientTargetNamedDataType.java | 22 - .../gadp/client/GadpClientTargetObject.java | 66 - .../gadp/client/GadpClientTargetProcess.java | 22 - .../gadp/client/GadpClientTargetRegister.java | 22 - .../client/GadpClientTargetRegisterBank.java | 87 - .../GadpClientTargetRegisterContainer.java | 23 - .../client/GadpClientTargetResumable.java | 31 - .../gadp/client/GadpClientTargetSection.java | 22 - .../GadpClientTargetSectionContainer.java | 23 - .../gadp/client/GadpClientTargetStack.java | 22 - .../client/GadpClientTargetStackFrame.java | 22 - .../client/GadpClientTargetSteppable.java | 32 - .../gadp/client/GadpClientTargetSymbol.java | 22 - .../GadpClientTargetSymbolNamespace.java | 23 - .../gadp/client/GadpClientTargetThread.java | 22 - .../client/GadpClientTargetTogglable.java | 22 - .../client/GadpTcpDebuggerModelFactory.java | 85 - .../dbg/gadp/client/GadpValueUtils.java | 749 - .../gadp/client/annot/GadpEventHandler.java | 26 - .../dbg/gadp/error/GadpErrorException.java | 31 - .../ghidra/dbg/gadp/error/GadpException.java | 26 - .../gadp/error/GadpIllegalStateException.java | 26 - .../dbg/gadp/error/GadpMessageException.java | 26 - .../dbg/gadp/error/GadpRuntimeException.java | 26 - ...AbstractGadpLocalDebuggerModelFactory.java | 212 - .../dbg/gadp/server/AbstractGadpServer.java | 125 - .../dbg/gadp/server/GadpClientHandler.java | 816 - .../util/AsyncProtobufMessageChannel.java | 178 - .../gadp/util/ProtobufOneofByTypeHelper.java | 89 - .../Debugger-gadp/src/main/proto/gadp.proto | 602 - .../ghidra/dbg/gadp/GadpClientServerTest.java | 1589 - .../dbg/gadp/client/GadpClientTest.java | 412 - .../dbg/gadp/client/GadpClientTestHelper.java | 31 - .../util/AsyncProtobufMessageChannelTest.java | 190 - Ghidra/Debug/Debugger-jpda/build.gradle | 6 - .../dbg/jdi/JdiDebuggerModelFactory.java | 37 - .../dbg/jdi/manager/JdiMemoryMapping.java | 20 - .../dbg/jdi/manager/JdiVMThreadGroup.java | 54 - .../ghidra/dbg/jdi/model/JdiModelImpl.java | 245 - .../JdiModelTargetAttributesContainer.java | 45 - .../JdiModelTargetBreakpointContainer.java | 153 - .../model/JdiModelTargetBreakpointSpec.java | 146 - .../model/JdiModelTargetClassContainer.java | 102 - .../jdi/model/JdiModelTargetConnector.java | 113 - .../JdiModelTargetConnectorContainer.java | 113 - .../jdi/model/JdiModelTargetConstantPool.java | 99 - .../JdiModelTargetElementsContainer.java | 59 - .../dbg/jdi/model/JdiModelTargetField.java | 132 - .../model/JdiModelTargetFieldContainer.java | 88 - .../model/JdiModelTargetLocalVariable.java | 105 - .../JdiModelTargetLocalVariableContainer.java | 89 - .../dbg/jdi/model/JdiModelTargetLocation.java | 133 - .../JdiModelTargetLocationContainer.java | 86 - .../dbg/jdi/model/JdiModelTargetMethod.java | 178 - .../model/JdiModelTargetMethodContainer.java | 99 - .../dbg/jdi/model/JdiModelTargetModule.java | 65 - .../model/JdiModelTargetModuleContainer.java | 144 - .../jdi/model/JdiModelTargetObjectImpl.java | 186 - .../model/JdiModelTargetObjectReference.java | 133 - ...diModelTargetObjectReferenceContainer.java | 87 - .../dbg/jdi/model/JdiModelTargetProcess.java | 132 - .../model/JdiModelTargetReferenceType.java | 178 - .../dbg/jdi/model/JdiModelTargetRegister.java | 96 - .../JdiModelTargetRegisterContainer.java | 145 - .../dbg/jdi/model/JdiModelTargetRoot.java | 289 - .../dbg/jdi/model/JdiModelTargetSection.java | 103 - .../model/JdiModelTargetSectionContainer.java | 145 - .../dbg/jdi/model/JdiModelTargetStack.java | 116 - .../jdi/model/JdiModelTargetStackFrame.java | 155 - .../dbg/jdi/model/JdiModelTargetThread.java | 415 - .../model/JdiModelTargetThreadContainer.java | 137 - .../JdiModelTargetThreadGroupContainer.java | 100 - .../dbg/jdi/model/JdiModelTargetType.java | 59 - .../model/JdiModelTargetTypeContainer.java | 90 - .../dbg/jdi/model/JdiModelTargetVM.java | 454 - .../jdi/model/JdiModelTargetVMContainer.java | 189 - .../dbg/jdi/model/JdiModelTargetValue.java | 49 - .../model/JdiModelTargetValueContainer.java | 90 - .../dbg/jdi/model/JdiModelTargetValueMap.java | 85 - .../iface1/JdiModelSelectableObject.java | 26 - .../JdiModelTargetAccessConditioned.java | 34 - .../model/iface1/JdiModelTargetAttacher.java | 39 - .../model/iface1/JdiModelTargetConsole.java | 30 - .../model/iface1/JdiModelTargetDeletable.java | 35 - .../iface1/JdiModelTargetDetachable.java | 35 - .../iface1/JdiModelTargetEnvironment.java | 40 - .../iface1/JdiModelTargetEventScope.java | 28 - .../JdiModelTargetExecutionStateful.java | 40 - .../iface1/JdiModelTargetFocusScope.java | 64 - .../iface1/JdiModelTargetInterruptible.java | 35 - .../model/iface1/JdiModelTargetKillable.java | 35 - .../model/iface1/JdiModelTargetLauncher.java | 94 - .../model/iface1/JdiModelTargetMethod.java | 28 - .../model/iface1/JdiModelTargetResumable.java | 35 - .../model/iface1/JdiModelTargetSteppable.java | 35 - .../iface2/JdiModelTargetAttachable.java | 30 - .../model/iface2/JdiModelTargetObject.java | 106 - .../java/ghidra/dbg/jdi/rmi/jpda/JdiArch.java | 10 +- .../dbg/jdi/rmi/jpda/JdiClientThread.java | 14 +- .../ghidra/dbg/jdi/rmi/jpda/JdiCommands.java | 198 +- .../{JdiManager.java => JdiConnector.java} | 6 +- .../ghidra/dbg/jdi/rmi/jpda/JdiHooks.java | 70 +- .../ghidra/dbg/jdi/rmi/jpda/JdiMethods.java | 90 +- .../ghidra/dbg/jdi/model/JdiModelTest.java | 72 - .../images/GdbLauncher.png | Bin 14838 -> 16405 bytes .../TraceRmiConnectionManagerProvider.java | 3 +- ...RmiConnectionManagerPluginScreenShots.java | 7 +- .../InstructionsForBuildingLLDBInterface.txt | 78 - .../Debug/Debugger-swig-lldb/Module.manifest | 1 - Ghidra/Debug/Debugger-swig-lldb/README.md | 1 - Ghidra/Debug/Debugger-swig-lldb/build.gradle | 52 - .../Debugger-swig-lldb/buildNatives.gradle | 146 - .../Debugger-swig-lldb/certification.manifest | 9 - .../macos_debugger_lldb_build_from_brew.sh | 84 - .../lldb/bindings/java/java-typemaps.swig | 18 - .../llvm-project/lldb/bindings/java/java.swig | 22 - .../src/main/cpp/LLDBWrapJava.cpp | 44704 ---------------- .../src/main/java/SWIG/AccessType.java | 60 - .../src/main/java/SWIG/BasicType.java | 89 - .../main/java/SWIG/BreakpointEventType.java | 68 - .../src/main/java/SWIG/ByteArray.java | 60 - .../src/main/java/SWIG/ByteOrder.java | 59 - .../main/java/SWIG/CommandArgumentType.java | 152 - .../src/main/java/SWIG/CommandFlags.java | 64 - .../java/SWIG/CommandInterpreterResult.java | 59 - .../src/main/java/SWIG/CompletionType.java | 82 - .../src/main/java/SWIG/ConnectionStatus.java | 62 - .../main/java/SWIG/DWIMPrintVerbosity.java | 58 - .../src/main/java/SWIG/DescriptionLevel.java | 60 - .../src/main/java/SWIG/DynamicValueType.java | 58 - .../java/SWIG/EmulateInstructionOptions.java | 58 - .../src/main/java/SWIG/Encoding.java | 60 - .../src/main/java/SWIG/ErrorType.java | 61 - .../java/SWIG/ExpressionEvaluationPhase.java | 59 - .../src/main/java/SWIG/ExpressionResults.java | 65 - .../src/main/java/SWIG/FilePermissions.java | 81 - .../src/main/java/SWIG/Format.java | 98 - .../main/java/SWIG/FormatterMatchType.java | 59 - .../src/main/java/SWIG/FrameComparison.java | 61 - .../src/main/java/SWIG/FunctionNameType.java | 62 - .../src/main/java/SWIG/GdbSignal.java | 61 - .../src/main/java/SWIG/InputReaderAction.java | 63 - .../java/SWIG/InputReaderGranularity.java | 60 - .../java/SWIG/InstructionControlFlowKind.java | 64 - .../java/SWIG/InstrumentationRuntimeType.java | 61 - .../src/main/java/SWIG/LanguageType.java | 108 - .../src/main/java/SWIG/LaunchFlags.java | 69 - .../src/main/java/SWIG/MatchType.java | 58 - .../main/java/SWIG/MemberFunctionKind.java | 60 - .../src/main/java/SWIG/PathType.java | 64 - .../src/main/java/SWIG/Permissions.java | 58 - .../src/main/java/SWIG/QueueItemKind.java | 58 - .../src/main/java/SWIG/QueueKind.java | 58 - .../src/main/java/SWIG/RegisterKind.java | 61 - .../src/main/java/SWIG/ReturnStatus.java | 63 - .../src/main/java/SWIG/RunMode.java | 58 - .../src/main/java/SWIG/SBAddress.java | 142 - .../src/main/java/SWIG/SBAttachInfo.java | 218 - .../src/main/java/SWIG/SBBlock.java | 134 - .../src/main/java/SWIG/SBBreakpoint.java | 266 - .../src/main/java/SWIG/SBBreakpointList.java | 86 - .../main/java/SWIG/SBBreakpointLocation.java | 182 - .../src/main/java/SWIG/SBBreakpointName.java | 210 - .../src/main/java/SWIG/SBBroadcaster.java | 114 - .../main/java/SWIG/SBCommandInterpreter.java | 204 - .../SWIG/SBCommandInterpreterRunOptions.java | 142 - .../main/java/SWIG/SBCommandReturnObject.java | 190 - .../src/main/java/SWIG/SBCommunication.java | 129 - .../src/main/java/SWIG/SBCompileUnit.java | 126 - .../src/main/java/SWIG/SBData.java | 218 - .../src/main/java/SWIG/SBDebugger.java | 550 - .../src/main/java/SWIG/SBDeclaration.java | 98 - .../src/main/java/SWIG/SBEnvironment.java | 102 - .../src/main/java/SWIG/SBError.java | 134 - .../src/main/java/SWIG/SBEvent.java | 102 - .../main/java/SWIG/SBExecutionContext.java | 94 - .../main/java/SWIG/SBExpressionOptions.java | 246 - .../src/main/java/SWIG/SBFile.java | 102 - .../src/main/java/SWIG/SBFileSpec.java | 118 - .../src/main/java/SWIG/SBFileSpecList.java | 90 - .../src/main/java/SWIG/SBFrame.java | 230 - .../src/main/java/SWIG/SBFunction.java | 126 - .../src/main/java/SWIG/SBHostOS.java | 94 - .../src/main/java/SWIG/SBInstruction.java | 134 - .../src/main/java/SWIG/SBInstructionList.java | 110 - .../src/main/java/SWIG/SBLanguageRuntime.java | 66 - .../src/main/java/SWIG/SBLaunchInfo.java | 242 - .../src/main/java/SWIG/SBLineEntry.java | 106 - .../src/main/java/SWIG/SBListener.java | 134 - .../main/java/SWIG/SBMemoryRegionInfo.java | 126 - .../java/SWIG/SBMemoryRegionInfoList.java | 86 - .../src/main/java/SWIG/SBModule.java | 251 - .../src/main/java/SWIG/SBModuleSpec.java | 147 - .../src/main/java/SWIG/SBModuleSpecList.java | 98 - .../src/main/java/SWIG/SBPlatform.java | 186 - .../java/SWIG/SBPlatformConnectOptions.java | 90 - .../java/SWIG/SBPlatformShellCommand.java | 114 - .../src/main/java/SWIG/SBProcess.java | 401 - .../src/main/java/SWIG/SBProcessInfo.java | 118 - .../src/main/java/SWIG/SBQueue.java | 110 - .../src/main/java/SWIG/SBQueueItem.java | 86 - .../src/main/java/SWIG/SBReproducer.java | 74 - .../src/main/java/SWIG/SBScriptObject.java | 75 - .../src/main/java/SWIG/SBSection.java | 138 - .../src/main/java/SWIG/SBSourceManager.java | 74 - .../src/main/java/SWIG/SBStream.java | 98 - .../src/main/java/SWIG/SBStringList.java | 90 - .../src/main/java/SWIG/SBStructuredData.java | 158 - .../src/main/java/SWIG/SBSymbol.java | 126 - .../src/main/java/SWIG/SBSymbolContext.java | 126 - .../main/java/SWIG/SBSymbolContextList.java | 94 - .../src/main/java/SWIG/SBTarget.java | 600 - .../src/main/java/SWIG/SBThread.java | 328 - .../main/java/SWIG/SBThreadCollection.java | 74 - .../src/main/java/SWIG/SBThreadPlan.java | 166 - .../src/main/java/SWIG/SBTrace.java | 98 - .../src/main/java/SWIG/SBTraceCursor.java | 130 - .../src/main/java/SWIG/SBType.java | 250 - .../src/main/java/SWIG/SBTypeCategory.java | 194 - .../src/main/java/SWIG/SBTypeEnumMember.java | 90 - .../main/java/SWIG/SBTypeEnumMemberList.java | 78 - .../src/main/java/SWIG/SBTypeFilter.java | 110 - .../src/main/java/SWIG/SBTypeFormat.java | 118 - .../src/main/java/SWIG/SBTypeList.java | 78 - .../src/main/java/SWIG/SBTypeMember.java | 98 - .../main/java/SWIG/SBTypeMemberFunction.java | 106 - .../main/java/SWIG/SBTypeNameSpecifier.java | 110 - .../src/main/java/SWIG/SBTypeSummary.java | 142 - .../main/java/SWIG/SBTypeSummaryOptions.java | 82 - .../src/main/java/SWIG/SBTypeSynthetic.java | 122 - .../src/main/java/SWIG/SBUnixSignals.java | 110 - .../src/main/java/SWIG/SBValue.java | 415 - .../src/main/java/SWIG/SBValueList.java | 102 - .../main/java/SWIG/SBVariablesOptions.java | 122 - .../src/main/java/SWIG/SBWatchpoint.java | 158 - .../src/main/java/SWIG/SWIGTYPE_p_double.java | 33 - ...TYPE_p_f_p_q_const__char_p_void__void.java | 33 - .../SWIG/SWIGTYPE_p_f_p_void__p_void.java | 33 - ...f_p_void_p_q_const__void_size_t__void.java | 33 - ...pec_r_lldb__SBFileSpec__lldb__SBError.java | 33 - ...E_p_f_unsigned_long_long_p_void__void.java | 33 - .../src/main/java/SWIG/SWIGTYPE_p_int.java | 33 - .../src/main/java/SWIG/SWIGTYPE_p_jbyte.java | 33 - .../SWIGTYPE_p_lldb__ConnectionStatus.java | 33 - .../java/SWIG/SWIGTYPE_p_long_double.java | 33 - .../main/java/SWIG/SWIGTYPE_p_long_long.java | 33 - .../src/main/java/SWIG/SWIGTYPE_p_p_void.java | 33 - .../main/java/SWIG/SWIGTYPE_p_pthread_t.java | 33 - .../src/main/java/SWIG/SWIGTYPE_p_size_t.java | 33 - ...td__shared_ptrT_lldb_private__Event_t.java | 29 - ...std__shared_ptrT_lldb_private__File_t.java | 33 - ...shared_ptrT_lldb_private__QueueItem_t.java | 29 - ...td__shared_ptrT_lldb_private__Queue_t.java | 29 - ...hared_ptrT_lldb_private__ThreadPlan_t.java | 29 - ...ared_ptrT_lldb_private__TraceCursor_t.java | 29 - .../java/SWIG/SWIGTYPE_p_unsigned_char.java | 33 - .../java/SWIG/SWIGTYPE_p_unsigned_int.java | 33 - .../SWIG/SWIGTYPE_p_unsigned_long_long.java | 33 - .../src/main/java/SWIG/SWIGTYPE_p_void.java | 33 - .../src/main/java/SWIG/SaveCoreStyle.java | 59 - .../src/main/java/SWIG/ScriptLanguage.java | 60 - .../src/main/java/SWIG/SearchDepth.java | 63 - .../src/main/java/SWIG/SectionType.java | 116 - .../src/main/java/SWIG/StateType.java | 68 - .../src/main/java/SWIG/StopReason.java | 70 - .../src/main/java/SWIG/StopShowColumn.java | 59 - .../main/java/SWIG/StructuredDataType.java | 66 - .../src/main/java/SWIG/SymbolContextItem.java | 65 - .../src/main/java/SWIG/SymbolType.java | 85 - .../main/java/SWIG/TemplateArgumentKind.java | 64 - .../main/java/SWIG/TraceCursorSeekType.java | 58 - .../src/main/java/SWIG/TraceEvent.java | 60 - .../src/main/java/SWIG/TraceItemKind.java | 58 - .../src/main/java/SWIG/TraceType.java | 57 - .../src/main/java/SWIG/TypeClass.java | 76 - .../src/main/java/SWIG/TypeFlags.java | 78 - .../src/main/java/SWIG/TypeOptions.java | 66 - .../main/java/SWIG/TypeSummaryCapping.java | 57 - .../src/main/java/SWIG/ValueType.java | 64 - .../main/java/SWIG/WatchpointEventType.java | 65 - .../src/main/java/SWIG/WatchpointKind.java | 57 - .../main/java/SWIG/WatchpointValueKind.java | 58 - .../src/main/java/SWIG/lldb.java | 15 - .../src/main/java/SWIG/lldbConstants.java | 72 - .../src/main/java/SWIG/lldbJNI.java | 2410 - Ghidra/Debug/Debugger/certification.manifest | 9 - .../src/main/help/help/TOC_Source.xml | 17 - .../DebuggerBreakpointMarkerPlugin.html | 11 +- .../DebuggerInterpreterPlugin.html | 54 - .../DebuggerModelServicePlugin.html | 66 - .../DebuggerObjectsPlugin.html | 370 - .../images/DebuggerBreakpointDialog.png | Bin 6103 -> 0 bytes ...buggerMethodInvocationDialog_ForLaunch.png | Bin 11350 -> 0 bytes .../images/DebuggerObjectsPlugin.png | Bin 29118 -> 0 bytes .../DebuggerTargetsPlugin.html | 67 - .../images/DebuggerConnectDialog.png | Bin 11787 -> 0 bytes .../images/DebuggerTargetsPlugin.png | Bin 10486 -> 0 bytes .../core/debug/gui/DebuggerResources.java | 18 +- .../LoadEmulatorAutoReadMemorySpec.java | 23 +- ...tractDebuggerWrappedConsoleConnection.java | 286 - .../DebuggerInterpreterPlugin.java | 129 - .../DebuggerInterpreterProvider.java | 42 - .../DebuggerWrappedConsoleConnection.java | 34 - .../DebuggerWrappedInterpreterConnection.java | 41 - .../gui/objects/DebuggerObjectsPlugin.java | 282 - .../gui/objects/DebuggerObjectsProvider.java | 2027 - .../debug/gui/objects/ObjectContainer.java | 593 - .../gui/objects/ObjectContainerListener.java | 22 - .../gui/objects/ObjectUpdateService.java | 29 - .../debug/gui/objects/ObjectUpdatedEvent.java | 33 - .../gui/objects/actions/DisplayAsAction.java | 99 - .../objects/actions/DisplayAsGraphAction.java | 99 - .../objects/actions/DisplayAsTableAction.java | 47 - .../objects/actions/DisplayAsTreeAction.java | 48 - .../objects/actions/DisplayAsXMLAction.java | 69 - .../actions/DisplayFilteredAction.java | 104 - .../actions/DisplayFilteredGraphAction.java | 98 - .../actions/DisplayFilteredTableAction.java | 52 - .../actions/DisplayFilteredTreeAction.java | 51 - .../actions/DisplayFilteredXMLAction.java | 79 - .../objects/actions/DisplayMethodsAction.java | 111 - .../objects/actions/ExportAsFactsAction.java | 108 - .../objects/actions/ExportAsXMLAction.java | 76 - .../objects/actions/ImportExportAsAction.java | 90 - .../actions/ImportFromFactsAction.java | 145 - .../objects/actions/ImportFromXMLAction.java | 132 - .../actions/OpenWinDbgTraceAction.java | 86 - .../gui/objects/actions/SetTimeoutAction.java | 61 - .../AttachableProcessesTableColumns.java | 53 - .../components/DebuggerAttachDialog.java | 163 - .../components/DebuggerAttachDialogOld.java | 101 - .../components/DebuggerBreakpointDialog.java | 98 - .../DebuggerMethodInvocationDialog.java | 3 +- .../objects/components/DummyTargetObject.java | 233 - .../GenericDebuggerProgramLaunchOffer.java | 59 - .../components/ObjectAttributeColumn.java | 53 - .../components/ObjectAttributeRow.java | 74 - .../components/ObjectElementColumn.java | 57 - .../objects/components/ObjectElementRow.java | 97 - .../ObjectEnumeratedColumnTableModel.java | 253 - .../gui/objects/components/ObjectNode.java | 242 - .../gui/objects/components/ObjectPane.java | 51 - .../gui/objects/components/ObjectTable.java | 310 - .../components/ObjectTableCellRenderer.java | 62 - .../gui/objects/components/ObjectTree.java | 429 - .../components/ObjectTreeCellRenderer.java | 124 - .../gui/target/DebuggerConnectionsNode.java | 114 - .../target/DebuggerModelActionContext.java | 56 - .../debug/gui/target/DebuggerModelNode.java | 60 - .../gui/target/DebuggerTargetsPlugin.java | 71 - .../gui/target/DebuggerTargetsProvider.java | 310 - .../mapping/DefaultDebuggerMappingOffer.java | 89 - .../mapping/DefaultDebuggerMemoryMapper.java | 5 +- .../DefaultDebuggerRegisterMapper.java | 5 +- .../DefaultDebuggerTargetTraceMapper.java | 5 +- .../LargestSubDebuggerRegisterMapper.java | 202 - .../ObjectBasedDebuggerMappingOffer.java | 41 - .../ObjectBasedDebuggerMappingOpinion.java | 46 - .../ObjectBasedDebuggerMemoryMapper.java | 5 +- .../ObjectBasedDebuggerTargetTraceMapper.java | 5 +- .../OverridesDebuggerMappingOpinion.java | 74 - .../DbgDebuggerProgramLaunchOpinion.java | 134 - .../DbgengX64DebuggerMappingOpinion.java | 94 - .../frida/FridaArmDebuggerMappingOpinion.java | 80 - .../FridaDebuggerProgramLaunchOpinion.java | 98 - .../frida/FridaX86DebuggerMappingOpinion.java | 133 - .../gdb/DefaultGdbDebuggerMappingOpinion.java | 99 - .../gdb/GdbArmDebuggerMappingOpinion.java | 73 - .../gdb/GdbDebuggerProgramLaunchOpinion.java | 122 - .../gdb/GdbM68kDebuggerMappingOpinion.java | 66 - .../gdb/GdbMipsDebuggerMappingOpinion.java | 125 - .../gdb/GdbPowerPCDebuggerMappingOpinion.java | 101 - .../gdb/GdbX86DebuggerMappingOpinion.java | 138 - .../jdi/JdiDalvikDebuggerMappingOpinion.java | 82 - .../jdi/JdiJvmDebuggerMappingOpinion.java | 82 - .../lldb/LldbArmDebuggerMappingOpinion.java | 79 - .../LldbDebuggerProgramLaunchOpinion.java | 93 - .../lldb/LldbX86DebuggerMappingOpinion.java | 131 - .../service/model/DebuggerConnectDialog.java | 5 +- .../model/DebuggerModelServiceInternal.java | 5 +- .../model/DebuggerModelServicePlugin.java | 1 + .../DebuggerModelServiceProxyPlugin.java | 1 + .../DebuggerSelectMappingOfferDialog.java | 5 +- .../model/DefaultBreakpointRecorder.java | 7 +- .../service/model/DefaultMemoryRecorder.java | 5 +- .../service/model/DefaultModuleRecorder.java | 5 +- .../service/model/DefaultProcessRecorder.java | 5 +- .../service/model/DefaultStackRecorder.java | 5 +- .../service/model/DefaultThreadRecorder.java | 5 +- .../service/model/DefaultTimeRecorder.java | 5 +- .../service/model/DefaultTraceRecorder.java | 8 +- .../model/PermanentTransactionExecutor.java | 5 +- .../RecorderBreakpointLocationResolver.java | 5 +- .../model/RecorderPermanentTransaction.java | 5 +- .../service/model/RecorderSimpleMemory.java | 5 +- .../model/RecorderSimpleRegisterSet.java | 34 - .../service/model/RecorderThreadMap.java | 5 +- .../service/model/TraceEventListener.java | 1 + .../service/model/TraceObjectListener.java | 5 +- .../service/model/TraceObjectManager.java | 7 +- .../service/model/TraceRecorderTarget.java | 3 +- .../interfaces/AbstractRecorderMemory.java | 5 +- .../interfaces/AbstractTraceRecorder.java | 5 +- .../interfaces/ManagedBreakpointRecorder.java | 5 +- .../interfaces/ManagedMemoryRecorder.java | 5 +- .../interfaces/ManagedModuleRecorder.java | 5 +- .../interfaces/ManagedProcessRecorder.java | 5 +- .../interfaces/ManagedStackRecorder.java | 5 +- .../interfaces/ManagedThreadRecorder.java | 5 +- .../AbstractDebuggerProgramLaunchOffer.java | 710 - .../AbstractDebuggerProgramLaunchOpinion.java | 87 - .../launch/DebuggerProgramLaunchOpinion.java | 5 +- .../model/record/DataTypeRecorder.java | 5 +- .../record/EmptyDebuggerRegisterMapper.java | 5 +- .../service/model/record/MemoryRecorder.java | 5 +- .../record/ObjectBasedTraceRecorder.java | 5 +- .../service/model/record/ObjectRecorder.java | 5 +- .../service/model/record/RecorderUtils.java | 5 +- .../service/model/record/SymbolRecorder.java | 5 +- .../service/model/record/TimeRecorder.java | 5 +- .../DebuggerObjectsPluginScreenShots.java | 252 - .../DebuggerObjectsAccessHelper.java | 23 - .../DebuggerTargetsPluginScreenShots.java | 113 - .../gui/AbstractGhidraHeadedDebuggerTest.java | 12 +- .../core/debug/gui/DebuggerManualTest.java | 6 +- .../DebuggerInterpreterPluginTest.java | 151 - .../objects/DebuggerObjectsProviderTest.java | 51 - .../target/DebuggerTargetsProviderFriend.java | 36 - .../target/DebuggerTargetsProviderTest.java | 178 - .../gui/trace/DebuggerTraceTabPanelTest.java | 8 +- .../DefaultDebuggerRegisterMapperTest.java | 133 - .../LargestSubDebuggerRegisterMapperTest.java | 318 - .../DefaultGdbDebuggerMappingOpinionTest.java | 57 - .../gdb/GdbArmDebuggerMappingOpinionTest.java | 102 - .../model/DebuggerModelServiceTest.java | 571 - .../model/DefaultTraceRecorderTest.java | 255 - .../TestDebuggerProgramLaunchOpinion.java | 71 - .../TestKnownArchDebuggerMappingOpinion.java | 41 - .../record/ObjectBasedTraceRecorderTest.java | 571 - ...nnotatedDebuggerAttributeListenerTest.java | 64 - .../ghidra/dbg/DebugModelConventionsTest.java | 127 - .../AbstractDebuggerModelActivationTest.java | 198 - .../AbstractDebuggerModelAttacherTest.java | 260 - .../AbstractDebuggerModelBreakpointsTest.java | 619 - .../AbstractDebuggerModelEnvironmentTest.java | 28 - .../AbstractDebuggerModelFactoryTest.java | 93 - .../AbstractDebuggerModelInterpreterTest.java | 265 - .../AbstractDebuggerModelLauncherTest.java | 180 - ...AbstractDebuggerModelMultiprocessTest.java | 32 - .../AbstractDebuggerModelRegistersTest.java | 234 - ...actDebuggerModelScenarioCloneExitTest.java | 157 - ...ractDebuggerModelScenarioForkExitTest.java | 256 - ...stractDebuggerModelScenarioMemoryTest.java | 173 - ...actDebuggerModelScenarioRegistersTest.java | 203 - ...bstractDebuggerModelScenarioStackTest.java | 175 - .../AbstractDebuggerModelSteppableTest.java | 331 - .../dbg/test/AbstractDebuggerModelTest.java | 341 - .../ghidra/dbg/test/AbstractModelHost.java | 285 - .../test/ProvidesTargetViaAttachSpecimen.java | 39 - .../test/ProvidesTargetViaLaunchSpecimen.java | 42 - .../dbg/test/RequiresAttachSpecimen.java | 32 - .../dbg/test/RequiresLaunchSpecimen.java | 33 - .../java/ghidra/dbg/test/RequiresTarget.java | 34 - .../dbg/testutil/CallbackValidator.java | 394 - .../dbg/testutil/DebuggerModelTestUtils.java | 271 +- .../ghidra/dbg/testutil/EventValidator.java | 297 - .../util/DebuggerCallbackReordererTest.java | 417 - .../Pty}/src/main/resources/session.py | 0 .../Test/DebuggerIntegrationTest/build.gradle | 14 +- .../DebuggerBreakpointsPluginScreenShots.java | 15 +- ...ceRmiLauncherServicePluginScreenShots.java | 3 +- .../TutorialDebuggerScreenShots.java | 11 +- .../flatapi/FlatDebuggerRecorderAPITest.java | 502 - .../images/GettingStarted_LaunchGDBDialog.png | Bin 14767 -> 16333 bytes 2208 files changed, 422 insertions(+), 239028 deletions(-) delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/DbgEngInJvmDebuggerModelFactory.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/COMUtilsExtra.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DbgEng.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugAdvanced.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugBreakpoint.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugClient.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugClientReentrant.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugControl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugControlReentrant.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugDataSpaces.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugEventCallbacks.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugEventInformation.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugExceptionFilterInformation.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugExceptionRecord64.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugFilterInformation.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugInputCallbacks.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugModule.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugModuleInfo.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugOutputCallbacks.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugProcessId.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugProcessInfo.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugProcessRecord.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugRegisters.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugRunningProcess.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugServerId.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugSessionId.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugSessionRecord.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugSpecificFilterInformation.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugStackInformation.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugSymbolEntry.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugSymbolId.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugSymbolName.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugSymbols.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugSystemObjects.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugSystemProcessRecord.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugSystemSessionRecord.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugSystemThreadRecord.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugThreadId.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugThreadInfo.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugThreadRecord.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugValue.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/err/DbgEngException.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/err/DbgEngRuntimeException.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/ext/JavaProvider.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/util/DebugEventCallbacksAdapter.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/gadp/DbgEngGadpDebuggerModelFactory.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/gadp/DbgEngGadpServer.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/gadp/DbgEngGadpServerLaunchShim.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/gadp/impl/AbstractClientThreadExecutor.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/gadp/impl/DbgEngClientThreadExecutor.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/gadp/impl/DbgEngGadpServerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/DbgEngUtil.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/DebugRunningProcessImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/advanced/DebugAdvancedImpl1.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/advanced/DebugAdvancedImpl2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/advanced/DebugAdvancedImpl3.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/advanced/DebugAdvancedInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/breakpoint/DebugBreakpointImpl1.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/breakpoint/DebugBreakpointImpl2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/breakpoint/DebugBreakpointImpl3.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/breakpoint/DebugBreakpointInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/client/DebugClientImpl1.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/client/DebugClientImpl2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/client/DebugClientImpl3.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/client/DebugClientImpl4.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/client/DebugClientImpl5.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/client/DebugClientImpl6.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/client/DebugClientImpl7.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/client/DebugClientInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/control/DebugControlImpl1.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/control/DebugControlImpl2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/control/DebugControlImpl3.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/control/DebugControlImpl4.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/control/DebugControlImpl5.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/control/DebugControlImpl6.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/control/DebugControlImpl7.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/control/DebugControlInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/dataspaces/DebugDataSpacesImpl1.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/dataspaces/DebugDataSpacesImpl2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/dataspaces/DebugDataSpacesImpl3.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/dataspaces/DebugDataSpacesImpl4.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/dataspaces/DebugDataSpacesInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/event/WrapCallbackIDebugEventCallbacks.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/event/WrapCallbackIDebugEventCallbacksWide.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/io/WrapCallbackIDebugInputCallbacks.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/io/WrapCallbackIDebugOutputCallbacks.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/io/WrapCallbackIDebugOutputCallbacksWide.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/registers/DebugRegistersImpl1.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/registers/DebugRegistersImpl2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/registers/DebugRegistersInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/symbols/DebugModuleImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/symbols/DebugSymbolsImpl1.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/symbols/DebugSymbolsImpl2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/symbols/DebugSymbolsImpl3.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/symbols/DebugSymbolsImpl4.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/symbols/DebugSymbolsImpl5.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/symbols/DebugSymbolsInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/sysobj/DebugSystemObjectsImpl1.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/sysobj/DebugSystemObjectsImpl2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/sysobj/DebugSystemObjectsImpl3.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/sysobj/DebugSystemObjectsImpl4.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/sysobj/DebugSystemObjectsInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/DbgEngNative.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/Kernel32Extra.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/ToolhelpUtil.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/UnknownWithUtils.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/WinNTExtra.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/advanced/IDebugAdvanced.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/advanced/IDebugAdvanced2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/advanced/IDebugAdvanced3.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/advanced/WrapIDebugAdvanced.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/advanced/WrapIDebugAdvanced2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/advanced/WrapIDebugAdvanced3.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/breakpoint/IDebugBreakpoint.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/breakpoint/IDebugBreakpoint2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/breakpoint/IDebugBreakpoint3.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/breakpoint/WrapIDebugBreakpoint.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/breakpoint/WrapIDebugBreakpoint2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/breakpoint/WrapIDebugBreakpoint3.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/IDebugClient.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/IDebugClient2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/IDebugClient3.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/IDebugClient4.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/IDebugClient5.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/IDebugClient6.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/IDebugClient7.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/WrapIDebugClient.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/WrapIDebugClient2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/WrapIDebugClient3.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/WrapIDebugClient4.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/WrapIDebugClient5.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/WrapIDebugClient6.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/WrapIDebugClient7.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/IDebugControl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/IDebugControl2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/IDebugControl3.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/IDebugControl4.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/IDebugControl5.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/IDebugControl6.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/IDebugControl7.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/WrapIDebugControl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/WrapIDebugControl2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/WrapIDebugControl3.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/WrapIDebugControl4.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/WrapIDebugControl5.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/WrapIDebugControl6.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/WrapIDebugControl7.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/dataspaces/IDebugDataSpaces.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/dataspaces/IDebugDataSpaces2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/dataspaces/IDebugDataSpaces3.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/dataspaces/IDebugDataSpaces4.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/dataspaces/WrapIDebugDataSpaces.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/dataspaces/WrapIDebugDataSpaces2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/dataspaces/WrapIDebugDataSpaces3.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/dataspaces/WrapIDebugDataSpaces4.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/CallbackIDebugEventCallbacks.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/CallbackIDebugEventCallbacksWide.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/CallbackIDebugEventContextCallbacks.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/IDebugEventCallbacks.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/IDebugEventCallbacksWide.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/IDebugEventContextCallbacks.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/ListenerIDebugEventCallbacks.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/ListenerIDebugEventCallbacksWide.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/ListenerIDebugEventContextCallbacks.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/MarkerEventCallbacks.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/VTableIDebugEventCallbacks.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/VTableIDebugEventCallbacksWide.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/VTableIDebugEventContextCallbacks.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/CallbackIDebugInputCallbacks.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/CallbackIDebugOutputCallbacks.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/CallbackIDebugOutputCallbacks2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/CallbackIDebugOutputCallbacksWide.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/IDebugInputCallbacks.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/IDebugOutputCallbacks.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/IDebugOutputCallbacks2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/IDebugOutputCallbacksWide.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/ListenerIDebugInputCallbacks.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/ListenerIDebugOutputCallbacks.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/ListenerIDebugOutputCallbacks2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/ListenerIDebugOutputCallbacksWide.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/MarkerInputCallbacks.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/MarkerOutputCallbacks.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/VTableIDebugInputCallbacks.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/VTableIDebugOutputCallbacks.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/VTableIDebugOutputCallbacks2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/VTableIDebugOutputCallbacksWide.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/registers/IDebugRegisters.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/registers/IDebugRegisters2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/registers/WrapIDebugRegisters.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/registers/WrapIDebugRegisters2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/IDebugSymbolGroup.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/IDebugSymbolGroup2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/IDebugSymbols.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/IDebugSymbols2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/IDebugSymbols3.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/IDebugSymbols4.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/IDebugSymbols5.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/WrapIDebugSymbols.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/WrapIDebugSymbols2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/WrapIDebugSymbols3.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/WrapIDebugSymbols4.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/WrapIDebugSymbols5.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/sysobj/IDebugSystemObjects.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/sysobj/IDebugSystemObjects2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/sysobj/IDebugSystemObjects3.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/sysobj/IDebugSystemObjects4.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/sysobj/WrapIDebugSystemObjects.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/sysobj/WrapIDebugSystemObjects2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/sysobj/WrapIDebugSystemObjects3.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/sysobj/WrapIDebugSystemObjects4.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/javaprovider/JavaProviderNative.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgCause.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgEventFilter.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgEventHandler.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgEventsListener.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgEventsListenerAdapter.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgExceptionFilter.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgManager.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgMemoryOperations.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgModule.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgModuleMemory.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgModuleSection.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgProcess.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgReason.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgSession.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgStackFrame.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgStackFrameOperations.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgState.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgStateListener.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgThread.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/breakpoint/DbgBreakpointDisp.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/breakpoint/DbgBreakpointInfo.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/breakpoint/DbgBreakpointInsertions.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/breakpoint/DbgBreakpointLocation.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/breakpoint/DbgBreakpointType.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/AbstractDbgCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/AbstractDbgExecToAddressCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/AbstractDbgReadCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgAddProcessCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgAddSessionCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgAttachCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgAttachKernelCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgCommandError.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgConsoleExecCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgContinueCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgDeleteBreakpointsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgDetachCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgDisableBreakpointsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgEnableBreakpointsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgEvaluateCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgFileExecAndSymbolsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgInsertBreakpointCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgKillCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgLaunchProcessCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListAvailableProcessesCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListBreakpointsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListEventFiltersCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListExceptionFiltersCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListKernelMemoryRegionsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListMappingsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListMemoryRegionsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListModulesCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListOSMemoryRegionsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListOSProcessesCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListOSThreadsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListProcessesCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListRegisterDescriptionsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListSessionsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListSymbolsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListThreadsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgOpenDumpCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgPendingCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgReadBusDataCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgReadControlCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgReadDebuggerDataCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgReadIoCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgReadMemoryCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgReadPhysicalMemoryCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgReadRegistersCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgRemoveProcessCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgRemoveSessionCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgRequestActivationCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgRequestFocusCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgResolveProcessCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgResolveThreadCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgRunCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgSetActiveProcessCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgSetActiveSessionCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgSetActiveThreadCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgSetFilterArgumentCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgSetFilterCommandCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgSetFilterSecondChanceCmdCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgStackListFramesCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgStackListOSFramesCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgStepCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgStepToAddressCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgThreadHoldCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgToggleContinuationCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgToggleExecutionCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgTraceToAddressCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgWriteBusDataCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgWriteControlCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgWriteIoCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgWriteMemoryCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgWritePhysicalMemoryCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgWriteRegistersCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/AbstractDbgCompletedCommandEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/AbstractDbgEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgBreakpointCreatedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgBreakpointDeletedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgBreakpointEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgBreakpointModifiedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgCommandDoneEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgCommandErrorEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgCommandRunningEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgConsoleOutputEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgDebuggeeStateChangeEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgExceptionEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgInitialBreakpointEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgInitialModuleLoadEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgModuleLoadedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgModuleUnloadedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgProcessCreatedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgProcessExitedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgProcessSelectedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgPromptChangedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgRunningEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgSessionSelectedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgStateChangedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgStoppedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgSystemErrorEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgSystemsEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgThreadCreatedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgThreadExitedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgThreadSelectedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgDebugEventCallbacksAdapter.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgDebugInputCallbacks.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgDebugOutputCallbacks.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgEventFilterImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgExceptionFilterImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgManagerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgMinimalSymbol.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgModuleImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgModuleMemoryImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgProcessImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgRegister.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgRegisterSet.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgSectionImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgSessionImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgStackFrameImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgThreadImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/reason/DbgEndSteppingRangeReason.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/reason/DbgExitNormallyReason.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/reason/DbgExitedReason.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/reason/DbgSignalReceivedReason.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/AbstractDbgModel.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelSelectableObject.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetAccessConditioned.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetActiveScope.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetAttachable.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetAttacher.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetBptHelper.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetConfigurable.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetDeletable.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetDetachable.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetEnvironment.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetEventScope.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetExecutionStateful.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetFocusScope.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetInterpreter.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetInterruptible.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetKillable.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetLauncher.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetMethod.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetResumable.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetSteppable.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetAvailable.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetAvailableContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetBreakpointContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetBreakpointLocation.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetBreakpointSpec.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetConnector.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetConnectorContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetDebugContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetEnvironmentEx.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetEventContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetEventOption.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetException.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetExceptionContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetMemoryContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetMemoryRegion.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetModule.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetModuleContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetModuleSection.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetModuleSectionContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetObject.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetProcess.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetProcessContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetRegister.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetRegisterBank.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetRegisterContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetRegisterContainerAndBank.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetRoot.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetSession.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetSessionAttributes.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetSessionAttributesMachine.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetSessionContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetStack.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetStackFrame.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetSymbol.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetSymbolContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetTTD.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetThread.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetThreadContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelDefaultTargetModelRoot.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelImplUtils.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetAvailableContainerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetAvailableImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetBreakpointContainerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetBreakpointSpecImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetConnectorContainerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetContinuationOptionImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetDebugContainerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetEventContainerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetEventImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetExceptionContainerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetExceptionImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetExecutionOptionImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetKernelConnectorImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetMemoryContainerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetMemoryRegionImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetModuleContainerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetModuleImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetModuleSectionContainerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetModuleSectionImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetObjectImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetProcessAttachConnectorImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetProcessContainerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetProcessImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetProcessLaunchConnectorImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetRegisterContainerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetRegisterImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetRootImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetSessionAttributesImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetSessionAttributesMachineImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetSessionContainerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetSessionImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetStackFrameImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetStackImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetSymbolContainerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetSymbolImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetThreadContainerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetThreadImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetTraceOrDumpConnectorImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/dbgeng/DbgEngTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/manager/impl/AbstractDbgManagerTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/manager/impl/SpawnedDbgManagerTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractDbgengModelHost.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengBreakpointsTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengFactoryTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengFrameActivationTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengInterpreterTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengProcessActivationTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengRootAttacherTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengRootLauncherTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengScenarioCloneExitTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengScenarioForkExitTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengScenarioMemoryTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengScenarioStackTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengScenarioX64RegistersTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengSessionActivationTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengSteppableTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengThreadActivationTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengX64RegistersTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/WindowsSpecimen.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpDbgengModelHost.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengBreakpointsTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengFactoryTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengFrameActivationTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengInterpreterTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengProcessActivationTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengRootAttacherTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengRootLauncherTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengScenarioCloneExitTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengScenarioForkExitTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengScenarioMemoryTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengScenarioStackTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengScenarioX64RegistersTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengSessionActivationTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengSteppableTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengThreadActivationTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengX64RegistersTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmDbgengModelHost.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengBreakpointsTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengFactoryTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengFrameActivationTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengInterpreterTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengProcessActivationTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengRootAttacherTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengRootLauncherTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengScenarioCloneExitTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengScenarioForkExitTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengScenarioMemoryTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengScenarioStackTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengScenarioX64RegistersTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengSessionActivationTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengSteppableTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengThreadActivationTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengX64RegistersTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel-traceloader/Module.manifest delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel-traceloader/README.md delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel-traceloader/build.gradle delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel-traceloader/certification.manifest delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel-traceloader/ghidra_scripts/BangAddressToMemory.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel-traceloader/ghidra_scripts/PopulateMemviewLocal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel-traceloader/ghidra_scripts/PopulateTraceLocal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel-traceloader/ghidra_scripts/PopulateTraceRemote.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/Module.manifest delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/README.md delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/build.gradle delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/certification.manifest delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/javaprovider/cpp/javaprovider.cpp delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/javaprovider/def/javaprovider.def delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/javaprovider/headers/afxres.h delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/javaprovider/headers/resource.h delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/javaprovider/rc/javaprovider.rc delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/DbgModelInJvmDebuggerModelFactory.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/COMUtilsExtra.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/DbgModel.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/UnknownEx.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/bridge/HostDataModelAccess.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/concept/ComparableConcept.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/concept/Concept.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/concept/DataModelConcept.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/concept/DynamicConceptProviderConcept.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/concept/DynamicKeyProviderConcept.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/concept/EquatableConcept.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/concept/IndexableConcept.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/concept/IterableConcept.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/concept/PreferredRuntimeTypeConcept.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/concept/StringDisplayableConcept.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/DataModelManager1.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/DataModelManager2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/DataModelNameBinder.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/DataModelScript.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/DataModelScriptClient.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/DataModelScriptHostContext.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/DataModelScriptManager.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/DataModelScriptProvider.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/DataModelScriptProviderEnumerator.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/DataModelScriptTemplate.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/DataModelScriptTemplateEnumerator.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/debug/DataModelScriptDebug1.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/debug/DataModelScriptDebug2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/debug/DataModelScriptDebugBreakpoint.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/debug/DataModelScriptDebugBreakpointEnumerator.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/debug/DataModelScriptDebugClient.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/debug/DataModelScriptDebugStack.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/debug/DataModelScriptDebugStackFrame.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/debug/DataModelScriptDebugVariableSetEnumerator.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHost.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostBase.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostBaseClass.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostConstant.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostContext.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostData.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostErrorSink.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostEvaluator1.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostEvaluator2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostExtensability.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostField.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostMemory1.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostMemory2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostModule1.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostModule2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostModuleSignature.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostPublic.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostScriptHost.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostStatus.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostSymbol1.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostSymbol2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostSymbolEnumerator.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostSymbols.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostType1.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostType2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostTypeSignature.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/main/KeyEnumerator.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/main/KeyStore.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/main/ModelIterator.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/main/ModelKeyReference1.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/main/ModelKeyReference2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/main/ModelMethod.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/main/ModelObject.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/main/ModelPropertyAccessor.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/main/RawEnumerator.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/gadp/DbgModelGadpDebuggerModelFactory.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/gadp/DbgModelGadpServer.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/gadp/DbgModelGadpServerLaunchShim.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/gadp/impl/DbgModelClientThreadExecutor.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/gadp/impl/DbgModelGadpServerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/gadp/impl/WrappedDbgModel.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/DebugRunningProcessImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/UnknownExImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/UnknownExInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/bridge/HDMAUtil.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/bridge/HostDataModelAccessImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/bridge/HostDataModelAccessInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/ComparableConceptImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/ComparableConceptInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/DataModelConceptImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/DataModelConceptInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/DynamicConceptProviderConceptImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/DynamicConceptProviderConceptInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/DynamicKeyProviderConceptImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/DynamicKeyProviderConceptInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/EquatableConceptImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/EquatableConceptInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/IndexableConceptImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/IndexableConceptInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/IterableConceptImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/IterableConceptInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/PreferredRuntimeTypeConceptImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/PreferredRuntimeTypeConceptInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/StringDisplayableConceptImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/StringDisplayableConceptInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/DataModelManagerImpl1.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/DataModelManagerImpl2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/DataModelManagerInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelNameBinderImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelNameBinderInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptClientImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptClientInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptHostContextImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptHostContextInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptManagerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptManagerInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptProviderEnumeratorImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptProviderEnumeratorInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptProviderImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptProviderInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptTemplateEnumeratorImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptTemplateEnumeratorInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptTemplateImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptTemplateInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugBreakpointEnumeratorImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugBreakpointEnumeratorInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugBreakpointImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugBreakpointInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugClientImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugClientInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugImpl2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugStackFrameImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugStackFrameInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugStackImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugStackInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugVariableSetEnumeratorImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugVariableSetEnumeratorInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostBaseClassImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostBaseClassInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostConstantImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostConstantInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostContextImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostContextInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostDataImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostDataInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostErrorSinkImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostErrorSinkInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostEvaluatorImpl1.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostEvaluatorImpl2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostEvaluatorInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostExtensabilityImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostExtensabilityInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostFieldImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostFieldInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostMemoryImpl1.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostMemoryImpl2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostMemoryInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostModuleImpl1.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostModuleImpl2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostModuleInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostModuleSignatureImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostModuleSignatureInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostPublicImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostPublicInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostScriptHostImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostScriptHostInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostStatusImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostStatusInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostSymbolEnumeratorImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostSymbolEnumeratorInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostSymbolImpl1.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostSymbolImpl2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostSymbolInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostSymbolsImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostSymbolsInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostTypeImpl1.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostTypeImpl2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostTypeInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostTypeSignatureImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostTypeSignatureInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/X_DebugHostBaseClassImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/X_DebugHostBaseClassInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/KeyEnumeratorImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/KeyEnumeratorInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/KeyStoreImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/KeyStoreInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/ModelIteratorImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/ModelIteratorInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/ModelKeyReferenceImpl1.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/ModelKeyReferenceImpl2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/ModelKeyReferenceInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/ModelMethodImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/ModelMethodInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/ModelObjectImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/ModelObjectInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/ModelPropertyAccessorImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/ModelPropertyAccessorInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/RawEnumeratorImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/RawEnumeratorInternal.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/cmd/DbgApplyMethodsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/cmd/DbgGetRegisterMapCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/cmd/DbgListAttributesCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/cmd/DbgListElementsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/DbgModelNative.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/IDebugClientEx.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/IUnknownEx.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/UnknownWithUtils.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/WrapIUnknownEx.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/bridge/IHostDataModelAccess.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/bridge/WrapIHostDataModelAccess.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/IComparableConcept.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/IDataModelConcept.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/IDynamicConceptProviderConcept.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/IDynamicKeyProviderConcept.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/IEquatableConcept.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/IIndexableConcept.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/IIterableConcept.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/IPreferredRuntimeTypeConcept.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/IStringDisplayableConcept.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/WrapIComparableConcept.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/WrapIDataModelConcept.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/WrapIDynamicConceptProviderConcept.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/WrapIDynamicKeyProviderConcept.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/WrapIEquatableConcept.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/WrapIIndexableConcept.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/WrapIIterableConcept.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/WrapIPreferredRuntimeTypeConcept.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/WrapIStringDisplayableConcept.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/IDataModelManager1.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/IDataModelManager2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/WrapIDataModelManager1.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/WrapIDataModelManager2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/IDataModelNameBinder.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/IDataModelScript.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/IDataModelScriptClient.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/IDataModelScriptHostContext.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/IDataModelScriptManager.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/IDataModelScriptProvider.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/IDataModelScriptProviderEnumerator.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/IDataModelScriptTemplate.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/IDataModelScriptTemplateEnumerator.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/WrapIDataModelNameBinder.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/WrapIDataModelScript.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/WrapIDataModelScriptClient.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/WrapIDataModelScriptHostContext.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/WrapIDataModelScriptManager.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/WrapIDataModelScriptProvider.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/WrapIDataModelScriptProviderEnumerator.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/WrapIDataModelScriptTemplate.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/WrapIDataModelScriptTemplateEnumerator.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/IDataModelScriptDebug.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/IDataModelScriptDebug2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/IDataModelScriptDebugBreakpoint.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/IDataModelScriptDebugBreakpointEnumerator.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/IDataModelScriptDebugClient.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/IDataModelScriptDebugStack.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/IDataModelScriptDebugStackFrame.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/IDataModelScriptDebugVariableSetEnumerator.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/WrapIDataModelScriptDebug.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/WrapIDataModelScriptDebug2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/WrapIDataModelScriptDebugBreakpoint.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/WrapIDataModelScriptDebugBreakpointEnumerator.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/WrapIDataModelScriptDebugClient.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/WrapIDataModelScriptDebugStack.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/WrapIDataModelScriptDebugStackFrame.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/WrapIDataModelScriptDebugVariableSetEnumerator.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHost.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostBaseClass.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostConstant.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostContext.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostData.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostErrorSink.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostEvaluator1.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostEvaluator2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostExtensability.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostField.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostMemory1.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostMemory2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostModule1.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostModule2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostModuleSignature.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostPublic.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostScriptHost.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostStatus.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostSymbol1.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostSymbol2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostSymbolEnumerator.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostSymbols.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostType1.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostType2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostTypeSignature.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHost.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostBaseClass.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostConstant.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostContext.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostData.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostErrorSink.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostEvaluator1.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostEvaluator2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostExtensability.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostField.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostMemory1.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostMemory2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostModule1.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostModule2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostModuleSignature.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostPublic.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostScriptHost.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostStatus.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostSymbol1.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostSymbol2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostSymbolEnumerator.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostSymbols.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostType1.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostType2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostTypeSignature.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/X_IDebugHostBaseClass.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/X_WrapIDebugHostBaseClass.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/IKeyEnumerator.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/IKeyStore.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/IModelIterator.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/IModelKeyReference.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/IModelKeyReference2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/IModelMethod.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/IModelObject.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/IModelPropertyAccessor.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/IRawEnumerator.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/WrapIKeyEnumerator.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/WrapIKeyStore.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/WrapIModelIterator.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/WrapIModelKeyReference1.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/WrapIModelKeyReference2.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/WrapIModelMethod.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/WrapIModelObject.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/WrapIModelPropertyAccessor.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/WrapIRawEnumerator.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/javaprovider/JavaProviderNative.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/manager/DbgManager2Impl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/model/impl/DbgModel2DefaultTargetModelRoot.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/model/impl/DbgModel2Impl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/model/impl/DbgModel2TargetAvailableContainerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/model/impl/DbgModel2TargetAvailableImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/model/impl/DbgModel2TargetObjectImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/model/impl/DbgModel2TargetProxy.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/model/impl/DbgModel2TargetRootImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/model/impl/DbgModel2TargetSystemMarkerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/model/impl/DelegateDbgModel2TargetObject.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/main/resources/agent/dbgmodel/model/impl/dbgmodel_schema.xml delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/sctldbg/cpp/sctldbg.cpp delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/dbgmodel/DbgModelSetContextMWETest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/dbgmodel/DbgModelTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/dbgmodel/NoisyDebugEventCallbacksAdapter.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/dbgmodel/ProcMaker.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmDbgmodelModelHost.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelBreakpointsTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelFactoryTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelFrameActivationTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelInterpreterTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelProcessActivationTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelRootAttacherTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelRootLauncherTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelScenarioCloneExitTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelScenarioForkExitTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelScenarioMemoryTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelScenarioStackTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelScenarioX64RegistersTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelSessionActivationTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelSteppableTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelThreadActivationTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelX64RegistersTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/Module.manifest delete mode 100644 Ghidra/Debug/Debugger-agent-frida/README.md delete mode 100644 Ghidra/Debug/Debugger-agent-frida/build.gradle delete mode 100644 Ghidra/Debug/Debugger-agent-frida/certification.manifest delete mode 100644 Ghidra/Debug/Debugger-agent-frida/data/scripts/onAccess.js delete mode 100644 Ghidra/Debug/Debugger-agent-frida/data/scripts/onAccessExt.js delete mode 100644 Ghidra/Debug/Debugger-agent-frida/data/scripts/onCallSummary.js delete mode 100644 Ghidra/Debug/Debugger-agent-frida/data/scripts/onEnter.js delete mode 100644 Ghidra/Debug/Debugger-agent-frida/data/scripts/onLeave.js delete mode 100644 Ghidra/Debug/Debugger-agent-frida/data/scripts/onReceive.js delete mode 100644 Ghidra/Debug/Debugger-agent-frida/ghidra_scripts/FridaTestScript.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/cpp/ghidra_wrapper.c delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/FridaInJvmDebuggerModelFactory.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/frida/FridaClient.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/frida/FridaClientImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/frida/FridaClientReentrant.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/frida/FridaEng.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/frida/FridaModuleInfo.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/frida/FridaProcessInfo.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/frida/FridaRegionInfo.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/frida/FridaServerId.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/frida/FridaSessionInfo.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/frida/FridaThreadInfo.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/gadp/FridaGadpDebuggerModelFactory.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/gadp/FridaGadpServer.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/gadp/impl/AbstractClientThreadExecutor.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/gadp/impl/FridaClientThreadExecutor.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/gadp/impl/FridaGadpServerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/jna/FridaNative.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaApplication.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaCause.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaContext.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaDebugger.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaError.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaEventsListener.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaEventsListenerAdapter.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaExport.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaFileSpec.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaFrame.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaFunction.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaImport.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaKernelMemoryRegionInfo.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaKernelModule.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaManager.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaMemoryRegionInfo.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaModule.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaOS.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaPointer.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaProcess.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaReason.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaScript.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaSection.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaSession.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaState.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaStateListener.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaSymbol.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaTarget.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaThread.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaValue.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/AbstractFridaCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/AbstractFridaReadCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaAddProcessCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaAddSessionCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaAttachCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaAttachDeviceByIdCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaAttachDeviceByTypeCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaCommandError.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaConsoleExecCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaContinueCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaDestroyCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaDetachCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaGetSessionAttributesCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaInterceptFunctionCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaKillCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaLaunchProcessCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaLaunchProcessWithOptionsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListAvailableDevicesCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListAvailableProcessesCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListHeapMemoryRegionsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListKernelMemoryRegionsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListKernelModulesCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListMemoryRegionsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListModuleExportsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListModuleImportsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListModuleSectionsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListModuleSymbolsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListModulesCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListProcessesCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListRegistersCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListSessionsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListStackFramesCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListThreadsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaPendingCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaReadKernelMemoryCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaReadMemoryCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaRemoveProcessCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaRepeatableWatchMemoryCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaRequestActivationCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaRequestFocusCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaSetExceptionHandlerCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaStalkThreadCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaWatchMemoryCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaWriteKernelMemoryCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaWriteMemoryCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/AbstractFridaCompletedCommandEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/AbstractFridaEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaCommandDoneEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaCommandErrorEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaConsoleOutputEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaInterruptEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaMemoryRegionAddedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaMemoryRegionRemovedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaMemoryRegionReplacedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaModuleLoadedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaModuleReplacedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaModuleUnloadedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaProcessCreatedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaProcessExitedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaProcessReplacedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaProcessSelectedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaRunningEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaSelectedFrameChangedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaSessionCreatedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaSessionExitedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaSessionReplacedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaSessionSelectedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaStateChangedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaStoppedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaThreadCreatedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaThreadExitedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaThreadReplacedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaThreadResumedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaThreadSelectedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaThreadStackChangedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaThreadSuspendedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/impl/FridaManagerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/AbstractFridaModel.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelSelectableObject.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetAccessConditioned.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetActiveScope.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetAttachable.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetAttacher.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetConfigurable.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetDeletable.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetDetachable.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetEnvironment.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetEventScope.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetExecutionStateful.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetFocusScope.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetInterpreter.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetKillable.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetLauncher.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetMethod.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetResumable.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetSteppable.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetAvailableDevice.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetAvailableDevicesContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetAvailableProcess.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetAvailableProcessesContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetConnector.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetConnectorContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetExport.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetExportContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetFileSpec.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetFunction.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetImport.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetImportContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetMemoryContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetMemoryRegion.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetModule.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetModuleContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetModuleSection.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetModuleSectionContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetObject.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetProcess.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetProcessContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetRegister.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetRegisterBank.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetRegisterContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetRegisterContainerAndBank.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetRoot.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetSession.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetSessionAttributes.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetSessionAttributesEnvironment.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetSessionAttributesPlatform.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetSessionContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetStack.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetStackFrame.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetStackFrameRegister.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetStackFrameRegisterBank.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetStackFrameRegisterContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetSymbol.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetSymbolContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetThread.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetThreadContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelDefaultTargetModelRoot.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetAvailableDeviceImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetAvailableDevicesContainerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetAvailableProcessImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetAvailableProcessesContainerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetConnectorContainerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetDeviceAttachByIdConnectorImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetDeviceAttachByTypeConnectorImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetExportContainerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetExportImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetFileSpecImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetFunctionImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetHeapMemoryContainerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetImportContainerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetImportImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetKernelImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetKernelMemoryContainerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetKernelModuleContainerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetKernelModuleImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetMemoryContainerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetMemoryRegionImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetModuleContainerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetModuleImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetModuleSectionContainerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetModuleSectionImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetObjectImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetProcessAttachByPidConnectorImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetProcessContainerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetProcessImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetProcessLaunchConnectorImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetProcessLaunchWithOptionsConnectorImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetRegisterContainerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetRegisterImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetRootImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetSessionAttributesEnvironmentImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetSessionAttributesImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetSessionAttributesPlatformImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetSessionContainerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetSessionImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetStackFrameImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetStackImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetSymbolContainerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetSymbolImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetThreadContainerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetThreadImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetFunctionInterceptorImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetMemoryPatchImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetMemoryProtectImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetMemoryScanImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetMemoryWatchImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetModuleInitImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetModuleInterceptorImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetModuleLoadImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetSymbolFromAddressImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetSymbolFromNameImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetSymbolLoadImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetThreadSleepImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetThreadStalkImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetUnloadScriptImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/main/sh/execjar.sh delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/AbstractFridaModelHost.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/AbstractModelForFridaActivationTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/AbstractModelForFridaFactoryTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/AbstractModelForFridaInterpreterTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/AbstractModelForFridaMethodsTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/AbstractModelForFridaRootAttacherTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/AbstractModelForFridaRootLauncherTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/AbstractModelForFridaScenarioStackTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/AbstractModelForFridaX64RegistersTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/FridaLinuxSpecimen.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/gadp/GadpFridaModelHost.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/gadp/GadpModelForFridaFactoryTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/gadp/GadpModelForFridaInterpreterTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/gadp/GadpModelForFridaRootLauncherTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/gadp/GadpModelForFridaScenarioStackTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/gadp/GadpModelForFridaX64RegistersTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/invm/InVmFridaModelHost.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/invm/InVmModelForFridaFactoryTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/invm/InVmModelForFridaInterpreterTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/invm/InVmModelForFridaMethodsTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/invm/InVmModelForFridaRootAttacherTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/invm/InVmModelForFridaRootLauncherTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/invm/InVmModelForFridaScenarioStackTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/invm/InVmModelForFridaX64RegistersTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/GdbCompatibility.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/GdbInJvmDebuggerModelFactory.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/GdbOverSshDebuggerModelFactory.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/gadp/GdbGadpDebuggerModelFactory.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/gadp/GdbGadpServer.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/gadp/GdbGadpServerLaunchShim.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/gadp/impl/GdbGadpServerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbCause.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbConsoleOperations.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbConsoleOutputListener.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbContextualOperations.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbEventsListener.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbEventsListenerAdapter.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbInferior.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbInferiorThreadGroup.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbLibraryId.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbManager.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbMemoryOperations.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbModule.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbModuleSection.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbProcessThreadGroup.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbRegister.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbRegisterSet.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbStackFrame.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbState.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbStateListener.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbTable.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbTargetOutputListener.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbThread.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/breakpoint/GdbBreakpointDisp.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/breakpoint/GdbBreakpointInfo.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/breakpoint/GdbBreakpointInsertions.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/breakpoint/GdbBreakpointLocation.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/breakpoint/GdbBreakpointType.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/AbstractGdbCompletedCommandEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/AbstractGdbEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/AbstractGdbEventWithFields.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/AbstractGdbEventWithStateChange.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/AbstractGdbEventWithString.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/AbstractGdbLibraryEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/AbstractGdbOutputEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/AbstractGdbThreadEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/AbstractGdbThreadGroupEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbBreakpointCreatedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbBreakpointDeletedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbBreakpointModifiedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbCommandConnectedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbCommandDoneEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbCommandEchoEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbCommandEchoInterruptEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbCommandErrorEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbCommandExitEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbCommandRunningEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbConsoleOutputEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbDebugOutputEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbLibraryLoadedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbLibraryUnloadedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbMemoryChangedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbParamChangedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbRunningEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbStoppedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbTargetOutputEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbThreadCreatedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbThreadExitedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbThreadGroupAddedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbThreadGroupExitedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbThreadGroupRemovedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbThreadGroupStartedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbThreadSelectedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbFrameInfo.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbInferiorImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbManagerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbMemoryMapping.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbMinimalSymbol.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbModuleImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbModuleSectionImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbPendingCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbStackFrameImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbThreadImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbThreadInfo.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/AbstractGdbCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/AbstractGdbCommandWithThreadAndFrameId.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/AbstractGdbCommandWithThreadId.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/AbstractLaunchGdbCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbAddInferiorCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbAttachCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbClaimStopped.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbCommandError.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbConsoleExecCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbContinueCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbDeleteBreakpointsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbDetachCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbDisableBreakpointsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbEnableBreakpointsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbEvaluateCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbFileExecAndSymbolsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbGetThreadInfoCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbGetVarCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbInferiorSelectCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbInfoOsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbInsertBreakpointCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbKillCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbListAvailableProcessesCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbListBreakpointsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbListInferiorsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbListRegisterNamesCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbListThreadsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbReadMemoryCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbReadRegistersCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbRemoveInferiorCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbRunCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbSetActiveFrameCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbSetActiveThreadCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbSetInferiorTtyCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbSetVarCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbStackListFramesCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbStartCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbStartInstructionCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbStateChangeRecord.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbStepCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbWriteMemoryCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbWriteRegistersCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/MixinResumeInCliGdbCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/parsing/GdbCValueParser.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/parsing/GdbMiParser.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/parsing/GdbParsingUtils.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/reason/GdbBreakpointHitReason.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/reason/GdbEndSteppingRangeReason.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/reason/GdbExitNormallyReason.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/reason/GdbExitedReason.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/reason/GdbReason.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/reason/GdbSignalReceivedReason.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelImplUtils.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelSelectableObject.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetAttachable.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetAvailableContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetBreakpointContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetBreakpointLocation.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetBreakpointLocationContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetBreakpointSpec.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetEnvironment.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetInferior.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetInferiorContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetMemoryRegion.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetModule.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetModuleContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetProcessMemory.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetRegister.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetRegisterContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetSection.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetSectionContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetSession.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetStack.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetStackFrame.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetStackFrameRegister.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetStackFrameRegisterContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetSymbol.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetSymbolContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetThread.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetThreadContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/manager/GdbTableTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/manager/impl/AbstractGdbManagerTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/manager/impl/GdbCValueParserTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/manager/impl/GdbReadRegistersCommandTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/manager/impl/JoinedGdbManagerTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/manager/impl/SpawnedCliGdbManagerTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/manager/impl/SpawnedMi2Gdb7Dot6Dot1ManagerTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/manager/impl/SpawnedMi2GdbHomeLocalManagerTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/manager/impl/SpawnedMi2GdbSystemManagerTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/manager/impl/SpawnedWindowsMi2GdbManagerTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/manager/parsing/GdbMiParserTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractGdbModelHost.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbAmd64RegistersTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbAttacherTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbBreakpointsTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbFactoryTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbFrameActivationTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbInferiorActivationTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbInferiorAttacherTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbInferiorLauncherTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbInterpreterTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbLauncherTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbScenarioAmd64RegistersTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbScenarioCloneExitTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbScenarioForkExitTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbScenarioMemoryTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbScenarioStackTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbSessionAttacherTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbSessionLauncherTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbSteppableTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbThreadActivationTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/GdbLinuxSpecimen.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/gadp/GadpGdbModelHost.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/gadp/GadpModelForGdbBreakpointsTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/gadp/GadpModelForGdbFactoryTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/gadp/GadpModelForGdbInferiorAttacherTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/gadp/GadpModelForGdbInferiorLauncherTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/gadp/GadpModelForGdbInterpreterTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/gadp/GadpModelForGdbScenarioForkExitTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/gadp/GadpModelForGdbSessionAttacherTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/gadp/GadpModelForGdbSessionLauncherTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmGdbModelHost.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbAmd64RegistersTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbBreakpointsTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbFactoryTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbFrameActivationTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbInferiorActivationTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbInferiorAttacherTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbInferiorLauncherTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbInterpreterTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbScenarioAmd64RegistersTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbScenarioCloneExitTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbScenarioForkExitTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbScenarioMemoryTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbScenarioStackTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbSessionAttacherTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbSessionLauncherTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbSteppableTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbThreadActivationTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/ssh/SshGdbModelHost.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/ssh/SshJoinGdbModelHost.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/ssh/SshJoinModelForGdbFactoryTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/ssh/SshJoinModelForGdbSessionLauncherTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/ssh/SshModelForGdbFactoryTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/llvm-project/lldb/bindings/java/java-typemaps.swig delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/llvm-project/lldb/bindings/java/java.swig delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/LldbInJvmDebuggerModelFactory.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/gadp/LldbGadpDebuggerModelFactory.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/gadp/LldbGadpServer.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/gadp/impl/AbstractClientThreadExecutor.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/gadp/impl/LldbClientThreadExecutor.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/gadp/impl/LldbGadpServerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugBreakpoint.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugBreakpointInfo.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugClient.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugClientImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugClientReentrant.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugEventCallbacks.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugEventInfo.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugModuleInfo.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugOutputCallbacks.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugProcessInfo.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugRegisters.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugServerId.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugSessionInfo.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugThreadInfo.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugValue.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/util/DebugEventCallbacksAdapter.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/LldbCause.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/LldbCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/LldbEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/LldbEventsListener.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/LldbEventsListenerAdapter.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/LldbManager.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/LldbReason.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/LldbStateListener.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/breakpoint/LldbBreakpointDisp.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/breakpoint/LldbBreakpointInfo.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/breakpoint/LldbBreakpointInsertions.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/breakpoint/LldbBreakpointType.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/AbstractLldbCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbAddProcessCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbAddSessionCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbAttachCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbAttachKernelCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbCommandError.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbConsoleExecCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbContinueCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbDeleteBreakpointsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbDestroyCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbDetachCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbDisableBreakpointsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbEnableBreakpointsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbEvaluateCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbInsertBreakpointCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbKillCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbLaunchProcessCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbLaunchProcessWithOptionsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListAvailableProcessesCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListBreakpointLocationsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListBreakpointsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListEnvironmentCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListMemoryRegionsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListModuleSectionsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListModuleSymbolsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListModulesCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListProcessesCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListSessionsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListStackFrameRegisterBanksCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListStackFrameRegistersCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListStackFramesCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListThreadsCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbOpenDumpCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbPendingCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbReadMemoryCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbRemoteConnectionCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbRemoveProcessCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbRequestActivationCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbRequestFocusCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbRunToAddressCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbSetActiveProcessCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbSetActiveSessionCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbSetActiveThreadCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbStepCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbThreadHoldCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbWriteMemoryCommand.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/AbstractLldbCompletedCommandEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/AbstractLldbEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointAutoContinueChangedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointCommandChangedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointConditionChangedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointCreatedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointDeletedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointDisabledEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointEnabledEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointHitEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointIgnoreChangedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointInvalidatedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointLocationsAddedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointLocationsRemovedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointLocationsResolvedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointModifiedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointThreadChangedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointTypeChangedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbCommandDoneEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbCommandErrorEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbCommandRunningEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbConsoleOutputEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbExceptionEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbInterruptEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbModuleLoadedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbModuleUnloadedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbProcessCreatedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbProcessExitedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbProcessReplacedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbProcessSelectedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbProfileDataEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbRunningEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbSelectedFrameChangedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbSessionCreatedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbSessionExitedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbSessionReplacedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbSessionSelectedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbStateChangedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbStoppedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbStructuredDataEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbSymbolsLoadedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbSystemsEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbThreadCreatedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbThreadExitedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbThreadReplacedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbThreadResumedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbThreadSelectedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbThreadStackChangedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbThreadSuspendedEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbWatchpointHitEvent.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/impl/LldbDebugOutputCallbacks.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/impl/LldbManagerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/AbstractLldbModel.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelSelectableObject.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetAccessConditioned.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetActiveScope.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetAttachable.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetAttacher.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetConfigurable.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetDeletable.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetDetachable.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetEnvironment.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetEventScope.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetExecutionStateful.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetFocusScope.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetInterpreter.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetInterruptible.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetKillable.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetLauncher.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetMethod.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetResumable.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetSteppable.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetAvailable.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetAvailableContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetBreakpointContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetBreakpointLocation.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetBreakpointLocationContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetBreakpointSpec.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetConnector.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetConnectorContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetDebugContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetFunction.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetMemoryContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetMemoryRegion.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetModule.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetModuleContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetModuleSection.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetModuleSectionContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetObject.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetProcess.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetProcessContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetRegister.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetRegisterBank.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetRegisterContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetRegisterContainerAndBank.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetRoot.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetSession.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetSessionAttributes.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetSessionAttributesEnvironment.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetSessionAttributesPlatform.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetSessionContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetStack.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetStackFrame.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetStackFrameRegister.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetStackFrameRegisterBank.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetStackFrameRegisterContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetSymbol.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetSymbolContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetThread.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetThreadContainer.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelDefaultTargetModelRoot.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetAbstractXpointSpec.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetAvailableContainerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetAvailableImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetBreakpointContainerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetBreakpointLocationContainerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetBreakpointLocationImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetBreakpointSpecImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetConnectorContainerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetDebugContainerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetFunctionImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetKernelConnectorImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetMemoryContainerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetMemoryRegionImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetModuleContainerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetModuleImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetModuleSectionContainerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetModuleSectionImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetObjectImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetProcessAttachByNameConnectorImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetProcessAttachByPathConnectorImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetProcessAttachByPidConnectorImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetProcessContainerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetProcessImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetProcessLaunchConnectorImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetProcessLaunchWithOptionsConnectorImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetProcessRemoteConnectorImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetRootImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetSessionAttributesEnvironmentImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetSessionAttributesImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetSessionAttributesPlatformImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetSessionContainerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetSessionImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetStackFrameImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetStackFrameRegisterBankImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetStackFrameRegisterContainerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetStackFrameRegisterImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetStackImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetSymbolContainerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetSymbolImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetThreadContainerImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetThreadImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetTraceOrDumpConnectorImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetWatchpointSpecImpl.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/main/sh/execjar.sh delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/lldb/LLDBTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractLldbModelHost.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbActivationTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbBreakpointsTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbFactoryTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbFrameActivationTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbInterpreterTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbProcessActivationTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbRootAttacherTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbRootLauncherTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbScenarioCloneExitTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbScenarioMemoryTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbScenarioStackTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbScenarioX64RegistersTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbSessionActivationTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbSteppableTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbThreadActivationTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbX64RegistersTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForlldbScenarioForkExitTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/MacOSSpecimen.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmLldbModelHost.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbBreakpointsTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbFactoryTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbFrameActivationTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbInterpreterTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbProcessActivationTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbRootAttacherTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbRootLauncherTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbScenarioCloneExitTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbScenarioForkExitTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbScenarioMemoryTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbScenarioStackTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbScenarioX64RegistersTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbSessionActivationTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbSteppableTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbThreadActivationTest.java delete mode 100644 Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbX64RegistersTest.java delete mode 100644 Ghidra/Debug/Debugger-api/src/main/java/ghidra/app/services/DebuggerInterpreterService.java delete mode 100644 Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/interpreter/DebuggerInterpreterConnection.java delete mode 100644 Ghidra/Debug/Debugger-gadp/Module.manifest delete mode 100644 Ghidra/Debug/Debugger-gadp/README.md delete mode 100644 Ghidra/Debug/Debugger-gadp/build.gradle delete mode 100644 Ghidra/Debug/Debugger-gadp/certification.manifest delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/GadpRegistry.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/GadpVersion.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/DelegateGadpClientTargetObject.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClient.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetAccessConditioned.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetActiveScope.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetAggregate.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetAttachable.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetAttacher.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetBreakpointLocation.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetBreakpointLocationContainer.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetBreakpointSpec.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetBreakpointSpecContainer.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetConfigurable.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetConsole.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetDataTypeMember.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetDataTypeNamespace.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetDeletable.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetDetachable.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetEnvironment.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetEventScope.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetExecutionStateful.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetFocusScope.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetInterpreter.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetInterruptible.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetKillable.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetLauncher.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetMemory.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetMemoryRegion.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetMethod.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetModule.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetModuleContainer.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetNamedDataType.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetObject.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetProcess.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetRegister.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetRegisterBank.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetRegisterContainer.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetResumable.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetSection.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetSectionContainer.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetStack.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetStackFrame.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetSteppable.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetSymbol.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetSymbolNamespace.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetThread.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetTogglable.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpTcpDebuggerModelFactory.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpValueUtils.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/annot/GadpEventHandler.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/error/GadpErrorException.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/error/GadpException.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/error/GadpIllegalStateException.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/error/GadpMessageException.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/error/GadpRuntimeException.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/server/AbstractGadpLocalDebuggerModelFactory.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/server/AbstractGadpServer.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/server/GadpClientHandler.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/util/AsyncProtobufMessageChannel.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/util/ProtobufOneofByTypeHelper.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/main/proto/gadp.proto delete mode 100644 Ghidra/Debug/Debugger-gadp/src/test/java/ghidra/dbg/gadp/GadpClientServerTest.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/test/java/ghidra/dbg/gadp/client/GadpClientTest.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/test/java/ghidra/dbg/gadp/client/GadpClientTestHelper.java delete mode 100644 Ghidra/Debug/Debugger-gadp/src/test/java/ghidra/dbg/gadp/util/AsyncProtobufMessageChannelTest.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/JdiDebuggerModelFactory.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/manager/JdiMemoryMapping.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/manager/JdiVMThreadGroup.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelImpl.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetAttributesContainer.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetBreakpointContainer.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetBreakpointSpec.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetClassContainer.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetConnector.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetConnectorContainer.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetConstantPool.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetElementsContainer.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetField.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetFieldContainer.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetLocalVariable.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetLocalVariableContainer.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetLocation.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetLocationContainer.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetMethod.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetMethodContainer.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetModule.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetModuleContainer.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetObjectImpl.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetObjectReference.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetObjectReferenceContainer.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetProcess.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetReferenceType.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetRegister.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetRegisterContainer.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetRoot.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetSection.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetSectionContainer.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetStack.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetStackFrame.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetThread.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetThreadContainer.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetThreadGroupContainer.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetType.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetTypeContainer.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetVM.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetVMContainer.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetValue.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetValueContainer.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetValueMap.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelSelectableObject.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetAccessConditioned.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetAttacher.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetConsole.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetDeletable.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetDetachable.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetEnvironment.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetEventScope.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetExecutionStateful.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetFocusScope.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetInterruptible.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetKillable.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetLauncher.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetMethod.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetResumable.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetSteppable.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface2/JdiModelTargetAttachable.java delete mode 100644 Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface2/JdiModelTargetObject.java rename Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/rmi/jpda/{JdiManager.java => JdiConnector.java} (98%) delete mode 100644 Ghidra/Debug/Debugger-jpda/src/test/java/ghidra/dbg/jdi/model/JdiModelTest.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/InstructionsForBuildingLLDBInterface.txt delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/Module.manifest delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/README.md delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/build.gradle delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/buildNatives.gradle delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/certification.manifest delete mode 100755 Ghidra/Debug/Debugger-swig-lldb/macos_debugger_lldb_build_from_brew.sh delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/llvm-project/lldb/bindings/java/java-typemaps.swig delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/llvm-project/lldb/bindings/java/java.swig delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/cpp/LLDBWrapJava.cpp delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/AccessType.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/BasicType.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/BreakpointEventType.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ByteArray.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ByteOrder.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/CommandArgumentType.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/CommandFlags.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/CommandInterpreterResult.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/CompletionType.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ConnectionStatus.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/DWIMPrintVerbosity.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/DescriptionLevel.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/DynamicValueType.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/EmulateInstructionOptions.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/Encoding.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ErrorType.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ExpressionEvaluationPhase.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ExpressionResults.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/FilePermissions.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/Format.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/FormatterMatchType.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/FrameComparison.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/FunctionNameType.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/GdbSignal.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/InputReaderAction.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/InputReaderGranularity.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/InstructionControlFlowKind.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/InstrumentationRuntimeType.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/LanguageType.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/LaunchFlags.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/MatchType.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/MemberFunctionKind.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/PathType.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/Permissions.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/QueueItemKind.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/QueueKind.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/RegisterKind.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ReturnStatus.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/RunMode.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBAddress.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBAttachInfo.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBBlock.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBBreakpoint.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBBreakpointList.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBBreakpointLocation.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBBreakpointName.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBBroadcaster.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBCommandInterpreter.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBCommandInterpreterRunOptions.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBCommandReturnObject.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBCommunication.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBCompileUnit.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBData.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBDebugger.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBDeclaration.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBEnvironment.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBError.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBEvent.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBExecutionContext.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBExpressionOptions.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBFile.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBFileSpec.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBFileSpecList.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBFrame.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBFunction.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBHostOS.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBInstruction.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBInstructionList.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBLanguageRuntime.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBLaunchInfo.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBLineEntry.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBListener.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBMemoryRegionInfo.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBMemoryRegionInfoList.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBModule.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBModuleSpec.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBModuleSpecList.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBPlatform.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBPlatformConnectOptions.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBPlatformShellCommand.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBProcess.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBProcessInfo.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBQueue.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBQueueItem.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBReproducer.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBScriptObject.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBSection.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBSourceManager.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBStream.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBStringList.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBStructuredData.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBSymbol.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBSymbolContext.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBSymbolContextList.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTarget.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBThread.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBThreadCollection.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBThreadPlan.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTrace.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTraceCursor.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBType.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeCategory.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeEnumMember.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeEnumMemberList.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeFilter.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeFormat.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeList.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeMember.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeMemberFunction.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeNameSpecifier.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeSummary.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeSummaryOptions.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeSynthetic.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBUnixSignals.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBValue.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBValueList.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBVariablesOptions.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBWatchpoint.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_double.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_f_p_q_const__char_p_void__void.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_f_p_void__p_void.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_f_p_void_p_q_const__void_size_t__void.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_f_p_void_r_q_const__lldb__SBModuleSpec_r_lldb__SBFileSpec_r_lldb__SBFileSpec__lldb__SBError.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_f_unsigned_long_long_p_void__void.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_int.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_jbyte.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_lldb__ConnectionStatus.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_long_double.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_long_long.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_p_void.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_pthread_t.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_size_t.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__Event_t.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__QueueItem_t.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__Queue_t.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__ThreadPlan_t.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__TraceCursor_t.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_unsigned_char.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_unsigned_int.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_unsigned_long_long.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_void.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SaveCoreStyle.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ScriptLanguage.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SearchDepth.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SectionType.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/StateType.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/StopReason.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/StopShowColumn.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/StructuredDataType.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SymbolContextItem.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SymbolType.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TemplateArgumentKind.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TraceCursorSeekType.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TraceEvent.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TraceItemKind.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TraceType.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TypeClass.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TypeFlags.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TypeOptions.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TypeSummaryCapping.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ValueType.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/WatchpointEventType.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/WatchpointKind.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/WatchpointValueKind.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/lldb.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/lldbConstants.java delete mode 100644 Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/lldbJNI.java delete mode 100644 Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerInterpreterPlugin/DebuggerInterpreterPlugin.html delete mode 100644 Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerModelServicePlugin/DebuggerModelServicePlugin.html delete mode 100644 Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerObjectsPlugin/DebuggerObjectsPlugin.html delete mode 100644 Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerObjectsPlugin/images/DebuggerBreakpointDialog.png delete mode 100644 Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerObjectsPlugin/images/DebuggerMethodInvocationDialog_ForLaunch.png delete mode 100644 Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerObjectsPlugin/images/DebuggerObjectsPlugin.png delete mode 100644 Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerTargetsPlugin/DebuggerTargetsPlugin.html delete mode 100644 Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerTargetsPlugin/images/DebuggerConnectDialog.png delete mode 100644 Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerTargetsPlugin/images/DebuggerTargetsPlugin.png delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/interpreters/AbstractDebuggerWrappedConsoleConnection.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/interpreters/DebuggerInterpreterPlugin.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/interpreters/DebuggerInterpreterProvider.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/interpreters/DebuggerWrappedConsoleConnection.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/interpreters/DebuggerWrappedInterpreterConnection.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/DebuggerObjectsPlugin.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/DebuggerObjectsProvider.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/ObjectContainer.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/ObjectContainerListener.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/ObjectUpdateService.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/ObjectUpdatedEvent.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayAsAction.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayAsGraphAction.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayAsTableAction.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayAsTreeAction.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayAsXMLAction.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayFilteredAction.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayFilteredGraphAction.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayFilteredTableAction.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayFilteredTreeAction.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayFilteredXMLAction.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayMethodsAction.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/ExportAsFactsAction.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/ExportAsXMLAction.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/ImportExportAsAction.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/ImportFromFactsAction.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/ImportFromXMLAction.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/OpenWinDbgTraceAction.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/SetTimeoutAction.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/AttachableProcessesTableColumns.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/DebuggerAttachDialog.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/DebuggerAttachDialogOld.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/DebuggerBreakpointDialog.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/DummyTargetObject.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/GenericDebuggerProgramLaunchOffer.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectAttributeColumn.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectAttributeRow.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectElementColumn.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectElementRow.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectEnumeratedColumnTableModel.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectNode.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectPane.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectTable.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectTableCellRenderer.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectTree.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectTreeCellRenderer.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/target/DebuggerConnectionsNode.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/target/DebuggerModelActionContext.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/target/DebuggerModelNode.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/target/DebuggerTargetsPlugin.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/target/DebuggerTargetsProvider.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/mapping/DefaultDebuggerMappingOffer.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/mapping/LargestSubDebuggerRegisterMapper.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/mapping/ObjectBasedDebuggerMappingOffer.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/mapping/ObjectBasedDebuggerMappingOpinion.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/OverridesDebuggerMappingOpinion.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/dbgeng/DbgDebuggerProgramLaunchOpinion.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/dbgeng/DbgengX64DebuggerMappingOpinion.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/frida/FridaArmDebuggerMappingOpinion.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/frida/FridaDebuggerProgramLaunchOpinion.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/frida/FridaX86DebuggerMappingOpinion.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/gdb/DefaultGdbDebuggerMappingOpinion.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/gdb/GdbArmDebuggerMappingOpinion.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/gdb/GdbDebuggerProgramLaunchOpinion.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/gdb/GdbM68kDebuggerMappingOpinion.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/gdb/GdbMipsDebuggerMappingOpinion.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/gdb/GdbPowerPCDebuggerMappingOpinion.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/gdb/GdbX86DebuggerMappingOpinion.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/jdi/JdiDalvikDebuggerMappingOpinion.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/jdi/JdiJvmDebuggerMappingOpinion.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/lldb/LldbArmDebuggerMappingOpinion.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/lldb/LldbDebuggerProgramLaunchOpinion.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/lldb/LldbX86DebuggerMappingOpinion.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/RecorderSimpleRegisterSet.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/launch/AbstractDebuggerProgramLaunchOffer.java delete mode 100644 Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/launch/AbstractDebuggerProgramLaunchOpinion.java delete mode 100644 Ghidra/Debug/Debugger/src/screen/java/ghidra/app/plugin/core/debug/gui/objects/DebuggerObjectsPluginScreenShots.java delete mode 100644 Ghidra/Debug/Debugger/src/screen/java/ghidra/app/plugin/core/debug/gui/objects/components/DebuggerObjectsAccessHelper.java delete mode 100644 Ghidra/Debug/Debugger/src/screen/java/ghidra/app/plugin/core/debug/gui/target/DebuggerTargetsPluginScreenShots.java delete mode 100644 Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/interpreters/DebuggerInterpreterPluginTest.java delete mode 100644 Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/objects/DebuggerObjectsProviderTest.java delete mode 100644 Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/target/DebuggerTargetsProviderFriend.java delete mode 100644 Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/target/DebuggerTargetsProviderTest.java delete mode 100644 Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/mapping/DefaultDebuggerRegisterMapperTest.java delete mode 100644 Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/mapping/LargestSubDebuggerRegisterMapperTest.java delete mode 100644 Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/platform/gdb/DefaultGdbDebuggerMappingOpinionTest.java delete mode 100644 Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/platform/gdb/GdbArmDebuggerMappingOpinionTest.java delete mode 100644 Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/service/model/DebuggerModelServiceTest.java delete mode 100644 Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/service/model/DefaultTraceRecorderTest.java delete mode 100644 Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/service/model/TestDebuggerProgramLaunchOpinion.java delete mode 100644 Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/service/model/TestKnownArchDebuggerMappingOpinion.java delete mode 100644 Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/service/model/record/ObjectBasedTraceRecorderTest.java delete mode 100644 Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/AnnotatedDebuggerAttributeListenerTest.java delete mode 100644 Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/DebugModelConventionsTest.java delete mode 100644 Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelActivationTest.java delete mode 100644 Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelAttacherTest.java delete mode 100644 Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelBreakpointsTest.java delete mode 100644 Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelEnvironmentTest.java delete mode 100644 Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelFactoryTest.java delete mode 100644 Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelInterpreterTest.java delete mode 100644 Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelLauncherTest.java delete mode 100644 Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelMultiprocessTest.java delete mode 100644 Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelRegistersTest.java delete mode 100644 Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelScenarioCloneExitTest.java delete mode 100644 Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelScenarioForkExitTest.java delete mode 100644 Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelScenarioMemoryTest.java delete mode 100644 Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelScenarioRegistersTest.java delete mode 100644 Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelScenarioStackTest.java delete mode 100644 Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelSteppableTest.java delete mode 100644 Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelTest.java delete mode 100644 Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractModelHost.java delete mode 100644 Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/ProvidesTargetViaAttachSpecimen.java delete mode 100644 Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/ProvidesTargetViaLaunchSpecimen.java delete mode 100644 Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/RequiresAttachSpecimen.java delete mode 100644 Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/RequiresLaunchSpecimen.java delete mode 100644 Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/RequiresTarget.java delete mode 100644 Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/testutil/CallbackValidator.java delete mode 100644 Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/testutil/EventValidator.java delete mode 100644 Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/util/DebuggerCallbackReordererTest.java rename Ghidra/{Debug/Debugger-agent-gdb => Framework/Pty}/src/main/resources/session.py (100%) delete mode 100644 Ghidra/Test/DebuggerIntegrationTest/src/test/java/ghidra/debug/flatapi/FlatDebuggerRecorderAPITest.java diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/build.gradle b/Ghidra/Debug/Debugger-agent-dbgeng/build.gradle index de377e6713..dc540b1026 100644 --- a/Ghidra/Debug/Debugger-agent-dbgeng/build.gradle +++ b/Ghidra/Debug/Debugger-agent-dbgeng/build.gradle @@ -24,17 +24,6 @@ apply from: "$rootProject.projectDir/gradle/debugger/hasNodepJar.gradle" apply plugin: 'eclipse' eclipse.project.name = 'Debug Debugger-agent-dbgeng' -dependencies { - api project(":Framework-AsyncComm") - api project(":Framework-Debugging") - api project(":Debugger-gadp") - - //testImplementation project(":Base") - testImplementation project(path: ':Framework-AsyncComm', configuration: 'testArtifacts') - testImplementation project(path: ':Framework-Debugging', configuration: 'testArtifacts') - testImplementation project(path: ":Debugger-gadp", configuration: 'testArtifacts') -} - ext.tlb = file("build/os/win_x86_64/dbgmodel.tlb") if ("win_x86_64".equals(getCurrentPlatformName())) { @@ -98,15 +87,3 @@ distributePyDep("capstone-5.0.1-py3-none-win_amd64.whl") distributePyDep("comtypes-1.4.1-py3-none-any.whl") distributePyDep("pywin32-306-cp312-cp312-win_amd64.whl") -tasks.nodepJar { - manifest { - attributes['Main-Class'] = 'agent.dbgeng.gadp.DbgEngGadpServer' - } -} - -test { - jvmArgs('-Xrs') // TODO: Is this needed, or left over from trial-and-error - if ("win_x86_64".equals(getCurrentPlatformName())) { - dependsOn(":Framework-Debugging:testSpecimenWin_x86_64") - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/DbgEngInJvmDebuggerModelFactory.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/DbgEngInJvmDebuggerModelFactory.java deleted file mode 100644 index 611803fdd2..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/DbgEngInJvmDebuggerModelFactory.java +++ /dev/null @@ -1,95 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng; - -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.model.impl.DbgModelImpl; -import ghidra.dbg.DebuggerModelFactory; -import ghidra.dbg.DebuggerObjectModel; -import ghidra.dbg.util.ConfigurableFactory.FactoryDescription; -import ghidra.program.model.listing.Program; - -@FactoryDescription( - brief = "MS dbgeng.dll (WinDbg)", - htmlDetails = """ - Connect to the Microsoft Debug Engine. - This is the same engine that powers WinDbg. - This is best for most Windows userspace and kernel targets. - Kernel debugging is still experimental. - This will access the native API, which may put Ghidra's JVM at risk.""") -public class DbgEngInJvmDebuggerModelFactory implements DebuggerModelFactory { - - protected String remote = "none"; // Require user to start server - @FactoryOption("DebugConnect options (.server)") - public final Property agentRemoteOption = - Property.fromAccessors(String.class, this::getAgentRemote, this::setAgentRemote); - - protected String transport = "none"; // Require user to start server - @FactoryOption("Remote process server options (untested)") - public final Property agentTransportOption = - Property.fromAccessors(String.class, this::getAgentTransport, this::setAgentTransport); - - @Override - public CompletableFuture build() { - DbgModelImpl model = new DbgModelImpl(); - List cmds = new ArrayList<>(); - completeCommandLine(cmds); - return model.startDbgEng(cmds.toArray(new String[cmds.size()])).thenApply(__ -> model); - } - - @Override - public int getPriority(Program program) { - // TODO: Might instead look for the DLL - if (!System.getProperty("os.name").toLowerCase().contains("windows")) { - return -1; - } - if (program != null) { - String exe = program.getExecutablePath(); - if (exe == null || exe.isBlank()) { - return -1; - } - } - return 80; - } - - public String getAgentTransport() { - return transport; - } - - public void setAgentTransport(String transport) { - this.transport = transport; - } - - public String getAgentRemote() { - return remote; - } - - public void setAgentRemote(String remote) { - this.remote = remote; - } - - protected void completeCommandLine(List cmd) { - if (!remote.equals("none") && !remote.equals("")) { - cmd.addAll(List.of(remote)); - } - if (!transport.equals("none") && !transport.equals("")) { - cmd.addAll(List.of(transport)); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/COMUtilsExtra.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/COMUtilsExtra.java deleted file mode 100644 index e194eb3bb4..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/COMUtilsExtra.java +++ /dev/null @@ -1,72 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng; - -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.platform.win32.COM.COMException; -import com.sun.jna.platform.win32.COM.COMUtils; - -/** - * Utilities for interacting with Microsoft COM objects beyond those provided by {@link COMUtils}. - * - * See the MSDN for details on the meanings of the return codes for the function or method of - * interest. - */ -public interface COMUtilsExtra { - - public static HRESULT E_UNEXPECTED = new HRESULT(0x8000FFFF); - public static HRESULT E_BOUNDS = new HRESULT(0x8000000B); - public static HRESULT E_NOTIMPLEMENTED = new HRESULT(0x80004001); - public static HRESULT E_NOINTERFACE = new HRESULT(0x80004002); - public static HRESULT E_COM_EXC = new HRESULT(0x80004003); - public static HRESULT E_FAIL = new HRESULT(0x80004005); - public static HRESULT E_CANTCALLOUT_INASYNCCALL = new HRESULT(0x80010004); - public static HRESULT E_INTERNALEXCEPTION = new HRESULT(0x80040205); - public static HRESULT E_ACCESS_DENIED = new HRESULT(0x80070005); - public static HRESULT E_CANNOT_READ = new HRESULT(0x8007001E); - public static HRESULT E_INVALID_PARAM = new HRESULT(0x80070057); - public static HRESULT E_SCOPE_NOT_FOUND = new HRESULT(0x8007013E); - - /** - * Check if the given exception represents an {@code E_NOINTERFACE} result - * - * @param e the exception - * @return true if {@code E_NOINTERFACE} - */ - static boolean isE_NOINTERFACE(COMException e) { - return E_NOINTERFACE.equals(e.getHresult()); - } - - /** - * Check if the given exception represents an {@code E_UNEXPECTED} result - * - * @param e the exception - * @return true if {@code E_UNEXPECTED} - */ - static boolean isE_UNEXPECTED(COMException e) { - return E_UNEXPECTED.equals(e.getHresult()); - } - - /** - * Check if the given exception represents an {@code E_INTERNALEXCEPTION} result - * - * @param e the exception - * @return true if {@code E_INTERNALEXCEPTION} - */ - static boolean isE_INTERNALEXCEPTION(COMException e) { - return E_INTERNALEXCEPTION.equals(e.getHresult()); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DbgEng.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DbgEng.java deleted file mode 100644 index bc90b1b3d1..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DbgEng.java +++ /dev/null @@ -1,163 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng; - -import java.lang.ref.Cleaner; - -import com.sun.jna.WString; -import com.sun.jna.platform.win32.Kernel32Util; -import com.sun.jna.platform.win32.WinDef.DWORD; -import com.sun.jna.platform.win32.WinNT.HANDLE; -import com.sun.jna.platform.win32.COM.IUnknown; - -import agent.dbgeng.impl.dbgeng.client.DebugClientInternal; -import agent.dbgeng.jna.dbgeng.DbgEngNative; -import ghidra.comm.util.BitmaskSet; -import ghidra.util.Msg; - -/** - * A wrapper for Microsoft's {@code dbgeng.dll} that presents a Java-friendly interface. - * - * This is the "root interface" from which all other interfaces to {@code dbgeng.dll} are generated. - * Not every method listed in the documentation, nor every method present in the header, is - * implemented. Only those that were necessary to implement the SCTL adapter. However, the class and - * interface hierarchy was designed so that adding the remaining methods should be fairly - * straightforward. This wrapper attempts to obtain the most capable COM interfaces for the debug - * client that it knows. Again, newer interfaces should be fairly straightforward to add. - * - * Methods that are "obviously" wrappers for a COM method are left undocumented, unless there is - * some nuance to how it has been wrapped. In many cases, a parameter which is an integer in the COM - * method may be presented as an {@code enum} or {@link BitmaskSet} by the wrapper. Consult the MSDN - * for the meaning of the various values and bit flags. - * - * Each wrapper interface is implemented by several COM interface wrappers: one for each known COM - * interface version. The wrapper is optimistic, in that it declares wrapper methods even for COM - * methods that are only available in later versions. The implementations limited to earlier COM - * interfaces should either emulate the operation, or throw an - * {@link UnsupportedOperationException}. Where a newer method is provided by a newer interface, a - * wrapper implementation should prefer the latest. For example, one series of interfaces introduces - * {@code *Wide} variants of existing methods. Since Java also uses a UTF-16-like string encoding - * internally, JNA permits wide strings to be passed by reference. Thus, the wide variant is always - * preferred. - * - * Pay careful attention to the threading requirements imposed by {@code dbgeng.dll} these can be - * found in the MSDN. As a general rule of thumb, if the method is reentrant (i.e., it can be called - * from any thread), it is declared in the {@code *Reentrant} variant of the wrapper interface. - * There are few of these. Unless the documentation explicitly lists the method as reentrant, do not - * declare it there. Many methods appear to execute successfully from the wrong thread, but cause - * latent issues. A practice to prevent accidental use of non-reentrant methods outside of the - * client's owning thread is to ensure that only the owning thread can see the full interface. All - * other threads should only have access to the reentrant interface. - * - * If you implement methods that introduce a new callback class, use the existing callback type - * hierarchies as a model. There are many classes to implement. Furthermore, be sure to keep a - * reference to any active callback instances within the wrapper that uses them. The JNA has no way - * of knowing whether or not the instance is still being used by the external C/C++ library. If you - * do not store a reference, the JVM will think it's garbage and free it, even though COM is still - * using it. Drop the reference only when you are certain nothing external has a reference to it. - */ -public class DbgEng { - private static final Cleaner CLEANER = Cleaner.create(); - - private static class ReleaseCOMObject implements Runnable { - private final IUnknown obj; - - ReleaseCOMObject(IUnknown obj) { - this.obj = obj; - } - - @Override - public void run() { - Msg.debug(this, "Releasing COM object: " + obj); - obj.Release(); - } - } - - private static class ReleaseHANDLE implements Runnable { - private final HANDLE handle; - - public ReleaseHANDLE(HANDLE handle) { - this.handle = handle; - } - - @Override - public void run() { - Kernel32Util.closeHandle(handle); - } - } - - public static class OpaqueCleanable { - @SuppressWarnings("unused") // A reference to control GC - private final Object state; - @SuppressWarnings("unused") // A reference to control GC - private final Cleaner.Cleanable cleanable; - - public OpaqueCleanable(Object state, Cleaner.Cleanable cleanable) { - this.state = state; - this.cleanable = cleanable; - } - } - - public static OpaqueCleanable releaseWhenPhantom(Object owner, IUnknown obj) { - ReleaseCOMObject state = new ReleaseCOMObject(obj); - return new OpaqueCleanable(state, CLEANER.register(owner, state)); - } - - public static OpaqueCleanable releaseWhenPhantom(Object owner, HANDLE handle) { - ReleaseHANDLE state = new ReleaseHANDLE(handle); - return new OpaqueCleanable(state, CLEANER.register(owner, state)); - } - - /** - * Connect to a debug session. - * - * See {@code DebugConnect} or {@code DebugConnectWide} on the MSDN. - * - * @param remoteOptions the options, like those given to {@code -remote} - * @return a new client connected as specified - */ - public static DebugClient debugConnect(String remoteOptions) { - WString options = new WString(remoteOptions); - return DebugClientInternal.tryPreferredInterfaces((refiid, - ppClient) -> DbgEngNative.INSTANCE.DebugConnectWide(options, refiid, ppClient)); - } - - /** - * Create a debug client. - * - * Typically, this client is connected to the "local server". See {@code DebugCreate} on the - * MSDN. - * - * @return a new client - */ - public static DebugClient debugCreate() { - return DebugClientInternal.tryPreferredInterfaces(DbgEngNative.INSTANCE::DebugCreate); - } - - /** - * Create a debug client with the given options. - * - * See {@code DebugCreateEx} on the MSDN. - * - * @param options the options - * @return a new client - */ - public static DebugClient debugCreate(int options) { - DWORD dwOpts = new DWORD(options); - return DebugClientInternal.tryPreferredInterfaces( - (refiid, ppClient) -> DbgEngNative.INSTANCE.DebugCreateEx(refiid, dwOpts, ppClient)); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugAdvanced.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugAdvanced.java deleted file mode 100644 index af4291f895..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugAdvanced.java +++ /dev/null @@ -1,83 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng; - -/** - * A wrapper for {@code IDebugAdvanced} and its newer variants. - */ -public interface DebugAdvanced { - public static class DebugThreadBasicInformation { - public final Integer exitStatus; - public final Integer priorityClass; - public final Integer priority; - public final Long createTime; - public final Long exitTime; - public final Long kernelTime; - public final Long userTime; - public final Long startOffset; - public final Long affinity; - - public DebugThreadBasicInformation(Integer exitStatus, Integer priorityClass, - Integer priority, Long createTime, Long exitTime, Long kernelTime, Long userTime, - Long startOffset, Long affinity) { - this.exitStatus = exitStatus; - this.priorityClass = priorityClass; - this.priority = priority; - this.createTime = createTime; - this.exitTime = exitTime; - this.kernelTime = kernelTime; - this.userTime = userTime; - this.startOffset = startOffset; - this.affinity = affinity; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(""); - return sb.toString(); - } - } - - DebugThreadBasicInformation getThreadBasicInformation(DebugThreadId tid); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugBreakpoint.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugBreakpoint.java deleted file mode 100644 index 85984c4c86..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugBreakpoint.java +++ /dev/null @@ -1,137 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng; - -import agent.dbgeng.jna.dbgeng.WinNTExtra.Machine; -import ghidra.comm.util.BitmaskSet; -import ghidra.comm.util.BitmaskUniverse; - -/** - * A wrapper for {@code IDebugBreakpoint} and its newer variants. - */ -public interface DebugBreakpoint { - public static enum BreakType { - CODE, DATA, TIME, INLINE; - } - - public static class BreakFullType { - public final BreakType breakType; - public final Machine procType; // TODO: Guessing the values are from WinNT - - public BreakFullType(BreakType breakType, Machine procType) { - this.breakType = breakType; - this.procType = procType; - } - } - - public static enum BreakFlags implements BitmaskUniverse { - GO_ONLY(1 << 0), // - DEFERRED(1 << 1), // - ENABLED(1 << 2), // - ADDER_ONLY(1 << 3), // - ONE_SHOT(1 << 4), // - ; - - private BreakFlags(int mask) { - this.mask = mask; - } - - private final int mask; - - @Override - public long getMask() { - return mask; - } - } - - public static enum BreakAccess implements BitmaskUniverse { - READ(1 << 0), // - WRITE(1 << 1), // - EXECUTE(1 << 2), // - IO(1 << 3), // - ; - - private BreakAccess(int mask) { - this.mask = mask; - } - - private final int mask; - - @Override - public long getMask() { - return mask; - } - } - - public static class BreakDataParameters { - public int size; - public BitmaskSet access; - - public BreakDataParameters(int size, BitmaskSet access) { - this.size = size; - this.access = access; - } - } - - void remove(); - - int getId(); - - BreakFullType getType(); - - DebugClient getAdder(); - - BitmaskSet getFlags(); - - void addFlags(BitmaskSet flags); - - void addFlags(BreakFlags... flags); - - void removeFlags(BitmaskSet flags); - - void removeFlags(BreakFlags... flags); - - void setFlags(BitmaskSet flags); - - void setFlags(BreakFlags... flags); - - /** - * Get the location on target that triggers the breakpoint - * - *

- * If the breakpoint is deferred, this will return {@code null}. In that case, use - * {@link #getOffsetExpression()}. - * - * @return the offset, or {@code null} - */ - Long getOffset(); - - void setOffset(long offset); - - String getOffsetExpression(); - - void setOffsetExpression(String expression); - - BreakDataParameters getDataParameters(); - - void setDataParameters(BreakDataParameters params); - - void setDataParameters(int size, BitmaskSet access); - - void setDataParameters(int size, BreakAccess... access); - - void dispose(); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugClient.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugClient.java deleted file mode 100644 index cb3a295c6d..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugClient.java +++ /dev/null @@ -1,434 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng; - -import java.util.List; - -import com.sun.jna.platform.win32.WinBase; - -import agent.dbgeng.dbgeng.DebugRunningProcess.Description; -import agent.dbgeng.dbgeng.DebugRunningProcess.Description.ProcessDescriptionFlags; -import ghidra.comm.util.BitmaskSet; -import ghidra.comm.util.BitmaskUniverse; - -/** - * A wrapper for {@code IDebugClient} and its newer variants. - */ -public interface DebugClient extends DebugClientReentrant { - public static enum ExecutionState { - RUNNING, STOPPED; - } - - public static enum DebugStatus { - NO_CHANGE(false, null, 13), // - GO(true, ExecutionState.RUNNING, 10), // - GO_HANDLED(true, ExecutionState.RUNNING, 9), // - GO_NOT_HANDLED(true, ExecutionState.RUNNING, 8), // - STEP_OVER(true, ExecutionState.RUNNING, 7), // - STEP_INTO(true, ExecutionState.RUNNING, 5), // - BREAK(false, ExecutionState.STOPPED, 0), // - NO_DEBUGGEE(true, null, 1), // shouldWait is true to handle process creation - STEP_BRANCH(true, ExecutionState.RUNNING, 6), // - IGNORE_EVENT(false, null, 11), // - RESTART_REQUESTED(true, null, 12), // - REVERSE_GO(true, null, 0xff), // - REVERSE_STEP_BRANCH(true, null, 0xff), // - REVERSE_STEP_OVER(true, null, 0xff), // - REVERSE_STEP_INTO(true, null, 0xff), // - OUT_OF_SYNC(false, null, 2), // - WAIT_INPUT(false, null, 3), // - TIMEOUT(false, null, 4), // - ; - - public static final long MASK = 0xaf; - public static final long INSIDE_WAIT = 0x100000000L; - public static final long WAIT_TIMEOUT = 0x200000000L; - - DebugStatus(boolean shouldWait, ExecutionState threadState, int precedence) { - this.shouldWait = shouldWait; - this.threadState = threadState; - this.precedence = precedence; - } - - public final boolean shouldWait; - public final ExecutionState threadState; - public final int precedence; // 0 is highest - - public static DebugStatus fromArgument(long argument) { - return values()[(int) (argument & MASK)]; - } - - public static boolean isInsideWait(long argument) { - return (argument & INSIDE_WAIT) != 0; - } - - public static boolean isWaitTimeout(long argument) { - return (argument & WAIT_TIMEOUT) != 0; - } - } - - public static enum SessionStatus { - ACTIVE, // - END_SESSION_ACTIVE_TERMINATE,// - END_SESSION_ACTIVE_DETACH, // - END_SESSION_PASSIVE, // - END, // - REBOOT, // - HIBERNATE, // - FAILURE, // - ; - } - - public static enum ChangeDebuggeeState implements BitmaskUniverse { - ALL(0xffffffff), // - REGISTERS(1 << 0), // - DATA(1 << 1), // - REFRESH(1 << 2), // - ; - - private ChangeDebuggeeState(int mask) { - this.mask = mask; - } - - private final int mask; - - @Override - public long getMask() { - return mask; - } - } - - public static enum ChangeEngineState implements BitmaskUniverse { - ALL(0xffffffff), // - CURRENT_THREAD(1 << 0), // - EFFECTIVE_PROCESSOR(1 << 1), // - BREAKPOINTS(1 << 2), // - CODE_LEVEL(1 << 3), // - EXECUTION_STATUS(1 << 4), // - ENGINE_OPTIONS(1 << 5), // - LOG_FILE(1 << 6), // - RADIX(1 << 7), // - EVENT_FILTERS(1 << 8), // - PROCESS_OPTIONS(1 << 9), // - EXTENSIONS(1 << 10), // - SYSTEMS(1 << 11), // - ASSEMBLY_OPTIONS(1 << 12), // - EXPRESSION_SYNTAX(1 << 13), // - TEXT_REPLACEMENTS(1 << 14), // - ; - - private ChangeEngineState(int mask) { - this.mask = mask; - } - - private final int mask; - - @Override - public long getMask() { - return mask; - } - } - - public static enum ChangeSymbolState implements BitmaskUniverse { - ALL(0xffffffff), // - LOADS(1 << 0), // - UNLOADS(1 << 1), // - SCOPE(1 << 2), // - PATHS(1 << 3), // - SYMBOL_OPTIONS(1 << 4), // - TYPE_OPTIONS(1 << 5), // - ; - - private ChangeSymbolState(int mask) { - this.mask = mask; - } - - private final int mask; - - @Override - public long getMask() { - return mask; - } - } - - public static enum DebugAttachFlags implements BitmaskUniverse { - DEFAULT(0), // - NONINVASIVE(1 << 0), // - EXISTING(1 << 1), // - NONINVASIVE_NO_SUSPEND(1 << 2), // - INVASIVE_NO_INITIAL_BREAK(1 << 3), // - INVASIVE_RESUME_PROCESS(1 << 4), // - NONINVASIVE_ALLOW_PARTIAL(1 << 5), // - ; - - DebugAttachFlags(int mask) { - this.mask = mask; - } - - private final int mask; - - @Override - public long getMask() { - return mask; - } - } - - public static enum DebugCreateFlags implements BitmaskUniverse { - DEBUG_PROCESS(WinBase.DEBUG_PROCESS), // - DEBUG_ONLY_THIS_PROCESS(WinBase.DEBUG_ONLY_THIS_PROCESS), // - CREATE_SUSPENDED(WinBase.CREATE_SUSPENDED), // - DETACHED_PROCESS(WinBase.DETACHED_PROCESS), // - - CREATE_NEW_CONSOLE(WinBase.CREATE_NEW_CONSOLE), // - //NORMAL_PRIORITY_CLASS(WinBase.NORMAL_PRIORITY_CLASS), // - //IDLE_PRIORITY_CLASS(WinBase.IDLE_PRIORITY_CLASS), // - //HIGH_PRIORITY_CLASS(WinBase.HIGH_PRIORITY_CLASS), // - - //REALTIME_PRIORITY_CLASS(WinBase.REALTIME_PRIORITY_CLASS), // - CREATE_NEW_PROCESS_GROUP(WinBase.CREATE_NEW_PROCESS_GROUP), // - CREATE_UNICODE_ENVIRONMENT(WinBase.CREATE_UNICODE_ENVIRONMENT), // - CREATE_SEPARATE_WOW_VDM(WinBase.CREATE_SEPARATE_WOW_VDM), // - - CREATE_SHARED_WOW_VDM(WinBase.CREATE_SHARED_WOW_VDM), // - CREATE_FORCEDOS(WinBase.CREATE_FORCEDOS), // - //BELOW_NORMAL_PRIORITY_CLASS(WinBase.BELOW_NORMAL_PRIORITY_CLASS), // - //ABOVE_NORMAL_PRIORITY_CLASS(WinBase.ABOVE_NORMAL_PRIORITY_CLASS), // - - INHERIT_PARENT_AFFINITY(WinBase.INHERIT_PARENT_AFFINITY), // - //INHERIT_CALLER_PRIORITY(WinBase.INHERIT_CALLER_PRIORITY), // - CREATE_PROTECTED_PROCESS(WinBase.CREATE_PROTECTED_PROCESS), // - EXTENDED_STARTUPINFO_PRESENT(WinBase.EXTENDED_STARTUPINFO_PRESENT), // - - //PROCESS_MODE_BACKGROUND_BEGIN(WinBase.PROCESS_MODE_BACKGROUND_BEGIN), // - //PROCESS_MODE_BACKGROUND_END(WinBase.PROCESS_MODE_BACKGROUND_END), // - - CREATE_BREAKAWAY_FROM_JOB(WinBase.CREATE_BREAKAWAY_FROM_JOB), // - CREATE_PRESERVE_CODE_AUTHZ_LEVEL(WinBase.CREATE_PRESERVE_CODE_AUTHZ_LEVEL), // - CREATE_DEFAULT_ERROR_MODE(WinBase.CREATE_DEFAULT_ERROR_MODE), // - CREATE_NO_WINDOW(WinBase.CREATE_NO_WINDOW), // - - //PROFILE_USER(WinBase.PROFILE_USER), // - //PROFILE_KERNEL(WinBase.PROFILE_KERNEL), // - //PROFILE_SERVER(WinBase.PROFILE_SERVER), // - //CREATE_IGNORE_SYSTEM_DEFAULT(WinBase.CREATE_IGNORE_SYSTEM_DEFAULT), // - DEBUG_CREATE_NO_DEBUG_HEAP(0x00000400), // - DEBUG_CREATE_THROUGH_RTL(0x00010000), // - ; - - DebugCreateFlags(int mask) { - this.mask = mask; - } - - private final int mask; - - @Override - public long getMask() { - return mask; - } - } - - public enum DebugEngCreateFlags implements BitmaskUniverse { - DEBUG_ECREATE_PROCESS_DEFAULT(0x00000000), - DEBUG_ECREATE_INHERIT_HANDLES(0x00000001), - DEBUG_ECREATE_USE_VERIFIER_FLAGS(0x00000002), - DEBUG_ECREATE_USE_IMPLICIT_COMMAND_LINE(0x00000004); - - DebugEngCreateFlags(int mask) { - this.mask = mask; - } - - private final int mask; - - @Override - public long getMask() { - return mask; - } - } - - public enum DebugVerifierFlags implements BitmaskUniverse { - DEBUG_VERIFIER_DEFAULT(0x00000000); - - DebugVerifierFlags(int mask) { - this.mask = mask; - } - - private final int mask; - - @Override - public long getMask() { - return mask; - } - } - - public enum DebugEndSessionFlags { - DEBUG_END_PASSIVE(0x00000000), - DEBUG_END_ACTIVE_TERMINATE(0x00000001), - DEBUG_END_ACTIVE_DETACH(0x00000002), - DEBUG_END_REENTRANT(0x00000003), - DEBUG_END_DISCONNECT(0x00000004); - - DebugEndSessionFlags(int value) { - this.value = value; - } - - private final int value; - - public long getValue() { - return value; - } - } - - public enum DebugOutputFlags { - DEBUG_OUTPUT_NORMAL(0x1), // - DEBUG_OUTPUT_ERROR(0x2), // - DEBUG_OUTPUT_WARNING(0x4), // - DEBUG_OUTPUT_VERBOSE(0x8), // - DEBUG_OUTPUT_PROMPT(0x10), // - DEBUG_OUTPUT_PROMPT_REGISTERS(0x20), // - DEBUG_OUTPUT_EXTENSION_WARNING(0x40), // - DEBUG_OUTPUT_DEBUGGEE(0x80), // - DEBUG_OUTPUT_DEBUGGEE_PROMPT(0x100), // - DEBUG_OUTPUT_SYMBOLS(0x200); - - DebugOutputFlags(int value) { - this.value = value; - } - - private final int value; - - public long getValue() { - return value; - } - } - - /** - * Obtain the advanced interface to this client. - * - * @return the advanced interface - */ - DebugAdvanced getAdvanced(); - - /** - * Obtain the control interface to this client - * - * @return the control interface - */ - @Override - DebugControl getControl(); - - /** - * Obtain the data spaces interface to this client - * - * @return the data spaces interface - */ - DebugDataSpaces getDataSpaces(); - - /** - * Obtain the registers interface to this client - * - * @return the registers interface - */ - DebugRegisters getRegisters(); - - /** - * Obtain the symbols interface to this client - * - * @return the symbols interface - */ - DebugSymbols getSymbols(); - - /** - * Obtain the system objects interface to this client - * - * @return the system objects interface - */ - DebugSystemObjects getSystemObjects(); - - /** - * The ID for the local server - * - * @return the ID - */ - DebugServerId getLocalServer(); - - void attachKernel(long flags, String options); - - void startProcessServer(String options); - - DebugServerId connectProcessServer(String options); - - boolean dispatchCallbacks(int timeout); - - void flushCallbacks(); - - default void dispatchCallbacks() { - this.dispatchCallbacks(-1); - } - - void exitDispatch(DebugClient client); - - default void exitDispatch() { - exitDispatch(this); - } - - void setInputCallbacks(DebugInputCallbacks cb); - - void setOutputCallbacks(DebugOutputCallbacks cb); - - void setEventCallbacks(DebugEventCallbacks cb); - - List getRunningProcesses(DebugServerId server); - - Description getProcessDescription(DebugServerId si, int systemId, - BitmaskSet flags); - - void attachProcess(DebugServerId si, long processId, BitmaskSet attachFlags); - - void createProcess(DebugServerId si, String commandLine, - String initialDirectory, String environment, - BitmaskSet createFlags, - BitmaskSet engCreateFlags, - BitmaskSet verifierFlags); - - void createProcessAndAttach(DebugServerId si, String commandLine, - BitmaskSet createFlags, int processId, - BitmaskSet attachFlags); - - void startServer(String options); - - // Only in IDebugClient2 - - void waitForProcessServerEnd(int timeout); - - default void waitForProcessServerEnd() { - waitForProcessServerEnd(-1); - } - - void terminateCurrentProcess(); - - void detachCurrentProcess(); - - void abandonCurrentProcess(); - - void connectSession(int flags); - - void endSession(DebugEndSessionFlags flags); - - // Only in IDebugClient4+ - - void openDumpFileWide(String fileName); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugClientReentrant.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugClientReentrant.java deleted file mode 100644 index cd846f72f9..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugClientReentrant.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng; - -/** - * An interface containing the subset of {@link DebugClient} methods which are reentrant. - * - * All other methods should be called only by the thread which created the client. - */ -public interface DebugClientReentrant { - /** - * Create a new client for the calling thread, connected to the same session as this client. - * - * @return the new client - */ - DebugClient createClient(); - - /** - * Get the reentrant control interface to the client - * - * @return the control interface - */ - DebugControlReentrant getControl(); - - /** - * End a session without acquiring locks - * - * Note. This method calls {@code IDebugClient::EndSession(DEBUG_END_REENTRANT)}. Per the MSDN, - * this may leave the engine in an indeterminate state. The engine should no longer be used by - * this process. It's really only appropriate to use this method when terminating the debugger. - */ - void endSessionReentrant(); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugControl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugControl.java deleted file mode 100644 index de7aedd7e5..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugControl.java +++ /dev/null @@ -1,447 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng; - -import java.util.ArrayList; -import java.util.List; - -import com.sun.jna.platform.win32.WinBase; -import com.sun.jna.platform.win32.COM.COMException; - -import agent.dbgeng.dbgeng.DebugBreakpoint.BreakType; -import agent.dbgeng.dbgeng.DebugClient.DebugStatus; -import ghidra.comm.util.BitmaskSet; -import ghidra.comm.util.BitmaskUniverse; -import ghidra.util.Msg; - -/** - * A wrapper for {@code IDebugControl} and its newer variants. - */ -public interface DebugControl extends DebugControlReentrant { - public static final BitmaskSet SET_ALL_CLIENTS = - BitmaskSet.of(DebugOutputControl.ALL_CLIENTS); - public static final BitmaskSet SET_DEFAULT = BitmaskSet.of(DebugExecute.DEFAULT); - - public static enum DebugOutputLevel implements BitmaskUniverse { - NORMAL(1 << 0), // - ERROR(1 << 1), // - WARNING(1 << 2), // - VERBOSE(1 << 3), // - PROMPT(1 << 4), // - PROMPT_REGISTERS(1 << 5), // - EXTENSION_WARNING(1 << 6), // - OUTPUT_DEBUGEE(1 << 7), // - OUTPUT_DEBUGEE_PROMPT(1 << 8), // - OUTPUT_SYMBOLS(1 << 9), // - OUTPUT_STATUS(1 << 10), // - ; - - private final int mask; - - DebugOutputLevel(int mask) { - this.mask = mask; - } - - @Override - public long getMask() { - return mask; - } - } - - public static enum DebugOutputControl implements BitmaskUniverse { - THIS_CLIENT(0), // - ALL_CLIENTS(1), // - ALL_OTHER_CLIENTS(2), // - IGNORE(3), // - LOG_ONLY(4), // - SEND_MASK(7), // - NOT_LOGGED(1 << 3), // - OVERRIDE_MASK(1 << 4), // - DML(1 << 5), // - AMBIENT_DML(0xfffffffe), // - AMBIENT_TEXT(0xffffffff), // - AMBIENT(0xffffffff), // - ; - - private final int mask; - - DebugOutputControl(int mask) { - this.mask = mask; - } - - @Override - public long getMask() { - return mask; - } - } - - public static enum DebugExecute implements BitmaskUniverse { - DEFAULT(0), // - ECHO(1 << 0), // - NOT_LOGGED(1 << 1), // - NO_REPEAT(1 << 2), // - ; - - private final int mask; - - DebugExecute(int mask) { - this.mask = mask; - } - - @Override - public long getMask() { - return mask; - } - } - - public static enum DebugInterrupt { - ACTIVE, // - PASSIVE, // - EXIT, // - ; - } - - public static enum DebugFilterOrdinals { - DEBUG_FILTER_CREATE_THREAD, // - DEBUG_FILTER_EXIT_THREAD, // - DEBUG_FILTER_CREATE_PROCESS, // - DEBUG_FILTER_EXIT_PROCESS, // - DEBUG_FILTER_LOAD_MODULE, // - DEBUG_FILTER_UNLOAD_MODULE, // - DEBUG_FILTER_SYSTEM_ERROR, // - DEBUG_FILTER_INITIAL_BREAKPOINT, // - DEBUG_FILTER_INITIAL_MODULE_LOAD, // - DEBUG_FILTER_DEBUGGEE_OUTPUT, // - ; - } - - public static enum DebugFilterExecutionOption { - DEBUG_FILTER_BREAK(0, "Break"), // - DEBUG_FILTER_SECOND_CHANCE_BREAK(1, "Second-chance Break"), // - DEBUG_FILTER_OUTPUT(2, "Output-only"), // - DEBUG_FILTER_IGNORE(3, "Ignore"), // - DEBUG_FILTER_REMOVE(4, "Remove"), // - ; - - public static DebugFilterExecutionOption getByNumber(int val) { - for (DebugFilterExecutionOption m : DebugFilterExecutionOption.values()) { - if (m.val == val) { - return m; - } - } - return null; - } - - DebugFilterExecutionOption(int val, String description) { - this.val = val; - this.description = description; - } - - public final int val; - public final String description; - } - - public static enum DebugFilterContinuationOption { - DEBUG_FILTER_GO_HANDLED(0, "Handled"), // - DEBUG_FILTER_GO_NOT_HANDLED(1, "Not Handled"), // - ; - - public static DebugFilterContinuationOption getByNumber(int val) { - for (DebugFilterContinuationOption m : DebugFilterContinuationOption.values()) { - if (m.val == val) { - return m; - } - } - return null; - } - - DebugFilterContinuationOption(int val, String description) { - this.val = val; - this.description = description; - } - - public final int val; - public final String description; - } - - boolean getInterrupt(); - - int getInterruptTimeout(); - - void setInterruptTimeout(int seconds); - - void print(BitmaskSet levels, String message); - - /** - * A shortcut for {@link #print(BitmaskSet, String)} that includes a newline. - * - * @param levels the log levels for the message - * @param message the message - */ - void println(BitmaskSet levels, String message); - - /** - * A shortcut for {@link #print(BitmaskSet, String)} that applies to a single level. - * - * @param level the log level for the message - * @param message the message - */ - default void print(DebugOutputLevel level, String message) { - print(BitmaskSet.of(level), message); - } - - /** - * A shortcut for {@link #print(BitmaskSet, String)} that includes a newline and applies to a - * single level. - * - * @param level the log level for the message - * @param message the message - */ - default void println(DebugOutputLevel level, String message) { - println(BitmaskSet.of(level), message); - } - - /** - * A shortcut for {@link #print(BitmaskSet, String)} at normal level. - * - * @param message the message - */ - default void out(String message) { - print(DebugOutputLevel.NORMAL, message); - } - - /** - * A shortcut for {@link #println(BitmaskSet, String)} at normal level. - * - * @param message the message - */ - default void outln(String message) { - println(DebugOutputLevel.NORMAL, message); - } - - /** - * A shortcut for {@link #print(BitmaskSet, String)} at warning level. - * - * @param message the message - */ - default void warn(String message) { - print(DebugOutputLevel.WARNING, message); - } - - /** - * A shortcut for {@link #println(BitmaskSet, String)} at warning level. - * - * @param message the message - */ - default void warnln(String message) { - println(DebugOutputLevel.WARNING, message); - } - - /** - * A shortcut for {@link #print(BitmaskSet, String)} at error level. - * - * @param message the message - */ - default void err(String message) { - print(DebugOutputLevel.ERROR, message); - } - - /** - * A shortcut for {@link #println(BitmaskSet, String)} at error level. - * - * @param message the message - */ - default void errln(String message) { - println(DebugOutputLevel.ERROR, message); - } - - /** - * A shortcut for {@link #print(BitmaskSet, String)} at verbose level. - * - * @param message the message - */ - default void verb(String message) { - print(DebugOutputLevel.VERBOSE, message); - } - - /** - * A shortcut for {@link #println(BitmaskSet, String)} at verbose level. - * - * @param message the message - */ - default void verbln(String message) { - println(DebugOutputLevel.VERBOSE, message); - } - - T evaluate(Class desiredType, String expression); - - void execute(BitmaskSet ctl, String str, BitmaskSet flags); - - /** - * A shortcut for {@link #execute(BitmaskSet, String, BitmaskSet)} outputting to all clients - * with the default execution flag. - * - * @param str the command string - */ - default void execute(String str) { - execute(SET_ALL_CLIENTS, str, SET_DEFAULT); - } - - void prompt(BitmaskSet ctl, String message); - - String getPromptText(); - - void returnInput(String input); - - DebugStatus getExecutionStatus(); - - void setExecutionStatus(DebugStatus status); - - int getNumberBreakpoints(); - - DebugBreakpoint getBreakpointByIndex(int index); - - /** - * Shortcut to retrieve all breakpoints for the current process. - * - *

- * Uses {@link #getNumberBreakpoints()} and {@link #getBreakpointByIndex(int)} to enumerate all - * breakpoints for the current process. - * - * @return the list of retrieved breakpoints. - */ - default List getBreakpoints() { - int count = getNumberBreakpoints(); - List result = new ArrayList<>(count); - for (int i = 0; i < count; i++) { - try { - result.add(getBreakpointByIndex(i)); - } - catch (COMException e) { - if (!COMUtilsExtra.isE_NOINTERFACE(e)) { - throw e; - } - Msg.trace(this, "Discarding private breakpoint at index " + i); - } - } - return result; - } - - /** - * Get a breakpoint by ID - * - * According to the MSDN, though the IDs may be global, this method should only succeed for - * breakpoints belonging to the current process. - * - * @param id - * @return - */ - DebugBreakpoint getBreakpointById(int id); - - /** - * Add a (resolved) breakpoint with the given type and desired id - * - *

- * This is equivalent, in part, to the {@code bp} command. - * - * @param type the type - * @param desiredId the desired id - * @return the breakpoint, disabled at offset 0 - */ - DebugBreakpoint addBreakpoint(BreakType type, int desiredId); - - /** - * Add a (resolved) breakpoint with the given type and any id - * - *

- * This is equivalent, in part, to the {@code bp} command. - * - * @param type the type - * @return the breakpoint, disable at offset 0 - */ - DebugBreakpoint addBreakpoint(BreakType type); - - /** - * Add an unresolved breakpoint with the given type and desired id - * - *

- * This is equivalent, in part, to the {@code bu} command. See the MSDN for a comparison of - * {@code bu} and {@code bp}. - * - * @param type the type - * @param desiredId the desired id - * @return the breakpoint, disabled at offset 0 - */ - DebugBreakpoint addBreakpoint2(BreakType type, int desiredId); - - /** - * Add an unresolved breakpoint with the given type and any id - * - *

- * This is equivalent, in part, to the {@code bu} command. See the MSDN for a comparison of - * {@code bu} and {@code bp}. - * - * @param desiredId the desired id - * @return the breakpoint, disabled at offset 0 - */ - DebugBreakpoint addBreakpoint2(BreakType type); - - void waitForEvent(int timeout); - - DebugEventInformation getLastEventInformation(); - - DebugStackInformation getStackTrace(long frameOffset, long stackOffset, long instructionOffset); - - /** - * Shortcut for {@link #waitForEvent(int)} with infinite timeout. - */ - default void waitForEvent() { - waitForEvent(WinBase.INFINITE); - } - - int getActualProcessorType(); - - int getEffectiveProcessorType(); - - int getExecutingProcessorType(); - - int getDebuggeeType(); - - DebugFilterInformation getNumberEventFilters(); - - String getEventFilterText(int index, int size); - - String getEventFilterCommand(int index, int size); - - void setEventFilterCommand(int index, String text); - - DebugSpecificFilterInformation getSpecificFilterParameters(int start, int count); - - void setSpecificFilterParameters(int start, int count, DebugSpecificFilterInformation info); - - String getSpecificFilterArgument(int index, int size); - - void setSpecificFilterArgument(int index, String arg); - - DebugExceptionFilterInformation getExceptionFilterParameters(int start, int[] codes, int count); - - void setExceptionFilterParameters(int count, DebugExceptionFilterInformation info); - - String getExceptionFilterSecondCommand(int index, int size); - - void setExceptionFilterSecondCommand(int index, String cmd); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugControlReentrant.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugControlReentrant.java deleted file mode 100644 index 544d451e77..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugControlReentrant.java +++ /dev/null @@ -1,27 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng; - -import agent.dbgeng.dbgeng.DebugControl.DebugInterrupt; - -/** - * An interface containing the subset of {@link DebugControl} methods which are reentrant. - * - * All other methods should be called only by the thread which created the client. - */ -public interface DebugControlReentrant { - void setInterrupt(DebugInterrupt interrupt); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugDataSpaces.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugDataSpaces.java deleted file mode 100644 index 797f0b1a3f..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugDataSpaces.java +++ /dev/null @@ -1,290 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng; - -import java.nio.ByteBuffer; -import java.util.*; - -import com.sun.jna.platform.win32.COM.COMException; - -import ghidra.comm.util.BitmaskSet; -import ghidra.comm.util.BitmaskUniverse; -import ghidra.util.Msg; - -/** - * A wrapper for {@code IDebugDataSpaces} and its newer variants. - */ -public interface DebugDataSpaces { - public enum PageState { - COMMIT(0x1000), FREE(0x10000), RESERVE(0x2000); - - private final int val; - - private PageState(int val) { - this.val = val; - } - - public static PageState byValue(int val) { - for (PageState state : values()) { - if (state.val == val) { - return state; - } - } - Msg.warn(PageState.class, "No such value: 0x" + Integer.toHexString(val)); - return null; - } - } - - public enum PageProtection implements BitmaskUniverse { - NOACCESS(1 << 0, false, false, false), // - READONLY(1 << 1, true, false, false), // - READWRITE(1 << 2, true, true, false), // - WRITE_COPY(1 << 3, true, true, false), // Becomes READWRITE after copy - EXECUTE(1 << 4, false, false, true), // - EXECUTE_READ(1 << 5, true, false, true), // - EXECUTE_READWRITE(1 << 6, true, true, true), // - EXECUTE_WRITECOPY(1 << 7, true, true, true), // - // - GUARD(1 << 8, false, false, false), // - NOCACHE(1 << 9, false, false, false), // - WRITECOMBINE(1 << 10, false, false, false), // - ; - - private PageProtection(int mask, boolean isRead, boolean isWrite, boolean isExecute) { - this.mask = mask; - this.isRead = isRead; - this.isWrite = isWrite; - this.isExecute = isExecute; - } - - final int mask; - final boolean isRead; - final boolean isWrite; - final boolean isExecute; - - @Override - public long getMask() { - return mask; - } - - public boolean isRead() { - return isRead; - } - - public boolean isWrite() { - return isWrite; - } - - public boolean isExecute() { - return isExecute; - } - } - - public enum PageType { - NONE(0), // - IMAGE(0x1000000), // - MAPPED(0x40000), // - PRIVATE(0x20000), // - ; - - private final int val; - - private PageType(int val) { - this.val = val; - } - - public static PageType byValue(int val) { - for (PageType type : values()) { - if (type.val == val) { - return type; - } - } - Msg.warn(PageType.class, "No such value: 0x" + Integer.toHexString(val)); - return null; - } - } - - public static class DebugMemoryBasicInformation { - public final long baseAddress; - public final long allocationBase; - public final Set allocationProtect; - public final long regionSize; - public final PageState state; - public final Set protect; - public final PageType type; - - public DebugMemoryBasicInformation(long baseAddress, long allocationBase, - BitmaskSet allocationProtect, long regionSize, PageState state, - BitmaskSet protect, PageType type) { - this.baseAddress = baseAddress; - this.allocationBase = allocationBase; - this.allocationProtect = Collections.unmodifiableSet(allocationProtect); - this.regionSize = regionSize; - this.state = state; - this.protect = Collections.unmodifiableSet(protect); - this.type = type; - } - - @Override - public String toString() { - return ""; - } - - @Override - public int hashCode() { - return Objects.hash(baseAddress, allocationBase, allocationProtect, regionSize, state, - protect, type); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof DebugMemoryBasicInformation)) { - return false; - } - DebugMemoryBasicInformation that = (DebugMemoryBasicInformation) obj; - if (this.baseAddress != that.baseAddress) { - return false; - } - if (this.allocationBase != that.allocationBase) { - return false; - } - if (!this.allocationProtect.equals(that.allocationProtect)) { - return false; - } - if (this.regionSize != that.regionSize) { - return false; - } - if (this.state != that.state) { - return false; - } - if (!this.protect.equals(that.protect)) { - return false; - } - if (this.type != that.type) { - return false; - } - return true; - } - } - - int readVirtual(long offset, ByteBuffer into, int len); - - int writeVirtual(long offset, ByteBuffer from, int len); - - int readVirtualUncached(long offset, ByteBuffer into, int len); - - int writeVirtualUncached(long offset, ByteBuffer from, int len); - - int readPhysical(long offset, ByteBuffer into, int len); - - int writePhysical(long offset, ByteBuffer from, int len); - - int readControl(int processor, long offset, ByteBuffer into, int len); - - int writeControl(int processor, long offset, ByteBuffer from, int len); - - int readBusData(int busDataType, int busNumber, int slotNumber, long offset, ByteBuffer into, - int len); - - int writeBusData(int busDataType, int busNumber, int slotNumber, long offset, ByteBuffer from, - int len); - - int readIo(int interfaceType, int busNumber, int addressSpace, long offset, ByteBuffer into, - int len); - - int writeIo(int interfaceType, int busNumber, int addressSpace, long offset, ByteBuffer from, - int len); - - long readMsr(int msr); - - void writeMsr(int msr, long value); - - int readDebuggerData(int offset, ByteBuffer into, int len); - - DebugMemoryBasicInformation queryVirtual(long offset); - - long virtualToPhysical(long offset); - - /** - * A shortcut for iterating over virtual memory regions. - * - * This operates by calling {@link #queryVirtual(long)} to get each next entry, starting at an - * offset of -start-, adding the size of the returned region to determine the offset for the - * next call. - * - * @param start the starting offset - * @return an iterator over virtual memory regions after the given start - */ - default Iterable iterateVirtual(long start) { - return new Iterable() { - @Override - public Iterator iterator() { - return new Iterator() { - private long last = start; - private long offset = start; - private DebugMemoryBasicInformation next = doGetNext(); - - private DebugMemoryBasicInformation getNext() { - if (Long.compareUnsigned(last, offset) < 0) { - return doGetNext(); - } - return null; - } - - private DebugMemoryBasicInformation doGetNext() { - try { - DebugMemoryBasicInformation info = queryVirtual(offset); - last = offset; - if (info != null) { - offset += info.regionSize; - } - return info; - } - catch (COMException e) { - if (!COMUtilsExtra.isE_NOINTERFACE(e)) { - throw e; - } - return null; - } - } - - @Override - public boolean hasNext() { - return next != null; - } - - @Override - public DebugMemoryBasicInformation next() { - DebugMemoryBasicInformation ret = next; - next = getNext(); - if (ret.equals(next)) { - next = null; - } - return ret; - } - }; - } - }; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugEventCallbacks.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugEventCallbacks.java deleted file mode 100644 index 2cd1c6360f..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugEventCallbacks.java +++ /dev/null @@ -1,116 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng; - -import java.lang.annotation.*; - -import agent.dbgeng.dbgeng.DebugClient.*; -import ghidra.comm.util.BitmaskSet; -import ghidra.comm.util.BitmaskUniverse; - -/** - * The interface for receiving event callbacks via {@code IDebugEventCallbacks} or a newer variant. - * - * Note: The wrapper implementation will select the appropriate native interface version. - * - * Note: Even though {@link #changeDebuggeeState(BitmaskSet, long)}, - * {@link #changeEngineState(BitmaskSet, long)} and {@link #changeSymbolState(BitmaskSet, long)} - * purport to return a {@link DebugStatus}, the returned value is ignored by {@code dbgeng.dll}. - */ -public interface DebugEventCallbacks { - public static enum DebugEvent implements BitmaskUniverse { - BREAKPOINT(1 << 0), // - EXCEPTION(1 << 1), // - CREATE_THREAD(1 << 2), // - EXIT_THREAD(1 << 3), // - CREATE_PROCESS(1 << 4), // - EXIT_PROCESS(1 << 5), // - LOAD_MODULE(1 << 6), // - UNLOAD_MODULE(1 << 7), // - SYSTEM_ERROR(1 << 8), // - SESSION_STATUS(1 << 9), // - CHANGE_DEBUGEE_STATE(1 << 10), // - CHANGE_ENGINE_STATE(1 << 11), // - CHANGE_SYMBOL_STATE(1 << 12), // - ; - - private DebugEvent(int mask) { - this.mask = mask; - } - - private final int mask; - - @Override - public long getMask() { - return mask; - } - } - - /** - * An annotation for marking each callback with its interest flag. - */ - @Target(ElementType.METHOD) - @Retention(RetentionPolicy.RUNTIME) - static @interface ForInterest { - /** - * The flag corresponding to the annotated callback method - * - * @return the flag - */ - DebugEvent value(); - } - - BitmaskSet getInterestMask(); - - @ForInterest(DebugEvent.BREAKPOINT) - DebugStatus breakpoint(DebugBreakpoint bp); - - @ForInterest(DebugEvent.EXCEPTION) - DebugStatus exception(DebugExceptionRecord64 exception, boolean firstChance); - - @ForInterest(DebugEvent.CREATE_THREAD) - DebugStatus createThread(DebugThreadInfo debugThreadInfo); - - @ForInterest(DebugEvent.EXIT_THREAD) - DebugStatus exitThread(int exitCode); - - @ForInterest(DebugEvent.CREATE_PROCESS) - DebugStatus createProcess(DebugProcessInfo debugProcessInfo); - - @ForInterest(DebugEvent.EXIT_PROCESS) - DebugStatus exitProcess(int exitCode); - - @ForInterest(DebugEvent.LOAD_MODULE) - DebugStatus loadModule(DebugModuleInfo debugModuleInfo); - - @ForInterest(DebugEvent.UNLOAD_MODULE) - DebugStatus unloadModule(String imageBaseName, long baseOffset); - - @ForInterest(DebugEvent.SYSTEM_ERROR) - DebugStatus systemError(int error, int level); - - @ForInterest(DebugEvent.SESSION_STATUS) - DebugStatus sessionStatus(SessionStatus status); - - @ForInterest(DebugEvent.CHANGE_DEBUGEE_STATE) - DebugStatus changeDebuggeeState(BitmaskSet flags, long argument); - - @ForInterest(DebugEvent.CHANGE_ENGINE_STATE) - DebugStatus changeEngineState(BitmaskSet flags, long argument); - - @ForInterest(DebugEvent.CHANGE_SYMBOL_STATE) - DebugStatus changeSymbolState(BitmaskSet flags, long argument); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugEventInformation.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugEventInformation.java deleted file mode 100644 index 12918fe060..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugEventInformation.java +++ /dev/null @@ -1,70 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng; - -import agent.dbgeng.jna.dbgeng.WinNTExtra; - -public class DebugEventInformation { - - private int type; - private DebugProcessId pid; - private DebugThreadId tid; - private DebugSessionId sid; - private int executingProcessorType = WinNTExtra.Machine.IMAGE_FILE_MACHINE_AMD64.val; - - public DebugEventInformation(int type, int pid, int tid) { - this.type = type; - this.pid = new DebugProcessRecord(pid); - this.tid = new DebugThreadRecord(tid); - } - - public int getType() { - return type; - } - - public DebugSessionId getSessionId() { - return sid; - } - - public DebugProcessId getProcessId() { - return pid; - } - - public DebugThreadId getThreadId() { - return tid; - } - - public void setThread(DebugThreadId tid) { - this.tid = tid; - } - - public void setProcess(DebugProcessId pid) { - this.pid = pid; - } - - public void setSession(DebugSessionId sid) { - this.sid = sid; - } - - public int getExecutingProcessorType() { - return executingProcessorType; - } - - public void setExecutingProcessorType(int execType) { - this.executingProcessorType = execType; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugExceptionFilterInformation.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugExceptionFilterInformation.java deleted file mode 100644 index 252afcdc85..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugExceptionFilterInformation.java +++ /dev/null @@ -1,42 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng; - -import agent.dbgeng.jna.dbgeng.DbgEngNative.DEBUG_EXCEPTION_FILTER_PARAMETERS; - -public class DebugExceptionFilterInformation { - - private int nParams; - private DEBUG_EXCEPTION_FILTER_PARAMETERS[] parameters; - - public DebugExceptionFilterInformation(int nParams, - DEBUG_EXCEPTION_FILTER_PARAMETERS[] parameters) { - this.nParams = nParams; - this.parameters = parameters; - } - - public int getNumberOfParameters() { - return nParams; - } - - public DEBUG_EXCEPTION_FILTER_PARAMETERS getParameter(int paramNumber) { - return parameters[paramNumber]; - } - - public DEBUG_EXCEPTION_FILTER_PARAMETERS[] getParameters() { - return parameters; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugExceptionRecord64.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugExceptionRecord64.java deleted file mode 100644 index 447e0cc775..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugExceptionRecord64.java +++ /dev/null @@ -1,41 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng; - -import java.util.Collections; -import java.util.List; - -/** - * Data copied from a {@code EXCEPTION_RECORD64} as defined in {@code winnt.h}. - * - * TODO: Some enums, flags, etc., to help interpret some of the fields. - */ -public class DebugExceptionRecord64 { - public final int code; // TODO: How to interpret - public final int flags; // TODO: How to interpret - public final long record; // TODO: How to interpret - public final long address; - public final List information; - - public DebugExceptionRecord64(int code, int flags, long record, long address, - List information) { - this.code = code; - this.flags = flags; - this.record = record; - this.address = address; - this.information = Collections.unmodifiableList(information); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugFilterInformation.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugFilterInformation.java deleted file mode 100644 index 5b22b62212..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugFilterInformation.java +++ /dev/null @@ -1,42 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng; - -public class DebugFilterInformation { - - private int nEvents; - private int nSpecificExceptions; - private int nArbitraryExceptions; - - public DebugFilterInformation(int nEvents, int nSpecificExceptions, int nArbitraryExceptions) { - this.nEvents = nEvents; - this.nSpecificExceptions = nSpecificExceptions; - this.nArbitraryExceptions = nArbitraryExceptions; - } - - public int getNumberEvents() { - return nEvents; - } - - public int getNumberSpecificExceptions() { - return nSpecificExceptions; - } - - public int getNumberArbitraryExceptions() { - return nArbitraryExceptions; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugInputCallbacks.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugInputCallbacks.java deleted file mode 100644 index d6f1507a0f..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugInputCallbacks.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng; - -/** - * The interface for receiving input callbacks via {@code IDebugInputCallbacks} or a newer variant. - * - * Note: The wrapper implementation will select the appropriate native interface version. - */ -@FunctionalInterface -public interface DebugInputCallbacks { - - public void startInput(long bufferSize); - - default void endInput() { - // Optional implementation - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugModule.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugModule.java deleted file mode 100644 index df524160d1..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugModule.java +++ /dev/null @@ -1,47 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng; - -/** - * Handle to a module (program or library image). - */ -public interface DebugModule { - public enum DebugModuleName { - IMAGE, MODULE, LOADED_IMAGE, SYMBOL_FILE, MAPPED_IMAGE; - } - - /** - * Get a name for the module. - * - * @param which identifies which name - * @return the requested name, if available - */ - String getName(DebugModuleName which); - - /** - * Get the index assigned to this module. - * - * @return the index - */ - int getIndex(); - - /** - * Get the base address where this module is loaded, if applicable. - * - * @return the base address - */ - long getBase(); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugModuleInfo.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugModuleInfo.java deleted file mode 100644 index 58973e5813..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugModuleInfo.java +++ /dev/null @@ -1,64 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng; - -/** - * Information about a module (program or library image). - * - * The fields correspond to the parameters taken by {@code LoadModule} of - * {@code IDebugEventCallbacks}. They also appear as a subset of parameters taken by - * {@code CreateProcess} of {@code IDebugEventCallbacks}. - */ -public class DebugModuleInfo { - public final long imageFileHandle; - public final long baseOffset; - public final int moduleSize; - public final int checkSum; - public final int timeDateStamp; - private String moduleName; - private String imageName; - - public DebugModuleInfo(long imageFileHandle, long baseOffset, int moduleSize, String moduleName, - String imageName, int checkSum, int timeDateStamp) { - this.imageFileHandle = imageFileHandle; - this.baseOffset = baseOffset; - this.moduleSize = moduleSize; - this.setModuleName(moduleName); - this.setImageName(imageName); - this.checkSum = checkSum; - this.timeDateStamp = timeDateStamp; // TODO: Convert to DateTime? - } - - public String toString() { - return Long.toHexString(baseOffset); - } - - public String getModuleName() { - return moduleName; - } - - public void setModuleName(String moduleName) { - this.moduleName = moduleName; - } - - public String getImageName() { - return imageName; - } - - public void setImageName(String imageName) { - this.imageName = imageName; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugOutputCallbacks.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugOutputCallbacks.java deleted file mode 100644 index 26fe938dcc..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugOutputCallbacks.java +++ /dev/null @@ -1,32 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng; - -import agent.dbgeng.dbgeng.DebugControl.DebugOutputLevel; - -/** - * The interface for receiving output callbacks via {@code IDebugOutputCallbacks} or a newer - * variant. - * - * Note: The wrapper implementation will select the apprirate native interface version. - * - * TODO: Change {@link #output(int, String)} {@code mask} parameter to use {@link DebugOutputLevel} - * flags. - */ -@FunctionalInterface -public interface DebugOutputCallbacks { - void output(int mask, String text); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugProcessId.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugProcessId.java deleted file mode 100644 index bd30def161..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugProcessId.java +++ /dev/null @@ -1,38 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng; - -/** - * The engine ID assigned to a debugged process. - * - * Note: This is not the same as the "PID." {@code dbgeng.dll} calls that the system ID of - * the process. - * - * This is essentially just a boxed integer, but having an explicit data type prevents confusion - * with other integral values. In particular, this prevents confusion of engine PIDs with system - * PIDs. - */ -public interface DebugProcessId extends Comparable { - - public String id(); - public long value(); - public boolean isSystem(); - - @Override - public default int compareTo(DebugProcessId that) { - return this.id().compareTo(that.id()); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugProcessInfo.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugProcessInfo.java deleted file mode 100644 index 714fcb61f3..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugProcessInfo.java +++ /dev/null @@ -1,36 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng; - -/** - * Information about a process. - * - * The fields correspond to parameters taken by {@code CreateProcess} of - * {@code IDebugEventCallbacks}. Note that parameters common to other callbacks have been factored - * into types aggregated here. - */ -public class DebugProcessInfo { - public final long handle; - public final DebugModuleInfo moduleInfo; - public final DebugThreadInfo initialThreadInfo; - - public DebugProcessInfo(long handle, DebugModuleInfo moduleInfo, - DebugThreadInfo initialThreadInfo) { - this.handle = handle; - this.moduleInfo = moduleInfo; - this.initialThreadInfo = initialThreadInfo; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugProcessRecord.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugProcessRecord.java deleted file mode 100644 index 8421c27885..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugProcessRecord.java +++ /dev/null @@ -1,34 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng; - -public record DebugProcessRecord(long value) implements DebugProcessId { - - @Override - public boolean isSystem() { - return false; - } - - @Override - public String id() { - return Long.toHexString(value); - } - - @Override - public String toString() { - return ""; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugRegisters.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugRegisters.java deleted file mode 100644 index 6574f72987..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugRegisters.java +++ /dev/null @@ -1,158 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng; - -import java.util.*; - -import agent.dbgeng.dbgeng.DebugValue.DebugValueType; -import ghidra.comm.util.BitmaskSet; -import ghidra.comm.util.BitmaskUniverse; - -/** - * A wrapper for {@code IDebugRegisters} and its newer variants. - */ -public interface DebugRegisters { - public static enum DebugRegisterSource { - DEBUG_REGSRC_DEBUGGEE, // - DEBUG_REGSRC_EXPLICIT, // - DEBUG_REGSRC_FRAME, // - ; - } - - public static enum DebugRegisterFlags implements BitmaskUniverse { - SUB_REGISTER(1 << 0), // - ; - - private DebugRegisterFlags(int mask) { - this.mask = mask; - } - - private final int mask; - - @Override - public long getMask() { - return mask; - } - } - - public static class DebugRegisterDescription { - public final String name; - public final int index; - public final DebugValueType type; - public final Set flags; - public final int subregMaster; - public final int subregLengthBits; - public final long subregMask; - public final int subregShift; - - public DebugRegisterDescription(String name, int index, DebugValueType type, - BitmaskSet flags, int subregMaster, int subregLengthBits, - long subregMask, int subregShift) { - this.name = name; - this.index = index; - this.type = type; - this.flags = Collections.unmodifiableSet(flags); - this.subregMaster = subregMaster; - this.subregLengthBits = subregLengthBits; - this.subregMask = subregMask; - this.subregShift = subregShift; - } - - @Override - public String toString() { - return String.format( - "<%s: name='%s' index=%d type=%s flags=%s subregMaster=%d subregLengthBits=%d" + - " subregMask=%x subregShift=%d>", - getClass().getSimpleName(), name, index, type, flags, subregMaster, - subregLengthBits, subregMask, subregShift); - } - } - - int getNumberRegisters(); - - DebugRegisterDescription getDescription(int registerNumber); - - /** - * A shortcut to get all register descriptions for the current process. - * - * Uses {@link #getNumberRegisters()} and {@link #getDescription(int)} to retrieve all - * descriptions for the current process. - * - * @return the list of register descriptions - */ - default Set getAllDescriptions() { - Set result = new LinkedHashSet<>(); - int count = getNumberRegisters(); - for (int i = 0; i < count; i++) { - result.add(getDescription(i)); - } - return result; - } - - int getIndexByName(String name); - - /** - * A shortcut to get many register indices in one call. - * - * Uses {@link #getIndexByName(String)}. - * - * @param names the names whose indices to get - * @return the indices in respective order to the given names - */ - default int[] getIndicesByNames(String... names) { - int[] indices = new int[names.length]; - for (int i = 0; i < names.length; i++) { - indices[i] = getIndexByName(names[i]); - } - return indices; - } - - DebugValue getValue(int index); - - Map getValues(DebugRegisterSource source, Collection indices); - - /** - * A shortcut to get a register value by name. - * - * Uses {@link #getIndexByName(String)} followed by {@link #getValue(int)}. - * - * @param name the name of the register - * @return the value - */ - default DebugValue getValueByName(String name) { - int indexByName = getIndexByName(name); - if (indexByName >= 0) { - return getValue(indexByName); - } - return null; - } - - void setValue(int index, DebugValue value); - - void setValues(DebugRegisterSource source, Map values); - - /** - * A shortcut to set a register value by name. - * - * Uses {@link #getIndexByName(String)} followed by {@link #setValue(int, DebugValue)}. - * - * @param name the name of the register - * @param value the desired value - */ - default void setValueByName(String name, DebugValue value) { - setValue(getIndexByName(name), value); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugRunningProcess.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugRunningProcess.java deleted file mode 100644 index 082638ef6a..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugRunningProcess.java +++ /dev/null @@ -1,123 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng; - -import agent.dbgeng.dbgeng.DebugRunningProcess.Description.ProcessDescriptionFlags; -import ghidra.comm.util.BitmaskUniverse; - -/** - * Information about a running process, not necessarily a debugged process. - */ -public interface DebugRunningProcess { - /** - * Description of a running process - */ - public static class Description { - public static enum ProcessDescriptionFlags implements BitmaskUniverse { - NO_PATHS(1 << 0), // - NO_SERVICES(1 << 1), // - NO_MTS_PACKAGES(1 << 2), // - NO_COMMAND_LINE(1 << 3), // - NO_SESSION_ID(1 << 4), // - NO_USER_NAME(1 << 5), // - ; - - ProcessDescriptionFlags(int mask) { - this.mask = mask; - } - - private final int mask; - - @Override - public long getMask() { - return mask; - } - } - - public Description(int systemId, String exeName, String description) { - this.systemId = systemId; - this.exeName = exeName; - this.description = description; - } - - private final int systemId; - private final String exeName; - private final String description; - - /** - * The system ID (PID) for the process. - * - * @return the PID - */ - public int getSystemId() { - return systemId; - } - - /** - * The name of the executable defining the process - * - * @return the name - */ - public String getExecutableName() { - return exeName; - } - - /** - * A textual description of the process. - * - * @return the description - */ - public String getDescription() { - return description; - } - - @Override - public String toString() { - return String.format("PID:%d, EXE:%s, Description:%s", systemId, exeName, description); - } - } - - /** - * The system ID (PID) for the process. - * - * @return the PID - */ - int getSystemId(); - - /** - * Get the "full" description of the process. - * - * @param flags indicate which information to include in the description - * @return the description - */ - Description getFullDescription(ProcessDescriptionFlags... flags); - - /** - * The name of the executable defining the process. - * - * @param flags indicate which information to include in the description - * @return the name - */ - String getExecutableName(ProcessDescriptionFlags... flags); - - /** - * A textual description of the process. - * - * @param flags indicate which information to include in the description - * @return the description - */ - String getDescription(ProcessDescriptionFlags... flags); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugServerId.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugServerId.java deleted file mode 100644 index d44683ab86..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugServerId.java +++ /dev/null @@ -1,58 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng; - -/** - * The ID of a debug server. - * - * Each server to which a client is connected is assigned a server ID. The local server, to which - * every client is connected by default, has the ID 0. This is essentially just a boxed integer, but - * having an explicit data type prevents confusion with other integral values. - */ -public class DebugServerId implements Comparable { - public final long id; - - public DebugServerId(long id) { - this.id = id; - } - - @Override - public int hashCode() { - return Long.hashCode(id); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof DebugServerId)) { - return false; - } - DebugServerId that = (DebugServerId) obj; - if (this.id != that.id) { - return false; - } - return true; - } - - @Override - public int compareTo(DebugServerId that) { - return Long.compare(this.id, that.id); - } - - @Override - public String toString() { - return ""; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugSessionId.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugSessionId.java deleted file mode 100644 index 93035b5b3c..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugSessionId.java +++ /dev/null @@ -1,38 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng; - -/** - * The engine ID assigned to a debugged process. - * - * Note: This is not the same as the "PID." {@code dbgeng.dll} calls that the system ID of - * the process. - * - * This is essentially just a boxed integer, but having an explicit data type prevents confusion - * with other integral values. In particular, this prevents confusion of engine PIDs with system - * PIDs. - */ -public interface DebugSessionId extends Comparable { - - public String id(); - public long value(); - public boolean isSystem(); - - @Override - public default int compareTo(DebugSessionId that) { - return this.id().compareTo(that.id()); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugSessionRecord.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugSessionRecord.java deleted file mode 100644 index cb9373367e..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugSessionRecord.java +++ /dev/null @@ -1,34 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng; - -public record DebugSessionRecord(long value) implements DebugSessionId { - - @Override - public boolean isSystem() { - return false; - } - - @Override - public String id() { - return Long.toHexString(value); - } - - @Override - public String toString() { - return ""; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugSpecificFilterInformation.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugSpecificFilterInformation.java deleted file mode 100644 index b1cd3e8808..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugSpecificFilterInformation.java +++ /dev/null @@ -1,42 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng; - -import agent.dbgeng.jna.dbgeng.DbgEngNative.DEBUG_SPECIFIC_FILTER_PARAMETERS; - -public class DebugSpecificFilterInformation { - - private int nParams; - private DEBUG_SPECIFIC_FILTER_PARAMETERS[] parameters; - - public DebugSpecificFilterInformation(int nParams, - DEBUG_SPECIFIC_FILTER_PARAMETERS[] parameters) { - this.nParams = nParams; - this.parameters = parameters; - } - - public int getNumberOfParameters() { - return nParams; - } - - public DEBUG_SPECIFIC_FILTER_PARAMETERS getParameter(int paramNumber) { - return parameters[paramNumber]; - } - - public DEBUG_SPECIFIC_FILTER_PARAMETERS[] getParameters() { - return parameters; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugStackInformation.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugStackInformation.java deleted file mode 100644 index a63be6271f..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugStackInformation.java +++ /dev/null @@ -1,37 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng; - -import agent.dbgeng.jna.dbgeng.DbgEngNative.DEBUG_STACK_FRAME; - -public class DebugStackInformation { - - private int nFrames; - private DEBUG_STACK_FRAME[] stackFrames; - - public DebugStackInformation(int nFrames, DEBUG_STACK_FRAME[] stackFrames) { - this.nFrames = nFrames; - this.stackFrames = stackFrames; - } - - public int getNumberOfFrames() { - return nFrames; - } - - public DEBUG_STACK_FRAME getFrame(int frameNumber) { - return stackFrames[frameNumber]; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugSymbolEntry.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugSymbolEntry.java deleted file mode 100644 index fe0904ae67..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugSymbolEntry.java +++ /dev/null @@ -1,56 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng; - -/** - * Data copied from a {@code DEBUG_SYMBOL_ENTRY} as defined in {@code dbgeng.h}. - * - * TODO: Some enums, flags, etc., to help interpret some of the fields. - */ -public class DebugSymbolEntry { - public final long moduleBase; - public final long offset; - public final long symbolId; - public final long size; - public final int flags; - public final int typeId; - public final String name; - public final int tag; - - public DebugSymbolEntry(long moduleBase, long offset, long symbolId, long size, int flags, - int typeId, String name, int tag) { - this.moduleBase = moduleBase; - this.offset = offset; - this.symbolId = symbolId; - this.size = size; - this.flags = flags; - this.typeId = typeId; - this.name = name; - this.tag = tag; - } - - @Override - public String toString() { - return String.format("", // - moduleBase, symbolId, offset, size, flags, typeId, name, tag); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugSymbolId.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugSymbolId.java deleted file mode 100644 index 451093b95b..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugSymbolId.java +++ /dev/null @@ -1,34 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng; - -/** - * Symbol identifier, consisting of module ID and symbol index. - */ -public class DebugSymbolId { - public final long moduleBase; - public final long symbolIndex; - - public DebugSymbolId(long moduleBase, long symbolIndex) { - this.moduleBase = moduleBase; - this.symbolIndex = symbolIndex; - } - - @Override - public String toString() { - return String.format("", moduleBase, symbolIndex); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugSymbolName.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugSymbolName.java deleted file mode 100644 index 325d6db4ff..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugSymbolName.java +++ /dev/null @@ -1,34 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng; - -/** - * Symbol name, consisting of textual name and offset. - */ -public class DebugSymbolName { - public final String name; - public final long offset; - - public DebugSymbolName(String name, long offset) { - this.name = name; - this.offset = offset; - } - - @Override - public String toString() { - return String.format("<%016x: %s>", offset, name); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugSymbols.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugSymbols.java deleted file mode 100644 index 3f7b990f1d..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugSymbols.java +++ /dev/null @@ -1,85 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng; - -import java.util.Iterator; -import java.util.List; - -/** - * A wrapper for {@code IDebugSymbols} and its newer variants. - */ -public interface DebugSymbols { - int getNumberLoadedModules(); - - int getNumberUnloadedModules(); - - DebugModule getModuleByIndex(int index); - - DebugModule getModuleByModuleName(String name, int startIndex); - - DebugModule getModuleByOffset(long offset, int startIndex); - - DebugModuleInfo getModuleParameters(int count, int startIndex); - - /** - * A shortcut for iterating over all loaded modules, lazily. - * - * @param startIndex the module index to start at - * @return an iterator over modules starting at the given index - */ - default Iterable iterateModules(int startIndex) { - int count = getNumberLoadedModules(); // TODO: What about unloaded? - return new Iterable() { - @Override - public Iterator iterator() { - return new Iterator() { - int cur = startIndex; - - @Override - public boolean hasNext() { - return cur < count; - } - - @Override - public DebugModule next() { - DebugModule ret = getModuleByIndex(cur); - cur++; - return ret; - } - }; - } - }; - } - - Iterable iterateSymbolMatches(String pattern); - - List getSymbolIdsByName(String pattern); - - DebugSymbolEntry getSymbolEntry(DebugSymbolId id); - - String getSymbolPath(); - - void setSymbolPath(String path); - - int getSymbolOptions(); - - void setSymbolOptions(int options); - - public int getCurrentScopeFrameIndex(); - - public void setCurrentScopeFrameIndex(int index); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugSystemObjects.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugSystemObjects.java deleted file mode 100644 index c6193c44ed..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugSystemObjects.java +++ /dev/null @@ -1,116 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng; - -import java.util.ArrayList; -import java.util.List; - -/** - * A wrapper for {@code IDebugSystemObjects} and its newer variants. - */ -public interface DebugSystemObjects { - - DebugThreadId getEventThread(); - - DebugProcessId getEventProcess(); - - DebugSessionId getEventSystem(); - - DebugThreadId getCurrentThreadId(); - - void setCurrentThreadId(DebugThreadId id); - - DebugProcessId getCurrentProcessId(); - - void setCurrentProcessId(DebugProcessId id); - - DebugSessionId getCurrentSystemId(); - - void setCurrentSystemId(DebugSessionId id); - - int getNumberThreads(); - - int getTotalNumberThreads(); // TODO: LargestProcess? - - /** - * Get the threads IDs by index from the current process - * - * @param start the starting index - * @param count the number of threads - * @return the list of thread IDs - */ - List getThreads(int start, int count); - - /** - * Get all thread IDs in the current process - * - * @return the list of thread IDs - */ - default List getThreads() { - return getThreads(0, getNumberThreads()); - } - - DebugThreadId getThreadIdByHandle(long handle); - - DebugProcessId getProcessIdByHandle(long handle); - - int getNumberSystems(); - - List getSystems(int start, int count); - - default List getSessions() { - int numberSystems = getNumberSystems(); - if (numberSystems < 0) { - return new ArrayList(); - } - return getSystems(0, numberSystems); - } - - int getNumberProcesses(); - - List getProcesses(int start, int count); - - default List getProcesses() { - int numberProcesses = getNumberProcesses(); - if (numberProcesses < 0) { - return new ArrayList(); - } - return getProcesses(0, numberProcesses); - } - - int getCurrentThreadSystemId(); - - int getCurrentProcessSystemId(); - - DebugThreadId getThreadIdBySystemId(int systemId); - - DebugProcessId getProcessIdBySystemId(int systemId); - - long getCurrentThreadDataOffset(); - - long getCurrentProcessDataOffset(); - - long getImplicitThreadDataOffset(); - - long getImplicitProcessDataOffset(); - - void setImplicitThreadDataOffset(long systemOffset); - - void setImplicitProcessDataOffset(long systemOffset); - - String getCurrentProcessExecutableName(); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugSystemProcessRecord.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugSystemProcessRecord.java deleted file mode 100644 index a6994a4a7c..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugSystemProcessRecord.java +++ /dev/null @@ -1,34 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng; - -public record DebugSystemProcessRecord(long value) implements DebugProcessId { - - @Override - public boolean isSystem() { - return true; - } - - @Override - public String id() { - return "SYS"+Long.toHexString(value); - } - - @Override - public String toString() { - return ""; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugSystemSessionRecord.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugSystemSessionRecord.java deleted file mode 100644 index 2832002392..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugSystemSessionRecord.java +++ /dev/null @@ -1,34 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng; - -public record DebugSystemSessionRecord(long value) implements DebugSessionId { - - @Override - public boolean isSystem() { - return true; - } - - @Override - public String id() { - return "SYS"+Long.toHexString(value); - } - - @Override - public String toString() { - return ""; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugSystemThreadRecord.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugSystemThreadRecord.java deleted file mode 100644 index ddb2cc9aec..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugSystemThreadRecord.java +++ /dev/null @@ -1,34 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng; - -public record DebugSystemThreadRecord(long value) implements DebugThreadId { - - @Override - public boolean isSystem() { - return true; - } - - @Override - public String id() { - return "PCR"+Long.toHexString(value); - } - - @Override - public String toString() { - return ""; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugThreadId.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugThreadId.java deleted file mode 100644 index cc5bf04ec4..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugThreadId.java +++ /dev/null @@ -1,39 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng; - -/** - * The engine ID assigned to a debugged thread. - * - * Note: This is not the same as the "TID." {@code dbgeng.dll} calls that the system ID of - * the thread. - * - * This is essentially just a boxed integer, but having an explicit data type prevents confusion - * with other integral values. In particular, this prevents confusion of engine TIDs with system - * TIDs. - */ -public interface DebugThreadId extends Comparable { - - public String id(); - public long value(); - public boolean isSystem(); - - @Override - public default int compareTo(DebugThreadId that) { - return this.id().compareTo(that.id()); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugThreadInfo.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugThreadInfo.java deleted file mode 100644 index a497c95f6b..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugThreadInfo.java +++ /dev/null @@ -1,43 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng; - -/** - * Information about a thread. - * - *

- * The fields correspond to parameters taken by {@code CreateThread} of - * {@code IDebugEventCallbacks}. They also appear as a subset of parameters taken by - * {@code CreateProcess} of {@code IDebugEventCallbacks}. - */ -public class DebugThreadInfo { - public final long handle; - public final long dataOffset; - public final long startOffset; - - public DebugThreadInfo(long handle, long dataOffset, long startOffset) { - this.handle = handle; - this.dataOffset = dataOffset; - this.startOffset = startOffset; - } - - @Override - public String toString() { - return String.format("<%s@%08x handle=0x%04x,dataOffset=0x%08x,startOffset=0x%08x>", - getClass().getSimpleName(), System.identityHashCode(this), - handle, dataOffset, startOffset); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugThreadRecord.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugThreadRecord.java deleted file mode 100644 index 8a4798f074..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugThreadRecord.java +++ /dev/null @@ -1,34 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng; - -public record DebugThreadRecord(long value) implements DebugThreadId { - - @Override - public boolean isSystem() { - return false; - } - - @Override - public String id() { - return Long.toHexString(value); - } - - @Override - public String toString() { - return ""; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugValue.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugValue.java deleted file mode 100644 index 28f3af5fb0..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/DebugValue.java +++ /dev/null @@ -1,457 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng; - -import java.lang.annotation.*; -import java.lang.reflect.InvocationTargetException; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; -import java.util.Arrays; - -import agent.dbgeng.dbgeng.DebugValue.DebugValueType; -import agent.dbgeng.dbgeng.DebugValue.ForDebugValueType; -import ghidra.util.NumericUtilities; - -/** - * Data copied from a {@code DEBUG_VALUE} as defined in {dbgeng.h}. - */ -@ForDebugValueType(DebugValueType.INVALID) -public interface DebugValue { - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - public static @interface ForDebugValueType { - DebugValueType value(); - } - - public static enum DebugValueType { - INVALID(0), // - INT8(Byte.SIZE), // - INT16(Short.SIZE), // - INT32(Integer.SIZE), // - INT64(Long.SIZE), // - FLOAT32(Float.SIZE), // - FLOAT64(Double.SIZE), // - FLOAT80(80), // - FLOAT82(82), // - FLOAT128(128), // - VECTOR64(64), // - VECTOR128(128), // - ; - - private static final Class[] CLASSES; - - static { - @SuppressWarnings("unchecked") - Class[] supressed = new Class[DebugValueType.values().length]; - CLASSES = supressed; - for (Class cls : DebugValue.class.getDeclaredClasses()) { - if (!DebugValue.class.isAssignableFrom(cls)) { - continue; - } - Class dvCls = cls.asSubclass(DebugValue.class); - DebugValueType type = getDebugValueTypeForClass(dvCls); - CLASSES[type.ordinal()] = dvCls; - } - } - - public static DebugValueType getDebugValueTypeForClass(Class cls) { - ForDebugValueType annot = cls.getAnnotation(ForDebugValueType.class); - if (annot == null) { - throw new AssertionError( - "INTERNAL: Missing ForDebugValueType annotation on " + cls); - } - return annot.value(); - } - - public final int bitLength; - public final int byteLength; - - private DebugValueType(int bitLength) { - this.bitLength = bitLength; - this.byteLength = (bitLength + 7) / 8; - } - - public Class getDebugValueClass() { - return CLASSES[ordinal()]; - } - - public DebugValue decodeBytes(byte[] bytes) throws IllegalArgumentException { - try { - return CLASSES[ordinal()].getConstructor(byte[].class).newInstance(bytes); - } - catch (InstantiationException | IllegalAccessException | IllegalArgumentException - | NoSuchMethodException | SecurityException e) { - throw new AssertionError(e); - } - catch (InvocationTargetException e) { - if (e.getCause() instanceof IllegalArgumentException) { - throw (IllegalArgumentException) e.getCause(); - } - throw new AssertionError(e); - } - } - } - - @ForDebugValueType(DebugValueType.INT8) - public static class DebugInt8Value implements DebugValue { - private final byte value; - - public DebugInt8Value(byte value) { - this.value = value; - } - - public DebugInt8Value(byte[] bytes) { - if (bytes.length != 1) { - throw new IllegalArgumentException("Must have exactly 1 byte"); - } - this.value = bytes[0]; - } - - public byte byteValue() { - return value; - } - - @Override - public byte[] encodeAsBytes() { - return new byte[] { value }; - } - - @Override - public String toString() { - return "byte " + Integer.toHexString(value) + "h"; - } - } - - @ForDebugValueType(DebugValueType.INT16) - public static class DebugInt16Value implements DebugValue { - private final short value; - - public DebugInt16Value(short value) { - this.value = value; - } - - public DebugInt16Value(byte[] bytes) { - if (bytes.length != Short.BYTES) { - throw new IllegalArgumentException("Must have exactly " + Short.BYTES + " bytes"); - } - ByteBuffer buf = ByteBuffer.wrap(bytes).order(ByteOrder.BIG_ENDIAN); - this.value = buf.getShort(); - } - - public short shortValue() { - return value; - } - - @Override - public byte[] encodeAsBytes() { - ByteBuffer buf = ByteBuffer.allocate(Short.BYTES).order(ByteOrder.BIG_ENDIAN); - buf.putShort(value); - return buf.array(); - } - - @Override - public String toString() { - return "word " + Integer.toHexString(value) + "h"; - } - } - - @ForDebugValueType(DebugValueType.INT32) - public static class DebugInt32Value implements DebugValue { - private final int value; - - public DebugInt32Value(int value) { - this.value = value; - } - - public DebugInt32Value(byte[] bytes) { - if (bytes.length != Integer.BYTES) { - throw new IllegalArgumentException("Must have exactly " + Integer.BYTES + " bytes"); - } - ByteBuffer buf = ByteBuffer.wrap(bytes).order(ByteOrder.BIG_ENDIAN); - this.value = buf.getInt(); - } - - public int intValue() { - return value; - } - - @Override - public byte[] encodeAsBytes() { - ByteBuffer buf = ByteBuffer.allocate(Integer.BYTES).order(ByteOrder.BIG_ENDIAN); - buf.putInt(value); - return buf.array(); - } - - @Override - public String toString() { - return "dword " + Integer.toHexString(value) + "h"; - } - } - - @ForDebugValueType(DebugValueType.INT64) - public static class DebugInt64Value implements DebugValue { - private final long value; - - public DebugInt64Value(long value) { - this.value = value; - } - - public DebugInt64Value(byte[] bytes) { - if (bytes.length != Long.BYTES) { - throw new IllegalArgumentException("Must have exactly " + Long.BYTES + " bytes"); - } - ByteBuffer buf = ByteBuffer.wrap(bytes).order(ByteOrder.BIG_ENDIAN); - this.value = buf.getLong(); - } - - public long longValue() { - return value; - } - - @Override - public byte[] encodeAsBytes() { - ByteBuffer buf = ByteBuffer.allocate(Long.BYTES).order(ByteOrder.BIG_ENDIAN); - buf.putLong(value); - return buf.array(); - } - - @Override - public String toString() { - return "qword " + Long.toHexString(value) + "h"; - } - } - - @ForDebugValueType(DebugValueType.FLOAT32) - public static class DebugFloat32Value implements DebugValue { - private final float value; - - public DebugFloat32Value(float value) { - this.value = value; - } - - public DebugFloat32Value(byte[] bytes) { - if (bytes.length != Float.BYTES) { - throw new IllegalArgumentException("Must have exactly " + Float.BYTES + " bytes"); - } - ByteBuffer buf = ByteBuffer.wrap(bytes).order(ByteOrder.BIG_ENDIAN); - this.value = buf.getFloat(); - } - - public float floatValue() { - return value; - } - - @Override - public byte[] encodeAsBytes() { - ByteBuffer buf = ByteBuffer.allocate(Float.BYTES).order(ByteOrder.BIG_ENDIAN); - buf.putFloat(value); - return buf.array(); - } - - @Override - public String toString() { - return "f32 " + value; - } - } - - @ForDebugValueType(DebugValueType.FLOAT64) - public static class DebugFloat64Value implements DebugValue { - private final double value; - - public DebugFloat64Value(double value) { - this.value = value; - } - - public DebugFloat64Value(byte[] bytes) { - if (bytes.length != Double.BYTES) { - throw new IllegalArgumentException("Must have exactly " + Double.BYTES + " bytes"); - } - ByteBuffer buf = ByteBuffer.wrap(bytes).order(ByteOrder.BIG_ENDIAN); - this.value = buf.getDouble(); - } - - public double doubleValue() { - return value; - } - - @Override - public byte[] encodeAsBytes() { - ByteBuffer buf = ByteBuffer.allocate(Double.BYTES).order(ByteOrder.BIG_ENDIAN); - buf.putDouble(value); - return buf.array(); - } - - @Override - public String toString() { - return "f64 " + value; - } - } - - /** - * Extended-precision float - */ - @ForDebugValueType(DebugValueType.FLOAT80) - public static class DebugFloat80Value implements DebugValue { - private final byte[] bytes; - - public DebugFloat80Value(byte[] bytes) { - if (bytes.length != 10) { - throw new IllegalArgumentException("Must have exactly 10 bytes"); - } - this.bytes = Arrays.copyOf(bytes, 10); - } - - public byte[] bytes() { - return bytes; - } - - @Override - public byte[] encodeAsBytes() { - return bytes; - } - - @Override - public String toString() { - return "f80 " + NumericUtilities.convertBytesToString(bytes); - } - } - - /** - * Specific to IA-64 (Itanium) floating-point registers - * - * 17-bit exponent, 64-bit fraction. Not sure how it's aligned in memory, though. - */ - @ForDebugValueType(DebugValueType.FLOAT82) - public static class DebugFloat82Value implements DebugValue { - private final byte[] bytes; - - public DebugFloat82Value(byte[] bytes) { - if (bytes.length != 11) { - throw new IllegalArgumentException("Must have exactly 11 bytes"); - } - this.bytes = Arrays.copyOf(bytes, 11); - } - - public byte[] bytes() { - return bytes; - } - - @Override - public byte[] encodeAsBytes() { - return bytes; - } - - @Override - public String toString() { - return "f82 " + NumericUtilities.convertBytesToString(bytes); - } - } - - /** - * Quadruple-precision float - */ - @ForDebugValueType(DebugValueType.FLOAT128) - public static class DebugFloat128Value implements DebugValue { - private final byte[] bytes; - - public DebugFloat128Value(byte[] bytes) { - if (bytes.length != 16) { - throw new IllegalArgumentException("Must have exactly 16 bytes"); - } - this.bytes = Arrays.copyOf(bytes, 16); - } - - public byte[] bytes() { - return bytes; - } - - @Override - public byte[] encodeAsBytes() { - return bytes; - } - - @Override - public String toString() { - return "f128 " + NumericUtilities.convertBytesToString(bytes); - } - } - - @ForDebugValueType(DebugValueType.VECTOR64) - public static class DebugVector64Value implements DebugValue { - private final byte[] bytes; - - public DebugVector64Value(byte[] bytes) { - if (bytes.length != 8) { - throw new IllegalArgumentException("Must have exactly 8 bytes"); - } - this.bytes = Arrays.copyOf(bytes, 8); - } - - public byte[] vi4() { - return bytes; - } - - @Override - public byte[] encodeAsBytes() { - return bytes; - } - - @Override - public String toString() { - return "vec64 " + NumericUtilities.convertBytesToString(bytes); - } - } - - @ForDebugValueType(DebugValueType.VECTOR128) - public static class DebugVector128Value implements DebugValue { - private final byte[] bytes; - - public DebugVector128Value(byte[] bytes) { - if (bytes.length != 16) { - throw new IllegalArgumentException( - "Must have exactly 16 bytes. got " + bytes.length); - } - this.bytes = Arrays.copyOf(bytes, 16); - } - - public byte[] vi8() { - return bytes; - } - - @Override - public byte[] encodeAsBytes() { - return bytes; - } - - @Override - public String toString() { - return "vec128 " + NumericUtilities.convertBytesToString(bytes); - } - } - - default DebugValueType getValueType() { - return DebugValueType.getDebugValueTypeForClass(getClass()); - } - - /** - * TODO: Document me - * - * Encodes the value as an array of bytes in big-endian order - * - * @return the encoded value - */ - public byte[] encodeAsBytes(); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/err/DbgEngException.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/err/DbgEngException.java deleted file mode 100644 index 8aa25a50de..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/err/DbgEngException.java +++ /dev/null @@ -1,29 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng.err; - -/** - * The base exception for checked {@code dbgeng.dll} wrapper-related errors. - */ -public class DbgEngException extends Exception { - public DbgEngException() { - super(); - } - - public DbgEngException(String message) { - super(message); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/err/DbgEngRuntimeException.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/err/DbgEngRuntimeException.java deleted file mode 100644 index 45409e4ee1..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/err/DbgEngRuntimeException.java +++ /dev/null @@ -1,29 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng.err; - -/** - * The base exception for unchecked {@code dbgeng.dll} wrapper-related errors. - */ -public class DbgEngRuntimeException extends RuntimeException { - public DbgEngRuntimeException() { - super(); - } - - public DbgEngRuntimeException(String message) { - super(message); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/ext/JavaProvider.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/ext/JavaProvider.java deleted file mode 100644 index c3db3835f8..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/ext/JavaProvider.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng.ext; - -import com.sun.jna.platform.win32.COM.COMUtils; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgeng.dbgeng.DebugClient; -import agent.dbgeng.impl.dbgeng.client.DebugClientInternal; -import agent.dbgeng.jna.dbgeng.client.WrapIDebugClient; -import agent.dbgeng.jna.javaprovider.JavaProviderNative; - -/** - * Wrapper for "javaprovider" plugin library - * - * @deprecated In one (abandoned) use case, the SCTL server can be loaded as a - * "{@code engext.cpp}-style" plugin, presumably into any {@code dbgeng.dll}-powered - * debugger. This is accomplished by embedding the JVM into the plugin, and then calling - * an alternative entry point. This plugin also provides a utility function for invoking - * {@code CreateClient} on the client provided to the plugin by the host debugger. - */ -@Deprecated -public class JavaProvider { - public static DebugClient createClient() { - PointerByReference pClient = new PointerByReference(); - COMUtils.checkRC(JavaProviderNative.INSTANCE.createClient(pClient.getPointer())); - WrapIDebugClient wrap = new WrapIDebugClient(pClient.getValue()); - - try { - return DebugClientInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/util/DebugEventCallbacksAdapter.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/util/DebugEventCallbacksAdapter.java deleted file mode 100644 index 3440fa29b7..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/dbgeng/util/DebugEventCallbacksAdapter.java +++ /dev/null @@ -1,125 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng.util; - -import java.lang.reflect.Method; - -import agent.dbgeng.dbgeng.*; -import agent.dbgeng.dbgeng.DebugClient.*; -import ghidra.comm.util.BitmaskSet; - -/** - * A convenient abstract implementation of {@link DebugEventCallbacks} - * - * This implementation automatically computes the value for {@link #getInterestMask()} based on the - * overridden methods. The default implementations all return {@link DebugStatus#NO_CHANGE}, should - * they happen to be called. - */ -public class DebugEventCallbacksAdapter implements DebugEventCallbacks { - - private BitmaskSet interests = new BitmaskSet<>(DebugEvent.class); - - public DebugEventCallbacksAdapter() { - try { - // Compute the interest mask based on methods that are overridden - for (Method im : DebugEventCallbacks.class.getDeclaredMethods()) { - Method m = this.getClass().getMethod(im.getName(), im.getParameterTypes()); - if (m.getDeclaringClass() == DebugEventCallbacksAdapter.class) { - continue; - } - // The interface method is overridden, grab the annotation from the interface - ForInterest fi = im.getAnnotation(ForInterest.class); - if (fi == null) { - throw new AssertionError("No ForInterest annotation present on " + m); - } - interests.add(fi.value()); - } - } - catch (NoSuchMethodException e) { - throw new AssertionError(e); - } - } - - @Override - public BitmaskSet getInterestMask() { - return interests; - } - - @Override - public DebugStatus breakpoint(DebugBreakpoint bp) { - return DebugStatus.NO_CHANGE; - } - - @Override - public DebugStatus exception(DebugExceptionRecord64 exception, boolean firstChance) { - return DebugStatus.NO_CHANGE; - } - - @Override - public DebugStatus createThread(DebugThreadInfo debugThreadInfo) { - return DebugStatus.NO_CHANGE; - } - - @Override - public DebugStatus exitThread(int exitCode) { - return DebugStatus.NO_CHANGE; - } - - @Override - public DebugStatus createProcess(DebugProcessInfo debugProcessInfo) { - return DebugStatus.NO_CHANGE; - } - - @Override - public DebugStatus exitProcess(int exitCode) { - return DebugStatus.NO_CHANGE; - } - - @Override - public DebugStatus loadModule(DebugModuleInfo debugModuleInfo) { - return DebugStatus.NO_CHANGE; - } - - @Override - public DebugStatus unloadModule(String imageBaseName, long baseOffset) { - return DebugStatus.NO_CHANGE; - } - - @Override - public DebugStatus systemError(int error, int level) { - return DebugStatus.NO_CHANGE; - } - - @Override - public DebugStatus sessionStatus(SessionStatus status) { - return DebugStatus.NO_CHANGE; - } - - @Override - public DebugStatus changeDebuggeeState(BitmaskSet flags, long argument) { - return DebugStatus.NO_CHANGE; - } - - @Override - public DebugStatus changeEngineState(BitmaskSet flags, long argument) { - return DebugStatus.NO_CHANGE; - } - - @Override - public DebugStatus changeSymbolState(BitmaskSet flags, long argument) { - return DebugStatus.NO_CHANGE; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/gadp/DbgEngGadpDebuggerModelFactory.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/gadp/DbgEngGadpDebuggerModelFactory.java deleted file mode 100644 index d570fa179b..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/gadp/DbgEngGadpDebuggerModelFactory.java +++ /dev/null @@ -1,97 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.gadp; - -import java.util.List; - -import ghidra.dbg.gadp.server.AbstractGadpLocalDebuggerModelFactory; -import ghidra.dbg.util.ConfigurableFactory.FactoryDescription; -import ghidra.program.model.listing.Program; - -@FactoryDescription( - brief = "MS dbgeng.dll (WinDbg) via GADP", - htmlDetails = """ - Connect to the Microsoft Debug Engine. - This is the same engine that powers WinDbg. - This is best for most Windows userspace and kernel targets. - Kernel debugging is still experimental. - This will protect Ghidra's JVM by using a subprocess to access the native API.""") -public class DbgEngGadpDebuggerModelFactory extends AbstractGadpLocalDebuggerModelFactory { - - protected String remote = "none"; // Require user to start server - @FactoryOption("DebugConnect options (.server)") - public final Property agentRemoteOption = - Property.fromAccessors(String.class, this::getAgentRemote, this::setAgentRemote); - - protected String transport = "none"; // Require user to start server - @FactoryOption("Remote process server options (untested)") - public final Property agentTransportOption = - Property.fromAccessors(String.class, this::getAgentTransport, this::setAgentTransport); - - @Override - public int getPriority(Program program) { - // TODO: Might instead look for the DLL - if (!System.getProperty("os.name").toLowerCase().contains("windows")) { - return -1; - } - if (program != null) { - String exe = program.getExecutablePath(); - if (exe == null || exe.isBlank()) { - return -1; - } - } - return 60; - } - - public String getAgentTransport() { - return transport; - } - - public void setAgentTransport(String transport) { - this.transport = transport; - } - - public String getAgentRemote() { - return remote; - } - - public void setAgentRemote(String remote) { - this.remote = remote; - } - - @Override - protected String getThreadName() { - return "Local dbgeng.dll Agent stdout"; - } - - protected Class getServerClass() { - return DbgEngGadpServer.class; - } - - @Override - protected void completeCommandLine(List cmd) { - cmd.add(getServerClass().getCanonicalName()); - cmd.addAll(List.of("-H", host)); - cmd.addAll(List.of("-p", Integer.toString(port))); - //cmd.addAll(List.of("-t", transport)); - if (!remote.equals("none") && !remote.equals("")) { - cmd.addAll(List.of("-r", remote)); - } - if (!transport.equals("none") && !transport.equals("")) { - cmd.addAll(List.of("-t", transport)); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/gadp/DbgEngGadpServer.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/gadp/DbgEngGadpServer.java deleted file mode 100644 index fffa0c594c..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/gadp/DbgEngGadpServer.java +++ /dev/null @@ -1,236 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.gadp; - -import java.io.IOException; -import java.net.InetSocketAddress; -import java.net.SocketAddress; -import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutionException; - -import org.apache.commons.lang3.exception.ExceptionUtils; - -import agent.dbgeng.gadp.impl.DbgEngGadpServerImpl; -import ghidra.async.AsyncUtils; -import ghidra.dbg.agent.AgentWindow; -import ghidra.util.Msg; - -public interface DbgEngGadpServer extends AutoCloseable { - public static final String USAGE = - """ - This is the GADP server for Windows dbgeng.dll. Usage: - - gadp-agent-gdbeng [-H HOST/ADDR] [-p PORT] [-i ID] [-t TRANSPORT] - [-r REMOTE] - - Options: - - --host/-H The address of the interface on which to listen. - --port/-p The TCP port on which to listen for GADP. Default is 12345 - --transport/-t The transport specification for the Process Server. Default - is tcp:port=11200 - --remote/-r The transport specification for a remote server. - - Starts a dbgeng.dll-based GADP server "agent". Once the server has started, it - will print the interface IP and port. - """; - public static final String DEFAULT_DBGSRV_TRANSPORT = "tcp:port=11200"; - - /** - * The entry point for the GADP-DBGENG server in stand-alone mode - * - * Run it to see help. - * - * @param args the command-line arguments - * @throws IOException if an I/O error occurs - * @throws ExecutionException - * @throws InterruptedException - */ - public static void main(String[] args) throws Exception { - try { - new DbgEngRunner().run(args); - } - catch (Throwable t) { - System.err.println(ExceptionUtils.getMessage(t)); - System.exit(1); - } - } - - /** - * Create a new instance of the server - * - * @param addr the address to bind the GADP server to - * @param busId the client ID the server should use on the bus for synthesized commands - * @param dbgSrvTransport the transport specification for the {@code dbgeng.dll} server - * @return the server instance - * @throws IOException - */ - public static DbgEngGadpServer newInstance(SocketAddress addr) throws IOException { - return new DbgEngGadpServerImpl(addr); - } - - /** - * Runs the server from the command line - */ - public class DbgEngRunner { - protected InetSocketAddress bindTo; - protected List dbgengArgs = new ArrayList<>(); - protected String dbgSrvTransport = DEFAULT_DBGSRV_TRANSPORT; - protected String remote = null; - - public DbgEngRunner() { - } - - public void run(String args[]) - throws IOException, InterruptedException, ExecutionException { - parseArguments(args); - - try (DbgEngGadpServer server = newInstance(bindTo)) { - //TODO: fix/test the debugConnect case when args are passed - server.startDbgEng(dbgengArgs.toArray(new String[] {})).exceptionally(e -> { - e = AsyncUtils.unwrapThrowable(e); - Msg.error(this, "Error starting dbgeng/GADP: " + e); - System.exit(-1); - return null; - }); - new AgentWindow("dbgeng.dll Agent for Ghidra", server.getLocalAddress()); - while (server.isRunning()) { - // TODO: Put consoleLoop back? - Thread.sleep(1000); - } - System.exit(0); - } - } - - protected void parseArguments(String[] args) { - String iface = "localhost"; - int port = 12345; - // NOTE: Maybe commons-cli or Argparse4j? - Iterator ait = Arrays.asList(args).iterator(); - while (ait.hasNext()) { - String a = ait.next(); - if ("-h".equals(a) || "--help".equals(a)) { - printUsage(); - System.exit(0); - } - else if ("-p".equals(a) || "--port".equals(a)) { - if (!ait.hasNext()) { - System.err.println("Expected PORT"); - printUsage(); - System.exit(-1); - } - String portStr = ait.next(); - try { - port = Integer.parseInt(portStr); - } - catch (NumberFormatException e) { - System.err.println("Integer required. Got " + portStr); - printUsage(); - System.exit(-1); - } - } - else if ("-H".equals(a) || "--host".equals(a)) { - if (!ait.hasNext()) { - System.err.println("Expected HOST/ADDR"); - printUsage(); - System.exit(-1); - } - iface = ait.next(); - } - else if ("-t".equals(a) || "--transport".equals(a)) { - if (!ait.hasNext()) { - System.err.println("Expected TRANSPORT"); - System.err.println("See the MSDN 'Activating a Process Server'"); - printUsage(); - System.exit(-1); - } - dbgSrvTransport = ait.next(); - dbgengArgs.add(dbgSrvTransport); - } - else if ("-r".equals(a) || "--remote".equals(a)) { - if (!ait.hasNext()) { - System.err.println("Expected TRANSPORT:HOST,PORT"); - printUsage(); - System.exit(-1); - } - remote = ait.next(); - dbgengArgs.add(remote); - } - else { - System.err.println("Unknown option: " + a); - printUsage(); - System.exit(-1); - } - } - - bindTo = new InetSocketAddress(iface, port); - } - - protected void printUsage() { - System.out.println(USAGE); - } - } - - /** - * Start the debugging server - * - * @return a future that completes when the server is ready - */ - CompletableFuture startDbgEng(String[] args); - - /** - * Get the local address to which the GADP server is bound. - * - * @return the local socket address - */ - SocketAddress getLocalAddress(); - - /** - * Starts the dbgeng manager's console loop - * - * @throws IOException if an I/O error occurs - */ - //public void consoleLoop() throws IOException; - - /** - * Close all connections and ports, GADP and Process Server, and terminate the server - * - * @throws IOException if an I/O error occurs - */ - public void terminate() throws IOException; - - /** - * Check if the server is running - * - * This will return false: 1) Before the server has been started, 2) After a call to - * {@link #terminate()}, or 3) When an error occurs causing the server to terminate - * unexpectedly. Otherwise, it returns true. - * - * @return true if the server is currently running. - */ - public boolean isRunning(); - - /** - * Calls {@link #terminate()} - * - * @throws IOException if an I/O error occurs - */ - @Override - default void close() throws IOException { - terminate(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/gadp/DbgEngGadpServerLaunchShim.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/gadp/DbgEngGadpServerLaunchShim.java deleted file mode 100644 index 65306763df..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/gadp/DbgEngGadpServerLaunchShim.java +++ /dev/null @@ -1,37 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.gadp; - -import org.apache.commons.lang3.exception.ExceptionUtils; - -import agent.dbgeng.gadp.DbgEngGadpServer.DbgEngRunner; -import ghidra.GhidraApplicationLayout; -import ghidra.GhidraLaunchable; - -public class DbgEngGadpServerLaunchShim implements GhidraLaunchable { - - @Override - public void launch(GhidraApplicationLayout layout, String[] args) throws Exception { - try { - new DbgEngRunner().run(args); - } - catch (Throwable t) { - System.err.println(ExceptionUtils.getMessage(t)); - System.exit(1); - } - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/gadp/impl/AbstractClientThreadExecutor.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/gadp/impl/AbstractClientThreadExecutor.java deleted file mode 100644 index 24cc191006..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/gadp/impl/AbstractClientThreadExecutor.java +++ /dev/null @@ -1,244 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.gadp.impl; - -import java.util.*; -import java.util.concurrent.*; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.function.Consumer; - -import com.sun.jna.platform.win32.COM.COMException; - -import agent.dbgeng.dbgeng.DebugClient; -import agent.dbgeng.dbgeng.DebugClient.DebugStatus; -import agent.dbgeng.dbgeng.DebugControl; -import agent.dbgeng.manager.DbgManager; -import ghidra.util.Msg; - -/** - * A single-threaded executor which creates and exclusively accesses the {@code dbgeng.dll} client. - * - *

- * The executor also has a priority mechanism, so that callbacks may register follow-on handlers - * which take precedence over other tasks in the queue (which could trigger additional callbacks). - * This is required since certain operation are not allowed during normal callback processing. For - * example, changing the current process is typically not allowed, but it is necessary to retrieve a - * thread's context. - */ -public abstract class AbstractClientThreadExecutor extends AbstractExecutorService { - private static final int DEFAULT_PRIORITY = 10; - - protected DebugClient client; - protected boolean shuttingDown = false; - protected final Queue queue = new PriorityQueue<>(); - protected Thread thread = new Thread(this::run, "DebugClient"); - protected final AtomicBoolean waitRegistered = new AtomicBoolean(); - - protected abstract void init(); - - public static class Entry implements Comparable { - final int priority; - public final Runnable command; - - public Entry(int priority, Runnable command) { - this.priority = priority; - this.command = command; - } - - @Override - public int compareTo(Entry that) { - return Integer.compare(this.priority, that.priority); - } - } - - /** - * Obtain a reference to the client, only if the calling thread is this executor's thread. - * - * @return the client - */ - public DebugClient getClient() { - if (thread != Thread.currentThread()) { - //TODO: throw new AssertionError("Cannot get client outside owning thread"); - } - return client; - } - - /** - * Instruct the executor to call {@link DebugClient#dispatchCallbacks()} when it next idles. - */ - public void cancelWait() { - waitRegistered.set(false); - } - - /** - * Instruct the executor to call {@link DebugControl#waitForEvent()} when it next idles. - */ - public void registerWait() { - waitRegistered.set(true); - } - - private Entry pollQueue() { - synchronized (queue) { - return queue.poll(); - } - } - - private void run() { - /** - * The general idea is to run indefinitely, taking every precaution to protect this thread's - * life, since only it can access the client. Granted, if it turns out to be too difficult, - * we can always create a new thread and client, using the existing client's reentrant - * methods. - * - *

- * As stated in the MSDN, this thread repeatedly calls {@code DispatchEvents} in order to - * receive callbacks regarding events caused by other clients. If, however, an wait is - * registered, or the current engine state indicates that a wait is proper, the thread calls - * {@code WaitForEvent} instead. The thread is occupied until the wait completes, which is - * fine since the engine is inaccessible (except to certain callbacks) until it completes, - * anyway. - */ - try { - init(); - while (!shuttingDown) { - Entry next; - while (null != (next = pollQueue())) { - if (shuttingDown) { - return; - } - try { - //System.out.println("Executing: " + next); - next.command.run(); - //System.out.println("Done"); - } - catch (Throwable t) { - Msg.error(this, "Task in executor threw: " + t); - } - } - DebugStatus status = client.getControl().getExecutionStatus(); - if (status.shouldWait && status != DebugStatus.NO_DEBUGGEE || - waitRegistered.get()) { - waitRegistered.set(false); - try { - getManager().waitForEventEx(); - //client.getControl().waitForEvent(); - } - catch (COMException e) { - Msg.error(this, "Error during WaitForEvents: " + e); - } - } - else { - try { - client.dispatchCallbacks(100); // TODO: Better synchronization - } - catch (COMException e) { - Msg.error(this, "Error during DispatchCallbacks: " + e); - } - } - } - } - catch (Throwable t) { - Msg.error(this, "Non-respawnable executor terminated unexpectedly", t); - shuttingDown = true; - } - } - - @Override - public void shutdown() { - shuttingDown = true; - } - - @Override - public List shutdownNow() { - shuttingDown = true; - client.exitDispatch(); - thread.interrupt(); - List left = new ArrayList<>(queue.size()); - for (Entry ent : queue) { - left.add(ent.command); - } - return left; - } - - @Override - public boolean isShutdown() { - return shuttingDown; - } - - @Override - public boolean isTerminated() { - return !thread.isAlive(); - } - - @Override - public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException { - long millis = TimeUnit.MILLISECONDS.convert(timeout, unit); - thread.join(millis); - return !thread.isAlive(); - } - - @Override - public void execute(Runnable command) { - execute(DEFAULT_PRIORITY, command); - } - - /** - * Schedule a task with a given priority. - * - *

- * Smaller priority values indicate earlier execution. The default priority is - * {@link #DEFAULT_PRIORITY}. - * - * @param priority the priority - * @param command the task - */ - public void execute(int priority, Runnable command) { - if (shuttingDown) { - // TODO: Is this the correct exception? - throw new RejectedExecutionException("Executor is shutting down"); - } - if (!thread.isAlive()) { - throw new RejectedExecutionException("Executor has terminated"); - } - synchronized (queue) { - queue.add(new Entry(priority, command)); - // TODO: Putting this in causes sync/output flushing problems - //client.exitDispatch(); - } - } - - public boolean isCurrentThread() { - return thread.equals(Thread.currentThread()); - } - - /** - * Schedule a task with the given priority, taking a reference to the client. - * - *

- * This is a convenience which spares a call to {@link #getClient()}. See - * {@link #execute(int, Runnable)} about priority. - * - * @param priority the priority - * @param command the task - */ - public void execute(int priority, Consumer command) { - execute(priority, () -> command.accept(client)); - } - - public abstract DbgManager getManager(); - - public abstract void setManager(DbgManager manager); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/gadp/impl/DbgEngClientThreadExecutor.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/gadp/impl/DbgEngClientThreadExecutor.java deleted file mode 100644 index 282daf06d4..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/gadp/impl/DbgEngClientThreadExecutor.java +++ /dev/null @@ -1,63 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.gadp.impl; - -import java.util.function.Supplier; - -import agent.dbgeng.dbgeng.DebugClient; -import agent.dbgeng.manager.DbgManager; - -/** - * A single-threaded executor which creates and exclusively accesses the {@code dbgeng.dll} client. - * - * The executor also has a priority mechanism, so that callbacks may register follow-on handlers - * which take precedence over other tasks in the queue (which could trigger additional callbacks). - * This is required since certain operation are not allowed during normal callback processing. For - * example, changing the current process is typically not allowed, but it is necessary to retrieve a - * thread's context. - */ -public class DbgEngClientThreadExecutor extends AbstractClientThreadExecutor { - - private final Supplier makeClient; - private DbgManager manager; - - /** - * Instantiate a new executor, providing a means of creating the client - * - * @param makeClient the callback to create the client - */ - public DbgEngClientThreadExecutor(Supplier makeClient) { - this.makeClient = makeClient; - thread.setDaemon(true); - thread.start(); - } - - @Override - protected void init() { - this.client = makeClient.get(); - } - - @Override - public DbgManager getManager() { - return manager; - } - - @Override - public void setManager(DbgManager manager) { - this.manager = manager; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/gadp/impl/DbgEngGadpServerImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/gadp/impl/DbgEngGadpServerImpl.java deleted file mode 100644 index 455d81da20..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/gadp/impl/DbgEngGadpServerImpl.java +++ /dev/null @@ -1,64 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.gadp.impl; - -import java.io.IOException; -import java.net.SocketAddress; -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.gadp.DbgEngGadpServer; -import agent.dbgeng.model.AbstractDbgModel; -import agent.dbgeng.model.impl.DbgModelImpl; -import ghidra.dbg.gadp.server.AbstractGadpServer; - -public class DbgEngGadpServerImpl implements DbgEngGadpServer { - public class GadpSide extends AbstractGadpServer { - public GadpSide(AbstractDbgModel model, SocketAddress addr) - throws IOException { - super(model, addr); - } - } - - protected final AbstractDbgModel model; - protected final GadpSide server; - - public DbgEngGadpServerImpl(SocketAddress addr) throws IOException { - super(); - this.model = new DbgModelImpl(); - this.server = new GadpSide(model, addr); - } - - @Override - public CompletableFuture startDbgEng(String[] args) { - return model.startDbgEng(args).thenCompose(__ -> server.launchAsyncService()); - } - - @Override - public SocketAddress getLocalAddress() { - return server.getLocalAddress(); - } - - @Override - public boolean isRunning() { - return model.isRunning(); - } - - @Override - public void terminate() throws IOException { - model.terminate(); - server.terminate(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/DbgEngUtil.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/DbgEngUtil.java deleted file mode 100644 index 7ce3e51094..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/DbgEngUtil.java +++ /dev/null @@ -1,93 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng; - -import java.lang.reflect.Method; -import java.util.List; -import java.util.Map; -import java.util.function.Function; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.Guid.REFIID; -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.platform.win32.COM.*; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgeng.dbgeng.err.DbgEngRuntimeException; -import ghidra.util.Msg; - -public abstract class DbgEngUtil { - public static final ULONG DEBUG_ANY_ID = new ULONG(-1); - - private DbgEngUtil() { - } - - public record Preferred (REFIID refiid, Class cls) { - public Preferred(IID iid, Class cls) { - this(new REFIID(iid), cls); - } - } - - public static interface InterfaceSupplier { - HRESULT get(REFIID refiid, PointerByReference pClient); - } - - @SuppressWarnings("unchecked") - public static I tryPreferredInterfaces(Class cls, List> preferred, - InterfaceSupplier supplier) { - PointerByReference ppClient = new PointerByReference(); - for (Preferred pref : preferred) { - try { - COMUtils.checkRC(supplier.get(pref.refiid, ppClient)); - if (ppClient.getValue() == null) { - continue; - } - T impl = pref.cls.getConstructor(Pointer.class).newInstance(ppClient.getValue()); - Method instanceFor = cls.getMethod("instanceFor", pref.cls); - Object instance = instanceFor.invoke(null, impl); - return (I) instance; - } - catch (COMException e) { - Msg.debug(DbgEngUtil.class, e + " (" + pref.cls + ")"); - // TODO: Only try next on E_NOINTERFACE? - // Try next - } - catch (Exception e) { - throw new AssertionError("INTERNAL: Unexpected exception", e); - } - } - throw new DbgEngRuntimeException("None of the preferred interfaces are supported"); - } - - public static U lazyWeakCache(Map cache, T unk, - Function forNew) { - U present = cache.get(unk.getPointer()); - if (present != null) { - unk.Release(); - return present; - } - U absent = forNew.apply(unk); - cache.put(unk.getPointer(), absent); - return absent; - } - - public static void dbgline() { - System.out.println(new Exception().getStackTrace()[1]); - System.out.flush(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/DebugRunningProcessImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/DebugRunningProcessImpl.java deleted file mode 100644 index d1efcb178a..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/DebugRunningProcessImpl.java +++ /dev/null @@ -1,66 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng; - -import agent.dbgeng.dbgeng.DebugRunningProcess; -import agent.dbgeng.dbgeng.DebugServerId; -import agent.dbgeng.impl.dbgeng.client.DebugClientInternal; -import ghidra.comm.util.BitmaskSet; - -public class DebugRunningProcessImpl - implements DebugRunningProcess, Comparable { - public DebugRunningProcessImpl(DebugClientInternal client, DebugServerId server, int systemId) { - this.client = client; - this.server = server; - this.systemId = systemId; - } - - protected final DebugClientInternal client; - protected final DebugServerId server; - protected final int systemId; - - @Override - public int getSystemId() { - return systemId; - } - - @Override - public Description getFullDescription(Description.ProcessDescriptionFlags... flags) { - return client.getProcessDescription(server, systemId, BitmaskSet.of(flags)); - } - - @Override - public String getExecutableName(Description.ProcessDescriptionFlags... flags) { - return getFullDescription(flags).getExecutableName(); - } - - @Override - public String getDescription(Description.ProcessDescriptionFlags... flags) { - return getFullDescription(flags).getDescription(); - } - - @Override - public int compareTo(DebugRunningProcessImpl that) { - int result; - - result = Integer.compare(this.systemId, that.systemId); - if (result != 0) { - return result; - } - - return 0; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/advanced/DebugAdvancedImpl1.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/advanced/DebugAdvancedImpl1.java deleted file mode 100644 index 277c15eb15..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/advanced/DebugAdvancedImpl1.java +++ /dev/null @@ -1,38 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.advanced; - -import agent.dbgeng.dbgeng.DbgEng; -import agent.dbgeng.dbgeng.DebugThreadId; -import agent.dbgeng.dbgeng.DbgEng.OpaqueCleanable; -import agent.dbgeng.jna.dbgeng.advanced.IDebugAdvanced; - -public class DebugAdvancedImpl1 implements DebugAdvancedInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - @SuppressWarnings("unused") - private final IDebugAdvanced jnaAdvanced; - - public DebugAdvancedImpl1(IDebugAdvanced jnaAdvanced) { - this.cleanable = DbgEng.releaseWhenPhantom(this, jnaAdvanced); - this.jnaAdvanced = jnaAdvanced; - } - - @Override - public DebugThreadBasicInformation getThreadBasicInformation(DebugThreadId tid) { - throw new UnsupportedOperationException("Not supported by this interface"); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/advanced/DebugAdvancedImpl2.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/advanced/DebugAdvancedImpl2.java deleted file mode 100644 index 275e4f80ca..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/advanced/DebugAdvancedImpl2.java +++ /dev/null @@ -1,85 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.advanced; - -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinDef.ULONGLONG; - -import agent.dbgeng.dbgeng.DebugThreadId; -import agent.dbgeng.jna.dbgeng.DbgEngNative.DEBUG_THREAD_BASIC_INFORMATION; -import agent.dbgeng.jna.dbgeng.advanced.IDebugAdvanced2; - -import com.sun.jna.platform.win32.COM.COMUtils; - -import ghidra.comm.util.BitmaskSet; - -public class DebugAdvancedImpl2 extends DebugAdvancedImpl1 { - private final IDebugAdvanced2 jnaAdvanced; - - public DebugAdvancedImpl2(IDebugAdvanced2 jnaAdvanced) { - super(jnaAdvanced); - this.jnaAdvanced = jnaAdvanced; - } - - @Override - public DebugThreadBasicInformation getThreadBasicInformation(DebugThreadId tid) { - ULONG ulWhich = new ULONG(WhichSystemObjectInformation.THREAD_BASIC_INFORMATION.ordinal()); - ULONGLONG ullUnused = new ULONGLONG(0); - ULONG ulThreadId = new ULONG(tid.value()); - DEBUG_THREAD_BASIC_INFORMATION sInfo = new DEBUG_THREAD_BASIC_INFORMATION(); - ULONG ulBufferSize = new ULONG(sInfo.size()); - COMUtils.checkRC(jnaAdvanced.GetSystemObjectInformation(ulWhich, ullUnused, ulThreadId, - sInfo.getPointer(), ulBufferSize, null)); - sInfo.read(); - - Integer exitStatus = null; - Integer priorityClass = null; - Integer priority = null; - Long createTime = null; - Long exitTime = null; - Long kernelTime = null; - Long userTime = null; - Long startOffset = null; - Long affinity = null; - - BitmaskSet valid = - new BitmaskSet<>(ThreadBasicInformationValidBits.class, sInfo.Valid.intValue()); - if (valid.contains(ThreadBasicInformationValidBits.EXIT_STATUS)) { - exitStatus = sInfo.ExitStatus.intValue(); - } - if (valid.contains(ThreadBasicInformationValidBits.PRIORITY_CLASS)) { - priorityClass = sInfo.PriorityClass.intValue(); - } - if (valid.contains(ThreadBasicInformationValidBits.PRIORITY)) { - priority = sInfo.Priority.intValue(); - } - if (valid.contains(ThreadBasicInformationValidBits.TIMES)) { - createTime = sInfo.CreateTime.longValue(); - exitTime = sInfo.ExitTime.longValue(); - kernelTime = sInfo.KernelTime.longValue(); - userTime = sInfo.UserTime.longValue(); - } - if (valid.contains(ThreadBasicInformationValidBits.START_OFFSET)) { - startOffset = sInfo.StartOffset.longValue(); - } - if (valid.contains(ThreadBasicInformationValidBits.AFFINITY)) { - affinity = sInfo.Affinity.longValue(); - } - - return new DebugThreadBasicInformation(exitStatus, priorityClass, priority, createTime, - exitTime, kernelTime, userTime, startOffset, affinity); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/advanced/DebugAdvancedImpl3.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/advanced/DebugAdvancedImpl3.java deleted file mode 100644 index 1d4de8f45d..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/advanced/DebugAdvancedImpl3.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.advanced; - -import agent.dbgeng.jna.dbgeng.advanced.IDebugAdvanced3; - -public class DebugAdvancedImpl3 extends DebugAdvancedImpl2 { - @SuppressWarnings("unused") - private final IDebugAdvanced3 jnaAdvanced; - - public DebugAdvancedImpl3(IDebugAdvanced3 jnaAdvanced) { - super(jnaAdvanced); - this.jnaAdvanced = jnaAdvanced; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/advanced/DebugAdvancedInternal.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/advanced/DebugAdvancedInternal.java deleted file mode 100644 index a5e50594d2..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/advanced/DebugAdvancedInternal.java +++ /dev/null @@ -1,84 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.advanced; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.dbgeng.DebugAdvanced; -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgeng.jna.dbgeng.advanced.*; -import ghidra.comm.util.BitmaskUniverse; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DebugAdvancedInternal extends DebugAdvanced { - Map CACHE = new WeakValueHashMap<>(); - - static DebugAdvancedInternal instanceFor(WrapIDebugAdvanced advanced) { - return DbgEngUtil.lazyWeakCache(CACHE, advanced, DebugAdvancedImpl1::new); - } - - static DebugAdvancedInternal instanceFor(WrapIDebugAdvanced2 advanced) { - return DbgEngUtil.lazyWeakCache(CACHE, advanced, DebugAdvancedImpl2::new); - } - - static DebugAdvancedInternal instanceFor(WrapIDebugAdvanced3 advanced) { - return DbgEngUtil.lazyWeakCache(CACHE, advanced, DebugAdvancedImpl3::new); - } - - List> PREFERRED_ADVANCED_IIDS = List.of( - new Preferred<>(IDebugAdvanced3.IID_IDEBUG_ADVANCED3, WrapIDebugAdvanced3.class), - new Preferred<>(IDebugAdvanced2.IID_IDEBUG_ADVANCED2, WrapIDebugAdvanced2.class), - new Preferred<>(IDebugAdvanced.IID_IDEBUG_ADVANCED, WrapIDebugAdvanced.class)); - - static DebugAdvancedInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(DebugAdvancedInternal.class, - PREFERRED_ADVANCED_IIDS, supplier); - } - - public enum WhichSystemObjectInformation { - THREAD_BASIC_INFORMATION, // - THREAD_NAME_WIDE, // - CURRENT_PROCESS_COOKIE, // - ; - } - - public enum ThreadBasicInformationValidBits implements BitmaskUniverse { - EXIT_STATUS(1 << 0), // - PRIORITY_CLASS(1 << 1), // - PRIORITY(1 << 2), // - TIMES(1 << 3), // - START_OFFSET(1 << 4), // - AFFINITY(1 << 5), // - ALL(0x3f); - ; - - ThreadBasicInformationValidBits(int mask) { - this.mask = mask; - } - - int mask; - - @Override - public long getMask() { - return mask; - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/breakpoint/DebugBreakpointImpl1.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/breakpoint/DebugBreakpointImpl1.java deleted file mode 100644 index cd03e1251f..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/breakpoint/DebugBreakpointImpl1.java +++ /dev/null @@ -1,195 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.breakpoint; - -import com.sun.jna.Native; -import com.sun.jna.platform.win32.Kernel32; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.platform.win32.COM.COMUtils; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgeng.dbgeng.DbgEng; -import agent.dbgeng.dbgeng.DbgEng.OpaqueCleanable; -import agent.dbgeng.dbgeng.DebugClient; -import agent.dbgeng.impl.dbgeng.client.DebugClientInternal; -import agent.dbgeng.impl.dbgeng.control.DebugControlInternal; -import agent.dbgeng.jna.dbgeng.WinNTExtra.Machine; -import agent.dbgeng.jna.dbgeng.breakpoint.IDebugBreakpoint; -import agent.dbgeng.jna.dbgeng.client.WrapIDebugClient; -import ghidra.comm.util.BitmaskSet; - -public class DebugBreakpointImpl1 implements DebugBreakpointInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private IDebugBreakpoint jnaBreakpoint; - private DebugControlInternal control; - - public DebugBreakpointImpl1(IDebugBreakpoint jnaBreakpoint) { - this.cleanable = DbgEng.releaseWhenPhantom(this, jnaBreakpoint); - this.jnaBreakpoint = jnaBreakpoint; - } - - @Override - public void setControl(DebugControlInternal control) { - this.control = control; - } - - @Override - public void remove() { - control.removeBreakpoint(jnaBreakpoint); - // If we do this here, dispose will fail - //jnaBreakpoint = null; - } - - @Override - public void dispose() { - // Prevent accidental access. Will be released during GC. NPE is better than segfault. - CACHE.remove(jnaBreakpoint.getPointer()); - jnaBreakpoint = null; - } - - @Override - public int getId() { - ULONGByReference pulId = new ULONGByReference(); - COMUtils.checkRC(jnaBreakpoint.GetId(pulId)); - return pulId.getValue().intValue(); - } - - @Override - public BreakFullType getType() { - ULONGByReference pulBreakType = new ULONGByReference(); - ULONGByReference pulProcType = new ULONGByReference(); - COMUtils.checkRC(jnaBreakpoint.GetType(pulBreakType, pulProcType)); - BreakType breakType = BreakType.values()[pulBreakType.getValue().intValue()]; - Machine procType = Machine.getByNumber(pulProcType.getValue().intValue()); - return new BreakFullType(breakType, procType); - } - - @Override - public DebugClient getAdder() { - PointerByReference pClient = new PointerByReference(); - COMUtils.checkRC(jnaBreakpoint.GetAdder(pClient.getPointer())); - WrapIDebugClient wrap = new WrapIDebugClient(pClient.getValue()); - - try { - return DebugClientInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public BitmaskSet getFlags() { - ULONGByReference pulFlags = new ULONGByReference(); - COMUtils.checkRC(jnaBreakpoint.GetFlags(pulFlags)); - return new BitmaskSet<>(BreakFlags.class, pulFlags.getValue().longValue()); - } - - @Override - public void addFlags(BitmaskSet flags) { - ULONG ulFlags = new ULONG(flags.getBitmask()); - COMUtils.checkRC(jnaBreakpoint.AddFlags(ulFlags)); - } - - @Override - public void addFlags(BreakFlags... flags) { - addFlags(BitmaskSet.of(flags)); - } - - @Override - public void removeFlags(BitmaskSet flags) { - ULONG ulFlags = new ULONG(flags.getBitmask()); - COMUtils.checkRC(jnaBreakpoint.RemoveFlags(ulFlags)); - } - - @Override - public void removeFlags(BreakFlags... flags) { - removeFlags(BitmaskSet.of(flags)); - } - - @Override - public void setFlags(BitmaskSet flags) { - ULONG ulFlags = new ULONG(flags.getBitmask()); - COMUtils.checkRC(jnaBreakpoint.SetFlags(ulFlags)); - } - - @Override - public void setFlags(BreakFlags... flags) { - setFlags(BitmaskSet.of(flags)); - } - - @Override - public Long getOffset() { - ULONGLONGByReference pullOffset = new ULONGLONGByReference(); - HRESULT getOffset = jnaBreakpoint.GetOffset(pullOffset); - if (getOffset.longValue() == Kernel32.E_NOINTERFACE) { - // Per MSDN, this means the placement is deferred - return null; - } - COMUtils.checkRC(getOffset); - return pullOffset.getValue().longValue(); - } - - @Override - public void setOffset(long offset) { - ULONGLONG ullOffset = new ULONGLONG(offset); - COMUtils.checkRC(jnaBreakpoint.SetOffset(ullOffset)); - } - - @Override - public String getOffsetExpression() { - ULONGByReference pulExpressionSize = new ULONGByReference(); - COMUtils.checkRC(jnaBreakpoint.GetOffsetExpression(null, new ULONG(0), pulExpressionSize)); - byte[] buffer = new byte[pulExpressionSize.getValue().intValue()]; - COMUtils.checkRC( - jnaBreakpoint.GetOffsetExpression(buffer, pulExpressionSize.getValue(), null)); - return Native.toString(buffer); - } - - @Override - public void setOffsetExpression(String expression) { - COMUtils.checkRC(jnaBreakpoint.SetOffsetExpression(expression)); - } - - @Override - public BreakDataParameters getDataParameters() { - ULONGByReference pulSize = new ULONGByReference(); - ULONGByReference pulAccessType = new ULONGByReference(); - COMUtils.checkRC(jnaBreakpoint.GetDataParameters(pulSize, pulAccessType)); - return new BreakDataParameters(pulSize.getValue().intValue(), - new BitmaskSet<>(BreakAccess.class, pulAccessType.getValue().intValue())); - } - - @Override - public void setDataParameters(BreakDataParameters params) { - setDataParameters(params.size, params.access); - } - - @Override - public void setDataParameters(int size, BitmaskSet access) { - ULONG ulSize = new ULONG(size); - ULONG ulAccessType = new ULONG(access.getBitmask()); - COMUtils.checkRC(jnaBreakpoint.SetDataParameters(ulSize, ulAccessType)); - } - - @Override - public void setDataParameters(int size, BreakAccess... access) { - setDataParameters(size, BitmaskSet.of(access)); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/breakpoint/DebugBreakpointImpl2.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/breakpoint/DebugBreakpointImpl2.java deleted file mode 100644 index cc8f1408a7..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/breakpoint/DebugBreakpointImpl2.java +++ /dev/null @@ -1,56 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.breakpoint; - -import com.sun.jna.Native; -import com.sun.jna.WString; -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinDef.ULONGByReference; -import com.sun.jna.platform.win32.COM.COMUtils; - -import agent.dbgeng.jna.dbgeng.breakpoint.IDebugBreakpoint2; - -public class DebugBreakpointImpl2 extends DebugBreakpointImpl1 { - - private IDebugBreakpoint2 jnaBreakpoint; - - public DebugBreakpointImpl2(IDebugBreakpoint2 jnaBreakpoint) { - super(jnaBreakpoint); - this.jnaBreakpoint = jnaBreakpoint; - } - - @Override - public void dispose() { - super.dispose(); - jnaBreakpoint = null; - } - - @Override - public String getOffsetExpression() { - ULONGByReference pulExpressionSize = new ULONGByReference(); - COMUtils.checkRC( - jnaBreakpoint.GetOffsetExpressionWide(null, new ULONG(0), pulExpressionSize)); - char[] buffer = new char[pulExpressionSize.getValue().intValue()]; - COMUtils.checkRC( - jnaBreakpoint.GetOffsetExpressionWide(buffer, pulExpressionSize.getValue(), null)); - return Native.toString(buffer); - } - - @Override - public void setOffsetExpression(String expression) { - COMUtils.checkRC(jnaBreakpoint.SetOffsetExpressionWide(new WString(expression))); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/breakpoint/DebugBreakpointImpl3.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/breakpoint/DebugBreakpointImpl3.java deleted file mode 100644 index 0647815afe..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/breakpoint/DebugBreakpointImpl3.java +++ /dev/null @@ -1,34 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.breakpoint; - -import agent.dbgeng.jna.dbgeng.breakpoint.IDebugBreakpoint3; - -public class DebugBreakpointImpl3 extends DebugBreakpointImpl2 { - @SuppressWarnings("unused") - private IDebugBreakpoint3 jnaBreakpoint; - - public DebugBreakpointImpl3(IDebugBreakpoint3 jnaBreakpoint) { - super(jnaBreakpoint); - this.jnaBreakpoint = jnaBreakpoint; - } - - @Override - public void dispose() { - super.dispose(); - jnaBreakpoint = null; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/breakpoint/DebugBreakpointInternal.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/breakpoint/DebugBreakpointInternal.java deleted file mode 100644 index 6ed0dbb4d2..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/breakpoint/DebugBreakpointInternal.java +++ /dev/null @@ -1,60 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.breakpoint; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.dbgeng.DebugBreakpoint; -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgeng.impl.dbgeng.control.DebugControlInternal; -import agent.dbgeng.jna.dbgeng.breakpoint.*; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DebugBreakpointInternal extends DebugBreakpoint { - Map CACHE = new WeakValueHashMap<>(); - - static DebugBreakpointInternal instanceFor(WrapIDebugBreakpoint bp) { - return DbgEngUtil.lazyWeakCache(CACHE, bp, DebugBreakpointImpl1::new); - } - - static DebugBreakpointInternal instanceFor(WrapIDebugBreakpoint2 bp) { - return DbgEngUtil.lazyWeakCache(CACHE, bp, DebugBreakpointImpl2::new); - } - - static DebugBreakpointInternal instanceFor(WrapIDebugBreakpoint3 bp) { - return DbgEngUtil.lazyWeakCache(CACHE, bp, DebugBreakpointImpl3::new); - } - - List> PREFERRED_BREAKPOINT_IIDS = List.of( - new Preferred<>(IDebugBreakpoint3.IID_IDEBUG_BREAKPOINT3, WrapIDebugBreakpoint3.class), - new Preferred<>(IDebugBreakpoint2.IID_IDEBUG_BREAKPOINT2, WrapIDebugBreakpoint2.class), - new Preferred<>(IDebugBreakpoint.IID_IDEBUG_BREAKPOINT, WrapIDebugBreakpoint.class)); - - static DebugBreakpointInternal tryPreferredInterfaces(DebugControlInternal control, - InterfaceSupplier supplier) { - DebugBreakpointInternal bpt = DbgEngUtil.tryPreferredInterfaces( - DebugBreakpointInternal.class, PREFERRED_BREAKPOINT_IIDS, supplier); - bpt.setControl(control); - return bpt; - } - - void setControl(DebugControlInternal control); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/client/DebugClientImpl1.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/client/DebugClientImpl1.java deleted file mode 100644 index 6a257e759d..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/client/DebugClientImpl1.java +++ /dev/null @@ -1,333 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.client; - -import java.util.ArrayList; -import java.util.List; - -import com.sun.jna.Native; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.platform.win32.COM.COMUtils; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgeng.dbgeng.*; -import agent.dbgeng.dbgeng.DbgEng.OpaqueCleanable; -import agent.dbgeng.impl.dbgeng.DebugRunningProcessImpl; -import agent.dbgeng.impl.dbgeng.advanced.DebugAdvancedInternal; -import agent.dbgeng.impl.dbgeng.control.DebugControlInternal; -import agent.dbgeng.impl.dbgeng.dataspaces.DebugDataSpacesInternal; -import agent.dbgeng.impl.dbgeng.event.WrapCallbackIDebugEventCallbacks; -import agent.dbgeng.impl.dbgeng.io.WrapCallbackIDebugInputCallbacks; -import agent.dbgeng.impl.dbgeng.io.WrapCallbackIDebugOutputCallbacks; -import agent.dbgeng.impl.dbgeng.registers.DebugRegistersInternal; -import agent.dbgeng.impl.dbgeng.symbols.DebugSymbolsInternal; -import agent.dbgeng.impl.dbgeng.sysobj.DebugSystemObjectsInternal; -import agent.dbgeng.jna.dbgeng.client.IDebugClient; -import agent.dbgeng.jna.dbgeng.event.ListenerIDebugEventCallbacks; -import agent.dbgeng.jna.dbgeng.event.MarkerEventCallbacks; -import agent.dbgeng.jna.dbgeng.io.*; -import ghidra.comm.util.BitmaskSet; - -public class DebugClientImpl1 implements DebugClientInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IDebugClient jnaClient; - - private DebugAdvancedInternal advanced; - private DebugControlInternal control; - private DebugDataSpaces data; - private DebugRegisters registers; - private DebugSymbols symbols; - private DebugSystemObjects sysobjs; - - // Keep references to callbacks here, since JNA doesn't keep one for things handed to natives. - protected MarkerOutputCallbacks listenerOutput; - protected MarkerInputCallbacks listenerInput; - protected MarkerEventCallbacks listenerEvent; - - public DebugClientImpl1(IDebugClient jnaClient) { - // TODO: Debug and verify COM resource management - this.cleanable = DbgEng.releaseWhenPhantom(this, jnaClient); - this.jnaClient = jnaClient; - } - - @Override - public IDebugClient getJNAClient() { - return jnaClient; - } - - @Override - public DebugAdvanced getAdvanced() { - if (advanced == null) { - advanced = DebugAdvancedInternal.tryPreferredInterfaces(jnaClient::QueryInterface); - } - return advanced; - } - - @Override - public DebugControlInternal getControlInternal() { - if (control == null) { - control = DebugControlInternal.tryPreferredInterfaces(jnaClient::QueryInterface); - } - return control; - } - - @Override - public DebugControl getControl() { - return getControlInternal(); - } - - @Override - public DebugDataSpaces getDataSpaces() { - if (data == null) { - data = DebugDataSpacesInternal.tryPreferredInterfaces(jnaClient::QueryInterface); - } - return data; - } - - @Override - public DebugRegisters getRegisters() { - if (registers == null) { - registers = DebugRegistersInternal.tryPreferredInterfaces(jnaClient::QueryInterface); - } - return registers; - } - - @Override - public DebugSymbols getSymbols() { - if (symbols == null) { - symbols = DebugSymbolsInternal.tryPreferredInterfaces(jnaClient::QueryInterface); - } - return symbols; - } - - @Override - public DebugSystemObjects getSystemObjects() { - if (sysobjs == null) { - sysobjs = DebugSystemObjectsInternal.tryPreferredInterfaces(jnaClient::QueryInterface); - } - return sysobjs; - } - - @Override - public DebugServerId getLocalServer() { - return new DebugServerId(0); - } - - @Override - public void startProcessServer(String options) { - COMUtils.checkRC(jnaClient.StartProcessServer(new ULONG(DebugClass.USER_WINDOWS.ordinal()), - options, null)); - } - - @Override - public DebugServerId connectProcessServer(String options) { - ULONGLONGByReference pulServer = new ULONGLONGByReference(); - COMUtils.checkRC(jnaClient.ConnectProcessServer(options, pulServer)); - return new DebugServerId(pulServer.getValue().longValue()); - } - - @Override - public List getRunningProcesses(DebugServerId si) { - ULONGLONG server = new ULONGLONG(si.id); - ULONGByReference actualCount = new ULONGByReference(); - COMUtils.checkRC( - jnaClient.GetRunningProcessSystemIds(server, null, new ULONG(0), actualCount)); - - int[] ids = new int[actualCount.getValue().intValue()]; - COMUtils.checkRC( - jnaClient.GetRunningProcessSystemIds(server, ids, actualCount.getValue(), null)); - - List result = new ArrayList<>(ids.length); - for (int id : ids) { - result.add(new DebugRunningProcessImpl(this, si, id)); - } - return result; - } - - @Override - public DebugRunningProcess.Description getProcessDescription(DebugServerId si, int systemId, - BitmaskSet flags) { - ULONGLONG ullServer = new ULONGLONG(si.id); - ULONG ulId = new ULONG(systemId); - ULONG ulFlags = new ULONG(flags.getBitmask()); - - ULONGByReference actualExeNameSize = new ULONGByReference(); - ULONGByReference actualDescriptionSize = new ULONGByReference(); - COMUtils.checkRC(jnaClient.GetRunningProcessDescription(ullServer, ulId, ulFlags, null, - new ULONG(0), actualExeNameSize, null, new ULONG(0), actualDescriptionSize)); - - byte[] exeName = new byte[actualExeNameSize.getValue().intValue()]; - byte[] description = new byte[actualDescriptionSize.getValue().intValue()]; - COMUtils.checkRC(jnaClient.GetRunningProcessDescription(ullServer, ulId, ulFlags, exeName, - actualExeNameSize.getValue(), null, description, actualDescriptionSize.getValue(), - null)); - - return new DebugRunningProcess.Description(systemId, Native.toString(exeName), - Native.toString(description)); - } - - @Override - public void attachProcess(DebugServerId si, long processId, - BitmaskSet attachFlags) { - ULONGLONG ullServer = new ULONGLONG(si.id); - ULONG ulPid = new ULONG(processId); - ULONG ulFlags = new ULONG(attachFlags.getBitmask()); - COMUtils.checkRC(jnaClient.AttachProcess(ullServer, ulPid, ulFlags)); - } - - @Override - public void createProcess(DebugServerId si, String commandLine, - String unusedInitialDirectory, String unusedEnvironment, - BitmaskSet createFlags, - BitmaskSet unusedEngCreateFlags, - BitmaskSet unusedVerifierFlags) { - ULONGLONG ullServer = new ULONGLONG(si.id); - ULONG ulFlags = new ULONG(createFlags.getBitmask()); - if (unusedInitialDirectory != null && unusedInitialDirectory.length() > 0) { - throw new UnsupportedOperationException( - "IDebugClient1 does not support 'initial directory'"); - } - if (unusedEnvironment != null && unusedEnvironment.length() > 0) { - throw new UnsupportedOperationException("IDebugClient1 does not support 'environment'"); - } - COMUtils.checkRC(jnaClient.CreateProcess(ullServer, commandLine, ulFlags)); - } - - @Override - public void createProcessAndAttach(DebugServerId si, String commandLine, - BitmaskSet createFlags, int processId, - BitmaskSet attachFlags) { - ULONGLONG ullServer = new ULONGLONG(si.id); - ULONG ulFlags1 = new ULONG(createFlags.getBitmask()); - ULONG ulPid = new ULONG(processId); - ULONG ulFlags2 = new ULONG(attachFlags.getBitmask()); - COMUtils.checkRC( - jnaClient.CreateProcessAndAttach(ullServer, commandLine, ulFlags1, ulPid, ulFlags2)); - } - - @Override - public void startServer(String options) { - COMUtils.checkRC(jnaClient.StartServer(options)); - } - - @Override - public boolean dispatchCallbacks(int timeout) { - HRESULT hr = jnaClient.DispatchCallbacks(new ULONG(timeout)); - COMUtils.checkRC(hr); - return hr.equals(WinNT.S_OK); - } - - @Override - public void flushCallbacks() { - HRESULT hr = jnaClient.FlushCallbacks(); - COMUtils.checkRC(hr); - } - - @Override - public void exitDispatch(DebugClient client) { - DebugClientInternal ic = (DebugClientInternal) client; - COMUtils.checkRC(jnaClient.ExitDispatch(ic.getJNAClient())); - } - - @Override - public DebugClient createClient() { - PointerByReference ppClient = new PointerByReference(); - COMUtils.checkRC(jnaClient.CreateClient(ppClient)); - return DebugClientInternal.tryPreferredInterfaces(jnaClient::QueryInterface); - } - - @Override - public void setInputCallbacks(DebugInputCallbacks cb) { - ListenerIDebugInputCallbacks listener = null; - if (cb != null) { - WrapCallbackIDebugInputCallbacks callback = - new WrapCallbackIDebugInputCallbacks(this, cb); - listener = new ListenerIDebugInputCallbacks(callback); - callback.setListener(listener); - } - COMUtils.checkRC(jnaClient.SetInputCallbacks(listener)); - listenerInput = listener; - } - - @Override - public void setOutputCallbacks(DebugOutputCallbacks cb) { - ListenerIDebugOutputCallbacks listener = null; - if (cb != null) { - WrapCallbackIDebugOutputCallbacks callback = new WrapCallbackIDebugOutputCallbacks(cb); - listener = new ListenerIDebugOutputCallbacks(callback); - callback.setListener(listener); - } - COMUtils.checkRC(jnaClient.SetOutputCallbacks(listener)); - listenerOutput = listener; - } - - @Override - public void setEventCallbacks(DebugEventCallbacks cb) { - ListenerIDebugEventCallbacks listener = null; - if (cb != null) { - WrapCallbackIDebugEventCallbacks callback = - new WrapCallbackIDebugEventCallbacks(this, cb); - listener = new ListenerIDebugEventCallbacks(callback); - callback.setListener(listener); - } - COMUtils.checkRC(jnaClient.SetEventCallbacks(listener)); - listenerEvent = listener; - } - - @Override - public void terminateCurrentProcess() { - throw new UnsupportedOperationException("Not implemented by this interface"); - } - - @Override - public void detachCurrentProcess() { - throw new UnsupportedOperationException("Not implemented by this interface"); - } - - @Override - public void abandonCurrentProcess() { - throw new UnsupportedOperationException("Not implemented by this interface"); - } - - @Override - public void waitForProcessServerEnd(int timeout) { - throw new UnsupportedOperationException("Not implemented by this interface"); - } - - @Override - public void endSession(DebugEndSessionFlags flags) { - COMUtils.checkRC(jnaClient.EndSession(new ULONG(flags.getValue()))); - } - - @Override - public void connectSession(int flags) { - COMUtils.checkRC(jnaClient.ConnectSession(new ULONG(flags), new ULONG(10000))); - } - - @Override - public void openDumpFileWide(String fileName) { - throw new UnsupportedOperationException("Not implemented by this interface"); - } - - @Override - public void attachKernel(long flags, String options) { - throw new UnsupportedOperationException("Not implemented by this interface"); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/client/DebugClientImpl2.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/client/DebugClientImpl2.java deleted file mode 100644 index 15578d0a24..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/client/DebugClientImpl2.java +++ /dev/null @@ -1,50 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.client; - -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.COM.COMUtils; - -import agent.dbgeng.jna.dbgeng.client.IDebugClient2; - -public class DebugClientImpl2 extends DebugClientImpl1 { - private final IDebugClient2 jnaClient; - - public DebugClientImpl2(IDebugClient2 jnaClient) { - super(jnaClient); - this.jnaClient = jnaClient; - } - - @Override - public void terminateCurrentProcess() { - COMUtils.checkRC(jnaClient.TerminateCurrentProcess()); - } - - @Override - public void detachCurrentProcess() { - COMUtils.checkRC(jnaClient.DetachCurrentProcess()); - } - - @Override - public void abandonCurrentProcess() { - COMUtils.checkRC(jnaClient.AbandonCurrentProcess()); - } - - @Override - public void waitForProcessServerEnd(int timeout) { - COMUtils.checkRC(jnaClient.WaitForProcessServerEnd(new ULONG(timeout))); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/client/DebugClientImpl3.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/client/DebugClientImpl3.java deleted file mode 100644 index 3c509d47c2..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/client/DebugClientImpl3.java +++ /dev/null @@ -1,76 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.client; - -import com.sun.jna.Native; -import com.sun.jna.WString; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.COM.COMUtils; - -import agent.dbgeng.dbgeng.DebugRunningProcess; -import agent.dbgeng.dbgeng.DebugRunningProcess.Description.ProcessDescriptionFlags; -import agent.dbgeng.dbgeng.DebugServerId; -import agent.dbgeng.jna.dbgeng.client.IDebugClient3; -import ghidra.comm.util.BitmaskSet; - -public class DebugClientImpl3 extends DebugClientImpl2 { - private final IDebugClient3 jnaClient; - - public DebugClientImpl3(IDebugClient3 jnaClient) { - super(jnaClient); - this.jnaClient = jnaClient; - } - - @Override - public void createProcess(DebugServerId si, String commandLine, - String unusedInitialDirectory, String unusedEnvironment, - BitmaskSet createFlags, - BitmaskSet unusedEngCreateFlags, - BitmaskSet unusedVerifierFlags) { - ULONGLONG ullServer = new ULONGLONG(si.id); - ULONG ulFlags = new ULONG(createFlags.getBitmask()); - if (unusedInitialDirectory != null && unusedInitialDirectory.length() > 0) { - throw new UnsupportedOperationException( - "IDebugClient3 does not support 'initial directory'"); - } - if (unusedEnvironment != null && unusedEnvironment.length() > 0) { - throw new UnsupportedOperationException("IDebugClient3 does not support 'environment'"); - } - COMUtils.checkRC(jnaClient.CreateProcessWide(ullServer, new WString(commandLine), ulFlags)); - } - - @Override - public DebugRunningProcess.Description getProcessDescription(DebugServerId si, int systemId, - BitmaskSet flags) { - ULONGLONG server = new ULONGLONG(si.id); - ULONG id = new ULONG(systemId); - ULONG f = new ULONG(flags.getBitmask()); - - ULONGByReference actualExeNameSize = new ULONGByReference(); - ULONGByReference actualDescriptionSize = new ULONGByReference(); - COMUtils.checkRC(jnaClient.GetRunningProcessDescriptionWide(server, id, f, null, - new ULONG(0), actualExeNameSize, null, new ULONG(0), actualDescriptionSize)); - - char[] exeName = new char[actualExeNameSize.getValue().intValue()]; - char[] description = new char[actualDescriptionSize.getValue().intValue()]; - COMUtils.checkRC(jnaClient.GetRunningProcessDescriptionWide(server, id, f, exeName, - actualExeNameSize.getValue(), null, description, actualDescriptionSize.getValue(), - null)); - - return new DebugRunningProcess.Description(systemId, Native.toString(exeName), - Native.toString(description)); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/client/DebugClientImpl4.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/client/DebugClientImpl4.java deleted file mode 100644 index a97d1fd041..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/client/DebugClientImpl4.java +++ /dev/null @@ -1,39 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.client; - -import com.sun.jna.WString; -import com.sun.jna.platform.win32.WinDef.ULONGLONG; - -import agent.dbgeng.jna.dbgeng.client.IDebugClient4; - -import com.sun.jna.platform.win32.COM.COMUtils; - -public class DebugClientImpl4 extends DebugClientImpl3 { - @SuppressWarnings("unused") - private final IDebugClient4 jnaClient; - - public DebugClientImpl4(IDebugClient4 jnaClient) { - super(jnaClient); - this.jnaClient = jnaClient; - } - - @Override - public void openDumpFileWide(String fileName) { - ULONGLONG ullFileHandle = new ULONGLONG(0); - COMUtils.checkRC(jnaClient.OpenDumpFileWide(new WString(fileName), ullFileHandle)); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/client/DebugClientImpl5.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/client/DebugClientImpl5.java deleted file mode 100644 index a572fd585c..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/client/DebugClientImpl5.java +++ /dev/null @@ -1,103 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.client; - -import com.sun.jna.WString; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.COM.COMUtils; - -import agent.dbgeng.dbgeng.*; -import agent.dbgeng.impl.dbgeng.event.WrapCallbackIDebugEventCallbacksWide; -import agent.dbgeng.impl.dbgeng.io.WrapCallbackIDebugOutputCallbacksWide; -import agent.dbgeng.jna.dbgeng.DbgEngNative.DEBUG_CREATE_PROCESS_OPTIONS; -import agent.dbgeng.jna.dbgeng.client.IDebugClient5; -import agent.dbgeng.jna.dbgeng.event.ListenerIDebugEventCallbacksWide; -import agent.dbgeng.jna.dbgeng.io.ListenerIDebugOutputCallbacksWide; -import ghidra.comm.util.BitmaskSet; - -public class DebugClientImpl5 extends DebugClientImpl4 { - private final IDebugClient5 jnaClient; - - public DebugClientImpl5(IDebugClient5 jnaClient) { - super(jnaClient); - this.jnaClient = jnaClient; - } - - @Override - public void createProcess(DebugServerId si, String commandLine, - String initialDirectory, String environment, - BitmaskSet createFlags, - BitmaskSet engCreateFlags, - BitmaskSet verifierFlags) { - ULONGLONG ullServer = new ULONGLONG(si.id); - DEBUG_CREATE_PROCESS_OPTIONS options = new DEBUG_CREATE_PROCESS_OPTIONS(); - options.CreateFlags = new ULONG(createFlags.getBitmask()); - options.EngCreateFlags = new ULONG(engCreateFlags.getBitmask()); - options.VerifierFlags = new ULONG(verifierFlags.getBitmask()); - ULONG ulOptionsBufferSize = new ULONG(options.size()); - WString cmdLine = new WString(commandLine); - WString initDir = initialDirectory == null ? null : new WString(initialDirectory); - WString env = environment == null ? null : new WString(environment); - COMUtils.checkRC(jnaClient.CreateProcess2Wide(ullServer, cmdLine, - options, ulOptionsBufferSize, - initDir, env)); - } - - @Override - public void attachKernel(long flags, String options) { - ULONG connectFlags = new ULONG(flags); - COMUtils.checkRC(jnaClient.AttachKernelWide(connectFlags, new WString(options))); - } - - @Override - public void startProcessServer(String options) { - COMUtils.checkRC(jnaClient.StartProcessServerWide( - new ULONG(DebugClass.USER_WINDOWS.ordinal()), new WString(options), null)); - } - - @Override - public DebugServerId connectProcessServer(String options) { - ULONGLONGByReference pulServer = new ULONGLONGByReference(); - COMUtils.checkRC(jnaClient.ConnectProcessServerWide(new WString(options), pulServer)); - return new DebugServerId(pulServer.getValue().longValue()); - } - - @Override - public void setOutputCallbacks(DebugOutputCallbacks cb) { - ListenerIDebugOutputCallbacksWide listener = null; - if (cb != null) { - WrapCallbackIDebugOutputCallbacksWide callback = - new WrapCallbackIDebugOutputCallbacksWide(cb); - listener = new ListenerIDebugOutputCallbacksWide(callback); - callback.setListener(listener); - } - COMUtils.checkRC(jnaClient.SetOutputCallbacksWide(listener)); - listenerOutput = listener; - } - - @Override - public void setEventCallbacks(DebugEventCallbacks cb) { - ListenerIDebugEventCallbacksWide listener = null; - if (cb != null) { - WrapCallbackIDebugEventCallbacksWide callback = - new WrapCallbackIDebugEventCallbacksWide(this, cb); - listener = new ListenerIDebugEventCallbacksWide(callback); - callback.setListener(listener); - } - COMUtils.checkRC(jnaClient.SetEventCallbacksWide(listener)); - listenerEvent = listener; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/client/DebugClientImpl6.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/client/DebugClientImpl6.java deleted file mode 100644 index 8282a39d72..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/client/DebugClientImpl6.java +++ /dev/null @@ -1,35 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.client; - -import agent.dbgeng.dbgeng.DebugEventCallbacks; -import agent.dbgeng.jna.dbgeng.client.IDebugClient6; - -public class DebugClientImpl6 extends DebugClientImpl5 { - @SuppressWarnings("unused") - private final IDebugClient6 jnaClient; - - public DebugClientImpl6(IDebugClient6 jnaClient) { - super(jnaClient); - this.jnaClient = jnaClient; - } - - @Override - public void setEventCallbacks(DebugEventCallbacks cb) { - // TODO: Use Context variant. Will require expanding the generic interface. - super.setEventCallbacks(cb); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/client/DebugClientImpl7.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/client/DebugClientImpl7.java deleted file mode 100644 index 3ac1b9139c..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/client/DebugClientImpl7.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.client; - -import agent.dbgeng.jna.dbgeng.client.IDebugClient7; - -public class DebugClientImpl7 extends DebugClientImpl6 { - @SuppressWarnings("unused") - private final IDebugClient7 jnaClient; - - public DebugClientImpl7(IDebugClient7 jnaClient) { - super(jnaClient); - this.jnaClient = jnaClient; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/client/DebugClientInternal.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/client/DebugClientInternal.java deleted file mode 100644 index 2ac51026b6..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/client/DebugClientInternal.java +++ /dev/null @@ -1,92 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.client; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.dbgeng.DebugClient; -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgeng.impl.dbgeng.control.DebugControlInternal; -import agent.dbgeng.jna.dbgeng.client.*; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DebugClientInternal extends DebugClient { - Map CACHE = new WeakValueHashMap<>(); - - enum DebugClass { - UNINITIALIZED, // - KERNEL, // - USER_WINDOWS, // - IMAGE_FILE, // - ; - } - - static DebugClientInternal instanceFor(WrapIDebugClient client) { - return DbgEngUtil.lazyWeakCache(CACHE, client, DebugClientImpl1::new); - } - - static DebugClientInternal instanceFor(WrapIDebugClient2 client) { - return DbgEngUtil.lazyWeakCache(CACHE, client, DebugClientImpl2::new); - } - - static DebugClientInternal instanceFor(WrapIDebugClient3 client) { - return DbgEngUtil.lazyWeakCache(CACHE, client, DebugClientImpl3::new); - } - - static DebugClientInternal instanceFor(WrapIDebugClient4 client) { - return DbgEngUtil.lazyWeakCache(CACHE, client, DebugClientImpl4::new); - } - - static DebugClientInternal instanceFor(WrapIDebugClient5 client) { - return DbgEngUtil.lazyWeakCache(CACHE, client, DebugClientImpl5::new); - } - - static DebugClientInternal instanceFor(WrapIDebugClient6 client) { - return DbgEngUtil.lazyWeakCache(CACHE, client, DebugClientImpl6::new); - } - - static DebugClientInternal instanceFor(WrapIDebugClient7 client) { - return DbgEngUtil.lazyWeakCache(CACHE, client, DebugClientImpl7::new); - } - - List> PREFERRED_CLIENT_IIDS = List.of( - new Preferred<>(IDebugClient7.IID_IDEBUG_CLIENT7, WrapIDebugClient7.class), - new Preferred<>(IDebugClient6.IID_IDEBUG_CLIENT6, WrapIDebugClient6.class), - new Preferred<>(IDebugClient5.IID_IDEBUG_CLIENT5, WrapIDebugClient5.class), - new Preferred<>(IDebugClient4.IID_IDEBUG_CLIENT4, WrapIDebugClient4.class), - new Preferred<>(IDebugClient3.IID_IDEBUG_CLIENT3, WrapIDebugClient3.class), - new Preferred<>(IDebugClient2.IID_IDEBUG_CLIENT2, WrapIDebugClient2.class), - new Preferred<>(IDebugClient.IID_IDEBUG_CLIENT, WrapIDebugClient.class)); - - static DebugClientInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(DebugClientInternal.class, PREFERRED_CLIENT_IIDS, - supplier); - } - - IDebugClient getJNAClient(); - - DebugControlInternal getControlInternal(); - - @Override - default void endSessionReentrant() { - endSession(DebugEndSessionFlags.DEBUG_END_REENTRANT); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/control/DebugControlImpl1.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/control/DebugControlImpl1.java deleted file mode 100644 index 63ca444e04..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/control/DebugControlImpl1.java +++ /dev/null @@ -1,445 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.control; - -import javax.help.UnsupportedOperationException; - -import com.sun.jna.Native; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinError; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.platform.win32.COM.COMUtils; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgeng.dbgeng.*; -import agent.dbgeng.dbgeng.DbgEng.OpaqueCleanable; -import agent.dbgeng.dbgeng.DebugBreakpoint.BreakType; -import agent.dbgeng.dbgeng.DebugClient.DebugStatus; -import agent.dbgeng.dbgeng.DebugValue.DebugValueType; -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.breakpoint.DebugBreakpointInternal; -import agent.dbgeng.jna.dbgeng.DbgEngNative.*; -import agent.dbgeng.jna.dbgeng.breakpoint.IDebugBreakpoint; -import agent.dbgeng.jna.dbgeng.breakpoint.WrapIDebugBreakpoint; -import agent.dbgeng.jna.dbgeng.control.IDebugControl; -import ghidra.comm.util.BitmaskSet; - -public class DebugControlImpl1 implements DebugControlInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IDebugControl jnaControl; - - public DebugControlImpl1(IDebugControl jnaControl) { - this.cleanable = DbgEng.releaseWhenPhantom(this, jnaControl); - this.jnaControl = jnaControl; - } - - @Override - public boolean getInterrupt() { - HRESULT interrupt = jnaControl.GetInterrupt(); - if (interrupt.equals(WinError.S_OK)) { - return true; - } - if (interrupt.equals(WinError.S_FALSE)) { - return false; - } - COMUtils.checkRC(interrupt); - throw new AssertionError("Shouldn't get here"); - } - - @Override - public void setInterrupt(DebugInterrupt interrupt) { - ULONG flags = new ULONG(interrupt.ordinal()); - COMUtils.checkRC(jnaControl.SetInterrupt(flags)); - } - - @Override - public int getInterruptTimeout() { - ULONGByReference pulSeconds = new ULONGByReference(); - COMUtils.checkRC(jnaControl.GetInterruptTimeout(pulSeconds)); - return pulSeconds.getValue().intValue(); - } - - @Override - public void setInterruptTimeout(int seconds) { - ULONG ulSeconds = new ULONG(seconds); - COMUtils.checkRC(jnaControl.SetInterruptTimeout(ulSeconds)); - } - - @Override - public void print(BitmaskSet levels, String message) { - ULONG mask = new ULONG(levels.getBitmask()); - COMUtils.checkRC(jnaControl.Output(mask, "%s", message)); - } - - @Override - public void println(BitmaskSet levels, String message) { - ULONG mask = new ULONG(levels.getBitmask()); - COMUtils.checkRC(jnaControl.Output(mask, "%s", message + "\r\n")); - } - - @Override - public void prompt(BitmaskSet ctl, String message) { - ULONG ctlMask = new ULONG(ctl.getBitmask()); - COMUtils.checkRC(jnaControl.OutputPrompt(ctlMask, "%s", message)); - } - - @Override - public String getPromptText() { - ULONGByReference pulTextSize = new ULONGByReference(); - COMUtils.checkRC(jnaControl.GetPromptText(null, new ULONG(0), pulTextSize)); - byte[] buffer = new byte[pulTextSize.getValue().intValue()]; - COMUtils.checkRC(jnaControl.GetPromptText(buffer, pulTextSize.getValue(), null)); - return Native.toString(buffer); - } - - protected DEBUG_VALUE doEval(DebugValueType type, String expression) { - DEBUG_VALUE.ByReference value = new DEBUG_VALUE.ByReference(); - ULONGByReference pulRemainder = new ULONGByReference(); - COMUtils.checkRC( - jnaControl.Evaluate(expression, new ULONG(type.ordinal()), value, pulRemainder)); - int remainder = pulRemainder.getValue().intValue(); - if (remainder != expression.length()) { - throw new RuntimeException("Failed to parse: " + expression.substring(remainder)); - } - return value; - } - - @Override - public T evaluate(Class desiredType, String expression) { - DebugValueType type = DebugValueType.getDebugValueTypeForClass(desiredType); - return doEval(type, expression).convertTo(desiredType); - } - - @Override - public void execute(BitmaskSet ctl, String cmd, - BitmaskSet flags) { - ULONG ctlMask = new ULONG(ctl.getBitmask()); - ULONG flagMask = new ULONG(flags.getBitmask()); - HRESULT hr = jnaControl.Execute(ctlMask, cmd, flagMask); - if (hr.equals(COMUtilsExtra.E_INTERNALEXCEPTION)) { - return; - } - COMUtils.checkRC(hr); - } - - @Override - public void returnInput(String input) { - COMUtils.checkRC(jnaControl.ReturnInput(input)); - } - - @Override - public DebugStatus getExecutionStatus() { - ULONGByReference pulStatus = new ULONGByReference(); - COMUtils.checkRC(jnaControl.GetExecutionStatus(pulStatus)); - return DebugStatus.values()[pulStatus.getValue().intValue()]; - } - - @Override - public void setExecutionStatus(DebugStatus status) { - ULONG ulStatus = new ULONG(status.ordinal()); - HRESULT hr = jnaControl.SetExecutionStatus(ulStatus); - if (!hr.equals(COMUtilsExtra.E_ACCESS_DENIED)) { - COMUtils.checkRC(hr); - } - } - - public DebugBreakpoint doAddBreakpoint(BreakType type, ULONG ulDesiredId) { - ULONG ulType = new ULONG(type.ordinal()); - PointerByReference ppBp = new PointerByReference(); - COMUtils.checkRC(jnaControl.AddBreakpoint(ulType, ulDesiredId, ppBp)); - IDebugBreakpoint Bp = new WrapIDebugBreakpoint(ppBp.getValue()); - DebugBreakpoint bpt = - DebugBreakpointInternal.tryPreferredInterfaces(this, Bp::QueryInterface); - // AddRef or no? Probably not. - return bpt; - } - - @Override - public int getNumberBreakpoints() { - ULONGByReference ulNumber = new ULONGByReference(); - COMUtils.checkRC(jnaControl.GetNumberBreakpoints(ulNumber)); - return ulNumber.getValue().intValue(); - } - - @Override - public DebugBreakpoint getBreakpointByIndex(int index) { - ULONG ulIndex = new ULONG(index); - PointerByReference ppBp = new PointerByReference(); - COMUtils.checkRC(jnaControl.GetBreakpointByIndex(ulIndex, ppBp)); - IDebugBreakpoint Bp = new WrapIDebugBreakpoint(ppBp.getValue()); - DebugBreakpoint bpt = - DebugBreakpointInternal.tryPreferredInterfaces(this, Bp::QueryInterface); - // NOTE: Do not AddRef. dbgeng manages lifecycle - return bpt; - } - - @Override - public DebugBreakpoint getBreakpointById(int id) { - ULONG ulId = new ULONG(id); - PointerByReference ppBp = new PointerByReference(); - HRESULT hr = jnaControl.GetBreakpointById(ulId, ppBp); - if (hr.equals(COMUtilsExtra.E_NOINTERFACE)) { - return null; - } - if (hr.equals(COMUtilsExtra.E_UNEXPECTED)) { - return null; - } - COMUtils.checkRC(hr); - IDebugBreakpoint Bp = new WrapIDebugBreakpoint(ppBp.getValue()); - DebugBreakpoint bpt = - DebugBreakpointInternal.tryPreferredInterfaces(this, Bp::QueryInterface); - // NOTE: Do not AddRef. dbgeng manages lifecycle - return bpt; - } - - @Override - public DebugBreakpoint addBreakpoint(BreakType type, int desiredId) { - return doAddBreakpoint(type, new ULONG(desiredId)); - } - - @Override - public DebugBreakpoint addBreakpoint(BreakType type) { - return doAddBreakpoint(type, DbgEngUtil.DEBUG_ANY_ID); - } - - @Override - public DebugBreakpoint addBreakpoint2(BreakType type) { - throw new UnsupportedOperationException(); - } - - @Override - public DebugBreakpoint addBreakpoint2(BreakType type, int desiredId) { - throw new UnsupportedOperationException(); - } - - @Override - public void removeBreakpoint(IDebugBreakpoint comBpt) { - COMUtils.checkRC(jnaControl.RemoveBreakpoint(comBpt)); - } - - @Override - public void waitForEvent(int timeout) { - COMUtils.checkRC(jnaControl.WaitForEvent(new ULONG(0), new ULONG(timeout))); - } - - @Override - public DebugEventInformation getLastEventInformation() { - ULONGByReference pulType = new ULONGByReference(); - ULONGByReference pulProcessId = new ULONGByReference(); - ULONGByReference pulThreadId = new ULONGByReference(); - //PointerByReference pExtraInformation = new PointerByReference(); - ULONG ulExtraInformationSize = new ULONG(0); - ULONGByReference pulExtraInformationUsed = new ULONGByReference(); - //byte[] pstrDescription = new byte[0]; - ULONG ulDescriptionSize = new ULONG(0); - ULONGByReference pulDescriptionUsed = new ULONGByReference(); - COMUtils.checkRC(jnaControl.GetLastEventInformation(pulType, pulProcessId, pulThreadId, - null, ulExtraInformationSize, pulExtraInformationUsed, null, ulDescriptionSize, - pulDescriptionUsed)); - return new DebugEventInformation(pulType.getValue().intValue(), - pulProcessId.getValue().intValue(), pulThreadId.getValue().intValue()); - } - - @Override - public DebugStackInformation getStackTrace(long frameOffset, long stackOffset, - long instructionOffset) { - ULONGLONG ullFrameOffset = new ULONGLONG(frameOffset); - ULONGLONG ullStackOffset = new ULONGLONG(stackOffset); - ULONGLONG ullInstructionOffset = new ULONGLONG(instructionOffset); - ULONG ulFrameSize = new ULONG(100); - DEBUG_STACK_FRAME[] pParams = new DEBUG_STACK_FRAME[ulFrameSize.intValue()]; - ULONGByReference pulFramesFilled = new ULONGByReference(); - COMUtils.checkRC(jnaControl.GetStackTrace(ullFrameOffset, ullStackOffset, - ullInstructionOffset, pParams, ulFrameSize, pulFramesFilled)); - return new DebugStackInformation(pulFramesFilled.getValue().intValue(), pParams); - } - - @Override - public int getActualProcessorType() { - ULONGByReference ulType = new ULONGByReference(); - HRESULT hr = jnaControl.GetActualProcessorType(ulType); - if (hr.equals(COMUtilsExtra.E_UNEXPECTED)) { - return -1; - } - COMUtils.checkRC(hr); - return ulType.getValue().intValue(); - } - - @Override - public int getEffectiveProcessorType() { - ULONGByReference ulType = new ULONGByReference(); - COMUtils.checkRC(jnaControl.GetEffectiveProcessorType(ulType)); - return ulType.getValue().intValue(); - } - - @Override - public int getExecutingProcessorType() { - ULONGByReference ulType = new ULONGByReference(); - COMUtils.checkRC(jnaControl.GetExecutingProcessorType(ulType)); - return ulType.getValue().intValue(); - } - - @Override - public int getDebuggeeType() { - ULONGByReference ulClass = new ULONGByReference(); - ULONGByReference ulQualifier = new ULONGByReference(); - COMUtils.checkRC(jnaControl.GetDebuggeeType(ulClass, ulQualifier)); - return ulClass.getValue().intValue(); - } - - @Override - public DebugFilterInformation getNumberEventFilters() { - ULONGByReference ulSpecificEvents = new ULONGByReference(); - ULONGByReference ulSpecificExceptions = new ULONGByReference(); - ULONGByReference ulArbitraryExceptions = new ULONGByReference(); - COMUtils.checkRC(jnaControl.GetNumberEventFilters(ulSpecificEvents, ulSpecificExceptions, - ulArbitraryExceptions)); - return new DebugFilterInformation( - ulSpecificEvents.getValue().intValue(), - ulSpecificExceptions.getValue().intValue(), - ulArbitraryExceptions.getValue().intValue()); - } - - @Override - public String getEventFilterText(int index, int size) { - ULONG ulIndex = new ULONG(index); - ULONG ulBufferSize = new ULONG(size); - ULONGByReference ulTextSize = new ULONGByReference(); - if (size == 0) { - COMUtils.checkRC( - jnaControl.GetEventFilterText(ulIndex, null, new ULONG(0), ulTextSize)); - ulBufferSize = ulTextSize.getValue(); - } - byte[] buffer = new byte[ulBufferSize.intValue()]; - COMUtils.checkRC(jnaControl.GetEventFilterText(ulIndex, buffer, ulBufferSize, null)); - return Native.toString(buffer); - } - - @Override - public String getEventFilterCommand(int index, int size) { - ULONG ulIndex = new ULONG(index); - ULONG ulBufferSize = new ULONG(size); - ULONGByReference ulCommandSize = new ULONGByReference(); - if (size == 0) { - COMUtils.checkRC( - jnaControl.GetEventFilterCommand(ulIndex, null, new ULONG(0), ulCommandSize)); - ulBufferSize = ulCommandSize.getValue(); - } - byte[] buffer = new byte[ulBufferSize.intValue()]; - COMUtils.checkRC(jnaControl.GetEventFilterCommand(ulIndex, buffer, ulBufferSize, null)); - return Native.toString(buffer); - } - - @Override - public void setEventFilterCommand(int index, String text) { - ULONG ulIndex = new ULONG(index); - COMUtils.checkRC(jnaControl.SetEventFilterCommand(ulIndex, text)); - } - - @Override - public DebugSpecificFilterInformation getSpecificFilterParameters(int start, int count) { - ULONG ulStart = new ULONG(start); - ULONG ulCount = new ULONG(count); - DEBUG_SPECIFIC_FILTER_PARAMETERS[] pParams = new DEBUG_SPECIFIC_FILTER_PARAMETERS[count]; - COMUtils.checkRC(jnaControl.GetSpecificFilterParameters(ulStart, ulCount, pParams)); - return new DebugSpecificFilterInformation(count, pParams); - } - - @Override - public void setSpecificFilterParameters(int start, int count, - DebugSpecificFilterInformation info) { - ULONG ulStart = new ULONG(start); - ULONG ulCount = new ULONG(count); - COMUtils.checkRC( - jnaControl.SetSpecificFilterParameters(ulStart, ulCount, info.getParameters())); - } - - @Override - public String getSpecificFilterArgument(int index, int size) { - ULONG ulIndex = new ULONG(index); - ULONG ulBufferSize = new ULONG(size); - ULONGByReference ulArgumentSize = new ULONGByReference(); - if (size == 0) { - HRESULT hr = - jnaControl.GetSpecificFilterArgument(ulIndex, null, ulBufferSize, ulArgumentSize); - if (hr.equals(COMUtilsExtra.E_INVALID_PARAM)) { - return null; - } - COMUtils.checkRC(hr); - ulBufferSize = ulArgumentSize.getValue(); - } - byte[] buffer = new byte[ulBufferSize.intValue()]; - COMUtils.checkRC( - jnaControl.GetSpecificFilterArgument(ulIndex, buffer, ulBufferSize, null)); - return Native.toString(buffer); - } - - @Override - public void setSpecificFilterArgument(int index, String arg) { - if (arg != null) { - ULONG ulIndex = new ULONG(index); - COMUtils.checkRC(jnaControl.SetSpecificFilterArgument(ulIndex, arg)); - } - } - - @Override - public DebugExceptionFilterInformation getExceptionFilterParameters(int start, int[] codes, - int count) { - ULONG ulStart = new ULONG(start); - //ULONG[] ulCodes = new ULONG[codes.length]; - //for (int i = 0; i < codes.length; i++) { - // ulCodes[i] = new ULONG(codes[i]); - //} - ULONG ulCount = new ULONG(count); - DEBUG_EXCEPTION_FILTER_PARAMETERS[] pParams = new DEBUG_EXCEPTION_FILTER_PARAMETERS[count]; - COMUtils.checkRC( - jnaControl.GetExceptionFilterParameters(ulCount, null, ulStart, pParams)); - return new DebugExceptionFilterInformation(count, pParams); - } - - @Override - public void setExceptionFilterParameters(int count, - DebugExceptionFilterInformation info) { - ULONG ulCount = new ULONG(count); - COMUtils.checkRC( - jnaControl.SetExceptionFilterParameters(ulCount, info.getParameters())); - } - - @Override - public String getExceptionFilterSecondCommand(int index, int size) { - ULONG ulIndex = new ULONG(index); - ULONG ulBufferSize = new ULONG(size); - ULONGByReference ulCommandSize = new ULONGByReference(); - if (size == 0) { - COMUtils.checkRC( - jnaControl.GetExceptionFilterSecondCommand(ulIndex, null, ulBufferSize, - ulCommandSize)); - ulBufferSize = ulCommandSize.getValue(); - } - byte[] buffer = new byte[ulBufferSize.intValue()]; - COMUtils.checkRC( - jnaControl.GetExceptionFilterSecondCommand(ulIndex, buffer, ulBufferSize, null)); - return Native.toString(buffer); - } - - @Override - public void setExceptionFilterSecondCommand(int index, String cmd) { - ULONG ulIndex = new ULONG(index); - COMUtils.checkRC(jnaControl.SetExceptionFilterSecondCommand(ulIndex, cmd)); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/control/DebugControlImpl2.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/control/DebugControlImpl2.java deleted file mode 100644 index eb0f3f70db..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/control/DebugControlImpl2.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.control; - -import agent.dbgeng.jna.dbgeng.control.IDebugControl2; - -public class DebugControlImpl2 extends DebugControlImpl1 { - @SuppressWarnings("unused") - private final IDebugControl2 jnaControl; - - public DebugControlImpl2(IDebugControl2 jnaControl) { - super(jnaControl); - this.jnaControl = jnaControl; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/control/DebugControlImpl3.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/control/DebugControlImpl3.java deleted file mode 100644 index b194837d4b..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/control/DebugControlImpl3.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.control; - -import agent.dbgeng.jna.dbgeng.control.IDebugControl3; - -public class DebugControlImpl3 extends DebugControlImpl2 { - @SuppressWarnings("unused") - private final IDebugControl3 jnaControl; - - public DebugControlImpl3(IDebugControl3 jnaControl) { - super(jnaControl); - this.jnaControl = jnaControl; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/control/DebugControlImpl4.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/control/DebugControlImpl4.java deleted file mode 100644 index fa67c30ddc..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/control/DebugControlImpl4.java +++ /dev/null @@ -1,128 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.control; - -import com.sun.jna.Native; -import com.sun.jna.WString; -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinDef.ULONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.platform.win32.COM.COMUtils; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgeng.dbgeng.COMUtilsExtra; -import agent.dbgeng.dbgeng.DebugBreakpoint; -import agent.dbgeng.dbgeng.DebugBreakpoint.BreakType; -import agent.dbgeng.dbgeng.DebugValue.DebugValueType; -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.breakpoint.DebugBreakpointInternal; -import agent.dbgeng.jna.dbgeng.DbgEngNative.DEBUG_VALUE; -import agent.dbgeng.jna.dbgeng.breakpoint.IDebugBreakpoint; -import agent.dbgeng.jna.dbgeng.breakpoint.WrapIDebugBreakpoint; -import agent.dbgeng.jna.dbgeng.control.IDebugControl4; -import ghidra.comm.util.BitmaskSet; - -public class DebugControlImpl4 extends DebugControlImpl3 { - private final IDebugControl4 jnaControl; - - public DebugControlImpl4(IDebugControl4 jnaControl) { - super(jnaControl); - this.jnaControl = jnaControl; - } - - @Override - public void print(BitmaskSet levels, String message) { - ULONG mask = new ULONG(levels.getBitmask()); - COMUtils.checkRC(jnaControl.OutputWide(mask, new WString("%s"), new WString(message))); - } - - @Override - public void println(BitmaskSet levels, String message) { - ULONG mask = new ULONG(levels.getBitmask()); - COMUtils - .checkRC( - jnaControl.OutputWide(mask, new WString("%s"), new WString(message + "\r\n"))); - } - - @Override - public void prompt(BitmaskSet ctl, String message) { - ULONG ctlMask = new ULONG(ctl.getBitmask()); - COMUtils - .checkRC( - jnaControl.OutputPromptWide(ctlMask, new WString("%s"), new WString(message))); - } - - @Override - public String getPromptText() { - ULONGByReference pulTextSize = new ULONGByReference(); - COMUtils.checkRC(jnaControl.GetPromptTextWide(null, new ULONG(0), pulTextSize)); - char[] buffer = new char[pulTextSize.getValue().intValue()]; - COMUtils.checkRC(jnaControl.GetPromptTextWide(buffer, pulTextSize.getValue(), null)); - return Native.toString(buffer); - } - - @Override - protected DEBUG_VALUE doEval(DebugValueType type, String expression) { - DEBUG_VALUE.ByReference value = new DEBUG_VALUE.ByReference(); - ULONGByReference pulRemainder = new ULONGByReference(); - COMUtils.checkRC(jnaControl.EvaluateWide(new WString(expression), new ULONG(type.ordinal()), - value, pulRemainder)); - int remainder = pulRemainder.getValue().intValue(); - if (remainder != expression.length()) { - throw new RuntimeException("Failed to parse: " + expression.substring(remainder)); - } - return value; - } - - @Override - public void execute(BitmaskSet ctl, String cmd, - BitmaskSet flags) { - ULONG ctlMask = new ULONG(ctl.getBitmask()); - ULONG flagMask = new ULONG(flags.getBitmask()); - HRESULT hr = jnaControl.ExecuteWide(ctlMask, new WString(cmd), flagMask); - if (hr.equals(COMUtilsExtra.E_INTERNALEXCEPTION)) { - return; - } - COMUtils.checkRC(hr); - } - - @Override - public void returnInput(String input) { - COMUtils.checkRC(jnaControl.ReturnInputWide(new WString(input))); - } - - public DebugBreakpoint doAddBreakpoint2(BreakType type, ULONG ulDesiredId) { - ULONG ulType = new ULONG(type.ordinal()); - PointerByReference ppBp = new PointerByReference(); - COMUtils.checkRC(jnaControl.AddBreakpoint2(ulType, ulDesiredId, ppBp)); - IDebugBreakpoint Bp = new WrapIDebugBreakpoint(ppBp.getValue()); - DebugBreakpoint bpt = - DebugBreakpointInternal.tryPreferredInterfaces(this, Bp::QueryInterface); - // AddRef or no? Probably not. - return bpt; - } - - @Override - public DebugBreakpoint addBreakpoint2(BreakType type, int desiredId) { - return doAddBreakpoint2(type, new ULONG(desiredId)); - } - - @Override - public DebugBreakpoint addBreakpoint2(BreakType type) { - return doAddBreakpoint2(type, DbgEngUtil.DEBUG_ANY_ID); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/control/DebugControlImpl5.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/control/DebugControlImpl5.java deleted file mode 100644 index 9b501e4d45..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/control/DebugControlImpl5.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.control; - -import agent.dbgeng.jna.dbgeng.control.IDebugControl5; - -public class DebugControlImpl5 extends DebugControlImpl4 { - @SuppressWarnings("unused") - private final IDebugControl5 jnaControl; - - public DebugControlImpl5(IDebugControl5 jnaControl) { - super(jnaControl); - this.jnaControl = jnaControl; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/control/DebugControlImpl6.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/control/DebugControlImpl6.java deleted file mode 100644 index 83186a2f5b..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/control/DebugControlImpl6.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.control; - -import agent.dbgeng.jna.dbgeng.control.IDebugControl6; - -public class DebugControlImpl6 extends DebugControlImpl5 { - @SuppressWarnings("unused") - private final IDebugControl6 jnaControl; - - public DebugControlImpl6(IDebugControl6 jnaControl) { - super(jnaControl); - this.jnaControl = jnaControl; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/control/DebugControlImpl7.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/control/DebugControlImpl7.java deleted file mode 100644 index b026dc7bed..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/control/DebugControlImpl7.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.control; - -import agent.dbgeng.jna.dbgeng.control.IDebugControl7; - -public class DebugControlImpl7 extends DebugControlImpl6 { - @SuppressWarnings("unused") - private final IDebugControl7 jnaControl; - - public DebugControlImpl7(IDebugControl7 jnaControl) { - super(jnaControl); - this.jnaControl = jnaControl; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/control/DebugControlInternal.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/control/DebugControlInternal.java deleted file mode 100644 index bd23831d68..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/control/DebugControlInternal.java +++ /dev/null @@ -1,77 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.control; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.dbgeng.DebugControl; -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgeng.jna.dbgeng.breakpoint.IDebugBreakpoint; -import agent.dbgeng.jna.dbgeng.control.*; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DebugControlInternal extends DebugControl { - Map CACHE = new WeakValueHashMap<>(); - - static DebugControlInternal instanceFor(WrapIDebugControl control) { - return DbgEngUtil.lazyWeakCache(CACHE, control, DebugControlImpl1::new); - } - - static DebugControlInternal instanceFor(WrapIDebugControl2 control) { - return DbgEngUtil.lazyWeakCache(CACHE, control, DebugControlImpl2::new); - } - - static DebugControlInternal instanceFor(WrapIDebugControl3 control) { - return DbgEngUtil.lazyWeakCache(CACHE, control, DebugControlImpl3::new); - } - - static DebugControlInternal instanceFor(WrapIDebugControl4 control) { - return DbgEngUtil.lazyWeakCache(CACHE, control, DebugControlImpl4::new); - } - - static DebugControlInternal instanceFor(WrapIDebugControl5 control) { - return DbgEngUtil.lazyWeakCache(CACHE, control, DebugControlImpl5::new); - } - - static DebugControlInternal instanceFor(WrapIDebugControl6 control) { - return DbgEngUtil.lazyWeakCache(CACHE, control, DebugControlImpl6::new); - } - - static DebugControlInternal instanceFor(WrapIDebugControl7 control) { - return DbgEngUtil.lazyWeakCache(CACHE, control, DebugControlImpl7::new); - } - - List> PREFERRED_CONTROL_IIDS = List.of( - new Preferred<>(IDebugControl7.IID_IDEBUG_CONTROL7, WrapIDebugControl7.class), - new Preferred<>(IDebugControl6.IID_IDEBUG_CONTROL6, WrapIDebugControl6.class), - new Preferred<>(IDebugControl5.IID_IDEBUG_CONTROL5, WrapIDebugControl5.class), - new Preferred<>(IDebugControl4.IID_IDEBUG_CONTROL4, WrapIDebugControl4.class), - new Preferred<>(IDebugControl3.IID_IDEBUG_CONTROL3, WrapIDebugControl3.class), - new Preferred<>(IDebugControl2.IID_IDEBUG_CONTROL2, WrapIDebugControl2.class), - new Preferred<>(IDebugControl.IID_IDEBUG_CONTROL, WrapIDebugControl.class)); - - static DebugControlInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(DebugControlInternal.class, PREFERRED_CONTROL_IIDS, - supplier); - } - - void removeBreakpoint(IDebugBreakpoint comBpt); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/dataspaces/DebugDataSpacesImpl1.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/dataspaces/DebugDataSpacesImpl1.java deleted file mode 100644 index 124bee8f0b..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/dataspaces/DebugDataSpacesImpl1.java +++ /dev/null @@ -1,276 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.dataspaces; - -import java.nio.BufferOverflowException; -import java.nio.ByteBuffer; - -import javax.help.UnsupportedOperationException; - -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.platform.win32.COM.COMUtils; - -import agent.dbgeng.dbgeng.COMUtilsExtra; -import agent.dbgeng.dbgeng.DbgEng; -import agent.dbgeng.dbgeng.DbgEng.OpaqueCleanable; -import agent.dbgeng.jna.dbgeng.dataspaces.IDebugDataSpaces; - -public class DebugDataSpacesImpl1 implements DebugDataSpacesInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanble; - private final IDebugDataSpaces jnaData; - - public DebugDataSpacesImpl1(IDebugDataSpaces jnaData) { - this.cleanble = DbgEng.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public DebugMemoryBasicInformation queryVirtual(long offset) { - throw new UnsupportedOperationException("Not implemented in this interface"); - } - - @Override - public int readVirtual(long offset, ByteBuffer into, int len) { - if (len > into.remaining()) { - throw new BufferOverflowException(); - } - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesRead = new ULONGByReference(); - HRESULT hr = jnaData.ReadVirtual(ullOffset, into, ulLen, pulBytesRead); - if (hr.equals(COMUtilsExtra.E_CANNOT_READ)) { - return 0; - } - COMUtils.checkRC(hr); - int read = pulBytesRead.getValue().intValue(); - into.position(read + into.position()); - return read; - } - - @Override - public int writeVirtual(long offset, ByteBuffer from, int len) { - if (len > from.remaining()) { - throw new BufferOverflowException(); - } - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesWritten = new ULONGByReference(); - COMUtils.checkRC(jnaData.WriteVirtual(ullOffset, from, ulLen, pulBytesWritten)); - int written = pulBytesWritten.getValue().intValue(); - from.position(written + from.position()); - return written; - } - - @Override - public int readVirtualUncached(long offset, ByteBuffer into, int len) { - if (len > into.remaining()) { - throw new BufferOverflowException(); - } - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesRead = new ULONGByReference(); - COMUtils.checkRC(jnaData.ReadVirtualUncached(ullOffset, into, ulLen, pulBytesRead)); - int read = pulBytesRead.getValue().intValue(); - into.position(read + into.position()); - return read; - } - - @Override - public int writeVirtualUncached(long offset, ByteBuffer from, int len) { - if (len > from.remaining()) { - throw new BufferOverflowException(); - } - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesWritten = new ULONGByReference(); - COMUtils.checkRC(jnaData.WriteVirtualUncached(ullOffset, from, ulLen, pulBytesWritten)); - int written = pulBytesWritten.getValue().intValue(); - from.position(written + from.position()); - return written; - } - - @Override - public int readPhysical(long offset, ByteBuffer into, int len) { - if (len > into.remaining()) { - throw new BufferOverflowException(); - } - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesRead = new ULONGByReference(); - COMUtils.checkRC(jnaData.ReadPhysical(ullOffset, into, ulLen, pulBytesRead)); - int read = pulBytesRead.getValue().intValue(); - into.position(read + into.position()); - return read; - } - - @Override - public int writePhysical(long offset, ByteBuffer from, int len) { - if (len > from.remaining()) { - throw new BufferOverflowException(); - } - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesWritten = new ULONGByReference(); - COMUtils.checkRC(jnaData.WritePhysical(ullOffset, from, ulLen, pulBytesWritten)); - int written = pulBytesWritten.getValue().intValue(); - from.position(written + from.position()); - return written; - } - - @Override - public int readControl(int processor, long offset, ByteBuffer into, int len) { - if (len > into.remaining()) { - throw new BufferOverflowException(); - } - ULONG ulProcessor = new ULONG(processor); - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesRead = new ULONGByReference(); - COMUtils.checkRC(jnaData.ReadControl(ulProcessor, ullOffset, into, ulLen, pulBytesRead)); - int read = pulBytesRead.getValue().intValue(); - into.position(read + into.position()); - return read; - } - - @Override - public int writeControl(int processor, long offset, ByteBuffer from, int len) { - if (len > from.remaining()) { - throw new BufferOverflowException(); - } - ULONG ulProcessor = new ULONG(processor); - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesWritten = new ULONGByReference(); - COMUtils.checkRC( - jnaData.WriteControl(ulProcessor, ullOffset, from, ulLen, pulBytesWritten)); - int written = pulBytesWritten.getValue().intValue(); - from.position(written + from.position()); - return written; - } - - @Override - public int readBusData(int busDataType, int busNumber, int slotNumber, long offset, - ByteBuffer into, int len) { - if (len > into.remaining()) { - throw new BufferOverflowException(); - } - ULONG ulBusDataType = new ULONG(busDataType); - ULONG ulBusNumber = new ULONG(busNumber); - ULONG ulSlotNumber = new ULONG(slotNumber); - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesRead = new ULONGByReference(); - COMUtils.checkRC(jnaData.ReadBusData(ulBusDataType, ulBusNumber, ulSlotNumber, ullOffset, - into, ulLen, pulBytesRead)); - int read = pulBytesRead.getValue().intValue(); - into.position(read + into.position()); - return read; - } - - @Override - public int writeBusData(int busDataType, int busNumber, int slotNumber, long offset, - ByteBuffer from, int len) { - if (len > from.remaining()) { - throw new BufferOverflowException(); - } - ULONG ulBusDataType = new ULONG(busDataType); - ULONG ulBusNumber = new ULONG(busNumber); - ULONG ulSlotNumber = new ULONG(slotNumber); - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesWritten = new ULONGByReference(); - COMUtils.checkRC(jnaData.WriteBusData(ulBusDataType, ulBusNumber, ulSlotNumber, ullOffset, - from, ulLen, pulBytesWritten)); - int written = pulBytesWritten.getValue().intValue(); - from.position(written + from.position()); - return written; - } - - @Override - public int readIo(int interfaceType, int busNumber, int addressSpace, long offset, - ByteBuffer into, int len) { - if (len > into.remaining()) { - throw new BufferOverflowException(); - } - ULONG ulInterfaceType = new ULONG(interfaceType); - ULONG ulBusNumber = new ULONG(busNumber); - ULONG ulAddressSpace = new ULONG(addressSpace); - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesRead = new ULONGByReference(); - COMUtils.checkRC(jnaData.ReadIo(ulInterfaceType, ulBusNumber, ulAddressSpace, ullOffset, - into, ulLen, pulBytesRead)); - int read = pulBytesRead.getValue().intValue(); - into.position(read + into.position()); - return read; - } - - @Override - public int writeIo(int interfaceType, int busNumber, int addressSpace, long offset, - ByteBuffer from, int len) { - if (len > from.remaining()) { - throw new BufferOverflowException(); - } - ULONG ulInterfaceType = new ULONG(interfaceType); - ULONG ulBusNumber = new ULONG(busNumber); - ULONG ulAddressSpace = new ULONG(addressSpace); - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesWritten = new ULONGByReference(); - COMUtils.checkRC(jnaData.WriteIo(ulInterfaceType, ulBusNumber, ulAddressSpace, ullOffset, - from, ulLen, pulBytesWritten)); - int written = pulBytesWritten.getValue().intValue(); - from.position(written + from.position()); - return written; - } - - @Override - public long readMsr(int msr) { - ULONG ulNumber = new ULONG(msr); - ULONGLONGByReference pulValue = new ULONGLONGByReference(); - COMUtils.checkRC(jnaData.ReadMsr(ulNumber, pulValue)); - return pulValue.getValue().longValue(); - } - - @Override - public void writeMsr(int msr, long value) { - ULONG ulNumber = new ULONG(msr); - ULONGLONG ullValue = new ULONGLONG(value); - COMUtils.checkRC(jnaData.WriteMsr(ulNumber, ullValue)); - } - - @Override - public int readDebuggerData(int offset, ByteBuffer into, int len) { - if (len > into.remaining()) { - throw new BufferOverflowException(); - } - ULONG ulOffset = new ULONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesRead = new ULONGByReference(); - COMUtils.checkRC(jnaData.ReadDebuggerData(ulOffset, into, ulLen, pulBytesRead)); - int read = pulBytesRead.getValue().intValue(); - into.position(read + into.position()); - return read; - } - - @Override - public long virtualToPhysical(long offset) { - throw new UnsupportedOperationException("Not implemented in this interface"); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/dataspaces/DebugDataSpacesImpl2.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/dataspaces/DebugDataSpacesImpl2.java deleted file mode 100644 index 8e91924003..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/dataspaces/DebugDataSpacesImpl2.java +++ /dev/null @@ -1,69 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.dataspaces; - -import com.sun.jna.platform.win32.WinDef.ULONGLONG; -import com.sun.jna.platform.win32.WinDef.ULONGLONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.platform.win32.COM.COMUtils; - -import agent.dbgeng.dbgeng.COMUtilsExtra; -import agent.dbgeng.jna.dbgeng.WinNTExtra.MEMORY_BASIC_INFORMATION64; -import agent.dbgeng.jna.dbgeng.dataspaces.IDebugDataSpaces2; -import ghidra.comm.util.BitmaskSet; - -public class DebugDataSpacesImpl2 extends DebugDataSpacesImpl1 { - private final IDebugDataSpaces2 jnaData; - - public DebugDataSpacesImpl2(IDebugDataSpaces2 jnaData) { - super(jnaData); - this.jnaData = jnaData; - } - - @Override - public DebugMemoryBasicInformation queryVirtual(long offset) { - ULONGLONG ullOffset = new ULONGLONG(offset); - MEMORY_BASIC_INFORMATION64.ByReference pInfo = new MEMORY_BASIC_INFORMATION64.ByReference(); - HRESULT hr = jnaData.QueryVirtual(ullOffset, pInfo); - if (hr.equals(COMUtilsExtra.E_UNEXPECTED)) { - return null; - } - if (hr.equals(COMUtilsExtra.E_NOTIMPLEMENTED)) { - return null; - } - if (hr.equals(COMUtilsExtra.E_NOINTERFACE)) { - return null; - } - COMUtils.checkRC(hr); - - return new DebugMemoryBasicInformation(pInfo.BaseAddress.longValue(), - pInfo.AllocationBase.longValue(), - new BitmaskSet<>(PageProtection.class, pInfo.AllocationProtect.intValue()), - pInfo.RegionSize.longValue(), PageState.byValue(pInfo.State.intValue()), - new BitmaskSet<>(PageProtection.class, pInfo.Protect.intValue()), - PageType.byValue(pInfo.Type.intValue())); - } - - @Override - public long virtualToPhysical(long offsetV) { - ULONGLONG ullOffset = new ULONGLONG(offsetV); - ULONGLONGByReference pulOffset = new ULONGLONGByReference(); - HRESULT hr = jnaData.VirtualToPhysical(ullOffset, pulOffset); - COMUtils.checkRC(hr); - - return pulOffset.getValue().longValue(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/dataspaces/DebugDataSpacesImpl3.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/dataspaces/DebugDataSpacesImpl3.java deleted file mode 100644 index 8e0d8a7e88..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/dataspaces/DebugDataSpacesImpl3.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.dataspaces; - -import agent.dbgeng.jna.dbgeng.dataspaces.IDebugDataSpaces3; - -public class DebugDataSpacesImpl3 extends DebugDataSpacesImpl2 { - @SuppressWarnings("unused") - private final IDebugDataSpaces3 jnaData; - - public DebugDataSpacesImpl3(IDebugDataSpaces3 jnaData) { - super(jnaData); - this.jnaData = jnaData; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/dataspaces/DebugDataSpacesImpl4.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/dataspaces/DebugDataSpacesImpl4.java deleted file mode 100644 index a0128ddc5d..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/dataspaces/DebugDataSpacesImpl4.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.dataspaces; - -import agent.dbgeng.jna.dbgeng.dataspaces.IDebugDataSpaces4; - -public class DebugDataSpacesImpl4 extends DebugDataSpacesImpl3 { - @SuppressWarnings("unused") - private final IDebugDataSpaces4 jnaData; - - public DebugDataSpacesImpl4(IDebugDataSpaces4 jnaData) { - super(jnaData); - this.jnaData = jnaData; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/dataspaces/DebugDataSpacesInternal.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/dataspaces/DebugDataSpacesInternal.java deleted file mode 100644 index deeac27a78..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/dataspaces/DebugDataSpacesInternal.java +++ /dev/null @@ -1,59 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.dataspaces; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.dbgeng.DebugDataSpaces; -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgeng.jna.dbgeng.dataspaces.*; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DebugDataSpacesInternal extends DebugDataSpaces { - Map CACHE = new WeakValueHashMap<>(); - - static DebugDataSpacesInternal instanceFor(WrapIDebugDataSpaces data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DebugDataSpacesImpl1::new); - } - - static DebugDataSpacesInternal instanceFor(WrapIDebugDataSpaces2 data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DebugDataSpacesImpl2::new); - } - - static DebugDataSpacesInternal instanceFor(WrapIDebugDataSpaces3 data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DebugDataSpacesImpl3::new); - } - - static DebugDataSpacesInternal instanceFor(WrapIDebugDataSpaces4 data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DebugDataSpacesImpl4::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IDebugDataSpaces4.IID_IDEBUG_DATA_SPACES4, WrapIDebugDataSpaces4.class), - new Preferred<>(IDebugDataSpaces3.IID_IDEBUG_DATA_SPACES3, WrapIDebugDataSpaces3.class), - new Preferred<>(IDebugDataSpaces2.IID_IDEBUG_DATA_SPACES2, WrapIDebugDataSpaces2.class), - new Preferred<>(IDebugDataSpaces.IID_IDEBUG_DATA_SPACES, WrapIDebugDataSpaces.class)); - - static DebugDataSpacesInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(DebugDataSpacesInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/event/WrapCallbackIDebugEventCallbacks.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/event/WrapCallbackIDebugEventCallbacks.java deleted file mode 100644 index 30df534da7..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/event/WrapCallbackIDebugEventCallbacks.java +++ /dev/null @@ -1,298 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.event; - -import java.util.ArrayList; -import java.util.List; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.Guid.REFIID; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinError; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.platform.win32.COM.IUnknown; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgeng.dbgeng.*; -import agent.dbgeng.dbgeng.DebugClient.DebugStatus; -import agent.dbgeng.dbgeng.DebugClient.SessionStatus; -import agent.dbgeng.dbgeng.DebugEventCallbacks.DebugEvent; -import agent.dbgeng.impl.dbgeng.breakpoint.DebugBreakpointInternal; -import agent.dbgeng.impl.dbgeng.client.DebugClientImpl1; -import agent.dbgeng.impl.dbgeng.client.DebugClientInternal; -import agent.dbgeng.jna.dbgeng.WinNTExtra.EXCEPTION_RECORD64; -import agent.dbgeng.jna.dbgeng.breakpoint.WrapIDebugBreakpoint; -import agent.dbgeng.jna.dbgeng.event.*; -import ghidra.comm.util.BitmaskSet; -import ghidra.util.Msg; - -public class WrapCallbackIDebugEventCallbacks implements CallbackIDebugEventCallbacks { - private static final HRESULT ERROR_RESULT = new HRESULT(WinError.E_UNEXPECTED); - - private final DebugClientInternal client; - private final DebugEventCallbacks cb; - private ListenerIDebugEventCallbacks listener; - - public WrapCallbackIDebugEventCallbacks(DebugClientImpl1 client, DebugEventCallbacks cb) { - this.client = client; - this.cb = cb; - } - - public void setListener(ListenerIDebugEventCallbacks listener) { - this.listener = listener; - } - - @Override - public Pointer getPointer() { - return listener.getPointer(); - } - - @Override - public HRESULT QueryInterface(REFIID refid, PointerByReference ppvObject) { - if (null == ppvObject) { - return new HRESULT(WinError.E_POINTER); - } - else if (refid.getValue().equals(IDebugEventCallbacks.IID_IDEBUG_EVENT_CALLBACKS)) { - ppvObject.setValue(this.getPointer()); - return WinError.S_OK; - } - else if (refid.getValue().equals(IUnknown.IID_IUNKNOWN)) { - ppvObject.setValue(this.getPointer()); - return WinError.S_OK; - } - return new HRESULT(WinError.E_NOINTERFACE); - } - - @Override - public int AddRef() { - return 0; - } - - @Override - public int Release() { - return 0; - } - - @Override - public HRESULT GetInterestMask(ULONGByReference Mask) { - try { - BitmaskSet interest = cb.getInterestMask(); - ULONG ulInterest = new ULONG(interest.getBitmask()); - Mask.setValue(ulInterest); - return WinError.S_OK; - } - catch (Throwable e) { - Msg.error(this, "Error during callback", e); - return new HRESULT(WinError.E_UNEXPECTED); - } - } - - @Override - public HRESULT Breakpoint(WrapIDebugBreakpoint.ByReference Bp) { - try { - DebugBreakpoint bpt = DebugBreakpointInternal - .tryPreferredInterfaces(client.getControlInternal(), Bp::QueryInterface); - DebugStatus status = cb.breakpoint(bpt); - return new HRESULT(status.ordinal()); - } - catch (Throwable e) { - Msg.error(this, "Error during callback", e); - return ERROR_RESULT; - } - } - - @Override - public HRESULT Exception(EXCEPTION_RECORD64.ByReference Exception, ULONG FirstChance) { - try { - int numParams = Exception.NumberParameters.intValue(); - List information = new ArrayList<>(numParams); - for (int i = 0; i < numParams; i++) { - information.set(i, Exception.ExceptionInformation[i].longValue()); - } - DebugExceptionRecord64 exc = - new DebugExceptionRecord64(Exception.ExceptionCode.intValue(), - Exception.ExceptionFlags.intValue(), Exception.ExceptionRecord.longValue(), - Exception.ExceptionAddress.longValue(), information); - boolean firstChance = FirstChance.intValue() != 0; - DebugStatus status = cb.exception(exc, firstChance); - return new HRESULT(status.ordinal()); - } - catch (Throwable e) { - Msg.error(this, "Error during callback", e); - return ERROR_RESULT; - } - } - - @Override - public HRESULT CreateThread(ULONGLONG Handle, ULONGLONG DataOffset, ULONGLONG StartOffset) { - try { - DebugStatus status = cb.createThread(new DebugThreadInfo(Handle.longValue(), - DataOffset.longValue(), StartOffset.longValue())); - return new HRESULT(status.ordinal()); - } - catch (Throwable e) { - Msg.error(this, "Error during callback", e); - return ERROR_RESULT; - } - } - - @Override - public HRESULT ExitThread(ULONG ExitCode) { - try { - DebugStatus status = cb.exitThread(ExitCode.intValue()); - return new HRESULT(status.ordinal()); - } - catch (Throwable e) { - Msg.error(this, "Error during callback", e); - return ERROR_RESULT; - } - } - - @Override - public HRESULT CreateProcess(ULONGLONG ImageFileHandle, ULONGLONG Handle, ULONGLONG BaseOffset, - ULONG ModuleSize, String ModuleName, String ImageName, ULONG CheckSum, - ULONG TimeDateStamp, ULONGLONG InitialThreadHandle, ULONGLONG ThreadDataOffset, - ULONGLONG StartOffset) { - try { - // TODO: Associate thread with process - // TODO: Record All these other parameters? - DebugStatus status = cb.createProcess(new DebugProcessInfo(Handle.longValue(), - new DebugModuleInfo(ImageFileHandle.longValue(), BaseOffset.longValue(), - ModuleSize.intValue(), ModuleName, ImageName, CheckSum.intValue(), - TimeDateStamp.intValue()), - new DebugThreadInfo(InitialThreadHandle.longValue(), ThreadDataOffset.longValue(), - StartOffset.longValue()))); - return new HRESULT(status.ordinal()); - } - catch (Throwable e) { - Msg.error(this, "Error during callback", e); - return ERROR_RESULT; - } - } - - @Override - public HRESULT ExitProcess(ULONG ExitCode) { - try { - DebugStatus status = cb.exitProcess(ExitCode.intValue()); - return new HRESULT(status.ordinal()); - } - catch (Throwable e) { - Msg.error(this, "Error during callback", e); - return ERROR_RESULT; - } - } - - @Override - public HRESULT LoadModule(ULONGLONG ImageFileHandle, ULONGLONG BaseOffset, ULONG ModuleSize, - String ModuleName, String ImageName, ULONG CheckSum, ULONG TimeDateStamp) { - try { - // All of these are potentially null - long imageFileHandle = ImageFileHandle == null ? -1L : ImageFileHandle.longValue(); - long baseOffset = BaseOffset == null ? -1L : BaseOffset.longValue(); - int moduleSize = ModuleSize == null ? -1 : ModuleSize.intValue(); - String moduleName = ModuleName == null ? "" : ModuleName.toString(); - String imageName = ImageName == null ? "" : ImageName.toString(); - int checkSum = CheckSum == null ? -1 : CheckSum.intValue(); - - DebugStatus status = cb.loadModule(new DebugModuleInfo(imageFileHandle, baseOffset, - moduleSize, moduleName, imageName, checkSum, TimeDateStamp.intValue())); - return new HRESULT(status.ordinal()); - } - catch (Throwable e) { - Msg.error(this, "Error during callback", e); - return ERROR_RESULT; - } - } - - @Override - public HRESULT UnloadModule(String ImageBaseName, ULONGLONG BaseOffset) { - try { - DebugStatus status = cb.unloadModule(ImageBaseName, BaseOffset.longValue()); - return new HRESULT(status.ordinal()); - } - catch (Throwable e) { - Msg.error(this, "Error during callback", e); - return ERROR_RESULT; - } - } - - @Override - public HRESULT SystemError(ULONG Error, ULONG Level) { - try { - DebugStatus status = cb.systemError(Error.intValue(), Level.intValue()); - return new HRESULT(status.ordinal()); - } - catch (Throwable e) { - Msg.error(this, "Error during callback", e); - return ERROR_RESULT; - } - } - - @Override - public HRESULT SessionStatus(ULONG Status) { - try { - SessionStatus ss = SessionStatus.values()[Status.intValue()]; - DebugStatus status = cb.sessionStatus(ss); - return new HRESULT(status.ordinal()); - } - catch (Throwable e) { - Msg.error(this, "Error during callback", e); - return ERROR_RESULT; - } - } - - @Override - public HRESULT ChangeDebuggeeState(ULONG Flags, ULONGLONG Argument) { - try { - BitmaskSet flags = - new BitmaskSet<>(DebugClient.ChangeDebuggeeState.class, Flags.intValue()); - DebugStatus status = cb.changeDebuggeeState(flags, Argument.longValue()); - return new HRESULT(status.ordinal()); - } - catch (Throwable e) { - Msg.error(this, "Error during callback", e); - return ERROR_RESULT; - } - } - - @Override - public HRESULT ChangeEngineState(ULONG Flags, ULONGLONG Argument) { - try { - BitmaskSet flags = - new BitmaskSet<>(DebugClient.ChangeEngineState.class, Flags.intValue()); - DebugStatus status = cb.changeEngineState(flags, Argument.longValue()); - return new HRESULT(status.ordinal()); - } - catch (Throwable e) { - Msg.error(this, "Error during callback", e); - return ERROR_RESULT; - } - } - - @Override - public HRESULT ChangeSymbolState(ULONG Flags, ULONGLONG Argument) { - try { - BitmaskSet flags = - new BitmaskSet<>(DebugClient.ChangeSymbolState.class, Flags.intValue()); - DebugStatus status = cb.changeSymbolState(flags, Argument.longValue()); - return new HRESULT(status.ordinal()); - } - catch (Throwable e) { - Msg.error(this, "Error during callback", e); - return ERROR_RESULT; - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/event/WrapCallbackIDebugEventCallbacksWide.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/event/WrapCallbackIDebugEventCallbacksWide.java deleted file mode 100644 index 2026c6dcc9..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/event/WrapCallbackIDebugEventCallbacksWide.java +++ /dev/null @@ -1,297 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.event; - -import java.util.ArrayList; -import java.util.List; - -import com.sun.jna.Pointer; -import com.sun.jna.WString; -import com.sun.jna.platform.win32.Guid.REFIID; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinError; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.platform.win32.COM.IUnknown; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgeng.dbgeng.*; -import agent.dbgeng.dbgeng.DebugClient.DebugStatus; -import agent.dbgeng.dbgeng.DebugClient.SessionStatus; -import agent.dbgeng.dbgeng.DebugEventCallbacks.DebugEvent; -import agent.dbgeng.impl.dbgeng.breakpoint.DebugBreakpointInternal; -import agent.dbgeng.impl.dbgeng.client.DebugClientImpl5; -import agent.dbgeng.impl.dbgeng.client.DebugClientInternal; -import agent.dbgeng.jna.dbgeng.WinNTExtra.EXCEPTION_RECORD64; -import agent.dbgeng.jna.dbgeng.breakpoint.WrapIDebugBreakpoint; -import agent.dbgeng.jna.dbgeng.event.*; -import ghidra.comm.util.BitmaskSet; -import ghidra.util.Msg; - -public class WrapCallbackIDebugEventCallbacksWide implements CallbackIDebugEventCallbacksWide { - private static final HRESULT ERROR_RESULT = new HRESULT(WinError.E_UNEXPECTED); - - private final DebugClientInternal client; - private final DebugEventCallbacks cb; - private ListenerIDebugEventCallbacksWide listener; - - public WrapCallbackIDebugEventCallbacksWide(DebugClientImpl5 client, DebugEventCallbacks cb) { - this.client = client; - this.cb = cb; - } - - public void setListener(ListenerIDebugEventCallbacksWide listener) { - this.listener = listener; - } - - @Override - public Pointer getPointer() { - return listener.getPointer(); - } - - @Override - public HRESULT QueryInterface(REFIID refid, PointerByReference ppvObject) { - if (null == ppvObject) { - return new HRESULT(WinError.E_POINTER); - } - else if (refid.getValue() - .equals(IDebugEventCallbacksWide.IID_IDEBUG_EVENT_CALLBACKS_WIDE)) { - ppvObject.setValue(this.getPointer()); - return WinError.S_OK; - } - else if (refid.getValue().equals(IUnknown.IID_IUNKNOWN)) { - ppvObject.setValue(this.getPointer()); - return WinError.S_OK; - } - return new HRESULT(WinError.E_NOINTERFACE); - } - - @Override - public int AddRef() { - return 0; - } - - @Override - public int Release() { - return 0; - } - - @Override - public HRESULT GetInterestMask(ULONGByReference Mask) { - try { - BitmaskSet interest = cb.getInterestMask(); - ULONG ulInterest = new ULONG(interest.getBitmask()); - Mask.setValue(ulInterest); - return WinError.S_OK; - } - catch (Throwable e) { - Msg.error(this, "Error during callback", e); - return ERROR_RESULT; - } - } - - @Override - public HRESULT Breakpoint(WrapIDebugBreakpoint.ByReference Bp) { - try { - DebugBreakpoint bpt = DebugBreakpointInternal - .tryPreferredInterfaces(client.getControlInternal(), Bp::QueryInterface); - DebugStatus status = cb.breakpoint(bpt); - return new HRESULT(status.ordinal()); - } - catch (Throwable e) { - Msg.error(this, "Error during callback", e); - return ERROR_RESULT; - } - } - - @Override - public HRESULT Exception(EXCEPTION_RECORD64.ByReference Exception, ULONG FirstChance) { - try { - int numParams = Exception.NumberParameters.intValue(); - List information = new ArrayList<>(numParams); - for (int i = 0; i < numParams; i++) { - information.add(Exception.ExceptionInformation[i].longValue()); - } - DebugExceptionRecord64 exc = - new DebugExceptionRecord64(Exception.ExceptionCode.intValue(), - Exception.ExceptionFlags.intValue(), Exception.ExceptionRecord.longValue(), - Exception.ExceptionAddress.longValue(), information); - boolean firstChance = FirstChance.intValue() != 0; - DebugStatus status = cb.exception(exc, firstChance); - return new HRESULT(status.ordinal()); - } - catch (Throwable e) { - Msg.error(this, "Error during callback", e); - return ERROR_RESULT; - } - } - - @Override - public HRESULT CreateThread(ULONGLONG Handle, ULONGLONG DataOffset, ULONGLONG StartOffset) { - try { - DebugStatus status = cb.createThread(new DebugThreadInfo(Handle.longValue(), - DataOffset.longValue(), StartOffset.longValue())); - return new HRESULT(status.ordinal()); - } - catch (Throwable e) { - Msg.error(this, "Error during callback", e); - return ERROR_RESULT; - } - } - - @Override - public HRESULT ExitThread(ULONG ExitCode) { - try { - DebugStatus status = cb.exitThread(ExitCode.intValue()); - return new HRESULT(status.ordinal()); - } - catch (Throwable e) { - Msg.error(this, "Error during callback", e); - return ERROR_RESULT; - } - } - - @Override - public HRESULT CreateProcess(ULONGLONG ImageFileHandle, ULONGLONG Handle, ULONGLONG BaseOffset, - ULONG ModuleSize, WString ModuleName, WString ImageName, ULONG CheckSum, - ULONG TimeDateStamp, ULONGLONG InitialThreadHandle, ULONGLONG ThreadDataOffset, - ULONGLONG StartOffset) { - try { - DebugStatus status = cb.createProcess(new DebugProcessInfo(Handle.longValue(), - new DebugModuleInfo(ImageFileHandle.longValue(), BaseOffset.longValue(), - ModuleSize.intValue(), ModuleName.toString(), ImageName.toString(), - CheckSum.intValue(), TimeDateStamp.intValue()), - new DebugThreadInfo(InitialThreadHandle.longValue(), ThreadDataOffset.longValue(), - StartOffset.longValue()))); - return new HRESULT(status.ordinal()); - } - catch (Throwable e) { - Msg.error(this, "Error during callback", e); - return ERROR_RESULT; - } - } - - @Override - public HRESULT ExitProcess(ULONG ExitCode) { - try { - DebugStatus status = cb.exitProcess(ExitCode.intValue()); - return new HRESULT(status.ordinal()); - } - catch (Throwable e) { - Msg.error(this, "Error during callback", e); - return ERROR_RESULT; - } - } - - @Override - public HRESULT LoadModule(ULONGLONG ImageFileHandle, ULONGLONG BaseOffset, ULONG ModuleSize, - WString ModuleName, WString ImageName, ULONG CheckSum, ULONG TimeDateStamp) { - try { - long imageFileHandle = ImageFileHandle == null ? -1L : ImageFileHandle.longValue(); - long baseOffset = BaseOffset == null ? -1L : BaseOffset.longValue(); - int moduleSize = ModuleSize == null ? -1 : ModuleSize.intValue(); - String moduleName = ModuleName == null ? "" : ModuleName.toString(); - String imageName = ImageName == null ? "" : ImageName.toString(); - int checkSum = CheckSum == null ? -1 : CheckSum.intValue(); - - DebugStatus status = cb.loadModule(new DebugModuleInfo(imageFileHandle, baseOffset, - moduleSize, moduleName, imageName, checkSum, TimeDateStamp.intValue())); - return new HRESULT(status.ordinal()); - } - catch (Throwable e) { - Msg.error(this, "Error during callback", e); - return ERROR_RESULT; - } - } - - @Override - public HRESULT UnloadModule(WString ImageBaseName, ULONGLONG BaseOffset) { - try { - DebugStatus status = cb.unloadModule(ImageBaseName.toString(), BaseOffset.longValue()); - return new HRESULT(status.ordinal()); - } - catch (Throwable e) { - Msg.error(this, "Error during callback", e); - return ERROR_RESULT; - } - } - - @Override - public HRESULT SystemError(ULONG Error, ULONG Level) { - try { - DebugStatus status = cb.systemError(Error.intValue(), Level.intValue()); - return new HRESULT(status.ordinal()); - } - catch (Throwable e) { - Msg.error(this, "Error during callback", e); - return ERROR_RESULT; - } - } - - @Override - public HRESULT SessionStatus(ULONG Status) { - try { - SessionStatus ss = SessionStatus.values()[Status.intValue()]; - DebugStatus status = cb.sessionStatus(ss); - return new HRESULT(status.ordinal()); - } - catch (Throwable e) { - Msg.error(this, "Error during callback", e); - return ERROR_RESULT; - } - } - - @Override - public HRESULT ChangeDebuggeeState(ULONG Flags, ULONGLONG Argument) { - try { - BitmaskSet flags = - new BitmaskSet<>(DebugClient.ChangeDebuggeeState.class, Flags.intValue()); - DebugStatus status = cb.changeDebuggeeState(flags, Argument.longValue()); - return new HRESULT(status.ordinal()); - } - catch (Throwable e) { - Msg.error(this, "Error during callback", e); - return ERROR_RESULT; - } - } - - @Override - public HRESULT ChangeEngineState(ULONG Flags, ULONGLONG Argument) { - try { - BitmaskSet flags = - new BitmaskSet<>(DebugClient.ChangeEngineState.class, Flags.intValue()); - DebugStatus status = cb.changeEngineState(flags, Argument.longValue()); - return new HRESULT(status.ordinal()); - } - catch (Throwable e) { - Msg.error(this, "Error during callback", e); - return ERROR_RESULT; - } - } - - @Override - public HRESULT ChangeSymbolState(ULONG Flags, ULONGLONG Argument) { - try { - BitmaskSet flags = - new BitmaskSet<>(DebugClient.ChangeSymbolState.class, Flags.intValue()); - DebugStatus status = cb.changeSymbolState(flags, Argument.longValue()); - return new HRESULT(status.ordinal()); - } - catch (Throwable e) { - Msg.error(this, "Error during callback", e); - return ERROR_RESULT; - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/io/WrapCallbackIDebugInputCallbacks.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/io/WrapCallbackIDebugInputCallbacks.java deleted file mode 100644 index 6a8aa21230..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/io/WrapCallbackIDebugInputCallbacks.java +++ /dev/null @@ -1,96 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.io; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.Guid.REFIID; -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinError; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.platform.win32.COM.IUnknown; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgeng.dbgeng.DebugInputCallbacks; -import agent.dbgeng.impl.dbgeng.client.DebugClientImpl1; -import agent.dbgeng.jna.dbgeng.io.*; - -public class WrapCallbackIDebugInputCallbacks implements CallbackIDebugInputCallbacks { - private final DebugClientImpl1 client; - private final DebugInputCallbacks cb; - private ListenerIDebugInputCallbacks listener; - - public WrapCallbackIDebugInputCallbacks(DebugClientImpl1 client, DebugInputCallbacks cb) { - this.client = client; - this.cb = cb; - } - - public void setListener(ListenerIDebugInputCallbacks listener) { - this.listener = listener; - } - - @Override - public Pointer getPointer() { - return listener.getPointer(); - } - - @Override - public HRESULT QueryInterface(REFIID refid, PointerByReference ppvObject) { - if (null == ppvObject) { - return new HRESULT(WinError.E_POINTER); - } - else if (refid.getValue().equals(IDebugInputCallbacks.IID_IDEBUG_INPUT_CALLBACKS)) { - ppvObject.setValue(this.getPointer()); - return WinError.S_OK; - } - else if (refid.getValue().equals(IUnknown.IID_IUNKNOWN)) { - ppvObject.setValue(this.getPointer()); - return WinError.S_OK; - } - return new HRESULT(WinError.E_NOINTERFACE); - } - - @Override - public int AddRef() { - return 0; - } - - @Override - public int Release() { - return 0; - } - - @Override - public HRESULT StartInput(ULONG BufferSize) { - try { - cb.startInput(BufferSize.longValue()); - return WinError.S_OK; - } - catch (Throwable e) { - return new HRESULT(WinError.E_UNEXPECTED); - } - } - - @Override - public HRESULT EndInput() { - try { - cb.endInput(); - return WinError.S_OK; - } - catch (Throwable e) { - return new HRESULT(WinError.E_UNEXPECTED); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/io/WrapCallbackIDebugOutputCallbacks.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/io/WrapCallbackIDebugOutputCallbacks.java deleted file mode 100644 index df0bb80d62..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/io/WrapCallbackIDebugOutputCallbacks.java +++ /dev/null @@ -1,82 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.io; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.Guid.REFIID; -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinError; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.platform.win32.COM.IUnknown; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgeng.dbgeng.DebugOutputCallbacks; -import agent.dbgeng.jna.dbgeng.io.*; - -public class WrapCallbackIDebugOutputCallbacks implements CallbackIDebugOutputCallbacks { - private final DebugOutputCallbacks cb; - private ListenerIDebugOutputCallbacks listener; - - public WrapCallbackIDebugOutputCallbacks(DebugOutputCallbacks cb) { - this.cb = cb; - } - - public void setListener(ListenerIDebugOutputCallbacks listener) { - this.listener = listener; - } - - @Override - public Pointer getPointer() { - return listener.getPointer(); - } - - @Override - public HRESULT QueryInterface(REFIID refid, PointerByReference ppvObject) { - if (null == ppvObject) { - return new HRESULT(WinError.E_POINTER); - } - else if (refid.getValue().equals(IDebugOutputCallbacks.IID_IDEBUG_OUTPUT_CALLBACKS)) { - ppvObject.setValue(this.getPointer()); - return WinError.S_OK; - } - else if (refid.getValue().equals(IUnknown.IID_IUNKNOWN)) { - ppvObject.setValue(this.getPointer()); - return WinError.S_OK; - } - return new HRESULT(WinError.E_NOINTERFACE); - } - - @Override - public int AddRef() { - return 0; - } - - @Override - public int Release() { - return 0; - } - - @Override - public HRESULT Output(ULONG Mask, String Text) { - try { - cb.output(Mask.intValue(), Text); - return WinError.S_OK; - } - catch (Throwable e) { - return new HRESULT(WinError.E_UNEXPECTED); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/io/WrapCallbackIDebugOutputCallbacksWide.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/io/WrapCallbackIDebugOutputCallbacksWide.java deleted file mode 100644 index c75c8cbeeb..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/io/WrapCallbackIDebugOutputCallbacksWide.java +++ /dev/null @@ -1,84 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.io; - -import com.sun.jna.Pointer; -import com.sun.jna.WString; -import com.sun.jna.platform.win32.Guid.REFIID; -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinError; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.platform.win32.COM.IUnknown; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgeng.dbgeng.DebugOutputCallbacks; -import agent.dbgeng.jna.dbgeng.io.*; - -public class WrapCallbackIDebugOutputCallbacksWide implements CallbackIDebugOutputCallbacksWide { - private final DebugOutputCallbacks cb; - private ListenerIDebugOutputCallbacksWide listener; - - public WrapCallbackIDebugOutputCallbacksWide(DebugOutputCallbacks cb) { - this.cb = cb; - } - - public void setListener(ListenerIDebugOutputCallbacksWide listener) { - this.listener = listener; - } - - @Override - public Pointer getPointer() { - return listener.getPointer(); - } - - @Override - public HRESULT QueryInterface(REFIID refid, PointerByReference ppvObject) { - if (null == ppvObject) { - return new HRESULT(WinError.E_POINTER); - } - else if (refid.getValue() - .equals(IDebugOutputCallbacksWide.IID_IDEBUG_OUTPUT_CALLBACKS_WIDE)) { - ppvObject.setValue(this.getPointer()); - return WinError.S_OK; - } - else if (refid.getValue().equals(IUnknown.IID_IUNKNOWN)) { - ppvObject.setValue(this.getPointer()); - return WinError.S_OK; - } - return new HRESULT(WinError.E_NOINTERFACE); - } - - @Override - public int AddRef() { - return 0; - } - - @Override - public int Release() { - return 0; - } - - @Override - public HRESULT Output(ULONG Mask, WString Text) { - try { - cb.output(Mask.intValue(), Text.toString()); - return WinError.S_OK; - } - catch (Throwable e) { - return new HRESULT(WinError.E_UNEXPECTED); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/registers/DebugRegistersImpl1.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/registers/DebugRegistersImpl1.java deleted file mode 100644 index 20862be8d3..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/registers/DebugRegistersImpl1.java +++ /dev/null @@ -1,154 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.registers; - -import java.util.*; - -import com.sun.jna.Native; -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinDef.ULONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.platform.win32.COM.COMUtils; - -import agent.dbgeng.dbgeng.*; -import agent.dbgeng.dbgeng.DbgEng.OpaqueCleanable; -import agent.dbgeng.dbgeng.DebugValue.DebugValueType; -import agent.dbgeng.jna.dbgeng.DbgEngNative.DEBUG_REGISTER_DESCRIPTION; -import agent.dbgeng.jna.dbgeng.DbgEngNative.DEBUG_VALUE; -import agent.dbgeng.jna.dbgeng.registers.IDebugRegisters; -import ghidra.comm.util.BitmaskSet; - -public class DebugRegistersImpl1 implements DebugRegistersInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IDebugRegisters jnaRegisters; - - public DebugRegistersImpl1(IDebugRegisters jnaRegisters) { - this.cleanable = DbgEng.releaseWhenPhantom(this, jnaRegisters); - this.jnaRegisters = jnaRegisters; - } - - @Override - public int getNumberRegisters() { - ULONGByReference pulNumber = new ULONGByReference(); - COMUtils.checkRC(jnaRegisters.GetNumberRegisters(pulNumber)); - return pulNumber.getValue().intValue(); - } - - @Override - public DebugRegisterDescription getDescription(int registerIndex) { - ULONG ulRegIdx = new ULONG(registerIndex); - ULONGByReference pulNameSize = new ULONGByReference(); - COMUtils.checkRC( - jnaRegisters.GetDescription(ulRegIdx, null, new ULONG(0), pulNameSize, null)); - byte[] name = new byte[pulNameSize.getValue().intValue()]; - DEBUG_REGISTER_DESCRIPTION.ByReference desc = new DEBUG_REGISTER_DESCRIPTION.ByReference(); - COMUtils.checkRC( - jnaRegisters.GetDescription(ulRegIdx, name, pulNameSize.getValue(), null, desc)); - - return new DebugRegisterDescription(Native.toString(name), registerIndex, - DebugValueType.values()[desc.Type.intValue()], - new BitmaskSet<>(DebugRegisterFlags.class, desc.Flags.intValue()), - desc.SubregMaster.intValue(), desc.SubregLength.intValue(), desc.SubregMask.longValue(), - desc.SubregShift.intValue()); - } - - @Override - public int getIndexByName(String name) { - ULONGByReference pulIndex = new ULONGByReference(); - HRESULT hr = jnaRegisters.GetIndexByName(name, pulIndex); - if (hr.equals(COMUtilsExtra.E_NOINTERFACE)) { - // This happens for 32-bit WOW execution - return -1; - } - COMUtils.checkRC(hr); - return pulIndex.getValue().intValue(); - } - - @Override - public DebugValue getValue(int index) { - ULONG ulIndex = new ULONG(index); - DEBUG_VALUE.ByReference dvVal = new DEBUG_VALUE.ByReference(); - COMUtils.checkRC(jnaRegisters.GetValue(ulIndex, dvVal)); - return dvVal.convertTo(DebugValue.class); - } - - protected void doGetValues(DebugRegisterSource source, ULONG ulCount, ULONG[] pulIndices, - DEBUG_VALUE[] pValues) { - if (source != DebugRegisterSource.DEBUG_REGSRC_DEBUGGEE) { - throw new IllegalArgumentException("This interface only permits DEBUG_REGSRC_DEBUGGEE"); - } - COMUtils.checkRC(jnaRegisters.GetValues(ulCount, pulIndices, new ULONG(0), pValues)); - } - - @Override - public Map getValues(DebugRegisterSource source, - Collection indices) { - if (source != DebugRegisterSource.DEBUG_REGSRC_DEBUGGEE) { - throw new IllegalArgumentException("This interface only permits DEBUG_REGSRC_DEBUGGEE"); - } - if (indices.isEmpty()) { - return Collections.emptyMap(); - } - List li = new ArrayList<>(indices); - ULONG ulCount = new ULONG(li.size()); - ULONG[] pulIndices = new ULONG[li.size()]; - DEBUG_VALUE[] pValues = (DEBUG_VALUE[]) new DEBUG_VALUE().toArray(li.size()); - for (int i = 0; i < indices.size(); i++) { - pulIndices[i] = new ULONG(li.get(i)); - } - doGetValues(source, ulCount, pulIndices, pValues); - Map result = new LinkedHashMap<>(); - for (int i = 0; i < li.size(); i++) { - result.put(li.get(i), pValues[i].convertTo(DebugValue.class)); - } - return result; - } - - @Override - public void setValue(int index, DebugValue value) { - ULONG ulIndex = new ULONG(index); - DEBUG_VALUE.ByReference dvVal = new DEBUG_VALUE.ByReference(); - DEBUG_VALUE.fromDebugValue(dvVal, value); - COMUtils.checkRC(jnaRegisters.SetValue(ulIndex, dvVal)); - } - - protected void doSetValues(DebugRegisterSource source, ULONG ulCount, ULONG[] pulIndices, - DEBUG_VALUE[] pValues) { - if (source != DebugRegisterSource.DEBUG_REGSRC_DEBUGGEE) { - throw new IllegalArgumentException("This interface only permits DEBUG_REGSRC_DEBUGGEE"); - } - - COMUtils.checkRC(jnaRegisters.SetValues(ulCount, pulIndices, new ULONG(0), pValues)); - } - - @Override - public void setValues(DebugRegisterSource source, Map values) { - if (values.isEmpty()) { - return; - } - ULONG ulCount = new ULONG(values.size()); - ULONG[] pulIndices = new ULONG[values.size()]; - DEBUG_VALUE[] pValues = (DEBUG_VALUE[]) new DEBUG_VALUE().toArray(values.size()); - int i = 0; - for (Map.Entry ent : values.entrySet()) { - pulIndices[i] = new ULONG(ent.getKey()); - DEBUG_VALUE.fromDebugValue(pValues[i], ent.getValue()); - i++; - } - doSetValues(source, ulCount, pulIndices, pValues); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/registers/DebugRegistersImpl2.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/registers/DebugRegistersImpl2.java deleted file mode 100644 index 6e1b01420c..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/registers/DebugRegistersImpl2.java +++ /dev/null @@ -1,50 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.registers; - -import com.sun.jna.platform.win32.WinDef.ULONG; - -import agent.dbgeng.jna.dbgeng.DbgEngNative.DEBUG_VALUE; -import agent.dbgeng.jna.dbgeng.registers.IDebugRegisters2; - -import com.sun.jna.platform.win32.COM.COMUtils; - -public class DebugRegistersImpl2 extends DebugRegistersImpl1 { - private final IDebugRegisters2 jnaRegisters; - - public DebugRegistersImpl2(IDebugRegisters2 jnaRegisters) { - super(jnaRegisters); - this.jnaRegisters = jnaRegisters; - } - - @Override - protected void doGetValues(DebugRegisterSource source, ULONG ulCount, ULONG[] pulIndices, - DEBUG_VALUE[] pValues) { - ULONG ulSource = new ULONG(source.ordinal()); - COMUtils - .checkRC( - jnaRegisters.GetValues2(ulSource, ulCount, pulIndices, new ULONG(0), pValues)); - } - - @Override - protected void doSetValues(DebugRegisterSource source, ULONG ulCount, ULONG[] pulIndices, - DEBUG_VALUE[] pValues) { - ULONG ulSource = new ULONG(source.ordinal()); - COMUtils - .checkRC( - jnaRegisters.SetValues2(ulSource, ulCount, pulIndices, new ULONG(0), pValues)); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/registers/DebugRegistersInternal.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/registers/DebugRegistersInternal.java deleted file mode 100644 index 8aaf42b5ac..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/registers/DebugRegistersInternal.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.registers; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.dbgeng.DebugRegisters; -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgeng.jna.dbgeng.registers.*; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DebugRegistersInternal extends DebugRegisters { - Map CACHE = new WeakValueHashMap<>(); - - static DebugRegistersInternal instanceFor(WrapIDebugRegisters registers) { - return DbgEngUtil.lazyWeakCache(CACHE, registers, DebugRegistersImpl1::new); - } - - static DebugRegistersInternal instanceFor(WrapIDebugRegisters2 registers) { - return DbgEngUtil.lazyWeakCache(CACHE, registers, DebugRegistersImpl2::new); - } - - List> PREFERRED_REGISTERS_IIDS = List.of( - new Preferred<>(IDebugRegisters2.IID_IDEBUG_REGISTERS2, WrapIDebugRegisters2.class), - new Preferred<>(IDebugRegisters.IID_IDEBUG_REGISTERS, WrapIDebugRegisters.class)); - - static DebugRegistersInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(DebugRegistersInternal.class, - PREFERRED_REGISTERS_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/symbols/DebugModuleImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/symbols/DebugModuleImpl.java deleted file mode 100644 index 82bb40391c..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/symbols/DebugModuleImpl.java +++ /dev/null @@ -1,72 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.symbols; - -import java.util.Objects; - -import agent.dbgeng.dbgeng.DebugModule; -import agent.dbgeng.dbgeng.DebugModuleInfo; - -public class DebugModuleImpl implements DebugModule { - private final DebugSymbolsInternal symbols; - final int index; - final long base; - DebugModuleInfo info; - - DebugModuleImpl(DebugSymbolsInternal symbols, int index, long base) { - this.symbols = symbols; - this.index = index; - this.base = base; - } - - @Override - public int hashCode() { - return Objects.hash(symbols, index, base); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof DebugModuleImpl)) { - return false; - } - DebugModuleImpl that = (DebugModuleImpl) obj; - if (!this.symbols.equals(that.symbols)) { - return false; - } - if (this.index != that.index) { - return false; - } - if (this.base != that.base) { - return false; - } - return true; - } - - @Override - public String getName(DebugModuleName which) { - return symbols.getModuleName(which, this); - } - - @Override - public int getIndex() { - return index; - } - - @Override - public long getBase() { - return base; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/symbols/DebugSymbolsImpl1.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/symbols/DebugSymbolsImpl1.java deleted file mode 100644 index bd07bfee19..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/symbols/DebugSymbolsImpl1.java +++ /dev/null @@ -1,232 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.symbols; - -import java.util.Iterator; -import java.util.List; - -import com.sun.jna.Native; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.COM.COMException; -import com.sun.jna.platform.win32.COM.COMUtils; - -import agent.dbgeng.dbgeng.*; -import agent.dbgeng.dbgeng.DbgEng.OpaqueCleanable; -import agent.dbgeng.dbgeng.DebugModule.DebugModuleName; -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.jna.dbgeng.DbgEngNative.DEBUG_MODULE_PARAMETERS; -import agent.dbgeng.jna.dbgeng.symbols.IDebugSymbols; - -public class DebugSymbolsImpl1 implements DebugSymbolsInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IDebugSymbols jnaSymbols; - - public DebugSymbolsImpl1(IDebugSymbols jnaSymbols) { - this.cleanable = DbgEng.releaseWhenPhantom(this, jnaSymbols); - this.jnaSymbols = jnaSymbols; - } - - @Override - public int getNumberLoadedModules() { - ULONGByReference pulLoaded = new ULONGByReference(); - ULONGByReference pulUnloaded = new ULONGByReference(); - COMUtils.checkRC(jnaSymbols.GetNumberModules(pulLoaded, pulUnloaded)); - return pulLoaded.getValue().intValue(); - } - - @Override - public int getNumberUnloadedModules() { - ULONGByReference pulLoaded = new ULONGByReference(); - ULONGByReference pulUnloaded = new ULONGByReference(); - COMUtils.checkRC(jnaSymbols.GetNumberModules(pulLoaded, pulUnloaded)); - return pulUnloaded.getValue().intValue(); - } - - @Override - public DebugModule getModuleByIndex(int index) { - ULONG ulIndex = new ULONG(index); - ULONGLONGByReference pullBase = new ULONGLONGByReference(); - COMUtils.checkRC(jnaSymbols.GetModuleByIndex(ulIndex, pullBase)); - return new DebugModuleImpl(this, index, pullBase.getValue().longValue()); - } - - @Override - public DebugModule getModuleByModuleName(String name, int startIndex) { - ULONG ulStartIndex = new ULONG(startIndex); - ULONGByReference pulIndex = new ULONGByReference(); - ULONGLONGByReference pullBase = new ULONGLONGByReference(); - COMUtils.checkRC(jnaSymbols.GetModuleByModuleName(name, ulStartIndex, pulIndex, pullBase)); - return new DebugModuleImpl(this, pulIndex.getValue().intValue(), - pullBase.getValue().longValue()); - } - - @Override - public DebugModule getModuleByOffset(long offset, int startIndex) { - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulStartIndex = new ULONG(startIndex); - ULONGByReference pulIndex = new ULONGByReference(); - ULONGLONGByReference pullBase = new ULONGLONGByReference(); - COMUtils.checkRC(jnaSymbols.GetModuleByOffset(ullOffset, ulStartIndex, pulIndex, pullBase)); - return new DebugModuleImpl(this, pulIndex.getValue().intValue(), - pullBase.getValue().longValue()); - } - - protected void callNamesForWhich(DebugModuleName which, ULONG Index, ULONGLONG Base, - byte[] Buffer, ULONG BufferSize, ULONGByReference NameSize) { - switch (which) { - case IMAGE: - COMUtils.checkRC(jnaSymbols.GetModuleNames(Index, Base, Buffer, BufferSize, - NameSize, null, new ULONG(0), null, null, new ULONG(0), null)); - case MODULE: - COMUtils.checkRC(jnaSymbols.GetModuleNames(Index, Base, null, new ULONG(0), null, - Buffer, BufferSize, NameSize, null, new ULONG(0), null)); - case LOADED_IMAGE: - COMUtils.checkRC(jnaSymbols.GetModuleNames(Index, Base, null, new ULONG(0), null, - null, new ULONG(0), null, Buffer, BufferSize, NameSize)); - default: - throw new UnsupportedOperationException("Interface does not support " + which); - } - } - - @Override - public String getModuleName(DebugModuleName which, DebugModule module) { - ULONGLONG ullBase = new ULONGLONG(module.getBase()); - ULONGByReference pulNameSize = new ULONGByReference(); - callNamesForWhich(which, DbgEngUtil.DEBUG_ANY_ID, ullBase, null, new ULONG(0), pulNameSize); - byte[] aBuffer = new byte[pulNameSize.getValue().intValue()]; - callNamesForWhich(which, DbgEngUtil.DEBUG_ANY_ID, ullBase, aBuffer, pulNameSize.getValue(), - null); - return Native.toString(aBuffer); - } - - @Override - public DebugModuleInfo getModuleParameters(int count, int startIndex) { - ULONG ulCount = new ULONG(count); - ULONG ulStartIndex = new ULONG(startIndex); - DEBUG_MODULE_PARAMETERS.ByReference pInfo = new DEBUG_MODULE_PARAMETERS.ByReference(); - COMUtils.checkRC(jnaSymbols.GetModuleParameters(ulCount, null, ulStartIndex, pInfo)); - return new DebugModuleInfo(0L, pInfo.Base.longValue(), pInfo.Size.intValue(), "", "", - pInfo.Checksum.intValue(), pInfo.TimeDateStamp.intValue()); - } - - @Override - public Iterable iterateSymbolMatches(String pattern) { - ULONGLONGByReference pullHandle = new ULONGLONGByReference(); - return new Iterable() { - @Override - public Iterator iterator() { - COMUtils.checkRC(jnaSymbols.StartSymbolMatch(pattern, pullHandle)); - return new Iterator() { - ULONGByReference pulMatchSize = new ULONGByReference(); - ULONGLONGByReference pullOffset = new ULONGLONGByReference(); - - @Override - public boolean hasNext() { - try { - COMUtils.checkRC(jnaSymbols.GetNextSymbolMatch(pullHandle.getValue(), - null, new ULONG(0), pulMatchSize, null)); - } - catch (COMException e) { - if (!COMUtilsExtra.isE_NOINTERFACE(e)) { - throw e; - } - return false; - } - return true; - } - - @Override - public DebugSymbolName next() { - try { - if (pulMatchSize.getValue().intValue() == 0) { - COMUtils.checkRC(jnaSymbols.GetNextSymbolMatch( - pullHandle.getValue(), null, new ULONG(0), pulMatchSize, null)); - } - byte[] aBuffer = new byte[pulMatchSize.getValue().intValue()]; - COMUtils.checkRC(jnaSymbols.GetNextSymbolMatch(pullHandle.getValue(), - aBuffer, pulMatchSize.getValue(), null, pullOffset)); - return new DebugSymbolName(Native.toString(aBuffer), - pullOffset.getValue().longValue()); - } - catch (COMException e) { - if (!COMUtilsExtra.isE_NOINTERFACE(e)) { - throw e; - } - return null; - } - finally { - pulMatchSize.getValue().setValue(0); - } - } - - @Override - protected void finalize() throws Throwable { - COMUtils.checkRC(jnaSymbols.EndSymbolMatch(pullHandle.getValue())); - } - }; - } - }; - } - - @Override - public List getSymbolIdsByName(String pattern) { - throw new UnsupportedOperationException("Not supported by this interface"); - } - - @Override - public DebugSymbolEntry getSymbolEntry(DebugSymbolId id) { - throw new UnsupportedOperationException("Not supported by this interface"); - } - - @Override - public String getSymbolPath() { - ULONGByReference pulPathLength = new ULONGByReference(); - COMUtils.checkRC(jnaSymbols.GetSymbolPath(null, new ULONG(0), pulPathLength)); - byte[] aBuffer = new byte[pulPathLength.getValue().intValue()]; - COMUtils.checkRC(jnaSymbols.GetSymbolPath(aBuffer, pulPathLength.getValue(), null)); - return Native.toString(aBuffer); - } - - @Override - public void setSymbolPath(String path) { - //WString wPath = new WString(path); - COMUtils.checkRC(jnaSymbols.SetSymbolPath(path)); - } - - @Override - public int getSymbolOptions() { - ULONGByReference pulOptions = new ULONGByReference(); - COMUtils.checkRC(jnaSymbols.GetSymbolPath(null, new ULONG(0), pulOptions)); - return pulOptions.getValue().intValue(); - } - - @Override - public void setSymbolOptions(int options) { - ULONG ulOptions = new ULONG(options); - COMUtils.checkRC(jnaSymbols.SetSymbolOptions(ulOptions)); - } - - @Override - public int getCurrentScopeFrameIndex() { - throw new UnsupportedOperationException("Not supported by this interface"); - } - - @Override - public void setCurrentScopeFrameIndex(int index) { - throw new UnsupportedOperationException("Not supported by this interface"); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/symbols/DebugSymbolsImpl2.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/symbols/DebugSymbolsImpl2.java deleted file mode 100644 index 605bc4e534..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/symbols/DebugSymbolsImpl2.java +++ /dev/null @@ -1,48 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.symbols; - -import com.sun.jna.Native; -import com.sun.jna.platform.win32.WinDef.*; - -import agent.dbgeng.dbgeng.DebugModule; -import agent.dbgeng.dbgeng.DebugModule.DebugModuleName; -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.jna.dbgeng.symbols.IDebugSymbols2; - -import com.sun.jna.platform.win32.COM.COMUtils; - -public class DebugSymbolsImpl2 extends DebugSymbolsImpl1 { - private final IDebugSymbols2 jnaSymbols; - - public DebugSymbolsImpl2(IDebugSymbols2 jnaSymbols) { - super(jnaSymbols); - this.jnaSymbols = jnaSymbols; - } - - @Override - public String getModuleName(DebugModuleName which, DebugModule module) { - ULONG ulWhich = new ULONG(which.ordinal()); - ULONGLONG ullBase = new ULONGLONG(module.getBase()); - ULONGByReference pulNameSize = new ULONGByReference(); - COMUtils.checkRC(jnaSymbols.GetModuleNameString(ulWhich, DbgEngUtil.DEBUG_ANY_ID, ullBase, - null, new ULONG(0), pulNameSize)); - byte[] aBuffer = new byte[pulNameSize.getValue().intValue()]; - COMUtils.checkRC(jnaSymbols.GetModuleNameString(ulWhich, DbgEngUtil.DEBUG_ANY_ID, ullBase, - aBuffer, pulNameSize.getValue(), null)); - return Native.toString(aBuffer); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/symbols/DebugSymbolsImpl3.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/symbols/DebugSymbolsImpl3.java deleted file mode 100644 index 0032b0d59f..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/symbols/DebugSymbolsImpl3.java +++ /dev/null @@ -1,115 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.symbols; - -import java.util.*; - -import com.sun.jna.Native; -import com.sun.jna.WString; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.platform.win32.COM.COMUtils; - -import agent.dbgeng.dbgeng.*; -import agent.dbgeng.dbgeng.DebugModule.DebugModuleName; -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.jna.dbgeng.DbgEngNative.DEBUG_MODULE_AND_ID; -import agent.dbgeng.jna.dbgeng.DbgEngNative.DEBUG_SYMBOL_ENTRY; -import agent.dbgeng.jna.dbgeng.symbols.IDebugSymbols3; - -public class DebugSymbolsImpl3 extends DebugSymbolsImpl2 { - private final IDebugSymbols3 jnaSymbols; - - public DebugSymbolsImpl3(IDebugSymbols3 jnaSymbols) { - super(jnaSymbols); - this.jnaSymbols = jnaSymbols; - } - - @Override - public int getCurrentScopeFrameIndex() { - ULONGByReference pulIndex = new ULONGByReference(); - COMUtils.checkRC(jnaSymbols.GetCurrentScopeFrameIndex(pulIndex)); - return pulIndex.getValue().intValue(); - } - - @Override - public void setCurrentScopeFrameIndex(int index) { - ULONG ulIndex = new ULONG(index); - HRESULT hr = jnaSymbols.SetCurrentScopeFrameIndex(ulIndex); - COMUtils.checkRC(hr); - } - - @Override - public DebugModule getModuleByModuleName(String name, int startIndex) { - ULONG ulStartIndex = new ULONG(startIndex); - ULONGByReference pulIndex = new ULONGByReference(); - ULONGLONGByReference pullBase = new ULONGLONGByReference(); - COMUtils.checkRC(jnaSymbols.GetModuleByModuleNameWide(new WString(name), ulStartIndex, - pulIndex, pullBase)); - return new DebugModuleImpl(this, pulIndex.getValue().intValue(), - pullBase.getValue().longValue()); - } - - @Override - public String getModuleName(DebugModuleName which, DebugModule module) { - ULONG ulWhich = new ULONG(which.ordinal()); - ULONGLONG ullBase = new ULONGLONG(module.getBase()); - ULONGByReference pulNameSize = new ULONGByReference(); - COMUtils.checkRC(jnaSymbols.GetModuleNameStringWide(ulWhich, DbgEngUtil.DEBUG_ANY_ID, - ullBase, null, new ULONG(0), pulNameSize)); - char[] aBuffer = new char[pulNameSize.getValue().intValue()]; - COMUtils.checkRC(jnaSymbols.GetModuleNameStringWide(ulWhich, DbgEngUtil.DEBUG_ANY_ID, - ullBase, aBuffer, pulNameSize.getValue(), null)); - return Native.toString(aBuffer); - } - - @Override - public List getSymbolIdsByName(String pattern) { - ULONGByReference pulEntries = new ULONGByReference(); - WString wsPattern = new WString(pattern); - COMUtils.checkRC(jnaSymbols.GetSymbolEntriesByNameWide(wsPattern, new ULONG(0), null, - new ULONG(0), pulEntries)); - if (pulEntries.getValue().intValue() == 0) { - return Collections.emptyList(); - } - DEBUG_MODULE_AND_ID[] aIds = (DEBUG_MODULE_AND_ID[]) new DEBUG_MODULE_AND_ID() - .toArray(pulEntries.getValue().intValue()); - COMUtils.checkRC(jnaSymbols.GetSymbolEntriesByNameWide(wsPattern, new ULONG(0), aIds, - pulEntries.getValue(), null)); - List result = new ArrayList<>(aIds.length); - for (int i = 0; i < aIds.length; i++) { - result.add(new DebugSymbolId(aIds[i].ModuleBase.longValue(), aIds[i].Id.longValue())); - } - return result; - } - - @Override - public DebugSymbolEntry getSymbolEntry(DebugSymbolId id) { - DEBUG_MODULE_AND_ID sId = new DEBUG_MODULE_AND_ID(); - sId.ModuleBase = new ULONGLONG(id.moduleBase); - sId.Id = new ULONGLONG(id.symbolIndex); - DEBUG_SYMBOL_ENTRY.ByReference pInfo = new DEBUG_SYMBOL_ENTRY.ByReference(); - COMUtils.checkRC(jnaSymbols.GetSymbolEntryInformation(sId, pInfo)); - // Get the name while I'm here - char[] aName = new char[pInfo.NameSize.intValue() + 1]; - COMUtils.checkRC(jnaSymbols.GetSymbolEntryStringWide(sId, new ULONG(0), aName, - new ULONG(aName.length), null)); - return new DebugSymbolEntry(pInfo.ModuleBase.longValue(), pInfo.Offset.longValue(), - pInfo.Id.longValue(), pInfo.Size.longValue(), pInfo.Flags.intValue(), - pInfo.TypeId.intValue()/* TODO */, Native.toString(aName), - pInfo.Tag.intValue()/* TODO */); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/symbols/DebugSymbolsImpl4.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/symbols/DebugSymbolsImpl4.java deleted file mode 100644 index 80274beb28..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/symbols/DebugSymbolsImpl4.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.symbols; - -import agent.dbgeng.jna.dbgeng.symbols.IDebugSymbols4; - -public class DebugSymbolsImpl4 extends DebugSymbolsImpl3 { - @SuppressWarnings("unused") - private final IDebugSymbols4 jnaSymbols; - - public DebugSymbolsImpl4(IDebugSymbols4 jnaSymbols) { - super(jnaSymbols); - this.jnaSymbols = jnaSymbols; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/symbols/DebugSymbolsImpl5.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/symbols/DebugSymbolsImpl5.java deleted file mode 100644 index a4534dc7fa..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/symbols/DebugSymbolsImpl5.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.symbols; - -import agent.dbgeng.jna.dbgeng.symbols.IDebugSymbols5; - -public class DebugSymbolsImpl5 extends DebugSymbolsImpl4 { - @SuppressWarnings("unused") - private final IDebugSymbols5 jnaSymbols; - - public DebugSymbolsImpl5(IDebugSymbols5 jnaSymbols) { - super(jnaSymbols); - this.jnaSymbols = jnaSymbols; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/symbols/DebugSymbolsInternal.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/symbols/DebugSymbolsInternal.java deleted file mode 100644 index 6879338755..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/symbols/DebugSymbolsInternal.java +++ /dev/null @@ -1,71 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.symbols; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.dbgeng.*; -import agent.dbgeng.dbgeng.DebugModule.DebugModuleName; -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgeng.jna.dbgeng.symbols.*; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DebugSymbolsInternal extends DebugSymbols { - final Map CACHE = new WeakValueHashMap<>(); - - static DebugSymbolsInternal instanceFor(WrapIDebugSymbols symbols) { - return DbgEngUtil.lazyWeakCache(CACHE, symbols, DebugSymbolsImpl1::new); - } - - static DebugSymbolsInternal instanceFor(WrapIDebugSymbols2 symbols) { - return DbgEngUtil.lazyWeakCache(CACHE, symbols, DebugSymbolsImpl2::new); - } - - static DebugSymbolsInternal instanceFor(WrapIDebugSymbols3 symbols) { - return DbgEngUtil.lazyWeakCache(CACHE, symbols, DebugSymbolsImpl3::new); - } - - static DebugSymbolsInternal instanceFor(WrapIDebugSymbols4 symbols) { - return DbgEngUtil.lazyWeakCache(CACHE, symbols, DebugSymbolsImpl4::new); - } - - static DebugSymbolsInternal instanceFor(WrapIDebugSymbols5 symbols) { - return DbgEngUtil.lazyWeakCache(CACHE, symbols, DebugSymbolsImpl5::new); - } - - List> PREFFERED_SYMBOLS_IIDS = List.of( - new Preferred<>(IDebugSymbols5.IID_IDEBUG_SYMBOLS5, WrapIDebugSymbols5.class), - new Preferred<>(IDebugSymbols4.IID_IDEBUG_SYMBOLS4, WrapIDebugSymbols4.class), - new Preferred<>(IDebugSymbols3.IID_IDEBUG_SYMBOLS3, WrapIDebugSymbols3.class), - new Preferred<>(IDebugSymbols2.IID_IDEBUG_SYMBOLS2, WrapIDebugSymbols2.class), - new Preferred<>(IDebugSymbols.IID_IDEBUG_SYMBOLS, WrapIDebugSymbols.class)); - - static DebugSymbolsInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(DebugSymbolsInternal.class, PREFFERED_SYMBOLS_IIDS, - supplier); - } - - String getModuleName(DebugModuleName which, DebugModule module); - - @Override - DebugModuleInfo getModuleParameters(int count, int startIndex); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/sysobj/DebugSystemObjectsImpl1.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/sysobj/DebugSystemObjectsImpl1.java deleted file mode 100644 index 6b3cb01bdf..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/sysobj/DebugSystemObjectsImpl1.java +++ /dev/null @@ -1,323 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.sysobj; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinDef.ULONGByReference; -import com.sun.jna.platform.win32.WinDef.ULONGLONG; -import com.sun.jna.platform.win32.WinDef.ULONGLONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.Native; -import com.sun.jna.platform.win32.COM.COMUtils; - -import agent.dbgeng.dbgeng.COMUtilsExtra; -import agent.dbgeng.dbgeng.DbgEng; -import agent.dbgeng.dbgeng.DbgEng.OpaqueCleanable; -import agent.dbgeng.dbgeng.DebugProcessId; -import agent.dbgeng.dbgeng.DebugProcessRecord; -import agent.dbgeng.dbgeng.DebugSessionId; -import agent.dbgeng.dbgeng.DebugThreadId; -import agent.dbgeng.dbgeng.DebugThreadRecord; -import agent.dbgeng.jna.dbgeng.sysobj.IDebugSystemObjects; - -public class DebugSystemObjectsImpl1 implements DebugSystemObjectsInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IDebugSystemObjects jnaSysobj; - - public DebugSystemObjectsImpl1(IDebugSystemObjects jnaSysobj) { - this.cleanable = DbgEng.releaseWhenPhantom(this, jnaSysobj); - this.jnaSysobj = jnaSysobj; - } - - @Override - public DebugThreadId getEventThread() { - ULONGByReference pulId = new ULONGByReference(); - HRESULT hr = jnaSysobj.GetEventThread(pulId); - if (hr.equals(COMUtilsExtra.E_UNEXPECTED)) { - return new DebugThreadRecord(-1); - } - COMUtils.checkRC(hr); - return new DebugThreadRecord(pulId.getValue().intValue()); - } - - @Override - public DebugProcessId getEventProcess() { - ULONGByReference pulId = new ULONGByReference(); - HRESULT hr = jnaSysobj.GetEventProcess(pulId); - if (hr.equals(COMUtilsExtra.E_UNEXPECTED)) { - return new DebugProcessRecord(-1); - } - COMUtils.checkRC(hr); - return new DebugProcessRecord(pulId.getValue().intValue()); - } - - @Override - public DebugThreadId getCurrentThreadId() { - ULONGByReference pulId = new ULONGByReference(); - HRESULT hr = jnaSysobj.GetCurrentThreadId(pulId); - if (hr.equals(COMUtilsExtra.E_UNEXPECTED)) { - return new DebugThreadRecord(-1); - } - COMUtils.checkRC(hr); - return new DebugThreadRecord(pulId.getValue().intValue()); - } - - @Override - public void setCurrentThreadId(DebugThreadId id) { - HRESULT hr = jnaSysobj.SetCurrentThreadId(new ULONG(id.value())); - if (!hr.equals(COMUtilsExtra.E_UNEXPECTED) && !hr.equals(COMUtilsExtra.E_NOINTERFACE)) { - COMUtils.checkRC(hr); - } - } - - @Override - public DebugProcessId getCurrentProcessId() { - ULONGByReference pulId = new ULONGByReference(); - HRESULT hr = jnaSysobj.GetCurrentProcessId(pulId); - if (hr.equals(COMUtilsExtra.E_UNEXPECTED)) { - return new DebugProcessRecord(-1); - } - COMUtils.checkRC(hr); - return new DebugProcessRecord(pulId.getValue().intValue()); - } - - @Override - public void setCurrentProcessId(DebugProcessId id) { - HRESULT hr = jnaSysobj.SetCurrentProcessId(new ULONG(id.value())); - if (hr.equals(COMUtilsExtra.E_UNEXPECTED)) { - //System.err.println("Failure on setCurrentProcessId(" + id + ")"); - return; - } - if (hr.equals(COMUtilsExtra.E_NOINTERFACE)) { - return; - } - COMUtils.checkRC(hr); - } - - @Override - public int getNumberThreads() { - ULONGByReference pulNumber = new ULONGByReference(); - HRESULT hr = jnaSysobj.GetNumberThreads(pulNumber); - if (hr.equals(COMUtilsExtra.E_UNEXPECTED)) { - return 0; - } - COMUtils.checkRC(hr); - return pulNumber.getValue().intValue(); - } - - @Override - public int getTotalNumberThreads() { - ULONGByReference pulTotal = new ULONGByReference(); - ULONGByReference pulLargestProcess = new ULONGByReference(); - COMUtils.checkRC(jnaSysobj.GetTotalNumberThreads(pulTotal, pulLargestProcess)); - return pulTotal.getValue().intValue(); - } - - @Override - public List getThreads(int start, int count) { - if (count == 0) { - return Collections.emptyList(); - } - // TODO: Does dbgeng do the bounds checking? - ULONG ulStart = new ULONG(start); - ULONG ulCount = new ULONG(count); - ULONG[] aulIds = new ULONG[count]; - COMUtils.checkRC(jnaSysobj.GetThreadIdsByIndex(ulStart, ulCount, aulIds, null)); - List result = new ArrayList<>(count); - for (int i = 0; i < count; i++) { - result.add(new DebugThreadRecord(aulIds[i].intValue())); - } - return result; - } - - @Override - public DebugThreadId getThreadIdByHandle(long handle) { - ULONGLONG ullHandle = new ULONGLONG(handle); - ULONGByReference pulId = new ULONGByReference(); - COMUtils.checkRC(jnaSysobj.GetThreadIdByHandle(ullHandle, pulId)); - return new DebugThreadRecord(pulId.getValue().intValue()); - } - - @Override - public DebugThreadId getThreadIdBySystemId(int systemId) { - ULONG ulHandle = new ULONG(systemId); - ULONGByReference pulId = new ULONGByReference(); - HRESULT hr = jnaSysobj.GetThreadIdBySystemId(ulHandle, pulId); - if (hr.equals(COMUtilsExtra.E_UNEXPECTED) || hr.equals(COMUtilsExtra.E_NOTIMPLEMENTED) || - hr.equals(COMUtilsExtra.E_NOINTERFACE)) { - return null; - } - COMUtils.checkRC(hr); - return new DebugThreadRecord(pulId.getValue().intValue()); - } - - @Override - public DebugProcessId getProcessIdByHandle(long handle) { - ULONGLONG ullHandle = new ULONGLONG(handle); - ULONGByReference pulId = new ULONGByReference(); - COMUtils.checkRC(jnaSysobj.GetProcessIdByHandle(ullHandle, pulId)); - return new DebugProcessRecord(pulId.getValue().intValue()); - } - - @Override - public DebugProcessId getProcessIdBySystemId(int systemId) { - ULONG ulHandle = new ULONG(systemId); - ULONGByReference pulId = new ULONGByReference(); - HRESULT hr = jnaSysobj.GetProcessIdBySystemId(ulHandle, pulId); - if (hr.equals(COMUtilsExtra.E_UNEXPECTED) || hr.equals(COMUtilsExtra.E_NOTIMPLEMENTED) || - hr.equals(COMUtilsExtra.E_NOINTERFACE)) { - return null; - } - COMUtils.checkRC(hr); - return new DebugProcessRecord(pulId.getValue().intValue()); - } - - @Override - public int getNumberProcesses() { - ULONGByReference pulNumber = new ULONGByReference(); - HRESULT hr = jnaSysobj.GetNumberProcesses(pulNumber); - if (hr.equals(COMUtilsExtra.E_UNEXPECTED)) { - return -1; - } - COMUtils.checkRC(hr); - return pulNumber.getValue().intValue(); - } - - @Override - public List getProcesses(int start, int count) { - if (count == 0) { - return Collections.emptyList(); - } - // TODO: Does dbgeng do the bounds checking? - ULONG ulStart = new ULONG(start); - ULONG ulCount = new ULONG(count); - ULONG[] aulIds = new ULONG[count]; - COMUtils.checkRC(jnaSysobj.GetProcessIdsByIndex(ulStart, ulCount, aulIds, null)); - List result = new ArrayList<>(count); - for (int i = 0; i < count; i++) { - result.add(new DebugProcessRecord(aulIds[i].intValue())); - } - return result; - } - - @Override - public int getCurrentThreadSystemId() { - ULONGByReference pulSysId = new ULONGByReference(); - HRESULT hr = jnaSysobj.GetCurrentThreadSystemId(pulSysId); - if (hr.equals(COMUtilsExtra.E_UNEXPECTED) || hr.equals(COMUtilsExtra.E_NOTIMPLEMENTED)) { - return -1; - } - COMUtils.checkRC(hr); - return pulSysId.getValue().intValue(); - } - - @Override - public int getCurrentProcessSystemId() { - ULONGByReference pulSysId = new ULONGByReference(); - HRESULT hr = jnaSysobj.GetCurrentProcessSystemId(pulSysId); - if (hr.equals(COMUtilsExtra.E_UNEXPECTED) || hr.equals(COMUtilsExtra.E_NOTIMPLEMENTED)) { - return -1; - } - COMUtils.checkRC(hr); - return pulSysId.getValue().intValue(); - } - - @Override - public long getCurrentThreadDataOffset() { - ULONGLONGByReference pulSysOffset = new ULONGLONGByReference(); - HRESULT hr = jnaSysobj.GetCurrentThreadDataOffset(pulSysOffset); - if (hr.equals(COMUtilsExtra.E_UNEXPECTED) || hr.equals(COMUtilsExtra.E_NOTIMPLEMENTED)) { - return -1; - } - COMUtils.checkRC(hr); - return pulSysOffset.getValue().longValue(); - } - - @Override - public long getCurrentProcessDataOffset() { - ULONGLONGByReference pulSysOffset = new ULONGLONGByReference(); - HRESULT hr = jnaSysobj.GetCurrentProcessDataOffset(pulSysOffset); - if (hr.equals(COMUtilsExtra.E_UNEXPECTED) || hr.equals(COMUtilsExtra.E_NOTIMPLEMENTED)) { - return -1; - } - COMUtils.checkRC(hr); - return pulSysOffset.getValue().longValue(); - } - - @Override - public String getCurrentProcessExecutableName() { - ULONGByReference pulPathLength = new ULONGByReference(); - COMUtils.checkRC(jnaSysobj.GetCurrentProcessExecutableName(null, new ULONG(0), pulPathLength)); - byte[] aBuffer = new byte[pulPathLength.getValue().intValue()]; - HRESULT hr = jnaSysobj.GetCurrentProcessExecutableName(aBuffer, pulPathLength.getValue(), null); - if (hr.equals(COMUtilsExtra.E_UNEXPECTED) || hr.equals(COMUtilsExtra.E_NOTIMPLEMENTED)) { - return null; - } - return Native.toString(aBuffer); - } - - @Override - public DebugSessionId getEventSystem() { - throw new UnsupportedOperationException("Not supported by this interface"); - } - - @Override - public DebugSessionId getCurrentSystemId() { - throw new UnsupportedOperationException("Not supported by this interface"); - } - - @Override - public void setCurrentSystemId(DebugSessionId id) { - throw new UnsupportedOperationException("Not supported by this interface"); - } - - @Override - public int getNumberSystems() { - throw new UnsupportedOperationException("Not supported by this interface"); - } - - @Override - public List getSystems(int start, int count) { - throw new UnsupportedOperationException("Not supported by this interface"); - } - - @Override - public long getImplicitThreadDataOffset() { - throw new UnsupportedOperationException("Not supported by this interface"); - } - - @Override - public long getImplicitProcessDataOffset() { - throw new UnsupportedOperationException("Not supported by this interface"); - } - - @Override - public void setImplicitThreadDataOffset(long offset) { - throw new UnsupportedOperationException("Not supported by this interface"); - } - - @Override - public void setImplicitProcessDataOffset(long offset) { - throw new UnsupportedOperationException("Not supported by this interface"); - } - - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/sysobj/DebugSystemObjectsImpl2.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/sysobj/DebugSystemObjectsImpl2.java deleted file mode 100644 index 251f47eafd..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/sysobj/DebugSystemObjectsImpl2.java +++ /dev/null @@ -1,75 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.sysobj; - -import com.sun.jna.platform.win32.COM.COMUtils; -import com.sun.jna.platform.win32.WinDef.ULONGLONG; -import com.sun.jna.platform.win32.WinDef.ULONGLONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgeng.dbgeng.COMUtilsExtra; -import agent.dbgeng.jna.dbgeng.sysobj.IDebugSystemObjects2; - -public class DebugSystemObjectsImpl2 extends DebugSystemObjectsImpl1 { - @SuppressWarnings("unused") - private final IDebugSystemObjects2 jnaSysobj; - - public DebugSystemObjectsImpl2(IDebugSystemObjects2 jnaSysobj) { - super(jnaSysobj); - this.jnaSysobj = jnaSysobj; - } - - public long getImplicitThreadDataOffset() { - ULONGLONGByReference pulSysOffset = new ULONGLONGByReference(); - HRESULT hr = jnaSysobj.GetImplicitThreadDataOffset(pulSysOffset); - if (hr.equals(COMUtilsExtra.E_UNEXPECTED) || hr.equals(COMUtilsExtra.E_NOTIMPLEMENTED)) { - return -1; - } - COMUtils.checkRC(hr); - return pulSysOffset.getValue().longValue(); - } - - @Override - public long getImplicitProcessDataOffset() { - ULONGLONGByReference pulSysOffset = new ULONGLONGByReference(); - HRESULT hr = jnaSysobj.GetImplicitProcessDataOffset(pulSysOffset); - if (hr.equals(COMUtilsExtra.E_UNEXPECTED) || hr.equals(COMUtilsExtra.E_NOTIMPLEMENTED)) { - return -1; - } - COMUtils.checkRC(hr); - return pulSysOffset.getValue().longValue(); - } - - public void setImplicitThreadDataOffset(long offset) { - ULONGLONG ulSysOffset = new ULONGLONG(offset); - HRESULT hr = jnaSysobj.SetImplicitThreadDataOffset(ulSysOffset); - if (hr.equals(COMUtilsExtra.E_UNEXPECTED) || hr.equals(COMUtilsExtra.E_NOTIMPLEMENTED)) { - return; - } - COMUtils.checkRC(hr); - } - - @Override - public void setImplicitProcessDataOffset(long offset) { - ULONGLONG ulSysOffset = new ULONGLONG(offset); - HRESULT hr = jnaSysobj.SetImplicitProcessDataOffset(ulSysOffset); - if (hr.equals(COMUtilsExtra.E_UNEXPECTED) || hr.equals(COMUtilsExtra.E_NOTIMPLEMENTED)) { - return; - } - COMUtils.checkRC(hr); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/sysobj/DebugSystemObjectsImpl3.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/sysobj/DebugSystemObjectsImpl3.java deleted file mode 100644 index 70a89e3852..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/sysobj/DebugSystemObjectsImpl3.java +++ /dev/null @@ -1,99 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.sysobj; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinDef.ULONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.platform.win32.COM.COMUtils; - -import agent.dbgeng.dbgeng.COMUtilsExtra; -import agent.dbgeng.dbgeng.DebugSessionId; -import agent.dbgeng.dbgeng.DebugSessionRecord; -import agent.dbgeng.jna.dbgeng.sysobj.IDebugSystemObjects3; - -public class DebugSystemObjectsImpl3 extends DebugSystemObjectsImpl2 { - @SuppressWarnings("unused") - private final IDebugSystemObjects3 jnaSysobj; - - public DebugSystemObjectsImpl3(IDebugSystemObjects3 jnaSysobj) { - super(jnaSysobj); - this.jnaSysobj = jnaSysobj; - } - - @Override - public DebugSessionId getEventSystem() { - ULONGByReference pulId = new ULONGByReference(); - HRESULT hr = jnaSysobj.GetEventSystem(pulId); - if (hr.equals(COMUtilsExtra.E_UNEXPECTED)) { - return new DebugSessionRecord(-1); - } - COMUtils.checkRC(hr); - return new DebugSessionRecord(pulId.getValue().intValue()); - } - - @Override - public DebugSessionId getCurrentSystemId() { - ULONGByReference pulId = new ULONGByReference(); - HRESULT hr = jnaSysobj.GetCurrentSystemId(pulId); - if (hr.equals(COMUtilsExtra.E_UNEXPECTED)) { - return new DebugSessionRecord(-1); - } - COMUtils.checkRC(hr); - return new DebugSessionRecord(pulId.getValue().intValue()); - } - - @Override - public void setCurrentSystemId(DebugSessionId id) { - HRESULT hr = jnaSysobj.SetCurrentSystemId(new ULONG(id.value())); - if (!hr.equals(COMUtilsExtra.E_UNEXPECTED)) { - COMUtils.checkRC(hr); - } - } - - @Override - public int getNumberSystems() { - ULONGByReference pulNumber = new ULONGByReference(); - HRESULT hr = jnaSysobj.GetNumberSystems(pulNumber); - if (hr.equals(COMUtilsExtra.E_UNEXPECTED)) { - return -1; - } - COMUtils.checkRC(hr); - return pulNumber.getValue().intValue(); - } - - @Override - public List getSystems(int start, int count) { - if (count == 0) { - return Collections.emptyList(); - } - // TODO: Does dbgeng do the bounds checking? - ULONG ulStart = new ULONG(start); - ULONG ulCount = new ULONG(count); - ULONG[] aulIds = new ULONG[count]; - COMUtils.checkRC(jnaSysobj.GetSystemIdsByIndex(ulStart, ulCount, aulIds, null)); - List result = new ArrayList<>(count); - for (int i = 0; i < count; i++) { - result.add(new DebugSessionRecord(aulIds[i].intValue())); - } - return result; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/sysobj/DebugSystemObjectsImpl4.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/sysobj/DebugSystemObjectsImpl4.java deleted file mode 100644 index 1797a2c9c3..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/sysobj/DebugSystemObjectsImpl4.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.sysobj; - -import agent.dbgeng.jna.dbgeng.sysobj.IDebugSystemObjects4; - -public class DebugSystemObjectsImpl4 extends DebugSystemObjectsImpl3 { - @SuppressWarnings("unused") - private final IDebugSystemObjects4 jnaSysobj; - - public DebugSystemObjectsImpl4(IDebugSystemObjects4 jnaSysobj) { - super(jnaSysobj); - this.jnaSysobj = jnaSysobj; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/sysobj/DebugSystemObjectsInternal.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/sysobj/DebugSystemObjectsInternal.java deleted file mode 100644 index d269551c9f..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/impl/dbgeng/sysobj/DebugSystemObjectsInternal.java +++ /dev/null @@ -1,63 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.impl.dbgeng.sysobj; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.dbgeng.DebugSystemObjects; -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgeng.jna.dbgeng.sysobj.*; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DebugSystemObjectsInternal extends DebugSystemObjects { - Map CACHE = new WeakValueHashMap<>(); - - static DebugSystemObjectsInternal instanceFor(WrapIDebugSystemObjects sysobj) { - return DbgEngUtil.lazyWeakCache(CACHE, sysobj, DebugSystemObjectsImpl1::new); - } - - static DebugSystemObjectsInternal instanceFor(WrapIDebugSystemObjects2 sysobj) { - return DbgEngUtil.lazyWeakCache(CACHE, sysobj, DebugSystemObjectsImpl2::new); - } - - static DebugSystemObjectsInternal instanceFor(WrapIDebugSystemObjects3 sysobj) { - return DbgEngUtil.lazyWeakCache(CACHE, sysobj, DebugSystemObjectsImpl3::new); - } - - static DebugSystemObjectsInternal instanceFor(WrapIDebugSystemObjects4 sysobj) { - return DbgEngUtil.lazyWeakCache(CACHE, sysobj, DebugSystemObjectsImpl4::new); - } - - List> PREFERRED_SYSTEM_OBJECTS_IIDS = List.of( - new Preferred<>(IDebugSystemObjects4.IID_IDEBUG_SYSTEM_OBJECTS4, - WrapIDebugSystemObjects4.class), - new Preferred<>(IDebugSystemObjects3.IID_IDEBUG_SYSTEM_OBJECTS3, - WrapIDebugSystemObjects3.class), - new Preferred<>(IDebugSystemObjects2.IID_IDEBUG_SYSTEM_OBJECTS2, - WrapIDebugSystemObjects2.class), - new Preferred<>(IDebugSystemObjects.IID_IDEBUG_SYSTEM_OBJECTS, - WrapIDebugSystemObjects.class)); - - static DebugSystemObjectsInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(DebugSystemObjectsInternal.class, - PREFERRED_SYSTEM_OBJECTS_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/DbgEngNative.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/DbgEngNative.java deleted file mode 100644 index 53bd482e6c..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/DbgEngNative.java +++ /dev/null @@ -1,524 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng; - -import java.util.List; - -import com.sun.jna.*; -import com.sun.jna.platform.win32.Guid.REFIID; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; -import com.sun.jna.win32.StdCallLibrary; - -import agent.dbgeng.dbgeng.DebugValue; -import agent.dbgeng.dbgeng.DebugValue.*; - -public interface DbgEngNative extends StdCallLibrary { - //DbgEngNative INSTANCE = Native.loadLibrary("dbgeng", DbgEngNative.class); - DbgEngNative INSTANCE = Native.load("dbgeng.dll", DbgEngNative.class); - - HRESULT DebugConnect(String RemoteOptions, REFIID InterfaceId, PointerByReference Interface); - - HRESULT DebugConnectWide(WString RemoteOptions, REFIID InterfaceId, - PointerByReference Interface); - - HRESULT DebugCreate(REFIID InterfaceId, PointerByReference Interface); - - HRESULT DebugCreateEx(REFIID InterfaceId, DWORD DbgEngOptions, PointerByReference Interface); - - public static class DEBUG_BREAKPOINT_PARAMETERS extends Structure { - public static class ByReference extends DEBUG_BREAKPOINT_PARAMETERS - implements Structure.ByReference { - } - - public static final List FIELDS = createFieldsOrder("Offset", "Id", "BreakType", - "ProcType", "Flags", "DataSize", "DataAccessType", "PassCount", "CurrentPassCount", - "MatchThread", "CommandSize", "OffsetExpressionSize"); - - public ULONGLONG Offset; - public ULONG Id; - public ULONG BreakType; - public ULONG ProcType; - public ULONG Flags; - public ULONG DataSize; - public ULONG DataAccessType; - public ULONG PassCount; - public ULONG CurrentPassCount; - public ULONG MatchThread; - public ULONG CommandSize; - public ULONG OffsetExpressionSize; - - @Override - protected List getFieldOrder() { - return FIELDS; - } - } - - public static class DEBUG_REGISTER_DESCRIPTION extends Structure { - public static class ByReference extends DEBUG_REGISTER_DESCRIPTION - implements Structure.ByReference { - } - - public static final List FIELDS = createFieldsOrder("Type", "Flags", "SubregMaster", - "SubregLength", "SubregMask", "SubregShift", "Reserved0"); - - public ULONG Type; - public ULONG Flags; - - public ULONG SubregMaster; - public ULONG SubregLength; - public ULONGLONG SubregMask; - public ULONG SubregShift; - - public ULONG Reserved0; - - @Override - protected List getFieldOrder() { - return FIELDS; - } - } - - public static class DEBUG_VALUE extends Structure { - public static class ByReference extends DEBUG_VALUE implements Structure.ByReference { - } - - public static final List FIELDS = createFieldsOrder("u", "TailOfRawBytes", "Type"); - - public static class UNION extends Union { - public static class ByReference extends UNION implements Structure.ByReference { - } - - public static class INTEGER64 extends Structure { - public static class ByReference extends UNION implements Structure.ByReference { - } - - @SuppressWarnings("hiding") - public static final List FIELDS = createFieldsOrder("I64", "Nat"); - - public ULONGLONG I64; - public BOOL Nat; // Always false for non-Itanium - - @Override - protected List getFieldOrder() { - return FIELDS; - } - } - - public static class I64Parts32 extends Structure { - public static class ByReference extends UNION implements Structure.ByReference { - } - - @SuppressWarnings("hiding") - public static final List FIELDS = createFieldsOrder("LowPart", "HighPart"); - - public ULONG LowPart; - public ULONG HighPart; - - @Override - protected List getFieldOrder() { - return FIELDS; - } - } - - public static class F128Parts64 extends Structure { - public static class ByReference extends UNION implements Structure.ByReference { - } - - @SuppressWarnings("hiding") - public static final List FIELDS = createFieldsOrder("LowPart", "HighPart"); - - public ULONGLONG LowPart; - public LONGLONG HighPart; - - @Override - protected List getFieldOrder() { - return FIELDS; - } - } - - public UCHAR I8; - public USHORT I16; - public ULONG I32; - public INTEGER64 I64; - public float F32; - public double F64; - public byte[] F80Bytes = new byte[10]; - public byte[] F82Bytes = new byte[11]; - public byte[] F128Bytes = new byte[16]; - - public byte[] VI8 = new byte[16]; - public short[] VI16 = new short[8]; - public int[] VI32 = new int[4]; - public long[] VI64 = new long[2]; - - public float[] VF32 = new float[4]; - public double[] VF64 = new double[2]; - - public I64Parts32 I64Parts32; - public F128Parts64 F128Parts64; - - public byte[] RawBytes = new byte[24]; - } - - public UNION u; - public ULONG TailOfRawBytes; - public ULONG Type; - - @Override - protected List getFieldOrder() { - return FIELDS; - } - - protected void doUSetType() { - switch (DebugValueType.values()[Type.intValue()]) { - case INVALID: - u.setType("RawBytes"); - break; - case INT8: - u.setType("I8"); - break; - case INT16: - u.setType("I16"); - break; - case INT32: - u.setType("I32"); - break; - case INT64: - u.setType("I64"); - break; - case FLOAT32: - u.setType("F32"); - break; - case FLOAT64: - u.setType("F64"); - break; - case FLOAT80: - u.setType("F80Bytes"); - break; - case FLOAT82: - u.setType("F82Bytes"); - break; - case FLOAT128: - u.setType("F128Bytes"); - break; - case VECTOR64: - u.setType("VI8"); - break; - case VECTOR128: - u.setType("VI8"); - break; // TODO: Can I activate multiple types? - } - } - - @Override - public void read() { - super.read(); - doUSetType(); - u.read(); - } - - @Override - public void write() { - super.write(); - doUSetType(); - u.write(); - } - - @SuppressWarnings("unchecked") - public T convertTo(Class desiredType) { - if (desiredType != null && desiredType != DebugValue.class && - DebugValueType.getDebugValueTypeForClass(desiredType).ordinal() != Type - .intValue()) { - // TODO: Display value in exception - throw new ClassCastException("debug value is not of the desired type"); - } - switch (DebugValueType.values()[Type.intValue()]) { - case INVALID: - return null; // TODO: Some DebugInvalidWrapper class? - case INT8: - return (T) new DebugInt8Value(u.I8.byteValue()); - case INT16: - return (T) new DebugInt16Value(u.I16.shortValue()); - case INT32: - return (T) new DebugInt32Value(u.I32.intValue()); - case INT64: - return (T) new DebugInt64Value(u.I64.I64.longValue()); - case FLOAT32: - return (T) new DebugFloat32Value(u.F32); - case FLOAT64: - return (T) new DebugFloat64Value(u.F64); - case FLOAT80: - return (T) new DebugFloat80Value(u.F80Bytes); - case FLOAT82: - return (T) new DebugFloat82Value(u.F82Bytes); - case FLOAT128: - return (T) new DebugFloat128Value(u.F128Bytes); - case VECTOR64: - return (T) new DebugVector128Value(u.VI8); - case VECTOR128: - return (T) new DebugVector128Value(u.VI8); - } - throw new AssertionError("INTERNAL: Shouldn't be here"); - } - - public static DEBUG_VALUE fromDebugValue(DebugValue value) { - DEBUG_VALUE result = new DEBUG_VALUE(); - fromDebugValue(result, value); - return result; - } - - public static void fromDebugValue(DEBUG_VALUE into, DebugValue value) { - DebugValueType type = DebugValueType.getDebugValueTypeForClass(value.getClass()); - into.Type = new ULONG(type.ordinal()); - switch (type) { - case INVALID: - break; - case INT8: - DebugInt8Value int8 = (DebugInt8Value) value; - into.u.I8 = new UCHAR(int8.byteValue()); - break; - case INT16: - DebugInt16Value int16 = (DebugInt16Value) value; - into.u.I16 = new USHORT(int16.shortValue()); - break; - case INT32: - DebugInt32Value int32 = (DebugInt32Value) value; - into.u.I32 = new ULONG(int32.intValue()); - break; - case INT64: - DebugInt64Value int64 = (DebugInt64Value) value; - into.u.I64.I64 = new ULONGLONG(int64.longValue()); - break; - case FLOAT32: - DebugFloat32Value float32 = (DebugFloat32Value) value; - into.u.F32 = float32.floatValue(); - break; - case FLOAT64: - DebugFloat64Value float64 = (DebugFloat64Value) value; - into.u.F64 = float64.doubleValue(); - break; - case FLOAT80: - DebugFloat80Value float80 = (DebugFloat80Value) value; - into.u.F80Bytes = float80.bytes(); - break; - case FLOAT82: - DebugFloat82Value float82 = (DebugFloat82Value) value; - into.u.F82Bytes = float82.bytes(); - break; - case FLOAT128: - DebugFloat128Value float128 = (DebugFloat128Value) value; - into.u.F128Bytes = float128.bytes(); - break; - case VECTOR64: - DebugVector64Value vector64 = (DebugVector64Value) value; - into.u.VI8 = vector64.vi4(); // TODO: Copy Into? - break; - case VECTOR128: - DebugVector128Value vector128 = (DebugVector128Value) value; - into.u.VI8 = vector128.vi8(); // TODO: Copy Into? - break; - default: - throw new AssertionError("INTERNAL: Shouldn't be here"); - } - } - } - - public class DEBUG_MODULE_AND_ID extends Structure { - public static class ByReference extends DEBUG_MODULE_AND_ID - implements Structure.ByReference { - } - - public static final List FIELDS = createFieldsOrder("ModuleBase", "Id"); - - public ULONGLONG ModuleBase; - public ULONGLONG Id; - - @Override - protected List getFieldOrder() { - return FIELDS; - } - } - - public class DEBUG_MODULE_PARAMETERS extends Structure { - public static class ByReference extends DEBUG_MODULE_PARAMETERS - implements Structure.ByReference { - } - - public static final List FIELDS = - createFieldsOrder("Base", "Size", "TimeDateStamp", "Checksum", "Flags", "SymbolType", - "ImageNameSize", "ModuleNameSize", "LoadedImageNameSize", "SymbolFileNameSize", - "MappedImageNameSize", "Reserved0", "Reserved1"); - - public ULONGLONG Base; - public ULONG Size; - public ULONG TimeDateStamp; - public ULONG Checksum; - public ULONG Flags; - public ULONG SymbolType; - public ULONG ImageNameSize; - public ULONG ModuleNameSize; - public ULONG LoadedImageNameSize; - public ULONG SymbolFileNameSize; - public ULONG MappedImageNameSize; - public ULONGLONG Reserved0; - public ULONGLONG Reserved1; - - @Override - protected List getFieldOrder() { - return FIELDS; - } - } - - public class DEBUG_SYMBOL_ENTRY extends Structure { - public static class ByReference extends DEBUG_SYMBOL_ENTRY - implements Structure.ByReference { - } - - public static final List FIELDS = createFieldsOrder("ModuleBase", "Offset", "Id", - "Arg64", "Size", "Flags", "TypeId", "NameSize", "Token", "Tag", "Arg32", "Reserved"); - - public ULONGLONG ModuleBase; - public ULONGLONG Offset; - public ULONGLONG Id; - public ULONGLONG Arg64; - public ULONG Size; - public ULONG Flags; - public ULONG TypeId; - public ULONG NameSize; - public ULONG Token; - public ULONG Tag; - public ULONG Arg32; - public ULONG Reserved; - - @Override - protected List getFieldOrder() { - return FIELDS; - } - } - - public class DEBUG_THREAD_BASIC_INFORMATION extends Structure { - public static class ByReference extends DEBUG_THREAD_BASIC_INFORMATION - implements Structure.ByReference { - } - - public static final List FIELDS = - createFieldsOrder("Valid", "ExitStatus", "PriorityClass", "Priority", "CreateTime", - "ExitTime", "KernelTime", "UserTime", "StartOffset", "Affinity"); - - public ULONG Valid; - public ULONG ExitStatus; - public ULONG PriorityClass; - public ULONG Priority; - public ULONGLONG CreateTime; - public ULONGLONG ExitTime; - public ULONGLONG KernelTime; - public ULONGLONG UserTime; - public ULONGLONG StartOffset; - public ULONGLONG Affinity; - - @Override - protected List getFieldOrder() { - return FIELDS; - } - } - - public class DEBUG_STACK_FRAME extends Structure { - public static class ByReference extends DEBUG_STACK_FRAME implements Structure.ByReference { - } - - public static final List FIELDS = - createFieldsOrder("InstructionOffset", "ReturnOffset", "FrameOffset", "StackOffset", - "FuncTableEntry", "Params", "Reserved", "Virtual", "FrameNumber"); - - public ULONGLONG InstructionOffset; - public ULONGLONG ReturnOffset; - public ULONGLONG FrameOffset; - public ULONGLONG StackOffset; - public ULONGLONG FuncTableEntry; - public ULONGLONG[] Params = new ULONGLONG[4]; - public ULONGLONG[] Reserved = new ULONGLONG[6]; - public BOOL Virtual; - public ULONG FrameNumber; - - @Override - protected List getFieldOrder() { - return FIELDS; - } - } - - public class DEBUG_SPECIFIC_FILTER_PARAMETERS extends Structure { - public static class ByReference extends DEBUG_SPECIFIC_FILTER_PARAMETERS - implements Structure.ByReference { - } - - public static final List FIELDS = - createFieldsOrder("ExecutionOption", "ContinueOption", "TextSize", "CommandSize", - "ArgumentSize"); - - public ULONG ExecutionOption; - public ULONG ContinueOption; - public ULONG TextSize; - public ULONG CommandSize; - public ULONG ArgumentSize; - - @Override - protected List getFieldOrder() { - return FIELDS; - } - } - - public class DEBUG_EXCEPTION_FILTER_PARAMETERS extends Structure { - public static class ByReference extends DEBUG_EXCEPTION_FILTER_PARAMETERS - implements Structure.ByReference { - } - - public static final List FIELDS = - createFieldsOrder("ExecutionOption", "ContinueOption", "TextSize", "CommandSize", - "SecondCommandSize", "ExceptionCode"); - - public ULONG ExecutionOption; - public ULONG ContinueOption; - public ULONG TextSize; - public ULONG CommandSize; - public ULONG SecondCommandSize; - public ULONG ExceptionCode; - - @Override - protected List getFieldOrder() { - return FIELDS; - } - } - - public static class DEBUG_CREATE_PROCESS_OPTIONS extends Structure { - public static class ByReference extends DEBUG_CREATE_PROCESS_OPTIONS - implements Structure.ByReference { - } - - public static final List FIELDS = createFieldsOrder( - "CreateFlags", "EngCreateFlags", "VerifierFlags", "Reserved"); - - public ULONG CreateFlags; - public ULONG EngCreateFlags; - public ULONG VerifierFlags; - public ULONG Reserved; - - @Override - protected List getFieldOrder() { - return FIELDS; - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/Kernel32Extra.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/Kernel32Extra.java deleted file mode 100644 index 60f57a0869..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/Kernel32Extra.java +++ /dev/null @@ -1,126 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng; - -import java.util.List; - -import com.sun.jna.*; -import com.sun.jna.platform.win32.BaseTSD.ULONG_PTR; -import com.sun.jna.platform.win32.WinDef; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HANDLE; -import com.sun.jna.win32.StdCallLibrary; -import com.sun.jna.win32.W32APIOptions; - -import agent.dbgeng.jna.dbgeng.WinNTExtra.EXCEPTION_POINTERS; - -public interface Kernel32Extra extends StdCallLibrary { - Kernel32Extra INSTANCE = - Native.loadLibrary("kernel32", Kernel32Extra.class, W32APIOptions.DEFAULT_OPTIONS); - - interface VectoredHandlerCallback extends StdCallCallback { - LONG EXCEPTION_CONTINUE_EXECUTION = new LONG(0xffffffff); - LONG EXCEPTION_CONTINUE_SEARCH = new LONG(0x0); - - LONG invoke(EXCEPTION_POINTERS.ByReference ExceptionInfo); - } - - interface HandlerRoutineCallback extends StdCallCallback { - int CTRL_C_EVENT = 0; - int CTRL_CLOSE_EVENT = 2; - int CTRL_LOGOFF_EVENT = 5; - int CTRL_SHUTDOWN_EVENT = 6; - - boolean invoke(DWORD dwCtrlType); - } - - public static class PROCESSENTRY32W extends Structure { - public static class ByReference extends PROCESSENTRY32W implements Structure.ByReference { - } - - public static final List FIELDS = createFieldsOrder("dwSize", "cntUsage", - "th32ProcessID", "th32DefaultHeapID", "th32ModuleID", "cntThreads", - "th32ParentProcessID", "pcPriClassBase", "dwFlags", "szExeFile"); - - public DWORD dwSize; - public DWORD cntUsage; - public DWORD th32ProcessID; - public ULONG_PTR th32DefaultHeapID; - public DWORD th32ModuleID; - public DWORD cntThreads; - public DWORD th32ParentProcessID; - public DWORD pcPriClassBase; - public DWORD dwFlags; - public char[] szExeFile = new char[WinDef.MAX_PATH]; - - public PROCESSENTRY32W() { - dwSize = new DWORD(size()); - } - - public PROCESSENTRY32W(Pointer p) { - super(p); - read(); - } - - @Override - protected List getFieldOrder() { - return FIELDS; - } - } - - public static class THREADENTRY32 extends Structure { - public static class ByReference extends THREADENTRY32 implements Structure.ByReference { - } - - public static final List FIELDS = createFieldsOrder("dwSize", "cntUsage", - "th32ThreadID", "th32OwnerProcessID", "tpBasePri", "tpDeltaPri", "dwFlags"); - - public DWORD dwSize; - public DWORD cntUsage; - public DWORD th32ThreadID; - public DWORD th32OwnerProcessID; - public LONG tpBasePri; - public LONG tpDeltaPri; - public DWORD dwFlags; - - public THREADENTRY32() { - dwSize = new DWORD(size()); - } - - public THREADENTRY32(Pointer p) { - super(p); - read(); - } - - @Override - protected List getFieldOrder() { - return FIELDS; - } - } - - Pointer AddVectoredExceptionHandler(ULONG FirstHandler, - Kernel32Extra.VectoredHandlerCallback VectoredHandler); - - boolean SetConsoleCtrlHandler(HandlerRoutineCallback HandlerRoutine, boolean Add); - - boolean Process32FirstW(HANDLE hSnapshot, PROCESSENTRY32W lppe); - - boolean Process32NextW(HANDLE hSnapshot, PROCESSENTRY32W lppe); - - boolean Thread32First(HANDLE hSnapshot, THREADENTRY32 lpte); - - boolean Thread32Next(HANDLE hSnapshot, THREADENTRY32 lpte); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/ToolhelpUtil.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/ToolhelpUtil.java deleted file mode 100644 index be625d1fbe..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/ToolhelpUtil.java +++ /dev/null @@ -1,107 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng; - -import java.util.ArrayList; -import java.util.List; -import java.util.function.BiFunction; -import java.util.function.Supplier; - -import com.sun.jna.platform.win32.*; -import com.sun.jna.platform.win32.WinDef.DWORD; -import com.sun.jna.platform.win32.WinNT.HANDLE; - -import agent.dbgeng.dbgeng.DbgEng; -import agent.dbgeng.dbgeng.DbgEng.OpaqueCleanable; -import agent.dbgeng.jna.dbgeng.Kernel32Extra.PROCESSENTRY32W; -import agent.dbgeng.jna.dbgeng.Kernel32Extra.THREADENTRY32; -import ghidra.comm.util.BitmaskSet; -import ghidra.comm.util.BitmaskUniverse; - -public class ToolhelpUtil { - public static class Snapshot { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final HANDLE handle; - - private Snapshot(HANDLE handle) { - this.cleanable = DbgEng.releaseWhenPhantom(this, handle); - this.handle = handle; - } - - protected List getItems(Supplier newStruct, BiFunction first, - BiFunction next) { - List items = new ArrayList<>(); - - T entry = newStruct.get(); - for (boolean has = first.apply(handle, entry); has; has = next.apply(handle, entry)) { - items.add(entry); - entry = newStruct.get(); - } - - int lastError = Kernel32.INSTANCE.GetLastError(); - if (lastError != W32Errors.ERROR_SUCCESS && - lastError != W32Errors.ERROR_NO_MORE_FILES) { - throw new Win32Exception(lastError); - } - - return items; - } - - public List getProcesses() { - return getItems(PROCESSENTRY32W::new, Kernel32Extra.INSTANCE::Process32FirstW, - Kernel32Extra.INSTANCE::Process32NextW); - } - - public List getThreads() { - return getItems(THREADENTRY32::new, Kernel32Extra.INSTANCE::Thread32First, - Kernel32Extra.INSTANCE::Thread32Next); - } - } - - public static enum SnapshotFlags implements BitmaskUniverse { - HEAPLIST(Tlhelp32.TH32CS_SNAPHEAPLIST), // - PROCESS(Tlhelp32.TH32CS_SNAPPROCESS), // - THREAD(Tlhelp32.TH32CS_SNAPTHREAD), // - MODULE(Tlhelp32.TH32CS_SNAPMODULE), // - MODULE32(Tlhelp32.TH32CS_SNAPMODULE32), // - ALL(Tlhelp32.TH32CS_SNAPALL), // - INHERIT(Tlhelp32.TH32CS_INHERIT), // - ; - - SnapshotFlags(DWORD mask) { - this.mask = mask.intValue(); - } - - int mask; - - @Override - public long getMask() { - return mask; - } - } - - public static Snapshot createSnapshot(BitmaskSet flags, int processId) { - DWORD dwFlags = new DWORD(flags.getBitmask()); - DWORD dwPID = new DWORD(processId); - HANDLE hSnap = Kernel32.INSTANCE.CreateToolhelp32Snapshot(dwFlags, dwPID); - if (hSnap == null) { - throw new Win32Exception(Kernel32.INSTANCE.GetLastError()); - } - - return new Snapshot(hSnap); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/UnknownWithUtils.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/UnknownWithUtils.java deleted file mode 100644 index 41a0d6b02e..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/UnknownWithUtils.java +++ /dev/null @@ -1,47 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.platform.win32.COM.Unknown; - -public class UnknownWithUtils extends Unknown { - public static interface VTableIndex { - int getIndex(); - - public static & VTableIndex> int follow(Class prev) { - I[] all = prev.getEnumConstants(); - int start = all[0].getIndex() - all[0].ordinal(); - return all.length + start; - } - } - - public UnknownWithUtils() { - } - - public UnknownWithUtils(Pointer pvInstance) { - super(pvInstance); - } - - protected HRESULT _invokeHR(VTableIndex idx, Object... args) { - /*if (idx != IDebugClient.VTIndices.DISPATCH_CALLBACKS && - idx != IDebugControl.VTIndices.GET_EXECUTION_STATUS) { - Msg.info(this, Thread.currentThread() + " invoked " + idx + Arrays.asList(args)); - }*/ - return (HRESULT) this._invokeNativeObject(idx.getIndex(), args, HRESULT.class); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/WinNTExtra.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/WinNTExtra.java deleted file mode 100644 index 2f47cbbdfd..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/WinNTExtra.java +++ /dev/null @@ -1,281 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng; - -import java.util.List; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.BaseTSD.ULONG_PTR; -import com.sun.jna.platform.win32.WinDef.*; - -public class WinNTExtra { - public static enum Machine { - IMAGE_FILE_MACHINE_UNKNOWN(0, "Unknown"), // - IMAGE_FILE_MACHINE_I386(0x014c, "x86"), // - IMAGE_FILE_MACHINE_ARM(0x01c0, "ARM"), // - IMAGE_FILE_MACHINE_IA64(0x0200, "Itanium"), // - IMAGE_FILE_MACHINE_AMD64(0x8664, "AMD64 (K8)"), // - IMAGE_FILE_MACHINE_EBC(0x0EBC, "EFI"), // - ; - - public static Machine getByNumber(int val) { - for (Machine m : Machine.values()) { - if (m.val == val) { - return m; - } - } - return null; - } - - Machine(int val, String description) { - this.val = val; - this.description = description; - } - - public final int val; - public final String description; - } - - public static class M128A extends Structure { - public static class ByReference extends M128A implements Structure.ByReference { - } - - public static final List FIELDS = createFieldsOrder("Low", "High"); - - public ULONGLONG Low; - public LONGLONG High; - - @Override - protected List getFieldOrder() { - return FIELDS; - } - } - - public static class CONTEXT_AMD64 extends Structure { - public static class ByReference extends CONTEXT_AMD64 implements Structure.ByReference { - } - - public static final List FIELDS = createFieldsOrder( - - "P1Home", "P2Home", "P3Home", "P4Home", "P5Home", "P6Home", - - "ContextFlags", "MxCsr", - - "SegCs", "SegDs", "SegEs", "SegFs", "SegGs", "SegSs", "EFlags", - - "Dr0", "Dr1", "Dr2", "Dr3", "Dr6", "Dr7", - - "Rax", "Rcx", "Rdx", "Rbx", "Rsp", "Rbp", "Rsi", "Rdi", "R8", "R9", "R10", "R11", "R12", - "R13", "R14", "R15", - - "Rip", - - "Header", "Legacy", "Xmm0", "Xmm1", "Xmm2", "Xmm3", "Xmm4", "Xmm5", "Xmm6", "Xmm7", - "Xmm8", "Xmm9", "Xmm10", "Xmm11", "Xmm12", "Xmm13", "Xmm14", "Xmm15", - - "VectorRegister", "VectorControl", - - "DebugControl", "LastBranchToRip", "LastBranchFromRip", "LastExceptionToRip", - "LastExceptionFromRip"); - - public DWORDLONG P1Home; - public DWORDLONG P2Home; - public DWORDLONG P3Home; - public DWORDLONG P4Home; - public DWORDLONG P5Home; - public DWORDLONG P6Home; - - public DWORD ContextFlags; - public DWORD MxCsr; - - public WORD SegCs; - public WORD SegDs; - public WORD SegEs; - public WORD SegFs; - public WORD SegGs; - public WORD SegSs; - public DWORD EFlags; - - public DWORDLONG Dr0; - public DWORDLONG Dr1; - public DWORDLONG Dr2; - public DWORDLONG Dr3; - public DWORDLONG Dr6; - public DWORDLONG Dr7; - - public DWORDLONG Rax; - public DWORDLONG Rcx; - public DWORDLONG Rdx; - public DWORDLONG Rbx; - public DWORDLONG Rsp; - public DWORDLONG Rbp; - public DWORDLONG Rsi; - public DWORDLONG Rdi; - public DWORDLONG R8; - public DWORDLONG R9; - public DWORDLONG R10; - public DWORDLONG R11; - public DWORDLONG R12; - public DWORDLONG R13; - public DWORDLONG R14; - public DWORDLONG R15; - - public DWORDLONG Rip; - - public M128A[] Header = new M128A[2]; - public M128A[] Legacy = new M128A[8]; - public M128A Xmm0; - public M128A Xmm1; - public M128A Xmm2; - public M128A Xmm3; - public M128A Xmm4; - public M128A Xmm5; - public M128A Xmm6; - public M128A Xmm7; - public M128A Xmm8; - public M128A Xmm9; - public M128A Xmm10; - public M128A Xmm11; - public M128A Xmm12; - public M128A Xmm13; - public M128A Xmm14; - public M128A Xmm15; - - public M128A[] VectorRegister = new M128A[26]; - public DWORDLONG VectorControl; - - public DWORDLONG DebugControl; - public DWORDLONG LastBranchToRip; - public DWORDLONG LastBranchFromRip; - public DWORDLONG LastExceptionToRip; - public DWORDLONG LastExceptionFromRip; - - @Override - protected List getFieldOrder() { - return FIELDS; - } - } - - public static class EXCEPTION_RECORD extends Structure { - public static class ByReference extends EXCEPTION_RECORD implements Structure.ByReference { - } - - public static final List FIELDS = createFieldsOrder("ExceptionCode", - "ExceptionFlags", "ExceptionRecord", "ExceptionAddress", "NumberParameters", - "__unusedAlignment", "ExceptionInformation"); - - public DWORD ExceptionCode; - public DWORD ExceptionFlags; - public EXCEPTION_RECORD.ByReference ExceptionRecord; - public Pointer ExceptionAddress; - public DWORD NumberParameters; - public ULONG_PTR ExceptionInformation[] = new ULONG_PTR[15]; - - @Override - protected List getFieldOrder() { - return FIELDS; - } - } - - public static class EXCEPTION_RECORD32 extends Structure { - public static class ByReference extends EXCEPTION_RECORD64 - implements Structure.ByReference { - } - - public static final List FIELDS = createFieldsOrder("ExceptionCode", - "ExceptionFlags", "ExceptionRecord", "ExceptionAddress", "NumberParameters", - "__unusedAlignment", "ExceptionInformation"); - - public DWORD ExceptionCode; - public DWORD ExceptionFlags; - public DWORD ExceptionRecord; - public DWORD ExceptionAddress; - public DWORD NumberParameters; - public DWORD __unusedAlignment; - public DWORD ExceptionInformation[] = new DWORD[15]; - - @Override - protected List getFieldOrder() { - return FIELDS; - } - } - - public static class EXCEPTION_RECORD64 extends Structure { - public static class ByReference extends EXCEPTION_RECORD64 - implements Structure.ByReference { - } - - public static final List FIELDS = createFieldsOrder("ExceptionCode", - "ExceptionFlags", "ExceptionRecord", "ExceptionAddress", "NumberParameters", - "__unusedAlignment", "ExceptionInformation"); - - public DWORD ExceptionCode; - public DWORD ExceptionFlags; - public DWORDLONG ExceptionRecord; - public DWORDLONG ExceptionAddress; - public DWORD NumberParameters; - public DWORD __unusedAlignment; - public DWORDLONG ExceptionInformation[] = new DWORDLONG[15]; - - @Override - protected List getFieldOrder() { - return FIELDS; - } - } - - public static class EXCEPTION_POINTERS extends Structure { - public static class ByReference extends EXCEPTION_POINTERS - implements Structure.ByReference { - } - - public static final List FIELDS = - createFieldsOrder("ExceptionRecord", "ContextRecord"); - - public EXCEPTION_RECORD.ByReference ExceptionRecord; - public CONTEXT_AMD64.ByReference ContextRecord; // TODO: This should be fine for now - - @Override - protected List getFieldOrder() { - return FIELDS; - } - } - - public static class MEMORY_BASIC_INFORMATION64 extends Structure { - public static class ByReference extends MEMORY_BASIC_INFORMATION64 - implements Structure.ByReference { - } - - public static final List FIELDS = - createFieldsOrder("BaseAddress", "AllocationBase", "AllocationProtect", "__alignment1", - "RegionSize", "State", "Protect", "Type", "__alignment2"); - - public ULONGLONG BaseAddress; - public ULONGLONG AllocationBase; - public DWORD AllocationProtect; - public DWORD __alignment1; - public ULONGLONG RegionSize; - public DWORD State; - public DWORD Protect; - public DWORD Type; - public DWORD __alignment2; - - @Override - protected List getFieldOrder() { - return FIELDS; - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/advanced/IDebugAdvanced.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/advanced/IDebugAdvanced.java deleted file mode 100644 index 666b10eb20..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/advanced/IDebugAdvanced.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.advanced; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgeng.jna.dbgeng.UnknownWithUtils.VTableIndex; - -import com.sun.jna.platform.win32.COM.IUnknown; - -public interface IDebugAdvanced extends IUnknown { - final IID IID_IDEBUG_ADVANCED = new IID("f2df5f53-071f-47bd-9de6-5734c3fed689"); - - enum VTIndices implements VTableIndex { - GET_THREAD_CONTEXT, // - SET_THREAD_CONTEXT, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT GetThreadContext(Pointer Context, ULONG ContextSize); - - HRESULT SetThreadContext(Pointer Context, ULONG ContextSize); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/advanced/IDebugAdvanced2.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/advanced/IDebugAdvanced2.java deleted file mode 100644 index 900fb5c531..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/advanced/IDebugAdvanced2.java +++ /dev/null @@ -1,60 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.advanced; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgeng.jna.dbgeng.UnknownWithUtils.VTableIndex; - -public interface IDebugAdvanced2 extends IDebugAdvanced { - final IID IID_IDEBUG_ADVANCED2 = new IID("716d14c9-119b-4ba5-af1f-0890e672416a"); - - enum VTIndices2 implements VTableIndex { - REQUEST, // - GET_SOURCE_FILE_INFORMATION, // - FIND_SOURCE_FILE_AND_TOKEN, // - GET_SYMBOL_INFORMATION, // - GET_SYSTEM_OBJECT_INFORMATION, // - ; - - static int start = VTableIndex.follow(VTIndices.class); - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT Request(ULONG Request, Pointer InBuffer, ULONG InBuffserSize, Pointer OutBuffer, - ULONG OutBufferSize, ULONGByReference OutSize); - - HRESULT GetSourceFileInformation(ULONG Which, String SourceFile, ULONGLONG Arg64, ULONG Arg32, - Pointer Buffer, ULONG BufferSize, ULONGByReference InfoSize); - - HRESULT FindSourceFileAndToken(ULONG StartElement, ULONGLONG ModAddr, String File, ULONG Flags, - Pointer FileToken, ULONG FileTokenSize, ULONGByReference FoundElement, byte[] Buffer, - ULONG BufferSize, ULONGByReference FoundSize); - - HRESULT GetSymbolInformation(ULONG Which, ULONGLONG Arg64, ULONG Arg32, Pointer Buffer, - ULONG BufferSize, ULONGByReference InfoSize, byte[] StringBuffer, - ULONG StringBufferSize, ULONGByReference StringSize); - - HRESULT GetSystemObjectInformation(ULONG Which, ULONGLONG Arg64, ULONG Arg32, Pointer Buffer, - ULONG BufferSize, ULONGByReference InfoSize); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/advanced/IDebugAdvanced3.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/advanced/IDebugAdvanced3.java deleted file mode 100644 index 3a5a3ac18a..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/advanced/IDebugAdvanced3.java +++ /dev/null @@ -1,53 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.advanced; - -import com.sun.jna.Pointer; -import com.sun.jna.WString; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgeng.jna.dbgeng.UnknownWithUtils.VTableIndex; - -public interface IDebugAdvanced3 extends IDebugAdvanced2 { - final IID IID_IDEBUG_ADVANCED3 = new IID("cba4abb4-84c4-444d-87ca-a04e13286739"); - - enum VTIndices3 implements VTableIndex { - GET_SOURCE_FILE_INFORMATION_WIDE, // - FIND_SOURCE_FILE_AND_TOKEN_WIDE, // - GET_SYMBOL_INFORMATION_WIDE, // - ; - - static int start = VTableIndex.follow(VTIndices2.class); - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT GetSourceFileInformationWide(ULONG Which, WString SourceFile, ULONGLONG Arg64, - ULONG Arg32, Pointer Buffer, ULONG BufferSize, ULONGByReference InfoSize); - - HRESULT FindSourceFileAndTokenWide(ULONG StartElement, ULONGLONG ModAddr, String File, - ULONG Flags, Pointer FileToken, ULONG FileTokenSize, ULONGByReference FoundElement, - char[] Buffer, ULONG BufferSize, ULONGByReference FoundSize); - - HRESULT GetSymbolInformationWide(ULONG Which, ULONGLONG Arg64, ULONG Arg32, Pointer Buffer, - ULONG BufferSize, ULONGByReference InfoSize, char[] StringBuffer, - ULONG StringBufferSize, ULONGByReference StringSize); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/advanced/WrapIDebugAdvanced.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/advanced/WrapIDebugAdvanced.java deleted file mode 100644 index e693f964c6..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/advanced/WrapIDebugAdvanced.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.advanced; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgeng.jna.dbgeng.UnknownWithUtils; - -public class WrapIDebugAdvanced extends UnknownWithUtils implements IDebugAdvanced { - public static class ByReference extends WrapIDebugAdvanced implements Structure.ByReference { - } - - public WrapIDebugAdvanced() { - } - - public WrapIDebugAdvanced(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT GetThreadContext(Pointer Context, ULONG ContextSize) { - return _invokeHR(VTIndices.GET_THREAD_CONTEXT, getPointer(), Context, ContextSize); - } - - @Override - public HRESULT SetThreadContext(Pointer Context, ULONG ContextSize) { - return _invokeHR(VTIndices.SET_THREAD_CONTEXT, getPointer(), Context, ContextSize); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/advanced/WrapIDebugAdvanced2.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/advanced/WrapIDebugAdvanced2.java deleted file mode 100644 index 4c70d828a9..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/advanced/WrapIDebugAdvanced2.java +++ /dev/null @@ -1,70 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.advanced; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -public class WrapIDebugAdvanced2 extends WrapIDebugAdvanced implements IDebugAdvanced2 { - public static class ByReference extends WrapIDebugAdvanced2 implements Structure.ByReference { - } - - public WrapIDebugAdvanced2() { - } - - public WrapIDebugAdvanced2(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT Request(ULONG Request, Pointer InBuffer, ULONG InBuffserSize, Pointer OutBuffer, - ULONG OutBufferSize, ULONGByReference OutSize) { - return _invokeHR(VTIndices2.REQUEST, getPointer(), Request, InBuffer, InBuffserSize, - OutBuffer, OutBufferSize, OutSize); - } - - @Override - public HRESULT GetSourceFileInformation(ULONG Which, String SourceFile, ULONGLONG Arg64, - ULONG Arg32, Pointer Buffer, ULONG BufferSize, ULONGByReference InfoSize) { - return _invokeHR(VTIndices2.GET_SOURCE_FILE_INFORMATION, getPointer(), Which, SourceFile, - Arg64, Arg32, Buffer, BufferSize, InfoSize); - } - - @Override - public HRESULT FindSourceFileAndToken(ULONG StartElement, ULONGLONG ModAddr, String File, - ULONG Flags, Pointer FileToken, ULONG FileTokenSize, ULONGByReference FoundElement, - byte[] Buffer, ULONG BufferSize, ULONGByReference FoundSize) { - return _invokeHR(VTIndices2.FIND_SOURCE_FILE_AND_TOKEN, getPointer(), StartElement, ModAddr, - File, Flags, FileToken, FileTokenSize, FoundElement, Buffer, BufferSize, FoundSize); - } - - @Override - public HRESULT GetSymbolInformation(ULONG Which, ULONGLONG Arg64, ULONG Arg32, Pointer Buffer, - ULONG BufferSize, ULONGByReference InfoSize, byte[] StringBuffer, - ULONG StringBufferSize, ULONGByReference StringSize) { - return _invokeHR(VTIndices2.GET_SYMBOL_INFORMATION, getPointer(), Which, Arg64, Arg32, - Buffer, BufferSize, InfoSize, StringBuffer, StringBufferSize, StringSize); - } - - @Override - public HRESULT GetSystemObjectInformation(ULONG Which, ULONGLONG Arg64, ULONG Arg32, - Pointer Buffer, ULONG BufferSize, ULONGByReference InfoSize) { - return _invokeHR(VTIndices2.GET_SYSTEM_OBJECT_INFORMATION, getPointer(), Which, Arg64, - Arg32, Buffer, BufferSize, InfoSize); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/advanced/WrapIDebugAdvanced3.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/advanced/WrapIDebugAdvanced3.java deleted file mode 100644 index bf80daa081..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/advanced/WrapIDebugAdvanced3.java +++ /dev/null @@ -1,56 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.advanced; - -import com.sun.jna.*; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -public class WrapIDebugAdvanced3 extends WrapIDebugAdvanced2 implements IDebugAdvanced3 { - public static class ByReference extends WrapIDebugAdvanced3 implements Structure.ByReference { - } - - public WrapIDebugAdvanced3() { - } - - public WrapIDebugAdvanced3(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT GetSourceFileInformationWide(ULONG Which, WString SourceFile, ULONGLONG Arg64, - ULONG Arg32, Pointer Buffer, ULONG BufferSize, ULONGByReference InfoSize) { - return _invokeHR(VTIndices3.GET_SOURCE_FILE_INFORMATION_WIDE, getPointer(), Which, - SourceFile, Arg64, Arg32, Buffer, BufferSize, InfoSize); - } - - @Override - public HRESULT FindSourceFileAndTokenWide(ULONG StartElement, ULONGLONG ModAddr, String File, - ULONG Flags, Pointer FileToken, ULONG FileTokenSize, ULONGByReference FoundElement, - char[] Buffer, ULONG BufferSize, ULONGByReference FoundSize) { - return _invokeHR(VTIndices3.FIND_SOURCE_FILE_AND_TOKEN_WIDE, getPointer(), StartElement, - ModAddr, File, Flags, FileToken, FileTokenSize, FoundElement, Buffer, BufferSize, - FoundSize); - } - - @Override - public HRESULT GetSymbolInformationWide(ULONG Which, ULONGLONG Arg64, ULONG Arg32, - Pointer Buffer, ULONG BufferSize, ULONGByReference InfoSize, char[] StringBuffer, - ULONG StringBufferSize, ULONGByReference StringSize) { - return _invokeHR(VTIndices3.GET_SYMBOL_INFORMATION_WIDE, getPointer(), Which, Arg64, Arg32, - Buffer, BufferSize, InfoSize, StringBuffer, StringBufferSize, StringSize); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/breakpoint/IDebugBreakpoint.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/breakpoint/IDebugBreakpoint.java deleted file mode 100644 index 7f45c72892..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/breakpoint/IDebugBreakpoint.java +++ /dev/null @@ -1,105 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.breakpoint; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.platform.win32.COM.IUnknown; - -import agent.dbgeng.jna.dbgeng.DbgEngNative.DEBUG_BREAKPOINT_PARAMETERS; -import agent.dbgeng.jna.dbgeng.UnknownWithUtils.VTableIndex; - -public interface IDebugBreakpoint extends IUnknown { - final IID IID_IDEBUG_BREAKPOINT = new IID("5bd9d474-5975-423a-b88b-65a8e7110e65"); - - enum VTIndices implements VTableIndex { - GET_ID, // - GET_TYPE, // - GET_ADDER, // - GET_FLAGS, // - ADD_FLAGS, // - REMOVE_FLAGS, // - SET_FLAGS, // - GET_OFFSET, // - SET_OFFSET, // - GET_DATA_PARAMETERS, // - SET_DATA_PARAMETERS, // - GET_PASS_COUNT, // - SET_PASS_COUNT, // - GET_CURRENT_PASS_COUNT, // - GET_MATCH_THREAD_ID, // - SET_MATCH_THREAD_ID, // - GET_COMMAND, // - SET_COMMAND, // - GET_OFFSET_EXPRESSION, // - SET_OFFSET_EXPRESSION, // - GET_PARAMETERS, // - ; - - public int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT GetId(ULONGByReference Id); - - HRESULT GetType(ULONGByReference BreakType, ULONGByReference ProcType); - - HRESULT GetAdder(Pointer Adder); - - HRESULT GetFlags(ULONGByReference Flags); - - HRESULT AddFlags(ULONG Flags); - - HRESULT RemoveFlags(ULONG Flags); - - HRESULT SetFlags(ULONG Flags); - - HRESULT GetOffset(ULONGLONGByReference Offset); - - HRESULT SetOffset(ULONGLONG Offset); - - HRESULT GetDataParameters(ULONGByReference Size, ULONGByReference AcessType); - - HRESULT SetDataParameters(ULONG Size, ULONG AccessType); - - HRESULT GetPassCount(ULONGByReference Count); - - HRESULT SetPassCount(ULONG Count); - - HRESULT GetCurrentPassCount(ULONGByReference Count); - - HRESULT GetMatchThreadId(ULONGByReference Id); - - HRESULT SetMatchThreadId(ULONG Thread); - - HRESULT GetCommand(byte[] Buffer, ULONG BufferSize, ULONGByReference CommandSize); - - HRESULT SetCommand(String Command); - - HRESULT GetOffsetExpression(byte[] Buffer, ULONG BufferSize, ULONGByReference ExpressionSize); - - HRESULT SetOffsetExpression(String Expression); - - HRESULT GetParameters(DEBUG_BREAKPOINT_PARAMETERS.ByReference Params); - - Pointer getPointer(); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/breakpoint/IDebugBreakpoint2.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/breakpoint/IDebugBreakpoint2.java deleted file mode 100644 index 3671586ae0..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/breakpoint/IDebugBreakpoint2.java +++ /dev/null @@ -1,52 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.breakpoint; - -import com.sun.jna.WString; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinDef.ULONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgeng.jna.dbgeng.UnknownWithUtils.VTableIndex; - -public interface IDebugBreakpoint2 extends IDebugBreakpoint { - final IID IID_IDEBUG_BREAKPOINT2 = new IID("1b278d20-79f2-426e-a3f9-c1ddf375d48e"); - - enum VTIndices2 implements VTableIndex { - GET_COMMAND_WIDE, // - SET_COMMAND_WIDE, // - GET_OFFSET_EXPRESSION_WIDE, // - SET_OFFSET_EXPRESSION_WIDE, // - ; - - public int start = VTableIndex.follow(VTIndices.class); - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT GetCommandWide(char[] Buffer, ULONG BufferSize, ULONGByReference CommandSize); - - HRESULT SetComamndWide(WString Command); - - HRESULT GetOffsetExpressionWide(char[] Buffer, ULONG BufferSize, - ULONGByReference ExpressionSize); - - HRESULT SetOffsetExpressionWide(WString Expression); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/breakpoint/IDebugBreakpoint3.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/breakpoint/IDebugBreakpoint3.java deleted file mode 100644 index 14d2403813..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/breakpoint/IDebugBreakpoint3.java +++ /dev/null @@ -1,40 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.breakpoint; - -import com.sun.jna.platform.win32.Guid.GUID; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgeng.jna.dbgeng.UnknownWithUtils.VTableIndex; - -public interface IDebugBreakpoint3 extends IDebugBreakpoint2 { - final IID IID_IDEBUG_BREAKPOINT3 = new IID("38f5c249-b448-43bb-9835-579d4ec02249"); - - enum VTIndices3 implements VTableIndex { - GET_GUID, // - ; - - static int start = VTableIndex.follow(VTIndices2.class); - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT GetGuid(GUID.ByReference Guid); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/breakpoint/WrapIDebugBreakpoint.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/breakpoint/WrapIDebugBreakpoint.java deleted file mode 100644 index dbfba1d2ce..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/breakpoint/WrapIDebugBreakpoint.java +++ /dev/null @@ -1,143 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.breakpoint; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgeng.jna.dbgeng.UnknownWithUtils; -import agent.dbgeng.jna.dbgeng.DbgEngNative.DEBUG_BREAKPOINT_PARAMETERS; - -public class WrapIDebugBreakpoint extends UnknownWithUtils implements IDebugBreakpoint { - public static class ByReference extends WrapIDebugBreakpoint implements Structure.ByReference { - } - - public WrapIDebugBreakpoint() { - } - - public WrapIDebugBreakpoint(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT GetId(ULONGByReference Id) { - return _invokeHR(VTIndices.GET_ID, getPointer(), Id); - } - - @Override - public HRESULT GetType(ULONGByReference BreakType, ULONGByReference ProcType) { - return _invokeHR(VTIndices.GET_TYPE, getPointer(), BreakType, ProcType); - } - - @Override - public HRESULT GetAdder(Pointer Adder) { - return _invokeHR(VTIndices.GET_ADDER, getPointer(), Adder); - } - - @Override - public HRESULT GetFlags(ULONGByReference Flags) { - return _invokeHR(VTIndices.GET_FLAGS, getPointer(), Flags); - } - - @Override - public HRESULT AddFlags(ULONG Flags) { - return _invokeHR(VTIndices.ADD_FLAGS, getPointer(), Flags); - } - - @Override - public HRESULT RemoveFlags(ULONG Flags) { - return _invokeHR(VTIndices.REMOVE_FLAGS, getPointer(), Flags); - } - - @Override - public HRESULT SetFlags(ULONG Flags) { - return _invokeHR(VTIndices.SET_FLAGS, getPointer(), Flags); - } - - @Override - public HRESULT GetOffset(ULONGLONGByReference Offset) { - return _invokeHR(VTIndices.GET_OFFSET, getPointer(), Offset); - } - - @Override - public HRESULT SetOffset(ULONGLONG Offset) { - return _invokeHR(VTIndices.SET_OFFSET, getPointer(), Offset); - } - - @Override - public HRESULT GetDataParameters(ULONGByReference Size, ULONGByReference AccessType) { - return _invokeHR(VTIndices.GET_DATA_PARAMETERS, getPointer(), Size, AccessType); - } - - @Override - public HRESULT SetDataParameters(ULONG Size, ULONG AccessType) { - return _invokeHR(VTIndices.SET_DATA_PARAMETERS, getPointer(), Size, AccessType); - } - - @Override - public HRESULT GetPassCount(ULONGByReference Count) { - return _invokeHR(VTIndices.GET_PASS_COUNT, getPointer(), Count); - } - - @Override - public HRESULT SetPassCount(ULONG Count) { - return _invokeHR(VTIndices.SET_PASS_COUNT, getPointer(), Count); - } - - @Override - public HRESULT GetCurrentPassCount(ULONGByReference Count) { - return _invokeHR(VTIndices.GET_CURRENT_PASS_COUNT, getPointer(), Count); - } - - @Override - public HRESULT GetMatchThreadId(ULONGByReference Id) { - return _invokeHR(VTIndices.GET_MATCH_THREAD_ID, getPointer(), Id); - } - - @Override - public HRESULT SetMatchThreadId(ULONG Thread) { - return _invokeHR(VTIndices.SET_MATCH_THREAD_ID, getPointer(), Thread); - } - - @Override - public HRESULT GetCommand(byte[] Buffer, ULONG BufferSize, ULONGByReference CommandSize) { - return _invokeHR(VTIndices.GET_COMMAND, getPointer(), Buffer, BufferSize, CommandSize); - } - - @Override - public HRESULT SetCommand(String Command) { - return _invokeHR(VTIndices.SET_COMMAND, getPointer(), Command); - } - - @Override - public HRESULT GetOffsetExpression(byte[] Buffer, ULONG BufferSize, - ULONGByReference ExpressionSize) { - return _invokeHR(VTIndices.GET_OFFSET_EXPRESSION, getPointer(), Buffer, BufferSize, - ExpressionSize); - } - - @Override - public HRESULT SetOffsetExpression(String Expression) { - return _invokeHR(VTIndices.SET_OFFSET_EXPRESSION, getPointer(), Expression); - } - - @Override - public HRESULT GetParameters(DEBUG_BREAKPOINT_PARAMETERS.ByReference Params) { - return _invokeHR(VTIndices.GET_PARAMETERS, getPointer(), Params); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/breakpoint/WrapIDebugBreakpoint2.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/breakpoint/WrapIDebugBreakpoint2.java deleted file mode 100644 index e68cd80426..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/breakpoint/WrapIDebugBreakpoint2.java +++ /dev/null @@ -1,56 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.breakpoint; - -import com.sun.jna.*; -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinDef.ULONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -public class WrapIDebugBreakpoint2 extends WrapIDebugBreakpoint implements IDebugBreakpoint2 { - public static class ByReference extends WrapIDebugBreakpoint2 implements Structure.ByReference { - } - - public WrapIDebugBreakpoint2() { - } - - public WrapIDebugBreakpoint2(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT GetCommandWide(char[] Buffer, ULONG BufferSize, ULONGByReference CommandSize) { - return _invokeHR(VTIndices2.GET_COMMAND_WIDE, getPointer(), Buffer, BufferSize, - CommandSize); - } - - @Override - public HRESULT SetComamndWide(WString Command) { - return _invokeHR(VTIndices2.SET_COMMAND_WIDE, getPointer(), Command); - } - - @Override - public HRESULT GetOffsetExpressionWide(char[] Buffer, ULONG BufferSize, - ULONGByReference ExpressionSize) { - return _invokeHR(VTIndices2.GET_OFFSET_EXPRESSION_WIDE, getPointer(), Buffer, BufferSize, - ExpressionSize); - } - - @Override - public HRESULT SetOffsetExpressionWide(WString Expression) { - return _invokeHR(VTIndices2.SET_OFFSET_EXPRESSION_WIDE, getPointer(), Expression); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/breakpoint/WrapIDebugBreakpoint3.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/breakpoint/WrapIDebugBreakpoint3.java deleted file mode 100644 index f4f0b7b6e3..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/breakpoint/WrapIDebugBreakpoint3.java +++ /dev/null @@ -1,38 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.breakpoint; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.Guid.GUID; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -public class WrapIDebugBreakpoint3 extends WrapIDebugBreakpoint2 implements IDebugBreakpoint3 { - public static class ByReference extends WrapIDebugBreakpoint3 implements Structure.ByReference { - } - - public WrapIDebugBreakpoint3() { - } - - public WrapIDebugBreakpoint3(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT GetGuid(GUID.ByReference Guid) { - return _invokeHR(VTIndices3.GET_GUID, getPointer(), Guid); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/IDebugClient.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/IDebugClient.java deleted file mode 100644 index 7fab436858..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/IDebugClient.java +++ /dev/null @@ -1,184 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.client; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.platform.win32.COM.IUnknown; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgeng.jna.dbgeng.UnknownWithUtils.VTableIndex; -import agent.dbgeng.jna.dbgeng.event.IDebugEventCallbacks; -import agent.dbgeng.jna.dbgeng.io.IDebugInputCallbacks; -import agent.dbgeng.jna.dbgeng.io.IDebugOutputCallbacks; - -public interface IDebugClient extends IUnknown { - final IID IID_IDEBUG_CLIENT = new IID("27fe5639-8407-4f47-8364-ee118fb08ac8"); - - enum VTIndices implements VTableIndex { - ATTACH_KERNEL, // - GET_KERNEL_CONNECTION_OPTIONS, // - SET_KERNEL_CONNECTION_OPTIONS, // - START_PROCESS_SERVER, // - CONNECT_PROCESS_SERVER, // - DISCONNECT_PROCESS_SERVER, // - GET_RUNNING_PROCESS_SYSTEM_IDS, // - GET_RUNNING_PROCESS_SYSTEM_ID_BY_EXECUTABLE_NAME, // - GET_RUNNING_PROCESS_DESCRIPTION, // - ATTACH_PROCESS, // - CREATE_PROCESS, // - CREATE_PROCESS_AND_ATTACH, // - GET_PROCESS_OPTIONS, // - ADD_PROCESS_OPTIONS, // - REMOVE_PROCESS_OPTIONS, // - SET_PROCESS_OPTIONS, // - OPEN_DUMP_FILE, // - WRITE_DUMP_FILE, // - CONNECTION_SESSION, // - START_SERVER, // - OUTPUT_SERVERS, // - TERMINATE_PROCESSES, // - DETACH_PROCESSES, // - END_SESSION, // - GET_EXIT_CODE, // - DISPATCH_CALLBACKS, // - EXIT_DISPATCH, // - CREATE_CLIENT, // - GET_INPUT_CALLBACKS, // - SET_INPUT_CALLBACKS, // - GET_OUTPUT_CALLBACKS, // - SET_OUTPUT_CALLBACKS, // - GET_OUTPUT_MASK, // - SET_OUTPUT_MASK, // - GET_OTHER_OUTPUT_MASK, // - SET_OTHER_OUTPUT_MASK, // - GET_OUTPUT_WIDTH, // - SET_OUTPUT_WIDTH, // - GET_OUTPUT_LINE_PREFIX, // - SET_OUTPUT_LINE_PREFIX, // - GET_IDENTITY, // - OUTPUT_IDENTITY, // - GET_EVENT_CALLBACKS, // - SET_EVENT_CALLBACKS, // - FLUSH_CALLBACKS, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT AttachKernel(ULONG Flags, String ConnectOptions); - - HRESULT GetKernelConnectionOptions(byte[] Buffer, ULONG BufferSize, - ULONGByReference OptionsSize); - - HRESULT SetKernelConnectionOptions(String Options); - - HRESULT StartProcessServer(ULONG Flags, String Options, Pointer Reserved); - - HRESULT ConnectProcessServer(String RemoteOptions, ULONGLONGByReference Server); - - HRESULT DisconnectProcessServer(ULONGLONG Server); - - HRESULT GetRunningProcessSystemIds(ULONGLONG Server, int[] Ids, ULONG Count, - ULONGByReference ActualCount); - - HRESULT GetRunningProcessSystemIdByExecutableName(ULONGLONG Server, String ExeName, ULONG Flags, - ULONGByReference Id); - - HRESULT GetRunningProcessDescription(ULONGLONG Server, ULONG SystemId, ULONG Flags, - byte[] ExeName, ULONG ExeNameSize, ULONGByReference ActualExeNameSize, - byte[] Description, ULONG DescriptionSize, ULONGByReference ActualDescriptionSize); - - HRESULT AttachProcess(ULONGLONG Server, ULONG ProcessId, ULONG AttachFlags); - - HRESULT CreateProcess(ULONGLONG Server, String CommandLine, ULONG CreateFlags); - - HRESULT CreateProcessAndAttach(ULONGLONG Server, String CommandLine, ULONG CreateFlags, - ULONG pid, ULONG AttachFlags); - - HRESULT GetProcessOptions(ULONGByReference Options); - - HRESULT AddProcessOptions(ULONG Options); - - HRESULT RemoveProcessOptions(ULONG Options); - - HRESULT SetProcessOptions(ULONG Options); - - HRESULT OpenDumpFile(String DumpFile); - - HRESULT WriteDumpFile(String DumpFile, ULONG Qualifier); - - HRESULT ConnectSession(ULONG Flags, ULONG HistoryLimit); - - HRESULT StartServer(String Options); - - HRESULT OutputServers(ULONG OutputControl, String Machine, ULONG Flags); - - HRESULT TerminateProcesses(); - - HRESULT DetachProcesses(); - - HRESULT EndSession(ULONG Flags); - - HRESULT GetExitCode(ULONGByReference Code); - - HRESULT DispatchCallbacks(ULONG Timeout); - - HRESULT ExitDispatch(IDebugClient Client); - - HRESULT CreateClient(PointerByReference Client); - - HRESULT GetInputCallbacks(PointerByReference Callbacks); - - HRESULT SetInputCallbacks(IDebugInputCallbacks Callbacks); - - HRESULT GetOutputCallbacks(Pointer Callbacks); - - HRESULT SetOutputCallbacks(IDebugOutputCallbacks Callbacks); - - HRESULT GetOutputMask(ULONGByReference Mask); - - HRESULT SetOutputMask(ULONG Mask); - - HRESULT GetOtherOutputMask(IDebugClient Client, ULONGByReference Mask); - - HRESULT SetOtherOutputMask(IDebugClient Client, ULONG Mask); - - HRESULT GetOutputWidth(ULONGByReference Columns); - - HRESULT SetOutputWidth(ULONG Columns); - - HRESULT GetOutputLinePrefix(byte[] Buffer, ULONG BufferSize, ULONGByReference PrefixSize); - - HRESULT SetOutputLinePrefix(String Prefix); - - HRESULT GetIdentity(byte[] Buffer, ULONG BufferSize, ULONGByReference IdentitySize); - - HRESULT OutputIdentity(ULONG OutputControl, ULONG Flags, String Format); - - HRESULT GetEventCallbacks(Pointer Callbacks); - - HRESULT SetEventCallbacks(IDebugEventCallbacks Callbacks); - - HRESULT FlushCallbacks(); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/IDebugClient2.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/IDebugClient2.java deleted file mode 100644 index d66a6eaa5b..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/IDebugClient2.java +++ /dev/null @@ -1,62 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.client; - -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinDef.ULONGLONG; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgeng.jna.dbgeng.UnknownWithUtils.VTableIndex; - -public interface IDebugClient2 extends IDebugClient { - final IID IID_IDEBUG_CLIENT2 = new IID("edbed635-372e-4dab-bbfe-ed0d2f63be81"); - - enum VTIndices2 implements VTableIndex { - WRITE_DUMP_FILE2, // - ADD_DUMP_INFORMATION_FILE, // - END_PROCESS_SERVER, // - WAIT_FOR_PROCESS_SERVER_END, // - IS_KERNEL_DEBUGGER_ENABLED, // - TERMINATE_CURRENT_PROCESS, // - DETACH_CURRENT_PROCESS, // - ABANDON_CURRENT_PROCESS, // - ; - - static int start = VTableIndex.follow(VTIndices.class); - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT WriteDumpFile2(String DumpFile, ULONG Qualifier, ULONG FormatFlags, String Comment); - - HRESULT AddDumpInformationFile(String InfoFile, ULONG Type); - - HRESULT EndProcessServer(ULONGLONG Server); - - HRESULT WaitForProcessServerEnd(ULONG Timeout); - - HRESULT IsKernelDebuggerEnabled(); - - HRESULT TerminateCurrentProcess(); - - HRESULT DetachCurrentProcess(); - - HRESULT AbandonCurrentProcess(); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/IDebugClient3.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/IDebugClient3.java deleted file mode 100644 index c260e62013..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/IDebugClient3.java +++ /dev/null @@ -1,54 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.client; - -import com.sun.jna.WString; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgeng.jna.dbgeng.UnknownWithUtils.VTableIndex; - -public interface IDebugClient3 extends IDebugClient2 { - final IID IID_IDEBUG_CLIENT3 = new IID("dd492d7f-71b8-4ad6-a8dc-1c887479ff91"); - - enum VTIndices3 implements VTableIndex { - GET_RUNNING_PROCESS_SYSTEM_ID_BY_EXECUTABLE_NAME_WIDE, // - GET_RUNNING_PROCESS_DESCRIPTION_WIDE, // - CREATE_PROCESS_WIDE, // - CREATE_PROCESS_AND_ATTACH_WIDE, // - ; - - static int start = VTableIndex.follow(VTIndices2.class); - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT GetRunningProcessSystemIdByExecutableNameWide(ULONGLONG Server, WString ExeName, - ULONG Flags, ULONGByReference Id); - - HRESULT GetRunningProcessDescriptionWide(ULONGLONG Server, ULONG SystemId, ULONG Flags, - char[] ExeName, ULONG ExeNameSize, ULONGByReference ActualExeNameSize, - char[] Description, ULONG DescriptionSize, ULONGByReference ActualDescriptionSize); - - HRESULT CreateProcessWide(ULONGLONG Server, WString CommandLine, ULONG CreateFlags); - - HRESULT CreateProcessAndAttachWide(ULONGLONG Server, WString CommandLine, ULONG CreateFlags, - ULONG ProcessId, ULONG AttachFlags); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/IDebugClient4.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/IDebugClient4.java deleted file mode 100644 index 8df1da1f88..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/IDebugClient4.java +++ /dev/null @@ -1,59 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.client; - -import com.sun.jna.WString; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgeng.jna.dbgeng.UnknownWithUtils.VTableIndex; - -public interface IDebugClient4 extends IDebugClient3 { - final IID IID_IDEBUG_CLIENT4 = new IID("ca83c3de-5089-4cf8-93c8-d892387f2a5e"); - - enum VTIndices4 implements VTableIndex { - OPEN_DUMP_FILE_WIDE, // - WRITE_DUMP_FILE_WIDE, // - ADD_DUMP_INFORMATION_FILE_WIDE, // - GET_NUMBER_DUMP_FILES, // - GET_DUMP_FILE, // - GET_DUMP_FILE_WIDE, // - ; - - static int start = VTableIndex.follow(VTIndices3.class); - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT OpenDumpFileWide(WString FileName, ULONGLONG FileHandle); - - HRESULT WriteDumpFileWide(WString FileName, ULONGLONG FileHandle, ULONG Qualifier, - ULONG FormatFlags, WString Comment); - - HRESULT AddDumpInformationFileWide(WString FileName, ULONGLONG FileHandle, ULONG Type); - - HRESULT GetNumberDumpFiles(ULONGByReference Number); - - HRESULT GetDumpFile(ULONG Index, byte[] Buffer, ULONG BufferSize, ULONGByReference NameSize, - ULONGLONGByReference Handle, ULONGByReference Type); - - HRESULT GetDumpFileWide(ULONG Index, char[] Buffer, ULONG BufferSize, ULONGByReference NameSize, - ULONGLONGByReference Handle, ULONGByReference Type); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/IDebugClient5.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/IDebugClient5.java deleted file mode 100644 index a19ce77f08..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/IDebugClient5.java +++ /dev/null @@ -1,137 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.client; - -import com.sun.jna.Pointer; -import com.sun.jna.WString; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgeng.jna.dbgeng.DbgEngNative.DEBUG_CREATE_PROCESS_OPTIONS; -import agent.dbgeng.jna.dbgeng.UnknownWithUtils.VTableIndex; -import agent.dbgeng.jna.dbgeng.event.IDebugEventCallbacksWide; -import agent.dbgeng.jna.dbgeng.io.IDebugOutputCallbacksWide; - -public interface IDebugClient5 extends IDebugClient4 { - final IID IID_IDEBUG_CLIENT5 = new IID("e3acb9d7-7ec2-4f0c-a0da-e81e0cbbe628"); - - enum VTIndices5 implements VTableIndex { - ATTACH_KERNEL_WIDE, // - GET_KERNEL_CONNECTION_OPTIONS_WIDE, // - SET_KERNEL_CONNECTION_OPTIONS_WIDE, // - START_PROCESS_SERVER_WIDE, // - CONNECT_PROCESS_SERVER_WIDE, // - START_SERVER_WIDE, // - OUTPUT_SERVERS_WIDE, // - GET_OUTPUT_CALLBACKS_WIDE, // - SET_OUTPUT_CALLBACKS_WIDE, // - GET_OUTPUT_LINE_PREFIX_WIDE, // - SET_OUTPUT_LINE_PREFIX_WIDE, // - GET_IDENTITY_WIDE, // - OUTPUT_IDENTITY_WIDE, // - GET_EVENT_CALLBACKS_WIDE, // - SET_EVENT_CALLBACKS_WIDE, // - CREATE_PROCESS2, // - CREATE_PROCESS2_WIDE, // - CREATE_PROCESS_AND_ATTACH2, // - CREATE_PROCESS_AND_ATTACH2_WIDE, // - PUSH_OUTPUT_LINE_PREFIX, // - PUSH_OUTPUT_LINE_PREFIX_WIDE, // - POP_OUTPUT_LINE_PREFIX, // - GET_NUMBER_INPUT_CALLBACKS, // - GET_NUMBER_OUTPUT_CALLBACKS, // - GET_NUMBER_EVENT_CALLBACKS, // - GET_QUIT_LOCK_STRING, // - SET_QUIT_LOCK_STRING, // - GET_QUIT_LOCK_STRING_WIDE, // - SET_QUIT_LOCK_STRING_WIDE, // - ; - - static int start = VTableIndex.follow(VTIndices4.class); - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT AttachKernelWide(ULONG Flags, WString ConnectOptions); - - HRESULT GetKernelConnectionOptionsWide(char[] Buffer, ULONG BufferSize, - ULONGByReference OptionsSize); - - HRESULT SetKernelConnectionOptionsWide(WString Options); - - HRESULT StartProcessServerWide(ULONG Flags, WString Options, Pointer Reserved); - - HRESULT ConnectProcessServerWide(WString RemoteOptions, ULONGLONGByReference Server); - - HRESULT StartServerWide(WString Options); - - HRESULT OutputServersWide(WString Options); - - HRESULT GetOutputCallbacksWide(Pointer Callbacks); - - HRESULT SetOutputCallbacksWide(IDebugOutputCallbacksWide Callbacks); - - HRESULT GetOutputLinePrefixWide(char[] Buffer, ULONG BufferSize, ULONGByReference PrefixSize); - - HRESULT SetOutputLinePrefixWide(WString Prefix); - - HRESULT GetIdentityWide(char[] Buffer, ULONG BufferSize, ULONGByReference IdentitySize); - - HRESULT OutputIdentityWide(ULONG OutputControl, ULONG Flags, WString Format); - - HRESULT GetEventCallbacksWide(Pointer Callbacks); - - HRESULT SetEventCallbacksWide(IDebugEventCallbacksWide Callbacks); - - HRESULT CreateProcess2(ULONGLONG Server, String CommandLine, Pointer OptionsBuffer, - ULONG OptionsBufferSize, String InitialDirectory, String Environment); - - HRESULT CreateProcess2Wide(ULONGLONG Server, WString CommandLine, - DEBUG_CREATE_PROCESS_OPTIONS OptionsBuffer, - ULONG OptionsBufferSize, WString InitialDirectory, WString Environment); - - HRESULT CreateProcessAndAttach2(ULONGLONG Server, String CommandLine, Pointer OptionsBuffer, - ULONG OptionsBufferSize, String InitialDirectory, String Environment, ULONG ProcessId, - ULONG AttachFlags); - - HRESULT CreateProcessAndAttach2Wide(ULONGLONG Server, WString CommandLine, - Pointer OptionsBuffer, ULONG OptionsBufferSize, WString InitialDirectory, - WString Environment, ULONG ProcessId, ULONG AttachFlags); - - HRESULT PushOutputLinePrefix(String NewPrefix, ULONGLONGByReference Handle); - - HRESULT PushOutputLinePrefixWide(WString NewPrefix, ULONGLONGByReference Handle); - - HRESULT PopOutputLinePrefix(ULONGLONG Handle); - - HRESULT GetNumberInputCallbacks(ULONGByReference Count); - - HRESULT GetNumberOutputCallbacks(ULONGByReference Count); - - HRESULT GetNumberEventCallbacks(ULONG EventFlags, ULONGByReference Count); - - HRESULT GetQuitLockString(byte[] Buffer, ULONG BufferSize, ULONGByReference StringSize); - - HRESULT SetQuitLockString(String String); - - HRESULT GetQuitLockStringWide(char[] Buffer, ULONG BufferSize, ULONGByReference StringSize); - - HRESULT SetQuitLockStringWide(WString String); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/IDebugClient6.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/IDebugClient6.java deleted file mode 100644 index b0dcd39598..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/IDebugClient6.java +++ /dev/null @@ -1,40 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.client; - -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgeng.jna.dbgeng.UnknownWithUtils.VTableIndex; -import agent.dbgeng.jna.dbgeng.event.IDebugEventContextCallbacks; - -public interface IDebugClient6 extends IDebugClient5 { - final IID IID_IDEBUG_CLIENT6 = new IID("fd28b4c5-c498-4686-a28e-62cad2154eb3"); - - enum VTIndices6 implements VTableIndex { - SET_EVENT_CONTEXT_CALLBACKS, // - ; - - static int start = VTableIndex.follow(VTIndices5.class); - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT SetEventContextCallbacks(IDebugEventContextCallbacks Callbacks); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/IDebugClient7.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/IDebugClient7.java deleted file mode 100644 index 3d662d9ef4..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/IDebugClient7.java +++ /dev/null @@ -1,41 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.client; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgeng.jna.dbgeng.UnknownWithUtils.VTableIndex; - -public interface IDebugClient7 extends IDebugClient6 { - final IID IID_IDEBUG_CLIENT7 = new IID("13586be3-542e-481e-b1f2-8497ba74f9a9"); - - enum VTIndices7 implements VTableIndex { - SET_CLIENT_CONTEXT, // - ; - - static int start = VTableIndex.follow(VTIndices6.class); - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT SetClientContext(Pointer Context, ULONG ContextSize); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/WrapIDebugClient.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/WrapIDebugClient.java deleted file mode 100644 index 745b9dd7c1..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/WrapIDebugClient.java +++ /dev/null @@ -1,281 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.client; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgeng.jna.dbgeng.UnknownWithUtils; -import agent.dbgeng.jna.dbgeng.event.IDebugEventCallbacks; -import agent.dbgeng.jna.dbgeng.io.IDebugInputCallbacks; -import agent.dbgeng.jna.dbgeng.io.IDebugOutputCallbacks; - -/** - * Wrapper class for the IDebugClient interface - */ -public class WrapIDebugClient extends UnknownWithUtils implements IDebugClient { - public static class ByReference extends WrapIDebugClient implements Structure.ByReference { - } - - public WrapIDebugClient() { - } - - public WrapIDebugClient(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT AttachKernel(ULONG Flags, String ConnectOptions) { - return _invokeHR(VTIndices.ATTACH_KERNEL, getPointer(), Flags, ConnectOptions); - } - - @Override - public HRESULT GetKernelConnectionOptions(byte[] Buffer, ULONG BufferSize, - ULONGByReference OptionsSize) { - return _invokeHR(VTIndices.GET_KERNEL_CONNECTION_OPTIONS, getPointer(), Buffer, BufferSize, - OptionsSize); - } - - @Override - public HRESULT SetKernelConnectionOptions(String Options) { - return _invokeHR(VTIndices.SET_KERNEL_CONNECTION_OPTIONS, getPointer(), Options); - } - - @Override - public HRESULT StartProcessServer(ULONG Flags, String Options, Pointer Reserved) { - return _invokeHR(VTIndices.START_PROCESS_SERVER, getPointer(), Flags, Options, Reserved); - } - - @Override - public HRESULT ConnectProcessServer(String RemoteOptions, ULONGLONGByReference Server) { - return _invokeHR(VTIndices.CONNECT_PROCESS_SERVER, getPointer(), RemoteOptions, Server); - } - - @Override - public HRESULT DisconnectProcessServer(ULONGLONG Server) { - return _invokeHR(VTIndices.DISCONNECT_PROCESS_SERVER, getPointer(), Server); - } - - @Override - public HRESULT GetRunningProcessSystemIds(ULONGLONG Server, int[] Ids, ULONG Count, - ULONGByReference ActualCount) { - return _invokeHR(VTIndices.GET_RUNNING_PROCESS_SYSTEM_IDS, getPointer(), Server, Ids, Count, - ActualCount); - } - - @Override - public HRESULT GetRunningProcessSystemIdByExecutableName(ULONGLONG Server, String ExeName, - ULONG Flags, ULONGByReference Id) { - return _invokeHR(VTIndices.GET_RUNNING_PROCESS_SYSTEM_ID_BY_EXECUTABLE_NAME, getPointer(), - Server, ExeName, Flags, Id); - } - - @Override - public HRESULT GetRunningProcessDescription(ULONGLONG Server, ULONG SystemId, ULONG Flags, - byte[] ExeName, ULONG ExeNameSize, ULONGByReference ActualExeNameSize, - byte[] Description, ULONG DescriptionSize, ULONGByReference ActualDescriptionSize) { - return _invokeHR(VTIndices.GET_RUNNING_PROCESS_DESCRIPTION, getPointer(), Server, SystemId, - Flags, ExeName, ExeNameSize, ActualExeNameSize, Description, DescriptionSize, - ActualDescriptionSize); - } - - @Override - public HRESULT AttachProcess(ULONGLONG Server, ULONG ProcessId, ULONG AttachFlags) { - return _invokeHR(VTIndices.ATTACH_PROCESS, getPointer(), Server, ProcessId, AttachFlags); - } - - @Override - public HRESULT CreateProcess(ULONGLONG Server, String CommandLine, ULONG CreateFlags) { - return _invokeHR(VTIndices.CREATE_PROCESS, getPointer(), Server, CommandLine, CreateFlags); - } - - @Override - public HRESULT CreateProcessAndAttach(ULONGLONG Server, String CommandLine, ULONG CreateFlags, - ULONG ProcessId, ULONG AttachFlags) { - return _invokeHR(VTIndices.CREATE_PROCESS_AND_ATTACH, getPointer(), Server, CommandLine, - CreateFlags, ProcessId, AttachFlags); - } - - @Override - public HRESULT GetProcessOptions(ULONGByReference Options) { - return _invokeHR(VTIndices.GET_PROCESS_OPTIONS, getPointer(), Options); - } - - @Override - public HRESULT AddProcessOptions(ULONG Options) { - return _invokeHR(VTIndices.ADD_PROCESS_OPTIONS, getPointer(), Options); - } - - @Override - public HRESULT RemoveProcessOptions(ULONG Options) { - return _invokeHR(VTIndices.REMOVE_PROCESS_OPTIONS, getPointer(), Options); - } - - @Override - public HRESULT SetProcessOptions(ULONG Options) { - return _invokeHR(VTIndices.SET_PROCESS_OPTIONS, getPointer(), Options); - } - - @Override - public HRESULT OpenDumpFile(String DumpFile) { - return _invokeHR(VTIndices.OPEN_DUMP_FILE, getPointer(), DumpFile); - } - - @Override - public HRESULT WriteDumpFile(String DumpFile, ULONG Qualifier) { - return _invokeHR(VTIndices.WRITE_DUMP_FILE, getPointer(), DumpFile, Qualifier); - } - - @Override - public HRESULT ConnectSession(ULONG Flags, ULONG HistoryLimit) { - return _invokeHR(VTIndices.CONNECTION_SESSION, getPointer(), Flags, HistoryLimit); - } - - @Override - public HRESULT StartServer(String Options) { - return _invokeHR(VTIndices.START_SERVER, getPointer(), Options); - } - - @Override - public HRESULT OutputServers(ULONG OutputControl, String Machine, ULONG Flags) { - return _invokeHR(VTIndices.OUTPUT_SERVERS, getPointer(), OutputControl, Machine, Flags); - } - - @Override - public HRESULT TerminateProcesses() { - return _invokeHR(VTIndices.TERMINATE_PROCESSES, getPointer()); - } - - @Override - public HRESULT DetachProcesses() { - return _invokeHR(VTIndices.DETACH_PROCESSES, getPointer()); - } - - @Override - public HRESULT EndSession(ULONG Flags) { - return _invokeHR(VTIndices.END_SESSION, getPointer(), Flags); - } - - @Override - public HRESULT GetExitCode(ULONGByReference Code) { - return _invokeHR(VTIndices.GET_EXIT_CODE, getPointer(), Code); - } - - @Override - public HRESULT DispatchCallbacks(ULONG Timeout) { - return _invokeHR(VTIndices.DISPATCH_CALLBACKS, getPointer(), Timeout); - } - - @Override - public HRESULT ExitDispatch(IDebugClient Client) { - return _invokeHR(VTIndices.EXIT_DISPATCH, getPointer(), Client); - } - - @Override - public HRESULT CreateClient(PointerByReference Client) { - return _invokeHR(VTIndices.CREATE_CLIENT, getPointer(), Client); - } - - @Override - public HRESULT GetInputCallbacks(PointerByReference Callbacks) { - return _invokeHR(VTIndices.GET_INPUT_CALLBACKS, getPointer(), Callbacks); - } - - @Override - public HRESULT SetInputCallbacks(IDebugInputCallbacks Callbacks) { - return _invokeHR(VTIndices.SET_INPUT_CALLBACKS, getPointer(), Callbacks); - } - - @Override - public HRESULT GetOutputCallbacks(Pointer Callbacks) { - return _invokeHR(VTIndices.GET_OUTPUT_CALLBACKS, getPointer(), Callbacks); - } - - @Override - public HRESULT SetOutputCallbacks(IDebugOutputCallbacks Callbacks) { - return _invokeHR(VTIndices.SET_OUTPUT_CALLBACKS, getPointer(), Callbacks); - } - - @Override - public HRESULT GetOutputMask(ULONGByReference Mask) { - return _invokeHR(VTIndices.GET_OUTPUT_MASK, getPointer(), Mask); - } - - @Override - public HRESULT SetOutputMask(ULONG Mask) { - return _invokeHR(VTIndices.SET_OUTPUT_MASK, getPointer(), Mask); - } - - @Override - public HRESULT GetOtherOutputMask(IDebugClient Client, ULONGByReference Mask) { - return _invokeHR(VTIndices.GET_OTHER_OUTPUT_MASK, getPointer(), Client, Mask); - } - - @Override - public HRESULT SetOtherOutputMask(IDebugClient Client, ULONG Mask) { - return _invokeHR(VTIndices.SET_OTHER_OUTPUT_MASK, getPointer(), Client, Mask); - } - - @Override - public HRESULT GetOutputWidth(ULONGByReference Columns) { - return _invokeHR(VTIndices.GET_OUTPUT_WIDTH, getPointer(), Columns); - } - - @Override - public HRESULT SetOutputWidth(ULONG Columns) { - return _invokeHR(VTIndices.SET_OUTPUT_WIDTH, getPointer(), Columns); - } - - @Override - public HRESULT GetOutputLinePrefix(byte[] Buffer, ULONG BufferSize, - ULONGByReference PrefixSize) { - return _invokeHR(VTIndices.GET_OUTPUT_LINE_PREFIX, getPointer(), Buffer, BufferSize, - PrefixSize); - } - - @Override - public HRESULT SetOutputLinePrefix(String Prefix) { - return _invokeHR(VTIndices.SET_OUTPUT_LINE_PREFIX, getPointer(), Prefix); - } - - @Override - public HRESULT GetIdentity(byte[] Buffer, ULONG BufferSize, ULONGByReference IdentitySize) { - return _invokeHR(VTIndices.GET_IDENTITY, getPointer(), Buffer, BufferSize, IdentitySize); - } - - @Override - public HRESULT OutputIdentity(ULONG OutputControl, ULONG Flags, String Format) { - return _invokeHR(VTIndices.OUTPUT_IDENTITY, getPointer(), OutputControl, Flags, Format); - } - - @Override - public HRESULT GetEventCallbacks(Pointer Callbacks) { - return _invokeHR(VTIndices.GET_EVENT_CALLBACKS, getPointer(), Callbacks); - } - - @Override - public HRESULT SetEventCallbacks(IDebugEventCallbacks Callbacks) { - return _invokeHR(VTIndices.SET_EVENT_CALLBACKS, getPointer(), Callbacks); - } - - @Override - public HRESULT FlushCallbacks() { - return _invokeHR(VTIndices.FLUSH_CALLBACKS, getPointer()); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/WrapIDebugClient2.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/WrapIDebugClient2.java deleted file mode 100644 index f23e64542a..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/WrapIDebugClient2.java +++ /dev/null @@ -1,79 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.client; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinDef.ULONGLONG; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -/** - * Wrapper class for the IDebugClient interface - */ -public class WrapIDebugClient2 extends WrapIDebugClient implements IDebugClient2 { - public static class ByReference extends WrapIDebugClient2 implements Structure.ByReference { - } - - public WrapIDebugClient2() { - } - - public WrapIDebugClient2(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT WriteDumpFile2(String DumpFile, ULONG Qualifier, ULONG FormatFlags, - String Comment) { - return _invokeHR(VTIndices2.WRITE_DUMP_FILE2, getPointer(), DumpFile, Qualifier, - FormatFlags, Comment); - } - - @Override - public HRESULT AddDumpInformationFile(String InfoFile, ULONG Type) { - return _invokeHR(VTIndices2.ADD_DUMP_INFORMATION_FILE, getPointer(), InfoFile, Type); - } - - @Override - public HRESULT EndProcessServer(ULONGLONG Server) { - return _invokeHR(VTIndices2.END_PROCESS_SERVER, getPointer(), Server); - } - - @Override - public HRESULT WaitForProcessServerEnd(ULONG Timeout) { - return _invokeHR(VTIndices2.WAIT_FOR_PROCESS_SERVER_END, getPointer(), Timeout); - } - - @Override - public HRESULT IsKernelDebuggerEnabled() { - return _invokeHR(VTIndices2.IS_KERNEL_DEBUGGER_ENABLED, getPointer()); - } - - @Override - public HRESULT TerminateCurrentProcess() { - return _invokeHR(VTIndices2.TERMINATE_CURRENT_PROCESS, getPointer()); - } - - @Override - public HRESULT DetachCurrentProcess() { - return _invokeHR(VTIndices2.DETACH_CURRENT_PROCESS, getPointer()); - } - - @Override - public HRESULT AbandonCurrentProcess() { - return _invokeHR(VTIndices2.ABANDON_CURRENT_PROCESS, getPointer()); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/WrapIDebugClient3.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/WrapIDebugClient3.java deleted file mode 100644 index 8fbba8675b..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/WrapIDebugClient3.java +++ /dev/null @@ -1,64 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.client; - -import com.sun.jna.*; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -/** - * Wrapper class for the IDebugClient interface - */ -public class WrapIDebugClient3 extends WrapIDebugClient2 implements IDebugClient3 { - public static class ByReference extends WrapIDebugClient3 implements Structure.ByReference { - } - - public WrapIDebugClient3() { - } - - public WrapIDebugClient3(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT GetRunningProcessSystemIdByExecutableNameWide(ULONGLONG Server, WString ExeName, - ULONG Flags, ULONGByReference Id) { - return _invokeHR(VTIndices3.GET_RUNNING_PROCESS_SYSTEM_ID_BY_EXECUTABLE_NAME_WIDE, - getPointer(), Server, ExeName, Flags, Id); - } - - @Override - public HRESULT GetRunningProcessDescriptionWide(ULONGLONG Server, ULONG SystemId, ULONG Flags, - char[] ExeName, ULONG ExeNameSize, ULONGByReference ActualExeNameSize, - char[] Description, ULONG DescriptionSize, ULONGByReference ActualDescriptionSize) { - return _invokeHR(VTIndices3.GET_RUNNING_PROCESS_DESCRIPTION_WIDE, getPointer(), Server, - SystemId, Flags, ExeName, ExeNameSize, ActualExeNameSize, Description, DescriptionSize, - ActualDescriptionSize); - } - - @Override - public HRESULT CreateProcessWide(ULONGLONG Server, WString CommandLine, ULONG CreateFlags) { - return _invokeHR(VTIndices3.CREATE_PROCESS_WIDE, getPointer(), Server, CommandLine, - CreateFlags); - } - - @Override - public HRESULT CreateProcessAndAttachWide(ULONGLONG Server, WString CommandLine, - ULONG CreateFlags, ULONG ProcessId, ULONG AttachFlags) { - return _invokeHR(VTIndices3.CREATE_PROCESS_AND_ATTACH_WIDE, getPointer(), Server, - CommandLine, CreateFlags, ProcessId, AttachFlags); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/WrapIDebugClient4.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/WrapIDebugClient4.java deleted file mode 100644 index ccadf743f3..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/WrapIDebugClient4.java +++ /dev/null @@ -1,72 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.client; - -import com.sun.jna.*; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -/** - * Wrapper class for the IDebugClient interface - */ -public class WrapIDebugClient4 extends WrapIDebugClient3 implements IDebugClient4 { - public static class ByReference extends WrapIDebugClient4 implements Structure.ByReference { - } - - public WrapIDebugClient4() { - } - - public WrapIDebugClient4(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT OpenDumpFileWide(WString FileName, ULONGLONG FileHandle) { - return _invokeHR(VTIndices4.OPEN_DUMP_FILE_WIDE, getPointer(), FileName, FileHandle); - } - - @Override - public HRESULT WriteDumpFileWide(WString FileName, ULONGLONG FileHandle, ULONG Qualifier, - ULONG FormatFlags, WString Comment) { - return _invokeHR(VTIndices4.WRITE_DUMP_FILE_WIDE, getPointer(), FileName, FileHandle, - Qualifier, FormatFlags, Comment); - } - - @Override - public HRESULT AddDumpInformationFileWide(WString FileName, ULONGLONG FileHandle, ULONG Type) { - return _invokeHR(VTIndices4.ADD_DUMP_INFORMATION_FILE_WIDE, getPointer(), FileName, - FileHandle, Type); - } - - @Override - public HRESULT GetNumberDumpFiles(ULONGByReference Number) { - return _invokeHR(VTIndices4.GET_NUMBER_DUMP_FILES, getPointer(), Number); - } - - @Override - public HRESULT GetDumpFile(ULONG Index, byte[] Buffer, ULONG BufferSize, - ULONGByReference NameSize, ULONGLONGByReference Handle, ULONGByReference Type) { - return _invokeHR(VTIndices4.GET_DUMP_FILE, getPointer(), Index, Buffer, BufferSize, - NameSize, Handle, Type); - } - - @Override - public HRESULT GetDumpFileWide(ULONG Index, char[] Buffer, ULONG BufferSize, - ULONGByReference NameSize, ULONGLONGByReference Handle, ULONGByReference Type) { - return _invokeHR(VTIndices4.GET_DUMP_FILE_WIDE, getPointer(), Index, Buffer, BufferSize, - NameSize, Handle, Type); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/WrapIDebugClient5.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/WrapIDebugClient5.java deleted file mode 100644 index 14338a34be..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/WrapIDebugClient5.java +++ /dev/null @@ -1,208 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.client; - -import com.sun.jna.*; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgeng.jna.dbgeng.DbgEngNative.DEBUG_CREATE_PROCESS_OPTIONS; -import agent.dbgeng.jna.dbgeng.event.IDebugEventCallbacksWide; -import agent.dbgeng.jna.dbgeng.io.IDebugOutputCallbacksWide; - -/** - * Wrapper class for the IDebugClient interface - */ -public class WrapIDebugClient5 extends WrapIDebugClient4 implements IDebugClient5 { - public static class ByReference extends WrapIDebugClient5 implements Structure.ByReference { - } - - public WrapIDebugClient5() { - } - - public WrapIDebugClient5(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT AttachKernelWide(ULONG Flags, WString ConnectOptions) { - return _invokeHR(VTIndices5.ATTACH_KERNEL_WIDE, getPointer(), Flags, ConnectOptions); - } - - @Override - public HRESULT GetKernelConnectionOptionsWide(char[] Buffer, ULONG BufferSize, - ULONGByReference OptionsSize) { - return _invokeHR(VTIndices5.GET_KERNEL_CONNECTION_OPTIONS_WIDE, getPointer(), Buffer, - BufferSize, OptionsSize); - } - - @Override - public HRESULT SetKernelConnectionOptionsWide(WString Options) { - return _invokeHR(VTIndices5.SET_KERNEL_CONNECTION_OPTIONS_WIDE, getPointer(), Options); - } - - @Override - public HRESULT StartProcessServerWide(ULONG Flags, WString Options, Pointer Reserved) { - return _invokeHR(VTIndices5.START_PROCESS_SERVER_WIDE, getPointer(), Flags, Options, - Reserved); - } - - @Override - public HRESULT ConnectProcessServerWide(WString RemoteOptions, ULONGLONGByReference Server) { - return _invokeHR(VTIndices5.CONNECT_PROCESS_SERVER_WIDE, getPointer(), RemoteOptions, - Server); - } - - @Override - public HRESULT StartServerWide(WString Options) { - return _invokeHR(VTIndices5.START_SERVER_WIDE, getPointer(), Options); - } - - @Override - public HRESULT OutputServersWide(WString Options) { - return _invokeHR(VTIndices5.OUTPUT_SERVERS_WIDE, getPointer(), Options); - } - - @Override - public HRESULT GetOutputCallbacksWide(Pointer Callbacks) { - return _invokeHR(VTIndices5.GET_OUTPUT_CALLBACKS_WIDE, getPointer(), Callbacks); - } - - @Override - public HRESULT SetOutputCallbacksWide(IDebugOutputCallbacksWide Callbacks) { - return _invokeHR(VTIndices5.SET_OUTPUT_CALLBACKS_WIDE, getPointer(), Callbacks); - } - - @Override - public HRESULT GetOutputLinePrefixWide(char[] Buffer, ULONG BufferSize, - ULONGByReference PrefixSize) { - return _invokeHR(VTIndices5.GET_OUTPUT_LINE_PREFIX_WIDE, getPointer(), Buffer, BufferSize, - PrefixSize); - } - - @Override - public HRESULT SetOutputLinePrefixWide(WString Prefix) { - return _invokeHR(VTIndices5.SET_OUTPUT_LINE_PREFIX_WIDE, getPointer(), Prefix); - } - - @Override - public HRESULT GetIdentityWide(char[] Buffer, ULONG BufferSize, ULONGByReference IdentitySize) { - return _invokeHR(VTIndices5.GET_IDENTITY_WIDE, getPointer(), Buffer, BufferSize, - IdentitySize); - } - - @Override - public HRESULT OutputIdentityWide(ULONG OutputControl, ULONG Flags, WString Format) { - return _invokeHR(VTIndices5.OUTPUT_IDENTITY_WIDE, getPointer(), OutputControl, Flags, - Format); - } - - @Override - public HRESULT GetEventCallbacksWide(Pointer Callbacks) { - return _invokeHR(VTIndices5.GET_EVENT_CALLBACKS_WIDE, getPointer(), Callbacks); - } - - @Override - public HRESULT SetEventCallbacksWide(IDebugEventCallbacksWide Callbacks) { - return _invokeHR(VTIndices5.SET_EVENT_CALLBACKS_WIDE, getPointer(), Callbacks); - } - - @Override - public HRESULT CreateProcess2(ULONGLONG Server, String CommandLine, Pointer OptionsBuffer, - ULONG OptionsBufferSize, String InitialDirectory, String Environment) { - return _invokeHR(VTIndices5.CREATE_PROCESS2, getPointer(), Server, CommandLine, - OptionsBuffer, OptionsBufferSize, InitialDirectory, Environment); - } - - @Override - public HRESULT CreateProcess2Wide(ULONGLONG Server, WString CommandLine, - DEBUG_CREATE_PROCESS_OPTIONS OptionsBuffer, - ULONG OptionsBufferSize, WString InitialDirectory, WString Environment) { - return _invokeHR(VTIndices5.CREATE_PROCESS2_WIDE, getPointer(), Server, CommandLine, - OptionsBuffer, OptionsBufferSize, InitialDirectory, Environment); - } - - @Override - public HRESULT CreateProcessAndAttach2(ULONGLONG Server, String CommandLine, - Pointer OptionsBuffer, ULONG OptionsBufferSize, String InitialDirectory, - String Environment, ULONG ProcessId, ULONG AttachFlags) { - return _invokeHR(VTIndices5.CREATE_PROCESS_AND_ATTACH2, getPointer(), Server, CommandLine, - OptionsBuffer, OptionsBufferSize, InitialDirectory, Environment, ProcessId, - AttachFlags); - } - - @Override - public HRESULT CreateProcessAndAttach2Wide(ULONGLONG Server, WString CommandLine, - Pointer OptionsBuffer, ULONG OptionsBufferSize, WString InitialDirectory, - WString Environment, ULONG ProcessId, ULONG AttachFlags) { - return _invokeHR(VTIndices5.CREATE_PROCESS_AND_ATTACH2_WIDE, getPointer(), Server, - CommandLine, OptionsBuffer, OptionsBufferSize, InitialDirectory, Environment, ProcessId, - AttachFlags); - } - - @Override - public HRESULT PushOutputLinePrefix(String NewPrefix, ULONGLONGByReference Handle) { - return _invokeHR(VTIndices5.PUSH_OUTPUT_LINE_PREFIX, getPointer(), NewPrefix, Handle); - } - - @Override - public HRESULT PushOutputLinePrefixWide(WString NewPrefix, ULONGLONGByReference Handle) { - return _invokeHR(VTIndices5.PUSH_OUTPUT_LINE_PREFIX_WIDE, getPointer(), NewPrefix, Handle); - } - - @Override - public HRESULT PopOutputLinePrefix(ULONGLONG Handle) { - return _invokeHR(VTIndices5.POP_OUTPUT_LINE_PREFIX, getPointer(), Handle); - } - - @Override - public HRESULT GetNumberInputCallbacks(ULONGByReference Count) { - return _invokeHR(VTIndices5.GET_NUMBER_INPUT_CALLBACKS, getPointer(), Count); - } - - @Override - public HRESULT GetNumberOutputCallbacks(ULONGByReference Count) { - return _invokeHR(VTIndices5.GET_NUMBER_OUTPUT_CALLBACKS, getPointer(), Count); - } - - @Override - public HRESULT GetNumberEventCallbacks(ULONG EventFlags, ULONGByReference Count) { - return _invokeHR(VTIndices5.GET_NUMBER_EVENT_CALLBACKS, getPointer(), Count); - } - - @Override - public HRESULT GetQuitLockString(byte[] Buffer, ULONG BufferSize, ULONGByReference StringSize) { - return _invokeHR(VTIndices5.GET_QUIT_LOCK_STRING, getPointer(), Buffer, BufferSize, - StringSize); - } - - @Override - public HRESULT SetQuitLockString(String String) { - return _invokeHR(VTIndices5.SET_QUIT_LOCK_STRING, getPointer(), String); - } - - @Override - public HRESULT GetQuitLockStringWide(char[] Buffer, ULONG BufferSize, - ULONGByReference StringSize) { - return _invokeHR(VTIndices5.GET_QUIT_LOCK_STRING_WIDE, getPointer(), Buffer, BufferSize, - StringSize); - } - - @Override - public HRESULT SetQuitLockStringWide(WString String) { - return _invokeHR(VTIndices5.SET_QUIT_LOCK_STRING_WIDE, getPointer(), String); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/WrapIDebugClient6.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/WrapIDebugClient6.java deleted file mode 100644 index a21ae73255..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/WrapIDebugClient6.java +++ /dev/null @@ -1,42 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.client; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgeng.jna.dbgeng.event.IDebugEventContextCallbacks; - -/** - * Wrapper class for the IDebugClient interface - */ -public class WrapIDebugClient6 extends WrapIDebugClient5 implements IDebugClient6 { - public static class ByReference extends WrapIDebugClient6 implements Structure.ByReference { - } - - public WrapIDebugClient6() { - } - - public WrapIDebugClient6(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT SetEventContextCallbacks(IDebugEventContextCallbacks Callbacks) { - return _invokeHR(VTIndices6.SET_EVENT_CONTEXT_CALLBACKS, getPointer(), Callbacks); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/WrapIDebugClient7.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/WrapIDebugClient7.java deleted file mode 100644 index 840d2b88b8..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/client/WrapIDebugClient7.java +++ /dev/null @@ -1,41 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.client; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -/** - * Wrapper class for the IDebugClient interface - */ -public class WrapIDebugClient7 extends WrapIDebugClient6 implements IDebugClient7 { - public static class ByReference extends WrapIDebugClient7 implements Structure.ByReference { - } - - public WrapIDebugClient7() { - } - - public WrapIDebugClient7(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT SetClientContext(Pointer Context, ULONG ContextSize) { - return _invokeHR(VTIndices7.SET_CLIENT_CONTEXT, getPointer(), Context, ContextSize); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/IDebugControl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/IDebugControl.java deleted file mode 100644 index 8f3a095a6f..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/IDebugControl.java +++ /dev/null @@ -1,220 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.control; - -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.platform.win32.COM.IUnknown; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgeng.jna.dbgeng.DbgEngNative.*; -import agent.dbgeng.jna.dbgeng.UnknownWithUtils.VTableIndex; -import agent.dbgeng.jna.dbgeng.breakpoint.IDebugBreakpoint; - -public interface IDebugControl extends IUnknown { - final IID IID_IDEBUG_CONTROL = new IID("5182e668-105e-416e-ad92-24ef800424ba"); - - enum VTIndices implements VTableIndex { - GET_INTERRUPT, // - SET_INTERRUPT, // - GET_INTERRUPT_TIMEOUT, // - SET_INTERRUPT_TIMEOUT, // - GET_LOG_FILE, // - OPEN_LOG_FILE, // - CLOSE_LOG_FILE, // - GET_LOG_MASK, // - SET_LOG_MASK, // - INPUT, // - RETURN_INPUT, // - OUTPUT, // - OUTPUT_VA_LIST, // - CONTROLLED_OUTPUT, // - CONTROLLED_OUTPUT_VA_LIST, // - OUTPUT_PROMPT, // - OUTPUT_PROMPT_VA_LIST, // - GET_PROMPT_TEXT, // - OUTPUT_CURRENT_STATE, // - OUTPUT_VERSION_INFORMATION, // - GET_NOTIFY_EVENT_HANDLE, // - SET_NOTIFY_EVENT_HANDLE, // - ASSEMBLE, // - DISASSEMBLE, // - GET_DISASSEMBLE_EFFECTIVE_OFFSET, // - OUTPUT_DISASSEMBLY, // - OUTPUT_DISASSEMBLY_LINES, // - GET_NEAR_INSTRUCTION, // - GET_STACK_TRACE, // - GET_RETURN_OFFSET, // - GET_OUTPUT_STACK_TRACE, // - GET_DEBUGGEE_TYPE, // - GET_ACTUAL_PROCESSOR_TYPE, // - GET_EXECUTING_PROCESSOR_TYPE, // - GET_NUMBER_POSSIBLE_EXECUTING_PROCESSOR_TYPES, // - GET_POSSIBLE_EXECUTING_PROCESSOR_TYPES, // - GET_NUMBER_PROCESSORS, // - GET_SYSTEM_VERSION, // - GET_PAGE_SIZE, // - IS_POINTER_64BIT, // - READ_BUG_CHECK_DATA, // - GET_NUMBER_SUPPORTED_PROCESSOR_TYPES, // - GET_SUPPORTED_PROCESSOR_TYPES, // - GET_PROCESSOR_TYPE_NAMES, // - GET_EFFECTIVE_PROCESSOR_TYPE, // - SET_EFFECTIVE_PROCESSOR_TYPE, // - GET_EXECUTION_STATUS, // - SET_EXECUTION_STATUS, // - GET_CODE_LEVEL, // - SET_CODE_LEVEL, // - GET_ENGINE_OPTIONS, // - ADD_ENGINE_OPTIONS, // - REMOVE_ENGINE_OPTIONS, // - SET_ENGINE_OPTIONS, // - GET_SYSTEM_ERROR_CONTROL, // - SET_SYSTEM_ERROR_CONTROL, // - GET_TEXT_MACRO, // - SET_TEXT_MACRO, // - GET_RADIX, // - SET_RADIX, // - EVALUATE, // - COERCE_VALUE, // - COERCE_VALUES, // - EXECUTE, // - EXECUTE_COMMAND_FILE, // - GET_NUMBER_BREAKPOINTS, // - GET_BREAKPOINT_BY_INDEX, // - GET_BREAKPOINT_BY_ID, // - GET_BREAKPOINT_PARAMETERS, // - ADD_BREAKPOINT, // - REMOVE_BREAKPOINT, // - ADD_EXTENSION, // - REMOVE_EXTENSION, // - GET_EXTENSION_BY_PATH, // - CALL_EXTENSION, // - GET_EXTENSION_FUNCTION, // - GET_WINDBG_EXTENSION_APIS32, // - GET_WINDBG_EXTENSION_APIS64, // - GET_NUMBER_EVENT_FILTERS, // - GET_EVENT_FILTER_TEXT, // - GET_EVENT_FILTER_COMMAND, // - SET_EVENT_FILTER_COMMAND, // - GET_SPECIFIC_FILTER_PARAMETERS, // - SET_SPECIFIC_FILTER_PARAMETERS, // - GET_SPECIFIC_FILTER_ARGUMENT, // - SET_SPECIFIC_FILTER_ARGUMENT, // - GET_EXCEPTION_FILTER_PARAMETERS, // - SET_EXCEPTION_FILTER_PARAMETERS, // - GET_EXCEPTION_FILTER_SECOND_COMMAND, // - SET_EXCEPTION_FILTER_SECOND_COMMAND, // - WAIT_FOR_EVENT, // - GET_LAST_EVENT_INFORMATION, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT GetInterrupt(); - - HRESULT SetInterrupt(ULONG Flags); - - HRESULT GetInterruptTimeout(ULONGByReference Seconds); - - HRESULT SetInterruptTimeout(ULONG Seconds); - - HRESULT ReturnInput(String Buffer); - - HRESULT Output(ULONG Mask, String Format, Object... objects); - - HRESULT OutputPrompt(ULONG OutputControl, String Format, Object... objects); - - HRESULT GetPromptText(byte[] Buffer, ULONG BufferSize, ULONGByReference TextSize); - - HRESULT GetExecutionStatus(ULONGByReference Status); - - HRESULT SetExecutionStatus(ULONG Status); - - HRESULT Evaluate(String Expression, ULONG DesiredType, DEBUG_VALUE.ByReference Value, - ULONGByReference RemainderIndex); - - HRESULT Execute(ULONG OutputControl, String Command, ULONG Flags); - - HRESULT GetNumberBreakpoints(ULONGByReference Number); - - HRESULT GetBreakpointByIndex(ULONG Index, PointerByReference Bp); - - HRESULT GetBreakpointById(ULONG Id, PointerByReference Bp); - - HRESULT AddBreakpoint(ULONG Type, ULONG DesiredId, PointerByReference Bp); - - HRESULT RemoveBreakpoint(IDebugBreakpoint Bp); - - HRESULT WaitForEvent(ULONG Flags, ULONG Timeout); - - HRESULT GetLastEventInformation(ULONGByReference pulType, ULONGByReference pulProcessId, - ULONGByReference pulThreadId, PointerByReference pExtraInformation, - ULONG ulExtraInformationSize, ULONGByReference pulExtraInformationUsed, - byte[] pstrDescription, ULONG ulDescriptionSize, ULONGByReference pulDescriptionUsed); - - HRESULT GetStackTrace(ULONGLONG FrameOffset, ULONGLONG StackOffset, ULONGLONG InstructionOffset, - DEBUG_STACK_FRAME[] pParams, ULONG FrameSize, ULONGByReference FramesFilled); - - HRESULT GetActualProcessorType(ULONGByReference Type); - - HRESULT GetEffectiveProcessorType(ULONGByReference Type); - - HRESULT GetExecutingProcessorType(ULONGByReference Type); - - HRESULT GetDebuggeeType(ULONGByReference Class, ULONGByReference Qualifier); - - HRESULT GetNumberEventFilters(ULONGByReference SpecificEvents, - ULONGByReference SpecificExceptions, ULONGByReference ArbitraryExceptions); - - HRESULT GetEventFilterText(ULONG Index, byte[] Buffer, ULONG BufferSize, - ULONGByReference TextSize); - - HRESULT GetEventFilterCommand(ULONG Index, byte[] Buffer, ULONG BufferSize, - ULONGByReference CommandSize); - - HRESULT SetEventFilterCommand(ULONG Index, String Command); - - HRESULT GetSpecificFilterParameters(ULONG Start, ULONG Count, - DEBUG_SPECIFIC_FILTER_PARAMETERS[] Params); - - HRESULT SetSpecificFilterParameters(ULONG Start, ULONG Count, - DEBUG_SPECIFIC_FILTER_PARAMETERS[] Params); - - HRESULT GetSpecificFilterArgument(ULONG Index, byte[] Buffer, ULONG BufferSize, - ULONGByReference ArgumentSize); - - HRESULT SetSpecificFilterArgument(ULONG Index, String Argument); - - HRESULT GetExceptionFilterParameters(ULONG Count, ULONG[] Codes, ULONG Start, - DEBUG_EXCEPTION_FILTER_PARAMETERS[] Params); - - HRESULT SetExceptionFilterParameters(ULONG Count, - DEBUG_EXCEPTION_FILTER_PARAMETERS[] Params); - - HRESULT GetExceptionFilterSecondCommand(ULONG Index, byte[] Buffer, ULONG BufferSize, - ULONGByReference CommandSize); - - HRESULT SetExceptionFilterSecondCommand(ULONG Index, String Command); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/IDebugControl2.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/IDebugControl2.java deleted file mode 100644 index e2efd771da..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/IDebugControl2.java +++ /dev/null @@ -1,43 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.control; - -import com.sun.jna.platform.win32.Guid.IID; - -import agent.dbgeng.jna.dbgeng.UnknownWithUtils.VTableIndex; - -public interface IDebugControl2 extends IDebugControl { - final IID IID_IDEBUG_CONTROL2 = new IID("d4366723-44df-4bed-8c7e-4c05424f4588"); - - enum VTIndices2 implements VTableIndex { - GET_CURRENT_TIME_DATE, // - GET_CURRENT_SYSTEM_UP_TIME, // - GET_DUMP_FORMAT_FLAGS, // - GET_NUMBER_TEXT_REPLACEMENTS, // - GET_TEXT_REPLACEMENT, // - SET_TEXT_REPLACEMENT, // - REMOVE_TEXT_REPLACEMENTS, // - OUTPUT_TEXT_REPLACEMENTS, // - ; - - static int start = VTableIndex.follow(VTIndices.class); - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/IDebugControl3.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/IDebugControl3.java deleted file mode 100644 index 55ddd9fb55..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/IDebugControl3.java +++ /dev/null @@ -1,48 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.control; - -import com.sun.jna.platform.win32.Guid.IID; - -import agent.dbgeng.jna.dbgeng.UnknownWithUtils.VTableIndex; - -public interface IDebugControl3 extends IDebugControl2 { - final IID IID_IDEBUG_CONTROL3 = new IID("7df74a86-b03f-407f-90ab-a20dadcead08"); - - enum VTIndices3 implements VTableIndex { - GET_ASSEMBLY_OPTIONS, // - ADD_ASSEMBLY_OPTIONS, // - REMOVE_ASSEMBLY_OPTIONS, // - SET_ASSEMBLY_OPTIONS, // - GET_EXPRESSION_SYNTAX, // - SET_EXPRESSION_SYNTAX, // - SET_EXPRESSION_SYNTAX_BY_NAME, // - GET_NUMBER_EXPRESSION_SYNTAXES, // - GET_EXPRESSION_SYNTAX_NAMES, // - GET_NUMBER_EVENTS, // - GET_EVENT_INDEX_DESCRIPTION, // - GET_CURRENT_EVENT_INDEX, // - SET_NEXT_EVENT_INDEX, // - ; - - static int start = VTableIndex.follow(VTIndices2.class); - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/IDebugControl4.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/IDebugControl4.java deleted file mode 100644 index 255e24d059..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/IDebugControl4.java +++ /dev/null @@ -1,109 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.control; - -import com.sun.jna.WString; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinDef.ULONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgeng.jna.dbgeng.DbgEngNative.DEBUG_VALUE; -import agent.dbgeng.jna.dbgeng.UnknownWithUtils.VTableIndex; - -public interface IDebugControl4 extends IDebugControl3 { - final IID IID_IDEBUG_CONTROL4 = new IID("94e60ce9-9b41-4b19-9fc0-6d9eb35272b3"); - - enum VTIndices4 implements VTableIndex { - GET_LOG_FILE_WIDE, // - OPEN_LOG_FILE_WIDE, // - INPUT_WIDE, // - RETURN_INPUT_WIDE, // - OUTPUT_WIDE, // - OUTPUT_VA_LIST_WIDE, // - CONTROLLED_OUTPUT_WIDE, // - CONTROLLED_OUTPUT_VA_LIST_WIDE, // - OUTPUT_PROMPT_WIDE, // - OUTPUT_PROMPT_VA_LIST_WIDE, // - GET_PROMPT_TEXT_WIDE, // - ASSEMBLE_WIDE, // - DISASSEMBLE_WIDE, // - GET_PROCESSOR_TYPE_NAMES_WIDE, // - GET_TEXT_MACRO_WIDE, // - SET_TEXT_MACRO_WIDE, // - EVALUATE_WIDE, // - EXECUTE_WIDE, // - EXECUTE_COMMAND_FILE_WIDE, // - GET_BREAKPOINT_BY_INDEX2, // - GET_BREAKPOINT_BY_ID2, // - ADD_BREAKPOINT2, // - REMOVE_BREAKPOINT2, // - ADD_EXTENSION_WIDE, // - GET_EXTENSION_BY_PATH_WIDE, // - CALL_EXTENSION_WIDE, // - GET_EXTENSION_FUNCTION_WIDE, // - GET_EVENT_FILTER_TEXT_WIDE, // - GET_EVENT_FILTER_COMMAND_WIDE, // - SET_EVENT_FILTER_COMMAND_WIDE, // - GET_SPECIFIC_FILTER_ARGUMENT_WIDE, // - SET_SPECIFIC_FILTER_ARGUMENT_WIDE, // - GET_EXCEPTION_FILTER_SECOND_COMMAND_WIDE, // - SET_EXCEPTION_FILTER_SECOND_COMMAND_WIDE, // - GET_LAST_EVENT_INFORMATINO_WIDE, // - GET_TEXT_REPLACEMENT_WIDE, // - SET_TEXT_REPLACEMENT_WIDE, // - SET_EXPRESSION_SYNTAX_BY_NAME_WIDE, // - GET_EXPRESSION_SYNTAX_NAMES_WIDE, // - GET_EVENT_INDEX_DESCRIPTION_WIDE, // - GET_LOG_FILE2, // - OPEN_LOG_FILE2, // - GET_LOG_FILE2_WIDE, // - OPEN_LOG_FILE2_WIDE, // - GET_SYSTEM_VERSION_VALUES, // - GET_SYSTEM_VERSION_STRING, // - GET_SYSTEM_VERSION_STRING_WIDE, // - GET_CONTEXT_STACK_TRACE, // - OUTPUT_CONTEXT_STACK_TRACE, // - GET_STORED_EVENT_INFORMATION, // - GET_MANAGED_STATUS, // - GET_MANAGED_STATUS_WIDE, // - RESET_MANAGED_STATUS, // - ; - - static int start = VTableIndex.follow(VTIndices3.class); - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT AddBreakpoint2(ULONG Type, ULONG DesiredId, PointerByReference Bp); - - HRESULT ReturnInputWide(WString Buffer); - - HRESULT OutputWide(ULONG Mask, WString Format, Object... objects); - - HRESULT OutputPromptWide(ULONG OutputControl, WString Format, Object... objects); - - HRESULT GetPromptTextWide(char[] Buffer, ULONG BufferSize, ULONGByReference TextSize); - - HRESULT EvaluateWide(WString Expression, ULONG DesiredType, DEBUG_VALUE.ByReference Value, - ULONGByReference RemainderIndex); - - HRESULT ExecuteWide(ULONG OutputControl, WString Command, ULONG Flags); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/IDebugControl5.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/IDebugControl5.java deleted file mode 100644 index 6f3e4b20f6..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/IDebugControl5.java +++ /dev/null @@ -1,40 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.control; - -import com.sun.jna.platform.win32.Guid.IID; - -import agent.dbgeng.jna.dbgeng.UnknownWithUtils.VTableIndex; - -public interface IDebugControl5 extends IDebugControl4 { - final IID IID_IDEBUG_CONTROL5 = new IID("b2ffe162-2412-429f-8d1d-5bf6dd824696"); - - enum VTIndices5 implements VTableIndex { - GET_STACK_TRACE_EX, // - OUTPUT_STACK_TRACE_EX, // - GET_CONTEXT_STACK_TRACE_EX, // - OUTPUT_CONTEXT_STACK_TRACE_EX, // - GET_BREAKPOINT_BY_GUID, // - ; - - static int start = VTableIndex.follow(VTIndices4.class); - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/IDebugControl6.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/IDebugControl6.java deleted file mode 100644 index acd7c00753..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/IDebugControl6.java +++ /dev/null @@ -1,41 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.control; - -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.ULONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgeng.jna.dbgeng.UnknownWithUtils.VTableIndex; - -public interface IDebugControl6 extends IDebugControl5 { - final IID IID_IDEBUG_CONTROL6 = new IID("bc0d583f-126d-43a1-9cc4-a860ab1d537b"); - - enum VTIndices6 implements VTableIndex { - GET_EXECUTABLE_STATUS_EX, // - GET_SYNCHRONIZATION_STATUS, // - ; - - static int start = VTableIndex.follow(VTIndices5.class); - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT GetExecutionStatusEx(ULONGByReference Status); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/IDebugControl7.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/IDebugControl7.java deleted file mode 100644 index 100b984b87..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/IDebugControl7.java +++ /dev/null @@ -1,36 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.control; - -import com.sun.jna.platform.win32.Guid.IID; - -import agent.dbgeng.jna.dbgeng.UnknownWithUtils.VTableIndex; - -public interface IDebugControl7 extends IDebugControl6 { - final IID IID_IDEBUG_CONTROL7 = new IID("b86fb3b1-80d4-475b-aea3-cf06539cf63a"); - - enum VTIndices7 implements VTableIndex { - GET_DEBUGGEE_TYPE2, // - ; - - static int start = VTableIndex.follow(VTIndices6.class); - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/WrapIDebugControl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/WrapIDebugControl.java deleted file mode 100644 index ef2f0b6ef9..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/WrapIDebugControl.java +++ /dev/null @@ -1,258 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.control; - -import java.util.*; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgeng.jna.dbgeng.DbgEngNative.*; -import agent.dbgeng.jna.dbgeng.UnknownWithUtils; -import agent.dbgeng.jna.dbgeng.breakpoint.IDebugBreakpoint; - -public class WrapIDebugControl extends UnknownWithUtils implements IDebugControl { - public static class ByReference extends WrapIDebugControl implements Structure.ByReference { - } - - public WrapIDebugControl() { - } - - public WrapIDebugControl(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT GetInterrupt() { - return _invokeHR(VTIndices.GET_INTERRUPT, getPointer()); - } - - @Override - public HRESULT SetInterrupt(ULONG Flags) { - return _invokeHR(VTIndices.SET_INTERRUPT, getPointer(), Flags); - } - - @Override - public HRESULT GetInterruptTimeout(ULONGByReference Seconds) { - return _invokeHR(VTIndices.GET_INTERRUPT_TIMEOUT, getPointer(), Seconds); - } - - @Override - public HRESULT SetInterruptTimeout(ULONG Seconds) { - return _invokeHR(VTIndices.SET_INTERRUPT_TIMEOUT, getPointer(), Seconds); - } - - @Override - public HRESULT ReturnInput(String Buffer) { - return _invokeHR(VTIndices.RETURN_INPUT, getPointer(), Buffer); - } - - @Override - public HRESULT Output(ULONG Mask, String Format, Object... objects) { - List args = new ArrayList<>(); - args.add(getPointer()); - args.add(Format); - args.addAll(Arrays.asList(objects)); - return _invokeHR(VTIndices.OUTPUT, args.toArray()); - } - - @Override - public HRESULT OutputPrompt(ULONG OutputControl, String Format, Object... objects) { - List args = new ArrayList<>(); - args.add(getPointer()); - args.add(OutputControl); - args.add(Format); - args.addAll(Arrays.asList(objects)); - return _invokeHR(VTIndices.OUTPUT_PROMPT, args.toArray()); - } - - @Override - public HRESULT GetPromptText(byte[] Buffer, ULONG BufferSize, ULONGByReference TextSize) { - return _invokeHR(VTIndices.GET_PROMPT_TEXT, getPointer(), Buffer, BufferSize, TextSize); - } - - @Override - public HRESULT GetExecutionStatus(ULONGByReference Status) { - return _invokeHR(VTIndices.GET_EXECUTION_STATUS, getPointer(), Status); - } - - @Override - public HRESULT SetExecutionStatus(ULONG Status) { - return _invokeHR(VTIndices.SET_EXECUTION_STATUS, getPointer(), Status); - } - - @Override - public HRESULT Evaluate(String Expression, ULONG DesiredType, DEBUG_VALUE.ByReference Value, - ULONGByReference RemainderIndex) { - return _invokeHR(VTIndices.EVALUATE, getPointer(), Expression, DesiredType, Value, - RemainderIndex); - } - - @Override - public HRESULT Execute(ULONG OutputControl, String Command, ULONG Flags) { - return _invokeHR(VTIndices.EXECUTE, getPointer(), OutputControl, Command, Flags); - } - - @Override - public HRESULT GetNumberBreakpoints(ULONGByReference Number) { - return _invokeHR(VTIndices.GET_NUMBER_BREAKPOINTS, getPointer(), Number); - } - - @Override - public HRESULT GetBreakpointByIndex(ULONG Index, PointerByReference Bp) { - return _invokeHR(VTIndices.GET_BREAKPOINT_BY_INDEX, getPointer(), Index, Bp); - } - - @Override - public HRESULT GetBreakpointById(ULONG Id, PointerByReference Bp) { - return _invokeHR(VTIndices.GET_BREAKPOINT_BY_ID, getPointer(), Id, Bp); - } - - @Override - public HRESULT AddBreakpoint(ULONG Type, ULONG DesiredId, PointerByReference Bp) { - return _invokeHR(VTIndices.ADD_BREAKPOINT, getPointer(), Type, DesiredId, Bp); - } - - @Override - public HRESULT RemoveBreakpoint(IDebugBreakpoint Bp) { - return _invokeHR(VTIndices.REMOVE_BREAKPOINT, getPointer(), Bp); - } - - @Override - public HRESULT WaitForEvent(ULONG Flags, ULONG Timeout) { - return _invokeHR(VTIndices.WAIT_FOR_EVENT, getPointer(), Flags, Timeout); - } - - @Override - public HRESULT GetLastEventInformation(ULONGByReference Type, ULONGByReference ProcessId, - ULONGByReference ThreadId, PointerByReference ExtraInformation, - ULONG ExtraInformationSize, ULONGByReference ExtraInformationUsed, byte[] Description, - ULONG DescriptionSize, ULONGByReference DescriptionUsed) { - return _invokeHR(VTIndices.GET_LAST_EVENT_INFORMATION, getPointer(), Type, ProcessId, - ThreadId, ExtraInformation, ExtraInformationSize, ExtraInformationUsed, Description, - DescriptionSize, DescriptionUsed); - } - - @Override - public HRESULT GetStackTrace(ULONGLONG FrameOffset, ULONGLONG StackOffset, - ULONGLONG InstructionOffset, DEBUG_STACK_FRAME[] Params, ULONG FrameSize, - ULONGByReference FramesFilled) { - return _invokeHR(VTIndices.GET_STACK_TRACE, getPointer(), FrameOffset, StackOffset, - InstructionOffset, Params, FrameSize, FramesFilled); - } - - @Override - public HRESULT GetActualProcessorType(ULONGByReference Type) { - return _invokeHR(VTIndices.GET_ACTUAL_PROCESSOR_TYPE, getPointer(), Type); - } - - @Override - public HRESULT GetEffectiveProcessorType(ULONGByReference Type) { - return _invokeHR(VTIndices.GET_EFFECTIVE_PROCESSOR_TYPE, getPointer(), Type); - } - - @Override - public HRESULT GetExecutingProcessorType(ULONGByReference Type) { - return _invokeHR(VTIndices.GET_EXECUTING_PROCESSOR_TYPE, getPointer(), Type); - } - - @Override - public HRESULT GetDebuggeeType(ULONGByReference Class, ULONGByReference Qualifier) { - return _invokeHR(VTIndices.GET_DEBUGGEE_TYPE, getPointer(), Class, Qualifier); - } - - @Override - public HRESULT GetNumberEventFilters(ULONGByReference SpecificEvents, - ULONGByReference SpecificExceptions, ULONGByReference ArbitraryExceptions) { - return _invokeHR(VTIndices.GET_NUMBER_EVENT_FILTERS, getPointer(), SpecificEvents, - SpecificExceptions, ArbitraryExceptions); - } - - @Override - public HRESULT GetEventFilterText(ULONG Index, byte[] Buffer, ULONG BufferSize, - ULONGByReference TextSize) { - return _invokeHR(VTIndices.GET_EVENT_FILTER_TEXT, getPointer(), Index, Buffer, - BufferSize, TextSize); - } - - @Override - public HRESULT GetEventFilterCommand(ULONG Index, byte[] Buffer, ULONG BufferSize, - ULONGByReference CommandSize) { - return _invokeHR(VTIndices.GET_EVENT_FILTER_COMMAND, getPointer(), Index, Buffer, - BufferSize, CommandSize); - } - - @Override - public HRESULT SetEventFilterCommand(ULONG Index, String Command) { - return _invokeHR(VTIndices.SET_EVENT_FILTER_COMMAND, getPointer(), Index, Command); - } - - @Override - public HRESULT GetSpecificFilterParameters(ULONG Start, ULONG Count, - DEBUG_SPECIFIC_FILTER_PARAMETERS[] Params) { - return _invokeHR(VTIndices.GET_SPECIFIC_FILTER_PARAMETERS, getPointer(), Start, Count, - Params); - } - - @Override - public HRESULT SetSpecificFilterParameters(ULONG Start, ULONG Count, - DEBUG_SPECIFIC_FILTER_PARAMETERS[] Params) { - return _invokeHR(VTIndices.SET_SPECIFIC_FILTER_PARAMETERS, getPointer(), Start, Count, - Params); - } - - @Override - public HRESULT GetSpecificFilterArgument(ULONG Index, byte[] Buffer, ULONG BufferSize, - ULONGByReference ArgumentSize) { - return _invokeHR(VTIndices.GET_SPECIFIC_FILTER_ARGUMENT, getPointer(), Index, Buffer, - BufferSize, ArgumentSize); - } - - @Override - public HRESULT SetSpecificFilterArgument(ULONG Index, String Argument) { - return _invokeHR(VTIndices.SET_SPECIFIC_FILTER_ARGUMENT, getPointer(), Index, Argument); - } - - @Override - public HRESULT GetExceptionFilterParameters(ULONG Count, ULONG[] Codes, ULONG Start, - DEBUG_EXCEPTION_FILTER_PARAMETERS[] Params) { - return _invokeHR(VTIndices.GET_EXCEPTION_FILTER_PARAMETERS, getPointer(), Count, Codes, - Start, - Params); - } - - @Override - public HRESULT SetExceptionFilterParameters(ULONG Count, - DEBUG_EXCEPTION_FILTER_PARAMETERS[] Params) { - return _invokeHR(VTIndices.SET_EXCEPTION_FILTER_PARAMETERS, getPointer(), Count, Params); - } - - @Override - public HRESULT GetExceptionFilterSecondCommand(ULONG Index, byte[] Buffer, ULONG BufferSize, - ULONGByReference CommandSize) { - return _invokeHR(VTIndices.GET_EXCEPTION_FILTER_SECOND_COMMAND, getPointer(), Index, Buffer, - BufferSize, CommandSize); - } - - @Override - public HRESULT SetExceptionFilterSecondCommand(ULONG Index, String Command) { - return _invokeHR(VTIndices.SET_EXCEPTION_FILTER_SECOND_COMMAND, getPointer(), Index, - Command); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/WrapIDebugControl2.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/WrapIDebugControl2.java deleted file mode 100644 index d622597009..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/WrapIDebugControl2.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.control; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; - -public class WrapIDebugControl2 extends WrapIDebugControl implements IDebugControl2 { - public static class ByReference extends WrapIDebugControl2 implements Structure.ByReference { - } - - public WrapIDebugControl2() { - } - - public WrapIDebugControl2(Pointer pvInstance) { - super(pvInstance); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/WrapIDebugControl3.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/WrapIDebugControl3.java deleted file mode 100644 index 04a84e11e5..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/WrapIDebugControl3.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.control; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; - -public class WrapIDebugControl3 extends WrapIDebugControl2 implements IDebugControl3 { - public static class ByReference extends WrapIDebugControl3 implements Structure.ByReference { - } - - public WrapIDebugControl3() { - } - - public WrapIDebugControl3(Pointer pvInstance) { - super(pvInstance); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/WrapIDebugControl4.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/WrapIDebugControl4.java deleted file mode 100644 index 9526616cda..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/WrapIDebugControl4.java +++ /dev/null @@ -1,85 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.control; - -import java.util.*; - -import com.sun.jna.*; -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinDef.ULONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgeng.jna.dbgeng.DbgEngNative.DEBUG_VALUE; - -public class WrapIDebugControl4 extends WrapIDebugControl3 implements IDebugControl4 { - public static class ByReference extends WrapIDebugControl4 implements Structure.ByReference { - } - - public WrapIDebugControl4() { - } - - public WrapIDebugControl4(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT AddBreakpoint2(ULONG Type, ULONG DesiredId, PointerByReference Bp) { - return _invokeHR(VTIndices4.ADD_BREAKPOINT2, getPointer(), Type, DesiredId, Bp); - } - - @Override - public HRESULT ReturnInputWide(WString Buffer) { - return _invokeHR(VTIndices4.RETURN_INPUT_WIDE, getPointer(), Buffer); - } - - @Override - public HRESULT OutputWide(ULONG Mask, WString Format, Object... objects) { - List args = new ArrayList<>(); - args.add(getPointer()); - args.add(Format); - args.addAll(Arrays.asList(objects)); - return _invokeHR(VTIndices4.OUTPUT_WIDE, args.toArray()); - } - - @Override - public HRESULT OutputPromptWide(ULONG OutputControl, WString Format, Object... objects) { - List args = new ArrayList<>(); - args.add(getPointer()); - args.add(OutputControl); - args.add(Format); - args.addAll(Arrays.asList(objects)); - return _invokeHR(VTIndices4.OUTPUT_PROMPT_WIDE, args.toArray()); - } - - @Override - public HRESULT GetPromptTextWide(char[] Buffer, ULONG BufferSize, ULONGByReference TextSize) { - return _invokeHR(VTIndices4.GET_PROMPT_TEXT_WIDE, getPointer(), Buffer, BufferSize, - TextSize); - } - - @Override - public HRESULT EvaluateWide(WString Expression, ULONG DesiredType, - DEBUG_VALUE.ByReference Value, ULONGByReference RemainderIndex) { - return _invokeHR(VTIndices4.EVALUATE_WIDE, getPointer(), Expression, DesiredType, Value, - RemainderIndex); - } - - @Override - public HRESULT ExecuteWide(ULONG OutputControl, WString Command, ULONG Flags) { - return _invokeHR(VTIndices4.EXECUTE_WIDE, getPointer(), OutputControl, Command, Flags); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/WrapIDebugControl5.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/WrapIDebugControl5.java deleted file mode 100644 index b2ae0cb2bc..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/WrapIDebugControl5.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.control; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; - -public class WrapIDebugControl5 extends WrapIDebugControl4 implements IDebugControl5 { - public static class ByReference extends WrapIDebugControl5 implements Structure.ByReference { - } - - public WrapIDebugControl5() { - } - - public WrapIDebugControl5(Pointer pvInstance) { - super(pvInstance); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/WrapIDebugControl6.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/WrapIDebugControl6.java deleted file mode 100644 index 67c3f64484..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/WrapIDebugControl6.java +++ /dev/null @@ -1,38 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.control; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinDef.ULONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -public class WrapIDebugControl6 extends WrapIDebugControl5 implements IDebugControl6 { - public static class ByReference extends WrapIDebugControl6 implements Structure.ByReference { - } - - public WrapIDebugControl6() { - } - - public WrapIDebugControl6(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT GetExecutionStatusEx(ULONGByReference Status) { - return _invokeHR(VTIndices6.GET_EXECUTABLE_STATUS_EX, getPointer(), Status); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/WrapIDebugControl7.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/WrapIDebugControl7.java deleted file mode 100644 index 52ef3db0b4..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/control/WrapIDebugControl7.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.control; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; - -public class WrapIDebugControl7 extends WrapIDebugControl6 implements IDebugControl7 { - public static class ByReference extends WrapIDebugControl7 implements Structure.ByReference { - } - - public WrapIDebugControl7() { - } - - public WrapIDebugControl7(Pointer pvInstance) { - super(pvInstance); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/dataspaces/IDebugDataSpaces.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/dataspaces/IDebugDataSpaces.java deleted file mode 100644 index 39432d0574..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/dataspaces/IDebugDataSpaces.java +++ /dev/null @@ -1,104 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.dataspaces; - -import java.nio.ByteBuffer; - -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.platform.win32.COM.IUnknown; - -import agent.dbgeng.jna.dbgeng.UnknownWithUtils.VTableIndex; - -public interface IDebugDataSpaces extends IUnknown { - final IID IID_IDEBUG_DATA_SPACES = new IID("88f7dfab-3ea7-4c3a-aefb-c4e8106173aa"); - - enum VTIndices implements VTableIndex { - READ_VIRTUAL, // - WRITE_VIRTUAL, // - SEARCH_VIRTUAL, // - READ_VIRTUAL_UNCACHED, // - WRITE_VIRTUAL_UNCACHED, // - READ_POINTERS_VIRTUAL, // - WRITE_POINTERS_VIRTUAL, // - READ_PHYSICAL, // - WRITE_PHYSICAL, // - READ_CONTROL, // - WRITE_CONTROL, // - READ_IO, // - WRITE_IO, // - READ_MSR, // - WRITE_MSR, // - READ_BUS_DATA, // - WRITE_BUS_DATA, // - CHECK_LOW_MEMORY, // - READ_DEBUGGER_DATA, // - READ_PROCESSOR_SYSTEM_DATA, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT ReadVirtual(ULONGLONG Offset, ByteBuffer Buffer, ULONG BufferSize, - ULONGByReference BytesRead); - - HRESULT WriteVirtual(ULONGLONG Offset, ByteBuffer Buffer, ULONG BufferSize, - ULONGByReference BytesWritten); - - HRESULT ReadVirtualUncached(ULONGLONG Offset, ByteBuffer Buffer, ULONG BufferSize, - ULONGByReference BytesRead); - - HRESULT WriteVirtualUncached(ULONGLONG Offset, ByteBuffer Buffer, ULONG BufferSize, - ULONGByReference BytesWritten); - - HRESULT ReadPhysical(ULONGLONG Offset, ByteBuffer Buffer, ULONG BufferSize, - ULONGByReference BytesRead); - - HRESULT WritePhysical(ULONGLONG Offset, ByteBuffer Buffer, ULONG BufferSize, - ULONGByReference BytesWritten); - - HRESULT ReadControl(ULONG Processor, ULONGLONG Offset, ByteBuffer Buffer, ULONG BufferSize, - ULONGByReference BytesRead); - - HRESULT WriteControl(ULONG Processor, ULONGLONG Offset, ByteBuffer Buffer, ULONG BufferSize, - ULONGByReference BytesWritten); - - HRESULT ReadBusData(ULONG BusDataType, ULONG BusNumber, ULONG SlotNumber, ULONGLONG Offset, - ByteBuffer Buffer, ULONG BufferSize, ULONGByReference BytesRead); - - HRESULT WriteBusData(ULONG BusDataType, ULONG BusNumber, ULONG SlotNumber, ULONGLONG Offset, - ByteBuffer Buffer, ULONG BufferSize, ULONGByReference BytesWritten); - - HRESULT ReadIo(ULONG InterfaceType, ULONG BusNumber, ULONG AddressSpace, ULONGLONG Offset, - ByteBuffer Buffer, ULONG BufferSize, ULONGByReference BytesRead); - - HRESULT WriteIo(ULONG InterfaceType, ULONG BusNumber, ULONG AddressSpace, ULONGLONG Offset, - ByteBuffer Buffer, ULONG BufferSize, ULONGByReference BytesWritten); - - HRESULT ReadMsr(ULONG Msr, ULONGLONGByReference Value); - - HRESULT WriteMsr(ULONG Msr, ULONGLONG Value); - - HRESULT ReadDebuggerData(ULONG Offset, ByteBuffer Buffer, ULONG BufferSize, - ULONGByReference BytesRead); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/dataspaces/IDebugDataSpaces2.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/dataspaces/IDebugDataSpaces2.java deleted file mode 100644 index cef7c7fdee..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/dataspaces/IDebugDataSpaces2.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.dataspaces; - -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.ULONGLONG; -import com.sun.jna.platform.win32.WinDef.ULONGLONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgeng.jna.dbgeng.UnknownWithUtils.VTableIndex; -import agent.dbgeng.jna.dbgeng.WinNTExtra.MEMORY_BASIC_INFORMATION64; - -public interface IDebugDataSpaces2 extends IDebugDataSpaces { - final IID IID_IDEBUG_DATA_SPACES2 = new IID("7a5e852f-96e9-468f-ac1b-0b3addc4a049"); - - enum VTIndices2 implements VTableIndex { - VIRTUAL_TO_PHYSICAL, // - GET_VIRTUAL_TRANSLATION_PHYSICAL_OFFSETS, // - READ_HANDLE_DATA, // - FILL_VIRTUAL, // - FILL_PHYSICAL, // - QUERY_VIRTUAL, // - ; - - static int start = VTableIndex.follow(VTIndices.class); - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT QueryVirtual(ULONGLONG Offset, MEMORY_BASIC_INFORMATION64.ByReference Info); - - HRESULT VirtualToPhysical(ULONGLONG OffsetVirtual, ULONGLONGByReference OffsetPhysical); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/dataspaces/IDebugDataSpaces3.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/dataspaces/IDebugDataSpaces3.java deleted file mode 100644 index cc0b1d84a3..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/dataspaces/IDebugDataSpaces3.java +++ /dev/null @@ -1,40 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.dataspaces; - -import com.sun.jna.platform.win32.Guid.IID; - -import agent.dbgeng.jna.dbgeng.UnknownWithUtils.VTableIndex; - -public interface IDebugDataSpaces3 extends IDebugDataSpaces2 { - final IID IID_IDEBUG_DATA_SPACES3 = new IID("23f79d6c-8aaf-4f7c-a607-9995f5407e63"); - - enum VTIndices3 implements VTableIndex { - READ_IMAGE_NT_HEADERS, // - READ_TAGGED, // - START_ENUM_TAGGED, // - GET_NEXT_TAGGED, // - END_ENUM_TAGGED, // - ; - - static int start = VTableIndex.follow(VTIndices2.class); - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/dataspaces/IDebugDataSpaces4.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/dataspaces/IDebugDataSpaces4.java deleted file mode 100644 index 92e55c2428..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/dataspaces/IDebugDataSpaces4.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.dataspaces; - -import com.sun.jna.platform.win32.Guid.IID; - -import agent.dbgeng.jna.dbgeng.UnknownWithUtils.VTableIndex; - -public interface IDebugDataSpaces4 extends IDebugDataSpaces3 { - final IID IID_IDEBUG_DATA_SPACES4 = new IID("d98ada1f-29e9-4ef5-a6c0-e53349883212"); - - enum VTIndices4 implements VTableIndex { - GET_OFFSET_INFORMATION, // - GET_NEXT_DIFFERENTLY_VALID_OFFSET_VIRTUAL, // - GET_VALID_REGION_VIRTUAL, // - SEARCH_VIRTUAL2, // - READ_MULTI_BYTE_STRING_VIRTUAL, // - READ_MULTI_BYTE_STRING_VIRTUAL_WIDE, // - READ_UNICODE_STRING_VIRTUAL, // - READ_UNICODE_STRING_VIRTUAL_WIDE, // - READ_PHYSICAL2, // - WRITE_PHYSICAL2, // - ; - - static int start = VTableIndex.follow(VTIndices3.class); - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/dataspaces/WrapIDebugDataSpaces.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/dataspaces/WrapIDebugDataSpaces.java deleted file mode 100644 index 015755d22a..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/dataspaces/WrapIDebugDataSpaces.java +++ /dev/null @@ -1,141 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.dataspaces; - -import java.nio.ByteBuffer; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgeng.jna.dbgeng.UnknownWithUtils; -import agent.dbgeng.jna.dbgeng.sysobj.WrapIDebugSystemObjects; - -public class WrapIDebugDataSpaces extends UnknownWithUtils implements IDebugDataSpaces { - public static class ByReference extends WrapIDebugSystemObjects - implements Structure.ByReference { - } - - public WrapIDebugDataSpaces() { - } - - public WrapIDebugDataSpaces(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT ReadVirtual(ULONGLONG Offset, ByteBuffer Buffer, ULONG BufferSize, - ULONGByReference BytesRead) { - return _invokeHR(VTIndices.READ_VIRTUAL, getPointer(), Offset, Buffer, BufferSize, - BytesRead); - } - - @Override - public HRESULT WriteVirtual(ULONGLONG Offset, ByteBuffer Buffer, ULONG BufferSize, - ULONGByReference BytesWritten) { - return _invokeHR(VTIndices.WRITE_VIRTUAL, getPointer(), Offset, Buffer, BufferSize, - BytesWritten); - } - - @Override - public HRESULT ReadVirtualUncached(ULONGLONG Offset, ByteBuffer Buffer, ULONG BufferSize, - ULONGByReference BytesRead) { - return _invokeHR(VTIndices.READ_VIRTUAL_UNCACHED, getPointer(), Offset, Buffer, BufferSize, - BytesRead); - } - - @Override - public HRESULT WriteVirtualUncached(ULONGLONG Offset, ByteBuffer Buffer, ULONG BufferSize, - ULONGByReference BytesWritten) { - return _invokeHR(VTIndices.WRITE_VIRTUAL_UNCACHED, getPointer(), Offset, Buffer, BufferSize, - BytesWritten); - } - - @Override - public HRESULT ReadPhysical(ULONGLONG Offset, ByteBuffer Buffer, ULONG BufferSize, - ULONGByReference BytesRead) { - return _invokeHR(VTIndices.READ_PHYSICAL, getPointer(), Offset, Buffer, BufferSize, - BytesRead); - } - - @Override - public HRESULT WritePhysical(ULONGLONG Offset, ByteBuffer Buffer, ULONG BufferSize, - ULONGByReference BytesWritten) { - return _invokeHR(VTIndices.WRITE_PHYSICAL, getPointer(), Offset, Buffer, BufferSize, - BytesWritten); - } - - @Override - public HRESULT ReadControl(ULONG Processor, ULONGLONG Offset, ByteBuffer Buffer, - ULONG BufferSize, ULONGByReference BytesRead) { - return _invokeHR(VTIndices.READ_CONTROL, getPointer(), Processor, Processor, Offset, Buffer, - BufferSize, BytesRead); - } - - @Override - public HRESULT WriteControl(ULONG Processor, ULONGLONG Offset, ByteBuffer Buffer, - ULONG BufferSize, ULONGByReference BytesWritten) { - return _invokeHR(VTIndices.WRITE_CONTROL, getPointer(), Offset, Buffer, BufferSize, - BytesWritten); - } - - @Override - public HRESULT ReadBusData(ULONG BusDataType, ULONG BusNumber, ULONG SlotNumber, - ULONGLONG Offset, ByteBuffer Buffer, ULONG BufferSize, ULONGByReference BytesRead) { - return _invokeHR(VTIndices.READ_BUS_DATA, getPointer(), BusDataType, BusNumber, SlotNumber, - Offset, Buffer, BufferSize, BytesRead); - } - - @Override - public HRESULT WriteBusData(ULONG BusDataType, ULONG BusNumber, ULONG SlotNumber, - ULONGLONG Offset, ByteBuffer Buffer, ULONG BufferSize, ULONGByReference BytesWritten) { - return _invokeHR(VTIndices.WRITE_BUS_DATA, getPointer(), BusDataType, BusNumber, SlotNumber, - Offset, Buffer, BufferSize, BytesWritten); - } - - @Override - public HRESULT ReadIo(ULONG InterfaceType, ULONG BusNumber, ULONG AddressSpace, - ULONGLONG Offset, ByteBuffer Buffer, ULONG BufferSize, ULONGByReference BytesRead) { - return _invokeHR(VTIndices.READ_IO, getPointer(), InterfaceType, BusNumber, AddressSpace, - Offset, Buffer, BufferSize, BytesRead); - } - - @Override - public HRESULT WriteIo(ULONG InterfaceType, ULONG BusNumber, ULONG AddressSpace, - ULONGLONG Offset, ByteBuffer Buffer, ULONG BufferSize, ULONGByReference BytesWritten) { - return _invokeHR(VTIndices.WRITE_IO, getPointer(), InterfaceType, BusNumber, AddressSpace, - Offset, Buffer, BufferSize, BytesWritten); - } - - @Override - public HRESULT ReadMsr(ULONG Msr, ULONGLONGByReference Value) { - return _invokeHR(VTIndices.READ_MSR, getPointer(), Msr, Value); - } - - @Override - public HRESULT WriteMsr(ULONG Msr, ULONGLONG Value) { - return _invokeHR(VTIndices.WRITE_MSR, getPointer(), Msr, Value); - } - - @Override - public HRESULT ReadDebuggerData(ULONG Offset, ByteBuffer Buffer, ULONG BufferSize, - ULONGByReference BytesRead) { - return _invokeHR(VTIndices.READ_DEBUGGER_DATA, getPointer(), Offset, Buffer, BufferSize, - BytesRead); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/dataspaces/WrapIDebugDataSpaces2.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/dataspaces/WrapIDebugDataSpaces2.java deleted file mode 100644 index 9411f07e7e..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/dataspaces/WrapIDebugDataSpaces2.java +++ /dev/null @@ -1,50 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.dataspaces; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinDef.ULONGLONG; -import com.sun.jna.platform.win32.WinDef.ULONGLONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgeng.jna.dbgeng.WinNTExtra.MEMORY_BASIC_INFORMATION64; -import agent.dbgeng.jna.dbgeng.sysobj.WrapIDebugSystemObjects2; - -public class WrapIDebugDataSpaces2 extends WrapIDebugDataSpaces implements IDebugDataSpaces2 { - public static class ByReference extends WrapIDebugSystemObjects2 - implements Structure.ByReference { - } - - public WrapIDebugDataSpaces2() { - } - - public WrapIDebugDataSpaces2(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT QueryVirtual(ULONGLONG Offset, MEMORY_BASIC_INFORMATION64.ByReference Info) { - return _invokeHR(VTIndices2.QUERY_VIRTUAL, getPointer(), Offset, Info); - } - - @Override - public HRESULT VirtualToPhysical(ULONGLONG OffsetVirtual, ULONGLONGByReference OffsetPhysical) { - return _invokeHR(VTIndices2.VIRTUAL_TO_PHYSICAL, getPointer(), OffsetVirtual, - OffsetPhysical); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/dataspaces/WrapIDebugDataSpaces3.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/dataspaces/WrapIDebugDataSpaces3.java deleted file mode 100644 index 0b643ee8d6..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/dataspaces/WrapIDebugDataSpaces3.java +++ /dev/null @@ -1,34 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.dataspaces; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; - -import agent.dbgeng.jna.dbgeng.sysobj.WrapIDebugSystemObjects3; - -public class WrapIDebugDataSpaces3 extends WrapIDebugDataSpaces2 implements IDebugDataSpaces3 { - public static class ByReference extends WrapIDebugSystemObjects3 - implements Structure.ByReference { - } - - public WrapIDebugDataSpaces3() { - } - - public WrapIDebugDataSpaces3(Pointer pvInstance) { - super(pvInstance); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/dataspaces/WrapIDebugDataSpaces4.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/dataspaces/WrapIDebugDataSpaces4.java deleted file mode 100644 index b188307a40..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/dataspaces/WrapIDebugDataSpaces4.java +++ /dev/null @@ -1,34 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.dataspaces; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; - -import agent.dbgeng.jna.dbgeng.sysobj.WrapIDebugSystemObjects4; - -public class WrapIDebugDataSpaces4 extends WrapIDebugDataSpaces3 implements IDebugDataSpaces4 { - public static class ByReference extends WrapIDebugSystemObjects4 - implements Structure.ByReference { - } - - public WrapIDebugDataSpaces4() { - } - - public WrapIDebugDataSpaces4(Pointer pvInstance) { - super(pvInstance); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/CallbackIDebugEventCallbacks.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/CallbackIDebugEventCallbacks.java deleted file mode 100644 index fe9adc2bb5..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/CallbackIDebugEventCallbacks.java +++ /dev/null @@ -1,21 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.event; - -import com.sun.jna.platform.win32.COM.IUnknownCallback; - -public interface CallbackIDebugEventCallbacks extends IDebugEventCallbacks, IUnknownCallback { -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/CallbackIDebugEventCallbacksWide.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/CallbackIDebugEventCallbacksWide.java deleted file mode 100644 index 8db971286e..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/CallbackIDebugEventCallbacksWide.java +++ /dev/null @@ -1,22 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.event; - -import com.sun.jna.platform.win32.COM.IUnknownCallback; - -public interface CallbackIDebugEventCallbacksWide - extends IDebugEventCallbacksWide, IUnknownCallback { -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/CallbackIDebugEventContextCallbacks.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/CallbackIDebugEventContextCallbacks.java deleted file mode 100644 index d85a5c9316..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/CallbackIDebugEventContextCallbacks.java +++ /dev/null @@ -1,22 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.event; - -import com.sun.jna.platform.win32.COM.IUnknownCallback; - -public interface CallbackIDebugEventContextCallbacks - extends IDebugEventContextCallbacks, IUnknownCallback { -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/IDebugEventCallbacks.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/IDebugEventCallbacks.java deleted file mode 100644 index 65302dbe7f..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/IDebugEventCallbacks.java +++ /dev/null @@ -1,59 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.event; - -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgeng.jna.dbgeng.WinNTExtra.EXCEPTION_RECORD64; -import agent.dbgeng.jna.dbgeng.breakpoint.WrapIDebugBreakpoint; - -public interface IDebugEventCallbacks { - final IID IID_IDEBUG_EVENT_CALLBACKS = new IID("337be28b-5036-4d72-b6bf-c45fbb9f2eaa"); - - HRESULT GetInterestMask(ULONGByReference Mask); - - HRESULT Breakpoint(WrapIDebugBreakpoint.ByReference Bp); - - HRESULT Exception(EXCEPTION_RECORD64.ByReference Exception, ULONG FirstChance); - - HRESULT CreateThread(ULONGLONG Handle, ULONGLONG DataOffset, ULONGLONG StartOffset); - - HRESULT ExitThread(ULONG ExitCode); - - HRESULT CreateProcess(ULONGLONG ImageFileHandle, ULONGLONG Handle, ULONGLONG BaseOffset, - ULONG ModuleSize, String ModuleName, String ImageName, ULONG CheckSum, - ULONG TimeDateStamp, ULONGLONG InitialThreadHandle, ULONGLONG ThreadDataOffset, - ULONGLONG StartOffset); - - HRESULT ExitProcess(ULONG ExitCode); - - HRESULT LoadModule(ULONGLONG ImageFileHandle, ULONGLONG BaseOffset, ULONG ModuleSize, - String ModuleName, String ImageName, ULONG CheckSum, ULONG TimeDateStamp); - - HRESULT UnloadModule(String ImageBaseName, ULONGLONG BaseOffset); - - HRESULT SystemError(ULONG Error, ULONG Level); - - HRESULT SessionStatus(ULONG Status); - - HRESULT ChangeDebuggeeState(ULONG Flags, ULONGLONG Argument); - - HRESULT ChangeEngineState(ULONG Flags, ULONGLONG Argument); - - HRESULT ChangeSymbolState(ULONG Flags, ULONGLONG Argument); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/IDebugEventCallbacksWide.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/IDebugEventCallbacksWide.java deleted file mode 100644 index 09d274eb88..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/IDebugEventCallbacksWide.java +++ /dev/null @@ -1,60 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.event; - -import com.sun.jna.WString; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgeng.jna.dbgeng.WinNTExtra.EXCEPTION_RECORD64; -import agent.dbgeng.jna.dbgeng.breakpoint.WrapIDebugBreakpoint; - -public interface IDebugEventCallbacksWide { - final IID IID_IDEBUG_EVENT_CALLBACKS_WIDE = new IID("0690e046-9c23-45ac-a04f-987ac29ad0d3"); - - HRESULT GetInterestMask(ULONGByReference Mask); - - HRESULT Breakpoint(WrapIDebugBreakpoint.ByReference Bp); - - HRESULT Exception(EXCEPTION_RECORD64.ByReference Exception, ULONG FirstChance); - - HRESULT CreateThread(ULONGLONG Handle, ULONGLONG DataOffset, ULONGLONG StartOffset); - - HRESULT ExitThread(ULONG ExitCode); - - HRESULT CreateProcess(ULONGLONG ImageFileHandle, ULONGLONG Handle, ULONGLONG BaseOffset, - ULONG ModuleSize, WString ModuleName, WString ImageName, ULONG CheckSum, - ULONG TimeDateStamp, ULONGLONG InitialThreadHandle, ULONGLONG ThreadDataOffset, - ULONGLONG StartOffset); - - HRESULT ExitProcess(ULONG ExitCode); - - HRESULT LoadModule(ULONGLONG ImageFileHandle, ULONGLONG BaseOffset, ULONG ModuleSize, - WString ModuleName, WString ImageName, ULONG CheckSum, ULONG TimeDateStamp); - - HRESULT UnloadModule(WString ImageBaseName, ULONGLONG BaseOffset); - - HRESULT SystemError(ULONG Error, ULONG Level); - - HRESULT SessionStatus(ULONG Status); - - HRESULT ChangeDebuggeeState(ULONG Flags, ULONGLONG Argument); - - HRESULT ChangeEngineState(ULONG Flags, ULONGLONG Argument); - - HRESULT ChangeSymbolState(ULONG Flags, ULONGLONG Argument); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/IDebugEventContextCallbacks.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/IDebugEventContextCallbacks.java deleted file mode 100644 index b75a457da2..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/IDebugEventContextCallbacks.java +++ /dev/null @@ -1,66 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.event; - -import com.sun.jna.Pointer; -import com.sun.jna.WString; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgeng.jna.dbgeng.WinNTExtra.EXCEPTION_RECORD64; -import agent.dbgeng.jna.dbgeng.breakpoint.WrapIDebugBreakpoint2; - -public interface IDebugEventContextCallbacks { - final IID IID_IDEBUG_EVENT_CONTEXT_CALLBACKS = new IID("61a4905b-23f9-4247-b3c5-53d087529ab7"); - - HRESULT GetInterestMask(ULONGByReference Mask); - - HRESULT Breakpoint(WrapIDebugBreakpoint2.ByReference Bp, Pointer Context, ULONG ContextSize); - - HRESULT Exception(EXCEPTION_RECORD64.ByReference Exception, ULONG FirstChance, Pointer Context, - ULONG ContextSize); - - HRESULT CreateThread(ULONGLONG Handle, ULONGLONG DataOffset, ULONGLONG StartOffset, - Pointer Context, ULONG ContextSize); - - HRESULT ExitThread(ULONG ExitCode, Pointer Context, ULONG ContextSize); - - HRESULT CreateProcess(ULONGLONG ImageFileHandle, ULONGLONG Handle, ULONGLONG BaseOffset, - ULONG ModuleSize, WString ModuleName, WString ImageName, ULONG CheckSum, - ULONG TimeDateStamp, ULONGLONG InitialThreadHandle, ULONGLONG ThreadDataOffset, - ULONGLONG StartOffset, Pointer Context, ULONG ContextSize); - - HRESULT ExitProcess(ULONG ExitCode, Pointer Context, ULONG ContextSize); - - HRESULT LoadModule(ULONGLONG ImageFileHandle, ULONGLONG BaseOffset, ULONG ModuleSize, - WString ModuleName, WString ImageName, ULONG CheckSum, ULONG TimeDateStamp, - Pointer Context, ULONG ContextSize); - - HRESULT UnloadModule(WString ImageBaseName, ULONGLONG BaseOffset, Pointer Context, - ULONG ContextSize); - - HRESULT SystemError(ULONG Error, ULONG Level, Pointer Context, ULONG ContextSize); - - HRESULT SessionStatus(ULONG Status); - - HRESULT ChangeDebuggeeState(ULONG Flags, ULONGLONG Argument, Pointer Context, - ULONG ContextSize); - - HRESULT ChangeEngineState(ULONG Flags, ULONGLONG Argument, Pointer Context, ULONG ContextSize); - - HRESULT ChangeSymbolState(ULONG Flags, ULONGLONG Argument); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/ListenerIDebugEventCallbacks.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/ListenerIDebugEventCallbacks.java deleted file mode 100644 index e7b656fbc5..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/ListenerIDebugEventCallbacks.java +++ /dev/null @@ -1,184 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.event; - -import java.util.List; - -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgeng.jna.dbgeng.WinNTExtra.EXCEPTION_RECORD64; -import agent.dbgeng.jna.dbgeng.breakpoint.WrapIDebugBreakpoint; - -public class ListenerIDebugEventCallbacks extends Structure - implements IDebugEventCallbacks, MarkerEventCallbacks { - public static final List FIELDS = createFieldsOrder("vtbl"); - - public ListenerIDebugEventCallbacks(CallbackIDebugEventCallbacks callback) { - this.vtbl = this.constructVTable(); - this.initVTable(callback); - super.write(); - } - - public VTableIDebugEventCallbacks.ByReference vtbl; - - @Override - protected List getFieldOrder() { - return FIELDS; - } - - protected VTableIDebugEventCallbacks.ByReference constructVTable() { - return new VTableIDebugEventCallbacks.ByReference(); - } - - protected void initVTable(final CallbackIDebugEventCallbacks callback) { - vtbl.QueryInterfaceCallback = (thisPointer, refid, ppvObject) -> { - return callback.QueryInterface(refid, ppvObject); - }; - vtbl.AddRefCallback = (thisPointer) -> { - return callback.AddRef(); - }; - vtbl.ReleaseCallback = (thisPointer) -> { - return callback.Release(); - }; - vtbl.GetInterestMaskCallback = (thisPointer, Mask) -> { - return callback.GetInterestMask(Mask); - }; - vtbl.BreakpointCallback = (thisPointer, Bp) -> { - return callback.Breakpoint(Bp); - }; - vtbl.ExceptionCallback = (thisPointer, Exception, FirstChance) -> { - return callback.Exception(Exception, FirstChance); - }; - vtbl.CreateThreadCallback = (thisPointer, Handle, DataOffset, StartOffset) -> { - return callback.CreateThread(Handle, DataOffset, StartOffset); - }; - vtbl.ExitThreadCallback = (thisPointer, ExitCode) -> { - return callback.ExitThread(ExitCode); - }; - vtbl.CreateProcessCallback = (thisPointer, ImageFileHandle, Handle, BaseOffset, ModuleSize, - ModuleName, ImageName, CheckSum, TimeDateStamp, InitialThreadHandle, - ThreadDataOffset, StartOffset) -> { - return callback.CreateProcess(ImageFileHandle, Handle, BaseOffset, ModuleSize, - ModuleName, ImageName, CheckSum, TimeDateStamp, InitialThreadHandle, - ThreadDataOffset, StartOffset); - }; - vtbl.ExitProcessCallback = (thisPointer, ExitCode) -> { - return callback.ExitProcess(ExitCode); - }; - vtbl.LoadModuleCallback = (thisPointer, ImageFileHandle, BaseOffset, ModuleSize, ModuleName, - ImageName, CheckSum, TimeDateStamp) -> { - return callback.LoadModule(ImageFileHandle, BaseOffset, ModuleSize, ModuleName, - ImageName, CheckSum, TimeDateStamp); - }; - vtbl.UnloadModuleCallback = (thisPointer, ImageBaseName, BaseOffset) -> { - return callback.UnloadModule(ImageBaseName, BaseOffset); - }; - vtbl.SystemErrorCallback = (thisPointer, Error, Level) -> { - return callback.SystemError(Error, Level); - }; - vtbl.SessionStatusCallback = (thisPointer, Status) -> { - return callback.SessionStatus(Status); - }; - vtbl.ChangeDebuggeeStateCallback = (thisPointer, Flags, Argument) -> { - return callback.ChangeDebuggeeState(Flags, Argument); - }; - vtbl.ChangeEngineStateCallback = (thisPointer, Flags, Argument) -> { - return callback.ChangeEngineState(Flags, Argument); - }; - vtbl.ChangeSymbolStateCallback = (thisPointer, Flags, Argument) -> { - return callback.ChangeSymbolState(Flags, Argument); - }; - } - - @Override - public HRESULT GetInterestMask(ULONGByReference Mask) { - return vtbl.GetInterestMaskCallback.invoke(getPointer(), Mask); - } - - @Override - public HRESULT Breakpoint(WrapIDebugBreakpoint.ByReference Bp) { - return vtbl.BreakpointCallback.invoke(getPointer(), Bp); - } - - @Override - public HRESULT Exception(EXCEPTION_RECORD64.ByReference Exception, ULONG FirstChance) { - return vtbl.ExceptionCallback.invoke(getPointer(), Exception, FirstChance); - } - - @Override - public HRESULT CreateThread(ULONGLONG Handle, ULONGLONG DataOffset, ULONGLONG StartOffset) { - return vtbl.CreateThreadCallback.invoke(getPointer(), Handle, DataOffset, StartOffset); - } - - @Override - public HRESULT ExitThread(ULONG ExitCode) { - return vtbl.ExitThreadCallback.invoke(getPointer(), ExitCode); - } - - @Override - public HRESULT CreateProcess(ULONGLONG ImageFileHandle, ULONGLONG Handle, ULONGLONG BaseOffset, - ULONG ModuleSize, String ModuleName, String ImageName, ULONG CheckSum, - ULONG TimeDateStamp, ULONGLONG InitialThreadHandle, ULONGLONG ThreadDataOffset, - ULONGLONG StartOffset) { - return vtbl.CreateProcessCallback.invoke(getPointer(), ImageFileHandle, Handle, BaseOffset, - ModuleSize, ModuleName, ImageName, CheckSum, TimeDateStamp, InitialThreadHandle, - ThreadDataOffset, StartOffset); - } - - @Override - public HRESULT ExitProcess(ULONG ExitCode) { - return vtbl.ExitProcessCallback.invoke(getPointer(), ExitCode); - } - - @Override - public HRESULT LoadModule(ULONGLONG ImageFileHandle, ULONGLONG BaseOffset, ULONG ModuleSize, - String ModuleName, String ImageName, ULONG CheckSum, ULONG TimeDateStamp) { - return vtbl.LoadModuleCallback.invoke(getPointer(), ImageFileHandle, BaseOffset, ModuleSize, - ModuleName, ImageName, CheckSum, TimeDateStamp); - } - - @Override - public HRESULT UnloadModule(String ImageBaseName, ULONGLONG BaseOffset) { - return vtbl.UnloadModuleCallback.invoke(getPointer(), ImageBaseName, BaseOffset); - } - - @Override - public HRESULT SystemError(ULONG Error, ULONG Level) { - return vtbl.SystemErrorCallback.invoke(getPointer(), Error, Level); - } - - @Override - public HRESULT SessionStatus(ULONG Status) { - return vtbl.SessionStatusCallback.invoke(getPointer(), Status); - } - - @Override - public HRESULT ChangeDebuggeeState(ULONG Flags, ULONGLONG Argument) { - return vtbl.ChangeDebuggeeStateCallback.invoke(getPointer(), Flags, Argument); - } - - @Override - public HRESULT ChangeEngineState(ULONG Flags, ULONGLONG Argument) { - return vtbl.ChangeEngineStateCallback.invoke(getPointer(), Flags, Argument); - } - - @Override - public HRESULT ChangeSymbolState(ULONG Flags, ULONGLONG Argument) { - return vtbl.ChangeSymbolStateCallback.invoke(getPointer(), Flags, Argument); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/ListenerIDebugEventCallbacksWide.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/ListenerIDebugEventCallbacksWide.java deleted file mode 100644 index c693094386..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/ListenerIDebugEventCallbacksWide.java +++ /dev/null @@ -1,185 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.event; - -import java.util.List; - -import com.sun.jna.Structure; -import com.sun.jna.WString; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgeng.jna.dbgeng.WinNTExtra.EXCEPTION_RECORD64; -import agent.dbgeng.jna.dbgeng.breakpoint.WrapIDebugBreakpoint; - -public class ListenerIDebugEventCallbacksWide extends Structure - implements IDebugEventCallbacksWide, MarkerEventCallbacks { - public static final List FIELDS = createFieldsOrder("vtbl"); - - public ListenerIDebugEventCallbacksWide(CallbackIDebugEventCallbacksWide callback) { - this.vtbl = this.constructVTable(); - this.initVTable(callback); - super.write(); - } - - public VTableIDebugEventCallbacksWide.ByReference vtbl; - - @Override - protected List getFieldOrder() { - return FIELDS; - } - - protected VTableIDebugEventCallbacksWide.ByReference constructVTable() { - return new VTableIDebugEventCallbacksWide.ByReference(); - } - - protected void initVTable(final CallbackIDebugEventCallbacksWide callback) { - vtbl.QueryInterfaceCallback = (thisPointer, refid, ppvObject) -> { - return callback.QueryInterface(refid, ppvObject); - }; - vtbl.AddRefCallback = (thisPointer) -> { - return callback.AddRef(); - }; - vtbl.ReleaseCallback = (thisPointer) -> { - return callback.Release(); - }; - vtbl.GetInterestMaskCallback = (thisPointer, Mask) -> { - return callback.GetInterestMask(Mask); - }; - vtbl.BreakpointCallback = (thisPointer, Bp) -> { - return callback.Breakpoint(Bp); - }; - vtbl.ExceptionCallback = (thisPointer, Exception, FirstChance) -> { - return callback.Exception(Exception, FirstChance); - }; - vtbl.CreateThreadCallback = (thisPointer, Handle, DataOffset, StartOffset) -> { - return callback.CreateThread(Handle, DataOffset, StartOffset); - }; - vtbl.ExitThreadCallback = (thisPointer, ExitCode) -> { - return callback.ExitThread(ExitCode); - }; - vtbl.CreateProcessCallback = (thisPointer, ImageFileHandle, Handle, BaseOffset, ModuleSize, - ModuleName, ImageName, CheckSum, TimeDateStamp, InitialThreadHandle, - ThreadDataOffset, StartOffset) -> { - return callback.CreateProcess(ImageFileHandle, Handle, BaseOffset, ModuleSize, - ModuleName, ImageName, CheckSum, TimeDateStamp, InitialThreadHandle, - ThreadDataOffset, StartOffset); - }; - vtbl.ExitProcessCallback = (thisPointer, ExitCode) -> { - return callback.ExitProcess(ExitCode); - }; - vtbl.LoadModuleCallback = (thisPointer, ImageFileHandle, BaseOffset, ModuleSize, ModuleName, - ImageName, CheckSum, TimeDateStamp) -> { - return callback.LoadModule(ImageFileHandle, BaseOffset, ModuleSize, ModuleName, - ImageName, CheckSum, TimeDateStamp); - }; - vtbl.UnloadModuleCallback = (thisPointer, ImageBaseName, BaseOffset) -> { - return callback.UnloadModule(ImageBaseName, BaseOffset); - }; - vtbl.SystemErrorCallback = (thisPointer, Error, Level) -> { - return callback.SystemError(Error, Level); - }; - vtbl.SessionStatusCallback = (thisPointer, Status) -> { - return callback.SessionStatus(Status); - }; - vtbl.ChangeDebuggeeStateCallback = (thisPointer, Flags, Argument) -> { - return callback.ChangeDebuggeeState(Flags, Argument); - }; - vtbl.ChangeEngineStateCallback = (thisPointer, Flags, Argument) -> { - return callback.ChangeEngineState(Flags, Argument); - }; - vtbl.ChangeSymbolStateCallback = (thisPointer, Flags, Argument) -> { - return callback.ChangeSymbolState(Flags, Argument); - }; - } - - @Override - public HRESULT GetInterestMask(ULONGByReference Mask) { - return vtbl.GetInterestMaskCallback.invoke(getPointer(), Mask); - } - - @Override - public HRESULT Breakpoint(WrapIDebugBreakpoint.ByReference Bp) { - return vtbl.BreakpointCallback.invoke(getPointer(), Bp); - } - - @Override - public HRESULT Exception(EXCEPTION_RECORD64.ByReference Exception, ULONG FirstChance) { - return vtbl.ExceptionCallback.invoke(getPointer(), Exception, FirstChance); - } - - @Override - public HRESULT CreateThread(ULONGLONG Handle, ULONGLONG DataOffset, ULONGLONG StartOffset) { - return vtbl.CreateThreadCallback.invoke(getPointer(), Handle, DataOffset, StartOffset); - } - - @Override - public HRESULT ExitThread(ULONG ExitCode) { - return vtbl.ExitThreadCallback.invoke(getPointer(), ExitCode); - } - - @Override - public HRESULT CreateProcess(ULONGLONG ImageFileHandle, ULONGLONG Handle, ULONGLONG BaseOffset, - ULONG ModuleSize, WString ModuleName, WString ImageName, ULONG CheckSum, - ULONG TimeDateStamp, ULONGLONG InitialThreadHandle, ULONGLONG ThreadDataOffset, - ULONGLONG StartOffset) { - return vtbl.CreateProcessCallback.invoke(getPointer(), ImageFileHandle, Handle, BaseOffset, - ModuleSize, ModuleName, ImageName, CheckSum, TimeDateStamp, InitialThreadHandle, - ThreadDataOffset, StartOffset); - } - - @Override - public HRESULT ExitProcess(ULONG ExitCode) { - return vtbl.ExitProcessCallback.invoke(getPointer(), ExitCode); - } - - @Override - public HRESULT LoadModule(ULONGLONG ImageFileHandle, ULONGLONG BaseOffset, ULONG ModuleSize, - WString ModuleName, WString ImageName, ULONG CheckSum, ULONG TimeDateStamp) { - return vtbl.LoadModuleCallback.invoke(getPointer(), ImageFileHandle, BaseOffset, ModuleSize, - ModuleName, ImageName, CheckSum, TimeDateStamp); - } - - @Override - public HRESULT UnloadModule(WString ImageBaseName, ULONGLONG BaseOffset) { - return vtbl.UnloadModuleCallback.invoke(getPointer(), ImageBaseName, BaseOffset); - } - - @Override - public HRESULT SystemError(ULONG Error, ULONG Level) { - return vtbl.SystemErrorCallback.invoke(getPointer(), Error, Level); - } - - @Override - public HRESULT SessionStatus(ULONG Status) { - return vtbl.SessionStatusCallback.invoke(getPointer(), Status); - } - - @Override - public HRESULT ChangeDebuggeeState(ULONG Flags, ULONGLONG Argument) { - return vtbl.ChangeDebuggeeStateCallback.invoke(getPointer(), Flags, Argument); - } - - @Override - public HRESULT ChangeEngineState(ULONG Flags, ULONGLONG Argument) { - return vtbl.ChangeEngineStateCallback.invoke(getPointer(), Flags, Argument); - } - - @Override - public HRESULT ChangeSymbolState(ULONG Flags, ULONGLONG Argument) { - return vtbl.ChangeSymbolStateCallback.invoke(getPointer(), Flags, Argument); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/ListenerIDebugEventContextCallbacks.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/ListenerIDebugEventContextCallbacks.java deleted file mode 100644 index 22df5c5ac8..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/ListenerIDebugEventContextCallbacks.java +++ /dev/null @@ -1,198 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.event; - -import java.util.List; - -import com.sun.jna.*; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgeng.jna.dbgeng.WinNTExtra.EXCEPTION_RECORD64; -import agent.dbgeng.jna.dbgeng.breakpoint.WrapIDebugBreakpoint2; - -public class ListenerIDebugEventContextCallbacks extends Structure - implements IDebugEventContextCallbacks, MarkerEventCallbacks { - public static final List FIELDS = createFieldsOrder("vtbl"); - - public ListenerIDebugEventContextCallbacks(CallbackIDebugEventContextCallbacks callback) { - this.vtbl = this.constructVTable(); - this.initVTable(callback); - super.write(); - } - - public VTableIDebugEventContextCallbacks.ByReference vtbl; - - @Override - protected List getFieldOrder() { - return FIELDS; - } - - protected VTableIDebugEventContextCallbacks.ByReference constructVTable() { - return new VTableIDebugEventContextCallbacks.ByReference(); - } - - protected void initVTable(final CallbackIDebugEventContextCallbacks callback) { - vtbl.QueryInterfaceCallback = (thisPointer, refid, ppvObject) -> { - return callback.QueryInterface(refid, ppvObject); - }; - vtbl.AddRefCallback = (thisPointer) -> { - return callback.AddRef(); - }; - vtbl.ReleaseCallback = (thisPointer) -> { - return callback.Release(); - }; - vtbl.GetInterestMaskCallback = (thisPointer, Mask) -> { - return callback.GetInterestMask(Mask); - }; - vtbl.BreakpointCallback = (thisPointer, Bp, Context, ContextSize) -> { - return callback.Breakpoint(Bp, Context, ContextSize); - }; - vtbl.ExceptionCallback = (thisPointer, Exception, FirstChance, Context, ContextSize) -> { - return callback.Exception(Exception, FirstChance, Context, ContextSize); - }; - vtbl.CreateThreadCallback = - (thisPointer, Handle, DataOffset, StartOffset, Context, ContextSize) -> { - return callback.CreateThread(Handle, DataOffset, StartOffset, Context, ContextSize); - }; - vtbl.ExitThreadCallback = (thisPointer, ExitCode, Context, ContextSize) -> { - return callback.ExitThread(ExitCode, Context, ContextSize); - }; - vtbl.CreateProcessCallback = (thisPointer, ImageFileHandle, Handle, BaseOffset, ModuleSize, - ModuleName, ImageName, CheckSum, TimeDateStamp, InitialThreadHandle, - ThreadDataOffset, StartOffset, Context, ContextSize) -> { - return callback.CreateProcess(ImageFileHandle, Handle, BaseOffset, ModuleSize, - ModuleName, ImageName, CheckSum, TimeDateStamp, InitialThreadHandle, - ThreadDataOffset, StartOffset, Context, ContextSize); - }; - vtbl.ExitProcessCallback = (thisPointer, ExitCode, Context, ContextSize) -> { - return callback.ExitProcess(ExitCode, Context, ContextSize); - }; - vtbl.LoadModuleCallback = (thisPointer, ImageFileHandle, BaseOffset, ModuleSize, ModuleName, - ImageName, CheckSum, TimeDateStamp, Context, ContextSize) -> { - return callback.LoadModule(ImageFileHandle, BaseOffset, ModuleSize, ModuleName, - ImageName, CheckSum, TimeDateStamp, Context, ContextSize); - }; - vtbl.UnloadModuleCallback = - (thisPointer, ImageBaseName, BaseOffset, Context, ContextSize) -> { - return callback.UnloadModule(ImageBaseName, BaseOffset, Context, ContextSize); - }; - vtbl.SystemErrorCallback = (thisPointer, Error, Level, Context, ContextSize) -> { - return callback.SystemError(Error, Level, Context, ContextSize); - }; - vtbl.SessionStatusCallback = (thisPointer, Status) -> { - return callback.SessionStatus(Status); - }; - vtbl.ChangeDebuggeeStateCallback = (thisPointer, Flags, Argument, Context, ContextSize) -> { - return callback.ChangeDebuggeeState(Flags, Argument, Context, ContextSize); - }; - vtbl.ChangeEngineStateCallback = (thisPointer, Flags, Argument, Context, ContextSize) -> { - return callback.ChangeEngineState(Flags, Argument, Context, ContextSize); - }; - vtbl.ChangeSymbolStateCallback = (thisPointer, Flags, Argument) -> { - return callback.ChangeSymbolState(Flags, Argument); - }; - } - - @Override - public HRESULT GetInterestMask(ULONGByReference Mask) { - return vtbl.GetInterestMaskCallback.invoke(getPointer(), Mask); - } - - @Override - public HRESULT Breakpoint(WrapIDebugBreakpoint2.ByReference Bp, Pointer Context, - ULONG ContextSize) { - return vtbl.BreakpointCallback.invoke(getPointer(), Bp, Context, ContextSize); - } - - @Override - public HRESULT Exception(EXCEPTION_RECORD64.ByReference Exception, ULONG FirstChance, - Pointer Context, ULONG ContextSize) { - return vtbl.ExceptionCallback.invoke(getPointer(), Exception, FirstChance, Context, - ContextSize); - } - - @Override - public HRESULT CreateThread(ULONGLONG Handle, ULONGLONG DataOffset, ULONGLONG StartOffset, - Pointer Context, ULONG ContextSize) { - return vtbl.CreateThreadCallback.invoke(getPointer(), Handle, DataOffset, StartOffset, - Context, ContextSize); - } - - @Override - public HRESULT ExitThread(ULONG ExitCode, Pointer Context, ULONG ContextSize) { - return vtbl.ExitThreadCallback.invoke(getPointer(), ExitCode, Context, ContextSize); - } - - @Override - public HRESULT CreateProcess(ULONGLONG ImageFileHandle, ULONGLONG Handle, ULONGLONG BaseOffset, - ULONG ModuleSize, WString ModuleName, WString ImageName, ULONG CheckSum, - ULONG TimeDateStamp, ULONGLONG InitialThreadHandle, ULONGLONG ThreadDataOffset, - ULONGLONG StartOffset, Pointer Context, ULONG ContextSize) { - return vtbl.CreateProcessCallback.invoke(getPointer(), ImageFileHandle, Handle, BaseOffset, - ModuleSize, ModuleName, ImageName, CheckSum, TimeDateStamp, InitialThreadHandle, - ThreadDataOffset, StartOffset, Context, ContextSize); - } - - @Override - public HRESULT ExitProcess(ULONG ExitCode, Pointer Context, ULONG ContextSize) { - return vtbl.ExitProcessCallback.invoke(getPointer(), ExitCode, Context, ContextSize); - } - - @Override - public HRESULT LoadModule(ULONGLONG ImageFileHandle, ULONGLONG BaseOffset, ULONG ModuleSize, - WString ModuleName, WString ImageName, ULONG CheckSum, ULONG TimeDateStamp, - Pointer Context, ULONG ContextSize) { - return vtbl.LoadModuleCallback.invoke(getPointer(), ImageFileHandle, BaseOffset, ModuleSize, - ModuleName, ImageName, CheckSum, TimeDateStamp, Context, ContextSize); - } - - @Override - public HRESULT UnloadModule(WString ImageBaseName, ULONGLONG BaseOffset, Pointer Context, - ULONG ContextSize) { - return vtbl.UnloadModuleCallback.invoke(getPointer(), ImageBaseName, BaseOffset, Context, - ContextSize); - } - - @Override - public HRESULT SystemError(ULONG Error, ULONG Level, Pointer Context, ULONG ContextSize) { - return vtbl.SystemErrorCallback.invoke(getPointer(), Error, Level, Context, ContextSize); - } - - @Override - public HRESULT SessionStatus(ULONG Status) { - return vtbl.SessionStatusCallback.invoke(getPointer(), Status); - } - - @Override - public HRESULT ChangeDebuggeeState(ULONG Flags, ULONGLONG Argument, Pointer Context, - ULONG ContextSize) { - return vtbl.ChangeDebuggeeStateCallback.invoke(getPointer(), Flags, Argument, Context, - ContextSize); - } - - @Override - public HRESULT ChangeEngineState(ULONG Flags, ULONGLONG Argument, Pointer Context, - ULONG ContextSize) { - return vtbl.ChangeEngineStateCallback.invoke(getPointer(), Flags, Argument, Context, - ContextSize); - } - - @Override - public HRESULT ChangeSymbolState(ULONG Flags, ULONGLONG Argument) { - return vtbl.ChangeSymbolStateCallback.invoke(getPointer(), Flags, Argument); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/MarkerEventCallbacks.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/MarkerEventCallbacks.java deleted file mode 100644 index 16bbf7593c..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/MarkerEventCallbacks.java +++ /dev/null @@ -1,20 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.event; - -public interface MarkerEventCallbacks { - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/VTableIDebugEventCallbacks.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/VTableIDebugEventCallbacks.java deleted file mode 100644 index 89c1504d6d..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/VTableIDebugEventCallbacks.java +++ /dev/null @@ -1,127 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.event; - -import java.util.List; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.win32.StdCallLibrary; - -import agent.dbgeng.jna.dbgeng.WinNTExtra.EXCEPTION_RECORD64; -import agent.dbgeng.jna.dbgeng.breakpoint.WrapIDebugBreakpoint; -import agent.dbgeng.jna.dbgeng.io.VTableIDebugInputCallbacks.*; - -public class VTableIDebugEventCallbacks extends Structure { - public static class ByReference extends VTableIDebugEventCallbacks - implements Structure.ByReference { - } - - public static final List FIELDS = createFieldsOrder("QueryInterfaceCallback", - "AddRefCallback", "ReleaseCallback", "GetInterestMaskCallback", "BreakpointCallback", - "ExceptionCallback", "CreateThreadCallback", "ExitThreadCallback", "CreateProcessCallback", - "ExitProcessCallback", "LoadModuleCallback", "UnloadModuleCallback", "SystemErrorCallback", - "SessionStatusCallback", "ChangeDebuggeeStateCallback", "ChangeEngineStateCallback", - "ChangeSymbolStateCallback"); - - public QueryInterfaceCallback QueryInterfaceCallback; - public AddRefCallback AddRefCallback; - public ReleaseCallback ReleaseCallback; - public GetInterestMaskCallback GetInterestMaskCallback; - public BreakpointCallback BreakpointCallback; - public ExceptionCallback ExceptionCallback; - public CreateThreadCallback CreateThreadCallback; - public ExitThreadCallback ExitThreadCallback; - public CreateProcessCallback CreateProcessCallback; - public ExitProcessCallback ExitProcessCallback; - public LoadModuleCallback LoadModuleCallback; - public UnloadModuleCallback UnloadModuleCallback; - public SystemErrorCallback SystemErrorCallback; - public SessionStatusCallback SessionStatusCallback; - public ChangeDebuggeeStateCallback ChangeDebuggeeStateCallback; - public ChangeEngineStateCallback ChangeEngineStateCallback; - public ChangeSymbolStateCallback ChangeSymbolStateCallback; - - @Override - public List getFieldOrder() { - return FIELDS; - } - - public static interface GetInterestMaskCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, ULONGByReference Mask); - } - - public static interface BreakpointCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, WrapIDebugBreakpoint.ByReference Bp); - } - - public static interface ExceptionCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, EXCEPTION_RECORD64.ByReference Exception, - ULONG FirstChance); - } - - public static interface CreateThreadCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, ULONGLONG Handle, ULONGLONG DataOffset, - ULONGLONG StartOffset); - } - - public static interface ExitThreadCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, ULONG ExitCode); - } - - public static interface CreateProcessCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, ULONGLONG ImageFileHandle, ULONGLONG Handle, - ULONGLONG BaseOffset, ULONG ModuleSize, String ModuleName, String ImageName, - ULONG CheckSum, ULONG TimeDateStamp, ULONGLONG InitialThreadHandle, - ULONGLONG ThreadDataOffset, ULONGLONG StartOffset); - } - - public static interface ExitProcessCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, ULONG ExitCode); - } - - public static interface LoadModuleCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, ULONGLONG ImageFileHandle, ULONGLONG BaseOffset, - ULONG ModuleSize, String ModuleName, String ImageName, ULONG CheckSum, - ULONG TimeDateStamp); - } - - public static interface UnloadModuleCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, String ImageBaseName, ULONGLONG BaseOffset); - } - - public static interface SystemErrorCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, ULONG Error, ULONG Level); - } - - public static interface SessionStatusCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, ULONG Status); - } - - public static interface ChangeDebuggeeStateCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, ULONG Flags, ULONGLONG Argument); - } - - public static interface ChangeEngineStateCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, ULONG Flags, ULONGLONG Argument); - } - - public static interface ChangeSymbolStateCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, ULONG Flags, ULONGLONG Argument); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/VTableIDebugEventCallbacksWide.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/VTableIDebugEventCallbacksWide.java deleted file mode 100644 index 385b239e2a..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/VTableIDebugEventCallbacksWide.java +++ /dev/null @@ -1,126 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.event; - -import java.util.List; - -import com.sun.jna.*; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.win32.StdCallLibrary; - -import agent.dbgeng.jna.dbgeng.WinNTExtra.EXCEPTION_RECORD64; -import agent.dbgeng.jna.dbgeng.breakpoint.WrapIDebugBreakpoint; -import agent.dbgeng.jna.dbgeng.io.VTableIDebugInputCallbacks.*; - -public class VTableIDebugEventCallbacksWide extends Structure { - public static class ByReference extends VTableIDebugEventCallbacksWide - implements Structure.ByReference { - } - - public static final List FIELDS = createFieldsOrder("QueryInterfaceCallback", - "AddRefCallback", "ReleaseCallback", "GetInterestMaskCallback", "BreakpointCallback", - "ExceptionCallback", "CreateThreadCallback", "ExitThreadCallback", "CreateProcessCallback", - "ExitProcessCallback", "LoadModuleCallback", "UnloadModuleCallback", "SystemErrorCallback", - "SessionStatusCallback", "ChangeDebuggeeStateCallback", "ChangeEngineStateCallback", - "ChangeSymbolStateCallback"); - - public QueryInterfaceCallback QueryInterfaceCallback; - public AddRefCallback AddRefCallback; - public ReleaseCallback ReleaseCallback; - public GetInterestMaskCallback GetInterestMaskCallback; - public BreakpointCallback BreakpointCallback; - public ExceptionCallback ExceptionCallback; - public CreateThreadCallback CreateThreadCallback; - public ExitThreadCallback ExitThreadCallback; - public CreateProcessCallback CreateProcessCallback; - public ExitProcessCallback ExitProcessCallback; - public LoadModuleCallback LoadModuleCallback; - public UnloadModuleCallback UnloadModuleCallback; - public SystemErrorCallback SystemErrorCallback; - public SessionStatusCallback SessionStatusCallback; - public ChangeDebuggeeStateCallback ChangeDebuggeeStateCallback; - public ChangeEngineStateCallback ChangeEngineStateCallback; - public ChangeSymbolStateCallback ChangeSymbolStateCallback; - - @Override - public List getFieldOrder() { - return FIELDS; - } - - public static interface GetInterestMaskCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, ULONGByReference Mask); - } - - public static interface BreakpointCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, WrapIDebugBreakpoint.ByReference Bp); - } - - public static interface ExceptionCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, EXCEPTION_RECORD64.ByReference Exception, - ULONG FirstChance); - } - - public static interface CreateThreadCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, ULONGLONG Handle, ULONGLONG DataOffset, - ULONGLONG StartOffset); - } - - public static interface ExitThreadCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, ULONG ExitCode); - } - - public static interface CreateProcessCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, ULONGLONG ImageFileHandle, ULONGLONG Handle, - ULONGLONG BaseOffset, ULONG ModuleSize, WString ModuleName, WString ImageName, - ULONG CheckSum, ULONG TimeDateStamp, ULONGLONG InitialThreadHandle, - ULONGLONG ThreadDataOffset, ULONGLONG StartOffset); - } - - public static interface ExitProcessCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, ULONG ExitCode); - } - - public static interface LoadModuleCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, ULONGLONG ImageFileHandle, ULONGLONG BaseOffset, - ULONG ModuleSize, WString ModuleName, WString ImageName, ULONG CheckSum, - ULONG TimeDateStamp); - } - - public static interface UnloadModuleCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, WString ImageBaseName, ULONGLONG BaseOffset); - } - - public static interface SystemErrorCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, ULONG Error, ULONG Level); - } - - public static interface SessionStatusCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, ULONG Status); - } - - public static interface ChangeDebuggeeStateCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, ULONG Flags, ULONGLONG Argument); - } - - public static interface ChangeEngineStateCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, ULONG Flags, ULONGLONG Argument); - } - - public static interface ChangeSymbolStateCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, ULONG Flags, ULONGLONG Argument); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/VTableIDebugEventContextCallbacks.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/VTableIDebugEventContextCallbacks.java deleted file mode 100644 index 45046f4635..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/event/VTableIDebugEventContextCallbacks.java +++ /dev/null @@ -1,132 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.event; - -import java.util.List; - -import com.sun.jna.*; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.win32.StdCallLibrary; - -import agent.dbgeng.jna.dbgeng.WinNTExtra.EXCEPTION_RECORD64; -import agent.dbgeng.jna.dbgeng.breakpoint.WrapIDebugBreakpoint2; -import agent.dbgeng.jna.dbgeng.io.VTableIDebugInputCallbacks.*; - -public class VTableIDebugEventContextCallbacks extends Structure { - public static class ByReference extends VTableIDebugEventContextCallbacks - implements Structure.ByReference { - } - - public static final List FIELDS = createFieldsOrder("QueryInterfaceCallback", - "AddRefCallback", "ReleaseCallback", "GetInterestMaskCallback", "BreakpointCallback", - "ExceptionCallback", "CreateThreadCallback", "ExitThreadCallback", "CreateProcessCallback", - "ExitProcessCallback", "LoadModuleCallback", "UnloadModuleCallback", "SystemErrorCallback", - "SessionStatusCallback", "ChangeDebuggeeStateCallback", "ChangeEngineStateCallback", - "ChangeSymbolStateCallback"); - - public QueryInterfaceCallback QueryInterfaceCallback; - public AddRefCallback AddRefCallback; - public ReleaseCallback ReleaseCallback; - public GetInterestMaskCallback GetInterestMaskCallback; - public BreakpointCallback BreakpointCallback; - public ExceptionCallback ExceptionCallback; - public CreateThreadCallback CreateThreadCallback; - public ExitThreadCallback ExitThreadCallback; - public CreateProcessCallback CreateProcessCallback; - public ExitProcessCallback ExitProcessCallback; - public LoadModuleCallback LoadModuleCallback; - public UnloadModuleCallback UnloadModuleCallback; - public SystemErrorCallback SystemErrorCallback; - public SessionStatusCallback SessionStatusCallback; - public ChangeDebuggeeStateCallback ChangeDebuggeeStateCallback; - public ChangeEngineStateCallback ChangeEngineStateCallback; - public ChangeSymbolStateCallback ChangeSymbolStateCallback; - - @Override - public List getFieldOrder() { - return FIELDS; - } - - public static interface GetInterestMaskCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, ULONGByReference Mask); - } - - public static interface BreakpointCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, WrapIDebugBreakpoint2.ByReference Bp, Pointer Context, - ULONG ContextSize); - } - - public static interface ExceptionCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, EXCEPTION_RECORD64.ByReference Exception, - ULONG FirstChance, Pointer Context, ULONG ContextSize); - } - - public static interface CreateThreadCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, ULONGLONG Handle, ULONGLONG DataOffset, - ULONGLONG StartOffset, Pointer Context, ULONG ContextSize); - } - - public static interface ExitThreadCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, ULONG ExitCode, Pointer Context, ULONG ContextSize); - } - - public static interface CreateProcessCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, ULONGLONG ImageFileHandle, ULONGLONG Handle, - ULONGLONG BaseOffset, ULONG ModuleSize, WString ModuleName, WString ImageName, - ULONG CheckSum, ULONG TimeDateStamp, ULONGLONG InitialThreadHandle, - ULONGLONG ThreadDataOffset, ULONGLONG StartOffset, Pointer Context, - ULONG ContextSize); - } - - public static interface ExitProcessCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, ULONG ExitCode, Pointer Context, ULONG ContextSize); - } - - public static interface LoadModuleCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, ULONGLONG ImageFileHandle, ULONGLONG BaseOffset, - ULONG ModuleSize, WString ModuleName, WString ImageName, ULONG CheckSum, - ULONG TimeDateStamp, Pointer Context, ULONG ContextSize); - } - - public static interface UnloadModuleCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, WString ImageBaseName, ULONGLONG BaseOffset, - Pointer Context, ULONG ContextSize); - } - - public static interface SystemErrorCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, ULONG Error, ULONG Level, Pointer Context, - ULONG ContextSize); - } - - public static interface SessionStatusCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, ULONG Status); - } - - public static interface ChangeDebuggeeStateCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, ULONG Flags, ULONGLONG Argument, Pointer Context, - ULONG ContextSize); - } - - public static interface ChangeEngineStateCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, ULONG Flags, ULONGLONG Argument, Pointer Context, - ULONG ContextSize); - } - - public static interface ChangeSymbolStateCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, ULONG Flags, ULONGLONG Argument); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/CallbackIDebugInputCallbacks.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/CallbackIDebugInputCallbacks.java deleted file mode 100644 index 9a5b846d01..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/CallbackIDebugInputCallbacks.java +++ /dev/null @@ -1,21 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.io; - -import com.sun.jna.platform.win32.COM.IUnknownCallback; - -public interface CallbackIDebugInputCallbacks extends IDebugInputCallbacks, IUnknownCallback { -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/CallbackIDebugOutputCallbacks.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/CallbackIDebugOutputCallbacks.java deleted file mode 100644 index ce6d65ba18..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/CallbackIDebugOutputCallbacks.java +++ /dev/null @@ -1,21 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.io; - -import com.sun.jna.platform.win32.COM.IUnknownCallback; - -public interface CallbackIDebugOutputCallbacks extends IDebugOutputCallbacks, IUnknownCallback { -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/CallbackIDebugOutputCallbacks2.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/CallbackIDebugOutputCallbacks2.java deleted file mode 100644 index 8a4331800c..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/CallbackIDebugOutputCallbacks2.java +++ /dev/null @@ -1,21 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.io; - -import com.sun.jna.platform.win32.COM.IUnknownCallback; - -public interface CallbackIDebugOutputCallbacks2 extends IDebugOutputCallbacks2, IUnknownCallback { -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/CallbackIDebugOutputCallbacksWide.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/CallbackIDebugOutputCallbacksWide.java deleted file mode 100644 index 74a951be01..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/CallbackIDebugOutputCallbacksWide.java +++ /dev/null @@ -1,22 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.io; - -import com.sun.jna.platform.win32.COM.IUnknownCallback; - -public interface CallbackIDebugOutputCallbacksWide - extends IDebugOutputCallbacksWide, IUnknownCallback { -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/IDebugInputCallbacks.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/IDebugInputCallbacks.java deleted file mode 100644 index 99a14d38d1..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/IDebugInputCallbacks.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.io; - -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -public interface IDebugInputCallbacks { - final IID IID_IDEBUG_INPUT_CALLBACKS = new IID("9f50e42c-f136-499e-9a97-73036c94ed2d"); - - HRESULT StartInput(ULONG BufferSize); - - HRESULT EndInput(); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/IDebugOutputCallbacks.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/IDebugOutputCallbacks.java deleted file mode 100644 index 80aa42a0c5..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/IDebugOutputCallbacks.java +++ /dev/null @@ -1,26 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.io; - -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -public interface IDebugOutputCallbacks { - final IID IID_IDEBUG_OUTPUT_CALLBACKS = new IID("4bf58045-d654-4c40-b0af-683090f356dc"); - - HRESULT Output(ULONG Mask, String Text); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/IDebugOutputCallbacks2.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/IDebugOutputCallbacks2.java deleted file mode 100644 index eb637fa4b1..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/IDebugOutputCallbacks2.java +++ /dev/null @@ -1,29 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.io; - -import com.sun.jna.WString; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -public interface IDebugOutputCallbacks2 extends IDebugOutputCallbacks { - final IID IID_IDEBUG_OUTPUT_CALLBACKS2 = new IID("67721fe9-56d2-4a44-a325-2b65513ce6eb"); - - HRESULT GetInterestMask(ULONGByReference Mask); - - HRESULT Output2(ULONG Which, ULONG Flags, ULONGLONG Arg, WString Text); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/IDebugOutputCallbacksWide.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/IDebugOutputCallbacksWide.java deleted file mode 100644 index 0d09bd28e9..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/IDebugOutputCallbacksWide.java +++ /dev/null @@ -1,27 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.io; - -import com.sun.jna.WString; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -public interface IDebugOutputCallbacksWide { - final IID IID_IDEBUG_OUTPUT_CALLBACKS_WIDE = new IID("4c7fd663-c394-4e26-8ef1-34ad5ed3764c"); - - HRESULT Output(ULONG Mask, WString Text); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/ListenerIDebugInputCallbacks.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/ListenerIDebugInputCallbacks.java deleted file mode 100644 index 8d6f920f17..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/ListenerIDebugInputCallbacks.java +++ /dev/null @@ -1,72 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.io; - -import java.util.List; - -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -public class ListenerIDebugInputCallbacks extends Structure - implements IDebugInputCallbacks, MarkerInputCallbacks { - public static final List FIELDS = createFieldsOrder("vtbl"); - - public ListenerIDebugInputCallbacks(CallbackIDebugInputCallbacks callback) { - this.vtbl = this.constructVTable(); - this.initVTable(callback); - super.write(); - } - - public VTableIDebugInputCallbacks.ByReference vtbl; - - @Override - protected List getFieldOrder() { - return FIELDS; - } - - protected VTableIDebugInputCallbacks.ByReference constructVTable() { - return new VTableIDebugInputCallbacks.ByReference(); - } - - protected void initVTable(final CallbackIDebugInputCallbacks callback) { - vtbl.QueryInterfaceCallback = (thisPointer, refid, ppvObject) -> { - return callback.QueryInterface(refid, ppvObject); - }; - vtbl.AddRefCallback = (thisPointer) -> { - return callback.AddRef(); - }; - vtbl.ReleaseCallback = (thisPointer) -> { - return callback.Release(); - }; - vtbl.StartInputCallback = (thisPointer, BufferSize) -> { - return callback.StartInput(BufferSize); - }; - vtbl.EndInputCallback = (thisPointer) -> { - return callback.EndInput(); - }; - } - - @Override - public HRESULT StartInput(ULONG BufferSize) { - return this.vtbl.StartInputCallback.invoke(getPointer(), BufferSize); - } - - @Override - public HRESULT EndInput() { - return this.vtbl.EndInputCallback.invoke(getPointer()); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/ListenerIDebugOutputCallbacks.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/ListenerIDebugOutputCallbacks.java deleted file mode 100644 index a6cb9aad6d..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/ListenerIDebugOutputCallbacks.java +++ /dev/null @@ -1,64 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.io; - -import java.util.List; - -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -public class ListenerIDebugOutputCallbacks extends Structure - implements IDebugOutputCallbacks, MarkerOutputCallbacks { - public static final List FIELDS = createFieldsOrder("vtbl"); - - public ListenerIDebugOutputCallbacks(CallbackIDebugOutputCallbacks callback) { - this.vtbl = this.constructVTable(); - this.initVTable(callback); - super.write(); - } - - public VTableIDebugOutputCallbacks.ByReference vtbl; - - @Override - protected List getFieldOrder() { - return FIELDS; - } - - protected VTableIDebugOutputCallbacks.ByReference constructVTable() { - return new VTableIDebugOutputCallbacks.ByReference(); - } - - protected void initVTable(final CallbackIDebugOutputCallbacks callback) { - vtbl.QueryInterfaceCallback = (thisPointer, refid, ppvObject) -> { - return callback.QueryInterface(refid, ppvObject); - }; - vtbl.AddRefCallback = (thisPointer) -> { - return callback.AddRef(); - }; - vtbl.ReleaseCallback = (thisPointer) -> { - return callback.Release(); - }; - vtbl.OutputCallback = (thisPointer, Mask, Text) -> { - return callback.Output(Mask, Text); - }; - } - - @Override - public HRESULT Output(ULONG Mask, String Text) { - return vtbl.OutputCallback.invoke(getPointer(), Mask, Text); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/ListenerIDebugOutputCallbacks2.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/ListenerIDebugOutputCallbacks2.java deleted file mode 100644 index 58ca63ce88..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/ListenerIDebugOutputCallbacks2.java +++ /dev/null @@ -1,81 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.io; - -import java.util.List; - -import com.sun.jna.Structure; -import com.sun.jna.WString; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -public class ListenerIDebugOutputCallbacks2 extends Structure - implements IDebugOutputCallbacks2, MarkerOutputCallbacks { - public static final List FIELDS = createFieldsOrder("vtbl"); - - public ListenerIDebugOutputCallbacks2(CallbackIDebugOutputCallbacks2 callback) { - this.vtbl = this.constructVTable(); - this.initVTable(callback); - super.write(); - } - - public VTableIDebugOutputCallbacks2.ByReference vtbl; - - @Override - protected List getFieldOrder() { - return FIELDS; - } - - protected VTableIDebugOutputCallbacks2.ByReference constructVTable() { - return new VTableIDebugOutputCallbacks2.ByReference(); - } - - protected void initVTable(final CallbackIDebugOutputCallbacks2 callback) { - vtbl.QueryInterfaceCallback = (thisPointer, refid, ppvObject) -> { - return callback.QueryInterface(refid, ppvObject); - }; - vtbl.AddRefCallback = (thisPointer) -> { - return callback.AddRef(); - }; - vtbl.ReleaseCallback = (thisPointer) -> { - return callback.Release(); - }; - vtbl.OutputCallback = (thisPointer, Mask, Text) -> { - return callback.Output(Mask, Text); - }; - vtbl.GetInterestMaskCallback = (thisPointer, Mask) -> { - return callback.GetInterestMask(Mask); - }; - vtbl.Output2Callback = (thisPointer, Which, Flags, Arg, Text) -> { - return callback.Output2(Which, Flags, Arg, Text); - }; - } - - @Override - public HRESULT Output(ULONG Mask, String Text) { - return vtbl.OutputCallback.invoke(getPointer(), Mask, Text); - } - - @Override - public HRESULT GetInterestMask(ULONGByReference Mask) { - return vtbl.GetInterestMaskCallback.invoke(getPointer(), Mask); - } - - @Override - public HRESULT Output2(ULONG Which, ULONG Flags, ULONGLONG Arg, WString Text) { - return vtbl.Output2Callback.invoke(getPointer(), Which, Flags, Arg, Text); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/ListenerIDebugOutputCallbacksWide.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/ListenerIDebugOutputCallbacksWide.java deleted file mode 100644 index 6f88d324af..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/ListenerIDebugOutputCallbacksWide.java +++ /dev/null @@ -1,65 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.io; - -import java.util.List; - -import com.sun.jna.Structure; -import com.sun.jna.WString; -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -public class ListenerIDebugOutputCallbacksWide extends Structure - implements IDebugOutputCallbacksWide, MarkerOutputCallbacks { - public static final List FIELDS = createFieldsOrder("vtbl"); - - public ListenerIDebugOutputCallbacksWide(CallbackIDebugOutputCallbacksWide callback) { - this.vtbl = this.constructVTable(); - this.initVTable(callback); - super.write(); - } - - public VTableIDebugOutputCallbacksWide.ByReference vtbl; - - @Override - protected List getFieldOrder() { - return FIELDS; - } - - protected VTableIDebugOutputCallbacksWide.ByReference constructVTable() { - return new VTableIDebugOutputCallbacksWide.ByReference(); - } - - protected void initVTable(final CallbackIDebugOutputCallbacksWide callback) { - vtbl.QueryInterfaceCallback = (thisPointer, refid, ppvObject) -> { - return callback.QueryInterface(refid, ppvObject); - }; - vtbl.AddRefCallback = (thisPointer) -> { - return callback.AddRef(); - }; - vtbl.ReleaseCallback = (thisPointer) -> { - return callback.Release(); - }; - vtbl.OutputCallback = (thisPointer, Mask, Text) -> { - return callback.Output(Mask, Text); - }; - } - - @Override - public HRESULT Output(ULONG Mask, WString Text) { - return vtbl.OutputCallback.invoke(getPointer(), Mask, Text); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/MarkerInputCallbacks.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/MarkerInputCallbacks.java deleted file mode 100644 index dfd8167b3c..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/MarkerInputCallbacks.java +++ /dev/null @@ -1,20 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.io; - -public interface MarkerInputCallbacks { - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/MarkerOutputCallbacks.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/MarkerOutputCallbacks.java deleted file mode 100644 index 6650813e5c..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/MarkerOutputCallbacks.java +++ /dev/null @@ -1,20 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.io; - -public interface MarkerOutputCallbacks { - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/VTableIDebugInputCallbacks.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/VTableIDebugInputCallbacks.java deleted file mode 100644 index c84c3e78b6..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/VTableIDebugInputCallbacks.java +++ /dev/null @@ -1,66 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.io; - -import java.util.List; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.Guid.REFIID; -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; -import com.sun.jna.win32.StdCallLibrary; - -public class VTableIDebugInputCallbacks extends Structure { - public static class ByReference extends VTableIDebugInputCallbacks - implements Structure.ByReference { - } - - public static final List FIELDS = createFieldsOrder("QueryInterfaceCallback", - "AddRefCallback", "ReleaseCallback", "StartInputCallback", "EndInputCallback"); - - public QueryInterfaceCallback QueryInterfaceCallback; - public AddRefCallback AddRefCallback; - public ReleaseCallback ReleaseCallback; - public StartInputCallback StartInputCallback; - public EndInputCallback EndInputCallback; - - @Override - public List getFieldOrder() { - return FIELDS; - } - - public static interface QueryInterfaceCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, REFIID refid, PointerByReference ppvObject); - } - - public static interface AddRefCallback extends StdCallLibrary.StdCallCallback { - int invoke(Pointer thisPointer); - } - - public static interface ReleaseCallback extends StdCallLibrary.StdCallCallback { - int invoke(Pointer thisPointer); - } - - public static interface StartInputCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, ULONG BufferSize); - } - - public static interface EndInputCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/VTableIDebugOutputCallbacks.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/VTableIDebugOutputCallbacks.java deleted file mode 100644 index 0c05469f3b..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/VTableIDebugOutputCallbacks.java +++ /dev/null @@ -1,61 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.io; - -import java.util.List; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.Guid.REFIID; -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; -import com.sun.jna.win32.StdCallLibrary; - -public class VTableIDebugOutputCallbacks extends Structure { - public static class ByReference extends VTableIDebugOutputCallbacks - implements Structure.ByReference { - } - - public static final List FIELDS = createFieldsOrder("QueryInterfaceCallback", - "AddRefCallback", "ReleaseCallback", "OutputCallback"); - - public QueryInterfaceCallback QueryInterfaceCallback; - public AddRefCallback AddRefCallback; - public ReleaseCallback ReleaseCallback; - public OutputCallback OutputCallback; - - @Override - public List getFieldOrder() { - return FIELDS; - } - - public static interface QueryInterfaceCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, REFIID refid, PointerByReference ppvObject); - } - - public static interface AddRefCallback extends StdCallLibrary.StdCallCallback { - int invoke(Pointer thisPointer); - } - - public static interface ReleaseCallback extends StdCallLibrary.StdCallCallback { - int invoke(Pointer thisPointer); - } - - public static interface OutputCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, ULONG Mask, String Text); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/VTableIDebugOutputCallbacks2.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/VTableIDebugOutputCallbacks2.java deleted file mode 100644 index b8afc09848..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/VTableIDebugOutputCallbacks2.java +++ /dev/null @@ -1,50 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.io; - -import java.util.List; - -import com.sun.jna.*; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.win32.StdCallLibrary; - -public class VTableIDebugOutputCallbacks2 extends VTableIDebugOutputCallbacks { - public static class ByReference extends VTableIDebugOutputCallbacks2 - implements Structure.ByReference { - } - - @SuppressWarnings("hiding") - public static final List FIELDS = - createFieldsOrder("QueryInterfaceCallback", "AddRefCallback", "ReleaseCallback", - "OutputCallback", "GetInterestMaskCallback", "Output2Callback"); - - public GetInterestMaskCallback GetInterestMaskCallback; - public Output2Callback Output2Callback; - - @Override - public List getFieldOrder() { - return FIELDS; - } - - public static interface GetInterestMaskCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, ULONGByReference Mask); - } - - public static interface Output2Callback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, ULONG Which, ULONG Flags, ULONGLONG Arg, WString Text); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/VTableIDebugOutputCallbacksWide.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/VTableIDebugOutputCallbacksWide.java deleted file mode 100644 index bc1484ef77..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/io/VTableIDebugOutputCallbacksWide.java +++ /dev/null @@ -1,60 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.io; - -import java.util.List; - -import com.sun.jna.*; -import com.sun.jna.platform.win32.Guid.REFIID; -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; -import com.sun.jna.win32.StdCallLibrary; - -public class VTableIDebugOutputCallbacksWide extends Structure { - public static class ByReference extends VTableIDebugOutputCallbacksWide - implements Structure.ByReference { - } - - public static final List FIELDS = createFieldsOrder("QueryInterfaceCallback", - "AddRefCallback", "ReleaseCallback", "OutputCallback"); - - public QueryInterfaceCallback QueryInterfaceCallback; - public AddRefCallback AddRefCallback; - public ReleaseCallback ReleaseCallback; - public OutputCallback OutputCallback; - - @Override - public List getFieldOrder() { - return FIELDS; - } - - public static interface QueryInterfaceCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, REFIID refid, PointerByReference ppvObject); - } - - public static interface AddRefCallback extends StdCallLibrary.StdCallCallback { - int invoke(Pointer thisPointer); - } - - public static interface ReleaseCallback extends StdCallLibrary.StdCallCallback { - int invoke(Pointer thisPointer); - } - - public static interface OutputCallback extends StdCallLibrary.StdCallCallback { - HRESULT invoke(Pointer thisPointer, ULONG Mask, WString Text); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/registers/IDebugRegisters.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/registers/IDebugRegisters.java deleted file mode 100644 index b928556307..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/registers/IDebugRegisters.java +++ /dev/null @@ -1,75 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.registers; - -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgeng.jna.dbgeng.DbgEngNative.DEBUG_REGISTER_DESCRIPTION; -import agent.dbgeng.jna.dbgeng.DbgEngNative.DEBUG_VALUE; -import agent.dbgeng.jna.dbgeng.UnknownWithUtils.VTableIndex; - -import com.sun.jna.platform.win32.COM.IUnknown; - -public interface IDebugRegisters extends IUnknown { - final IID IID_IDEBUG_REGISTERS = new IID("ce289126-9e84-45a7-937e-67bb18691493"); - - enum VTIndices implements VTableIndex { - GET_NUMBER_REGISTERS, // - GET_DESCRIPTION, // - GET_INDEX_BY_NAME, // - GET_VALUE, // - SET_VALUE, // - GET_VALUES, // - SET_VALUES, // - OUTPUT_REGISTERS, // - GET_INSTRUCTION_OFFSET, // - GET_STACK_OFFSET, // - GET_FRAME_OFFSET, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT GetNumberRegisters(ULONGByReference Number); - - HRESULT GetDescription(ULONG Register, byte[] NameBuffer, ULONG NameBufferSize, - ULONGByReference NameSize, DEBUG_REGISTER_DESCRIPTION.ByReference Desc); - - HRESULT GetIndexByName(String Name, ULONGByReference Index); - - HRESULT GetValue(ULONG Register, DEBUG_VALUE.ByReference Value); - - HRESULT SetValue(ULONG Register, DEBUG_VALUE.ByReference Value); - - HRESULT GetValues(ULONG Count, ULONG[] Indices, ULONG Start, DEBUG_VALUE[] Values); - - HRESULT SetValues(ULONG Count, ULONG[] Indices, ULONG Start, DEBUG_VALUE[] Values); - - HRESULT OutputRegisters(ULONG OutputControl, ULONG Flags); - - HRESULT GetInstructionOffset(ULONGLONGByReference Offset); - - HRESULT GetStackOffset(ULONGLONGByReference Offset); - - HRESULT GetFrameOffset(ULONGLONGByReference Offset); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/registers/IDebugRegisters2.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/registers/IDebugRegisters2.java deleted file mode 100644 index 629b5a7e0f..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/registers/IDebugRegisters2.java +++ /dev/null @@ -1,92 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.registers; - -import com.sun.jna.WString; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgeng.jna.dbgeng.DbgEngNative.DEBUG_REGISTER_DESCRIPTION; -import agent.dbgeng.jna.dbgeng.DbgEngNative.DEBUG_VALUE; -import agent.dbgeng.jna.dbgeng.UnknownWithUtils.VTableIndex; - -public interface IDebugRegisters2 extends IDebugRegisters { - final IID IID_IDEBUG_REGISTERS2 = new IID("1656afa9-19c6-4e3a-97e7-5dc9160cf9c4"); - - enum VTIndices2 implements VTableIndex { - GET_DESCRIPTION_WIDE, // - GET_INDEX_BY_NAME_WIDE, // - GET_NUMBER_PSEUDO_REGISTERS, // - GET_PSEUDO_DESCRIPTION, // - GET_PSEUDO_DESCRIPTION_WIDE, // - GET_PSEUDO_INDEX_BY_NAME, // - GET_PSEUDO_INDEX_BY_NAME_WIDE, // - GET_PSEUDO_VALUES, // - SET_PSEUDO_VALUES, // - GET_VALUES2, // - SET_VALUES2, // - OUTPUT_REGISTERS2, // - GET_INSTRUCTION_OFFSET2, // - GET_STACK_OFFSET2, // - GET_FRAME_OFFSET2, // - ; - - static int start = VTableIndex.follow(VTIndices.class); - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT GetDescriptionWide(ULONG Register, char[] NameBuffer, ULONG NameBufferSize, - ULONGByReference NameSize, DEBUG_REGISTER_DESCRIPTION.ByReference Desc); - - HRESULT GetIndexByNameWide(WString Name, ULONGByReference Index); - - HRESULT GetNumberPseudoRegisters(ULONGByReference Number); - - HRESULT GetPseudoDescription(ULONG Register, byte[] NameBuffer, ULONG NameBufferSize, - ULONGByReference NameSize, ULONGLONGByReference TypeModule, ULONGByReference TypeId); - - HRESULT GetPseudoDescriptionWide(ULONG Register, char[] NameBuffer, ULONG NameBufferSize, - ULONGByReference NameSize, ULONGLONGByReference TypeModule, ULONGByReference TypeId); - - HRESULT GetPseudoIndexByName(String Name, ULONGByReference Index); - - HRESULT GetPseudoIndexByNameWide(WString Name, ULONGByReference Index); - - HRESULT GetPseudoValues(ULONG Source, ULONG Count, ULONG[] Indices, ULONG Start, - DEBUG_VALUE[] Values); - - HRESULT SetPseudoValues(ULONG Source, ULONG Count, ULONG[] Indices, ULONG Start, - DEBUG_VALUE[] Values); - - HRESULT GetValues2(ULONG Source, ULONG Count, ULONG[] Indices, ULONG Start, - DEBUG_VALUE[] Values); - - HRESULT SetValues2(ULONG Source, ULONG Count, ULONG[] Indices, ULONG Start, - DEBUG_VALUE[] Values); - - HRESULT OutputRegisters2(ULONG OutputControl, ULONG Source, ULONG Flags); - - HRESULT GetInstructionOffset2(ULONG Source, ULONGLONGByReference Offset); - - HRESULT GetStackOffset2(ULONG Source, ULONGLONGByReference Offset); - - HRESULT GetFrameOffset2(ULONG Source, ULONGLONGByReference Offset); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/registers/WrapIDebugRegisters.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/registers/WrapIDebugRegisters.java deleted file mode 100644 index 74543c7291..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/registers/WrapIDebugRegisters.java +++ /dev/null @@ -1,94 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.registers; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgeng.jna.dbgeng.UnknownWithUtils; -import agent.dbgeng.jna.dbgeng.DbgEngNative.DEBUG_REGISTER_DESCRIPTION; -import agent.dbgeng.jna.dbgeng.DbgEngNative.DEBUG_VALUE; - -public class WrapIDebugRegisters extends UnknownWithUtils implements IDebugRegisters { - public static class ByReference extends WrapIDebugRegisters implements Structure.ByReference { - } - - public WrapIDebugRegisters() { - } - - public WrapIDebugRegisters(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT GetNumberRegisters(ULONGByReference Number) { - return _invokeHR(VTIndices.GET_NUMBER_REGISTERS, getPointer(), Number); - } - - @Override - public HRESULT GetDescription(ULONG Register, byte[] NameBuffer, ULONG NameBufferSize, - ULONGByReference NameSize, DEBUG_REGISTER_DESCRIPTION.ByReference Desc) { - return _invokeHR(VTIndices.GET_DESCRIPTION, getPointer(), Register, NameBuffer, - NameBufferSize, NameSize, Desc); - } - - @Override - public HRESULT GetIndexByName(String Name, ULONGByReference Index) { - return _invokeHR(VTIndices.GET_INDEX_BY_NAME, getPointer(), Name, Index); - } - - @Override - public HRESULT GetValue(ULONG Register, DEBUG_VALUE.ByReference Value) { - return _invokeHR(VTIndices.GET_VALUE, getPointer(), Register, Value); - } - - @Override - public HRESULT SetValue(ULONG Register, DEBUG_VALUE.ByReference Value) { - return _invokeHR(VTIndices.SET_VALUE, getPointer(), Register, Value); - } - - @Override - public HRESULT GetValues(ULONG Count, ULONG[] Indices, ULONG Start, DEBUG_VALUE[] Values) { - return _invokeHR(VTIndices.GET_VALUES, getPointer(), Count, Indices, Start, Values); - } - - @Override - public HRESULT SetValues(ULONG Count, ULONG[] Indices, ULONG Start, DEBUG_VALUE[] Values) { - return _invokeHR(VTIndices.SET_VALUES, getPointer(), Count, Indices, Start, Values); - } - - @Override - public HRESULT OutputRegisters(ULONG OutputControl, ULONG Flags) { - return _invokeHR(VTIndices.OUTPUT_REGISTERS, getPointer(), OutputControl, Flags); - } - - @Override - public HRESULT GetInstructionOffset(ULONGLONGByReference Offset) { - return _invokeHR(VTIndices.GET_INSTRUCTION_OFFSET, getPointer(), Offset); - } - - @Override - public HRESULT GetStackOffset(ULONGLONGByReference Offset) { - return _invokeHR(VTIndices.GET_STACK_OFFSET, getPointer(), Offset); - } - - @Override - public HRESULT GetFrameOffset(ULONGLONGByReference Offset) { - return _invokeHR(VTIndices.GET_FRAME_OFFSET, getPointer(), Offset); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/registers/WrapIDebugRegisters2.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/registers/WrapIDebugRegisters2.java deleted file mode 100644 index ea414f067b..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/registers/WrapIDebugRegisters2.java +++ /dev/null @@ -1,124 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.registers; - -import com.sun.jna.*; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgeng.jna.dbgeng.DbgEngNative.DEBUG_REGISTER_DESCRIPTION; -import agent.dbgeng.jna.dbgeng.DbgEngNative.DEBUG_VALUE; - -public class WrapIDebugRegisters2 extends WrapIDebugRegisters implements IDebugRegisters2 { - public static class ByReference extends WrapIDebugRegisters2 implements Structure.ByReference { - } - - public WrapIDebugRegisters2() { - } - - public WrapIDebugRegisters2(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT GetDescriptionWide(ULONG Register, char[] NameBuffer, ULONG NameBufferSize, - ULONGByReference NameSize, DEBUG_REGISTER_DESCRIPTION.ByReference Desc) { - return _invokeHR(VTIndices2.GET_DESCRIPTION_WIDE, getPointer(), Register, NameBuffer, - NameBufferSize, NameSize, Desc); - } - - @Override - public HRESULT GetIndexByNameWide(WString Name, ULONGByReference Index) { - return _invokeHR(VTIndices2.GET_INDEX_BY_NAME_WIDE, getPointer(), Name, Index); - } - - @Override - public HRESULT GetNumberPseudoRegisters(ULONGByReference Number) { - return _invokeHR(VTIndices2.GET_NUMBER_PSEUDO_REGISTERS, getPointer(), Number); - } - - @Override - public HRESULT GetPseudoDescription(ULONG Register, byte[] NameBuffer, ULONG NameBufferSize, - ULONGByReference NameSize, ULONGLONGByReference TypeModule, ULONGByReference TypeId) { - return _invokeHR(VTIndices2.GET_PSEUDO_DESCRIPTION, getPointer(), Register, NameBuffer, - NameBufferSize, NameSize, TypeModule, TypeId); - } - - @Override - public HRESULT GetPseudoDescriptionWide(ULONG Register, char[] NameBuffer, ULONG NameBufferSize, - ULONGByReference NameSize, ULONGLONGByReference TypeModule, ULONGByReference TypeId) { - return _invokeHR(VTIndices2.GET_PSEUDO_DESCRIPTION_WIDE, getPointer(), Register, NameBuffer, - NameBufferSize, NameSize, TypeModule, TypeId); - } - - @Override - public HRESULT GetPseudoIndexByName(String Name, ULONGByReference Index) { - return _invokeHR(VTIndices2.GET_PSEUDO_INDEX_BY_NAME, getPointer(), Name, Index); - } - - @Override - public HRESULT GetPseudoIndexByNameWide(WString Name, ULONGByReference Index) { - return _invokeHR(VTIndices2.GET_PSEUDO_INDEX_BY_NAME_WIDE, getPointer(), Name, Index); - } - - @Override - public HRESULT GetPseudoValues(ULONG Source, ULONG Count, ULONG[] Indices, ULONG Start, - DEBUG_VALUE[] Values) { - return _invokeHR(VTIndices2.GET_PSEUDO_VALUES, getPointer(), Source, Count, Indices, Start, - Values); - } - - @Override - public HRESULT SetPseudoValues(ULONG Source, ULONG Count, ULONG[] Indices, ULONG Start, - DEBUG_VALUE[] Values) { - return _invokeHR(VTIndices2.SET_PSEUDO_VALUES, getPointer(), Source, Count, Indices, Start, - Values); - } - - @Override - public HRESULT GetValues2(ULONG Source, ULONG Count, ULONG[] Indices, ULONG Start, - DEBUG_VALUE[] Values) { - return _invokeHR(VTIndices2.GET_VALUES2, getPointer(), Source, Count, Indices, Start, - Values); - } - - @Override - public HRESULT SetValues2(ULONG Source, ULONG Count, ULONG[] Indices, ULONG Start, - DEBUG_VALUE[] Values) { - return _invokeHR(VTIndices2.SET_VALUES2, getPointer(), Source, Count, Indices, Start, - Values); - } - - @Override - public HRESULT OutputRegisters2(ULONG OutputControl, ULONG Source, ULONG Flags) { - return _invokeHR(VTIndices2.OUTPUT_REGISTERS2, getPointer(), OutputControl, Source, Flags); - } - - @Override - public HRESULT GetInstructionOffset2(ULONG Source, ULONGLONGByReference Offset) { - return _invokeHR(VTIndices2.GET_INSTRUCTION_OFFSET2, getPointer(), Source, Offset); - } - - @Override - public HRESULT GetStackOffset2(ULONG Source, ULONGLONGByReference Offset) { - return _invokeHR(VTIndices2.GET_STACK_OFFSET2, getPointer(), Source, Offset); - } - - @Override - public HRESULT GetFrameOffset2(ULONG Source, ULONGLONGByReference Offset) { - return _invokeHR(VTIndices2.GET_FRAME_OFFSET2, getPointer(), Source, Offset); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/IDebugSymbolGroup.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/IDebugSymbolGroup.java deleted file mode 100644 index e19111c88a..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/IDebugSymbolGroup.java +++ /dev/null @@ -1,22 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.symbols; - -import com.sun.jna.platform.win32.Guid.IID; - -public interface IDebugSymbolGroup { - final IID IID_IDEBUG_SYMBOL_GROUP = new IID("f2528316-0f1a-4431-aeed-11d096e1e2ab"); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/IDebugSymbolGroup2.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/IDebugSymbolGroup2.java deleted file mode 100644 index 179a5686a4..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/IDebugSymbolGroup2.java +++ /dev/null @@ -1,22 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.symbols; - -import com.sun.jna.platform.win32.Guid.IID; - -public interface IDebugSymbolGroup2 { - final IID IID_IDEBUG_SYMBOL_GROUP2 = new IID("6a7ccc5f-fb5e-4dcc-b41c-6c20307bccc7"); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/IDebugSymbols.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/IDebugSymbols.java deleted file mode 100644 index ae7fae16e2..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/IDebugSymbols.java +++ /dev/null @@ -1,123 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.symbols; - -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.platform.win32.COM.IUnknown; - -import agent.dbgeng.jna.dbgeng.DbgEngNative.DEBUG_MODULE_PARAMETERS; -import agent.dbgeng.jna.dbgeng.UnknownWithUtils.VTableIndex; - -public interface IDebugSymbols extends IUnknown { - final IID IID_IDEBUG_SYMBOLS = new IID("8c31e98c-983a-48a5-9016-6fe5d667a950"); - - enum VTIndices implements VTableIndex { - GET_SYMBOL_OPTIONS, // - ADD_SYMBOL_OPTIONS, // - REMOVE_SYMBOL_OPTIONS, // - SET_SYMBOL_OPTIONS, // - GET_NAME_BY_OFFSET, // - GET_OFFSET_BY_NAME, // - GET_NEAR_NAME_BY_OFFSET, // - GET_LINE_BY_OFFSET, // - GET_OFFSET_BY_LINE, // - GET_NUMBER_MODULES, // - GET_MODULE_BY_INDEX, // - GET_MODULE_BY_MODULE_NAME, // - GET_MODULE_BY_OFFSET, // - GET_MODULE_NAMES, // - GET_MODULE_PARAMETERS, // - GET_SYMBOL_MODULE, // - GET_TYPE_NAME, // - GET_TYPE_ID, // - GET_TYPE_SIZE, // - GET_FIELD_OFFSET, // - GET_SYMBOL_TYPE_ID, // - GET_OFFSET_TYPE_ID, // - READ_TYPED_DATA_VIRTUAL, // - WRITE_TYPED_DATA_VIRTUAL, // - OUTPUT_TYPED_DATA_VIRTUAL, // - READ_TYPED_DATA_PHYSICAL, // - WRITE_TYPED_DATA_PHYSICAL, // - OUTPUT_TYPED_DATA_PHYSICAL, // - GET_SCOPE, // - SET_SCOPE, // - RESET_SCOPE, // - GET_SCOPE_SYMBOL_GROUP, // - CREATE_SYMBOL_GROUP, // - START_SYMBOL_MATCH, // - GET_NEXT_SYMBOL_MATCH, // - END_SYMBOL_MATCH, // - RELOAD, // - GET_SYMBOL_PATH, // - SET_SYMBOL_PATH, // - APPEND_SYMBOL_PATH, // - GET_IMAGE_PATH, // - SET_IMAGE_PATH, // - APPEND_IMAGE_PATH, // - GET_SOURCE_PATH, // - GET_SOURCE_PATH_ELEMENT, // - SET_SOURCE_PATH, // - APPEND_SOURCE_PATH, // - FIND_SOURCE_FILE, // - GET_SOURCE_FILE_LINE_OFFSETS, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT GetNumberModules(ULONGByReference Loaded, ULONGByReference Unloaded); - - HRESULT GetModuleByIndex(ULONG Index, ULONGLONGByReference Base); - - HRESULT GetModuleByModuleName(String Name, ULONG StartIndex, ULONGByReference Index, - ULONGLONGByReference Base); - - HRESULT GetModuleByOffset(ULONGLONG Offset, ULONG StartIndex, ULONGByReference Index, - ULONGLONGByReference Base); - - HRESULT GetModuleNames(ULONG Index, ULONGLONG Base, byte[] ImageNameBuffer, - ULONG ImageNameBufferSize, ULONGByReference ImageNameSize, byte[] ModuleNameBuffer, - ULONG ModuleNameBufferSize, ULONGByReference ModuleNameSize, - byte[] LoadedImageNameBuffer, ULONG LoadedImageNameBufferSize, - ULONGByReference LoadedImageNameSize); - - HRESULT GetModuleParameters(ULONG Count, ULONGLONGByReference Bases, ULONG Start, - DEBUG_MODULE_PARAMETERS.ByReference Params); - - HRESULT StartSymbolMatch(String Pattern, ULONGLONGByReference Handle); - - HRESULT GetNextSymbolMatch(ULONGLONG Handle, byte[] Buffer, ULONG BufferSize, - ULONGByReference MatchSize, ULONGLONGByReference Offset); - - HRESULT EndSymbolMatch(ULONGLONG Handle); - - HRESULT GetSymbolPath(byte[] aBuffer, ULONG value, Object object); - - HRESULT SetSymbolPath(String Path); - - HRESULT GetSymbolOptions(); - - HRESULT SetSymbolOptions(ULONG Options); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/IDebugSymbols2.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/IDebugSymbols2.java deleted file mode 100644 index c6808457aa..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/IDebugSymbols2.java +++ /dev/null @@ -1,48 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.symbols; - -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgeng.jna.dbgeng.UnknownWithUtils.VTableIndex; - -public interface IDebugSymbols2 extends IDebugSymbols { - final IID IID_IDEBUG_SYMBOLS2 = new IID("3a707211-afdd-4495-ad4f-56fecdf8163f"); - - enum VTIndices2 implements VTableIndex { - GET_MODULE_VERSION_INFORMATION, // - GET_MODULE_NAME_STRING, // - GET_CONSTANT_NAME, // - GET_FIELD_NAME, // - GET_TYPE_OPTIONS, // - ADD_TYPE_OPTIONS, // - REMOVE_TYPE_OPTIONS, // - SET_TYPE_OPTIONS, // - ; - - static int start = VTableIndex.follow(VTIndices.class); - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT GetModuleNameString(ULONG Which, ULONG Index, ULONGLONG Base, byte[] Buffer, - ULONG BufferSize, ULONGByReference NameSize); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/IDebugSymbols3.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/IDebugSymbols3.java deleted file mode 100644 index 37090b650f..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/IDebugSymbols3.java +++ /dev/null @@ -1,130 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.symbols; - -import com.sun.jna.WString; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgeng.jna.dbgeng.DbgEngNative.DEBUG_MODULE_AND_ID; -import agent.dbgeng.jna.dbgeng.DbgEngNative.DEBUG_SYMBOL_ENTRY; -import agent.dbgeng.jna.dbgeng.UnknownWithUtils.VTableIndex; - -public interface IDebugSymbols3 extends IDebugSymbols2 { - final IID IID_IDEBUG_SYMBOLS3 = new IID("f02fbecc-50ac-4f36-9ad9-c975e8f32ff8"); - - enum VTIndices3 implements VTableIndex { - GET_NAME_BY_OFFSET_WIDE, // - GET_OFFSET_BY_NAME_WIDE, // - GET_NEAR_NAME_BY_OFFSET_WIDE, // - GET_LINE_BY_OFFSET_WIDE, // - GET_OFFSET_BY_LINE_WIDE, // - GET_MODULE_BY_MODULE_NAME_WIDE, // - GET_SYMBOL_MODULE_WIDE, // - GET_TYPED_NAME_WIDE, // - GET_TYPE_ID_WIDE, // - GET_FIELD_OFFSET_WIDE, // - GET_SYMBOL_TYPE_ID_WIDE, // - GET_SCOPE_SYMBOL_GROUP2, // - CREATE_SYMBOL_GROUP2, // - START_SYMBOL_MATCH_WIDE, // - GET_NEXT_SYMBOL_MATCH_WIDE, // - RELOAD_WIDE, // - GET_SYMBOL_PATH_WIDE, // - SET_SYMBOL_PATH_WIDE, // - APPEND_SYMBOL_PATH_WIDE, // - GET_IMAGE_PATH_WIDE, // - SET_IMAGE_PATH_WIDE, // - APPEND_IMAGE_PATH_WIDE, // - GET_SOURCE_PATH_WIDE, // - GET_SOURCE_PATH_ELEMENT_WIDE, // - SET_SOURCE_PATH_WIDE, // - APPEND_SOURCE_PATH_WIDE, // - FIND_SOURCE_FILE_WIDE, // - GET_SOURCE_FILE_LINE_OFFSETS_WIDE, // - GET_MODULE_VERSION_INFORMATION_WIDE, // - GET_MODULE_NAME_STRING_WIDE, // - GET_CONSTANT_NAME_WIDE, // - GET_FIELD_NAME_WIDE, // - IS_MANAGED_MODULE, // - GET_MODULE_BY_MODULE_NAME2, // - GET_MODULE_BY_MODULE_NAME2_WIDE, // - GET_MODULE_BY_OFFSET2, // - ADD_SYNTHETIC_MODULE, // - ADD_SYNTHETIC_MODULE_WIDE, // - REMOVE_SYNTHETIC_MODULE, // - GET_CURRENT_SCOPE_FRAME_INDEX, // - SET_SCOPE_FRAME_BY_INDEX, // - SET_SCOPE_FROM_JIT_DEBUG_INFO, // - SET_SCOPE_FROM_STORED_EVENT, // - OUTPUT_SYMBOL_BY_OFFSET, // - GET_FUNCTION_ENTRY_BY_OFFSET, // - GET_FIELD_TYPE_AND_OFFSET, // - GET_FIELD_TYPE_AND_OFFSET_WIDE, // - ADD_SYNTHETIC_SYMBOL, // - ADD_SYNTHETIC_SYMBOL_WIDE, // - REMOVE_SYNTHETIC_SYMBOL, // - GET_SYMBOL_ENTRIES_BY_OFFSET, // - GET_SYMBOL_ENTRIES_BY_NAME, // - GET_SYMBOL_ENTRIES_BY_NAME_WIDE, // - GET_SYMBOL_ENTRY_BY_TOKEN, // - GET_SYMBOL_ENTRY_INFORMATION, // - GET_SYMBOL_ENTRY_STRING, // - GET_SYMBOL_ENTRY_STRING_WIDE, // - GET_SYMBOL_ENTRY_OFFSET_REGIONS, // - GET_SYMBOL_ENTRY_BY_SYMBOL_ENTRY, // - GET_SOURCE_ENTRIES_BY_OFFSET, // - GET_SOURCE_ENTRIES_BY_LINE, // - GET_SOURCE_ENTRIES_BY_LINE_WIDE, // - GET_SOURCE_ENTRY_STRING, // - GET_SOURCE_ENTRY_STRING_WIDE, // - GET_SOURCE_ENTRY_OFFSET_REGIONS, // - GET_SOURCE_ENTRY_BY_SOURCE_ENTRY, // - ; - - static int start = VTableIndex.follow(VTIndices2.class); - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT GetCurrentScopeFrameIndex(ULONGByReference Index); - - HRESULT SetCurrentScopeFrameIndex(ULONG Index); - - HRESULT GetModuleByModuleNameWide(WString Name, ULONG StartIndex, ULONGByReference Index, - ULONGLONGByReference Base); - - HRESULT GetModuleNameStringWide(ULONG Which, ULONG Index, ULONGLONG Base, char[] Buffer, - ULONG BufferSize, ULONGByReference NameSize); - - HRESULT GetSymbolEntriesByName(String Symbol, ULONG Flags, DEBUG_MODULE_AND_ID[] Ids, - ULONG IdsCount, ULONGByReference Entries); - - HRESULT GetSymbolEntriesByNameWide(WString Symbol, ULONG Flags, DEBUG_MODULE_AND_ID[] Ids, - ULONG IdsCount, ULONGByReference Entries); - - HRESULT GetSymbolEntryInformation(DEBUG_MODULE_AND_ID Id, DEBUG_SYMBOL_ENTRY.ByReference Info); - - HRESULT GetSymbolEntryString(DEBUG_MODULE_AND_ID Id, ULONG Which, byte[] Buffer, - ULONG BufferSize, ULONGByReference StringSize); - - HRESULT GetSymbolEntryStringWide(DEBUG_MODULE_AND_ID Id, ULONG Which, char[] Buffer, - ULONG BufferSize, ULONGByReference StringSize); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/IDebugSymbols4.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/IDebugSymbols4.java deleted file mode 100644 index 8d35a5581c..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/IDebugSymbols4.java +++ /dev/null @@ -1,42 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.symbols; - -import com.sun.jna.platform.win32.Guid.IID; - -import agent.dbgeng.jna.dbgeng.UnknownWithUtils.VTableIndex; - -public interface IDebugSymbols4 extends IDebugSymbols3 { - final IID IID_IDEBUG_SYMBOLS4 = new IID("e391bbd8-9d8c-4418-840b-c006592a1752"); - - enum VTIndices4 implements VTableIndex { - GET_SCOPE_EX, // - SET_SCOPE_EX, // - GET_NAME_BY_INLINE_CONTEXT, // - GET_NAME_BY_INLINE_CONTEXT_WIDE, // - GET_LINE_BY_INLINE_CONTEXT, // - GET_LINE_BY_INLINE_CONTEXT_WIDE, // - OUTPUT_SYMBOL_BY_INLINE_CONTEXT, // - ; - - static int start = VTableIndex.follow(VTIndices3.class); - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/IDebugSymbols5.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/IDebugSymbols5.java deleted file mode 100644 index d43f4ba75b..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/IDebugSymbols5.java +++ /dev/null @@ -1,37 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.symbols; - -import com.sun.jna.platform.win32.Guid.IID; - -import agent.dbgeng.jna.dbgeng.UnknownWithUtils.VTableIndex; - -public interface IDebugSymbols5 extends IDebugSymbols4 { - final IID IID_IDEBUG_SYMBOLS5 = new IID("c65fa83e-1e69-475e-8e0e-b5d79e9cc17e"); - - enum VTIndices5 implements VTableIndex { - GET_CURRENT_SCOPE_FRAME_INDEX_EX, // - SET_SCOPE_FRAME_BY_INDEX_EX, // - ; - - static int start = VTableIndex.follow(VTIndices4.class); - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/WrapIDebugSymbols.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/WrapIDebugSymbols.java deleted file mode 100644 index a59faae5ef..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/WrapIDebugSymbols.java +++ /dev/null @@ -1,116 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.symbols; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgeng.jna.dbgeng.DbgEngNative.DEBUG_MODULE_PARAMETERS; -import agent.dbgeng.jna.dbgeng.UnknownWithUtils; - -public class WrapIDebugSymbols extends UnknownWithUtils implements IDebugSymbols { - public static class ByReference extends WrapIDebugSymbols implements Structure.ByReference { - } - - public WrapIDebugSymbols() { - } - - public WrapIDebugSymbols(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT GetNumberModules(ULONGByReference Loaded, ULONGByReference Unloaded) { - return _invokeHR(VTIndices.GET_NUMBER_MODULES, getPointer(), Loaded, Unloaded); - } - - @Override - public HRESULT GetModuleByIndex(ULONG Index, ULONGLONGByReference Base) { - return _invokeHR(VTIndices.GET_MODULE_BY_INDEX, getPointer(), Index, Base); - } - - @Override - public HRESULT GetModuleByModuleName(String Name, ULONG StartIndex, ULONGByReference Index, - ULONGLONGByReference Base) { - return _invokeHR(VTIndices.GET_MODULE_BY_MODULE_NAME, getPointer(), Name, StartIndex, Index, - Base); - } - - @Override - public HRESULT GetModuleByOffset(ULONGLONG Offset, ULONG StartIndex, ULONGByReference Index, - ULONGLONGByReference Base) { - return _invokeHR(VTIndices.GET_MODULE_BY_OFFSET, getPointer(), Offset, StartIndex, Index, - Base); - } - - @Override - public HRESULT GetModuleNames(ULONG Index, ULONGLONG Base, byte[] ImageNameBuffer, - ULONG ImageNameBufferSize, ULONGByReference ImageNameSize, byte[] ModuleNameBuffer, - ULONG ModuleNameBufferSize, ULONGByReference ModuleNameSize, - byte[] LoadedImageNameBuffer, ULONG LoadedImageNameBufferSize, - ULONGByReference LoadedImageNameSize) { - return _invokeHR(VTIndices.GET_MODULE_NAMES, getPointer(), Index, Base, ImageNameBuffer, - ImageNameBufferSize, ImageNameSize, ModuleNameBuffer, ModuleNameBufferSize, - ModuleNameSize, LoadedImageNameBuffer, LoadedImageNameBufferSize, LoadedImageNameSize); - } - - @Override - public HRESULT GetModuleParameters(ULONG Count, ULONGLONGByReference Bases, ULONG Start, - DEBUG_MODULE_PARAMETERS.ByReference Params) { - return _invokeHR(VTIndices.GET_MODULE_PARAMETERS, getPointer(), Count, Bases, Start, - Params); - } - - @Override - public HRESULT StartSymbolMatch(String Pattern, ULONGLONGByReference Handle) { - return _invokeHR(VTIndices.START_SYMBOL_MATCH, getPointer(), Pattern, Handle); - } - - @Override - public HRESULT GetNextSymbolMatch(ULONGLONG Handle, byte[] Buffer, ULONG BufferSize, - ULONGByReference MatchSize, ULONGLONGByReference Offset) { - return _invokeHR(VTIndices.GET_NEXT_SYMBOL_MATCH, getPointer(), Handle, Buffer, BufferSize, - MatchSize, Offset); - } - - @Override - public HRESULT EndSymbolMatch(ULONGLONG Handle) { - return _invokeHR(VTIndices.END_SYMBOL_MATCH, getPointer(), Handle); - } - - @Override - public HRESULT GetSymbolPath(byte[] aBuffer, ULONG value, Object object) { - return _invokeHR(VTIndices.GET_SYMBOL_PATH, getPointer(), aBuffer, value, object); - } - - @Override - public HRESULT SetSymbolPath(String Path) { - return _invokeHR(VTIndices.SET_SYMBOL_PATH, getPointer(), Path); - } - - @Override - public HRESULT GetSymbolOptions() { - return _invokeHR(VTIndices.GET_SYMBOL_OPTIONS, getPointer()); - } - - @Override - public HRESULT SetSymbolOptions(ULONG Options) { - return _invokeHR(VTIndices.SET_SYMBOL_OPTIONS, getPointer(), Options); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/WrapIDebugSymbols2.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/WrapIDebugSymbols2.java deleted file mode 100644 index f0bbb77223..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/WrapIDebugSymbols2.java +++ /dev/null @@ -1,40 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.symbols; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -public class WrapIDebugSymbols2 extends WrapIDebugSymbols implements IDebugSymbols2 { - public static class ByReference extends WrapIDebugSymbols2 implements Structure.ByReference { - } - - public WrapIDebugSymbols2() { - } - - public WrapIDebugSymbols2(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT GetModuleNameString(ULONG Which, ULONG Index, ULONGLONG Base, byte[] Buffer, - ULONG BufferSize, ULONGByReference NameSize) { - return _invokeHR(VTIndices2.GET_MODULE_NAME_STRING, getPointer(), Which, Index, Base, - Buffer, BufferSize, NameSize); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/WrapIDebugSymbols3.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/WrapIDebugSymbols3.java deleted file mode 100644 index 281aa29c5c..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/WrapIDebugSymbols3.java +++ /dev/null @@ -1,93 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.symbols; - -import com.sun.jna.*; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgeng.jna.dbgeng.DbgEngNative.DEBUG_MODULE_AND_ID; -import agent.dbgeng.jna.dbgeng.DbgEngNative.DEBUG_SYMBOL_ENTRY; - -public class WrapIDebugSymbols3 extends WrapIDebugSymbols2 implements IDebugSymbols3 { - public static class ByReference extends WrapIDebugSymbols3 implements Structure.ByReference { - } - - public WrapIDebugSymbols3() { - } - - public WrapIDebugSymbols3(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT GetCurrentScopeFrameIndex(ULONGByReference Index) { - return _invokeHR(VTIndices3.GET_CURRENT_SCOPE_FRAME_INDEX, getPointer(), Index); - } - - @Override - public HRESULT SetCurrentScopeFrameIndex(ULONG Index) { - return _invokeHR(VTIndices3.SET_SCOPE_FRAME_BY_INDEX, getPointer(), Index); - } - - @Override - public HRESULT GetModuleByModuleNameWide(WString Name, ULONG StartIndex, ULONGByReference Index, - ULONGLONGByReference Base) { - return _invokeHR(VTIndices3.GET_MODULE_BY_MODULE_NAME_WIDE, getPointer(), Name, StartIndex, - Index, Base); - } - - @Override - public HRESULT GetModuleNameStringWide(ULONG Which, ULONG Index, ULONGLONG Base, char[] Buffer, - ULONG BufferSize, ULONGByReference NameSize) { - return _invokeHR(VTIndices3.GET_MODULE_NAME_STRING_WIDE, getPointer(), Which, Index, Base, - Buffer, BufferSize, NameSize); - } - - @Override - public HRESULT GetSymbolEntriesByName(String Symbol, ULONG Flags, DEBUG_MODULE_AND_ID[] Ids, - ULONG IdsCount, ULONGByReference Entries) { - return _invokeHR(VTIndices3.GET_SYMBOL_ENTRIES_BY_NAME, getPointer(), Symbol, Flags, Ids, - IdsCount, Entries); - } - - @Override - public HRESULT GetSymbolEntriesByNameWide(WString Symbol, ULONG Flags, - DEBUG_MODULE_AND_ID[] Ids, ULONG IdsCount, ULONGByReference Entries) { - return _invokeHR(VTIndices3.GET_SYMBOL_ENTRIES_BY_NAME_WIDE, getPointer(), Symbol, Flags, - Ids, IdsCount, Entries); - } - - @Override - public HRESULT GetSymbolEntryInformation(DEBUG_MODULE_AND_ID Id, - DEBUG_SYMBOL_ENTRY.ByReference Info) { - return _invokeHR(VTIndices3.GET_SYMBOL_ENTRY_INFORMATION, getPointer(), Id, Info); - } - - @Override - public HRESULT GetSymbolEntryString(DEBUG_MODULE_AND_ID Id, ULONG Which, byte[] Buffer, - ULONG BufferSize, ULONGByReference StringSize) { - return _invokeHR(VTIndices3.GET_SYMBOL_ENTRY_STRING, getPointer(), Id, Which, Buffer, - BufferSize, StringSize); - } - - @Override - public HRESULT GetSymbolEntryStringWide(DEBUG_MODULE_AND_ID Id, ULONG Which, char[] Buffer, - ULONG BufferSize, ULONGByReference StringSize) { - return _invokeHR(VTIndices3.GET_SYMBOL_ENTRY_STRING_WIDE, getPointer(), Id, Which, Buffer, - BufferSize, StringSize); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/WrapIDebugSymbols4.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/WrapIDebugSymbols4.java deleted file mode 100644 index c820f7d346..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/WrapIDebugSymbols4.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.symbols; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; - -public class WrapIDebugSymbols4 extends WrapIDebugSymbols3 implements IDebugSymbols4 { - public static class ByReference extends WrapIDebugSymbols4 implements Structure.ByReference { - } - - public WrapIDebugSymbols4() { - } - - public WrapIDebugSymbols4(Pointer pvInstance) { - super(pvInstance); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/WrapIDebugSymbols5.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/WrapIDebugSymbols5.java deleted file mode 100644 index 21d78a5087..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/symbols/WrapIDebugSymbols5.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.symbols; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; - -public class WrapIDebugSymbols5 extends WrapIDebugSymbols4 implements IDebugSymbols5 { - public static class ByReference extends WrapIDebugSymbols5 implements Structure.ByReference { - } - - public WrapIDebugSymbols5() { - } - - public WrapIDebugSymbols5(Pointer pvInstance) { - super(pvInstance); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/sysobj/IDebugSystemObjects.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/sysobj/IDebugSystemObjects.java deleted file mode 100644 index 57c4144b60..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/sysobj/IDebugSystemObjects.java +++ /dev/null @@ -1,108 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.sysobj; - -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.platform.win32.COM.IUnknown; - -import agent.dbgeng.jna.dbgeng.UnknownWithUtils.VTableIndex; - -public interface IDebugSystemObjects extends IUnknown { - final IID IID_IDEBUG_SYSTEM_OBJECTS = new IID("6b86fe2c-2c4f-4f0c-9da2-174311acc327"); - - enum VTIndices implements VTableIndex { - GET_EVENT_THREAD, // - GET_EVENT_PROCESS, // - GET_CURRENT_THREAD_ID, // - SET_CURRENT_THREAD_ID, // - GET_CURRENT_PROCESS_ID, // - SET_CURRENT_PROCESS_ID, // - GET_NUMBER_THREADS, // - GET_TOTAL_NUMBER_THREADS, // - GET_THREAD_IDS_BY_INDEX, // - GET_THREAD_ID_BY_PROCESSOR, // - GET_CURRENT_THREAD_DATA_OFFSET, // - GET_THREAD_ID_BY_DATA_OFFSET, // - GET_CURRENT_THREAD_TEB, // - GET_THREAD_ID_BY_TEB, // - GET_CURRENT_THREAD_SYSTEM_ID, // - GET_THREAD_ID_BY_SYSTEM_ID, // - GET_CURRENT_THREAD_HANDLE, // - GET_THREAD_ID_BY_HANDLE, // - GET_NUMBER_PROCESSES, // - GET_PROCESS_IDS_BY_INDEX, // - GET_CURRENT_PROCESS_DATA_OFFSET, // - GET_PROCESS_ID_BY_DATA_OFFSET, // - GET_CURRENT_PROCESS_PEB, // - GET_PROCESS_ID_BY_PEB, // - GET_CURRENT_PROCESS_SYSTEM_ID, // - GET_PROCESS_ID_BY_SYSTEM_ID, // - GET_CURRENT_PROCESS_HANDLE, // - GET_PROCESS_ID_BY_HANDLE, // - GET_CURRENT_PROCESS_EXECUTABLE_NAME, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT GetEventThread(ULONGByReference Id); - - HRESULT GetEventProcess(ULONGByReference Id); - - HRESULT GetCurrentThreadId(ULONGByReference Id); - - HRESULT SetCurrentThreadId(ULONG Id); - - HRESULT GetCurrentProcessId(ULONGByReference Id); - - HRESULT SetCurrentProcessId(ULONG Id); - - HRESULT GetNumberThreads(ULONGByReference Number); - - HRESULT GetTotalNumberThreads(ULONGByReference Total, ULONGByReference LargestProcess); - - HRESULT GetThreadIdsByIndex(ULONG Start, ULONG Count, ULONG[] Ids, ULONG[] SysIds); - - HRESULT GetThreadIdByHandle(ULONGLONG Handle, ULONGByReference Id); - - HRESULT GetNumberProcesses(ULONGByReference Number); - - HRESULT GetProcessIdsByIndex(ULONG Start, ULONG Count, ULONG[] Ids, ULONG[] SysIds); - - HRESULT GetProcessIdByHandle(ULONGLONG Handle, ULONGByReference Id); - - HRESULT GetCurrentThreadSystemId(ULONGByReference SysId); - - HRESULT GetCurrentProcessSystemId(ULONGByReference SysId); - - HRESULT GetThreadIdBySystemId(ULONG SystemId, ULONGByReference Id); - - HRESULT GetProcessIdBySystemId(ULONG SystemId, ULONGByReference Id); - - HRESULT GetCurrentThreadDataOffset(ULONGLONGByReference SysOffset); - - HRESULT GetCurrentProcessDataOffset(ULONGLONGByReference SysOffset); - - HRESULT GetCurrentProcessExecutableName(byte[] Buffer, ULONG BufferSize, ULONGByReference ExeSize); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/sysobj/IDebugSystemObjects2.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/sysobj/IDebugSystemObjects2.java deleted file mode 100644 index 8866b85115..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/sysobj/IDebugSystemObjects2.java +++ /dev/null @@ -1,52 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.sysobj; - -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.ULONGLONG; -import com.sun.jna.platform.win32.WinDef.ULONGLONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgeng.jna.dbgeng.UnknownWithUtils.VTableIndex; - -public interface IDebugSystemObjects2 extends IDebugSystemObjects { - final IID IID_IDEBUG_SYSTEM_OBJECTS2 = new IID("0ae9f5ff-1852-4679-b055-494bee6407ee"); - - enum VTIndices2 implements VTableIndex { - GET_CURRENT_PROCESS_UP_TIME, // - GET_IMPLICIT_THREAD_DATA_OFFSET, // - SET_IMPLICIT_THREAD_DATA_OFFSET, // - GET_IMPLICIT_PROCESS_DATA_OFFSET, // - SET_IMPLICIT_PROCESS_DATA_OFFSET, // - ; - - static int start = VTableIndex.follow(VTIndices.class); - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT GetImplicitThreadDataOffset(ULONGLONGByReference SysOffset); - - HRESULT GetImplicitProcessDataOffset(ULONGLONGByReference SysOffset); - - HRESULT SetImplicitThreadDataOffset(ULONGLONG SysOffset); - - HRESULT SetImplicitProcessDataOffset(ULONGLONG SysOffset); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/sysobj/IDebugSystemObjects3.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/sysobj/IDebugSystemObjects3.java deleted file mode 100644 index 971584b399..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/sysobj/IDebugSystemObjects3.java +++ /dev/null @@ -1,57 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.sysobj; - -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinDef.ULONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgeng.jna.dbgeng.UnknownWithUtils.VTableIndex; - -public interface IDebugSystemObjects3 extends IDebugSystemObjects2 { - final IID IID_IDEBUG_SYSTEM_OBJECTS3 = new IID("e9676e2f-e286-4ea3-b0f9-dfe5d9fc330e"); - - enum VTIndices3 implements VTableIndex { - GET_EVENT_SYSTEM, // - GET_CURRENT_SYSTEM_ID, // - SET_CURRENT_SYSTEM_ID, // - GET_NUMBER_SYSTEMS, // - GET_SYSTEM_IDS_BY_INDEX, // - GET_TOTAL_NUMBER_THREADS_AND_PROCESSES, // - GET_CURRENT_SYSTEM_SERER, // - GET_SYSTEM_BY_SERVER, // - GET_CURRENT_SYSTEM_SERVER_NAME, // - ; - - static int start = VTableIndex.follow(VTIndices2.class); - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT GetEventSystem(ULONGByReference Id); - - HRESULT GetCurrentSystemId(ULONGByReference Id); - - HRESULT SetCurrentSystemId(ULONG Id); - - HRESULT GetNumberSystems(ULONGByReference Number); - - HRESULT GetSystemIdsByIndex(ULONG Start, ULONG Count, ULONG[] Ids, ULONG[] SysIds); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/sysobj/IDebugSystemObjects4.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/sysobj/IDebugSystemObjects4.java deleted file mode 100644 index d4d0212259..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/sysobj/IDebugSystemObjects4.java +++ /dev/null @@ -1,37 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.sysobj; - -import com.sun.jna.platform.win32.Guid.IID; - -import agent.dbgeng.jna.dbgeng.UnknownWithUtils.VTableIndex; - -public interface IDebugSystemObjects4 extends IDebugSystemObjects3 { - final IID IID_IDEBUG_SYSTEM_OBJECTS4 = new IID("489468e6-7d0f-4af5-87ab-25207454d553"); - - enum VTIndices4 implements VTableIndex { - GET_CURRENT_PROCESS_EXECUTABLE_NAME_WIDE, // - GET_CURRENT_SYSTEM_SERVER_NAME_WIDE, // - ; - - static int start = VTableIndex.follow(VTIndices3.class); - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/sysobj/WrapIDebugSystemObjects.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/sysobj/WrapIDebugSystemObjects.java deleted file mode 100644 index ce1b153792..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/sysobj/WrapIDebugSystemObjects.java +++ /dev/null @@ -1,142 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.sysobj; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinDef.ULONGByReference; -import com.sun.jna.platform.win32.WinDef.ULONGLONG; -import com.sun.jna.platform.win32.WinDef.ULONGLONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgeng.jna.dbgeng.UnknownWithUtils; - -public class WrapIDebugSystemObjects extends UnknownWithUtils implements IDebugSystemObjects { - public static class ByReference extends WrapIDebugSystemObjects - implements Structure.ByReference { - } - - public WrapIDebugSystemObjects() { - } - - public WrapIDebugSystemObjects(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT GetEventThread(ULONGByReference Id) { - return _invokeHR(VTIndices.GET_EVENT_THREAD, getPointer(), Id); - } - - @Override - public HRESULT GetEventProcess(ULONGByReference Id) { - return _invokeHR(VTIndices.GET_EVENT_PROCESS, getPointer(), Id); - } - - @Override - public HRESULT GetCurrentThreadId(ULONGByReference Id) { - return _invokeHR(VTIndices.GET_CURRENT_THREAD_ID, getPointer(), Id); - } - - @Override - public HRESULT SetCurrentThreadId(ULONG Id) { - return _invokeHR(VTIndices.SET_CURRENT_THREAD_ID, getPointer(), Id); - } - - @Override - public HRESULT GetCurrentProcessId(ULONGByReference Id) { - return _invokeHR(VTIndices.GET_CURRENT_PROCESS_ID, getPointer(), Id); - } - - @Override - public HRESULT SetCurrentProcessId(ULONG Id) { - return _invokeHR(VTIndices.SET_CURRENT_PROCESS_ID, getPointer(), Id); - } - - @Override - public HRESULT GetNumberThreads(ULONGByReference Number) { - return _invokeHR(VTIndices.GET_NUMBER_THREADS, getPointer(), Number); - } - - @Override - public HRESULT GetTotalNumberThreads(ULONGByReference Total, ULONGByReference LargestProcess) { - return _invokeHR(VTIndices.GET_TOTAL_NUMBER_THREADS, getPointer(), Total, LargestProcess); - } - - @Override - public HRESULT GetThreadIdsByIndex(ULONG Start, ULONG Count, ULONG[] Ids, ULONG[] SysIds) { - return _invokeHR(VTIndices.GET_THREAD_IDS_BY_INDEX, getPointer(), Start, Count, Ids, - SysIds); - } - - @Override - public HRESULT GetThreadIdByHandle(ULONGLONG Handle, ULONGByReference Id) { - return _invokeHR(VTIndices.GET_THREAD_ID_BY_HANDLE, getPointer(), Handle, Id); - } - - @Override - public HRESULT GetThreadIdBySystemId(ULONG SystemId, ULONGByReference Id) { - return _invokeHR(VTIndices.GET_THREAD_ID_BY_SYSTEM_ID, getPointer(), SystemId, Id); - } - - @Override - public HRESULT GetProcessIdBySystemId(ULONG SystemId, ULONGByReference Id) { - return _invokeHR(VTIndices.GET_PROCESS_ID_BY_SYSTEM_ID, getPointer(), SystemId, Id); - } - - @Override - public HRESULT GetNumberProcesses(ULONGByReference Number) { - return _invokeHR(VTIndices.GET_NUMBER_PROCESSES, getPointer(), Number); - } - - @Override - public HRESULT GetProcessIdsByIndex(ULONG Start, ULONG Count, ULONG[] Ids, ULONG[] SysIds) { - return _invokeHR(VTIndices.GET_PROCESS_IDS_BY_INDEX, getPointer(), Start, Count, Ids, - SysIds); - } - - @Override - public HRESULT GetProcessIdByHandle(ULONGLONG Handle, ULONGByReference Id) { - return _invokeHR(VTIndices.GET_PROCESS_ID_BY_HANDLE, getPointer(), Handle, Id); - } - - @Override - public HRESULT GetCurrentThreadSystemId(ULONGByReference SysId) { - return _invokeHR(VTIndices.GET_CURRENT_THREAD_SYSTEM_ID, getPointer(), SysId); - } - - @Override - public HRESULT GetCurrentProcessSystemId(ULONGByReference SysId) { - return _invokeHR(VTIndices.GET_CURRENT_PROCESS_SYSTEM_ID, getPointer(), SysId); - } - - @Override - public HRESULT GetCurrentThreadDataOffset(ULONGLONGByReference SysOffset) { - return _invokeHR(VTIndices.GET_CURRENT_THREAD_DATA_OFFSET, getPointer(), SysOffset); - } - - @Override - public HRESULT GetCurrentProcessDataOffset(ULONGLONGByReference SysOffset) { - return _invokeHR(VTIndices.GET_CURRENT_PROCESS_DATA_OFFSET, getPointer(), SysOffset); - } - - @Override - public HRESULT GetCurrentProcessExecutableName(byte[] Buffer, ULONG BufferSize, ULONGByReference ExeSize) { - return _invokeHR(VTIndices.GET_CURRENT_PROCESS_EXECUTABLE_NAME, getPointer(), Buffer, BufferSize, ExeSize); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/sysobj/WrapIDebugSystemObjects2.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/sysobj/WrapIDebugSystemObjects2.java deleted file mode 100644 index d8d1d7097c..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/sysobj/WrapIDebugSystemObjects2.java +++ /dev/null @@ -1,59 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.sysobj; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinDef.ULONGLONG; -import com.sun.jna.platform.win32.WinDef.ULONGLONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgeng.jna.dbgeng.sysobj.IDebugSystemObjects2.VTIndices2; - -public class WrapIDebugSystemObjects2 extends WrapIDebugSystemObjects - implements IDebugSystemObjects2 { - public static class ByReference extends WrapIDebugSystemObjects2 - implements Structure.ByReference { - } - - public WrapIDebugSystemObjects2() { - } - - public WrapIDebugSystemObjects2(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT GetImplicitThreadDataOffset(ULONGLONGByReference SysOffset) { - return _invokeHR(VTIndices2.GET_IMPLICIT_THREAD_DATA_OFFSET, getPointer(), SysOffset); - } - - @Override - public HRESULT GetImplicitProcessDataOffset(ULONGLONGByReference SysOffset) { - return _invokeHR(VTIndices2.GET_IMPLICIT_PROCESS_DATA_OFFSET, getPointer(), SysOffset); - } - - @Override - public HRESULT SetImplicitThreadDataOffset(ULONGLONG SysOffset) { - return _invokeHR(VTIndices2.SET_IMPLICIT_THREAD_DATA_OFFSET, getPointer(), SysOffset); - } - - @Override - public HRESULT SetImplicitProcessDataOffset(ULONGLONG SysOffset) { - return _invokeHR(VTIndices2.SET_IMPLICIT_PROCESS_DATA_OFFSET, getPointer(), SysOffset); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/sysobj/WrapIDebugSystemObjects3.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/sysobj/WrapIDebugSystemObjects3.java deleted file mode 100644 index daea46df9e..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/sysobj/WrapIDebugSystemObjects3.java +++ /dev/null @@ -1,63 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.sysobj; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinDef.ULONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -public class WrapIDebugSystemObjects3 extends WrapIDebugSystemObjects2 - implements IDebugSystemObjects3 { - public static class ByReference extends WrapIDebugSystemObjects3 - implements Structure.ByReference { - } - - public WrapIDebugSystemObjects3() { - } - - public WrapIDebugSystemObjects3(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT GetEventSystem(ULONGByReference Id) { - return _invokeHR(VTIndices3.GET_EVENT_SYSTEM, getPointer(), Id); - } - - @Override - public HRESULT GetCurrentSystemId(ULONGByReference Id) { - return _invokeHR(VTIndices3.GET_CURRENT_SYSTEM_ID, getPointer(), Id); - } - - @Override - public HRESULT SetCurrentSystemId(ULONG Id) { - return _invokeHR(VTIndices3.SET_CURRENT_SYSTEM_ID, getPointer(), Id); - } - - @Override - public HRESULT GetNumberSystems(ULONGByReference Number) { - return _invokeHR(VTIndices3.GET_NUMBER_SYSTEMS, getPointer(), Number); - } - - @Override - public HRESULT GetSystemIdsByIndex(ULONG Start, ULONG Count, ULONG[] Ids, ULONG[] SysIds) { - return _invokeHR(VTIndices3.GET_SYSTEM_IDS_BY_INDEX, getPointer(), Start, Count, Ids, - SysIds); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/sysobj/WrapIDebugSystemObjects4.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/sysobj/WrapIDebugSystemObjects4.java deleted file mode 100644 index 8d760e6fea..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/dbgeng/sysobj/WrapIDebugSystemObjects4.java +++ /dev/null @@ -1,33 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.dbgeng.sysobj; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; - -public class WrapIDebugSystemObjects4 extends WrapIDebugSystemObjects3 - implements IDebugSystemObjects4 { - public static class ByReference extends WrapIDebugSystemObjects4 - implements Structure.ByReference { - } - - public WrapIDebugSystemObjects4() { - } - - public WrapIDebugSystemObjects4(Pointer pvInstance) { - super(pvInstance); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/javaprovider/JavaProviderNative.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/javaprovider/JavaProviderNative.java deleted file mode 100644 index 024df0908e..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/jna/javaprovider/JavaProviderNative.java +++ /dev/null @@ -1,25 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.jna.javaprovider; - -import com.sun.jna.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -public interface JavaProviderNative extends Library { - JavaProviderNative INSTANCE = Native.loadLibrary("javaprovider", JavaProviderNative.class); - - HRESULT createClient(Pointer client); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgCause.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgCause.java deleted file mode 100644 index 37fbf0954f..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgCause.java +++ /dev/null @@ -1,33 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager; - -import agent.dbgeng.manager.cmd.DbgPendingCommand; - -/** - * Identifies the cause of an event emitted by dbgeng - * - * This is not a concept native to dbgeng. Rather, it is a means to distinguish events that result - * from commands issued by the {@link DbgManager} from those issued by the user or some other means. - * For example, a call to {@link DbgManager#addProcess()} will emit a - * {@link DbgEventsListener#processAdded(DbgProcess, DbgCause)} event, identifying the - * {@link DbgPendingCommand} as the cause. - */ -public interface DbgCause { - public enum Causes implements DbgCause { - UNCLAIMED; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgCommand.java deleted file mode 100644 index 7d9421cce8..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgCommand.java +++ /dev/null @@ -1,79 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager; - -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.manager.cmd.AbstractDbgCommand; -import agent.dbgeng.manager.cmd.DbgPendingCommand; - -/** - * The interface for Dbg command implementations - * - * Commands are executed by Dbg in serial. In order to distinguish the likely cause of events, the - * manager will wait to issue each command until it has seen a prompt. Thus, commands are queued up, - * and the manager uses the {@link CompletableFuture} pattern to "return" results after execution - * completes. Once issued, a command is presumed to be executing until another prompt is received. - * This generally immediately follows the command result, i.e., the "^..." result line in Dbg/MI. - * The command implementation is responsible for handling the command result. Implementors ought to - * use {@link AbstractDbgCommand} to ensure consistent processing. - * - * To begin executing the command, the manager invokes the command, using {@link #invoke()}. Any - * event that occurs during command execution is given to - * {@link #handle(DbgEvent, DbgPendingCommand)}. The implementor then has the option to "claim" or - * "steal" the event. When claimed, any subsequent event processor or listener is provided this - * command as the event's cause. When stolen, no subsequent event processors are called. The - * implementation ought to keep a list of claimed and stolen events. Once Dbg has finished executing - * the command, the manager calls {@link #complete(DbgPendingCommand)}, allowing the implementation - * to process its claimed and stolen events and return the result of the command. - * - * @param the type of object "returned" by the command - */ -public interface DbgCommand { - - /** - * Check if this command can be executed given Dbg's current state - * - * @param state Dbg's state - * @return true if it can be executed, false otherwise - */ - public boolean validInState(DbgState state); - - /** - * Invoke the command - */ - public void invoke(); - - /** - * Handle an event that ocurred during the execution of this command - * - * @param evt the event - * @param pending a copy of the executing command instance - * @return true if the command is now ready to be completed - */ - public boolean handle(DbgEvent evt, DbgPendingCommand pending); - - /** - * Called when the manager believes this command is finished executing - * - * This is presumed when the manager receives the prompt after issuing the encoded command - * - * @param pending a copy of the now-finished-executing command instance - * @return the object "returned" by the command - */ - public T complete(DbgPendingCommand pending); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgEvent.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgEvent.java deleted file mode 100644 index f02114b727..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgEvent.java +++ /dev/null @@ -1,63 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager; - -import agent.dbgeng.manager.cmd.DbgPendingCommand; - -public interface DbgEvent { - /** - * Get the information detailing the event - * - * @return the information - */ - public T getInfo(); - - /** - * Use {@link DbgPendingCommand#claim(DbgEvent)} instead - * - * @param cause the cause - */ - public void claim(DbgPendingCommand cause); - - /** - * If claimed, get the cause of this event - * - * @return the cause - */ - public DbgCause getCause(); - - /** - * Use {@link DbgPendingCommand#steal(DbgEvent)} instead - */ - public void steal(); - - /** - * Check if this event is stolen - * - * A stolen event should not be processed further, except by the thief - * - * @return true if stolen, false otherwise - */ - public boolean isStolen(); - - /** - * If this event implies a new dbgeng state, get that state - * - * @return the new state, or null for no change - */ - public DbgState newState(); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgEventFilter.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgEventFilter.java deleted file mode 100644 index 26af765ed8..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgEventFilter.java +++ /dev/null @@ -1,36 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager; - -public interface DbgEventFilter { - - int getIndex(); - - String getName(); - - String getArg(); - - String getCmd(); - - int getExecutionOption(); - - void setExecutionOption(int executionOption); - - int getContinueOption(); - - void setContinueOption(int continueOption); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgEventHandler.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgEventHandler.java deleted file mode 100644 index 2a75ed4f14..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgEventHandler.java +++ /dev/null @@ -1,62 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager; - -import agent.dbgeng.manager.cmd.DbgPendingCommand; - -public interface DbgEventHandler { - /** - * Get the information detailing the event - * - * @return the information - */ - public T getInfo(); - - /** - * Use {@link DbgPendingCommand#claim(DbgEventHandler)} instead - * - * @param cause the cause - */ - public void claim(DbgPendingCommand cause); - - /** - * If claimed, get the cause of this event - * - * @return the cause - */ - public DbgCause getCause(); - - /** - * Use {@link DbgPendingCommand#steal(DbgEventHandler)} instead - */ - public void steal(); - - /** - * Check if this event is stolen - * - * A stolen event should not be processed further, except by the thief - * - * @return true if stolen, false otherwise - */ - public boolean isStolen(); - - /** - * If this event implies a new dbgeng state, get that state - * - * @return the new state, or null for no change - */ - public DbgState newState(); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgEventsListener.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgEventsListener.java deleted file mode 100644 index 768fa6361b..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgEventsListener.java +++ /dev/null @@ -1,262 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager; - -import agent.dbgeng.dbgeng.*; -import agent.dbgeng.manager.breakpoint.DbgBreakpointInfo; -import agent.dbgeng.manager.evt.AbstractDbgEvent; - -public interface DbgEventsListener { - - /** - * A session has been added - * - * @param session a handle to the new session - * @param cause the cause of this event - */ - void sessionAdded(DbgSession session, DbgCause cause); - - /** - * A session has been removed - * - * @param sessionId the ID of the now-defunct session - * @param cause the cause of this event - */ - void sessionRemoved(DebugSessionId sessionId, DbgCause cause); - - /** - * A different session has been selected (gained focus) - * - * @param session a handle to the selected session - * @param cause the cause of this event - */ - void sessionSelected(DbgSession session, DbgCause cause); - - /** - * An Process has been added to the session - * - * @param process a handle to the new process - * @param cause the cause of this event - */ - void processAdded(DbgProcess process, DbgCause cause); - - /** - * An process has been removed from the session - * - * @param processId the ID of the now-defunct process - * @param cause the cause of this event - */ - void processRemoved(DebugProcessId processId, DbgCause cause); - - /** - * A different process has been selected (gained focus) - * - * @param process a handle to the selected process - * @param cause the cause of this event - */ - void processSelected(DbgProcess process, DbgCause cause); - - /** - * Execution has been started in an process - * - * @param process a handle to the now-executing process - * @param cause the cause of this event - */ - void processStarted(DbgProcess process, DbgCause cause); - - /** - * Execution has terminated in an process - * - * @param process a handle to the now-stopped process - * @param cause the cause of this event - */ - void processExited(DbgProcess process, DbgCause cause); - - /** - * A thread has been created - * - * Use {@link DbgThread#getProcess()} to get a handle to the process in which the thread was - * created. - * - * @param thread a handle to the new thread - * @param cause the cause of this event - */ - void threadCreated(DbgThread thread, DbgCause cause); - - /** - * A thread's state has changed, e.g., {@link DbgState#RUNNING} to {@link DbgState#STOPPED} - * - * @param thread a handle to the thread whose state has changed - * @param state the state to which the thread changed - * @param cause the cause of this event - * @param reason the reason for the state change - */ - void threadStateChanged(DbgThread thread, DbgState state, DbgCause cause, DbgReason reason); - - /** - * A thread has exited - * - * @param threadId the ID of the now-defuct thread - * @param process a handle to the process to which the thread belonged - * @param cause the cause of this event - */ - void threadExited(DebugThreadId threadId, DbgProcess process, DbgCause cause); - - /** - * A different thread has been selected (gained focus) - * - * @param thread a handle to the selected thread - * @param frame a handle to the current frame - * @param cause the cause of this event - */ - void threadSelected(DbgThread thread, DbgStackFrame frame, DbgCause cause); - - /** - * A system event has occurred (gained focus) - * - * @param event a handle to the current event - * @param cause the cause of this event - */ - void eventSelected(AbstractDbgEvent event, DbgCause cause); - - /** - * A module has been loaded by an process - * - * @param process a handle to the process which loaded the module - * @param name the name of the module on the target - * @param cause the cause of this event - */ - void moduleLoaded(DbgProcess process, DebugModuleInfo info, DbgCause cause); - - /** - * A module has been unloaded from an process - * - * @param process a handle to the process which unloaded the module - * @param name the name of the module on the target - * @param cause the cause of this event - */ - void moduleUnloaded(DbgProcess process, DebugModuleInfo info, DbgCause cause); - - /** - * A breakpoint has been created in the session - * - * @param info information about the new breakpoint - * @param cause the cause of this event - */ - void breakpointCreated(DbgBreakpointInfo info, DbgCause cause); - - /** - * A breakpoint in the session has been modified - * - * @param newInfo new information about the modified breakpoint - * @param oldInfo old information about the modified breakpoint - * @param cause the cause of this event - */ - void breakpointModified(DbgBreakpointInfo newInfo, DbgBreakpointInfo oldInfo, DbgCause cause); - - /** - * A breakpoint has been deleted from the session - * - * @param info information about the now-deleted breakpoint - * @param cause the cause of this event - */ - void breakpointDeleted(DbgBreakpointInfo info, DbgCause cause); - - /** - * A breakpoint was hit in the session - * - * @param info information about the breakpoint hit - * @param cause the cause of this event - */ - void breakpointHit(DbgBreakpointInfo info, DbgCause cause); - - /** - * A breakpoint has effectively been applied to an process - * - * dbgeng has a robust (read "complicated") breakpoint model. A breakpoint may apply to multiple - * processes, and even within a single process, it may have multiple locations. Consider, e.g., - * an inlined function or a C++ template function. If the breakpoint is specified as a line - * number, it may correspond to several locations in the compiled binary. Worse yet, a - * breakpoint may be pending, meaning its specification is ambiguous from not having a target - * file. Once a file is loaded, which may be an program, or a shared library loaded during the - * execution of a program, that matches the specification, the breakpoint is resolved to one or - * more locations. Even worse yet, if another library gets loaded that also matches the - * specification, new locations may be appended. - * - * Thus, the dbgeng manager attempts to interpret the information about a breakpoint provided by - * dbgeng and builds a set of "effective breakpoints" each corresponding to a single location in - * a single process image, i.e., process. Consider for example: A new library is loaded and an - * existing dbgeng breakpoint must be applied within. dbgeng will emit a breakpoint modified - * event, which the manager will parse and pass to - * {@link #breakpointModified(DbgBreakpointInfo, DbgBreakpointInfo, DbgCause)}. The manager will - * also interpret that event and, seeing a new location, emit an - * {@link #effectiveBreakpointCreated(DbgProcess, DbgEffectiveBreakpoint, DbgCause)} event. - * - * @param process a handle to the process to which the breakpoint has been applied - * @param newBkpt information about the effective breakpoint - * @param cause the cause of this event - */ - //void effectiveBreakpointCreated(DbgProcess process, DbgEffectiveBreakpoint newBkpt, - // DbgCause cause); - - /** - * An effective breakpoint has been modified within an process - * - * @param process a handle to the process to which the modified effective breakpoint applies - * @param newBkpt information about the new effective breakpoint - * @param oldBkpt information about the old effective breakpoint - * @param cause the cause of this event - * @see #effectiveBreakpointCreated(DbgProcess, DbgEffectiveBreakpoint, DbgCause) - */ - //void effectiveBreakpointModified(DbgProcess process, DbgEffectiveBreakpoint newBkpt, - // DbgEffectiveBreakpoint oldBkpt, DbgCause cause); - - /** - * An effective breakpoint has been deleted from an process - * - * @param process a handle to the process from which the effective breakpoint was deleted - * @param oldBkpt information about the now-deleted effective breakpoint - * @param cause the cause of this event - * @see #effectiveBreakpointCreated(DbgProcess, DbgEffectiveBreakpoint, DbgCause) - */ - //void effectiveBreakpointDeleted(DbgProcess process, DbgEffectiveBreakpoint oldBkpt, - // DbgCause cause); - - /** - * TODO: This is not yet implemented - * - * It is not clear whether dbgeng detects when a target writes into its own memory, or if this - * event is emitted when dbgeng changes the target's memory, or both. - * - * @param process the process whose memory changed - * @param addr the address of the change - * @param len the length, with the address, bounding the region of change - * @param cause the cause of this event - */ - void memoryChanged(DbgProcess process, long addr, int len, DbgCause cause); - - /** - * @param output console output - * @param mask class of output - */ - void consoleOutput(String output, int mask); - - /** - * @param prompt for console output - */ - void promptChanged(String prompt); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgEventsListenerAdapter.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgEventsListenerAdapter.java deleted file mode 100644 index 794e667600..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgEventsListenerAdapter.java +++ /dev/null @@ -1,157 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager; - -import agent.dbgeng.dbgeng.*; -import agent.dbgeng.manager.breakpoint.DbgBreakpointInfo; -import agent.dbgeng.manager.evt.AbstractDbgEvent; - -public interface DbgEventsListenerAdapter extends DbgEventsListener { - - @Override - public default void sessionAdded(DbgSession session, DbgCause cause) { - // Extension point - } - - @Override - public default void sessionRemoved(DebugSessionId sessionId, DbgCause cause) { - // Extension point - } - - @Override - public default void sessionSelected(DbgSession session, DbgCause cause) { - // Extension point - } - - @Override - public default void processAdded(DbgProcess process, DbgCause cause) { - // Extension point - } - - @Override - public default void processRemoved(DebugProcessId processId, DbgCause cause) { - // Extension point - } - - @Override - public default void processSelected(DbgProcess process, DbgCause cause) { - // Extension point - } - - @Override - public default void processStarted(DbgProcess process, DbgCause cause) { - // Extension point - } - - @Override - public default void processExited(DbgProcess process, DbgCause cause) { - // Extension point - } - - @Override - public default void threadCreated(DbgThread thread, DbgCause cause) { - // Extension point - } - - @Override - public default void threadStateChanged(DbgThread thread, DbgState state, DbgCause cause, - DbgReason reason) { - // Extension point - } - - @Override - public default void threadExited(DebugThreadId threadId, DbgProcess process, DbgCause cause) { - // Extension point - - } - - @Override - public default void threadSelected(DbgThread thread, DbgStackFrame frame, DbgCause cause) { - // Extension point - } - - @Override - public default void eventSelected(AbstractDbgEvent event, DbgCause cause) { - // Extension point - } - - @Override - public default void moduleLoaded(DbgProcess process, DebugModuleInfo info, DbgCause cause) { - // Extension point - } - - @Override - public default void moduleUnloaded(DbgProcess process, DebugModuleInfo info, DbgCause cause) { - // Extension point - } - - @Override - public default void breakpointCreated(DbgBreakpointInfo info, DbgCause cause) { - // Extension point - } - - @Override - public default void breakpointModified(DbgBreakpointInfo newInfo, DbgBreakpointInfo oldInfo, - DbgCause cause) { - // Extension point - } - - @Override - public default void breakpointDeleted(DbgBreakpointInfo info, DbgCause cause) { - // Extension point - } - - @Override - public default void breakpointHit(DbgBreakpointInfo info, DbgCause cause) { - // Extension point - } - - /* - @Override - public default void effectiveBreakpointCreated(DbgProcess process, - DbgEffectiveBreakpoint newBkpt, DbgCause cause) { - // Extension point - } - - @Override - public default void effectiveBreakpointModified(DbgProcess process, - DbgEffectiveBreakpoint newBkpt, DbgEffectiveBreakpoint oldBkpt, DbgCause cause) { - // Extension point - } - - @Override - public default void effectiveBreakpointDeleted(DbgProcess process, - DbgEffectiveBreakpoint oldBkpt, DbgCause cause) { - // Extension point - } - */ - - @Override - public default void memoryChanged(DbgProcess process, long addr, int len, DbgCause cause) { - // Extension point - } - - @Override - public default void consoleOutput(String output, int mask) { - // Extension point - } - - @Override - public default void promptChanged(String prompt) { - // Extension point - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgExceptionFilter.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgExceptionFilter.java deleted file mode 100644 index c053f4c6fe..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgExceptionFilter.java +++ /dev/null @@ -1,23 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager; - -public interface DbgExceptionFilter extends DbgEventFilter { - - String getSecondCmd(); - - String getExceptionCode(); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgManager.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgManager.java deleted file mode 100644 index 7567a1db49..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgManager.java +++ /dev/null @@ -1,398 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import org.apache.commons.lang3.tuple.Pair; - -import agent.dbgeng.dbgeng.*; -import agent.dbgeng.manager.breakpoint.DbgBreakpointInfo; -import agent.dbgeng.manager.breakpoint.DbgBreakpointInsertions; -import agent.dbgeng.manager.cmd.DbgListOSMemoryRegionsCommand; -import agent.dbgeng.manager.cmd.DbgListOSProcessesCommand; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgeng.manager.impl.DbgProcessImpl; - -public interface DbgManager extends AutoCloseable, DbgBreakpointInsertions { - - /** - * Possible values for {@link DbgThread#step(ExecSuffix)} - */ - public enum ExecSuffix { - /** Equivalent to {@code finish} in the CLI */ - FINISH("finish"), - /** Equivalent to {@code next} in the CLI */ - NEXT("next"), - /** Equivalent to {@code nexti} in the CLI */ - NEXT_INSTRUCTION("next-instruction"), - /** Equivalent to {@code return} in the CLI */ - RETURN("return"), - /** Equivalent to {@code step} in the CLI */ - STEP("step"), - /** Equivalent to {@code stepi} in the CLI */ - STEP_INSTRUCTION("step-instruction"), - /** Equivalent to {@code until} in the CLI */ - UNTIL("until"), - /** Equivalent to {@code ext} in the CLI */ - EXTENDED("ext"),; - - final String str; - - ExecSuffix(String str) { - this.str = str; - } - - @Override - public String toString() { - return str; - } - } - - static DbgManager newInstance() { - //return new DbgManagerModelImpl(); - return new DbgManagerImpl(); - } - - /** - * Launch dbgeng - * - * @param args cmd plus args - * @return a future which completes when dbgeng is ready to accept commands - */ - CompletableFuture start(String[] args); - - /** - * Terminate dbgeng - */ - void terminate(); - - /** - * Check if GDB is alive - * - * Note this is not about the state of inferiors in GDB. If the GDB controlling process is - * alive, GDB is alive. - * - * @return true if GDB is alive, false otherwise - */ - boolean isRunning(); - - /** - * Add a listener for dbgeng's state - * - * @see #getState() - * @param listener the listener to add - */ - void addStateListener(DbgStateListener listener); - - /** - * Remove a listener for dbgeng's state - * - * @see #getState() - * @param listener the listener to remove - */ - void removeStateListener(DbgStateListener listener); - - /** - * Add a listener for events on processes - * - * @param listener the listener to add - */ - void addEventsListener(DbgEventsListener listener); - - /** - * Remove a listener for events on inferiors - * - * @param listener the listener to remove - */ - void removeEventsListener(DbgEventsListener listener); - - /** - * Get a thread by its dbgeng-assigned ID - * - * dbgeng numbers its threads using a global counter. These IDs are unrelated to the OS-assigned - * TID. This method can retrieve a thread by its ID no matter which inferior it belongs to. - * - * @param id the dbgeng-asigned thread ID - * @return a handle to the thread, if it exists - */ - DbgThread getThread(DebugThreadId id); - - /** - * Get an process by its dbgeng-assigned ID - * - * dbgeng numbers processes incrementally. All inferiors and created and destroyed by the user. - * See {@link #addProcess()}. - * - * @param id the process ID - * @return a handle to the process, if it exists - */ - DbgProcess getProcess(DebugProcessId id); - - /** - * Get an session by its dbgeng-assigned ID - * - * dbgeng numbers processes incrementally. All inferiors and created and destroyed by the user. - * See {@link #addSession()}. - * - * @param id the process ID - * @return a handle to the process, if it exists - */ - DbgSession getSession(DebugSessionId id); - - /** - * Get all threads known to the manager - * - * This does not ask dbgeng to lists its known threads. Rather it returns a read-only view of - * the manager's understanding of the current threads based on its tracking of dbgeng events. - * - * @return a map of dbgeng-assigned thread IDs to corresponding thread handles - */ - Map getKnownThreads(); - - /** - * Get all processes known to the manager - * - * This does not ask dbgeng to list its processes. Rather it returns a read-only view of the - * manager's understanding of the current processes based on its tracking of dbgeng events. - * - * @return a map of process IDs to corresponding process handles - */ - Map getKnownProcesses(); - - /** - * Get all sessions known to the manager - * - * This does not ask dbgeng to list its processes. Rather it returns a read-only view of the - * manager's understanding of the current inferiors based on its tracking of dbgeng events. - * - * @return a map of session IDs to corresponding session handles - */ - Map getKnownSessions(); - - /** - * Get all breakpoints known to the manager - * - * This does not ask dbgeng to list its breakpoints. Rather it returns a read-only view of the - * manager's understanding of the current breakpoints based on its tracking of dbgeng events. - * - * @return a map of dbgeng-assigned breakpoint IDs to corresponding breakpoint information - */ - Map getKnownBreakpoints(); - - /** - * Get all memory regions known to the manager - * - * This does not ask dbgeng to list its regions. Rather it returns a read-only view of the - * manager's understanding of the current ememory based on its tracking of dbgeng events. - * - * @return a map of dbgeng-assigned breakpoint IDs to corresponding breakpoint information - */ - Map getKnownMemoryRegions(); - - /** - * Send an interrupt to dbgeng regardless of other queued commands - * - * This may be useful if the manager's command queue is stalled because an inferior is running. - * - */ - void sendInterruptNow(); - - /** - * Get the state of the dbgeng session - * - * In all-stop mode, if any thread is running, dbgeng is said to be in the running state and is - * unable to process commands. Otherwise, if all threads are stopped, then dbgeng is said to be - * in the stopped state and can accept and process commands. This manager has not been tested in - * non-stop mode. - * - * @return the state - */ - DbgState getState(); - - /** - * Add a process - * - * @return a future which completes with the handle to the new process - */ - CompletableFuture addProcess(); - - /** - * Remove a process - * - * @param process the process to remove - * @return a future which completes then dbgeng has executed the command - */ - CompletableFuture removeProcess(DbgProcess process); - - /** - * Add a session - * - * @return a future which completes with the handle to the new process - */ - CompletableFuture addSession(); - - /** - * Remove a session - * - * @param process the session to remove - * @return a future which completes then dbgeng has executed the command - */ - CompletableFuture removeSession(DbgSession session); - - /** - * Add a memory region - * - * @return a future which completes with the handle to the new process - */ - CompletableFuture addMemory(DbgModuleMemory region); - - /** - * Remove a memory region - * - * @param regionId the region to remove - * @return a future which completes then dbgeng has executed the command - */ - CompletableFuture removeMemory(Long regionId); - - /** - * Execute an arbitrary CLI command, printing output to the CLI console - * - * Note: to ensure a certain thread or inferior has focus for a console command, see - * {@link DbgThread#console(String)}. - * - * @param command the command to execute - * @return a future that completes when dbgeng has executed the command - */ - CompletableFuture console(String command); - - /** - * Execute an arbitrary CLI command, capturing its console output - * - * The output will not be printed to the CLI console. To ensure a certain thread or inferior has - * focus for a console command, see {@link DbgThread#consoleCapture(String)} and - * {@link DbgProcess#consoleCapture(String)}. - * - * @param command the command to execute - * @return a future that completes with the captured output when dbgeng has executed the command - */ - CompletableFuture consoleCapture(String command); - - /** - * List dbgeng's processes - * - * @return a future that completes with a map of process IDs to process handles - */ - CompletableFuture> listProcesses(); - - /** - * List dbgeng's processes - * - * @return a future that completes with a kernel-mode map of process IDs to process handles - */ - CompletableFuture> listOSProcesses(); - - /** - * List dbgeng's processes - * - * @return a future that completes with a kernel-mode list of process memory - */ - CompletableFuture> listOSMemory(); - - /** - * List dbgeng's threads - * - * @return a future that completes with a kernel-mode map of thread IDs to thread handles - */ - CompletableFuture> listOSThreads(DbgProcessImpl proc); - - /** - * List the available processes on target - * - * @return a future that completes with a list of PIDs - */ - CompletableFuture>> listAvailableProcesses(); - - /** - * List dbgeng's sessions - * - * @return a future that completes with a map of session IDs to session handles - */ - CompletableFuture> listSessions(); - - /** - * List information for all breakpoints - * - * @return a future that completes with a list of information for all breakpoints - */ - CompletableFuture> listBreakpoints(); - - /** - * Disable the given breakpoints - * - * This is equivalent to the CLI command {@code disable breakpoint [NUMBER]}. - * - * @param numbers the dbgeng-assigned breakpoint numbers - * @return a future that completes when dbgeng has executed the command - */ - CompletableFuture disableBreakpoints(long... numbers); - - /** - * Enable the given breakpoints - * - * This is equivalent to the CLI command {@code enable breakpoint [NUMBER]}. - * - * @param numbers the dbgeng-assigned breakpoint numbers - * @return a future that completes when dbgeng has executed the command - */ - CompletableFuture enableBreakpoints(long... numbers); - - /** - * Delete a breakpoint - * - * This is equivalent to the CLI command {@code delete breakpoint [NUMBER]}. - * - * @param numbers the dbgeng-assigned breakpoint numbers - * @return a future that completes when dbgeng has executed the command - */ - CompletableFuture deleteBreakpoints(long... numbers); - - CompletableFuture launch(Map args); - - /********** NEEDED FOR TESTING ************/ - - /** - * Returns the current process - * - * @return the current process - */ - DbgProcess currentProcess(); - - CompletableFuture waitForState(DbgState stopped); - - CompletableFuture waitForPrompt(); - - CompletableFuture waitForEventEx(); - - CompletableFuture execute(DbgCommand cmd); - - DebugEventInformation getLastEventInformation(); - - DbgSession getSessionComputeIfAbsent(DebugSessionId debugSessionId, boolean b); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgMemoryOperations.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgMemoryOperations.java deleted file mode 100644 index beb1a026e1..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgMemoryOperations.java +++ /dev/null @@ -1,70 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager; - -import java.nio.ByteBuffer; -import java.util.concurrent.CompletableFuture; - -import generic.ULongSpan.ULongSpanSet; - -public interface DbgMemoryOperations { - - /** - * Read memory - * - * @param addr the address to begin reading at - * @param buf the buffer to read into - * @param len the length of data to read - * @return a future which completes giving the ranges successfully read - */ - CompletableFuture readMemory(long addr, ByteBuffer buf, int len); - - /** - * Read memory - * - * The length is determined by the available space in the destination buffer - * - * @param addr the address to begin reading at - * @param buf the buffer to read into - * @return a future which completes giving the ranges successfully read - */ - default CompletableFuture readMemory(long addr, ByteBuffer buf) { - return readMemory(addr, buf, buf.remaining()); - } - - /** - * Write memory - * - * @param addr the address to begin writing at - * @param buf the buffer to copy from - * @param len the length of data to write - * @return a future that completes when the write succeeds in its entirety - */ - CompletableFuture writeMemory(long addr, ByteBuffer buf, int len); - - /** - * Write memory - * - * The length is determined by the available data in the source buffer - * - * @param addr the address to begin writing at - * @param buf the buffer to copy from - * @return a future that completes when the write succeeds in its entirety - */ - default CompletableFuture writeMemory(long addr, ByteBuffer buf) { - return writeMemory(addr, buf, buf.remaining()); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgModule.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgModule.java deleted file mode 100644 index a6884da2e2..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgModule.java +++ /dev/null @@ -1,43 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager; - -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.manager.impl.DbgMinimalSymbol; - -public interface DbgModule { - - String getName(); - - String getImageName(); - - String getModuleName(); - - Long getKnownBase(); - - Integer getSize(); - - Integer getTimeStamp(); - - //CompletableFuture> listSections(); - - //Map getKnownSections(); - - CompletableFuture> listMinimalSymbols(); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgModuleMemory.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgModuleMemory.java deleted file mode 100644 index 74c943a710..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgModuleMemory.java +++ /dev/null @@ -1,51 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager; - -import java.util.List; - -public interface DbgModuleMemory { - - String getName(); - - Long getId(); - - long getVmaStart(); - - long getVmaEnd(); - - String getType(); - - List getProtect(); - - List getAllocationProtect(); - - long getAllocationBase(); - - String getState(); - - boolean isRead(); - - boolean isWrite(); - - boolean isExec(); - - /* NB: Be sure to implement these in any implementation - public int hashCode(); - public boolean equals(Object obj); - */ - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgModuleSection.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgModuleSection.java deleted file mode 100644 index c2474bec60..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgModuleSection.java +++ /dev/null @@ -1,38 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager; - -public class DbgModuleSection { - - private DbgModule module; - - public DbgModuleSection(DbgModule module) { - this.module = module; - } - - public Long getStart() { - return module.getKnownBase(); - } - - public Integer getSize() { - return module.getSize(); - } - - public String getName() { - return module.getImageName(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgProcess.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgProcess.java deleted file mode 100644 index c962f5c86c..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgProcess.java +++ /dev/null @@ -1,254 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager; - -import java.util.Map; -import java.util.Set; -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.dbgeng.DebugProcessId; -import agent.dbgeng.dbgeng.DebugThreadId; -import agent.dbgeng.manager.DbgManager.ExecSuffix; -import agent.dbgeng.manager.impl.DbgSectionImpl; -import ghidra.dbg.target.TargetAttachable; - -public interface DbgProcess extends DbgMemoryOperations { - - /** - * Get the dbgeng-assigned process number - * - * @return the number - */ - DebugProcessId getId(); - - /** - * If started, get the OS-assigned ID of the process - * - * @return the process ID - */ - Long getPid(); - - /** - * If exited (implying a previous start), get the process exit code - * - * This may be slightly system-dependent, as the exit code may specify either the status of a - * normal exit, or the cause of an abnormal exit. - * - * @return the exit code - */ - Long getExitCode(); - - /** - * Get a thread belonging to this process - * - * dbgeng (at least recent versions) numbers its threads using a global counter. The thread ID - * is this number, not the OS-assigned TID. - * - * @param id the dbgeng-assigned thread ID - * @return a handle to the thread, if it exists - */ - DbgThread getThread(DebugThreadId id); - - /** - * Get a module belonging to this process - * - * dbgeng (at least recent versions) numbers its threads using a global counter. The thread ID - * is this number, not the OS-assigned TID. - * - * @param id the dbgeng-assigned thread ID - * @return a handle to the module, if it exists - */ - DbgModule getModule(String id); - - /** - * Enumerate the threads known to the manager to belong to this process - * - * This does not send any commands to dbgeng. Rather it simply returns a read-only handle to the - * manager's internal map for tracking threads and processes. - * - * @return a map of dbgeng-assigned thread IDs to thread handles - */ - Map getKnownThreads(); - - /** - * List Dbg's threads in this process - * - * This is equivalent to the CLI command: {@code info threads}. - * - * @return a future that completes with a map of global thread IDs to thread handles - */ - CompletableFuture> listThreads(); - - /** - * Enumerate the modules known to the manager to belong to this process - * - * This does not send any commands to dbgeng. Rather it simply returns a read-only handle to the - * manager's internal map for tracking modules. - * - * @return a map of dbgeng-assigned names to module handles - */ - Map getKnownModules(); - - /** - * List dbgeng's modules in this process - * - * This is equivalent to the CLI command: {@code maintenance info sections ALLOBJ}. This command - * is more thorough than {@code info shared} as it contains the executable module, shared - * libraries, system-supplied objects, and enumerates all sections thereof, not just - * {@code .text}. - * - * @return a future that completes with a map of module names to module handles - */ - CompletableFuture> listModules(); - - /** - * Enumerate the memory mappings known to the manager to belong to this process - * - * @return a map of start addresses to mapped memory regions - */ - Map getKnownMappings(); - - /** - * List the memory mappings of this process - * - * @return a future that completes with a map of start addresses to mapped memory regions - */ - CompletableFuture> listMappings(); - - /** - * Change focus to this process - * - * @return a future that completes when dbgeng has executed the command - */ - CompletableFuture setActive(); - - /** - * Specify a binary image for execution and debug symbols - * - * @param file the path to the binary image - * @return a future that completes when dbgeng has executed the command - */ - CompletableFuture fileExecAndSymbols(String file); - - /** - * Begin execution - * - * @return a future that completes with a handle to the first thread of the running process - */ - CompletableFuture run(); - - /** - * Attach to a running process - * - * @param pid the OS-assigned process ID of the target process - * @return a future that completes with a set of handles to all threads of the attached process - */ - CompletableFuture> attach(long pid); - - /** - * Attach to a running process - * - * @param ref the target process - * @return a future that completes with a set of handles to all threads of the attached process - */ - CompletableFuture> reattach(TargetAttachable attachable); - - /** - * Execute an arbitrary kd command, capturing its console output - * - * @param command the command to execute - * @return a future that completes with the captured output when Dbg has executed the command - */ - CompletableFuture consoleCapture(String command); - - /** - * Continue execution - * - * @return a future that completes once the process is running - */ - CompletableFuture cont(); - - /** - * Step the process - * - * Note that the command can complete before the process has finished stepping. The command - * completes as soon as the process is running. A separate stop event is emitted when the step - * is completed. - * - * @param suffix specifies how far to step, or on what conditions stepping ends. - * - * @return a future that completes once the process is running - */ - CompletableFuture step(ExecSuffix suffix); - - /** - * Step the process - * - * Note that the command can complete before the process has finished stepping. The command - * completes as soon as the process is running. A separate stop event is emitted when the step - * is completed. - * - * @param args specifies how far to step, or on what conditions stepping ends. - * - * @return a future that completes once the process is running - */ - CompletableFuture step(Map args); - - /** - * Evaluate an expression - * - * @param expression the expression to evaluate - * @return a future that completes with the string representation of the value - */ - CompletableFuture evaluate(String expression); - - /** - * Detach from the process - * - * @return a future that completes when dbgeng has executed the command - */ - CompletableFuture detach(); - - /** - * Kill the process - * - * @return a future that completes when dbgeng has executed the command - */ - CompletableFuture kill(); - - /** - * Remove this process from the session - * - * @return a future that completes when dbgeng has executed the command - */ - CompletableFuture remove(); - - /** - * Get the address of the associated process structure - */ - Long getOffset(); - - /** - * Get the executable's name - */ - String getExecutableName(); - - /** - * Set the executable's name - */ - void setExecutableName(String name); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgReason.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgReason.java deleted file mode 100644 index 2776874605..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgReason.java +++ /dev/null @@ -1,44 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager; - -public interface DbgReason { - - /** - * Reasons other than those given by GDB - */ - enum Reasons implements DbgReason { - /** - * No reason was given - */ - NONE, - /** - * A reason was given, but the manager does not understand it - */ - UNKNOWN; - - @Override - public String desc() { - return "Unknown"; - } - } - - static DbgReason getReason(String info) { - return Reasons.UNKNOWN; - } - - public String desc(); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgSession.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgSession.java deleted file mode 100644 index 00b6d0db89..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgSession.java +++ /dev/null @@ -1,73 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager; - -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.dbgeng.DebugProcessId; -import agent.dbgeng.dbgeng.DebugSessionId; - -public interface DbgSession { - - /** - * Get the dbgeng-assigned session number - * - * @return the number - */ - DebugSessionId getId(); - - /** - * If exited (implying a previous start), get the session exit code - * - * This may be slightly system-dependent, as the exit code may specify either the status of a - * normal exit, or the cause of an abnormal exit. - * - * @return the exit code - */ - Long getExitCode(); - - /** - * Get a process belonging to this session - * - * dbgeng (at least recent versions) numbers its processes using a global counter. The process - * ID is this number, not the OS-assigned TID. - * - * @param id the dbgeng-assigned process ID - * @return a handle to the process, if it exists - */ - DbgProcess getProcess(DebugProcessId id); - - /** - * Enumerate the processes known to the manager to belong to this session - * - * This does not send any commands to dbgeng. Rather it simply returns a read-only handle to the - * manager's internal map for tracking processes and sessions. - * - * @return a map of dbgeng-assigned process IDs to process handles - */ - Map getKnownProcesses(); - - /** - * List Dbg's processes in this session - * - * This is equivalent to the CLI command: {@code info processes}. - * - * @return a future that completes with a map of global process IDs to process handles - */ - CompletableFuture> listProcesses(); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgStackFrame.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgStackFrame.java deleted file mode 100644 index b39f7b9572..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgStackFrame.java +++ /dev/null @@ -1,71 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager; - -import java.math.BigInteger; -import java.util.concurrent.CompletableFuture; - -public interface DbgStackFrame extends DbgStackFrameOperations { - - /** - * Get the address of the program counter - * - * @return the program counter - */ - BigInteger getAddress(); - - /** - * Get the name of the function where the program counter is - * - * @return the function name - */ - String getFunction(); - - /** - * Get the level of the frame - * - * Frame 0 is the actual machine state, and each increment unwinds the stack 1 frame. - * - * @return the frame level - */ - int getLevel(); - - /** - * Make this frame the current frame - * - * @return a future that completes when the frame is the current frame - */ - CompletableFuture setActive(); - - /** - * Get the thread for this frame - * - * @return the thread - */ - DbgThread getThread(); - - long getFuncTableEntry(); - - long getFrameOffset(); - - long getReturnOffset(); - - long getStackOffset(); - - boolean getVirtual(); - - long[] getParams(); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgStackFrameOperations.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgStackFrameOperations.java deleted file mode 100644 index 3a34c54146..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgStackFrameOperations.java +++ /dev/null @@ -1,72 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager; - -import java.math.BigInteger; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.manager.impl.DbgRegister; - -public interface DbgStackFrameOperations { - - /** - * Evaluate an expression - * - * This evaluates an expression in the same way that the CLI commands {@code print}, - * {@code output}, and {@code call} would. - * - * @param expression the expression to evaluate - * @return a future that completes with the string representation of the value - */ - CompletableFuture evaluate(String expression); - - /** - * Read the values of a given set of registers - * - * @param regs the set of registers - * @return a future that completes with a map of register descriptors to value - */ - CompletableFuture> readRegisters(Set regs); - - /** - * Write the values of a given set of registers - * - * @param regVals a map of register descriptors to value - * @return a future that completes when the registers have been written - */ - CompletableFuture writeRegisters(Map regVals); - - /** - * Execute an arbitrary CLI command, printing output to the CLI console - * - * @param command the command to execute - * @return a future that completes when Dbg has executed the command - */ - CompletableFuture console(String command); - - /** - * Execute an arbitrary CLI command, capturing its console output - * - * The output will not be printed to the CLI console. - * - * @param command the command to execute - * @return a future that completes with the captured output when Dbg has executed the command - */ - CompletableFuture consoleCapture(String command); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgState.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgState.java deleted file mode 100644 index 745b935099..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgState.java +++ /dev/null @@ -1,89 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager; - -/** - * Describes the running state of dbgeng - * - * The manager is initialized in the {@link #NOT_STARTED} state. When - * {@link DbgManager#start(String[] args)} is called, it enters the {@link #STARTING} state - * immediately upon successfully launching the Dbg session. Once dbgeng issues its first prompt, it - * enters the {@link #STOPPED} state. The state then switches between {@link #RUNNING} and - * {@link #STOPPED} according to the execution state of its inferior(s). When the dbgeng session - * exits, it enters the {@link #EXIT} state. - * - * This is also used to describe the state of threads and inferiors. Only {@link #STOPPED}, - * {@link #RUNNING}, and {@link #EXIT} apply to inferiors. Only {@link #STOPPED} and - * {@link #RUNNING} apply to threads. - */ -public enum DbgState { - /** - * Dbg is not alive, because it has not be started - */ - NOT_STARTED { - @Override - public boolean isAlive() { - return false; - } - }, - /** - * Dbg is alive, but has not issued its first prompt, yet - */ - STARTING { - @Override - public boolean isAlive() { - return true; - } - }, - /** - * Dbg, the process, or the thread, is stopped - */ - STOPPED { - @Override - public boolean isAlive() { - return true; - } - }, - /** - * Dbg, the process, or the thread, is running - */ - RUNNING { - @Override - public boolean isAlive() { - return true; - } - }, - /** - * Dbg or the process has exited - */ - EXIT { - @Override - public boolean isAlive() { - return false; - } - }, - /** - * Dbg or the process has exited - */ - SESSION_EXIT { - @Override - public boolean isAlive() { - return false; - } - }; - - public abstract boolean isAlive(); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgStateListener.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgStateListener.java deleted file mode 100644 index b7edd7785e..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgStateListener.java +++ /dev/null @@ -1,36 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager; - -import ghidra.util.TriConsumer; - -/** - * A listener for changes in Dbg's state - */ -public interface DbgStateListener extends TriConsumer { - /** - * The state has changed because of the given cause - * - * @param state the new state - * @param cause the reason for the change - */ - void stateChanged(DbgState state, DbgCause cause); - - @Override - default void accept(DbgState oldVal, DbgState newVal, DbgCause u) { - stateChanged(newVal, u); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgThread.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgThread.java deleted file mode 100644 index 08a4c50717..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/DbgThread.java +++ /dev/null @@ -1,169 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.dbgeng.DebugThreadId; -import agent.dbgeng.jna.dbgeng.WinNTExtra.Machine; -import agent.dbgeng.manager.DbgManager.ExecSuffix; -import agent.dbgeng.manager.breakpoint.DbgBreakpointInsertions; -import agent.dbgeng.manager.impl.DbgRegisterSet; - -public interface DbgThread - extends DbgBreakpointInsertions, DbgMemoryOperations, DbgStackFrameOperations { - - /** - * Get the dbgeng-assigned thread number - * - * This is not the OS-assigned TID. - * - * @return the number - */ - DebugThreadId getId(); - - Long getTid(); - - /** - * Get the state of the thread, {@link DbgState#RUNNING} or {@link DbgState#STOPPED}. - * - * @return the state - */ - DbgState getState(); - - /** - * Set the state of this thread - * - * @param state the new state - * @param cause the cause for the change - * @param reason the reason (usually a stop reason) for the change - * @return true if the state actually changed - */ - boolean setState(DbgState state, DbgCause cause, DbgReason reason); - - /** - * Make this thread the current thread - * - * @return a future that completes when the thread is the current thread - */ - CompletableFuture setActive(); - - /** - * Get the process to which this thread belongs - * - * @return the process - */ - DbgProcess getProcess(); - - /** - * List the frames of this thread's stack - * - * @return the list of stack frames - */ - CompletableFuture> listStackFrames(); - - /** - * List the registers available to this thread - * - * @return a future that completes with a map of register names to descriptors - */ - CompletableFuture listRegisters(); - - /** - * Continue execution - * - * This is equivalent to the CLI command: {@code continue}. Depending on GDB's execution mode, - * this may allow other threads to execute, too. - * - * @return a future that completes once the thread is running - */ - CompletableFuture cont(); - - /** - * Step the thread - * - * Note that the command can complete before the thread has finished stepping. The command - * completes as soon as the thread is running. A separate stop event is emitted when the step is - * completed. - * - * @param suffix specifies how far to step, or on what conditions stepping ends. - * - * @return a future that completes once the thread is running - */ - CompletableFuture step(ExecSuffix suffix); - - /** - * Step the thread - * - * Note that the command can complete before the thread has finished stepping. The command - * completes as soon as the thread is running. A separate stop event is emitted when the step is - * completed. - * - * @param args specifies how far to step, or on what conditions stepping ends. - * - * @return a future that completes once the thread is running - */ - CompletableFuture step(Map args); - - /** - * Step (over) the thread until the specified address is reached - * - * @param address the stop address - * @return a future that completes once the thread is running - */ - CompletableFuture stepToAddress(String address); - - /** - * Trace (step into) the thread until the specified address is reached - * - * @param address the stop address - * @return a future that completes once the thread is running - */ - CompletableFuture traceToAddress(String address); - - /** - * Detach from the entire process - * - * This is equivalent to the CLI command {@code detach}. It will detach the entire process, not - * just this thread. - * - * @return a future that completes when GDB has executed the command - */ - CompletableFuture kill(); - - /** - * Kill the entire process - * - * This is equivalent to the CLI command {@code kill}. It will kill the entire process, not just - * this thread. - * - * @return a future that completes when GDB has executed the command - */ - CompletableFuture detach(); - - /** - * Get the effective architecture for the executing thread - */ - Machine getExecutingProcessorType(); - - /** - * Get the address of the associated thread structure - */ - Long getOffset(); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/breakpoint/DbgBreakpointDisp.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/breakpoint/DbgBreakpointDisp.java deleted file mode 100644 index e03d9bc836..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/breakpoint/DbgBreakpointDisp.java +++ /dev/null @@ -1,32 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.breakpoint; - -public enum DbgBreakpointDisp { - /** - * The breakpoint should remain until deleted by the user - */ - KEEP, - /** - * The breakpoint should be deleted once it is hit - */ - DEL, - /** - * Some disposition unknown to the manager - */ - OTHER; - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/breakpoint/DbgBreakpointInfo.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/breakpoint/DbgBreakpointInfo.java deleted file mode 100644 index faaa70617a..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/breakpoint/DbgBreakpointInfo.java +++ /dev/null @@ -1,310 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.breakpoint; - -import java.util.Objects; - -import agent.dbgeng.dbgeng.DebugBreakpoint; -import agent.dbgeng.dbgeng.DebugBreakpoint.*; -import agent.dbgeng.manager.DbgProcess; -import agent.dbgeng.manager.DbgThread; -import ghidra.comm.util.BitmaskSet; - -public class DbgBreakpointInfo { - - private DebugBreakpoint bpt; - private DbgProcess proc; - private DbgThread eventThread; - private BreakFullType bptType; - private BitmaskSet flags; - private BreakDataParameters parameters = - new BreakDataParameters(1, BitmaskSet.of(BreakAccess.EXECUTE)); - private BitmaskSet access; - private int size = 1; - - private final long number; - private boolean enabled; - - private Long offset; - private String expression; - //private final List locations; - - /** - * Construct Dbg breakpoint information - * - * @param number the Dbg-assigned breakpoint number - * @param type the type of breakpoint - * @param disp the breakpoint disposition - * @param loc the location of the breakpoint - * @param pending if pending, the location that is not yet resolved - * @param enabled true if the breakpoint is enabled, false otherwise - * @param times the number of times the breakpoint has been hit - * @param locations the resolved address(es) of this breakpoint - */ - public DbgBreakpointInfo(DbgBreakpointInfo oldInfo, boolean enabled) { - this(oldInfo.getDebugBreakpoint(), oldInfo.getProc(), oldInfo.getEventThread()); - this.enabled = enabled; - } - - public DbgBreakpointInfo(DebugBreakpoint bpt, DbgProcess proc) { - this(bpt, proc, null); - } - - public DbgBreakpointInfo(DebugBreakpoint bp, DbgProcess process, DbgThread thread) { - this.setBreakpoint(bp); - this.proc = process; - this.eventThread = thread; - this.number = bpt.getId(); - this.bptType = bpt.getType(); - this.flags = bpt.getFlags(); - if (bpt.getType().breakType.equals(BreakType.DATA)) { - this.parameters = bpt.getDataParameters(); - } - this.access = parameters.access; - this.size = parameters.size; - this.offset = bpt.getOffset(); - this.expression = bpt.getOffsetExpression(); - } - - @Override - public int hashCode() { - return Objects.hash(number, bptType, getFlags(), /*location,*/ enabled, access, getSize(), - offset, expression); - } - - public int getId() { - return bpt.getId(); - } - - @Override - public String toString() { - return Integer.toHexString(bpt.getId()); - } - /* - @Override - public String toString() { - return ""; - } - */ - - @Override - public boolean equals(Object obj) { - if (!((obj instanceof DbgBreakpointInfo))) { - return false; - } - DbgBreakpointInfo that = (DbgBreakpointInfo) obj; - if (this.number != that.number) { - return false; - } - if (this.getFlags() != that.getFlags()) { - return false; - } - if (this.getSize() != that.getSize()) { - return false; - } - /*if (!Objects.equals(this.location, that.location)) { - return false; - }*/ - if (!Objects.equals(this.expression, that.expression)) { - return false; - } - if (!Objects.equals(this.offset, that.offset)) { - return false; - } - if (this.enabled != that.enabled) { - return false; - } - return true; - } - - /** - * Get the Dbg-assigned breakpoint number - * - * This is the key into Dbg's breakpoint table to locate the breakpoint this information - * describes. - * - * @return the number - */ - public long getNumber() { - return number; - } - - /** - * Get the type of breakpoint - * - * @return the type - */ - public DbgBreakpointType getType() { - boolean isCode = bpt.getType().breakType.equals(BreakType.CODE); - if (isCode) { - return DbgBreakpointType.BREAKPOINT; - } - BreakDataParameters params = bpt.getDataParameters(); - if (params == null || params.access.isEmpty()) { - return DbgBreakpointType.OTHER; - } - if (params.access.contains(BreakAccess.READ) && params.access.contains(BreakAccess.WRITE)) { - return DbgBreakpointType.ACCESS_WATCHPOINT; - } - if (params.access.contains(BreakAccess.READ)) { - return DbgBreakpointType.READ_WATCHPOINT; - } - if (params.access.contains(BreakAccess.WRITE)) { - return DbgBreakpointType.HW_WATCHPOINT; - } - if (params.access.contains(BreakAccess.EXECUTE)) { - return DbgBreakpointType.HW_BREAKPOINT; - } - return DbgBreakpointType.OTHER; - } - - /** - * Get the breakpoint disposition, i.e., what happens to the breakpoint once it has been hit - * - * @return the disposition - */ - public DbgBreakpointDisp getDisp() { - return DbgBreakpointDisp.KEEP; - } - - /** - * Get the offset expression of the breakpoint - * - * @return the location - */ - public String getExpression() { - return expression; - } - - /** - * Get the size of the breakpoint - * - * @return the size - */ - public int getSize() { - return size; - } - - /** - * Get the access of the breakpoint - * - * @return the size - */ - public BitmaskSet getAccess() { - return access; - } - - /** - * Get the offset of this breakpoint - * - *

- * Note if the offset was given as an expression, but it hasn't been resolved, this will return - * {@code null}. - * - * @return the offset, or {@code null} - */ - public Long getOffset() { - return offset; - } - - /** - * If the breakpoint is pending resolution, get the location that is pending - * - * @return the pending location - */ - public String getPending() { - return getFlags().contains(BreakFlags.DEFERRED) ? "pending" : ""; - } - - /** - * Check if the breakpoint is enabled - * - * @return true if enabled, false otherwise - */ - public boolean isEnabled() { - return getFlags().contains(BreakFlags.ENABLED); - } - - /** - * Get the number of times the breakpoint has been hit - * - * @return the hit count - */ - public int getTimes() { - return 0; - } - - /** - * Get a list of resolved addresses - * - *

- * The effective locations may change for a variety of reasons. Most notable, a new module may - * be loaded, having location(s) that match the desired location of this breakpoint. The binary - * addresses within will become new effective locations of this breakpoint. - * - * @return the list of locations at the time the breakpoint information was captured - */ - /*public List getLocations() { - return locations; - }*/ - - public DbgBreakpointInfo withEnabled(@SuppressWarnings("hiding") boolean enabled) { - if (isEnabled() == enabled) { - return this; - } - return new DbgBreakpointInfo(this, enabled); - } - - public DebugBreakpoint getDebugBreakpoint() { - return bpt; - } - - public BitmaskSet getFlags() { - return flags; - } - - public DbgProcess getProc() { - return proc; - } - - public DbgThread getEventThread() { - return eventThread; - } - - public void setBreakpoint(DebugBreakpoint bpt) { - this.bpt = bpt; - this.bptType = bpt.getType(); - this.flags = bpt.getFlags(); - this.offset = bpt.getOffset(); - this.expression = bpt.getOffsetExpression(); - if (bptType.breakType.equals(BreakType.DATA)) { - BreakDataParameters p = bpt.getDataParameters(); - this.access = p.access; - this.size = p.size; - } - } - - public void remove() { - bpt.remove(); - } - - public void dispose() { - bpt.dispose(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/breakpoint/DbgBreakpointInsertions.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/breakpoint/DbgBreakpointInsertions.java deleted file mode 100644 index 0c22f1a1e4..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/breakpoint/DbgBreakpointInsertions.java +++ /dev/null @@ -1,84 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.breakpoint; - -import java.util.concurrent.CompletableFuture; - -import ghidra.util.NumericUtilities; - -public interface DbgBreakpointInsertions { - /** - * Insert a breakpoint - * - * This is equivalent to the CLI command: {@code break [LOC]}, or {@code watch [LOC]}, etc. - * - * Breakpoints in Dbg can get pretty complicated. Depending on the location specification, the - * actual location of the breakpoint may change during the lifetime of an inferior. Take note of - * the breakpoint number to track those changes across breakpoint modification events. - * - * @param loc the location (address, symbol, line number, etc.) to place the breakpoint at - * @param type the type of breakpoint (or watchpoint) to add - * @return a copy of the resulting breakpoint information once Dbg has executed the command - */ - default CompletableFuture insertBreakpoint(String loc, - DbgBreakpointType type) { - return insertBreakpoint(NumericUtilities.parseHexLong(loc), 1, - DbgBreakpointType.BREAKPOINT); - } - - /** - * Insert a (usually software) execution breakpoint - * - * @param loc string version of address - * @return a future that completes when dbgeng has executed the command - * - * @see #insertBreakpoint(String, DbgBreakpointType) - */ - default CompletableFuture insertBreakpoint(String loc) { - return insertBreakpoint(loc, DbgBreakpointType.BREAKPOINT); - } - - /** - * Insert a (usually software) execution breakpoint at the given address offset - * - * Note, this uses the "Address Notation" specified by Dbg. - * - * @param addr breakpoint address - * @return a future that completes when dbgeng has executed the command - * - * @see #insertBreakpoint(String, DbgBreakpointType) - */ - default CompletableFuture insertBreakpoint(long addr) { - return insertBreakpoint(addr, 1, DbgBreakpointType.BREAKPOINT); - } - - /** - * Insert a breakpoint (usually a watchpoint) at the given address range - * - * Note, this implements the length by casting the address pointer to a - * fixed-length-char-array-pointer where the array has the given length. Support for specific - * lengths may vary by platform. - * - * @param addr the starting address - * @param len the length of the range - * @param type the type of breakpoint (usually a watchpoint) - * @return a future that completes when dbgeng has executed the command - * @see #insertBreakpoint(String, DbgBreakpointType) - */ - CompletableFuture insertBreakpoint(long addr, int len, - DbgBreakpointType type); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/breakpoint/DbgBreakpointLocation.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/breakpoint/DbgBreakpointLocation.java deleted file mode 100644 index b5d4176561..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/breakpoint/DbgBreakpointLocation.java +++ /dev/null @@ -1,138 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.breakpoint; - -import java.util.*; - -import agent.dbgeng.dbgeng.DebugProcessId; - -public class DbgBreakpointLocation { - - private final long number; - private final long sub; - private final boolean enabled; - private final String addr; - private final List processIds; - - /** - * Construct a breakpoint location - * - * @param number the number of breakpoint location, i.e., {@code x} in {@code x.y} - * @param sub the number of the breakpoint location, i.e., {@code y} in {@code x.y} - * @param enabled true if the location is enabled, false otherwise - * @param addr the address of this location, usually resolved, but maybe not - * @param processIds a list of inferior IDs to which this location applies - */ - DbgBreakpointLocation(long number, long sub, boolean enabled, String addr, - List processIds) { - this.number = number; - this.sub = sub; - this.enabled = enabled; - this.addr = addr; - this.processIds = Collections.unmodifiableList(processIds); - } - - @Override - public String toString() { - return ""; - } - - /** - * Get the breakpoint number, i.e., {@code x} in {@code x.y} - * - * @return the breakpoint number - */ - public long getNumber() { - return number; - } - - /** - * If present, get the location number, i.e., {@code y} in {@code x.y} - * - * @return the location number, or 0 - */ - public long getSub() { - return sub; - } - - /** - * Check if the location is enabled - * - * @return true if enabled, false otherwise - */ - public boolean isEnabled() { - return enabled; - } - - /** - * Get the address, usually resolved, but maybe not - * - * see {@link DbgBreakpointInfo#getPending()} - * - * @return the address - */ - public String getAddr() { - return addr; - } - - /** - * If numerical, get the address as a long - * - * @return the address - */ - public long addrAsLong() { - return Long.parseUnsignedLong(addr, 16); - } - - /** - * Get a list of inferior IDs to which this location applies - * - * @return the list of inferiors - */ - public List getProcessIds() { - return processIds; - } - - @Override - public int hashCode() { - return Objects.hash(number, sub, enabled, addr, processIds); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof DbgBreakpointLocation)) { - return false; - } - DbgBreakpointLocation that = (DbgBreakpointLocation) obj; - if (this.number != that.number) { - return false; - } - if (this.sub != that.sub) { - return false; - } - if (this.enabled != that.enabled) { - return false; - } - if (!Objects.equals(this.addr, that.addr)) { - return false; - } - if (!Objects.equals(this.processIds, that.processIds)) { - return false; - } - return true; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/breakpoint/DbgBreakpointType.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/breakpoint/DbgBreakpointType.java deleted file mode 100644 index e957b32055..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/breakpoint/DbgBreakpointType.java +++ /dev/null @@ -1,65 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.breakpoint; - -/** - * The type of Dbg breakpoint - */ -public enum DbgBreakpointType { - /** - * A software execution breakpoint, usually set via {@code break} - */ - BREAKPOINT, - /** - * A hardware execution breakpoint, usually set via {@code hbreak} - */ - HW_BREAKPOINT, - /** - * A debug printf point, usually set via {@code dprint} - */ - DPRINTF, - /** - * A hardware (write) watchpoint, usually set via {@code watch} - */ - HW_WATCHPOINT, - /** - * A read watchpoint, usually set via {@code rwatch} - */ - READ_WATCHPOINT, - /** - * An access (r/w) watchpoint, usually set via {@code awatch} - */ - ACCESS_WATCHPOINT, - /** - * Some type not known to the manager - */ - OTHER; - - /** - * Parse a type from a Dbg/MI breakpoint information block - * - * @param string the value of type parsed - * @return the enum constant, or {@link #OTHER} if unrecognized - */ - public static DbgBreakpointType fromStr(String string) { - try { - return valueOf(string); - } - catch (IllegalArgumentException e) { - return OTHER; - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/AbstractDbgCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/AbstractDbgCommand.java deleted file mode 100644 index 08c1c4223f..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/AbstractDbgCommand.java +++ /dev/null @@ -1,124 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import agent.dbgeng.dbgeng.DebugProcessId; -import agent.dbgeng.dbgeng.DebugSystemObjects; -import agent.dbgeng.dbgeng.DebugThreadId; -import agent.dbgeng.manager.DbgCommand; -import agent.dbgeng.manager.DbgEvent; -import agent.dbgeng.manager.DbgProcess; -import agent.dbgeng.manager.DbgState; -import agent.dbgeng.manager.DbgThread; -import agent.dbgeng.manager.evt.DbgCommandDoneEvent; -import agent.dbgeng.manager.impl.DbgManagerImpl; - -/** - * A base class for interacting with specific Dbg commands - * - * @param the type of object "returned" by the command - */ -public abstract class AbstractDbgCommand implements DbgCommand { - protected final DbgManagerImpl manager; - DbgProcess previousProcess; - Long previousProcessOffset; - DebugProcessId previousProcessId; - DbgThread previousThread; - Long previousThreadOffset; - DebugThreadId previousThreadId; - - /** - * Construct a new command to be executed by the given manager - * - * @param manager the manager to execute the command - */ - protected AbstractDbgCommand(DbgManagerImpl manager) { - this.manager = manager; - } - - @Override - public boolean validInState(DbgState state) { - return true; // With dual interpreters, shouldn't have to worry. - } - - @Override - public boolean handle(DbgEvent evt, DbgPendingCommand pending) { - if (evt instanceof DbgCommandDoneEvent) { - if (pending.getCommand().equals(((DbgCommandDoneEvent) evt).getCmd())) { - return true; - } - } - return false; - } - - @Override - public T complete(DbgPendingCommand pending) { - return null; - } - - @Override - public void invoke() { - // Nothing - } - - public void setProcess(DbgProcess process) { - DebugSystemObjects so = manager.getSystemObjects(); - previousProcess = process; - if (manager.isKernelMode() && !process.getId().isSystem()) { - previousProcessOffset = so.getCurrentProcessDataOffset(); - so.setImplicitProcessDataOffset(process.getOffset()); - } - else { - previousProcessId = so.getCurrentProcessId(); - so.setCurrentProcessId(process.getId()); - } - } - - - public void resetProcess() { - DebugSystemObjects so = manager.getSystemObjects(); - if (manager.isKernelMode() && !previousProcess.getId().isSystem()) { - so.setImplicitProcessDataOffset(previousProcessOffset); - } - else { - so.setCurrentProcessId(previousProcessId); - } - } - - public void setThread(DbgThread thread) { - DebugSystemObjects so = manager.getSystemObjects(); - previousThread = thread; - if (manager.isKernelMode() && !thread.getId().isSystem()) { - previousThreadOffset = so.getCurrentThreadDataOffset(); - so.setImplicitThreadDataOffset(thread.getOffset()); - } - else { - previousThreadId = so.getCurrentThreadId(); - so.setCurrentThreadId(thread.getId()); - } - } - - - public void resetThread() { - DebugSystemObjects so = manager.getSystemObjects(); - if (manager.isKernelMode() && !previousThread.getId().isSystem()) { - so.setImplicitThreadDataOffset(previousThreadOffset); - } - else { - so.setCurrentThreadId((DebugThreadId) previousThreadId); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/AbstractDbgExecToAddressCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/AbstractDbgExecToAddressCommand.java deleted file mode 100644 index 7113295461..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/AbstractDbgExecToAddressCommand.java +++ /dev/null @@ -1,73 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import agent.dbgeng.dbgeng.DebugControl; -import agent.dbgeng.dbgeng.DebugThreadId; -import agent.dbgeng.manager.DbgEvent; -import agent.dbgeng.manager.evt.*; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgeng.manager.impl.DbgThreadImpl; -import ghidra.util.Msg; - -public abstract class AbstractDbgExecToAddressCommand extends AbstractDbgCommand { - - private final DebugThreadId id; - private final String address; - - public AbstractDbgExecToAddressCommand(DbgManagerImpl manager, DebugThreadId id, - String address) { - super(manager); - this.id = id; - this.address = address; - } - - @Override - public boolean handle(DbgEvent evt, DbgPendingCommand pending) { - if (evt instanceof AbstractDbgCompletedCommandEvent && pending.getCommand().equals(this)) { - return evt instanceof DbgCommandErrorEvent || - !pending.findAllOf(DbgRunningEvent.class).isEmpty(); - } - else if (evt instanceof DbgRunningEvent) { - // Event happens no matter which interpreter received the command - pending.claim(evt); - return !pending.findAllOf(AbstractDbgCompletedCommandEvent.class).isEmpty(); - } - return false; - } - - protected abstract String generateCommand(String address); - - @Override - public void invoke() { - String cmd = generateCommand(address); - String prefix = id == null ? "" : "~" + id.id() + " "; - DebugControl control = manager.getControl(); - DbgThreadImpl eventThread = manager.getEventThread(); - if (eventThread != null && eventThread.getId().equals(id)) { - control.execute(cmd); - } - else { - if (manager.isKernelMode()) { - Msg.info(this, "Thread-specific steppign is ignored in kernel-mode"); - control.execute(cmd); - } - else { - control.execute(prefix + cmd); - } - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/AbstractDbgReadCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/AbstractDbgReadCommand.java deleted file mode 100644 index f7d59c7b38..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/AbstractDbgReadCommand.java +++ /dev/null @@ -1,53 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import java.nio.ByteBuffer; - -import agent.dbgeng.manager.impl.DbgManagerImpl; -import generic.ULongSpan; -import generic.ULongSpan.ULongSpanSet; - -public abstract class AbstractDbgReadCommand extends AbstractDbgCommand { - - private final long addr; - private final ByteBuffer buf; - private final int len; - - private int readLen; - - protected AbstractDbgReadCommand(DbgManagerImpl manager, long addr, ByteBuffer buf, int len) { - super(manager); - this.addr = addr; - this.buf = buf; - this.len = len; - } - - protected abstract int doRead(long addr, ByteBuffer buf, int len); - - @Override - public void invoke() { - readLen = doRead(addr, buf, len); - } - - @Override - public ULongSpanSet complete(DbgPendingCommand pending) { - if (readLen == 0) { - return ULongSpanSet.of(); - } - return ULongSpanSet.of(ULongSpan.extent(addr, readLen)); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgAddProcessCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgAddProcessCommand.java deleted file mode 100644 index 91ed6a8d1a..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgAddProcessCommand.java +++ /dev/null @@ -1,37 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import agent.dbgeng.manager.DbgManager; -import agent.dbgeng.manager.DbgProcess; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgeng.manager.impl.DbgProcessImpl; - -/** - * Implementation of {@link DbgManager#addProcess()} - */ -public class DbgAddProcessCommand extends AbstractDbgCommand { - - public DbgAddProcessCommand(DbgManagerImpl manager) { - super(manager); - } - - @Override - public DbgProcess complete(DbgPendingCommand pending) { - return new DbgProcessImpl(manager); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgAddSessionCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgAddSessionCommand.java deleted file mode 100644 index 80bc6c1224..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgAddSessionCommand.java +++ /dev/null @@ -1,37 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import agent.dbgeng.manager.DbgManager; -import agent.dbgeng.manager.DbgSession; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgeng.manager.impl.DbgSessionImpl; - -/** - * Implementation of {@link DbgManager#addProcess()} - */ -public class DbgAddSessionCommand extends AbstractDbgCommand { - - public DbgAddSessionCommand(DbgManagerImpl manager) { - super(manager); - } - - @Override - public DbgSession complete(DbgPendingCommand pending) { - return new DbgSessionImpl(manager); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgAttachCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgAttachCommand.java deleted file mode 100644 index 943e09ffe3..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgAttachCommand.java +++ /dev/null @@ -1,82 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import java.util.LinkedHashSet; -import java.util.Set; - -import agent.dbgeng.dbgeng.*; -import agent.dbgeng.dbgeng.DebugClient.DebugAttachFlags; -import agent.dbgeng.manager.*; -import agent.dbgeng.manager.evt.*; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgeng.manager.impl.DbgProcessImpl; -import ghidra.comm.util.BitmaskSet; - -/** - * Implementation of {@link DbgProcess#kill()} - */ -public class DbgAttachCommand extends AbstractDbgCommand> { - - private DbgProcessCreatedEvent created = null; - private boolean completed = false; - private DbgProcessImpl proc; - private BitmaskSet flags; - - public DbgAttachCommand(DbgManagerImpl manager, DbgProcessImpl proc, - BitmaskSet flags) { - super(manager); - this.proc = proc; - this.flags = flags; - } - - @Override - public boolean handle(DbgEvent evt, DbgPendingCommand pending) { - if (evt instanceof AbstractDbgCompletedCommandEvent && pending.getCommand().equals(this)) { - completed = true; - } - else if (evt instanceof DbgProcessCreatedEvent) { - created = (DbgProcessCreatedEvent) evt; - } - else if (evt instanceof DbgThreadCreatedEvent) { - pending.claim(evt); - } - else if (evt instanceof DbgStoppedEvent) { - pending.claim(evt); - } - return completed && (created != null); - } - - @Override - public Set complete(DbgPendingCommand pending) { - DebugSystemObjects so = manager.getSystemObjects(); - Set threads = new LinkedHashSet<>(); - for (DbgThreadCreatedEvent adds : pending.findAllOf(DbgThreadCreatedEvent.class)) { - DebugThreadInfo info = adds.getInfo(); - DebugThreadId tid = so.getThreadIdByHandle(info.handle); - threads.add(manager.getThread(tid)); - } - return threads; - } - - @Override - public void invoke() { - DebugClient dbgeng = manager.getClient(); - dbgeng.attachProcess(dbgeng.getLocalServer(), proc.getPid().intValue(), flags); - - manager.waitForEventEx(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgAttachKernelCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgAttachKernelCommand.java deleted file mode 100644 index b83912d0f4..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgAttachKernelCommand.java +++ /dev/null @@ -1,72 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import java.util.Map; - -import agent.dbgeng.dbgeng.*; -import agent.dbgeng.manager.*; -import agent.dbgeng.manager.evt.AbstractDbgCompletedCommandEvent; -import agent.dbgeng.manager.evt.DbgProcessCreatedEvent; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import ghidra.util.Msg; - -/** - * Implementation of {@link DbgProcess#fileExecAndSymbols(String)} - */ -public class DbgAttachKernelCommand extends AbstractDbgCommand { - - private DbgProcessCreatedEvent created = null; - private boolean completed = false; - private Map args; - - public DbgAttachKernelCommand(DbgManagerImpl manager, Map args) { - super(manager); - this.args = args; - } - - @Override - public boolean handle(DbgEvent evt, DbgPendingCommand pending) { - if (evt instanceof AbstractDbgCompletedCommandEvent && pending.getCommand().equals(this)) { - completed = true; - } - else if (evt instanceof DbgProcessCreatedEvent) { - created = (DbgProcessCreatedEvent) evt; - } - return completed && (created != null); - } - - @Override - public DbgThread complete(DbgPendingCommand pending) { - DebugProcessInfo info = created.getInfo(); - DebugThreadInfo tinfo = info.initialThreadInfo; - DebugSystemObjects so = manager.getSystemObjects(); - DebugThreadId tid = so.getThreadIdByHandle(tinfo.handle); - return manager.getThread(tid); - } - - @Override - public void invoke() { - if (!System.getenv().containsKey("_NT_SYMBOL_PATH")) { - Msg.warn(this, "_NT_SYMBOL_PATH is undefined - you may need to define it or run .sympath"); - } - DebugClient dbgeng = manager.getClient(); - long flags = (Long) args.get("Flags"); - String options = (String) args.get("Options"); - dbgeng.attachKernel(flags, options); - manager.waitForEventEx(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgCommandError.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgCommandError.java deleted file mode 100644 index 8cb4e32b0c..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgCommandError.java +++ /dev/null @@ -1,55 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import agent.dbgeng.manager.DbgCommand; - -/** - * Exception generated by the default "^error" handler - */ -public class DbgCommandError extends RuntimeException { - private final Object info; - - /** - * Construct an error with the given details - * - * @param info the detail information - * @param cmd source of error - */ - public DbgCommandError(Object info, DbgCommand cmd) { - super(cmd + " caused '" + info + "'"); - this.info = info; - } - - /** - * Construct an error with the given message - * - * @param message the message - */ - public DbgCommandError(String message) { - super(message); - this.info = null; - } - - /** - * Get the details, if present - * - * @return the details, or null - */ - public Object getInfo() { - return info; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgConsoleExecCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgConsoleExecCommand.java deleted file mode 100644 index ff59b5c2af..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgConsoleExecCommand.java +++ /dev/null @@ -1,70 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import agent.dbgeng.dbgeng.DebugControl; -import agent.dbgeng.manager.DbgEvent; -import agent.dbgeng.manager.DbgManager; -import agent.dbgeng.manager.evt.*; -import agent.dbgeng.manager.impl.DbgManagerImpl; - -/** - * Implementation of {@link DbgManager#console(String)} and similar - */ -public class DbgConsoleExecCommand extends AbstractDbgCommand { - public enum Output { - CONSOLE, CAPTURE; - } - - private String command; - private Output to; - - public DbgConsoleExecCommand(DbgManagerImpl manager, String command, Output to) { - super(manager); - this.command = command; - this.to = to; - } - - @Override - public boolean handle(DbgEvent evt, DbgPendingCommand pending) { - if (evt instanceof AbstractDbgCompletedCommandEvent && pending.getCommand().equals(this)) { - return true; - } - else if (evt instanceof DbgConsoleOutputEvent && to == Output.CAPTURE) { - pending.steal(evt); - } - return false; - } - - @Override - public String complete(DbgPendingCommand pending) { - if (to == Output.CONSOLE) { - return null; - } - StringBuilder builder = new StringBuilder(); - for (DbgConsoleOutputEvent out : pending.findAllOf(DbgConsoleOutputEvent.class)) { - builder.append(out.getOutput()); - } - return builder.toString(); - } - - @Override - public void invoke() { - DebugControl control = manager.getControl(); - control.execute(command); - manager.processEvent(new DbgPromptChangedEvent(control.getPromptText())); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgContinueCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgContinueCommand.java deleted file mode 100644 index 1159011c33..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgContinueCommand.java +++ /dev/null @@ -1,52 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import agent.dbgeng.dbgeng.DebugClient; -import agent.dbgeng.dbgeng.DebugClient.DebugStatus; -import agent.dbgeng.manager.DbgEvent; -import agent.dbgeng.manager.DbgProcess; -import agent.dbgeng.manager.evt.*; -import agent.dbgeng.manager.impl.DbgManagerImpl; - -/** - * Implementation of {@link DbgProcess#kill()} - */ -public class DbgContinueCommand extends AbstractDbgCommand { - public DbgContinueCommand(DbgManagerImpl manager) { - super(manager); - } - - @Override - public boolean handle(DbgEvent evt, DbgPendingCommand pending) { - if (evt instanceof AbstractDbgCompletedCommandEvent && pending.getCommand().equals(this)) { - return evt instanceof DbgCommandErrorEvent || - !pending.findAllOf(DbgRunningEvent.class).isEmpty(); - } - else if (evt instanceof DbgRunningEvent) { - // Event happens no matter which interpreter received the command - pending.claim(evt); - return !pending.findAllOf(AbstractDbgCompletedCommandEvent.class).isEmpty(); - } - return false; - } - - @Override - public void invoke() { - DebugClient dbgeng = manager.getClient(); - dbgeng.getControl().setExecutionStatus(DebugStatus.GO); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgDeleteBreakpointsCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgDeleteBreakpointsCommand.java deleted file mode 100644 index b61962c339..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgDeleteBreakpointsCommand.java +++ /dev/null @@ -1,44 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import agent.dbgeng.dbgeng.DebugBreakpoint; -import agent.dbgeng.dbgeng.DebugControl; -import agent.dbgeng.manager.impl.DbgManagerImpl; - -/** - * Implementation of {@link DbgManagerImpl#deleteBreakpoints(long)} - */ -public class DbgDeleteBreakpointsCommand extends AbstractDbgCommand { - - private final long[] numbers; - - public DbgDeleteBreakpointsCommand(DbgManagerImpl manager, long... numbers) { - super(manager); - this.numbers = numbers; - } - - @Override - public void invoke() { - DebugControl control = manager.getControl(); - for (long id : numbers) { - DebugBreakpoint bp = control.getBreakpointById((int) id); - if (bp != null) { - bp.remove(); - } - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgDetachCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgDetachCommand.java deleted file mode 100644 index ffd5a22ded..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgDetachCommand.java +++ /dev/null @@ -1,54 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import java.util.ArrayList; -import java.util.Collection; - -import agent.dbgeng.dbgeng.DebugClient; -import agent.dbgeng.manager.DbgCause; -import agent.dbgeng.manager.DbgProcess; -import agent.dbgeng.manager.impl.*; - -/** - * Implementation of {@link DbgProcess#kill()} - */ -public class DbgDetachCommand extends AbstractDbgCommand { - private final DbgProcessImpl process; - - public DbgDetachCommand(DbgManagerImpl manager, DbgProcessImpl process) { - super(manager); - this.process = process; - } - - @Override - public Void complete(DbgPendingCommand pending) { - // TODO: necessary? - Collection threads = new ArrayList<>(process.getKnownThreadsImpl().values()); - for (DbgThreadImpl t : threads) { - manager.fireThreadExited(t.getId(), process, pending); - t.remove(); - } - manager.getEventListeners().invoke().processRemoved(process.getId(), DbgCause.Causes.UNCLAIMED); - return null; - } - - @Override - public void invoke() { - DebugClient dbgeng = manager.getClient(); - dbgeng.detachCurrentProcess(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgDisableBreakpointsCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgDisableBreakpointsCommand.java deleted file mode 100644 index 2a0d02ec2d..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgDisableBreakpointsCommand.java +++ /dev/null @@ -1,44 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import agent.dbgeng.dbgeng.DebugBreakpoint; -import agent.dbgeng.dbgeng.DebugBreakpoint.BreakFlags; -import agent.dbgeng.dbgeng.DebugControl; -import agent.dbgeng.manager.evt.DbgCommandDoneEvent; -import agent.dbgeng.manager.impl.DbgManagerImpl; - -/** - * Implementation of {@link DbgManagerImpl#deleteBreakpoints(long)} - */ -public class DbgDisableBreakpointsCommand extends AbstractDbgCommand { - - private final long[] numbers; - - public DbgDisableBreakpointsCommand(DbgManagerImpl manager, long... numbers) { - super(manager); - this.numbers = numbers; - } - - @Override - public void invoke() { - DebugControl control = manager.getControl(); - for (long id : numbers) { - DebugBreakpoint bp = control.getBreakpointById((int) id); - bp.removeFlags(BreakFlags.ENABLED); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgEnableBreakpointsCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgEnableBreakpointsCommand.java deleted file mode 100644 index ed6359fa82..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgEnableBreakpointsCommand.java +++ /dev/null @@ -1,43 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import agent.dbgeng.dbgeng.DebugBreakpoint; -import agent.dbgeng.dbgeng.DebugBreakpoint.BreakFlags; -import agent.dbgeng.dbgeng.DebugControl; -import agent.dbgeng.manager.impl.DbgManagerImpl; - -/** - * Implementation of {@link DbgManagerImpl#enableBreakpoints(long)} - */ -public class DbgEnableBreakpointsCommand extends AbstractDbgCommand { - - private final long[] numbers; - - public DbgEnableBreakpointsCommand(DbgManagerImpl manager, long... numbers) { - super(manager); - this.numbers = numbers; - } - - @Override - public void invoke() { - DebugControl control = manager.getControl(); - for (long id : numbers) { - DebugBreakpoint bp = control.getBreakpointById((int) id); - bp.addFlags(BreakFlags.ENABLED); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgEvaluateCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgEvaluateCommand.java deleted file mode 100644 index 69e3d6cf2d..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgEvaluateCommand.java +++ /dev/null @@ -1,42 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import agent.dbgeng.manager.DbgProcess; -import agent.dbgeng.manager.impl.DbgManagerImpl; - -/** - * Implementation of {@link DbgProcess#evaluate(String)} - */ -public class DbgEvaluateCommand extends AbstractDbgCommand { - private final String expression; - private String result; - - public DbgEvaluateCommand(DbgManagerImpl manager, String expression) { - super(manager); - this.expression = expression; - } - - @Override - public String complete(DbgPendingCommand pending) { - return result; - } - - @Override - public void invoke() { - // TODO: do something with expression to get result - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgFileExecAndSymbolsCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgFileExecAndSymbolsCommand.java deleted file mode 100644 index df3c4d02a2..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgFileExecAndSymbolsCommand.java +++ /dev/null @@ -1,37 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import agent.dbgeng.manager.DbgProcess; -import agent.dbgeng.manager.impl.DbgManagerImpl; - -/** - * Implementation of {@link DbgProcess#fileExecAndSymbols(String)} - */ -public class DbgFileExecAndSymbolsCommand extends AbstractDbgCommand { - - private final String file; - - public DbgFileExecAndSymbolsCommand(DbgManagerImpl manager, String file) { - super(manager); - this.file = file; - } - - @Override - public void invoke() { - // TODO Auto-generated method stub - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgInsertBreakpointCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgInsertBreakpointCommand.java deleted file mode 100644 index be91d29556..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgInsertBreakpointCommand.java +++ /dev/null @@ -1,95 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import agent.dbgeng.dbgeng.DebugBreakpoint; -import agent.dbgeng.dbgeng.DebugBreakpoint.*; -import agent.dbgeng.dbgeng.DebugControl; -import agent.dbgeng.manager.breakpoint.*; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import ghidra.comm.util.BitmaskSet; - -/** - * Implementation of {@link DbgBreakpointInsertions#insertBreakpoint(String)} - */ -public class DbgInsertBreakpointCommand extends AbstractDbgCommand { - //private List locations; - private final DbgBreakpointType type; - private DbgBreakpointInfo bkpt; - private int len; - private final String expression; - private final Long loc; - - public DbgInsertBreakpointCommand(DbgManagerImpl manager, String expression, - DbgBreakpointType type) { - super(manager); - this.type = type; - this.expression = expression; - this.loc = null; - } - - public DbgInsertBreakpointCommand(DbgManagerImpl manager, long loc, int len, - DbgBreakpointType type) { - super(manager); - this.len = len; - this.type = type; - this.expression = null; - this.loc = loc; - } - - @Override - public DbgBreakpointInfo complete(DbgPendingCommand pending) { - //manager.doBreakpointCreated(bkpt, pending); - return bkpt; - } - - @Override - public void invoke() { - DebugControl control = manager.getControl(); - BreakType bt = BreakType.DATA; - if (type.equals(DbgBreakpointType.BREAKPOINT)) { - bt = BreakType.CODE; - } - // 2 for BU, 1 for BP - DebugBreakpoint bp = control.addBreakpoint/*2*/(bt); - if (bt.equals(BreakType.DATA)) { - BitmaskSet access = BitmaskSet.of(BreakAccess.EXECUTE); - if (type.equals(DbgBreakpointType.ACCESS_WATCHPOINT)) { - access = BitmaskSet.of(BreakAccess.READ, BreakAccess.WRITE); - } - if (type.equals(DbgBreakpointType.READ_WATCHPOINT)) { - access = BitmaskSet.of(BreakAccess.READ); - } - if (type.equals(DbgBreakpointType.HW_WATCHPOINT)) { - access = BitmaskSet.of(BreakAccess.WRITE); - } - if (type.equals(DbgBreakpointType.HW_BREAKPOINT)) { - access = BitmaskSet.of(BreakAccess.EXECUTE); - len = 1; - } - bp.setDataParameters(len, access); - } - if (loc != null) { - bp.setOffset(loc); - } - else { - bp.setOffsetExpression(expression); - } - bp.addFlags(BreakFlags.ENABLED); - - bkpt = new DbgBreakpointInfo(bp, manager.getCurrentProcess()); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgKillCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgKillCommand.java deleted file mode 100644 index aabc0d8ec5..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgKillCommand.java +++ /dev/null @@ -1,39 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import agent.dbgeng.dbgeng.DebugClient; -import agent.dbgeng.manager.DbgProcess; -import agent.dbgeng.manager.evt.DbgProcessExitedEvent; -import agent.dbgeng.manager.impl.DbgManagerImpl; - -/** - * Implementation of {@link DbgProcess#kill()} - */ -public class DbgKillCommand extends AbstractDbgCommand { - public DbgKillCommand(DbgManagerImpl manager) { - super(manager); - } - - @Override - public void invoke() { - DebugClient dbgeng = manager.getClient(); - // NB: process the event before terminating - manager.processEvent(new DbgProcessExitedEvent(0)); - dbgeng.terminateCurrentProcess(); - dbgeng.detachCurrentProcess(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgLaunchProcessCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgLaunchProcessCommand.java deleted file mode 100644 index e14cf08e77..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgLaunchProcessCommand.java +++ /dev/null @@ -1,110 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import agent.dbgeng.dbgeng.DebugClient; -import agent.dbgeng.dbgeng.DebugClient.DebugCreateFlags; -import agent.dbgeng.dbgeng.DebugClient.DebugEngCreateFlags; -import agent.dbgeng.dbgeng.DebugClient.DebugVerifierFlags; -import agent.dbgeng.dbgeng.DebugProcessInfo; -import agent.dbgeng.dbgeng.DebugSystemObjects; -import agent.dbgeng.dbgeng.DebugThreadId; -import agent.dbgeng.dbgeng.DebugThreadInfo; -import agent.dbgeng.manager.DbgEvent; -import agent.dbgeng.manager.DbgProcess; -import agent.dbgeng.manager.DbgThread; -import agent.dbgeng.manager.evt.AbstractDbgCompletedCommandEvent; -import agent.dbgeng.manager.evt.DbgProcessCreatedEvent; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import ghidra.comm.util.BitmaskSet; - -/** - * Implementation of {@link DbgProcess#fileExecAndSymbols(String)} - */ -public class DbgLaunchProcessCommand extends AbstractDbgCommand { - - private DbgProcessCreatedEvent created = null; - private boolean completed = false; - private String args; - private String initialDirectory; - private String environment; - private BitmaskSet createFlags; - private BitmaskSet engCreateFlags; - private BitmaskSet verifierFlags; - - public DbgLaunchProcessCommand(DbgManagerImpl manager, String args, - String initialDirectory, String environment, - BitmaskSet createFlags, - BitmaskSet engCreateFlags, - BitmaskSet verifierFlags) { - super(manager); - this.args = args; - this.initialDirectory = initialDirectory; - this.environment = environment; - this.createFlags = createFlags; - this.engCreateFlags = engCreateFlags; - this.verifierFlags = verifierFlags; - } - - @Override - public boolean handle(DbgEvent evt, DbgPendingCommand pending) { - if (evt instanceof AbstractDbgCompletedCommandEvent && pending.getCommand().equals(this)) { - completed = true; - } - else if (evt instanceof DbgProcessCreatedEvent) { - created = (DbgProcessCreatedEvent) evt; - } - return completed && (created != null); - } - - @Override - public DbgThread complete(DbgPendingCommand pending) { - DebugProcessInfo info = created.getInfo(); - DebugThreadInfo tinfo = info.initialThreadInfo; - DebugSystemObjects so = manager.getSystemObjects(); - DebugThreadId tid = so.getThreadIdByHandle(tinfo.handle); - return manager.getThread(tid); - } - - @Override - public void invoke() { - DebugClient dbgeng = manager.getClient(); - //DebugControl control = dbgeng.getControl(); - - initialDirectory = fixPath(initialDirectory); - environment = fixPath(environment); - // NB: The intent here is to enable multi-line input via a single dialog field - if (environment != null) { - environment = environment.replace("\\0", "\0"); - } - - dbgeng.createProcess(dbgeng.getLocalServer(), args, - initialDirectory, environment, createFlags, engCreateFlags, verifierFlags); - manager.waitForEventEx(); - } - - private String fixPath(String input) { - if (input == null || input.equals("")) { - return null; - } - String output = input; - if (input.startsWith("/")) { - output = output.substring(1); - } - output = output.replace("/", "\\"); - return output; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListAvailableProcessesCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListAvailableProcessesCommand.java deleted file mode 100644 index 557d61c2c7..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListAvailableProcessesCommand.java +++ /dev/null @@ -1,58 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.lang3.tuple.ImmutablePair; -import org.apache.commons.lang3.tuple.Pair; - -import agent.dbgeng.jna.dbgeng.Kernel32Extra.PROCESSENTRY32W; -import agent.dbgeng.jna.dbgeng.ToolhelpUtil; -import agent.dbgeng.jna.dbgeng.ToolhelpUtil.Snapshot; -import agent.dbgeng.jna.dbgeng.ToolhelpUtil.SnapshotFlags; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import ghidra.comm.util.BitmaskSet; - -public class DbgListAvailableProcessesCommand - extends AbstractDbgCommand>> { - - private Snapshot snap; - - public DbgListAvailableProcessesCommand(DbgManagerImpl manager) { - super(manager); - } - - @Override - public List> complete(DbgPendingCommand pending) { - List> result = new ArrayList<>(); - for (PROCESSENTRY32W proc : snap.getProcesses()) { - int pid = proc.th32ProcessID.intValue(); - char[] name = proc.szExeFile; - String exe = new String(name); - result.add(new ImmutablePair<>(pid, exe)); - } - return result; - } - - @Override - public void invoke() { - snap = ToolhelpUtil - .createSnapshot(BitmaskSet.of(SnapshotFlags.PROCESS, SnapshotFlags.THREAD), 0); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListBreakpointsCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListBreakpointsCommand.java deleted file mode 100644 index 651bb7ad71..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListBreakpointsCommand.java +++ /dev/null @@ -1,50 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import java.util.*; - -import agent.dbgeng.dbgeng.DebugBreakpoint; -import agent.dbgeng.manager.DbgProcess; -import agent.dbgeng.manager.breakpoint.DbgBreakpointInfo; -import agent.dbgeng.manager.impl.DbgManagerImpl; - -/** - * Implementation of {@link DbgProcess#listBreakpoints()} - */ -public class DbgListBreakpointsCommand extends AbstractDbgCommand> { - - private List breakpoints; - - public DbgListBreakpointsCommand(DbgManagerImpl manager) { - super(manager); - } - - @Override - public Map complete(DbgPendingCommand pending) { - Map list = new LinkedHashMap<>(); - for (DebugBreakpoint bpt : breakpoints) { - DbgBreakpointInfo info = new DbgBreakpointInfo(bpt, manager.getCurrentProcess()); - list.put((long) bpt.getId(), info); - } - return list; - } - - @Override - public void invoke() { - breakpoints = manager.getControl().getBreakpoints(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListEventFiltersCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListEventFiltersCommand.java deleted file mode 100644 index 8fff92de76..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListEventFiltersCommand.java +++ /dev/null @@ -1,58 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import java.util.ArrayList; -import java.util.List; - -import agent.dbgeng.dbgeng.*; -import agent.dbgeng.jna.dbgeng.DbgEngNative.DEBUG_SPECIFIC_FILTER_PARAMETERS; -import agent.dbgeng.manager.DbgEventFilter; -import agent.dbgeng.manager.impl.DbgEventFilterImpl; -import agent.dbgeng.manager.impl.DbgManagerImpl; - -public class DbgListEventFiltersCommand - extends AbstractDbgCommand> { - private List result; - - public DbgListEventFiltersCommand(DbgManagerImpl manager) { - super(manager); - } - - @Override - public List complete(DbgPendingCommand pending) { - return result; - } - - @Override - public void invoke() { - result = new ArrayList<>(); - DebugControl control = manager.getControl(); - DebugFilterInformation info = control.getNumberEventFilters(); - DebugSpecificFilterInformation exc = - control.getSpecificFilterParameters(0, info.getNumberEvents()); - for (int i = 0; i < info.getNumberEvents(); i++) { - DEBUG_SPECIFIC_FILTER_PARAMETERS p = exc.getParameter(i); - String text = control.getEventFilterText(i, p.TextSize.intValue()); - String cmd = control.getEventFilterCommand(i, p.CommandSize.intValue()); - String arg = control.getSpecificFilterArgument(i, p.ArgumentSize.intValue()); - DbgEventFilterImpl f = - new DbgEventFilterImpl(i, text, cmd, arg, p.ExecutionOption.intValue(), - p.ContinueOption.intValue()); - result.add(f); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListExceptionFiltersCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListExceptionFiltersCommand.java deleted file mode 100644 index 047943fb4b..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListExceptionFiltersCommand.java +++ /dev/null @@ -1,79 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import java.util.ArrayList; -import java.util.List; - -import agent.dbgeng.dbgeng.*; -import agent.dbgeng.jna.dbgeng.DbgEngNative.DEBUG_EXCEPTION_FILTER_PARAMETERS; -import agent.dbgeng.manager.DbgExceptionFilter; -import agent.dbgeng.manager.impl.DbgExceptionFilterImpl; -import agent.dbgeng.manager.impl.DbgManagerImpl; - -public class DbgListExceptionFiltersCommand - extends AbstractDbgCommand> { - private List result; - - public DbgListExceptionFiltersCommand(DbgManagerImpl manager) { - super(manager); - } - - @Override - public List complete(DbgPendingCommand pending) { - return result; - } - - @Override - public void invoke() { - result = new ArrayList<>(); - DebugControl control = manager.getControl(); - DebugFilterInformation info = control.getNumberEventFilters(); - int nEvents = info.getNumberEvents(); - int nExcs = info.getNumberSpecificExceptions(); - int nExcsA = info.getNumberArbitraryExceptions(); - DebugExceptionFilterInformation exc = - control.getExceptionFilterParameters(nEvents, null, nExcs); - for (int i = 0; i < exc.getParameters().length; i++) { - DEBUG_EXCEPTION_FILTER_PARAMETERS p = exc.getParameter(i); - String text = control.getEventFilterText(nEvents + i, p.TextSize.intValue()); - String cmd = control.getEventFilterCommand(nEvents + i, p.CommandSize.intValue()); - String cmd2 = control.getExceptionFilterSecondCommand(nEvents + i, - p.SecondCommandSize.intValue()); - DbgExceptionFilterImpl filter = new DbgExceptionFilterImpl(i, text, cmd, cmd2, - p.ExecutionOption.intValue(), p.ContinueOption.intValue(), - p.ExceptionCode.longValue()); - result.add(filter); - } - if (nExcsA > 0) { - DebugExceptionFilterInformation excA = - control.getExceptionFilterParameters(nEvents + nExcs, null, nExcsA); - for (int i = 0; i < excA.getParameters().length; i++) { - DEBUG_EXCEPTION_FILTER_PARAMETERS p = excA.getParameter(i); - String text = Long.toHexString(p.ExceptionCode.longValue()); - // control.getEventFilterText(nEvents + nExcs + i, p.TextSize.intValue()); - String cmd = - control.getEventFilterCommand(nEvents + nExcs + i, p.CommandSize.intValue()); - String cmd2 = control.getExceptionFilterSecondCommand(nEvents + nExcs + i, - p.SecondCommandSize.intValue()); - DbgExceptionFilterImpl filter = new DbgExceptionFilterImpl(i, text, cmd, cmd2, - p.ExecutionOption.intValue(), p.ContinueOption.intValue(), - p.ExceptionCode.longValue()); - result.add(filter); - } - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListKernelMemoryRegionsCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListKernelMemoryRegionsCommand.java deleted file mode 100644 index b405c9e448..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListKernelMemoryRegionsCommand.java +++ /dev/null @@ -1,98 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import java.util.ArrayList; -import java.util.List; - -import agent.dbgeng.dbgeng.DebugDataSpaces.PageState; -import agent.dbgeng.manager.DbgModuleMemory; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgeng.manager.impl.DbgModuleMemoryImpl; - -public class DbgListKernelMemoryRegionsCommand extends AbstractDbgCommand> { - - private List memoryRegions = new ArrayList<>(); - - public DbgListKernelMemoryRegionsCommand(DbgManagerImpl manager) { - super(manager); - } - - @Override - public List complete(DbgPendingCommand pending) { - return memoryRegions; - } - - @Override - public void invoke() { - DbgModuleMemoryImpl section = - new DbgModuleMemoryImpl("lomem", 0L, 0x7FFFFFFFFFFFFFFFL, 0L, new ArrayList(), - new ArrayList(), PageState.COMMIT, "NONE", true, true, true); - memoryRegions.add(section); - section = new DbgModuleMemoryImpl("himem", 0x8000000000000000L, 0xFFFFFFFFFFFFFFFFL, - 0x8000000000000000L, new ArrayList(), new ArrayList(), PageState.COMMIT, - "NONE", true, true, true); - memoryRegions.add(section); - /* - DebugDataSpaces dataSpaces = manager.getDataSpaces(); - for (DebugMemoryBasicInformation info : dataSpaces.iterateVirtual(0)) { - if (info.state == PageState.FREE) { - continue; - } - String type = "[" + info.type + "]"; - if (info.type == PageType.IMAGE) { - try { - DebugModule mod = manager.getSymbols().getModuleByOffset(info.baseAddress, 0); - if (mod != null) { - type = mod.getName(DebugModuleName.IMAGE); - } - } - catch (COMException e) { - type = "[IMAGE UNKNOWN]"; - } - } - else if (info.type == PageType.MAPPED) { - // TODO: Figure out the file name - } - long vmaStart = info.baseAddress; - long vmaEnd = info.baseAddress + info.regionSize; - - boolean isRead = false; - boolean isWrite = false; - boolean isExec = false; - List ap = new ArrayList<>(); - for (PageProtection protect : info.allocationProtect) { - ap.add(protect.toString()); - isRead |= protect.isRead(); - isWrite |= protect.isWrite(); - isExec |= protect.isExecute(); - } - List ip = new ArrayList<>(); - for (PageProtection protect : info.protect) { - ip.add(protect.toString()); - isRead |= protect.isRead(); - isWrite |= protect.isWrite(); - isExec |= protect.isExecute(); - } - DbgModuleMemoryImpl section = - new DbgModuleMemoryImpl(Long.toHexString(vmaStart), vmaStart, vmaEnd, - info.allocationBase, ap, ip, info.state, type, isRead, isWrite, isExec); - memoryRegions.add(section); - } - */ - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListMappingsCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListMappingsCommand.java deleted file mode 100644 index f7d75a80eb..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListMappingsCommand.java +++ /dev/null @@ -1,69 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import java.util.*; - -import agent.dbgeng.dbgeng.DebugSystemObjects; -import agent.dbgeng.dbgeng.DebugThreadId; -import agent.dbgeng.manager.DbgThread; -import agent.dbgeng.manager.impl.*; -import ghidra.util.Msg; - -public class DbgListMappingsCommand extends AbstractDbgCommand> { - protected final DbgProcessImpl process; - private List updatedThreadIds; - - public DbgListMappingsCommand(DbgManagerImpl manager, DbgProcessImpl process) { - super(manager); - this.process = process; - } - - @Override - public Map complete(DbgPendingCommand pending) { - Map threads = process.getKnownThreads(); - Set cur = threads.keySet(); - DebugSystemObjects so = manager.getSystemObjects(); - DebugThreadId previous = so.getCurrentThreadId(); - for (DebugThreadId id : updatedThreadIds) { - if (cur.contains(id)) { - continue; // Do nothing, we're in sync - } - // Need to create the thread as if we receive =thread-created - Msg.warn(this, "Resync: Was missing thread: " + id); - so.setCurrentThreadId(id); - int tid = so.getCurrentThreadSystemId(); - manager.getThreadComputeIfAbsent(id, process, tid, false); - } - for (DebugThreadId id : new ArrayList<>(cur)) { - if (updatedThreadIds.contains(id)) { - continue; // Do nothing, we're in sync - } - // Need to remove the thread as if we received =thread-exited - Msg.warn(this, "Resync: Had extra thread: " + id); - process.removeThread(id); - manager.removeThread(id); - } - so.setCurrentThreadId(previous); - return process.getKnownMappings(); - } - - @Override - public void invoke() { - //TODO - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListMemoryRegionsCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListMemoryRegionsCommand.java deleted file mode 100644 index 941a2be218..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListMemoryRegionsCommand.java +++ /dev/null @@ -1,118 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import java.util.*; -import java.util.Map.Entry; - -import com.sun.jna.platform.win32.COM.COMException; - -import agent.dbgeng.dbgeng.DebugDataSpaces; -import agent.dbgeng.dbgeng.DebugDataSpaces.*; -import agent.dbgeng.dbgeng.DebugModule; -import agent.dbgeng.dbgeng.DebugModule.DebugModuleName; -import agent.dbgeng.manager.DbgModuleMemory; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgeng.manager.impl.DbgModuleMemoryImpl; -import ghidra.util.Msg; - -public class DbgListMemoryRegionsCommand extends AbstractDbgCommand> { - - private List memoryRegions = new ArrayList<>(); - - public DbgListMemoryRegionsCommand(DbgManagerImpl manager) { - super(manager); - } - - @Override - public List complete(DbgPendingCommand pending) { - Map memory = manager.getKnownMemoryRegions(); - if (memoryRegions.isEmpty()) { - Msg.error(this, "Switching to !address for memory"); - manager.setAltMemoryQuery(true); - } - for (DbgModuleMemory region : memoryRegions) { - if (memory.containsValue(region)) { - continue; // Do nothing, we're in sync - } - if (!memory.isEmpty()) { - Msg.warn(this, "Resync: Was missing memory: " + Long.toHexString(region.getId())); - } - manager.addMemory(region); - } - List toRemove = new ArrayList<>(); - for (Entry entry : memory.entrySet()) { - if (memoryRegions.contains(entry.getValue())) { - continue; // Do nothing, we're in sync - } - toRemove.add(entry.getKey()); - } - for (Long key : toRemove) { - manager.removeMemory(key); - } - return memoryRegions; - } - - @Override - public void invoke() { - DebugDataSpaces dataSpaces = manager.getDataSpaces(); - for (DebugMemoryBasicInformation info : dataSpaces.iterateVirtual(0)) { - if (info.state == PageState.FREE) { - continue; - } - String type = "[" + info.type + "]"; - if (info.type == PageType.IMAGE) { - try { - DebugModule mod = manager.getSymbols().getModuleByOffset(info.baseAddress, 0); - if (mod != null) { - type = mod.getName(DebugModuleName.IMAGE); - } - } - catch (COMException e) { - type = "[IMAGE UNKNOWN]"; - } - } - else if (info.type == PageType.MAPPED) { - // TODO: Figure out the file name - } - long vmaStart = info.baseAddress; - long vmaEnd = info.baseAddress + info.regionSize; - - boolean isRead = false; - boolean isWrite = false; - boolean isExec = false; - List ap = new ArrayList<>(); - for (PageProtection protect : info.allocationProtect) { - ap.add(protect.toString()); - isRead |= protect.isRead(); - isWrite |= protect.isWrite(); - isExec |= protect.isExecute(); - } - List ip = new ArrayList<>(); - for (PageProtection protect : info.protect) { - ip.add(protect.toString()); - isRead |= protect.isRead(); - isWrite |= protect.isWrite(); - isExec |= protect.isExecute(); - } - DbgModuleMemoryImpl region = - new DbgModuleMemoryImpl(Long.toHexString(vmaStart), vmaStart, vmaEnd, - info.allocationBase, ap, ip, info.state, type, isRead, isWrite, isExec); - memoryRegions.add(region); - } - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListModulesCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListModulesCommand.java deleted file mode 100644 index 703fee1a14..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListModulesCommand.java +++ /dev/null @@ -1,85 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import java.util.*; - -import agent.dbgeng.dbgeng.*; -import agent.dbgeng.dbgeng.DebugModule.DebugModuleName; -import agent.dbgeng.manager.DbgModule; -import agent.dbgeng.manager.impl.*; -import ghidra.util.Msg; - -public class DbgListModulesCommand extends AbstractDbgCommand> { - protected final DbgProcessImpl process; - private Map updatedModules = new HashMap<>(); - private Map moduleInfo = new HashMap<>(); - - public DbgListModulesCommand(DbgManagerImpl manager, DbgProcessImpl process) { - super(manager); - this.process = process; - } - - @Override - public Map complete(DbgPendingCommand pending) { - Map modules = process.getKnownModules(); - Set cur = modules.keySet(); - for (String id : updatedModules.keySet()) { - if (cur.contains(id)) { - continue; // Do nothing, we're in sync - } - // Need to create the thread as if we receive =thread-created - Msg.warn(this, "Resync: Was missing module: " + id); - DebugModuleInfo info = moduleInfo.get(updatedModules.get(id)); - DbgModuleImpl module = new DbgModuleImpl(manager, process, info); - module.add(); - } - for (String id : new ArrayList<>(cur)) { - if (updatedModules.containsKey(id)) { - continue; // Do nothing, we're in sync - } - process.removeModule(id); - } - return process.getKnownModules(); - } - - @Override - public void invoke() { - try { - setProcess(process); - DebugSymbols symbols = manager.getSymbols(); - for (DebugModule module : symbols.iterateModules(0)) { - DebugModuleInfo info = symbols.getModuleParameters(1, module.getIndex()); - String imageName = "UNKNOWN"; - String moduleName = "UNKNOWN"; - try { - imageName = module.getName(DebugModuleName.IMAGE); - moduleName = module.getName(DebugModuleName.MODULE); - } catch (UnsupportedOperationException uoe) { - //Skip - } - info.setImageName(imageName); - info.setModuleName(moduleName); - updatedModules.put(info.toString(), module); - moduleInfo.put(module, info); - } - } - finally { - resetProcess(); - } - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListOSMemoryRegionsCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListOSMemoryRegionsCommand.java deleted file mode 100644 index 66662d9485..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListOSMemoryRegionsCommand.java +++ /dev/null @@ -1,115 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import java.util.*; -import java.util.Map.Entry; - -import agent.dbgeng.dbgeng.DebugControl; -import agent.dbgeng.dbgeng.DebugDataSpaces.PageState; -import agent.dbgeng.manager.DbgEvent; -import agent.dbgeng.manager.DbgModuleMemory; -import agent.dbgeng.manager.evt.AbstractDbgCompletedCommandEvent; -import agent.dbgeng.manager.evt.DbgConsoleOutputEvent; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgeng.manager.impl.DbgModuleMemoryImpl; -import ghidra.util.Msg; - -public class DbgListOSMemoryRegionsCommand extends AbstractDbgCommand> { - - private List memoryRegions = new ArrayList<>(); - - public DbgListOSMemoryRegionsCommand(DbgManagerImpl manager) { - super(manager); - } - - @Override - public boolean handle(DbgEvent evt, DbgPendingCommand pending) { - if (evt instanceof AbstractDbgCompletedCommandEvent && pending.getCommand().equals(this)) { - return true; - } - else if (evt instanceof DbgConsoleOutputEvent) { - pending.steal(evt); - } - return false; - } - - @Override - public List complete(DbgPendingCommand pending) { - StringBuilder builder = new StringBuilder(); - for (DbgConsoleOutputEvent out : pending.findAllOf(DbgConsoleOutputEvent.class)) { - builder.append(out.getOutput()); - } - parse(builder.toString()); - - Map memory = manager.getKnownMemoryRegions(); - for (DbgModuleMemory region : memoryRegions) { - if (memory.containsValue(region)) { - continue; // Do nothing, we're in sync - } - if (!memory.isEmpty()) { - Msg.warn(this, "Resync: Was missing memory: " + Long.toHexString(region.getId())); - } - manager.addMemory(region); - } - List toRemove = new ArrayList<>(); - for (Entry entry : memory.entrySet()) { - if (memoryRegions.contains(entry.getValue())) { - continue; // Do nothing, we're in sync - } - toRemove.add(entry.getKey()); - } - for (Long key : toRemove) { - manager.removeMemory(key); - } - return memoryRegions; - } - - private void parse(String result) { - String[] lines = result.split("\n"); - for (String line : lines) { - if (line.startsWith("Mapping")) { - continue; - } - String[] fields = line.trim().split("\\s+"); - if (fields.length < 4) { - continue; - } - String start = fields[0].replaceAll("`", ""); - String end = fields[1].replaceAll("`", ""); - long startVal, endVal; - try { - startVal = Long.parseUnsignedLong(start, 16); - endVal = Long.parseUnsignedLong(end, 16); - } - catch (Exception e) { - continue; - } - String name = fields[3]; - ArrayList protect = new ArrayList(); - DbgModuleMemoryImpl region = new DbgModuleMemoryImpl(start, startVal, endVal, startVal, - protect, protect, PageState.COMMIT, name, true, true, true); - memoryRegions.add(region); - } - } - - @Override - public void invoke() { - DebugControl control = manager.getControl(); - control.execute("!address"); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListOSProcessesCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListOSProcessesCommand.java deleted file mode 100644 index 5094cd478c..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListOSProcessesCommand.java +++ /dev/null @@ -1,100 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import java.math.BigInteger; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -import agent.dbgeng.dbgeng.DebugControl; -import agent.dbgeng.dbgeng.DebugProcessId; -import agent.dbgeng.dbgeng.DebugProcessRecord; -import agent.dbgeng.manager.DbgEvent; -import agent.dbgeng.manager.DbgManager; -import agent.dbgeng.manager.DbgProcess; -import agent.dbgeng.manager.evt.AbstractDbgCompletedCommandEvent; -import agent.dbgeng.manager.evt.DbgConsoleOutputEvent; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgeng.manager.impl.DbgProcessImpl; -import ghidra.util.Msg; - -/** - * Implementation of {@link DbgManager#listProcesses()} - */ -public class DbgListOSProcessesCommand extends AbstractDbgCommand> { - private List updatedProcessIds = new ArrayList<>(); - - public DbgListOSProcessesCommand(DbgManagerImpl manager) { - super(manager); - } - - @Override - public boolean handle(DbgEvent evt, DbgPendingCommand pending) { - if (evt instanceof AbstractDbgCompletedCommandEvent && pending.getCommand().equals(this)) { - return true; - } - else if (evt instanceof DbgConsoleOutputEvent) { - pending.steal(evt); - } - return false; - } - - @Override - public Map complete(DbgPendingCommand pending) { - StringBuilder builder = new StringBuilder(); - for (DbgConsoleOutputEvent out : pending.findAllOf(DbgConsoleOutputEvent.class)) { - builder.append(out.getOutput()); - } - parse(builder.toString()); - Msg.warn(this, "Completed OS process list"); - return manager.getKnownProcesses(); - } - - private void parse(String result) { - String[] lines = result.split("\n"); - Long offset = null; - for (int i = 0; i < lines.length; i++) { - String line = lines[i]; - if (line.contains("PROCESS")) { - offset = null; - String[] fields = line.trim().split("\\s+"); - if (fields.length > 1 && fields[0].equals("PROCESS")) { - BigInteger val = new BigInteger(fields[1], 16); - offset = val.longValue(); - } - } - if (line.contains("Cid:")) { - String[] fields = line.trim().split("\\s+"); - if (fields.length > 3 && fields[2].equals("Cid:")) { - Long pid = Long.parseLong(fields[3], 16); - DbgProcessImpl mirror = manager.getProcessComputeIfAbsent(new DebugProcessRecord(pid), pid, null, false); - if (offset != null) { - mirror.setOffset(offset); - updatedProcessIds.add(mirror.getId()); - } - } - } - } - } - - @Override - public void invoke() { - Msg.warn(this, "Retrieving OS process list"); - DebugControl control = manager.getControl(); - control.execute("!process 0 0"); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListOSThreadsCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListOSThreadsCommand.java deleted file mode 100644 index d1783dde55..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListOSThreadsCommand.java +++ /dev/null @@ -1,98 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import java.math.BigInteger; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -import agent.dbgeng.dbgeng.DebugControl; -import agent.dbgeng.dbgeng.DebugThreadId; -import agent.dbgeng.dbgeng.DebugThreadRecord; -import agent.dbgeng.manager.DbgEvent; -import agent.dbgeng.manager.DbgThread; -import agent.dbgeng.manager.evt.AbstractDbgCompletedCommandEvent; -import agent.dbgeng.manager.evt.DbgConsoleOutputEvent; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgeng.manager.impl.DbgProcessImpl; -import agent.dbgeng.manager.impl.DbgThreadImpl; -import ghidra.util.Msg; - -public class DbgListOSThreadsCommand extends AbstractDbgCommand> { - protected final DbgProcessImpl process; - private List updatedThreadIds = new ArrayList<>();; - - public DbgListOSThreadsCommand(DbgManagerImpl manager, DbgProcessImpl process) { - super(manager); - this.process = process; - } - - @Override - public boolean handle(DbgEvent evt, DbgPendingCommand pending) { - if (evt instanceof AbstractDbgCompletedCommandEvent && pending.getCommand().equals(this)) { - return true; - } - else if (evt instanceof DbgConsoleOutputEvent) { - pending.steal(evt); - } - return false; - } - - @Override - public Map complete(DbgPendingCommand pending) { - StringBuilder builder = new StringBuilder(); - for (DbgConsoleOutputEvent out : pending.findAllOf(DbgConsoleOutputEvent.class)) { - builder.append(out.getOutput()); - } - parse(builder.toString()); - Msg.warn(this, "Completed OS thread list for pid="+Long.toHexString(process.getPid())); - Map threads = process.getKnownThreads(); - return threads; - } - - private void parse(String result) { - String[] lines = result.split("\n"); - Long offset = null; - for (int i = 0; i < lines.length; i++) { - String line = lines[i]; - if (line.contains("THREAD")) { - String[] fields = line.trim().split("\\s+"); - if (fields.length > 4 && fields[0].equals("THREAD")) { - BigInteger val = new BigInteger(fields[1], 16); - offset = val.longValue(); - String[] split = fields[3].split("\\."); - if (split.length == 2) { - Long tid = Long.parseLong(split[1], 16); - DbgThreadImpl mirror = manager.getThreadComputeIfAbsent(new DebugThreadRecord(tid), process, tid, false); - if (offset != null) { - mirror.setOffset(offset); - updatedThreadIds.add(mirror.getId()); - } - } - } - } - } - } - - @Override - public void invoke() { - Msg.warn(this, "Retrieving OS thread list for pid="+Long.toHexString(process.getPid())); - DebugControl control = manager.getControl(); - control.execute("!process "+Long.toHexString(process.getOffset())+" 2"); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListProcessesCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListProcessesCommand.java deleted file mode 100644 index 233700bb98..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListProcessesCommand.java +++ /dev/null @@ -1,87 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import agent.dbgeng.dbgeng.DebugProcessId; -import agent.dbgeng.dbgeng.DebugSystemObjects; -import agent.dbgeng.dbgeng.DebugSystemProcessRecord; -import agent.dbgeng.manager.DbgCause.Causes; -import agent.dbgeng.manager.DbgManager; -import agent.dbgeng.manager.DbgProcess; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgeng.manager.impl.DbgProcessImpl; -import ghidra.util.Msg; - -/** - * Implementation of {@link DbgManager#listProcesses()} - */ -public class DbgListProcessesCommand extends AbstractDbgCommand> { - private List updatedProcessIds; - - public DbgListProcessesCommand(DbgManagerImpl manager) { - super(manager); - } - - @Override - public Map complete(DbgPendingCommand pending) { - Map allProcesses = manager.getKnownProcesses(); - Set cur = allProcesses.keySet(); - for (DebugProcessId id : updatedProcessIds) { - if (cur.contains(id)) { - continue; // Do nothing, we're in sync - } - // Need to create the inferior as if we received =thread-group-created - DebugSystemObjects so = manager.getSystemObjects(); - long pid; - String name; - if (!manager.isKernelMode()) { - Msg.warn(this, "Resync: Was missing group: i" + id); - so.setCurrentProcessId(id); - pid = so.getCurrentProcessSystemId(); - name = so.getCurrentProcessExecutableName(); - } - else { - id = new DebugSystemProcessRecord(id.value()); - pid = -1; - name = so.getCurrentProcessExecutableName();; - } - DbgProcessImpl proc = manager.getProcessComputeIfAbsent(id, pid, name, true); - Long offset = so.getCurrentProcessDataOffset(); - proc.setOffset(offset); - } - for (DebugProcessId id : new ArrayList<>(cur)) { - if (updatedProcessIds.contains(id)) { - continue; // Do nothing, we're in sync - } - if (!manager.isKernelMode()) { - Msg.warn(this, "Resync: Had extra group: i" + id); - manager.removeProcess(id, Causes.UNCLAIMED); - } - } - return allProcesses; - } - - @Override - public void invoke() { - DebugSystemObjects so = manager.getSystemObjects(); - updatedProcessIds = so.getProcesses(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListRegisterDescriptionsCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListRegisterDescriptionsCommand.java deleted file mode 100644 index 565e138288..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListRegisterDescriptionsCommand.java +++ /dev/null @@ -1,48 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import java.util.*; - -import agent.dbgeng.dbgeng.DebugRegisters; -import agent.dbgeng.dbgeng.DebugRegisters.DebugRegisterDescription; -import agent.dbgeng.manager.impl.DbgManagerImpl; - -public class DbgListRegisterDescriptionsCommand - extends AbstractDbgCommand> { - - private List list; - - public DbgListRegisterDescriptionsCommand(DbgManagerImpl manager) { - super(manager); - } - - @Override - public List complete(DbgPendingCommand pending) { - return list; - } - - @Override - public void invoke() { - DebugRegisters registers = manager.getRegisters(); - Set descs = registers.getAllDescriptions(); - list = new ArrayList(); - for (DebugRegisterDescription desc : descs) { - list.add(desc); - } - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListSessionsCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListSessionsCommand.java deleted file mode 100644 index 96e85ab505..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListSessionsCommand.java +++ /dev/null @@ -1,66 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import java.util.*; - -import agent.dbgeng.dbgeng.DebugSessionId; -import agent.dbgeng.dbgeng.DebugSystemObjects; -import agent.dbgeng.manager.DbgCause.Causes; -import agent.dbgeng.manager.DbgManager; -import agent.dbgeng.manager.DbgSession; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import ghidra.util.Msg; - -/** - * Implementation of {@link DbgManager#listSessions()} - */ -public class DbgListSessionsCommand extends AbstractDbgCommand> { - private List updatedSessionIds = new ArrayList<>(); - - public DbgListSessionsCommand(DbgManagerImpl manager) { - super(manager); - } - - @Override - public Map complete(DbgPendingCommand pending) { - Map allSessions = manager.getKnownSessions(); - Set cur = allSessions.keySet(); - for (DebugSessionId id : updatedSessionIds) { - if (cur.contains(id)) { - continue; // Do nothing, we're in sync - } - // Need to create the inferior as if we received =thread-group-created - Msg.warn(this, "Resync: Was missing group: i" + id); - manager.getSessionComputeIfAbsent(id, true); - } - for (DebugSessionId id : new ArrayList<>(cur)) { - if (updatedSessionIds.contains(id)) { - continue; // Do nothing, we're in sync - } - // Need to remove the session as if we received =thread-group-removed - Msg.warn(this, "Resync: Had extra group: i" + id); - manager.removeSession(id, Causes.UNCLAIMED); - } - return allSessions; - } - - @Override - public void invoke() { - DebugSystemObjects so = manager.getSystemObjects(); - updatedSessionIds = so.getSessions(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListSymbolsCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListSymbolsCommand.java deleted file mode 100644 index 63a29310df..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListSymbolsCommand.java +++ /dev/null @@ -1,67 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import java.util.*; -import java.util.Map.Entry; - -import agent.dbgeng.dbgeng.*; -import agent.dbgeng.manager.impl.*; - -public class DbgListSymbolsCommand extends AbstractDbgCommand> { - protected final DbgProcessImpl process; - protected final DbgModuleImpl module; - - private Map symbolEntries = new HashMap<>(); - - public DbgListSymbolsCommand(DbgManagerImpl manager, DbgProcessImpl process, - DbgModuleImpl module) { - super(manager); - this.process = process; - this.module = module; - } - - @Override - public Map complete(DbgPendingCommand pending) { - Map symbolMap = new HashMap<>(); - for (Entry entry : symbolEntries.entrySet()) { - DebugSymbolEntry value = entry.getValue(); - DbgMinimalSymbol minSymbol = new DbgMinimalSymbol(entry.getKey().symbolIndex, - value.typeId, value.name, value.offset, value.size, value.tag, value.moduleBase); - symbolMap.put(entry.getKey().toString(), minSymbol); - } - return symbolMap; - } - - @Override - public void invoke() { - try { - setProcess(process); - DebugSymbols symbols = manager.getSymbols(); - - for (DebugSymbolName symbol : symbols.iterateSymbolMatches(module.getName() + "!*")) { - List symbolIdsByName = symbols.getSymbolIdsByName(symbol.name); - for (DebugSymbolId symbolId : symbolIdsByName) { - DebugSymbolEntry symbolEntry = symbols.getSymbolEntry(symbolId); - symbolEntries.put(symbolId, symbolEntry); - } - } - } - finally { - resetProcess(); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListThreadsCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListThreadsCommand.java deleted file mode 100644 index c1b1b5e9ce..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgListThreadsCommand.java +++ /dev/null @@ -1,89 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import agent.dbgeng.dbgeng.DebugSystemObjects; -import agent.dbgeng.dbgeng.DebugSystemThreadRecord; -import agent.dbgeng.dbgeng.DebugThreadId; -import agent.dbgeng.manager.DbgThread; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgeng.manager.impl.DbgProcessImpl; -import agent.dbgeng.manager.impl.DbgThreadImpl; -import ghidra.util.Msg; - -public class DbgListThreadsCommand extends AbstractDbgCommand> { - protected final DbgProcessImpl process; - private List updatedThreadIds; - - public DbgListThreadsCommand(DbgManagerImpl manager, DbgProcessImpl process) { - super(manager); - this.process = process; - } - - @Override - public Map complete(DbgPendingCommand pending) { - Map threads = process.getKnownThreads(); - Set cur = threads.keySet(); - for (DebugThreadId id : updatedThreadIds) { - if (cur.contains(id)) { - continue; // Do nothing, we're in sync - } - DebugSystemObjects so = manager.getSystemObjects(); - long tid; - if (!manager.isKernelMode()) { - Msg.warn(this, "Resync: Was missing thread: " + id); - so.setCurrentThreadId(id); - tid = (long) so.getCurrentThreadSystemId(); - } - else { - id = new DebugSystemThreadRecord(id.value()); - tid = -1; - } - DbgThreadImpl thread = manager.getThreadComputeIfAbsent(id, process, tid, false); - Long offset = so.getCurrentThreadDataOffset(); - thread.setOffset(offset); - } - for (DebugThreadId id : new ArrayList<>(cur)) { - if (updatedThreadIds.contains(id)) { - continue; // Do nothing, we're in sync - } - if (!manager.isKernelMode()) { - Msg.warn(this, "Resync: Had extra thread: " + id); - process.removeThread(id); - manager.removeThread(id); - } - } - return process.getKnownThreads(); - } - - @Override - public void invoke() { - try { - setProcess(process); - DebugSystemObjects so = manager.getSystemObjects(); - updatedThreadIds = so.getThreads(); - } - finally { - resetProcess(); - } - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgOpenDumpCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgOpenDumpCommand.java deleted file mode 100644 index ec50688ce3..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgOpenDumpCommand.java +++ /dev/null @@ -1,73 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import java.util.Map; - -import agent.dbgeng.dbgeng.*; -import agent.dbgeng.manager.*; -import agent.dbgeng.manager.evt.AbstractDbgCompletedCommandEvent; -import agent.dbgeng.manager.evt.DbgProcessCreatedEvent; -import agent.dbgeng.manager.impl.DbgManagerImpl; - -/** - * Implementation of {@link DbgProcess#fileExecAndSymbols(String)} - */ -public class DbgOpenDumpCommand extends AbstractDbgCommand { - - private DbgProcessCreatedEvent created = null; - private boolean completed = false; - private Map args; - - public DbgOpenDumpCommand(DbgManagerImpl manager, Map args) { - super(manager); - this.args = args; - } - - @Override - public boolean handle(DbgEvent evt, DbgPendingCommand pending) { - if (evt instanceof AbstractDbgCompletedCommandEvent && pending.getCommand().equals(this)) { - completed = true; - } - else if (evt instanceof DbgProcessCreatedEvent) { - created = (DbgProcessCreatedEvent) evt; - } - return completed && (created != null); - } - - @Override - public DbgThread complete(DbgPendingCommand pending) { - DebugProcessInfo info = created.getInfo(); - DebugThreadInfo tinfo = info.initialThreadInfo; - DebugSystemObjects so = manager.getSystemObjects(); - DebugThreadId tid = so.getThreadIdByHandle(tinfo.handle); - return manager.getThread(tid); - } - - @Override - public void invoke() { - DebugClient dbgeng = manager.getClient(); - //DebugControl control = dbgeng.getControl(); - - String f = (String) args.get("TraceOrDump"); - if (f.startsWith("/")) { - f = f.substring(1); - } - f = f.replace("/", "\\"); - dbgeng.openDumpFileWide(f); - manager.waitForEventEx(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgPendingCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgPendingCommand.java deleted file mode 100644 index 6359ce08ff..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgPendingCommand.java +++ /dev/null @@ -1,205 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.manager.*; -import agent.dbgeng.manager.evt.AbstractDbgCompletedCommandEvent; -import agent.dbgeng.manager.evt.DbgCommandErrorEvent; - -/** - * A command queued on the dbgeng manager - * - * A {@link DbgCommand} is queued by wrapping it in a {@link DbgPendingCommand} and submitting it to - * the manager implementation's executor. This object also keep track of claimed/stolen events and - * provides convenience methods for sifting through them. - * - * @param the type "returned" by the command - */ -public class DbgPendingCommand extends CompletableFuture implements DbgCause { - private final DbgCommand cmd; - private final Set> evts = new LinkedHashSet<>(); - - /** - * Wrap a command for execution - * - * @param cmd the command - */ - public DbgPendingCommand(DbgCommand cmd) { - this.cmd = cmd; - } - - /** - * Get the command being executed - * - * @return cmd - */ - public DbgCommand getCommand() { - return cmd; - } - - /** - * Finish the execution of this command - */ - public void finish() { - //Msg.trace(this, "Finishing " + cmd); - try { - T result = cmd.complete(this); - complete(result); - } - catch (Throwable e) { - completeExceptionally(e); - } - } - - /** - * Handle an event - * - * This gives the command implementation the first chance to claim or steal an event - * - * @param evt the event - * @return true if the command is ready to be completed - */ - public boolean handle(DbgEvent evt) { - return cmd.handle(evt, this); - } - - /** - * Claim an event - * - * This stores the event for later retrieval and processing. - * - * @param evt the event - */ - public void claim(DbgEvent evt) { - evt.claim(this); - evts.add(evt); - } - - /** - * Steal an event - * - * This stores the event for later retrieval and processing. - * - * @param evt the event - */ - public void steal(DbgEvent evt) { - claim(evt); - evt.steal(); - } - - /** - * Assume a single event of particular type was claimed/stolen, and get that event - * - * @param cls the type of the event - * @return the event cast to the type - * @throws IllegalStateException if more than one event was claimed/stolen - * @throws ClassCastException if the event cannot be cast to the given type - */ - public > E castSingleEvent(Class cls) { - if (evts.size() != 1) { - throw new IllegalStateException("Command did not claim exactly one event"); - } - return cls.cast(evts.iterator().next()); - } - - /** - * Find the first claimed/stolen event of a given type - * - * @param cls the type of the event - * @return the event cast to the type - * @throws IllegalStateException if no event of the given type was claimed/stolen - */ - public > E findFirstOf(Class cls) { - for (DbgEvent evt : evts) { - if (cls.isAssignableFrom(evt.getClass())) { - return cls.cast(evt); - } - } - throw new IllegalStateException("Command did not claim any " + cls); - } - - /** - * Find all events claimed/stolen of a given type - * - * @param cls the type of the events - * @return the list of events cast to the type - */ - public > List findAllOf(Class cls) { - List found = new ArrayList<>(); - for (DbgEvent evt : evts) { - if (cls.isAssignableFrom(evt.getClass())) { - found.add(cls.cast(evt)); - } - } - return found; - } - - /** - * Assume exactly one event of the given type was claimed/stolen, and get that event - * - * @param cls the type of the event - * @return the event cast to the type - * @throws IllegalStateException if more than one event matches - */ - public > E findSingleOf(Class cls) { - List found = findAllOf(cls); - if (found.size() != 1) { - throw new IllegalStateException( - "Command did not claim exactly one " + cls + ". Have " + evts); - } - return found.get(0); - } - - /** - * Check that the command completed with one of the given results - * - * {@link DbgCommandErrorEvent} need not be listed. This method will handle it as a special case - * already. To avoid the special treatment, list it explicitly. - * - * @param classes the completion type to accept - * @return the completion event, cast to the greatest common subclass - */ - @SafeVarargs - public final E checkCompletion( - Class... classes) { - AbstractDbgCompletedCommandEvent completion = - findSingleOf(AbstractDbgCompletedCommandEvent.class); - // Allow query for exact class to override error interpretation - for (Class cls : classes) { - if (cls == completion.getClass()) { - return cls.cast(completion); - } - } - if (completion instanceof DbgCommandErrorEvent) { - throw new DbgCommandError(completion.getInfo(), cmd); - } - for (Class cls : classes) { - if (cls.isAssignableFrom(completion.getClass())) { - return cls.cast(completion); - } - } - throw new IllegalStateException( - "Command completed with " + completion + ", not any of " + Arrays.asList(classes)); - } - - @Override - public String toString() { - return super.toString() + "(" + cmd + ")"; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgReadBusDataCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgReadBusDataCommand.java deleted file mode 100644 index 0ff2526d4a..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgReadBusDataCommand.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import java.nio.ByteBuffer; - -import agent.dbgeng.manager.DbgThread; -import agent.dbgeng.manager.impl.DbgManagerImpl; - -/** - * Implementation of {@link DbgThread#readMemory(long, ByteBuffer, int)} - */ -public class DbgReadBusDataCommand extends AbstractDbgReadCommand { - - private final int busDataType; - private final int busNumber; - private final int slotNumber; - - public DbgReadBusDataCommand(DbgManagerImpl manager, long addr, ByteBuffer buf, int len, - int busDataType, int busNumber, int slotNumber) { - super(manager, addr, buf, len); - this.busDataType = busDataType; - this.busNumber = busNumber; - this.slotNumber = slotNumber; - } - - @Override - protected int doRead(long addr, ByteBuffer buf, int len) { - return manager.getDataSpaces() - .readBusData(busDataType, busNumber, slotNumber, addr, buf, len); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgReadControlCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgReadControlCommand.java deleted file mode 100644 index 0374c236e4..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgReadControlCommand.java +++ /dev/null @@ -1,40 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import java.nio.ByteBuffer; - -import agent.dbgeng.manager.DbgThread; -import agent.dbgeng.manager.impl.DbgManagerImpl; - -/** - * Implementation of {@link DbgThread#readMemory(long, ByteBuffer, int)} - */ -public class DbgReadControlCommand extends AbstractDbgReadCommand { - - private final int processor; - - public DbgReadControlCommand(DbgManagerImpl manager, long addr, ByteBuffer buf, int len, - int processor) { - super(manager, addr, buf, len); - this.processor = processor; - } - - @Override - protected int doRead(long addr, ByteBuffer buf, int len) { - return manager.getDataSpaces().readControl(processor, addr, buf, len); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgReadDebuggerDataCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgReadDebuggerDataCommand.java deleted file mode 100644 index 78763fa034..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgReadDebuggerDataCommand.java +++ /dev/null @@ -1,36 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import java.nio.ByteBuffer; - -import agent.dbgeng.manager.DbgThread; -import agent.dbgeng.manager.impl.DbgManagerImpl; - -/** - * Implementation of {@link DbgThread#readMemory(long, ByteBuffer, int)} - */ -public class DbgReadDebuggerDataCommand extends AbstractDbgReadCommand { - - public DbgReadDebuggerDataCommand(DbgManagerImpl manager, long addr, ByteBuffer buf, int len) { - super(manager, addr, buf, len); - } - - @Override - protected int doRead(long addr, ByteBuffer buf, int len) { - return manager.getDataSpaces().readDebuggerData((int) addr, buf, len); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgReadIoCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgReadIoCommand.java deleted file mode 100644 index f7bf5b0543..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgReadIoCommand.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import java.nio.ByteBuffer; - -import agent.dbgeng.manager.DbgThread; -import agent.dbgeng.manager.impl.DbgManagerImpl; - -/** - * Implementation of {@link DbgThread#readMemory(long, ByteBuffer, int)} - */ -public class DbgReadIoCommand extends AbstractDbgReadCommand { - - private final int interfaceType; - private final int busNumber; - private final int addressSpace; - - public DbgReadIoCommand(DbgManagerImpl manager, long addr, ByteBuffer buf, int len, - int interfaceType, int busNumber, int addressSpace) { - super(manager, addr, buf, len); - this.interfaceType = interfaceType; - this.busNumber = busNumber; - this.addressSpace = addressSpace; - } - - @Override - protected int doRead(long addr, ByteBuffer buf, int len) { - return manager.getDataSpaces() - .readIo(interfaceType, busNumber, addressSpace, addr, buf, len); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgReadMemoryCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgReadMemoryCommand.java deleted file mode 100644 index 1cf37ecadb..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgReadMemoryCommand.java +++ /dev/null @@ -1,36 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import java.nio.ByteBuffer; - -import agent.dbgeng.manager.DbgThread; -import agent.dbgeng.manager.impl.DbgManagerImpl; - -/** - * Implementation of {@link DbgThread#readMemory(long, ByteBuffer, int)} - */ -public class DbgReadMemoryCommand extends AbstractDbgReadCommand { - - public DbgReadMemoryCommand(DbgManagerImpl manager, long addr, ByteBuffer buf, int len) { - super(manager, addr, buf, len); - } - - @Override - protected int doRead(long addr, ByteBuffer buf, int len) { - return manager.getDataSpaces().readVirtual(addr, buf, len); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgReadPhysicalMemoryCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgReadPhysicalMemoryCommand.java deleted file mode 100644 index 4a2fd53e82..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgReadPhysicalMemoryCommand.java +++ /dev/null @@ -1,37 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import java.nio.ByteBuffer; - -import agent.dbgeng.manager.DbgThread; -import agent.dbgeng.manager.impl.DbgManagerImpl; - -/** - * Implementation of {@link DbgThread#readMemory(long, ByteBuffer, int)} - */ -public class DbgReadPhysicalMemoryCommand extends AbstractDbgReadCommand { - - public DbgReadPhysicalMemoryCommand(DbgManagerImpl manager, long addr, ByteBuffer buf, - int len) { - super(manager, addr, buf, len); - } - - @Override - protected int doRead(long addr, ByteBuffer buf, int len) { - return manager.getDataSpaces().readPhysical(addr, buf, len); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgReadRegistersCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgReadRegistersCommand.java deleted file mode 100644 index 9b8ec6204e..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgReadRegistersCommand.java +++ /dev/null @@ -1,71 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import java.math.BigInteger; -import java.util.*; - -import agent.dbgeng.dbgeng.*; -import agent.dbgeng.manager.DbgStackFrameOperations; -import agent.dbgeng.manager.impl.*; - -/** - * Implementation of {@link DbgStackFrameOperations#readRegisters(Set)} - */ -public class DbgReadRegistersCommand extends AbstractDbgCommand> { - - private final DbgThreadImpl thread; - private final Set regs; - private DebugRegisters registers; - private Map result = new LinkedHashMap<>(); - - public DbgReadRegistersCommand(DbgManagerImpl manager, DbgThreadImpl thread, Integer frameId, - Set regs) { - super(manager); - this.thread = thread; - this.regs = regs; - } - - @Override - public Map complete(DbgPendingCommand pending) { - if (regs.isEmpty()) { - return Collections.emptyMap(); - } - return result; - } - - @Override - public void invoke() { - try { - setThread(thread); - registers = manager.getClient().getRegisters(); - if (registers != null) { - for (DbgRegister r : regs) { - if (r.isBaseRegister()) { - DebugValue value = registers.getValueByName(r.getName()); - if (value != null) { - BigInteger bval = new BigInteger(value.encodeAsBytes()); - result.put(r, bval); - } - } - } - } - } - finally { - resetThread(); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgRemoveProcessCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgRemoveProcessCommand.java deleted file mode 100644 index e29743362d..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgRemoveProcessCommand.java +++ /dev/null @@ -1,37 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import agent.dbgeng.dbgeng.DebugProcessId; -import agent.dbgeng.manager.DbgManager; -import agent.dbgeng.manager.impl.DbgManagerImpl; - -/** - * Implementation of {@link DbgManager#addProcess()} - */ -public class DbgRemoveProcessCommand extends AbstractDbgCommand { - private DebugProcessId id; - - public DbgRemoveProcessCommand(DbgManagerImpl manager, DebugProcessId id) { - super(manager); - this.id = id; - } - - @Override - public void invoke() { - manager.removeProcess(manager.getProcess(id)); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgRemoveSessionCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgRemoveSessionCommand.java deleted file mode 100644 index 5f9a941731..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgRemoveSessionCommand.java +++ /dev/null @@ -1,37 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import agent.dbgeng.dbgeng.DebugSessionId; -import agent.dbgeng.manager.DbgManager; -import agent.dbgeng.manager.impl.DbgManagerImpl; - -/** - * Implementation of {@link DbgManager#addProcess()} - */ -public class DbgRemoveSessionCommand extends AbstractDbgCommand { - private DebugSessionId id; - - public DbgRemoveSessionCommand(DbgManagerImpl manager, DebugSessionId id) { - super(manager); - this.id = id; - } - - @Override - public void invoke() { - manager.removeSession(manager.getSession(id)); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgRequestActivationCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgRequestActivationCommand.java deleted file mode 100644 index f2176e79d0..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgRequestActivationCommand.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgeng.model.iface1.DbgModelTargetActiveScope; -import ghidra.dbg.target.TargetObject; - -public class DbgRequestActivationCommand extends AbstractDbgCommand { - - private DbgModelTargetActiveScope activator; - private TargetObject obj; - - /** - * Set focus for the current ref - * - * @param manager the manager to execute the command - * @param activator in most cases the root object (must be an ancestor for the ref) - * @param obj the desired object to be made active - */ - public DbgRequestActivationCommand(DbgManagerImpl manager, DbgModelTargetActiveScope activator, - TargetObject obj) { - super(manager); - this.activator = activator; - this.obj = obj; - } - - @Override - public void invoke() { - activator.doRequestActivation(obj); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgRequestFocusCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgRequestFocusCommand.java deleted file mode 100644 index 698ceddb8e..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgRequestFocusCommand.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgeng.model.iface1.DbgModelTargetFocusScope; -import ghidra.dbg.target.TargetObject; - -public class DbgRequestFocusCommand extends AbstractDbgCommand { - - private DbgModelTargetFocusScope scope; - private TargetObject obj; - - /** - * Set focus for the current ref - * - * @param manager the manager to execute the command - * @param scope in most cases the root object (must be an ancestor for the ref) - * @param obj the desired focus - */ - public DbgRequestFocusCommand(DbgManagerImpl manager, DbgModelTargetFocusScope scope, - TargetObject obj) { - super(manager); - this.scope = scope; - this.obj = obj; - } - - @Override - public void invoke() { - scope.doRequestFocus(obj); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgResolveProcessCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgResolveProcessCommand.java deleted file mode 100644 index 1047e50dd9..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgResolveProcessCommand.java +++ /dev/null @@ -1,101 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import java.math.BigInteger; - -import agent.dbgeng.dbgeng.DebugControl; -import agent.dbgeng.manager.DbgEvent; -import agent.dbgeng.manager.DbgProcess; -import agent.dbgeng.manager.evt.AbstractDbgCompletedCommandEvent; -import agent.dbgeng.manager.evt.DbgConsoleOutputEvent; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgeng.manager.impl.DbgProcessImpl; -import ghidra.util.Msg; - -public class DbgResolveProcessCommand extends AbstractDbgCommand { - - private DbgProcessImpl process; - private Long offset; - - /** - * Adjust the process contents to include both pid and offset - * NB: should only be used in kernel-mode against the current process (i.e. id==offset) - * - * @param manager the manager to execute the command - * @param process the desired process - */ - public DbgResolveProcessCommand(DbgManagerImpl manager, DbgProcess process) { - super(manager); - this.process = (DbgProcessImpl) process; - } - - @Override - public boolean handle(DbgEvent evt, DbgPendingCommand pending) { - if (evt instanceof AbstractDbgCompletedCommandEvent && pending.getCommand().equals(this)) { - return true; - } - else if (evt instanceof DbgConsoleOutputEvent) { - pending.steal(evt); - } - return false; - } - - @Override - public DbgProcess complete(DbgPendingCommand pending) { - StringBuilder builder = new StringBuilder(); - for (DbgConsoleOutputEvent out : pending.findAllOf(DbgConsoleOutputEvent.class)) { - builder.append(out.getOutput()); - } - parse(builder.toString()); - return process; - } - - private void parse(String result) { - String[] lines = result.split("\n"); - for (int i = 0; i < lines.length; i++) { - String line = lines[i]; - if (line.contains("PROCESS")) { - String[] fields = line.trim().split("\\s+"); - if (fields.length > 1 && fields[0].equals("PROCESS")) { - BigInteger val = new BigInteger(fields[1], 16); - offset = val.longValue(); - process.setOffset(offset); - } - } - if (line.contains("Cid:")) { - String[] fields = line.trim().split("\\s+"); - if (fields.length > 3 && fields[2].equals("Cid:")) { - Long pid = Long.parseLong(fields[3], 16); - process.setPid(pid); - } - break; - } - } - if (offset == null) { - Msg.error(this, result); - } - } - - @Override - public void invoke() { - if (process != null) { - DebugControl control = manager.getControl(); - Long key = process.getOffset() != null ? process.getOffset() : process.getPid(); - control.execute("!process "+Long.toHexString(key)+" 0"); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgResolveThreadCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgResolveThreadCommand.java deleted file mode 100644 index c765984474..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgResolveThreadCommand.java +++ /dev/null @@ -1,100 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import java.math.BigInteger; - -import agent.dbgeng.dbgeng.DebugControl; -import agent.dbgeng.dbgeng.DebugThreadId; -import agent.dbgeng.manager.DbgEvent; -import agent.dbgeng.manager.DbgThread; -import agent.dbgeng.manager.evt.AbstractDbgCompletedCommandEvent; -import agent.dbgeng.manager.evt.DbgConsoleOutputEvent; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgeng.manager.impl.DbgThreadImpl; -import ghidra.util.Msg; - -public class DbgResolveThreadCommand extends AbstractDbgCommand { - - private DbgThreadImpl thread; - private Long offset; - - /** - * Adjust the thread contents to include both tid and offset - * NB: should only be used in kernel-mode against the current thread (i.e. id==offset) - * - * @param manager the manager to execute the command - * @param thread the desired thread - * @param frameId the desired frame level - */ - public DbgResolveThreadCommand(DbgManagerImpl manager, DbgThread thread) { - super(manager); - this.thread = (DbgThreadImpl) thread; - } - - @Override - public boolean handle(DbgEvent evt, DbgPendingCommand pending) { - if (evt instanceof AbstractDbgCompletedCommandEvent && pending.getCommand().equals(this)) { - return true; - } - else if (evt instanceof DbgConsoleOutputEvent) { - pending.steal(evt); - } - return false; - } - - @Override - public DbgThread complete(DbgPendingCommand pending) { - StringBuilder builder = new StringBuilder(); - for (DbgConsoleOutputEvent out : pending.findAllOf(DbgConsoleOutputEvent.class)) { - builder.append(out.getOutput()); - } - parse(builder.toString()); - return thread; - } - - private void parse(String result) { - String[] lines = result.split("\n"); - for (int i = 0; i < lines.length; i++) { - String line = lines[i]; - if (line.contains("THREAD")) { - String[] fields = line.trim().split("\\s+"); - if (fields.length > 4 && fields[0].equals("THREAD")) { - BigInteger val = new BigInteger(fields[1], 16); - offset = val.longValue(); - thread.setOffset(offset); - String[] split = fields[3].split("\\."); - if (split.length == 2) { - //Long pid = Long.parseLong(split[0], 16); - Long tid = Long.parseLong(split[1], 16); - thread.setTid(tid); - } - } - break; - } - } - if (offset == null) { - Msg.error(this, result); - } - } - - @Override - public void invoke() { - DebugControl control = manager.getControl(); - Long key = thread.getOffset() != null ? thread.getOffset() : thread.getTid(); - control.execute("!thread "+Long.toHexString(key)+" 0"); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgRunCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgRunCommand.java deleted file mode 100644 index 3c36a5de74..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgRunCommand.java +++ /dev/null @@ -1,61 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import agent.dbgeng.dbgeng.*; -import agent.dbgeng.manager.*; -import agent.dbgeng.manager.evt.*; -import agent.dbgeng.manager.impl.DbgManagerImpl; - -/** - * Implementation of {@link DbgProcess#fileExecAndSymbols(String)} - */ -public class DbgRunCommand extends AbstractDbgCommand { - - public DbgRunCommand(DbgManagerImpl manager) { - super(manager); - } - - @Override - public boolean handle(DbgEvent evt, DbgPendingCommand pending) { - if (evt instanceof AbstractDbgCompletedCommandEvent && pending.getCommand().equals(this)) { - pending.claim(evt); - return true; - } - else if (evt instanceof DbgRunningEvent) { - pending.claim(evt); - } - else if (evt instanceof DbgThreadCreatedEvent) { - pending.claim(evt); - } - return false; - } - - @Override - public DbgThread complete(DbgPendingCommand pending) { - // Just take the first thread. Others are considered clones. - DbgThreadCreatedEvent created = pending.findFirstOf(DbgThreadCreatedEvent.class); - DebugThreadInfo info = created.getInfo(); - DebugSystemObjects so = manager.getSystemObjects(); - DebugThreadId tid = so.getThreadIdByHandle(info.handle); - return manager.getThread(tid); - } - - @Override - public void invoke() { - // TODO Auto-generated method stub - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgSetActiveProcessCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgSetActiveProcessCommand.java deleted file mode 100644 index 800eea4843..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgSetActiveProcessCommand.java +++ /dev/null @@ -1,108 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import java.math.BigInteger; - -import agent.dbgeng.dbgeng.DebugControl; -import agent.dbgeng.dbgeng.DebugProcessId; -import agent.dbgeng.dbgeng.DebugSystemObjects; -import agent.dbgeng.manager.DbgEvent; -import agent.dbgeng.manager.DbgProcess; -import agent.dbgeng.manager.evt.AbstractDbgCompletedCommandEvent; -import agent.dbgeng.manager.evt.DbgConsoleOutputEvent; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgeng.manager.impl.DbgProcessImpl; - -public class DbgSetActiveProcessCommand extends AbstractDbgCommand { - - private DbgProcessImpl process; - private Long offset; - - /** - * Set the active process - * - * @param manager the manager to execute the command - * @param process the desired process - */ - public DbgSetActiveProcessCommand(DbgManagerImpl manager, DbgProcess process) { - super(manager); - this.process = (DbgProcessImpl) process; - } - - @Override - public boolean handle(DbgEvent evt, DbgPendingCommand pending) { - if (evt instanceof AbstractDbgCompletedCommandEvent && pending.getCommand().equals(this)) { - return true; - } - else if (evt instanceof DbgConsoleOutputEvent) { - pending.steal(evt); - } - return false; - } - - @Override - public Void complete(DbgPendingCommand pending) { - StringBuilder builder = new StringBuilder(); - for (DbgConsoleOutputEvent out : pending.findAllOf(DbgConsoleOutputEvent.class)) { - builder.append(out.getOutput()); - } - parse(builder.toString()); - if (offset != null) { - manager.getSystemObjects().setImplicitThreadDataOffset(offset); - } - return null; - } - - private void parse(String result) { - String[] lines = result.split("\n"); - for (int i = 0; i < lines.length; i++) { - String line = lines[i]; - if (line.contains("PROCESS")) { - String[] fields = line.trim().split("\\s+"); - if (fields.length > 1 && fields[0].equals("PROCESS")) { - BigInteger val = new BigInteger(fields[1], 16); - offset = val.longValue(); - process.setOffset(offset); - } - break; - } - } - } - - @Override - public void invoke() { - if (process != null) { - DebugProcessId id = process.getId(); - if (id != null) { - DebugSystemObjects so = manager.getSystemObjects(); - if (manager.isKernelMode()) { - offset = process.getOffset(); - if (offset == null || offset == 0L) { - DebugControl control = manager.getControl(); - control.execute("!process "+Long.toHexString(process.getPid())+" 0"); - } - } else { - so.setCurrentProcessId(id); - DebugProcessId currentProcessId = so.getCurrentProcessId(); - if (!id.id().equals(currentProcessId.id())) { - so.setCurrentProcessId(id); - } - } - } - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgSetActiveSessionCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgSetActiveSessionCommand.java deleted file mode 100644 index c29eb214bc..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgSetActiveSessionCommand.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import agent.dbgeng.dbgeng.DebugSessionId; -import agent.dbgeng.manager.DbgSession; -import agent.dbgeng.manager.impl.DbgManagerImpl; - -public class DbgSetActiveSessionCommand extends AbstractDbgCommand { - private DbgSession session; - - /** - * Set the active session - * - * @param manager the manager to execute the command - * @param process the desired process - */ - public DbgSetActiveSessionCommand(DbgManagerImpl manager, DbgSession session) { - super(manager); - this.session = session; - } - - @Override - public void invoke() { - if (session != null) { - DebugSessionId id = session.getId(); - if (id != null) { - manager.getSystemObjects().setCurrentSystemId(id); - } - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgSetActiveThreadCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgSetActiveThreadCommand.java deleted file mode 100644 index 621c85e198..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgSetActiveThreadCommand.java +++ /dev/null @@ -1,106 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import java.math.BigInteger; - -import agent.dbgeng.dbgeng.DebugControl; -import agent.dbgeng.dbgeng.DebugThreadId; -import agent.dbgeng.manager.DbgEvent; -import agent.dbgeng.manager.DbgThread; -import agent.dbgeng.manager.evt.AbstractDbgCompletedCommandEvent; -import agent.dbgeng.manager.evt.DbgConsoleOutputEvent; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgeng.manager.impl.DbgThreadImpl; - -public class DbgSetActiveThreadCommand extends AbstractDbgCommand { - - private DbgThreadImpl thread; - private Integer frameId; - private Long offset; - - /** - * Set the active thread - * - * @param manager the manager to execute the command - * @param thread the desired thread - * @param frameId the desired frame level - */ - public DbgSetActiveThreadCommand(DbgManagerImpl manager, DbgThread thread, Integer frameId) { - super(manager); - this.thread = (DbgThreadImpl) thread; - this.frameId = frameId; - } - - @Override - public boolean handle(DbgEvent evt, DbgPendingCommand pending) { - if (evt instanceof AbstractDbgCompletedCommandEvent && pending.getCommand().equals(this)) { - return true; - } - else if (evt instanceof DbgConsoleOutputEvent) { - pending.steal(evt); - } - return false; - } - - @Override - public Void complete(DbgPendingCommand pending) { - StringBuilder builder = new StringBuilder(); - for (DbgConsoleOutputEvent out : pending.findAllOf(DbgConsoleOutputEvent.class)) { - builder.append(out.getOutput()); - } - parse(builder.toString()); - if (offset != null) { - manager.getSystemObjects().setImplicitThreadDataOffset(offset); - } - return null; - } - - private void parse(String result) { - String[] lines = result.split("\n"); - for (int i = 0; i < lines.length; i++) { - String line = lines[i]; - if (line.contains("THREAD")) { - String[] fields = line.trim().split("\\s+"); - if (fields.length > 1 && fields[0].equals("THREAD")) { - BigInteger val = new BigInteger(fields[1], 16); - offset = val.longValue(); - thread.setOffset(offset); - } - break; - } - } - } - - @Override - public void invoke() { - DebugThreadId id = thread.getId(); - if (id != null) { - if (!manager.isKernelMode()) { - manager.getSystemObjects().setCurrentThreadId(id); - } else { - offset = thread.getOffset(); - if (offset == null || offset == 0L) { - DebugControl control = manager.getControl(); - control.execute("!thread -t "+Long.toHexString(thread.getTid())+" 0"); - } - } - if (frameId != null) { - manager.getSymbols().setCurrentScopeFrameIndex(frameId); - } - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgSetFilterArgumentCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgSetFilterArgumentCommand.java deleted file mode 100644 index 6b3ffc0c8a..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgSetFilterArgumentCommand.java +++ /dev/null @@ -1,39 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import agent.dbgeng.dbgeng.DebugControl; -import agent.dbgeng.manager.impl.DbgManagerImpl; - -public class DbgSetFilterArgumentCommand - extends AbstractDbgCommand { - - private int index; - private String cmd; - - public DbgSetFilterArgumentCommand(DbgManagerImpl manager, int index, - String cmd) { - super(manager); - this.index = index; - this.cmd = cmd; - } - - @Override - public void invoke() { - DebugControl control = manager.getControl(); - control.setEventFilterCommand(index, cmd); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgSetFilterCommandCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgSetFilterCommandCommand.java deleted file mode 100644 index 0030ec7068..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgSetFilterCommandCommand.java +++ /dev/null @@ -1,39 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import agent.dbgeng.dbgeng.DebugControl; -import agent.dbgeng.manager.impl.DbgManagerImpl; - -public class DbgSetFilterCommandCommand - extends AbstractDbgCommand { - - private int index; - private String cmd; - - public DbgSetFilterCommandCommand(DbgManagerImpl manager, int index, - String cmd) { - super(manager); - this.index = index; - this.cmd = cmd; - } - - @Override - public void invoke() { - DebugControl control = manager.getControl(); - control.setEventFilterCommand(index, cmd); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgSetFilterSecondChanceCmdCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgSetFilterSecondChanceCmdCommand.java deleted file mode 100644 index 47e0d5ffd3..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgSetFilterSecondChanceCmdCommand.java +++ /dev/null @@ -1,39 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import agent.dbgeng.dbgeng.DebugControl; -import agent.dbgeng.manager.impl.DbgManagerImpl; - -public class DbgSetFilterSecondChanceCmdCommand - extends AbstractDbgCommand { - - private int index; - private String cmd; - - public DbgSetFilterSecondChanceCmdCommand(DbgManagerImpl manager, int index, - String cmd) { - super(manager); - this.index = index; - this.cmd = cmd; - } - - @Override - public void invoke() { - DebugControl control = manager.getControl(); - control.setExceptionFilterSecondCommand(index, cmd); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgStackListFramesCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgStackListFramesCommand.java deleted file mode 100644 index 8db659677b..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgStackListFramesCommand.java +++ /dev/null @@ -1,70 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import java.math.BigInteger; -import java.util.ArrayList; -import java.util.List; - -import agent.dbgeng.dbgeng.*; -import agent.dbgeng.jna.dbgeng.DbgEngNative.DEBUG_STACK_FRAME; -import agent.dbgeng.manager.DbgStackFrame; -import agent.dbgeng.manager.impl.*; - -public class DbgStackListFramesCommand extends AbstractDbgCommand> { - protected final DbgThreadImpl thread; - private List result; - - public DbgStackListFramesCommand(DbgManagerImpl manager, DbgThreadImpl thread) { - super(manager); - this.thread = thread; - } - - @Override - public List complete(DbgPendingCommand pending) { - return result; - } - - @Override - public void invoke() { - result = new ArrayList<>(); - try { - setThread(thread); - DebugStackInformation stackTrace = manager.getControl().getStackTrace(0L, 0L, 0L); - for (int i = 0; i < stackTrace.getNumberOfFrames(); i++) { - DEBUG_STACK_FRAME tf = stackTrace.getFrame(i); - //DbgStackFrame frame = new DbgStackFrameImpl(thread, tf.FrameNumber.intValue(), - // new BigInteger(Long.toHexString(tf.InstructionOffset.longValue()), 16), null); - DbgStackFrame frame = new DbgStackFrameImpl(thread, // - tf.FrameNumber.intValue(), // - new BigInteger(Long.toHexString(tf.InstructionOffset.longValue()), 16), // - tf.FuncTableEntry.longValue(), // - tf.FrameOffset.longValue(), // - tf.ReturnOffset.longValue(), // - tf.StackOffset.longValue(), // - tf.Virtual.booleanValue(), // - tf.Params[0].longValue(), // - tf.Params[1].longValue(), // - tf.Params[2].longValue(), // - tf.Params[3].longValue()); - result.add(frame); - } - } - finally { - resetThread(); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgStackListOSFramesCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgStackListOSFramesCommand.java deleted file mode 100644 index 416a2f6ff0..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgStackListOSFramesCommand.java +++ /dev/null @@ -1,119 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import java.math.BigInteger; -import java.util.ArrayList; -import java.util.List; - -import agent.dbgeng.dbgeng.DebugControl; -import agent.dbgeng.manager.DbgEvent; -import agent.dbgeng.manager.DbgStackFrame; -import agent.dbgeng.manager.evt.AbstractDbgCompletedCommandEvent; -import agent.dbgeng.manager.evt.DbgConsoleOutputEvent; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgeng.manager.impl.DbgStackFrameImpl; -import agent.dbgeng.manager.impl.DbgThreadImpl; - -public class DbgStackListOSFramesCommand extends AbstractDbgCommand> { - protected final DbgThreadImpl thread; - private List result = new ArrayList<>(); - - public DbgStackListOSFramesCommand(DbgManagerImpl manager, DbgThreadImpl thread) { - super(manager); - this.thread = thread; - } - - @Override - public boolean handle(DbgEvent evt, DbgPendingCommand pending) { - if (evt instanceof AbstractDbgCompletedCommandEvent && pending.getCommand().equals(this)) { - return true; - } - else if (evt instanceof DbgConsoleOutputEvent) { - pending.steal(evt); - } - return false; - } - - @Override - public List complete(DbgPendingCommand pending) { - StringBuilder builder = new StringBuilder(); - for (DbgConsoleOutputEvent out : pending.findAllOf(DbgConsoleOutputEvent.class)) { - builder.append(out.getOutput()); - } - parse(builder.toString()); - return result; - } - - private void parse(String output) { - String[] lines = output.split("\n"); - int fcount = 0; - for (int i = 0; i < lines.length; i++) { - String line = lines[i]; - if (line.contains(" : ") && !line.startsWith("Child") && !line.startsWith("THREAD")) { - String[] fields = line.trim().split("\\s+"); - DbgStackFrame frame = new DbgStackFrameImpl(thread, // - fcount++, // - parseToBig(fields[1]), // return - fields.length > 8 ? fields[8] : "" - ); - result.add(frame); - } - } - } - - private BigInteger parseToBig(String lval) { - if (lval.contains("`")) { - lval = lval.replaceAll("`", ""); - } - return new BigInteger(lval, 16); - } - - @Override - public void invoke() { - DebugControl control = manager.getControl(); - control.execute("!thread "+Long.toHexString(thread.getOffset())+" 6"); - - } - -// @Override -// public void invoke() { -// result = new ArrayList<>(); -// DebugSystemObjects so = manager.getSystemObjects(); -// DebugThreadId previous = so.getCurrentThreadId(); -// so.setCurrentThreadId(thread.getId()); -// DebugStackInformation stackTrace = manager.getControl().getStackTrace(0L, 0L, 0L); -// for (int i = 0; i < stackTrace.getNumberOfFrames(); i++) { -// DEBUG_STACK_FRAME tf = stackTrace.getFrame(i); -// //DbgStackFrame frame = new DbgStackFrameImpl(thread, tf.FrameNumber.intValue(), -// // new BigInteger(Long.toHexString(tf.InstructionOffset.longValue()), 16), null); -// DbgStackFrame frame = new DbgStackFrameImpl(thread, // -// tf.FrameNumber.intValue(), // -// new BigInteger(Long.toHexString(tf.InstructionOffset.longValue()), 16), // -// tf.FuncTableEntry.longValue(), // -// tf.FrameOffset.longValue(), // -// tf.ReturnOffset.longValue(), // -// tf.StackOffset.longValue(), // -// tf.Virtual.booleanValue(), // -// tf.Params[0].longValue(), // -// tf.Params[1].longValue(), // -// tf.Params[2].longValue(), // -// tf.Params[3].longValue()); -// result.add(frame); -// } -// so.setCurrentThreadId(previous); -// } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgStepCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgStepCommand.java deleted file mode 100644 index 2789329d0e..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgStepCommand.java +++ /dev/null @@ -1,115 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import java.util.Map; - -import agent.dbgeng.dbgeng.DebugControl; -import agent.dbgeng.dbgeng.DebugThreadId; -import agent.dbgeng.manager.DbgEvent; -import agent.dbgeng.manager.DbgManager.ExecSuffix; -import agent.dbgeng.manager.DbgThread; -import agent.dbgeng.manager.evt.*; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgeng.manager.impl.DbgThreadImpl; -import ghidra.util.Msg; - -/** - * Implementation of {@link DbgThread#stepInstruction()} - */ -public class DbgStepCommand extends AbstractDbgCommand { - - private DebugThreadId id; - protected final ExecSuffix suffix; - private String lastCommand = "tct"; - - public DbgStepCommand(DbgManagerImpl manager, DebugThreadId id, ExecSuffix suffix) { - super(manager); - this.id = id; - this.suffix = suffix; - } - - public DbgStepCommand(DbgManagerImpl manager, DebugThreadId id, Map args) { - super(manager); - this.id = id; - this.suffix = ExecSuffix.EXTENDED; - this.lastCommand = (String) args.get("Command"); - } - - @Override - public boolean handle(DbgEvent evt, DbgPendingCommand pending) { - if (evt instanceof AbstractDbgCompletedCommandEvent && pending.getCommand().equals(this)) { - return evt instanceof DbgCommandErrorEvent || - !pending.findAllOf(DbgRunningEvent.class).isEmpty(); - } - else if (evt instanceof DbgRunningEvent) { - // Event happens no matter which interpreter received the command - pending.claim(evt); - return !pending.findAllOf(AbstractDbgCompletedCommandEvent.class).isEmpty(); - } - return false; - } - - // NB: Would really prefer to do this through the API, but the API does - // not appear to support freeze/unfreeze and suspend/resume thread. These appear - // to be applied via the kernel32 API. Worse, the Windbg/KD API appears to lack - // commands to query the freeze/suspend count for a given thread. Rather than - // wrestle with the underlying API, we're going to just use the WIndbg commands. - // Note that the thread-restricted form is used iff we're stepping a thread other - // then the event thread. - @Override - public void invoke() { - String cmd = ""; - String prefix = id == null ? "" : "~" + id.id() + " "; - DebugControl control = manager.getControl(); - if (suffix.equals(ExecSuffix.STEP_INSTRUCTION)) { - cmd = "t"; - //control.setExecutionStatus(DebugStatus.STEP_INTO); - } - else if (suffix.equals(ExecSuffix.NEXT_INSTRUCTION)) { - cmd = "p"; - //control.setExecutionStatus(DebugStatus.STEP_OVER); - } - else if (suffix.equals(ExecSuffix.FINISH)) { - cmd = "gu"; - //control.setExecutionStatus(DebugStatus.STEP_BRANCH); - } - else if (suffix.equals(ExecSuffix.EXTENDED)) { - cmd = getLastCommand(); - } - DbgThreadImpl eventThread = manager.getEventThread(); - if (eventThread != null && eventThread.getId().equals(id)) { - control.execute(cmd); - } - else { - if (manager.isKernelMode()) { - Msg.info(this, "Thread-specific stepping ignored in kernel-mode"); - control.execute(cmd); - } - else { - control.execute(prefix + cmd); - } - } - } - - public String getLastCommand() { - return lastCommand; - } - - public void setLastCommand(String lastCommand) { - this.lastCommand = lastCommand; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgStepToAddressCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgStepToAddressCommand.java deleted file mode 100644 index 8f0f93f43d..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgStepToAddressCommand.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import agent.dbgeng.dbgeng.DebugThreadId; -import agent.dbgeng.manager.impl.DbgManagerImpl; - -public class DbgStepToAddressCommand extends AbstractDbgExecToAddressCommand { - - public DbgStepToAddressCommand(DbgManagerImpl manager, DebugThreadId id, String address) { - super(manager, id, address); - } - - @Override - protected String generateCommand(String address) { - return "pa " + address; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgThreadHoldCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgThreadHoldCommand.java deleted file mode 100644 index 73c3edce61..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgThreadHoldCommand.java +++ /dev/null @@ -1,75 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import agent.dbgeng.dbgeng.*; -import agent.dbgeng.manager.DbgThread; -import agent.dbgeng.manager.impl.DbgManagerImpl; - -public class DbgThreadHoldCommand extends AbstractDbgCommand { - - static final String FREEZE_ALL_THREADS_COMMAND = "~* f"; - static final String FREEZE_CURRENT_THREAD_COMMAND = "~. f"; - static final String UNFREEZE_CURRENT_THREAD_COMMAND = "~. u"; - static final String UNFREEZE_ALL_THREADS_COMMAND = "~* u"; - - static final String SUSPEND_ALL_THREADS_COMMAND = "~* n"; - static final String SUSPEND_CURRENT_THREAD_COMMAND = "~. n"; - static final String RESUME_CURRENT_THREAD_COMMAND = "~. m"; - static final String RESUME_ALL_THREADS_COMMAND = "~* m"; - - static final Boolean preferFreeze = true; - - private DbgThread thread; - private Boolean set; - - /** - * Select the given thread and frame level - * - * To simply select a thread, you should use frame 0 as the default. - * - * @param manager the manager to execute the command - * @param thread the desired thread - * @param set hold or release - */ - public DbgThreadHoldCommand(DbgManagerImpl manager, DbgThread thread, Boolean set) { - super(manager); - this.thread = thread; - this.set = set; - } - - @Override - public void invoke() { - DebugThreadId id = thread.getId(); - if (id != null) { - DebugSystemObjects so = manager.getSystemObjects(); - DebugThreadId previous = so.getCurrentThreadId(); - so.setCurrentThreadId(id); - if (!manager.isKernelMode()) { - DebugControl control = manager.getControl(); - if (preferFreeze) { - control.execute( - set ? FREEZE_CURRENT_THREAD_COMMAND : UNFREEZE_CURRENT_THREAD_COMMAND); - } - else { - control.execute( - set ? SUSPEND_CURRENT_THREAD_COMMAND : RESUME_CURRENT_THREAD_COMMAND); - } - } - so.setCurrentThreadId(previous); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgToggleContinuationCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgToggleContinuationCommand.java deleted file mode 100644 index 743996685f..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgToggleContinuationCommand.java +++ /dev/null @@ -1,60 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import com.sun.jna.platform.win32.WinDef.ULONG; - -import agent.dbgeng.dbgeng.*; -import agent.dbgeng.dbgeng.DebugControl.DebugFilterContinuationOption; -import agent.dbgeng.jna.dbgeng.DbgEngNative.DEBUG_EXCEPTION_FILTER_PARAMETERS; -import agent.dbgeng.jna.dbgeng.DbgEngNative.DEBUG_SPECIFIC_FILTER_PARAMETERS; -import agent.dbgeng.manager.impl.DbgManagerImpl; - -public class DbgToggleContinuationCommand - extends AbstractDbgCommand { - - private int index; - private DebugFilterContinuationOption optionCont; - - public DbgToggleContinuationCommand(DbgManagerImpl manager, int index, - DebugFilterContinuationOption optionCont) { - super(manager); - this.index = index; - this.optionCont = optionCont; - } - - @Override - public void invoke() { - DebugControl control = manager.getControl(); - DebugFilterInformation info = control.getNumberEventFilters(); - int nEvents = info.getNumberEvents(); - int nExcs = info.getNumberSpecificExceptions(); - if (index < nEvents) { - DebugSpecificFilterInformation exc = - control.getSpecificFilterParameters(0, nEvents); - DEBUG_SPECIFIC_FILTER_PARAMETERS p = exc.getParameter(index); - p.ContinueOption = new ULONG(optionCont.ordinal()); - control.setSpecificFilterParameters(0, nEvents, exc); - } - else { - DebugExceptionFilterInformation exc = - control.getExceptionFilterParameters(nEvents, null, nExcs); - DEBUG_EXCEPTION_FILTER_PARAMETERS p = exc.getParameter(index); - p.ContinueOption = new ULONG(optionCont.ordinal()); - control.setExceptionFilterParameters(nExcs, exc); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgToggleExecutionCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgToggleExecutionCommand.java deleted file mode 100644 index e612f1e1e8..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgToggleExecutionCommand.java +++ /dev/null @@ -1,60 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import com.sun.jna.platform.win32.WinDef.ULONG; - -import agent.dbgeng.dbgeng.*; -import agent.dbgeng.dbgeng.DebugControl.DebugFilterExecutionOption; -import agent.dbgeng.jna.dbgeng.DbgEngNative.DEBUG_EXCEPTION_FILTER_PARAMETERS; -import agent.dbgeng.jna.dbgeng.DbgEngNative.DEBUG_SPECIFIC_FILTER_PARAMETERS; -import agent.dbgeng.manager.impl.DbgManagerImpl; - -public class DbgToggleExecutionCommand - extends AbstractDbgCommand { - - private int index; - private DebugFilterExecutionOption optionCont; - - public DbgToggleExecutionCommand(DbgManagerImpl manager, int index, - DebugFilterExecutionOption optionCont) { - super(manager); - this.index = index; - this.optionCont = optionCont; - } - - @Override - public void invoke() { - DebugControl control = manager.getControl(); - DebugFilterInformation info = control.getNumberEventFilters(); - int nEvents = info.getNumberEvents(); - int nExcs = info.getNumberSpecificExceptions(); - if (index < nEvents) { - DebugSpecificFilterInformation exc = - control.getSpecificFilterParameters(0, nEvents); - DEBUG_SPECIFIC_FILTER_PARAMETERS p = exc.getParameter(index); - p.ExecutionOption = new ULONG(optionCont.ordinal()); - control.setSpecificFilterParameters(0, nEvents, exc); - } - else { - DebugExceptionFilterInformation exc = - control.getExceptionFilterParameters(nEvents, null, nExcs); - DEBUG_EXCEPTION_FILTER_PARAMETERS p = exc.getParameter(index); - p.ExecutionOption = new ULONG(optionCont.ordinal()); - control.setExceptionFilterParameters(nExcs, exc); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgTraceToAddressCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgTraceToAddressCommand.java deleted file mode 100644 index c96cfabb14..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgTraceToAddressCommand.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import agent.dbgeng.dbgeng.DebugThreadId; -import agent.dbgeng.manager.impl.DbgManagerImpl; - -public class DbgTraceToAddressCommand extends AbstractDbgExecToAddressCommand { - - public DbgTraceToAddressCommand(DbgManagerImpl manager, DebugThreadId id, String address) { - super(manager, id, address); - } - - @Override - protected String generateCommand(String address) { - return "ta " + address; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgWriteBusDataCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgWriteBusDataCommand.java deleted file mode 100644 index 76769516d3..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgWriteBusDataCommand.java +++ /dev/null @@ -1,52 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import java.nio.ByteBuffer; - -import agent.dbgeng.manager.DbgThread; -import agent.dbgeng.manager.impl.DbgManagerImpl; - -/** - * Implementation of {@link DbgThread#writeMemory(long, ByteBuffer, int)} - */ -public class DbgWriteBusDataCommand extends AbstractDbgCommand { - - private final long addr; - private final ByteBuffer buf; - private final int busDataType; - private final int busNumber; - private final int slotNumber; - private final int len; - - public DbgWriteBusDataCommand(DbgManagerImpl manager, long addr, ByteBuffer buf, int len, - int busDataType, int busNumber, int slotNumber) { - super(manager); - this.addr = addr; - this.busDataType = busDataType; - this.busNumber = busNumber; - this.slotNumber = slotNumber; - this.buf = buf.duplicate(); - this.len = len; - } - - @Override - public void invoke() { - manager.getDataSpaces() - .writeBusData(busDataType, busNumber, slotNumber, addr, buf, buf.remaining()); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgWriteControlCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgWriteControlCommand.java deleted file mode 100644 index 97a1a4863e..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgWriteControlCommand.java +++ /dev/null @@ -1,47 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import java.nio.ByteBuffer; - -import agent.dbgeng.manager.DbgThread; -import agent.dbgeng.manager.impl.DbgManagerImpl; - -/** - * Implementation of {@link DbgThread#writeMemory(long, ByteBuffer, int)} - */ -public class DbgWriteControlCommand extends AbstractDbgCommand { - - private final long addr; - private final ByteBuffer buf; - private final int processor; - private final int len; - - public DbgWriteControlCommand(DbgManagerImpl manager, long addr, ByteBuffer buf, int len, - int processor) { - super(manager); - this.addr = addr; - this.processor = processor; - this.buf = buf.duplicate(); - this.len = len; - } - - @Override - public void invoke() { - manager.getDataSpaces().writeControl(processor, addr, buf, buf.remaining()); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgWriteIoCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgWriteIoCommand.java deleted file mode 100644 index b833ef23e6..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgWriteIoCommand.java +++ /dev/null @@ -1,52 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import java.nio.ByteBuffer; - -import agent.dbgeng.manager.DbgThread; -import agent.dbgeng.manager.impl.DbgManagerImpl; - -/** - * Implementation of {@link DbgThread#writeMemory(long, ByteBuffer, int)} - */ -public class DbgWriteIoCommand extends AbstractDbgCommand { - - private final long addr; - private final ByteBuffer buf; - private final int interfaceType; - private final int busNumber; - private final int addressSpace; - private final int len; - - public DbgWriteIoCommand(DbgManagerImpl manager, long addr, ByteBuffer buf, int len, - int interfaceType, int busNumber, int addressSpace) { - super(manager); - this.addr = addr; - this.interfaceType = interfaceType; - this.busNumber = busNumber; - this.addressSpace = addressSpace; - this.buf = buf.duplicate(); - this.len = len; - } - - @Override - public void invoke() { - manager.getDataSpaces() - .writeIo(interfaceType, busNumber, addressSpace, addr, buf, buf.remaining()); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgWriteMemoryCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgWriteMemoryCommand.java deleted file mode 100644 index 87c4b8c8fd..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgWriteMemoryCommand.java +++ /dev/null @@ -1,44 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import java.nio.ByteBuffer; - -import agent.dbgeng.manager.DbgThread; -import agent.dbgeng.manager.impl.DbgManagerImpl; - -/** - * Implementation of {@link DbgThread#writeMemory(long, ByteBuffer, int)} - */ -public class DbgWriteMemoryCommand extends AbstractDbgCommand { - - private final long addr; - private final ByteBuffer buf; - private final int len; - - public DbgWriteMemoryCommand(DbgManagerImpl manager, long addr, ByteBuffer buf, int len) { - super(manager); - this.addr = addr; - this.buf = buf.duplicate(); - this.len = len; - } - - @Override - public void invoke() { - manager.getDataSpaces().writeVirtual(addr, buf, buf.remaining()); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgWritePhysicalMemoryCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgWritePhysicalMemoryCommand.java deleted file mode 100644 index bf0e30474b..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgWritePhysicalMemoryCommand.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import java.nio.ByteBuffer; - -import agent.dbgeng.manager.DbgThread; -import agent.dbgeng.manager.impl.DbgManagerImpl; - -/** - * Implementation of {@link DbgThread#writeMemory(long, ByteBuffer, int)} - */ -public class DbgWritePhysicalMemoryCommand extends AbstractDbgCommand { - - private final long addr; - private final ByteBuffer buf; - private final int len; - - public DbgWritePhysicalMemoryCommand(DbgManagerImpl manager, long addr, ByteBuffer buf, - int len) { - super(manager); - this.addr = addr; - this.buf = buf.duplicate(); - this.len = len; - } - - @Override - public void invoke() { - manager.getDataSpaces().writePhysical(addr, buf, buf.remaining()); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgWriteRegistersCommand.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgWriteRegistersCommand.java deleted file mode 100644 index efcfa0ec5d..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/cmd/DbgWriteRegistersCommand.java +++ /dev/null @@ -1,71 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.cmd; - -import java.math.BigInteger; -import java.util.*; - -import com.sun.jna.platform.win32.COM.COMException; - -import agent.dbgeng.dbgeng.*; -import agent.dbgeng.dbgeng.DebugRegisters.DebugRegisterDescription; -import agent.dbgeng.dbgeng.DebugRegisters.DebugRegisterSource; -import agent.dbgeng.manager.DbgStackFrameOperations; -import agent.dbgeng.manager.impl.*; - -/** - * Implementation of {@link DbgStackFrameOperations#readRegisters(Set)} - */ -public class DbgWriteRegistersCommand extends AbstractDbgCommand { - - private final DbgThreadImpl thread; - private final Map regVals; - - public DbgWriteRegistersCommand(DbgManagerImpl manager, DbgThreadImpl thread, Integer frameId, - Map regVals) { - super(manager); - this.thread = thread; - this.regVals = regVals; - } - - @Override - public void invoke() { - DebugSystemObjects so = manager.getSystemObjects(); - DebugThreadId previous = so.getCurrentThreadId(); - so.setCurrentThreadId(thread.getId()); - DebugRegisters registers = manager.getRegisters(); - Map values = new LinkedHashMap<>(); - for (DbgRegister r : regVals.keySet()) { - try { - BigInteger val = regVals.get(r); - DebugRegisterDescription desc = registers.getDescription(r.getNumber()); - byte[] bytes = new byte[desc.type.byteLength]; - byte[] newBytes = val.toByteArray(); - for (int i = newBytes.length - 1, j = bytes.length - 1; i >= 0 && - j >= 0; i--, j--) { - bytes[j] = newBytes[i]; - } - DebugValue dv = desc.type.decodeBytes(bytes); - values.put(r.getNumber(), dv); - } - catch (COMException e) { - manager.getControl().errln("No register: " + r.getName()); - } - } - registers.setValues(DebugRegisterSource.DEBUG_REGSRC_DEBUGGEE, values); - so.setCurrentThreadId(previous); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/AbstractDbgCompletedCommandEvent.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/AbstractDbgCompletedCommandEvent.java deleted file mode 100644 index 74e53b5041..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/AbstractDbgCompletedCommandEvent.java +++ /dev/null @@ -1,40 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.evt; - -import agent.dbgeng.manager.DbgState; - -public class AbstractDbgCompletedCommandEvent extends AbstractDbgEvent { - - public AbstractDbgCompletedCommandEvent(String message) { - super(message); - } - - public AbstractDbgCompletedCommandEvent() { - super(null); - } - - public static void main(String[] args) { - // TODO Auto-generated method stub - - } - - public DbgState newState() { - // TODO Auto-generated method stub - return null; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/AbstractDbgEvent.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/AbstractDbgEvent.java deleted file mode 100644 index 42ecd00d3f..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/AbstractDbgEvent.java +++ /dev/null @@ -1,85 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.evt; - -import agent.dbgeng.dbgeng.DebugClient.DebugStatus; -import agent.dbgeng.manager.*; -import agent.dbgeng.manager.DbgCause.Causes; -import agent.dbgeng.manager.cmd.DbgPendingCommand; - -/** - * A base class for Dbg events - * - * @param the type of information detailing the event - */ -public abstract class AbstractDbgEvent implements DbgEvent { - private final T info; - protected DbgCause cause = Causes.UNCLAIMED; - protected boolean stolen = false; - protected DebugStatus status = DebugStatus.NO_CHANGE; - - /** - * Construct a new event with the given information - * - * @param info the information - */ - protected AbstractDbgEvent(T info) { - this.info = info; - } - - @Override - public T getInfo() { - return info; - } - - @Override - public void claim(DbgPendingCommand cmd) { - if (cause != Causes.UNCLAIMED) { - throw new IllegalStateException("Event is already claimed by " + cause); - } - cause = cmd; - } - - @Override - public DbgCause getCause() { - return cause; - } - - public DbgReason getReason() { - return DbgReason.getReason(null); - } - - @Override - public void steal() { - stolen = true; - } - - @Override - public boolean isStolen() { - return stolen; - } - - @Override - public String toString() { - return "<" + getClass().getSimpleName() + " " + info + " >"; - } - - @Override - public DbgState newState() { - return null; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgBreakpointCreatedEvent.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgBreakpointCreatedEvent.java deleted file mode 100644 index 99b03440d2..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgBreakpointCreatedEvent.java +++ /dev/null @@ -1,42 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.evt; - -import agent.dbgeng.manager.breakpoint.DbgBreakpointInfo; - -public class DbgBreakpointCreatedEvent extends AbstractDbgEvent { - private final DbgBreakpointInfo bkptInfo; - - /** - * Construct a new event from the given info - * - * @param info breakpoint info - * - */ - public DbgBreakpointCreatedEvent(DbgBreakpointInfo info) { - super(info); - this.bkptInfo = info; - } - - /** - * Get the breakpoint information - * - * @return the breakpoint information - */ - public DbgBreakpointInfo getBreakpointInfo() { - return bkptInfo; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgBreakpointDeletedEvent.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgBreakpointDeletedEvent.java deleted file mode 100644 index 664ce28e8d..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgBreakpointDeletedEvent.java +++ /dev/null @@ -1,41 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.evt; - -import agent.dbgeng.manager.breakpoint.DbgBreakpointInfo; - -public class DbgBreakpointDeletedEvent extends AbstractDbgEvent { - private final long number; - - /** - * Construct a new event from the given info - * - * @param info breakpoint info - */ - public DbgBreakpointDeletedEvent(DbgBreakpointInfo info) { - super(info); - this.number = info.getNumber(); - } - - /** - * Get the breakpoint number - * - * @return the breakpoint number - */ - public long getNumber() { - return number; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgBreakpointEvent.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgBreakpointEvent.java deleted file mode 100644 index 51fc54dbff..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgBreakpointEvent.java +++ /dev/null @@ -1,25 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.evt; - -import agent.dbgeng.dbgeng.DebugBreakpoint; - -public class DbgBreakpointEvent extends AbstractDbgEvent { - - public DbgBreakpointEvent(DebugBreakpoint info) { - super(info); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgBreakpointModifiedEvent.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgBreakpointModifiedEvent.java deleted file mode 100644 index 718e95a3d7..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgBreakpointModifiedEvent.java +++ /dev/null @@ -1,51 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.evt; - -import agent.dbgeng.manager.breakpoint.DbgBreakpointInfo; - -public class DbgBreakpointModifiedEvent extends AbstractDbgEvent { - - private long bptId; - - /** - * Construct a new event from the given info - * - * @param info breakpoint info - */ - public DbgBreakpointModifiedEvent(DbgBreakpointInfo info) { - super(info); - this.bptId = info.getNumber(); - } - - public DbgBreakpointModifiedEvent(long bptId) { - super(null); - this.bptId = bptId; - } - - /** - * Get the breakpoint information - * - * @return the breakpoint information - */ - public DbgBreakpointInfo getBreakpointInfo() { - return getInfo(); - } - - public long getId() { - return bptId; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgCommandDoneEvent.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgCommandDoneEvent.java deleted file mode 100644 index fd89891fc3..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgCommandDoneEvent.java +++ /dev/null @@ -1,43 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.evt; - -import agent.dbgeng.manager.DbgCommand; -import agent.dbgeng.manager.DbgState; - -public class DbgCommandDoneEvent extends AbstractDbgCompletedCommandEvent { - - private DbgCommand cmd; - - public DbgCommandDoneEvent() { - super(); - } - - public DbgCommandDoneEvent(DbgCommand cmd) { - super(cmd.toString()); - this.cmd = cmd; - } - - @Override - public DbgState newState() { - return DbgState.STOPPED; - } - - public DbgCommand getCmd() { - return cmd; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgCommandErrorEvent.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgCommandErrorEvent.java deleted file mode 100644 index a065869226..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgCommandErrorEvent.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.evt; - -import agent.dbgeng.manager.DbgEvent; -import agent.dbgeng.manager.DbgState; - -public class DbgCommandErrorEvent extends AbstractDbgCompletedCommandEvent { - - /** - * Construct a new event using the given error message - * - * @param message the message - * @return the new event - */ - public static DbgEvent fromMessage(String message) { - return new DbgCommandErrorEvent(message); - } - - protected DbgCommandErrorEvent() { - super(); - } - - protected DbgCommandErrorEvent(String message) { - super(message); - } - - @Override - public DbgState newState() { - return DbgState.STOPPED; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgCommandRunningEvent.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgCommandRunningEvent.java deleted file mode 100644 index f812681354..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgCommandRunningEvent.java +++ /dev/null @@ -1,30 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.evt; - -import agent.dbgeng.manager.DbgState; - -public class DbgCommandRunningEvent extends AbstractDbgCompletedCommandEvent { - - public DbgCommandRunningEvent() { - super(); - } - - @Override - public DbgState newState() { - return DbgState.RUNNING; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgConsoleOutputEvent.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgConsoleOutputEvent.java deleted file mode 100644 index 7004ee9328..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgConsoleOutputEvent.java +++ /dev/null @@ -1,34 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.evt; - -public class DbgConsoleOutputEvent extends AbstractDbgEvent { - - private int mask; - - public DbgConsoleOutputEvent(int mask, String info) { - super(info); - this.mask = mask; - } - - public String getOutput() { - return getInfo(); - } - - public int getMask() { - return mask; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgDebuggeeStateChangeEvent.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgDebuggeeStateChangeEvent.java deleted file mode 100644 index f9bb205d47..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgDebuggeeStateChangeEvent.java +++ /dev/null @@ -1,48 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.evt; - -import agent.dbgeng.dbgeng.DebugClient.ChangeDebuggeeState; -import ghidra.comm.util.BitmaskSet; - -/** - * The event corresponding with ChangedDebuggeeState - */ -public class DbgDebuggeeStateChangeEvent extends AbstractDbgEvent { - private final BitmaskSet flags; - private final long argument; - - /** - * The selected flags must be specified by dbgeng. - * - * @param flags dbgeng-provided id - * @param argument event-specific argument - */ - public DbgDebuggeeStateChangeEvent(BitmaskSet flags, long argument) { - super((int) flags.getBitmask()); - this.flags = flags; - this.argument = argument; - } - - public BitmaskSet getFlags() { - return flags; - } - - public long getArgument() { - return argument; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgExceptionEvent.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgExceptionEvent.java deleted file mode 100644 index fcb6a48ce9..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgExceptionEvent.java +++ /dev/null @@ -1,25 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.evt; - -import agent.dbgeng.dbgeng.DebugExceptionRecord64; - -public class DbgExceptionEvent extends AbstractDbgEvent { - - public DbgExceptionEvent(DebugExceptionRecord64 info) { - super(info); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgInitialBreakpointEvent.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgInitialBreakpointEvent.java deleted file mode 100644 index 9b428d0c60..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgInitialBreakpointEvent.java +++ /dev/null @@ -1,25 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.evt; - -import agent.dbgeng.dbgeng.DebugBreakpoint; - -public class DbgInitialBreakpointEvent extends AbstractDbgEvent { - - public DbgInitialBreakpointEvent(DebugBreakpoint info) { - super(info); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgInitialModuleLoadEvent.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgInitialModuleLoadEvent.java deleted file mode 100644 index b1aaca8d20..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgInitialModuleLoadEvent.java +++ /dev/null @@ -1,25 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.evt; - -import agent.dbgeng.dbgeng.DebugModuleInfo; - -public class DbgInitialModuleLoadEvent extends AbstractDbgEvent { - - public DbgInitialModuleLoadEvent(DebugModuleInfo info) { - super(info); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgModuleLoadedEvent.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgModuleLoadedEvent.java deleted file mode 100644 index a1fcb8797d..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgModuleLoadedEvent.java +++ /dev/null @@ -1,25 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.evt; - -import agent.dbgeng.dbgeng.DebugModuleInfo; - -public class DbgModuleLoadedEvent extends AbstractDbgEvent { - - public DbgModuleLoadedEvent(DebugModuleInfo info) { - super(info); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgModuleUnloadedEvent.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgModuleUnloadedEvent.java deleted file mode 100644 index fd2a07d421..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgModuleUnloadedEvent.java +++ /dev/null @@ -1,25 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.evt; - -import agent.dbgeng.dbgeng.DebugModuleInfo; - -public class DbgModuleUnloadedEvent extends AbstractDbgEvent { - - public DbgModuleUnloadedEvent(DebugModuleInfo info) { - super(info); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgProcessCreatedEvent.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgProcessCreatedEvent.java deleted file mode 100644 index 38b9bd14e9..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgProcessCreatedEvent.java +++ /dev/null @@ -1,25 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.evt; - -import agent.dbgeng.dbgeng.DebugProcessInfo; - -public class DbgProcessCreatedEvent extends AbstractDbgEvent { - - public DbgProcessCreatedEvent(DebugProcessInfo info) { - super(info); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgProcessExitedEvent.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgProcessExitedEvent.java deleted file mode 100644 index f111737487..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgProcessExitedEvent.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.evt; - -import agent.dbgeng.manager.DbgState; - -public class DbgProcessExitedEvent extends AbstractDbgEvent { - - public DbgProcessExitedEvent(Integer exitCode) { - super(exitCode); - } - - @Override - public DbgState newState() { - return DbgState.EXIT; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgProcessSelectedEvent.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgProcessSelectedEvent.java deleted file mode 100644 index cce6c76dfe..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgProcessSelectedEvent.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.evt; - -import agent.dbgeng.dbgeng.DebugProcessId; -import agent.dbgeng.manager.impl.DbgProcessImpl; - -public class DbgProcessSelectedEvent extends AbstractDbgEvent { - private final DebugProcessId id; - private DbgProcessImpl process; - - /** - * The selected process ID must be specified by dbgeng. - * - * @param id dbgeng-defined id - */ - public DbgProcessSelectedEvent(DbgProcessImpl process) { - super(process.getId()); - this.process = process; - this.id = process.getId(); - } - - /** - * Get the selected process ID - * - * @return the process ID - */ - public DebugProcessId getProcessId() { - return id; - } - - public DbgProcessImpl getProcess() { - return process; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgPromptChangedEvent.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgPromptChangedEvent.java deleted file mode 100644 index 7b538a7e30..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgPromptChangedEvent.java +++ /dev/null @@ -1,26 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.evt; - -public class DbgPromptChangedEvent extends AbstractDbgEvent { - public DbgPromptChangedEvent(String prompt) { - super(prompt); - } - - public String getPrompt() { - return getInfo(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgRunningEvent.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgRunningEvent.java deleted file mode 100644 index 84b50954a2..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgRunningEvent.java +++ /dev/null @@ -1,48 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.evt; - -import agent.dbgeng.dbgeng.DebugThreadId; -import agent.dbgeng.manager.DbgState; - -public class DbgRunningEvent extends AbstractDbgEvent { - private final DebugThreadId id; - - /** - * Construct a new event with the given thread ID - * - * @param id the event info - */ - public DbgRunningEvent(DebugThreadId id) { - super(id); - this.id = id; - } - - /** - * Get the ID of the thread causing the event - * - * @return the thread ID - */ - public DebugThreadId getThreadId() { - return id; - } - - @Override - public DbgState newState() { - return DbgState.RUNNING; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgSessionSelectedEvent.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgSessionSelectedEvent.java deleted file mode 100644 index e5297d2c44..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgSessionSelectedEvent.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.evt; - -import agent.dbgeng.dbgeng.DebugSessionId; -import agent.dbgeng.manager.impl.DbgSessionImpl; - -public class DbgSessionSelectedEvent extends AbstractDbgEvent { - private final DebugSessionId id; - private DbgSessionImpl session; - - /** - * The selected session ID must be specified by dbgeng. - * - * @param session dbgeng-defined session - */ - public DbgSessionSelectedEvent(DbgSessionImpl session) { - super(session.getId()); - this.session = session; - this.id = session.getId(); - } - - /** - * Get the selected session ID - * - * @return the session ID - */ - public DebugSessionId getSessionId() { - return id; - } - - public DbgSessionImpl getSession() { - return session; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgStateChangedEvent.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgStateChangedEvent.java deleted file mode 100644 index a3ae5848e6..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgStateChangedEvent.java +++ /dev/null @@ -1,53 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.evt; - -import agent.dbgeng.dbgeng.DebugClient.ChangeEngineState; -import agent.dbgeng.manager.DbgState; -import agent.dbgeng.manager.DbgThread; -import agent.dbgeng.manager.impl.DbgStackFrameImpl; -import ghidra.comm.util.BitmaskSet; - -public class DbgStateChangedEvent extends AbstractDbgEvent> { - - private long argument; - private DbgState state = null; - - public DbgStateChangedEvent(BitmaskSet flags) { - super(flags); - } - - public long getArgument() { - return argument; - } - - public void setArgument(long argument) { - this.argument = argument; - } - - public DbgStackFrameImpl getFrame(DbgThread thread) { - return null; - } - - @Override - public DbgState newState() { - return state; - } - - public void setState(DbgState state) { - this.state = state; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgStoppedEvent.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgStoppedEvent.java deleted file mode 100644 index 209d34fb88..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgStoppedEvent.java +++ /dev/null @@ -1,59 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.evt; - -import agent.dbgeng.dbgeng.DebugThreadId; -import agent.dbgeng.manager.DbgState; -import agent.dbgeng.manager.impl.DbgStackFrameImpl; -import agent.dbgeng.manager.impl.DbgThreadImpl; - -public class DbgStoppedEvent extends AbstractDbgEvent { - private final DebugThreadId id; - - /** - * Construct a new event with the given thread ID - * - * @param id the thread ID - */ - public DbgStoppedEvent(DebugThreadId id) { - super(id); - this.id = id; - } - - /** - * Get the ID of the thread causing the event - * - * @return the thread ID - */ - public DebugThreadId getThreadId() { - return id; - } - - /** - * Get the current frame, if applicable - * - * @param thread the current thread - * @return the frame - */ - public DbgStackFrameImpl getFrame(DbgThreadImpl thread) { - return null; - } - - @Override - public DbgState newState() { - return DbgState.STOPPED; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgSystemErrorEvent.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgSystemErrorEvent.java deleted file mode 100644 index f2e8885625..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgSystemErrorEvent.java +++ /dev/null @@ -1,41 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.evt; - -public class DbgSystemErrorEvent extends AbstractDbgEvent { - private final int error; - private final int level; - - /** - * The selected error ID must be specified by dbgeng. - * - * @param error dbgeng-provided id - */ - public DbgSystemErrorEvent(int error, int level) { - super(error); - this.error = error; - this.level = level; - } - - public int getError() { - return error; - } - - public int getLevel() { - return level; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgSystemsEvent.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgSystemsEvent.java deleted file mode 100644 index f82b5e55de..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgSystemsEvent.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.evt; - -public class DbgSystemsEvent extends AbstractDbgEvent { - private final long id; - - /** - * The selected target ID must be specified by dbgeng. - * - * @param targetID dbgeng-provided id - */ - public DbgSystemsEvent(Long targetID) { - super(targetID); - this.id = targetID; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgThreadCreatedEvent.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgThreadCreatedEvent.java deleted file mode 100644 index 453361429a..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgThreadCreatedEvent.java +++ /dev/null @@ -1,25 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.evt; - -import agent.dbgeng.dbgeng.DebugThreadInfo; - -public class DbgThreadCreatedEvent extends AbstractDbgEvent { - - public DbgThreadCreatedEvent(DebugThreadInfo info) { - super(info); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgThreadExitedEvent.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgThreadExitedEvent.java deleted file mode 100644 index 71773502dd..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgThreadExitedEvent.java +++ /dev/null @@ -1,24 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.evt; - -public class DbgThreadExitedEvent extends AbstractDbgEvent { - - public DbgThreadExitedEvent(Integer exitCode) { - super(exitCode); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgThreadSelectedEvent.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgThreadSelectedEvent.java deleted file mode 100644 index 7e3bfe54f5..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/evt/DbgThreadSelectedEvent.java +++ /dev/null @@ -1,65 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.evt; - -import agent.dbgeng.dbgeng.DebugThreadId; -import agent.dbgeng.manager.DbgState; -import agent.dbgeng.manager.DbgThread; -import agent.dbgeng.manager.impl.DbgStackFrameImpl; -import agent.dbgeng.manager.impl.DbgThreadImpl; - -public class DbgThreadSelectedEvent extends AbstractDbgEvent { - private final DebugThreadId id; - private DbgState state; - private DbgThread thread; - private DbgStackFrameImpl frame; - - /** - * The selected thread ID must be specified by dbgeng. - * - * @param frame - * @param id dbgeng-provided id - */ - public DbgThreadSelectedEvent(DbgState state, DbgThread thread, DbgStackFrameImpl frame) { - super(thread.getId()); - this.id = thread.getId(); - this.state = state; - this.thread = thread; - this.frame = frame; - } - - /** - * Get the selected thread ID - * - * @return the thread ID - */ - public DebugThreadId getThreadId() { - return id; - } - - public DbgState getState() { - return state; - } - - public DbgThreadImpl getThread() { - return (DbgThreadImpl) thread; - } - - public DbgStackFrameImpl getFrame() { - return frame; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgDebugEventCallbacksAdapter.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgDebugEventCallbacksAdapter.java deleted file mode 100644 index 0312b7a60d..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgDebugEventCallbacksAdapter.java +++ /dev/null @@ -1,156 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.impl; - -import java.nio.file.Paths; - -import agent.dbgeng.dbgeng.*; -import agent.dbgeng.dbgeng.DebugClient.ChangeEngineState; -import agent.dbgeng.dbgeng.DebugClient.DebugStatus; -import agent.dbgeng.dbgeng.util.DebugEventCallbacksAdapter; -import agent.dbgeng.manager.DbgState; -import agent.dbgeng.manager.evt.*; -import ghidra.comm.util.BitmaskSet; -import ghidra.util.Msg; - -public class DbgDebugEventCallbacksAdapter extends DebugEventCallbacksAdapter { - private DbgManagerImpl manager; - - public DbgDebugEventCallbacksAdapter(DbgManagerImpl manager) { - super(); - this.manager = manager; - } - - protected DebugStatus checkInterrupt(DebugStatus normal) { - if (manager.getControl().getInterrupt()) { - return DebugStatus.BREAK; - } - return normal; - } - - @Override - public DebugStatus breakpoint(DebugBreakpoint bp) { - Msg.info(this, "***Breakpoint: " + bp.getId()); - return checkInterrupt(manager.processEvent(new DbgBreakpointEvent(bp))); - } - - @Override - public DebugStatus exception(DebugExceptionRecord64 exception, boolean firstChance) { - Msg.info(this, "***Exception: " + exception + ", first=" + firstChance); - return checkInterrupt(manager.processEvent(new DbgExceptionEvent(exception))); - } - - @Override - public DebugStatus createThread(DebugThreadInfo threadInfo) { - Msg.info(this, "***Thread created: " + Long.toHexString(threadInfo.handle)); - return checkInterrupt(manager.processEvent(new DbgThreadCreatedEvent(threadInfo))); - } - - @Override - public DebugStatus exitThread(int exitCode) { - Msg.info(this, "***Thread exited: " + exitCode); - return checkInterrupt(manager.processEvent(new DbgThreadExitedEvent(exitCode))); - } - - @Override - public DebugStatus createProcess(DebugProcessInfo processInfo) { - Msg.info(this, "***Process created: " + Long.toHexString(processInfo.handle)); - Msg.info(this, - " **Thread created: " + Long.toHexString(processInfo.initialThreadInfo.handle)); - return checkInterrupt(manager.processEvent(new DbgProcessCreatedEvent(processInfo))); - } - - @Override - public DebugStatus exitProcess(int exitCode) { - Msg.info(this, "***Process exited: " + exitCode); - Msg.info(this, " **Thread exited"); - return checkInterrupt(manager.processEvent(new DbgProcessExitedEvent(exitCode))); - } - - @Override - public DebugStatus loadModule(DebugModuleInfo moduleInfo) { - Msg.info(this, "***Module Loaded: " + moduleInfo); - return checkInterrupt(manager.processEvent(new DbgModuleLoadedEvent(moduleInfo))); - } - - @Override - public DebugStatus unloadModule(String imageBaseName, long baseOffset) { - Msg.info(this, - "***Module Unloaded: " + imageBaseName + ", " + Long.toHexString(baseOffset)); - DebugModuleInfo info = - new DebugModuleInfo(0L, baseOffset, 0, basename(imageBaseName), imageBaseName, 0, 0); - return checkInterrupt(manager.processEvent(new DbgModuleUnloadedEvent(info))); - } - - private String basename(String path) { - return Paths.get(path).getFileName().toString(); - } - - @Override - public DebugStatus changeEngineState(BitmaskSet flags, long argument) { - DbgStateChangedEvent event = new DbgStateChangedEvent(flags); - event.setArgument(argument); - if (flags.contains(ChangeEngineState.EXECUTION_STATUS)) { - if (DebugStatus.isInsideWait(argument)) { - return DebugStatus.NO_CHANGE; - } - DebugStatus status = DebugStatus.fromArgument(argument); - Msg.info(this, "***ExecutionStatus: " + status); - if (status.equals(DebugStatus.NO_DEBUGGEE)) { - long processCount = manager.getProcessCount(); - event.setState(processCount > 0 ? DbgState.SESSION_EXIT : DbgState.EXIT); - } - return checkInterrupt(manager.processEvent(event)); - } - if (flags.contains(ChangeEngineState.BREAKPOINTS)) { - Msg.info(this, "***BreakpointChanged: " + flags + ", " + argument + " on " + - Thread.currentThread()); - return checkInterrupt(manager.processEvent(event)); - } - if (flags.contains(ChangeEngineState.CURRENT_THREAD)) { - Msg.info(this, "***CurrentThread: " + argument); - return checkInterrupt(manager.processEvent(event)); - } - if (flags.contains(ChangeEngineState.SYSTEMS)) { - Msg.info(this, "***Systems: " + argument); - event.setState(DbgState.RUNNING); - return checkInterrupt(manager.processEvent(event)); - } - return checkInterrupt(DebugStatus.NO_CHANGE); - } - - @Override - public DebugStatus systemError(int error, int level) { - return checkInterrupt(manager.processEvent(new DbgSystemErrorEvent(error, level))); - } - - /* - @Override - public DebugStatus changeDebuggeeState(BitmaskSet flags, long argument) { - //System.err.println("CHANGE_DEBUGGEE_STATE: " + flags + ":" + argument); - return checkInterrupt( - manager.processEvent(new DbgDebuggeeStateChangeEvent(flags, argument))); - } - - /* - @Override - public DebugStatus sessionStatus(SessionStatus status) { - System.err.println("SESSION_STATUS: " + status); - return DebugStatus.NO_CHANGE; - } - */ - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgDebugInputCallbacks.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgDebugInputCallbacks.java deleted file mode 100644 index 2f631c27a6..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgDebugInputCallbacks.java +++ /dev/null @@ -1,43 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.impl; - -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutionException; - -import agent.dbgeng.dbgeng.DebugInputCallbacks; - -public class DbgDebugInputCallbacks implements DebugInputCallbacks { - private DbgManagerImpl manager; - - public DbgDebugInputCallbacks(DbgManagerImpl manager) { - this.manager = manager; - } - - @Override - public void startInput(long bufsize) { - manager.getEventListeners().invoke().promptChanged(">>>"); - CompletableFuture cf = new CompletableFuture(); - try { - manager.setContinuation(cf); - manager.getControl().returnInput(cf.get()); - } - catch (InterruptedException | ExecutionException e) { - e.printStackTrace(); - } - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgDebugOutputCallbacks.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgDebugOutputCallbacks.java deleted file mode 100644 index 4482d2fce8..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgDebugOutputCallbacks.java +++ /dev/null @@ -1,34 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.impl; - -import agent.dbgeng.dbgeng.DebugOutputCallbacks; -import agent.dbgeng.manager.evt.DbgConsoleOutputEvent; - -public class DbgDebugOutputCallbacks implements DebugOutputCallbacks { - private DbgManagerImpl manager; - - public DbgDebugOutputCallbacks(DbgManagerImpl manager) { - this.manager = manager; - } - - @Override - public void output(int mask, String text) { - //System.out.print(text); - manager.processEvent(new DbgConsoleOutputEvent(mask, text)); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgEventFilterImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgEventFilterImpl.java deleted file mode 100644 index 8f03909f36..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgEventFilterImpl.java +++ /dev/null @@ -1,79 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.impl; - -import agent.dbgeng.manager.DbgEventFilter; - -public class DbgEventFilterImpl implements DbgEventFilter { - - protected int index; - protected final String text; - protected final String arg; - protected final String cmd; - protected int executionOption; - protected int continueOption; - - public DbgEventFilterImpl(int index, String text, String cmd, String arg, int executionOption, - int continueOption) { - this.index = index; - this.text = text; - this.cmd = cmd; - this.arg = arg; - this.setExecutionOption(executionOption); - this.setContinueOption(continueOption); - } - - @Override - public int getIndex() { - return index; - } - - @Override - public String getName() { - return text; - } - - @Override - public String getArg() { - return arg == null ? "N/A" : arg; - } - - @Override - public String getCmd() { - return cmd; - } - - @Override - public int getExecutionOption() { - return executionOption; - } - - @Override - public void setExecutionOption(int executionOption) { - this.executionOption = executionOption; - } - - @Override - public int getContinueOption() { - return continueOption; - } - - @Override - public void setContinueOption(int continueOption) { - this.continueOption = continueOption; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgExceptionFilterImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgExceptionFilterImpl.java deleted file mode 100644 index a20f277ee4..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgExceptionFilterImpl.java +++ /dev/null @@ -1,41 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.impl; - -import agent.dbgeng.manager.DbgExceptionFilter; - -public class DbgExceptionFilterImpl extends DbgEventFilterImpl implements DbgExceptionFilter { - - private final String cmd2; - private long exceptionCode; - - public DbgExceptionFilterImpl(int index, String text, String cmd, String cmd2, - int executionOption, - int continueOption, long exceptionCode) { - super(index, text, cmd, null, executionOption, continueOption); - this.cmd2 = cmd2; - this.exceptionCode = exceptionCode; - } - - public String getSecondCmd() { - return cmd2; - } - - public String getExceptionCode() { - return Long.toHexString(exceptionCode); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgManagerImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgManagerImpl.java deleted file mode 100644 index 2ae51b93cc..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgManagerImpl.java +++ /dev/null @@ -1,1806 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.impl; - -import static ghidra.async.AsyncUtils.sequence; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.EnumSet; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NavigableMap; -import java.util.Objects; -import java.util.Set; -import java.util.TreeMap; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicReference; - -import org.apache.commons.lang3.tuple.Pair; - -import com.sun.jna.platform.win32.COM.COMException; - -import agent.dbgeng.dbgeng.DbgEng; -import agent.dbgeng.dbgeng.DebugAdvanced; -import agent.dbgeng.dbgeng.DebugBreakpoint; -import agent.dbgeng.dbgeng.DebugBreakpoint.BreakFlags; -import agent.dbgeng.dbgeng.DebugBreakpoint.BreakType; -import agent.dbgeng.dbgeng.DebugClient; -import agent.dbgeng.dbgeng.DebugClient.ChangeDebuggeeState; -import agent.dbgeng.dbgeng.DebugClient.ChangeEngineState; -import agent.dbgeng.dbgeng.DebugClient.DebugCreateFlags; -import agent.dbgeng.dbgeng.DebugClient.DebugEndSessionFlags; -import agent.dbgeng.dbgeng.DebugClient.DebugEngCreateFlags; -import agent.dbgeng.dbgeng.DebugClient.DebugStatus; -import agent.dbgeng.dbgeng.DebugClient.DebugVerifierFlags; -import agent.dbgeng.dbgeng.DebugClient.ExecutionState; -import agent.dbgeng.dbgeng.DebugClientReentrant; -import agent.dbgeng.dbgeng.DebugControl; -import agent.dbgeng.dbgeng.DebugControl.DebugInterrupt; -import agent.dbgeng.dbgeng.DebugDataSpaces; -import agent.dbgeng.dbgeng.DebugEventInformation; -import agent.dbgeng.dbgeng.DebugExceptionRecord64; -import agent.dbgeng.dbgeng.DebugModuleInfo; -import agent.dbgeng.dbgeng.DebugProcessId; -import agent.dbgeng.dbgeng.DebugProcessInfo; -import agent.dbgeng.dbgeng.DebugProcessRecord; -import agent.dbgeng.dbgeng.DebugRegisters; -import agent.dbgeng.dbgeng.DebugSessionId; -import agent.dbgeng.dbgeng.DebugSymbols; -import agent.dbgeng.dbgeng.DebugSystemObjects; -import agent.dbgeng.dbgeng.DebugSystemProcessRecord; -import agent.dbgeng.dbgeng.DebugSystemThreadRecord; -import agent.dbgeng.dbgeng.DebugThreadId; -import agent.dbgeng.dbgeng.DebugThreadInfo; -import agent.dbgeng.dbgeng.DebugThreadRecord; -import agent.dbgeng.gadp.impl.AbstractClientThreadExecutor; -import agent.dbgeng.gadp.impl.DbgEngClientThreadExecutor; -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.jna.dbgeng.WinNTExtra; -import agent.dbgeng.manager.DbgCause; -import agent.dbgeng.manager.DbgCause.Causes; -import agent.dbgeng.manager.DbgCommand; -import agent.dbgeng.manager.DbgEvent; -import agent.dbgeng.manager.DbgEventsListener; -import agent.dbgeng.manager.DbgManager; -import agent.dbgeng.manager.DbgModuleMemory; -import agent.dbgeng.manager.DbgProcess; -import agent.dbgeng.manager.DbgSession; -import agent.dbgeng.manager.DbgState; -import agent.dbgeng.manager.DbgStateListener; -import agent.dbgeng.manager.DbgThread; -import agent.dbgeng.manager.breakpoint.DbgBreakpointInfo; -import agent.dbgeng.manager.breakpoint.DbgBreakpointType; -import agent.dbgeng.manager.cmd.DbgAddProcessCommand; -import agent.dbgeng.manager.cmd.DbgAddSessionCommand; -import agent.dbgeng.manager.cmd.DbgAttachKernelCommand; -import agent.dbgeng.manager.cmd.DbgCommandError; -import agent.dbgeng.manager.cmd.DbgConsoleExecCommand; -import agent.dbgeng.manager.cmd.DbgDeleteBreakpointsCommand; -import agent.dbgeng.manager.cmd.DbgDisableBreakpointsCommand; -import agent.dbgeng.manager.cmd.DbgEnableBreakpointsCommand; -import agent.dbgeng.manager.cmd.DbgInsertBreakpointCommand; -import agent.dbgeng.manager.cmd.DbgLaunchProcessCommand; -import agent.dbgeng.manager.cmd.DbgListAvailableProcessesCommand; -import agent.dbgeng.manager.cmd.DbgListBreakpointsCommand; -import agent.dbgeng.manager.cmd.DbgListOSMemoryRegionsCommand; -import agent.dbgeng.manager.cmd.DbgListOSProcessesCommand; -import agent.dbgeng.manager.cmd.DbgListOSThreadsCommand; -import agent.dbgeng.manager.cmd.DbgListProcessesCommand; -import agent.dbgeng.manager.cmd.DbgOpenDumpCommand; -import agent.dbgeng.manager.cmd.DbgPendingCommand; -import agent.dbgeng.manager.cmd.DbgRemoveProcessCommand; -import agent.dbgeng.manager.cmd.DbgRemoveSessionCommand; -import agent.dbgeng.manager.cmd.DbgRequestActivationCommand; -import agent.dbgeng.manager.cmd.DbgRequestFocusCommand; -import agent.dbgeng.manager.cmd.DbgResolveProcessCommand; -import agent.dbgeng.manager.cmd.DbgResolveThreadCommand; -import agent.dbgeng.manager.cmd.DbgSetActiveProcessCommand; -import agent.dbgeng.manager.cmd.DbgSetActiveSessionCommand; -import agent.dbgeng.manager.cmd.DbgSetActiveThreadCommand; -import agent.dbgeng.manager.evt.AbstractDbgEvent; -import agent.dbgeng.manager.evt.DbgBreakpointCreatedEvent; -import agent.dbgeng.manager.evt.DbgBreakpointDeletedEvent; -import agent.dbgeng.manager.evt.DbgBreakpointEvent; -import agent.dbgeng.manager.evt.DbgBreakpointModifiedEvent; -import agent.dbgeng.manager.evt.DbgCommandDoneEvent; -import agent.dbgeng.manager.evt.DbgConsoleOutputEvent; -import agent.dbgeng.manager.evt.DbgDebuggeeStateChangeEvent; -import agent.dbgeng.manager.evt.DbgExceptionEvent; -import agent.dbgeng.manager.evt.DbgModuleLoadedEvent; -import agent.dbgeng.manager.evt.DbgModuleUnloadedEvent; -import agent.dbgeng.manager.evt.DbgProcessCreatedEvent; -import agent.dbgeng.manager.evt.DbgProcessExitedEvent; -import agent.dbgeng.manager.evt.DbgProcessSelectedEvent; -import agent.dbgeng.manager.evt.DbgPromptChangedEvent; -import agent.dbgeng.manager.evt.DbgRunningEvent; -import agent.dbgeng.manager.evt.DbgSessionSelectedEvent; -import agent.dbgeng.manager.evt.DbgStateChangedEvent; -import agent.dbgeng.manager.evt.DbgStoppedEvent; -import agent.dbgeng.manager.evt.DbgSystemErrorEvent; -import agent.dbgeng.manager.evt.DbgSystemsEvent; -import agent.dbgeng.manager.evt.DbgThreadCreatedEvent; -import agent.dbgeng.manager.evt.DbgThreadExitedEvent; -import agent.dbgeng.manager.evt.DbgThreadSelectedEvent; -import agent.dbgeng.model.iface1.DbgModelTargetActiveScope; -import agent.dbgeng.model.iface1.DbgModelTargetFocusScope; -import agent.dbgeng.model.iface2.DbgModelTargetObject; -import agent.dbgeng.model.iface2.DbgModelTargetThread; -import ghidra.async.AsyncClaimQueue; -import ghidra.async.AsyncReference; -import ghidra.async.AsyncUtils; -import ghidra.async.TypeSpec; -import ghidra.comm.util.BitmaskSet; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.util.HandlerMap; -import ghidra.lifecycle.Internal; -import ghidra.util.Msg; -import ghidra.util.datastruct.ListenerSet; - -public class DbgManagerImpl implements DbgManager { - - private String dbgSrvTransport; - - //private final AsyncClaimQueue claimsCreateThread = new AsyncClaimQueue<>(); - //private final AsyncClaimQueue claimsContinueThread = new AsyncClaimQueue<>(); - //private final AsyncClaimQueue claimsStopThread = new AsyncClaimQueue<>(); - //private final AsyncClaimQueue claimsExitThread = new AsyncClaimQueue<>(); - //private final AsyncClaimQueue claimsLoadModule = new AsyncClaimQueue<>(); - private final AsyncClaimQueue claimsBreakpointAdded = new AsyncClaimQueue<>(); - private final AsyncClaimQueue claimsBreakpointRemoved = new AsyncClaimQueue<>(); - //private final AsyncClaimQueue claimsFocusThread = new AsyncClaimQueue<>(); - - public DebugStatus status; - - public final Set statiAccessible = - Collections.unmodifiableSet(EnumSet.of(DebugStatus.NO_DEBUGGEE, DebugStatus.BREAK)); - - private final Map breaksById = new LinkedHashMap<>(); - - protected AbstractClientThreadExecutor engThread; - protected DebugClientReentrant reentrantClient; - - private List> activeCmds = new ArrayList<>(); - - protected final Map sessions = new LinkedHashMap<>(); - protected DbgSessionImpl curSession = null; - private final Map unmodifiableSessions = - Collections.unmodifiableMap(sessions); - - protected final Map processes = new LinkedHashMap<>(); - private final Map unmodifiableProcesses = - Collections.unmodifiableMap(processes); - - protected final Map threads = new LinkedHashMap<>(); - private final Map unmodifiableThreads = - Collections.unmodifiableMap(threads); - - private final Map breakpoints = new LinkedHashMap<>(); - private final Map unmodifiableBreakpoints = - Collections.unmodifiableMap(breakpoints); - - private final NavigableMap memory = new TreeMap<>(); - private final NavigableMap unmodifiableMemory = - Collections.unmodifiableNavigableMap(memory); - - protected final AsyncReference state = - new AsyncReference<>(DbgState.NOT_STARTED); - private final HandlerMap, Void, DebugStatus> handlerMap = new HandlerMap<>(); - private final Map, DebugStatus> statusMap = new LinkedHashMap<>(); - private final Map statusByNameMap = new LinkedHashMap<>(); - private final ListenerSet listenersEvent = - new ListenerSet<>(DbgEventsListener.class, true); - - private DebugEventInformation lastEventInformation; - private DbgSession currentSession; - private DbgProcess currentProcess; - private DbgThread currentThread; - private DbgSession eventSession; - private DbgProcess eventProcess; - private DbgThread eventThread; - private volatile boolean waiting = false; - private boolean kernelMode = false; - private boolean altMemoryQuery = false; - private boolean ignoreEventThread = false; - private CompletableFuture continuation; - private long processCount = 0; - - /** - * Instantiate a new manager - */ - public DbgManagerImpl() { - state.filter(this::stateFilter); - state.addChangeListener(this::trackRunningInterpreter); - defaultHandlers(); - //TODO: this.server = createSctlSide(addr); - //TODO: this.dbgSrvTransport = dbgSrvTransport; - } - - @Override - public DbgThreadImpl getThread(DebugThreadId tid) { - synchronized (threads) { - return threads.get(tid); - } - } - - public DbgThreadImpl getThreadComputeIfAbsent(DebugThreadId id, DbgProcessImpl process, - long tid, boolean fire) { - synchronized (threads) { - if (threads.containsKey(id)) { - DbgThreadImpl existingThread = threads.get(id); - return existingThread; - } - DbgThreadImpl thread = new DbgThreadImpl(this, process, id, tid); - thread.add(); - if (fire) { - Causes cause = DbgCause.Causes.UNCLAIMED; - getEventListeners().invoke().threadCreated(thread, cause); - getEventListeners().invoke().threadSelected(thread, null, cause); - } - return threads.get(id); - } - } - - /** - * Use {@link DbgThreadImpl#remove()} instead - * - * @param id the thread ID to remove - */ - public void removeThread(DebugThreadId id) { - synchronized (threads) { - if (threads.remove(id) == null) { - throw new IllegalArgumentException("There is no thread with id " + id); - } - } - } - - /** - * Use {@link DbgProcessImpl#remove(DbgCause)} instead - * - * @param id the process ID to remove - * @param cause the cause of removal - */ - @Internal - public void removeProcess(DebugProcessId id, DbgCause cause) { - synchronized (processes) { - DbgProcessImpl proc = processes.remove(id); - if (proc == null) { - throw new IllegalArgumentException("There is no process with id " + id); - } - Set toRemove = new HashSet<>(); - for (DebugThreadId tid : threads.keySet()) { - DbgThreadImpl thread = threads.get(tid); - if (thread.getProcess().getId().equals(id)) { - toRemove.add(tid); - } - } - for (DebugThreadId tid : toRemove) { - removeThread(tid); - } - getEventListeners().invoke().processRemoved(id, cause); - } - } - - /** - * Update the selected process - * - * @param process the process that now has focus - * @param cause the cause of the focus change - * @param forEach() signal listeners - * @return success status - */ - @Override - public DbgProcessImpl getProcess(DebugProcessId id) { - synchronized (processes) { - DbgProcessImpl result = processes.get(id); - if (result == null) { - throw new IllegalArgumentException("There is no process with id " + id); - } - return result; - } - } - - public DbgProcessImpl getProcessComputeIfAbsent(DebugProcessId id, long pid, String name, boolean fire) { - synchronized (processes) { - if (processes.containsKey(id)) { - DbgProcessImpl existingProc = processes.get(id); - return existingProc; - } - DbgProcessImpl process = new DbgProcessImpl(this, id, pid, name); - process.add(); - if (fire) { - getEventListeners().invoke().processAdded(process, DbgCause.Causes.UNCLAIMED); - } - return processes.get(id); - } - } - - /** - * Use {@link DbgSessionImpl#remove(DbgCause)} instead - * - * @param id the session ID to remove - * @param cause the cause of removal - */ - @Internal - public void removeSession(DebugSessionId id, DbgCause cause) { - synchronized (sessions) { - if (sessions.remove(id) == null) { - throw new IllegalArgumentException("There is no session with id " + id); - } - getEventListeners().invoke().sessionRemoved(id, cause); - } - } - - @Override - public DbgSession getSession(DebugSessionId id) { - synchronized (sessions) { - DbgSession result = sessions.get(id); - if (result == null) { - throw new IllegalArgumentException("There is no session with id " + id); - } - return result; - } - } - - @Override - public DbgSessionImpl getSessionComputeIfAbsent(DebugSessionId id, boolean fire) { - synchronized (sessions) { - if (!sessions.containsKey(id) && id.value() >= 0) { - DbgSessionImpl session = new DbgSessionImpl(this, id); - session.add(); - if (fire) { - getEventListeners().invoke().sessionAdded(session, DbgCause.Causes.UNCLAIMED); - } - } - return sessions.get(id); - } - } - - @Override - public Map getKnownThreads() { - return unmodifiableThreads; - } - - @Override - public Map getKnownProcesses() { - return unmodifiableProcesses; - } - - @Override - public Map getKnownSessions() { - return unmodifiableSessions; - } - - @Override - public Map getKnownBreakpoints() { - return unmodifiableBreakpoints; - } - - @Override - public Map getKnownMemoryRegions() { - return unmodifiableMemory; - } - - private DbgBreakpointInfo addKnownBreakpoint(DbgBreakpointInfo bkpt, boolean expectExisting) { - DbgBreakpointInfo old = breakpoints.put(bkpt.getNumber(), bkpt); - if (expectExisting && old == null) { - Msg.warn(this, "Breakpoint " + bkpt.getNumber() + " is not known"); - } - else if (!expectExisting && old != null) { - Msg.warn(this, "Breakpoint " + bkpt.getNumber() + " is already known"); - } - return old; - } - - private DbgBreakpointInfo getKnownBreakpoint(long number) { - DbgBreakpointInfo info = breakpoints.get(number); - if (info == null) { - Msg.warn(this, "Breakpoint " + number + " is not known"); - } - return info; - } - - private DbgBreakpointInfo removeKnownBreakpoint(long number) { - DbgBreakpointInfo del = breakpoints.remove(number); - if (del == null) { - Msg.warn(this, "Breakpoint " + number + " is not known"); - } - return del; - } - - @Override - public CompletableFuture insertBreakpoint(String loc, - DbgBreakpointType type) { - return execute(new DbgInsertBreakpointCommand(this, loc, type)); - } - - @Override - public CompletableFuture insertBreakpoint(long loc, int len, - DbgBreakpointType type) { - return execute(new DbgInsertBreakpointCommand(this, loc, len, type)); - } - - @Override - public CompletableFuture disableBreakpoints(long... numbers) { - return execute(new DbgDisableBreakpointsCommand(this, numbers)); - } - - @Override - public CompletableFuture enableBreakpoints(long... numbers) { - return execute(new DbgEnableBreakpointsCommand(this, numbers)); - } - - @Override - public CompletableFuture deleteBreakpoints(long... numbers) { - return execute(new DbgDeleteBreakpointsCommand(this, numbers)); - } - - @Override - public CompletableFuture> listBreakpoints() { - return execute(new DbgListBreakpointsCommand(this)); - } - - private void checkStarted() { - if (state.get() == DbgState.NOT_STARTED) { - throw new IllegalStateException( - "dbgeng has not been started or has not finished starting"); - } - } - - @Override - public CompletableFuture start(String[] args) { - state.set(DbgState.STARTING, Causes.UNCLAIMED); - boolean create = true; - if (args.length == 0) { - engThread = new DbgEngClientThreadExecutor(() -> DbgEng.debugCreate().createClient()); - } - else { - String remoteOptions = String.join(" ", args); - engThread = new DbgEngClientThreadExecutor( - () -> DbgEng.debugConnect(remoteOptions).createClient()); - create = false; - } - engThread.setManager(this); - AtomicReference creat = new AtomicReference<>(create); - return sequence(TypeSpec.VOID).then(engThread, (seq) -> { - doExecute(creat.get()); - seq.exit(); - }).finish().exceptionally((exc) -> { - Msg.error(this, "start failed"); - return null; - }); - } - - protected void doExecute(Boolean create) { - DebugClient dbgeng = engThread.getClient(); - reentrantClient = dbgeng; - - status = dbgeng.getControl().getExecutionStatus(); - // Take control of the session. - // Helps if the JVM is using it for SA, or when starting a new server during testing. - if (create) { - dbgeng.endSession(DebugEndSessionFlags.DEBUG_END_ACTIVE_TERMINATE); - } - - status = dbgeng.getControl().getExecutionStatus(); - dbgeng.setOutputCallbacks(new DbgDebugOutputCallbacks(this)); - dbgeng.setEventCallbacks(new DbgDebugEventCallbacksAdapter(this)); - dbgeng.setInputCallbacks(new DbgDebugInputCallbacks(this)); - dbgeng.flushCallbacks(); - - if (!create) { - dbgeng.connectSession(0); - } - - if (dbgSrvTransport != null && !"none".equalsIgnoreCase(dbgSrvTransport)) { - dbgeng.startServer(dbgSrvTransport); - } - } - - @Override - public boolean isRunning() { - return !engThread.isShutdown() && !engThread.isTerminated(); - } - - @Override - public void terminate() { - //TODO: server.terminate(); - engThread.execute(100, dbgeng -> { - Msg.debug(this, "Disconnecting DebugClient from session"); - dbgeng.endSession(DebugEndSessionFlags.DEBUG_END_PASSIVE); - dbgeng.setOutputCallbacks(null); - dbgeng.setEventCallbacks(null); - dbgeng.setInputCallbacks(null); - engThread.shutdown(); - }); - try { - engThread.awaitTermination(5000, TimeUnit.MILLISECONDS); - } - catch (InterruptedException e) { - // Eh, just go on - } - } - - @Override - public void close() throws Exception { - terminate(); - } - - /** - * Schedule a command for execution - * - * @param cmd the command to execute - * @return the pending command, which acts as a future for later completion - */ - //@Override - @Override - public CompletableFuture execute(DbgCommand cmd) { - assert cmd != null; - checkStarted(); - DbgPendingCommand pcmd = new DbgPendingCommand<>(cmd); - //if (isWaiting()) { - // throw new DebuggerModelAccessException( - // "Cannot process command " + cmd.toString() + " while engine is waiting for events"); - //} - - if (engThread.isCurrentThread()) { - try { - addCommand(cmd, pcmd); - } - catch (Throwable exc) { - pcmd.completeExceptionally(exc); - } - } - else { - CompletableFuture.runAsync(() -> { - addCommand(cmd, pcmd); - }, engThread).exceptionally((exc) -> { - pcmd.completeExceptionally(exc); - return null; - }); - } - return pcmd; - } - - private void addCommand(DbgCommand cmd, DbgPendingCommand pcmd) { - synchronized (this) { - if (!cmd.validInState(state.get())) { - throw new DbgCommandError("Command " + cmd + " is not valid while " + state.get()); - } - activeCmds.add(pcmd); - } - cmd.invoke(); - processEvent(new DbgCommandDoneEvent(cmd)); - } - - public DebugStatus processEvent(DbgEvent evt) { - if (state.get() == DbgState.STARTING) { - state.set(DbgState.STOPPED, Causes.UNCLAIMED); - } - DbgState newState = evt.newState(); - if (newState != null && !(evt instanceof DbgCommandDoneEvent)) { - Msg.debug(this, evt + " transitions state to " + newState); - state.set(newState, evt.getCause()); - } - - boolean cmdFinished = false; - List> toRemove = new ArrayList>(); - for (DbgPendingCommand pcmd : activeCmds) { - cmdFinished = pcmd.handle(evt); - if (cmdFinished) { - pcmd.finish(); - toRemove.add(pcmd); - } - } - for (DbgPendingCommand pcmd : toRemove) { - activeCmds.remove(pcmd); - } - - synchronized (this) { - boolean waitState = isWaiting(); - waiting = false; - DebugStatus ret = evt.isStolen() ? null : handlerMap.handle(evt, null); - if (ret == null) { - ret = DebugStatus.NO_CHANGE; - } - waiting = ret.equals(DebugStatus.NO_DEBUGGEE) ? false : waitState; - return ret; - } - } - - @Override - public void addStateListener(DbgStateListener listener) { - state.addChangeListener(listener); - } - - @Override - public void removeStateListener(DbgStateListener listener) { - state.removeChangeListener(listener); - } - - public ListenerSet getEventListeners() { - return listenersEvent; - } - - @Override - public void addEventsListener(DbgEventsListener listener) { - getEventListeners().add(listener); - } - - @Override - public void removeEventsListener(DbgEventsListener listener) { - getEventListeners().remove(listener); - } - - private DbgState stateFilter(DbgState cur, DbgState set, DbgCause cause) { - if (set == null) { - return cur; - } - return set; - } - - private void trackRunningInterpreter(DbgState oldSt, DbgState st, DbgCause cause) { - if (st == DbgState.RUNNING && cause instanceof DbgPendingCommand) { - DbgPendingCommand pcmd = (DbgPendingCommand) cause; - DbgCommand command = pcmd.getCommand(); - Msg.debug(this, "Entered " + st + " from " + command); - } - } - - private void defaultHandlers() { - handlerMap.put(DbgBreakpointEvent.class, this::processBreakpoint); - handlerMap.put(DbgExceptionEvent.class, this::processException); - handlerMap.put(DbgThreadCreatedEvent.class, this::processThreadCreated); - handlerMap.put(DbgThreadExitedEvent.class, this::processThreadExited); - handlerMap.put(DbgThreadSelectedEvent.class, this::processThreadSelected); - handlerMap.put(DbgProcessCreatedEvent.class, this::processProcessCreated); - handlerMap.put(DbgProcessExitedEvent.class, this::processProcessExited); - handlerMap.put(DbgProcessSelectedEvent.class, this::processProcessSelected); - handlerMap.put(DbgModuleLoadedEvent.class, this::processModuleLoaded); - handlerMap.put(DbgModuleUnloadedEvent.class, this::processModuleUnloaded); - handlerMap.put(DbgStateChangedEvent.class, this::processStateChanged); - handlerMap.put(DbgSessionSelectedEvent.class, this::processSessionSelected); - handlerMap.put(DbgSystemsEvent.class, this::processSystemsEvent); - handlerMap.putVoid(DbgDebuggeeStateChangeEvent.class, this::processDebuggeeStateChanged); - handlerMap.putVoid(DbgSystemErrorEvent.class, this::processSystemErrorEvent); - handlerMap.putVoid(DbgCommandDoneEvent.class, this::processDefault); - handlerMap.putVoid(DbgStoppedEvent.class, this::processDefault); - handlerMap.putVoid(DbgRunningEvent.class, this::processDefault); - handlerMap.putVoid(DbgConsoleOutputEvent.class, this::processConsoleOutput); - handlerMap.putVoid(DbgPromptChangedEvent.class, this::processPromptChanged); - handlerMap.putVoid(DbgBreakpointCreatedEvent.class, this::processBreakpointCreated); - handlerMap.putVoid(DbgBreakpointModifiedEvent.class, this::processBreakpointModified); - handlerMap.putVoid(DbgBreakpointDeletedEvent.class, this::processBreakpointDeleted); - - statusMap.put(DbgBreakpointEvent.class, DebugStatus.BREAK); - statusMap.put(DbgExceptionEvent.class, DebugStatus.NO_CHANGE); - statusMap.put(DbgProcessCreatedEvent.class, DebugStatus.BREAK); - statusMap.put(DbgStateChangedEvent.class, DebugStatus.NO_CHANGE); - statusMap.put(DbgStoppedEvent.class, DebugStatus.BREAK); - } - - private DebugThreadId updateState() { - DebugClient dbgeng = engThread.getClient(); - DebugSystemObjects so = dbgeng.getSystemObjects(); - DebugThreadId etid = so.getEventThread(); - DebugProcessId epid = so.getEventProcess(); - DebugSessionId esid = so.getCurrentSystemId(); - - DebugControl control = dbgeng.getControl(); - int execType = WinNTExtra.Machine.IMAGE_FILE_MACHINE_AMD64.val; - try { - //so.setCurrentProcessId(epid); - //so.setCurrentThreadId(etid); - execType = control.getExecutingProcessorType(); - } - catch (Exception e) { - // Ignore for now - } - - lastEventInformation = control.getLastEventInformation(); - lastEventInformation.setSession(esid); - lastEventInformation.setExecutingProcessorType(execType); - updateStateFromSystemObject(etid, epid, esid); - if (eventThread != null) { - ((DbgThreadImpl) eventThread).setInfo(lastEventInformation); - } - return currentThread == null ? new DebugThreadRecord(-1) : currentThread.getId(); - } - - /** - * Default handler for events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processDefault(AbstractDbgEvent evt, Void v) { - //updateState(); - return statusMap.get(evt.getClass()); - } - - /** - * Handler for breakpoint events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processBreakpoint(DbgBreakpointEvent evt, Void v) { - updateState(); - - DebugBreakpoint bp = evt.getInfo(); - DbgBreakpointInfo info = new DbgBreakpointInfo(bp, getEventProcess(), getEventThread()); - getEventListeners().invoke().threadSelected(eventThread, null, evt.getCause()); - getEventListeners().invoke().breakpointHit(info, evt.getCause()); - - String key = Integer.toHexString(bp.getId()); - if (statusByNameMap.containsKey(key)) { - return statusByNameMap.get(key); - } - return statusMap.get(evt.getClass()); - } - - /** - * Handler for breakpoint events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processException(DbgExceptionEvent evt, Void v) { - getEventListeners().invoke().eventSelected(evt, evt.getCause()); - getEventListeners().invoke().threadSelected(eventThread, null, evt.getCause()); - - DebugExceptionRecord64 info = evt.getInfo(); - String key = Integer.toHexString(info.code); - if (statusByNameMap.containsKey(key)) { - return statusByNameMap.get(key); - } - return statusMap.get(evt.getClass()); - } - - /** - * Handler for thread created events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processThreadCreated(DbgThreadCreatedEvent evt, Void v) { - DebugThreadId eventId = updateState(); - DbgProcessImpl process = getCurrentProcess(); - DbgThreadImpl thread = getThreadFromDebugProcessInfo(process, evt.getInfo()); - - getEventListeners().invoke().eventSelected(evt, evt.getCause()); - getEventListeners().invoke().threadCreated(thread, DbgCause.Causes.UNCLAIMED); - getEventListeners().invoke().threadSelected(thread, null, evt.getCause()); - - String key = eventId.id(); - if (statusByNameMap.containsKey(key)) { - return statusByNameMap.get(key); - } - return statusMap.get(evt.getClass()); - } - - /** - * Handler for thread exited events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processThreadExited(DbgThreadExitedEvent evt, Void v) { - DebugThreadId eventId = updateState(); - DbgProcessImpl process = getCurrentProcess(); - DbgThreadImpl thread = getCurrentThread(); - if (thread != null) { - thread.remove(); - } - process.threadExited(eventId); - getEventListeners().invoke().eventSelected(evt, evt.getCause()); - getEventListeners().invoke().threadExited(eventId, process, evt.getCause()); - - String key = eventId.id(); - if (statusByNameMap.containsKey(key)) { - return statusByNameMap.get(key); - } - return statusMap.get(evt.getClass()); - } - - /** - * Handler for thread selected events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processThreadSelected(DbgThreadSelectedEvent evt, Void v) { - if (evt.getState() == DbgState.RUNNING) { - currentThread = evt.getThread(); - currentThread.setState(evt.getState(), evt.getCause(), evt.getReason()); - return statusMap.get(evt.getClass()); - } - DebugThreadId eventId = updateState(); - - //currentThread = evt.getThread(); - currentThread.setState(evt.getState(), evt.getCause(), evt.getReason()); - getEventListeners().invoke().threadSelected(currentThread, evt.getFrame(), evt.getCause()); - - String key = eventId.id(); - if (statusByNameMap.containsKey(key)) { - return statusByNameMap.get(key); - } - return statusMap.get(evt.getClass()); - } - - /** - * Handler for process created events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processProcessCreated(DbgProcessCreatedEvent evt, Void v) { - DebugProcessInfo info = evt.getInfo(); - DbgProcessImpl proc = getProcessFromDebugProcessInfo(info); - getEventListeners().invoke().eventSelected(evt, evt.getCause()); - getEventListeners().invoke().processAdded(proc, evt.getCause()); - getEventListeners().invoke().processSelected(proc, evt.getCause()); - - getThreadFromDebugProcessInfo(proc, info.initialThreadInfo); - //getEventListeners().fire.threadCreated(thread, evt.getCause()); - //getEventListeners().fire.threadSelected(thread, null, evt.getCause()); - - //proc.moduleLoaded(info.moduleInfo); - //getEventListeners().fire.moduleLoaded(proc, info.moduleInfo, evt.getCause()); - - String key = proc.getId().id(); - if (statusByNameMap.containsKey(key)) { - return statusByNameMap.get(key); - } - return statusMap.get(evt.getClass()); - } - - /** - * Handler for process exited events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processProcessExited(DbgProcessExitedEvent evt, Void v) { - DebugThreadId eventId = updateState(); - DbgThreadImpl thread = getCurrentThread(); - DbgProcessImpl process = getCurrentProcess(); - process.setExitCode(Long.valueOf(evt.getInfo())); - - getEventListeners().invoke().eventSelected(evt, evt.getCause()); - getEventListeners().invoke().threadExited(eventId, process, evt.getCause()); - getEventListeners().invoke().processExited(process, evt.getCause()); - - for (DebugBreakpoint bpt : getBreakpoints()) { - breaksById.remove(bpt.getId()); - } - if (thread != null) { - thread.remove(); - } - process.remove(evt.getCause()); - getEventListeners().invoke().processRemoved(process.getId(), evt.getCause()); - - String key = process.getId().id(); - if (statusByNameMap.containsKey(key)) { - return statusByNameMap.get(key); - } - return statusMap.get(evt.getClass()); - } - - /** - * Handler for process selected events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processProcessSelected(DbgProcessSelectedEvent evt, Void v) { - DebugThreadId eventId = updateState(); - - currentProcess = evt.getProcess(); - getEventListeners().invoke().processSelected(currentProcess, evt.getCause()); - - String key = eventId.id(); - if (statusByNameMap.containsKey(key)) { - return statusByNameMap.get(key); - } - return statusMap.get(evt.getClass()); - } - - /** - * Handler for module loaded events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processModuleLoaded(DbgModuleLoadedEvent evt, Void v) { - updateState(); - DbgProcessImpl process = getCurrentProcess(); - DebugModuleInfo info = evt.getInfo(); - process.moduleLoaded(info); - getEventListeners().invoke().eventSelected(evt, evt.getCause()); - getEventListeners().invoke().moduleLoaded(process, info, evt.getCause()); - - String key = info.getModuleName(); - if (statusByNameMap.containsKey(key)) { - return statusByNameMap.get(key); - } - return statusMap.get(evt.getClass()); - } - - /** - * Handler for module unloaded events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processModuleUnloaded(DbgModuleUnloadedEvent evt, Void v) { - updateState(); - DbgProcessImpl process = getCurrentProcess(); - DebugModuleInfo info = evt.getInfo(); - process.moduleUnloaded(info); - getEventListeners().invoke().eventSelected(evt, evt.getCause()); - getEventListeners().invoke().moduleUnloaded(process, info, evt.getCause()); - - String key = info.getModuleName(); - if (statusByNameMap.containsKey(key)) { - return statusByNameMap.get(key); - } - return statusMap.get(evt.getClass()); - } - - /** - * Handler for state changed events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processStateChanged(DbgStateChangedEvent evt, Void v) { - BitmaskSet flags = evt.getInfo(); - long argument = evt.getArgument(); - if (flags.contains(ChangeEngineState.EXECUTION_STATUS)) { - if (DebugStatus.isInsideWait(argument)) { - return DebugStatus.NO_CHANGE; - } - status = DebugStatus.fromArgument(argument); - - if (status.equals(DebugStatus.NO_DEBUGGEE)) { - waiting = false; - return DebugStatus.NO_DEBUGGEE; - } - if (!threads.isEmpty()) { - //DbgSessionImpl session = getCurrentSession(); - //DbgProcessImpl process = getCurrentProcess(); - eventThread = getCurrentThread(); - DbgState dbgState = null; - if (eventThread != null) { - if (status.threadState.equals(ExecutionState.STOPPED)) { - dbgState = DbgState.STOPPED; - //System.err.println("STOPPED " + id); - processEvent(new DbgStoppedEvent(eventThread.getId())); - processEvent(new DbgPromptChangedEvent(getControl().getPromptText())); - } - if (status.threadState.equals(ExecutionState.RUNNING)) { - //System.err.println("RUNNING " + id); - dbgState = DbgState.RUNNING; - // NB: Needed by GADP variants, but not IN-VM - getEventListeners().invoke().memoryChanged(currentProcess, 0L, 0, - evt.getCause()); - processEvent(new DbgRunningEvent(eventThread.getId())); - } - if (!threads.containsValue(eventThread)) { - dbgState = DbgState.EXIT; - } - // Don't fire - if (dbgState != null && dbgState != DbgState.EXIT) { - processEvent(new DbgThreadSelectedEvent(dbgState, eventThread, - evt.getFrame(eventThread))); - } - return DebugStatus.NO_CHANGE; - } - } - if (status.equals(DebugStatus.BREAK)) { - waiting = false; - processEvent(new DbgStoppedEvent(getSystemObjects().getCurrentThreadId())); - DbgProcessImpl process = getCurrentProcess(); - if (process != null) { - processEvent(new DbgProcessSelectedEvent(process)); - } - processEvent(new DbgPromptChangedEvent(getControl().getPromptText())); - return DebugStatus.BREAK; - } - if (status.equals(DebugStatus.GO)) { - waiting = true; - processEvent(new DbgRunningEvent(getSystemObjects().getCurrentThreadId())); - return DebugStatus.GO; - } - waiting = false; - return DebugStatus.NO_CHANGE; - } - if (flags.contains(ChangeEngineState.BREAKPOINTS)) { - long bptId = evt.getArgument(); - //System.err.println("BPT: " + bptId + ":" + flags + ":" + argument); - processEvent(new DbgBreakpointModifiedEvent(bptId)); - } - if (flags.contains(ChangeEngineState.CURRENT_THREAD)) { - long id = evt.getArgument(); - for (DebugThreadId key : getThreads()) { - if (key.value() == id) { - DbgThread thread = getThread(key); - if (thread != null) { - getEventListeners().invoke().threadSelected(thread, null, evt.getCause()); - } - processEvent(new DbgPromptChangedEvent(getControl().getPromptText())); - break; - } - } - } - if (flags.contains(ChangeEngineState.SYSTEMS)) { - processEvent(new DbgSystemsEvent(argument)); - } - return DebugStatus.NO_CHANGE; - } - - /** - * Handler for session selected events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processSessionSelected(DbgSessionSelectedEvent evt, Void v) { - DebugThreadId eventId = updateState(); - - currentSession = evt.getSession(); - getEventListeners().invoke().sessionSelected(currentSession, evt.getCause()); - - String key = eventId.id(); - if (statusByNameMap.containsKey(key)) { - return statusByNameMap.get(key); - } - return statusMap.get(evt.getClass()); - } - - /** - * Handler for systems events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processSystemsEvent(DbgSystemsEvent evt, Void v) { - - waiting = true; - - Long info = evt.getInfo(); - if (info.intValue() >= 0) { - processCount++; - } - else { - processCount--; - } - DebugProcessId id = new DebugProcessRecord(info.intValue()); - - String key = id.id(); - if (statusByNameMap.containsKey(key)) { - return statusByNameMap.get(key); - } - return statusMap.get(evt.getClass()); - } - - protected void processDebuggeeStateChanged(DbgDebuggeeStateChangeEvent evt, Void v) { - if (evt.getFlags().contains(ChangeDebuggeeState.DATA)) { - getEventListeners().invoke().memoryChanged(currentProcess, 0L, 0, evt.getCause()); - } - } - - protected void processSystemErrorEvent(DbgSystemErrorEvent evt, Void v) { - getEventListeners().invoke().eventSelected(evt, evt.getCause()); - String error = "SystemError " + evt.getError() + ":" + evt.getLevel(); - getEventListeners().invoke().consoleOutput(error, 0); - } - - protected void processConsoleOutput(DbgConsoleOutputEvent evt, Void v) { - getEventListeners().invoke().eventSelected(evt, evt.getCause()); - getEventListeners().invoke().consoleOutput(evt.getInfo(), evt.getMask()); - } - - protected void processPromptChanged(DbgPromptChangedEvent evt, Void v) { - getEventListeners().invoke().promptChanged(evt.getPrompt()); - } - - /** - * Handler for breakpoint-created event - * - * @param evt the event - * @param v nothing - */ - protected void processBreakpointCreated(DbgBreakpointCreatedEvent evt, Void v) { - doBreakpointCreated(evt.getBreakpointInfo(), evt.getCause()); - } - - /** - * Handler for breakpoint-modified event - * - * @param evt the event - * @param v nothing - */ - protected void processBreakpointModified(DbgBreakpointModifiedEvent evt, Void v) { - DbgBreakpointInfo breakpointInfo = evt.getBreakpointInfo(); - if (breakpointInfo == null) { - long bptId = evt.getId(); - if (bptId == DbgEngUtil.DEBUG_ANY_ID.longValue()) { - changeBreakpoints(); - for (DbgBreakpointInfo bptInfo : breakpoints.values()) { - if (bptInfo.getProc().equals(currentProcess)) { - doBreakpointDeleted(bptInfo.getNumber(), evt.getCause()); - } - } - } - else { - DebugBreakpoint bpt = getControl().getBreakpointById((int) bptId); - if (bpt == null && bptId != DbgEngUtil.DEBUG_ANY_ID.longValue()) { - doBreakpointDeleted(bptId, evt.getCause()); - return; - } - DbgBreakpointInfo knownBreakpoint = breakpoints.get(bptId); - if (knownBreakpoint == null) { - breakpointInfo = new DbgBreakpointInfo(bpt, getCurrentProcess()); - if (breakpointInfo.getOffset() != null) { - addKnownBreakpoint(breakpointInfo, false); - // NB: we don't want to create this here as the address is 0s - //doBreakpointCreated(breakpointInfo, evt.getCause()); - } - return; - } - breakpointInfo = knownBreakpoint; - Long initOffset = breakpointInfo.getOffset(); - breakpointInfo.setBreakpoint(bpt); - if (!breakpointInfo.getOffset().equals(0L)) { - if (initOffset.equals(0L)) { - doBreakpointCreated(breakpointInfo, evt.getCause()); - } - else { - doBreakpointModified(breakpointInfo, evt.getCause()); - } - } - } - } - } - - /** - * Handler for breakpoint-deleted event - * - * @param evt the event - * @param v nothing - */ - protected void processBreakpointDeleted(DbgBreakpointDeletedEvent evt, Void v) { - doBreakpointDeleted(evt.getNumber(), evt.getCause()); - } - - /** - * Fire breakpoint created event - * - * @param newInfo the new information - * @param cause the cause of the creation - */ - @Internal - public void doBreakpointCreated(DbgBreakpointInfo newInfo, DbgCause cause) { - addKnownBreakpoint(newInfo, true); - getEventListeners().invoke().breakpointCreated(newInfo, cause); - } - - /** - * Fire breakpoint modified event - * - * @param newInfo the new information - * @param cause the cause of the modification - */ - @Internal - public void doBreakpointModified(DbgBreakpointInfo newInfo, DbgCause cause) { - DbgBreakpointInfo oldInfo = addKnownBreakpoint(newInfo, true); - getEventListeners().invoke().breakpointModified(newInfo, oldInfo, cause); - } - - /** - * Fire breakpoint deleted event - * - * @param number the deleted breakpoint number - * @param cause the cause of the deletion - */ - @Internal - public void doBreakpointDeleted(long number, DbgCause cause) { - DbgBreakpointInfo oldInfo = removeKnownBreakpoint(number); - if (oldInfo == null) { - return; - } - getEventListeners().invoke().breakpointDeleted(oldInfo, cause); - oldInfo.dispose(); - } - - protected void doBreakpointModifiedSameLocations(DbgBreakpointInfo newInfo, - DbgBreakpointInfo oldInfo, DbgCause cause) { - if (Objects.equals(newInfo, oldInfo)) { - return; - } - getEventListeners().invoke().breakpointModified(newInfo, oldInfo, cause); - } - - @Internal - public void doBreakpointDisabled(long number, DbgCause cause) { - DbgBreakpointInfo oldInfo = getKnownBreakpoint(number); - if (oldInfo == null) { - return; - } - DbgBreakpointInfo newInfo = oldInfo.withEnabled(false); - doBreakpointModifiedSameLocations(newInfo, oldInfo, cause); - } - - @Internal - public void doBreakpointEnabled(long number, DbgCause cause) { - DbgBreakpointInfo oldInfo = getKnownBreakpoint(number); - if (oldInfo == null) { - return; - } - DbgBreakpointInfo newInfo = oldInfo.withEnabled(true); - doBreakpointModifiedSameLocations(newInfo, oldInfo, cause); - } - - private long orZero(Long l) { - if (l == null) { - return 0; - } - return l; - } - - private void changeBreakpoints() { - Set retained = new HashSet<>(); - DebugSystemObjects so = getSystemObjects(); - try (SavedFocus focus = new SavedFocus(so)) { - for (DebugProcessId pid : so.getProcesses()) { - try { - Msg.debug(this, "BREAKPOINTS: Changing current process to " + pid); - so.setCurrentProcessId(pid); - } - catch (COMException e) { - Msg.debug(this, e.getMessage()); - continue; - } - List tids = so.getThreads(); - for (DebugBreakpoint bpt : getControl().getBreakpoints()) { - BitmaskSet f = bpt.getFlags(); - if (!f.contains((BreakFlags.ENABLED)) || f.contains(BreakFlags.DEFERRED)) { - continue; - } - if (bpt.getType().breakType != BreakType.CODE) { - continue; // TODO: Extend SCTL to handle R/W breakpoints - } - int id = bpt.getId(); - retained.add(id); - long newOffset = orZero(bpt.getOffset()); - BreakpointTag tag = breaksById.get(id); - if (tag == null) { - for (DebugThreadId tid : tids) { - Msg.debug(this, "TRAP Added: " + id + " on " + tid); - if (claimsBreakpointAdded.satisfy(tid)) { - Msg.debug(this, " claimed"); - } - breaksById.put(id, new BreakpointTag(newOffset)); - } - } - else if (tag.offset != newOffset) { - tag.offset = newOffset; - } // else the breakpoint is unchanged - } - Iterator it = breaksById.keySet().iterator(); - while (it.hasNext()) { - int id = it.next(); - if (retained.contains(id)) { - continue; - } - for (DebugThreadId tid : tids) { - Msg.debug(this, "TRAP Removed: " + id + " on " + tid); - if (claimsBreakpointRemoved.satisfy(new BreakId(tid, id))) { - Msg.debug(this, " claimed"); - } - } - it.remove(); - } - } - } - catch (COMException e) { - Msg.error(this, "Error retrieving processes: " + e); - } - } - - @Override - public CompletableFuture> listProcesses() { - return execute(new DbgListProcessesCommand(this)); - } - - @Override - public CompletableFuture> listOSProcesses() { - return execute(new DbgListOSProcessesCommand(this)); - } - - @Override - public CompletableFuture> listOSMemory() { - return execute(new DbgListOSMemoryRegionsCommand(this)); - } - - @Override - public CompletableFuture> listOSThreads(DbgProcessImpl proc) { - return execute(new DbgListOSThreadsCommand(this, proc)); - } - - @Override - public CompletableFuture>> listAvailableProcesses() { - return execute(new DbgListAvailableProcessesCommand(this)); - } - - @Override - public CompletableFuture> listSessions() { - return CompletableFuture.completedFuture(null); - ///return execute(new DbgListSessionsCommand(this)); - } - - @Override - public void sendInterruptNow() { - checkStarted(); - Msg.info(this, "Interrupting"); - // NB: don't use "execute" here - engThread is paused on waitForEvents - // and execute::sequence blocks on engThread - reentrantClient.getControl().setInterrupt(DebugInterrupt.ACTIVE); - } - - @Override - public CompletableFuture addProcess() { - return execute(new DbgAddProcessCommand(this)); - } - - @Override - public CompletableFuture removeProcess(DbgProcess process) { - return execute(new DbgRemoveProcessCommand(this, process.getId())); - } - - @Override - public CompletableFuture addSession() { - return execute(new DbgAddSessionCommand(this)); - } - - @Override - public CompletableFuture removeSession(DbgSession session) { - return execute(new DbgRemoveSessionCommand(this, session.getId())); - } - - @Override - public CompletableFuture addMemory(DbgModuleMemory region) { - memory.put(region.getId(), region); - return AsyncUtils.nil(); - } - - @Override - public CompletableFuture removeMemory(Long id) { - memory.remove(id); - return AsyncUtils.nil(); - } - - @Override - public CompletableFuture launch(Map map) { - String args = (String) map.get("args"); - String initDir = (String) map.get("dir"); - String env = (String) map.get("env"); - - Integer cfVal = (Integer) map.get("cf"); - Integer efVal = (Integer) map.get("ef"); - Integer vfVal = (Integer) map.get("vf"); - BitmaskSet cf = - new BitmaskSet(DebugCreateFlags.class, - cfVal == null ? 1 : cfVal); - BitmaskSet ef = - new BitmaskSet(DebugEngCreateFlags.class, - efVal == null ? 0 : efVal); - BitmaskSet vf = - new BitmaskSet(DebugVerifierFlags.class, - vfVal == null ? 0 : vfVal); - return execute(new DbgLaunchProcessCommand(this, args, - initDir, env, cf, ef, vf)).thenApply(__ -> null); - } - - public CompletableFuture openFile(Map args) { - return execute(new DbgOpenDumpCommand(this, args)); - } - - public CompletableFuture attachKernel(Map args) { - setKernelMode(true); - return execute(new DbgAttachKernelCommand(this, args)); - } - - static class ExitEvent { - final DebugThreadId tid; - final long exitCode; - - public ExitEvent(DebugThreadId tid, long exitCode) { - this.tid = tid; - this.exitCode = exitCode; - } - } - - static class BreakId { - final DebugThreadId tid; - final int bpid; - - public BreakId(DebugThreadId tid, int bpid) { - this.tid = tid; - this.bpid = bpid; - } - } - - static class BreakpointTag { - long offset; - - public BreakpointTag(long offset) { - this.offset = offset; - } - } - - class SavedFocus implements AutoCloseable { - final DebugSystemObjects so; - DebugThreadId tid = null; - - public SavedFocus(DebugSystemObjects so) { - this.so = so; - try { - tid = so.getCurrentThreadId(); - } - catch (COMException e) { - Msg.debug(this, "Cannot save current thread id: " + e); - } - } - - @Override - public void close() { - if (tid != null) { - try { - so.setCurrentThreadId(tid); - } - catch (COMException e) { - Msg.debug(this, "Could not restore current thread id: " + e); - } - } - } - } - - public DebugClient getClient() { - return engThread.getClient(); - } - - public DebugAdvanced getAdvanced() { - DebugClient dbgeng = getClient(); - return dbgeng.getAdvanced(); - } - - public DebugControl getControl() { - DebugClient dbgeng = getClient(); - return dbgeng.getControl(); - } - - public DebugDataSpaces getDataSpaces() { - DebugClient dbgeng = getClient(); - return dbgeng.getDataSpaces(); - } - - public DebugRegisters getRegisters() { - DebugClient dbgeng = getClient(); - return dbgeng.getRegisters(); - } - - public DebugSymbols getSymbols() { - DebugClient dbgeng = getClient(); - return dbgeng.getSymbols(); - } - - public DebugSystemObjects getSystemObjects() { - DebugClient dbgeng = getClient(); - return dbgeng.getSystemObjects(); - } - - public List getThreads() { - DebugSystemObjects so = getSystemObjects(); - return so.getThreads(); - } - - private List getBreakpoints() { - DebugControl control = getControl(); - return control.getBreakpoints(); - } - - public DbgThreadImpl getCurrentThread() { - return (DbgThreadImpl) (currentThread != null ? currentThread : eventThread); - } - - public void setCurrentThread(DbgThreadImpl thread) { - currentThread = thread; - } - - public DbgProcessImpl getCurrentProcess() { - return (DbgProcessImpl) (currentProcess != null ? currentProcess : eventProcess); - } - - public void setCurrentProcess(DbgProcessImpl process) { - currentProcess = process; - } - - public DbgSessionImpl getCurrentSession() { - return (DbgSessionImpl) (currentSession != null ? currentSession : eventSession); - } - - public DbgThreadImpl getEventThread() { - return (DbgThreadImpl) eventThread; - } - - public DbgProcessImpl getEventProcess() { - return (DbgProcessImpl) eventProcess; - } - - public DbgSessionImpl getEventSession() { - return (DbgSessionImpl) eventSession; - } - - public CompletableFuture setActiveFrame(DbgThread thread, int index) { - currentThread = thread; - currentProcess = thread.getProcess(); - return execute(new DbgSetActiveThreadCommand(this, thread, index)); - } - - public CompletableFuture setActiveThread(DbgThread thread) { - if (currentThread != null) { - if (thread == null || thread.getTid().equals(currentThread.getTid())) { - return CompletableFuture.completedFuture(null); - } - } - currentThread = thread; - currentProcess = thread.getProcess(); - return execute(new DbgSetActiveThreadCommand(this, thread, null)); - } - - public CompletableFuture setActiveProcess(DbgProcess process) { - if (currentProcess != null) { - if (process == null || process.getPid().equals(currentProcess.getPid())) { - return CompletableFuture.completedFuture(null); - } - } - currentProcess = process; - return execute(new DbgSetActiveProcessCommand(this, process)); - } - - public CompletableFuture setActiveSession(DbgSession session) { - currentSession = session; - return execute(new DbgSetActiveSessionCommand(this, session)); - } - - public CompletableFuture requestFocus(DbgModelTargetFocusScope scope, TargetObject obj) { - return execute(new DbgRequestFocusCommand(this, scope, obj)); - } - - public CompletableFuture requestActivation(DbgModelTargetActiveScope activator, - TargetObject obj) { - return execute(new DbgRequestActivationCommand(this, activator, obj)); - } - - @Override - public CompletableFuture console(String command) { - if (continuation != null) { - //String prompt = command.equals("") ? DbgModelTargetInterpreter.DBG_PROMPT : ">>>"; - //getEventListeners().fire.promptChanged(prompt); - continuation.complete(command); - setContinuation(null); - return AsyncUtils.nil(); - } - return execute( - new DbgConsoleExecCommand(this, command, DbgConsoleExecCommand.Output.CONSOLE)) - .thenApply(e -> null); - } - - @Override - public CompletableFuture consoleCapture(String command) { - return execute( - new DbgConsoleExecCommand(this, command, DbgConsoleExecCommand.Output.CAPTURE)); - } - - public void fireThreadExited(DebugThreadId id, DbgProcessImpl process, DbgCause cause) { - getEventListeners().invoke().threadExited(id, process, cause); - } - - @Override - public DbgState getState() { - return state.get(); - } - - @Override - public DbgProcess currentProcess() { - return getCurrentProcess(); - } - - @Override - public CompletableFuture waitForEventEx() { - //System.err.println("ENTER"); - DebugControl control = getControl(); - waiting = true; - control.waitForEvent(); - //System.err.println("EXIT"); - waiting = false; - updateState(); - return CompletableFuture.completedFuture(null); - } - - @Override - public CompletableFuture waitForState(DbgState forState) { - checkStarted(); - return state.waitValue(forState); - } - - @Override - public CompletableFuture waitForPrompt() { - return CompletableFuture.completedFuture(null); - } - - @Override - public DebugEventInformation getLastEventInformation() { - return lastEventInformation; - } - - public boolean shouldUpdate(TargetObject object) { - if (ignoreEventThread || !(object instanceof DbgModelTargetObject)) { - return true; - } - DbgModelTargetObject modelObject = (DbgModelTargetObject) object; - DbgModelTargetThread parentThread = modelObject.getParentThread(); - if (parentThread == null) { - return true; - } - return parentThread.getThread().equals(eventThread); - } - - public CompletableFuture> getRegisterMap(List path) { - return null; - } - - public boolean isWaiting() { - return waiting; - } - - public boolean isKernelMode() { - return kernelMode; - } - - public void setKernelMode(boolean kernelMode) { - this.kernelMode = kernelMode; - } - - public boolean useAltMemoryQuery() { - return altMemoryQuery; - } - - public void setAltMemoryQuery(boolean altMemoryQuery) { - this.altMemoryQuery = altMemoryQuery; - } - - public void setContinuation(CompletableFuture continuation) { - this.continuation = continuation; - } - - public long getProcessCount() { - return processCount; - } - - public DebugThreadId getThreadIdBySystemId(Integer tid) { - return getSystemObjects().getThreadIdBySystemId(tid); - } - - public DebugProcessId getProcessIdBySystemId(Integer pid) { - return getSystemObjects().getProcessIdBySystemId(pid); - } - - private DbgProcessImpl getProcessFromDebugProcessInfo(DebugProcessInfo info) { - DebugSystemObjects so = getSystemObjects(); - DebugProcessId id = so.getProcessIdByHandle(info.handle); - if (kernelMode) { - // Unnecessary? Are these events transmitted in kernel-mode? - return null; - } else { - int pid = so.getCurrentProcessSystemId(); - String name = so.getCurrentProcessExecutableName(); - return getProcessComputeIfAbsent(id, pid, name, true); - } - } - - private DbgThreadImpl getThreadFromDebugProcessInfo(DbgProcessImpl proc, DebugThreadInfo info) { - DebugSystemObjects so = getSystemObjects(); - DebugThreadId id = so.getThreadIdByHandle(info.handle); - if (kernelMode) { - // Unnecessary? Are these events transmitted in kernel-mode? - return null; - } else { - int pid = so.getCurrentThreadSystemId(); - return getThreadComputeIfAbsent(id, proc, pid, true); - } - } - - private void updateStateFromSystemObject(DebugThreadId etid, DebugProcessId epid, DebugSessionId esid) { - DebugSystemObjects so = getSystemObjects(); - currentSession = eventSession = getSessionComputeIfAbsent(esid, true); - if (kernelMode) { - DbgProcessImpl cp = getProcessComputeIfAbsent(new DebugSystemProcessRecord(epid.value()), -1, null, true); - cp.setOffset(so.getCurrentProcessDataOffset()); - cp.setExecutableName(so.getCurrentProcessExecutableName()); - currentProcess = eventProcess = cp; - if (currentProcess.getId().isSystem()) { - execute(new DbgResolveProcessCommand(this, currentProcess)).thenAccept(proc -> { - currentProcess = eventProcess = proc; - // As you now have both pid & offset, update the id==pid version - DbgProcessImpl mirror = getProcessComputeIfAbsent(new DebugProcessRecord(proc.getPid()), proc.getPid(), null, true); - if (mirror != null) { - mirror.setOffset(currentProcess.getOffset()); - currentProcess = eventProcess = mirror; - getEventListeners().invoke().processSelected(eventProcess, Causes.UNCLAIMED); - } - }); - } - DbgThreadImpl ct = getThreadComputeIfAbsent(new DebugSystemThreadRecord(etid.value()), cp, -1, false); - ct.setOffset(so.getCurrentThreadDataOffset()); - currentThread = eventThread = ct; - if (currentThread.getId().isSystem()) { - execute(new DbgResolveThreadCommand(this, currentThread)).thenAccept(thread -> { - currentThread = eventThread = thread; - // As you now have both tid & offset, update the id==tid version - DbgThreadImpl mirror = getThreadComputeIfAbsent(new DebugThreadRecord(thread.getTid()), (DbgProcessImpl) eventProcess, thread.getTid(), true); - if (mirror != null) { - mirror.setOffset(currentThread.getOffset()); - currentThread = eventThread = mirror; - getEventListeners().invoke().threadSelected(eventThread, null, Causes.UNCLAIMED); - } - }); - } - } else { - currentProcess = - eventProcess = getProcessComputeIfAbsent(epid, so.getCurrentProcessSystemId(), so.getCurrentProcessExecutableName(), true); - currentThread = eventThread = getThreadComputeIfAbsent(etid, (DbgProcessImpl) eventProcess, - so.getCurrentThreadSystemId(), false); - getEventListeners().invoke().threadSelected(eventThread, null, Causes.UNCLAIMED); - } - } - - public DebugStatus getStatus() { - return status; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgMinimalSymbol.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgMinimalSymbol.java deleted file mode 100644 index 6e8b641fea..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgMinimalSymbol.java +++ /dev/null @@ -1,65 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.impl; - -public class DbgMinimalSymbol { - protected final long index; - protected final int typeId; - protected final String name; - protected final long address; - protected final long size; - private final int tag; - private final long moduleBase; - - public DbgMinimalSymbol(long index, int typeId, String name, long address, long size, int tag, - long moduleBase) { - this.index = index; - this.typeId = typeId; - this.name = name; - this.address = address; - this.size = size; - this.tag = tag; - this.moduleBase = moduleBase; - } - - public long getIndex() { - return index; - } - - public int getTypeId() { - return typeId; - } - - public String getName() { - return name; - } - - public long getAddress() { - return address; - } - - public long getSize() { - return size; - } - - public int getTag() { - return tag; - } - - public long getModuleBase() { - return moduleBase; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgModuleImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgModuleImpl.java deleted file mode 100644 index 129943da09..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgModuleImpl.java +++ /dev/null @@ -1,110 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.impl; - -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.dbgeng.DebugModuleInfo; -import agent.dbgeng.manager.DbgCause.Causes; -import agent.dbgeng.manager.DbgModule; -import agent.dbgeng.manager.cmd.DbgListSymbolsCommand; -import ghidra.async.AsyncLazyValue; - -public class DbgModuleImpl implements DbgModule { - - DbgManagerImpl manager; - protected final DbgProcessImpl process; - protected final String name; - private DebugModuleInfo info; - - protected final AsyncLazyValue> minimalSymbols = - new AsyncLazyValue<>(this::doGetMinimalSymbols); - - /** - * Construct a new module - * - * @param manager the manager creating the module - * @param process the process to which the module belongs - * @param id the dbgeng-assigned module ID - */ - public DbgModuleImpl(DbgManagerImpl manager, DbgProcessImpl process, DebugModuleInfo info) { - this.manager = manager; - this.process = process; - this.info = info; - this.name = info.getModuleName(); - } - - @Override - public String getName() { - return name; - } - - /** - * Add this thread to the inferior and manager - */ - public void add() { - process.addModule(this); - manager.getEventListeners().invoke().moduleLoaded(process, info, Causes.UNCLAIMED); - } - - /** - * Remove this thread from the inferior and manager - */ - public void remove() { - process.removeModule(name); - manager.getEventListeners().invoke().moduleUnloaded(process, info, Causes.UNCLAIMED); - } - - @Override - public String getImageName() { - return info == null ? getName() : info.getImageName(); - } - - @Override - public String getModuleName() { - return info == null ? getName() : info.getModuleName(); - } - - @Override - public Long getKnownBase() { - return info == null ? 0L : info.baseOffset; - } - - @Override - public Integer getSize() { - return info == null ? 0 : info.moduleSize; - } - - @Override - public Integer getTimeStamp() { - return info == null ? 0 : info.timeDateStamp; - } - - protected CompletableFuture> doGetMinimalSymbols() { - return manager.execute(new DbgListSymbolsCommand(manager, process, this)); - } - - @Override - public CompletableFuture> listMinimalSymbols() { - return minimalSymbols.request(); - } - - public DebugModuleInfo getInfo() { - return info; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgModuleMemoryImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgModuleMemoryImpl.java deleted file mode 100644 index a3d7b912d4..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgModuleMemoryImpl.java +++ /dev/null @@ -1,151 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.impl; - -import java.util.List; -import java.util.Objects; - -import agent.dbgeng.dbgeng.DebugDataSpaces.PageState; -import agent.dbgeng.manager.DbgModuleMemory; - -public class DbgModuleMemoryImpl implements DbgModuleMemory { - - protected final String index; - protected final long vmaStart; - protected final long vmaEnd; - protected final long allocationBase; - protected final List allocationProtect; - protected final List protect; - protected final PageState state; - protected final String type; - private boolean isRead; - private boolean isWrite; - private boolean isExec; - private int hashcode; - - public DbgModuleMemoryImpl(String index, long vmaStart, long vmaEnd, long allocationBase, - List allocationProtect, List protect, PageState state, String type, - boolean isRead, boolean isWrite, boolean isExec) { - this.index = index; - this.vmaStart = vmaStart; - this.vmaEnd = vmaEnd; - this.allocationBase = allocationBase; - this.state = state; - this.type = type; - this.allocationProtect = List.copyOf(allocationProtect); - this.protect = List.copyOf(protect); - this.isRead = isRead; - this.isWrite = isWrite; - this.isExec = isExec; - this.hashcode = Objects.hash(vmaStart, vmaEnd, getState(), type, isRead, isWrite, isExec); - } - - @Override - public String getName() { - return index; - } - - @Override - public Long getId() { - return vmaStart; - } - - @Override - public long getVmaStart() { - return vmaStart; - } - - @Override - public long getVmaEnd() { - return vmaEnd; - } - - @Override - public long getAllocationBase() { - return allocationBase; - } - - @Override - public List getAllocationProtect() { - return allocationProtect; - } - - @Override - public List getProtect() { - return protect; - } - - @Override - public String getState() { - return state.toString(); - } - - @Override - public String getType() { - return type; - } - - public boolean isRead() { - return isRead; - } - - public boolean isWrite() { - return isWrite; - } - - public boolean isExec() { - return isExec; - } - - @Override - public int hashCode() { - return hashcode; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (!(obj instanceof DbgModuleMemory)) { - return false; - } - DbgModuleMemory that = (DbgModuleMemory) obj; - if (this.getVmaStart() != that.getVmaStart()) { - return false; - } - if (this.getVmaEnd() != that.getVmaEnd()) { - return false; - } - if (!this.getState().equals(that.getState())) { - return false; - } - if (!this.getType().equals(that.getType())) { - return false; - } - if (this.isRead() != that.isRead()) { - return false; - } - if (this.isWrite() != that.isWrite()) { - return false; - } - if (this.isExec() != that.isExec()) { - return false; - } - return true; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgProcessImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgProcessImpl.java deleted file mode 100644 index 95677abd9f..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgProcessImpl.java +++ /dev/null @@ -1,413 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.impl; - -import static ghidra.async.AsyncUtils.sequence; - -import java.nio.ByteBuffer; -import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.function.Function; -import java.util.function.Supplier; - -import agent.dbgeng.dbgeng.*; -import agent.dbgeng.dbgeng.DebugClient.DebugAttachFlags; -import agent.dbgeng.manager.*; -import agent.dbgeng.manager.DbgManager.ExecSuffix; -import agent.dbgeng.manager.cmd.*; -import generic.ULongSpan.ULongSpanSet; -import ghidra.async.TypeSpec; -import ghidra.comm.util.BitmaskSet; -import ghidra.dbg.target.TargetAttachable; -import ghidra.util.Msg; - -public class DbgProcessImpl implements DbgProcess { - - private final Map threads = new LinkedHashMap<>(); - private final Map unmodifiableThreads = - Collections.unmodifiableMap(threads); - - private final Map modules = new LinkedHashMap<>(); - private final Map unmodifiableModules = Collections.unmodifiableMap(modules); - - private final NavigableMap mappings = new TreeMap<>(); - private final NavigableMap unmodifiableMappings = - Collections.unmodifiableNavigableMap(mappings); - - private DbgManagerImpl manager; - private DebugProcessId id; - private Long pid; - private Long exitCode; - private Long offset; - private String name; - - /** - * Construct a new inferior - * - * @param manager the manager creating the process - * @param id the dbgeng-assigned process ID - */ - public DbgProcessImpl(DbgManagerImpl manager, DebugProcessId id, long pid, String name) { - this.manager = manager; - this.id = id; - this.pid = pid; - this.name = name; - } - - public DbgProcessImpl(DbgManagerImpl manager, DebugProcessId id, long pid) { - this.manager = manager; - this.id = id; - this.pid = pid; - } - - public DbgProcessImpl(DbgManagerImpl manager) { - this.manager = manager; - } - - @Override - public String toString() { - return ""; - } - - @Override - public DebugProcessId getId() { - return id; - } - - public void setId(DebugProcessId id) { - this.id = id; - } - - @Override - public Long getPid() { - return pid; - } - - /** - * Set the exit code - * - * @param exitCode the exit code (status or signal) - */ - public void setExitCode(Long exitCode) { - this.exitCode = exitCode; - } - - @Override - public Long getExitCode() { - return exitCode; - } - - /** - * Add this process to the manager's list of processes, because of a given cause - * - * @param cause the cause of the new inferior - */ - public void add() { - manager.processes.put(id, this); - //manager.getEventListeners().fire.processAdded(this, DbgCause.Causes.UNCLAIMED); - //manager.addProcess(this, cause); - } - - /** - * Remove this process from the manager's list of processes, because of a given cause - * - * @param cause the cause of removal - */ - public void remove(DbgCause cause) { - manager.removeProcess(id, cause); - } - - @Override - public CompletableFuture remove() { - return manager.removeProcess(this); - } - - /** - * Use {@link DbgThreadImpl#add()} instead - * - * @param thread the thread to add - */ - public void addThread(DbgThreadImpl thread) { - assert(thread.getProcess().equals(this)); - DbgThreadImpl exists = threads.get(thread.getId()); - if (exists != null) { - Msg.warn(this, "Adding pre-existing thread " + exists); - //throw new IllegalArgumentException("There is already thread " + exists); - } - threads.put(thread.getId(), thread); - - } - - @Override - public DbgThreadImpl getThread(DebugThreadId tid) { - DbgThreadImpl result = threads.get(tid); - if (result == null) { - throw new IllegalArgumentException("There is no thread with id " + tid); - } - return result; - } - - /** - * Use {@link DbgThreadImpl#remove()} instead - * - * @param tid the ID of the thread to remove - */ - public void removeThread(DebugThreadId tid) { - if (threads.remove(tid) == null) { - throw new IllegalArgumentException("There is no thread with id " + tid); - } - } - - /** - * Use {@link DbgModuleImpl#add()} instead - * - * @param module the thread to add - */ - public void addModule(DbgModuleImpl module) { - DbgModuleImpl exists = modules.get(module.getInfo().toString()); - if (exists != null) { - throw new IllegalArgumentException("There is already module " + exists); - } - modules.put(module.getInfo().toString(), module); - - } - - @Override - public DbgModuleImpl getModule(String id) { - DbgModuleImpl result = modules.get(id); - if (result == null) { - throw new IllegalArgumentException("There is no module with id " + id); - } - return result; - } - - /** - * Use {@link DbgModulesImpl#remove()} instead - * - * @param id the ID of the thread to remove - */ - public void removeModule(String id) { - if (modules.remove(id) == null) { - throw new IllegalArgumentException("There is no module with id " + id); - } - } - - @Override - public Map getKnownThreads() { - return unmodifiableThreads; - } - - public Map getKnownThreadsImpl() { - return threads; - } - - @Override - public CompletableFuture> listThreads() { - if (manager.isKernelMode() && !id.isSystem()) { - return CompletableFuture.completedFuture(getKnownThreads()); - } - return manager.execute(new DbgListThreadsCommand(manager, this)); - } - - @Override - public Map getKnownModules() { - return unmodifiableModules; - } - - @Override - public CompletableFuture> listModules() { - return manager.execute(new DbgListModulesCommand(manager, this)); - } - - @Override - public Map getKnownMappings() { - return unmodifiableMappings; - } - - @Override - public CompletableFuture> listMappings() { - return manager.execute(new DbgListMappingsCommand(manager, this)); - } - - @Override - public CompletableFuture setActive() { - return manager.setActiveProcess(this); - } - - @Override - public CompletableFuture fileExecAndSymbols(String file) { - return sequence(TypeSpec.VOID).then((seq) -> { - setActive().handle(seq::next); - }).then((seq) -> { - manager.execute(new DbgFileExecAndSymbolsCommand(manager, file)).handle(seq::exit); - }).finish(); - } - - @Override - public CompletableFuture run() { - return sequence(TypeSpec.cls(DbgThread.class)).then((seq) -> { - setActive().handle(seq::next); - }).then((seq) -> { - manager.execute(new DbgRunCommand(manager)).handle(seq::exit); - }).finish(); - } - - @Override - public CompletableFuture> attach(long toPid) { - return sequence(TypeSpec.cls(DbgThread.class).set()).then((seq) -> { - setActive().handle(seq::next); - }).then((seq) -> { - id = new DebugProcessRecord(toPid); - pid = toPid; // TODO: Wait for successful completion? - manager.execute( - new DbgAttachCommand(manager, this, BitmaskSet.of(DebugAttachFlags.DEFAULT))) - .handle(seq::exit); - }).finish(); - } - - @Override - public CompletableFuture> reattach(TargetAttachable attachable) { - return sequence(TypeSpec.cls(DbgThread.class).set()).then((seq) -> { - setActive().handle(seq::next); - }).then((seq) -> { - manager.execute( - new DbgAttachCommand(manager, this, BitmaskSet.of(DebugAttachFlags.EXISTING))) - .handle(seq::exit); - }).finish(); - } - - @Override - public CompletableFuture detach() { - return sequence(TypeSpec.VOID).then((seq) -> { - setActive().handle(seq::next); - }).then((seq) -> { - manager.execute(new DbgDetachCommand(manager, this)).handle(seq::exit); - }).finish(); - } - - @Override - public CompletableFuture kill() { - return sequence(TypeSpec.VOID).then((seq) -> { - setActive().handle(seq::next); - }).then((seq) -> { - manager.execute(new DbgKillCommand(manager)).handle(seq::exit); - }).finish(); - } - - @Override - public CompletableFuture cont() { - return sequence(TypeSpec.VOID).then((seq) -> { - setActive().handle(seq::next); - }).then((seq) -> { - manager.execute(new DbgContinueCommand(manager)).handle(seq::exit); - }).finish(); - } - - @Override - public CompletableFuture step(ExecSuffix suffix) { - return sequence(TypeSpec.VOID).then((seq) -> { - setActive().handle(seq::next); - }).then((seq) -> { - manager.execute(new DbgStepCommand(manager, null, suffix)).handle(seq::exit); - }).finish(); - } - - @Override - public CompletableFuture step(Map args) { - return sequence(TypeSpec.VOID).then((seq) -> { - setActive().handle(seq::next); - }).then((seq) -> { - manager.execute(new DbgStepCommand(manager, null, args)).handle(seq::exit); - }).finish(); - } - - protected CompletableFuture preferThread( - Function> viaThread, - Supplier> viaThis) { - Optional first = threads.values().stream().findFirst(); - if (first.isPresent()) { - return viaThread.apply(first.get()); - } - return setActive().thenCompose(__ -> viaThis.get()); - } - - @Override - public CompletableFuture readMemory(long addr, ByteBuffer buf, int len) { - // I can't imagine this working without a thread.... - return preferThread(t -> t.readMemory(addr, buf, len), - () -> manager.execute(new DbgReadMemoryCommand(manager, addr, buf, len))); - } - - @Override - public CompletableFuture writeMemory(long addr, ByteBuffer buf, int len) { - // I can't imagine this working without a thread.... - return preferThread(t -> t.writeMemory(addr, buf, len), - () -> manager.execute(new DbgWriteMemoryCommand(manager, addr, buf, len))); - } - - @Override - public CompletableFuture consoleCapture(String command) { - // TODO Auto-generated method stub - return null; - } - - protected void moduleLoaded(DebugModuleInfo info) { - if (!modules.containsKey(info.getModuleName())) { - DbgModuleImpl module = new DbgModuleImpl(manager, this, info); - modules.put(info.toString(), module); - } - } - - protected void moduleUnloaded(DebugModuleInfo info) { - modules.remove(info.toString()); - } - - protected void threadCreated(DbgThreadImpl thread) { - threads.put(thread.getId(), thread); - } - - public void threadExited(DebugThreadId id) { - threads.remove(id); - } - - @Override - public CompletableFuture evaluate(String expression) { - return manager.execute(new DbgEvaluateCommand(manager, expression)); - } - - public Long getOffset() { - return offset; - } - - public void setOffset(long offset) { - this.offset = offset; - } - - public void setPid(Long pid) { - this.pid = pid; - } - - @Override - public String getExecutableName() { - return name; - } - - @Override - public void setExecutableName(String name) { - this.name = name; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgRegister.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgRegister.java deleted file mode 100644 index dbb58764c7..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgRegister.java +++ /dev/null @@ -1,89 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.impl; - -import agent.dbgeng.dbgeng.DebugRegisters.DebugRegisterDescription; - -public class DbgRegister implements Comparable { - private final String name; - private final int number; - private final int size; - private DebugRegisterDescription desc; - - /** - * Construct a new register descriptor - * - * @param name the register's name - * @param number the dbgeng-assigned register number - * @param size the size in bytes - */ - public DbgRegister(String name, int number, int size) { - this.name = name; - this.number = number; - this.size = size; - } - - public DbgRegister(DebugRegisterDescription desc) { - this.name = desc.name; - this.number = desc.index; - this.size = desc.type.byteLength; - this.desc = desc; - } - - /** - * Get the register's name - * - * @return the name - */ - public String getName() { - return name; - } - - /** - * Get the register's Dbg-assigned number - * - * @return the number - */ - public int getNumber() { - return number; - } - - /** - * Get the register's size in bytes - * - * @return the size - */ - public int getSize() { - return size; - } - - @Override - public int compareTo(DbgRegister that) { - return this.number - that.number; - } - - @Override - public String toString() { - return "<" + getClass().getSimpleName() + " " + name + " (" + number + ")>"; - } - - public boolean isBaseRegister() { - if (desc == null) { - return true; - } - return desc.subregMask == 0; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgRegisterSet.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgRegisterSet.java deleted file mode 100644 index a66afa11b9..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgRegisterSet.java +++ /dev/null @@ -1,68 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.impl; - -import java.util.*; - -public class DbgRegisterSet extends AbstractSet { - private final Map byName = new HashMap<>(); - private final Map byNumber = new TreeMap<>(); - - /** - * Construct a set from the given collection - * - * Note that regs need not be presented in any particular order; however, there must be at most - * one register per number. Otherwise, there may be undefined behavior. - * - * @param regs the registers to index - */ - public DbgRegisterSet(Collection regs) { - for (DbgRegister r : regs) { - byName.put(r.getName(), r); - byNumber.put(r.getNumber(), r); - } - } - - /** - * Get a register by name - * - * @param name the name - * @return the register - */ - public DbgRegister get(String name) { - return byName.get(name); - } - - /** - * Get a register by number - * - * @param number the number - * @return the register - */ - public DbgRegister get(int number) { - return byNumber.get(number); - } - - @Override - public Iterator iterator() { - return byNumber.values().iterator(); - } - - @Override - public int size() { - return byNumber.size(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgSectionImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgSectionImpl.java deleted file mode 100644 index b0e6fdbfe8..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgSectionImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.impl; - -public class DbgSectionImpl { - private final long start; - private final long end; - private final long size; - private final long offset; - private final String objfile; - - public DbgSectionImpl(long start, long end, long size, long offset, String objfile) { - this.start = start; - this.end = end; - this.size = size; - this.offset = offset; - this.objfile = objfile; - - assert start + size == end; - } - - public long getStart() { - return start; - } - - public long getEnd() { - return end; - } - - public long getSize() { - return size; - } - - public long getOffset() { - return offset; - } - - public String getObjfile() { - return objfile; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgSessionImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgSessionImpl.java deleted file mode 100644 index 9a27eaf9c6..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgSessionImpl.java +++ /dev/null @@ -1,154 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.impl; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.dbgeng.DebugProcessId; -import agent.dbgeng.dbgeng.DebugSessionId; -import agent.dbgeng.manager.*; -import agent.dbgeng.manager.cmd.DbgListProcessesCommand; - -public class DbgSessionImpl implements DbgSession { - - private final Map processes = new LinkedHashMap<>(); - private final Map unmodifiableProcesses = - Collections.unmodifiableMap(processes); - - private DbgManagerImpl manager; - private DebugSessionId id; - private Long exitCode; - - /** - * Construct a new session - * - * @param manager the manager creating the session - * @param id the dbgeng-assigned session ID - */ - public DbgSessionImpl(DbgManagerImpl manager, DebugSessionId id) { - this.manager = manager; - this.id = id; - } - - public DbgSessionImpl(DbgManagerImpl manager) { - this.manager = manager; - } - - @Override - public String toString() { - return ""; - } - - @Override - public DebugSessionId getId() { - return id; - } - - public void setId(DebugSessionId id) { - this.id = id; - } - - /** - * Set the exit code - * - * @param exitCode the exit code (status or signal) - */ - public void setExitCode(Long exitCode) { - this.exitCode = exitCode; - } - - @Override - public Long getExitCode() { - return exitCode; - } - - /** - * Add this process to the manager's list of processes, because of a given cause - * - * @param cause the cause of the new inferior - */ - public void add() { - manager.sessions.put(id, this); - //manager.getEventListeners().fire.sessionAdded(this, DbgCause.Causes.UNCLAIMED); - //manager.addSession(this, cause); - } - - /** - * Remove this process from the manager's list of processes, because of a given cause - * - * @param cause the cause of removal - */ - public void remove(DbgCause cause) { - manager.removeSession(id, cause); - } - - /** - * Use {@link DbgSessionImpl#add()} instead - * - * @param process the process to add - */ - public void addProcess(DbgProcessImpl process) { - DbgProcessImpl exists = processes.get(process.getId()); - if (exists != null) { - throw new IllegalArgumentException("There is already process " + exists); - } - processes.put(process.getId(), process); - - } - - @Override - public DbgProcessImpl getProcess(DebugProcessId tid) { - DbgProcessImpl result = processes.get(tid); - if (result == null) { - throw new IllegalArgumentException("There is no thread with id " + tid); - } - return result; - } - - /** - * Use {@link DbgProcessImpl#remove()} instead - * - * @param pid the ID of the thread to remove - */ - public void removeProcess(DebugProcessId pid) { - if (processes.remove(pid) == null) { - throw new IllegalArgumentException("There is no process with id " + pid); - } - } - - @Override - public Map getKnownProcesses() { - return unmodifiableProcesses; - } - - public Map getKnownProcessImpl() { - return processes; - } - - @Override - public CompletableFuture> listProcesses() { - return manager.execute(new DbgListProcessesCommand(manager)); - } - - protected void processCreated(DbgProcessImpl process) { - processes.put(process.getId(), process); - } - - public void processExited(DebugProcessId id) { - processes.remove(id); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgStackFrameImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgStackFrameImpl.java deleted file mode 100644 index e26f5614d6..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgStackFrameImpl.java +++ /dev/null @@ -1,162 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.impl; - -import java.math.BigInteger; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.manager.DbgStackFrame; -import agent.dbgeng.manager.cmd.*; -import ghidra.async.AsyncUtils; -import ghidra.async.TypeSpec; - -public class DbgStackFrameImpl implements DbgStackFrame { - - protected final DbgManagerImpl manager; - protected final DbgThreadImpl thread; - protected final int level; - protected final BigInteger addr; - protected final String func; - private long funcTableEntry; - private long frameOffset; - private long returnOffset; - private long stackOffset; - private boolean virtual; - - private long params[] = new long[4]; - - public DbgStackFrameImpl(DbgThreadImpl thread, int level, BigInteger addr, String func) { - this.manager = thread.manager; - this.thread = thread; - this.level = level; - this.addr = addr; - this.func = func; - } - - public DbgStackFrameImpl(DbgThreadImpl thread, int level, BigInteger addr, long funcTableEntry, - long frameOffset, long returnOffset, long stackOffset, boolean virtual, long param0, - long param1, long param2, long param3) { - this.manager = thread.manager; - this.thread = thread; - this.level = level; - this.addr = addr; - this.func = null; - this.funcTableEntry = funcTableEntry; - this.frameOffset = frameOffset; - this.returnOffset = returnOffset; - this.stackOffset = stackOffset; - this.virtual = virtual; - this.params[0] = param0; - this.params[1] = param1; - this.params[2] = param2; - this.params[3] = param3; - } - - @Override - public String toString() { - return ""; - } - - @Override - public int getLevel() { - return level; - } - - @Override - public BigInteger getAddress() { - return addr; - } - - @Override - public String getFunction() { - return func; - } - - @Override - public DbgThreadImpl getThread() { - return thread; - } - - @Override - public long getFuncTableEntry() { - return funcTableEntry; - } - - @Override - public long getFrameOffset() { - return frameOffset; - } - - @Override - public long getReturnOffset() { - return returnOffset; - } - - @Override - public long getStackOffset() { - return stackOffset; - } - - @Override - public boolean getVirtual() { - return virtual; - } - - @Override - public long[] getParams() { - return params; - } - - @Override - public CompletableFuture setActive() { - return thread.setActive(); - } - - @Override - public CompletableFuture evaluate(String expression) { - return manager.execute(new DbgEvaluateCommand(manager, expression)); - } - - @Override - public CompletableFuture> readRegisters(Set regs) { - return AsyncUtils.sequence(TypeSpec.map(DbgRegister.class, BigInteger.class)).then(seq -> { - manager.execute(new DbgReadRegistersCommand(manager, thread, level, regs)) - .handle(seq::exit); - }).finish(); - } - - @Override - public CompletableFuture writeRegisters(Map regVals) { - return manager.execute(new DbgWriteRegistersCommand(manager, thread, level, regVals)); - } - - @Override - public CompletableFuture console(String command) { - return manager - .execute(new DbgConsoleExecCommand(manager, command, - DbgConsoleExecCommand.Output.CONSOLE)) - .thenApply(e -> null); - } - - @Override - public CompletableFuture consoleCapture(String command) { - return manager.execute( - new DbgConsoleExecCommand(manager, command, DbgConsoleExecCommand.Output.CAPTURE)); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgThreadImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgThreadImpl.java deleted file mode 100644 index 229c5f52cf..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/impl/DbgThreadImpl.java +++ /dev/null @@ -1,301 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.impl; - -import java.math.BigInteger; -import java.nio.ByteBuffer; -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.dbgeng.DebugEventInformation; -import agent.dbgeng.dbgeng.DebugRegisters.DebugRegisterDescription; -import agent.dbgeng.dbgeng.DebugThreadId; -import agent.dbgeng.jna.dbgeng.WinNTExtra; -import agent.dbgeng.jna.dbgeng.WinNTExtra.Machine; -import agent.dbgeng.manager.*; -import agent.dbgeng.manager.DbgManager.ExecSuffix; -import agent.dbgeng.manager.breakpoint.DbgBreakpointInfo; -import agent.dbgeng.manager.breakpoint.DbgBreakpointType; -import agent.dbgeng.manager.cmd.*; -import generic.ULongSpan.ULongSpanSet; -import ghidra.async.AsyncLazyValue; -import ghidra.async.AsyncReference; -import ghidra.util.Msg; - -public class DbgThreadImpl implements DbgThread { - - DbgManagerImpl manager; - private DbgProcessImpl process; - private DebugThreadId id; - private Long tid; - private DebugEventInformation info; - private Long offset; - - private final AsyncReference state = - new AsyncReference<>(DbgState.STOPPED); - - private final AsyncLazyValue registers = - new AsyncLazyValue<>(this::doListRegisters); - - /** - * Construct a new thread - * - * @param manager the manager creating the thread - * @param process the process to which the thread belongs - * @param id the dbgeng-assigned thread ID - */ - public DbgThreadImpl(DbgManagerImpl manager, DbgProcessImpl process, DebugThreadId id, - long tid) { - this.manager = manager; - this.process = process; - this.id = id; - this.tid = tid; - } - - @Override - public String toString() { - return ""; - } - - @Override - public DebugThreadId getId() { - return id; - } - - @Override - public DbgProcess getProcess() { - return process; - } - - @Override - public Long getTid() { - return tid; - } - - /** - * Add this thread to the inferior and manager - */ - public void add() { - manager.threads.put(id, this); - //manager.getEventListeners().fire.threadCreated(this, DbgCause.Causes.UNCLAIMED); - process.addThread(this); - state.addChangeListener((oldState, newState, pair) -> { - this.manager.getEventListeners().invoke().threadStateChanged(this, newState, pair.cause, - pair.reason); - }); - } - - /** - * Remove this thread from the inferior and manager - */ - public void remove() { - try { - process.removeThread(id); - manager.removeThread(id); - } - catch (IllegalArgumentException e) { - Msg.warn(this, "Thread " + id + " already removed"); - } - } - - @Override - public DbgState getState() { - return state.get(); - } - - /** - * Set the state of this thread - * - * @param state the new state - * @param cause the cause for the change - * @param reason the reason (usually a stop reason) for the change - * @return true if the state actually changed - */ - @Override - public boolean setState(DbgState state, DbgCause cause, DbgReason reason) { - return this.state.set(state, new CauseReasonPair(cause, reason)); - } - - @Override - public CompletableFuture setActive() { - return manager.setActiveThread(this); - } - - @Override - public CompletableFuture evaluate(String expression) { - return manager.execute(new DbgEvaluateCommand(manager, expression)); - } - - @Override - // TODO: Is this per thread or per inferior? - public CompletableFuture listRegisters() { - return registers.request(); - } - - private CompletableFuture doListRegisters() { - CompletableFuture> listCmd = - manager.execute(new DbgListRegisterDescriptionsCommand(manager)); - return listCmd.thenApply(descs -> { - if (descs == null) { - return new DbgRegisterSet(Set.of()); - } - List regs = new ArrayList<>(); - for (DebugRegisterDescription desc : descs) { - regs.add(new DbgRegister(desc)); - } - return new DbgRegisterSet(regs); - }); - } - - @Override - public CompletableFuture> listStackFrames() { - return manager.execute(new DbgStackListFramesCommand(manager, this)); - } - - @Override - public CompletableFuture> readRegisters(Set regs) { - return manager.execute(new DbgReadRegistersCommand(manager, this, null, regs)); - } - - @Override - public CompletableFuture writeRegisters(Map regVals) { - return manager.execute(new DbgWriteRegistersCommand(manager, this, null, regVals)); - } - - @Override - public CompletableFuture readMemory(long addr, ByteBuffer buf, int len) { - return manager.execute(new DbgReadMemoryCommand(manager, addr, buf, len)); - } - - @Override - public CompletableFuture writeMemory(long addr, ByteBuffer buf, int len) { - return manager.execute(new DbgWriteMemoryCommand(manager, addr, buf, len)); - } - - @Override - public CompletableFuture insertBreakpoint(long loc, int len, - DbgBreakpointType type) { - return manager.execute(new DbgInsertBreakpointCommand(manager, loc, len, type)); - } - - @Override - public CompletableFuture console(String command) { - return manager - .execute(new DbgConsoleExecCommand(manager, command, - DbgConsoleExecCommand.Output.CONSOLE)) - .thenApply(e -> null); - } - - @Override - public CompletableFuture consoleCapture(String command) { - return manager.execute( - new DbgConsoleExecCommand(manager, command, DbgConsoleExecCommand.Output.CAPTURE)); - } - - @Override - public CompletableFuture cont() { - return setActive().thenCompose(__ -> { - return manager.execute(new DbgContinueCommand(manager)); - }); - } - - @Override - public CompletableFuture step(ExecSuffix suffix) { - return setActive().thenCompose(__ -> { - return manager.execute(new DbgStepCommand(manager, id, suffix)); - }); - } - - @Override - public CompletableFuture step(Map args) { - return setActive().thenCompose(__ -> { - return manager.execute(new DbgStepCommand(manager, id, args)); - }); - } - - @Override - public CompletableFuture stepToAddress(String address) { - return setActive().thenCompose(__ -> { - return manager.execute(new DbgStepToAddressCommand(manager, id, address)); - }); - } - - @Override - public CompletableFuture traceToAddress(String address) { - return setActive().thenCompose(__ -> { - return manager.execute(new DbgTraceToAddressCommand(manager, id, address)); - }); - } - - @Override - public CompletableFuture kill() { - return setActive().thenCompose(__ -> { - return manager.execute(new DbgKillCommand(manager)); - }); - } - - @Override - public CompletableFuture detach() { - return setActive().thenCompose(__ -> { - return manager.execute(new DbgDetachCommand(manager, process)); - }); - } - - public DebugEventInformation getInfo() { - return info; - } - - public void setInfo(DebugEventInformation info) { - Machine newType = WinNTExtra.Machine.getByNumber(info.getExecutingProcessorType()); - Machine oldType = getExecutingProcessorType(); - if (!newType.equals(oldType)) { - registers.forget(); - } - this.info = info; - } - - private static class CauseReasonPair { - private final DbgCause cause; - private final DbgReason reason; - - CauseReasonPair(DbgCause cause, DbgReason reason) { - this.cause = cause; - this.reason = reason; - } - } - - @Override - public Machine getExecutingProcessorType() { - if (info == null) { - return WinNTExtra.Machine.IMAGE_FILE_MACHINE_AMD64; - } - int executingProcessorType = info.getExecutingProcessorType(); - return WinNTExtra.Machine.getByNumber(executingProcessorType); - } - - public Long getOffset() { - return offset; - } - - public void setOffset(long offset) { - this.offset = offset; - } - - public void setTid(Long tid) { - this.tid = tid; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/reason/DbgEndSteppingRangeReason.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/reason/DbgEndSteppingRangeReason.java deleted file mode 100644 index 0cf0c5cac0..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/reason/DbgEndSteppingRangeReason.java +++ /dev/null @@ -1,34 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.reason; - -import java.util.Map; - -import agent.dbgeng.manager.DbgReason; - -/** - * The inferior stopped because it finished stepping - */ -public class DbgEndSteppingRangeReason implements DbgReason { - public DbgEndSteppingRangeReason(Map info) { - // Nothing additional to parse - } - - @Override - public String desc() { - return "Stepping ended"; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/reason/DbgExitNormallyReason.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/reason/DbgExitNormallyReason.java deleted file mode 100644 index 0d05f231b4..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/reason/DbgExitNormallyReason.java +++ /dev/null @@ -1,34 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.reason; - -import java.util.Map; - -import agent.dbgeng.manager.DbgReason; - -/** - * The inferior stopped because it has exited (with status 0) - */ -public class DbgExitNormallyReason implements DbgReason { - public DbgExitNormallyReason(Map info) { - // Nothing additional to parse - } - - @Override - public String desc() { - return "Exited normally"; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/reason/DbgExitedReason.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/reason/DbgExitedReason.java deleted file mode 100644 index a25a13110f..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/reason/DbgExitedReason.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.reason; - -import java.util.Map; - -import agent.dbgeng.manager.DbgReason; - -/** - * The inferior stopped because it has exited - */ -public class DbgExitedReason implements DbgReason { - private final int exitCode; - - public DbgExitedReason(Map info) { - this.exitCode = Integer.parseInt((String) info.get("exit-code")); - } - - /** - * Get the exit code of the inferior - * - * @return the exit code - */ - public int getExitCode() { - return exitCode; - } - - @Override - public String desc() { - return "Exited with code " + exitCode; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/reason/DbgSignalReceivedReason.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/reason/DbgSignalReceivedReason.java deleted file mode 100644 index ace93471b3..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/manager/reason/DbgSignalReceivedReason.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.reason; - -import java.util.Map; - -import agent.dbgeng.manager.DbgReason; - -/** - * The inferior stopped because it has received a signal - */ -public class DbgSignalReceivedReason implements DbgReason { - private final String signalName; - - public DbgSignalReceivedReason(Map info) { - this.signalName = (String) info.get("signal-name"); - } - - /** - * Get the (POSIX) name of the signal received - * - * @return the signal name - */ - public String getSignalName() { - return signalName; - } - - @Override - public String desc() { - return "Signalled with " + getSignalName(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/AbstractDbgModel.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/AbstractDbgModel.java deleted file mode 100644 index 0cc494fd98..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/AbstractDbgModel.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model; - -import java.io.IOException; -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.manager.DbgManager; -import agent.dbgeng.model.iface2.DbgModelTargetSession; -import ghidra.dbg.agent.AbstractDebuggerObjectModel; -import ghidra.dbg.target.TargetObject; -import ghidra.program.model.address.AddressFactory; - -public abstract class AbstractDbgModel extends AbstractDebuggerObjectModel { - - public abstract DbgManager getManager(); - - public abstract CompletableFuture startDbgEng(String[] args); - - public abstract boolean isRunning(); - - public abstract void terminate() throws IOException; - - public abstract AddressFactory getAddressFactory(); - - public abstract DbgModelTargetSession getSession(); - - public abstract void addModelObject(Object object, TargetObject targetObject); - - public abstract TargetObject getModelObject(Object object); - - public abstract void deleteModelObject(Object object); - - public abstract boolean isSuppressDescent(); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelSelectableObject.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelSelectableObject.java deleted file mode 100644 index cdc74fa96d..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelSelectableObject.java +++ /dev/null @@ -1,62 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface1; - -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.manager.DbgProcess; -import agent.dbgeng.manager.DbgThread; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgeng.model.iface2.*; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; - -@TargetObjectSchemaInfo( - name = "Selectable", - attributes = { - @TargetAttributeType(type = Void.class) }) -public interface DbgModelSelectableObject extends DbgModelTargetObject { - - public default CompletableFuture setActive() { - if (this instanceof DbgModelTargetSession) { - DbgManagerImpl manager = getManager(); - DbgProcess process = manager.getCurrentProcess(); - return process.setActive(); - } - if (this instanceof DbgModelTargetProcess) { - DbgModelTargetProcess tp = (DbgModelTargetProcess) this; - DbgProcess process = tp.getProcess(); - return process.setActive(); - } - if (this instanceof DbgModelTargetThread) { - DbgModelTargetThread tt = (DbgModelTargetThread) this; - DbgThread thread = tt.getThread(); - return thread.setActive(); - } - if (this instanceof DbgModelTargetStackFrame) { - DbgModelTargetStackFrame tf = (DbgModelTargetStackFrame) this; - TargetObject ref = tf.getParentThread(); - if (ref instanceof DbgModelTargetThread) { - DbgModelTargetThread tt = (DbgModelTargetThread) ref; - DbgThread thread = tt.getThread(); - return thread.setActive(); - } - } - return CompletableFuture.completedFuture(null); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetAccessConditioned.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetAccessConditioned.java deleted file mode 100644 index 543af41e1f..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetAccessConditioned.java +++ /dev/null @@ -1,36 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface1; - -import agent.dbgeng.model.iface2.DbgModelTargetObject; -import ghidra.dbg.target.TargetAccessConditioned; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface DbgModelTargetAccessConditioned - extends DbgModelTargetObject, TargetAccessConditioned { - - @Override - public boolean isAccessible(); - - public void setAccessible(boolean accessible); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetActiveScope.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetActiveScope.java deleted file mode 100644 index 6aa31e22ea..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetActiveScope.java +++ /dev/null @@ -1,68 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface1; - -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.model.iface2.DbgModelTargetObject; -import ghidra.async.AsyncUtils; -import ghidra.dbg.error.DebuggerIllegalArgumentException; -import ghidra.dbg.target.TargetActiveScope; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.util.PathUtils; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface DbgModelTargetActiveScope extends DbgModelTargetObject, TargetActiveScope { - - // NB: requesActivation request change in active object - propagates down to manager - // (but, of course, may then cause change in state) - @Override - public default CompletableFuture requestActivation(TargetObject obj) { - return getModel().gateFuture(getManager().requestActivation(this, obj)); - } - - public default CompletableFuture doRequestActivation(TargetObject obj) { - if (getManager().isWaiting()) { - return AsyncUtils.nil(); - } - getModel().assertMine(TargetObject.class, obj); - if (!PathUtils.isAncestor(this.getPath(), obj.getPath())) { - throw new DebuggerIllegalArgumentException("Can only focus a successor of the scope"); - } - TargetObject cur = obj; - while (cur != null) { - if (cur instanceof DbgModelSelectableObject) { - DbgModelSelectableObject sel = (DbgModelSelectableObject) cur; - //System.err.println("requestActivation " + obj); - return sel.setActive(); - } - if (cur instanceof DbgModelTargetObject) { - DbgModelTargetObject def = (DbgModelTargetObject) cur; - cur = def.getParent(); - continue; - } - throw new AssertionError(); - } - return AsyncUtils.nil(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetAttachable.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetAttachable.java deleted file mode 100644 index b83e0921db..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetAttachable.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface1; - -import agent.dbgeng.model.iface2.DbgModelTargetObject; -import ghidra.dbg.target.TargetAttachable; - -/** - * An interface which indicates this object is capable of launching targets. - * - *

- * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface DbgModelTargetAttachable extends DbgModelTargetObject, TargetAttachable { - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetAttacher.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetAttacher.java deleted file mode 100644 index bcc40d1823..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetAttacher.java +++ /dev/null @@ -1,60 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface1; - -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.manager.DbgProcess; -import agent.dbgeng.manager.impl.DbgProcessImpl; -import agent.dbgeng.model.iface2.DbgModelTargetAvailable; -import agent.dbgeng.model.iface2.DbgModelTargetObject; -import ghidra.dbg.target.TargetAttachable; -import ghidra.dbg.target.TargetAttacher; -import ghidra.util.Msg; - -/** - * An interface which indicates this object is capable of launching targets. - * - *

- * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface DbgModelTargetAttacher extends DbgModelTargetObject, TargetAttacher { - - @Override - public default CompletableFuture attach(TargetAttachable attachable) { - DbgModelTargetAvailable available = - getModel().assertMine(DbgModelTargetAvailable.class, attachable); - // TODO: This and the below new DbgProcessImpl seem to do the same thing - // Both should be expressed the same way - return getModel().gateFuture(getManager().addProcess().thenCompose(process -> { - return process.attach(available.getPid()); - }).exceptionally(exc -> { - Msg.error(this, "attach failed"); - return null; - })).thenApply(__ -> null); - } - - @Override - public default CompletableFuture attach(long pid) { - DbgProcess process = new DbgProcessImpl(getManager()); - return getModel().gateFuture(process.attach(pid).exceptionally(exc -> { - Msg.error(this, "attach failed"); - return null; - })).thenApply(__ -> null); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetBptHelper.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetBptHelper.java deleted file mode 100644 index 227b69c61e..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetBptHelper.java +++ /dev/null @@ -1,44 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface1; - -import agent.dbgeng.manager.breakpoint.DbgBreakpointInfo; -import agent.dbgeng.model.iface2.DbgModelTargetObject; -import ghidra.dbg.target.TargetBreakpointSpec.TargetBreakpointAction; -import ghidra.util.datastruct.ListenerSet; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface DbgModelTargetBptHelper extends DbgModelTargetObject { - - public DbgBreakpointInfo getBreakpointInfo(); - - public void setBreakpointId(String id); - - public void setBreakpointInfo(DbgBreakpointInfo info); - - public boolean isBreakpointEnabled(); - - public void setBreakpointEnabled(boolean enabled); - - public ListenerSet getActions(); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetConfigurable.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetConfigurable.java deleted file mode 100644 index 5d0101239a..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetConfigurable.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface1; - -import agent.dbgeng.model.iface2.DbgModelTargetObject; -import ghidra.dbg.target.TargetConfigurable; - -/** - * An interface which indicates this object is configurable. - * - * @param type for this - */ -public interface DbgModelTargetConfigurable extends DbgModelTargetObject, TargetConfigurable { - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetDeletable.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetDeletable.java deleted file mode 100644 index 15762e20d3..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetDeletable.java +++ /dev/null @@ -1,35 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface1; - -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.model.iface2.DbgModelTargetObject; -import ghidra.dbg.target.TargetDeletable; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface DbgModelTargetDeletable extends DbgModelTargetObject, TargetDeletable { - - @Override - public CompletableFuture delete(); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetDetachable.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetDetachable.java deleted file mode 100644 index bb7f05e0f3..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetDetachable.java +++ /dev/null @@ -1,39 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface1; - -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.manager.DbgProcess; -import agent.dbgeng.model.iface2.DbgModelTargetObject; -import ghidra.dbg.target.TargetDetachable; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface DbgModelTargetDetachable extends DbgModelTargetObject, TargetDetachable { - - @Override - public default CompletableFuture detach() { - DbgProcess process = getManager().getCurrentProcess(); - return getModel().gateFuture(process.detach()); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetEnvironment.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetEnvironment.java deleted file mode 100644 index f663282234..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetEnvironment.java +++ /dev/null @@ -1,40 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface1; - -import agent.dbgeng.model.iface2.DbgModelTargetObject; -import ghidra.dbg.target.TargetEnvironment; - -public interface DbgModelTargetEnvironment extends DbgModelTargetObject, TargetEnvironment { - - public void refreshInternal(); - - @Override - public default String getArchitecture() { - return getTypedAttributeNowByName(ARCH_ATTRIBUTE_NAME, String.class, ""); - } - - @Override - public default String getDebugger() { - return getTypedAttributeNowByName(DEBUGGER_ATTRIBUTE_NAME, String.class, ""); - } - - @Override - public default String getOperatingSystem() { - return getTypedAttributeNowByName(OS_ATTRIBUTE_NAME, String.class, ""); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetEventScope.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetEventScope.java deleted file mode 100644 index 8757bf92cc..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetEventScope.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface1; - -import agent.dbgeng.model.iface2.DbgModelTargetObject; -import ghidra.dbg.target.TargetEventScope; - -/** - * The object can emit events affecting itself and its successors - * - * @param type for this - */ -public interface DbgModelTargetEventScope extends DbgModelTargetObject, TargetEventScope { - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetExecutionStateful.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetExecutionStateful.java deleted file mode 100644 index 362d92f7b3..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetExecutionStateful.java +++ /dev/null @@ -1,53 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface1; - -import java.util.List; -import java.util.Map; - -import agent.dbgeng.manager.DbgState; -import agent.dbgeng.model.iface2.DbgModelTargetObject; -import ghidra.dbg.target.TargetExecutionStateful; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface DbgModelTargetExecutionStateful - extends DbgModelTargetObject, TargetExecutionStateful { - - public default TargetExecutionState convertState(DbgState state) { - switch (state) { - case RUNNING: - return TargetExecutionState.RUNNING; - case STOPPED: - default: - return TargetExecutionState.STOPPED; - } - } - - public default void setExecutionState(TargetExecutionState state, String reason) { - if (isValid()) { - changeAttributes(List.of(), Map.of( // - STATE_ATTRIBUTE_NAME, state // - ), reason); - } - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetFocusScope.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetFocusScope.java deleted file mode 100644 index 7fb117f50c..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetFocusScope.java +++ /dev/null @@ -1,78 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface1; - -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.model.iface2.DbgModelTargetObject; -import ghidra.async.AsyncUtils; -import ghidra.dbg.error.DebuggerIllegalArgumentException; -import ghidra.dbg.target.TargetFocusScope; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.util.PathUtils; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface DbgModelTargetFocusScope extends DbgModelTargetObject, TargetFocusScope { - - @Override - public DbgModelSelectableObject getFocus(); - - // NB: setFocus changes attributes - propagates up to client - public boolean setFocus(DbgModelSelectableObject sel); - - // NB: requestFocus request change in focused object - propagates down to manager - // (but, of course, may then cause change in state) - @Override - public default CompletableFuture requestFocus(TargetObject obj) { - return getModel().gateFuture(getManager().requestFocus(this, obj)); - } - - public default CompletableFuture doRequestFocus(TargetObject obj) { - if (getManager().isWaiting()) { - return AsyncUtils.nil(); - } - getModel().assertMine(TargetObject.class, obj); - if (obj.equals(getFocus())) { - return AsyncUtils.nil(); - } - if (!PathUtils.isAncestor(this.getPath(), obj.getPath())) { - throw new DebuggerIllegalArgumentException("Can only focus a successor of the scope"); - } - TargetObject cur = obj; - while (cur != null) { - if (cur instanceof DbgModelSelectableObject) { - DbgModelSelectableObject sel = (DbgModelSelectableObject) cur; - //System.err.println("requestFocus " + obj); - setFocus(sel); - return AsyncUtils.nil(); - } - if (cur instanceof DbgModelTargetObject) { - DbgModelTargetObject def = (DbgModelTargetObject) cur; - cur = def.getParent(); - continue; - } - throw new AssertionError(); - } - return AsyncUtils.nil(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetInterpreter.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetInterpreter.java deleted file mode 100644 index 353db9862c..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetInterpreter.java +++ /dev/null @@ -1,44 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface1; - -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.model.iface2.DbgModelTargetObject; -import ghidra.dbg.target.TargetInterpreter; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface DbgModelTargetInterpreter extends DbgModelTargetObject, TargetInterpreter { - - public static final String DBG_PROMPT = "(kd)"; - - @Override - public default CompletableFuture execute(String cmd) { - return getModel().gateFuture(getManager().console(cmd)); - } - - @Override - public default CompletableFuture executeCapture(String cmd) { - return getModel().gateFuture(getManager().consoleCapture(cmd)); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetInterruptible.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetInterruptible.java deleted file mode 100644 index 3c8778e593..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetInterruptible.java +++ /dev/null @@ -1,38 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface1; - -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.model.iface2.DbgModelTargetObject; -import ghidra.dbg.target.TargetInterruptible; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface DbgModelTargetInterruptible extends DbgModelTargetObject, TargetInterruptible { - - @Override - public default CompletableFuture interrupt() { - getManager().sendInterruptNow(); - return CompletableFuture.completedFuture(null); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetKillable.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetKillable.java deleted file mode 100644 index f73de76f39..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetKillable.java +++ /dev/null @@ -1,39 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface1; - -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.manager.DbgProcess; -import agent.dbgeng.model.iface2.DbgModelTargetObject; -import ghidra.dbg.target.TargetKillable; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface DbgModelTargetKillable extends DbgModelTargetObject, TargetKillable { - - @Override - public default CompletableFuture kill() { - DbgProcess process = getManager().getCurrentProcess(); - return getModel().gateFuture(process.kill()); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetLauncher.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetLauncher.java deleted file mode 100644 index 0487fb2698..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetLauncher.java +++ /dev/null @@ -1,41 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface1; - -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.model.iface2.DbgModelTargetObject; -import ghidra.dbg.error.DebuggerUserException; -import ghidra.dbg.target.TargetCmdLineLauncherEx; - -/** - * An interface which indicates this object is capable of launching targets. - * - *

- * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface DbgModelTargetLauncher extends DbgModelTargetObject, TargetCmdLineLauncherEx { - - @Override - public default CompletableFuture launch(Map args) { - return getModel().gateFuture(getManager().launch(args)).exceptionally((exc) -> { - throw new DebuggerUserException("Launch failed for " + args); - }).thenApply(__ -> null); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetMethod.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetMethod.java deleted file mode 100644 index 2f1342f92e..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetMethod.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface1; - -import agent.dbgeng.model.iface2.DbgModelTargetObject; -import ghidra.dbg.target.TargetMethod; - -/** - * An interface which indicates this object is a method in its parent. - * - * @param type for this - */ -public interface DbgModelTargetMethod extends DbgModelTargetObject, TargetMethod { - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetResumable.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetResumable.java deleted file mode 100644 index 84c50344dd..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetResumable.java +++ /dev/null @@ -1,43 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface1; - -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.manager.DbgProcess; -import agent.dbgeng.model.iface2.DbgModelTargetObject; -import ghidra.async.AsyncUtils; -import ghidra.dbg.target.TargetResumable; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface DbgModelTargetResumable extends DbgModelTargetObject, TargetResumable { - - @Override - public default CompletableFuture resume() { - DbgProcess process = getManager().getCurrentProcess(); - if (process == null) { - return AsyncUtils.nil(); - } - return getModel().gateFuture(process.cont()); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetSteppable.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetSteppable.java deleted file mode 100644 index 2a60ac97ea..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface1/DbgModelTargetSteppable.java +++ /dev/null @@ -1,89 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface1; - -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.manager.DbgManager.ExecSuffix; -import agent.dbgeng.manager.DbgProcess; -import agent.dbgeng.manager.DbgThread; -import agent.dbgeng.model.iface2.*; -import ghidra.dbg.target.TargetSteppable; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface DbgModelTargetSteppable extends DbgModelTargetObject, TargetSteppable { - - default ExecSuffix convertToDbg(TargetStepKind kind) { - switch (kind) { - case FINISH: - return ExecSuffix.FINISH; - case INTO: - return ExecSuffix.STEP_INSTRUCTION; - case LINE: - return ExecSuffix.STEP; - case OVER: - return ExecSuffix.NEXT_INSTRUCTION; - case OVER_LINE: - return ExecSuffix.NEXT; - case RETURN: - return ExecSuffix.RETURN; - case UNTIL: - return ExecSuffix.UNTIL; - case EXTENDED: - return ExecSuffix.EXTENDED; - default: - throw new AssertionError(); - } - } - - @Override - default CompletableFuture step(TargetStepKind kind) { - DbgThread thread = getManager().getCurrentThread(); - switch (kind) { - case SKIP: - throw new UnsupportedOperationException(kind.name()); - default: - if (this instanceof DbgModelTargetThread) { - DbgModelTargetThread targetThread = (DbgModelTargetThread) this; - return getModel().gateFuture(targetThread.getThread().step(convertToDbg(kind))); - } - if (this instanceof DbgModelTargetProcess) { - DbgModelTargetProcess targetProcess = (DbgModelTargetProcess) this; - DbgProcess process = targetProcess.getProcess(); - if (process == null) { - process = getManager().getCurrentProcess(); - } - return getModel() - .gateFuture(process.step(convertToDbg(kind))); - } - return getModel().gateFuture(thread.step(convertToDbg(kind))); - } - } - - @Override - default CompletableFuture step(Map args) { - DbgThread thread = getManager().getCurrentThread(); - return getModel().gateFuture(thread.step(args)); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetAvailable.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetAvailable.java deleted file mode 100644 index 1e9488325c..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetAvailable.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface2; - -import ghidra.dbg.target.TargetAttachable; - -public interface DbgModelTargetAvailable extends DbgModelTargetObject, TargetAttachable { - String PID_ATTRIBUTE_NAME = PREFIX_INVISIBLE + "pid"; - // TODO: DESCRIPTION, TYPE, USER? - - public long getPid(); - - public void setBase(Object value); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetAvailableContainer.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetAvailableContainer.java deleted file mode 100644 index 453d6373c4..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetAvailableContainer.java +++ /dev/null @@ -1,22 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface2; - -public interface DbgModelTargetAvailableContainer extends DbgModelTargetObject { - - public DbgModelTargetAvailable getTargetAttachable(int pid); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetBreakpointContainer.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetBreakpointContainer.java deleted file mode 100644 index c6c2bf0a13..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetBreakpointContainer.java +++ /dev/null @@ -1,95 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface2; - -import java.util.Set; -import java.util.concurrent.CompletableFuture; -import java.util.function.Function; - -import agent.dbgeng.manager.DbgEventsListenerAdapter; -import agent.dbgeng.manager.breakpoint.DbgBreakpointType; -import ghidra.async.AsyncFence; -import ghidra.dbg.target.TargetBreakpointLocationContainer; -import ghidra.dbg.target.TargetBreakpointSpec.TargetBreakpointKind; -import ghidra.dbg.target.TargetBreakpointSpecContainer; -import ghidra.dbg.target.schema.*; -import ghidra.program.model.address.AddressRange; - -@TargetObjectSchemaInfo( - name = "BreakpointContainer", - elements = { - @TargetElementType(type = DbgModelTargetBreakpointSpec.class) }, - attributes = { - @TargetAttributeType(type = Void.class) }, - canonicalContainer = true) -public interface DbgModelTargetBreakpointContainer extends DbgModelTargetObject, // - TargetBreakpointSpecContainer, // - TargetBreakpointLocationContainer, // - DbgEventsListenerAdapter { - - /* - @Override - public void breakpointCreated(DbgBreakpointInfo info, DbgCause cause); - - @Override - public void breakpointModified(DbgBreakpointInfo newInfo, DbgBreakpointInfo oldInfo, - DbgCause cause); - - @Override - public void breakpointDeleted(DbgBreakpointInfo info, DbgCause cause); - - @Override - public void breakpointHit(DbgBreakpointInfo info, DbgCause cause); - */ - - public default CompletableFuture doPlaceBreakpoint(Set kinds, - Function> placer) { - AsyncFence fence = new AsyncFence(); - if (kinds.contains(TargetBreakpointKind.READ) && - kinds.contains(TargetBreakpointKind.WRITE)) { - fence.include(placer.apply(DbgBreakpointType.ACCESS_WATCHPOINT)); - } - else if (kinds.contains(TargetBreakpointKind.READ)) { - fence.include(placer.apply(DbgBreakpointType.READ_WATCHPOINT)); - } - else if (kinds.contains(TargetBreakpointKind.WRITE)) { - fence.include(placer.apply(DbgBreakpointType.HW_WATCHPOINT)); - } - if (kinds.contains(TargetBreakpointKind.HW_EXECUTE)) { - fence.include(placer.apply(DbgBreakpointType.HW_BREAKPOINT)); - } - if (kinds.contains(TargetBreakpointKind.SW_EXECUTE)) { - fence.include(placer.apply(DbgBreakpointType.BREAKPOINT)); - } - return getModel().gateFuture(fence.ready()); - } - - @Override - public default CompletableFuture placeBreakpoint(String expression, - Set kinds) { - return doPlaceBreakpoint(kinds, t -> getManager().insertBreakpoint(expression, t)); - } - - @Override - public default CompletableFuture placeBreakpoint(AddressRange range, - Set kinds) { - // TODO: Consider how to translate address spaces - long offset = range.getMinAddress().getOffset(); - int len = (int) range.getLength(); - return doPlaceBreakpoint(kinds, t -> getManager().insertBreakpoint(offset, len, t)); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetBreakpointLocation.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetBreakpointLocation.java deleted file mode 100644 index 449bd14cab..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetBreakpointLocation.java +++ /dev/null @@ -1,27 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface2; - -import ghidra.dbg.target.TargetBreakpointLocation; -import ghidra.program.model.address.AddressRange; - -public interface DbgModelTargetBreakpointLocation - extends DbgModelTargetObject, TargetBreakpointLocation { - - @Override - public AddressRange getRange(); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetBreakpointSpec.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetBreakpointSpec.java deleted file mode 100644 index 77b5ff9049..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetBreakpointSpec.java +++ /dev/null @@ -1,214 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface2; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.manager.breakpoint.DbgBreakpointInfo; -import agent.dbgeng.model.iface1.DbgModelTargetBptHelper; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetBreakpointSpecContainer.TargetBreakpointKindSet; -import ghidra.program.model.address.*; -import ghidra.util.Msg; - -public interface DbgModelTargetBreakpointSpec extends // - DbgModelTargetObject, // - TargetBreakpointSpec, // - TargetBreakpointLocation, // - TargetDeletable, // - DbgModelTargetBptHelper { - - String BPT_ACCESS_ATTRIBUTE_NAME = "Access"; - String BPT_DISP_ATTRIBUTE_NAME = "Disposition"; - String BPT_PENDING_ATTRIBUTE_NAME = "Pending"; - String BPT_TIMES_ATTRIBUTE_NAME = "Times"; - String BPT_TYPE_ATTRIBUTE_NAME = "Type"; - String BPT_INDEX_ATTRIBUTE_NAME = "Id"; - - @Override - public default CompletableFuture delete() { - return getModel().gateFuture(getManager().deleteBreakpoints(getNumber())); - } - - @Override - public default CompletableFuture disable() { - setEnabled(false, "Disabled"); - return getModel().gateFuture(getManager().disableBreakpoints(getNumber())); - } - - @Override - public default CompletableFuture enable() { - setEnabled(true, "Enabled"); - return getModel().gateFuture(getManager().enableBreakpoints(getNumber())); - } - - @Override - public default String getExpression() { - DbgBreakpointInfo info = getBreakpointInfo(); - return info == null ? null : info.getExpression(); - } - - public default long getNumber() { - DbgBreakpointInfo info = getBreakpointInfo(); - return info == null ? null : info.getNumber(); - } - - @Override - public default TargetBreakpointKindSet getKinds() { - DbgBreakpointInfo info = getBreakpointInfo(); - if (info == null) { - return TargetBreakpointKindSet.of(); - } - switch (info.getType()) { - case BREAKPOINT: - return TargetBreakpointKindSet.of(TargetBreakpointKind.SW_EXECUTE); - case HW_BREAKPOINT: - return TargetBreakpointKindSet.of(TargetBreakpointKind.HW_EXECUTE); - case HW_WATCHPOINT: - return TargetBreakpointKindSet.of(TargetBreakpointKind.WRITE); - case READ_WATCHPOINT: - return TargetBreakpointKindSet.of(TargetBreakpointKind.READ); - case ACCESS_WATCHPOINT: - return TargetBreakpointKindSet.of(TargetBreakpointKind.READ, - TargetBreakpointKind.WRITE); - default: - return TargetBreakpointKindSet.of(); - } - } - - @Override - public default CompletableFuture init(Map map) { - AddressSpace space = getModel().getAddressSpace("ram"); - return requestNativeAttributes().thenAccept(attrs -> { - if (attrs != null) { - map.putAll(attrs); - TargetObject addr = (TargetObject) attrs.get("Address"); - TargetObject id = (TargetObject) attrs.get("Id"); - //TargetObject unique = (TargetObject) attrs.get("UniqueID"); - TargetObject enabled = (TargetObject) attrs.get("IsEnabled"); - String addstr = addr.getCachedAttribute(VALUE_ATTRIBUTE_NAME).toString(); - String idstr = id.getCachedAttribute(VALUE_ATTRIBUTE_NAME).toString(); - setBreakpointId(idstr); - //String uidstr = unique.getCachedAttribute(VALUE_ATTRIBUTE_NAME).toString(); - String enstr = enabled.getCachedAttribute(VALUE_ATTRIBUTE_NAME).toString(); - Address address = null; - try { - address = space.getAddress(addstr); - //map.put(ADDRESS_ATTRIBUTE_NAME, address); - } - catch (AddressFormatException e) { - Msg.error(this, "Could not parse breakpoint address", e); - } - map.put(SPEC_ATTRIBUTE_NAME, this); - map.put(EXPRESSION_ATTRIBUTE_NAME, addstr); - map.put(KINDS_ATTRIBUTE_NAME, getKinds()); - //map.put(BPT_INDEX_ATTRIBUTE_NAME, Long.decode(idstr)); - map.put(ENABLED_ATTRIBUTE_NAME, enstr.equals("-1")); - setEnabled(enstr.equals("-1"), "Refreshed"); - int size = getBreakpointInfo().getSize(); - //map.put(LENGTH_ATTRIBUTE_NAME, size); - if (address != null) { - try { - map.put(RANGE_ATTRIBUTE_NAME, new AddressRangeImpl(address, size)); - } - catch (AddressOverflowException e) { - Msg.error(this, "Address overflow in breakpoint range", e); - } - } - - String oldval = (String) getCachedAttribute(DISPLAY_ATTRIBUTE_NAME); - String display = "[" + idstr + "] " + addstr; - map.put(DISPLAY_ATTRIBUTE_NAME, display); - setModified(map, !display.equals(oldval)); - } - }); - } - - private long orZero(Long l) { - if (l == null) { - Msg.warn(this, "Breakpoint had null offset. Defaulting to ram:00000000"); - } - return l == null ? 0 : l; - } - - private int orOne(Integer i) { - return i == null ? 1 : i; - } - - public default Address doGetAddress() { - DbgBreakpointInfo info = getBreakpointInfo(); - return getModel().getAddress("ram", orZero(info.getOffset())); - } - - public default AddressRange doGetRange() { - DbgBreakpointInfo info = getBreakpointInfo(); - AddressSpace ram = getModel().getAddressSpace("ram"); - Address min = ram.getAddress(orZero(info.getOffset())); - Address max = min.add(orOne(info.getSize()) - 1); - return new AddressRangeImpl(min, max); - } - - public default void updateInfo(DbgBreakpointInfo oldInfo, DbgBreakpointInfo newInfo, - String reason) { - synchronized (this) { - assert oldInfo == getBreakpointInfo(); - setBreakpointInfo(newInfo); - } - setEnabled(newInfo.isEnabled(), reason); - } - - /** - * Update the enabled field - * - *

- * This does not actually toggle the breakpoint. It just updates the field and calls the proper - * listeners. To actually toggle the breakpoint, use {@link #toggle(boolean)} instead, which if - * effective, should eventually cause this method to be called. - * - * @param enabled true if enabled, false if disabled - * @param reason a description of the cause (not really used, yet) - */ - public default void setEnabled(boolean enabled, String reason) { - setBreakpointEnabled(enabled); - changeAttributes(List.of(), Map.of(ENABLED_ATTRIBUTE_NAME, enabled // - ), reason); - } - - @Override - public default boolean isEnabled() { - return isBreakpointEnabled(); - } - - @Override - public default void addAction(TargetBreakpointAction action) { - getActions().add(action); - } - - @Override - public default void removeAction(TargetBreakpointAction action) { - getActions().remove(action); - } - - public default void breakpointHit() { - DbgModelTargetThread targetThread = - getParentProcess().getThreads().getTargetThread(getManager().getEventThread()); - getActions().invoke() - .breakpointHit((DbgModelTargetBreakpointSpec) getProxy(), targetThread, null, this); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetConnector.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetConnector.java deleted file mode 100644 index 1581cf63fe..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetConnector.java +++ /dev/null @@ -1,41 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface2; - -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.model.iface1.DbgModelSelectableObject; -import ghidra.dbg.target.TargetLauncher; -import ghidra.dbg.target.TargetMethod.TargetParameterMap; - -public interface DbgModelTargetConnector - extends DbgModelSelectableObject, TargetLauncher { - - @Override - public default String getDisplay() { - return getName(); - } - - @Override - public CompletableFuture setActive(); - - @Override - public TargetParameterMap getParameters(); - - @Override - public CompletableFuture launch(Map args); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetConnectorContainer.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetConnectorContainer.java deleted file mode 100644 index 8c79ea44f3..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetConnectorContainer.java +++ /dev/null @@ -1,22 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface2; - -public interface DbgModelTargetConnectorContainer extends DbgModelTargetObject { - - public DbgModelTargetAvailable getTargetAttachable(int pid); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetDebugContainer.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetDebugContainer.java deleted file mode 100644 index 84df97afe2..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetDebugContainer.java +++ /dev/null @@ -1,22 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface2; - -import ghidra.dbg.target.TargetAggregate; - -public interface DbgModelTargetDebugContainer extends DbgModelTargetObject, TargetAggregate { - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetEnvironmentEx.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetEnvironmentEx.java deleted file mode 100644 index d1e4d59dbc..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetEnvironmentEx.java +++ /dev/null @@ -1,41 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface2; - -import ghidra.dbg.target.TargetEnvironment; - -public interface DbgModelTargetEnvironmentEx extends DbgModelTargetObject, TargetEnvironment { - - public void refreshInternal(); - - /* - @Override - public default String getArchitecture() { - return getTypedAttributeNowByName(ARCH_ATTRIBUTE_NAME, String.class, ""); - } - - @Override - public default String getDebugger() { - return getTypedAttributeNowByName(DEBUGGER_ATTRIBUTE_NAME, String.class, ""); - } - - @Override - public default String getOperatingSystem() { - return getTypedAttributeNowByName(OS_ATTRIBUTE_NAME, String.class, ""); - } - */ - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetEvent.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetEvent.java deleted file mode 100644 index 8b5de3f811..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetEvent.java +++ /dev/null @@ -1,36 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface2; - -import agent.dbgeng.manager.*; -import agent.dbgeng.manager.evt.AbstractDbgEvent; -import agent.dbgeng.model.iface1.DbgModelSelectableObject; -import agent.dbgeng.model.iface1.DbgModelTargetConfigurable; - -public interface DbgModelTargetEvent extends - DbgModelSelectableObject, // - DbgModelTargetConfigurable, // - DbgEventsListenerAdapter // -{ - - public DbgEventFilter getFilter(); - - public int getEventIndex(); - - @Override - void eventSelected(AbstractDbgEvent event, DbgCause cause); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetEventContainer.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetEventContainer.java deleted file mode 100644 index 4085880f94..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetEventContainer.java +++ /dev/null @@ -1,30 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface2; - -import ghidra.dbg.target.TargetAggregate; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "EventContainer", - elements = { - @TargetElementType(type = DbgModelTargetEvent.class) }, - attributes = { - @TargetAttributeType(type = Void.class) }, - canonicalContainer = true) -public interface DbgModelTargetEventContainer extends DbgModelTargetObject, TargetAggregate { - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetEventOption.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetEventOption.java deleted file mode 100644 index d601205443..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetEventOption.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface2; - -import java.util.concurrent.CompletableFuture; - -import ghidra.dbg.target.TargetTogglable; - -public interface DbgModelTargetEventOption extends DbgModelTargetObject, TargetTogglable { - - Integer getOption(); - - CompletableFuture setOption(int ordinal); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetException.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetException.java deleted file mode 100644 index a28c5731d0..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetException.java +++ /dev/null @@ -1,24 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface2; - -import agent.dbgeng.manager.DbgExceptionFilter; - -public interface DbgModelTargetException extends DbgModelTargetEvent { - - public DbgExceptionFilter getFilter(); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetExceptionContainer.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetExceptionContainer.java deleted file mode 100644 index 7b66363730..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetExceptionContainer.java +++ /dev/null @@ -1,30 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface2; - -import ghidra.dbg.target.TargetAggregate; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "ExceptionContainer", - elements = { - @TargetElementType(type = DbgModelTargetException.class) }, - attributes = { - @TargetAttributeType(type = Void.class) }, - canonicalContainer = true) -public interface DbgModelTargetExceptionContainer extends DbgModelTargetObject, TargetAggregate { - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetMemoryContainer.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetMemoryContainer.java deleted file mode 100644 index 51faa2821c..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetMemoryContainer.java +++ /dev/null @@ -1,37 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface2; - -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.manager.DbgModuleMemory; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.TargetMemory; -import ghidra.program.model.address.Address; - -public interface DbgModelTargetMemoryContainer extends DbgModelTargetObject, TargetMemory { - - public DbgModelTargetMemoryRegion getTargetMemory(DbgModuleMemory region); - - @Override - public CompletableFuture readMemory(Address address, int length); - - @Override - public CompletableFuture writeMemory(Address address, byte[] data); - - public CompletableFuture requestElements(RefreshBehavior refresh); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetMemoryRegion.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetMemoryRegion.java deleted file mode 100644 index 1537df006a..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetMemoryRegion.java +++ /dev/null @@ -1,35 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface2; - -import ghidra.dbg.target.TargetMemoryRegion; -import ghidra.program.model.address.AddressRange; - -public interface DbgModelTargetMemoryRegion extends DbgModelTargetObject, TargetMemoryRegion { - - @Override - public AddressRange getRange(); - - @Override - public boolean isReadable(); - - @Override - public boolean isWritable(); - - @Override - public boolean isExecutable(); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetModule.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetModule.java deleted file mode 100644 index 252014d083..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetModule.java +++ /dev/null @@ -1,75 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface2; - -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.manager.DbgModule; -import ghidra.dbg.target.TargetModule; -import ghidra.dbg.target.TargetObject; -import ghidra.program.model.address.*; - -public interface DbgModelTargetModule extends DbgModelTargetObject, TargetModule { - - DbgModule getDbgModule(); - - @Override - public default CompletableFuture init(Map map) { - AddressSpace space = getModel().getAddressSpace("ram"); - return requestNativeAttributes().thenAccept(attrs -> { - if (!isValid()) { - return; - } - if (attrs != null) { - map.putAll(attrs); - TargetObject baseAttr = (TargetObject) attrs.get("BaseAddress"); - TargetObject nameAttr = (TargetObject) attrs.get("Name"); - TargetObject sizeAttr = (TargetObject) attrs.get("Size"); - - Object baseval = baseAttr == null ? null - : baseAttr.getCachedAttribute(VALUE_ATTRIBUTE_NAME); - Object nameval = nameAttr == null ? null - : nameAttr.getCachedAttribute(VALUE_ATTRIBUTE_NAME); - Object sizeval = sizeAttr == null ? null - : sizeAttr.getCachedAttribute(VALUE_ATTRIBUTE_NAME); - - String basestr = baseval == null ? "0" : baseval.toString(); - String namestr = nameval == null ? "" : nameval.toString(); - String sizestr = sizeval == null ? "1" : sizeval.toString(); - - String shortnamestr = namestr; - int sep = shortnamestr.lastIndexOf('\\'); - if (sep > 0 && sep < shortnamestr.length()) { - shortnamestr = shortnamestr.substring(sep + 1); - } - Long base = Long.parseUnsignedLong(basestr, 16); - Integer sz = Integer.parseInt(sizestr, 16); - Address min = space.getAddress(base); - Address max = min.add(sz - 1); - AddressRange range = new AddressRangeImpl(min, max); - map.put(RANGE_ATTRIBUTE_NAME, range); - - String oldval = (String) getCachedAttribute(DISPLAY_ATTRIBUTE_NAME); - map.put(MODULE_NAME_ATTRIBUTE_NAME, namestr); - map.put(SHORT_DISPLAY_ATTRIBUTE_NAME, shortnamestr); - map.put(DISPLAY_ATTRIBUTE_NAME, shortnamestr); - setModified(map, !shortnamestr.equals(oldval)); - } - }); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetModuleContainer.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetModuleContainer.java deleted file mode 100644 index 5a1cc039e2..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetModuleContainer.java +++ /dev/null @@ -1,36 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface2; - -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.model.iface1.DbgModelTargetEventScope; -import ghidra.dbg.target.TargetModule; -import ghidra.dbg.target.TargetModuleContainer; - -public interface DbgModelTargetModuleContainer - extends /*DbgModelTargetObject,*/ DbgModelTargetEventScope, TargetModuleContainer { - - @Override - public CompletableFuture addSyntheticModule(String name); - - public DbgModelTargetModule getTargetModule(String name); - - public void libraryLoaded(String name); - - public void libraryUnloaded(String name); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetModuleSection.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetModuleSection.java deleted file mode 100644 index 8f4883cb6a..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetModuleSection.java +++ /dev/null @@ -1,26 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface2; - -import ghidra.dbg.target.TargetSection; -import ghidra.program.model.address.AddressRange; - -public interface DbgModelTargetModuleSection extends DbgModelTargetObject, TargetSection { - - @Override - public AddressRange getRange(); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetModuleSectionContainer.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetModuleSectionContainer.java deleted file mode 100644 index 4c673175b6..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetModuleSectionContainer.java +++ /dev/null @@ -1,23 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface2; - -import ghidra.dbg.target.TargetSectionContainer; - -public interface DbgModelTargetModuleSectionContainer - extends DbgModelTargetObject, TargetSectionContainer { - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetObject.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetObject.java deleted file mode 100644 index ec43e56596..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetObject.java +++ /dev/null @@ -1,80 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface2; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.dbgeng.DebugClient.DebugStatus; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgeng.model.AbstractDbgModel; -import ghidra.async.AsyncUtils; -import ghidra.dbg.agent.SpiTargetObject; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.util.CollectionUtils.Delta; - -public interface DbgModelTargetObject extends SpiTargetObject { - - @Override - public AbstractDbgModel getModel(); - - public default DbgManagerImpl getManager() { - return (DbgManagerImpl) getModel().getManager(); - } - - public default CompletableFuture init(Map map) { - return CompletableFuture.completedFuture(null); - } - - public default DbgManagerImpl getManagerWithCheck() { - DbgManagerImpl impl = (DbgManagerImpl) getModel().getManager(); - if (impl == null) { - return impl; - } - DebugStatus status = impl.getControl().getExecutionStatus(); - if (status.equals(DebugStatus.GO)) { - System.err.println("Attempt to access DbgManager while GO"); - throw new RuntimeException("Attempt to access DbgManager while GO"); - } - return impl; - } - - public Delta changeAttributes(List remove, Map add, String reason); - - public CompletableFuture> requestNativeAttributes(); - - public default CompletableFuture requestAugmentedAttributes() { - return AsyncUtils.nil(); - } - - public CompletableFuture> requestNativeElements(); - - public DbgModelTargetSession getParentSession(); - - public DbgModelTargetProcess getParentProcess(); - - public DbgModelTargetThread getParentThread(); - - public TargetObject getProxy(); - - public void setModified(Map map, boolean b); - - public void setModified(boolean modified); - - public void resetModified(); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetProcess.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetProcess.java deleted file mode 100644 index bb0b1c66b0..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetProcess.java +++ /dev/null @@ -1,95 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface2; - -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.dbgeng.DebugProcessId; -import agent.dbgeng.dbgeng.DebugProcessRecord; -import agent.dbgeng.manager.DbgEventsListenerAdapter; -import agent.dbgeng.manager.DbgProcess; -import agent.dbgeng.manager.DbgState; -import agent.dbgeng.manager.DbgThread; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgeng.model.iface1.DbgModelSelectableObject; -import agent.dbgeng.model.iface1.DbgModelTargetAccessConditioned; -import agent.dbgeng.model.iface1.DbgModelTargetAttachable; -import agent.dbgeng.model.iface1.DbgModelTargetAttacher; -import agent.dbgeng.model.iface1.DbgModelTargetDeletable; -import agent.dbgeng.model.iface1.DbgModelTargetDetachable; -import agent.dbgeng.model.iface1.DbgModelTargetExecutionStateful; -import agent.dbgeng.model.iface1.DbgModelTargetInterruptible; -import agent.dbgeng.model.iface1.DbgModelTargetKillable; -import agent.dbgeng.model.iface1.DbgModelTargetResumable; -import agent.dbgeng.model.iface1.DbgModelTargetSteppable; -import ghidra.dbg.target.TargetAggregate; -import ghidra.dbg.target.TargetProcess; -import ghidra.dbg.util.PathUtils; - -public interface DbgModelTargetProcess extends // - TargetAggregate, // - TargetProcess, // - DbgModelTargetExecutionStateful, // - DbgModelTargetAccessConditioned, // - DbgModelTargetAttacher, // - DbgModelTargetAttachable, // - DbgModelTargetDeletable, // - DbgModelTargetDetachable, // - DbgModelTargetKillable, // - DbgModelTargetResumable, // - DbgModelTargetSteppable, // - DbgModelTargetInterruptible, // - DbgEventsListenerAdapter, // - DbgModelSelectableObject { - - public void processStarted(Long pid); - - public DbgModelTargetThreadContainer getThreads(); - - public DbgModelTargetModuleContainer getModules(); - - public DbgModelTargetMemoryContainer getMemory(); - - public void threadStateChangedSpecific(DbgThread thread, DbgState state); - - public default DbgProcess getProcess() { - return getProcess(true); - } - - public default DbgProcess getProcess(boolean fire) { - DbgManagerImpl manager = getManager(); - try { - String index = PathUtils.parseIndex(getName()); - Long pid = Long.decode(index); - DebugProcessId id = new DebugProcessRecord(pid); - return manager.getProcessComputeIfAbsent(id, pid, null, fire); - } - catch (IllegalArgumentException e) { - return manager.getCurrentProcess(); - } - } - - @Override - public default CompletableFuture setActive() { - DbgManagerImpl manager = getManager(); - DbgProcess process = getProcess(); - if (process == null) { - process = manager.getEventProcess(); - } - return manager.setActiveProcess(process); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetProcessContainer.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetProcessContainer.java deleted file mode 100644 index 4da4997744..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetProcessContainer.java +++ /dev/null @@ -1,32 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface2; - -import agent.dbgeng.dbgeng.DebugProcessId; -import agent.dbgeng.manager.DbgEventsListenerAdapter; -import agent.dbgeng.manager.DbgProcess; -import agent.dbgeng.model.iface1.DbgModelTargetEventScope; - -public interface DbgModelTargetProcessContainer extends // - //DbgModelTargetObject, - DbgModelTargetEventScope, // - DbgEventsListenerAdapter { - - public DbgModelTargetProcess getTargetProcess(DebugProcessId id); - - public DbgModelTargetProcess getTargetProcess(DbgProcess process); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetRegister.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetRegister.java deleted file mode 100644 index 98a46e1c74..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetRegister.java +++ /dev/null @@ -1,37 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface2; - -import java.math.BigInteger; - -import agent.dbgeng.manager.impl.DbgRegister; -import ghidra.dbg.target.TargetRegister; -import ghidra.dbg.util.ConversionUtils; - -public interface DbgModelTargetRegister extends DbgModelTargetObject, TargetRegister { - - @Override - public int getBitLength(); - - public DbgRegister getRegister(); - - public default byte[] getBytes() { - String val = (String) getCachedAttributes().get(VALUE_ATTRIBUTE_NAME); - BigInteger value = new BigInteger(val, 16); - return ConversionUtils.bigIntegerToBytes(16, value); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetRegisterBank.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetRegisterBank.java deleted file mode 100644 index b3ecf55a02..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetRegisterBank.java +++ /dev/null @@ -1,151 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface2; - -import java.math.BigInteger; -import java.util.*; -import java.util.Map.Entry; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.atomic.AtomicReference; - -import agent.dbgeng.manager.*; -import agent.dbgeng.manager.impl.*; -import ghidra.async.AsyncUtils; -import ghidra.async.TypeSpec; -import ghidra.dbg.error.DebuggerRegisterAccessException; -import ghidra.dbg.target.TargetRegisterBank; -import ghidra.dbg.util.ConversionUtils; -import ghidra.util.Msg; - -public interface DbgModelTargetRegisterBank extends DbgModelTargetObject, TargetRegisterBank { - - public DbgModelTargetRegister getTargetRegister(DbgRegister register); - - @Override - public default CompletableFuture> readRegistersNamed( - Collection names) { - return getModel().gateFuture(doReadRegistersNamed(names)); - } - - public default CompletableFuture> doReadRegistersNamed( - Collection names) { - DbgManagerImpl manager = getManager(); - if (manager.isWaiting()) { - Msg.warn(this, - "Cannot process command readRegistersNamed while engine is waiting for events"); - } - - AtomicReference> read = new AtomicReference<>(); - return getManager().getRegisterMap(getPath()).thenCompose(valueMap -> { - Map regs = getCachedAttributes(); - Map map = - new HashMap(); - - for (String regname : names) { - Object x = regs.get(regname); - if (!(x instanceof DbgModelTargetRegister)) { - continue; - } - if (!valueMap.containsKey(regname)) { - continue; - } - DbgModelTargetRegister reg = (DbgModelTargetRegister) x; - DbgRegister register = (DbgRegister) valueMap.get(regname); - if (register != null) { - map.put(register, reg); - } - } - read.set(map); - return getParentThread().getThread().readRegisters(map.keySet()); - }).thenApply(vals -> { - Map result = new LinkedHashMap<>(); - for (DbgRegister dbgReg : vals.keySet()) { - DbgModelTargetRegister reg = read.get().get(dbgReg); - String oldval = (String) reg.getCachedAttributes().get(VALUE_ATTRIBUTE_NAME); - BigInteger value = vals.get(dbgReg); - byte[] bytes = ConversionUtils.bigIntegerToBytes(dbgReg.getSize(), value); - result.put(dbgReg.getName(), bytes); - reg.changeAttributes(List.of(), Map.of( // - VALUE_ATTRIBUTE_NAME, value.toString(16) // - ), "Refreshed"); - if (value.longValue() != 0) { - String valstr = Long.toUnsignedString(value.longValue(), 16); //value.toString(16); - String newval = reg.getName() + " : " + valstr; - reg.changeAttributes(List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, newval // - ), "Refreshed"); - reg.setModified(valstr.equals(oldval)); - } - } - - broadcast().registersUpdated(getProxy(), result); - return result; - }); - } - - @Override - public default CompletableFuture writeRegistersNamed(Map values) { - return getModel().gateFuture(doWriteRegistersNamed(values)); - } - - public default CompletableFuture doWriteRegistersNamed(Map values) { - DbgManagerImpl manager = getManager(); - DbgThread thread = getParentThread().getThread(); - return AsyncUtils.sequence(TypeSpec.VOID).then(seq -> { - requestNativeElements().handle(seq::nextIgnore); - }).then(seq -> { - thread.listRegisters().handle(seq::next); - }, TypeSpec.cls(DbgRegisterSet.class)).then((regset, seq) -> { - Map regs = getCachedAttributes(); - Map toWrite = new LinkedHashMap<>(); - for (Map.Entry ent : values.entrySet()) { - String regname = ent.getKey(); - DbgModelTargetRegister reg = (DbgModelTargetRegister) regs.get(regname); - if (reg == null) { - throw new DebuggerRegisterAccessException("No such register: " + regname); - } - BigInteger val = new BigInteger(1, ent.getValue()); - DbgRegister dbgreg = regset.get(regname); - toWrite.put(dbgreg, val); - } - getParentThread().getThread().writeRegisters(toWrite).handle(seq::next); - // TODO: Should probably filter only effective and normalized writes in the callback - }).then(seq -> { - manager.getEventListeners().invoke().threadStateChanged(thread, thread.getState(), - DbgCause.Causes.UNCLAIMED, DbgReason.Reasons.NONE); - broadcast().registersUpdated(getProxy(), values); - seq.exit(); - }).finish(); - } - - @Override - public default Map getCachedRegisters() { - return getValues(); - } - - public default Map getValues() { - Map result = new HashMap<>(); - for (Entry entry : this.getCachedAttributes().entrySet()) { - if (entry.getValue() instanceof DbgModelTargetRegister) { - DbgModelTargetRegister reg = (DbgModelTargetRegister) entry.getValue(); - byte[] bytes = reg.getBytes(); - result.put(entry.getKey(), bytes); - } - } - return result; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetRegisterContainer.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetRegisterContainer.java deleted file mode 100644 index 09b7cb4cd0..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetRegisterContainer.java +++ /dev/null @@ -1,26 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface2; - -import agent.dbgeng.manager.impl.DbgRegister; -import ghidra.dbg.target.TargetRegisterContainer; - -public interface DbgModelTargetRegisterContainer - extends DbgModelTargetObject, TargetRegisterContainer { - - public DbgModelTargetRegister getTargetRegister(DbgRegister register); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetRegisterContainerAndBank.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetRegisterContainerAndBank.java deleted file mode 100644 index e86c24636e..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetRegisterContainerAndBank.java +++ /dev/null @@ -1,29 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface2; - -import agent.dbgeng.manager.impl.DbgRegister; -import ghidra.dbg.target.TargetRegisterBank; -import ghidra.dbg.target.TargetRegisterContainer; - -public interface DbgModelTargetRegisterContainerAndBank extends // - DbgModelTargetObject, // - TargetRegisterContainer, // - TargetRegisterBank { - - public DbgModelTargetRegister getTargetRegister(DbgRegister register); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetRoot.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetRoot.java deleted file mode 100644 index 1c05d05f32..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetRoot.java +++ /dev/null @@ -1,35 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface2; - -import agent.dbgeng.manager.DbgEventsListenerAdapter; -import agent.dbgeng.model.iface1.*; - -public interface DbgModelTargetRoot extends // - ///DbgModelTargetObject, - DbgModelTargetAccessConditioned, // - DbgModelTargetAttacher, // - DbgModelTargetActiveScope, // - DbgModelTargetEventScope, // - DbgModelTargetLauncher, // - DbgModelTargetFocusScope, // - DbgEventsListenerAdapter { - - void setDefaultConnector(DbgModelTargetConnector defaultConnector); - - // getActive & requestActivation implemented by DbgModelTargetObject & DbgModelTargetActiveScope - // getFocus & requestFocus implemented by DbgModelTargetObject & DbgModelTargetFocusScope -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetSession.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetSession.java deleted file mode 100644 index 88537fe152..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetSession.java +++ /dev/null @@ -1,107 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface2; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.dbgeng.DebugClient.DebugOutputFlags; -import agent.dbgeng.dbgeng.DebugSessionId; -import agent.dbgeng.dbgeng.DebugSessionRecord; -import agent.dbgeng.manager.DbgEventsListenerAdapter; -import agent.dbgeng.manager.DbgSession; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgeng.model.iface1.DbgModelSelectableObject; -import agent.dbgeng.model.iface1.DbgModelTargetAccessConditioned; -import agent.dbgeng.model.iface1.DbgModelTargetExecutionStateful; -import agent.dbgeng.model.iface1.DbgModelTargetInterpreter; -import agent.dbgeng.model.iface1.DbgModelTargetInterruptible; -import agent.dbgeng.model.iface1.DbgModelTargetResumable; -import ghidra.dbg.target.TargetAggregate; -import ghidra.dbg.target.TargetConsole; -import ghidra.dbg.target.TargetConsole.Channel; -import ghidra.dbg.util.PathUtils; - -public interface DbgModelTargetSession extends // - DbgModelTargetAccessConditioned, // - //DbgModelTargetFocusScope, // - DbgModelTargetExecutionStateful, // - DbgModelTargetInterpreter, // - DbgModelTargetInterruptible, // - DbgModelTargetResumable, // - DbgEventsListenerAdapter, // - DbgModelSelectableObject, // - TargetAggregate { - - DbgModelTargetProcessContainer getProcesses(); - - public default DbgSession getSession() { - return getSession(true); - } - - public default DbgSession getSession(boolean fire) { - DbgManagerImpl manager = getManager(); - try { - String index = PathUtils.parseIndex(getName()); - Integer sid = Integer.decode(index); - DebugSessionId id = new DebugSessionRecord(sid); - return manager.getSessionComputeIfAbsent(id, fire); - } - catch (IllegalArgumentException e) { - return manager.getCurrentSession(); - } - } - - @Override - public default void consoleOutput(String output, int mask) { - - if (!isValid()) { - return; - } - Channel chan = TargetConsole.Channel.STDOUT; - if (((mask & DebugOutputFlags.DEBUG_OUTPUT_ERROR.getValue()) // - == DebugOutputFlags.DEBUG_OUTPUT_ERROR.getValue()) || // - ((mask & DebugOutputFlags.DEBUG_OUTPUT_WARNING.getValue()) // - == DebugOutputFlags.DEBUG_OUTPUT_WARNING.getValue())) { - chan = TargetConsole.Channel.STDERR; - } - if (output.contains("loaded *kernel* extension dll for usermode")) { - return; - } - if (!isValid()) { - return; - } - broadcast().consoleOutput(getProxy(), chan, output); - } - - @Override - public default void promptChanged(String prompt) { - changeAttributes(List.of(), Map.of( // - PROMPT_ATTRIBUTE_NAME, prompt // - ), "Refreshed"); - } - - @Override - public default CompletableFuture setActive() { - DbgManagerImpl manager = getManager(); - DbgSession session = getSession(); - if (session == null) { - session = manager.getEventSession(); - } - return manager.setActiveSession(session); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetSessionAttributes.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetSessionAttributes.java deleted file mode 100644 index 4178e7f3fc..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetSessionAttributes.java +++ /dev/null @@ -1,26 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface2; - -import agent.dbgeng.manager.DbgEventsListenerAdapter; -import agent.dbgeng.model.iface1.DbgModelTargetEnvironment; - -public interface DbgModelTargetSessionAttributes extends - //DbgModelTargetObject, - DbgModelTargetEnvironment, // - DbgEventsListenerAdapter { - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetSessionAttributesMachine.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetSessionAttributesMachine.java deleted file mode 100644 index e064a7c173..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetSessionAttributesMachine.java +++ /dev/null @@ -1,24 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface2; - -import agent.dbgeng.manager.DbgEventsListenerAdapter; - -public interface DbgModelTargetSessionAttributesMachine extends // - DbgModelTargetObject, // - DbgEventsListenerAdapter { - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetSessionContainer.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetSessionContainer.java deleted file mode 100644 index 3edf89ffa8..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetSessionContainer.java +++ /dev/null @@ -1,34 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface2; - -import agent.dbgeng.dbgeng.DebugSessionId; -import agent.dbgeng.manager.*; - -public interface DbgModelTargetSessionContainer - extends DbgModelTargetObject, DbgEventsListenerAdapter { - - @Override - public default void sessionAdded(DbgSession session, DbgCause cause) { - //refresh(); - } - - @Override - public void sessionRemoved(DebugSessionId sessionId, DbgCause cause); - - public DbgModelTargetSession getTargetSession(DbgSession session); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetStack.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetStack.java deleted file mode 100644 index 806dc7ef1f..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetStack.java +++ /dev/null @@ -1,26 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface2; - -import agent.dbgeng.manager.DbgStackFrame; -import ghidra.dbg.target.TargetStack; - -public interface DbgModelTargetStack - extends DbgModelTargetObject, TargetStack { - - public DbgModelTargetStackFrame getTargetFrame(DbgStackFrame frame); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetStackFrame.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetStackFrame.java deleted file mode 100644 index e8379459db..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetStackFrame.java +++ /dev/null @@ -1,114 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface2; - -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.manager.*; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgeng.model.iface1.DbgModelSelectableObject; -import ghidra.async.AsyncUtils; -import ghidra.dbg.target.TargetStackFrame; -import ghidra.program.model.address.Address; -import ghidra.program.model.address.AddressSpace; - -public interface DbgModelTargetStackFrame extends // - //DbgModelTargetObject, - TargetStackFrame, // - DbgEventsListenerAdapter, // - DbgModelSelectableObject { - - public static final String FUNC_ATTRIBUTE_NAME = "function"; - public static final String FUNC_TABLE_ENTRY_ATTRIBUTE_NAME = "Table Entry"; - public static final String FRAME_OFFSET_ATTRIBUTE_NAME = "Frame Offset"; - public static final String INST_OFFSET_ATTRIBUTE_NAME = "Inst. Offset"; - public static final String RETURN_OFFSET_ATTRIBUTE_NAME = "Return Offset"; - public static final String STACK_OFFSET_ATTRIBUTE_NAME = "Stack Offset"; - public static final String VIRTUAL_ATTRIBUTE_NAME = "Virtual"; - public static final String PARAM0_ATTRIBUTE_NAME = "Param[0]"; - public static final String PARAM1_ATTRIBUTE_NAME = "Param[1]"; - public static final String PARAM2_ATTRIBUTE_NAME = "Param[2]"; - public static final String PARAM3_ATTRIBUTE_NAME = "Param[3]"; - public static final String FROM_ATTRIBUTE_NAME = PREFIX_INVISIBLE + "from"; // TODO - - @Override - public default CompletableFuture setActive() { - DbgManagerImpl manager = getManager(); - DbgModelTargetThread targetThread = getParentThread(); - DbgThread thread = targetThread.getThread(); - String name = this.getName(); - String stripped = name.substring(1, name.length() - 1); - int index = Integer.decode(stripped); - return manager.setActiveFrame(thread, index); - } - - @Override - public default CompletableFuture init(Map map) { - AddressSpace space = getModel().getAddressSpace("ram"); - return requestNativeAttributes().thenCompose(attrs -> { - if (attrs == null) { - return AsyncUtils.nil(); - } - map.putAll(attrs); - DbgModelTargetObject attributes = (DbgModelTargetObject) attrs.get("Attributes"); - if (attributes == null) { - return AsyncUtils.nil(); - } - return attributes.requestAugmentedAttributes().thenCompose(ax -> { - if (!isValid()) { - return AsyncUtils.nil(); - } - Map subattrs = attributes.getCachedAttributes(); - DbgModelTargetObject frameNumber = - (DbgModelTargetObject) subattrs.get("FrameNumber"); - if (frameNumber == null) { - return AsyncUtils.nil(); - } - return frameNumber.requestAugmentedAttributes().thenCompose(bx -> { - if (!isValid()) { - return AsyncUtils.nil(); - } - Object noval = frameNumber.getCachedAttribute(VALUE_ATTRIBUTE_NAME); - String nostr = noval.toString(); - DbgModelTargetObject instructionOffset = - (DbgModelTargetObject) subattrs.get("InstructionOffset"); - if (instructionOffset == null) { - return AsyncUtils.nil(); - } - return instructionOffset.requestAugmentedAttributes().thenAccept(cx -> { - if (!isValid()) { - return; - } - String oldval = (String) getCachedAttribute(DISPLAY_ATTRIBUTE_NAME); - Object pcval = instructionOffset.getCachedAttribute(VALUE_ATTRIBUTE_NAME); - String pcstr = pcval.toString(); - long pc = Long.parseUnsignedLong(pcstr, 16); - map.put(PC_ATTRIBUTE_NAME, space.getAddress(pc)); - String display = String.format("#%s 0x%s", nostr, pcstr); - map.put(DISPLAY_ATTRIBUTE_NAME, display); - setModified(map, !display.equals(oldval)); - }); - }); - }); - }); - } - - public void setFrame(DbgStackFrame frame); - - public Address getPC(); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetSymbol.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetSymbol.java deleted file mode 100644 index 6837bfe1cb..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetSymbol.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface2; - -import ghidra.dbg.target.TargetSymbol; -import ghidra.program.model.address.Address; - -public interface DbgModelTargetSymbol extends DbgModelTargetObject, TargetSymbol { - - @Override - public boolean isConstant(); - - @Override - public Address getValue(); - - @Override - public long getSize(); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetSymbolContainer.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetSymbolContainer.java deleted file mode 100644 index 5b38aff825..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetSymbolContainer.java +++ /dev/null @@ -1,26 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface2; - -import agent.dbgeng.manager.impl.DbgMinimalSymbol; -import agent.dbgeng.model.impl.DbgModelTargetSymbolImpl; -import ghidra.dbg.target.TargetSymbolNamespace; - -public interface DbgModelTargetSymbolContainer extends DbgModelTargetObject, TargetSymbolNamespace { - - public DbgModelTargetSymbolImpl getTargetSymbol(DbgMinimalSymbol symbol); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetTTD.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetTTD.java deleted file mode 100644 index fcd9f72805..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetTTD.java +++ /dev/null @@ -1,56 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface2; - -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -public interface DbgModelTargetTTD extends DbgModelTargetObject { - - @Override - public default CompletableFuture init(Map map) { - return requestNativeAttributes().thenCompose(attrs -> { - if (attrs == null) { - return CompletableFuture.completedFuture(null); - } - map.putAll(attrs); - DbgModelTargetObject attributes = (DbgModelTargetObject) attrs.get("Position"); - if (attributes == null) { - return CompletableFuture.completedFuture(null); - } - return attributes.requestAugmentedAttributes().thenCompose(ax -> { - Map subattrs = attributes.getCachedAttributes(); - if (subattrs == null) { - return CompletableFuture.completedFuture(null); - } - DbgModelTargetObject seq = (DbgModelTargetObject) subattrs.get("Sequence"); - return seq.requestAugmentedAttributes().thenCompose(bx -> { - Object sqval = seq.getCachedAttribute(VALUE_ATTRIBUTE_NAME); - String sqstr = sqval.toString(); - DbgModelTargetObject steps = (DbgModelTargetObject) subattrs.get("Steps"); - return steps.requestAugmentedAttributes().thenAccept(cx -> { - Object stval = steps.getCachedAttribute(VALUE_ATTRIBUTE_NAME); - String oldval = (String) getCachedAttribute(DISPLAY_ATTRIBUTE_NAME); - String ststr = stval.toString(); - String display = String.format("TTD %s:%s", sqstr, ststr); - map.put(DISPLAY_ATTRIBUTE_NAME, display); - setModified(map, !display.equals(oldval)); - }); - }); - }); - }); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetThread.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetThread.java deleted file mode 100644 index ee8835013a..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetThread.java +++ /dev/null @@ -1,95 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface2; - -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.dbgeng.*; -import agent.dbgeng.manager.*; -import agent.dbgeng.manager.impl.*; -import agent.dbgeng.model.iface1.*; -import agent.dbgeng.model.impl.DbgModelTargetStackImpl; -import ghidra.dbg.target.*; -import ghidra.dbg.util.PathUtils; -import ghidra.program.model.address.Address; - -public interface DbgModelTargetThread extends // - TargetThread, // - TargetAggregate, // - DbgModelTargetAccessConditioned, // - DbgModelTargetExecutionStateful, // - DbgModelTargetSteppable, // - DbgEventsListenerAdapter, // - DbgModelSelectableObject { - - public default DbgThread getThread() { - return getThread(false); - } - - public default DbgThread getThread(boolean fire) { - DbgManagerImpl manager = getManager(); - try { - DbgModelTargetProcess parentProcess = getParentProcess(); - DbgProcessImpl process = parentProcess == null ? null : (DbgProcessImpl) parentProcess.getProcess(); - String index = PathUtils.parseIndex(getName()); - Long tid = Long.decode(index); - - DebugSystemObjects so = manager.getSystemObjects(); - DebugThreadId id = so.getThreadIdBySystemId(tid.intValue()); - if (id == null) { - id = so.getCurrentThreadId(); - } - DbgThreadImpl thread = manager.getThreadComputeIfAbsent(id, process, tid, fire); - return thread; - } - catch (IllegalArgumentException e) { - return manager.getCurrentThread(); - } - } - - @TargetMethod.Export("Step to Address (pa)") - public default CompletableFuture stepToAddress( - @TargetMethod.Param( - description = "The target address", - display = "StopAddress", - name = "address") Address address) { - return getModel().gateFuture(getThread().stepToAddress(address.toString(false))); - } - - @TargetMethod.Export("Trace to Address (ta)") - public default CompletableFuture traceToAddress( - @TargetMethod.Param( - description = "The target address", - display = "StopAddress", - name = "address") Address address) { - return getModel().gateFuture(getThread().traceToAddress(address.toString(false))); - } - - @Override - public default CompletableFuture setActive() { - DbgManagerImpl manager = getManager(); - DbgProcessImpl process = (DbgProcessImpl) getParentProcess().getProcess(); - manager.setActiveProcess(process); - return manager.setActiveThread(getThread()); - } - - public DbgModelTargetStackImpl getStack(); - - public String getExecutingProcessorType(); - - public void threadStateChangedSpecific(DbgState state, DbgReason reason); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetThreadContainer.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetThreadContainer.java deleted file mode 100644 index e60460e18e..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/iface2/DbgModelTargetThreadContainer.java +++ /dev/null @@ -1,34 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.iface2; - -import agent.dbgeng.dbgeng.DebugThreadId; -import agent.dbgeng.manager.DbgEventsListenerAdapter; -import agent.dbgeng.manager.DbgThread; -import agent.dbgeng.model.iface1.DbgModelTargetEventScope; - -public interface DbgModelTargetThreadContainer extends // - //DbgModelTargetObject, - DbgModelTargetEventScope, // - DbgEventsListenerAdapter { - - public DbgModelTargetThread getTargetThread(DbgThread thread); - - public void threadCreated(DbgThread thread); - - public void threadExited(DebugThreadId threadId); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelDefaultTargetModelRoot.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelDefaultTargetModelRoot.java deleted file mode 100644 index 9472115313..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelDefaultTargetModelRoot.java +++ /dev/null @@ -1,33 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.impl; - -import ghidra.dbg.target.TargetAggregate; -import ghidra.dbg.target.schema.TargetObjectSchema; - -public class DbgModelDefaultTargetModelRoot extends DbgModelTargetObjectImpl - implements TargetAggregate { - - public DbgModelDefaultTargetModelRoot(DbgModelImpl model, String typeHint) { - super(model, null, null, typeHint); - } - - public DbgModelDefaultTargetModelRoot(DbgModelImpl model, String typeHint, - TargetObjectSchema schema) { - super(model, null, null, typeHint, schema); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelImpl.java deleted file mode 100644 index 2e72334ef2..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelImpl.java +++ /dev/null @@ -1,197 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.impl; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.RejectedExecutionException; - -import org.apache.commons.lang3.exception.ExceptionUtils; - -import agent.dbgeng.dbgeng.DebugSessionRecord; -import agent.dbgeng.manager.DbgManager; -import agent.dbgeng.manager.DbgSession; -import agent.dbgeng.model.AbstractDbgModel; -import agent.dbgeng.model.iface2.DbgModelTargetProcess; -import agent.dbgeng.model.iface2.DbgModelTargetSession; -import agent.dbgeng.model.iface2.DbgModelTargetSessionContainer; -import ghidra.async.AsyncUtils; -import ghidra.dbg.DebuggerModelClosedReason; -import ghidra.dbg.DebuggerObjectModelWithMemory; -import ghidra.dbg.error.DebuggerModelTerminatingException; -import ghidra.dbg.target.TargetMemory; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.AnnotatedSchemaContext; -import ghidra.dbg.target.schema.TargetObjectSchema; -import ghidra.program.model.address.Address; -import ghidra.program.model.address.AddressFactory; -import ghidra.program.model.address.AddressSpace; -import ghidra.program.model.address.DefaultAddressFactory; -import ghidra.program.model.address.GenericAddressSpace; - -public class DbgModelImpl extends AbstractDbgModel implements DebuggerObjectModelWithMemory { - // TODO: Need some minimal memory modeling per architecture on the model/agent side. - // The model must convert to and from Ghidra's address space names - protected static final String SPACE_NAME = "ram"; - - protected static final AnnotatedSchemaContext SCHEMA_CTX = new AnnotatedSchemaContext(); - protected static final TargetObjectSchema ROOT_SCHEMA = - SCHEMA_CTX.getSchemaForClass(DbgModelTargetRootImpl.class); - - // Don't make this static, so each model has a unique "GDB" space - protected final AddressSpace space = - new GenericAddressSpace(SPACE_NAME, 64, AddressSpace.TYPE_RAM, 0); - protected final AddressFactory addressFactory = - new DefaultAddressFactory(new AddressSpace[] { space }); - - protected final DbgManager dbg; - protected final DbgModelTargetRootImpl root; - protected final DbgModelTargetSessionImpl session; - - protected final CompletableFuture completedRoot; - - protected Map objectMap = new HashMap<>(); - private boolean suppressDescent = false; - - public DbgModelImpl() { - this.dbg = DbgManager.newInstance(); - //System.out.println(XmlSchemaContext.serialize(SCHEMA_CTX)); - this.root = new DbgModelTargetRootImpl(this, ROOT_SCHEMA); - this.completedRoot = CompletableFuture.completedFuture(root); - DbgSession s = dbg.getSessionComputeIfAbsent(new DebugSessionRecord(0), true); - DbgModelTargetSessionContainer sessions = root.sessions; - this.session = (DbgModelTargetSessionImpl) sessions.getTargetSession(s); - addModelRoot(root); - } - - @Override - public String getBrief() { - return "DBGENG@" + Integer.toHexString(System.identityHashCode(this)); - } - - @Override - public AddressSpace getAddressSpace(String name) { - if (!SPACE_NAME.equals(name)) { - return null; - } - return space; - } - - // TODO: Place make this a model method? - @Override - public AddressFactory getAddressFactory() { - return addressFactory; - } - - @Override - public CompletableFuture startDbgEng(String[] args) { - return dbg.start(args).thenApplyAsync(__ -> null, clientExecutor); - } - - @Override - public boolean isRunning() { - return dbg.isRunning(); - } - - @Override - public void terminate() throws IOException { - broadcast().modelClosed(DebuggerModelClosedReason.NORMAL); - root.invalidateSubtree(root, "Dbgeng is terminating"); - dbg.terminate(); - } - - @Override - public TargetObjectSchema getRootSchema() { - return root.getSchema(); - } - - @Override - public CompletableFuture fetchModelRoot() { - return completedRoot; - } - - @Override - public DbgManager getManager() { - return dbg; - } - - @Override - public CompletableFuture close() { - try { - terminate(); - return super.close(); - } - catch (RejectedExecutionException e) { - reportError(this, "Model is already closing", e); - return AsyncUtils.nil(); - } - catch (Throwable t) { - return CompletableFuture.failedFuture(t); - } - } - - @Override - public DbgModelTargetSession getSession() { - return session; - } - - @Override - public TargetMemory getMemory(TargetObject target, Address address, int length) { - if (target instanceof DbgModelTargetProcess) { - DbgModelTargetProcess process = (DbgModelTargetProcess) target; - return new DbgModelTargetMemoryContainerImpl(process); - } - return null; - } - - @Override - public void addModelObject(Object object, TargetObject targetObject) { - objectMap.put(object, targetObject); - } - - @Override - public TargetObject getModelObject(Object object) { - return objectMap.get(object); - } - - @Override - public void deleteModelObject(Object object) { - objectMap.remove(object); - } - - @Override - public CompletableFuture gateFuture(CompletableFuture future) { - return super.gateFuture(future).exceptionally(ex -> { - for (Throwable cause = ex; cause != null; cause = cause.getCause()) { - if (cause instanceof RejectedExecutionException) { - throw new DebuggerModelTerminatingException("dbgeng is terminating", ex); - } - } - return ExceptionUtils.rethrow(ex); - }); - } - - @Override - public boolean isSuppressDescent() { - return suppressDescent; - } - - public void setSuppressDescent(boolean suppressDescent) { - this.suppressDescent = suppressDescent; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelImplUtils.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelImplUtils.java deleted file mode 100644 index 5d44fbb051..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelImplUtils.java +++ /dev/null @@ -1,34 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.impl; - -import java.util.List; -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.manager.DbgProcess; -import agent.dbgeng.model.AbstractDbgModel; - -public enum DbgModelImplUtils { - ; - public static CompletableFuture launch(AbstractDbgModel impl, DbgProcess process, - List args) { - return process.fileExecAndSymbols(args.get(0)); - } - - public static V noDupMerge(V first, V second) { - throw new AssertionError(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetAvailableContainerImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetAvailableContainerImpl.java deleted file mode 100644 index 4ff77e5a35..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetAvailableContainerImpl.java +++ /dev/null @@ -1,96 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import org.apache.commons.lang3.tuple.Pair; - -import agent.dbgeng.model.iface1.DbgModelTargetConfigurable; -import agent.dbgeng.model.iface2.*; -import ghidra.async.AsyncUtils; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.error.DebuggerIllegalArgumentException; -import ghidra.dbg.target.TargetConfigurable; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; -import ghidra.util.datastruct.WeakValueHashMap; - -@TargetObjectSchemaInfo(name = "AvailableContainer", elements = { - @TargetElementType(type = DbgModelTargetAvailableImpl.class) // -}, elementResync = ResyncMode.ALWAYS, attributes = { // - @TargetAttributeType(name = TargetConfigurable.BASE_ATTRIBUTE_NAME, type = Integer.class), // - @TargetAttributeType(type = Void.class) // -}, canonicalContainer = true) -public class DbgModelTargetAvailableContainerImpl extends DbgModelTargetObjectImpl - implements DbgModelTargetAvailableContainer, DbgModelTargetConfigurable { - - protected final Map attachablesById = - new WeakValueHashMap<>(); - - public DbgModelTargetAvailableContainerImpl(DbgModelTargetRoot root) { - super(root.getModel(), root, "Available", "AvailableContainer"); - this.changeAttributes(List.of(), Map.of(BASE_ATTRIBUTE_NAME, 16), "Initialized"); - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - return getManager().listAvailableProcesses().thenAccept(list -> { - List available; - synchronized (this) { - // NOTE: If more details added to entries, should clear attachablesById - available = - list.stream().map(this::getTargetAttachableEx).collect(Collectors.toList()); - } - setElements(available, Map.of(), "Refreshed"); - }); - } - - public synchronized DbgModelTargetAvailable getTargetAttachableEx(Pair pair) { - return attachablesById.computeIfAbsent(pair.getLeft(), - i -> new DbgModelTargetAvailableImpl(this, pair.getLeft(), pair.getRight())); - } - - @Override - public synchronized DbgModelTargetAvailable getTargetAttachable(int pid) { - return attachablesById.computeIfAbsent(pid, - i -> new DbgModelTargetAvailableImpl(this, pid)); - } - - @Override - public CompletableFuture writeConfigurationOption(String key, Object value) { - switch (key) { - case BASE_ATTRIBUTE_NAME: - if (value instanceof Integer) { - this.changeAttributes(List.of(), Map.of(BASE_ATTRIBUTE_NAME, value), - "Modified"); - for (DbgModelTargetAvailable child : attachablesById.values()) { - child.setBase(value); - } - } - else { - throw new DebuggerIllegalArgumentException("Base should be numeric"); - } - default: - } - return AsyncUtils.nil(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetAvailableImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetAvailableImpl.java deleted file mode 100644 index b4fd38706d..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetAvailableImpl.java +++ /dev/null @@ -1,83 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.impl; - -import java.util.List; -import java.util.Map; - -import agent.dbgeng.model.iface2.DbgModelTargetAvailable; -import agent.dbgeng.model.iface2.DbgModelTargetAvailableContainer; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.util.PathUtils; - -@TargetObjectSchemaInfo(name = "Available", elements = { - @TargetElementType(type = Void.class) }, attributes = { - @TargetAttributeType(type = Void.class) }) -public class DbgModelTargetAvailableImpl extends DbgModelTargetObjectImpl - implements DbgModelTargetAvailable { - - protected static String indexAttachable(int pid, Integer base) { - String pidstr = Integer.toString(pid, base); - if (base == 16) { - pidstr = "0x" + pidstr; - } - return pidstr; - } - - protected static String keyAttachable(int pid, Integer base) { - return PathUtils.makeKey(indexAttachable(pid, base)); - } - - protected static String keyAttachable(int pid) { - return PathUtils.makeKey(indexAttachable(pid, 16)); - } - - protected final int pid; - - public DbgModelTargetAvailableImpl(DbgModelTargetAvailableContainer parent, int pid, - String name) { - super(parent.getModel(), parent, keyAttachable(pid), name); - this.pid = pid; - - this.changeAttributes(List.of(), List.of(), Map.of(// - PID_ATTRIBUTE_NAME, (long) pid, // - DISPLAY_ATTRIBUTE_NAME, keyAttachable(pid) + " : " + name.trim() // - ), "Initialized"); - } - - public DbgModelTargetAvailableImpl(DbgModelTargetAvailableContainer parent, int pid) { - super(parent.getModel(), parent, keyAttachable(pid), "Attachable"); - this.pid = pid; - - this.changeAttributes(List.of(), List.of(), Map.of(// - PID_ATTRIBUTE_NAME, (long) pid, // - DISPLAY_ATTRIBUTE_NAME, keyAttachable(pid) // - ), "Initialized"); - } - - @TargetAttributeType(name = PID_ATTRIBUTE_NAME, hidden = true) - @Override - public long getPid() { - return pid; - } - - public void setBase(Object value) { - this.changeAttributes(List.of(), List.of(), Map.of(// - DISPLAY_ATTRIBUTE_NAME, keyAttachable(pid, (Integer) value) // - ), "Initialized"); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetBreakpointContainerImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetBreakpointContainerImpl.java deleted file mode 100644 index 6737f66d07..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetBreakpointContainerImpl.java +++ /dev/null @@ -1,126 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import agent.dbgeng.manager.DbgCause; -import agent.dbgeng.manager.DbgProcess; -import agent.dbgeng.manager.breakpoint.DbgBreakpointInfo; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgeng.model.iface2.*; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.TargetBreakpointSpec.TargetBreakpointKind; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "BreakpointContainer", - elements = { // - @TargetElementType(type = DbgModelTargetBreakpointSpecImpl.class) // - }, - attributes = { // - @TargetAttributeType(type = Void.class) // - }, - canonicalContainer = true) -public class DbgModelTargetBreakpointContainerImpl extends DbgModelTargetObjectImpl - implements DbgModelTargetBreakpointContainer { - - protected static final TargetBreakpointKindSet SUPPORTED_KINDS = - TargetBreakpointKindSet.of(TargetBreakpointKind.values()); - - public DbgModelTargetBreakpointContainerImpl(DbgModelTargetDebugContainer debug) { - super(debug.getModel(), debug, "Breakpoints", "BreakpointContainer"); - - getManager().addEventsListener(this); - - changeAttributes(List.of(), List.of(), Map.of( // - // TODO: Seems terrible to duplicate this static attribute on each instance - SUPPORTED_BREAK_KINDS_ATTRIBUTE_NAME, SUPPORTED_KINDS // - ), "Initialized"); - } - - private boolean isMatch(DbgBreakpointInfo info) { - DbgProcess bptProc = info.getProc(); - DbgModelTargetProcess parentProcess = getParentProcess(); - return parentProcess.getProcess().equals(bptProc); - } - - @Override - public void breakpointCreated(DbgBreakpointInfo info, DbgCause cause) { - if (!isMatch(info)) { - return; - } - changeElements(List.of(), List.of(getTargetBreakpointSpec(info)), Map.of(), "Created"); - } - - @Override - public void breakpointModified(DbgBreakpointInfo newInfo, DbgBreakpointInfo oldInfo, - DbgCause cause) { - if (!isMatch(newInfo)) { - return; - } - getTargetBreakpointSpec(oldInfo).updateInfo(oldInfo, newInfo, "Modified"); - } - - @Override - public void breakpointDeleted(DbgBreakpointInfo info, DbgCause cause) { - if (!isMatch(info)) { - return; - } - DbgModelImpl impl = (DbgModelImpl) model; - impl.deleteModelObject(info.getDebugBreakpoint()); - changeElements(List.of( // - DbgModelTargetBreakpointSpecImpl.indexBreakpoint(info) // - ), List.of(), Map.of(), "Deleted"); - } - - @Override - public void breakpointHit(DbgBreakpointInfo info, DbgCause cause) { - DbgModelTargetThread targetThread = - getParentProcess().getThreads().getTargetThread(getManager().getEventThread()); - DbgModelTargetBreakpointSpec spec = getTargetBreakpointSpec(info); - broadcast().breakpointHit(getProxy(), targetThread, null, spec, spec); - spec.breakpointHit(); - } - - public DbgModelTargetBreakpointSpec getTargetBreakpointSpec(DbgBreakpointInfo info) { - DbgModelImpl impl = (DbgModelImpl) model; - TargetObject modelObject = impl.getModelObject(info.getDebugBreakpoint()); - if (modelObject != null) { - return (DbgModelTargetBreakpointSpec) modelObject; - } - return new DbgModelTargetBreakpointSpecImpl(this, info); - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - DbgManagerImpl manager = getManager(); - return manager.listBreakpoints().thenAccept(byNumber -> { - List specs; - synchronized (this) { - specs = byNumber.values() - .stream() - .map(this::getTargetBreakpointSpec) - .collect(Collectors.toList()); - } - setElements(specs, Map.of(), "Refreshed"); - }); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetBreakpointSpecImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetBreakpointSpecImpl.java deleted file mode 100644 index 94356b94af..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetBreakpointSpecImpl.java +++ /dev/null @@ -1,169 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.manager.breakpoint.DbgBreakpointInfo; -import agent.dbgeng.model.iface2.DbgModelTargetBreakpointContainer; -import agent.dbgeng.model.iface2.DbgModelTargetBreakpointSpec; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.TargetBreakpointLocation; -import ghidra.dbg.target.TargetBreakpointSpec; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; -import ghidra.dbg.util.PathUtils; -import ghidra.util.datastruct.ListenerSet; - -@TargetObjectSchemaInfo( - name = "BreakpointSpec", - attributes = { - @TargetAttributeType( - name = TargetBreakpointSpec.CONTAINER_ATTRIBUTE_NAME, - type = DbgModelTargetBreakpointContainerImpl.class), - @TargetAttributeType( - name = TargetBreakpointLocation.SPEC_ATTRIBUTE_NAME, - type = DbgModelTargetBreakpointSpecImpl.class), - @TargetAttributeType( - name = DbgModelTargetBreakpointSpec.BPT_TYPE_ATTRIBUTE_NAME, - type = String.class), - @TargetAttributeType( - name = DbgModelTargetBreakpointSpec.BPT_DISP_ATTRIBUTE_NAME, - type = String.class), - @TargetAttributeType( - name = DbgModelTargetBreakpointSpec.BPT_PENDING_ATTRIBUTE_NAME, - type = String.class), - @TargetAttributeType( - name = DbgModelTargetBreakpointSpec.BPT_TIMES_ATTRIBUTE_NAME, - type = Integer.class), - @TargetAttributeType(type = Void.class) // - }, - canonicalContainer = true) -public class DbgModelTargetBreakpointSpecImpl extends DbgModelTargetObjectImpl - implements DbgModelTargetBreakpointSpec { - - protected static String indexBreakpoint(DbgBreakpointInfo info) { - return PathUtils.makeIndex(info.getNumber()); - } - - protected static String keyBreakpoint(DbgBreakpointInfo info) { - return PathUtils.makeKey(indexBreakpoint(info)); - } - - protected DbgBreakpointInfo info; - protected boolean enabled; - - public void changeAttributeSet(String reason) { - this.changeAttributes(List.of(), List.of(), - Map.of(DISPLAY_ATTRIBUTE_NAME, "[" + info.getNumber() + "] " + info.getExpression(), - RANGE_ATTRIBUTE_NAME, doGetRange(), SPEC_ATTRIBUTE_NAME, this, - EXPRESSION_ATTRIBUTE_NAME, info.getExpression(), KINDS_ATTRIBUTE_NAME, getKinds(), - - BPT_TYPE_ATTRIBUTE_NAME, info.getType().name(), BPT_DISP_ATTRIBUTE_NAME, - info.getDisp().name(), BPT_PENDING_ATTRIBUTE_NAME, info.getPending(), - BPT_TIMES_ATTRIBUTE_NAME, info.getTimes()), - reason); - } - - // Use strong references on actions - // The values may be weak, but the keys, which are the same objects, are strong - private final ListenerSet actions = - new ListenerSet<>(TargetBreakpointAction.class, false); - - public DbgModelTargetBreakpointSpecImpl(DbgModelTargetBreakpointContainer breakpoints, - DbgBreakpointInfo info) { - super(breakpoints.getModel(), breakpoints, keyBreakpoint(info), "BreakpointSpec"); - this.getModel().addModelObject(info.getDebugBreakpoint(), this); - //this.setBreakpointInfo(info); - - updateInfo(null, info, "Created"); - } - - @Override - public void updateInfo(DbgBreakpointInfo oldInfo, DbgBreakpointInfo newInfo, String reason) { - synchronized (this) { - assert oldInfo == getBreakpointInfo(); - setBreakpointInfo(newInfo); - } - changeAttributeSet("Refreshed"); - setEnabled(newInfo.isEnabled(), reason); - } - - @Override - public DbgBreakpointInfo getBreakpointInfo() { - return info; - } - - @Override - public void setBreakpointId(String id) { - throw new AssertionError(); - } - - @Override - public void setBreakpointInfo(DbgBreakpointInfo info) { - this.info = info; - } - - /** - * Update the enabled field - * - * This does not actually toggle the breakpoint. It just updates the field and calls the proper - * listeners. To actually toggle the breakpoint, use {@link #toggle(boolean)} instead, which if - * effective, should eventually cause this method to be called. - * - * @param enabled true if enabled, false if disabled - * @param reason a description of the cause (not really used, yet) - */ - @Override - public void setEnabled(boolean enabled, String reason) { - setBreakpointEnabled(enabled); - changeAttributes(List.of(), List.of(), Map.of(ENABLED_ATTRIBUTE_NAME, enabled // - ), reason); - } - - @Override - public boolean isBreakpointEnabled() { - return enabled; - } - - @Override - public void setBreakpointEnabled(boolean enabled) { - this.enabled = enabled; - } - - @Override - public ListenerSet getActions() { - return actions; - } - - protected CompletableFuture getInfo() { - return getManager().listBreakpoints() - .thenApply(__ -> getManager().getKnownBreakpoints().get(getNumber())); - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - return getInfo().thenAccept(i -> { - synchronized (this) { - setBreakpointInfo(i); - } - changeAttributeSet("Initialized"); - }); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetConnectorContainerImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetConnectorContainerImpl.java deleted file mode 100644 index 994184e4dc..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetConnectorContainerImpl.java +++ /dev/null @@ -1,93 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.impl; - -import java.util.List; -import java.util.Map; - -import agent.dbgeng.model.iface2.DbgModelTargetConnector; -import agent.dbgeng.model.iface2.DbgModelTargetRoot; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; - -@TargetObjectSchemaInfo( - name = "ConnectorContainer", - attributes = { - @TargetAttributeType( - name = "Launch process", - type = DbgModelTargetProcessLaunchConnectorImpl.class, - required = true, - fixed = true), - @TargetAttributeType( - name = "Attach to process", - type = DbgModelTargetProcessAttachConnectorImpl.class, - required = true, - fixed = true), - @TargetAttributeType( - name = "Load trace/dump", - type = DbgModelTargetTraceOrDumpConnectorImpl.class, - required = true, - fixed = true), - @TargetAttributeType( - name = "Attach to kernel", - type = DbgModelTargetKernelConnectorImpl.class, - required = true, - fixed = true), - @TargetAttributeType(type = Void.class) - }, - canonicalContainer = true) -public class DbgModelTargetConnectorContainerImpl extends DbgModelTargetObjectImpl { - - protected final DbgModelTargetRoot root; - - private DbgModelTargetConnector defaultConnector; - - protected final DbgModelTargetProcessLaunchConnectorImpl processLauncher; - protected final DbgModelTargetProcessAttachConnectorImpl processAttacher; - protected final DbgModelTargetTraceOrDumpConnectorImpl traceLoader; - protected final DbgModelTargetKernelConnectorImpl kernelAttacher; - - public DbgModelTargetConnectorContainerImpl(DbgModelTargetRoot root) { - super(root.getModel(), root, "Connectors", "ConnectorsContainer"); - this.root = root; - - this.processLauncher = new DbgModelTargetProcessLaunchConnectorImpl(this, "Launch process"); - this.processAttacher = - new DbgModelTargetProcessAttachConnectorImpl(this, "Attach to process"); - this.traceLoader = new DbgModelTargetTraceOrDumpConnectorImpl(this, "Load trace/dump"); - this.kernelAttacher = new DbgModelTargetKernelConnectorImpl(this, "Attach to kernel"); - this.defaultConnector = processLauncher; - - changeAttributes(List.of(), List.of( // - processAttacher, // - processLauncher, // - traceLoader, // - kernelAttacher // - ), Map.of( // - DISPLAY_ATTRIBUTE_NAME, "Connectors" // - ), "Initialized"); - } - - public DbgModelTargetConnector getDefaultConnector() { - return defaultConnector; - } - - public void setDefaultConnector(DbgModelTargetConnector defaultConnector) { - this.defaultConnector = defaultConnector; - root.setDefaultConnector(defaultConnector); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetContinuationOptionImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetContinuationOptionImpl.java deleted file mode 100644 index a1f0747698..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetContinuationOptionImpl.java +++ /dev/null @@ -1,91 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.dbgeng.DebugControl.DebugFilterContinuationOption; -import agent.dbgeng.manager.cmd.DbgToggleContinuationCommand; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgeng.model.iface2.*; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "ContinuationFilter", - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType(type = Object.class) }) -public class DbgModelTargetContinuationOptionImpl extends DbgModelTargetObjectImpl - implements DbgModelTargetEventOption { - - private DbgModelTargetEvent event; - private DebugFilterContinuationOption optionCont; - - public DbgModelTargetContinuationOptionImpl(DbgModelTargetEvent event, - DebugFilterContinuationOption option) { - super(event.getModel(), event, "Continue", "ContinuationFilter"); - this.getModel().addModelObject(option, this); - this.event = event; - this.optionCont = option; - setAttributes(); - } - - public DbgModelTargetContinuationOptionImpl(DbgModelTargetException exc, - DebugFilterContinuationOption option) { - super(exc.getModel(), exc, "Continue", "ContinuationFilter"); - this.event = exc; - this.getModel().addModelObject(option, this); - this.optionCont = option; - setAttributes(); - } - - @Override - public CompletableFuture disable() { - return setOption(DebugFilterContinuationOption.DEBUG_FILTER_GO_NOT_HANDLED.ordinal()); - } - - @Override - public CompletableFuture enable() { - return setOption(DebugFilterContinuationOption.DEBUG_FILTER_GO_HANDLED.ordinal()); - } - - @Override - public Integer getOption() { - return optionCont.ordinal(); - } - - @Override - public CompletableFuture setOption(int ordinal) { - DbgManagerImpl manager = getManager(); - optionCont = DebugFilterContinuationOption.getByNumber(ordinal); - setAttributes(); - return manager.execute( - new DbgToggleContinuationCommand(manager, event.getEventIndex(), optionCont)); - } - - public void setAttributes() { - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getName() + " : " + optionCont.description, // - VALUE_ATTRIBUTE_NAME, optionCont.val, // - ENABLED_ATTRIBUTE_NAME, - optionCont.equals(DebugFilterContinuationOption.DEBUG_FILTER_GO_HANDLED)), - "Refreshed"); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetDebugContainerImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetDebugContainerImpl.java deleted file mode 100644 index b09f64641c..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetDebugContainerImpl.java +++ /dev/null @@ -1,71 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.impl; - -import java.util.List; -import java.util.Map; - -import agent.dbgeng.model.iface2.DbgModelTargetDebugContainer; -import agent.dbgeng.model.iface2.DbgModelTargetProcess; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; - -@TargetObjectSchemaInfo( - name = "DebugContainer", - attributes = { - @TargetAttributeType( - name = "Breakpoints", - type = DbgModelTargetBreakpointContainerImpl.class, - required = true, - fixed = true), - @TargetAttributeType( - name = "Events", - type = DbgModelTargetEventContainerImpl.class, - required = true, - fixed = true), - @TargetAttributeType( - name = "Exceptions", - type = DbgModelTargetExceptionContainerImpl.class, - required = true, - fixed = true), - @TargetAttributeType(type = Void.class) - }, - canonicalContainer = true) -public class DbgModelTargetDebugContainerImpl extends DbgModelTargetObjectImpl - implements DbgModelTargetDebugContainer { - - protected final DbgModelTargetBreakpointContainerImpl breakpoints; - protected DbgModelTargetEventContainerImpl events; - protected DbgModelTargetExceptionContainerImpl exceptions; - - private DbgModelTargetProcess process; - - public DbgModelTargetDebugContainerImpl(DbgModelTargetProcess process) { - super(process.getModel(), process, "Debug", "DebugContainer"); - this.process = process; - - this.breakpoints = new DbgModelTargetBreakpointContainerImpl(this); - this.events = new DbgModelTargetEventContainerImpl(this); - this.exceptions = new DbgModelTargetExceptionContainerImpl(this); - - changeAttributes(List.of(), List.of( // - breakpoints, // - events, // - exceptions // - ), Map.of(), "Initialized"); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetEventContainerImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetEventContainerImpl.java deleted file mode 100644 index 0945f11092..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetEventContainerImpl.java +++ /dev/null @@ -1,87 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import agent.dbgeng.manager.DbgEventFilter; -import agent.dbgeng.manager.cmd.DbgListEventFiltersCommand; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgeng.manager.impl.DbgProcessImpl; -import agent.dbgeng.model.iface2.*; -import ghidra.async.AsyncUtils; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.*; -import ghidra.util.datastruct.WeakValueHashMap; - -@TargetObjectSchemaInfo( - name = "EventContainer", - elements = { - @TargetElementType(type = DbgModelTargetEventImpl.class) }, - attributes = { - @TargetAttributeType(type = Void.class) }, - canonicalContainer = true) -public class DbgModelTargetEventContainerImpl extends DbgModelTargetObjectImpl - implements DbgModelTargetEventContainer { - - protected final DbgModelTargetDebugContainer debug; - - protected final Map events = - new WeakValueHashMap<>(); - - public DbgModelTargetEventContainerImpl(DbgModelTargetDebugContainer debug) { - super(debug.getModel(), debug, "Events", "EventContainer"); - this.debug = debug; - requestElements(RefreshBehavior.REFRESH_ALWAYS); - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - DbgModelTargetProcess targetProcess = getParentProcess(); - DbgProcessImpl currentProcess = getManager().getCurrentProcess(); - if (!refresh.equals(RefreshBehavior.REFRESH_ALWAYS) || - (currentProcess != null && !currentProcess.equals(targetProcess.getProcess()))) { - return AsyncUtils.nil(); - } - return listEventFilters().thenAccept(byName -> { - List eventObjs; - synchronized (this) { - eventObjs = byName.stream().map(this::getTargetEvent).collect(Collectors.toList()); - } - setElements(eventObjs, Map.of(), "Refreshed"); - }); - } - - public synchronized DbgModelTargetEvent getTargetEvent(DbgEventFilter filter) { - String id = filter.getName(); - DbgModelTargetEventImpl event = events.get(id); - if (event != null && event.getFilter().getName().equals(id)) { - return event; - } - event = new DbgModelTargetEventImpl(this, filter); - events.put(filter.getName(), event); - return event; - } - - public CompletableFuture> listEventFilters() { - DbgManagerImpl manager = getManager(); - return manager.execute(new DbgListEventFiltersCommand(manager)); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetEventImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetEventImpl.java deleted file mode 100644 index 5b81bccf80..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetEventImpl.java +++ /dev/null @@ -1,209 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.impl; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.dbgeng.DebugControl.*; -import agent.dbgeng.manager.DbgCause; -import agent.dbgeng.manager.DbgEventFilter; -import agent.dbgeng.manager.cmd.DbgSetFilterArgumentCommand; -import agent.dbgeng.manager.cmd.DbgSetFilterCommandCommand; -import agent.dbgeng.manager.evt.*; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgeng.model.iface2.*; -import ghidra.async.AsyncUtils; -import ghidra.dbg.error.DebuggerIllegalArgumentException; -import ghidra.dbg.target.TargetMethod.ParameterDescription; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.util.PathUtils; - -@TargetObjectSchemaInfo( - name = "Event", - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType(type = Object.class) }) -public class DbgModelTargetEventImpl extends DbgModelTargetObjectImpl - implements DbgModelTargetEvent { - - final String COMMAND_ATTRIBUTE_NAME = "Command"; - final String ARGUMENT_ATTRIBUTE_NAME = "Argument"; - final String CONTINUE_OPTION_ATTRIBUTE_NAME = "Continue"; - final String EXECUTE_OPTION_ATTRIBUTE_NAME = "Execute"; - - protected static String indexFilter(DbgEventFilter filter) { - return filter.getName(); - } - - protected static String keyFilter(DbgEventFilter filter) { - return PathUtils.makeKey(indexFilter(filter)); - } - - protected DbgModelTargetEventOption execOption; - protected DbgModelTargetEventOption contOption; - - private DbgEventFilter filter; - - public DbgModelTargetEventImpl(DbgModelTargetEventContainer events, DbgEventFilter filter) { - super(events.getModel(), events, keyFilter(filter), "EventFilter"); - this.getModel().addModelObject(filter, this); - this.filter = filter; - - DebugFilterExecutionOption exec = - DebugFilterExecutionOption.getByNumber(filter.getExecutionOption()); - DebugFilterContinuationOption cont = - DebugFilterContinuationOption.getByNumber(filter.getContinueOption()); - execOption = new DbgModelTargetExecutionOptionImpl(this, exec); - contOption = new DbgModelTargetContinuationOptionImpl(this, cont); - - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getIndex(), // - COMMAND_ATTRIBUTE_NAME, filter.getCmd(), // - ARGUMENT_ATTRIBUTE_NAME, filter.getArg(), // - EXECUTE_OPTION_ATTRIBUTE_NAME, execOption, // - CONTINUE_OPTION_ATTRIBUTE_NAME, contOption // - ), "Initialized"); - - getManager().addEventsListener(this); - } - - @Override - public DbgEventFilter getFilter() { - return filter; - } - - @Override - public int getEventIndex() { - return filter.getIndex(); - } - - @Override - public void eventSelected(AbstractDbgEvent event, DbgCause cause) { - changeAttributes(List.of(), List.of(), Map.of( // - MODIFIED_ATTRIBUTE_NAME, false), "Refreshed"); - if (event instanceof DbgThreadCreatedEvent && - getEventIndex() == DebugFilterOrdinals.DEBUG_FILTER_CREATE_THREAD.ordinal()) { - changeAttributes(List.of(), List.of(), Map.of( // - MODIFIED_ATTRIBUTE_NAME, true), "Refreshed"); - } - if (event instanceof DbgThreadExitedEvent && - getEventIndex() == DebugFilterOrdinals.DEBUG_FILTER_EXIT_THREAD.ordinal()) { - changeAttributes(List.of(), List.of(), Map.of( // - MODIFIED_ATTRIBUTE_NAME, true), "Refreshed"); - } - if (event instanceof DbgProcessCreatedEvent && - getEventIndex() == DebugFilterOrdinals.DEBUG_FILTER_CREATE_PROCESS.ordinal()) { - changeAttributes(List.of(), List.of(), Map.of( // - MODIFIED_ATTRIBUTE_NAME, true), "Refreshed"); - } - if (event instanceof DbgProcessExitedEvent && - getEventIndex() == DebugFilterOrdinals.DEBUG_FILTER_EXIT_PROCESS.ordinal()) { - changeAttributes(List.of(), List.of(), Map.of( // - MODIFIED_ATTRIBUTE_NAME, true), "Refreshed"); - } - if (event instanceof DbgModuleLoadedEvent && - getEventIndex() == DebugFilterOrdinals.DEBUG_FILTER_LOAD_MODULE.ordinal()) { - changeAttributes(List.of(), List.of(), Map.of( // - MODIFIED_ATTRIBUTE_NAME, true), "Refreshed"); - } - if (event instanceof DbgModuleUnloadedEvent && - getEventIndex() == DebugFilterOrdinals.DEBUG_FILTER_UNLOAD_MODULE.ordinal()) { - changeAttributes(List.of(), List.of(), Map.of( // - MODIFIED_ATTRIBUTE_NAME, true), "Refreshed"); - } - if (event instanceof DbgInitialBreakpointEvent && - getEventIndex() == DebugFilterOrdinals.DEBUG_FILTER_INITIAL_BREAKPOINT.ordinal()) { - changeAttributes(List.of(), List.of(), Map.of( // - MODIFIED_ATTRIBUTE_NAME, true), "Refreshed"); - } - if (event instanceof DbgInitialModuleLoadEvent && - getEventIndex() == DebugFilterOrdinals.DEBUG_FILTER_INITIAL_MODULE_LOAD.ordinal()) { - changeAttributes(List.of(), List.of(), Map.of( // - MODIFIED_ATTRIBUTE_NAME, true), "Refreshed"); - } - if (event instanceof DbgSystemErrorEvent && - getEventIndex() == DebugFilterOrdinals.DEBUG_FILTER_SYSTEM_ERROR.ordinal()) { - changeAttributes(List.of(), List.of(), Map.of( // - MODIFIED_ATTRIBUTE_NAME, true), "Refreshed"); - } - if (event instanceof DbgConsoleOutputEvent && - getEventIndex() == DebugFilterOrdinals.DEBUG_FILTER_DEBUGGEE_OUTPUT.ordinal()) { - changeAttributes(List.of(), List.of(), Map.of( // - MODIFIED_ATTRIBUTE_NAME, true), "Refreshed"); - } - } - - @Override - public Map> getConfigurableOptions() { - Map> map = new HashMap<>(); - ParameterDescription cmdDesc = ParameterDescription.create(String.class, - COMMAND_ATTRIBUTE_NAME, false, "", COMMAND_ATTRIBUTE_NAME, "filter command"); - map.put(COMMAND_ATTRIBUTE_NAME, cmdDesc); - ParameterDescription argDesc = - ParameterDescription.create(String.class, ARGUMENT_ATTRIBUTE_NAME, false, "", - ARGUMENT_ATTRIBUTE_NAME, "filter argument"); - map.put(ARGUMENT_ATTRIBUTE_NAME, argDesc); - ParameterDescription execDesc = - ParameterDescription.create(Integer.class, EXECUTE_OPTION_ATTRIBUTE_NAME, false, - execOption.getOption(), EXECUTE_OPTION_ATTRIBUTE_NAME, "filter execution option"); - map.put(EXECUTE_OPTION_ATTRIBUTE_NAME, execDesc); - ParameterDescription contDesc = - ParameterDescription.create(Integer.class, CONTINUE_OPTION_ATTRIBUTE_NAME, false, - contOption.getOption(), CONTINUE_OPTION_ATTRIBUTE_NAME, - "filter continuation option"); - map.put(CONTINUE_OPTION_ATTRIBUTE_NAME, contDesc); - return map; - } - - @Override - public CompletableFuture writeConfigurationOption(String key, Object value) { - DbgManagerImpl manager = getManager(); - switch (key) { - case COMMAND_ATTRIBUTE_NAME: - if (value instanceof String) { - this.changeAttributes(List.of(), Map.of(COMMAND_ATTRIBUTE_NAME, value), - "Modified"); - String cmd = (String) getCachedAttribute(COMMAND_ATTRIBUTE_NAME); - return manager.execute( - new DbgSetFilterCommandCommand(manager, getEventIndex(), cmd)); - } - throw new DebuggerIllegalArgumentException("Command should be a string"); - case ARGUMENT_ATTRIBUTE_NAME: - if (value instanceof String) { - this.changeAttributes(List.of(), Map.of(ARGUMENT_ATTRIBUTE_NAME, value), - "Modified"); - String cmd = (String) getCachedAttribute(ARGUMENT_ATTRIBUTE_NAME); - return manager.execute( - new DbgSetFilterArgumentCommand(manager, getEventIndex(), cmd)); - } - throw new DebuggerIllegalArgumentException("Argument should be a string"); - case EXECUTE_OPTION_ATTRIBUTE_NAME: - if (value instanceof Integer) { - return execOption.setOption((Integer) value); - } - throw new DebuggerIllegalArgumentException("Option should be numeric"); - case CONTINUE_OPTION_ATTRIBUTE_NAME: - if (value instanceof Integer) { - return contOption.setOption((Integer) value); - } - throw new DebuggerIllegalArgumentException("Option should be numeric"); - default: - } - return AsyncUtils.nil(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetExceptionContainerImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetExceptionContainerImpl.java deleted file mode 100644 index c36a559096..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetExceptionContainerImpl.java +++ /dev/null @@ -1,88 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import agent.dbgeng.manager.DbgExceptionFilter; -import agent.dbgeng.manager.cmd.DbgListExceptionFiltersCommand; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgeng.manager.impl.DbgProcessImpl; -import agent.dbgeng.model.iface2.*; -import ghidra.async.AsyncUtils; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.*; -import ghidra.util.datastruct.WeakValueHashMap; - -@TargetObjectSchemaInfo( - name = "ExceptionContainer", - elements = { - @TargetElementType(type = DbgModelTargetExceptionImpl.class) }, - attributes = { - @TargetAttributeType(type = Void.class) }, - canonicalContainer = true) -public class DbgModelTargetExceptionContainerImpl extends DbgModelTargetObjectImpl - implements DbgModelTargetExceptionContainer { - - protected final DbgModelTargetDebugContainer debug; - - protected final Map exceptions = - new WeakValueHashMap<>(); - - public DbgModelTargetExceptionContainerImpl(DbgModelTargetDebugContainer debug) { - super(debug.getModel(), debug, "Exceptions", "ExceptionContainer"); - this.debug = debug; - requestElements(RefreshBehavior.REFRESH_ALWAYS); - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - DbgModelTargetProcess targetProcess = getParentProcess(); - DbgProcessImpl currentProcess = getManager().getCurrentProcess(); - if (!refresh.equals(RefreshBehavior.REFRESH_ALWAYS) || - (currentProcess != null && !currentProcess.equals(targetProcess.getProcess()))) { - return AsyncUtils.nil(); - } - return listExceptionFilters().thenAccept(byName -> { - List excObjs; - synchronized (this) { - excObjs = - byName.stream().map(this::getTargetException).collect(Collectors.toList()); - } - setElements(excObjs, Map.of(), "Refreshed"); - }); - } - - public synchronized DbgModelTargetException getTargetException(DbgExceptionFilter filter) { - String id = filter.getName(); - DbgModelTargetExceptionImpl exc = exceptions.get(id); - if (exc != null && exc.getFilter().getName().equals(id)) { - return exc; - } - exc = new DbgModelTargetExceptionImpl(this, filter); - exceptions.put(filter.getName(), exc); - return exc; - } - - public CompletableFuture> listExceptionFilters() { - DbgManagerImpl manager = getManager(); - return manager.execute(new DbgListExceptionFiltersCommand(manager)); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetExceptionImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetExceptionImpl.java deleted file mode 100644 index 5c1869c54a..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetExceptionImpl.java +++ /dev/null @@ -1,177 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.impl; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.dbgeng.DebugControl.DebugFilterContinuationOption; -import agent.dbgeng.dbgeng.DebugControl.DebugFilterExecutionOption; -import agent.dbgeng.dbgeng.DebugExceptionRecord64; -import agent.dbgeng.manager.DbgCause; -import agent.dbgeng.manager.DbgExceptionFilter; -import agent.dbgeng.manager.cmd.DbgSetFilterCommandCommand; -import agent.dbgeng.manager.cmd.DbgSetFilterSecondChanceCmdCommand; -import agent.dbgeng.manager.evt.AbstractDbgEvent; -import agent.dbgeng.manager.evt.DbgExceptionEvent; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgeng.model.iface1.DbgModelTargetFocusScope; -import agent.dbgeng.model.iface2.*; -import ghidra.async.AsyncUtils; -import ghidra.dbg.error.DebuggerIllegalArgumentException; -import ghidra.dbg.target.TargetFocusScope; -import ghidra.dbg.target.TargetMethod.ParameterDescription; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.util.PathUtils; - -@TargetObjectSchemaInfo(name = "Exception", elements = { - @TargetElementType(type = Void.class) }, attributes = { - @TargetAttributeType(type = Object.class) }) -public class DbgModelTargetExceptionImpl extends DbgModelTargetObjectImpl - implements DbgModelTargetException { - - final String COMMAND_ATTRIBUTE_NAME = "Command"; - final String COMMAND2_ATTRIBUTE_NAME = "SecondCmd"; - final String CONTINUE_OPTION_ATTRIBUTE_NAME = "Continue"; - final String EXECUTE_OPTION_ATTRIBUTE_NAME = "Execute"; - final String EXCEPTION_CODE_ATTRIBUTE_NAME = "Exception"; - - protected static String indexFilter(DbgExceptionFilter filter) { - return filter.getName(); - } - - protected static String keyFilter(DbgExceptionFilter filter) { - return PathUtils.makeKey(indexFilter(filter)); - } - - protected DbgModelTargetEventOption execOption; - protected DbgModelTargetEventOption contOption; - - private DbgExceptionFilter filter; - - public DbgModelTargetExceptionImpl(DbgModelTargetExceptionContainer exceptions, - DbgExceptionFilter filter) { - super(exceptions.getModel(), exceptions, keyFilter(filter), "ExceptionFilter"); - this.getModel().addModelObject(filter, this); - this.filter = filter; - - DebugFilterExecutionOption exec = - DebugFilterExecutionOption.getByNumber(filter.getExecutionOption()); - DebugFilterContinuationOption cont = - DebugFilterContinuationOption.getByNumber(filter.getContinueOption()); - execOption = new DbgModelTargetExecutionOptionImpl(this, exec); - contOption = new DbgModelTargetContinuationOptionImpl(this, cont); - - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getIndex(), // - COMMAND_ATTRIBUTE_NAME, filter.getCmd(), // - COMMAND2_ATTRIBUTE_NAME, filter.getCmd(), // - EXECUTE_OPTION_ATTRIBUTE_NAME, execOption, // - CONTINUE_OPTION_ATTRIBUTE_NAME, contOption, // - EXCEPTION_CODE_ATTRIBUTE_NAME, filter.getExceptionCode() // - ), "Initialized"); - - getManager().addEventsListener(this); - } - - @Override - public DbgExceptionFilter getFilter() { - return filter; - } - - @Override - public int getEventIndex() { - return filter.getIndex(); - } - - @Override - public void eventSelected(AbstractDbgEvent event, DbgCause cause) { - DbgManagerImpl manager = getManager(); - changeAttributes(List.of(), List.of(), Map.of( // - MODIFIED_ATTRIBUTE_NAME, false), "Refreshed"); - if (event instanceof DbgExceptionEvent) { - DebugExceptionRecord64 info = (DebugExceptionRecord64) event.getInfo(); - if (info.code == Long.parseLong(filter.getExceptionCode(), 16)) { - ((DbgModelTargetFocusScope) searchForSuitable(TargetFocusScope.class)) - .setFocus(this); - changeAttributes(List.of(), List.of(), Map.of( // - MODIFIED_ATTRIBUTE_NAME, true), "Refreshed"); - manager.getEventListeners() - .invoke() - .consoleOutput("Exception " + filter.getExceptionCode() + " : " + - filter.getName() + "\n", 0); - } - } - } - - @Override - public Map> getConfigurableOptions() { - Map> map = new HashMap<>(); - ParameterDescription cmdDesc = ParameterDescription.create(String.class, - COMMAND_ATTRIBUTE_NAME, false, "", COMMAND_ATTRIBUTE_NAME, "filter command"); - map.put(COMMAND_ATTRIBUTE_NAME, cmdDesc); - ParameterDescription cmdDesc2 = - ParameterDescription.create(String.class, COMMAND2_ATTRIBUTE_NAME, false, "", - COMMAND2_ATTRIBUTE_NAME, "filter 2nd-chance command"); - map.put(COMMAND2_ATTRIBUTE_NAME, cmdDesc2); - ParameterDescription execDesc = - ParameterDescription.create(Integer.class, EXECUTE_OPTION_ATTRIBUTE_NAME, false, - execOption.getOption(), EXECUTE_OPTION_ATTRIBUTE_NAME, "filter execution option"); - map.put(EXECUTE_OPTION_ATTRIBUTE_NAME, execDesc); - ParameterDescription contDesc = ParameterDescription.create(Integer.class, - CONTINUE_OPTION_ATTRIBUTE_NAME, false, contOption.getOption(), - CONTINUE_OPTION_ATTRIBUTE_NAME, "filter continuation option"); - map.put(CONTINUE_OPTION_ATTRIBUTE_NAME, contDesc); - return map; - } - - @Override - public CompletableFuture writeConfigurationOption(String key, Object value) { - DbgManagerImpl manager = getManager(); - switch (key) { - case COMMAND_ATTRIBUTE_NAME: - if (value instanceof String) { - this.changeAttributes(List.of(), Map.of(COMMAND_ATTRIBUTE_NAME, value), - "Modified"); - String cmd = (String) getCachedAttribute(COMMAND_ATTRIBUTE_NAME); - return manager - .execute(new DbgSetFilterCommandCommand(manager, getEventIndex(), cmd)); - } - throw new DebuggerIllegalArgumentException("Command should be a string"); - case COMMAND2_ATTRIBUTE_NAME: - if (value instanceof String) { - this.changeAttributes(List.of(), Map.of(COMMAND2_ATTRIBUTE_NAME, value), - "Modified"); - String cmd = (String) getCachedAttribute(COMMAND2_ATTRIBUTE_NAME); - return manager.execute( - new DbgSetFilterSecondChanceCmdCommand(manager, getEventIndex(), cmd)); - } - throw new DebuggerIllegalArgumentException("Command should be a string"); - case EXECUTE_OPTION_ATTRIBUTE_NAME: - if (value instanceof Integer) { - return execOption.setOption((Integer) value); - } - throw new DebuggerIllegalArgumentException("Option should be numeric"); - case CONTINUE_OPTION_ATTRIBUTE_NAME: - if (value instanceof Integer) { - return contOption.setOption((Integer) value); - } - throw new DebuggerIllegalArgumentException("Option should be numeric"); - default: - } - return AsyncUtils.nil(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetExecutionOptionImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetExecutionOptionImpl.java deleted file mode 100644 index 95c8963b79..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetExecutionOptionImpl.java +++ /dev/null @@ -1,91 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.dbgeng.DebugControl.DebugFilterExecutionOption; -import agent.dbgeng.manager.cmd.DbgToggleExecutionCommand; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgeng.model.iface2.*; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "ExecutionOption", - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType(type = Object.class) }) -public class DbgModelTargetExecutionOptionImpl extends DbgModelTargetObjectImpl - implements DbgModelTargetEventOption { - - private DbgModelTargetEvent event; - private DebugFilterExecutionOption optionExc; - - public DbgModelTargetExecutionOptionImpl(DbgModelTargetEvent event, - DebugFilterExecutionOption option) { - super(event.getModel(), event, "Execute", "ExecutionOption"); - this.event = event; - this.getModel().addModelObject(option, this); - this.optionExc = option; - setAttributes(); - } - - public DbgModelTargetExecutionOptionImpl(DbgModelTargetException exc, - DebugFilterExecutionOption option) { - super(exc.getModel(), exc, "Execute", "ExecutionOption"); - this.event = exc; - this.getModel().addModelObject(option, this); - this.optionExc = option; - setAttributes(); - } - - @Override - public CompletableFuture disable() { - return enable(); - } - - @Override - public CompletableFuture enable() { - int ordinal = (optionExc.ordinal() + 1) % (DebugFilterExecutionOption.values().length - 1); - return setOption(ordinal); - } - - @Override - public Integer getOption() { - return optionExc.ordinal(); - } - - @Override - public CompletableFuture setOption(int ordinal) { - DbgManagerImpl manager = getManager(); - optionExc = DebugFilterExecutionOption.getByNumber(ordinal); - setAttributes(); - return manager.execute( - new DbgToggleExecutionCommand(manager, event.getEventIndex(), optionExc)); - } - - public void setAttributes() { - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getName() + " : " + optionExc.description, // - VALUE_ATTRIBUTE_NAME, optionExc.val, // - ENABLED_ATTRIBUTE_NAME, - optionExc.equals(DebugFilterExecutionOption.DEBUG_FILTER_BREAK)), "Refreshed"); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetKernelConnectorImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetKernelConnectorImpl.java deleted file mode 100644 index bc4d0349f6..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetKernelConnectorImpl.java +++ /dev/null @@ -1,90 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.impl; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgeng.model.iface2.DbgModelTargetConnector; -import ghidra.async.AsyncUtils; -import ghidra.async.TypeSpec; -import ghidra.dbg.error.DebuggerUserException; -import ghidra.dbg.target.TargetMethod; -import ghidra.dbg.target.TargetMethod.ParameterDescription; -import ghidra.dbg.target.TargetMethod.TargetParameterMap; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "KernelConnector", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(type = Void.class) - }) -public class DbgModelTargetKernelConnectorImpl extends DbgModelTargetObjectImpl - implements DbgModelTargetConnector { - - protected final DbgModelTargetConnectorContainerImpl connectors; - protected final TargetParameterMap paramDescs; - - public DbgModelTargetKernelConnectorImpl(DbgModelTargetConnectorContainerImpl connectors, - String name) { - super(connectors.getModel(), connectors, name, name); - this.connectors = connectors; - - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDisplay(), // - TargetMethod.PARAMETERS_ATTRIBUTE_NAME, - paramDescs = TargetParameterMap.copyOf(computeParameters()) // - ), "Initialized"); - } - - @Override - public CompletableFuture setActive() { - connectors.setDefaultConnector(this); - return CompletableFuture.completedFuture(null); - } - - protected Map> computeParameters() { - HashMap> map = - new HashMap>(); - ParameterDescription flags = ParameterDescription.create(Long.class, "Flags", true, - 0L, "Flags", "0=target 1=eXDI driver"); - ParameterDescription options = ParameterDescription.create(String.class, "Options", - true, "", "Options", "-k connection options"); - map.put("Flags", flags); - map.put("Options", options); - return map; - } - - @Override - public TargetParameterMap getParameters() { - return TargetMethod.getParameters(this); - } - - @Override - public CompletableFuture launch(Map args) { - return AsyncUtils.sequence(TypeSpec.VOID).then(seq -> { - DbgManagerImpl manager = getManager(); - manager.addProcess(); - manager.attachKernel(args).handle(seq::nextIgnore); - }).finish().exceptionally((exc) -> { - throw new DebuggerUserException("Launch failed for " + args); - }); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetMemoryContainerImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetMemoryContainerImpl.java deleted file mode 100644 index d3a965fc40..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetMemoryContainerImpl.java +++ /dev/null @@ -1,312 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.impl; - -import java.lang.invoke.MethodHandles; -import java.nio.ByteBuffer; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import agent.dbgeng.manager.DbgModuleMemory; -import agent.dbgeng.manager.cmd.DbgListKernelMemoryRegionsCommand; -import agent.dbgeng.manager.cmd.DbgListMemoryRegionsCommand; -import agent.dbgeng.manager.cmd.DbgListOSMemoryRegionsCommand; -import agent.dbgeng.manager.cmd.DbgReadBusDataCommand; -import agent.dbgeng.manager.cmd.DbgReadControlCommand; -import agent.dbgeng.manager.cmd.DbgReadDebuggerDataCommand; -import agent.dbgeng.manager.cmd.DbgReadIoCommand; -import agent.dbgeng.manager.cmd.DbgReadMemoryCommand; -import agent.dbgeng.manager.cmd.DbgReadPhysicalMemoryCommand; -import agent.dbgeng.manager.cmd.DbgWriteBusDataCommand; -import agent.dbgeng.manager.cmd.DbgWriteControlCommand; -import agent.dbgeng.manager.cmd.DbgWriteIoCommand; -import agent.dbgeng.manager.cmd.DbgWriteMemoryCommand; -import agent.dbgeng.manager.cmd.DbgWritePhysicalMemoryCommand; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgeng.manager.impl.DbgProcessImpl; -import agent.dbgeng.model.iface2.DbgModelTargetMemoryContainer; -import agent.dbgeng.model.iface2.DbgModelTargetMemoryRegion; -import agent.dbgeng.model.iface2.DbgModelTargetProcess; -import generic.ULongSpan; -import generic.ULongSpan.ULongSpanSet; -import ghidra.async.AsyncUtils; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.error.DebuggerMemoryAccessException; -import ghidra.dbg.error.DebuggerModelAccessException; -import ghidra.dbg.target.TargetMethod; -import ghidra.dbg.target.TargetMethod.AnnotatedTargetMethod; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetElementType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; -import ghidra.program.model.address.Address; -import ghidra.util.datastruct.WeakValueHashMap; - -@TargetObjectSchemaInfo( - name = "Memory", - elements = { - @TargetElementType(type = DbgModelTargetMemoryRegionImpl.class) }, - attributes = { - @TargetAttributeType(name = "Populate", type = TargetMethod.class), - @TargetAttributeType(type = Void.class) }, - canonicalContainer = true) -public class DbgModelTargetMemoryContainerImpl extends DbgModelTargetObjectImpl - implements DbgModelTargetMemoryContainer { - - protected final DbgModelTargetProcess process; - - protected final Map memoryRegions = - new WeakValueHashMap<>(); - - public DbgModelTargetMemoryContainerImpl(DbgModelTargetProcess process) { - super(process.getModel(), process, "Memory", "MemoryContainer"); - this.process = process; - if (!getModel().isSuppressDescent()) { - requestElements(RefreshBehavior.REFRESH_ALWAYS); - } - DbgManagerImpl manager = getManager(); - if (manager.isKernelMode()) { - changeAttributes(List.of(), List.of(), - AnnotatedTargetMethod.collectExports(MethodHandles.lookup(), getModel(), this), - "Methods"); - } - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - DbgModelTargetProcess targetProcess = getParentProcess(); - DbgProcessImpl currentProcess = getManager().getCurrentProcess(); - if (!refresh.equals(RefreshBehavior.REFRESH_ALWAYS) || - (currentProcess != null && !currentProcess.equals(targetProcess.getProcess()))) { - return AsyncUtils.nil(); - } - return listMemory().thenAccept(byName -> { - List sections; - synchronized (this) { - sections = byName.stream().map(this::getTargetMemory).collect(Collectors.toList()); - } - setElements(sections, Map.of(), "Refreshed"); - }); - } - - @Override - public synchronized DbgModelTargetMemoryRegion getTargetMemory(DbgModuleMemory section) { - DbgModelTargetMemoryRegionImpl region = memoryRegions.get(section.getName()); - if (region != null && region.isSame(section)) { - return region; - } - region = new DbgModelTargetMemoryRegionImpl(this, section); - memoryRegions.put(section.getName(), region); - return region; - // NB: The following logic will cause errors in setElements because of key re-use - //return memoryRegions.computeIfAbsent(section.getName(), - // n -> new DbgModelTargetMemoryRegionImpl(this, section)); - } - - public CompletableFuture> listMemory() { - DbgManagerImpl manager = getManager(); - if (manager.isKernelMode()) { - return manager.execute(new DbgListKernelMemoryRegionsCommand(manager)); - } - if (manager.useAltMemoryQuery()) { - return manager.execute(new DbgListOSMemoryRegionsCommand(manager)); - } - return manager.execute(new DbgListMemoryRegionsCommand(manager)); - } - - public CompletableFuture readVirtualMemory(Address address, int length) { - DbgManagerImpl manager = getManager(); - if (manager.isWaiting()) { - throw new DebuggerModelAccessException( - "Cannot process command readMemory while engine is waiting for events"); - } - ByteBuffer buf = ByteBuffer.allocate(length); - long offset = address.getOffset(); - return process.getProcess().readMemory(offset, buf).thenApply(set -> { - return readAssist(address, buf, offset, set); - }); - } - - private byte[] readAssist(Address address, ByteBuffer buf, long offset, ULongSpanSet set) { - if (set == null) { - return new byte[0]; - } - ULongSpan span = set.spanContaining(offset); - if (span == null) { - throw new DebuggerMemoryAccessException("Cannot read at " + address); - } - broadcast().memoryUpdated(getProxy(), address, buf.array()); - return Arrays.copyOf(buf.array(), (int) span.length()); - } - - public CompletableFuture writeVirtualMemory(Address address, byte[] data) { - DbgManagerImpl manager = getManager(); - if (manager.isWaiting()) { - throw new DebuggerModelAccessException( - "Cannot process command writeMemory while engine is waiting for events"); - } - long offset = address.getOffset(); - return process.getProcess().writeMemory(offset, ByteBuffer.wrap(data)).thenAccept(___ -> { - writeAssist(address, data); - }); - } - - private void writeAssist(Address address, byte[] data) { - broadcast().memoryUpdated(getProxy(), address, data); - } - - @Override - public CompletableFuture readMemory(Address address, int length) { - return model.gateFuture(doReadMemory(address, length)); - } - - protected CompletableFuture doReadMemory(Address address, int length) { - DbgManagerImpl manager = getManager(); - if (manager.isWaiting()) { - throw new DebuggerModelAccessException( - "Cannot process command readMemory while engine is waiting for events"); - } - ByteBuffer buf = ByteBuffer.allocate(length); - long offset = address.getOffset(); - if (!manager.isKernelMode() || address.getAddressSpace().getName().equals("ram")) { - return manager.execute(new DbgReadMemoryCommand(manager, offset, buf, buf.remaining())) - .thenApply(set -> { - return readAssist(address, buf, offset, set); - }); - } - if (address.getAddressSpace().getName().equals("phys")) { - return manager - .execute( - new DbgReadPhysicalMemoryCommand(manager, offset, buf, buf.remaining())) - .thenApply(set -> { - return readAssist(address, buf, offset, set); - }); - } - if (address.getAddressSpace().getName().equals("ctrl")) { - int processor = 0; - return manager - .execute( - new DbgReadControlCommand(manager, offset, buf, buf.remaining(), processor)) - .thenApply(set -> { - return readAssist(address, buf, offset, set); - }); - } - if (address.getAddressSpace().getName().equals("bus")) { - int busDataType = 0; - int busNumber = 0; - int slotNumber = 0; - return manager - .execute(new DbgReadBusDataCommand(manager, offset, buf, buf.remaining(), - busDataType, busNumber, slotNumber)) - .thenApply(set -> { - return readAssist(address, buf, offset, set); - }); - } - if (address.getAddressSpace().getName().equals("io")) { - int interfaceType = 0; - int busNumber = 0; - int addresSpace = 0; - return manager - .execute(new DbgReadIoCommand(manager, offset, buf, buf.remaining(), - interfaceType, busNumber, addresSpace)) - .thenApply(set -> { - return readAssist(address, buf, offset, set); - }); - } - if (address.getAddressSpace().getName().equals("debug")) { - return manager - .execute(new DbgReadDebuggerDataCommand(manager, offset, buf, buf.remaining())) - .thenApply(set -> { - return readAssist(address, buf, offset, set); - }); - } - return CompletableFuture.completedFuture(new byte[length]); - } - - @Override - public CompletableFuture writeMemory(Address address, byte[] data) { - return model.gateFuture(doWriteMemory(address, data)); - } - - protected CompletableFuture doWriteMemory(Address address, byte[] data) { - DbgManagerImpl manager = getManager(); - if (manager.isWaiting()) { - throw new DebuggerModelAccessException( - "Cannot process command writeMemory while engine is waiting for events"); - } - ByteBuffer buf = ByteBuffer.wrap(data); - long offset = address.getOffset(); - if (!manager.isKernelMode() || address.getAddressSpace().getName().equals("ram")) { - return manager.execute(new DbgWriteMemoryCommand(manager, offset, buf, buf.remaining())) - .thenAccept(___ -> { - writeAssist(address, data); - }); - } - if (address.getAddressSpace().getName().equals("phys")) { - return manager - .execute( - new DbgWritePhysicalMemoryCommand(manager, offset, buf, buf.remaining())) - .thenAccept(___ -> { - writeAssist(address, data); - }); - } - if (address.getAddressSpace().getName().equals("ctrl")) { - int processor = 0; - return manager - .execute(new DbgWriteControlCommand(manager, offset, buf, buf.remaining(), - processor)) - .thenAccept(___ -> { - writeAssist(address, data); - }); - } - if (address.getAddressSpace().getName().equals("bus")) { - int busDataType = 0; - int busNumber = 0; - int slotNumber = 0; - return manager - .execute(new DbgWriteBusDataCommand(manager, offset, buf, buf.remaining(), - busDataType, busNumber, slotNumber)) - .thenAccept(___ -> { - writeAssist(address, data); - }); - } - if (address.getAddressSpace().getName().equals("io")) { - int interfaceType = 0; - int busNumber = 0; - int addresSpace = 0; - return manager - .execute(new DbgWriteIoCommand(manager, offset, buf, buf.remaining(), - interfaceType, busNumber, addresSpace)) - .thenAccept(___ -> { - writeAssist(address, data); - }); - } - return CompletableFuture.completedFuture(null); - } - - @TargetMethod.Export("Populate") - public CompletableFuture populate() { - return getManager().listOSMemory().thenAccept(byName -> { - List sections; - synchronized (this) { - sections = byName.stream().map(this::getTargetMemory).collect(Collectors.toList()); - } - setElements(sections, Map.of(), "Refreshed"); - }); - }} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetMemoryRegionImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetMemoryRegionImpl.java deleted file mode 100644 index a4bd855c5f..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetMemoryRegionImpl.java +++ /dev/null @@ -1,149 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.impl; - -import java.util.List; -import java.util.Map; - -import agent.dbgeng.manager.DbgModuleMemory; -import agent.dbgeng.model.iface2.DbgModelTargetMemoryContainer; -import agent.dbgeng.model.iface2.DbgModelTargetMemoryRegion; -import ghidra.dbg.target.TargetMemoryRegion; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.util.PathUtils; -import ghidra.program.model.address.*; - -@TargetObjectSchemaInfo( - name = "MemoryRegion", - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType( - name = TargetMemoryRegion.MEMORY_ATTRIBUTE_NAME, - type = DbgModelTargetMemoryContainerImpl.class), - @TargetAttributeType(name = "BaseAddress", type = Address.class), - @TargetAttributeType(name = "EndAddress", type = Address.class), - @TargetAttributeType(name = "RegionSize", type = String.class), - @TargetAttributeType(name = "AllocationBase", type = Address.class), - @TargetAttributeType(name = "AllocationProtect", type = String.class), - @TargetAttributeType(name = "Protect", type = String.class), - @TargetAttributeType(name = "State", type = String.class), - @TargetAttributeType(name = "Type", type = String.class), - @TargetAttributeType(type = Void.class) }) -public class DbgModelTargetMemoryRegionImpl extends DbgModelTargetObjectImpl - implements DbgModelTargetMemoryRegion { - - protected static String indexSection(DbgModuleMemory section) { - return section.getName(); - } - - protected static String keySection(DbgModuleMemory section) { - return PathUtils.makeKey(indexSection(section)); - } - - protected final DbgModuleMemory section; - protected final AddressRange range; - protected final List protect; - protected final List allocProtect; - private boolean isRead; - private boolean isWrite; - private boolean isExec; - - public DbgModelTargetMemoryRegionImpl(DbgModelTargetMemoryContainer memory, - DbgModuleMemory region) { - super(memory.getModel(), memory, keySection(region), "Region"); - this.getModel().addModelObject(region, this); - this.section = region; - - this.range = doGetRange(section); - allocProtect = region.getAllocationProtect(); - String apx = ""; - for (String p : allocProtect) { - apx += p + ":"; - } - if (apx.length() > 1) { - apx = apx.substring(0, apx.length() - 1); - } - protect = region.getProtect(); - String ipx = ""; - for (String p : protect) { - ipx += p + ":"; - } - if (ipx.length() > 1) { - ipx = ipx.substring(0, ipx.length() - 1); - } - isRead = region.isRead(); - isWrite = region.isWrite(); - isExec = region.isExec(); - - this.changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, computeDisplay(region), // - MEMORY_ATTRIBUTE_NAME, memory, // - RANGE_ATTRIBUTE_NAME, doGetRange(section), // - READABLE_ATTRIBUTE_NAME, isReadable(), // - WRITABLE_ATTRIBUTE_NAME, isWritable(), // - EXECUTABLE_ATTRIBUTE_NAME, isExecutable() // - ), "Initialized"); - - AddressSpace space = getModel().getAddressSpace("ram"); - this.changeAttributes(List.of(), List.of(), Map.of( // - "BaseAddress", space.getAddress(region.getVmaStart()), // - "EndAddress", space.getAddress(region.getVmaEnd()), // - "RegionSize", Long.toHexString(region.getVmaEnd() - region.getVmaStart()), // - "AllocationBase", space.getAddress(region.getAllocationBase()), // - "AllocationProtect", apx, // - "Protect", ipx, // - "State", region.getState(), // - "Type", region.getType() // - ), "Initialized"); - } - - protected String computeDisplay(DbgModuleMemory region) { - return region.getType() + " " + getName(); // NB. Name will contain []s - } - - protected AddressRange doGetRange(DbgModuleMemory s) { - AddressSpace addressSpace = getModel().getAddressSpace("ram"); - Address min = addressSpace.getAddress(s.getVmaStart()); - Address max = addressSpace.getAddress(s.getVmaEnd() - 1); - return new AddressRangeImpl(min, max); - } - - @Override - public AddressRange getRange() { - return range; - } - - @Override - public boolean isReadable() { - return isRead; - } - - @Override - public boolean isWritable() { - return isWrite; - } - - @Override - public boolean isExecutable() { - return isExec; - } - - public boolean isSame(DbgModuleMemory section) { - return range.equals(doGetRange(section)); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetModuleContainerImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetModuleContainerImpl.java deleted file mode 100644 index b211bd07c5..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetModuleContainerImpl.java +++ /dev/null @@ -1,130 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.impl; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.manager.DbgModule; -import agent.dbgeng.manager.DbgProcess; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgeng.model.iface2.DbgModelTargetModule; -import agent.dbgeng.model.iface2.DbgModelTargetModuleContainer; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.*; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; -import ghidra.lifecycle.Internal; - -@TargetObjectSchemaInfo( - name = "ModuleContainer", - elements = { - @TargetElementType(type = DbgModelTargetModuleImpl.class) - }, - elementResync = ResyncMode.ONCE, - attributes = { - @TargetAttributeType(type = Void.class) - }, - canonicalContainer = true) -public class DbgModelTargetModuleContainerImpl extends DbgModelTargetObjectImpl - implements DbgModelTargetModuleContainer { - // NOTE: -file-list-shared-libraries omits the main module and system-supplied DSO. - - protected final DbgModelTargetProcessImpl targetProcess; - protected final DbgProcess process; - - public DbgModelTargetModuleContainerImpl(DbgModelTargetProcessImpl process) { - super(process.getModel(), process, "Modules", "ModuleContainer"); - this.targetProcess = process; - this.process = process.process; - DbgManagerImpl manager = getManager(); - if (manager.isKernelMode()) { - if (!this.process.getId().isSystem()) { - return; - } - } - if (getModel().isSuppressDescent()) { - return; - } - requestElements(RefreshBehavior.REFRESH_NEVER); - } - - @Override - @Internal - public void libraryLoaded(String name) { - DbgModelTargetModule module; - synchronized (this) { - /** - * It's not a good idea to remove "stale" entries. If the entry's already present, it's - * probably because several modules were loaded at once, at it has already had its - * sections loaded. Removing it will cause it to load all module sections again! - */ - //modulesByName.remove(name); - module = getTargetModule(name); - } - changeElements(List.of(), List.of(module), Map.of(), "Loaded"); - } - - @Override - @Internal - public void libraryUnloaded(String name) { - DbgModelTargetModule targetModule = getTargetModule(name); - if (targetModule != null) { - DbgModelImpl impl = (DbgModelImpl) model; - impl.deleteModelObject(targetModule.getDbgModule()); - } - changeElements(List.of(name), List.of(), Map.of(), "Unloaded"); - } - - @Override - public boolean supportsSyntheticModules() { - return false; - } - - @Override - public CompletableFuture addSyntheticModule(String name) { - throw new UnsupportedOperationException("Dbgeng Does not support synthetic modules"); - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - List result = new ArrayList<>(); - return process.listModules().thenAccept(byName -> { - synchronized (this) { - for (Map.Entry ent : byName.entrySet()) { - result.add(getTargetModule(ent.getKey())); - } - } - changeElements(List.of(), result, Map.of(), "Refreshed"); - }); - } - - @Override - public DbgModelTargetModule getTargetModule(String name) { - // Only get here from libraryLoaded or getElements. The known list should be fresh. - DbgModule module = process.getKnownModules().get(name); - if (module == null) { - return null; - } - DbgModelImpl impl = (DbgModelImpl) model; - TargetObject modelObject = impl.getModelObject(module); - if (modelObject != null) { - return (DbgModelTargetModule) modelObject; - } - return new DbgModelTargetModuleImpl(this, module); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetModuleImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetModuleImpl.java deleted file mode 100644 index 48366f11b5..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetModuleImpl.java +++ /dev/null @@ -1,106 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.impl; - -import java.util.List; -import java.util.Map; - -import agent.dbgeng.manager.*; -import agent.dbgeng.model.iface2.DbgModelTargetModule; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.util.PathUtils; -import ghidra.program.model.address.*; - -@TargetObjectSchemaInfo( - name = "Module", - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType( - name = "Symbols", - type = DbgModelTargetSymbolContainerImpl.class, - required = true, - fixed = true), - @TargetAttributeType(name = "BaseAddress", type = Address.class), - @TargetAttributeType(name = "ImageName", type = String.class), - @TargetAttributeType(name = "TimeStamp", type = Integer.class), - @TargetAttributeType(name = "Len", type = String.class), - @TargetAttributeType(type = Void.class) }) -public class DbgModelTargetModuleImpl extends DbgModelTargetObjectImpl - implements DbgModelTargetModule { - protected static String indexModule(DbgModule module) { - return module.getName(); - } - - protected static String keyModule(DbgModule module) { - return PathUtils.makeKey(indexModule(module)); - } - - protected final DbgProcess process; - protected final DbgModule module; - - protected final DbgModelTargetSymbolContainerImpl symbols; - //protected final DbgModelTargetModuleSectionContainerImpl sections; - - public DbgModelTargetModuleImpl(DbgModelTargetModuleContainerImpl modules, DbgModule module) { - super(modules.getModel(), modules, keyModule(module), "Module"); - this.getModel().addModelObject(module, this); - this.process = modules.process; - this.module = module; - - this.symbols = new DbgModelTargetSymbolContainerImpl(this); - //this.sections = new DbgModelTargetModuleSectionContainerImpl(this); - - AddressSpace space = getModel().getAddressSpace("ram"); - - changeAttributes(List.of(), List.of( // - symbols // - // sections.getName(), sections, // - ), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getIndex(), // - SHORT_DISPLAY_ATTRIBUTE_NAME, module.getName(), // - MODULE_NAME_ATTRIBUTE_NAME, module.getImageName(), // - "BaseAddress", space.getAddress(module.getKnownBase()), // - "ImageName", module.getImageName(), // - "TimeStamp", module.getTimeStamp(), // - "Len", Integer.toHexString(module.getSize()) // - ), "Initialized"); - - DbgModuleSection section = new DbgModuleSection(module); - Address min = space.getAddress(section.getStart()); - // Ghidra ranges are not inclusive at the end. - Address max = space.getAddress(section.getStart() + section.getSize() - 1); - AddressRange range = new AddressRangeImpl(min, max); - - changeAttributes(List.of(), List.of(), Map.of( // - RANGE_ATTRIBUTE_NAME, range // - ), "Initialized"); - } - - protected Address doGetBase() { - return getModel().getAddressSpace("ram").getAddress(module.getKnownBase()); - } - - @Override - public DbgModule getDbgModule() { - return module; - } - - public DbgProcess getProcess() { - return process; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetModuleSectionContainerImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetModuleSectionContainerImpl.java deleted file mode 100644 index fef32a4785..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetModuleSectionContainerImpl.java +++ /dev/null @@ -1,67 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.impl; - -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.manager.DbgModule; -import agent.dbgeng.manager.DbgModuleSection; -import agent.dbgeng.model.iface2.*; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo(name = "SectionContainer", elements = { - @TargetElementType(type = DbgModelTargetModuleSectionImpl.class) }, attributes = { - @TargetAttributeType(type = Void.class) }, canonicalContainer = true) -public class DbgModelTargetModuleSectionContainerImpl extends DbgModelTargetObjectImpl - implements DbgModelTargetModuleSectionContainer { - - protected final DbgModule module; - - public DbgModelTargetModuleSectionContainerImpl(DbgModelTargetModule module) { - super(module.getModel(), module, "Sections", "ModuleSections"); - this.module = module.getDbgModule(); - - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - return CompletableFuture.completedFuture(null); - /* - return module.listSections().thenAccept(byStart -> { - List sections; - synchronized (this) { - sections = byStart.values() - .stream() - .map(this::getModuleSection) - .collect(Collectors.toList()); - setElements(sections, "Refreshed"); - } - }); - */ - } - - protected synchronized DbgModelTargetModuleSection getModuleSection(DbgModuleSection section) { - DbgModelImpl impl = (DbgModelImpl) model; - TargetObject modelObject = impl.getModelObject(section); - if (modelObject != null) { - return (DbgModelTargetModuleSection) modelObject; - } - return new DbgModelTargetModuleSectionImpl(this, section); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetModuleSectionImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetModuleSectionImpl.java deleted file mode 100644 index 220da5a051..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetModuleSectionImpl.java +++ /dev/null @@ -1,59 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.impl; - -import java.util.List; -import java.util.Map; - -import agent.dbgeng.manager.DbgModuleSection; -import agent.dbgeng.model.iface2.DbgModelTargetModuleSection; -import ghidra.dbg.target.schema.*; -import ghidra.program.model.address.*; - -@TargetObjectSchemaInfo(name = "Section", elements = { - @TargetElementType(type = Void.class) }, attributes = { - @TargetAttributeType(type = Void.class) }) -public class DbgModelTargetModuleSectionImpl extends DbgModelTargetObjectImpl - implements DbgModelTargetModuleSection { - protected static final String OBJFILE_ATTRIBUTE_NAME = PREFIX_INVISIBLE + "objfile"; - - protected AddressRangeImpl range; - - public DbgModelTargetModuleSectionImpl(DbgModelTargetModuleSectionContainerImpl sections, - DbgModuleSection section) { - super(sections.getModel(), sections, section.getName(), "Section"); - this.getModel().addModelObject(section, this); - - AddressSpace space = getModel().getAddressSpace("ram"); - Address min = space.getAddress(section.getStart()); - // Ghidra ranges are not inclusive at the end. - Address max = space.getAddress(section.getStart() + section.getSize() - 1); - range = new AddressRangeImpl(min, max); - - changeAttributes(List.of(), List.of(), Map.of( // - MODULE_ATTRIBUTE_NAME, sections.getParent(), // - RANGE_ATTRIBUTE_NAME, range, // - DISPLAY_ATTRIBUTE_NAME, section.getName() // - ), "Initialized"); - } - - @TargetAttributeType(name = RANGE_ATTRIBUTE_NAME) - @Override - public AddressRange getRange() { - return range; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetObjectImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetObjectImpl.java deleted file mode 100644 index 0f5d63de1b..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetObjectImpl.java +++ /dev/null @@ -1,208 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.manager.*; -import agent.dbgeng.model.AbstractDbgModel; -import agent.dbgeng.model.iface1.DbgModelTargetAccessConditioned; -import agent.dbgeng.model.iface1.DbgModelTargetExecutionStateful; -import agent.dbgeng.model.iface2.*; -import ghidra.dbg.agent.DefaultTargetObject; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetExecutionStateful.TargetExecutionState; -import ghidra.dbg.target.schema.TargetObjectSchema; - -public class DbgModelTargetObjectImpl extends DefaultTargetObject - implements DbgModelTargetObject { - - protected boolean accessible = true; - protected final DbgStateListener accessListener = this::checkExited; - private boolean modified; - - public DbgModelTargetObjectImpl(AbstractDbgModel impl, TargetObject parent, String name, - String typeHint) { - super(impl, parent, name, typeHint); - getManager().addStateListener(accessListener); - } - - public DbgModelTargetObjectImpl(AbstractDbgModel impl, TargetObject parent, String name, - String typeHint, TargetObjectSchema schema) { - super(impl, parent, name, typeHint, schema); - getManager().addStateListener(accessListener); - } - - public void setAttribute(String key, String value) { - changeAttributes(List.of(), List.of(), Map.of( // - key, value), "Initialized"); - } - - @Override - protected void doInvalidate(TargetObject branch, String reason) { - super.doInvalidate(branch, reason); - getManager().removeStateListener(accessListener); - } - - public void setAccessible(boolean accessible) { - synchronized (attributes) { - if (this.accessible == accessible) { - return; - } - this.accessible = accessible; - } - if (this instanceof DbgModelTargetAccessConditioned) { - changeAttributes(List.of(), List.of(), Map.of( // - TargetAccessConditioned.ACCESSIBLE_ATTRIBUTE_NAME, accessible // - ), "Accessibility changed"); - } - } - - @Override - public AbstractDbgModel getModel() { - return (AbstractDbgModel) model; - } - - public void onRunning() { - setAccessible(false); - } - - public void onStopped() { - setAccessible(true); - } - - public void onExit() { - setAccessible(true); - } - - protected void checkExited(DbgState state, DbgCause cause) { - TargetExecutionState exec = TargetExecutionState.INACTIVE; - switch (state) { - case NOT_STARTED: { - exec = TargetExecutionState.INACTIVE; - break; - } - case STARTING: { - exec = TargetExecutionState.ALIVE; - break; - } - case RUNNING: { - exec = TargetExecutionState.RUNNING; - resetModified(); - onRunning(); - break; - } - case STOPPED: { - exec = TargetExecutionState.STOPPED; - onStopped(); - break; - } - case EXIT: { - exec = TargetExecutionState.TERMINATED; - if (getParentProcess() != null || this instanceof TargetProcess) { - getManager().removeStateListener(accessListener); - } - onExit(); - break; - } - case SESSION_EXIT: { - getModel().close(); - return; - } - } - if (proxy instanceof DbgModelTargetExecutionStateful stateful) { - if (proxy instanceof DbgModelTargetSession) { - if (state != DbgState.EXIT) { - stateful.setExecutionState(exec, "Refreshed"); - } - } - else { - TargetExecutionState previous = stateful.getExecutionState(); - if (!previous.equals(TargetExecutionState.INACTIVE)) { - stateful.setExecutionState(exec, "Refreshed"); - } - } - } - } - - @Override - public CompletableFuture> requestNativeAttributes() { - throw new AssertionError(); // shouldn't ever be here - } - - @Override - public CompletableFuture> requestNativeElements() { - throw new AssertionError(); // shouldn't ever be here - } - - @Override - public DbgModelTargetSession getParentSession() { - DbgModelTargetObject test = (DbgModelTargetObject) parent; - while (test != null && !(test instanceof DbgModelTargetSession)) { - test = (DbgModelTargetObject) test.getParent(); - } - return test == null ? null : (DbgModelTargetSession) test; - } - - @Override - public DbgModelTargetProcess getParentProcess() { - DbgModelTargetObject test = (DbgModelTargetObject) parent; - while (test != null && !(test instanceof TargetProcess)) { - test = (DbgModelTargetObject) test.getParent(); - } - return test == null ? null : (DbgModelTargetProcess) test; - } - - @Override - public DbgModelTargetThread getParentThread() { - DbgModelTargetObject test = (DbgModelTargetObject) parent; - while (test != null && !(test instanceof TargetThread)) { - test = (DbgModelTargetObject) test.getParent(); - } - return test == null ? null : (DbgModelTargetThread) test; - } - - @Override - public void setModified(Map map, boolean b) { - if (modified) { - map.put(MODIFIED_ATTRIBUTE_NAME, modified); - } - } - - @Override - public void setModified(boolean modified) { - if (modified) { - changeAttributes(List.of(), List.of(), Map.of( // - MODIFIED_ATTRIBUTE_NAME, modified // - ), "Refreshed"); - } - } - - @Override - public void resetModified() { - changeAttributes(List.of(), List.of(), Map.of( // - MODIFIED_ATTRIBUTE_NAME, false // - ), "Refreshed"); - } - - public TargetObject searchForSuitable(Class type) { - List pathToClass = model.getRootSchema().searchForSuitable(type, path); - return model.getModelObject(pathToClass); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetProcessAttachConnectorImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetProcessAttachConnectorImpl.java deleted file mode 100644 index f4ec0bf024..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetProcessAttachConnectorImpl.java +++ /dev/null @@ -1,89 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.impl; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.manager.DbgProcess; -import agent.dbgeng.manager.impl.DbgProcessImpl; -import agent.dbgeng.model.iface2.DbgModelTargetConnector; -import ghidra.async.AsyncUtils; -import ghidra.async.TypeSpec; -import ghidra.dbg.error.DebuggerUserException; -import ghidra.dbg.target.TargetMethod; -import ghidra.dbg.target.TargetMethod.ParameterDescription; -import ghidra.dbg.target.TargetMethod.TargetParameterMap; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "ProcessAttachConnector", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(type = Void.class) - }) -public class DbgModelTargetProcessAttachConnectorImpl extends DbgModelTargetObjectImpl - implements DbgModelTargetConnector { - - protected final DbgModelTargetConnectorContainerImpl connectors; - protected final TargetParameterMap paramDescs; - - public DbgModelTargetProcessAttachConnectorImpl(DbgModelTargetConnectorContainerImpl connectors, - String name) { - super(connectors.getModel(), connectors, name, name); - this.connectors = connectors; - - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDisplay(), // - TargetMethod.PARAMETERS_ATTRIBUTE_NAME, - paramDescs = TargetParameterMap.copyOf(computeParameters()) // - ), "Initialized"); - } - - @Override - public CompletableFuture setActive() { - connectors.setDefaultConnector(this); - return CompletableFuture.completedFuture(null); - } - - protected Map> computeParameters() { - HashMap> map = - new HashMap>(); - ParameterDescription param = ParameterDescription.create(String.class, "Pid", true, - "", "Pid", "process id for the target process"); - map.put("Pid", param); - return map; - } - - @Override - public TargetParameterMap getParameters() { - return TargetMethod.getParameters(this); - } - - @Override - public CompletableFuture launch(Map args) { - String pidstr = (String) args.get("Pid"); - int pid = Integer.decode(pidstr); - return AsyncUtils.sequence(TypeSpec.VOID).then(seq -> { - DbgProcess process = new DbgProcessImpl(getManager()); - process.attach(pid).handle(seq::nextIgnore); - }).finish().exceptionally((exc) -> { - throw new DebuggerUserException("Launch failed for " + args); - }); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetProcessContainerImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetProcessContainerImpl.java deleted file mode 100644 index 1a591eddd1..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetProcessContainerImpl.java +++ /dev/null @@ -1,235 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.impl; - -import java.lang.invoke.MethodHandles; -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import agent.dbgeng.dbgeng.DebugClient.DebugStatus; -import agent.dbgeng.dbgeng.DebugModuleInfo; -import agent.dbgeng.dbgeng.DebugProcessId; -import agent.dbgeng.dbgeng.DebugThreadId; -import agent.dbgeng.manager.DbgCause; -import agent.dbgeng.manager.DbgProcess; -import agent.dbgeng.manager.DbgReason; -import agent.dbgeng.manager.DbgState; -import agent.dbgeng.manager.DbgThread; -import agent.dbgeng.manager.breakpoint.DbgBreakpointInfo; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgeng.model.iface1.DbgModelTargetConfigurable; -import agent.dbgeng.model.iface2.DbgModelTargetMemoryContainer; -import agent.dbgeng.model.iface2.DbgModelTargetModuleContainer; -import agent.dbgeng.model.iface2.DbgModelTargetProcess; -import agent.dbgeng.model.iface2.DbgModelTargetProcessContainer; -import agent.dbgeng.model.iface2.DbgModelTargetSession; -import ghidra.async.AsyncUtils; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.error.DebuggerIllegalArgumentException; -import ghidra.dbg.target.TargetConfigurable; -import ghidra.dbg.target.TargetMethod; -import ghidra.dbg.target.TargetMethod.AnnotatedTargetMethod; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetElementType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; - -@TargetObjectSchemaInfo( - name = "ProcessContainer", - elements = { - @TargetElementType(type = DbgModelTargetProcessImpl.class) - }, - attributes = { - @TargetAttributeType(name = TargetConfigurable.BASE_ATTRIBUTE_NAME, type = Integer.class), - @TargetAttributeType(name = "Populate", type = TargetMethod.class), - @TargetAttributeType(type = Void.class) - }, - canonicalContainer = true) -public class DbgModelTargetProcessContainerImpl extends DbgModelTargetObjectImpl - implements DbgModelTargetProcessContainer, DbgModelTargetConfigurable { - - public DbgModelTargetProcessContainerImpl(DbgModelTargetSession session) { - super(session.getModel(), session, "Processes", "ProcessContainer"); - this.changeAttributes(List.of(), Map.of(BASE_ATTRIBUTE_NAME, 16), "Initialized"); - - DbgManagerImpl manager = getManager(); - manager.addEventsListener(this); - } - - @Override - public void processAdded(DbgProcess proc, DbgCause cause) { - DbgModelTargetSession session = (DbgModelTargetSession) getParent(); - session.setAccessible(true); - DbgModelTargetProcess process = getTargetProcess(proc); - changeElements(List.of(), List.of(process), Map.of(), "Added"); - process.processStarted(Long.valueOf(proc.getPid())); - broadcast().event(getProxy(), null, TargetEventType.PROCESS_CREATED, - "Process " + proc.getId() + " started " + process.getName() + "pid=" + proc.getPid(), - List.of(process)); - - DbgManagerImpl manager = getManager(); - if (manager.isKernelMode()) { - changeAttributes(List.of(), List.of(), - AnnotatedTargetMethod.collectExports(MethodHandles.lookup(), getModel(), this), - "Methods"); - } -} - - @Override - public void processStarted(DbgProcess proc, DbgCause cause) { - DbgModelTargetProcess process = getTargetProcess(proc); - process.processStarted(Long.valueOf(proc.getPid())); - } - - @Override - public void processRemoved(DebugProcessId processId, DbgCause cause) { - changeElements(List.of( // - DbgModelTargetProcessImpl.indexProcess(processId) // - ), List.of(), Map.of(), "Removed"); - } - - @Override - public void threadCreated(DbgThread thread, DbgCause cause) { - DbgModelTargetProcess process = getTargetProcess(thread.getProcess()); - process.getThreads().threadCreated(thread); - } - - @Override - public void threadStateChanged(DbgThread thread, DbgState state, DbgCause cause, - DbgReason reason) { - DbgModelTargetProcess process = getTargetProcess(thread.getProcess()); - process.threadStateChangedSpecific(thread, state); - if (!getManager().getStatus().equals(DebugStatus.STEP_INTO)) { - DbgModelTargetMemoryContainer memory = process.getMemory(); - if (memory != null) { - memory.requestElements(RefreshBehavior.REFRESH_ALWAYS); - } - } - } - - @Override - public void threadExited(DebugThreadId threadId, DbgProcess proc, DbgCause cause) { - DbgModelTargetProcess process = getTargetProcess(proc); - if (process != null) { - process.getThreads().threadExited(threadId); - } - } - - @Override - public void breakpointHit(DbgBreakpointInfo info, DbgCause cause) { - DbgProcess proc = info.getProc(); - DbgModelTargetProcess process = getTargetProcess(proc); - DbgModelTargetMemoryContainer memory = process.getMemory(); - if (memory != null) { - memory.requestElements(RefreshBehavior.REFRESH_ALWAYS); - } - } - - @Override - public void moduleLoaded(DbgProcess proc, DebugModuleInfo info, DbgCause cause) { - DbgModelTargetProcess process = getTargetProcess(proc); - DbgModelTargetModuleContainer modules = process.getModules(); - if (modules != null) { - modules.libraryLoaded(info.toString()); - } - DbgModelTargetMemoryContainer memory = process.getMemory(); - if (memory != null) { - memory.requestElements(RefreshBehavior.REFRESH_ALWAYS); - } - } - - @Override - public void moduleUnloaded(DbgProcess proc, DebugModuleInfo info, DbgCause cause) { - DbgModelTargetProcess process = getTargetProcess(proc); - process.getModules().libraryUnloaded(info.toString()); - DbgModelTargetMemoryContainer memory = process.getMemory(); - if (memory != null) { - memory.requestElements(RefreshBehavior.REFRESH_NEVER); - } - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - DbgManagerImpl manager = getManager(); - return manager.listProcesses().thenAccept(byIID -> { - List processes; - synchronized (this) { - processes = byIID.values() - .stream() - .map(this::getTargetProcess) - .collect(Collectors.toList()); - } - setElements(processes, Map.of(), "Refreshed"); - }); - } - - @Override - public synchronized DbgModelTargetProcess getTargetProcess(DebugProcessId id) { - DbgModelImpl impl = (DbgModelImpl) model; - TargetObject modelObject = impl.getModelObject(id); - if (modelObject != null) { - return (DbgModelTargetProcess) modelObject; - } - return new DbgModelTargetProcessImpl(this, getManager().getKnownProcesses().get(id)); - } - - @Override - public synchronized DbgModelTargetProcess getTargetProcess(DbgProcess process) { - DbgModelImpl impl = (DbgModelImpl) model; - TargetObject modelObject = impl.getModelObject(process); - if (modelObject != null) { - return (DbgModelTargetProcess) modelObject; - } - return new DbgModelTargetProcessImpl(this, process); - } - - @Override - public CompletableFuture writeConfigurationOption(String key, Object value) { - switch (key) { - case BASE_ATTRIBUTE_NAME: - if (value instanceof Integer) { - this.changeAttributes(List.of(), Map.of(BASE_ATTRIBUTE_NAME, value), - "Modified"); - for (TargetObject child : getCachedElements().values()) { - if (child instanceof DbgModelTargetProcessImpl) { - DbgModelTargetProcessImpl targetProcess = - (DbgModelTargetProcessImpl) child; - targetProcess.setBase(value); - } - } - } - else { - throw new DebuggerIllegalArgumentException("Base should be numeric"); - } - default: - } - return AsyncUtils.nil(); - } - - @TargetMethod.Export("Populate") - public CompletableFuture populate() { - return getManager().listOSProcesses().thenAccept(byPID -> { - List processes; - synchronized (this) { - processes = - byPID.values().stream().map(this::getTargetProcess).collect(Collectors.toList()); - } - setElements(processes, Map.of(), "Refreshed"); - }); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetProcessImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetProcessImpl.java deleted file mode 100644 index 24119e54df..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetProcessImpl.java +++ /dev/null @@ -1,304 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.dbgeng.DebugProcessId; -import agent.dbgeng.manager.DbgCause; -import agent.dbgeng.manager.DbgProcess; -import agent.dbgeng.manager.DbgState; -import agent.dbgeng.manager.DbgThread; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgeng.model.iface2.DbgModelTargetDebugContainer; -import agent.dbgeng.model.iface2.DbgModelTargetMemoryContainer; -import agent.dbgeng.model.iface2.DbgModelTargetModuleContainer; -import agent.dbgeng.model.iface2.DbgModelTargetProcess; -import agent.dbgeng.model.iface2.DbgModelTargetProcessContainer; -import agent.dbgeng.model.iface2.DbgModelTargetThreadContainer; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.TargetAttachable; -import ghidra.dbg.target.TargetEventScope.TargetEventType; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetElementType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; -import ghidra.dbg.util.PathUtils; - -@TargetObjectSchemaInfo( - name = "Process", - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType( - name = "Debug", - type = DbgModelTargetDebugContainerImpl.class, - required = true, - fixed = true - ), - @TargetAttributeType( - name = "Memory", - type = DbgModelTargetMemoryContainerImpl.class, - required = true, - fixed = true - ), - @TargetAttributeType( - name = "Modules", - type = DbgModelTargetModuleContainerImpl.class, - required = true, - fixed = true - ), - @TargetAttributeType( - name = "Threads", - type = DbgModelTargetThreadContainerImpl.class, - required = true, - fixed = true - ), - @TargetAttributeType( - name = DbgModelTargetProcessImpl.EXIT_CODE_ATTRIBUTE_NAME, - type = Long.class - ), - @TargetAttributeType(type = Void.class) } -) -public class DbgModelTargetProcessImpl extends DbgModelTargetObjectImpl - implements DbgModelTargetProcess { - - public static final String PID_ATTRIBUTE_NAME = PREFIX_INVISIBLE + "pid"; - public static final String EXIT_CODE_ATTRIBUTE_NAME = PREFIX_INVISIBLE + "exit_code"; - - public static final TargetAttachKindSet SUPPORTED_KINDS = TargetAttachKindSet.of( // - TargetAttachKind.BY_OBJECT_REF, TargetAttachKind.BY_ID); - - protected static String indexProcess(DebugProcessId debugProcessId) { - return debugProcessId.id(); - } - - protected static String indexProcess(DbgProcess process) { - return indexProcess(process.getId()); - } - - protected static String keyProcess(DbgProcess process) { - return PathUtils.makeKey(indexProcess(process)); - } - - protected final DbgProcess process; - - protected final DbgModelTargetDebugContainer debug; - protected final DbgModelTargetMemoryContainer memory; - protected final DbgModelTargetModuleContainer modules; - protected final DbgModelTargetThreadContainer threads; - - private Integer base = 16; - - public DbgModelTargetProcessImpl(DbgModelTargetProcessContainer processes, DbgProcess process) { - super(processes.getModel(), processes, keyProcess(process), "Process"); - this.getModel().addModelObject(process, this); - this.getModel().addModelObject(process.getId(), this); - this.process = process; - - this.debug = new DbgModelTargetDebugContainerImpl(this); - this.memory = new DbgModelTargetMemoryContainerImpl(this); - this.modules = new DbgModelTargetModuleContainerImpl(this); - this.threads = new DbgModelTargetThreadContainerImpl(this); - - changeAttributes(List.of(), List.of( // - debug, // - memory, // - modules, // - threads // - ), Map.of( // - ACCESSIBLE_ATTRIBUTE_NAME, accessible = false, // - DISPLAY_ATTRIBUTE_NAME, getDisplay(), // - SUPPORTED_ATTACH_KINDS_ATTRIBUTE_NAME, SUPPORTED_KINDS, // - SUPPORTED_STEP_KINDS_ATTRIBUTE_NAME, DbgModelTargetThreadImpl.SUPPORTED_KINDS // - ), "Initialized"); - if (getManager().isKernelMode()) { - TargetExecutionState state = - process.getPid() > 0 ? TargetExecutionState.INACTIVE : TargetExecutionState.ALIVE; - setExecutionState(state, "Initialized"); - } - else { - setExecutionState(TargetExecutionState.ALIVE, "Initialized"); - } - - getManager().addEventsListener(this); - } - - @Override - public String getDisplay() { - DebugProcessId id = process.getId(); - Long pid = process.getPid(); - if (getManager().isKernelMode()) { - if (id.isSystem()) { - return "[" + id.id() + "]"; - } - String pidstr = Long.toString(pid, base); - if (base == 16) { - pidstr = "0x" + pidstr; - } - Long offset = process.getOffset(); - return offset == null ? "[" + pidstr + "]" - : "[" + pidstr + " : " + Long.toHexString(offset) + "]"; - } - else { - if (pid < 0) { - return "[" + id.id() + "]"; - } - String pidstr = Long.toString(pid, base); - if (base == 16) { - pidstr = "0x" + pidstr; - } - String name = process.getExecutableName(); - return name == null ? "[" + id.id() + ":" + pidstr + "]" - : "[" + id.id() + ":" + pidstr + "]" + " : " + name; - } - } - - @Override - public void threadStateChangedSpecific(DbgThread thread, DbgState state) { - TargetExecutionState targetState = convertState(state); - setExecutionState(targetState, "ThreadStateChanged"); - } - - @Override - public CompletableFuture resume() { - return model.gateFuture(process.cont()); - } - - @Override - public CompletableFuture kill() { - return model.gateFuture(process.kill()); - } - - @Override - public CompletableFuture attach(TargetAttachable attachable) { - getModel().assertMine(TargetObject.class, attachable); - // NOTE: Get the object and type check it myself. - // The typed ref could have been unsafely cast - return model.gateFuture(process.reattach(attachable)).thenApply(set -> null); - } - - @Override - public CompletableFuture attach(long pid) { - return model.gateFuture(process.attach(pid)).thenApply(set -> null); - } - - @Override - public CompletableFuture detach() { - return model.gateFuture(process.detach()); - } - - @Override - public CompletableFuture delete() { - return model.gateFuture(process.remove()); - } - - @Override - public CompletableFuture step(TargetStepKind kind) { - switch (kind) { - case SKIP: - throw new UnsupportedOperationException(kind.name()); - default: - return model.gateFuture(process.step(convertToDbg(kind))); - } - } - - @Override - public CompletableFuture step(Map args) { - return model.gateFuture(process.step(args)); - } - - @Override - public void processStarted(Long pid) { - if (pid != null) { - changeAttributes(List.of(), List.of(), Map.of( // - PID_ATTRIBUTE_NAME, pid, // - DISPLAY_ATTRIBUTE_NAME, getDisplay()// - ), "Started"); - } - setExecutionState(TargetExecutionState.ALIVE, "Started"); - } - - @Override - public void processExited(DbgProcess proc, DbgCause cause) { - if (proc.equals(this.process)) { - changeAttributes(List.of(), List.of(), Map.of( // - STATE_ATTRIBUTE_NAME, TargetExecutionState.TERMINATED, // - EXIT_CODE_ATTRIBUTE_NAME, proc.getExitCode() // - ), "Exited"); - broadcast().event(getProxy(), null, TargetEventType.PROCESS_EXITED, - "Process " + proc.getId() + " exited code=" + proc.getExitCode(), - List.of(getProxy())); - } - } - - @Override - public void memoryChanged(DbgProcess proc, long addr, int len, DbgCause cause) { - if (proc.equals(this.process)) { - broadcast().invalidateCacheRequested(memory); - } - } - - @Override - public CompletableFuture setActive() { - DbgManagerImpl manager = getManager(); - return manager.setActiveProcess(process); - } - - @Override - public DbgModelTargetThreadContainer getThreads() { - return threads; - } - - @Override - public DbgModelTargetModuleContainer getModules() { - return modules; - } - - @Override - public DbgModelTargetMemoryContainer getMemory() { - return memory; - } - - @Override - public DbgProcess getProcess() { - return process; - } - - @Override - public boolean isAccessible() { - return accessible; - } - - public void setBase(Object value) { - this.base = (Integer) value; - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDisplay()// - ), "Started"); - } - - @Override - public CompletableFuture resync(RefreshBehavior refreshAttributes, - RefreshBehavior refreshElements) { - if (memory != null) { - memory.requestElements(RefreshBehavior.REFRESH_ALWAYS); - } - return super.resync(refreshAttributes, refreshElements); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetProcessLaunchConnectorImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetProcessLaunchConnectorImpl.java deleted file mode 100644 index f77838bc2c..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetProcessLaunchConnectorImpl.java +++ /dev/null @@ -1,95 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.impl; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.model.iface2.DbgModelTargetConnector; -import ghidra.dbg.target.TargetMethod; -import ghidra.dbg.target.TargetMethod.ParameterDescription; -import ghidra.dbg.target.TargetMethod.TargetParameterMap; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "ProcessLaunchConnector", - elements = { // - @TargetElementType(type = Void.class) // - }, - attributes = { // - @TargetAttributeType(type = Void.class) // - }) -public class DbgModelTargetProcessLaunchConnectorImpl extends DbgModelTargetObjectImpl - implements DbgModelTargetConnector { - - protected final DbgModelTargetConnectorContainerImpl connectors; - protected final TargetParameterMap paramDescs; - - public DbgModelTargetProcessLaunchConnectorImpl(DbgModelTargetConnectorContainerImpl connectors, - String name) { - super(connectors.getModel(), connectors, name, name); - this.connectors = connectors; - - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDisplay(), // - TargetMethod.PARAMETERS_ATTRIBUTE_NAME, - paramDescs = TargetParameterMap.copyOf(computeParameters()) // - ), "Initialized"); - } - - @Override - public CompletableFuture setActive() { - connectors.setDefaultConnector(this); - return CompletableFuture.completedFuture(null); - } - - protected Map> computeParameters() { - HashMap> map = - new HashMap>(); - ParameterDescription param = ParameterDescription.create(String.class, "args", true, - "", "Cmd", "executable to be launched"); - ParameterDescription initDir = - ParameterDescription.create(String.class, "dir", false, - "", "Dir", "initial directory"); - ParameterDescription env = ParameterDescription.create(String.class, "env", false, - "", "Env (sep=/0)", "environment block"); - ParameterDescription cf = ParameterDescription.create(Integer.class, "cf", true, - 1, "Create Flags", "creation flags"); - ParameterDescription ef = ParameterDescription.create(Integer.class, "ef", false, - 0, "Create Flags (Eng)", "engine creation flags"); - ParameterDescription vf = ParameterDescription.create(Integer.class, "vf", false, - 0, "Verifier Flags", "verifier flags"); - map.put("args", param); - map.put("dir", initDir); - map.put("env", env); - map.put("cf", cf); - map.put("ef", ef); - map.put("vf", vf); - // Innocuous comment: up-up-down-down-left-right-left-right-B-A - return map; - } - - @Override - public TargetParameterMap getParameters() { - return TargetMethod.getParameters(this); - } - - @Override - public CompletableFuture launch(Map args) { - return getManager().launch(args); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetRegisterContainerImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetRegisterContainerImpl.java deleted file mode 100644 index cdd3704e61..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetRegisterContainerImpl.java +++ /dev/null @@ -1,195 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.impl; - -import java.math.BigInteger; -import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import agent.dbgeng.manager.*; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgeng.manager.impl.DbgRegister; -import agent.dbgeng.model.iface2.*; -import ghidra.async.AsyncUtils; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.error.DebuggerRegisterAccessException; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.TargetRegisterBank; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; -import ghidra.dbg.util.ConversionUtils; -import ghidra.docking.settings.FormatSettingsDefinition; - -@TargetObjectSchemaInfo( - name = "RegisterContainer", - elements = { - @TargetElementType(type = DbgModelTargetRegisterImpl.class) }, - elementResync = ResyncMode.ONCE, // - attributes = { - @TargetAttributeType( - name = TargetRegisterBank.DESCRIPTIONS_ATTRIBUTE_NAME, - type = DbgModelTargetRegisterContainerImpl.class), - @TargetAttributeType(type = Void.class) }, - canonicalContainer = true) -public class DbgModelTargetRegisterContainerImpl extends DbgModelTargetObjectImpl - implements DbgModelTargetRegisterContainerAndBank { - - protected final DbgThread thread; - - protected final Map registersByName = new HashMap<>(); - - private Map values = new HashMap<>(); - - public DbgModelTargetRegisterContainerImpl(DbgModelTargetThread thread) { - super(thread.getModel(), thread, "Registers", "RegisterContainer"); - this.thread = thread.getThread(); - - if (!getModel().isSuppressDescent()) { - requestElements(RefreshBehavior.REFRESH_NEVER); - changeAttributes(List.of(), List.of(), Map.of( // - TargetRegisterBank.DESCRIPTIONS_ATTRIBUTE_NAME, this // - ), "Initialized"); - } - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - return thread.listRegisters().thenAccept(regs -> { - if (regs.size() != registersByName.size()) { - DbgModelImpl impl = (DbgModelImpl) model; - for (DbgRegister reg : regs) { - impl.deleteModelObject(reg); - } - registersByName.clear(); - - } - List registers; - synchronized (this) { - registers = regs.stream().map(this::getTargetRegister).collect(Collectors.toList()); - } - setElements(registers, Map.of(), "Refreshed"); - if (!getCachedElements().isEmpty()) { - readRegistersNamed(getCachedElements().keySet()); - } - }); - } - - public void threadStateChangedSpecific(DbgState state, DbgReason reason) { - if (!state.equals(DbgState.RUNNING)) { - readRegistersNamed(getCachedElements().keySet()); - } - } - - @Override - public synchronized DbgModelTargetRegister getTargetRegister(DbgRegister register) { - DbgModelImpl impl = (DbgModelImpl) model; - TargetObject modelObject = impl.getModelObject(register); - if (modelObject != null) { - return (DbgModelTargetRegister) modelObject; - } - DbgModelTargetRegister reg = new DbgModelTargetRegisterImpl(this, register); - registersByName.put(register.getName(), reg); - return reg; - } - - @Override - public CompletableFuture> readRegistersNamed( - Collection names) { - return model.gateFuture(thread.listRegisters().thenCompose(regs -> { - if (regs.size() != registersByName.size() || getCachedElements().isEmpty()) { - return requestElements(RefreshBehavior.REFRESH_NEVER); - } - return AsyncUtils.nil(); - }).thenCompose(__ -> { - Set toRead = new LinkedHashSet<>(); - for (String regname : names) { - DbgModelTargetRegister reg = registersByName.get(regname); - if (reg != null) { - DbgRegister register = reg.getRegister(); - //if (register.isBaseRegister()) { - toRead.add(register); - //} - //throw new DebuggerRegisterAccessException("No such register: " + regname); - } - } - return thread.readRegisters(toRead); - }).thenApply(vals -> { - Map result = new LinkedHashMap<>(); - for (DbgRegister dbgReg : vals.keySet()) { - DbgModelTargetRegister reg = getTargetRegister(dbgReg); - BigInteger value = vals.get(dbgReg); - byte[] bytes = ConversionUtils.bigIntegerToBytes(dbgReg.getSize(), value); - result.put(dbgReg.getName(), bytes); - changeAttrs(reg, value); - } - this.values = result; - broadcast().registersUpdated(getProxy(), result); - return result; - })); - } - - @Override - public CompletableFuture writeRegistersNamed(Map values) { - DbgManagerImpl manager = getManager(); - return model.gateFuture(thread.listRegisters().thenCompose(regs -> { - return requestElements(RefreshBehavior.REFRESH_NEVER); - }).thenCompose(__ -> { - Map regs = getCachedElements(); - Map toWrite = new LinkedHashMap<>(); - for (Map.Entry ent : values.entrySet()) { - String regname = ent.getKey(); - DbgModelTargetRegister reg = (DbgModelTargetRegister) regs.get(regname); - if (reg == null) { - throw new DebuggerRegisterAccessException("No such register: " + regname); - } - BigInteger val = new BigInteger(1, ent.getValue()); - toWrite.put(reg.getRegister(), val); - changeAttrs(reg, val); - } - return thread.writeRegisters(toWrite); - // TODO: Should probably filter only effective and normalized writes in the callback - }).thenAccept(__ -> { - manager.getEventListeners().invoke().threadStateChanged(thread, thread.getState(), - DbgCause.Causes.UNCLAIMED, DbgReason.Reasons.NONE); - broadcast().registersUpdated(getProxy(), values); - })); - } - - private void changeAttrs(DbgModelTargetRegister reg, BigInteger value) { - String oldval = (String) reg.getCachedAttributes().get(VALUE_ATTRIBUTE_NAME); - int bitLength = reg.getBitLength(); - boolean negative = value.signum() < 0; - if (negative) { - // force use of unsigned value - value = value.add(BigInteger.valueOf(2).pow(bitLength)); - } - String valstr = value.toString(16); - String newval = (value.longValue() == 0) ? reg.getName() - : reg.getName() + " : " + valstr; - reg.changeAttributes(List.of(), Map.of( // - VALUE_ATTRIBUTE_NAME, valstr, // - DISPLAY_ATTRIBUTE_NAME, newval // - ), "Refreshed"); - reg.setModified(!valstr.equals(oldval)); - } - - @Override - public Map getCachedRegisters() { - return values; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetRegisterImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetRegisterImpl.java deleted file mode 100644 index bcc94dcb22..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetRegisterImpl.java +++ /dev/null @@ -1,82 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.impl; - -import java.util.List; -import java.util.Map; - -import agent.dbgeng.manager.impl.DbgRegister; -import agent.dbgeng.model.iface2.DbgModelTargetRegister; -import agent.dbgeng.model.iface2.DbgModelTargetRegisterContainerAndBank; -import ghidra.dbg.target.TargetRegister; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.util.PathUtils; - -@TargetObjectSchemaInfo( - name = "RegisterDescriptor", - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType( - name = TargetRegister.CONTAINER_ATTRIBUTE_NAME, - type = DbgModelTargetRegisterContainerImpl.class), - @TargetAttributeType(type = Void.class) }) -public class DbgModelTargetRegisterImpl extends DbgModelTargetObjectImpl - implements DbgModelTargetRegister { - - protected static String indexRegister(DbgRegister register) { - String name = register.getName(); - if ("".equals(name)) { - return "UNNAMED," + register.getNumber(); - } - return name; - } - - protected static String keyRegister(DbgRegister register) { - return PathUtils.makeKey(indexRegister(register)); - } - - protected final DbgModelTargetRegisterContainerAndBank registers; - protected final DbgRegister register; - - protected final int bitLength; - - public DbgModelTargetRegisterImpl(DbgModelTargetRegisterContainerAndBank registers, - DbgRegister register) { - super(registers.getModel(), registers, keyRegister(register), "Register"); - this.getModel().addModelObject(register, this); - this.registers = registers; - this.register = register; - - this.bitLength = register.getSize() * 8; - - changeAttributes(List.of(), List.of(), Map.of( // - CONTAINER_ATTRIBUTE_NAME, registers, // - BIT_LENGTH_ATTRIBUTE_NAME, bitLength, // - DISPLAY_ATTRIBUTE_NAME, "[" + register.getName() + "]" // - ), "Initialized"); - } - - @Override - public int getBitLength() { - return bitLength; - } - - @Override - public DbgRegister getRegister() { - return register; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetRootImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetRootImpl.java deleted file mode 100644 index ce3e6fb477..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetRootImpl.java +++ /dev/null @@ -1,286 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.impl; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.dbgeng.DebugProcessId; -import agent.dbgeng.dbgeng.DebugThreadId; -import agent.dbgeng.manager.DbgCause; -import agent.dbgeng.manager.DbgProcess; -import agent.dbgeng.manager.DbgReason; -import agent.dbgeng.manager.DbgSession; -import agent.dbgeng.manager.DbgStackFrame; -import agent.dbgeng.manager.DbgState; -import agent.dbgeng.manager.DbgThread; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgeng.manager.impl.DbgProcessImpl; -import agent.dbgeng.model.AbstractDbgModel; -import agent.dbgeng.model.iface1.DbgModelSelectableObject; -import agent.dbgeng.model.iface1.DbgModelTargetExecutionStateful; -import agent.dbgeng.model.iface2.DbgModelTargetConnector; -import agent.dbgeng.model.iface2.DbgModelTargetRoot; -import agent.dbgeng.model.iface2.DbgModelTargetThread; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.error.DebuggerUserException; -import ghidra.dbg.target.TargetEventScope; -import ghidra.dbg.target.TargetExecutionStateful; -import ghidra.dbg.target.TargetExecutionStateful.TargetExecutionState; -import ghidra.dbg.target.TargetFocusScope; -import ghidra.dbg.target.TargetMethod; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetElementType; -import ghidra.dbg.target.schema.TargetObjectSchema; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; -import ghidra.dbg.util.PathUtils; - -@TargetObjectSchemaInfo( - name = "Debugger", - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType( - name = "Available", - type = DbgModelTargetAvailableContainerImpl.class, - required = true, - fixed = true), - @TargetAttributeType( - name = "Connectors", - type = DbgModelTargetConnectorContainerImpl.class, - required = true, - fixed = true), - @TargetAttributeType( - name = "Sessions", - type = DbgModelTargetSessionContainerImpl.class, - required = true, - fixed = true), - @TargetAttributeType(type = Void.class) }) -public class DbgModelTargetRootImpl extends DbgModelDefaultTargetModelRoot - implements DbgModelTargetRoot { - - protected final DbgModelTargetAvailableContainerImpl available; - protected final DbgModelTargetConnectorContainerImpl connectors; - protected final DbgModelTargetSessionContainerImpl sessions; - - protected String debugger = "kd"; // Used by DbgModelTargetEnvironment - - protected DbgModelSelectableObject focus; - - public DbgModelTargetRootImpl(DbgModelImpl impl, TargetObjectSchema schema) { - super(impl, "Debugger", schema); - - this.available = new DbgModelTargetAvailableContainerImpl(this); - this.connectors = new DbgModelTargetConnectorContainerImpl(this); - this.sessions = new DbgModelTargetSessionContainerImpl(this); - - DbgModelTargetConnector defaultConnector = connectors.getDefaultConnector(); - changeAttributes(List.of(), List.of( // - available, // - connectors, // - sessions // - ), Map.of( // - ACCESSIBLE_ATTRIBUTE_NAME, accessible, // - DISPLAY_ATTRIBUTE_NAME, "Debugger", // - FOCUS_ATTRIBUTE_NAME, this, // - SUPPORTED_ATTACH_KINDS_ATTRIBUTE_NAME, DbgModelTargetProcessImpl.SUPPORTED_KINDS, // - TargetMethod.PARAMETERS_ATTRIBUTE_NAME, defaultConnector.getParameters() // - // ARCH_ATTRIBUTE_NAME, "x86_64", // - // DEBUGGER_ATTRIBUTE_NAME, "dbgeng", // - // OS_ATTRIBUTE_NAME, "Windows", // - ), "Initialized"); - impl.getManager().addEventsListener(this); - } - - @Override - public DbgModelSelectableObject getFocus() { - return focus; - } - - @Override - public void setDefaultConnector(DbgModelTargetConnector defaultConnector) { - changeAttributes(List.of(), List.of(), - Map.of(TargetMethod.PARAMETERS_ATTRIBUTE_NAME, defaultConnector.getParameters()), - "Default connector changed"); - } - - @Override - public boolean setFocus(DbgModelSelectableObject sel) { - boolean doFire; - synchronized (this) { - doFire = !Objects.equals(this.focus, sel); - if (doFire && focus != null) { - List focusPath = focus.getPath(); - List selPath = sel.getPath(); - doFire = !PathUtils.isAncestor(selPath, focusPath); - } - } - if (doFire) { - this.focus = sel; - changeAttributes(List.of(), List.of(), Map.of( // - TargetFocusScope.FOCUS_ATTRIBUTE_NAME, focus // - ), "Focus changed"); - } - return doFire; - } - - @Override - public CompletableFuture launch(Map args) { - DbgModelTargetConnector targetConnector = connectors.getDefaultConnector(); - return model.gateFuture(targetConnector.launch(args)).exceptionally(exc -> { - throw new DebuggerUserException("Launch failed for " + args); - }); - } - - @Override - public CompletableFuture attach(long pid) { - DbgProcess process = new DbgProcessImpl(getManager()); - return model.gateFuture(process.attach(pid)).thenApply(__ -> null); - } - - @Override - public void threadStateChanged(DbgThread thread, DbgState state, DbgCause cause, - DbgReason reason) { - DbgModelTargetThread targetThread = - (DbgModelTargetThread) getModel().getModelObject(thread); - if (targetThread != null) { - changeAttributes(List.of(), List.of(), Map.of( // - TargetEventScope.EVENT_OBJECT_ATTRIBUTE_NAME, targetThread // - ), reason.desc()); - } - } - - @Override - public void processSelected(DbgProcess process, DbgCause cause) { - if (process != null) { - objectSelected(process); - } - } - - @Override - public void threadSelected(DbgThread thread, DbgStackFrame frame, DbgCause cause) { - if (thread != null) { - objectSelected(thread); - if (frame != null) { - objectSelected(frame); - } - } - } - - public void objectSelected(Object object) { - AbstractDbgModel model = getModel(); - List objPath = findObject(object); - model.fetchModelObject(objPath, RefreshBehavior.REFRESH_WHEN_ABSENT).thenAccept(obj -> - update(obj) - ); - } - - private List findObject(Object obj) { - DbgManagerImpl manager = getManager(); - List objpath = new ArrayList<>(); - if (obj == null) { - return objpath; - } - DbgSession session = manager.getCurrentSession(); - if (obj instanceof DbgSession) { - session = (DbgSession) obj; - } - if (session == null) { - return objpath; - } - String skey = DbgModelTargetSessionImpl.keySession(session); - if (obj instanceof DbgSession || obj instanceof String) { - objpath = List.of("Sessions", skey); - return objpath; - } - - DbgProcess process = manager.getCurrentProcess(); - if (obj instanceof DbgProcess) { - process = (DbgProcess) obj; - } - if (process == null) { - return objpath; - } - String pkey = DbgModelTargetProcessImpl.keyProcess(process); - if (obj instanceof DbgProcess || obj instanceof DebugProcessId) { - objpath = List.of("Sessions", skey, "Processes", pkey); - return objpath; - } - - DbgThread thread = manager.getCurrentThread(); - if (obj instanceof DbgThread) { - thread = (DbgThread) obj; - process = thread.getProcess(); - pkey = DbgModelTargetProcessImpl.keyProcess(process); - } - if (thread == null) { - return objpath; - } - String tkey = DbgModelTargetThreadImpl.keyThread(thread); - if (getManager().isKernelMode()) { - if (tkey.equals("[0x0]")) { - // Weird, but necessary... - pkey = "[0x0]"; - } - } - if (obj instanceof DbgThread || obj instanceof DebugThreadId) { - objpath = List.of("Sessions", skey, "Processes", pkey, "Threads", tkey); - return objpath; - } - - if (obj instanceof DbgStackFrame) { - DbgStackFrame frame = (DbgStackFrame) obj; - thread = frame.getThread(); - process = thread.getProcess(); - String fkey = DbgModelTargetStackFrameImpl.keyFrame(frame); - tkey = DbgModelTargetThreadImpl.keyThread(thread); - pkey = DbgModelTargetProcessImpl.keyProcess(process); - objpath = List.of("Sessions", skey, "Processes", pkey, "Threads", tkey, "Stack", - "Frames", fkey); - return objpath; - } - return objpath; - } - - private void update(TargetObject obj) { - if (obj instanceof DbgModelSelectableObject) { - setFocus((DbgModelSelectableObject) obj); - } - if (obj instanceof DbgModelTargetExecutionStateful) { - activate((DbgModelTargetExecutionStateful) obj); - } - } - - private void activate(DbgModelTargetExecutionStateful stateful) { - TargetExecutionState state = stateful.getExecutionState(); - if (state.equals(TargetExecutionState.INACTIVE)) { - stateful.changeAttributes(List.of(), Map.of( // - TargetExecutionStateful.STATE_ATTRIBUTE_NAME, TargetExecutionState.ALIVE // - ), "Selected"); - stateful.fetchAttributes(RefreshBehavior.REFRESH_ALWAYS); - } - } - - @Override - public boolean isAccessible() { - return accessible; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetSessionAttributesImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetSessionAttributesImpl.java deleted file mode 100644 index 28395e0ba7..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetSessionAttributesImpl.java +++ /dev/null @@ -1,89 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.model.iface2.DbgModelTargetSession; -import agent.dbgeng.model.iface2.DbgModelTargetSessionAttributes; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "SessionAttributes", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType( - name = "Machine", - type = DbgModelTargetSessionAttributesMachineImpl.class, - fixed = true), - @TargetAttributeType(type = Void.class) - }) -public class DbgModelTargetSessionAttributesImpl extends DbgModelTargetObjectImpl - implements DbgModelTargetSessionAttributes { - - protected final DbgModelTargetSessionAttributesMachineImpl machineAttributes; - - public DbgModelTargetSessionAttributesImpl(DbgModelTargetSession session) { - super(session.getModel(), session, "Attributes", "SessionAttributes"); - - this.machineAttributes = new DbgModelTargetSessionAttributesMachineImpl(this); - - changeAttributes(List.of(), List.of( // - machineAttributes // - ), Map.of( // - ARCH_ATTRIBUTE_NAME, "x86_64", // - DEBUGGER_ATTRIBUTE_NAME, "dbgeng", // - OS_ATTRIBUTE_NAME, "Windows", // - ENDIAN_ATTRIBUTE_NAME, "little" // - ), "Initialized"); - - getManager().addEventsListener(this); - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - return CompletableFuture.completedFuture(null); - } - - /* - @Override - public String getArchitecture() { - return machineAttributes.getTypedAttributeNowByName(ARCH_ATTRIBUTE_NAME, String.class, ""); - } - - @Override - public String getDebugger() { - return machineAttributes.getTypedAttributeNowByName(DEBUGGER_ATTRIBUTE_NAME, String.class, - ""); - } - - @Override - public String getOperatingSystem() { - return machineAttributes.getTypedAttributeNowByName(OS_ATTRIBUTE_NAME, String.class, ""); - } - */ - - @Override - public void refreshInternal() { - machineAttributes.refreshInternal(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetSessionAttributesMachineImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetSessionAttributesMachineImpl.java deleted file mode 100644 index 2b89657ca2..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetSessionAttributesMachineImpl.java +++ /dev/null @@ -1,97 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.atomic.AtomicReference; - -import agent.dbgeng.dbgeng.DebugControl; -import agent.dbgeng.impl.dbgeng.client.DebugClientInternal; -import agent.dbgeng.impl.dbgeng.client.DebugClientInternal.DebugClass; -import agent.dbgeng.jna.dbgeng.WinNTExtra.Machine; -import agent.dbgeng.manager.*; -import agent.dbgeng.model.iface2.DbgModelTargetSessionAttributes; -import agent.dbgeng.model.iface2.DbgModelTargetSessionAttributesMachine; -import ghidra.async.AsyncUtils; -import ghidra.async.TypeSpec; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "SessionAttributesMachine", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(name = "Arch", type = String.class), - @TargetAttributeType(name = "Debugger", type = String.class), - @TargetAttributeType(name = "OS", type = String.class), - @TargetAttributeType(name = "Mode", type = String.class), - @TargetAttributeType(type = Void.class) - }) -public class DbgModelTargetSessionAttributesMachineImpl extends DbgModelTargetObjectImpl - implements DbgModelTargetSessionAttributesMachine { - - static String ARCH_ATTRIBUTE_NAME = "Arch"; - static String DEBUGGER_ATTRIBUTE_NAME = "Debugger"; - static String OS_ATTRIBUTE_NAME = "OS"; - - public DbgModelTargetSessionAttributesMachineImpl(DbgModelTargetSessionAttributes attributes) { - super(attributes.getModel(), attributes, "Machine", "SessionMachineAttributes"); - - changeAttributes(List.of(), List.of(), Map.of( // - ARCH_ATTRIBUTE_NAME, "x86_64", // - DEBUGGER_ATTRIBUTE_NAME, "dbgeng", // - OS_ATTRIBUTE_NAME, "Windows" // - ), "Initialized"); - - getManager().addEventsListener(this); - } - - @Override - public void sessionAdded(DbgSession session, DbgCause cause) { - refreshInternal(); - } - - @Override - public void processAdded(DbgProcess process, DbgCause cause) { - refreshInternal(); - } - - public void refreshInternal() { - DebugControl control = getManager().getControl(); - int processorType = control.getActualProcessorType(); - if (processorType < 0) { - return; - } - Machine machine = Machine.getByNumber(processorType); - int debuggeeType = control.getDebuggeeType(); - DebugClass debugClass = DebugClientInternal.DebugClass.values()[debuggeeType]; - changeAttributes(List.of(), List.of(), Map.of( // - ARCH_ATTRIBUTE_NAME, machine.description, // - "Mode", debugClass.toString() // - ), "Refreshed"); - - AtomicReference capture = new AtomicReference<>(); - AsyncUtils.sequence(TypeSpec.VOID).then(seq -> { - getManager().consoleCapture("vertarget").handle(seq::next); - }, capture).then(seq -> { - changeAttributes(List.of(), List.of(), Map.of( // - OS_ATTRIBUTE_NAME, capture.get()), "Refreshed"); - }).finish(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetSessionContainerImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetSessionContainerImpl.java deleted file mode 100644 index 300ae9b8ea..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetSessionContainerImpl.java +++ /dev/null @@ -1,90 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.dbgeng.DebugSessionId; -import agent.dbgeng.manager.DbgCause; -import agent.dbgeng.manager.DbgSession; -import agent.dbgeng.model.iface2.*; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo(name = "SessionContainer", elements = { - @TargetElementType(type = DbgModelTargetSessionImpl.class) }, attributes = { - @TargetAttributeType(type = Void.class) }, canonicalContainer = true) -public class DbgModelTargetSessionContainerImpl extends DbgModelTargetObjectImpl - implements DbgModelTargetSessionContainer { - - public DbgModelTargetSessionContainerImpl(DbgModelTargetRoot root) { - super(root.getModel(), root, "Sessions", "SessionContainer"); - - getManager().addEventsListener(this); - } - - @Override - public void sessionAdded(DbgSession sess, DbgCause cause) { - DbgModelTargetSession session = getTargetSession(sess); - changeElements(List.of(), List.of(session), Map.of(), "Added"); - } - - @Override - public void sessionRemoved(DebugSessionId sessionId, DbgCause cause) { - //synchronized (this) { - // sessionsById.remove(sessionId); - //} - changeElements(List.of( // - DbgModelTargetSessionImpl.indexSession(sessionId) // - ), List.of(), Map.of(), "Removed"); - } - - @Override - public synchronized DbgModelTargetSession getTargetSession(DbgSession session) { - DbgModelImpl impl = (DbgModelImpl) model; - TargetObject modelObject = impl.getModelObject(session); - if (modelObject != null) { - return (DbgModelTargetSession) modelObject; - } - return new DbgModelTargetSessionImpl(this, session); - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - return CompletableFuture.completedFuture(null); - /* - DbgManagerImpl manager = getManager(); - if (manager.checkAccessProhibited()) { - return CompletableFuture.completedFuture(this.elementsView); - } - return manager.listSessions().thenApply(byIID -> { - List sessions; - synchronized (this) { - sessions = byIID.values() - .stream() - .map(this::getTargetSession) - .collect(Collectors.toList()); - } - setElements(sessions, "Refreshed"); - return this.elementsView; - }); - */ - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetSessionImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetSessionImpl.java deleted file mode 100644 index 005f18d3f8..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetSessionImpl.java +++ /dev/null @@ -1,117 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.dbgeng.DebugSessionId; -import agent.dbgeng.manager.*; -import agent.dbgeng.model.iface1.DbgModelSelectableObject; -import agent.dbgeng.model.iface1.DbgModelTargetInterpreter; -import agent.dbgeng.model.iface2.DbgModelTargetProcessContainer; -import agent.dbgeng.model.iface2.DbgModelTargetSession; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.util.PathUtils; - -@TargetObjectSchemaInfo( - name = "Session", - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType( - name = "Attributes", - type = DbgModelTargetSessionAttributesImpl.class, - fixed = true), - @TargetAttributeType( - name = "Processes", - type = DbgModelTargetProcessContainerImpl.class, - required = true, - fixed = true), - @TargetAttributeType(type = Void.class) }) -public class DbgModelTargetSessionImpl extends DbgModelTargetObjectImpl - implements DbgModelTargetSession { - - protected static final String DBG_PROMPT = "(kd)"; - private Integer base = 16; - - // NB: This should almost certainly always be implemented by the root of the object tree - - protected static String indexSession(DebugSessionId debugSystemId) { - return debugSystemId.id(); - } - - protected static String indexSession(DbgSession session) { - return indexSession(session.getId()); - } - - protected static String keySession(DbgSession session) { - return PathUtils.makeKey(indexSession(session)); - } - - protected final DbgModelTargetSessionAttributesImpl attributes; - protected final DbgModelTargetProcessContainerImpl processes; - private DbgModelSelectableObject focus; - - protected String debugger = "kd"; // Used by DbgModelTargetEnvironment - - public DbgModelTargetSessionImpl(DbgModelTargetSessionContainerImpl sessions, - DbgSession session) { - super(sessions.getModel(), sessions, keySession(session), "Session"); - this.getModel().addModelObject(session, this); - - this.attributes = new DbgModelTargetSessionAttributesImpl(this); - this.processes = new DbgModelTargetProcessContainerImpl(this); - - changeAttributes(List.of(), List.of( // - attributes, // - processes // - ), Map.of( // - ACCESSIBLE_ATTRIBUTE_NAME, accessible, // - PROMPT_ATTRIBUTE_NAME, DbgModelTargetInterpreter.DBG_PROMPT, // - STATE_ATTRIBUTE_NAME, TargetExecutionState.ALIVE // - ), "Initialized"); - - getManager().addEventsListener(this); - } - - @Override - public CompletableFuture setActive() { - //DbgManagerImpl manager = getManager(); - //DbgProcessImpl process = manager.getCurrentProcess(); - //return manager.execute(new DbgProcessSelectCommand(manager, process)); - return CompletableFuture.completedFuture(null); - } - - @Override - public boolean isAccessible() { - return accessible; - } - - @Override - public DbgModelTargetProcessContainer getProcesses() { - return processes; - } - - @Override - public void threadStateChanged(DbgThread thread, DbgState state, DbgCause cause, - DbgReason reason) { - TargetExecutionState targetState = convertState(state); - setExecutionState(targetState, "ThreadStateChanged"); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetStackFrameImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetStackFrameImpl.java deleted file mode 100644 index 0a974f8eb1..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetStackFrameImpl.java +++ /dev/null @@ -1,172 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.impl; - -import java.math.BigInteger; -import java.util.List; -import java.util.Map; - -import agent.dbgeng.manager.*; -import agent.dbgeng.model.iface1.DbgModelTargetFocusScope; -import agent.dbgeng.model.iface2.*; -import ghidra.dbg.target.TargetFocusScope; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.util.PathUtils; -import ghidra.program.model.address.Address; -import ghidra.program.model.address.AddressSpace; - -@TargetObjectSchemaInfo( - name = "StackFrame", - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType( - name = DbgModelTargetStackFrame.FUNC_ATTRIBUTE_NAME, - type = String.class), - @TargetAttributeType( - name = DbgModelTargetStackFrame.FUNC_TABLE_ENTRY_ATTRIBUTE_NAME, - type = String.class), - @TargetAttributeType( - name = DbgModelTargetStackFrame.INST_OFFSET_ATTRIBUTE_NAME, - type = Address.class), - @TargetAttributeType( - name = DbgModelTargetStackFrame.FRAME_OFFSET_ATTRIBUTE_NAME, - type = Address.class), - @TargetAttributeType( - name = DbgModelTargetStackFrame.RETURN_OFFSET_ATTRIBUTE_NAME, - type = Address.class), - @TargetAttributeType( - name = DbgModelTargetStackFrame.STACK_OFFSET_ATTRIBUTE_NAME, - type = Address.class), - @TargetAttributeType( - name = DbgModelTargetStackFrame.VIRTUAL_ATTRIBUTE_NAME, - type = Boolean.class), - @TargetAttributeType( - name = DbgModelTargetStackFrame.PARAM0_ATTRIBUTE_NAME, - type = String.class), - @TargetAttributeType( - name = DbgModelTargetStackFrame.PARAM1_ATTRIBUTE_NAME, - type = String.class), - @TargetAttributeType( - name = DbgModelTargetStackFrame.PARAM2_ATTRIBUTE_NAME, - type = String.class), - @TargetAttributeType( - name = DbgModelTargetStackFrame.PARAM3_ATTRIBUTE_NAME, - type = String.class), - @TargetAttributeType(type = Void.class) }) -public class DbgModelTargetStackFrameImpl extends DbgModelTargetObjectImpl - implements DbgModelTargetStackFrame { - - protected static String indexFrame(DbgStackFrame frame) { - return PathUtils.makeIndex(frame.getLevel()); - } - - protected static String keyFrame(DbgStackFrame frame) { - return PathUtils.makeKey(indexFrame(frame)); - } - - protected DbgStackFrame frame; - protected Address pc; - protected String func; - protected String display; - - private Long funcTableEntry = -1L; - private Long frameOffset = -1L; - private Long returnOffset = -1L; - private Long stackOffset = -1L; - private Boolean virtual = false; - private long[] params = new long[4]; - - public DbgModelTargetStackFrameImpl(DbgModelTargetStack stack, DbgModelTargetThread thread, - DbgStackFrame frame) { - super(stack.getModel(), stack, keyFrame(frame), "StackFrame"); - this.getModel().addModelObject(frame, this); - this.pc = getModel().getAddressSpace("ram").getAddress(-1); - - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, display = computeDisplay(frame), // - PC_ATTRIBUTE_NAME, pc // - ), "Initialized"); - setFrame(frame); - - getManager().addEventsListener(this); - } - - protected static String computeDisplay(DbgStackFrame frame) { - if (frame.getFunction() == null) { - return String.format("#%d 0x%s", frame.getLevel(), frame.getAddress().toString(16)); - } - return String.format("#%d 0x%s in %s", frame.getLevel(), frame.getAddress().toString(16), - frame.getFunction()); - } - - @Override - public void threadSelected(DbgThread eventThread, DbgStackFrame eventFrame, DbgCause cause) { - if (eventFrame != null && eventFrame.equals(frame)) { - ((DbgModelTargetFocusScope) searchForSuitable(TargetFocusScope.class)).setFocus(this); - } - } - - @Override - public void setFrame(DbgStackFrame frame) { - BigInteger address = frame.getAddress(); - long lval = address == null ? -1 : address.longValue(); - this.pc = getModel().getAddressSpace("ram").getAddress(lval); - this.func = frame.getFunction(); - if (func == null) { - func = "UNKNOWN"; - } - this.funcTableEntry = frame.getFuncTableEntry(); - this.frameOffset = frame.getFrameOffset(); - this.returnOffset = frame.getReturnOffset(); - this.stackOffset = frame.getStackOffset(); - this.virtual = frame.getVirtual(); - this.params = frame.getParams(); - // TODO: module? "from" - this.frame = frame; - - AddressSpace space = getModel().getAddressSpace("ram"); - changeAttributes(List.of(), List.of(), Map.of( // - PC_ATTRIBUTE_NAME, pc, // - DISPLAY_ATTRIBUTE_NAME, display = computeDisplay(frame), // - FUNC_ATTRIBUTE_NAME, func, // - FUNC_TABLE_ENTRY_ATTRIBUTE_NAME, Long.toHexString(funcTableEntry), // - INST_OFFSET_ATTRIBUTE_NAME, space.getAddress(lval), // - FRAME_OFFSET_ATTRIBUTE_NAME, space.getAddress(frameOffset), // - RETURN_OFFSET_ATTRIBUTE_NAME, space.getAddress(returnOffset), // - STACK_OFFSET_ATTRIBUTE_NAME, space.getAddress(stackOffset), // - VIRTUAL_ATTRIBUTE_NAME, virtual // - ), "Refreshed"); - changeAttributes(List.of(), List.of(), Map.of( // - PARAM0_ATTRIBUTE_NAME, Long.toHexString(params[0]), // - PARAM1_ATTRIBUTE_NAME, Long.toHexString(params[1]), // - PARAM2_ATTRIBUTE_NAME, Long.toHexString(params[2]), // - PARAM3_ATTRIBUTE_NAME, Long.toHexString(params[3]) // - ), "Refreshed"); - } - - @Override - public Address getPC() { - return pc; - } - - /* - public void invalidateRegisterCaches() { - listeners.fire.invalidateCacheRequested(this); - } - */ - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetStackImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetStackImpl.java deleted file mode 100644 index 95444f21f4..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetStackImpl.java +++ /dev/null @@ -1,95 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import agent.dbgeng.manager.*; -import agent.dbgeng.model.iface2.*; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.*; -import ghidra.util.Msg; -import ghidra.util.datastruct.WeakValueHashMap; - -@TargetObjectSchemaInfo( - name = "Stack", - elements = { - @TargetElementType(type = DbgModelTargetStackFrameImpl.class) - }, - attributes = { - @TargetAttributeType(type = Void.class) - }, - canonicalContainer = true) -public class DbgModelTargetStackImpl extends DbgModelTargetObjectImpl - implements DbgModelTargetStack { - - protected final DbgModelTargetThread thread; - - public static final String NAME = "Stack"; - - protected final Map framesByLevel = - new WeakValueHashMap<>(); - - public DbgModelTargetStackImpl(DbgModelTargetThread thread, DbgModelTargetProcess process) { - super(thread.getModel(), thread, NAME, "Stack"); - this.thread = thread; - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - return thread.getThread().listStackFrames().thenAccept(f -> { - List frames; - synchronized (this) { - frames = f.stream().map(this::getTargetFrame).collect(Collectors.toList()); - } - // TODO: This might be a case where "move" is useful - setElements(frames, Map.of(), "Refreshed"); - }); - } - - @Override - public synchronized DbgModelTargetStackFrame getTargetFrame(DbgStackFrame frame) { - return framesByLevel.compute(frame.getLevel(), (l, f) -> { - if (f == null) { - return new DbgModelTargetStackFrameImpl(this, thread, frame); - } - f.setFrame(frame); - return f; - }); - } - - /* - public void invalidateRegisterCaches() { - setElements(List.of(), Map.of(), "Invalidated"); - for (DbgModelTargetStackFrameImpl frame : framesByLevel.values()) { - frame.invalidateRegisterCaches(); - } - } - */ - - public void threadStateChangedSpecific(DbgState state, DbgReason reason) { - if (!state.equals(DbgState.RUNNING)) { - requestElements(RefreshBehavior.REFRESH_ALWAYS).exceptionally(e -> { - Msg.error(this, "Could not update stack " + this + " on STOPPED"); - return null; - }); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetSymbolContainerImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetSymbolContainerImpl.java deleted file mode 100644 index 9b5bd8ee6c..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetSymbolContainerImpl.java +++ /dev/null @@ -1,71 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import agent.dbgeng.manager.impl.DbgMinimalSymbol; -import agent.dbgeng.model.iface2.DbgModelTargetSymbolContainer; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; - -@TargetObjectSchemaInfo( - name = "SymbolContainer", - elements = { - @TargetElementType(type = DbgModelTargetSymbolImpl.class) }, - elementResync = ResyncMode.ONCE, - attributes = { - @TargetAttributeType(type = Void.class) }, - canonicalContainer = true) -public class DbgModelTargetSymbolContainerImpl extends DbgModelTargetObjectImpl - implements DbgModelTargetSymbolContainer { - - protected final DbgModelTargetModuleImpl module; - - public DbgModelTargetSymbolContainerImpl(DbgModelTargetModuleImpl module) { - super(module.getModel(), module, "Symbols", "SymbolContainer"); - this.module = module; - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - return module.module.listMinimalSymbols().thenAccept(byName -> { - List symbols; - synchronized (this) { - symbols = byName.values() - .stream() - .map(this::getTargetSymbol) - .collect(Collectors.toList()); - } - setElements(symbols, Map.of(), "Refreshed"); - }); - } - - @Override - public synchronized DbgModelTargetSymbolImpl getTargetSymbol(DbgMinimalSymbol symbol) { - DbgModelImpl impl = (DbgModelImpl) model; - TargetObject modelObject = impl.getModelObject(symbol); - if (modelObject != null) { - return (DbgModelTargetSymbolImpl) modelObject; - } - return new DbgModelTargetSymbolImpl(this, symbol); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetSymbolImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetSymbolImpl.java deleted file mode 100644 index 2d44f214f2..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetSymbolImpl.java +++ /dev/null @@ -1,97 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.impl; - -import java.util.List; -import java.util.Map; - -import agent.dbgeng.manager.impl.DbgMinimalSymbol; -import agent.dbgeng.model.iface2.DbgModelTargetSymbol; -import ghidra.dbg.target.*; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.util.PathUtils; -import ghidra.program.model.address.Address; - -@TargetObjectSchemaInfo( - name = "Symbol", - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType( - name = TargetSymbol.NAMESPACE_ATTRIBUTE_NAME, - type = DbgModelTargetSymbolContainerImpl.class), - @TargetAttributeType(name = TargetObject.VALUE_ATTRIBUTE_NAME, type = Address.class), - @TargetAttributeType(name = TargetSymbol.SIZE_ATTRIBUTE_NAME, type = long.class), - @TargetAttributeType(name = TargetBreakpointSpec.AS_BPT_ATTRIBUTE_NAME, type = String.class), - @TargetAttributeType(name = "Name", type = String.class), - @TargetAttributeType(name = "Size", type = long.class), - @TargetAttributeType(name = "TypeId", type = int.class), - @TargetAttributeType(name = "Tag", type = int.class), - @TargetAttributeType(type = Void.class) }) -public class DbgModelTargetSymbolImpl extends DbgModelTargetObjectImpl - implements DbgModelTargetSymbol { - protected static String indexSymbol(DbgMinimalSymbol symbol) { - return symbol.getName(); - } - - protected static String keySymbol(DbgMinimalSymbol symbol) { - return PathUtils.makeKey(indexSymbol(symbol)); - } - - protected final boolean constant; - protected final Address value; - protected final long size; - - public DbgModelTargetSymbolImpl(DbgModelTargetSymbolContainerImpl symbols, - DbgMinimalSymbol symbol) { - super(symbols.getModel(), symbols, keySymbol(symbol), "Symbol"); - this.getModel().addModelObject(symbol, this); - this.constant = false; - this.value = symbols.getModel().getAddressSpace("ram").getAddress(symbol.getAddress()); - this.size = symbol.getSize(); - - TargetObject module = symbols.getParent(); - String moduleName = - (String) module.getCachedAttribute(TargetObject.SHORT_DISPLAY_ATTRIBUTE_NAME); - changeAttributes(List.of(), List.of(), Map.of( // - // TODO: DATA_TYPE - NAMESPACE_ATTRIBUTE_NAME, symbols, // - VALUE_ATTRIBUTE_NAME, value, // - SIZE_ATTRIBUTE_NAME, size, // - TargetBreakpointSpec.AS_BPT_ATTRIBUTE_NAME, // - moduleName + "!" + symbol.getName(), // - "Name", symbol.getName(), // - "Size", size, // - "TypeId", symbol.getTypeId(), // - "Tag", symbol.getTag() // - ), "Initialized"); - } - - @Override - public boolean isConstant() { - return constant; - } - - @Override - public Address getValue() { - return value; - } - - @Override - public long getSize() { - return size; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetThreadContainerImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetThreadContainerImpl.java deleted file mode 100644 index 42fa8f2f59..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetThreadContainerImpl.java +++ /dev/null @@ -1,204 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.impl; - -import java.lang.invoke.MethodHandles; -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import agent.dbgeng.dbgeng.DebugThreadId; -import agent.dbgeng.manager.DbgCause; -import agent.dbgeng.manager.DbgProcess; -import agent.dbgeng.manager.DbgReason; -import agent.dbgeng.manager.DbgState; -import agent.dbgeng.manager.DbgThread; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgeng.manager.impl.DbgProcessImpl; -import agent.dbgeng.manager.reason.DbgEndSteppingRangeReason; -import agent.dbgeng.manager.reason.DbgExitNormallyReason; -import agent.dbgeng.manager.reason.DbgExitedReason; -import agent.dbgeng.manager.reason.DbgSignalReceivedReason; -import agent.dbgeng.model.iface1.DbgModelTargetConfigurable; -import agent.dbgeng.model.iface2.DbgModelTargetProcess; -import agent.dbgeng.model.iface2.DbgModelTargetThread; -import agent.dbgeng.model.iface2.DbgModelTargetThreadContainer; -import ghidra.async.AsyncUtils; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.error.DebuggerIllegalArgumentException; -import ghidra.dbg.target.TargetConfigurable; -import ghidra.dbg.target.TargetMethod; -import ghidra.dbg.target.TargetMethod.AnnotatedTargetMethod; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetElementType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; - -@TargetObjectSchemaInfo( - name = "ThreadContainer", - elements = { - @TargetElementType(type = DbgModelTargetThreadImpl.class) - }, - attributes = { - @TargetAttributeType(name = TargetConfigurable.BASE_ATTRIBUTE_NAME, type = Integer.class), - @TargetAttributeType(name = "Populate", type = TargetMethod.class), - @TargetAttributeType(type = Void.class) - }, - canonicalContainer = true) -public class DbgModelTargetThreadContainerImpl extends DbgModelTargetObjectImpl - implements DbgModelTargetThreadContainer, DbgModelTargetConfigurable { - - protected final DbgProcess process; - - public DbgModelTargetThreadContainerImpl(DbgModelTargetProcessImpl process) { - super(process.getModel(), process, "Threads", "ThreadContainer"); - this.process = process.process; - this.changeAttributes(List.of(), Map.of( - BASE_ATTRIBUTE_NAME, 16 // - ), "Initialized"); - - DbgManagerImpl manager = getManager(); - manager.addEventsListener(this); - if (manager.isKernelMode() && !process.getProcess().getId().isSystem()) { - changeAttributes(List.of(), List.of(), - AnnotatedTargetMethod.collectExports(MethodHandles.lookup(), getModel(), this), - "Methods"); - } - } - - @Override - public void threadCreated(DbgThread thread) { - changeElements(List.of(), List.of(getTargetThread(thread)), Map.of(), "Created"); - DbgModelTargetThread targetThread = getTargetThread(thread); - changeElements(List.of(), List.of(targetThread), Map.of(), "Created"); - targetThread.threadStateChangedSpecific(DbgState.STARTING, DbgReason.getReason(null)); - broadcast().event(getProxy(), targetThread, TargetEventType.THREAD_CREATED, - "Thread " + thread.getId() + " started", List.of(targetThread)); - } - - @Override - public void threadStateChanged(DbgThread thread, DbgState state, DbgCause cause, - DbgReason reason) { - if (!thread.getProcess().equals(process)) { - return; - } - DbgModelTargetThread targetThread = getTargetThread(thread); - TargetEventType eventType = getEventType(state, cause, reason); - broadcast().event(getProxy(), targetThread, eventType, - "Thread " + thread.getId() + " state changed", List.of(targetThread)); - targetThread.threadStateChangedSpecific(state, reason); - } - - @Override - public void threadExited(DebugThreadId threadId) { - DbgModelImpl impl = (DbgModelImpl) model; - DbgModelTargetThread targetThread = (DbgModelTargetThread) impl.getModelObject(threadId); - if (targetThread != null) { - broadcast().event(getProxy(), targetThread, TargetEventType.THREAD_EXITED, - "Thread " + threadId + " exited", List.of(targetThread)); - } - //synchronized (this) { - // threadsById.remove(threadId); - //} - changeElements(List.of( // - DbgModelTargetThreadImpl.indexThread(threadId) // - ), List.of(), Map.of(), "Exited"); - } - - private TargetEventType getEventType(DbgState state, DbgCause cause, DbgReason reason) { - switch (state) { - case RUNNING: - return TargetEventType.RUNNING; - case STOPPED: - case EXIT: - if (reason instanceof DbgEndSteppingRangeReason) { - return TargetEventType.STEP_COMPLETED; - } - if (reason instanceof DbgSignalReceivedReason) { - return TargetEventType.SIGNAL; - } - if (reason instanceof DbgExitedReason) { - return TargetEventType.EXCEPTION; - } - if (reason instanceof DbgExitNormallyReason) { - return TargetEventType.THREAD_EXITED; - } - return TargetEventType.STOPPED; - default: - break; - } - return null; - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - return process.listThreads().thenAccept(byTID -> { - List threads; - synchronized (this) { - threads = - byTID.values().stream().map(this::getTargetThread).collect(Collectors.toList()); - } - setElements(threads, Map.of(), "Refreshed"); - }); - } - - @Override - public synchronized DbgModelTargetThread getTargetThread(DbgThread thread) { - DbgModelImpl impl = (DbgModelImpl) model; - TargetObject modelObject = impl.getModelObject(thread); - if (modelObject != null) { - return (DbgModelTargetThread) modelObject; - } - return new DbgModelTargetThreadImpl(this, (DbgModelTargetProcess) parent, thread); - } - - @Override - public CompletableFuture writeConfigurationOption(String key, Object value) { - switch (key) { - case BASE_ATTRIBUTE_NAME: - if (value instanceof Integer) { - this.changeAttributes(List.of(), Map.of(BASE_ATTRIBUTE_NAME, value), - "Modified"); - for (TargetObject child : getCachedElements().values()) { - if (child instanceof DbgModelTargetThreadImpl) { - DbgModelTargetThreadImpl targetThread = - (DbgModelTargetThreadImpl) child; - targetThread.setBase(value); - } - } - } - else { - throw new DebuggerIllegalArgumentException("Base should be numeric"); - } - default: - } - return AsyncUtils.nil(); - } - - @TargetMethod.Export("Populate") - public CompletableFuture populate() { - return getManager().listOSThreads((DbgProcessImpl) process).thenAccept(byTID -> { - List threads; - synchronized (this) { - threads = - byTID.values().stream().map(this::getTargetThread).collect(Collectors.toList()); - } - setElements(threads, Map.of(), "Refreshed"); - }); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetThreadImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetThreadImpl.java deleted file mode 100644 index 3a722598d3..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetThreadImpl.java +++ /dev/null @@ -1,215 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.impl; - -import java.lang.invoke.MethodHandles; -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.dbgeng.DebugThreadId; -import agent.dbgeng.manager.DbgReason; -import agent.dbgeng.manager.DbgState; -import agent.dbgeng.manager.DbgThread; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgeng.model.iface2.DbgModelTargetProcess; -import agent.dbgeng.model.iface2.DbgModelTargetRegisterContainerAndBank; -import agent.dbgeng.model.iface2.DbgModelTargetThread; -import agent.dbgeng.model.iface2.DbgModelTargetThreadContainer; -import ghidra.dbg.target.TargetEnvironment; -import ghidra.dbg.target.TargetMethod.AnnotatedTargetMethod; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetElementType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; -import ghidra.dbg.util.PathUtils; - -@TargetObjectSchemaInfo( - name = "Thread", - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType( - name = "Registers", - type = DbgModelTargetRegisterContainerImpl.class, - required = true, - fixed = true), - @TargetAttributeType( - name = "Stack", - type = DbgModelTargetStackImpl.class, - required = true, - fixed = true), - @TargetAttributeType(name = TargetEnvironment.ARCH_ATTRIBUTE_NAME, type = String.class), - @TargetAttributeType(type = Void.class) }) -public class DbgModelTargetThreadImpl extends DbgModelTargetObjectImpl - implements DbgModelTargetThread { - - public static final TargetStepKindSet SUPPORTED_KINDS = TargetStepKindSet.of( // - TargetStepKind.FINISH, // - TargetStepKind.LINE, // - TargetStepKind.OVER, // - TargetStepKind.OVER_LINE, // - TargetStepKind.RETURN, // - TargetStepKind.UNTIL, // - TargetStepKind.EXTENDED); - - protected static String indexThread(DebugThreadId debugThreadId) { - return debugThreadId.id(); - } - - protected static String indexThread(DbgThread thread) { - return indexThread(thread.getId()); - } - - protected static String keyThread(DbgThread thread) { - return PathUtils.makeKey(indexThread(thread)); - } - - protected final DbgThread thread; - - protected final DbgModelTargetRegisterContainerImpl registers; - protected final DbgModelTargetStackImpl stack; - - private DbgModelTargetProcess process; - private Integer base = 16; - - public DbgModelTargetThreadImpl(DbgModelTargetThreadContainer threads, - DbgModelTargetProcess process, DbgThread thread) { - super(threads.getModel(), threads, keyThread(thread), "Thread"); - this.getModel().addModelObject(thread, this); - this.getModel().addModelObject(thread.getId(), this); - this.process = process; - this.thread = thread; - - this.registers = new DbgModelTargetRegisterContainerImpl(this); - this.stack = new DbgModelTargetStackImpl(this, process); - - changeAttributes(List.of(), List.of(), - AnnotatedTargetMethod.collectExports(MethodHandles.lookup(), threads.getModel(), this), - "Methods"); - changeAttributes(List.of(), List.of( // - registers, // - stack // - ), Map.of( // - ACCESSIBLE_ATTRIBUTE_NAME, accessible = false, // - DISPLAY_ATTRIBUTE_NAME, getDisplay(), // - SUPPORTED_STEP_KINDS_ATTRIBUTE_NAME, SUPPORTED_KINDS // - ), "Initialized"); - setExecutionState(convertState(thread.getState()), "Initialized"); - // TODO: Stack (Registers) - - getManager().addEventsListener(this); - } - - @Override - public String getDisplay() { - if (thread == null) { - return "[unknown]"; - } - DebugThreadId id = thread.getId(); - Long tid = thread.getTid(); - if (getManager().isKernelMode()) { - if (id.isSystem()) { - return "[" + id.id() + "]"; - } - String tidstr = Long.toString(tid, base); - if (base == 16) { - tidstr = "0x" + tidstr; - } - Long offset = thread.getOffset(); - return offset == null ? "[" + tidstr + "]" : "[" + tidstr + " : " + Long.toHexString(offset) + "]"; - } - else { - if (tid < 0) { - return "[" + id.id() + "]"; - } - String tidstr = Long.toString(tid, base); - if (base == 16) { - tidstr = "0x" + tidstr; - } - return "[" + id.id() + ":" + tidstr + "]"; - } - } - - @Override - public void threadStateChangedSpecific(DbgState state, DbgReason reason) { - TargetExecutionState targetState = convertState(state); - String executionType = thread.getExecutingProcessorType().description; - changeAttributes(List.of(), List.of(), Map.of( // - STATE_ATTRIBUTE_NAME, targetState, // - TargetEnvironment.ARCH_ATTRIBUTE_NAME, executionType // - ), reason.desc()); - //setExecutionState(targetState, reason.desc()); - registers.threadStateChangedSpecific(state, reason); - stack.threadStateChangedSpecific(state, reason); - } - - @Override - public CompletableFuture step(TargetStepKind kind) { - switch (kind) { - case SKIP: - throw new UnsupportedOperationException(kind.name()); - default: - return model.gateFuture(thread.step(convertToDbg(kind))); - } - } - - @Override - public CompletableFuture step(Map args) { - return model.gateFuture(thread.step(args)); - } - - @Override - public CompletableFuture setActive() { - DbgManagerImpl manager = getManager(); - return manager.setActiveThread(thread); - } - - public DbgModelTargetRegisterContainerAndBank getRegisters() { - return registers; - } - - @Override - public DbgModelTargetStackImpl getStack() { - return stack; - } - - @Override - public DbgThread getThread() { - return thread; - } - - public DbgModelTargetProcess getProcess() { - return process; - } - - @Override - public boolean isAccessible() { - return accessible; - } - - @Override - public String getExecutingProcessorType() { - return thread.getExecutingProcessorType().description; - } - - public void setBase(Object value) { - this.base = (Integer) value; - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDisplay()// - ), "Started"); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetTraceOrDumpConnectorImpl.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetTraceOrDumpConnectorImpl.java deleted file mode 100644 index b1ce758899..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetTraceOrDumpConnectorImpl.java +++ /dev/null @@ -1,93 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.impl; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgeng.model.iface2.DbgModelTargetConnector; -import ghidra.async.AsyncUtils; -import ghidra.async.TypeSpec; -import ghidra.dbg.error.DebuggerUserException; -import ghidra.dbg.target.TargetMethod; -import ghidra.dbg.target.TargetMethod.ParameterDescription; -import ghidra.dbg.target.TargetMethod.TargetParameterMap; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "TraceOrDumpConnector", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(type = Void.class) - }) -public class DbgModelTargetTraceOrDumpConnectorImpl extends DbgModelTargetObjectImpl - implements DbgModelTargetConnector { - - protected final DbgModelTargetConnectorContainerImpl connectors; - protected final TargetParameterMap paramDescs; - - public DbgModelTargetTraceOrDumpConnectorImpl(DbgModelTargetConnectorContainerImpl connectors, - String name) { - super(connectors.getModel(), connectors, name, name); - this.connectors = connectors; - - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDisplay(), // - TargetMethod.PARAMETERS_ATTRIBUTE_NAME, - paramDescs = TargetParameterMap.copyOf(computeParameters()) // - ), "Initialized"); - } - - @Override - public CompletableFuture setActive() { - connectors.setDefaultConnector(this); - return CompletableFuture.completedFuture(null); - } - - protected Map> computeParameters() { - HashMap> map = - new HashMap>(); - ParameterDescription p1 = ParameterDescription.create(String.class, "CommandLine", - true, ".opendump", "Cmd", "native loader command"); - ParameterDescription p2 = ParameterDescription.create(String.class, "TraceOrDump", - true, "", "File", "trace or dump to be loaded"); - map.put("CommandLine", p1); - map.put("TraceOrDump", p2); - return map; - } - - @Override - public TargetParameterMap getParameters() { - return TargetMethod.getParameters(this); - } - - @Override - public CompletableFuture launch(Map args) { - return AsyncUtils.sequence(TypeSpec.VOID).then(seq -> { - DbgManagerImpl manager = getManager(); - Boolean qv = (Boolean) args.get("UseQueryVirtual"); - if (qv != null) { - manager.setAltMemoryQuery(!qv); - } - manager.openFile(args).handle(seq::nextIgnore); - }).finish().exceptionally((exc) -> { - throw new DebuggerUserException("Launch failed for " + args); - }); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/dbgeng/DbgEngTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/dbgeng/DbgEngTest.java deleted file mode 100644 index d9bd792f9b..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/dbgeng/DbgEngTest.java +++ /dev/null @@ -1,905 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.dbgeng; - -import static org.junit.Assert.*; -import static org.junit.Assume.assumeTrue; - -import java.io.*; -import java.nio.ByteBuffer; -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import org.junit.*; - -import com.sun.jna.Native; -import com.sun.jna.platform.win32.COM.COMException; -import com.sun.jna.win32.StdCallLibrary; - -import agent.dbgeng.dbgeng.DebugBreakpoint.BreakType; -import agent.dbgeng.dbgeng.DebugClient.*; -import agent.dbgeng.dbgeng.DebugDataSpaces.*; -import agent.dbgeng.dbgeng.DebugModule.DebugModuleName; -import agent.dbgeng.dbgeng.DebugRegisters.DebugRegisterDescription; -import agent.dbgeng.dbgeng.DebugRegisters.DebugRegisterSource; -import agent.dbgeng.dbgeng.DebugValue.DebugInt64Value; -import agent.dbgeng.dbgeng.DebugValue.DebugValueType; -import agent.dbgeng.dbgeng.util.DebugEventCallbacksAdapter; -import ghidra.comm.util.BitmaskSet; -import ghidra.dbg.testutil.DummyProc; -import ghidra.framework.Application; -import ghidra.test.AbstractGhidraHeadlessIntegrationTest; -import ghidra.util.Msg; -import ghidra.util.NumericUtilities; - -@Ignore("deprecated") -public class DbgEngTest extends AbstractGhidraHeadlessIntegrationTest { - - private interface DummyLibIf extends StdCallLibrary { - } - - public static void assumeDbgengDLLLoadable() { - try { - Native.load("dbgeng.dll", DummyLibIf.class); - - } - catch (UnsatisfiedLinkError ex) { - assumeTrue("dbgeng.dll not found. Probably not Windows here.", false); - } - } - - protected static DebugClient cachedClient = null; - - protected DebugClient doDebugCreate() { - System.out.println("Creating a client"); - return DbgEng.debugCreate().createClient(); - } - - protected DebugClient debugCreate() { - //if (cachedClient == null) { - cachedClient = doDebugCreate(); - //} - return cachedClient; - } - - protected DebugClient client; - protected DebugControl control; - - @Before - public void setUp() { - assumeDbgengDLLLoadable(); - client = debugCreate(); - control = client.getControl(); - } - - @Test - public void testPrintln() { - CompletableFuture cb = new CompletableFuture<>(); - client.setOutputCallbacks(new DebugOutputCallbacks() { - @Override - public void output(int mask, String text) { - System.out.print(text); - cb.complete(text); - } - }); - control.outln("Hello, World!"); - String back = cb.getNow(null); - // NOTE: I'd like to be precise wrt/ new lines, but it seems to vary with version. - assertEquals("Hello, World!", back.trim()); - } - - @Test - public void testGetProcessSystemIds() { - List procs = client.getRunningProcesses(client.getLocalServer()); - System.out.println("Total: " + procs.size()); - procs.sort(null); - for (DebugRunningProcess p : procs) { - System.out.println("ID: " + p.getSystemId()); - } - } - - @Test - public void testGetProcessDescriptions() { - List procs = client.getRunningProcesses(client.getLocalServer()); - System.out.println("Total: " + procs.size()); - procs.sort(null); - for (DebugRunningProcess p : procs) { - try { - System.out.println(p.getFullDescription()); - } - catch (COMException e) { - System.out.println("Error with PID " + p.getSystemId() + ": " + e.getMessage()); - } - } - } - - public static abstract class NoisyDebugEventCallbacksAdapter - extends DebugEventCallbacksAdapter { - final DebugStatus defaultStatus; - - public NoisyDebugEventCallbacksAdapter(DebugStatus defaultStatus) { - this.defaultStatus = defaultStatus; - } - - @Override - public DebugStatus createProcess(DebugProcessInfo debugProcessInfo) { - Msg.info(this, "createProcess: " + debugProcessInfo); - return defaultStatus; - } - - @Override - public DebugStatus createThread(DebugThreadInfo debugThreadInfo) { - Msg.info(this, "createThread: " + debugThreadInfo); - return defaultStatus; - } - - @Override - public DebugStatus exitProcess(int exitCode) { - Msg.info(this, "exitProcess: " + Integer.toHexString(exitCode)); - return defaultStatus; - } - - @Override - public DebugStatus breakpoint(DebugBreakpoint bp) { - Msg.info(this, "breakpoint: " + bp); - return defaultStatus; - } - - @Override - public DebugStatus changeDebuggeeState(BitmaskSet flags, - long argument) { - Msg.info(this, "changeDebuggeeState: " + flags + ", " + argument); - return defaultStatus; - } - - @Override - public DebugStatus changeEngineState(BitmaskSet flags, long argument) { - Msg.info(this, "changeEngineState: " + flags + ", " + argument); - return defaultStatus; - } - - @Override - public DebugStatus changeSymbolState(BitmaskSet flags, long argument) { - Msg.info(this, "changeSymbolState: " + flags + ", " + argument); - return defaultStatus; - } - - @Override - public DebugStatus exception(DebugExceptionRecord64 exception, boolean firstChance) { - Msg.info(this, "exception: " + exception + ", " + firstChance); - return defaultStatus; - } - - @Override - public DebugStatus exitThread(int exitCode) { - Msg.info(this, "exitThread: " + Integer.toHexString(exitCode)); - return defaultStatus; - } - - @Override - public DebugStatus loadModule(DebugModuleInfo debugModuleInfo) { - Msg.info(this, "loadModule: " + debugModuleInfo); - return defaultStatus; - } - - @Override - public DebugStatus sessionStatus(SessionStatus status) { - Msg.info(this, "sessionStatus: " + status); - return defaultStatus; - } - - @Override - public DebugStatus systemError(int error, int level) { - Msg.info(this, "systemError: " + error + ", " + level); - return defaultStatus; - } - - @Override - public DebugStatus unloadModule(String imageBaseName, long baseOffset) { - Msg.info(this, "unloadModule: " + imageBaseName + ", " + baseOffset); - return defaultStatus; - } - } - - protected class ProcMaker implements AutoCloseable { - public ProcMaker(String cmdLine) { - this.cmdLine = cmdLine; - } - - final String cmdLine; - - final CompletableFuture procInfo = new CompletableFuture<>(); - final CompletableFuture threadInfo = new CompletableFuture<>(); - final CompletableFuture procExit = new CompletableFuture<>(); - - StringBuilder outputCapture = null; - - public void start() { - client.setEventCallbacks(new NoisyDebugEventCallbacksAdapter(DebugStatus.NO_CHANGE) { - @Override - public DebugStatus createProcess(DebugProcessInfo debugProcessInfo) { - super.createProcess(debugProcessInfo); - procInfo.complete(debugProcessInfo); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus createThread(DebugThreadInfo debugThreadInfo) { - super.createThread(debugThreadInfo); - threadInfo.complete(debugThreadInfo); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus exitProcess(int exitCode) { - super.exitProcess(exitCode); - procExit.complete(exitCode); - return DebugStatus.BREAK; - } - }); - client.setOutputCallbacks(new DebugOutputCallbacks() { - @Override - public void output(int mask, String text) { - System.out.print(text); - if (outputCapture != null) { - outputCapture.append(text); - } - } - }); - - Msg.debug(this, "Starting " + cmdLine + " with client " + client); - control.execute(".create " + cmdLine); - control.waitForEvent(); - DebugProcessInfo pi = procInfo.getNow(null); - assertNotNull(pi); - control.execute("g"); - control.waitForEvent(); - DebugThreadInfo ti = threadInfo.getNow(null); - assertNotNull(ti); - } - - public void kill() { - Msg.debug(this, "Killing " + cmdLine); - control.execute(".kill"); - control.waitForEvent(); - Integer exitCode = procExit.getNow(null); - client.setOutputCallbacks(null); - assertNotNull(exitCode); - } - - public List execCapture(String command) { - try { - outputCapture = new StringBuilder(); - control.execute(command); - return Arrays.asList(outputCapture.toString().split("\n")); - } - finally { - outputCapture = null; - } - } - - @Override - public void close() { - if (procInfo.isDone() && !procExit.isDone()) { - kill(); - } - } - } - - @Test - public void testDescribeVector256Register() { - try (ProcMaker maker = new ProcMaker("notepad")) { - maker.start(); - - DebugRegisters regs = client.getRegisters(); - int index = regs.getIndexByName("ymm0"); - DebugRegisterDescription desc = regs.getDescription(index); - Msg.debug(this, "desc=" + desc); - // This seems wrong, but I'm curious about the value - assertEquals(DebugValueType.VECTOR128, desc.type); - - DebugValue value = regs.getValue(index); - Msg.debug(this, "value=" + value); - } - } - - @Test - public void testGetSingleRegister() { - try (ProcMaker maker = new ProcMaker("notepad")) { - maker.start(); - - List out = maker.execCapture("r"); - String expected = - out.stream().filter(s -> s.startsWith("rax")).findAny().get().split("\\s+")[0]; - - DebugRegisters regs = client.getRegisters(); - DebugInt64Value raxVal = (DebugInt64Value) regs.getValueByName("rax"); - - String actual = String.format("rax=%016x", raxVal.longValue()); - assertEquals(expected, actual); - } - } - - @Test - public void testGetRegisters() { - try (ProcMaker maker = new ProcMaker("notepad")) { - maker.start(); - - List out = maker.execCapture("r"); - String expected = out.stream().filter(s -> s.startsWith("rax")).findAny().get(); - - DebugRegisters regs = client.getRegisters(); - List indices = new ArrayList<>(); - int raxIdx = regs.getIndexByName("rax"); - int rbxIdx = regs.getIndexByName("rbx"); - int rcxIdx = regs.getIndexByName("rcx"); - indices.add(raxIdx); - indices.add(rbxIdx); - indices.add(rcxIdx); - Map values = - regs.getValues(DebugRegisterSource.DEBUG_REGSRC_DEBUGGEE, indices); - - String actual = String.format("rax=%016x rbx=%016x rcx=%016x", - ((DebugInt64Value) values.get(raxIdx)).longValue(), - ((DebugInt64Value) values.get(rbxIdx)).longValue(), - ((DebugInt64Value) values.get(rcxIdx)).longValue()); - assertEquals(expected, actual); - } - } - - @Test - public void testSetSingleRegister() { - try (ProcMaker maker = new ProcMaker("notepad")) { - maker.start(); - - DebugRegisters regs = client.getRegisters(); - regs.setValueByName("rax", new DebugInt64Value(0x0102030405060708L)); - - List out = maker.execCapture("r"); - String actual = - out.stream().filter(s -> s.startsWith("rax")).findAny().get().split("\\s+")[0]; - assertEquals("rax=0102030405060708", actual); - } - } - - @Test - public void testSetRegisters() { - try (ProcMaker maker = new ProcMaker("notepad")) { - maker.start(); - - DebugRegisters regs = client.getRegisters(); - // Purposefully choosing non-linked variant. - // Want to know that order does not make a difference. - Map values = new HashMap<>(); - values.put(regs.getIndexByName("rax"), new DebugInt64Value(0x0102030405060708L)); - values.put(regs.getIndexByName("rbx"), new DebugInt64Value(0x1122334455667788L)); - values.put(regs.getIndexByName("rcx"), new DebugInt64Value(0x8877665544332211L)); - regs.setValues(DebugRegisterSource.DEBUG_REGSRC_DEBUGGEE, values); - - List out = maker.execCapture("r"); - String actual = out.stream().filter(s -> s.startsWith("rax")).findAny().get(); - assertEquals("rax=0102030405060708 rbx=1122334455667788 rcx=8877665544332211", actual); - } - } - - @Test - public void testQueryVirtual() { - // Also, an experiment to figure out how it works - try (ProcMaker maker = new ProcMaker("notepad")) { - maker.start(); - - List collected1 = new ArrayList<>(); - try { - long last = 0; - long offset = 0; - do { - System.out.print(Long.toHexString(offset) + ": "); - DebugMemoryBasicInformation info = client.getDataSpaces().queryVirtual(offset); - //System.out.println(info); - if (info == null) { - break; - } - System.out.println(Long.toHexString(info.baseAddress) + "-" + - Long.toHexString(info.regionSize) + ": " + info.state); - if (info.baseAddress != offset) { - System.out.println(" !!!"); - } - collected1.add(info); - last = offset; - offset += info.regionSize; - } - while (Long.compareUnsigned(last, offset) < 0); - } - catch (COMException e) { - if (!e.getMessage().contains("HRESULT: 80004002")) { - throw e; - } - } - - List collected2 = new ArrayList<>(); - for (DebugMemoryBasicInformation info : client.getDataSpaces().iterateVirtual(0)) { - collected2.add(info); - } - - assertTrue(collected1.size() > 0); - assertEquals(collected1, collected2); - - // For comparison - client.getControl().execute("!address"); - } - } - - @Test - public void testModules() { - try (ProcMaker maker = new ProcMaker("notepad")) { - maker.start(); - - for (DebugModule mod : client.getSymbols().iterateModules(0)) { - System.out.println(mod.getIndex() + ": " + Long.toHexString(mod.getBase()) + ": " + - mod.getName(DebugModuleName.MODULE)); - System.out.println(" Img: " + mod.getName(DebugModuleName.IMAGE)); - System.out.println(" Load: " + mod.getName(DebugModuleName.LOADED_IMAGE)); - } - } - } - - @Test(expected = COMException.class) - public void testModuleOutOfBounds() { - try (ProcMaker maker = new ProcMaker("notepad")) { - maker.start(); - - DebugModule umod = client.getSymbols() - .getModuleByIndex( - client.getSymbols().getNumberLoadedModules() + 1); - System.out.println(umod.getBase()); - } - } - - @Test - public void testQueryVirtualWithModule() { - try (ProcMaker maker = new ProcMaker("notepad")) { - maker.start(); - - for (DebugMemoryBasicInformation info : client.getDataSpaces().iterateVirtual(0)) { - if (info.state != PageState.FREE) { - DebugModule mod = null; - String name = "[NONE]"; - try { - mod = client.getSymbols().getModuleByOffset(info.baseAddress, 0); - name = mod.getName(DebugModuleName.IMAGE); - } - catch (COMException e) { - name = "[ERR:" + e + "]"; - } - System.out.println(String.format("%016x", info.baseAddress) + ":" + - Long.toHexString(info.regionSize) + ":" + info.state + " from " + name + - " " + info.type + info.protect); - } - } - } - } - - @Test - public void testSymbols() { - try (ProcMaker maker = new ProcMaker("notepad")) { - maker.start(); - - Set symbols = new LinkedHashSet<>(); - Set modules = new LinkedHashSet<>(); - for (DebugSymbolName sym : client.getSymbols().iterateSymbolMatches("*")) { - String[] parts = sym.name.split("!"); - symbols.add(sym); - modules.add(parts[0]); - } - System.out.println("Total Symbols: " + symbols.size()); - System.out.println("Total Modules (by symbol name): " + modules.size()); - - // These make assumptions that could be broken later. - // It used to expect at least 10 modules (devised when testing on Win7). Now it's 5! - assertTrue("Fewer than 1000 symbols: " + symbols.size(), symbols.size() > 1000); - assertTrue("Fewer than 3 modules: " + modules.size(), modules.size() > 3); - } - } - - @Test - public void testSymbolInfo() { - try (ProcMaker maker = new ProcMaker("notepad")) { - maker.start(); - - int count = 0; - for (DebugSymbolId symid : client.getSymbols().getSymbolIdsByName("ntdll!*")) { - //System.out.println(symid); - DebugSymbolEntry syment = client.getSymbols().getSymbolEntry(symid); - if (syment.typeId != 0) { - System.out.println(" " + syment); - } - count++; - } - - assertTrue(count > 10); - } - } - - @Test - public void testReadMemory() throws FileNotFoundException, IOException { - try (ProcMaker maker = new ProcMaker("notepad")) { - maker.start(); - - control.execute(".server tcp:port=54321"); - int len = 256; - - DebugModule notepadModule = client.getSymbols().getModuleByModuleName("notepad", 0); - System.out.println("Base: " + Long.toHexString(notepadModule.getBase())); - ByteBuffer data = ByteBuffer.allocate(len); - client.getDataSpaces().readVirtual(notepadModule.getBase(), data, data.remaining()); - System.out.println(NumericUtilities.convertBytesToString(data.array())); - - // TODO: Avoid hardcoding path to notepad - try (FileInputStream fis = new FileInputStream("C:\\Windows\\notepad.exe")) { - byte[] fromFile = new byte[len]; - fis.read(fromFile); - // TODO: Note sure why, but this seems to be the case after it's loaded - //ByteBuffer toWriteBase = ByteBuffer.wrap(fromFile).order(ByteOrder.LITTLE_ENDIAN); - //toWriteBase.putLong(280, notepadModule.getBase()); - System.out.println(NumericUtilities.convertBytesToString(fromFile)); - assertArrayEquals(fromFile, data.array()); - } - - data.clear(); - data.putInt(0x12345678); - client.getDataSpaces().readVirtual(notepadModule.getBase(), data, data.remaining()); - data.flip(); - - assertEquals(0x12345678, data.getInt()); - } - } - - //@Test - NOT WORKING, addresses in RW memory still not necessarily writeable (why?) - public void testWriteMemory() { - try (ProcMaker maker = new ProcMaker("notepad")) { - maker.start(); - - // TODO: How to write to protected memory? - // Debugger should be able to modify program code. - DebugMemoryBasicInformation writable = null; - space: for (DebugMemoryBasicInformation info : client.getDataSpaces() - .iterateVirtual( - 0)) { - for (PageProtection prot : info.protect) { - if (prot.isWrite()) { - writable = info; - break space; - } - } - } - if (writable == null) { - throw new AssertionError("No writable pages?"); - } - System.out.println("writable: " + writable); - ByteBuffer toWrite = ByteBuffer.allocate(10); - toWrite.putInt(0x12345678); - toWrite.putInt(0x89abcdef); - toWrite.putShort((short) 0x5555); - toWrite.flip(); - client.getDataSpaces().writeVirtual(writable.baseAddress, toWrite, toWrite.remaining()); - - ByteBuffer toRead = ByteBuffer.allocate(10); - client.getDataSpaces().readVirtual(writable.baseAddress, toRead, toRead.remaining()); - - assertArrayEquals(toWrite.array(), toRead.array()); - } - } - - @Test - public void testBreakpoints() { - try (ProcMaker maker = new ProcMaker("notepad")) { - maker.start(); - - DebugBreakpoint bpt = control.addBreakpoint(BreakType.CODE); - System.out.println("Breakpoint id: " + bpt.getId()); - System.out.println("Flags: " + bpt.getFlags()); - DebugBreakpoint bpt2 = control.getBreakpointById(bpt.getId()); - assertEquals(bpt, bpt2); - } - } - - @Test - public void testFreezeUnfreeze() { - try (ProcMaker maker = new ProcMaker("notepad")) { - maker.start(); - - // Trying to see if any events will help me track frozen threads - System.out.println("****Freezing"); - control.execute("~0 f"); - System.out.println("****Unfreezing"); - control.execute("~0 u"); - System.out.println("****Done"); - // Well, that result stinks. - // There is no event to tell me about frozenness - } - } - - @Test - @Ignore("I can't find a reliable means to detect the last thread. " + - "There's supposed to be an initial break, but it is rarely reported. " + - "I thought about toolhelp, but that presumes local live debugging.") - public void testMultiThreadAttach() throws Exception { - // I need to see how to attach to multi-threaded processes. There must be some event - // or condition to indicate when all threads have been discovered. - String specimen = - Application.getOSFile("sctldbgeng", "expCreateThreadSpin.exe").getCanonicalPath(); - client.setOutputCallbacks(new DebugOutputCallbacks() { - @Override - public void output(int mask, String text) { - System.out.print(text); - System.out.flush(); - } - }); - client.setEventCallbacks(new DebugEventCallbacksAdapter() { - @Override - public DebugStatus breakpoint(DebugBreakpoint bp) { - control.outln("*** Breakpoint: " + bp); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus exception(DebugExceptionRecord64 exception, boolean firstChance) { - control.outln("*** Exception: " + exception + "," + firstChance); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus createThread(DebugThreadInfo debugThreadInfo) { - control.outln("*** CreateThread: " + debugThreadInfo); - System.out.println("Threads: " + client.getSystemObjects().getThreads()); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus createProcess(DebugProcessInfo debugProcessInfo) { - control.outln("*** CreateProcess: " + debugProcessInfo); - System.out.println("Threads: " + client.getSystemObjects().getThreads()); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus exitThread(int exitCode) { - control.outln("*** ExitThread: code=" + exitCode + ", " + - client.getSystemObjects().getEventThread()); - System.out.println("Threads: " + client.getSystemObjects().getThreads()); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus exitProcess(int exitCode) { - control.outln("*** ExitProcess: code=" + exitCode + ", " + - client.getSystemObjects().getEventProcess()); - System.out.println("Threads: " + client.getSystemObjects().getThreads()); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus changeEngineState(BitmaskSet flags, - long argument) { - if (flags.contains(ChangeEngineState.EXECUTION_STATUS)) { - control.outln( - "*** ExecutionStatus: " + control.getExecutionStatus()); - } - return DebugStatus.NO_CHANGE; - } - }); - try (DummyProc proc = DummyProc.run(specimen)) { - System.out.println("Started " + specimen + " with PID=" + proc.pid); - Thread.sleep(1000); - System.out.println("Attaching..."); - client.attachProcess(client.getLocalServer(), proc.pid, BitmaskSet.of()); - if (true) { - for (int i = 0; i < 10; i++) { - System.out.println("WAIT " + i + "..."); - control.waitForEvent(100); - System.out.println("STATUS: " + control.getExecutionStatus()); - System.out.println("DONE " + i); - // control.execute("~*"); - } - } - } - finally { - client.setEventCallbacks(null); - } - } - - protected static class BreakAllCallbacks extends DebugEventCallbacksAdapter { - protected final DebugControl control; - protected final DebugRegisters regs; - protected final DebugSystemObjects objs; - - volatile protected long currentThread = 0; - volatile protected DebugProcessInfo createdProc = null; - volatile protected String lastReg = null; - - public BreakAllCallbacks(DebugClient client) { - this.control = client.getControl(); - this.regs = client.getRegisters(); - this.objs = client.getSystemObjects(); - } - - @Override - public DebugStatus breakpoint(DebugBreakpoint bp) { - control.outln("*** Breakpoint: " + bp); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus changeDebuggeeState(BitmaskSet flags, - long argument) { - control.outln("*** ChangeDebuggeeState: " + flags + "," + argument); - if (flags.contains(ChangeDebuggeeState.REGISTERS) && - !flags.contains(ChangeDebuggeeState.REFRESH)) { - DebugRegisterDescription description = regs.getDescription((int) argument); - control.outln(" Process: " + objs.getEventProcess()); - control.outln(" Thread: " + Long.toHexString(objs.getCurrentThreadSystemId())); - control.outln(" Reg: " + description); - control.outln(" Val: " + NumericUtilities - .convertBytesToString(regs.getValue((int) argument).encodeAsBytes(), "")); - lastReg = description.name; - } - return DebugStatus.BREAK; - } - - @Override - public DebugStatus changeEngineState(BitmaskSet flags, long argument) { - control.outln("*** ChangeEngineState: " + flags + "," + Long.toHexString(argument)); - if (flags.contains(ChangeEngineState.CURRENT_THREAD)) { - currentThread = argument; - } - return DebugStatus.BREAK; - } - - @Override - public DebugStatus changeSymbolState(BitmaskSet flags, long argument) { - control.outln("*** ChangeSymbolState: " + flags + "," + argument); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus createProcess(DebugProcessInfo debugProcessInfo) { - control.outln("*** CreateProcess: " + debugProcessInfo); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus createThread(DebugThreadInfo debugThreadInfo) { - control.outln("*** CreateThread: " + debugThreadInfo); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus exception(DebugExceptionRecord64 exception, boolean firstChance) { - control.outln("*** Exception: " + exception + "," + firstChance); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus exitProcess(int exitCode) { - control.outln("*** ExitProcess: code=" + exitCode); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus exitThread(int exitCode) { - control.outln("*** ExitThread: code=" + exitCode); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus loadModule(DebugModuleInfo debugModuleInfo) { - control.outln("*** LoadModule: " + debugModuleInfo); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus sessionStatus(SessionStatus status) { - control.outln("*** SessionStatus: " + status); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus systemError(int error, int level) { - control.outln("*** SystemError: " + error + "," + level); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus unloadModule(String imageBaseName, long baseOffset) { - control.outln("*** UnloadModule: " + imageBaseName + "," + baseOffset); - return DebugStatus.BREAK; - } - } - - protected static class ConsoleOutputCallbacks implements DebugOutputCallbacks { - @Override - public void output(int mask, String text) { - System.out.print(text); - System.out.flush(); - } - } - - //@Test - This test is way broken; the while(true) loop is unexitable - public void testAttachLaunch() throws Exception { - final String specimenX = "C:\\windows\\write.exe"; - final String specimenA = "C:\\windows\\notepad.exe"; - final String specimenC = "C:\\windows\\system32\\win32calc.exe"; - - try (DummyProc proc = DummyProc.run(specimenX)) { - client.setOutputCallbacks(new ConsoleOutputCallbacks()); - BreakAllCallbacks cb = new BreakAllCallbacks(client); - client.setEventCallbacks(cb); - System.out.println("Started " + specimenA + " with PID=" + proc.pid); - Thread.sleep(1000); - - //System.out.println("Attaching..."); - //client.attachProcess(client.getLocalServer(), proc.pid, BitmaskSet.of()); - client.createProcess(client.getLocalServer(), specimenA, null, null, - BitmaskSet.of(DebugCreateFlags.DEBUG_PROCESS), - BitmaskSet.of(DebugEngCreateFlags.DEBUG_ECREATE_PROCESS_DEFAULT), - BitmaskSet.of(DebugVerifierFlags.DEBUG_VERIFIER_DEFAULT)); - - cb.lastReg = null; - //while (cb.lastReg == null) { - while (true) { - if (cb.currentThread != 0) { - client.getControl().execute("~* r rip"); - } - client.getControl().waitForEvent(); - } -/* - final Map ripValsPreLaunch = new HashMap<>(); - for (DebugThreadId tid : client.getSystemObjects().getThreads()) { - client.getSystemObjects().setCurrentThreadId(tid); - byte[] val = client.getRegisters().getValue(16).encodeAsBytes(); - ripValsPreLaunch.put(tid, new BigInteger(1, val).toString(16)); - } - - System.out.println("Creating..."); - client.createProcess(client.getLocalServer(), specimenC, - BitmaskSet.of(DebugCreateFlags.DEBUG_PROCESS)); - - cb.lastReg = null; - while (cb.lastReg == null) { - System.err.println(client.getSystemObjects().getCurrentProcessId()); - client.getControl().waitForEvent(); - client.getSystemObjects().setCurrentProcessId(new DebugProcessId(1)); - DebugEventInformation info = client.getControl().getLastEventInformation(); - System.err.println(info.getProcessId()); - } - - client.getSystemObjects().setCurrentProcessId(new DebugProcessId(0)); - final Map ripValsPostLaunch = new HashMap<>(); - for (DebugThreadId tid : client.getSystemObjects().getThreads()) { - client.getSystemObjects().setCurrentThreadId(tid); - byte[] val = client.getRegisters().getValue(16).encodeAsBytes(); - ripValsPostLaunch.put(tid, new BigInteger(1, val).toString(16)); - } - - assertEquals(ripValsPreLaunch, ripValsPostLaunch); - */ - } - finally { - client.setOutputCallbacks(null); - client.setEventCallbacks(null); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/manager/impl/AbstractDbgManagerTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/manager/impl/AbstractDbgManagerTest.java deleted file mode 100644 index f2c9f9a5e8..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/manager/impl/AbstractDbgManagerTest.java +++ /dev/null @@ -1,447 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.impl; - -import static ghidra.async.AsyncUtils.sequence; -import static org.junit.Assert.*; - -import java.io.IOException; -import java.math.BigInteger; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; -import java.util.*; -import java.util.concurrent.*; -import java.util.concurrent.atomic.AtomicLong; -import java.util.concurrent.atomic.AtomicReference; - -import org.apache.commons.lang3.tuple.Pair; -import org.junit.*; - -import agent.dbgeng.dbgeng.DbgEngTest; -import agent.dbgeng.dbgeng.DebugProcessId; -import agent.dbgeng.manager.*; -import agent.dbgeng.manager.DbgManager.ExecSuffix; -import agent.dbgeng.manager.breakpoint.DbgBreakpointInfo; -import generic.ULongSpan; -import generic.ULongSpan.ULongSpanSet; -import ghidra.async.AsyncFence; -import ghidra.async.TypeSpec; -import ghidra.dbg.testutil.DummyProc; -import ghidra.test.AbstractGhidraHeadlessIntegrationTest; -import ghidra.util.Msg; - -public abstract class AbstractDbgManagerTest extends AbstractGhidraHeadlessIntegrationTest { - protected static final int TIMEOUT = 2000 * 1000; - - protected abstract CompletableFuture startManager(DbgManager manager); - - protected void stopManager() throws IOException { - // Nothing by default - } - - protected T waitOn(CompletableFuture future) throws Throwable { - try { - return future.get(TIMEOUT, TimeUnit.MILLISECONDS); - } - catch (ExecutionException e) { - throw e.getCause(); - } - } - - @Before - public void setUpDbgManagerTest() { - DbgEngTest.assumeDbgengDLLLoadable(); - } - - @After - public void tearDownDbgManagerTest() throws IOException { - stopManager(); - } - - @Test - public void testAddProcess() throws Throwable { - try (DbgManager mgr = DbgManager.newInstance()) { - DbgProcess process = waitOn(sequence(TypeSpec.cls(DbgProcess.class)).then(seq -> { - startManager(mgr).handle(seq::next); - }).then(seq -> { - mgr.addProcess().handle(seq::exit); - }).finish()); - assertEquals(2, process.getId()); - assertEquals(Set.of(1, 2), mgr.getKnownProcesses().keySet()); - } - } - - @Test - public void testRemoveProcess() throws Throwable { - try (DbgManager mgr = DbgManager.newInstance()) { - waitOn(sequence(TypeSpec.VOID).then(seq -> { - startManager(mgr).handle(seq::next); - }).then(seq -> { - mgr.addProcess().handle(seq::next); - }, TypeSpec.cls(DbgProcess.class)).then((inf, seq) -> { - assertEquals(2, mgr.getKnownProcesses().size()); - inf.remove().handle(seq::next); - }).then(seq -> { - assertEquals(1, mgr.getKnownProcesses().size()); - assertEquals(1, mgr.currentProcess().getId()); - seq.exit(); - }).finish()); - assertEquals(Set.of(1), mgr.getKnownProcesses().keySet()); - } - } - - @Test - public void testRemoveCurrentProcess() throws Throwable { - try (DbgManager mgr = DbgManager.newInstance()) { - List selEvtIds = new ArrayList<>(); - mgr.addEventsListener(new DbgEventsListenerAdapter() { - @Override - public void processSelected(DbgProcess process, DbgCause cause) { - selEvtIds.add(process.getId()); - } - }); - waitOn(sequence(TypeSpec.VOID).then(seq -> { - startManager(mgr).handle(seq::next); - }).then(seq -> { - assertEquals(List.of(1), selEvtIds); - mgr.addProcess().handle(seq::nextIgnore); - }).then(seq -> { - assertEquals(2, mgr.getKnownProcesses().size()); - mgr.currentProcess().remove().handle(seq::next); - }).then(seq -> { - assertEquals(1, mgr.getKnownProcesses().size()); - assertEquals(2, mgr.currentProcess().getId()); - seq.exit(); - }).finish()); - assertEquals(Set.of(2), mgr.getKnownProcesses().keySet()); - assertEquals(List.of(1, 2), selEvtIds); - } - } - - @Test - public void testConsoleCapture() throws Throwable { - try (DbgManager mgr = DbgManager.newInstance()) { - String out = waitOn(sequence(TypeSpec.STRING).then(seq -> { - startManager(mgr).handle(seq::next); - }).then(seq -> { - mgr.consoleCapture("echo test").handle(seq::exit); - }).finish()); - assertEquals("test", out.trim()); - } - } - - @Test - public void testListProcesses() throws Throwable { - try (DbgManager mgr = DbgManager.newInstance()) { - Map processes = - waitOn(sequence(TypeSpec.obj((Map) null)).then(seq -> { - startManager(mgr).handle(seq::next); - }).then(seq -> { - mgr.listProcesses().handle(seq::exit); - }).finish()); - assertEquals(new HashSet<>(Arrays.asList(new Integer[] { 1 })), processes.keySet()); - } - } - - @Test - public void testListAvailableProcesses() throws Throwable { - try (DbgManager mgr = DbgManager.newInstance()) { - List> pids = - waitOn(sequence(TypeSpec.obj((List>) null)).then(seq -> { - startManager(mgr).handle(seq::next); - }).then(seq -> { - mgr.listAvailableProcesses().handle(seq::exit); - }).finish()); - assertTrue(pids.get(0).getLeft().equals(0)); // Weak check, but on Linux, 1 (init) is always running - } - } - - @Test - public void testStart() throws Throwable { - try (DbgManager mgr = DbgManager.newInstance()) { - DbgThread thread = waitOn(sequence(TypeSpec.cls(DbgThread.class)).then(seq -> { - startManager(mgr).handle(seq::next); - }).then(seq -> { - mgr.currentProcess().fileExecAndSymbols("/usr/bin/echo").handle(seq::next); - }).then(seq -> { - mgr.console("break main").handle(seq::next); - }).then(seq -> { - mgr.currentProcess().run().handle(seq::exit); - }).finish()); - assertNotNull(thread.getProcess().getPid()); - } - } - - @Test - public void testAttachDetach() throws Throwable { - try (DummyProc echo = DummyProc.run("dd"); DbgManager mgr = DbgManager.newInstance()) { - AtomicReference> threads = new AtomicReference<>(); - waitOn(sequence(TypeSpec.VOID).then(seq -> { - startManager(mgr).handle(seq::next); - }).then(seq -> { - mgr.currentProcess().attach((int) echo.pid).handle(seq::next); - }, threads).then(seq -> { - // Attach stops the process, so no need to wait for STOPPED or prompt - AsyncFence fence = new AsyncFence(); - for (DbgThread t : threads.get()) { - assertEquals(echo.pid, (long) t.getProcess().getPid()); - fence.include(t.detach()); - } - fence.ready().handle(seq::exit); - }).finish()); - } - } - - public void stupidSleep(long millis) { - try { - Thread.sleep(millis); - } - catch (InterruptedException e) { - // Whatever - } - } - - @Test - public void testInsertListDeleteBreakpoint() throws Throwable { - AtomicReference breakpoint = new AtomicReference<>(); - try (DbgManager mgr = DbgManager.newInstance()) { - waitOn(sequence(TypeSpec.VOID).then(seq -> { - startManager(mgr).handle(seq::next); - }).then(seq -> { - mgr.currentProcess().fileExecAndSymbols("/usr/bin/echo").handle(seq::next); - }).then(seq -> { - mgr.insertBreakpoint("main").handle(seq::next); - }, breakpoint).then(seq -> { - mgr.listBreakpoints().handle(seq::next); - }, TypeSpec.obj((Map) null)).then((bl, seq) -> { - assertEquals(Map.of(1L, breakpoint.get()), bl); - mgr.deleteBreakpoints(breakpoint.get().getNumber()).handle(seq::next); - }).then(seq -> { - mgr.listBreakpoints().handle(seq::next); - }, TypeSpec.obj((Map) null)).then((bl, seq) -> { - assertEquals(Map.of(), bl); - seq.exit(); - }).finish()); - } - } - - @Test - public void testListReadWriteReadRegisters() throws Throwable { - AtomicReference thread = new AtomicReference<>(); - AtomicReference regs = new AtomicReference<>(); - AtomicReference> read = new AtomicReference<>(); - try (DbgManager mgr = DbgManager.newInstance()) { - waitOn(sequence(TypeSpec.VOID).then(seq -> { - startManager(mgr).handle(seq::next); - }).then(seq -> { - mgr.currentProcess().fileExecAndSymbols("/usr/bin/echo").handle(seq::next); - }).then(seq -> { - mgr.insertBreakpoint("main").handle(seq::nextIgnore); - }).then(seq -> { - mgr.currentProcess().run().handle(seq::next); - }, thread).then(seq -> { - mgr.waitForState(DbgState.STOPPED).handle(seq::next); - }).then(seq -> { - mgr.waitForPrompt().handle(seq::next); - }).then(seq -> { - thread.get().listRegisters().handle(seq::next); - }, regs).then(seq -> { - Set toRead = new HashSet<>(); - toRead.add(regs.get().get("eflags")); - toRead.add(regs.get().get("rax")); - thread.get().readRegisters(toRead).handle(seq::next); - }, read).then(seq -> { - // Verify eflags is rendered numerically - assertNotNull(read.get().get(regs.get().get("eflags"))); - assertNotNull(read.get().get(regs.get().get("rax"))); - Map toWrite = new HashMap<>(); - // NOTE: Not all flags are mutable from user-space. - // Turns out GDB/MI does not honor this, but CLI does.... - toWrite.put(regs.get().get("eflags"), BigInteger.valueOf(0L)); - toWrite.put(regs.get().get("rax"), BigInteger.valueOf(0x1122334455667788L)); - thread.get().writeRegisters(toWrite).handle(seq::next); - }).then(seq -> { - Set toRead = new HashSet<>(); - toRead.add(regs.get().get("eflags")); - // Verify register structure is reflected in API - toRead.add(regs.get().get("eax")); - thread.get().readRegisters(toRead).handle(seq::next); - }, read).then(seq -> { - // IF and that other reserved bit cannot be cleared - // Verified the same behavior in vanilla GDB at the CLI. - assertEquals(0x202L, read.get().get(regs.get().get("eflags")).longValue()); - assertEquals(0x55667788L, read.get().get(regs.get().get("eax")).longValue()); - seq.exit(); - }).finish()); - } - } - - @Test - public void testWriteReadMemory() throws Throwable { - AtomicReference thread = new AtomicReference<>(); - AtomicLong addr = new AtomicLong(); - ByteBuffer rBuf = ByteBuffer.allocate(1024); - try (DbgManager mgr = DbgManager.newInstance()) { - waitOn(sequence(TypeSpec.VOID).then(seq -> { - startManager(mgr).handle(seq::next); - }).then(seq -> { - mgr.currentProcess().fileExecAndSymbols("/usr/bin/echo").handle(seq::next); - }).then(seq -> { - mgr.insertBreakpoint("main").handle(seq::nextIgnore); - }).then(seq -> { - mgr.currentProcess().run().handle(seq::next); - }, thread).then(seq -> { - mgr.waitForState(DbgState.STOPPED).handle(seq::next); - }).then(seq -> { - mgr.waitForPrompt().handle(seq::next); - }).then(seq -> { - mgr.currentProcess().evaluate("(long)main").handle(seq::next); - }, TypeSpec.STRING).then((str, seq) -> { - addr.set(Long.parseLong(str)); - ByteBuffer buf = ByteBuffer.allocate(1024); - buf.order(ByteOrder.LITTLE_ENDIAN); - for (int i = 0; i < 10; i++) { - buf.putInt(i); - } - buf.flip(); - thread.get().writeMemory(addr.get(), buf).handle(seq::next); - }).then(seq -> { - thread.get().readMemory(addr.get(), rBuf).handle(seq::next); - }, TypeSpec.obj((ULongSpanSet) null)).then((rng, seq) -> { - rBuf.flip(); - rBuf.order(ByteOrder.LITTLE_ENDIAN); - ULongSpanSet exp = ULongSpanSet.of(ULongSpan.extent(addr.get(), 1024)); - assertEquals(exp, rng); - for (int i = 0; i < 10; i++) { - assertEquals(i, rBuf.getInt()); - } - seq.exit(); - }).finish()); - } - } - - @Test - public void testContinue() throws Throwable { - AtomicReference thread = new AtomicReference<>(); - try (DbgManager mgr = DbgManager.newInstance()) { - waitOn(sequence(TypeSpec.VOID).then(seq -> { - startManager(mgr).handle(seq::next); - }).then(seq -> { - mgr.currentProcess().fileExecAndSymbols("/usr/bin/echo").handle(seq::next); - }).then(seq -> { - mgr.insertBreakpoint("main").handle(seq::nextIgnore); - }).then(seq -> { - mgr.currentProcess().run().handle(seq::next); - }, thread).then(seq -> { - mgr.waitForState(DbgState.STOPPED).handle(seq::next); - }).then(seq -> { - mgr.waitForPrompt().handle(seq::next); - }).then(seq -> { - thread.get().cont().handle(seq::next); - }).then(seq -> { - mgr.waitForState(DbgState.STOPPED).handle(seq::next); - }).then(seq -> { - assertEquals(0L, (long) mgr.currentProcess().getExitCode()); - seq.exit(); - }).finish()); - } - } - - @Test - public void testStep() throws Throwable { - AtomicReference thread = new AtomicReference<>(); - try (DbgManager mgr = DbgManager.newInstance()) { - waitOn(sequence(TypeSpec.VOID).then(seq -> { - startManager(mgr).handle(seq::next); - }).then(seq -> { - mgr.currentProcess().fileExecAndSymbols("/usr/bin/echo").handle(seq::next); - }).then(seq -> { - mgr.insertBreakpoint("main").handle(seq::nextIgnore); - }).then(seq -> { - mgr.currentProcess().run().handle(seq::next); - }, thread).then(seq -> { - mgr.waitForState(DbgState.STOPPED).handle(seq::next); - }).then(seq -> { - mgr.waitForPrompt().handle(seq::next); - }).then(seq -> { - thread.get().step(ExecSuffix.NEXT_INSTRUCTION).handle(seq::next); - }).then(seq -> { - mgr.waitForState(DbgState.STOPPED).handle(seq::next); - }).then(seq -> { - assertNull(mgr.currentProcess().getExitCode()); - seq.exit(); - }).finish()); - } - } - - @Test - public void testThreadSelect() throws Throwable { - AtomicReference thread = new AtomicReference<>(); - try (DbgManager mgr = DbgManager.newInstance()) { - waitOn(sequence(TypeSpec.VOID).then(seq -> { - startManager(mgr).handle(seq::next); - }).then(seq -> { - mgr.currentProcess().fileExecAndSymbols("/usr/bin/echo").handle(seq::next); - }).then(seq -> { - mgr.insertBreakpoint("main").handle(seq::nextIgnore); - }).then(seq -> { - mgr.currentProcess().run().handle(seq::next); - }, thread).then(seq -> { - mgr.waitForState(DbgState.STOPPED).handle(seq::next); - }).then(seq -> { - mgr.waitForPrompt().handle(seq::next); - }).then(seq -> { - thread.get().setActive().handle(seq::next); - }).finish()); - } - } - - @Test - public void testListFrames() throws Throwable { - AtomicReference thread = new AtomicReference<>(); - try (DbgManager mgr = DbgManager.newInstance()) { - waitOn(sequence(TypeSpec.VOID).then(seq -> { - startManager(mgr).handle(seq::next); - }).then(seq -> { - mgr.currentProcess().fileExecAndSymbols("/usr/bin/echo").handle(seq::next); - }).then(seq -> { - mgr.insertBreakpoint("main").handle(seq::nextIgnore); - }).then(seq -> { - mgr.currentProcess().run().handle(seq::next); - }, thread).then(seq -> { - mgr.waitForState(DbgState.STOPPED).handle(seq::next); - }).then(seq -> { - mgr.waitForPrompt().handle(seq::next); - }).then(seq -> { - mgr.insertBreakpoint("write").handle(seq::nextIgnore); - }).then(seq -> { - mgr.currentProcess().cont().handle(seq::next); - }).then(seq -> { - mgr.waitForState(DbgState.STOPPED).handle(seq::next); - }).then(seq -> { - thread.get().listStackFrames().handle(seq::next); - }, TypeSpec.cls(DbgStackFrame.class).list()).then((stack, seq) -> { - Msg.debug(this, "Got stack:"); - for (DbgStackFrame frame : stack) { - Msg.debug(this, " " + frame); - } - assertEquals("write", stack.get(0).getFunction()); - assertEquals("main", stack.get(stack.size() - 1).getFunction()); - seq.exit(); - }).finish()); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/manager/impl/SpawnedDbgManagerTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/manager/impl/SpawnedDbgManagerTest.java deleted file mode 100644 index bcb0c40b16..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/manager/impl/SpawnedDbgManagerTest.java +++ /dev/null @@ -1,30 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.manager.impl; - -import java.util.concurrent.CompletableFuture; - -import org.junit.Ignore; - -import agent.dbgeng.manager.DbgManager; - -@Ignore("deprecated") -public class SpawnedDbgManagerTest extends AbstractDbgManagerTest { - @Override - protected CompletableFuture startManager(DbgManager manager) { - return manager.start(new String[] {}); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractDbgengModelHost.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractDbgengModelHost.java deleted file mode 100644 index 2cb8358d63..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractDbgengModelHost.java +++ /dev/null @@ -1,27 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model; - -import java.util.Map; - -import ghidra.dbg.test.AbstractModelHost; - -public abstract class AbstractDbgengModelHost extends AbstractModelHost { - @Override - public Map getFactoryOptions() { - return Map.ofEntries(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengBreakpointsTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengBreakpointsTest.java deleted file mode 100644 index 942ee7928b..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengBreakpointsTest.java +++ /dev/null @@ -1,171 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model; - -import static org.junit.Assert.*; - -import java.util.List; - -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetBreakpointSpec.TargetBreakpointKind; -import ghidra.dbg.target.TargetBreakpointSpecContainer.TargetBreakpointKindSet; -import ghidra.dbg.test.*; -import ghidra.dbg.util.PathPattern; -import ghidra.dbg.util.PathUtils; -import ghidra.program.model.address.*; - -public abstract class AbstractModelForDbgengBreakpointsTest - extends AbstractDebuggerModelBreakpointsTest implements ProvidesTargetViaLaunchSpecimen { - - protected abstract PathPattern getBreakPattern(); - - private static final int BREAK_ID_POS = 1; - - @Override - public AbstractDebuggerModelTest getTest() { - return this; - } - - @Override - protected List seedPath() { - return List.of(); - } - - @Override - public DebuggerTestSpecimen getLaunchSpecimen() { - return WindowsSpecimen.PRINT; - } - - @Override - public List getExpectedBreakpointContainerPath(List targetPath) { - return PathUtils.extend(targetPath, PathUtils.parse("Debug.Breakpoints")); - } - - @Override - public TargetBreakpointKindSet getExpectedSupportedKinds() { - return TargetBreakpointKindSet.of( // - TargetBreakpointKind.SW_EXECUTE, // - TargetBreakpointKind.HW_EXECUTE, // - TargetBreakpointKind.READ, // - TargetBreakpointKind.WRITE); // - } - - @Override - public AddressRange getSuitableRangeForBreakpoint(TargetObject target, - TargetBreakpointKind kind) throws Throwable { - TargetStackFrame frame = retry(() -> { - TargetStackFrame f = findAnyStackFrame(target.getPath()); - assertNotNull(f); - return f; - }, List.of(AssertionError.class)); - waitOn(frame.fetchAttributes()); - Address pc = frame.getProgramCounter(); - switch (kind) { - case SW_EXECUTE: - case HW_EXECUTE: - return new AddressRangeImpl(pc, pc); - case READ: - case WRITE: - return new AddressRangeImpl(pc, 4); - default: - throw new AssertionError(); - } - } - - @Override - protected void placeBreakpointViaInterpreter(AddressRange range, TargetBreakpointKind kind, - TargetInterpreter interpreter) throws Throwable { - Address min = range.getMinAddress(); - if (range.getLength() == 4) { - switch (kind) { - case READ: - waitOn(interpreter.execute("ba r4 " + min)); - break; - case WRITE: - waitOn(interpreter.execute("ba w4 " + min)); - break; - default: - fail(); - } - } - else if (range.getLength() == 1) { - switch (kind) { - case SW_EXECUTE: - waitOn(interpreter.execute("bp " + min)); - break; - case HW_EXECUTE: - waitOn(interpreter.execute("ba e1 " + min)); - break; - default: - fail(); - } - } - else { - fail(); - } - } - - @Override - protected void disableViaInterpreter(TargetTogglable t, TargetInterpreter interpreter) - throws Throwable { - String bpId = getBreakPattern().matchKeys(t.getPath()).get(BREAK_ID_POS); - waitOn(interpreter.execute("bd " + bpId)); - } - - @Override - protected void enableViaInterpreter(TargetTogglable t, TargetInterpreter interpreter) - throws Throwable { - String bpId = getBreakPattern().matchKeys(t.getPath()).get(BREAK_ID_POS); - waitOn(interpreter.execute("be " + bpId)); - } - - @Override - protected void deleteViaInterpreter(TargetDeletable d, TargetInterpreter interpreter) - throws Throwable { - String bpId = getBreakPattern().matchKeys(d.getPath()).get(BREAK_ID_POS); - waitOn(interpreter.execute("bc " + bpId)); - } - - @Override - protected void assertLocCoversViaInterpreter(AddressRange range, TargetBreakpointKind kind, - TargetBreakpointLocation loc, TargetInterpreter interpreter) throws Throwable { - String bpId = getBreakPattern().matchKeys(loc.getPath()).get(BREAK_ID_POS); - String line = waitOn(interpreter.executeCapture("bl " + bpId)).trim(); - assertFalse(line.contains("\n")); - // NB. WinDbg numbers breakpoints in base 10, by default - assertTrue(line.startsWith(bpId)); - // TODO: Do I care to parse the details? The ID is confirmed, and details via the object... - } - - @Override - protected void assertEnabledViaInterpreter(TargetTogglable t, boolean enabled, - TargetInterpreter interpreter) throws Throwable { - String bpId = getBreakPattern().matchKeys(t.getPath()).get(BREAK_ID_POS); - String line = waitOn(interpreter.executeCapture("bl " + bpId)).trim(); - assertFalse(line.contains("\n")); - assertTrue(line.startsWith(bpId)); - String e = line.split("\\s+")[1]; - assertEquals(enabled ? "e" : "d", e); - } - - @Override - protected void assertDeletedViaInterpreter(TargetDeletable d, TargetInterpreter interpreter) - throws Throwable { - String bpId = getBreakPattern().matchKeys(d.getPath()).get(BREAK_ID_POS); - String line = waitOn(interpreter.executeCapture("bl " + bpId)).trim(); - assertEquals("", line); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengFactoryTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengFactoryTest.java deleted file mode 100644 index 4a0039a4e5..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengFactoryTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model; - -import java.util.Map; - -import ghidra.dbg.test.AbstractDebuggerModelFactoryTest; - -public abstract class AbstractModelForDbgengFactoryTest extends AbstractDebuggerModelFactoryTest { - @Override - protected Map getFailingFactoryOptions() { - // TODO: No options to test for IN-VM variant - return Map.ofEntries(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengFrameActivationTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengFrameActivationTest.java deleted file mode 100644 index 6984821673..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengFrameActivationTest.java +++ /dev/null @@ -1,116 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model; - -import static org.junit.Assert.*; - -import java.util.*; - -import org.junit.Ignore; -import org.junit.Test; - -import ghidra.dbg.target.*; -import ghidra.dbg.test.AbstractDebuggerModelActivationTest; -import ghidra.dbg.util.PathPattern; - -public abstract class AbstractModelForDbgengFrameActivationTest - extends AbstractDebuggerModelActivationTest { - - protected abstract PathPattern getStackPattern(); - - protected DebuggerTestSpecimen getSpecimen() { - return WindowsSpecimen.STACK; - } - - @Override - protected Set getActivatableThings() throws Throwable { - DebuggerTestSpecimen specimen = getSpecimen(); - TargetLauncher launcher = findLauncher(); // root launcher should generate new inferiors - waitOn(launcher.launch(specimen.getLauncherArgs())); - - TargetProcess process = retry(() -> { - TargetProcess p = m.findAny(TargetProcess.class, seedPath()); - assertNotNull(p); - return p; - }, List.of(AssertionError.class)); - - trapAt("expStack!break_here", process); - - waitSettled(m.getModel(), 200); - - return retry(() -> { - Map, TargetStackFrame> frames = - m.findAll(TargetStackFrame.class, seedPath(), true); - assertTrue(frames.size() >= 3); - return Set.copyOf(frames.values()); - }, List.of(AssertionError.class)); - } - - // TODO: Should probably assert default focus/activation here - - @Override - @Ignore("dbgeng.dll has no event for frame activation") - public void testActivateEachViaInterpreter() throws Throwable { - } - - @Override - protected void assertActiveViaInterpreter(TargetObject expected, TargetInterpreter interpreter) - throws Throwable { - String line = waitOn(interpreter.executeCapture(".frame")).trim(); - assertFalse(line.contains("\n")); - int frameId = Integer.parseInt(line.split("\\s+")[0], 16); - int expId = Integer.decode(getStackPattern().matchKeys(expected.getPath()).get(2)); - assertEquals(expId, frameId); - } - - @Override - @Test - public void testActivateEachOnce() throws Throwable { - m.build(); - - TargetActiveScope activeScope = findActiveScope(); - Set activatable = getActivatableThings(); - for (TargetObject obj : activatable) { - waitOn(activeScope.requestActivation(obj)); - if (m.hasInterpreter()) { - TargetInterpreter interpreter = findInterpreter(); - assertActiveViaInterpreter(obj, interpreter); - } - } - - } - - @Test - public void testActivateEachTwice() throws Throwable { - m.build(); - - TargetActiveScope activeScope = findActiveScope(); - Set activatable = getActivatableThings(); - for (TargetObject obj : activatable) { - waitOn(activeScope.requestActivation(obj)); - if (m.hasInterpreter()) { - TargetInterpreter interpreter = findInterpreter(); - assertActiveViaInterpreter(obj, interpreter); - } - waitOn(activeScope.requestActivation(obj)); - if (m.hasInterpreter()) { - TargetInterpreter interpreter = findInterpreter(); - assertActiveViaInterpreter(obj, interpreter); - } - } - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengInterpreterTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengInterpreterTest.java deleted file mode 100644 index 1af771309a..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengInterpreterTest.java +++ /dev/null @@ -1,81 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model; - -import java.util.List; - -import ghidra.dbg.target.TargetProcess; -import ghidra.dbg.test.AbstractDebuggerModelInterpreterTest; -import ghidra.dbg.util.PathUtils; - -public abstract class AbstractModelForDbgengInterpreterTest - extends AbstractDebuggerModelInterpreterTest { - - @Override - protected List seedPath() { - return PathUtils.parse("Sessions[0]"); - } - - @Override - public List getExpectedInterpreterPath() { - return PathUtils.parse("Sessions[0]"); - } - - @Override - protected String getEchoCommand(String msg) { - return ".echo " + msg; - } - - @Override - protected String getQuitCommand() { - return "q"; - } - - @Override - protected String getAttachCommand() { - return ".attach " + Long.toHexString(dummy.pid); - } - - @Override - protected String getDetachCommand(TargetProcess process) { - return ".detach"; - } - - @Override - protected String getKillCommand(TargetProcess process) { - return ".kill"; - } - - @Override - public DebuggerTestSpecimen getAttachSpecimen() { - return WindowsSpecimen.NOTEPAD; - } - - @Override - public DebuggerTestSpecimen getLaunchSpecimen() { - return WindowsSpecimen.PRINT; - } - - /* - @Override - @Ignore - @Test(expected = DebuggerModelTerminatingException.class) - public void testExecuteQuit() throws Throwable { - // Different behavior for dbg clients vice gdb - } - */ - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengProcessActivationTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengProcessActivationTest.java deleted file mode 100644 index bb96337e20..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengProcessActivationTest.java +++ /dev/null @@ -1,83 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model; - -import static org.junit.Assert.*; - -import java.util.*; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import generic.Unique; -import ghidra.dbg.target.*; -import ghidra.dbg.test.AbstractDebuggerModelActivationTest; -import ghidra.dbg.util.PathPattern; - -public abstract class AbstractModelForDbgengProcessActivationTest - extends AbstractDebuggerModelActivationTest { - - protected abstract PathPattern getProcessPattern(); - - protected int getCount() { - return 3; - } - - protected DebuggerTestSpecimen getSpecimen() { - return WindowsSpecimen.PRINT; - } - - public abstract List getExpectedSessionPath(); - - @Override - protected Set getActivatableThings() throws Throwable { - DebuggerTestSpecimen specimen = getSpecimen(); - TargetLauncher launcher = findLauncher(); - int count = getCount(); - for (int i = 0; i < count; i++) { - waitOn(launcher.launch(specimen.getLauncherArgs())); - } - - waitSettled(m.getModel(), 200); - - return retry(() -> { - Map, TargetProcess> found = - m.findAll(TargetProcess.class, getExpectedSessionPath(), true); - assertEquals(count, found.size()); - return Set.copyOf(found.values()); - }, List.of(AssertionError.class)); - } - - @Override - protected void activateViaInterpreter(TargetObject obj, TargetInterpreter interpreter) - throws Throwable { - String id = Unique.assertOne(getProcessPattern().matchKeys(obj.getPath())); - waitOn(interpreter.execute("|" + id + " s")); - } - - public abstract String getIdFromCapture(String line); - - @Override - protected void assertActiveViaInterpreter(TargetObject expected, TargetInterpreter interpreter) - throws Throwable { - String output = waitOn(interpreter.executeCapture("|")); - String line = Unique.assertOne(Stream.of(output.split("\n")) - .filter(l -> l.trim().startsWith(".")) - .collect(Collectors.toList())).trim(); - String procId = getIdFromCapture(line); - assertEquals(expected.getPath(), - getProcessPattern().applyKeys(procId).getSingletonPath()); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengRootAttacherTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengRootAttacherTest.java deleted file mode 100644 index 040ddd790a..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengRootAttacherTest.java +++ /dev/null @@ -1,58 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import java.util.List; - -import ghidra.dbg.target.TargetEnvironment; -import ghidra.dbg.target.TargetMethod.TargetParameterMap; -import ghidra.dbg.test.AbstractDebuggerModelAttacherTest; -import ghidra.dbg.util.PathUtils; - -public abstract class AbstractModelForDbgengRootAttacherTest - extends AbstractDebuggerModelAttacherTest { - - @Override - public List getExpectedAttachableContainerPath() { - return List.of("Available"); - } - - @Override - public List getExpectedAttacherPath() { - return PathUtils.parse(""); - } - - @Override - public DebuggerTestSpecimen getAttachSpecimen() { - return WindowsSpecimen.NOTEPAD; - } - - @Override - public TargetParameterMap getExpectedAttachParameters() { - return null; // TODO - } - - @Override - public void assertEnvironment(TargetEnvironment environment) { - assertEquals("x86_64", environment.getArchitecture()); - assertEquals("Windows", environment.getOperatingSystem()); - assertEquals("little", environment.getEndian()); - assertTrue(environment.getDebugger().toLowerCase().contains("dbgeng")); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengRootLauncherTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengRootLauncherTest.java deleted file mode 100644 index bc1d78a654..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengRootLauncherTest.java +++ /dev/null @@ -1,72 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model; - -import static org.junit.Assert.*; - -import java.util.List; -import java.util.Map; - -import ghidra.dbg.DebugModelConventions; -import ghidra.dbg.DebugModelConventions.AsyncState; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetExecutionStateful.TargetExecutionState; -import ghidra.dbg.target.TargetMethod.ParameterDescription; -import ghidra.dbg.target.TargetMethod.TargetParameterMap; -import ghidra.dbg.test.AbstractDebuggerModelLauncherTest; -import ghidra.dbg.util.PathUtils; - -public abstract class AbstractModelForDbgengRootLauncherTest - extends AbstractDebuggerModelLauncherTest { - - @Override - public List getExpectedLauncherPath() { - return PathUtils.parse(""); - } - - @Override - public DebuggerTestSpecimen getLaunchSpecimen() { - return WindowsSpecimen.PRINT; - } - - @Override - public TargetParameterMap getExpectedLauncherParameters() { - return TargetParameterMap.copyOf(Map.ofEntries( - Map.entry("args", ParameterDescription.create(String.class, "args", true, "", - "Command Line", "space-separated command-line arguments")))); - } - - @Override - public void assertEnvironment(TargetEnvironment environment) { - assertEquals("x86_64", environment.getArchitecture()); - assertEquals("Windows", environment.getOperatingSystem()); - assertEquals("little", environment.getEndian()); - assertTrue(environment.getDebugger().toLowerCase().contains("dbgeng")); - } - - protected void runTestResumeTerminates(DebuggerTestSpecimen specimen) throws Throwable { - TargetProcess process = retryForProcessRunning(specimen, this); - TargetResumable resumable = m.suitable(TargetResumable.class, process.getPath()); - AsyncState state = - new AsyncState(m.suitable(TargetExecutionStateful.class, process.getPath())); - TargetExecutionState st = waitOn(state.waitUntil(s -> s == TargetExecutionState.STOPPED)); - assertTrue(st.isAlive()); - waitOn(resumable.resume()); - retryVoid(() -> assertFalse(DebugModelConventions.isProcessAlive(process)), - List.of(AssertionError.class)); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengScenarioCloneExitTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengScenarioCloneExitTest.java deleted file mode 100644 index c7988ca763..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengScenarioCloneExitTest.java +++ /dev/null @@ -1,32 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model; - -import ghidra.dbg.test.AbstractDebuggerModelScenarioCloneExitTest; - -public abstract class AbstractModelForDbgengScenarioCloneExitTest - extends AbstractDebuggerModelScenarioCloneExitTest { - - @Override - protected DebuggerTestSpecimen getSpecimen() { - return WindowsSpecimen.CREATE_THREAD_EXIT; - } - - @Override - protected String getBreakpointExpression() { - return "expCreateThreadExit!work"; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengScenarioForkExitTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengScenarioForkExitTest.java deleted file mode 100644 index e4f3ff6c29..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengScenarioForkExitTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import ghidra.dbg.target.TargetEnvironment; -import ghidra.dbg.test.AbstractDebuggerModelScenarioForkExitTest; - -public abstract class AbstractModelForDbgengScenarioForkExitTest - extends AbstractDebuggerModelScenarioForkExitTest { - - @Override - protected DebuggerTestSpecimen getSpecimen() { - return WindowsSpecimen.CREATE_PROCESS; - } - - @Override - protected String getParentBreakpointExpression() { - return "expCreateProcess!func"; - } - - @Override - protected String getChildBreakpointExpression() { - return "expCreateProcess!func"; - } - - @Override - public void assertEnvironment(TargetEnvironment environment) { - assertEquals("x86_64", environment.getArchitecture()); - assertEquals("Windows", environment.getOperatingSystem()); - assertEquals("little", environment.getEndian()); - assertTrue(environment.getDebugger().toLowerCase().contains("dbgeng")); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengScenarioMemoryTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengScenarioMemoryTest.java deleted file mode 100644 index 72533dd256..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengScenarioMemoryTest.java +++ /dev/null @@ -1,72 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model; - -import static org.junit.Assert.assertEquals; - -import java.util.List; -import java.util.Objects; - -import agent.dbgeng.model.impl.DbgModelTargetProcessImpl; -import ghidra.dbg.target.*; -import ghidra.dbg.test.AbstractDebuggerModelScenarioMemoryTest; -import ghidra.dbg.util.PathUtils; -import ghidra.program.model.address.Address; - -public abstract class AbstractModelForDbgengScenarioMemoryTest - extends AbstractDebuggerModelScenarioMemoryTest { - - @Override - protected WindowsSpecimen getSpecimen() { - return WindowsSpecimen.PRINT; - } - - protected String getSymbolName() { - return "overwrite"; - } - - @Override - protected Address getAddressToWrite(TargetProcess process) throws Throwable { - // It seems this is the only test case that exercises module symbols. - List modulePath = PathUtils.extend(process.getPath(), - PathUtils.parse("Modules[" + getSpecimen().getBinModuleKey() + "]")); - TargetObject container = - Objects.requireNonNull(m.findContainer(TargetSymbol.class, modulePath)); - TargetSymbol symbol = - waitOn(container.fetchElements()).get(getSymbolName()).as(TargetSymbol.class); - return symbol.getValue(); - } - - @Override - protected byte[] getBytesToWrite() { - return "Speak".getBytes(); - } - - @Override - protected byte[] getExpectedBytes() { - return "Speak, World!".getBytes(); - } - - @Override - protected void verifyExpectedEffect(TargetProcess process) throws Throwable { - // TODO: Should (optional) exitCode be standardized on all models? - retryVoid(() -> { - long status = process.getTypedAttributeNowByName( - DbgModelTargetProcessImpl.EXIT_CODE_ATTRIBUTE_NAME, Long.class, 0L); - assertEquals('S', status); - }, List.of(AssertionError.class)); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengScenarioStackTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengScenarioStackTest.java deleted file mode 100644 index 902df89660..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengScenarioStackTest.java +++ /dev/null @@ -1,66 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model; - -import static org.junit.Assert.assertEquals; - -import java.util.*; -import java.util.Map.Entry; - -import ghidra.dbg.target.*; -import ghidra.dbg.test.AbstractDebuggerModelScenarioStackTest; -import ghidra.dbg.util.PathUtils; -import ghidra.program.model.address.Address; - -public abstract class AbstractModelForDbgengScenarioStackTest - extends AbstractDebuggerModelScenarioStackTest { - protected static List expectedSymbols = - List.of("break_here", "funcC", "funcB", "funcA"); - protected NavigableMap symbolsByAddress = new TreeMap<>(); - - @Override - protected WindowsSpecimen getSpecimen() { - return WindowsSpecimen.STACK; - } - - @Override - protected String getBreakpointExpression() { - return "expStack!break_here"; - } - - @Override - protected void postLaunch(TargetProcess process) throws Throwable { - TargetModuleContainer modules = m.find(TargetModuleContainer.class, process.getPath()); - // NB. NEVER is recommended resync mode for modules container - // It's not guaranteed to come before process is alive, though - TargetModule binMod = (TargetModule) waitOn(m.getAddedWaiter() - .wait(PathUtils.index(modules.getPath(), getSpecimen().getBinModuleKey()))); - - // NB. this heuristic assumes all function bodies are contiguous in memory - TargetSymbolNamespace symbols = m.find(TargetSymbolNamespace.class, binMod.getPath()); - // NB. ONCE is recommended resync mode for module symbols - for (Entry entry : waitOn(symbols.fetchElements()) - .entrySet()) { - symbolsByAddress.put(entry.getValue().as(TargetSymbol.class).getValue(), - entry.getKey()); - } - } - - @Override - protected void validateFramePC(int index, Address pc) { - assertEquals(expectedSymbols.get(index), symbolsByAddress.floorEntry(pc).getValue()); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengScenarioX64RegistersTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengScenarioX64RegistersTest.java deleted file mode 100644 index 1e08891876..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengScenarioX64RegistersTest.java +++ /dev/null @@ -1,52 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model; - -import static org.junit.Assert.*; - -import java.util.Map; - -import agent.dbgeng.model.impl.DbgModelTargetProcessImpl; -import ghidra.dbg.target.TargetProcess; -import ghidra.dbg.test.AbstractDebuggerModelScenarioRegistersTest; - -public abstract class AbstractModelForDbgengScenarioX64RegistersTest - extends AbstractDebuggerModelScenarioRegistersTest { - - @Override - protected DebuggerTestSpecimen getSpecimen() { - return WindowsSpecimen.REGISTERS; - } - - @Override - protected String getBreakpointExpression() { - return "expRegisters!break_here"; - } - - @Override - protected Map getRegisterWrites() { - // RCX is first parameter `val` of break_here(int val) - return Map.of("rcx", arr("0000000000000041")); - } - - @Override - protected void verifyExpectedEffect(TargetProcess process) throws Throwable { - long status = process.getTypedAttributeNowByName( - DbgModelTargetProcessImpl.EXIT_CODE_ATTRIBUTE_NAME, Long.class, 0L); - // TODO: This really shouldn't return 0 - possible race? - assertTrue(status == 0x41 || status == 0); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengSessionActivationTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengSessionActivationTest.java deleted file mode 100644 index 1d3db7333d..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengSessionActivationTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model; - -import static ghidra.lifecycle.Unfinished.TODO; - -import java.util.Set; - -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.test.AbstractDebuggerModelActivationTest; - -public abstract class AbstractModelForDbgengSessionActivationTest - extends AbstractDebuggerModelActivationTest { - - @Override - protected Set getActivatableThings() throws Throwable { - TODO("Don't know how to make multiple sessions"); - return null; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengSteppableTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengSteppableTest.java deleted file mode 100644 index 6764c4ef7e..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengSteppableTest.java +++ /dev/null @@ -1,39 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model; - -import java.util.List; - -import ghidra.dbg.test.*; - -public abstract class AbstractModelForDbgengSteppableTest extends AbstractDebuggerModelSteppableTest - implements ProvidesTargetViaLaunchSpecimen { - - @Override - public AbstractDebuggerModelTest getTest() { - return this; - } - - @Override - public List getExpectedSteppablePath(List threadPath) { - return threadPath; - } - - @Override - public DebuggerTestSpecimen getLaunchSpecimen() { - return WindowsSpecimen.PRINT; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengThreadActivationTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengThreadActivationTest.java deleted file mode 100644 index b41286b216..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengThreadActivationTest.java +++ /dev/null @@ -1,84 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model; - -import static org.junit.Assert.*; - -import java.util.*; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import generic.Unique; -import ghidra.dbg.target.*; -import ghidra.dbg.test.AbstractDebuggerModelActivationTest; -import ghidra.dbg.util.PathPattern; - -public abstract class AbstractModelForDbgengThreadActivationTest - extends AbstractDebuggerModelActivationTest { - - protected abstract PathPattern getThreadPattern(); - - protected DebuggerTestSpecimen getSpecimen() { - return WindowsSpecimen.PRINT; - } - - protected int getCount() { - return 1; - } - - protected abstract List getExpectedSessionPath(); - - @Override - protected Set getActivatableThings() throws Throwable { - DebuggerTestSpecimen specimen = getSpecimen(); - TargetLauncher launcher = findLauncher(); - int count = getCount(); - for (int i = 0; i < count; i++) { - waitOn(launcher.launch(specimen.getLauncherArgs())); - } - - waitSettled(m.getModel(), 200); - - return retry(() -> { - Map, TargetThread> found = - m.findAll(TargetThread.class, getExpectedSessionPath(), true); - assertEquals(count, found.size()); - return Set.copyOf(found.values()); - }, List.of(AssertionError.class)); - } - - @Override - protected void activateViaInterpreter(TargetObject obj, TargetInterpreter interpreter) - throws Throwable { - String threadId = getThreadPattern().matchKeys(obj.getPath()).get(1); - // TODO: This test is imperfect, since processes are activated as well - waitOn(interpreter.execute("~" + threadId + " s")); - } - - public abstract String getIdFromCapture(String line); - - @Override - protected void assertActiveViaInterpreter(TargetObject expected, TargetInterpreter interpreter) - throws Throwable { - String output = waitOn(interpreter.executeCapture("~")); - String line = Unique.assertOne(Stream.of(output.split("\n")) - .filter(l -> l.trim().startsWith(".")) - .collect(Collectors.toList())).trim(); - String threadId = getIdFromCapture(line); - String expId = getThreadPattern().matchKeys(expected.getPath()).get(1); - assertEquals(expId, threadId); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengX64RegistersTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengX64RegistersTest.java deleted file mode 100644 index ade035368f..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/AbstractModelForDbgengX64RegistersTest.java +++ /dev/null @@ -1,52 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model; - -import java.util.List; -import java.util.Map; - -import ghidra.dbg.test.*; -import ghidra.dbg.util.PathUtils; - -public abstract class AbstractModelForDbgengX64RegistersTest - extends AbstractDebuggerModelRegistersTest - implements ProvidesTargetViaLaunchSpecimen { - public final Map REG_VALS = Map.ofEntries( - Map.entry("rax", arr("0123456789abcdef")), - Map.entry("ymm0", arr( - "0123456789abcdef" + "fedcba9876543210" // TODO: Why 16 bytes instead of 32? - /*+ "0011223344556677" + "8899aabbccddeeff"*/))); - - @Override - public AbstractDebuggerModelTest getTest() { - return this; - } - - @Override - public List getExpectedRegisterBankPath(List threadPath) { - return PathUtils.extend(threadPath, PathUtils.parse("Registers")); - } - - @Override - public Map getRegisterWrites() { - return REG_VALS; - } - - @Override - public DebuggerTestSpecimen getLaunchSpecimen() { - return WindowsSpecimen.PRINT; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/WindowsSpecimen.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/WindowsSpecimen.java deleted file mode 100644 index d992f31b2c..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/WindowsSpecimen.java +++ /dev/null @@ -1,124 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model; - -import java.io.File; -import java.util.*; - -import agent.dbgeng.model.iface2.DbgModelTargetAvailable; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetLauncher.TargetCmdLineLauncher; -import ghidra.dbg.test.AbstractDebuggerModelTest; -import ghidra.dbg.test.AbstractDebuggerModelTest.DebuggerTestSpecimen; -import ghidra.dbg.testutil.DebuggerModelTestUtils; -import ghidra.dbg.testutil.DummyProc; - -public enum WindowsSpecimen implements DebuggerTestSpecimen, DebuggerModelTestUtils { - PRINT { - @Override - String getCommandLine() { - return DummyProc.which("expPrint.exe"); - } - }, - NOTEPAD { - @Override - String getCommandLine() { - return "C:\\Windows\\notepad.exe"; - } - }, - CREATE_PROCESS { - @Override - String getCommandLine() { - return DummyProc.which("expCreateProcess.exe"); - } - }, - CREATE_THREAD_EXIT { - @Override - String getCommandLine() { - return DummyProc.which("expCreateThreadExit.exe"); - } - }, - REGISTERS { - @Override - String getCommandLine() { - return DummyProc.which("expRegisters.exe"); - } - }, - STACK { - @Override - String getCommandLine() { - return DummyProc.which("expStack.exe"); - } - }; - - abstract String getCommandLine(); - - @Override - public DummyProc runDummy() throws Throwable { - // This is not great, but.... - return DummyProc.run(getCommandLine().split("\\s+")); - } - - @Override - public Map getLauncherArgs() { - return Map.ofEntries(Map.entry(TargetCmdLineLauncher.CMDLINE_ARGS_NAME, getCommandLine())); - } - - @Override - public List getLaunchScript() { - // NB: this will not appear on the process list until cont - return List.of(".create " + getCommandLine() + "; g"); - } - - protected static String getShortName(String fullPath) { - if (fullPath == null) { - return null; - } - return new File(fullPath).getName(); - } - - public String getBinModuleKey() { - String moduleName = getBinModuleName(); - if (moduleName.endsWith(".exe")) { - return moduleName.substring(0, moduleName.length() - ".exe".length()); - } - return moduleName; - } - - public String getBinModuleName() { - return getShortName(getCommandLine().split("\\s+")[0]); - } - - @Override - public boolean isRunningIn(TargetProcess process, AbstractDebuggerModelTest test) - throws Throwable { - // NB. ShellUtils.parseArgs removes the \s. Not good. - String expected = getBinModuleName(); - Collection modules = - test.m.findAll(TargetModule.class, process.getPath(), true).values(); - return modules.stream() - .anyMatch(m -> expected.equalsIgnoreCase(getShortName(m.getModuleName()))); - } - - @Override - public boolean isAttachable(DummyProc dummy, TargetAttachable attachable, - AbstractDebuggerModelTest test) throws Throwable { - waitOn(attachable.fetchAttributes()); - long pid = attachable.getTypedAttributeNowByName(DbgModelTargetAvailable.PID_ATTRIBUTE_NAME, - Long.class, -1L); - return pid == dummy.pid; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpDbgengModelHost.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpDbgengModelHost.java deleted file mode 100644 index 8f5434ff73..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpDbgengModelHost.java +++ /dev/null @@ -1,29 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.gadp; - -import agent.dbgeng.dbgeng.DbgEngTest; -import agent.dbgeng.gadp.DbgEngGadpDebuggerModelFactory; -import agent.dbgeng.model.AbstractDbgengModelHost; -import ghidra.dbg.DebuggerModelFactory; - -public class GadpDbgengModelHost extends AbstractDbgengModelHost { - @Override - public DebuggerModelFactory getModelFactory() { - DbgEngTest.assumeDbgengDLLLoadable(); - return new DbgEngGadpDebuggerModelFactory(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengBreakpointsTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengBreakpointsTest.java deleted file mode 100644 index 68a1aa9c6a..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengBreakpointsTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.gadp; - -import org.junit.Ignore; - -import agent.dbgeng.model.AbstractModelForDbgengBreakpointsTest; -import ghidra.dbg.util.PathPattern; -import ghidra.dbg.util.PathUtils; - -@Ignore("deprecated") -public class GadpModelForDbgengBreakpointsTest extends AbstractModelForDbgengBreakpointsTest { - - @Override - protected PathPattern getBreakPattern() { - return new PathPattern(PathUtils.parse("Sessions[0].Processes[].Debug.Breakpoints[]")); - } - - @Override - public ModelHost modelHost() throws Throwable { - return new GadpDbgengModelHost(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengFactoryTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengFactoryTest.java deleted file mode 100644 index 821fef44f3..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengFactoryTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.gadp; - -import org.junit.Ignore; - -import agent.dbgeng.model.AbstractModelForDbgengFactoryTest; - -@Ignore("deprecated") -public class GadpModelForDbgengFactoryTest extends AbstractModelForDbgengFactoryTest { - @Override - public ModelHost modelHost() throws Throwable { - return new GadpDbgengModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengFrameActivationTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengFrameActivationTest.java deleted file mode 100644 index 3efb0e1013..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengFrameActivationTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.gadp; - -import org.junit.Ignore; - -import agent.dbgeng.model.AbstractModelForDbgengFrameActivationTest; -import ghidra.dbg.util.PathPattern; -import ghidra.dbg.util.PathUtils; - -@Ignore("deprecated") -public class GadpModelForDbgengFrameActivationTest - extends AbstractModelForDbgengFrameActivationTest { - - @Override - protected PathPattern getStackPattern() { - return new PathPattern(PathUtils.parse("Sessions[0].Processes[].Threads[].Stack[]")); - } - - @Override - public ModelHost modelHost() throws Throwable { - return new GadpDbgengModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengInterpreterTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengInterpreterTest.java deleted file mode 100644 index fcc84569e6..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengInterpreterTest.java +++ /dev/null @@ -1,40 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.gadp; - -import org.junit.Ignore; -import org.junit.Test; - -import agent.dbgeng.model.AbstractModelForDbgengInterpreterTest; - -@Ignore("deprecated") -public class GadpModelForDbgengInterpreterTest extends AbstractModelForDbgengInterpreterTest { - - // NB: testLaunchViaInterpreterShowInProcessContainer fails - - @Override - public ModelHost modelHost() throws Throwable { - return new GadpDbgengModelHost(); - } - - @Override - @Ignore - @Test - public void testAttachViaInterpreterShowsInProcessContainer() throws Throwable { - super.testAttachViaInterpreterShowsInProcessContainer(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengProcessActivationTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengProcessActivationTest.java deleted file mode 100644 index 33409c5543..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengProcessActivationTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.gadp; - -import java.util.List; - -import org.junit.Ignore; - -import agent.dbgeng.model.AbstractModelForDbgengProcessActivationTest; -import ghidra.dbg.util.PathPattern; -import ghidra.dbg.util.PathUtils; - -@Ignore("deprecated") -public class GadpModelForDbgengProcessActivationTest - extends AbstractModelForDbgengProcessActivationTest { - - @Override - protected PathPattern getProcessPattern() { - return new PathPattern(PathUtils.parse("Sessions[0].Processes[]")); - } - - @Override - public ModelHost modelHost() throws Throwable { - return new GadpDbgengModelHost(); - } - - @Override - public List getExpectedSessionPath() { - return PathUtils.parse("Sessions[0]"); - } - - @Override - public String getIdFromCapture(String line) { - return line.split("\\s+")[1]; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengRootAttacherTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengRootAttacherTest.java deleted file mode 100644 index 82ae195c86..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengRootAttacherTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.gadp; - -import org.junit.Ignore; - -import agent.dbgeng.model.AbstractModelForDbgengRootAttacherTest; - -@Ignore("deprecated") -public class GadpModelForDbgengRootAttacherTest extends AbstractModelForDbgengRootAttacherTest { - - // NB: testListAttachable fails with OTE - [] not invalidated - - @Override - public ModelHost modelHost() throws Throwable { - return new GadpDbgengModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengRootLauncherTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengRootLauncherTest.java deleted file mode 100644 index 5301114e72..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengRootLauncherTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.gadp; - -import org.junit.Ignore; - -import agent.dbgeng.model.AbstractModelForDbgengRootLauncherTest; - -@Ignore("deprecated") -public class GadpModelForDbgengRootLauncherTest extends AbstractModelForDbgengRootLauncherTest { - @Override - public ModelHost modelHost() throws Throwable { - return new GadpDbgengModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengScenarioCloneExitTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengScenarioCloneExitTest.java deleted file mode 100644 index 21bf709f0a..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengScenarioCloneExitTest.java +++ /dev/null @@ -1,29 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.gadp; - -import org.junit.Ignore; - -import agent.dbgeng.model.AbstractModelForDbgengScenarioCloneExitTest; - -@Ignore("deprecated") -public class GadpModelForDbgengScenarioCloneExitTest - extends AbstractModelForDbgengScenarioCloneExitTest { - @Override - public ModelHost modelHost() throws Throwable { - return new GadpDbgengModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengScenarioForkExitTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengScenarioForkExitTest.java deleted file mode 100644 index 8f9d2af757..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengScenarioForkExitTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.gadp; - -import org.junit.Ignore; -import org.junit.Test; - -import agent.dbgeng.model.AbstractModelForDbgengScenarioForkExitTest; - -@Ignore("deprecated") -public class GadpModelForDbgengScenarioForkExitTest - extends AbstractModelForDbgengScenarioForkExitTest { - - @Override - @Ignore("Specimen is currently defunct") - @Test - public void testScenario() throws Throwable { - } - - @Override - public ModelHost modelHost() throws Throwable { - return new GadpDbgengModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengScenarioMemoryTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengScenarioMemoryTest.java deleted file mode 100644 index 8321850128..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengScenarioMemoryTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.gadp; - -import org.junit.Ignore; - -import agent.dbgeng.model.AbstractModelForDbgengScenarioMemoryTest; - -@Ignore("deprecated") -public class GadpModelForDbgengScenarioMemoryTest extends AbstractModelForDbgengScenarioMemoryTest { - - // NB: Fails on validateCompletionThread - - @Override - public ModelHost modelHost() throws Throwable { - return new GadpDbgengModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengScenarioStackTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengScenarioStackTest.java deleted file mode 100644 index f5cb8b78df..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengScenarioStackTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.gadp; - -import org.junit.Ignore; - -import agent.dbgeng.model.AbstractModelForDbgengScenarioStackTest; - -@Ignore("deprecated") -public class GadpModelForDbgengScenarioStackTest extends AbstractModelForDbgengScenarioStackTest { - @Override - public ModelHost modelHost() throws Throwable { - return new GadpDbgengModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengScenarioX64RegistersTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengScenarioX64RegistersTest.java deleted file mode 100644 index f5da866431..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengScenarioX64RegistersTest.java +++ /dev/null @@ -1,29 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.gadp; - -import org.junit.Ignore; - -import agent.dbgeng.model.AbstractModelForDbgengScenarioX64RegistersTest; - -@Ignore("deprecated") -public class GadpModelForDbgengScenarioX64RegistersTest - extends AbstractModelForDbgengScenarioX64RegistersTest { - @Override - public ModelHost modelHost() throws Throwable { - return new GadpDbgengModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengSessionActivationTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengSessionActivationTest.java deleted file mode 100644 index 64ac2425dd..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengSessionActivationTest.java +++ /dev/null @@ -1,29 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.gadp; - -import org.junit.Ignore; - -import agent.dbgeng.model.AbstractModelForDbgengSessionActivationTest; - -@Ignore("Don't know how to make multiple sessions, deprecated") -public class GadpModelForDbgengSessionActivationTest - extends AbstractModelForDbgengSessionActivationTest { - @Override - public ModelHost modelHost() throws Throwable { - return new GadpDbgengModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengSteppableTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengSteppableTest.java deleted file mode 100644 index 1a5373b593..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengSteppableTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.gadp; - -import org.junit.Ignore; - -import agent.dbgeng.model.AbstractModelForDbgengSteppableTest; - -@Ignore("deprecated") -public class GadpModelForDbgengSteppableTest extends AbstractModelForDbgengSteppableTest { - @Override - public ModelHost modelHost() throws Throwable { - return new GadpDbgengModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengThreadActivationTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengThreadActivationTest.java deleted file mode 100644 index ca9b00f69f..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengThreadActivationTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.gadp; - -import java.util.List; - -import org.junit.Ignore; - -import agent.dbgeng.model.AbstractModelForDbgengThreadActivationTest; -import ghidra.dbg.util.PathPattern; -import ghidra.dbg.util.PathUtils; - -@Ignore("deprecated") -public class GadpModelForDbgengThreadActivationTest - extends AbstractModelForDbgengThreadActivationTest { - - @Override - protected PathPattern getThreadPattern() { - return new PathPattern(PathUtils.parse("Sessions[0].Processes[].Threads[]")); - } - - @Override - public ModelHost modelHost() throws Throwable { - return new GadpDbgengModelHost(); - } - - @Override - public List getExpectedSessionPath() { - return PathUtils.parse("Sessions[0]"); - } - - @Override - public String getIdFromCapture(String line) { - return line.split("\\s+")[1]; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengX64RegistersTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengX64RegistersTest.java deleted file mode 100644 index eca50820d5..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/gadp/GadpModelForDbgengX64RegistersTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.gadp; - -import org.junit.Ignore; - -import agent.dbgeng.model.AbstractModelForDbgengX64RegistersTest; - -@Ignore("deprecated") -public class GadpModelForDbgengX64RegistersTest extends AbstractModelForDbgengX64RegistersTest { - - // NB: Fails testWriteRegisters - - @Override - public ModelHost modelHost() throws Throwable { - return new GadpDbgengModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmDbgengModelHost.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmDbgengModelHost.java deleted file mode 100644 index 42bf8a2633..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmDbgengModelHost.java +++ /dev/null @@ -1,32 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.invm; - -import org.junit.Ignore; - -import agent.dbgeng.DbgEngInJvmDebuggerModelFactory; -import agent.dbgeng.dbgeng.DbgEngTest; -import agent.dbgeng.model.AbstractDbgengModelHost; -import ghidra.dbg.DebuggerModelFactory; - -@Ignore("deprecated") -public class InVmDbgengModelHost extends AbstractDbgengModelHost { - @Override - public DebuggerModelFactory getModelFactory() { - DbgEngTest.assumeDbgengDLLLoadable(); - return new DbgEngInJvmDebuggerModelFactory(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengBreakpointsTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengBreakpointsTest.java deleted file mode 100644 index 2b6550971d..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengBreakpointsTest.java +++ /dev/null @@ -1,38 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.invm; - -import org.junit.Ignore; - -import org.junit.Ignore; - -import agent.dbgeng.model.AbstractModelForDbgengBreakpointsTest; -import ghidra.dbg.util.PathPattern; -import ghidra.dbg.util.PathUtils; - -@Ignore("deprecated") -public class InVmModelForDbgengBreakpointsTest extends AbstractModelForDbgengBreakpointsTest { - - @Override - protected PathPattern getBreakPattern() { - return new PathPattern(PathUtils.parse("Sessions[0].Processes[].Debug.Breakpoints[]")); - } - - @Override - public ModelHost modelHost() throws Throwable { - return new InVmDbgengModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengFactoryTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengFactoryTest.java deleted file mode 100644 index c82fadd6d1..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengFactoryTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.invm; - -import org.junit.Ignore; - -import agent.dbgeng.model.AbstractModelForDbgengFactoryTest; - -@Ignore("deprecated") -public class InVmModelForDbgengFactoryTest extends AbstractModelForDbgengFactoryTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmDbgengModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengFrameActivationTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengFrameActivationTest.java deleted file mode 100644 index 62b1f857c1..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengFrameActivationTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.invm; - -import org.junit.Ignore; - -import agent.dbgeng.model.AbstractModelForDbgengFrameActivationTest; -import ghidra.dbg.util.PathPattern; -import ghidra.dbg.util.PathUtils; - -@Ignore("deprecated") -public class InVmModelForDbgengFrameActivationTest - extends AbstractModelForDbgengFrameActivationTest { - - @Override - protected PathPattern getStackPattern() { - return new PathPattern(PathUtils.parse("Sessions[0].Processes[].Threads[].Stack[]")); - } - - @Override - public ModelHost modelHost() throws Throwable { - return new InVmDbgengModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengInterpreterTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengInterpreterTest.java deleted file mode 100644 index 74d6dcdc2e..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengInterpreterTest.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.invm; - -import org.junit.Ignore; -import org.junit.Test; - -import agent.dbgeng.model.AbstractModelForDbgengInterpreterTest; -import ghidra.dbg.error.DebuggerModelTerminatingException; - -@Ignore("deprecated") -public class InVmModelForDbgengInterpreterTest extends AbstractModelForDbgengInterpreterTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmDbgengModelHost(); - } - - @Override - @Ignore - @Test - public void testAttachViaInterpreterShowsInProcessContainer() throws Throwable { - super.testAttachViaInterpreterShowsInProcessContainer(); - } - - @Override - @Ignore - @Test(expected = DebuggerModelTerminatingException.class) - public void testExecuteQuit() throws Throwable { - // Different behavior for dbg clients vice gdb - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengProcessActivationTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengProcessActivationTest.java deleted file mode 100644 index 5b2a7c2892..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengProcessActivationTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.invm; - -import java.util.List; - -import org.junit.Ignore; - -import agent.dbgeng.model.AbstractModelForDbgengProcessActivationTest; -import ghidra.dbg.util.PathPattern; -import ghidra.dbg.util.PathUtils; - -@Ignore("deprecated") -public class InVmModelForDbgengProcessActivationTest - extends AbstractModelForDbgengProcessActivationTest { - - @Override - protected PathPattern getProcessPattern() { - return new PathPattern(PathUtils.parse("Sessions[0].Processes[]")); - } - - @Override - public ModelHost modelHost() throws Throwable { - return new InVmDbgengModelHost(); - } - - @Override - public List getExpectedSessionPath() { - return PathUtils.parse("Sessions[0]"); - } - - @Override - public String getIdFromCapture(String line) { - return line.split("\\s+")[1]; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengRootAttacherTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengRootAttacherTest.java deleted file mode 100644 index 333a52db54..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengRootAttacherTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.invm; - -import org.junit.Ignore; -import org.junit.Test; - -import agent.dbgeng.model.AbstractModelForDbgengRootAttacherTest; - -@Ignore("deprecated") -public class InVmModelForDbgengRootAttacherTest extends AbstractModelForDbgengRootAttacherTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmDbgengModelHost(); - } - - @Override - @Ignore - @Test - // Takes forever - passes w/ OTE on Memory in tear down - public void testAttachByPidThenResumeInterrupt() throws Throwable { - super.testAttachByPidThenResumeInterrupt(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengRootLauncherTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengRootLauncherTest.java deleted file mode 100644 index 0339e40be6..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengRootLauncherTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.invm; - -import org.junit.Ignore; - -import agent.dbgeng.model.AbstractModelForDbgengRootLauncherTest; - -@Ignore("deprecated") -public class InVmModelForDbgengRootLauncherTest extends AbstractModelForDbgengRootLauncherTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmDbgengModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengScenarioCloneExitTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengScenarioCloneExitTest.java deleted file mode 100644 index 34753420e5..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengScenarioCloneExitTest.java +++ /dev/null @@ -1,29 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.invm; - -import org.junit.Ignore; - -import agent.dbgeng.model.AbstractModelForDbgengScenarioCloneExitTest; - -@Ignore("deprecated") -public class InVmModelForDbgengScenarioCloneExitTest - extends AbstractModelForDbgengScenarioCloneExitTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmDbgengModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengScenarioForkExitTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengScenarioForkExitTest.java deleted file mode 100644 index c3eae4d934..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengScenarioForkExitTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.invm; - -import org.junit.Ignore; -import org.junit.Test; - -import agent.dbgeng.model.AbstractModelForDbgengScenarioForkExitTest; - -@Ignore("deprecated") -public class InVmModelForDbgengScenarioForkExitTest - extends AbstractModelForDbgengScenarioForkExitTest { - - @Override - @Ignore("Specimen is currently defunct") - @Test - public void testScenario() throws Throwable { - } - - @Override - public ModelHost modelHost() throws Throwable { - return new InVmDbgengModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengScenarioMemoryTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengScenarioMemoryTest.java deleted file mode 100644 index a3c32f6474..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengScenarioMemoryTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.invm; - -import org.junit.Ignore; - -import agent.dbgeng.model.AbstractModelForDbgengScenarioMemoryTest; - -@Ignore("deprecated") -public class InVmModelForDbgengScenarioMemoryTest extends AbstractModelForDbgengScenarioMemoryTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmDbgengModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengScenarioStackTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengScenarioStackTest.java deleted file mode 100644 index 10aeeaa790..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengScenarioStackTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.invm; - -import org.junit.Ignore; - -import agent.dbgeng.model.AbstractModelForDbgengScenarioStackTest; - -@Ignore("deprecated") -public class InVmModelForDbgengScenarioStackTest extends AbstractModelForDbgengScenarioStackTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmDbgengModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengScenarioX64RegistersTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengScenarioX64RegistersTest.java deleted file mode 100644 index aa8b62f6a5..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengScenarioX64RegistersTest.java +++ /dev/null @@ -1,29 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.invm; - -import org.junit.Ignore; - -import agent.dbgeng.model.AbstractModelForDbgengScenarioX64RegistersTest; - -@Ignore("deprecated") -public class InVmModelForDbgengScenarioX64RegistersTest - extends AbstractModelForDbgengScenarioX64RegistersTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmDbgengModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengSessionActivationTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengSessionActivationTest.java deleted file mode 100644 index 4126caebae..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengSessionActivationTest.java +++ /dev/null @@ -1,29 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.invm; - -import org.junit.Ignore; - -import agent.dbgeng.model.AbstractModelForDbgengSessionActivationTest; - -@Ignore("Don't know how to make multiple sessions, deprecated") -public class InVmModelForDbgengSessionActivationTest - extends AbstractModelForDbgengSessionActivationTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmDbgengModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengSteppableTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengSteppableTest.java deleted file mode 100644 index fc257236d9..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengSteppableTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.invm; - -import org.junit.Ignore; - -import agent.dbgeng.model.AbstractModelForDbgengSteppableTest; - -@Ignore("deprecated") -public class InVmModelForDbgengSteppableTest extends AbstractModelForDbgengSteppableTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmDbgengModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengThreadActivationTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengThreadActivationTest.java deleted file mode 100644 index 303a24086b..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengThreadActivationTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.invm; - -import java.util.List; - -import org.junit.Ignore; - -import agent.dbgeng.model.AbstractModelForDbgengThreadActivationTest; -import ghidra.dbg.util.PathPattern; -import ghidra.dbg.util.PathUtils; - -@Ignore("deprecated") -public class InVmModelForDbgengThreadActivationTest - extends AbstractModelForDbgengThreadActivationTest { - - @Override - protected PathPattern getThreadPattern() { - return new PathPattern(PathUtils.parse("Sessions[0].Processes[].Threads[]")); - } - - @Override - public ModelHost modelHost() throws Throwable { - return new InVmDbgengModelHost(); - } - - @Override - public List getExpectedSessionPath() { - return PathUtils.parse("Sessions[0]"); - } - - @Override - public String getIdFromCapture(String line) { - return line.split("\\s+")[1]; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengX64RegistersTest.java b/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengX64RegistersTest.java deleted file mode 100644 index c2dc159165..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgeng/src/test/java/agent/dbgeng/model/invm/InVmModelForDbgengX64RegistersTest.java +++ /dev/null @@ -1,29 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgeng.model.invm; - -import org.junit.Ignore; - -import agent.dbgeng.model.AbstractModelForDbgengX64RegistersTest; - -@Ignore("deprecated") -public class InVmModelForDbgengX64RegistersTest extends AbstractModelForDbgengX64RegistersTest { - - @Override - public ModelHost modelHost() throws Throwable { - return new InVmDbgengModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel-traceloader/Module.manifest b/Ghidra/Debug/Debugger-agent-dbgmodel-traceloader/Module.manifest deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel-traceloader/README.md b/Ghidra/Debug/Debugger-agent-dbgmodel-traceloader/README.md deleted file mode 100644 index fcf665b185..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel-traceloader/README.md +++ /dev/null @@ -1 +0,0 @@ -# Debugger-agent-dbgmodel-traceloader diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel-traceloader/build.gradle b/Ghidra/Debug/Debugger-agent-dbgmodel-traceloader/build.gradle deleted file mode 100644 index 7c97953e24..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel-traceloader/build.gradle +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -apply from: "${rootProject.projectDir}/gradle/javaProject.gradle" -apply from: "${rootProject.projectDir}/gradle/jacocoProject.gradle" -apply from: "${rootProject.projectDir}/gradle/javaTestProject.gradle" -apply from: "${rootProject.projectDir}/gradle/distributableGhidraModule.gradle" - -apply plugin: 'eclipse' -eclipse.project.name = 'Debug Debugger-agent-dbgmodel-traceloader' - -dependencies { - api project(":Debugger") - api project(":Debugger-agent-dbgeng") - api project(':Debugger-agent-dbgmodel') -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel-traceloader/certification.manifest b/Ghidra/Debug/Debugger-agent-dbgmodel-traceloader/certification.manifest deleted file mode 100644 index 5e05c17012..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel-traceloader/certification.manifest +++ /dev/null @@ -1,4 +0,0 @@ -##VERSION: 2.0 -##MODULE IP: Apache License 2.0 -Module.manifest||GHIDRA||||END| -README.md||GHIDRA||||END| diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel-traceloader/ghidra_scripts/BangAddressToMemory.java b/Ghidra/Debug/Debugger-agent-dbgmodel-traceloader/ghidra_scripts/BangAddressToMemory.java deleted file mode 100644 index 4a1eacbbd0..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel-traceloader/ghidra_scripts/BangAddressToMemory.java +++ /dev/null @@ -1,159 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgeng.model.AbstractDbgModel; -import db.Transaction; -import ghidra.app.script.GhidraScript; -import ghidra.app.services.DebuggerModelService; -import ghidra.app.services.DebuggerTraceManagerService; -import ghidra.dbg.DebuggerObjectModel; -import ghidra.program.model.address.*; -import ghidra.program.model.lang.Language; -import ghidra.trace.model.Lifespan; -import ghidra.trace.model.Trace; -import ghidra.trace.model.memory.*; -import ghidra.util.LockHold; -import ghidra.util.Msg; -import ghidra.util.exception.DuplicateNameException; - -/** - * This script populates a trace database with memory derived from "!address". This is particularly - * useful for dump files and other cases where QueryVirtual fails. - * - *

- * Your current tool had better be the "TraceBrowser"! The demonstration serves two purposes. 1) It - * puts interesting data into the TraceBrowser and leaves some annotations as an exercise. 2) It - * demonstrates how a decent portion the Trace API works. - * - *

- * A Trace is basically a collection of observations of memory and registers over the lifetime of an - * application or computer system. In Ghidra, the Trace object also supports many of the same - * annotations as does Program. In the same way that Program brings knowledge markup to an image of - * bytes, Trace brings knowledge markup to bytes observed over time. - * - */ -public class BangAddressToMemory extends GhidraScript { - - /** - * The Memory APIs all use Java NIO ByteBuffer. While it has it can sometimes be annoying, it - * provides most of the conveniences you'd need for packing arbitrary data into a memory buffer. - * I'll allocate one here large enough to write a couple values at a time. - */ - private ByteBuffer buf = ByteBuffer.allocate(16).order(ByteOrder.LITTLE_ENDIAN); - - private Language lang; - private Trace trace; - private TraceMemoryManager memory; - - private AddressSpace defaultSpace; - - private DebuggerModelService modelService; - private DebuggerTraceManagerService managerService; - - /** - * Create an address in the processor's (x86_64) default space. - * - * @param offset the byte offset - * @return the address - */ - protected Address addr(long offset) { - return defaultSpace.getAddress(offset); - } - - /** - * Create an address range in the processor's default space. - * - * @param min the minimum byte offset - * @param max the maximum (inclusive) byte offset - * @return the range - */ - protected AddressRange rng(long min, long max) { - return new AddressRangeImpl(addr(min), addr(max)); - } - - @Override - protected void run() throws Exception { - - modelService = state.getTool().getService(DebuggerModelService.class); - if (modelService == null) { - throw new RuntimeException("Unable to find DebuggerMemviewPlugin"); - } - - DebuggerObjectModel model = modelService.getCurrentModel(); - if (!(model instanceof AbstractDbgModel)) { - throw new RuntimeException("Current model must be an AbstractDbgModel"); - } - AbstractDbgModel dbgmodel = (AbstractDbgModel) model; - DbgManagerImpl manager = (DbgManagerImpl) dbgmodel.getManager(); - //client = manager.getClient(); - - managerService = state.getTool().getService(DebuggerTraceManagerService.class); - trace = managerService.getCurrentTrace(); - if (trace == null) { - throw new RuntimeException("Script requires an active trace"); - } - memory = trace.getMemoryManager(); - - lang = currentProgram.getLanguage(); - defaultSpace = lang.getAddressFactory().getDefaultAddressSpace(); - - manager.consoleCapture("!address").thenAccept(result -> { - parse(result); - }); - } - - private void parse(String result) { - try (Transaction tx = trace.openTransaction("Populate memory"); - LockHold hold = trace.lockWrite();) { - //Pattern pattern = Pattern.compile("\\s+(*)\\s+(*)\\s+"); - //Matcher matcher = pattern.matcher(fullclassname); - String[] lines = result.split("\n"); - for (String line : lines) { - if (line.startsWith("Mapping")) { - continue; - } - String[] fields = line.trim().split("\\s+"); - if (fields.length < 4) { - continue; - } - String startStr = fields[0].replaceAll("`", ""); - String endStr = fields[1].replaceAll("`", ""); - long start, end; - try { - start = Long.parseUnsignedLong(startStr, 16); - end = Long.parseUnsignedLong(endStr, 16); - } - catch (Exception e) { - continue; - } - String name = fields[3]; - AddressRange rng = rng(start, end - 1); - try { - TraceMemoryRegion region = - memory.addRegion(startStr, Lifespan.nowOn(0), rng, TraceMemoryFlag.READ, - TraceMemoryFlag.WRITE, TraceMemoryFlag.EXECUTE); - region.setName(name); - } - catch (TraceOverlappedRegionException | DuplicateNameException e) { - Msg.info(this, "Duplicate range at " + start); - } - } - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel-traceloader/ghidra_scripts/PopulateMemviewLocal.java b/Ghidra/Debug/Debugger-agent-dbgmodel-traceloader/ghidra_scripts/PopulateMemviewLocal.java deleted file mode 100644 index 07bde497b5..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel-traceloader/ghidra_scripts/PopulateMemviewLocal.java +++ /dev/null @@ -1,283 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import java.io.File; -import java.util.*; - -import com.sun.jna.Pointer; - -import agent.dbgeng.dbgeng.DebugClient; -import agent.dbgeng.dbgeng.DebugControl; -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.bridge.HostDataModelAccess; -import agent.dbgmodel.dbgmodel.main.ModelMethod; -import agent.dbgmodel.dbgmodel.main.ModelObject; -import agent.dbgmodel.impl.dbgmodel.bridge.HDMAUtil; -import ghidra.app.plugin.core.debug.gui.memview.*; -import ghidra.app.script.GhidraScript; -import ghidra.program.model.address.*; -import ghidra.program.model.lang.Language; -import ghidra.program.model.lang.Register; -import ghidra.trace.model.Lifespan; -import ghidra.trace.model.memory.TraceMemoryFlag; -import ghidra.util.Swing; - -public class PopulateMemviewLocal extends GhidraScript { - - private Language lang; - - private AddressSpace defaultSpace; - - private HostDataModelAccess access; - private DebugClient client; - private DebugControl control; - private HDMAUtil util; - - private Map boxes = new HashMap(); - private Set eventSnaps = new HashSet(); - private MemviewService memview; - - /** - * Create an address in the processor's (x86_64) default space. - * - * @param offset the byte offset - * @return the address - */ - protected Address addr(long offset) { - return defaultSpace.getAddress(offset); - } - - /** - * Create an address range in the processor's default space. - * - * @param min the minimum byte offset - * @param max the maximum (inclusive) byte offset - * @return the range - */ - protected AddressRange rng(long min, long max) { - return new AddressRangeImpl(addr(min), addr(max)); - } - - /** - * Get a register by name - * - * @param name the name - * @return the register - */ - protected Register reg(String name) { - return lang.getRegister(name); - } - - @Override - protected void run() throws Exception { - - memview = state.getTool().getService(MemviewService.class); - if (memview == null) { - throw new RuntimeException("Unable to find DebuggerMemviewPlugin"); - } - - access = DbgModel.debugCreate(); - client = access.getClient(); - control = client.getControl(); - util = new HDMAUtil(access); - - File f = askFile("Trace", "Load"); - - lang = currentProgram.getLanguage(); - defaultSpace = lang.getAddressFactory().getDefaultAddressSpace(); - - client.openDumpFileWide(f.getAbsolutePath()); - control.waitForEvent(); - - List children = util.getElements( - List.of("Debugger", "State", "DebuggerVariables", "curprocess", "TTD", "Events")); - - Map maxPos = util.getAttributes(List.of("Debugger", "State", - "DebuggerVariables", "curprocess", "TTD", "Lifetime", "MaxPosition")); - Long max = (Long) maxPos.get("Sequence").getValue(); - - for (ModelObject event : children) { - Map eventMap = event.getKeyValueMap(); - ModelObject pos = eventMap.get("Position"); - ModelObject seq = pos.getKeyValue("Sequence"); - //ModelObject step = pos.getKeyValue("Steps"); - ModelObject type = eventMap.get("Type"); - String display = type.getValueString(); - Long snap = (Long) seq.getValue(); - if (display.contains("ModuleLoaded") || display.contains("ModuleUnloaded")) { - ModelObject module = eventMap.get("Module"); - Map moduleMap = module.getKeyValueMap(); - ModelObject name = moduleMap.get("Name"); - ModelObject address = moduleMap.get("Address"); - ModelObject size = moduleMap.get("Size"); - String moduleId = name.getValueString(); - display += " " + moduleId; - //Address base = currentProgram.getAddressFactory().getAddress(address.getValueString()); - if (display.contains("ModuleLoaded")) { - Long start = (Long) address.getValue(); - Long sz = (Long) size.getValue(); - AddressRange rng = rng(start, start + sz - 1); - addLoadedModule(moduleId, moduleId, Lifespan.nowOn(snap), rng); - //addRegion(moduleId, Range.atLeast(snap), rng, TraceMemoryFlag.READ, - // TraceMemoryFlag.WRITE, TraceMemoryFlag.EXECUTE); - } - else { - markModuleClosed(moduleId, snap); - } - } - else if (display.contains("ThreadCreated") || display.contains("ThreadTerminated")) { - ModelObject thread = eventMap.get("Thread"); - //ModelObject uid = thread.getKeyValue("UniqueId"); - ModelObject id = thread.getKeyValue("Id"); - String threadId = id.getValueString(); - int iid = Integer.parseInt(threadId, 16); - AddressRange rng = rng(iid, iid + 1); - display += " " + threadId; - if (display.contains("ThreadCreated")) { - addThread("Thread " + threadId, Lifespan.nowOn(snap), rng); - } - else { - markThreadClosed(threadId, snap); - } - } - if (snap < 0) { - snap = ++max; - } - //timeManager.getSnapshot(snap, true).setDescription(display); - eventSnaps.add(snap); - } - - for (Long snap : eventSnaps) { - control.execute("!tt " + Long.toHexString(snap) + ":0"); - control.waitForEvent(); - - List modelThreads = util.getElements( - List.of("Debugger", "State", "DebuggerVariables", "curprocess", "Threads")); - Map modelThreadMap = new HashMap(); - for (ModelObject obj : modelThreads) { - modelThreadMap.put(obj.getSearchKey(), obj); - } - } - - ModelObject currentSession = util.getCurrentSession(); - ModelObject data = currentSession.getKeyValue("TTD").getKeyValue("Data"); - ModelMethod heap = data.getMethod("Heap"); - Pointer[] args = new Pointer[0]; - ModelObject ret = heap.call(data, 0, args); - for (ModelObject heapObj : ret.getElements()) { - Map heapMap = heapObj.getKeyValueMap(); - ModelObject address = heapMap.get("Address"); - ModelObject size = heapMap.get("Size"); - ModelObject timeStart = heapMap.get("TimeStart").getKeyValue("Sequence"); - ModelObject timeEnd = heapMap.get("TimeEnd").getKeyValue("Sequence"); - if (address == null) { - continue; - } - Long start = (Long) address.getValue(); - if (size == null) { - continue; - } - Long sz = (Long) size.getValue(); - if (sz == null) { - continue; - } - AddressRange rng = rng(start, start + sz); - String heapId = "Heap " + address.getValueString(); - Long startTick = (Long) timeStart.getValue(); - Long stopTick = (Long) timeEnd.getValue(); - Lifespan interval = - (stopTick > 0) ? Lifespan.span(startTick, stopTick) : Lifespan.nowOn(startTick); - addHeap(heapId, interval, rng, TraceMemoryFlag.READ, TraceMemoryFlag.WRITE, - TraceMemoryFlag.EXECUTE); - } - - /** - * Give a program view to Ghidra's program manager - * - * NOTE: Eventually, there will probably be a TraceManager service as well, but to use the - * familiar UI components, we generally take orders from the ProgramManager. - */ - //manager.openTrace(trace); - //manager.activateTrace(trace); - List boxList = new ArrayList<>(); - for (MemoryBox memoryBox : boxes.values()) { - boxList.add(memoryBox); - } - Swing.runIfSwingOrRunLater(() -> { - memview.setBoxes(boxList); - memview.setProgram(currentProgram); - memview.initViews(); - }); - } - - private void addHeap(String heapId, Lifespan interval, AddressRange rng, - TraceMemoryFlag read, TraceMemoryFlag write, TraceMemoryFlag execute) { - MemoryBox box = new MemoryBox(heapId, MemviewBoxType.HEAP_CREATE, rng, interval); - boxes.put(box.getId(), box); - } - - private void addThread(String threadId, Lifespan interval, AddressRange rng) { - MemoryBox box = new MemoryBox(threadId, MemviewBoxType.THREAD, rng, interval); - boxes.put(box.getId(), box); - } - - private void addRegion(String regionId, Lifespan interval, AddressRange rng, - TraceMemoryFlag read, TraceMemoryFlag write, TraceMemoryFlag execute) { - MemoryBox box = new MemoryBox(regionId, MemviewBoxType.IMAGE, rng, interval); - boxes.put(box.getId(), box); - } - - private void addLoadedModule(String moduleId, String moduleId2, Lifespan interval, - AddressRange rng) { - MemoryBox box = new MemoryBox(moduleId, MemviewBoxType.MODULE, rng, interval); - boxes.put(box.getId(), box); - } - - private void markThreadClosed(String threadId, Long end) { - MemoryBox box = boxes.get(threadId); - if (box != null) { - if (end < 0) { - end = Long.MAX_VALUE; - } - box.setEnd(end); - } - } - - private void markModuleClosed(String moduleId, Long end) { - MemoryBox box = boxes.get(moduleId); - if (box != null) { - if (end < 0) { - end = Long.MAX_VALUE; - } - box.setEnd(end); - } - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel-traceloader/ghidra_scripts/PopulateTraceLocal.java b/Ghidra/Debug/Debugger-agent-dbgmodel-traceloader/ghidra_scripts/PopulateTraceLocal.java deleted file mode 100644 index 0a84055cda..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel-traceloader/ghidra_scripts/PopulateTraceLocal.java +++ /dev/null @@ -1,406 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import java.io.File; -import java.math.BigInteger; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; -import java.util.*; - -import agent.dbgeng.dbgeng.DebugClient; -import agent.dbgeng.dbgeng.DebugControl; -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.bridge.HostDataModelAccess; -import agent.dbgmodel.dbgmodel.main.ModelObject; -import agent.dbgmodel.impl.dbgmodel.bridge.HDMAUtil; -import db.Transaction; -import ghidra.app.script.GhidraScript; -import ghidra.app.services.DebuggerTraceManagerService; -import ghidra.program.model.address.*; -import ghidra.program.model.lang.*; -import ghidra.trace.database.DBTrace; -import ghidra.trace.model.Lifespan; -import ghidra.trace.model.Trace; -import ghidra.trace.model.memory.*; -import ghidra.trace.model.modules.TraceModule; -import ghidra.trace.model.modules.TraceModuleManager; -import ghidra.trace.model.thread.TraceThread; -import ghidra.trace.model.thread.TraceThreadManager; -import ghidra.trace.model.time.TraceTimeManager; -import ghidra.util.Msg; - -/** - * This script populates a trace database for demonstrations purposes and opens it in the current - * tool. - * - *

- * Your current tool had better be the "TraceBrowser"! The demonstration serves two purposes. 1) It - * puts interesting data into the TraceBrowser and leaves some annotations as an exercise. 2) It - * demonstrates how a decent portion the Trace API works. - * - *

- * A Trace is basically a collection of observations of memory and registers over the lifetime of an - * application or computer system. In Ghidra, the Trace object also supports many of the same - * annotations as does Program. In the same way that Program brings knowledge markup to an image of - * bytes, Trace brings knowledge markup to bytes observed over time. - * - *

- * Effectively, if you take the cross-product of Program with time and add Threads, Breakpoints, - * etc., you get Trace. It's a lot. In order to use all the UI components which take a Program, - * Trace can present itself as a Program at a particular point in time. - * - *

- * Each particular component will be introduced as its used in the script below, but for now some - * core concepts: - * - *

    - *
  • A point in time is called a "tick." These don't necessarily correspond to any real unit of - * time, though they may. The only requirement is that they are numbered in chronological - * order.
  • - *
  • Every annotation has a "lifespan," which is the range of ticks for which the annotation is - * effective. Some annotations may overlap, others may not. In general, if the corresponding concept - * in Program permits address overlap, then Trace permits both address and time overlap. If not, - * then neither is permitted. In essense, Trace defines overlap as the intersection of rectangles, - * where an annotation's X dimension is it's address range, and its Y dimension is its lifespan. - *
  • - *
  • Observations in memory happen at a particular tick and are assumed in effect until another - * observation changes that. To record the "freshness" of observations, the memory manager tags - * regions as KNOWN, UNKNOWN, or ERROR. An observation implicitly marks the affected region as - * KNOWN. The intent is to grey the background for regions where memory is UNKNOWN for the current - * tick.
  • - *
  • Observations of registers behave exactly the same as observations for memory, by leveraging - * Ghidra's "register space." The only difference is that those observations must be recorded with - * respect to a given thread. Each thread is effectively allocated its own copy of the register - * space. Most of the API components require you to obtain a special "register space" for a given - * thread before recording observations of or applying annotations to that thread.
  • - *
- * - *

- * After you've run this script, a trace should appear in the UI. Note that there is not yet a way - * to save a trace in the UI. As an exercise, try adding data units to analyze the threads' stacks. - * It may take some getting accustomed to, but the rules for laying down units should be very - * similar to those in a Program. However, the Trace must take the applied units and decide how far - * into the future they are effective. In general, it defaults to "from here on out." However, two - * conditions may cause the trace to choose an ending tick: 1) The underlying bytes change sometime - * in the future, and 2) There is an overlapping code unit sometime in the future. - * - *

- * The trace chooses the latest tick possible preceding any byte change or existing code unit, so - * that the unit's underlying bytes remain constant for its lifespan, and the unit does not overlap - * any existing unit. This rule causes some odd behavior for null-terminated strings. I intend to - * adjust this rule slightly for static data types wrt/ byte changes. For those, the placed unit - * should be truncated as described above, however, another data unit of the same type can be placed - * at the change. The same rule is then applied iteratively into the future until an overlapping - * unit is encountered, or there are no remaining byte changes. - */ -public class PopulateTraceLocal extends GhidraScript { - - /** - * The Memory APIs all use Java NIO ByteBuffer. While it has it can sometimes be annoying, it - * provides most of the conveniences you'd need for packing arbitrary data into a memory buffer. - * I'll allocate one here large enough to write a couple values at a time. - */ - private ByteBuffer buf = ByteBuffer.allocate(16).order(ByteOrder.LITTLE_ENDIAN); - - private Language lang; - private CompilerSpec cspec; - private Trace trace; - private TraceMemoryManager memory; - private TraceModuleManager modules; - private TraceThreadManager threads; - private TraceTimeManager timeManager; - - private AddressSpace defaultSpace; - - private DebuggerTraceManagerService manager; - - private HostDataModelAccess access; - private DebugClient client; - private DebugControl control; - private HDMAUtil util; - - private Set eventSnaps = new HashSet(); - - /** - * Create an address in the processor's (x86_64) default space. - * - * @param offset the byte offset - * @return the address - */ - protected Address addr(long offset) { - return defaultSpace.getAddress(offset); - } - - /** - * Create an address range in the processor's default space. - * - * @param min the minimum byte offset - * @param max the maximum (inclusive) byte offset - * @return the range - */ - protected AddressRange rng(long min, long max) { - return new AddressRangeImpl(addr(min), addr(max)); - } - - /** - * Get a register by name - * - * @param name the name - * @return the register - */ - protected Register reg(String name) { - return lang.getRegister(name); - } - - @Override - protected void run() throws Exception { - - access = DbgModel.debugCreate(); - client = access.getClient(); - control = client.getControl(); - util = new HDMAUtil(access); - - File f = askFile("Trace", "Load"); - - cspec = currentProgram.getCompilerSpec(); - lang = currentProgram.getLanguage(); - defaultSpace = lang.getAddressFactory().getDefaultAddressSpace(); - trace = new DBTrace(f.getName(), cspec, this); - - memory = trace.getMemoryManager(); - modules = trace.getModuleManager(); - threads = trace.getThreadManager(); - timeManager = trace.getTimeManager(); - - manager = state.getTool().getService(DebuggerTraceManagerService.class); - - client.openDumpFileWide(f.getAbsolutePath()); - control.waitForEvent(); - - try (Transaction tx = trace.openTransaction("Populate Events")) { - - List children = - util.getElements(List.of("Debugger", "State", "DebuggerVariables", "curprocess", - "TTD", "Events")); - - Map maxPos = util.getAttributes( - List.of("Debugger", "State", "DebuggerVariables", "curprocess", "TTD", "Lifetime", - "MaxPosition")); - Long max = (Long) maxPos.get("Sequence").getValue(); - - for (ModelObject event : children) { - Map eventMap = event.getKeyValueMap(); - ModelObject pos = eventMap.get("Position"); - ModelObject seq = pos.getKeyValue("Sequence"); - //ModelObject step = pos.getKeyValue("Steps"); - ModelObject type = eventMap.get("Type"); - String display = type.getValueString(); - Long snap = (Long) seq.getValue(); - if (display.contains("ModuleLoaded") || display.contains("ModuleUnloaded")) { - ModelObject module = eventMap.get("Module"); - Map moduleMap = module.getKeyValueMap(); - ModelObject name = moduleMap.get("Name"); - ModelObject address = moduleMap.get("Address"); - ModelObject size = moduleMap.get("Size"); - String moduleId = name.getValueString(); - display += " " + moduleId; - Address base = - currentProgram.getAddressFactory().getAddress(address.getValueString()); - if (display.contains("ModuleLoaded")) { - Long start = (Long) address.getValue(); - Long sz = (Long) size.getValue(); - buf = ByteBuffer.allocate(sz.intValue()).order(ByteOrder.LITTLE_ENDIAN); - AddressRange rng = rng(start, start + sz - 1); - modules.addLoadedModule(moduleId, moduleId, rng, snap); - memory.addRegion(moduleId, Lifespan.nowOn(snap), rng, - TraceMemoryFlag.READ, TraceMemoryFlag.WRITE, TraceMemoryFlag.EXECUTE); - try { - int read = - client.getDataSpaces().readVirtual(start, buf, sz.intValue()); - int written = memory.putBytes(snap, rng.getMinAddress(), buf.flip()); - if (read != written) { - Msg.debug(this, - "read:written=" + read + ":" + written + " at " + start); - } - } - catch (Exception e) { - System.err.println("Unable to read " + moduleId + " at " + snap); - } - } - else { - if (snap >= 0) { - Collection mods = - modules.getModulesByPath(moduleId); - Iterator iterator = mods.iterator(); - while (iterator.hasNext()) { - TraceModule next = iterator.next(); - next.setUnloadedSnap(snap); - } - } - } - } - else if (display.contains("ThreadCreated") || - display.contains("ThreadTerminated")) { - ModelObject thread = eventMap.get("Thread"); - //ModelObject uid = thread.getKeyValue("UniqueId"); - ModelObject id = thread.getKeyValue("Id"); - String threadId = id.getValueString(); - display += " " + threadId; - if (display.contains("ThreadCreated")) { - threads.addThread(threadId, Lifespan.nowOn(snap)); - } - else { - if (snap >= 0) { - Collection thrs = - threads.getThreadsByPath(threadId); - Iterator iterator = thrs.iterator(); - while (iterator.hasNext()) { - TraceThread next = iterator.next(); - next.setDestructionSnap(snap); - } - } - } - } - if (snap < 0) { - snap = ++max; - } - timeManager.getSnapshot(snap, true).setDescription(display); - eventSnaps.add(snap); - } - } - - try (Transaction tx = trace.openTransaction("Populate Registers")) { - //for (Long tick : tickManager.getAllTicks()) { - for (Long snap : eventSnaps) { - control.execute("!tt " + Long.toHexString(snap) + ":0"); - control.waitForEvent(); - - List modelThreads = - util.getElements( - List.of("Debugger", "State", "DebuggerVariables", "curprocess", "Threads")); - Map modelThreadMap = new HashMap(); - for (ModelObject obj : modelThreads) { - modelThreadMap.put(obj.getSearchKey(), obj); - } - - Collection liveThreads = threads.getLiveThreads(snap); - for (TraceThread thread : liveThreads) { - TraceMemorySpace regspace = memory.getMemoryRegisterSpace(thread, true); - ModelObject modelThread = modelThreadMap.get("0x" + thread.getName()); - if (modelThread != null) { - Map registers = - modelThread.getKeyValue("Registers") - .getKeyValue( - "User") - .getKeyValueMap(); - for (String rname : registers.keySet()) { - ModelObject r = registers.get(rname); - Register reg = reg(rname.toUpperCase()); - if (reg != null) { - try { - regspace.setValue(snap, - new RegisterValue(reg, BigInteger.valueOf( - Long.parseUnsignedLong(r.getValueString(), 16)))); - } - catch (Exception e) { - System.err.println(rname + "<--" + r.getValueString()); - } - } - } - } - else { - System.err.println(thread.getName() + " not found!"); - } - - } - } - } - - /* - try (Transaction tx = trace.openTransaction("Populate Heap")) { - ModelObject currentSession = util.getCurrentSession(); - ModelObject data = currentSession.getKeyValue("TTD").getKeyValue("Data"); - ModelMethod heap = data.getMethod("Heap"); - Pointer[] args = new Pointer[0]; - ModelObject ret = heap.call(data, 0, args); - List heapObjects = new ArrayList(); - for (ModelObject heapObj : ret.getElements()) { - Map heapMap = heapObj.getKeyValueMap(); - ModelObject address = heapMap.get("Address"); - ModelObject size = heapMap.get("Size"); - ModelObject timeStart = heapMap.get("TimeStart").getKeyValue("Sequence"); - ModelObject timeEnd = heapMap.get("TimeEnd").getKeyValue("Sequence"); - if (address == null) { - continue; - } - Long start = (Long) address.getValue(); - if (size == null) { - continue; - } - Long sz = (Long) size.getValue(); - if (sz == null) { - continue; - } - AddressRange rng = rng(start, start + sz); - String heapId = "Heap " + address.getValueString(); - Long startTick = (Long) timeStart.getValue(); - Long stopTick = (Long) timeEnd.getValue(); - Range interval = - (stopTick > 0) ? Range.open(startTick, stopTick) : Range.atLeast(startTick); - tickManager.setTick(startTick, heapId + " allocated"); - tickManager.setTick(stopTick, heapId + " freed"); - TraceMemoryRegion heapRegion = - memory.addRegion(heapId, interval, rng, - TraceMemoryFlag.READ, TraceMemoryFlag.WRITE, TraceMemoryFlag.EXECUTE); - heapObjects.add(heapRegion); - } - for (TraceMemoryRegion heapRegion : heapObjects) { - long startTick = heapRegion.getCreatedTick(); - try { - control.execute("!tt " + Long.toHexString(startTick) + ":0"); - control.waitForEvent(); - - AddressRange range = heapRegion.getRange(); - buf = - ByteBuffer.allocate((int) range.getLength()).order(ByteOrder.LITTLE_ENDIAN); - long start = range.getMinAddress().getOffset(); - int read = - client.getDataSpaces().readVirtual(start, buf, - (int) range.getLength()); - int written = memory.putBytes(startTick, range.getMinAddress(), buf.flip()); - if (read != written) { - Msg.debug(this, - "read:written=" + read + ":" + written + " at " + start); - } - } - catch (Exception e) { - System.err.println( - "Unable to read " + heapRegion.getName() + " at " + startTick); - } - } - } - */ - - /** - * Give a program view to Ghidra's program manager - * - * NOTE: Eventually, there will probably be a TraceManager service as well, but to use the - * familiar UI components, we generally take orders from the ProgramManager. - */ - manager.openTrace(trace); - manager.activateTrace(trace); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel-traceloader/ghidra_scripts/PopulateTraceRemote.java b/Ghidra/Debug/Debugger-agent-dbgmodel-traceloader/ghidra_scripts/PopulateTraceRemote.java deleted file mode 100644 index 92f4ba5cf0..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel-traceloader/ghidra_scripts/PopulateTraceRemote.java +++ /dev/null @@ -1,173 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import java.io.File; -import java.util.Set; - -import db.Transaction; -import ghidra.app.script.GhidraScript; -import ghidra.app.services.DebuggerModelService; -import ghidra.app.services.DebuggerTraceManagerService; -import ghidra.dbg.DebugModelConventions; -import ghidra.dbg.DebuggerObjectModel; -import ghidra.dbg.target.*; -import ghidra.framework.plugintool.PluginTool; -import ghidra.program.model.address.*; -import ghidra.program.model.lang.*; -import ghidra.trace.database.DBTrace; -import ghidra.trace.model.Trace; -import ghidra.trace.model.time.TraceTimeManager; - -/** - * This script populates a trace database for demonstrations purposes and opens it in the current - * tool. - * - *

- * Your current tool had better be the "TraceBrowser"! The demonstration serves two purposes. 1) It - * puts interesting data into the TraceBrowser and leaves some annotations as an exercise. 2) It - * demonstrates how a decent portion the Trace API works. - * - *

- * A Trace is basically a collection of observations of memory and registers over the lifetime of an - * application or computer system. In Ghidra, the Trace object also supports many of the same - * annotations as does Program. In the same way that Program brings knowledge markup to an image of - * bytes, Trace brings knowledge markup to bytes observed over time. - * - *

- * Effectively, if you take the cross-product of Program with time and add Threads, Breakpoints, - * etc., you get Trace. It's a lot. In order to use all the UI components which take a Program, - * Trace can present itself as a Program at a particular point in time. - * - *

- * Each particular component will be introduced as its used in the script below, but for now some - * core concepts: - * - *

    - *
  • A point in time is called a "tick." These don't necessarily correspond to any real unit of - * time, though they may. The only requirement is that they are numbered in chronological - * order.
  • - *
  • Every annotation has a "lifespan," which is the range of ticks for which the annotation is - * effective. Some annotations may overlap, others may not. In general, if the corresponding concept - * in Program permits address overlap, then Trace permits both address and time overlap. If not, - * then neither is permitted. In essense, Trace defines overlap as the intersection of rectangles, - * where an annotation's X dimension is it's address range, and its Y dimension is its lifespan. - *
  • - *
  • Observations in memory happen at a particular tick and are assumed in effect until another - * observation changes that. To record the "freshness" of observations, the memory manager tags - * regions as KNOWN, UNKNOWN, or ERROR. An observation implicitly marks the affected region as - * KNOWN. The intent is to grey the background for regions where memory is UNKNOWN for the current - * tick.
  • - *
  • Observations of registers behave exactly the same as observations for memory, by leveraging - * Ghidra's "register space." The only difference is that those observations must be recorded with - * respect to a given thread. Each thread is effectively allocated its own copy of the register - * space. Most of the API components require you to obtain a special "register space" for a given - * thread before recording observations of or applying annotations to that thread.
  • - *
- * - *

- * After you've run this script, a trace should appear in the UI. Note that there is not yet a way - * to save a trace in the UI. As an exercise, try adding data units to analyze the threads' stacks. - * It may take some getting accustomed to, but the rules for laying down units should be very - * similar to those in a Program. However, the Trace must take the applied units and decide how far - * into the future they are effective. In general, it defaults to "from here on out." However, two - * conditions may cause the trace to choose an ending tick: 1) The underlying bytes change sometime - * in the future, and 2) There is an overlapping code unit sometime in the future. - * - *

- * The trace chooses the latest tick possible preceding any byte change or existing code unit, so - * that the unit's underlying bytes remain constant for its lifespan, and the unit does not overlap - * any existing unit. This rule causes some odd behavior for null-terminated strings. I intend to - * adjust this rule slightly for static data types wrt/ byte changes. For those, the placed unit - * should be truncated as described above, however, another data unit of the same type can be placed - * at the change. The same rule is then applied iteratively into the future until an overlapping - * unit is encountered, or there are no remaining byte changes. - */ -public class PopulateTraceRemote extends GhidraScript { - - private Language lang; - private CompilerSpec cspec; - private Trace trace; - private TraceTimeManager timeManager; - - private AddressSpace defaultSpace; - - private DebuggerTraceManagerService manager; - private DebuggerModelService targets; - - /** - * Create an address in the processor's (x86_64) default space. - * - * @param offset the byte offset - * @return the address - */ - protected Address addr(long offset) { - return defaultSpace.getAddress(offset); - } - - /** - * Create an address range in the processor's default space. - * - * @param min the minimum byte offset - * @param max the maximum (inclusive) byte offset - * @return the range - */ - protected AddressRange rng(long min, long max) { - return new AddressRangeImpl(addr(min), addr(max)); - } - - /** - * Get a register by name - * - * @param name the name - * @return the register - */ - protected Register reg(String name) { - return lang.getRegister(name); - } - - @Override - protected void run() throws Exception { - - File f = askFile("Trace", "Load"); - - cspec = currentProgram.getCompilerSpec(); - lang = currentProgram.getLanguage(); - defaultSpace = lang.getAddressFactory().getDefaultAddressSpace(); - trace = new DBTrace(f.getName(), cspec, this); - - PluginTool tool = state.getTool(); - manager = tool.getService(DebuggerTraceManagerService.class); - targets = tool.getService(DebuggerModelService.class); - - try (Transaction tx = trace.openTransaction("Populate Events")) { - timeManager = trace.getTimeManager(); - timeManager.createSnapshot("init"); - } - - manager.openTrace(trace); - manager.activateTrace(trace); - - Set models = targets.getModels(); - DebuggerObjectModel model = (DebuggerObjectModel) models.toArray()[0]; - TargetInterpreter interpreter = - DebugModelConventions.findSuitable(TargetInterpreter.class, model.getModelRoot()).get(); - interpreter.execute(".opendump " + f.getAbsolutePath()).get(); - interpreter.execute("g"); - TargetAttacher attacher = - DebugModelConventions.findSuitable(TargetAttacher.class, model.getModelRoot()).get(); - // TODO: Is "Available" the correct path? - attacher.attach(model.getModelObject("Available", "[0]").as(TargetAttachable.class)).get(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/Module.manifest b/Ghidra/Debug/Debugger-agent-dbgmodel/Module.manifest deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/README.md b/Ghidra/Debug/Debugger-agent-dbgmodel/README.md deleted file mode 100644 index 43a7f3ea9a..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/README.md +++ /dev/null @@ -1 +0,0 @@ -# Debugger-agent-dbgmodel diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/build.gradle b/Ghidra/Debug/Debugger-agent-dbgmodel/build.gradle deleted file mode 100644 index 485bc8cf8a..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/build.gradle +++ /dev/null @@ -1,47 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -apply from: "$rootProject.projectDir/gradle/javaProject.gradle" -apply from: "$rootProject.projectDir/gradle/jacocoProject.gradle" -apply from: "$rootProject.projectDir/gradle/javaTestProject.gradle" -apply from: "$rootProject.projectDir/gradle/nativeProject.gradle" -apply from: "$rootProject.projectDir/gradle/distributableGhidraModule.gradle" - -apply from: "$rootProject.projectDir/gradle/debugger/hasNodepJar.gradle" - -apply plugin: 'eclipse' -eclipse.project.name = 'Debug Debugger-agent-dbgmodel' - -dependencies { - api project(":Debugger-agent-dbgeng") - - testImplementation project(path: ":Debugger-agent-dbgeng", configuration: 'testArtifacts') - testImplementation project(path: ':Framework-AsyncComm', configuration: 'testArtifacts') - testImplementation project(path: ':Framework-Debugging', configuration: 'testArtifacts') - testImplementation project(path: ":Debugger-gadp", configuration: 'testArtifacts') -} - -tasks.nodepJar { - manifest { - attributes['Main-Class'] = 'agent.dbgmodel.gadp.DbgModelGadpServer' - } -} - -test { - jvmArgs('-Xrs') // TODO: Is this needed, or left over from trial-and-error - if ("win_x86_64".equals(getCurrentPlatformName())) { - dependsOn(":Framework-Debugging:testSpecimenWin_x86_64") - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/certification.manifest b/Ghidra/Debug/Debugger-agent-dbgmodel/certification.manifest deleted file mode 100644 index e04c1bb1e9..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/certification.manifest +++ /dev/null @@ -1,6 +0,0 @@ -##VERSION: 2.0 -Module.manifest||GHIDRA||||END| -README.md||GHIDRA||||END| -src/javaprovider/def/javaprovider.def||GHIDRA||||END| -src/javaprovider/rc/javaprovider.rc||GHIDRA||||END| -src/main/resources/agent/dbgmodel/model/impl/dbgmodel_schema.xml||GHIDRA||||END| diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/javaprovider/cpp/javaprovider.cpp b/Ghidra/Debug/Debugger-agent-dbgmodel/src/javaprovider/cpp/javaprovider.cpp deleted file mode 100644 index 2bb02ec96b..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/javaprovider/cpp/javaprovider.cpp +++ /dev/null @@ -1,224 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#define INITGUID - -#include -#include - -#include "resource.h" - -#define CHECK_RESULT(x, y) do { \ - HRESULT hr = (x); \ - if (hr != S_OK) { \ - fprintf(stderr, "HRESULT of %s = %x\n", ##x, hr); \ - return y; \ - } \ -} while (0) - -class EXT_CLASS : public ExtExtension { -public: - virtual HRESULT Initialize(); - virtual void Uninitialize(); - - //virtual void OnSessionAccessible(ULONG64 Argument); - - EXT_COMMAND_METHOD(java_add_cp); - EXT_COMMAND_METHOD(java_set); - EXT_COMMAND_METHOD(java_get); - EXT_COMMAND_METHOD(java_run); - - void run_command(PCSTR name); -}; - -EXT_DECLARE_GLOBALS(); - -JavaVM* jvm = NULL; -JNIEnv* env = NULL; -jclass clsCommands = NULL; - -char JDK_JVM_DLL_PATH[] = "\\jre\\bin\\server\\jvm.dll"; -char JRE_JVM_DLL_PATH[] = "\\bin\\server\\jvm.dll"; - -typedef jint (_cdecl *CreateJavaVMFunc)(JavaVM**, void**, void*); - -HRESULT EXT_CLASS::Initialize() { - HRESULT result = ExtExtension::Initialize(); - if (result != S_OK) { - return result; - } - - char* env_java_home = getenv("JAVA_HOME"); - if (env_java_home == NULL) { - fprintf(stderr, "JAVA_HOME is not set\n"); - fflush(stderr); - return E_FAIL; - } - char* java_home = strdup(env_java_home); - size_t home_len = strlen(java_home); - if (java_home[home_len - 1] == '\\') { - java_home[home_len - 1] = '\0'; - } - size_t full_len = home_len + sizeof(JDK_JVM_DLL_PATH); - char* full_path = new char[full_len]; - HMODULE jvmDll = NULL; - // Try the JRE path first; - strcpy_s(full_path, full_len, java_home); - strcat_s(full_path, full_len, JRE_JVM_DLL_PATH); - fprintf(stderr, "Trying to find jvm.dll at %s\n", full_path); - fflush(stderr); - jvmDll = LoadLibraryA(full_path); - if (jvmDll == NULL) { - // OK, then try the JDK path - strcpy_s(full_path, full_len, java_home); - strcat_s(full_path, full_len, JDK_JVM_DLL_PATH); - fprintf(stderr, "Trying to find jvm.dll at %s\n", full_path); - fflush(stderr); - jvmDll = LoadLibraryA(full_path); - } - free(full_path); - free(java_home); - if (jvmDll == NULL) { - fprintf(stderr, "Could not find the jvm.dll\n"); - fflush(stderr); - return E_FAIL; - } - fprintf(stderr, "Found it!\n"); - fflush(stderr); - - JavaVMOption options[2]; - JavaVMInitArgs vm_args = { 0 }; - vm_args.version = JNI_VERSION_1_8; - vm_args.nOptions = sizeof(options)/sizeof(options[0]); - vm_args.options = options; - options[0].optionString = "-Xrs"; - options[1].optionString = "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005"; - vm_args.ignoreUnrecognized = false; - CreateJavaVMFunc create_jvm = NULL; - //create_jvm = JNI_CreateJavaVM; - create_jvm = (CreateJavaVMFunc) GetProcAddress(jvmDll, "JNI_CreateJavaVM"); - jint jni_result = create_jvm(&jvm, (void**)&env, &vm_args); - - if (jni_result != JNI_OK) { - jvm = NULL; - fprintf(stderr, "Could not initialize JVM: %d: ", jni_result); - switch (jni_result) { - case JNI_ERR: - fprintf(stderr, "unknown error"); - break; - case JNI_EDETACHED: - fprintf(stderr, "thread detached from the VM"); - break; - case JNI_EVERSION: - fprintf(stderr, "JNI version error"); - break; - case JNI_ENOMEM: - fprintf(stderr, "not enough memory"); - break; - case JNI_EEXIST: - fprintf(stderr, "VM already created"); - break; - case JNI_EINVAL: - fprintf(stderr, "invalid arguments"); - break; - } - fprintf(stderr, "\n"); - fflush(stderr); - return E_FAIL; - } - - HMODULE hJavaProviderModule = GetModuleHandle(TEXT("javaprovider")); - HRSRC resCommandsClassfile = FindResource(hJavaProviderModule, MAKEINTRESOURCE(IDR_CLASSFILE1), TEXT("Classfile")); - HGLOBAL gblCommandsClassfile = LoadResource(hJavaProviderModule, resCommandsClassfile); - LPVOID lpCommandsClassfile = LockResource(gblCommandsClassfile); - DWORD szCommandsClassfile = SizeofResource(hJavaProviderModule, resCommandsClassfile); - - clsCommands = env->DefineClass( - "javaprovider/Commands", NULL, (jbyte*) lpCommandsClassfile, szCommandsClassfile - ); - if (clsCommands == NULL) { - fprintf(stderr, "Could not define Commands class\n"); - if (env->ExceptionCheck()) { - env->ExceptionDescribe(); - env->ExceptionClear(); - return E_FAIL; - } - } - - return S_OK; -} - -void EXT_CLASS::Uninitialize() { - if (jvm != NULL) { - jvm->DestroyJavaVM(); - } - ExtExtension::Uninitialize(); -} - -void EXT_CLASS::run_command(PCSTR name) { - // TODO: Throw an exception during load, then! - if (jvm == NULL) { - Out("javaprovider extension did not load properly.\n"); - return; - } - if (clsCommands == NULL) { - Out("javaprovider extension did not load properly.\n"); - return; - } - - PCSTR args = GetRawArgStr(); - - jmethodID mthCommand = env->GetStaticMethodID(clsCommands, name, "(Ljava/lang/String;)V"); - if (mthCommand == NULL) { - Out("INTERNAL ERROR: No such command: %s\n", name); - return; - } - - jstring argsStr = env->NewStringUTF(args); - if (argsStr == NULL) { - Out("Could not create Java string for arguments.\n"); - return; - } - - env->CallStaticVoidMethod(clsCommands, mthCommand, argsStr); - env->DeleteLocalRef(argsStr); - if (env->ExceptionCheck()) { - Out("Exception during javaprovider command:\n"); - env->ExceptionDescribe(); // TODO: Send this to output callbacks, not console. - env->ExceptionClear(); - } -} - -EXT_COMMAND(java_add_cp, "Add an element to the class path", "{{custom}}") { - run_command("java_add_cp"); -} - -EXT_COMMAND(java_set, "Set a Java system property", "{{custom}}") { - run_command("java_set"); -} - -EXT_COMMAND(java_get, "Get a Java system property", "{{custom}}") { - run_command("java_get"); -} - -EXT_COMMAND(java_run, "Execute the named java class", "{{custom}}") { - run_command("java_run"); -} - -#define JNA extern "C" __declspec(dllexport) - -JNA HRESULT createClient(PDEBUG_CLIENT* client) { - return g_ExtInstance.m_Client->CreateClient(client); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/javaprovider/def/javaprovider.def b/Ghidra/Debug/Debugger-agent-dbgmodel/src/javaprovider/def/javaprovider.def deleted file mode 100644 index 197aee0bbd..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/javaprovider/def/javaprovider.def +++ /dev/null @@ -1,13 +0,0 @@ -EXPORTS - -; For ExtCpp - DebugExtensionInitialize - DebugExtensionUninitialize - DebugExtensionNotify - help - -; My Commands - java_add_cp - java_set - java_get - java_run diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/javaprovider/headers/afxres.h b/Ghidra/Debug/Debugger-agent-dbgmodel/src/javaprovider/headers/afxres.h deleted file mode 100644 index 853b8950c1..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/javaprovider/headers/afxres.h +++ /dev/null @@ -1,16 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/javaprovider/headers/resource.h b/Ghidra/Debug/Debugger-agent-dbgmodel/src/javaprovider/headers/resource.h deleted file mode 100644 index 39e5f2e8e5..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/javaprovider/headers/resource.h +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by javaprovider.rc -// -#define IDR_CLASSFILE1 101 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 102 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1001 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/javaprovider/rc/javaprovider.rc b/Ghidra/Debug/Debugger-agent-dbgmodel/src/javaprovider/rc/javaprovider.rc deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/DbgModelInJvmDebuggerModelFactory.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/DbgModelInJvmDebuggerModelFactory.java deleted file mode 100644 index 08778e90eb..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/DbgModelInJvmDebuggerModelFactory.java +++ /dev/null @@ -1,93 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel; - -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.CompletableFuture; - -import agent.dbgmodel.model.impl.DbgModel2Impl; -import ghidra.dbg.DebuggerModelFactory; -import ghidra.dbg.DebuggerObjectModel; -import ghidra.dbg.util.ConfigurableFactory.FactoryDescription; -import ghidra.program.model.listing.Program; - -@FactoryDescription( - brief = "MS dbgmodel.dll (WinDbg Preview)", - htmlDetails = """ - Connect to the Microsoft Debug Model. - This is the same engine that powers WinDbg 2. - This will access the native API, which may put Ghidra's JVM at risk.""") -public class DbgModelInJvmDebuggerModelFactory implements DebuggerModelFactory { - - protected String remote = "none"; // Require user to start server - @FactoryOption("DebugConnect options (.server)") - public final Property agentRemoteOption = - Property.fromAccessors(String.class, this::getAgentRemote, this::setAgentRemote); - - protected String transport = "none"; // Require user to start server - @FactoryOption("Remote process server options (untested)") - public final Property agentTransportOption = - Property.fromAccessors(String.class, this::getAgentTransport, this::setAgentTransport); - - @Override - public CompletableFuture build() { - DbgModel2Impl model = new DbgModel2Impl(); - List cmds = new ArrayList<>(); - completeCommandLine(cmds); - return model.startDbgEng(cmds.toArray(new String[cmds.size()])).thenApply(__ -> model); - } - - @Override - public int getPriority(Program program) { - // TODO: Might instead look for the DLL - if (!System.getProperty("os.name").toLowerCase().contains("windows")) { - return -1; - } - if (program != null) { - String exe = program.getExecutablePath(); - if (exe == null || exe.isBlank()) { - return -1; - } - } - return 70; - } - - public String getAgentTransport() { - return transport; - } - - public void setAgentTransport(String transport) { - this.transport = transport; - } - - public String getAgentRemote() { - return remote; - } - - public void setAgentRemote(String remote) { - this.remote = remote; - } - - protected void completeCommandLine(List cmd) { - if (!remote.equals("none") && !remote.equals("")) { - cmd.addAll(List.of(remote)); - } - if (!transport.equals("none") && !transport.equals("")) { - cmd.addAll(List.of(transport)); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/COMUtilsExtra.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/COMUtilsExtra.java deleted file mode 100644 index 30cb27a1c6..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/COMUtilsExtra.java +++ /dev/null @@ -1,72 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel; - -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.platform.win32.COM.COMException; -import com.sun.jna.platform.win32.COM.COMUtils; - -/** - * Utilities for interacting with Microsoft COM objects beyond those provided by {@link COMUtils}. - * - * See the MSDN for details on the meanings of the return codes for the function or method of - * interest. - */ -public interface COMUtilsExtra { - - public static HRESULT E_UNEXPECTED = new HRESULT(0x8000FFFF); - public static HRESULT E_BOUNDS = new HRESULT(0x8000000B); - public static HRESULT E_NOTIMPLEMENTED = new HRESULT(0x80004001); - public static HRESULT E_NOINTERFACE = new HRESULT(0x80004002); - public static HRESULT E_COM_EXC = new HRESULT(0x80004003); - public static HRESULT E_FAIL = new HRESULT(0x80004005); - public static HRESULT E_CANTCALLOUT_INASYNCCALL = new HRESULT(0x80010004); - public static HRESULT E_INTERNALEXCEPTION = new HRESULT(0x80040205); - public static HRESULT E_ACCESS_DENIED = new HRESULT(0x80070005); - public static HRESULT E_CANNOT_READ = new HRESULT(0x8007001E); - public static HRESULT E_INVALID_PARAM = new HRESULT(0x80070057); - public static HRESULT E_SCOPE_NOT_FOUND = new HRESULT(0x8007013E); - - /** - * Check if the given exception represents an {@code E_NOINTERFACE} result - * - * @param e the exception - * @return true if {@code E_NOINTERFACE} - */ - static boolean isE_NOINTERFACE(COMException e) { - return e.getMessage().contains("HRESULT: 80004002"); - } - - /** - * Check if the given exception represents an {@code E_UNEXPECTED} result - * - * @param e the exception - * @return true if {@code E_UNEXPECTED} - */ - static boolean isE_UNEXPECTED(COMException e) { - return e.getMessage().contains("HRESULT: 8000ffff"); - } - - /** - * Check if the given exception represents an {@code E_INTERNALEXCEPTION} result - * - * @param e the exception - * @return true if {@code E_INTERNALEXCEPTION} - */ - static boolean isE_INTERNALEXCEPTION(COMException e) { - return e.getMessage().contains("HRESULT: 80040205"); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/DbgModel.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/DbgModel.java deleted file mode 100644 index bbe98e01bf..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/DbgModel.java +++ /dev/null @@ -1,196 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel; - -import java.lang.ref.Cleaner; - -import com.sun.jna.WString; -import com.sun.jna.platform.win32.Kernel32Util; -import com.sun.jna.platform.win32.WinDef.DWORD; -import com.sun.jna.platform.win32.WinNT.HANDLE; -import com.sun.jna.platform.win32.COM.IUnknown; - -import agent.dbgeng.impl.dbgeng.client.DebugClientImpl1; -import agent.dbgeng.impl.dbgeng.client.DebugClientInternal; -import agent.dbgeng.jna.dbgeng.DbgEngNative; -import agent.dbgeng.jna.dbgeng.client.IDebugClient; -import agent.dbgmodel.dbgmodel.bridge.HostDataModelAccess; -import agent.dbgmodel.impl.dbgmodel.bridge.HostDataModelAccessInternal; -import ghidra.comm.util.BitmaskSet; - -/** - * A wrapper for Microsoft's {@code dbgeng.dll} that presents a Java-friendly interface. - * - * This is the "root interface" from which all other interfaces to {@code dbgeng.dll} are generated. - * Not every method listed in the documentation, nor every method present in the header, is - * implemented. Only those that were necessary to implement the SCTL adapter. However, the class and - * interface hierarchy was designed so that adding the remaining methods should be fairly - * straightforward. This wrapper attempts to obtain the most capable COM interfaces for the debug - * client that it knows. Again, newer interfaces should be fairly straightforward to add. - * - * Methods that are "obviously" wrappers for a COM method are left undocumented, unless there is - * some nuance to how it has been wrapped. In many cases, a parameter which is an integer in the COM - * method may be presented as an {@code enum} or {@link BitmaskSet} by the wrapper. Consult the MSDN - * for the meaning of the various values and bit flags. - * - * Each wrapper interface is implemented by several COM interface wrappers: one for each known COM - * interface version. The wrapper is optimistic, in that it declares wrapper methods even for COM - * methods that are only available in later versions. The implementations limited to earlier COM - * interfaces should either emulate the operation, or throw an - * {@link UnsupportedOperationException}. Where a newer method is provided by a newer interface, a - * wrapper implementation should prefer the latest. For example, one series of interfaces introduces - * {@code *Wide} variants of existing methods. Since Java also uses a UTF-16-like string encoding - * internally, JNA permits wide strings to be passed by reference. Thus, the wide variant is always - * preferred. - * - * Pay careful attention to the threading requirements imposed by {@code dbgeng.dll} these can be - * found in the MSDN. As a general rule of thumb, if the method is reentrant (i.e., it can be called - * from any thread), it is declared in the {@code *Reentrant} variant of the wrapper interface. - * There are few of these. Unless the documentation explicitly lists the method as reentrant, do not - * declare it there. Many methods appear to execute successfully from the wrong thread, but cause - * latent issues. A practice to prevent accidental use of non-reentrant methods outside of the - * client's owning thread is to ensure that only the owning thread can see the full interface. All - * other threads should only have access to the reentrant interface. - * - * If you implement methods that introduce a new callback class, use the existing callback type - * hierarchies as a model. There are many classes to implement. Furthermore, be sure to keep a - * reference to any active callback instances within the wrapper that uses them. The JNA has no way - * of knowing whether or not the instance is still being used by the external C/C++ library. If you - * do not store a reference, the JVM will think it's garbage and free it, even though COM is still - * using it. Drop the reference only when you are certain nothing external has a reference to it. - */ -public class DbgModel { - private static final Cleaner CLEANER = Cleaner.create(); - - private static class ReleaseCOMObject implements Runnable { - private final IUnknown obj; - - ReleaseCOMObject(IUnknown obj) { - this.obj = obj; - } - - @Override - public void run() { - //Msg.debug(this, "Releasing COM object: " + obj); - try { - obj.Release(); - } - catch (Exception e) { - e.printStackTrace(); - } - } - } - - private static class ReleaseHANDLE implements Runnable { - private final HANDLE handle; - - public ReleaseHANDLE(HANDLE handle) { - this.handle = handle; - } - - @Override - public void run() { - Kernel32Util.closeHandle(handle); - } - } - - public static class OpaqueCleanable { - @SuppressWarnings("unused") // A reference to control GC - private final Object state; - @SuppressWarnings("unused") // A reference to control GC - private final Cleaner.Cleanable cleanable; - - public OpaqueCleanable(Object state, Cleaner.Cleanable cleanable) { - this.state = state; - this.cleanable = cleanable; - } - } - - public static OpaqueCleanable releaseWhenPhantom(Object owner, IUnknown obj) { - ReleaseCOMObject state = new ReleaseCOMObject(obj); - return new OpaqueCleanable(state, CLEANER.register(owner, state)); - } - - public static OpaqueCleanable releaseWhenPhantom(Object owner, HANDLE handle) { - ReleaseHANDLE state = new ReleaseHANDLE(handle); - return new OpaqueCleanable(state, CLEANER.register(owner, state)); - } - - private static HostDataModelAccess wrapClient(DebugClientInternal debugClient) { - DebugClientImpl1 impl = (DebugClientImpl1) debugClient; - IDebugClient jnaClient = impl.getJNAClient(); - HostDataModelAccess hostDataModelAccess = - HostDataModelAccessInternal.tryPreferredInterfaces(jnaClient::QueryInterface); - hostDataModelAccess.setClient(debugClient); - hostDataModelAccess.getDataModel(); - return hostDataModelAccess; - } - - /** - * Connect to a debug session. - * - * See {@code DebugConnect} or {@code DebugConnectWide} on the MSDN. - * - * @param remoteOptions the options, like those given to {@code -remote} - * @return a new client connected as specified - */ - public static HostDataModelAccess debugConnect(String remoteOptions) { - addSearchPaths(); - // so this will not work - WString options = new WString(remoteOptions); - return wrapClient(DebugClientInternal.tryPreferredInterfaces((refiid, - ppClient) -> DbgEngNative.INSTANCE.DebugConnectWide(options, refiid, ppClient))); - } - - /** - * Create a debug client. - * - * Typically, this client is connected to the "local server". See {@code DebugCreate} on the - * MSDN. - * - * @return a new client - */ - - public static HostDataModelAccess debugCreate() { - addSearchPaths(); - return wrapClient( - DebugClientInternal.tryPreferredInterfaces(DbgEngNative.INSTANCE::DebugCreate)); - } - - /** - * Create a debug client with the given options. - * - * See {@code DebugCreateEx} on the MSDN. - * - * @param options the options - * @return a new client - */ - public static HostDataModelAccess debugCreate(int options) { - addSearchPaths(); - DWORD dwOpts = new DWORD(options); - return wrapClient(DebugClientInternal.tryPreferredInterfaces( - (refiid, ppClient) -> DbgEngNative.INSTANCE.DebugCreateEx(refiid, dwOpts, ppClient))); - } - - private static void addSearchPaths() { - /* - NativeLibrary.addSearchPath("dbghelp.dll", "C:\\Software\\windbg\\amd64"); - NativeLibrary.addSearchPath("dbgeng.dll", "C:\\Software\\windbg\\amd64"); - NativeLibrary.addSearchPath("dbgmodel.dll", "C:\\Software\\windbg\\amd64"); - */ - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/UnknownEx.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/UnknownEx.java deleted file mode 100644 index 9576a94ebe..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/UnknownEx.java +++ /dev/null @@ -1,24 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel; - -import com.sun.jna.Pointer; - -public interface UnknownEx { - - Pointer getPointer(); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/bridge/HostDataModelAccess.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/bridge/HostDataModelAccess.java deleted file mode 100644 index bb83ab26c3..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/bridge/HostDataModelAccess.java +++ /dev/null @@ -1,38 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.bridge; - -import agent.dbgeng.dbgeng.DebugClient; -import agent.dbgmodel.dbgmodel.UnknownEx; -import agent.dbgmodel.dbgmodel.datamodel.DataModelManager1; -import agent.dbgmodel.dbgmodel.debughost.DebugHost; - -/** - * A wrapper for {@code IHostDataModelAccess} and its newer variants. - */ -public interface HostDataModelAccess extends UnknownEx { - - void getDataModel(); - - DebugClient getClient(); - - void setClient(DebugClient debugClient); - - DataModelManager1 getManager(); - - DebugHost getHost(); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/concept/ComparableConcept.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/concept/ComparableConcept.java deleted file mode 100644 index 70f327b099..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/concept/ComparableConcept.java +++ /dev/null @@ -1,26 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.concept; - -import agent.dbgmodel.dbgmodel.main.ModelObject; - -/** - * A wrapper for {@code IComparableConcept} and its newer variants. - */ -public interface ComparableConcept extends Concept { - - int compareObjects(ModelObject contextObject, ModelObject otherObject); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/concept/Concept.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/concept/Concept.java deleted file mode 100644 index cf818df3aa..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/concept/Concept.java +++ /dev/null @@ -1,27 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.concept; - -import agent.dbgmodel.dbgmodel.UnknownEx; -import agent.dbgmodel.dbgmodel.main.KeyStore; - -public interface Concept extends UnknownEx { - - KeyStore getMetadata(); - - void setMetadata(KeyStore mdata); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/concept/DataModelConcept.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/concept/DataModelConcept.java deleted file mode 100644 index 794829f7e6..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/concept/DataModelConcept.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.concept; - -import agent.dbgmodel.dbgmodel.debughost.DebugHostSymbolEnumerator; -import agent.dbgmodel.dbgmodel.debughost.DebugHostTypeSignature; -import agent.dbgmodel.dbgmodel.main.ModelObject; - -/** - * A wrapper for {@code IDataModelConcept} and its newer variants. - */ -public interface DataModelConcept extends Concept { - - void initializeObject(ModelObject modelObject, DebugHostTypeSignature matchingTypeSignature, - DebugHostSymbolEnumerator wildcardMatches); - - String getName(); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/concept/DynamicConceptProviderConcept.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/concept/DynamicConceptProviderConcept.java deleted file mode 100644 index 01ad73888f..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/concept/DynamicConceptProviderConcept.java +++ /dev/null @@ -1,40 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.concept; - -import com.sun.jna.platform.win32.Guid.REFIID; - -import agent.dbgmodel.dbgmodel.UnknownEx; -import agent.dbgmodel.dbgmodel.main.KeyStore; -import agent.dbgmodel.dbgmodel.main.ModelObject; - -/** - * A wrapper for {@code IDynamicConceptProviderConcept} and its newer variants. - */ -public interface DynamicConceptProviderConcept extends Concept { - - boolean getConcept(ModelObject contextObject, REFIID conceptId); - - void setConcept(ModelObject contextObject, REFIID conceptId, UnknownEx conceptInterface, - KeyStore conceptMetadata); - - void notifyParent(ModelObject parentModel); - - void notifyParentChange(ModelObject parentModel); - - void notifyDestruct(); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/concept/DynamicKeyProviderConcept.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/concept/DynamicKeyProviderConcept.java deleted file mode 100644 index 3a4f5cb632..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/concept/DynamicKeyProviderConcept.java +++ /dev/null @@ -1,32 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.concept; - -import com.sun.jna.WString; - -import agent.dbgmodel.dbgmodel.main.*; - -/** - * A wrapper for {@code IDynamicKeyProviderConcept} and its newer variants. - */ -public interface DynamicKeyProviderConcept extends Concept { - - boolean getKey(ModelObject contextObject, WString key); - - void setKey(ModelObject contextObject, WString key, ModelObject keyValue, KeyStore metadata); - - KeyEnumerator EnumerateKeys(ModelObject contextObject); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/concept/EquatableConcept.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/concept/EquatableConcept.java deleted file mode 100644 index 5a19819c83..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/concept/EquatableConcept.java +++ /dev/null @@ -1,27 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.concept; - -import agent.dbgmodel.dbgmodel.main.ModelObject; - -/** - * A wrapper for {@code IEquatableConcept} and its newer variants. - */ -public interface EquatableConcept extends Concept { - - boolean areObjectsEqual(ModelObject contextObject, ModelObject otherObject); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/concept/IndexableConcept.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/concept/IndexableConcept.java deleted file mode 100644 index 7a9e905940..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/concept/IndexableConcept.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.concept; - -import com.sun.jna.Pointer; - -import agent.dbgmodel.dbgmodel.main.ModelObject; - -/** - * A wrapper for {@code IIndexableConcept} and its newer variants. - */ -public interface IndexableConcept extends Concept { - - long getDimensionality(ModelObject contextObject); - - ModelObject getAt(ModelObject contextObject, long indexerCount, Pointer[] indexers); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/concept/IterableConcept.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/concept/IterableConcept.java deleted file mode 100644 index 0027c35977..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/concept/IterableConcept.java +++ /dev/null @@ -1,30 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.concept; - -import agent.dbgmodel.dbgmodel.main.ModelIterator; -import agent.dbgmodel.dbgmodel.main.ModelObject; - -/** - * A wrapper for {@code IIterableConcept} and its newer variants. - */ -public interface IterableConcept extends Concept { - - long getDefaultIndexDimensionality(ModelObject contextObject); - - ModelIterator getIterator(ModelObject contextObject); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/concept/PreferredRuntimeTypeConcept.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/concept/PreferredRuntimeTypeConcept.java deleted file mode 100644 index 1df35f1c94..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/concept/PreferredRuntimeTypeConcept.java +++ /dev/null @@ -1,26 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.concept; - -import agent.dbgmodel.dbgmodel.main.ModelObject; - -/** - * A wrapper for {@code IPreferredRuntimeTypeConcept} and its newer variants. - */ -public interface PreferredRuntimeTypeConcept extends Concept { - - ModelObject CastToPreferredRuntimeType(ModelObject contextObject); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/concept/StringDisplayableConcept.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/concept/StringDisplayableConcept.java deleted file mode 100644 index d7f958ca7f..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/concept/StringDisplayableConcept.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.concept; - -import agent.dbgmodel.dbgmodel.main.KeyStore; -import agent.dbgmodel.dbgmodel.main.ModelObject; - -/** - * A wrapper for {@code IStringDisplayableConcept} and its newer variants. - */ -public interface StringDisplayableConcept extends Concept { - - String toDisplayString(ModelObject contextObject, KeyStore metadata); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/DataModelManager1.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/DataModelManager1.java deleted file mode 100644 index c7a942ee9b..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/DataModelManager1.java +++ /dev/null @@ -1,84 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.datamodel; - -import com.sun.jna.WString; -import com.sun.jna.platform.win32.Variant.VARIANT.ByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.dbgmodel.UnknownEx; -import agent.dbgmodel.dbgmodel.concept.DataModelConcept; -import agent.dbgmodel.dbgmodel.datamodel.script.DataModelScriptManager; -import agent.dbgmodel.dbgmodel.debughost.*; -import agent.dbgmodel.dbgmodel.main.KeyStore; -import agent.dbgmodel.dbgmodel.main.ModelObject; -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.LOCATION; -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.ModelObjectKind; - -/** - * A wrapper for {@code IDataModelManager1} and its newer variants. - */ -public interface DataModelManager1 extends UnknownEx { - - void close(); - - ModelObject createNoValue(); - - ModelObject createErrorObject(HRESULT hrError, WString pwszMessage); - - ModelObject createTypedObject(DebugHostContext context, LOCATION objectLocation, - DebugHostType1 objectType); - - ModelObject createTypedObjectReference(DebugHostContext context, LOCATION objectLocation, - DebugHostType1 objectType); - - ModelObject createSyntheticObject(DebugHostContext context); - - ModelObject createDataModelObject(DataModelConcept dataModel); - - ModelObject createIntrinsicObject(ModelObjectKind objectKind, ByReference intrinsicData); - - ModelObject createTypedIntrinsicObject(ByReference intrinsicData, DebugHostType1 type); - - ModelObject getModelForTypeSignature(DebugHostTypeSignature typeSignature); - - ModelObject getModelForType(DebugHostType1 type); - - void registerModelForTypeSignature(DebugHostTypeSignature typeSignature, - ModelObject dataModel); - - void unregisterModelForTypeSignature(ModelObject dataModel, - DebugHostTypeSignature typeSignature); - - void registerExtensionForTypeSignature(DebugHostTypeSignature typeSignature, - ModelObject dataModel); - - void unregisterExtensionForTypeSignature(ModelObject dataModel, - DebugHostTypeSignature typeSignature); - - KeyStore createMetadataStore(KeyStore parentStore); - - ModelObject getRootNamespace(); - - void registerNamedModel(WString modelName, ModelObject modelObject); - - void unregisterNamedModel(WString modelName); - - ModelObject acquireNamedModel(WString modelName); - - DataModelScriptManager asScriptManager(); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/DataModelManager2.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/DataModelManager2.java deleted file mode 100644 index 8042a8360b..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/DataModelManager2.java +++ /dev/null @@ -1,36 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.datamodel; - -import com.sun.jna.WString; -import com.sun.jna.platform.win32.Variant.VARIANT.ByReference; - -import agent.dbgmodel.dbgmodel.debughost.DebugHostContext; -import agent.dbgmodel.dbgmodel.debughost.DebugHostType1; -import agent.dbgmodel.dbgmodel.main.KeyStore; -import agent.dbgmodel.dbgmodel.main.ModelObject; - -/** - * A wrapper for {@code IDataModelManager2} and its newer variants. - */ -public interface DataModelManager2 extends DataModelManager1 { - - ModelObject acquireSubNamespace(WString modelName, WString subNamespaceModelName, - WString accessName, KeyStore metadata); - - ModelObject createTypedIntrinsicObjectEx(DebugHostContext context, ByReference intrinsicData, - DebugHostType1 type); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/DataModelNameBinder.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/DataModelNameBinder.java deleted file mode 100644 index d5f9f7d39f..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/DataModelNameBinder.java +++ /dev/null @@ -1,36 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.datamodel.script; - -import com.sun.jna.WString; - -import agent.dbgmodel.dbgmodel.UnknownEx; -import agent.dbgmodel.dbgmodel.main.KeyEnumerator; -import agent.dbgmodel.dbgmodel.main.ModelObject; - -/** - * A wrapper for {@code IDataModelNameBinder} and its newer variants. - */ -public interface DataModelNameBinder extends UnknownEx { - - void bindValue(ModelObject contextObject, WString name); - - void bindReference(ModelObject contextObject, WString name); - - KeyEnumerator enumerateValues(ModelObject contextObject); - - KeyEnumerator enumerateReferences(ModelObject contextObject); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/DataModelScript.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/DataModelScript.java deleted file mode 100644 index 391b0f1305..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/DataModelScript.java +++ /dev/null @@ -1,42 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.datamodel.script; - -import com.sun.jna.Pointer; -import com.sun.jna.WString; - -import agent.dbgmodel.dbgmodel.UnknownEx; - -/** - * A wrapper for {@code IDataModelScript} and its newer variants. - */ -public interface DataModelScript extends UnknownEx { - - String getName(); - - void rename(WString scriptName); - - void populate(Pointer contentStream); - - void execute(DataModelScriptClient client); - - void unlink(); - - boolean isInvocable(); - - void invokeMain(DataModelScriptClient client); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/DataModelScriptClient.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/DataModelScriptClient.java deleted file mode 100644 index 1abbb87bc9..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/DataModelScriptClient.java +++ /dev/null @@ -1,29 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.datamodel.script; - -import com.sun.jna.WString; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.dbgmodel.UnknownEx; - -/** - * A wrapper for {@code IDataModelScriptClient} and its newer variants. - */ -public interface DataModelScriptClient extends UnknownEx { - - void reportError(int errorClass, HRESULT hrFail, WString message, int line, int position); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/DataModelScriptHostContext.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/DataModelScriptHostContext.java deleted file mode 100644 index 991b868940..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/DataModelScriptHostContext.java +++ /dev/null @@ -1,29 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.datamodel.script; - -import agent.dbgmodel.dbgmodel.UnknownEx; -import agent.dbgmodel.dbgmodel.main.ModelObject; - -/** - * A wrapper for {@code IDataModelScriptHostContext} and its newer variants. - */ -public interface DataModelScriptHostContext extends UnknownEx { - - void notifyScriptChange(DataModelScript script, int changeKind); - - ModelObject getNamespaceObject(); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/DataModelScriptManager.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/DataModelScriptManager.java deleted file mode 100644 index 540d5cd911..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/DataModelScriptManager.java +++ /dev/null @@ -1,37 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.datamodel.script; - -import agent.dbgmodel.dbgmodel.UnknownEx; - -/** - * A wrapper for {@code IDataModelScriptManager} and its newer variants. - */ -public interface DataModelScriptManager extends UnknownEx { - - DataModelNameBinder getDefaultNameBinder(); - - void registerScriptProvider(DataModelScriptProvider provider); - - void unregisterScriptProvider(DataModelScriptProvider provider); - - DataModelScriptProvider findProviderForScriptType(String scriptType); - - DataModelScriptProvider findProviderForScriptExtension(String scriptExtension); - - DataModelScriptProviderEnumerator enumeratorScriptProviders(); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/DataModelScriptProvider.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/DataModelScriptProvider.java deleted file mode 100644 index 115a69f3f9..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/DataModelScriptProvider.java +++ /dev/null @@ -1,34 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.datamodel.script; - -import agent.dbgmodel.dbgmodel.UnknownEx; - -/** - * A wrapper for {@code IDataModelScriptProvider} and its newer variants. - */ -public interface DataModelScriptProvider extends UnknownEx { - - String getName(); - - String getExtension(); - - DataModelScriptTemplate createScript(); - - DataModelScriptTemplate getDefaultTemplateContent(); - - DataModelScriptTemplateEnumerator enumerateTemplates(); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/DataModelScriptProviderEnumerator.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/DataModelScriptProviderEnumerator.java deleted file mode 100644 index b215f7e31a..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/DataModelScriptProviderEnumerator.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.datamodel.script; - -import agent.dbgmodel.dbgmodel.UnknownEx; - -/** - * A wrapper for {@code IDataModelScriptProviderEnumerator} and its newer variants. - */ -public interface DataModelScriptProviderEnumerator extends UnknownEx { - - void reset(); - - DataModelScriptProvider getNext(); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/DataModelScriptTemplate.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/DataModelScriptTemplate.java deleted file mode 100644 index 47a8ae7dcd..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/DataModelScriptTemplate.java +++ /dev/null @@ -1,30 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.datamodel.script; - -import agent.dbgmodel.dbgmodel.UnknownEx; - -/** - * A wrapper for {@code IDataModelScriptTemplate} and its newer variants. - */ -public interface DataModelScriptTemplate extends UnknownEx { - - String getName(); - - String getDescription(); - - UnknownEx getContent(); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/DataModelScriptTemplateEnumerator.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/DataModelScriptTemplateEnumerator.java deleted file mode 100644 index 8ae7867de2..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/DataModelScriptTemplateEnumerator.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.datamodel.script; - -import agent.dbgmodel.dbgmodel.UnknownEx; - -/** - * A wrapper for {@code IDataModelScriptTemplateEnumerator} and its newer variants. - */ -public interface DataModelScriptTemplateEnumerator extends UnknownEx { - - void reset(); - - DataModelScriptTemplate getNext(); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/debug/DataModelScriptDebug1.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/debug/DataModelScriptDebug1.java deleted file mode 100644 index bef2908499..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/debug/DataModelScriptDebug1.java +++ /dev/null @@ -1,24 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.datamodel.script.debug; - -import agent.dbgmodel.dbgmodel.UnknownEx; - -/** - * A wrapper for {@code IDataModelScriptDebug1} and its newer variants. - */ -public interface DataModelScriptDebug1 extends UnknownEx { -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/debug/DataModelScriptDebug2.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/debug/DataModelScriptDebug2.java deleted file mode 100644 index 6232ce058b..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/debug/DataModelScriptDebug2.java +++ /dev/null @@ -1,22 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.datamodel.script.debug; - -/** - * A wrapper for {@code IDataModelScriptDebug2} and its newer variants. - */ -public interface DataModelScriptDebug2 extends DataModelScriptDebug1 { -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/debug/DataModelScriptDebugBreakpoint.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/debug/DataModelScriptDebugBreakpoint.java deleted file mode 100644 index 640bb07f10..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/debug/DataModelScriptDebugBreakpoint.java +++ /dev/null @@ -1,24 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.datamodel.script.debug; - -import agent.dbgmodel.dbgmodel.UnknownEx; - -/** - * A wrapper for {@code IDataModelScriptDebugBreakpoint} and its newer variants. - */ -public interface DataModelScriptDebugBreakpoint extends UnknownEx { -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/debug/DataModelScriptDebugBreakpointEnumerator.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/debug/DataModelScriptDebugBreakpointEnumerator.java deleted file mode 100644 index 4b5d191643..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/debug/DataModelScriptDebugBreakpointEnumerator.java +++ /dev/null @@ -1,24 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.datamodel.script.debug; - -import agent.dbgmodel.dbgmodel.UnknownEx; - -/** - * A wrapper for {@code IDataModelScriptDebugBreakpointEnumerator} and its newer variants. - */ -public interface DataModelScriptDebugBreakpointEnumerator extends UnknownEx { -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/debug/DataModelScriptDebugClient.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/debug/DataModelScriptDebugClient.java deleted file mode 100644 index 45cc4fa09f..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/debug/DataModelScriptDebugClient.java +++ /dev/null @@ -1,24 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.datamodel.script.debug; - -import agent.dbgmodel.dbgmodel.UnknownEx; - -/** - * A wrapper for {@code IDataModelScriptDebugClient} and its newer variants. - */ -public interface DataModelScriptDebugClient extends UnknownEx { -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/debug/DataModelScriptDebugStack.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/debug/DataModelScriptDebugStack.java deleted file mode 100644 index 63dbaf18b3..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/debug/DataModelScriptDebugStack.java +++ /dev/null @@ -1,24 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.datamodel.script.debug; - -import agent.dbgmodel.dbgmodel.UnknownEx; - -/** - * A wrapper for {@code IDataModelScriptDebugStack} and its newer variants. - */ -public interface DataModelScriptDebugStack extends UnknownEx { -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/debug/DataModelScriptDebugStackFrame.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/debug/DataModelScriptDebugStackFrame.java deleted file mode 100644 index 7ef75a02e8..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/debug/DataModelScriptDebugStackFrame.java +++ /dev/null @@ -1,24 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.datamodel.script.debug; - -import agent.dbgmodel.dbgmodel.UnknownEx; - -/** - * A wrapper for {@code IDataModelScriptDebugStackFrame} and its newer variants. - */ -public interface DataModelScriptDebugStackFrame extends UnknownEx { -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/debug/DataModelScriptDebugVariableSetEnumerator.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/debug/DataModelScriptDebugVariableSetEnumerator.java deleted file mode 100644 index d7996519f7..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/datamodel/script/debug/DataModelScriptDebugVariableSetEnumerator.java +++ /dev/null @@ -1,24 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.datamodel.script.debug; - -import agent.dbgmodel.dbgmodel.UnknownEx; - -/** - * A wrapper for {@code IDataModelScriptDebugVariableSetEnumerator} and its newer variants. - */ -public interface DataModelScriptDebugVariableSetEnumerator extends UnknownEx { -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHost.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHost.java deleted file mode 100644 index 86065c4046..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHost.java +++ /dev/null @@ -1,40 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.debughost; - -import agent.dbgmodel.dbgmodel.UnknownEx; -import agent.dbgmodel.dbgmodel.main.KeyStore; - -/** - * A wrapper for {@code IDebugHost} and its newer variants. - */ -public interface DebugHost extends UnknownEx { - - UnknownEx getHostDefinedInterface(); - - DebugHostContext getCurrentContext(); - - KeyStore getDefaultMetadata(); - - DebugHostSymbols asSymbols(); - - DebugHostMemory1 asMemory(); - - DebugHostScriptHost asScriptHost(); - - DebugHostEvaluator2 asEvaluator(); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostBase.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostBase.java deleted file mode 100644 index 2ce27e1dac..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostBase.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.debughost; - -import com.sun.jna.WString; - -import agent.dbgmodel.dbgmodel.UnknownEx; -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.SymbolKind; -import agent.dbgmodel.jna.dbgmodel.debughost.IDebugHostBaseClass; - -/** - * A wrapper for {@code IDebugHostBase} and its newer variants. - */ -public interface DebugHostBase extends UnknownEx { - - DebugHostContext getContext(); - - DebugHostSymbolEnumerator enumerateChildren(SymbolKind symbolModule, WString Name); - - SymbolKind getSymbolKind(); - - String getName(); - - DebugHostType1 getType(); - - DebugHostModule1 getContainingModule(); - - long getOffset(); - - IDebugHostBaseClass getJnaData(); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostBaseClass.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostBaseClass.java deleted file mode 100644 index 47eda0aa26..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostBaseClass.java +++ /dev/null @@ -1,24 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.debughost; - -/** - * A wrapper for {@code IDebugHostBaseClass} and its newer variants. - */ -public interface DebugHostBaseClass extends DebugHostBase { - - long getOffset(); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostConstant.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostConstant.java deleted file mode 100644 index 66907f99bd..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostConstant.java +++ /dev/null @@ -1,26 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.debughost; - -import com.sun.jna.platform.win32.Variant.VARIANT; - -/** - * A wrapper for {@code IDebugHostConstant} and its newer variants. - */ -public interface DebugHostConstant extends DebugHostBase { - - VARIANT getValue(); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostContext.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostContext.java deleted file mode 100644 index e6057ad30c..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostContext.java +++ /dev/null @@ -1,26 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.debughost; - -import agent.dbgmodel.dbgmodel.UnknownEx; - -/** - * A wrapper for {@code IDebugHostContext} and its newer variants. - */ -public interface DebugHostContext extends UnknownEx { - - boolean isEqualTo(DebugHostContext context); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostData.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostData.java deleted file mode 100644 index f89dd7775b..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostData.java +++ /dev/null @@ -1,32 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.debughost; - -import com.sun.jna.platform.win32.Variant.VARIANT; - -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.LOCATION; - -/** - * A wrapper for {@code IDebugHostData} and its newer variants. - */ -public interface DebugHostData extends DebugHostBase { - - int getLocationKind(); - - LOCATION getLocation(); - - VARIANT getValue(); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostErrorSink.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostErrorSink.java deleted file mode 100644 index 920100f821..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostErrorSink.java +++ /dev/null @@ -1,29 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.debughost; - -import com.sun.jna.WString; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.dbgmodel.UnknownEx; - -/** - * A wrapper for {@code IDebugHostErrorSink} and its newer variants. - */ -public interface DebugHostErrorSink extends UnknownEx { - - void reportError(int errorClass, HRESULT hrError, WString message); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostEvaluator1.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostEvaluator1.java deleted file mode 100644 index 5c2de9d02d..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostEvaluator1.java +++ /dev/null @@ -1,34 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.debughost; - -import com.sun.jna.WString; - -import agent.dbgmodel.dbgmodel.UnknownEx; -import agent.dbgmodel.dbgmodel.main.ModelObject; - -/** - * A wrapper for {@code IDebugHostEvaluator1} and its newer variants. - */ -public interface DebugHostEvaluator1 extends UnknownEx { - - ModelObject evaluateExpression(DebugHostContext context, WString expression, - ModelObject bindingContext); - - ModelObject evaluateExtendedExpression(DebugHostContext context, WString expression, - ModelObject bindingContext); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostEvaluator2.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostEvaluator2.java deleted file mode 100644 index e6121bde0f..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostEvaluator2.java +++ /dev/null @@ -1,26 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.debughost; - -import agent.dbgmodel.dbgmodel.main.ModelObject; - -/** - * A wrapper for {@code IDebugHostEvaluator2} and its newer variants. - */ -public interface DebugHostEvaluator2 extends DebugHostEvaluator1 { - - ModelObject assignTo(ModelObject assignmentReference, ModelObject assignmentValue); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostExtensability.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostExtensability.java deleted file mode 100644 index 20189375f5..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostExtensability.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.debughost; - -import com.sun.jna.WString; - -import agent.dbgmodel.dbgmodel.UnknownEx; -import agent.dbgmodel.dbgmodel.main.ModelObject; - -/** - * A wrapper for {@code IDebugHostExtensability} and its newer variants. - */ -public interface DebugHostExtensability extends UnknownEx { - - void createFunctionAlias(WString aliasName, ModelObject functionObject); - - void destroyFunctionAlias(WString aliasName); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostField.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostField.java deleted file mode 100644 index c88eeb5ad5..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostField.java +++ /dev/null @@ -1,34 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.debughost; - -import com.sun.jna.platform.win32.Variant.VARIANT; - -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.LOCATION; - -/** - * A wrapper for {@code IDebugHostField} and its newer variants. - */ -public interface DebugHostField extends DebugHostBase { - - int getLocationKind(); - - long getOffset(); - - LOCATION getLocation(); - - VARIANT getValue(); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostMemory1.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostMemory1.java deleted file mode 100644 index 7cb3fd7eaf..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostMemory1.java +++ /dev/null @@ -1,42 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.debughost; - -import java.nio.ByteBuffer; - -import com.sun.jna.platform.win32.WinDef.ULONGLONGByReference; - -import agent.dbgmodel.dbgmodel.UnknownEx; -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.LOCATION; - -/** - * A wrapper for {@code IDebugHostMemory1} and its newer variants. - */ -public interface DebugHostMemory1 extends UnknownEx { - - long readBytes(DebugHostContext context, LOCATION location, ByteBuffer buffer, long bufferSize); - - long writeBytes(DebugHostContext context, LOCATION location, ByteBuffer buffer, - long bufferSize); - - ULONGLONGByReference readPointers(DebugHostContext context, LOCATION location, long count); - - ULONGLONGByReference writePointers(DebugHostContext context, LOCATION location, long count); - - String GetDisplayStringForLocation(DebugHostContext context, LOCATION location, - boolean verbose); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostMemory2.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostMemory2.java deleted file mode 100644 index a9075567e1..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostMemory2.java +++ /dev/null @@ -1,27 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.debughost; - -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.LOCATION; - -/** - * A wrapper for {@code IDebugHostMemory2} and its newer variants. - */ -public interface DebugHostMemory2 extends DebugHostMemory1 { - - LOCATION linearizeLocation(DebugHostContext context, LOCATION location); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostModule1.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostModule1.java deleted file mode 100644 index 8999140d06..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostModule1.java +++ /dev/null @@ -1,39 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.debughost; - -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.LOCATION; - -/** - * A wrapper for {@code IDebugHostModule1} and its newer variants. - */ -public interface DebugHostModule1 extends DebugHostBase { - - String getImageName(boolean allowPath); - - LOCATION getBaseLocation(); - - void getVersion(); - - DebugHostType1 findTypeByName(String typeName); - - DebugHostSymbol1 findSymbolByRVA(long rva); - - DebugHostSymbol1 findSymbolByName(String symbolName); - - DebugHostSymbol1 asSymbol(); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostModule2.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostModule2.java deleted file mode 100644 index fb770ea907..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostModule2.java +++ /dev/null @@ -1,25 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.debughost; - -/** - * A wrapper for {@code IDebugHostModule} and its newer variants. - */ -public interface DebugHostModule2 extends DebugHostModule1 { - - DebugHostSymbol1 findContainingSymbolByRVA(long rva); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostModuleSignature.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostModuleSignature.java deleted file mode 100644 index a4700ef87c..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostModuleSignature.java +++ /dev/null @@ -1,27 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.debughost; - -import agent.dbgmodel.dbgmodel.UnknownEx; - -/** - * A wrapper for {@code IDebugHostModuleSignature} and its newer variants. - */ -public interface DebugHostModuleSignature extends UnknownEx { - - boolean IsMatch(DebugHostModule1 module); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostPublic.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostPublic.java deleted file mode 100644 index 0962dd47be..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostPublic.java +++ /dev/null @@ -1,30 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.debughost; - -import agent.dbgmodel.dbgmodel.UnknownEx; -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.LOCATION; -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.LocationKind; - -/** - * A wrapper for {@code IDebugHostPublic} and its newer variants. - */ -public interface DebugHostPublic extends UnknownEx { - - LocationKind getLocationKind(); - - LOCATION getLocation(); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostScriptHost.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostScriptHost.java deleted file mode 100644 index 61449ff1ef..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostScriptHost.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.debughost; - -import agent.dbgmodel.dbgmodel.UnknownEx; -import agent.dbgmodel.dbgmodel.datamodel.script.DataModelScript; - -/** - * A wrapper for {@code IDebugHostScriptHost} and its newer variants. - */ -public interface DebugHostScriptHost extends UnknownEx { - - DebugHostContext createContext(DataModelScript script); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostStatus.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostStatus.java deleted file mode 100644 index 6d36ee5dbe..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostStatus.java +++ /dev/null @@ -1,27 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.debughost; - -import agent.dbgmodel.dbgmodel.UnknownEx; - -/** - * A wrapper for {@code IDebugHostStatus} and its newer variants. - */ -public interface DebugHostStatus extends UnknownEx { - - boolean PollUserInterrupt(); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostSymbol1.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostSymbol1.java deleted file mode 100644 index dcc1c86298..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostSymbol1.java +++ /dev/null @@ -1,37 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.debughost; - -/** - * A wrapper for {@code IDebugHostSymbol1} and its newer variants. - */ -public interface DebugHostSymbol1 extends DebugHostBase { - - int compareAgainst(DebugHostSymbol1 comparisonSymbol, long comparisonFlags); - - DebugHostBaseClass asBaseClass(); - - DebugHostConstant asConstant(); - - DebugHostData asData(); - - DebugHostField asField(); - - DebugHostModule1 asModule(); - - DebugHostPublic asPublic(); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostSymbol2.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostSymbol2.java deleted file mode 100644 index f3edbc28b8..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostSymbol2.java +++ /dev/null @@ -1,29 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.debughost; - -import com.sun.jna.Structure.ByReference; -import com.sun.jna.WString; - -/** - * A wrapper for {@code IDebugHostSymbol2} and its newer variants. - */ -public interface DebugHostSymbol2 extends DebugHostSymbol1 { - - DebugHostSymbolEnumerator enumerateChildrenEx(long kind, WString name, ByReference searchInfo); - - int getLanguage(); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostSymbolEnumerator.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostSymbolEnumerator.java deleted file mode 100644 index 5fd7d1f2e7..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostSymbolEnumerator.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.debughost; - -import agent.dbgmodel.dbgmodel.UnknownEx; - -/** - * A wrapper for {@code IDebugHostSymbolEnumerator} and its newer variants. - */ -public interface DebugHostSymbolEnumerator extends UnknownEx { - - void reset(); - - DebugHostSymbol1 getNext(); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostSymbols.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostSymbols.java deleted file mode 100644 index 78e3f54a69..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostSymbols.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.debughost; - -import com.sun.jna.WString; - -import agent.dbgmodel.dbgmodel.UnknownEx; -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.LOCATION; - -/** - * A wrapper for {@code IDebugHostSymbols} and its newer variants. - */ -public interface DebugHostSymbols extends UnknownEx { - - DebugHostModuleSignature createModuleSignature(WString pwszModuleName, WString pwszMinVersion, - WString pwszMaxVersion); - - DebugHostTypeSignature createTypeSignature(WString signatureSpecification, - DebugHostModule1 module); - - DebugHostTypeSignature createTypeSignatureForModuleRange(WString signatureSpecification, - WString pwszModuleName, WString pwszMinVersion, WString pwszMaxVersion); - - DebugHostSymbolEnumerator enumerateModules(DebugHostContext context); - - DebugHostModule1 findModuleByName(DebugHostContext context, String string); - - DebugHostModule1 findModuleByLocation(DebugHostContext context, LOCATION moduleLocation); - - DebugHostType1 getMostDerivedObject(DebugHostContext context, LOCATION location, - DebugHostType1 objectTypeLOCATION); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostType1.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostType1.java deleted file mode 100644 index 0b8217e9f1..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostType1.java +++ /dev/null @@ -1,61 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.debughost; - -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.*; -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.ARRAY_DIMENSION.ByReference; - -/** - * A wrapper for {@code IDebugHostType1} and its newer variants. - */ -public interface DebugHostType1 extends DebugHostBase { - - TypeKind getTypeKind(); - - long getSize(); - - DebugHostType1 getBaseType(); - - int getHashCode(); - - IntrinsicKind getIntrinsicType(); - - void getBitField(); - - PointerKind getPointerKind(); - - DebugHostType1 getMemberType(); - - DebugHostType1 createPointerTo(int kind); - - long getArrayDimensionality(); - - ARRAY_DIMENSION getArrayDimensions(long dimensions); - - DebugHostType1 createArrayOf(long dimensions, ByReference pDimensions); - - int getFunctionCallingConvention(); - - DebugHostType1 getFunctionReturnType(); - - DebugHostType1 getFunctionParameterTypeAt(int i); - - boolean isGeneric(); - - long getGenericArgumentCount(); - - DebugHostSymbol1 getGenericArgumentAt(int i); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostType2.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostType2.java deleted file mode 100644 index 630ab23991..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostType2.java +++ /dev/null @@ -1,33 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.debughost; - -/** - * A wrapper for {@code IDebugHostType2} and its newer variants. - */ -public interface DebugHostType2 extends DebugHostType1 { - - boolean isTypedef(); - - DebugHostType2 getTypedefBaseType(); - - DebugHostType2 getTypedefFinalBaseType(); - - int getFunctionVarArgsKind(); - - DebugHostType2 getFunctionInstancePointerType(); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostTypeSignature.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostTypeSignature.java deleted file mode 100644 index 51475942e0..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/debughost/DebugHostTypeSignature.java +++ /dev/null @@ -1,32 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.debughost; - -import com.sun.jna.Pointer; - -/** - * A wrapper for {@code IDebugHostTypeSignature} and its newer variants. - */ -public interface DebugHostTypeSignature { - - Pointer getPointer(); - - int getHashCode(); - - boolean isMatch(DebugHostType1 type); - - int compareAgainst(DebugHostTypeSignature typeSignature); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/main/KeyEnumerator.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/main/KeyEnumerator.java deleted file mode 100644 index 931689d476..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/main/KeyEnumerator.java +++ /dev/null @@ -1,30 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.main; - -import agent.dbgmodel.dbgmodel.UnknownEx; - -/** - * A wrapper for {@code IKeyEnumerator} and its newer variants. - */ -public interface KeyEnumerator extends UnknownEx { - - void reset(); - - String getNext(); - - ModelObject getValue(); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/main/KeyStore.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/main/KeyStore.java deleted file mode 100644 index e3523edf14..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/main/KeyStore.java +++ /dev/null @@ -1,36 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.main; - -import com.sun.jna.WString; - -import agent.dbgmodel.dbgmodel.UnknownEx; - -/** - * A wrapper for {@code IKeyStore} and its newer variants. - */ -public interface KeyStore extends UnknownEx { - - ModelObject getKey(WString key); - - void setKey(WString key, ModelObject object, KeyStore metadata); - - ModelObject getKeyValue(WString key); - - void setKeyValue(WString key, ModelObject object); - - void clearKeys(); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/main/ModelIterator.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/main/ModelIterator.java deleted file mode 100644 index 62d990bd64..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/main/ModelIterator.java +++ /dev/null @@ -1,30 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.main; - -import agent.dbgmodel.dbgmodel.UnknownEx; - -/** - * A wrapper for {@code IModelIterator} and its newer variants. - */ -public interface ModelIterator extends UnknownEx { - - void reset(); - - ModelObject getNext(long dimensions); - - ModelObject getIndexers(); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/main/ModelKeyReference1.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/main/ModelKeyReference1.java deleted file mode 100644 index 357d97f614..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/main/ModelKeyReference1.java +++ /dev/null @@ -1,38 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.main; - -import agent.dbgmodel.dbgmodel.UnknownEx; - -/** - * A wrapper for {@code IModelKeyReference1} and its newer variants. - */ -public interface ModelKeyReference1 extends UnknownEx { - - String getKeyName(); - - ModelObject getOriginalObject(); - - ModelObject getContextObject(); - - ModelObject getKey(); - - ModelObject getKeyValue(); - - void setKey(ModelObject object, KeyStore metadata); - - void setKeyValue(ModelObject object, KeyStore metadata); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/main/ModelKeyReference2.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/main/ModelKeyReference2.java deleted file mode 100644 index 22d732f21f..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/main/ModelKeyReference2.java +++ /dev/null @@ -1,24 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.main; - -/** - * A wrapper for {@code IModelKeyReference2} and its newer variants. - */ -public interface ModelKeyReference2 extends ModelKeyReference1 { - - void overrideContextObject(ModelObject newContextObject); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/main/ModelMethod.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/main/ModelMethod.java deleted file mode 100644 index d92fe03417..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/main/ModelMethod.java +++ /dev/null @@ -1,29 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.main; - -import com.sun.jna.Pointer; - -import agent.dbgmodel.dbgmodel.UnknownEx; - -/** - * A wrapper for {@code IModelMethod} and its newer variants. - */ -public interface ModelMethod extends UnknownEx { - - ModelObject call(ModelObject contextObject, long argCount, Pointer[] ppArguments); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/main/ModelObject.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/main/ModelObject.java deleted file mode 100644 index 1c860086ce..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/main/ModelObject.java +++ /dev/null @@ -1,147 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.main; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.WString; -import com.sun.jna.platform.win32.Guid.REFIID; -import com.sun.jna.platform.win32.Variant.VARIANT; -import com.sun.jna.platform.win32.WTypes.VARTYPE; - -import agent.dbgmodel.dbgmodel.UnknownEx; -import agent.dbgmodel.dbgmodel.datamodel.DataModelManager1; -import agent.dbgmodel.dbgmodel.debughost.DebugHostContext; -import agent.dbgmodel.dbgmodel.debughost.DebugHostType1; -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.*; -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.main.IModelObject; - -/** - * A wrapper for {@code IModelObject} and its newer variants. - */ -public interface ModelObject extends UnknownEx { - - DebugHostContext getContext(); - - ModelObjectKind getKind(); - - Object getIntrinsicValue(); - - VARIANT getIntrinsicValueAs(VARTYPE vt); - - ModelObject getKeyValue(String key); - - void setKeyValue(WString key, ModelObject object); - - KeyEnumerator enumerateKeyValues(); - - ModelObject getRawValue(int kind, WString name, int searchFlags); - - RawEnumerator enumerateRawValues(int kind, int searchFlags); - - ModelObject dereference(); - - ModelObject tryCastToRuntimeType(); - - UnknownEx getConcept(REFIID conceptId); - - LOCATION getLocation(); - - DebugHostType1 getTypeInfo(); - - DebugHostType1 getTargetInfo(); - - long getNumberOfParentModels(); - - ModelObject getParentModel(int i); - - void addParentModel(ModelObject model, ModelObject contextObject, boolean override); - - void removeParentModel(ModelObject model); - - ModelObject getKey(String key); - - ModelObject getKeyReference(String key); - - void setKey(WString key, ModelObject object, KeyStore conceptMetadata); - - void clearKeys(); - - KeyEnumerator enumerateKeys(); - - KeyEnumerator enumerateKeyReferences(); - - void setConcept(REFIID conceptId, ModelObject conceptInterface, ModelObject conceptMetadata); - - void clearConcepts(); - - ModelObject getRawReference(int kind, WString name, int searchFlags); - - RawEnumerator enumerateRawReferences(int kind, int searchFlags); - - void setContextForDataModel(ModelObject dataModelObject, IUnknownEx context); - - UnknownEx getContextForDataModel(ModelObject dataModelObject); - - boolean compare(ModelObject contextObject, ModelObject other); - - /*******/ - - KeyStore getMetadata(); - - void setMetadata(KeyStore metadata); - - void setContextObject(ModelObject context); - - ModelObject getIndexer(); - - void setIndexer(ModelObject indexer); - - List getElements(); - - ModelObject getElement(String key); - - ModelObject getChild(DataModelManager1 manager, VARIANT v); - - Map getKeyValueMap(); - - ModelObject getKeyValueByEnum(String key); - - Map getRawValueMap(); - - ModelObject getRawValueByEnum(String key); - - Object getValue(); - - String getValueString(); - - IModelObject getJnaData(); - - void switchTo(DataModelManager1 manager, VARIANT v); - - ModelMethod getMethod(String name); - - String getOriginalKey(); - - String getSearchKey(); - - void setSearchKey(String key); - - TypeKind getTypeKind(); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/main/ModelPropertyAccessor.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/main/ModelPropertyAccessor.java deleted file mode 100644 index e8e8f7cd49..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/main/ModelPropertyAccessor.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.main; - -import agent.dbgmodel.dbgmodel.UnknownEx; - -/** - * A wrapper for {@code IModelPropertyAccessor} and its newer variants. - */ -public interface ModelPropertyAccessor extends UnknownEx { - - ModelObject getValue(String key, ModelObject contextObject); - - void setValue(String key, ModelObject contextObject, ModelObject value); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/main/RawEnumerator.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/main/RawEnumerator.java deleted file mode 100644 index ced1836f88..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/dbgmodel/main/RawEnumerator.java +++ /dev/null @@ -1,34 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel.main; - -import agent.dbgmodel.dbgmodel.UnknownEx; -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.ModelObjectKind; - -/** - * A wrapper for {@code IRawEnumerator} and its newer variants. - */ -public interface RawEnumerator extends UnknownEx { - - void reset(); - - String getNext(); - - ModelObjectKind getKind(); - - ModelObject getValue(); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/gadp/DbgModelGadpDebuggerModelFactory.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/gadp/DbgModelGadpDebuggerModelFactory.java deleted file mode 100644 index cd57a8654a..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/gadp/DbgModelGadpDebuggerModelFactory.java +++ /dev/null @@ -1,54 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.gadp; - -import agent.dbgeng.gadp.DbgEngGadpDebuggerModelFactory; -import ghidra.dbg.util.ConfigurableFactory.FactoryDescription; -import ghidra.program.model.listing.Program; - -@FactoryDescription( - brief = "MS dbgmodel.dll (WinDbg Preview) via GADP/TCP", - htmlDetails = """ - Connect to the Microsoft Debug Model. - This is the same engine that powers WinDbg 2. - This will protect Ghidra's JVM by using a subprocess to access the native API.""") -public class DbgModelGadpDebuggerModelFactory extends DbgEngGadpDebuggerModelFactory { - - @Override - protected String getThreadName() { - return "Local dbgmodel.dll Agent stdout"; - } - - @Override - protected Class getServerClass() { - return DbgModelGadpServer.class; - } - - @Override - public int getPriority(Program program) { - // TODO: Might instead look for the DLL - if (!System.getProperty("os.name").toLowerCase().contains("windows")) { - return -1; - } - if (program != null) { - String exe = program.getExecutablePath(); - if (exe == null || exe.isBlank()) { - return -1; - } - } - return 50; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/gadp/DbgModelGadpServer.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/gadp/DbgModelGadpServer.java deleted file mode 100644 index a6e9d39a8b..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/gadp/DbgModelGadpServer.java +++ /dev/null @@ -1,119 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.gadp; - -import java.io.IOException; -import java.net.SocketAddress; -import java.util.concurrent.ExecutionException; - -import org.apache.commons.lang3.exception.ExceptionUtils; - -import agent.dbgeng.gadp.DbgEngGadpServer; -import agent.dbgmodel.gadp.impl.DbgModelGadpServerImpl; -import ghidra.async.AsyncUtils; -import ghidra.dbg.agent.AgentWindow; -import ghidra.util.Msg; - -/** - * The interface for the GADP-{@code dbgeng.dll} server - * - *

- * This is just an interface to specify the truly public methods. This is also a convenient place to - * put all the command-line parsing logic. - * - *

- * This server implements the GADP commands necessary to have a smooth debugging experience in - * Ghidra. It implements almost every command that has use on a binary without debugging - * information. It operates as a standalone debugging server based on {@code dbgeng.dll}, which can - * accept other {@code dbgeng.dll}-based clients as well as GADP clients. - * - *

- * Without limitation, the caveats are listed here: - * - *

    - *
  1. For binaries without a debugging database (pdb file), the symbol commands only search the - * exported symbols.
  2. - *
  3. The type commands are not implemented. Ghidra can read most PDB files directly.
  4. - *
  5. While GADP presents thread-specific control, {@code dbgeng.dll} does not. Continue ("g" in - * {@code dbgeng.dll}) affects all debugged targets, except those with higher suspend counts and - * those that are frozen. The API makes it impossible to perfectly track which threads are actually - * executed by "g". The server thus assumes that all threads run when any thread runs.
  6. - *
- */ -public interface DbgModelGadpServer extends DbgEngGadpServer { - - /** - * The entry point for the GADP-DBGMODEL server in stand-alone mode - * - * Run it to see help. - * - * @param args the command-line arguments - * @throws IOException if an I/O error occurs - * @throws ExecutionException - * @throws InterruptedException - */ - public static void main(String[] args) throws Exception { - try { - new DbgModelRunner().run(args); - } - catch (Throwable t) { - System.err.println(ExceptionUtils.getMessage(t)); - System.exit(1); - } - } - - /** - * Create a new instance of the server - * - * @param addr the address to bind the GADP server to - * @param busId the client ID the server should use on the bus for synthesized commands - * @param dbgSrvTransport the transport specification for the {@code dbgeng.dll} server - * @return the server instance - * @throws IOException - */ - public static DbgModelGadpServer newInstance(SocketAddress addr) throws IOException { - return new DbgModelGadpServerImpl(addr); - } - - /** - * Runs the server from the command line or dbgeng javaprovider - */ - public class DbgModelRunner extends DbgEngRunner { - - public DbgModelRunner() { - } - - @Override - public void run(String args[]) - throws IOException, InterruptedException, ExecutionException { - parseArguments(args); - - try (DbgModelGadpServer server = newInstance(bindTo)) { - server.startDbgEng(dbgengArgs.toArray(new String[] {})).exceptionally(e -> { - e = AsyncUtils.unwrapThrowable(e); - Msg.error(this, "Error starting dbgeng/GADP: " + e); - System.exit(-1); - return null; - }); - new AgentWindow("dbgmodel.dll Agent for Ghidra", server.getLocalAddress()); - while (server.isRunning()) { - // TODO: Put consoleLoop back? - Thread.sleep(1000); - } - } - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/gadp/DbgModelGadpServerLaunchShim.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/gadp/DbgModelGadpServerLaunchShim.java deleted file mode 100644 index dddffdc629..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/gadp/DbgModelGadpServerLaunchShim.java +++ /dev/null @@ -1,37 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.gadp; - -import org.apache.commons.lang3.exception.ExceptionUtils; - -import agent.dbgmodel.gadp.DbgModelGadpServer.DbgModelRunner; -import ghidra.GhidraApplicationLayout; -import ghidra.GhidraLaunchable; - -public class DbgModelGadpServerLaunchShim implements GhidraLaunchable { - - @Override - public void launch(GhidraApplicationLayout layout, String[] args) throws Exception { - try { - new DbgModelRunner().run(args); - } - catch (Throwable t) { - System.err.println(ExceptionUtils.getMessage(t)); - System.exit(1); - } - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/gadp/impl/DbgModelClientThreadExecutor.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/gadp/impl/DbgModelClientThreadExecutor.java deleted file mode 100644 index 7e061a83be..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/gadp/impl/DbgModelClientThreadExecutor.java +++ /dev/null @@ -1,78 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.gadp.impl; - -import java.util.function.Supplier; - -import agent.dbgeng.gadp.impl.AbstractClientThreadExecutor; -import agent.dbgeng.manager.DbgManager; -import agent.dbgmodel.dbgmodel.bridge.HostDataModelAccess; - -/** - * A single-threaded executor which creates and exclusively accesses the {@code dbgeng.dll} client. - * - * The executor also has a priority mechanism, so that callbacks may register follow-on handlers - * which take precedence over other tasks in the queue (which could trigger additional callbacks). - * This is required since certain operation are not allowed during normal callback processing. For - * example, changing the current process is typically not allowed, but it is necessary to retrieve a - * thread's context. - */ -public class DbgModelClientThreadExecutor extends AbstractClientThreadExecutor { - - private final Supplier makeAccess; - private WrappedDbgModel dbgmodel; - private DbgManager manager; - - /** - * Instantiate a new executor, providing a means of creating the client - * - * @param makeClient the callback to create the client - */ - public DbgModelClientThreadExecutor(Supplier makeClient) { - this.makeAccess = makeClient; - thread.setDaemon(true); - thread.start(); - } - - /** - * Obtain a reference to the client, only if the calling thread is this executor's thread. - * - * @return the client - */ - public WrappedDbgModel getAccess() { - if (thread != Thread.currentThread()) { - throw new AssertionError("Cannot get client outside owning thread"); - } - return dbgmodel; - } - - @Override - protected void init() { - dbgmodel = new WrappedDbgModel(makeAccess.get()); - client = dbgmodel.getClient(); - } - - @Override - public DbgManager getManager() { - return manager; - } - - @Override - public void setManager(DbgManager manager) { - this.manager = manager; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/gadp/impl/DbgModelGadpServerImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/gadp/impl/DbgModelGadpServerImpl.java deleted file mode 100644 index 1dd1eb2fd9..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/gadp/impl/DbgModelGadpServerImpl.java +++ /dev/null @@ -1,63 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.gadp.impl; - -import java.io.IOException; -import java.net.SocketAddress; -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.model.AbstractDbgModel; -import agent.dbgmodel.gadp.DbgModelGadpServer; -import agent.dbgmodel.model.impl.DbgModel2Impl; -import ghidra.dbg.gadp.server.AbstractGadpServer; - -public class DbgModelGadpServerImpl implements DbgModelGadpServer { - public class GadpSide extends AbstractGadpServer { - public GadpSide(AbstractDbgModel model, SocketAddress addr) throws IOException { - super(model, addr); - } - } - - protected final AbstractDbgModel model; - protected final GadpSide server; - - public DbgModelGadpServerImpl(SocketAddress addr) throws IOException { - super(); - this.model = new DbgModel2Impl(); - this.server = new GadpSide(model, addr); - } - - @Override - public CompletableFuture startDbgEng(String[] args) { - return model.startDbgEng(args).thenCompose(__ -> server.launchAsyncService()); - } - - @Override - public SocketAddress getLocalAddress() { - return server.getLocalAddress(); - } - - @Override - public boolean isRunning() { - return model.isRunning(); - } - - @Override - public void terminate() throws IOException { - model.terminate(); - server.terminate(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/gadp/impl/WrappedDbgModel.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/gadp/impl/WrappedDbgModel.java deleted file mode 100644 index 04006fbc02..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/gadp/impl/WrappedDbgModel.java +++ /dev/null @@ -1,1066 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.gadp.impl; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.sun.jna.platform.win32.WinDef.ULONGLONG; -import com.sun.jna.platform.win32.COM.COMException; - -import agent.dbgeng.dbgeng.DebugAdvanced; -import agent.dbgeng.dbgeng.DebugClient; -import agent.dbgeng.dbgeng.DebugControl; -import agent.dbgeng.dbgeng.DebugDataSpaces; -import agent.dbgeng.dbgeng.DebugEventCallbacks; -import agent.dbgeng.dbgeng.DebugInputCallbacks; -import agent.dbgeng.dbgeng.DebugModule; -import agent.dbgeng.dbgeng.DebugModuleInfo; -import agent.dbgeng.dbgeng.DebugOutputCallbacks; -import agent.dbgeng.dbgeng.DebugProcessId; -import agent.dbgeng.dbgeng.DebugProcessRecord; -import agent.dbgeng.dbgeng.DebugRegisters; -import agent.dbgeng.dbgeng.DebugRunningProcess; -import agent.dbgeng.dbgeng.DebugRunningProcess.Description; -import agent.dbgeng.dbgeng.DebugRunningProcess.Description.ProcessDescriptionFlags; -import agent.dbgeng.dbgeng.DebugServerId; -import agent.dbgeng.dbgeng.DebugSessionId; -import agent.dbgeng.dbgeng.DebugSymbolEntry; -import agent.dbgeng.dbgeng.DebugSymbolId; -import agent.dbgeng.dbgeng.DebugSymbolName; -import agent.dbgeng.dbgeng.DebugSymbols; -import agent.dbgeng.dbgeng.DebugSystemObjects; -import agent.dbgeng.dbgeng.DebugThreadId; -import agent.dbgeng.dbgeng.DebugValue; -import agent.dbgeng.dbgeng.DebugValue.DebugInt16Value; -import agent.dbgeng.dbgeng.DebugValue.DebugInt32Value; -import agent.dbgeng.dbgeng.DebugValue.DebugInt64Value; -import agent.dbgeng.dbgeng.DebugValue.DebugValueType; -import agent.dbgmodel.dbgmodel.bridge.HostDataModelAccess; -import agent.dbgmodel.dbgmodel.debughost.DebugHost; -import agent.dbgmodel.dbgmodel.debughost.DebugHostContext; -import agent.dbgmodel.dbgmodel.debughost.DebugHostMemory1; -import agent.dbgmodel.dbgmodel.debughost.DebugHostModule1; -import agent.dbgmodel.dbgmodel.debughost.DebugHostSymbol1; -import agent.dbgmodel.dbgmodel.debughost.DebugHostSymbolEnumerator; -import agent.dbgmodel.dbgmodel.debughost.DebugHostSymbols; -import agent.dbgmodel.dbgmodel.main.ModelObject; -import agent.dbgmodel.impl.dbgmodel.DebugRunningProcessImpl; -import agent.dbgmodel.impl.dbgmodel.bridge.HDMAUtil; -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.LOCATION; -import ghidra.comm.util.BitmaskSet; - -public class WrappedDbgModel - implements DebugClient, DebugSystemObjects, DebugRegisters, DebugDataSpaces, DebugSymbols { - - private HDMAUtil util; - private DebugClient client; - private HashMap map = new HashMap(); - private boolean USE_CLIENT = false; - - //private boolean USE_CLIENT = true; - - public WrappedDbgModel(HostDataModelAccess access) { - util = new HDMAUtil(access); - client = access.getClient(); - System.err.println(">>>>>>>>>>>> USING WRAPPED DBGMODEL <<<<<<<<<<<<<<"); - } - - public DebugClient getClient() { - return this; - } - - // Used to get ExitTime/Status for threads - @Override - public DebugAdvanced getAdvanced() { - return client.getAdvanced(); - } - - // Used for control, I/O, breakpoints - @Override - public DebugControl getControl() { - return client.getControl(); - } - - // Used to enumerate/read-write regions - @Override - public DebugDataSpaces getDataSpaces() { - return this; - } - - // Used to enumerate registers - @Override - public DebugRegisters getRegisters() { - return this; - } - - // Used to enumerate threads/processes - @Override - public DebugSystemObjects getSystemObjects() { - return this; - } - - // Used to enumerate symbols - @Override - public DebugSymbols getSymbols() { - return this; - } - - public Map getAttributes(List path) { - return getUtil().getAttributes(path); - } - - public List getElements(List path) { - return getUtil().getElements(path); - } - - public ModelObject getMethod(List path) { - return getUtil().getMethod(path); - } - - @Override - public void attachProcess(DebugServerId si, long processId, - BitmaskSet attachFlags) { - client.attachProcess(si, processId, attachFlags); - } - - @Override - public void createProcess(DebugServerId si, String commandLine, - String initialDirectory, String environment, - BitmaskSet createFlags, - BitmaskSet engCreateFlags, - BitmaskSet verifierFlags) { - client.createProcess(si, commandLine, - initialDirectory, environment, - createFlags, engCreateFlags, verifierFlags); - } - - @Override - public void createProcessAndAttach(DebugServerId si, String commandLine, - BitmaskSet createFlags, int processId, - BitmaskSet attachFlags) { - client.createProcessAndAttach(si, commandLine, createFlags, processId, attachFlags); - } - - @Override - public void abandonCurrentProcess() { - client.abandonCurrentProcess(); - } - - @Override - public void startServer(String options) { - client.startServer(options); - } - - @Override - public void waitForProcessServerEnd(int timeout) { - client.waitForProcessServerEnd(timeout); - } - - @Override - public void terminateCurrentProcess() { - client.terminateCurrentProcess(); - } - - @Override - public void detachCurrentProcess() { - client.detachCurrentProcess(); - } - - @Override - public void connectSession(int flags) { - client.connectSession(flags); - } - - @Override - public void endSession(DebugEndSessionFlags flags) { - client.endSession(flags); - } - - public HDMAUtil getUtil() { - return util; - } - - @Override - public DebugClient createClient() { - return client; - } - - @Override - public void endSessionReentrant() { - client.endSessionReentrant(); - } - - @Override - public DebugServerId getLocalServer() { - return client.getLocalServer(); - } - - @Override - public void attachKernel(long flags, String options) { - client.attachKernel(flags, options); - } - - @Override - public void startProcessServer(String options) { - client.startProcessServer(options); - } - - @Override - public DebugServerId connectProcessServer(String options) { - return client.connectProcessServer(options); - } - - @Override - public boolean dispatchCallbacks(int timeout) { - return client.dispatchCallbacks(timeout); - } - - @Override - public void flushCallbacks() { - client.flushCallbacks(); - } - - @Override - public void exitDispatch(DebugClient client) { - client.exitDispatch(client); - } - - @Override - public void setInputCallbacks(DebugInputCallbacks cb) { - client.setInputCallbacks(cb); - } - - @Override - public void setOutputCallbacks(DebugOutputCallbacks cb) { - client.setOutputCallbacks(cb); - } - - @Override - public void setEventCallbacks(DebugEventCallbacks cb) { - client.setEventCallbacks(cb); - } - - @Override - public Description getProcessDescription(DebugServerId si, int systemId, - BitmaskSet flags) { - return client.getProcessDescription(si, systemId, flags); - } - - @Override - public void openDumpFileWide(String fileName) { - client.openDumpFileWide(fileName); - } - - // DATA SPACES INTERFACE - - @Override - public int readVirtual(long offset, ByteBuffer buf, int remaining) { - DebugHostContext currentContext = getUtil().getCurrentContext(); - DebugHost host = getUtil().getHost(); - ULONGLONG ulOffset = new ULONGLONG(offset); - LOCATION base = new LOCATION(ulOffset); - DebugHostMemory1 memory = host.asMemory(); - return (int) memory.readBytes(currentContext, base, buf, remaining); - } - - @Override - public int writeVirtual(long offset, ByteBuffer buf, int remaining) { - // UNTESTED - DebugHostContext currentContext = getUtil().getCurrentContext(); - DebugHost host = getUtil().getHost(); - ULONGLONG ulOffset = new ULONGLONG(offset); - LOCATION base = new LOCATION(ulOffset); - DebugHostMemory1 memory = host.asMemory(); - return (int) memory.writeBytes(currentContext, base, buf, remaining); - } - - @Override - public int readVirtualUncached(long offset, ByteBuffer into, int len) { - return readVirtual(offset, into, len); - } - - @Override - public int writeVirtualUncached(long offset, ByteBuffer from, int len) { - return readVirtual(offset, from, len); - } - - // TODO what follows is untested - - @Override - public int readPhysical(long offset, ByteBuffer buf, int remaining) { - return client.getDataSpaces().readPhysical(offset, buf, remaining); - } - - @Override - public int writePhysical(long offset, ByteBuffer buf, int remaining) { - return client.getDataSpaces().writePhysical(offset, buf, remaining); - } - - @Override - public int readControl(int processor, long offset, ByteBuffer buf, int remaining) { - return client.getDataSpaces().readControl(processor, offset, buf, remaining); - } - - @Override - public int writeControl(int processor, long offset, ByteBuffer buf, int remaining) { - return client.getDataSpaces().writeControl(processor, offset, buf, remaining); - } - - @Override - public int readBusData(int busDataType, int busNumber, int slotNumber, long offset, - ByteBuffer buf, int remaining) { - return client.getDataSpaces() - .readBusData(busDataType, busNumber, slotNumber, offset, buf, remaining); - } - - @Override - public int writeBusData(int busDataType, int busNumber, int slotNumber, long offset, - ByteBuffer buf, int remaining) { - return client.getDataSpaces() - .writeBusData(busDataType, busNumber, slotNumber, offset, buf, remaining); - } - - @Override - public int readIo(int interfaceType, int busNumber, int addressSpace, long offset, - ByteBuffer buf, int remaining) { - return client.getDataSpaces() - .readIo(interfaceType, busNumber, addressSpace, offset, buf, remaining); - } - - @Override - public int writeIo(int interfaceType, int busNumber, int addressSpace, long offset, - ByteBuffer buf, int remaining) { - return client.getDataSpaces() - .writeIo(interfaceType, busNumber, addressSpace, offset, buf, remaining); - } - - @Override - public long readMsr(int msr) { - return client.getDataSpaces().readMsr(msr); - } - - @Override - public void writeMsr(int msr, long value) { - client.getDataSpaces().writeMsr(msr, value); - } - - @Override - public int readDebuggerData(int offset, ByteBuffer buf, int remaining) { - DebugHostContext currentContext = getUtil().getCurrentContext(); - DebugHost host = getUtil().getHost(); - ULONGLONG ulOffset = new ULONGLONG(offset); - LOCATION base = new LOCATION(ulOffset); - DebugHostMemory1 memory = host.asMemory(); - return (int) memory.readBytes(currentContext, base, buf, remaining); - } - - @Override - public DebugMemoryBasicInformation queryVirtual(long offset) { - return client.getDataSpaces().queryVirtual(offset); - } - - @Override - public long virtualToPhysical(long offset) { - return client.getDataSpaces().virtualToPhysical(offset); - } - - // REGISTERS INTERFACE - - public DebugRegisterDescription getRegisterDescription(int i) { - return client.getRegisters().getDescription(i); - /* - if (USE_CLIENT) { - System.err.println("getRegisterDescription"); - return client.getRegisters().getDescription(i); - } - */ - /* - Map registerMap = getRegisterMap(); - Object[] array = registerMap.keySet().toArray(); - if (i > array.length) { - DebugRegisterDescription description = client.getRegisters().getDescription(i); - System.err.println(description.name + " not found"); - return null; - } - String regname = (String) array[i]; - ModelObject register = registerMap.get(regname); - DebugRegisterDescription drp = new DebugRegisterDescription(regname, i, getDVType(register), - new BitmaskSet<>(DebugRegisterFlags.class, 0), 0, 0, 0, 0); - return drp; - */ - } - - public Set getAllRegisterDescriptions() { - return client.getRegisters().getAllDescriptions(); - /* - if (USE_CLIENT) { - System.err.println("getAllRegisterDescriptions"); - return client.getRegisters().getAllDescriptions(); - } - */ - /* - Set set = new HashSet(); - Map registerMap = getRegisterMap(); - Object[] array = registerMap.keySet().toArray(); - for (int i = 0; i < array.length; i++) { - String regname = (String) array[i]; - if (regname == null) { - continue; - } - ModelObject register = registerMap.get(regname); - DebugRegisterDescription drp = new DebugRegisterDescription(regname, i, - getDVType(register), new BitmaskSet<>(DebugRegisterFlags.class, 0), 0, 0, 0, 0); - set.add(drp); - } - return set; - */ - } - - /* - public void setRegisterValue(Entry ent) { - System.err.println("setRegisterValue"); - Map registerMap = getRegisterMap(); - ModelObject register = registerMap.get(ent.getKey()); - DebugValue value = decodeBytes(register, ent.getValue()); - client.getRegisters().setValueByName(ent.getKey(), value); - } - */ - - @Override - public int getNumberRegisters() { - return client.getRegisters().getNumberRegisters(); - //return getRegisterMap().size(); - } - - @Override - public DebugRegisterDescription getDescription(int registerNumber) { - return getRegisterDescription(registerNumber); - } - - @Override - public int getIndexByName(String name) { - return client.getRegisters().getIndexByName(name); - /* - if (USE_CLIENT) { - System.err.println("getAllRegisterDescriptions"); - return client.getRegisters().getIndexByName(name); - } - */ - /* - TreeMap registerMap = (TreeMap) getRegisterMap(); - Object[] array = registerMap.keySet().toArray(); - for (int i = 0; i < array.length; i++) { - String key = (String) array[i]; - if (key.equals(name)) { - return i; - } - } - return -1; - */ - } - - @Override - public DebugValue getValueByName(String name) { - return client.getRegisters().getValueByName(name); - //TreeMap registerMap = (TreeMap) getRegisterMap(); - //ModelObject obj = registerMap.get(name); - //return getDebugValue(obj); - } - - @Override - public DebugValue getValue(int index) { - return client.getRegisters().getValue(index); - /* - if (USE_CLIENT) { - System.err.println("getAllRegisterDescriptions"); - return client.getRegisters().getValue(index); - } - */ - /* - TreeMap registerMap = (TreeMap) getRegisterMap(); - Object[] array = registerMap.values().toArray(); - if (index >= 0 && index < array.length) { - ModelObject obj = (ModelObject) array[index]; - return getDebugValue(obj); - } - return null; - */ - } - - @Override - public Map getValues(DebugRegisterSource source, - Collection indices) { - return client.getRegisters().getValues(source, indices); - /* - if (USE_CLIENT) { - System.err.println("getAllRegisterDescriptions"); - return client.getRegisters().getValues(source, indices); - } - */ - /* - TreeMap registerMap = (TreeMap) getRegisterMap(); - Object[] array = registerMap.keySet().toArray(); - Map registers = new TreeMap(); - for (Integer index : indices) { - String key = (String) array[index]; - ModelObject obj = registerMap.get(key); - registers.put(index, getDebugValue(obj)); - } - return registers; - */ - } - - @Override - public void setValueByName(String name, DebugValue value) { - setValue(getIndexByName(name), value); - } - - @Override - public void setValue(int index, DebugValue value) { - client.getRegisters().setValue(index, value); - } - - @Override - public void setValues(DebugRegisterSource source, Map values) { - client.getRegisters().setValues(source, values); - } - - // SYSTEM OBJECT INTERFACE - - public List getThreadIds() { - List ids = null; - /* - if (USE_CLIENT) { - System.err.println("getThreadIds"); - ids = client.getSystemObjects().getThreads(); - return ids; - } - */ - ModelObject currentSession = getUtil().getCurrentSession(); - ModelObject currentProcess = getUtil().getCurrentProcess(); - String pid = getUtil().getCtlId(currentProcess); - List runningThreads = getUtil().getRunningThreads(currentSession, pid); - ids = new ArrayList(); - for (ModelObject t : runningThreads) { - String tid = getUtil().getCtlId(t); - ids.add(tid2dti(tid)); - } - return ids; - } - - public List getProcessIds() { - /* - if (USE_CLIENT) { - System.err.println("getProcessIds"); - return client.getSystemObjects().getProcesses(); - } - */ - // TODO: What follow is problematic. SO.getProcesses uses SO.GetNumberProcesses - // and GetProcessIdsByIndex, which return the processes being debugged, not the - // system process list. Using the system process list and calling getProcessIdBySystemID - // triggers unsupported interface COM exceptions - List ids = new ArrayList(); - List procs = getRunningProcesses(sid2dsi()); - for (DebugRunningProcess p : procs) { - try { - ids.add(pid2dpi("0x" + Integer.toHexString(p.getSystemId()))); - } - catch (COMException e) { - System.err.println(p.getSystemId()); - } - } - return ids; - } - - @Override - public void setCurrentSystemId(DebugSessionId dpi) { - client.getSystemObjects().setCurrentSystemId(dpi); - /* - if (USE_CLIENT) { - System.err.println("setCurrentProcess"); - client.getSystemObjects().setCurrentProcessId(dpi); - return; - } - *//* DOESN'T WORK - String pid = obj2id(dpi); - ModelObject currentProcess = util.getCurrentProcess(); - util.setCurrentProcess(currentProcess, pid); - */ - } - - @Override - public void setCurrentProcessId(DebugProcessId dpi) { - client.getSystemObjects().setCurrentProcessId(dpi); - /* - if (USE_CLIENT) { - System.err.println("setCurrentProcess"); - client.getSystemObjects().setCurrentProcessId(dpi); - return; - } - *//* DOESN'T WORK - String pid = obj2id(dpi); - ModelObject currentProcess = util.getCurrentProcess(); - util.setCurrentProcess(currentProcess, pid); - */ - } - - @Override - public void setCurrentThreadId(DebugThreadId dti) { - DebugSystemObjects so = client.getSystemObjects(); - DebugThreadId currentThreadId = so.getCurrentThreadId(); - if (!dti.id().equals(currentThreadId.id())) { - so.setCurrentThreadId(dti); - } - /* - if (USE_CLIENT) { - System.err.println("setCurrentThread"); - client.getSystemObjects().setCurrentThreadId(dti); - return; - } - *//* DOESN'T WORK - String tid = obj2id(dti); - ModelObject currentThread = util.getCurrentThread(); - util.setCurrentThread(currentThread, tid); - */ - } - - @Override - public DebugSessionId getCurrentSystemId() { - /* - if (USE_CLIENT) { - System.err.println("getCurrentSystemId"); - return client.getSystemObjects().getCurrentSystemId(); - } - */ - return client.getSystemObjects().getCurrentSystemId(); - } - - @Override - public DebugProcessId getCurrentProcessId() { - /* - if (USE_CLIENT) { - System.err.println("getCurrentProcessId"); - return client.getSystemObjects().getCurrentProcessId(); - } - */ - ModelObject currentProcess = getUtil().getCurrentProcess(); - DebugProcessId dpi = client.getSystemObjects().getCurrentProcessId(); - if (currentProcess != null) { - String id = getUtil().getCtlId(currentProcess); - addObj(dpi, id); - } - return dpi; - } - - @Override - public DebugThreadId getCurrentThreadId() { - /* - if (USE_CLIENT) { - System.err.println("getCurrentThreadId"); - return client.getSystemObjects().getCurrentThreadId(); - } - */ - ModelObject currentThread = getUtil().getCurrentThread(); - DebugThreadId dti = client.getSystemObjects().getCurrentThreadId(); - if (currentThread != null) { - String id = getUtil().getCtlId(currentThread); - addObj(dti, id); - } - return dti; - } - - @Override - public DebugProcessId getProcessIdByHandle(long handle) { - // "Handle" key exists for processes, but not threads currently - return client.getSystemObjects().getProcessIdByHandle(handle); - } - - @Override - public DebugThreadId getThreadIdByHandle(long handle) { - // "Handle" key exists for processes, but not threads currently - return client.getSystemObjects().getThreadIdByHandle(handle); - } - - @Override - public DebugSessionId getEventSystem() { - /* - if (USE_CLIENT) { - System.err.println("getEventProcess"); - return client.getSystemObjects().getEventProcess(); - } - */ - return client.getSystemObjects().getEventSystem(); - //return getCurrentProcessId(); - } - - @Override - public DebugProcessId getEventProcess() { - /* - if (USE_CLIENT) { - System.err.println("getEventProcess"); - return client.getSystemObjects().getEventProcess(); - } - */ - return client.getSystemObjects().getEventProcess(); - //return getCurrentProcessId(); - } - - @Override - public DebugThreadId getEventThread() { - /* - if (USE_CLIENT) { - System.err.println("getEventThread"); - return client.getSystemObjects().getEventThread(); - } - */ - return client.getSystemObjects().getEventThread(); - //return getCurrentThreadId(); - } - - @Override - public List getRunningProcesses(DebugServerId si) { - /* - if (USE_CLIENT) { - System.err.println("getRunningProcesses"); - return client.getRunningProcesses(si); - } - */ - List processes = getUtil().getRunningProcesses(obj2id(si)); - List result = new ArrayList<>(processes.size()); - for (ModelObject child : processes) { - String pid = getUtil().getCtlId(child); - result.add(new DebugRunningProcessImpl(pid, child, si)); - } - return result; - } - - @Override - public int getCurrentThreadSystemId() { // used by impl - return client.getSystemObjects().getCurrentThreadSystemId(); - } - - @Override - public int getCurrentProcessSystemId() { // used by impl - return client.getSystemObjects().getCurrentProcessSystemId(); - } - - @Override - public long getCurrentThreadDataOffset() { // used by impl - return client.getSystemObjects().getCurrentThreadDataOffset(); - } - - @Override - public long getCurrentProcessDataOffset() { // used by impl - return client.getSystemObjects().getCurrentProcessDataOffset(); - } - - @Override - public long getImplicitThreadDataOffset() { // used by impl - return client.getSystemObjects().getImplicitThreadDataOffset(); - } - - @Override - public long getImplicitProcessDataOffset() { // used by impl - return client.getSystemObjects().getImplicitProcessDataOffset(); - } - - @Override - public void setImplicitThreadDataOffset(long offset) { // used by impl - client.getSystemObjects().setImplicitThreadDataOffset(offset); - } - - @Override - public void setImplicitProcessDataOffset(long offset) { // used by impl - client.getSystemObjects().setImplicitProcessDataOffset(offset); - } - - @Override - public int getNumberThreads() { // used by dso - return client.getSystemObjects().getNumberThreads(); - } - - @Override - public List getThreads(int start, int count) { // used by dso - return client.getSystemObjects().getThreads(start, count); - } - - @Override - public int getNumberProcesses() { // used by dso - return client.getSystemObjects().getNumberProcesses(); - } - - @Override - public List getProcesses(int start, int count) { // used by dso - return client.getSystemObjects().getProcesses(start, count); - } - - @Override - public int getNumberSystems() { // used by dso - return client.getSystemObjects().getNumberSystems(); - } - - @Override - public List getSystems(int start, int count) { // used by dso - return client.getSystemObjects().getSystems(start, count); - } - - @Override - public DebugThreadId getThreadIdBySystemId(int systemId) { // used by this - return client.getSystemObjects().getThreadIdBySystemId(systemId); - } - - @Override - public DebugProcessId getProcessIdBySystemId(int systemId) { // used by this - return client.getSystemObjects().getProcessIdBySystemId(systemId); - } - - @Override - public int getTotalNumberThreads() { // unused - return client.getSystemObjects().getTotalNumberThreads(); - } - - // SYMBOLS INTERFACE - - public List getDebugHostModules() { - DebugHostSymbols symbols = getUtil().getHost().asSymbols(); - DebugHostSymbolEnumerator enumerator = - symbols.enumerateModules(getUtil().getCurrentContext()); - List list = new ArrayList(); - DebugHostSymbol1 next; - while ((next = enumerator.getNext()) != null) { - list.add(next.asModule()); - } - return list; - } - - public List getModuleList() { - return getUtil().getModuleList(); - } - - @Override - public int getNumberLoadedModules() { - return getModuleList().size(); - } - - @Override - public int getNumberUnloadedModules() { - return client.getSymbols().getNumberUnloadedModules(); - } - - @Override - public DebugModule getModuleByIndex(int index) { - List modules = getModuleList(); - return modules.get(index); - } - - @Override - public DebugModule getModuleByModuleName(String name, int startIndex) { - List modules = getModuleList(); - for (DebugModule module : modules) { - String moduleName = module.getName(null); - if (moduleName.equals(name)) { - return module; - } - } - System.err.println(name + " not found"); - return null; - } - - @Override - public DebugModule getModuleByOffset(long offset, int startIndex) { - List modules = getModuleList(); - long min = Long.MAX_VALUE; - DebugModule ret = null; - for (DebugModule module : modules) { - long baseAddress = module.getBase(); - if (offset >= baseAddress && baseAddress < min) { - min = baseAddress; - ret = module; - } - } - return ret; - } - - @Override - public DebugModuleInfo getModuleParameters(int count, int startIndex) { - return client.getSymbols().getModuleParameters(count, startIndex); - } - - @Override - public Iterable iterateSymbolMatches(String pattern) { - return client.getSymbols().iterateSymbolMatches(pattern); - } - - @Override - public List getSymbolIdsByName(String pattern) { - return client.getSymbols().getSymbolIdsByName(pattern); - } - - @Override - public DebugSymbolEntry getSymbolEntry(DebugSymbolId id) { - return client.getSymbols().getSymbolEntry(id); - } - - @Override - public String getSymbolPath() { - return client.getSymbols().getSymbolPath(); - } - - @Override - public void setSymbolPath(String path) { - client.getSymbols().setSymbolPath(path); - } - - @Override - public int getSymbolOptions() { - return client.getSymbols().getSymbolOptions(); - } - - @Override - public void setSymbolOptions(int options) { - client.getSymbols().setSymbolOptions(options); - } - - // UTILITY METHODS - - private DebugServerId sid2dsi() { - DebugServerId dsi = new DebugServerId(0); - addObj(dsi, "0"); - return dsi; - } - - private DebugProcessId pid2dpi(String id) { - if (!id.startsWith("0x")) { - id = "0x" + id; - } - int pid = Integer.decode(id); - if (pid == 0) { - return new DebugProcessRecord(-1); - } - DebugProcessId dpi = client.getSystemObjects().getProcessIdBySystemId(pid); - addObj(dpi, id); - return dpi; - } - - private DebugThreadId tid2dti(String id) { - if (!id.startsWith("0x")) { - id = "0x" + id; - } - int tid = Integer.decode(id); - DebugThreadId dti = client.getSystemObjects().getThreadIdBySystemId(tid); - addObj(dti, id); - return dti; - } - - private void addObj(Object obj, String id) { - if (obj == null || id == null) { - System.err.println("attempt to add null object"); - } - map.put(obj, id); - } - - private String obj2id(Object obj) { - String id = map.get(obj); - return id; - } - - public DebugValue getDebugValue(ModelObject register) { - DebugValue dv = null; - Object value = register.getValue(); - if (value instanceof Short) { - dv = new DebugInt16Value(((Short) value).shortValue()); - } - else if (value instanceof Integer) { - dv = new DebugInt32Value(((Integer) value).intValue()); - } - else if (value instanceof Long) { - dv = new DebugInt64Value(((Long) value).longValue()); - } - return dv; - } - - public byte[] encodeAsBytes(ModelObject register) { - DebugValue dv = null; - Object value = register.getValue(); - if (value instanceof Short) { - Short lval = (Short) value; - dv = new DebugInt16Value(lval); - } - else if (value instanceof Integer) { - Integer lval = (Integer) value; - dv = new DebugInt32Value(lval); - } - else if (value instanceof Long) { - Long lval = (Long) value; - dv = new DebugInt64Value(lval); - } - else { - return new byte[0]; - } - return dv.encodeAsBytes(); - } - - private DebugValue decodeBytes(ModelObject register, byte[] bytes) { - DebugValue dv = null; - Object value = register.getValue(); - if (value instanceof Short) { - dv = new DebugInt16Value(bytes); - } - else if (value instanceof Integer) { - dv = new DebugInt32Value(bytes); - } - else if (value instanceof Long) { - dv = new DebugInt64Value(bytes); - } - return dv; - } - - private DebugValueType getDVType(ModelObject register) { - Object value = register.getValue(); - if (value instanceof Short) { - return DebugValueType.INT16; - } - else if (value instanceof Integer) { - return DebugValueType.INT32; - } - else if (value instanceof Long) { - return DebugValueType.INT64; - } - return DebugValueType.INVALID; - } - - @Override - public int getCurrentScopeFrameIndex() { - return client.getSymbols().getCurrentScopeFrameIndex(); - } - - @Override - public void setCurrentScopeFrameIndex(int index) { - client.getSymbols().setCurrentScopeFrameIndex(index); - } - - @Override - public String getCurrentProcessExecutableName() { - return client.getSystemObjects().getCurrentProcessExecutableName(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/DebugRunningProcessImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/DebugRunningProcessImpl.java deleted file mode 100644 index 3dc205750f..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/DebugRunningProcessImpl.java +++ /dev/null @@ -1,66 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel; - -import agent.dbgeng.dbgeng.DebugRunningProcess; -import agent.dbgeng.dbgeng.DebugServerId; -import agent.dbgmodel.dbgmodel.main.ModelObject; - -public class DebugRunningProcessImpl - implements DebugRunningProcess, Comparable { - - public DebugRunningProcessImpl(String id, ModelObject object, DebugServerId server) { - this.object = object; - this.server = server; - this.systemId = Integer.decode(id); - } - - protected final ModelObject object; - protected final DebugServerId server; - protected final int systemId; - - @Override - public int getSystemId() { - return systemId; - } - - @Override - public Description getFullDescription(Description.ProcessDescriptionFlags... flags) { - return new Description(systemId, object.getSearchKey(), object.toString()); - } - - @Override - public String getExecutableName(Description.ProcessDescriptionFlags... flags) { - return getFullDescription(flags).getExecutableName(); - } - - @Override - public String getDescription(Description.ProcessDescriptionFlags... flags) { - return getFullDescription(flags).getDescription(); - } - - @Override - public int compareTo(DebugRunningProcessImpl that) { - int result; - - result = Integer.compare(this.systemId, that.systemId); - if (result != 0) { - return result; - } - - return 0; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/UnknownExImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/UnknownExImpl.java deleted file mode 100644 index 5aa87e9273..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/UnknownExImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.COM.IUnknown; - -import agent.dbgmodel.dbgmodel.main.KeyStore; - -public class UnknownExImpl implements UnknownExInternal { - - private final IUnknown jnaData; - private KeyStore metadata; - - public UnknownExImpl(IUnknown jnaData) { - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return null; - } - - public void setMetadata(KeyStore metadata) { - this.metadata = metadata; - } - - public KeyStore getMetadata() { - return metadata; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/UnknownExInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/UnknownExInternal.java deleted file mode 100644 index ed5c3ae42d..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/UnknownExInternal.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.COM.IUnknown; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.UnknownEx; -import agent.dbgmodel.jna.dbgmodel.WrapIUnknownEx; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface UnknownExInternal extends UnknownEx { - Map CACHE = new WeakValueHashMap<>(); - - static UnknownExInternal instanceFor(WrapIUnknownEx data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, UnknownExImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IUnknown.IID_IUNKNOWN, WrapIUnknownEx.class)); - - static UnknownExInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(UnknownExInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/bridge/HDMAUtil.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/bridge/HDMAUtil.java deleted file mode 100644 index 257789ae97..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/bridge/HDMAUtil.java +++ /dev/null @@ -1,278 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.bridge; - -import java.util.*; - -import com.sun.jna.WString; -import com.sun.jna.platform.win32.Variant.VARIANT; - -import agent.dbgeng.dbgeng.DebugClient; -import agent.dbgeng.dbgeng.DebugModule; -import agent.dbgmodel.dbgmodel.bridge.HostDataModelAccess; -import agent.dbgmodel.dbgmodel.datamodel.DataModelManager1; -import agent.dbgmodel.dbgmodel.debughost.*; -import agent.dbgmodel.dbgmodel.main.ModelObject; -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.ModelObjectKind; -import ghidra.dbg.util.PathUtils; -import ghidra.util.Msg; - -public class HDMAUtil { - - private DebugClient client; - private HostDataModelAccess access; - - public HDMAUtil(HostDataModelAccess access) { - this.access = access; - this.client = access.getClient(); - } - - public DataModelManager1 getManager() { - return access.getManager(); - } - - public DebugHost getHost() { - return access.getHost(); - } - - public ModelObject getRootNamespace() { - ModelObject rootNamespace = getManager().getRootNamespace(); - if (rootNamespace == null) { - Msg.debug(this, "resetting HostDataModelAccess manager/host " + access); - access.getDataModel(); - rootNamespace = getManager().getRootNamespace(); - } - return rootNamespace; - } - - public DebugHostContext getCurrentContext() { - return getHost().getCurrentContext(); - } - - public ModelObject getSessionOf(DebugHostContext obj) { - return getRootNamespace().getKeyValue("Debugger").getKeyValue("Sessions");//[obj] - } - - public ModelObject getProcessOf(DebugHostContext obj) { - return getSessionOf(obj).getKeyValue("Processes");//[obj] - } - - public ModelObject getThreadOf(DebugHostContext obj) { - return getProcessOf(obj).getKeyValue("Threads");//[obj] - } - - public VARIANT string2variant(String id) { - Integer decode = id == null ? 0 : Integer.decode(id); - return new VARIANT(decode); - } - - public Map getAttributes(List path) { - ModelObject target = getTerminalModelObject(path); - if (target == null) { - //System.err.println("(A) Null target for path=" + path); - return new HashMap(); - } - ModelObjectKind kind = target.getKind(); - if (kind.equals(ModelObjectKind.OBJECT_ERROR)) { - HashMap map = new HashMap(); - map.put("ERROR", target); - return map; - } - if (kind.equals(ModelObjectKind.OBJECT_INTRINSIC) || - kind.equals(ModelObjectKind.OBJECT_TARGET_OBJECT) || - kind.equals(ModelObjectKind.OBJECT_TARGET_OBJECT_REFERENCE)) { - Map map = target.getRawValueMap(); - if (!map.isEmpty()) { - return map; - } - } - return target.getKeyValueMap(); - } - - public List getElements(List path) { - ModelObject target = getTerminalModelObject(path); - if (target == null) { - //System.err.println("(C) Null target for path=" + path); - return new ArrayList(); - } - ModelObjectKind kind = target.getKind(); - if (kind.equals(ModelObjectKind.OBJECT_ERROR)) { - List list = new ArrayList(); - list.add(target); - return list; - } - return target.getElements(); - } - - public ModelObject getMethod(List path) { - DebugHostEvaluator2 eval = getHost().asEvaluator(); - DebugHostContext context = getHost().getCurrentContext(); - List npath = PathUtils.parent(path); - int last = path.size() - 1; - String cmd = path.get(last); - ModelObject parentModel = getTerminalModelObject(npath); - return eval.evaluateExtendedExpression(context, new WString(cmd), parentModel); - } - - public ModelObject getTerminalModelObject(List path) { - //System.err.println(path); - ModelObject target = getRootNamespace(); - for (String str : path) { - String indexStr = null; - if (str.endsWith(")")) { - target = evaluatePredicate(target, str); - if (target.getKind().equals(ModelObjectKind.OBJECT_ERROR)) { - return target; - } - } - if (str.endsWith("]")) { - indexStr = str.substring(str.indexOf("[") + 1, str.indexOf("]")); - str = str.substring(0, str.indexOf("[")); - } - if (!str.equals("")) { - ModelObject keyValue = target.getKeyValueByEnum(str); - if (keyValue != null) { - target = keyValue; - continue; - } - else { - ModelObject rawValue = target.getRawValueByEnum(str); - if (rawValue != null) { - target = rawValue; - continue; - } - } - } - if (indexStr != null) { - ModelObject element = target.getElement(indexStr); - if (element != null) { - target = element; - continue; - } - } - return null; - } - return target; - } - - private ModelObject evaluatePredicate(ModelObject target, String call) { - DebugHostEvaluator2 eval = getHost().asEvaluator(); - DebugHostContext context = getHost().getCurrentContext(); - return eval.evaluateExtendedExpression(context, new WString(call), target); - } - - public ModelObject getSession(String id) { - return getRootNamespace().getKeyValue("Debugger").getKeyValue("Sessions"); - } - - public ModelObject getProcess(ModelObject session, String id) { - ModelObject processes = session.getKeyValue("Processes"); - return processes.getChild(getManager(), string2variant(id)); - } - - public ModelObject getThread(ModelObject process, String id) { - ModelObject threads = process.getKeyValue("Threads"); - return threads.getChild(getManager(), string2variant(id)); - } - - public ModelObject getSettings() { - return getRootNamespace().getKeyValue("Debugger").getKeyValue("Settings"); - } - - public ModelObject getVariables() { - return getRootNamespace().getKeyValue("Debugger") - .getKeyValue("State") - .getKeyValue("DebuggerVariables"); - } - - public ModelObject getCurrentSession() { - return getVariables().getKeyValue("cursession"); - } - - public ModelObject getCurrentProcess() { - return getVariables().getKeyValue("curprocess"); - } - - public ModelObject getCurrentThread() { - return getVariables().getKeyValue("curthread"); - } - - public ModelObject getCurrentStack() { - return getCurrentThread().getKeyValue("Stack"); - } - - public ModelObject getCurrentFrame() { - return getVariables().getKeyValue("curframe"); - } - - public List getCurrentModuleList() { - ModelObject process = getCurrentProcess(); - ModelObject modules = process.getKeyValue("Modules"); - return modules.getElements(); - } - - public List getModuleList() { - DebugHostSymbols symbols = getHost().asSymbols(); - DebugHostSymbolEnumerator enumerator = symbols.enumerateModules(getCurrentContext()); - List modules = new ArrayList(); - DebugHostSymbol1 next; - int index = 0; - while ((next = enumerator.getNext()) != null) { - DebugHostModule1 module = next.asModule(); - String name = module.getName(); - //BSTR imageName = module.getImageName(true); - //LOCATION base = module.getBaseLocation(); - //long baseAddress = base.Offset.longValue(); - DebugModule debugModule = client.getSymbols().getModuleByModuleName(name, index++); - //DebugModule debugModule = new DbgModelModule(name, baseAddress, index++); - modules.add(debugModule); - } - return modules; - } - - public List getRunningProcesses(String id) { - ModelObject session = getSession(id); - ModelObject processes = session.getKeyValue("Processes"); - return processes.getElements(); - } - - public List getRunningThreads(ModelObject session, String id) { - ModelObject process = getProcess(session, id); - ModelObject threads = process.getKeyValue("Threads"); - return threads.getElements(); - } - - public ModelObject getProcessDescription(String sid, int systemId) { - ModelObject session = getSession(sid); - return getProcess(session, Integer.toHexString(systemId)); - } - - public void setCurrentProcess(ModelObject context, String id) { - VARIANT v = new VARIANT(id); - context.switchTo(getManager(), v); - } - - public void setCurrentThread(ModelObject context, String id) { - VARIANT v = new VARIANT(id); - context.switchTo(getManager(), v); - } - - public String getCtlId(ModelObject object) { - ModelObject value = object.getKeyValue("Id"); - return value == null ? "" : value.getValueString(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/bridge/HostDataModelAccessImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/bridge/HostDataModelAccessImpl.java deleted file mode 100644 index bc914b0221..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/bridge/HostDataModelAccessImpl.java +++ /dev/null @@ -1,105 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.bridge; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.COM.COMUtils; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgeng.dbgeng.DebugClient; -import agent.dbgeng.impl.dbgeng.client.DebugClientImpl1; -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.dbgmodel.datamodel.DataModelManager1; -import agent.dbgmodel.dbgmodel.debughost.DebugHost; -import agent.dbgmodel.impl.dbgmodel.datamodel.DataModelManagerInternal; -import agent.dbgmodel.impl.dbgmodel.debughost.DebugHostInternal; -import agent.dbgmodel.jna.dbgmodel.bridge.IHostDataModelAccess; -import agent.dbgmodel.jna.dbgmodel.datamodel.WrapIDataModelManager1; -import agent.dbgmodel.jna.dbgmodel.debughost.WrapIDebugHost; - -public class HostDataModelAccessImpl implements HostDataModelAccessInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IHostDataModelAccess jnaData; - - private DataModelManager1 manager; - private DebugHost host; - private DebugClient debugClient; - - public HostDataModelAccessImpl(IHostDataModelAccess jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - public HostDataModelAccessImpl(DebugClient debugClient) { - DebugClientImpl1 impl = (DebugClientImpl1) debugClient; - this.jnaData = (IHostDataModelAccess) impl.getJNAClient(); - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - public IHostDataModelAccess getJNAData() { - return jnaData; - } - - @Override - public void getDataModel() { - PointerByReference ppManager = new PointerByReference(); - PointerByReference ppHost = new PointerByReference(); - COMUtils.checkRC(jnaData.GetDataModel(ppManager, ppHost)); - - WrapIDataModelManager1 wrap0 = new WrapIDataModelManager1(ppManager.getValue()); - try { - manager = DataModelManagerInternal.tryPreferredInterfaces(wrap0::QueryInterface); - } - finally { - wrap0.Release(); - } - WrapIDebugHost wrap1 = new WrapIDebugHost(ppHost.getValue()); - try { - host = DebugHostInternal.tryPreferredInterfaces(wrap1::QueryInterface); - } - finally { - wrap1.Release(); - } - } - - @Override - public DataModelManager1 getManager() { - return manager; - } - - @Override - public DebugHost getHost() { - return host; - } - - @Override - public DebugClient getClient() { - return debugClient; - } - - @Override - public void setClient(DebugClient debugClient) { - this.debugClient = debugClient; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/bridge/HostDataModelAccessInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/bridge/HostDataModelAccessInternal.java deleted file mode 100644 index 2b38de6f8a..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/bridge/HostDataModelAccessInternal.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.bridge; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.bridge.HostDataModelAccess; -import agent.dbgmodel.jna.dbgmodel.bridge.IHostDataModelAccess; -import agent.dbgmodel.jna.dbgmodel.bridge.WrapIHostDataModelAccess; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface HostDataModelAccessInternal extends HostDataModelAccess { - Map CACHE = new WeakValueHashMap<>(); - - static HostDataModelAccessInternal instanceFor(WrapIHostDataModelAccess data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, HostDataModelAccessImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IHostDataModelAccess.IID_IHOST_DATA_MODEL_ACCESS, - WrapIHostDataModelAccess.class)); - - static HostDataModelAccessInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(HostDataModelAccessInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/ComparableConceptImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/ComparableConceptImpl.java deleted file mode 100644 index 476cf6e279..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/ComparableConceptImpl.java +++ /dev/null @@ -1,64 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.concept; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.WinDef.ULONGByReference; - -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.dbgmodel.main.KeyStore; -import agent.dbgmodel.dbgmodel.main.ModelObject; -import agent.dbgmodel.jna.dbgmodel.concept.IComparableConcept; - -import com.sun.jna.platform.win32.COM.COMUtils; - -public class ComparableConceptImpl implements ComparableConceptInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IComparableConcept jnaData; - private KeyStore metadata; - - public ComparableConceptImpl(IComparableConcept jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public int compareObjects(ModelObject contextObject, ModelObject otherObject) { - Pointer pContextObject = contextObject.getPointer(); - Pointer pOtherObject = otherObject.getPointer(); - ULONGByReference pulComparisonResult = new ULONGByReference(); - COMUtils.checkRC(jnaData.CompareObjects(pContextObject, pOtherObject, pulComparisonResult)); - return pulComparisonResult.getValue().intValue(); - } - - @Override - public KeyStore getMetadata() { - return metadata; - } - - @Override - public void setMetadata(KeyStore metdata) { - this.metadata = metdata; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/ComparableConceptInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/ComparableConceptInternal.java deleted file mode 100644 index 4d1ee354e1..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/ComparableConceptInternal.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.concept; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.concept.ComparableConcept; -import agent.dbgmodel.jna.dbgmodel.concept.IComparableConcept; -import agent.dbgmodel.jna.dbgmodel.concept.WrapIComparableConcept; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface ComparableConceptInternal extends ComparableConcept { - Map CACHE = new WeakValueHashMap<>(); - - static ComparableConceptInternal instanceFor(WrapIComparableConcept data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, ComparableConceptImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IComparableConcept.IID_ICOMPARABLE_CONCEPT, WrapIComparableConcept.class)); - - static ComparableConceptInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(ComparableConceptInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/DataModelConceptImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/DataModelConceptImpl.java deleted file mode 100644 index 385dc2f539..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/DataModelConceptImpl.java +++ /dev/null @@ -1,79 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.concept; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.OleAuto; -import com.sun.jna.platform.win32.WTypes.BSTR; -import com.sun.jna.platform.win32.WTypes.BSTRByReference; -import com.sun.jna.platform.win32.COM.COMUtils; - -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.dbgmodel.debughost.DebugHostSymbolEnumerator; -import agent.dbgmodel.dbgmodel.debughost.DebugHostTypeSignature; -import agent.dbgmodel.dbgmodel.main.KeyStore; -import agent.dbgmodel.dbgmodel.main.ModelObject; -import agent.dbgmodel.jna.dbgmodel.concept.IDataModelConcept; - -public class DataModelConceptImpl implements DataModelConceptInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IDataModelConcept jnaData; - private KeyStore metadata; - - public DataModelConceptImpl(IDataModelConcept jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public void initializeObject(ModelObject modelObject, - DebugHostTypeSignature matchingTypeSignature, - DebugHostSymbolEnumerator wildcardMatches) { - Pointer pModelObject = modelObject.getPointer(); - Pointer pMatchingTypeSignature = matchingTypeSignature.getPointer(); - Pointer pWildcardMatches = wildcardMatches.getPointer(); - COMUtils.checkRC( - jnaData.InitializeObject(pModelObject, pMatchingTypeSignature, pWildcardMatches)); - } - - @Override - public String getName() { - BSTRByReference bref = new BSTRByReference(); - COMUtils.checkRC(jnaData.GetName(bref)); - BSTR bstr = bref.getValue(); - String modelName = bstr.getValue(); - OleAuto.INSTANCE.SysFreeString(bstr); - return modelName; - } - - @Override - public KeyStore getMetadata() { - return metadata; - } - - @Override - public void setMetadata(KeyStore metdata) { - this.metadata = metdata; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/DataModelConceptInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/DataModelConceptInternal.java deleted file mode 100644 index 3a60e83f80..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/DataModelConceptInternal.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.concept; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.concept.DataModelConcept; -import agent.dbgmodel.jna.dbgmodel.concept.IDataModelConcept; -import agent.dbgmodel.jna.dbgmodel.concept.WrapIDataModelConcept; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DataModelConceptInternal extends DataModelConcept { - Map CACHE = new WeakValueHashMap<>(); - - static DataModelConceptInternal instanceFor(WrapIDataModelConcept data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DataModelConceptImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IDataModelConcept.IID_IDATA_MODEL_CONCEPT, WrapIDataModelConcept.class)); - - static DataModelConceptInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(DataModelConceptInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/DynamicConceptProviderConceptImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/DynamicConceptProviderConceptImpl.java deleted file mode 100644 index d8b1e3174b..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/DynamicConceptProviderConceptImpl.java +++ /dev/null @@ -1,128 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.concept; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.Guid.REFIID; -import com.sun.jna.platform.win32.WinDef.BOOLByReference; -import com.sun.jna.platform.win32.COM.COMUtils; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.UnknownEx; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.dbgmodel.main.KeyStore; -import agent.dbgmodel.dbgmodel.main.ModelObject; -import agent.dbgmodel.impl.dbgmodel.UnknownExInternal; -import agent.dbgmodel.impl.dbgmodel.main.KeyStoreInternal; -import agent.dbgmodel.jna.dbgmodel.WrapIUnknownEx; -import agent.dbgmodel.jna.dbgmodel.concept.IDynamicConceptProviderConcept; -import agent.dbgmodel.jna.dbgmodel.main.WrapIKeyStore; - -public class DynamicConceptProviderConceptImpl implements DynamicConceptProviderConceptInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IDynamicConceptProviderConcept jnaData; - - // TODO: creates IUnknown - //private UnknownInternal conceptInterface; - private UnknownEx conceptInterface; - private KeyStore conceptMetadata; - private KeyStore metadata; - - public DynamicConceptProviderConceptImpl(IDynamicConceptProviderConcept jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public boolean getConcept(ModelObject contextObject, REFIID conceptId) { - Pointer pContextObject = contextObject.getPointer(); - PointerByReference ppConceptInterface = new PointerByReference(); - PointerByReference ppConceptMetadata = new PointerByReference(); - BOOLByReference pHasConcept = new BOOLByReference(); - COMUtils.checkRC(jnaData.GetConcept(pContextObject, conceptId, ppConceptInterface, - ppConceptMetadata, pHasConcept)); - - WrapIUnknownEx wrap0 = new WrapIUnknownEx(ppConceptInterface.getValue()); - try { - conceptInterface = UnknownExInternal.tryPreferredInterfaces(wrap0::QueryInterface); - } - finally { - wrap0.Release(); - } - WrapIKeyStore wrap1 = new WrapIKeyStore(ppConceptInterface.getValue()); - try { - conceptMetadata = KeyStoreInternal.tryPreferredInterfaces(wrap1::QueryInterface); - } - finally { - wrap1.Release(); - } - - return pHasConcept.getValue().booleanValue(); - } - - @Override - public void setConcept(ModelObject contextObject, REFIID conceptId, UnknownEx conceptInterface, - KeyStore conceptMetadata) { - Pointer pContextObject = contextObject.getPointer(); - Pointer pConceptInterface = conceptInterface.getPointer(); - Pointer pConceptMetadata = conceptMetadata.getPointer(); - COMUtils.checkRC( - jnaData.SetConcept(pContextObject, conceptId, pConceptInterface, pConceptMetadata)); - } - - @Override - public void notifyParent(ModelObject parentModel) { - Pointer pParentModel = parentModel.getPointer(); - COMUtils.checkRC(jnaData.NotifyParent(pParentModel)); - } - - @Override - public void notifyParentChange(ModelObject parentModel) { - Pointer pParentModel = parentModel.getPointer(); - COMUtils.checkRC(jnaData.NotifyParent(pParentModel)); - } - - @Override - public void notifyDestruct() { - COMUtils.checkRC(jnaData.NotifyDestruct()); - } - - public UnknownEx getConceptInterface() { - return conceptInterface; - } - - public KeyStore getConceptMetadata() { - return conceptMetadata; - } - - @Override - public KeyStore getMetadata() { - return metadata; - } - - @Override - public void setMetadata(KeyStore metdata) { - this.metadata = metdata; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/DynamicConceptProviderConceptInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/DynamicConceptProviderConceptInternal.java deleted file mode 100644 index a8e2eeb5de..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/DynamicConceptProviderConceptInternal.java +++ /dev/null @@ -1,48 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.concept; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.concept.DynamicConceptProviderConcept; -import agent.dbgmodel.jna.dbgmodel.concept.IDynamicConceptProviderConcept; -import agent.dbgmodel.jna.dbgmodel.concept.WrapIDynamicConceptProviderConcept; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DynamicConceptProviderConceptInternal extends DynamicConceptProviderConcept { - Map CACHE = new WeakValueHashMap<>(); - - static DynamicConceptProviderConceptInternal instanceFor( - WrapIDynamicConceptProviderConcept data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DynamicConceptProviderConceptImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IDynamicConceptProviderConcept.IID_IDYNAMIC_CONCEPT_PROVIDER_CONCEPT, - WrapIDynamicConceptProviderConcept.class)); - - static DynamicConceptProviderConceptInternal tryPreferredInterfaces( - InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(DynamicConceptProviderConceptInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/DynamicKeyProviderConceptImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/DynamicKeyProviderConceptImpl.java deleted file mode 100644 index bbda3c9dbd..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/DynamicKeyProviderConceptImpl.java +++ /dev/null @@ -1,101 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.concept; - -import com.sun.jna.Pointer; -import com.sun.jna.WString; -import com.sun.jna.platform.win32.WinDef.BOOLByReference; -import com.sun.jna.platform.win32.COM.COMUtils; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.dbgmodel.main.*; -import agent.dbgmodel.impl.dbgmodel.main.KeyEnumeratorInternal; -import agent.dbgmodel.impl.dbgmodel.main.ModelObjectImpl; -import agent.dbgmodel.jna.dbgmodel.concept.IDynamicKeyProviderConcept; -import agent.dbgmodel.jna.dbgmodel.main.WrapIKeyEnumerator; - -public class DynamicKeyProviderConceptImpl implements DynamicKeyProviderConceptInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IDynamicKeyProviderConcept jnaData; - private ModelObject keyValue; - private KeyStore metadata; - - public DynamicKeyProviderConceptImpl(IDynamicKeyProviderConcept jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public boolean getKey(ModelObject contextObject, WString key) { - Pointer pContextObject = contextObject.getPointer(); - PointerByReference ppKeyValue = new PointerByReference(); - PointerByReference ppMetadata = new PointerByReference(); - BOOLByReference pHasKey = new BOOLByReference(); - COMUtils.checkRC(jnaData.GetKey(pContextObject, key, ppKeyValue, ppMetadata, pHasKey)); - - keyValue = ModelObjectImpl.getObjectWithMetadata(ppKeyValue, ppMetadata); - - return pHasKey.getValue().booleanValue(); - } - - @Override - public void setKey(ModelObject contextObject, WString key, ModelObject keyValue, - KeyStore conceptMetadata) { - Pointer pContextObject = contextObject.getPointer(); - Pointer pKeyValue = keyValue.getPointer(); - Pointer pMetadata = conceptMetadata.getPointer(); - COMUtils.checkRC( - jnaData.SetKey(pContextObject, key, pKeyValue, pMetadata)); - } - - @Override - public KeyEnumerator EnumerateKeys(ModelObject contextObject) { - Pointer pContextObject = contextObject.getPointer(); - PointerByReference ppEnumerator = new PointerByReference(); - COMUtils.checkRC(jnaData.EnumerateKeys(pContextObject, ppEnumerator)); - - WrapIKeyEnumerator wrap = new WrapIKeyEnumerator(ppEnumerator.getValue()); - try { - return KeyEnumeratorInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - public ModelObject getKeyValue() { - return keyValue; - } - - @Override - public KeyStore getMetadata() { - return metadata; - } - - @Override - public void setMetadata(KeyStore metdata) { - this.metadata = metdata; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/DynamicKeyProviderConceptInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/DynamicKeyProviderConceptInternal.java deleted file mode 100644 index 26128e5efd..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/DynamicKeyProviderConceptInternal.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.concept; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.concept.DynamicKeyProviderConcept; -import agent.dbgmodel.jna.dbgmodel.concept.IDynamicKeyProviderConcept; -import agent.dbgmodel.jna.dbgmodel.concept.WrapIDynamicKeyProviderConcept; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DynamicKeyProviderConceptInternal extends DynamicKeyProviderConcept { - Map CACHE = new WeakValueHashMap<>(); - - static DynamicKeyProviderConceptInternal instanceFor(WrapIDynamicKeyProviderConcept data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DynamicKeyProviderConceptImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IDynamicKeyProviderConcept.IID_IDYNAMIC_KEY_PROVIDER_CONCEPT, - WrapIDynamicKeyProviderConcept.class)); - - static DynamicKeyProviderConceptInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(DynamicKeyProviderConceptInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/EquatableConceptImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/EquatableConceptImpl.java deleted file mode 100644 index 4e4681b442..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/EquatableConceptImpl.java +++ /dev/null @@ -1,64 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.concept; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.WinDef.BOOLByReference; - -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.dbgmodel.main.KeyStore; -import agent.dbgmodel.dbgmodel.main.ModelObject; -import agent.dbgmodel.jna.dbgmodel.concept.IEquatableConcept; - -import com.sun.jna.platform.win32.COM.COMUtils; - -public class EquatableConceptImpl implements EquatableConceptInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IEquatableConcept jnaData; - private KeyStore metadata; - - public EquatableConceptImpl(IEquatableConcept jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public boolean areObjectsEqual(ModelObject contextObject, ModelObject otherObject) { - Pointer pContextObject = contextObject.getPointer(); - Pointer pOtherObject = otherObject.getPointer(); - BOOLByReference pIsEqual = new BOOLByReference(); - COMUtils.checkRC(jnaData.AreObjectsEqual(pContextObject, pOtherObject, pIsEqual)); - return pIsEqual.getValue().booleanValue(); - } - - @Override - public KeyStore getMetadata() { - return metadata; - } - - @Override - public void setMetadata(KeyStore metdata) { - this.metadata = metdata; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/EquatableConceptInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/EquatableConceptInternal.java deleted file mode 100644 index 2921b43dd5..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/EquatableConceptInternal.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.concept; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.concept.EquatableConcept; -import agent.dbgmodel.jna.dbgmodel.concept.IEquatableConcept; -import agent.dbgmodel.jna.dbgmodel.concept.WrapIEquatableConcept; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface EquatableConceptInternal extends EquatableConcept { - Map CACHE = new WeakValueHashMap<>(); - - static EquatableConceptInternal instanceFor(WrapIEquatableConcept data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, EquatableConceptImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IEquatableConcept.IID_IEQUATABLE_CONCEPT, WrapIEquatableConcept.class)); - - static EquatableConceptInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(EquatableConceptInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/IndexableConceptImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/IndexableConceptImpl.java deleted file mode 100644 index 0b281bf6d8..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/IndexableConceptImpl.java +++ /dev/null @@ -1,85 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.concept; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.WinDef.ULONGLONG; -import com.sun.jna.platform.win32.WinDef.ULONGLONGByReference; -import com.sun.jna.platform.win32.COM.COMUtils; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.dbgmodel.main.KeyStore; -import agent.dbgmodel.dbgmodel.main.ModelObject; -import agent.dbgmodel.impl.dbgmodel.main.ModelObjectImpl; -import agent.dbgmodel.jna.dbgmodel.concept.IIndexableConcept; - -public class IndexableConceptImpl implements IndexableConceptInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IIndexableConcept jnaData; - - private ModelObject indexers; - private KeyStore metadata; - - public IndexableConceptImpl(IIndexableConcept jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public long getDimensionality(ModelObject contextObject) { - Pointer pContextObject = contextObject.getPointer(); - ULONGLONGByReference pDimensionality = new ULONGLONGByReference(); - COMUtils.checkRC(jnaData.GetDimensionality(pContextObject, pDimensionality)); - return pDimensionality.getValue().longValue(); - } - - @Override - public ModelObject getAt(ModelObject contextObject, long indexerCount, - Pointer[] ppIndexers) { - Pointer pContextObject = contextObject.getPointer(); - ULONGLONG ulIndexerCount = new ULONGLONG(indexerCount); - PointerByReference ppObject = new PointerByReference(); - PointerByReference ppMetadata = new PointerByReference(); - COMUtils.checkRC( - jnaData.GetAt(pContextObject, ulIndexerCount, ppIndexers, - ppObject, ppMetadata)); - - return ModelObjectImpl.getObjectWithMetadata(ppObject, ppMetadata); - } - - public ModelObject getIndexers() { - return indexers; - } - - @Override - public KeyStore getMetadata() { - return metadata; - } - - @Override - public void setMetadata(KeyStore metdata) { - this.metadata = metdata; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/IndexableConceptInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/IndexableConceptInternal.java deleted file mode 100644 index c348a20910..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/IndexableConceptInternal.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.concept; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.concept.IndexableConcept; -import agent.dbgmodel.jna.dbgmodel.concept.IIndexableConcept; -import agent.dbgmodel.jna.dbgmodel.concept.WrapIIndexableConcept; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface IndexableConceptInternal extends IndexableConcept { - Map CACHE = new WeakValueHashMap<>(); - - static IndexableConceptInternal instanceFor(WrapIIndexableConcept data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, IndexableConceptImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IIndexableConcept.IID_IINDEXABLE_CONCEPT, WrapIIndexableConcept.class)); - - static IndexableConceptInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(IndexableConceptInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/IterableConceptImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/IterableConceptImpl.java deleted file mode 100644 index f80e80dfaf..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/IterableConceptImpl.java +++ /dev/null @@ -1,99 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.concept; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.WinDef.ULONGLONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.platform.win32.COM.COMUtils; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.dbgmodel.COMUtilsExtra; -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.dbgmodel.main.*; -import agent.dbgmodel.impl.dbgmodel.main.ModelIteratorInternal; -import agent.dbgmodel.jna.dbgmodel.concept.IIterableConcept; -import agent.dbgmodel.jna.dbgmodel.main.WrapIModelIterator; -import ghidra.util.Msg; - -public class IterableConceptImpl implements IterableConceptInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IIterableConcept jnaData; - - private ModelIterator iterator; - private KeyStore metadata; - - public IterableConceptImpl(IIterableConcept jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public long getDefaultIndexDimensionality(ModelObject contextObject) { - Pointer pContextObject = contextObject.getPointer(); - ULONGLONGByReference pDimensionality = new ULONGLONGByReference(); - COMUtils.checkRC(jnaData.GetDefaultIndexDimensionality(pContextObject, pDimensionality)); - return pDimensionality.getValue().longValue(); - } - - @Override - public ModelIterator getIterator(ModelObject contextObject) { - Pointer pContextObject = contextObject.getPointer(); - PointerByReference ppIndexers = new PointerByReference(); - HRESULT hr = jnaData.GetIterator(pContextObject, ppIndexers); - if (hr.equals(COMUtilsExtra.E_FAIL)) { - return null; - } - if (hr.equals(COMUtilsExtra.E_BOUNDS)) { - Msg.error(this, "iterator out of bounds - check symbol path"); - return null; - } - if (hr.equals(COMUtilsExtra.E_COM_EXC)) { - return null; - } - COMUtils.checkRC(hr); - - WrapIModelIterator wrap = new WrapIModelIterator(ppIndexers.getValue()); - try { - return ModelIteratorInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - public ModelIterator getIterator() { - return iterator; - } - - @Override - public KeyStore getMetadata() { - return metadata; - } - - @Override - public void setMetadata(KeyStore metdata) { - this.metadata = metdata; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/IterableConceptInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/IterableConceptInternal.java deleted file mode 100644 index d71e21f782..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/IterableConceptInternal.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.concept; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.concept.IterableConcept; -import agent.dbgmodel.jna.dbgmodel.concept.IIterableConcept; -import agent.dbgmodel.jna.dbgmodel.concept.WrapIIterableConcept; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface IterableConceptInternal extends IterableConcept { - Map CACHE = new WeakValueHashMap<>(); - - static IterableConceptInternal instanceFor(WrapIIterableConcept data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, IterableConceptImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IIterableConcept.IID_IITERABLE_CONCEPT, WrapIIterableConcept.class)); - - static IterableConceptInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(IterableConceptInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/PreferredRuntimeTypeConceptImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/PreferredRuntimeTypeConceptImpl.java deleted file mode 100644 index e1886257f0..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/PreferredRuntimeTypeConceptImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.concept; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.COM.COMUtils; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.dbgmodel.main.KeyStore; -import agent.dbgmodel.dbgmodel.main.ModelObject; -import agent.dbgmodel.impl.dbgmodel.main.ModelObjectInternal; -import agent.dbgmodel.jna.dbgmodel.concept.IPreferredRuntimeTypeConcept; -import agent.dbgmodel.jna.dbgmodel.main.WrapIModelObject; - -public class PreferredRuntimeTypeConceptImpl implements PreferredRuntimeTypeConceptInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IPreferredRuntimeTypeConcept jnaData; - private KeyStore metadata; - - public PreferredRuntimeTypeConceptImpl(IPreferredRuntimeTypeConcept jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public ModelObject CastToPreferredRuntimeType(ModelObject contextObject) { - Pointer pContextObject = contextObject.getPointer(); - PointerByReference ppObject = new PointerByReference(); - COMUtils.checkRC(jnaData.CastToPreferredRuntimeType(pContextObject, ppObject)); - - WrapIModelObject wrap = new WrapIModelObject(ppObject.getValue()); - try { - return ModelObjectInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public KeyStore getMetadata() { - return metadata; - } - - @Override - public void setMetadata(KeyStore metdata) { - this.metadata = metdata; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/PreferredRuntimeTypeConceptInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/PreferredRuntimeTypeConceptInternal.java deleted file mode 100644 index bb8b476ee0..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/PreferredRuntimeTypeConceptInternal.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.concept; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.concept.PreferredRuntimeTypeConcept; -import agent.dbgmodel.jna.dbgmodel.concept.IPreferredRuntimeTypeConcept; -import agent.dbgmodel.jna.dbgmodel.concept.WrapIPreferredRuntimeTypeConcept; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface PreferredRuntimeTypeConceptInternal extends PreferredRuntimeTypeConcept { - Map CACHE = new WeakValueHashMap<>(); - - static PreferredRuntimeTypeConceptInternal instanceFor(WrapIPreferredRuntimeTypeConcept data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, PreferredRuntimeTypeConceptImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IPreferredRuntimeTypeConcept.IID_IPREFERRED_RUNTIME_TYPE_CONCEPT, - WrapIPreferredRuntimeTypeConcept.class)); - - static PreferredRuntimeTypeConceptInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(PreferredRuntimeTypeConceptInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/StringDisplayableConceptImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/StringDisplayableConceptImpl.java deleted file mode 100644 index 411988674a..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/StringDisplayableConceptImpl.java +++ /dev/null @@ -1,68 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.concept; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.OleAuto; -import com.sun.jna.platform.win32.WTypes.BSTR; -import com.sun.jna.platform.win32.WTypes.BSTRByReference; -import com.sun.jna.platform.win32.COM.COMUtils; - -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.dbgmodel.main.KeyStore; -import agent.dbgmodel.dbgmodel.main.ModelObject; -import agent.dbgmodel.jna.dbgmodel.concept.IStringDisplayableConcept; - -public class StringDisplayableConceptImpl implements StringDisplayableConceptInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IStringDisplayableConcept jnaData; - private KeyStore metadata; - - public StringDisplayableConceptImpl(IStringDisplayableConcept jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public String toDisplayString(ModelObject contextObject, KeyStore mdata) { - Pointer pContextObject = contextObject.getPointer(); - Pointer pMetadata = (mdata == null) ? null : mdata.getPointer(); - BSTRByReference bref = new BSTRByReference(); - COMUtils.checkRC(jnaData.ToDisplayString(pContextObject, pMetadata, bref)); - BSTR bstr = bref.getValue(); - String displayString = bstr.getValue(); - OleAuto.INSTANCE.SysFreeString(bstr); - return displayString; - } - - @Override - public KeyStore getMetadata() { - return metadata; - } - - @Override - public void setMetadata(KeyStore metdata) { - this.metadata = metdata; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/StringDisplayableConceptInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/StringDisplayableConceptInternal.java deleted file mode 100644 index 416bbc922e..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/concept/StringDisplayableConceptInternal.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.concept; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.concept.StringDisplayableConcept; -import agent.dbgmodel.jna.dbgmodel.concept.IStringDisplayableConcept; -import agent.dbgmodel.jna.dbgmodel.concept.WrapIStringDisplayableConcept; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface StringDisplayableConceptInternal extends StringDisplayableConcept { - Map CACHE = new WeakValueHashMap<>(); - - static StringDisplayableConceptInternal instanceFor(WrapIStringDisplayableConcept data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, StringDisplayableConceptImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IStringDisplayableConcept.IID_ISTRING_DISPLAYABLE_CONCEPT, - WrapIStringDisplayableConcept.class)); - - static StringDisplayableConceptInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(StringDisplayableConceptInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/DataModelManagerImpl1.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/DataModelManagerImpl1.java deleted file mode 100644 index e19f33bf81..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/DataModelManagerImpl1.java +++ /dev/null @@ -1,341 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.datamodel; - -import com.sun.jna.Pointer; -import com.sun.jna.WString; -import com.sun.jna.platform.win32.Variant.VARIANT; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.platform.win32.COM.COMUtils; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.dbgmodel.concept.DataModelConcept; -import agent.dbgmodel.dbgmodel.datamodel.script.DataModelScriptManager; -import agent.dbgmodel.dbgmodel.debughost.*; -import agent.dbgmodel.dbgmodel.main.KeyStore; -import agent.dbgmodel.dbgmodel.main.ModelObject; -import agent.dbgmodel.impl.dbgmodel.datamodel.script.DataModelScriptManagerInternal; -import agent.dbgmodel.impl.dbgmodel.debughost.DebugHostSymbolEnumeratorInternal; -import agent.dbgmodel.impl.dbgmodel.debughost.DebugHostTypeSignatureInternal; -import agent.dbgmodel.impl.dbgmodel.main.KeyStoreInternal; -import agent.dbgmodel.impl.dbgmodel.main.ModelObjectInternal; -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.LOCATION; -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.ModelObjectKind; -import agent.dbgmodel.jna.dbgmodel.datamodel.IDataModelManager1; -import agent.dbgmodel.jna.dbgmodel.main.WrapIKeyStore; -import agent.dbgmodel.jna.dbgmodel.main.WrapIModelObject; - -public class DataModelManagerImpl1 implements DataModelManagerInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IDataModelManager1 jnaData; - private DebugHostTypeSignatureInternal typeSignature; - private DebugHostSymbolEnumeratorInternal wildcardMatches; - - public DataModelManagerImpl1(IDataModelManager1 jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public void close() { - COMUtils.checkRC(jnaData.Close()); - } - - @Override - public ModelObject createNoValue() { - PointerByReference ppContextObject = new PointerByReference(); - COMUtils.checkRC(jnaData.CreateNoValue(ppContextObject)); - - WrapIModelObject wrap = new WrapIModelObject(ppContextObject.getValue()); - try { - return ModelObjectInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public ModelObject createErrorObject(HRESULT hrError, WString pwszMessage) { - PointerByReference ppContextObject = new PointerByReference(); - COMUtils.checkRC(jnaData.CreateErrorObject(hrError, pwszMessage, ppContextObject)); - - WrapIModelObject wrap = new WrapIModelObject(ppContextObject.getValue()); - try { - return ModelObjectInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public ModelObject createTypedObject(DebugHostContext context, LOCATION objectLocation, - DebugHostType1 objectType) { - Pointer pContext = context.getPointer(); - Pointer pObjectType = objectType.getPointer(); - PointerByReference ppObject = new PointerByReference(); - COMUtils.checkRC( - jnaData.CreateTypedObject(pContext, objectLocation, pObjectType, ppObject)); - - WrapIModelObject wrap = new WrapIModelObject(ppObject.getValue()); - try { - return ModelObjectInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public ModelObject createTypedObjectReference(DebugHostContext context, LOCATION objectLocation, - DebugHostType1 objectType) { - Pointer pContext = context.getPointer(); - Pointer pObjectType = context.getPointer(); - PointerByReference ppObject = new PointerByReference(); - COMUtils.checkRC( - jnaData.CreateTypedObjectReference(pContext, objectLocation, pObjectType, ppObject)); - - WrapIModelObject wrap = new WrapIModelObject(ppObject.getValue()); - try { - return ModelObjectInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public ModelObject createSyntheticObject(DebugHostContext context) { - Pointer pContext = context.getPointer(); - PointerByReference ppObject = new PointerByReference(); - COMUtils.checkRC(jnaData.CreateSyntheticObject(pContext, ppObject)); - - WrapIModelObject wrap = new WrapIModelObject(ppObject.getValue()); - try { - return ModelObjectInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public ModelObject createDataModelObject(DataModelConcept dataModel) { - Pointer pDataModel = dataModel.getPointer(); - PointerByReference ppObject = new PointerByReference(); - COMUtils.checkRC(jnaData.CreateDataModelObject(pDataModel, ppObject)); - - WrapIModelObject wrap = new WrapIModelObject(ppObject.getValue()); - try { - return ModelObjectInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public ModelObject createIntrinsicObject(ModelObjectKind objectKind, - VARIANT.ByReference intrinsicData) { - PointerByReference ppObject = new PointerByReference(); - COMUtils.checkRC(jnaData.CreateIntrinsicObject(objectKind, intrinsicData, ppObject)); - - WrapIModelObject wrap = new WrapIModelObject(ppObject.getValue()); - try { - return ModelObjectInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public ModelObject createTypedIntrinsicObject(VARIANT.ByReference intrinsicData, - DebugHostType1 type) { - Pointer pType = type.getPointer(); - PointerByReference ppObject = new PointerByReference(); - COMUtils.checkRC(jnaData.CreateTypedIntrinsicObject(intrinsicData, pType, ppObject)); - - WrapIModelObject wrap = new WrapIModelObject(ppObject.getValue()); - try { - return ModelObjectInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public ModelObject getModelForTypeSignature(DebugHostTypeSignature typeSignature) { - Pointer pTypeSignature = typeSignature.getPointer(); - PointerByReference ppObject = new PointerByReference(); - COMUtils.checkRC(jnaData.GetModelForTypeSignature(pTypeSignature, ppObject)); - - WrapIModelObject wrap = new WrapIModelObject(ppObject.getValue()); - try { - return ModelObjectInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public ModelObject getModelForType(DebugHostType1 type) { - Pointer pType = type.getPointer(); - PointerByReference ppObject = new PointerByReference(); - PointerByReference ppTypeSignature = new PointerByReference(); - PointerByReference ppWildcardMatches = new PointerByReference(); - COMUtils.checkRC( - jnaData.GetModelForType(pType, ppObject, ppTypeSignature, ppWildcardMatches)); - - WrapIModelObject wrap0 = new WrapIModelObject(ppTypeSignature.getValue()); - try { - typeSignature = - DebugHostTypeSignatureInternal.tryPreferredInterfaces(wrap0::QueryInterface); - } - finally { - wrap0.Release(); - } - WrapIModelObject wrap1 = new WrapIModelObject(ppWildcardMatches.getValue()); - try { - wildcardMatches = - DebugHostSymbolEnumeratorInternal.tryPreferredInterfaces(wrap1::QueryInterface); - } - finally { - wrap1.Release(); - } - WrapIModelObject wrap = new WrapIModelObject(ppObject.getValue()); - try { - return ModelObjectInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public void registerModelForTypeSignature(DebugHostTypeSignature typeSignature, - ModelObject dataModel) { - Pointer pTypeSignature = typeSignature.getPointer(); - Pointer pDataModel = dataModel.getPointer(); - COMUtils.checkRC(jnaData.RegisterModelForTypeSignature(pTypeSignature, pDataModel)); - } - - @Override - public void unregisterModelForTypeSignature(ModelObject dataModel, - DebugHostTypeSignature typeSignature) { - Pointer pDataModel = dataModel.getPointer(); - Pointer pTypeSignature = typeSignature.getPointer(); - COMUtils.checkRC(jnaData.UnregisterModelForTypeSignature(pDataModel, pTypeSignature)); - } - - @Override - public void registerExtensionForTypeSignature(DebugHostTypeSignature typeSignature, - ModelObject dataModel) { - Pointer pTypeSignature = typeSignature.getPointer(); - Pointer pDataModel = dataModel.getPointer(); - COMUtils.checkRC(jnaData.RegisterExtensionForTypeSignature(pTypeSignature, pDataModel)); - } - - @Override - public void unregisterExtensionForTypeSignature(ModelObject dataModel, - DebugHostTypeSignature typeSignature) { - Pointer pDataModel = dataModel.getPointer(); - Pointer pTypeSignature = typeSignature.getPointer(); - COMUtils.checkRC(jnaData.UnregisterExtensionForTypeSignature(pDataModel, pTypeSignature)); - } - - @Override - public KeyStore createMetadataStore(KeyStore parentStore) { - Pointer pParentStore = parentStore.getPointer(); - PointerByReference ppMetadataStore = new PointerByReference(); - COMUtils.checkRC(jnaData.CreateMetadataStore(pParentStore, ppMetadataStore)); - - WrapIKeyStore wrap = new WrapIKeyStore(ppMetadataStore.getValue()); - try { - return KeyStoreInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public ModelObject getRootNamespace() { - PointerByReference ppObject = new PointerByReference(); - COMUtils.checkRC(jnaData.GetRootNamespace(ppObject)); - - Pointer value = ppObject.getValue(); - if (value == null) { - return null; - } - WrapIModelObject wrap = new WrapIModelObject(value); - try { - return ModelObjectInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public void registerNamedModel(WString modelName, ModelObject modelObject) { - Pointer pModelObject = modelObject.getPointer(); - COMUtils.checkRC(jnaData.RegisterNamedModel(modelName, pModelObject)); - } - - @Override - public void unregisterNamedModel(WString modelName) { - COMUtils.checkRC(jnaData.UnregisterNamedModel(modelName)); - } - - @Override - public ModelObject acquireNamedModel(WString modelName) { - PointerByReference ppModelObject = new PointerByReference(); - COMUtils.checkRC(jnaData.AcquireNamedModel(modelName, ppModelObject)); - - WrapIModelObject wrap = new WrapIModelObject(ppModelObject.getValue()); - try { - return ModelObjectInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - public DebugHostTypeSignatureInternal getTypeSignature() { - return typeSignature; - } - - public DebugHostSymbolEnumeratorInternal getWildcardMatches() { - return wildcardMatches; - } - - @Override - public DataModelScriptManager asScriptManager() { - return DataModelScriptManagerInternal.tryPreferredInterfaces(jnaData::QueryInterface); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/DataModelManagerImpl2.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/DataModelManagerImpl2.java deleted file mode 100644 index cdf5e044cc..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/DataModelManagerImpl2.java +++ /dev/null @@ -1,82 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.datamodel; - -import com.sun.jna.Pointer; -import com.sun.jna.WString; -import com.sun.jna.platform.win32.Variant.VARIANT; -import com.sun.jna.platform.win32.COM.COMUtils; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.dbgmodel.datamodel.DataModelManager2; -import agent.dbgmodel.dbgmodel.debughost.DebugHostContext; -import agent.dbgmodel.dbgmodel.debughost.DebugHostType1; -import agent.dbgmodel.dbgmodel.main.KeyStore; -import agent.dbgmodel.dbgmodel.main.ModelObject; -import agent.dbgmodel.impl.dbgmodel.main.ModelObjectInternal; -import agent.dbgmodel.jna.dbgmodel.datamodel.IDataModelManager2; -import agent.dbgmodel.jna.dbgmodel.main.WrapIModelObject; - -public class DataModelManagerImpl2 extends DataModelManagerImpl1 implements DataModelManager2 { - @SuppressWarnings("unused") - private final IDataModelManager2 jnaData; - - public DataModelManagerImpl2(IDataModelManager2 jnaData) { - super(jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public ModelObject acquireSubNamespace(WString modelName, WString subNamespaceModelName, - WString accessName, KeyStore metadata) { - Pointer pMetadata = metadata.getPointer(); - PointerByReference ppNamespaceModelObject = new PointerByReference(); - COMUtils.checkRC(jnaData.AcquireSubNamespace(modelName, subNamespaceModelName, accessName, - pMetadata, ppNamespaceModelObject)); - - WrapIModelObject wrap = new WrapIModelObject(ppNamespaceModelObject.getValue()); - try { - return ModelObjectInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public ModelObject createTypedIntrinsicObjectEx(DebugHostContext context, - VARIANT.ByReference intrinsicData, DebugHostType1 type) { - Pointer pContext = context.getPointer(); - Pointer pType = type.getPointer(); - PointerByReference ppObject = new PointerByReference(); - COMUtils.checkRC( - jnaData.CreateTypedIntrinsicObjectEx(pContext, intrinsicData, pType, ppObject)); - - WrapIModelObject wrap = new WrapIModelObject(ppObject.getValue()); - try { - return ModelObjectInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/DataModelManagerInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/DataModelManagerInternal.java deleted file mode 100644 index 04589e0540..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/DataModelManagerInternal.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.datamodel; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.datamodel.DataModelManager1; -import agent.dbgmodel.jna.dbgmodel.datamodel.*; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DataModelManagerInternal extends DataModelManager1 { - Map CACHE = new WeakValueHashMap<>(); - - static DataModelManagerInternal instanceFor(WrapIDataModelManager1 data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DataModelManagerImpl1::new); - } - - static DataModelManagerInternal instanceFor(WrapIDataModelManager2 data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DataModelManagerImpl2::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IDataModelManager2.IID_IDATA_MODEL_MANAGER2, WrapIDataModelManager2.class), - new Preferred<>(IDataModelManager1.IID_IDATA_MODEL_MANAGER, WrapIDataModelManager1.class)); - - static DataModelManagerInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(DataModelManagerInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelNameBinderImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelNameBinderImpl.java deleted file mode 100644 index 74596cfe64..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelNameBinderImpl.java +++ /dev/null @@ -1,136 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.datamodel.script; - -import com.sun.jna.Pointer; -import com.sun.jna.WString; -import com.sun.jna.platform.win32.COM.COMUtils; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.dbgmodel.main.*; -import agent.dbgmodel.impl.dbgmodel.main.*; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.IDataModelNameBinder; -import agent.dbgmodel.jna.dbgmodel.main.*; - -public class DataModelNameBinderImpl implements DataModelNameBinderInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IDataModelNameBinder jnaData; - - private ModelObject value; - private KeyStore metadata; - private ModelObject reference; - - public DataModelNameBinderImpl(IDataModelNameBinder jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public void bindValue(ModelObject contextObject, WString name) { - Pointer pContextObject = contextObject.getPointer(); - PointerByReference ppValue = new PointerByReference(); - PointerByReference ppMetadata = new PointerByReference(); - COMUtils.checkRC(jnaData.BindValue(pContextObject, name, ppValue, ppMetadata)); - - WrapIModelObject wrap0 = new WrapIModelObject(ppMetadata.getValue()); - try { - value = ModelObjectInternal.tryPreferredInterfaces(wrap0::QueryInterface); - } - finally { - wrap0.Release(); - } - WrapIKeyStore wrap1 = new WrapIKeyStore(ppMetadata.getValue()); - try { - metadata = KeyStoreInternal.tryPreferredInterfaces(wrap1::QueryInterface); - } - finally { - wrap1.Release(); - } - } - - @Override - public void bindReference(ModelObject contextObject, WString name) { - Pointer pContextObject = contextObject.getPointer(); - PointerByReference ppReference = new PointerByReference(); - PointerByReference ppMetadata = new PointerByReference(); - COMUtils.checkRC(jnaData.BindReference(pContextObject, name, ppReference, ppMetadata)); - - WrapIModelObject wrap0 = new WrapIModelObject(ppMetadata.getValue()); - try { - reference = ModelObjectInternal.tryPreferredInterfaces(wrap0::QueryInterface); - } - finally { - wrap0.Release(); - } - WrapIKeyStore wrap1 = new WrapIKeyStore(ppMetadata.getValue()); - try { - metadata = KeyStoreInternal.tryPreferredInterfaces(wrap1::QueryInterface); - } - finally { - wrap1.Release(); - } - } - - @Override - public KeyEnumerator enumerateValues(ModelObject contextObject) { - Pointer pContextObject = contextObject.getPointer(); - PointerByReference ppEnumerator = new PointerByReference(); - COMUtils.checkRC(jnaData.EnumerateValues(pContextObject, ppEnumerator)); - - WrapIKeyEnumerator wrap = new WrapIKeyEnumerator(ppEnumerator.getValue()); - try { - return KeyEnumeratorInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public KeyEnumerator enumerateReferences(ModelObject contextObject) { - Pointer pContextObject = contextObject.getPointer(); - PointerByReference ppEnumerator = new PointerByReference(); - COMUtils.checkRC(jnaData.EnumerateReferences(pContextObject, ppEnumerator)); - - WrapIKeyEnumerator wrap = new WrapIKeyEnumerator(ppEnumerator.getValue()); - try { - return KeyEnumeratorInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - public ModelObject getValue() { - return value; - } - - public KeyStore getMetadata() { - return metadata; - } - - public ModelObject getReference() { - return reference; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelNameBinderInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelNameBinderInternal.java deleted file mode 100644 index 47c089d564..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelNameBinderInternal.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.datamodel.script; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.datamodel.script.DataModelNameBinder; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.IDataModelNameBinder; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.WrapIDataModelNameBinder; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DataModelNameBinderInternal extends DataModelNameBinder { - Map CACHE = new WeakValueHashMap<>(); - - static DataModelNameBinderInternal instanceFor(WrapIDataModelNameBinder data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DataModelNameBinderImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IDataModelNameBinder.IID_IDATA_MODEL_NAME_BINDER, - WrapIDataModelNameBinder.class)); - - static DataModelNameBinderInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(DataModelNameBinderInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptClientImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptClientImpl.java deleted file mode 100644 index afd21d2f22..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptClientImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.datamodel.script; - -import com.sun.jna.Pointer; -import com.sun.jna.WString; -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.IDataModelScriptClient; - -import com.sun.jna.platform.win32.COM.COMUtils; - -public class DataModelScriptClientImpl implements DataModelScriptClientInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IDataModelScriptClient jnaData; - - public DataModelScriptClientImpl(IDataModelScriptClient jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public void reportError(int errorClass, HRESULT hrFail, WString message, - int line, int position) { - ULONG ulErrorClass = new ULONG(errorClass); - ULONG ulLine = new ULONG(line); - ULONG ulPosition = new ULONG(position); - COMUtils.checkRC( - jnaData.ReportError(ulErrorClass, hrFail, message, ulLine, ulPosition)); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptClientInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptClientInternal.java deleted file mode 100644 index 6de1a6e747..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptClientInternal.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.datamodel.script; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.datamodel.script.DataModelScriptClient; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.IDataModelScriptClient; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.WrapIDataModelScriptClient; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DataModelScriptClientInternal extends DataModelScriptClient { - Map CACHE = new WeakValueHashMap<>(); - - static DataModelScriptClientInternal instanceFor(WrapIDataModelScriptClient data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DataModelScriptClientImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IDataModelScriptClient.IID_IDATA_MODEL_SCRIPT_CLIENT, - WrapIDataModelScriptClient.class)); - - static DataModelScriptClientInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(DataModelScriptClientInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptHostContextImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptHostContextImpl.java deleted file mode 100644 index fa01622053..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptHostContextImpl.java +++ /dev/null @@ -1,67 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.datamodel.script; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.COM.COMUtils; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.dbgmodel.datamodel.script.DataModelScript; -import agent.dbgmodel.dbgmodel.main.ModelObject; -import agent.dbgmodel.impl.dbgmodel.main.ModelObjectInternal; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.IDataModelScriptHostContext; -import agent.dbgmodel.jna.dbgmodel.main.WrapIModelObject; - -public class DataModelScriptHostContextImpl implements DataModelScriptHostContextInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IDataModelScriptHostContext jnaData; - - public DataModelScriptHostContextImpl(IDataModelScriptHostContext jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public void notifyScriptChange(DataModelScript script, int changeKind) { - Pointer pScript = script.getPointer(); - ULONG ulChangeKind = new ULONG(changeKind); - COMUtils.checkRC(jnaData.NotifyScriptChange(pScript, ulChangeKind)); - } - - @Override - public ModelObject getNamespaceObject() { - PointerByReference ppNamespaceObject = new PointerByReference(); - COMUtils.checkRC(jnaData.GetNamespaceObject(ppNamespaceObject)); - - WrapIModelObject wrap = new WrapIModelObject(ppNamespaceObject.getValue()); - try { - return ModelObjectInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptHostContextInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptHostContextInternal.java deleted file mode 100644 index a5ec3d9e5e..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptHostContextInternal.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.datamodel.script; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.datamodel.script.DataModelScriptHostContext; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.IDataModelScriptHostContext; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.WrapIDataModelScriptHostContext; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DataModelScriptHostContextInternal extends DataModelScriptHostContext { - Map CACHE = new WeakValueHashMap<>(); - - static DataModelScriptHostContextInternal instanceFor(WrapIDataModelScriptHostContext data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DataModelScriptHostContextImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IDataModelScriptHostContext.IID_IDATA_MODEL_SCRIPT_HOST_CONTEXT, - WrapIDataModelScriptHostContext.class)); - - static DataModelScriptHostContextInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(DataModelScriptHostContextInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptImpl.java deleted file mode 100644 index c3b5b2e7e0..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptImpl.java +++ /dev/null @@ -1,90 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.datamodel.script; - -import com.sun.jna.Pointer; -import com.sun.jna.WString; -import com.sun.jna.platform.win32.OleAuto; -import com.sun.jna.platform.win32.WTypes.BSTR; -import com.sun.jna.platform.win32.WTypes.BSTRByReference; -import com.sun.jna.platform.win32.WinDef.BOOLByReference; -import com.sun.jna.platform.win32.COM.COMUtils; - -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.dbgmodel.datamodel.script.DataModelScriptClient; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.IDataModelScript; - -public class DataModelScriptImpl implements DataModelScriptInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IDataModelScript jnaData; - - public DataModelScriptImpl(IDataModelScript jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public String getName() { - BSTRByReference bref = new BSTRByReference(); - COMUtils.checkRC(jnaData.GetName(bref)); - BSTR bstr = bref.getValue(); - String scriptName = bstr.getValue(); - OleAuto.INSTANCE.SysFreeString(bstr); - return scriptName; - } - - @Override - public void rename(WString scriptName) { - COMUtils.checkRC(jnaData.Rename(scriptName)); - } - - @Override - public void populate(Pointer contentStream) { - COMUtils.checkRC(jnaData.Populate(contentStream)); - } - - @Override - public void execute(DataModelScriptClient client) { - Pointer pClient = client.getPointer(); - COMUtils.checkRC(jnaData.Execute(pClient)); - } - - @Override - public void unlink() { - COMUtils.checkRC(jnaData.Unlink()); - } - - @Override - public boolean isInvocable() { - BOOLByReference bIsInvocable = new BOOLByReference(); - COMUtils.checkRC(jnaData.IsInvocable(bIsInvocable)); - return bIsInvocable.getValue().booleanValue(); - } - - @Override - public void invokeMain(DataModelScriptClient client) { - Pointer pClient = client.getPointer(); - COMUtils.checkRC(jnaData.InvokeMain(pClient)); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptInternal.java deleted file mode 100644 index b4a53d03cc..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptInternal.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.datamodel.script; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.datamodel.script.DataModelScript; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.IDataModelScript; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.WrapIDataModelScript; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DataModelScriptInternal extends DataModelScript { - Map CACHE = new WeakValueHashMap<>(); - - static DataModelScriptInternal instanceFor(WrapIDataModelScript data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DataModelScriptImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IDataModelScript.IID_IDATA_MODEL_SCRIPT, - WrapIDataModelScript.class)); - - static DataModelScriptInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(DataModelScriptInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptManagerImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptManagerImpl.java deleted file mode 100644 index f9ba112bb9..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptManagerImpl.java +++ /dev/null @@ -1,114 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.datamodel.script; - -import com.sun.jna.Pointer; -import com.sun.jna.WString; -import com.sun.jna.platform.win32.COM.COMUtils; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.dbgmodel.datamodel.script.*; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.*; - -public class DataModelScriptManagerImpl implements DataModelScriptManagerInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IDataModelScriptManager jnaData; - - public DataModelScriptManagerImpl(IDataModelScriptManager jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public DataModelNameBinder getDefaultNameBinder() { - PointerByReference ppNameBinder = new PointerByReference(); - COMUtils.checkRC(jnaData.GetDefaultNameBinder(ppNameBinder)); - - WrapIDataModelNameBinder wrap = new WrapIDataModelNameBinder(ppNameBinder.getValue()); - try { - return DataModelNameBinderInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public void registerScriptProvider(DataModelScriptProvider provider) { - Pointer pProvider = provider.getPointer(); - COMUtils.checkRC(jnaData.RegisterScriptProvider(pProvider)); - } - - @Override - public void unregisterScriptProvider(DataModelScriptProvider provider) { - Pointer pProvider = provider.getPointer(); - COMUtils.checkRC(jnaData.UnregisterScriptProvider(pProvider)); - } - - @Override - public DataModelScriptProvider findProviderForScriptType(String scriptType) { - WString wScriptType = new WString(scriptType); - PointerByReference ppProvider = new PointerByReference(); - COMUtils.checkRC(jnaData.FindProviderForScriptType(wScriptType, ppProvider)); - - WrapIDataModelScriptProvider wrap = new WrapIDataModelScriptProvider(ppProvider.getValue()); - try { - return DataModelScriptProviderInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public DataModelScriptProvider findProviderForScriptExtension(String scriptExtension) { - WString wScriptExtension = new WString(scriptExtension); - PointerByReference ppProvider = new PointerByReference(); - COMUtils.checkRC(jnaData.FindProviderForScriptType(wScriptExtension, ppProvider)); - - WrapIDataModelScriptProvider wrap = new WrapIDataModelScriptProvider(ppProvider.getValue()); - try { - return DataModelScriptProviderInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public DataModelScriptProviderEnumerator enumeratorScriptProviders() { - PointerByReference ppEnumerator = new PointerByReference(); - COMUtils.checkRC(jnaData.EnumerateScriptProviders(ppEnumerator)); - - WrapIDataModelScriptProviderEnumerator wrap = - new WrapIDataModelScriptProviderEnumerator(ppEnumerator.getValue()); - try { - return DataModelScriptProviderEnumeratorInternal.tryPreferredInterfaces( - wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptManagerInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptManagerInternal.java deleted file mode 100644 index 46f33bc99c..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptManagerInternal.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.datamodel.script; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.datamodel.script.DataModelScriptManager; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.IDataModelScriptManager; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.WrapIDataModelScriptManager; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DataModelScriptManagerInternal extends DataModelScriptManager { - Map CACHE = new WeakValueHashMap<>(); - - static DataModelScriptManagerInternal instanceFor(WrapIDataModelScriptManager data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DataModelScriptManagerImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IDataModelScriptManager.IID_IDATA_MODEL_SCRIPT_MANAGER, - WrapIDataModelScriptManager.class)); - - static DataModelScriptManagerInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(DataModelScriptManagerInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptProviderEnumeratorImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptProviderEnumeratorImpl.java deleted file mode 100644 index 2c8e1b2563..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptProviderEnumeratorImpl.java +++ /dev/null @@ -1,68 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.datamodel.script; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.platform.win32.COM.COMUtils; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.dbgmodel.COMUtilsExtra; -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.dbgmodel.datamodel.script.DataModelScriptProvider; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.IDataModelScriptProviderEnumerator; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.WrapIDataModelScriptProvider; - -public class DataModelScriptProviderEnumeratorImpl - implements DataModelScriptProviderEnumeratorInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IDataModelScriptProviderEnumerator jnaData; - - public DataModelScriptProviderEnumeratorImpl(IDataModelScriptProviderEnumerator jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public void reset() { - COMUtils.checkRC(jnaData.Reset()); - } - - @Override - public DataModelScriptProvider getNext() { - PointerByReference ppProvider = new PointerByReference(); - HRESULT hr = jnaData.GetNext(ppProvider); - if (hr.equals(COMUtilsExtra.E_BOUNDS)) { - return null; - } - COMUtils.checkRC(hr); - - WrapIDataModelScriptProvider wrap = new WrapIDataModelScriptProvider(ppProvider.getValue()); - try { - return DataModelScriptProviderInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptProviderEnumeratorInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptProviderEnumeratorInternal.java deleted file mode 100644 index 6a844bcacf..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptProviderEnumeratorInternal.java +++ /dev/null @@ -1,50 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.datamodel.script; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.datamodel.script.DataModelScriptProviderEnumerator; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.IDataModelScriptProviderEnumerator; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.WrapIDataModelScriptProviderEnumerator; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DataModelScriptProviderEnumeratorInternal - extends DataModelScriptProviderEnumerator { - Map CACHE = new WeakValueHashMap<>(); - - static DataModelScriptProviderEnumeratorInternal instanceFor( - WrapIDataModelScriptProviderEnumerator data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DataModelScriptProviderEnumeratorImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>( - IDataModelScriptProviderEnumerator.IID_IDATA_MODEL_SCRIPT_PROVIDER_ENUMERATOR, - WrapIDataModelScriptProviderEnumerator.class)); - - static DataModelScriptProviderEnumeratorInternal tryPreferredInterfaces( - InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(DataModelScriptProviderEnumeratorInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptProviderImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptProviderImpl.java deleted file mode 100644 index 1aa063116e..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptProviderImpl.java +++ /dev/null @@ -1,111 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.datamodel.script; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.OleAuto; -import com.sun.jna.platform.win32.WTypes.BSTR; -import com.sun.jna.platform.win32.WTypes.BSTRByReference; -import com.sun.jna.platform.win32.COM.COMUtils; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.dbgmodel.datamodel.script.DataModelScriptTemplate; -import agent.dbgmodel.dbgmodel.datamodel.script.DataModelScriptTemplateEnumerator; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.*; - -public class DataModelScriptProviderImpl implements DataModelScriptProviderInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IDataModelScriptProvider jnaData; - - public DataModelScriptProviderImpl(IDataModelScriptProvider jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public String getName() { - BSTRByReference bref = new BSTRByReference(); - COMUtils.checkRC(jnaData.GetName(bref)); - BSTR bstr = bref.getValue(); - String name = bstr.getValue(); - OleAuto.INSTANCE.SysFreeString(bstr); - return name; - } - - @Override - public String getExtension() { - BSTRByReference bref = new BSTRByReference(); - COMUtils.checkRC(jnaData.GetExtension(bref)); - BSTR bstr = bref.getValue(); - String extension = bstr.getValue(); - OleAuto.INSTANCE.SysFreeString(bstr); - return extension; - } - - @Override - public DataModelScriptTemplate createScript() { - PointerByReference ppScript = new PointerByReference(); - COMUtils.checkRC(jnaData.CreateScript(ppScript)); - - WrapIDataModelScriptTemplate wrap = - new WrapIDataModelScriptTemplate(ppScript.getValue()); - try { - return DataModelScriptTemplateInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public DataModelScriptTemplate getDefaultTemplateContent() { - PointerByReference ppTemplateContent = new PointerByReference(); - COMUtils.checkRC(jnaData.GetDefaultTemplateContent(ppTemplateContent)); - - WrapIDataModelScriptTemplate wrap = - new WrapIDataModelScriptTemplate(ppTemplateContent.getValue()); - try { - return DataModelScriptTemplateInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public DataModelScriptTemplateEnumerator enumerateTemplates() { - PointerByReference ppTemplateContent = new PointerByReference(); - COMUtils.checkRC(jnaData.EnumerateTemplates(ppTemplateContent)); - - WrapIDataModelScriptTemplateEnumerator wrap = - new WrapIDataModelScriptTemplateEnumerator(ppTemplateContent.getValue()); - try { - return DataModelScriptTemplateEnumeratorInternal.tryPreferredInterfaces( - wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptProviderInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptProviderInternal.java deleted file mode 100644 index 0dbcef6d1d..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptProviderInternal.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.datamodel.script; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.datamodel.script.DataModelScriptProvider; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.IDataModelScriptProvider; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.WrapIDataModelScriptProvider; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DataModelScriptProviderInternal extends DataModelScriptProvider { - Map CACHE = new WeakValueHashMap<>(); - - static DataModelScriptProviderInternal instanceFor(WrapIDataModelScriptProvider data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DataModelScriptProviderImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IDataModelScriptProvider.IID_IDATA_MODEL_SCRIPT_PROVIDER, - WrapIDataModelScriptProvider.class)); - - static DataModelScriptProviderInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(DataModelScriptProviderInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptTemplateEnumeratorImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptTemplateEnumeratorImpl.java deleted file mode 100644 index 4930c86a14..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptTemplateEnumeratorImpl.java +++ /dev/null @@ -1,69 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.datamodel.script; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.platform.win32.COM.COMUtils; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.dbgmodel.COMUtilsExtra; -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.dbgmodel.datamodel.script.DataModelScriptTemplate; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.IDataModelScriptTemplateEnumerator; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.WrapIDataModelScriptTemplate; - -public class DataModelScriptTemplateEnumeratorImpl - implements DataModelScriptTemplateEnumeratorInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IDataModelScriptTemplateEnumerator jnaData; - - public DataModelScriptTemplateEnumeratorImpl(IDataModelScriptTemplateEnumerator jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public void reset() { - COMUtils.checkRC(jnaData.Reset()); - } - - @Override - public DataModelScriptTemplate getNext() { - PointerByReference ppTemplateContent = new PointerByReference(); - HRESULT hr = jnaData.GetNext(ppTemplateContent); - if (hr.equals(COMUtilsExtra.E_BOUNDS)) { - return null; - } - COMUtils.checkRC(hr); - - WrapIDataModelScriptTemplate wrap = - new WrapIDataModelScriptTemplate(ppTemplateContent.getValue()); - try { - return DataModelScriptTemplateInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptTemplateEnumeratorInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptTemplateEnumeratorInternal.java deleted file mode 100644 index f015b60d69..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptTemplateEnumeratorInternal.java +++ /dev/null @@ -1,50 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.datamodel.script; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.datamodel.script.DataModelScriptTemplateEnumerator; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.IDataModelScriptTemplateEnumerator; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.WrapIDataModelScriptTemplateEnumerator; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DataModelScriptTemplateEnumeratorInternal - extends DataModelScriptTemplateEnumerator { - Map CACHE = new WeakValueHashMap<>(); - - static DataModelScriptTemplateEnumeratorInternal instanceFor( - WrapIDataModelScriptTemplateEnumerator data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DataModelScriptTemplateEnumeratorImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>( - IDataModelScriptTemplateEnumerator.IID_IDATA_MODEL_SCRIPT_TEMPLATE_ENUMERATOR, - WrapIDataModelScriptTemplateEnumerator.class)); - - static DataModelScriptTemplateEnumeratorInternal tryPreferredInterfaces( - InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(DataModelScriptTemplateEnumeratorInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptTemplateImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptTemplateImpl.java deleted file mode 100644 index 9179c023e3..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptTemplateImpl.java +++ /dev/null @@ -1,80 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.datamodel.script; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.OleAuto; -import com.sun.jna.platform.win32.WTypes.BSTR; -import com.sun.jna.platform.win32.WTypes.BSTRByReference; -import com.sun.jna.platform.win32.COM.COMUtils; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.dbgmodel.UnknownEx; -import agent.dbgmodel.impl.dbgmodel.UnknownExInternal; -import agent.dbgmodel.jna.dbgmodel.WrapIUnknownEx; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.IDataModelScriptTemplate; - -public class DataModelScriptTemplateImpl implements DataModelScriptTemplateInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IDataModelScriptTemplate jnaData; - - public DataModelScriptTemplateImpl(IDataModelScriptTemplate jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public String getName() { - BSTRByReference bref = new BSTRByReference(); - COMUtils.checkRC(jnaData.GetName(bref)); - BSTR bstr = bref.getValue(); - String templateName = bstr.getValue(); - OleAuto.INSTANCE.SysFreeString(bstr); - return templateName; - } - - @Override - public String getDescription() { - BSTRByReference bref = new BSTRByReference(); - COMUtils.checkRC(jnaData.GetName(bref)); - BSTR bstr = bref.getValue(); - String templateDescription = bstr.getValue(); - OleAuto.INSTANCE.SysFreeString(bstr); - return templateDescription; - } - - @Override - public UnknownEx getContent() { - PointerByReference ppContentStream = new PointerByReference(); - COMUtils.checkRC(jnaData.GetContent(ppContentStream)); - - WrapIUnknownEx wrap = new WrapIUnknownEx(ppContentStream.getValue()); - try { - return UnknownExInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptTemplateInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptTemplateInternal.java deleted file mode 100644 index 2fb57f0bd4..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/DataModelScriptTemplateInternal.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.datamodel.script; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.datamodel.script.DataModelScriptTemplate; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.IDataModelScriptTemplate; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.WrapIDataModelScriptTemplate; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DataModelScriptTemplateInternal extends DataModelScriptTemplate { - Map CACHE = new WeakValueHashMap<>(); - - static DataModelScriptTemplateInternal instanceFor(WrapIDataModelScriptTemplate data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DataModelScriptTemplateImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IDataModelScriptTemplate.IID_IDATA_MODEL_SCRIPT_TEMPLATE, - WrapIDataModelScriptTemplate.class)); - - static DataModelScriptTemplateInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(DataModelScriptTemplateInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugBreakpointEnumeratorImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugBreakpointEnumeratorImpl.java deleted file mode 100644 index 9d41f4c46d..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugBreakpointEnumeratorImpl.java +++ /dev/null @@ -1,103 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.datamodel.script.debug; - -import com.sun.jna.Pointer; - -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.debug.IDataModelScriptDebugBreakpointEnumerator; - -public class DataModelScriptDebugBreakpointEnumeratorImpl - implements DataModelScriptDebugBreakpointEnumeratorInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IDataModelScriptDebugBreakpointEnumerator jnaData; - - public DataModelScriptDebugBreakpointEnumeratorImpl( - IDataModelScriptDebugBreakpointEnumerator jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - /* - @Override - public DebugMemoryBasicInformation queryVirtual(long offset) { - throw new UnsupportedOperationException("Not implemented in this interface"); - } - - @Override - public int readVirtual(long offset, ByteBuffer into, int len) { - if (len > into.remaining()) { - throw new BufferOverflowException(); - } - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesRead = new ULONGByReference(); - COMUtils.checkRC(jnaData.ReadVirtual(ullOffset, into, ulLen, pulBytesRead)); - int read = pulBytesRead.getValue().intValue(); - into.position(read + into.position()); - return read; - } - - @Override - public int readVirtualUncached(long offset, ByteBuffer into, int len) { - if (len > into.remaining()) { - throw new BufferOverflowException(); - } - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesRead = new ULONGByReference(); - COMUtils.checkRC(jnaData.ReadVirtualUncached(ullOffset, into, ulLen, pulBytesRead)); - int read = pulBytesRead.getValue().intValue(); - into.position(read + into.position()); - return read; - } - - @Override - public int writeVirtual(long offset, ByteBuffer from, int len) { - if (len > from.remaining()) { - throw new BufferOverflowException(); - } - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesWritten = new ULONGByReference(); - COMUtils.checkRC(jnaData.WriteVirtual(ullOffset, from, ulLen, pulBytesWritten)); - int written = pulBytesWritten.getValue().intValue(); - from.position(written + from.position()); - return written; - } - - @Override - public int writeVirtualUncached(long offset, ByteBuffer from, int len) { - if (len > from.remaining()) { - throw new BufferOverflowException(); - } - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesWritten = new ULONGByReference(); - COMUtils.checkRC(jnaData.WriteVirtualUncached(ullOffset, from, ulLen, pulBytesWritten)); - int written = pulBytesWritten.getValue().intValue(); - from.position(written + from.position()); - return written; - } - */ -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugBreakpointEnumeratorInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugBreakpointEnumeratorInternal.java deleted file mode 100644 index a4d25796db..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugBreakpointEnumeratorInternal.java +++ /dev/null @@ -1,53 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.datamodel.script.debug; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.datamodel.script.debug.DataModelScriptDebugBreakpointEnumerator; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.debug.IDataModelScriptDebugBreakpointEnumerator; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.debug.WrapIDataModelScriptDebugBreakpointEnumerator; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DataModelScriptDebugBreakpointEnumeratorInternal - extends DataModelScriptDebugBreakpointEnumerator { - Map CACHE = new WeakValueHashMap<>(); - - static DataModelScriptDebugBreakpointEnumeratorInternal instanceFor( - WrapIDataModelScriptDebugBreakpointEnumerator data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, - DataModelScriptDebugBreakpointEnumeratorImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = - List.of( - new Preferred<>( - IDataModelScriptDebugBreakpointEnumerator.IID_IDATA_MODEL_SCRIPT_DEBUG_BREAKPOINT_ENUMERATOR, - WrapIDataModelScriptDebugBreakpointEnumerator.class)); - - static DataModelScriptDebugBreakpointEnumeratorInternal tryPreferredInterfaces( - InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces( - DataModelScriptDebugBreakpointEnumeratorInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugBreakpointImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugBreakpointImpl.java deleted file mode 100644 index caf1710e02..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugBreakpointImpl.java +++ /dev/null @@ -1,101 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.datamodel.script.debug; - -import com.sun.jna.Pointer; - -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.debug.IDataModelScriptDebugBreakpoint; - -public class DataModelScriptDebugBreakpointImpl implements DataModelScriptDebugBreakpointInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IDataModelScriptDebugBreakpoint jnaData; - - public DataModelScriptDebugBreakpointImpl(IDataModelScriptDebugBreakpoint jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - /* - @Override - public DebugMemoryBasicInformation queryVirtual(long offset) { - throw new UnsupportedOperationException("Not implemented in this interface"); - } - - @Override - public int readVirtual(long offset, ByteBuffer into, int len) { - if (len > into.remaining()) { - throw new BufferOverflowException(); - } - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesRead = new ULONGByReference(); - COMUtils.checkRC(jnaData.ReadVirtual(ullOffset, into, ulLen, pulBytesRead)); - int read = pulBytesRead.getValue().intValue(); - into.position(read + into.position()); - return read; - } - - @Override - public int readVirtualUncached(long offset, ByteBuffer into, int len) { - if (len > into.remaining()) { - throw new BufferOverflowException(); - } - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesRead = new ULONGByReference(); - COMUtils.checkRC(jnaData.ReadVirtualUncached(ullOffset, into, ulLen, pulBytesRead)); - int read = pulBytesRead.getValue().intValue(); - into.position(read + into.position()); - return read; - } - - @Override - public int writeVirtual(long offset, ByteBuffer from, int len) { - if (len > from.remaining()) { - throw new BufferOverflowException(); - } - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesWritten = new ULONGByReference(); - COMUtils.checkRC(jnaData.WriteVirtual(ullOffset, from, ulLen, pulBytesWritten)); - int written = pulBytesWritten.getValue().intValue(); - from.position(written + from.position()); - return written; - } - - @Override - public int writeVirtualUncached(long offset, ByteBuffer from, int len) { - if (len > from.remaining()) { - throw new BufferOverflowException(); - } - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesWritten = new ULONGByReference(); - COMUtils.checkRC(jnaData.WriteVirtualUncached(ullOffset, from, ulLen, pulBytesWritten)); - int written = pulBytesWritten.getValue().intValue(); - from.position(written + from.position()); - return written; - } - */ -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugBreakpointInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugBreakpointInternal.java deleted file mode 100644 index 57cabc851e..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugBreakpointInternal.java +++ /dev/null @@ -1,50 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.datamodel.script.debug; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.datamodel.script.debug.DataModelScriptDebugBreakpoint; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.debug.IDataModelScriptDebugBreakpoint; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.debug.WrapIDataModelScriptDebugBreakpoint; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DataModelScriptDebugBreakpointInternal extends DataModelScriptDebugBreakpoint { - Map CACHE = new WeakValueHashMap<>(); - - static DataModelScriptDebugBreakpointInternal instanceFor( - WrapIDataModelScriptDebugBreakpoint data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DataModelScriptDebugBreakpointImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = - List.of( - new Preferred<>( - IDataModelScriptDebugBreakpoint.IID_IDATA_MODEL_SCRIPT_DEBUG_BREAKPOINT, - WrapIDataModelScriptDebugBreakpoint.class)); - - static DataModelScriptDebugBreakpointInternal tryPreferredInterfaces( - InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(DataModelScriptDebugBreakpointInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugClientImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugClientImpl.java deleted file mode 100644 index cd5c467166..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugClientImpl.java +++ /dev/null @@ -1,101 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.datamodel.script.debug; - -import com.sun.jna.Pointer; - -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.debug.IDataModelScriptDebugClient; - -public class DataModelScriptDebugClientImpl implements DataModelScriptDebugClientInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IDataModelScriptDebugClient jnaData; - - public DataModelScriptDebugClientImpl(IDataModelScriptDebugClient jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - /* - @Override - public DebugMemoryBasicInformation queryVirtual(long offset) { - throw new UnsupportedOperationException("Not implemented in this interface"); - } - - @Override - public int readVirtual(long offset, ByteBuffer into, int len) { - if (len > into.remaining()) { - throw new BufferOverflowException(); - } - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesRead = new ULONGByReference(); - COMUtils.checkRC(jnaData.ReadVirtual(ullOffset, into, ulLen, pulBytesRead)); - int read = pulBytesRead.getValue().intValue(); - into.position(read + into.position()); - return read; - } - - @Override - public int readVirtualUncached(long offset, ByteBuffer into, int len) { - if (len > into.remaining()) { - throw new BufferOverflowException(); - } - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesRead = new ULONGByReference(); - COMUtils.checkRC(jnaData.ReadVirtualUncached(ullOffset, into, ulLen, pulBytesRead)); - int read = pulBytesRead.getValue().intValue(); - into.position(read + into.position()); - return read; - } - - @Override - public int writeVirtual(long offset, ByteBuffer from, int len) { - if (len > from.remaining()) { - throw new BufferOverflowException(); - } - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesWritten = new ULONGByReference(); - COMUtils.checkRC(jnaData.WriteVirtual(ullOffset, from, ulLen, pulBytesWritten)); - int written = pulBytesWritten.getValue().intValue(); - from.position(written + from.position()); - return written; - } - - @Override - public int writeVirtualUncached(long offset, ByteBuffer from, int len) { - if (len > from.remaining()) { - throw new BufferOverflowException(); - } - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesWritten = new ULONGByReference(); - COMUtils.checkRC(jnaData.WriteVirtualUncached(ullOffset, from, ulLen, pulBytesWritten)); - int written = pulBytesWritten.getValue().intValue(); - from.position(written + from.position()); - return written; - } - */ -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugClientInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugClientInternal.java deleted file mode 100644 index 3bb58d63a9..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugClientInternal.java +++ /dev/null @@ -1,47 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.datamodel.script.debug; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.datamodel.script.debug.DataModelScriptDebugClient; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.debug.IDataModelScriptDebugClient; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.debug.WrapIDataModelScriptDebugClient; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DataModelScriptDebugClientInternal extends DataModelScriptDebugClient { - Map CACHE = new WeakValueHashMap<>(); - - static DataModelScriptDebugClientInternal instanceFor( - WrapIDataModelScriptDebugClient data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DataModelScriptDebugClientImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IDataModelScriptDebugClient.IID_IDATA_MODEL_SCRIPT_DEBUG_CLIENT, - WrapIDataModelScriptDebugClient.class)); - - static DataModelScriptDebugClientInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(DataModelScriptDebugClientInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugImpl.java deleted file mode 100644 index c022a70e88..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugImpl.java +++ /dev/null @@ -1,101 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.datamodel.script.debug; - -import com.sun.jna.Pointer; - -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.debug.IDataModelScriptDebug; - -public class DataModelScriptDebugImpl implements DataModelScriptDebugInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IDataModelScriptDebug jnaData; - - public DataModelScriptDebugImpl(IDataModelScriptDebug jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - /* - @Override - public DebugMemoryBasicInformation queryVirtual(long offset) { - throw new UnsupportedOperationException("Not implemented in this interface"); - } - - @Override - public int readVirtual(long offset, ByteBuffer into, int len) { - if (len > into.remaining()) { - throw new BufferOverflowException(); - } - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesRead = new ULONGByReference(); - COMUtils.checkRC(jnaData.ReadVirtual(ullOffset, into, ulLen, pulBytesRead)); - int read = pulBytesRead.getValue().intValue(); - into.position(read + into.position()); - return read; - } - - @Override - public int readVirtualUncached(long offset, ByteBuffer into, int len) { - if (len > into.remaining()) { - throw new BufferOverflowException(); - } - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesRead = new ULONGByReference(); - COMUtils.checkRC(jnaData.ReadVirtualUncached(ullOffset, into, ulLen, pulBytesRead)); - int read = pulBytesRead.getValue().intValue(); - into.position(read + into.position()); - return read; - } - - @Override - public int writeVirtual(long offset, ByteBuffer from, int len) { - if (len > from.remaining()) { - throw new BufferOverflowException(); - } - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesWritten = new ULONGByReference(); - COMUtils.checkRC(jnaData.WriteVirtual(ullOffset, from, ulLen, pulBytesWritten)); - int written = pulBytesWritten.getValue().intValue(); - from.position(written + from.position()); - return written; - } - - @Override - public int writeVirtualUncached(long offset, ByteBuffer from, int len) { - if (len > from.remaining()) { - throw new BufferOverflowException(); - } - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesWritten = new ULONGByReference(); - COMUtils.checkRC(jnaData.WriteVirtualUncached(ullOffset, from, ulLen, pulBytesWritten)); - int written = pulBytesWritten.getValue().intValue(); - from.position(written + from.position()); - return written; - } - */ -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugImpl2.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugImpl2.java deleted file mode 100644 index 0ce3956ea3..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugImpl2.java +++ /dev/null @@ -1,98 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.datamodel.script.debug; - -import com.sun.jna.Pointer; - -import agent.dbgmodel.jna.dbgmodel.datamodel.script.debug.IDataModelScriptDebug2; - -public class DataModelScriptDebugImpl2 extends DataModelScriptDebugImpl { - @SuppressWarnings("unused") - private final IDataModelScriptDebug2 jnaData; - - public DataModelScriptDebugImpl2(IDataModelScriptDebug2 jnaData) { - super(jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - /* - @Override - public DebugMemoryBasicInformation queryVirtual(long offset) { - throw new UnsupportedOperationException("Not implemented in this interface"); - } - - @Override - public int readVirtual(long offset, ByteBuffer into, int len) { - if (len > into.remaining()) { - throw new BufferOverflowException(); - } - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesRead = new ULONGByReference(); - COMUtils.checkRC(jnaData.ReadVirtual(ullOffset, into, ulLen, pulBytesRead)); - int read = pulBytesRead.getValue().intValue(); - into.position(read + into.position()); - return read; - } - - @Override - public int readVirtualUncached(long offset, ByteBuffer into, int len) { - if (len > into.remaining()) { - throw new BufferOverflowException(); - } - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesRead = new ULONGByReference(); - COMUtils.checkRC(jnaData.ReadVirtualUncached(ullOffset, into, ulLen, pulBytesRead)); - int read = pulBytesRead.getValue().intValue(); - into.position(read + into.position()); - return read; - } - - @Override - public int writeVirtual(long offset, ByteBuffer from, int len) { - if (len > from.remaining()) { - throw new BufferOverflowException(); - } - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesWritten = new ULONGByReference(); - COMUtils.checkRC(jnaData.WriteVirtual(ullOffset, from, ulLen, pulBytesWritten)); - int written = pulBytesWritten.getValue().intValue(); - from.position(written + from.position()); - return written; - } - - @Override - public int writeVirtualUncached(long offset, ByteBuffer from, int len) { - if (len > from.remaining()) { - throw new BufferOverflowException(); - } - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesWritten = new ULONGByReference(); - COMUtils.checkRC(jnaData.WriteVirtualUncached(ullOffset, from, ulLen, pulBytesWritten)); - int written = pulBytesWritten.getValue().intValue(); - from.position(written + from.position()); - return written; - } - */ -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugInternal.java deleted file mode 100644 index 2dda316792..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugInternal.java +++ /dev/null @@ -1,47 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.datamodel.script.debug; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.datamodel.script.debug.DataModelScriptDebug1; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.debug.*; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DataModelScriptDebugInternal extends DataModelScriptDebug1 { - Map CACHE = new WeakValueHashMap<>(); - - static DataModelScriptDebugInternal instanceFor(WrapIDataModelScriptDebug data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DataModelScriptDebugImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IDataModelScriptDebug2.IID_IDATA_MODEL_SCRIPT_DEBUG2, - WrapIDataModelScriptDebug.class), - new Preferred<>(IDataModelScriptDebug.IID_IDATA_MODEL_SCRIPT_DEBUG, - WrapIDataModelScriptDebug.class)); - - static DataModelScriptDebugInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(DataModelScriptDebugInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugStackFrameImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugStackFrameImpl.java deleted file mode 100644 index 4a6a0a9631..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugStackFrameImpl.java +++ /dev/null @@ -1,101 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.datamodel.script.debug; - -import com.sun.jna.Pointer; - -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.debug.IDataModelScriptDebugStackFrame; - -public class DataModelScriptDebugStackFrameImpl implements DataModelScriptDebugStackFrameInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IDataModelScriptDebugStackFrame jnaData; - - public DataModelScriptDebugStackFrameImpl(IDataModelScriptDebugStackFrame jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - /* - @Override - public DebugMemoryBasicInformation queryVirtual(long offset) { - throw new UnsupportedOperationException("Not implemented in this interface"); - } - - @Override - public int readVirtual(long offset, ByteBuffer into, int len) { - if (len > into.remaining()) { - throw new BufferOverflowException(); - } - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesRead = new ULONGByReference(); - COMUtils.checkRC(jnaData.ReadVirtual(ullOffset, into, ulLen, pulBytesRead)); - int read = pulBytesRead.getValue().intValue(); - into.position(read + into.position()); - return read; - } - - @Override - public int readVirtualUncached(long offset, ByteBuffer into, int len) { - if (len > into.remaining()) { - throw new BufferOverflowException(); - } - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesRead = new ULONGByReference(); - COMUtils.checkRC(jnaData.ReadVirtualUncached(ullOffset, into, ulLen, pulBytesRead)); - int read = pulBytesRead.getValue().intValue(); - into.position(read + into.position()); - return read; - } - - @Override - public int writeVirtual(long offset, ByteBuffer from, int len) { - if (len > from.remaining()) { - throw new BufferOverflowException(); - } - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesWritten = new ULONGByReference(); - COMUtils.checkRC(jnaData.WriteVirtual(ullOffset, from, ulLen, pulBytesWritten)); - int written = pulBytesWritten.getValue().intValue(); - from.position(written + from.position()); - return written; - } - - @Override - public int writeVirtualUncached(long offset, ByteBuffer from, int len) { - if (len > from.remaining()) { - throw new BufferOverflowException(); - } - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesWritten = new ULONGByReference(); - COMUtils.checkRC(jnaData.WriteVirtualUncached(ullOffset, from, ulLen, pulBytesWritten)); - int written = pulBytesWritten.getValue().intValue(); - from.position(written + from.position()); - return written; - } - */ -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugStackFrameInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugStackFrameInternal.java deleted file mode 100644 index c0b9e97f38..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugStackFrameInternal.java +++ /dev/null @@ -1,48 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.datamodel.script.debug; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.datamodel.script.debug.DataModelScriptDebugStackFrame; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.debug.IDataModelScriptDebugStackFrame; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.debug.WrapIDataModelScriptDebugStackFrame; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DataModelScriptDebugStackFrameInternal extends DataModelScriptDebugStackFrame { - Map CACHE = new WeakValueHashMap<>(); - - static DataModelScriptDebugStackFrameInternal instanceFor( - WrapIDataModelScriptDebugStackFrame data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DataModelScriptDebugStackFrameImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IDataModelScriptDebugStackFrame.IID_IDATA_MODEL_SCRIPT_DEBUG_STACK_FRAME, - WrapIDataModelScriptDebugStackFrame.class)); - - static DataModelScriptDebugStackFrameInternal tryPreferredInterfaces( - InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(DataModelScriptDebugStackFrameInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugStackImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugStackImpl.java deleted file mode 100644 index 40406d44b3..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugStackImpl.java +++ /dev/null @@ -1,101 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.datamodel.script.debug; - -import com.sun.jna.Pointer; - -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.debug.IDataModelScriptDebugStack; - -public class DataModelScriptDebugStackImpl implements DataModelScriptDebugStackInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IDataModelScriptDebugStack jnaData; - - public DataModelScriptDebugStackImpl(IDataModelScriptDebugStack jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - /* - @Override - public DebugMemoryBasicInformation queryVirtual(long offset) { - throw new UnsupportedOperationException("Not implemented in this interface"); - } - - @Override - public int readVirtual(long offset, ByteBuffer into, int len) { - if (len > into.remaining()) { - throw new BufferOverflowException(); - } - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesRead = new ULONGByReference(); - COMUtils.checkRC(jnaData.ReadVirtual(ullOffset, into, ulLen, pulBytesRead)); - int read = pulBytesRead.getValue().intValue(); - into.position(read + into.position()); - return read; - } - - @Override - public int readVirtualUncached(long offset, ByteBuffer into, int len) { - if (len > into.remaining()) { - throw new BufferOverflowException(); - } - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesRead = new ULONGByReference(); - COMUtils.checkRC(jnaData.ReadVirtualUncached(ullOffset, into, ulLen, pulBytesRead)); - int read = pulBytesRead.getValue().intValue(); - into.position(read + into.position()); - return read; - } - - @Override - public int writeVirtual(long offset, ByteBuffer from, int len) { - if (len > from.remaining()) { - throw new BufferOverflowException(); - } - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesWritten = new ULONGByReference(); - COMUtils.checkRC(jnaData.WriteVirtual(ullOffset, from, ulLen, pulBytesWritten)); - int written = pulBytesWritten.getValue().intValue(); - from.position(written + from.position()); - return written; - } - - @Override - public int writeVirtualUncached(long offset, ByteBuffer from, int len) { - if (len > from.remaining()) { - throw new BufferOverflowException(); - } - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesWritten = new ULONGByReference(); - COMUtils.checkRC(jnaData.WriteVirtualUncached(ullOffset, from, ulLen, pulBytesWritten)); - int written = pulBytesWritten.getValue().intValue(); - from.position(written + from.position()); - return written; - } - */ -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugStackInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugStackInternal.java deleted file mode 100644 index 7a65ca31c7..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugStackInternal.java +++ /dev/null @@ -1,47 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.datamodel.script.debug; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.datamodel.script.debug.DataModelScriptDebugStack; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.debug.IDataModelScriptDebugStack; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.debug.WrapIDataModelScriptDebugStack; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DataModelScriptDebugStackInternal extends DataModelScriptDebugStack { - Map CACHE = new WeakValueHashMap<>(); - - static DataModelScriptDebugStackInternal instanceFor( - WrapIDataModelScriptDebugStack data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DataModelScriptDebugStackImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IDataModelScriptDebugStack.IID_IDATA_MODEL_SCRIPT_DEBUG_STACK, - WrapIDataModelScriptDebugStack.class)); - - static DataModelScriptDebugStackInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(DataModelScriptDebugStackInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugVariableSetEnumeratorImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugVariableSetEnumeratorImpl.java deleted file mode 100644 index fce2454a8d..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugVariableSetEnumeratorImpl.java +++ /dev/null @@ -1,103 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.datamodel.script.debug; - -import com.sun.jna.Pointer; - -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.debug.IDataModelScriptDebugVariableSetEnumerator; - -public class DataModelScriptDebugVariableSetEnumeratorImpl - implements DataModelScriptDebugVariableSetEnumeratorInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IDataModelScriptDebugVariableSetEnumerator jnaData; - - public DataModelScriptDebugVariableSetEnumeratorImpl( - IDataModelScriptDebugVariableSetEnumerator jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - /* - @Override - public DebugMemoryBasicInformation queryVirtual(long offset) { - throw new UnsupportedOperationException("Not implemented in this interface"); - } - - @Override - public int readVirtual(long offset, ByteBuffer into, int len) { - if (len > into.remaining()) { - throw new BufferOverflowException(); - } - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesRead = new ULONGByReference(); - COMUtils.checkRC(jnaData.ReadVirtual(ullOffset, into, ulLen, pulBytesRead)); - int read = pulBytesRead.getValue().intValue(); - into.position(read + into.position()); - return read; - } - - @Override - public int readVirtualUncached(long offset, ByteBuffer into, int len) { - if (len > into.remaining()) { - throw new BufferOverflowException(); - } - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesRead = new ULONGByReference(); - COMUtils.checkRC(jnaData.ReadVirtualUncached(ullOffset, into, ulLen, pulBytesRead)); - int read = pulBytesRead.getValue().intValue(); - into.position(read + into.position()); - return read; - } - - @Override - public int writeVirtual(long offset, ByteBuffer from, int len) { - if (len > from.remaining()) { - throw new BufferOverflowException(); - } - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesWritten = new ULONGByReference(); - COMUtils.checkRC(jnaData.WriteVirtual(ullOffset, from, ulLen, pulBytesWritten)); - int written = pulBytesWritten.getValue().intValue(); - from.position(written + from.position()); - return written; - } - - @Override - public int writeVirtualUncached(long offset, ByteBuffer from, int len) { - if (len > from.remaining()) { - throw new BufferOverflowException(); - } - ULONGLONG ullOffset = new ULONGLONG(offset); - ULONG ulLen = new ULONG(len); - ULONGByReference pulBytesWritten = new ULONGByReference(); - COMUtils.checkRC(jnaData.WriteVirtualUncached(ullOffset, from, ulLen, pulBytesWritten)); - int written = pulBytesWritten.getValue().intValue(); - from.position(written + from.position()); - return written; - } - */ -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugVariableSetEnumeratorInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugVariableSetEnumeratorInternal.java deleted file mode 100644 index db5c911dd8..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/datamodel/script/debug/DataModelScriptDebugVariableSetEnumeratorInternal.java +++ /dev/null @@ -1,54 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.datamodel.script.debug; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.datamodel.script.debug.DataModelScriptDebugVariableSetEnumerator; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.debug.IDataModelScriptDebugVariableSetEnumerator; -import agent.dbgmodel.jna.dbgmodel.datamodel.script.debug.WrapIDataModelScriptDebugVariableSetEnumerator; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DataModelScriptDebugVariableSetEnumeratorInternal - extends DataModelScriptDebugVariableSetEnumerator { - Map CACHE = - new WeakValueHashMap<>(); - - static DataModelScriptDebugVariableSetEnumeratorInternal instanceFor( - WrapIDataModelScriptDebugVariableSetEnumerator data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, - DataModelScriptDebugVariableSetEnumeratorImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = - List.of( - new Preferred<>( - IDataModelScriptDebugVariableSetEnumerator.IID_IDATA_MODEL_SCRIPT_DEBUG_VARIABLE_SET_ENUMERATOR, - WrapIDataModelScriptDebugVariableSetEnumerator.class)); - - static DataModelScriptDebugVariableSetEnumeratorInternal tryPreferredInterfaces( - InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces( - DataModelScriptDebugVariableSetEnumeratorInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostBaseClassImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostBaseClassImpl.java deleted file mode 100644 index 161e2b8c30..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostBaseClassImpl.java +++ /dev/null @@ -1,138 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import com.sun.jna.WString; -import com.sun.jna.platform.win32.OleAuto; -import com.sun.jna.platform.win32.WTypes.BSTR; -import com.sun.jna.platform.win32.WTypes.BSTRByReference; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.platform.win32.COM.COMUtils; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.dbgmodel.COMUtilsExtra; -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.dbgmodel.debughost.*; -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.SymbolKind; -import agent.dbgmodel.jna.dbgmodel.debughost.*; - -public abstract class DebugHostBaseClassImpl implements DebugHostBaseClassInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IDebugHostBaseClass jnaData; - - public DebugHostBaseClassImpl(IDebugHostBaseClass jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public DebugHostContext getContext() { - PointerByReference ppContext = new PointerByReference(); - COMUtils.checkRC(jnaData.GetContext(ppContext)); - - WrapIDebugHostContext wrap = new WrapIDebugHostContext(ppContext.getValue()); - try { - return DebugHostContextInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public DebugHostSymbolEnumerator enumerateChildren(SymbolKind kind, WString name) { - ULONG ulKind = new ULONG(kind.ordinal()); - PointerByReference ppEnum = new PointerByReference(); - HRESULT hr = jnaData.EnumerateChildren(ulKind, name, ppEnum); - if (hr.equals(COMUtilsExtra.E_FAIL)) { - return null; - } - COMUtils.checkRC(hr); - - WrapIDebugHostSymbolEnumerator wrap = new WrapIDebugHostSymbolEnumerator(ppEnum.getValue()); - try { - return DebugHostSymbolEnumeratorInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public SymbolKind getSymbolKind() { - ULONGByReference pulKind = new ULONGByReference(); - COMUtils.checkRC(jnaData.GetSymbolKind(pulKind)); - return SymbolKind.values()[pulKind.getValue().intValue()]; - } - - @Override - public String getName() { - BSTRByReference bref = new BSTRByReference(); - COMUtils.checkRC(jnaData.GetName(bref)); - BSTR bstr = bref.getValue(); - String modelName = bstr.getValue(); - OleAuto.INSTANCE.SysFreeString(bstr); - return modelName; - } - - @Override - public DebugHostType1 getType() { - PointerByReference ppType = new PointerByReference(); - HRESULT hr = jnaData.GetType(ppType); - if (hr.equals(COMUtilsExtra.E_FAIL)) { - return null; - } - COMUtils.checkRC(hr); - - WrapIDebugHostType1 wrap = new WrapIDebugHostType1(ppType.getValue()); - try { - return DebugHostTypeInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public DebugHostModule1 getContainingModule() { - PointerByReference ppType = new PointerByReference(); - COMUtils.checkRC(jnaData.GetContainingModule(ppType)); - - WrapIDebugHostModule1 wrap = new WrapIDebugHostModule1(ppType.getValue()); - try { - return DebugHostModuleInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public long getOffset() { - ULONGLONGByReference ppOffset = new ULONGLONGByReference(); - COMUtils.checkRC(jnaData.GetOffset(ppOffset)); - return ppOffset.getValue().longValue(); - } - - @Override - public IDebugHostBaseClass getJnaData() { - return jnaData; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostBaseClassInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostBaseClassInternal.java deleted file mode 100644 index 08d500ca9d..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostBaseClassInternal.java +++ /dev/null @@ -1,47 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.debughost.DebugHostBase; -import agent.dbgmodel.jna.dbgmodel.debughost.X_IDebugHostBaseClass; -import agent.dbgmodel.jna.dbgmodel.debughost.X_WrapIDebugHostBaseClass; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DebugHostBaseClassInternal extends DebugHostBase { - - Map CACHE = new WeakValueHashMap<>(); - - static X_DebugHostBaseClassInternal instanceFor(X_WrapIDebugHostBaseClass data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, X_DebugHostBaseClassImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(X_IDebugHostBaseClass.IID_IDEBUG_HOST_BASE_CLASS, - X_WrapIDebugHostBaseClass.class)); - - static X_DebugHostBaseClassInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(X_DebugHostBaseClassInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostConstantImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostConstantImpl.java deleted file mode 100644 index fde283bd2d..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostConstantImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.Variant.VARIANT; - -import agent.dbgmodel.jna.dbgmodel.debughost.IDebugHostConstant; - -import com.sun.jna.platform.win32.COM.COMUtils; - -public class DebugHostConstantImpl extends DebugHostBaseClassImpl - implements DebugHostConstantInternal { - @SuppressWarnings("unused") - private final IDebugHostConstant jnaData; - - public DebugHostConstantImpl(IDebugHostConstant jnaData) { - super(jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public VARIANT getValue() { - VARIANT.ByReference pValue = new VARIANT.ByReference(); - COMUtils.checkRC(jnaData.GetValue(pValue)); - return (VARIANT) pValue.getValue(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostConstantInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostConstantInternal.java deleted file mode 100644 index 8f0bc3b019..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostConstantInternal.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.debughost.DebugHostConstant; -import agent.dbgmodel.jna.dbgmodel.debughost.IDebugHostConstant; -import agent.dbgmodel.jna.dbgmodel.debughost.WrapIDebugHostConstant; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DebugHostConstantInternal extends DebugHostConstant { - Map CACHE = new WeakValueHashMap<>(); - - static DebugHostConstantInternal instanceFor(WrapIDebugHostConstant data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DebugHostConstantImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IDebugHostConstant.IID_IDEBUG_HOST_CONSTANT, - WrapIDebugHostConstant.class)); - - static DebugHostConstantInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(DebugHostConstantInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostContextImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostContextImpl.java deleted file mode 100644 index 4a6a558fd6..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostContextImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.WinDef.BOOLByReference; - -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.dbgmodel.debughost.DebugHostContext; -import agent.dbgmodel.jna.dbgmodel.debughost.IDebugHostContext; - -import com.sun.jna.platform.win32.COM.COMUtils; - -public class DebugHostContextImpl implements DebugHostContextInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IDebugHostContext jnaData; - - public DebugHostContextImpl(IDebugHostContext jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - public IDebugHostContext getJnaData() { - return jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public boolean isEqualTo(DebugHostContext context) { - Pointer pContext = context.getPointer(); - BOOLByReference pIsEqual = new BOOLByReference(); - COMUtils.checkRC(jnaData.IsEqualTo(pContext, pIsEqual)); - return pIsEqual.getValue().booleanValue(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostContextInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostContextInternal.java deleted file mode 100644 index b9ff6fd6a9..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostContextInternal.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.debughost.DebugHostContext; -import agent.dbgmodel.jna.dbgmodel.debughost.IDebugHostContext; -import agent.dbgmodel.jna.dbgmodel.debughost.WrapIDebugHostContext; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DebugHostContextInternal extends DebugHostContext { - Map CACHE = new WeakValueHashMap<>(); - - static DebugHostContextInternal instanceFor(WrapIDebugHostContext data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DebugHostContextImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IDebugHostContext.IID_IDEBUG_HOST_CONTEXT, - WrapIDebugHostContext.class)); - - static DebugHostContextInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(DebugHostContextInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostDataImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostDataImpl.java deleted file mode 100644 index f65d453ba8..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostDataImpl.java +++ /dev/null @@ -1,62 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.Variant.VARIANT; -import com.sun.jna.platform.win32.WinDef.ULONGByReference; - -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.LOCATION; -import agent.dbgmodel.jna.dbgmodel.debughost.IDebugHostData; - -import com.sun.jna.platform.win32.COM.COMUtils; - -public class DebugHostDataImpl extends DebugHostBaseClassImpl implements DebugHostDataInternal { - @SuppressWarnings("unused") - private final IDebugHostData jnaData; - - public DebugHostDataImpl(IDebugHostData jnaData) { - super(jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public int getLocationKind() { - ULONGByReference pulLocationKind = new ULONGByReference(); - COMUtils.checkRC(jnaData.GetLocationKind(pulLocationKind)); - return pulLocationKind.getValue().intValue(); - } - - @Override - public LOCATION getLocation() { - LOCATION.ByReference pLocation = new LOCATION.ByReference(); - COMUtils.checkRC(jnaData.GetLocation(pLocation)); - return new LOCATION(pLocation); - } - - @Override - public VARIANT getValue() { - VARIANT.ByReference pValue = new VARIANT.ByReference(); - COMUtils.checkRC(jnaData.GetValue(pValue)); - return (VARIANT) pValue.getValue(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostDataInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostDataInternal.java deleted file mode 100644 index 7a4c41167c..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostDataInternal.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.debughost.DebugHostData; -import agent.dbgmodel.jna.dbgmodel.debughost.IDebugHostData; -import agent.dbgmodel.jna.dbgmodel.debughost.WrapIDebugHostData; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DebugHostDataInternal extends DebugHostData { - Map CACHE = new WeakValueHashMap<>(); - - static DebugHostDataInternal instanceFor(WrapIDebugHostData data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DebugHostDataImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IDebugHostData.IID_IDEBUG_HOST_DATA, WrapIDebugHostData.class)); - - static DebugHostDataInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(DebugHostDataInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostErrorSinkImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostErrorSinkImpl.java deleted file mode 100644 index 6ace827123..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostErrorSinkImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.WString; -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.jna.dbgmodel.debughost.IDebugHostErrorSink; - -import com.sun.jna.platform.win32.COM.COMUtils; - -public class DebugHostErrorSinkImpl implements DebugHostErrorSinkInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IDebugHostErrorSink jnaData; - - public DebugHostErrorSinkImpl(IDebugHostErrorSink jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public void reportError(int errorClass, HRESULT hrError, WString message) { - ULONG ulErrorClass = new ULONG(errorClass); - COMUtils.checkRC(jnaData.ReportError(ulErrorClass, hrError, message)); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostErrorSinkInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostErrorSinkInternal.java deleted file mode 100644 index ac794e1d13..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostErrorSinkInternal.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.debughost.DebugHostErrorSink; -import agent.dbgmodel.jna.dbgmodel.debughost.IDebugHostErrorSink; -import agent.dbgmodel.jna.dbgmodel.debughost.WrapIDebugHostErrorSink; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DebugHostErrorSinkInternal extends DebugHostErrorSink { - Map CACHE = new WeakValueHashMap<>(); - - static DebugHostErrorSinkInternal instanceFor(WrapIDebugHostErrorSink data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DebugHostErrorSinkImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IDebugHostErrorSink.IID_IDEBUG_HOST_ERROR_SINK, - WrapIDebugHostErrorSink.class)); - - static DebugHostErrorSinkInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(DebugHostErrorSinkInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostEvaluatorImpl1.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostEvaluatorImpl1.java deleted file mode 100644 index 1a89a93961..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostEvaluatorImpl1.java +++ /dev/null @@ -1,69 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.WString; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.dbgmodel.debughost.DebugHostContext; -import agent.dbgmodel.dbgmodel.main.ModelObject; -import agent.dbgmodel.impl.dbgmodel.main.ModelObjectImpl; -import agent.dbgmodel.jna.dbgmodel.debughost.IDebugHostEvaluator1; - -public class DebugHostEvaluatorImpl1 implements DebugHostEvaluatorInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IDebugHostEvaluator1 jnaData; - - public DebugHostEvaluatorImpl1(IDebugHostEvaluator1 jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public ModelObject evaluateExpression(DebugHostContext context, - WString expression, ModelObject bindingContext) { - Pointer pContext = context.getPointer(); - Pointer pBindingContext = bindingContext.getPointer(); - PointerByReference ppResult = new PointerByReference(); - PointerByReference ppMetadata = new PointerByReference(); - jnaData.EvaluateExpression(pContext, expression, pBindingContext, ppResult, ppMetadata); - - return ModelObjectImpl.getObjectWithMetadata(ppResult, ppMetadata); - } - - @Override - public ModelObject evaluateExtendedExpression(DebugHostContext context, WString expression, - ModelObject bindingContext) { - Pointer pContext = context.getPointer(); - Pointer pBindingContext = bindingContext.getPointer(); - PointerByReference ppResult = new PointerByReference(); - PointerByReference ppMetadata = new PointerByReference(); - jnaData.EvaluateExtendedExpression(pContext, expression, pBindingContext, ppResult, - ppMetadata); - - return ModelObjectImpl.getObjectWithMetadata(ppResult, ppMetadata); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostEvaluatorImpl2.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostEvaluatorImpl2.java deleted file mode 100644 index 1fd2a619c3..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostEvaluatorImpl2.java +++ /dev/null @@ -1,53 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.dbgmodel.debughost.DebugHostEvaluator2; -import agent.dbgmodel.dbgmodel.main.ModelObject; -import agent.dbgmodel.impl.dbgmodel.main.ModelObjectImpl; -import agent.dbgmodel.jna.dbgmodel.debughost.IDebugHostEvaluator2; - -public class DebugHostEvaluatorImpl2 extends DebugHostEvaluatorImpl1 - implements DebugHostEvaluator2 { - @SuppressWarnings("unused") - private final IDebugHostEvaluator2 jnaData; - - public DebugHostEvaluatorImpl2(IDebugHostEvaluator2 jnaData) { - super(jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public ModelObject assignTo(ModelObject assignmentReference, ModelObject assignmentValue) { - Pointer pAssignmentReference = assignmentReference.getPointer(); - Pointer pAssignmentValue = assignmentValue.getPointer(); - PointerByReference ppAssignmentResult = new PointerByReference(); - PointerByReference ppAssignmentMetadata = new PointerByReference(); - jnaData.AssignTo(pAssignmentReference, pAssignmentValue, ppAssignmentResult, - ppAssignmentMetadata); - - return ModelObjectImpl.getObjectWithMetadata(ppAssignmentResult, ppAssignmentMetadata); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostEvaluatorInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostEvaluatorInternal.java deleted file mode 100644 index 2aadeccabd..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostEvaluatorInternal.java +++ /dev/null @@ -1,51 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.debughost.DebugHostEvaluator1; -import agent.dbgmodel.jna.dbgmodel.debughost.*; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DebugHostEvaluatorInternal extends DebugHostEvaluator1 { - Map CACHE = new WeakValueHashMap<>(); - - static DebugHostEvaluatorInternal instanceFor(WrapIDebugHostEvaluator1 data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DebugHostEvaluatorImpl1::new); - } - - static DebugHostEvaluatorInternal instanceFor(WrapIDebugHostEvaluator2 data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DebugHostEvaluatorImpl2::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IDebugHostEvaluator2.IID_IDEBUG_HOST_EVALUATOR2, - WrapIDebugHostEvaluator2.class), - new Preferred<>(IDebugHostEvaluator1.IID_IDEBUG_HOST_EVALUATOR, - WrapIDebugHostEvaluator1.class)); - - static DebugHostEvaluatorInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(DebugHostEvaluatorInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostExtensabilityImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostExtensabilityImpl.java deleted file mode 100644 index 28cf9d54a4..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostExtensabilityImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.WString; -import com.sun.jna.platform.win32.COM.COMUtils; - -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.dbgmodel.main.ModelObject; -import agent.dbgmodel.jna.dbgmodel.debughost.IDebugHostExtensability; - -public class DebugHostExtensabilityImpl implements DebugHostExtensabilityInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IDebugHostExtensability jnaData; - - public DebugHostExtensabilityImpl(IDebugHostExtensability jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public void createFunctionAlias(WString aliasName, ModelObject functionObject) { - Pointer pFunctionObject = functionObject.getPointer(); - COMUtils.checkRC(jnaData.CreateFunctionAlias(aliasName, pFunctionObject)); - } - - @Override - public void destroyFunctionAlias(WString aliasName) { - COMUtils.checkRC(jnaData.DestroyFunctionAlias(aliasName)); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostExtensabilityInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostExtensabilityInternal.java deleted file mode 100644 index f20bfa8b7f..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostExtensabilityInternal.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.debughost.DebugHostExtensability; -import agent.dbgmodel.jna.dbgmodel.debughost.IDebugHostExtensability; -import agent.dbgmodel.jna.dbgmodel.debughost.WrapIDebugHostExtensability; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DebugHostExtensabilityInternal extends DebugHostExtensability { - Map CACHE = new WeakValueHashMap<>(); - - static DebugHostExtensabilityInternal instanceFor(WrapIDebugHostExtensability data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DebugHostExtensabilityImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IDebugHostExtensability.IID_IDEBUG_HOST_EXTENSABILITY, - WrapIDebugHostExtensability.class)); - - static DebugHostExtensabilityInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(DebugHostExtensabilityInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostFieldImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostFieldImpl.java deleted file mode 100644 index 6e2881f26b..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostFieldImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.Variant.VARIANT; -import com.sun.jna.platform.win32.WinDef.ULONGByReference; -import com.sun.jna.platform.win32.WinDef.ULONGLONGByReference; - -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.LOCATION; -import agent.dbgmodel.jna.dbgmodel.debughost.IDebugHostField; - -import com.sun.jna.platform.win32.COM.COMUtils; - -public class DebugHostFieldImpl extends DebugHostBaseClassImpl implements DebugHostFieldInternal { - @SuppressWarnings("unused") - private final IDebugHostField jnaData; - - public DebugHostFieldImpl(IDebugHostField jnaData) { - super(jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public int getLocationKind() { - ULONGByReference pulLocationKind = new ULONGByReference(); - COMUtils.checkRC(jnaData.GetLocationKind(pulLocationKind)); - return pulLocationKind.getValue().intValue(); - } - - @Override - public long getOffset() { - ULONGLONGByReference ppOffset = new ULONGLONGByReference(); - COMUtils.checkRC(jnaData.GetOffset(ppOffset)); - return ppOffset.getValue().longValue(); - } - - @Override - public LOCATION getLocation() { - LOCATION.ByReference pLocation = new LOCATION.ByReference(); - COMUtils.checkRC(jnaData.GetLocation(pLocation)); - return new LOCATION(pLocation); - } - - @Override - public VARIANT getValue() { - VARIANT.ByReference pValue = new VARIANT.ByReference(); - COMUtils.checkRC(jnaData.GetValue(pValue)); - return (VARIANT) pValue.getValue(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostFieldInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostFieldInternal.java deleted file mode 100644 index 4876dec469..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostFieldInternal.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.debughost.DebugHostField; -import agent.dbgmodel.jna.dbgmodel.debughost.IDebugHostField; -import agent.dbgmodel.jna.dbgmodel.debughost.WrapIDebugHostField; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DebugHostFieldInternal extends DebugHostField { - Map CACHE = new WeakValueHashMap<>(); - - static DebugHostFieldInternal instanceFor(WrapIDebugHostField data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DebugHostFieldImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IDebugHostField.IID_IDEBUG_HOST_FIELD, WrapIDebugHostField.class)); - - static DebugHostFieldInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(DebugHostFieldInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostImpl.java deleted file mode 100644 index 90055bc933..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostImpl.java +++ /dev/null @@ -1,111 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.COM.COMUtils; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.dbgmodel.UnknownEx; -import agent.dbgmodel.dbgmodel.debughost.*; -import agent.dbgmodel.dbgmodel.main.KeyStore; -import agent.dbgmodel.impl.dbgmodel.UnknownExInternal; -import agent.dbgmodel.impl.dbgmodel.main.KeyStoreInternal; -import agent.dbgmodel.jna.dbgmodel.WrapIUnknownEx; -import agent.dbgmodel.jna.dbgmodel.debughost.IDebugHost; -import agent.dbgmodel.jna.dbgmodel.debughost.WrapIDebugHostContext; -import agent.dbgmodel.jna.dbgmodel.main.WrapIKeyStore; - -public class DebugHostImpl implements DebugHostInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IDebugHost jnaData; - - public DebugHostImpl(IDebugHost jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public UnknownEx getHostDefinedInterface() { - PointerByReference ppHostUnk = new PointerByReference(); - COMUtils.checkRC(jnaData.GetHostDefinedInterface(ppHostUnk)); - - WrapIUnknownEx wrap = new WrapIUnknownEx(ppHostUnk.getValue()); - try { - return UnknownExInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public DebugHostContext getCurrentContext() { - PointerByReference ppContext = new PointerByReference(); - COMUtils.checkRC(jnaData.GetCurrentContext(ppContext)); - - WrapIDebugHostContext wrap = new WrapIDebugHostContext(ppContext.getValue()); - try { - return DebugHostContextInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public KeyStore getDefaultMetadata() { - PointerByReference ppDefaultMetadataStore = new PointerByReference(); - COMUtils.checkRC(jnaData.GetDefaultMetadata(ppDefaultMetadataStore)); - - WrapIKeyStore wrap = new WrapIKeyStore(ppDefaultMetadataStore.getValue()); - try { - return KeyStoreInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public DebugHostMemory1 asMemory() { - return DebugHostMemoryInternal.tryPreferredInterfaces(jnaData::QueryInterface); - } - - @Override - public DebugHostSymbols asSymbols() { - return DebugHostSymbolsInternal.tryPreferredInterfaces(jnaData::QueryInterface); - } - - @Override - public DebugHostScriptHost asScriptHost() { - return DebugHostScriptHostInternal.tryPreferredInterfaces(jnaData::QueryInterface); - } - - @Override - public DebugHostEvaluator2 asEvaluator() { - return (DebugHostEvaluator2) DebugHostEvaluatorInternal.tryPreferredInterfaces( - jnaData::QueryInterface); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostInternal.java deleted file mode 100644 index d48741c4a6..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostInternal.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.debughost.DebugHost; -import agent.dbgmodel.jna.dbgmodel.debughost.IDebugHost; -import agent.dbgmodel.jna.dbgmodel.debughost.WrapIDebugHost; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DebugHostInternal extends DebugHost { - Map CACHE = new WeakValueHashMap<>(); - - static DebugHostInternal instanceFor(WrapIDebugHost data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DebugHostImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IDebugHost.IID_IDEBUG_HOST, WrapIDebugHost.class)); - - static DebugHostInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(DebugHostInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostMemoryImpl1.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostMemoryImpl1.java deleted file mode 100644 index 6c0d047fec..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostMemoryImpl1.java +++ /dev/null @@ -1,119 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import java.nio.BufferOverflowException; -import java.nio.ByteBuffer; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.OleAuto; -import com.sun.jna.platform.win32.WTypes.BSTR; -import com.sun.jna.platform.win32.WTypes.BSTRByReference; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.platform.win32.COM.COMUtils; - -import agent.dbgeng.dbgeng.COMUtilsExtra; -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.dbgmodel.debughost.DebugHostContext; -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.LOCATION; -import agent.dbgmodel.jna.dbgmodel.debughost.IDebugHostMemory1; - -public class DebugHostMemoryImpl1 implements DebugHostMemoryInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IDebugHostMemory1 jnaData; - - public DebugHostMemoryImpl1(IDebugHostMemory1 jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public long readBytes(DebugHostContext context, LOCATION location, ByteBuffer buffer, - long bufferSize) { - if (bufferSize > buffer.remaining()) { - throw new BufferOverflowException(); - } - Pointer pContext = context.getPointer(); - ULONGLONG pulBufferSize = new ULONGLONG(bufferSize); - ULONGLONGByReference pulBytesRead = new ULONGLONGByReference(); - HRESULT hr = jnaData.ReadBytes(pContext, location, buffer, pulBufferSize, pulBytesRead); - if (hr.equals(COMUtilsExtra.E_NOTIMPLEMENTED)) { - return 0; - } - COMUtils.checkRC(hr); - long read = pulBytesRead.getValue().longValue(); - buffer.position((int) (read + buffer.position())); - return read; - } - - @Override - public long writeBytes(DebugHostContext context, LOCATION location, ByteBuffer buffer, - long bufferSize) { - if (bufferSize > buffer.remaining()) { - throw new BufferOverflowException(); - } - Pointer pContext = context.getPointer(); - ULONGLONG pulBufferSize = new ULONGLONG(bufferSize); - ULONGLONGByReference pulBytesWritten = new ULONGLONGByReference(); - COMUtils.checkRC( - jnaData.WriteBytes(pContext, location, buffer, pulBufferSize, pulBytesWritten)); - long written = pulBytesWritten.getValue().longValue(); - buffer.position((int) (written + buffer.position())); - return written; - } - - @Override - public ULONGLONGByReference readPointers(DebugHostContext context, LOCATION location, - long count) { - Pointer pContext = context.getPointer(); - ULONGLONG pCount = new ULONGLONG(count); - ULONGLONGByReference pPointers = new ULONGLONGByReference(); - COMUtils.checkRC(jnaData.ReadPointers(pContext, location, pCount, pPointers)); - return pPointers; - } - - @Override - public ULONGLONGByReference writePointers(DebugHostContext context, LOCATION location, - long count) { - Pointer pContext = context.getPointer(); - ULONGLONG pCount = new ULONGLONG(count); - ULONGLONGByReference pPointers = new ULONGLONGByReference(); - COMUtils.checkRC(jnaData.WritePointers(pContext, location, pCount, pPointers)); - return pPointers; - } - - @Override - public String GetDisplayStringForLocation(DebugHostContext context, LOCATION location, - boolean verbose) { - Pointer pContext = context.getPointer(); - BOOL bVerbose = new BOOL(verbose); - BSTRByReference bref = new BSTRByReference(); - COMUtils.checkRC( - jnaData.GetDisplayStringForLocation(pContext, location, bVerbose, bref)); - BSTR bstr = bref.getValue(); - String locationName = bstr.getValue(); - OleAuto.INSTANCE.SysFreeString(bstr); - return locationName; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostMemoryImpl2.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostMemoryImpl2.java deleted file mode 100644 index 3a4ce5f7d2..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostMemoryImpl2.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.COM.COMUtils; - -import agent.dbgmodel.dbgmodel.debughost.DebugHostContext; -import agent.dbgmodel.dbgmodel.debughost.DebugHostMemory2; -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.LOCATION; -import agent.dbgmodel.jna.dbgmodel.debughost.IDebugHostMemory2; - -public class DebugHostMemoryImpl2 extends DebugHostMemoryImpl1 implements DebugHostMemory2 { - private final IDebugHostMemory2 jnaData; - - public DebugHostMemoryImpl2(IDebugHostMemory2 jnaData) { - super(jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public LOCATION linearizeLocation(DebugHostContext context, LOCATION location) { - Pointer pContext = context.getPointer(); - LOCATION.ByReference pLinearizedLocation = new LOCATION.ByReference(); - COMUtils.checkRC(jnaData.LinearizeLocation(pContext, location, pLinearizedLocation)); - return new LOCATION(pLinearizedLocation); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostMemoryInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostMemoryInternal.java deleted file mode 100644 index d42ed50753..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostMemoryInternal.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.debughost.DebugHostMemory1; -import agent.dbgmodel.jna.dbgmodel.debughost.*; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DebugHostMemoryInternal extends DebugHostMemory1 { - Map CACHE = new WeakValueHashMap<>(); - - static DebugHostMemoryInternal instanceFor(WrapIDebugHostMemory1 data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DebugHostMemoryImpl1::new); - } - - static DebugHostMemoryInternal instanceFor(WrapIDebugHostMemory2 data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DebugHostMemoryImpl2::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IDebugHostMemory2.IID_IDEBUG_HOST_MEMORY2, WrapIDebugHostMemory2.class), - new Preferred<>(IDebugHostMemory1.IID_IDEBUG_HOST_MEMORY, WrapIDebugHostMemory1.class)); - - static DebugHostMemoryInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(DebugHostMemoryInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostModuleImpl1.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostModuleImpl1.java deleted file mode 100644 index 8286ae60a8..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostModuleImpl1.java +++ /dev/null @@ -1,149 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.WString; -import com.sun.jna.platform.win32.OleAuto; -import com.sun.jna.platform.win32.WTypes.BSTR; -import com.sun.jna.platform.win32.WTypes.BSTRByReference; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.platform.win32.COM.COMUtils; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.dbgmodel.COMUtilsExtra; -import agent.dbgmodel.dbgmodel.debughost.DebugHostSymbol1; -import agent.dbgmodel.dbgmodel.debughost.DebugHostType1; -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.LOCATION; -import agent.dbgmodel.jna.dbgmodel.debughost.*; - -public class DebugHostModuleImpl1 extends DebugHostBaseClassImpl - implements DebugHostModuleInternal { - @SuppressWarnings("unused") - private final IDebugHostModule1 jnaData; - private long fileVersion; - private long productVersion; - - public DebugHostModuleImpl1(IDebugHostModule1 jnaData) { - super(jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public String getImageName(boolean allowPath) { - BOOL bAllowPath = new BOOL(allowPath); - BSTRByReference bref = new BSTRByReference(); - COMUtils.checkRC(jnaData.GetImageName(bAllowPath, bref)); - BSTR bstr = bref.getValue(); - String imageName = bstr.getValue(); - OleAuto.INSTANCE.SysFreeString(bstr); - return imageName; - } - - @Override - public LOCATION getBaseLocation() { - LOCATION.ByReference pLocation = new LOCATION.ByReference(); - COMUtils.checkRC(jnaData.GetBaseLocation(pLocation)); - return new LOCATION(pLocation); - } - - @Override - public void getVersion() { - ULONGLONGByReference pulFileVersion = new ULONGLONGByReference(); - ULONGLONGByReference pulProductVersion = new ULONGLONGByReference(); - COMUtils.checkRC(jnaData.GetVersion(pulFileVersion, pulProductVersion)); - fileVersion = pulFileVersion.getValue().longValue(); - productVersion = pulProductVersion.getValue().longValue(); - } - - @Override - public DebugHostType1 findTypeByName(String typeName) { - PointerByReference ppType = new PointerByReference(); - HRESULT hr = jnaData.FindTypeByName(new WString(typeName), ppType); - if (hr.equals(COMUtilsExtra.E_FAIL) || hr.equals(COMUtilsExtra.E_BOUNDS)) { - System.out.println(typeName + " NOT FOUND"); - return null; - } - COMUtils.checkRC(hr); - - WrapIDebugHostType1 wrap = new WrapIDebugHostType1(ppType.getValue()); - try { - return DebugHostTypeInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public DebugHostSymbol1 findSymbolByRVA(long rva) { - ULONGLONG ulRva = new ULONGLONG(rva); - PointerByReference ppSymbol = new PointerByReference(); - HRESULT hr = jnaData.FindSymbolByRVA(ulRva, ppSymbol); - if (hr.equals(COMUtilsExtra.E_FAIL)) { - System.out.println(rva + " NOT FOUND"); - return null; - } - COMUtils.checkRC(hr); - - WrapIDebugHostSymbol1 wrap = new WrapIDebugHostSymbol1(ppSymbol.getValue()); - try { - return DebugHostSymbolInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public DebugHostSymbol1 findSymbolByName(String symbolName) { - PointerByReference ppSymbol = new PointerByReference(); - HRESULT hr = jnaData.FindSymbolByName(new WString(symbolName), ppSymbol); - if (hr.equals(COMUtilsExtra.E_FAIL)) { - System.out.println(symbolName + " NOT FOUND"); - return null; - } - COMUtils.checkRC(hr); - - WrapIDebugHostSymbol1 wrap = new WrapIDebugHostSymbol1(ppSymbol.getValue()); - try { - return DebugHostSymbolInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - public long getFileVersion() { - return fileVersion; - } - - public long getProductVersion() { - return productVersion; - } - - @Override - public DebugHostSymbol1 asSymbol() { - return DebugHostSymbolInternal.tryPreferredInterfaces(jnaData::QueryInterface); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostModuleImpl2.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostModuleImpl2.java deleted file mode 100644 index 09b8d5abc6..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostModuleImpl2.java +++ /dev/null @@ -1,67 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.WinDef.ULONGLONG; -import com.sun.jna.platform.win32.WinDef.ULONGLONGByReference; -import com.sun.jna.platform.win32.COM.COMUtils; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.dbgmodel.debughost.DebugHostModule2; -import agent.dbgmodel.dbgmodel.debughost.DebugHostSymbol1; -import agent.dbgmodel.jna.dbgmodel.debughost.IDebugHostModule2; -import agent.dbgmodel.jna.dbgmodel.debughost.WrapIDebugHostSymbol1; - -public class DebugHostModuleImpl2 extends DebugHostModuleImpl1 implements DebugHostModule2 { - private final IDebugHostModule2 jnaData; - - private long offset; - - public DebugHostModuleImpl2(IDebugHostModule2 jnaData) { - super(jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public DebugHostSymbol1 findContainingSymbolByRVA(long rva) { - ULONGLONG ulRva = new ULONGLONG(rva); - PointerByReference ppSymbol = new PointerByReference(); - ULONGLONGByReference pulOffset = new ULONGLONGByReference(); - COMUtils.checkRC(jnaData.FindContainingSymbolByRVA(ulRva, ppSymbol, pulOffset)); - - offset = pulOffset.getValue().longValue(); - - WrapIDebugHostSymbol1 wrap = new WrapIDebugHostSymbol1(ppSymbol.getValue()); - try { - return DebugHostSymbolInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public long getOffset() { - return offset; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostModuleInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostModuleInternal.java deleted file mode 100644 index 36e5391b91..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostModuleInternal.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.debughost.DebugHostModule1; -import agent.dbgmodel.jna.dbgmodel.debughost.*; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DebugHostModuleInternal extends DebugHostModule1 { - Map CACHE = new WeakValueHashMap<>(); - - static DebugHostModuleInternal instanceFor(WrapIDebugHostModule1 data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DebugHostModuleImpl1::new); - } - - static DebugHostModuleInternal instanceFor(WrapIDebugHostModule2 data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DebugHostModuleImpl2::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IDebugHostModule2.IID_IDEBUG_HOST_MODULE2, WrapIDebugHostModule2.class), - new Preferred<>(IDebugHostModule1.IID_IDEBUG_HOST_MODULE, WrapIDebugHostModule1.class)); - - static DebugHostModuleInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(DebugHostModuleInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostModuleSignatureImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostModuleSignatureImpl.java deleted file mode 100644 index 597b082669..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostModuleSignatureImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.WinDef.BOOLByReference; - -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.dbgmodel.debughost.DebugHostModule1; -import agent.dbgmodel.jna.dbgmodel.debughost.IDebugHostModuleSignature; - -import com.sun.jna.platform.win32.COM.COMUtils; - -public class DebugHostModuleSignatureImpl implements DebugHostModuleSignatureInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IDebugHostModuleSignature jnaData; - - public DebugHostModuleSignatureImpl(IDebugHostModuleSignature jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public boolean IsMatch(DebugHostModule1 module) { - Pointer pModule = module.getPointer(); - BOOLByReference pIsMatch = new BOOLByReference(); - COMUtils.checkRC(jnaData.IsMatch(pModule, pIsMatch)); - return pIsMatch.getValue().booleanValue(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostModuleSignatureInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostModuleSignatureInternal.java deleted file mode 100644 index 5e325536f7..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostModuleSignatureInternal.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.debughost.DebugHostModuleSignature; -import agent.dbgmodel.jna.dbgmodel.debughost.IDebugHostModuleSignature; -import agent.dbgmodel.jna.dbgmodel.debughost.WrapIDebugHostModuleSignature; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DebugHostModuleSignatureInternal extends DebugHostModuleSignature { - Map CACHE = new WeakValueHashMap<>(); - - static DebugHostModuleSignatureInternal instanceFor(WrapIDebugHostModuleSignature data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DebugHostModuleSignatureImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IDebugHostModuleSignature.IID_IDEBUG_HOST_MODULE_SIGNATURE, - WrapIDebugHostModuleSignature.class)); - - static DebugHostModuleSignatureInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(DebugHostModuleSignatureInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostPublicImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostPublicImpl.java deleted file mode 100644 index a49ca44223..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostPublicImpl.java +++ /dev/null @@ -1,55 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.WinDef.ULONGByReference; - -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.LOCATION; -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.LocationKind; -import agent.dbgmodel.jna.dbgmodel.debughost.IDebugHostPublic; - -import com.sun.jna.platform.win32.COM.COMUtils; - -public class DebugHostPublicImpl extends DebugHostBaseClassImpl implements DebugHostPublicInternal { - @SuppressWarnings("unused") - private final IDebugHostPublic jnaData; - - public DebugHostPublicImpl(IDebugHostPublic jnaData) { - super(jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public LocationKind getLocationKind() { - ULONGByReference pulLocationKind = new ULONGByReference(); - COMUtils.checkRC(jnaData.GetLocationKind(pulLocationKind)); - return LocationKind.values()[pulLocationKind.getValue().intValue()]; - } - - @Override - public LOCATION getLocation() { - LOCATION.ByReference pLocation = new LOCATION.ByReference(); - COMUtils.checkRC(jnaData.GetLocation(pLocation)); - return new LOCATION(pLocation); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostPublicInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostPublicInternal.java deleted file mode 100644 index 4e8eb156cb..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostPublicInternal.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.debughost.DebugHostPublic; -import agent.dbgmodel.jna.dbgmodel.debughost.IDebugHostPublic; -import agent.dbgmodel.jna.dbgmodel.debughost.WrapIDebugHostPublic; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DebugHostPublicInternal extends DebugHostPublic { - Map CACHE = new WeakValueHashMap<>(); - - static DebugHostPublicInternal instanceFor(WrapIDebugHostPublic data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DebugHostPublicImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IDebugHostPublic.IID_IDEBUG_HOST_PUBLIC, WrapIDebugHostPublic.class)); - - static DebugHostPublicInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(DebugHostPublicInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostScriptHostImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostScriptHostImpl.java deleted file mode 100644 index 03fa75dedb..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostScriptHostImpl.java +++ /dev/null @@ -1,59 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.COM.COMUtils; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.dbgmodel.datamodel.script.DataModelScript; -import agent.dbgmodel.dbgmodel.debughost.DebugHostContext; -import agent.dbgmodel.jna.dbgmodel.debughost.IDebugHostScriptHost; -import agent.dbgmodel.jna.dbgmodel.debughost.WrapIDebugHostContext; - -public class DebugHostScriptHostImpl implements DebugHostScriptHostInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IDebugHostScriptHost jnaData; - - public DebugHostScriptHostImpl(IDebugHostScriptHost jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public DebugHostContext createContext(DataModelScript script) { - Pointer pScript = script.getPointer(); - PointerByReference ppScriptContext = new PointerByReference(); - COMUtils.checkRC(jnaData.CreateContext(pScript, ppScriptContext)); - - WrapIDebugHostContext wrap = new WrapIDebugHostContext(ppScriptContext.getValue()); - try { - return DebugHostContextInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostScriptHostInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostScriptHostInternal.java deleted file mode 100644 index 34f43d399b..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostScriptHostInternal.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.debughost.DebugHostScriptHost; -import agent.dbgmodel.jna.dbgmodel.debughost.IDebugHostScriptHost; -import agent.dbgmodel.jna.dbgmodel.debughost.WrapIDebugHostScriptHost; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DebugHostScriptHostInternal extends DebugHostScriptHost { - Map CACHE = new WeakValueHashMap<>(); - - static DebugHostScriptHostInternal instanceFor(WrapIDebugHostScriptHost data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DebugHostScriptHostImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IDebugHostScriptHost.IID_IDEBUG_HOST_SCRIPT_HOST, - WrapIDebugHostScriptHost.class)); - - static DebugHostScriptHostInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(DebugHostScriptHostInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostStatusImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostStatusImpl.java deleted file mode 100644 index 12e9e01741..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostStatusImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.WinDef.BOOLByReference; - -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.jna.dbgmodel.debughost.IDebugHostStatus; - -import com.sun.jna.platform.win32.COM.COMUtils; - -public class DebugHostStatusImpl implements DebugHostStatusInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IDebugHostStatus jnaData; - - public DebugHostStatusImpl(IDebugHostStatus jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public boolean PollUserInterrupt() { - BOOLByReference pInterruptRequested = new BOOLByReference(); - COMUtils.checkRC(jnaData.PollUserInterrupt(pInterruptRequested)); - return pInterruptRequested.getValue().booleanValue(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostStatusInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostStatusInternal.java deleted file mode 100644 index 73c6d49681..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostStatusInternal.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.debughost.DebugHostStatus; -import agent.dbgmodel.jna.dbgmodel.debughost.IDebugHostStatus; -import agent.dbgmodel.jna.dbgmodel.debughost.WrapIDebugHostStatus; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DebugHostStatusInternal extends DebugHostStatus { - Map CACHE = new WeakValueHashMap<>(); - - static DebugHostStatusInternal instanceFor(WrapIDebugHostStatus data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DebugHostStatusImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IDebugHostStatus.IID_IDEBUG_HOST_STATUS, WrapIDebugHostStatus.class)); - - static DebugHostStatusInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(DebugHostStatusInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostSymbolEnumeratorImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostSymbolEnumeratorImpl.java deleted file mode 100644 index a2de989464..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostSymbolEnumeratorImpl.java +++ /dev/null @@ -1,72 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.platform.win32.COM.COMUtils; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.dbgmodel.debughost.DebugHostSymbol1; -import agent.dbgmodel.jna.dbgmodel.debughost.IDebugHostSymbolEnumerator; -import agent.dbgmodel.jna.dbgmodel.debughost.WrapIDebugHostSymbol1; - -public class DebugHostSymbolEnumeratorImpl implements DebugHostSymbolEnumeratorInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IDebugHostSymbolEnumerator jnaData; - - public DebugHostSymbolEnumeratorImpl(IDebugHostSymbolEnumerator jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public void reset() { - COMUtils.checkRC(jnaData.Reset()); - } - - @Override - public DebugHostSymbol1 getNext() { - PointerByReference ppSymbol = new PointerByReference(); - HRESULT hr = jnaData.GetNext(ppSymbol); - if (hr.longValue() != 0) { - return null; - } - /* - if (hr.equals(COMUtilsExtra.E_BOUNDS)) { - return null; - } - COMUtils.checkRC(hr); - */ - - WrapIDebugHostSymbol1 wrap = new WrapIDebugHostSymbol1(ppSymbol.getValue()); - try { - return DebugHostSymbolInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostSymbolEnumeratorInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostSymbolEnumeratorInternal.java deleted file mode 100644 index b04b6f1bd3..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostSymbolEnumeratorInternal.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.debughost.DebugHostSymbolEnumerator; -import agent.dbgmodel.jna.dbgmodel.debughost.IDebugHostSymbolEnumerator; -import agent.dbgmodel.jna.dbgmodel.debughost.WrapIDebugHostSymbolEnumerator; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DebugHostSymbolEnumeratorInternal extends DebugHostSymbolEnumerator { - Map CACHE = new WeakValueHashMap<>(); - - static DebugHostSymbolEnumeratorInternal instanceFor(WrapIDebugHostSymbolEnumerator data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DebugHostSymbolEnumeratorImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IDebugHostSymbolEnumerator.IID_IDEBUG_HOST_SYMBOL_ENUMERATOR, - WrapIDebugHostSymbolEnumerator.class)); - - static DebugHostSymbolEnumeratorInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(DebugHostSymbolEnumeratorInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostSymbolImpl1.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostSymbolImpl1.java deleted file mode 100644 index d7b7916334..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostSymbolImpl1.java +++ /dev/null @@ -1,81 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.WinDef.BOOLByReference; -import com.sun.jna.platform.win32.WinDef.ULONG; - -import agent.dbgmodel.dbgmodel.debughost.*; -import agent.dbgmodel.jna.dbgmodel.debughost.IDebugHostSymbol1; - -import com.sun.jna.platform.win32.COM.COMUtils; - -public class DebugHostSymbolImpl1 extends DebugHostBaseClassImpl - implements DebugHostSymbolInternal { - - private final IDebugHostSymbol1 jnaData; - - public DebugHostSymbolImpl1(IDebugHostSymbol1 jnaData) { - super(jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public int compareAgainst(DebugHostSymbol1 comparisonSymbol, long comparisonFlags) { - Pointer pComparisonSymbol = comparisonSymbol.getPointer(); - ULONG ulComparisonFlags = new ULONG(comparisonFlags); - BOOLByReference pMatches = new BOOLByReference(); - COMUtils.checkRC(jnaData.CompareAgainst(pComparisonSymbol, ulComparisonFlags, pMatches)); - return pMatches.getValue().intValue(); - } - - @Override - public DebugHostBaseClass asBaseClass() { - return X_DebugHostBaseClassInternal.tryPreferredInterfaces(jnaData::QueryInterface); - } - - @Override - public DebugHostConstant asConstant() { - return DebugHostConstantInternal.tryPreferredInterfaces(jnaData::QueryInterface); - } - - @Override - public DebugHostData asData() { - return DebugHostDataInternal.tryPreferredInterfaces(jnaData::QueryInterface); - } - - @Override - public DebugHostField asField() { - return DebugHostFieldInternal.tryPreferredInterfaces(jnaData::QueryInterface); - } - - @Override - public DebugHostModule1 asModule() { - return DebugHostModuleInternal.tryPreferredInterfaces(jnaData::QueryInterface); - } - - @Override - public DebugHostPublic asPublic() { - return DebugHostPublicInternal.tryPreferredInterfaces(jnaData::QueryInterface); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostSymbolImpl2.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostSymbolImpl2.java deleted file mode 100644 index d62f6a00bd..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostSymbolImpl2.java +++ /dev/null @@ -1,65 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import com.sun.jna.*; -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinDef.ULONGByReference; -import com.sun.jna.platform.win32.COM.COMUtils; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.dbgmodel.debughost.DebugHostSymbol2; -import agent.dbgmodel.dbgmodel.debughost.DebugHostSymbolEnumerator; -import agent.dbgmodel.jna.dbgmodel.debughost.IDebugHostSymbol2; -import agent.dbgmodel.jna.dbgmodel.debughost.WrapIDebugHostSymbolEnumerator; - -public class DebugHostSymbolImpl2 extends DebugHostSymbolImpl1 implements DebugHostSymbol2 { - private final IDebugHostSymbol2 jnaData; - - public DebugHostSymbolImpl2(IDebugHostSymbol2 jnaData) { - super(jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public DebugHostSymbolEnumerator enumerateChildrenEx(long kind, WString name, - Structure.ByReference searchInfo) { - ULONG ulKind = new ULONG(kind); - PointerByReference ppEnum = new PointerByReference(); - COMUtils.checkRC(jnaData.EnumerateChildrenEx(ulKind, name, searchInfo, ppEnum)); - - WrapIDebugHostSymbolEnumerator wrap = new WrapIDebugHostSymbolEnumerator(ppEnum.getValue()); - try { - return DebugHostSymbolEnumeratorInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public int getLanguage() { - ULONGByReference pulKind = new ULONGByReference(); - COMUtils.checkRC(jnaData.GetLanguage(pulKind)); - return pulKind.getValue().intValue(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostSymbolInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostSymbolInternal.java deleted file mode 100644 index 819ef20164..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostSymbolInternal.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.debughost.DebugHostSymbol1; -import agent.dbgmodel.jna.dbgmodel.debughost.*; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DebugHostSymbolInternal extends DebugHostSymbol1 { - Map CACHE = new WeakValueHashMap<>(); - - static DebugHostSymbolInternal instanceFor(WrapIDebugHostSymbol1 data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DebugHostSymbolImpl1::new); - } - - static DebugHostSymbolInternal instanceFor(WrapIDebugHostSymbol2 data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DebugHostSymbolImpl2::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IDebugHostSymbol2.IID_IDEBUG_HOST_SYMBOL2, WrapIDebugHostSymbol2.class), - new Preferred<>(IDebugHostSymbol1.IID_IDEBUG_HOST_SYMBOL, WrapIDebugHostSymbol1.class)); - - static DebugHostSymbolInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(DebugHostSymbolInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostSymbolsImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostSymbolsImpl.java deleted file mode 100644 index e86ebfa18d..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostSymbolsImpl.java +++ /dev/null @@ -1,171 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.WString; -import com.sun.jna.platform.win32.COM.COMUtils; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.dbgmodel.debughost.*; -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.LOCATION; -import agent.dbgmodel.jna.dbgmodel.debughost.*; - -public class DebugHostSymbolsImpl implements DebugHostSymbolsInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IDebugHostSymbols jnaData; - - private LOCATION derivedLocation; - - public DebugHostSymbolsImpl(IDebugHostSymbols jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public DebugHostModuleSignature createModuleSignature(WString pwszModuleName, - WString pwszMinVersion, WString pwszMaxVersion) { - PointerByReference ppModuleSignature = new PointerByReference(); - COMUtils.checkRC(jnaData.CreateModuleSignature(pwszModuleName, pwszMinVersion, - pwszMaxVersion, ppModuleSignature)); - - WrapIDebugHostModuleSignature wrap = - new WrapIDebugHostModuleSignature(ppModuleSignature.getValue()); - try { - return DebugHostModuleSignatureInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public DebugHostTypeSignature createTypeSignature(WString signatureSpecification, - DebugHostModule1 module) { - Pointer pModule = module == null ? null : module.getPointer(); - PointerByReference ppTypeSignature = new PointerByReference(); - COMUtils.checkRC( - jnaData.CreateTypeSignature(signatureSpecification, pModule, - ppTypeSignature)); - - WrapIDebugHostTypeSignature wrap = - new WrapIDebugHostTypeSignature(ppTypeSignature.getValue()); - try { - return DebugHostTypeSignatureInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public DebugHostTypeSignature createTypeSignatureForModuleRange(WString signatureSpecification, - WString pwszModuleName, WString pwszMinVersion, WString pwszMaxVersion) { - PointerByReference ppTypeSignature = new PointerByReference(); - COMUtils.checkRC(jnaData.CreateTypeSignatureForModuleRange(signatureSpecification, - pwszModuleName, pwszMinVersion, pwszMaxVersion, ppTypeSignature)); - - WrapIDebugHostTypeSignature wrap = - new WrapIDebugHostTypeSignature(ppTypeSignature.getValue()); - try { - return DebugHostTypeSignatureInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public DebugHostSymbolEnumerator enumerateModules(DebugHostContext context) { - Pointer pContext = context.getPointer(); - PointerByReference moduleEnum = new PointerByReference(); - COMUtils.checkRC(jnaData.EnumerateModules(pContext, moduleEnum)); - - WrapIDebugHostSymbolEnumerator wrap = - new WrapIDebugHostSymbolEnumerator(moduleEnum.getValue()); - try { - return DebugHostSymbolEnumeratorInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public DebugHostModule1 findModuleByName(DebugHostContext context, String moduleName) { - Pointer pContext = context.getPointer(); - PointerByReference ppModule = new PointerByReference(); - COMUtils.checkRC(jnaData.FindModuleByName(pContext, new WString(moduleName), ppModule)); - - WrapIDebugHostModule1 wrap = new WrapIDebugHostModule1(ppModule.getValue()); - try { - return DebugHostModuleInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public DebugHostModule1 findModuleByLocation(DebugHostContext context, - LOCATION moduleLocation) { - Pointer pContext = context.getPointer(); - PointerByReference ppModule = new PointerByReference(); - COMUtils.checkRC(jnaData.FindModuleByLocation(pContext, moduleLocation, ppModule)); - - WrapIDebugHostModule1 wrap = new WrapIDebugHostModule1(ppModule.getValue()); - try { - return DebugHostModuleInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public DebugHostType1 getMostDerivedObject(DebugHostContext context, LOCATION location, - DebugHostType1 objectType) { - Pointer pContext = context.getPointer(); - Pointer pObjectType = objectType.getPointer(); - LOCATION.ByReference pDerivedLocation = new LOCATION.ByReference(); - PointerByReference ppDerivedType = new PointerByReference(); - COMUtils.checkRC( - jnaData.GetMostDerivedObject(pContext, location, pObjectType, pDerivedLocation, - ppDerivedType)); - - derivedLocation = new LOCATION(pDerivedLocation); - WrapIDebugHostType1 wrap = new WrapIDebugHostType1(ppDerivedType.getValue()); - try { - return DebugHostTypeInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - public LOCATION getDerivedLocation() { - return derivedLocation; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostSymbolsInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostSymbolsInternal.java deleted file mode 100644 index 797af945a1..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostSymbolsInternal.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.debughost.DebugHostSymbols; -import agent.dbgmodel.jna.dbgmodel.debughost.IDebugHostSymbols; -import agent.dbgmodel.jna.dbgmodel.debughost.WrapIDebugHostSymbols; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DebugHostSymbolsInternal extends DebugHostSymbols { - Map CACHE = new WeakValueHashMap<>(); - - static DebugHostSymbolsInternal instanceFor(WrapIDebugHostSymbols data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DebugHostSymbolsImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IDebugHostSymbols.IID_IDEBUG_HOST_SYMBOLS, WrapIDebugHostSymbols.class)); - - static DebugHostSymbolsInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(DebugHostSymbolsInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostTypeImpl1.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostTypeImpl1.java deleted file mode 100644 index b8f146a30c..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostTypeImpl1.java +++ /dev/null @@ -1,265 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.WTypes.VARTYPE; -import com.sun.jna.platform.win32.WTypes.VARTYPEByReference; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.platform.win32.COM.COMUtils; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.dbgmodel.COMUtilsExtra; -import agent.dbgmodel.dbgmodel.debughost.DebugHostSymbol1; -import agent.dbgmodel.dbgmodel.debughost.DebugHostType1; -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.*; -import agent.dbgmodel.jna.dbgmodel.debughost.*; - -public class DebugHostTypeImpl1 extends DebugHostBaseClassImpl implements DebugHostTypeInternal { - @SuppressWarnings("unused") - private final IDebugHostType1 jnaData; - - private ULONG intrinsicKind; - private VARTYPE carrierType; - private ULONG lsbOfField; - private ULONG lengthOfField; - - public DebugHostTypeImpl1(IDebugHostType1 jnaData) { - super(jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public TypeKind getTypeKind() { - ULONGByReference pulKind = new ULONGByReference(); - COMUtils.checkRC(jnaData.GetTypeKind(pulKind)); - return TypeKind.values()[pulKind.getValue().intValue()]; - } - - @Override - public long getSize() { - ULONGLONGByReference pulSize = new ULONGLONGByReference(); - COMUtils.checkRC(jnaData.GetSize(pulSize)); - return pulSize.getValue().longValue(); - } - - @Override - public DebugHostType1 getBaseType() { - PointerByReference ppBaseType = new PointerByReference(); - HRESULT hr = jnaData.GetBaseType(ppBaseType); - if (hr.equals(COMUtilsExtra.E_FAIL)) { - return null; - } - COMUtils.checkRC(hr); - - WrapIDebugHostType1 wrap = new WrapIDebugHostType1(ppBaseType.getValue()); - try { - return DebugHostTypeInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public int getHashCode() { - ULONGByReference pulHashCode = new ULONGByReference(); - COMUtils.checkRC(jnaData.GetHashCode(pulHashCode)); - return pulHashCode.getValue().intValue(); - } - - @Override - public IntrinsicKind getIntrinsicType() { - ULONGByReference pulIntrinsicKind = new ULONGByReference(); - VARTYPEByReference pCarrierType = new VARTYPEByReference(); - HRESULT hr = jnaData.GetIntrinsicType(pulIntrinsicKind, pCarrierType); - if (hr.equals(COMUtilsExtra.E_FAIL)) { - return null; - } - COMUtils.checkRC(hr); - - carrierType = pCarrierType.getValue(); - int intValue = pulIntrinsicKind.getValue().intValue(); - return IntrinsicKind.values()[intValue]; - } - - @Override - public void getBitField() { - ULONGByReference pulLsbOfField = new ULONGByReference(); - ULONGByReference pulLengthOfField = new ULONGByReference(); - COMUtils.checkRC(jnaData.GetBitField(pulLsbOfField, pulLengthOfField)); - lsbOfField = pulLsbOfField.getValue(); - lengthOfField = pulLengthOfField.getValue(); - } - - @Override - public PointerKind getPointerKind() { - ULONGByReference pulPointerKind = new ULONGByReference(); - HRESULT hr = jnaData.GetPointerKind(pulPointerKind); - if (hr.equals(COMUtilsExtra.E_FAIL)) { - return null; - } - COMUtils.checkRC(hr); - return PointerKind.values()[pulPointerKind.getValue().intValue()]; - } - - @Override - public DebugHostType1 getMemberType() { - PointerByReference ppMemberType = new PointerByReference(); - COMUtils.checkRC(jnaData.GetMemberType(ppMemberType)); - - WrapIDebugHostType1 wrap = new WrapIDebugHostType1(ppMemberType.getValue()); - try { - return DebugHostTypeInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public DebugHostType1 createPointerTo(int kind) { - ULONG ulKind = new ULONG(kind); - PointerByReference ppMemberType = new PointerByReference(); - COMUtils.checkRC(jnaData.CreatePointerTo(ulKind, ppMemberType)); - - WrapIDebugHostType1 wrap = new WrapIDebugHostType1(ppMemberType.getValue()); - try { - return DebugHostTypeInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public long getArrayDimensionality() { - ULONGLONGByReference pulArrayDimensionality = new ULONGLONGByReference(); - COMUtils.checkRC(jnaData.GetArrayDimensionality(pulArrayDimensionality)); - return pulArrayDimensionality.getValue().longValue(); - } - - @Override - public ARRAY_DIMENSION getArrayDimensions(long dimensions) { - ULONGLONG pDimensions = new ULONGLONG(dimensions); - ARRAY_DIMENSION.ByReference ppDimensions = new ARRAY_DIMENSION.ByReference(); - COMUtils.checkRC(jnaData.GetArrayDimensions(pDimensions, ppDimensions)); - return new ARRAY_DIMENSION(ppDimensions); - } - - @Override - public DebugHostType1 createArrayOf(long dimensions, ARRAY_DIMENSION.ByReference pDimensions) { - ULONGLONG ulDimensions = new ULONGLONG(dimensions); - PointerByReference ppNewType = new PointerByReference(); - COMUtils.checkRC(jnaData.CreateArrayOf(ulDimensions, pDimensions, ppNewType)); - - WrapIDebugHostType1 wrap = new WrapIDebugHostType1(ppNewType.getValue()); - try { - return DebugHostTypeInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public int getFunctionCallingConvention() { - ULONGByReference pulConventionKind = new ULONGByReference(); - COMUtils.checkRC(jnaData.GetFunctionCallingConvention(pulConventionKind)); - return pulConventionKind.getValue().intValue(); - } - - @Override - public DebugHostType1 getFunctionReturnType() { - PointerByReference ppReturnType = new PointerByReference(); - COMUtils.checkRC(jnaData.GetFunctionReturnType(ppReturnType)); - - WrapIDebugHostType1 wrap = new WrapIDebugHostType1(ppReturnType.getValue()); - try { - return DebugHostTypeInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public DebugHostType1 getFunctionParameterTypeAt(int i) { - ULONG ulI = new ULONG(i); - PointerByReference ppReturnType = new PointerByReference(); - COMUtils.checkRC(jnaData.GetFunctionParameterTypeAt(ulI, ppReturnType)); - - WrapIDebugHostType1 wrap = new WrapIDebugHostType1(ppReturnType.getValue()); - try { - return DebugHostTypeInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public boolean isGeneric() { - BOOLByReference bIsGeneric = new BOOLByReference(); - COMUtils.checkRC(jnaData.IsGeneric(bIsGeneric)); - return bIsGeneric.getValue().booleanValue(); - } - - @Override - public long getGenericArgumentCount() { - ULONGLONGByReference pulArgCount = new ULONGLONGByReference(); - COMUtils.checkRC(jnaData.GetGenericArgumentCount(pulArgCount)); - return pulArgCount.getValue().longValue(); - } - - @Override - public DebugHostSymbol1 getGenericArgumentAt(int i) { - ULONG ulI = new ULONG(i); - PointerByReference ppArgument = new PointerByReference(); - COMUtils.checkRC(jnaData.GetGenericArgumentAt(ulI, ppArgument)); - - WrapIDebugHostSymbol1 wrap = new WrapIDebugHostSymbol1(ppArgument.getValue()); - try { - return DebugHostSymbolInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - public ULONG getIntrinsicKind() { - return intrinsicKind; - } - - public VARTYPE getCarrierType() { - return carrierType; - } - - public ULONG getLsbOfField() { - return lsbOfField; - } - - public ULONG getLengthOfField() { - return lengthOfField; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostTypeImpl2.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostTypeImpl2.java deleted file mode 100644 index e3d3cf7637..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostTypeImpl2.java +++ /dev/null @@ -1,100 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.WinDef.BOOLByReference; -import com.sun.jna.platform.win32.WinDef.ULONGByReference; -import com.sun.jna.platform.win32.COM.COMUtils; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.dbgmodel.debughost.DebugHostType2; -import agent.dbgmodel.jna.dbgmodel.debughost.IDebugHostType2; -import agent.dbgmodel.jna.dbgmodel.debughost.WrapIDebugHostType2; - -public class DebugHostTypeImpl2 extends DebugHostTypeImpl1 implements DebugHostType2 { - private final IDebugHostType2 jnaData; - - public DebugHostTypeImpl2(IDebugHostType2 jnaData) { - super(jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public boolean isTypedef() { - BOOLByReference bIsTypedef = new BOOLByReference(); - COMUtils.checkRC(jnaData.IsTypedef(bIsTypedef)); - return bIsTypedef.getValue().booleanValue(); - } - - @Override - public DebugHostType2 getTypedefBaseType() { - PointerByReference ppBaseType = new PointerByReference(); - COMUtils.checkRC(jnaData.GetTypedefBaseType(ppBaseType)); - - WrapIDebugHostType2 wrap = new WrapIDebugHostType2(ppBaseType.getValue()); - try { - return (DebugHostType2) DebugHostTypeInternal.tryPreferredInterfaces( - wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public DebugHostType2 getTypedefFinalBaseType() { - PointerByReference ppFinalBaseType = new PointerByReference(); - COMUtils.checkRC(jnaData.GetTypedefFinalBaseType(ppFinalBaseType)); - - WrapIDebugHostType2 wrap = new WrapIDebugHostType2(ppFinalBaseType.getValue()); - try { - return (DebugHostType2) DebugHostTypeInternal.tryPreferredInterfaces( - wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public int getFunctionVarArgsKind() { - ULONGByReference pulVarArgsKind = new ULONGByReference(); - COMUtils.checkRC(jnaData.GetFunctionVarArgsKind(pulVarArgsKind)); - return pulVarArgsKind.getValue().intValue(); - } - - @Override - public DebugHostType2 getFunctionInstancePointerType() { - PointerByReference ppInstancePointerType = new PointerByReference(); - COMUtils.checkRC(jnaData.GetFunctionInstancePointerType(ppInstancePointerType)); - - WrapIDebugHostType2 wrap = new WrapIDebugHostType2(ppInstancePointerType.getValue()); - try { - return (DebugHostType2) DebugHostTypeInternal.tryPreferredInterfaces( - wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostTypeInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostTypeInternal.java deleted file mode 100644 index 9ae5e96c1d..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostTypeInternal.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.debughost.DebugHostType1; -import agent.dbgmodel.jna.dbgmodel.debughost.*; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DebugHostTypeInternal extends DebugHostType1 { - Map CACHE = new WeakValueHashMap<>(); - - static DebugHostTypeInternal instanceFor(WrapIDebugHostType1 data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DebugHostTypeImpl1::new); - } - - static DebugHostTypeInternal instanceFor(WrapIDebugHostType2 data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DebugHostTypeImpl2::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IDebugHostType2.IID_IDEBUG_HOST_TYPE2, WrapIDebugHostType2.class), - new Preferred<>(IDebugHostType1.IID_IDEBUG_HOST_TYPE, WrapIDebugHostType1.class)); - - static DebugHostTypeInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(DebugHostTypeInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostTypeSignatureImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostTypeSignatureImpl.java deleted file mode 100644 index 003fa82c73..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostTypeSignatureImpl.java +++ /dev/null @@ -1,85 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.WinDef.BOOLByReference; -import com.sun.jna.platform.win32.WinDef.ULONGByReference; -import com.sun.jna.platform.win32.COM.COMUtils; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.dbgmodel.debughost.DebugHostType1; -import agent.dbgmodel.dbgmodel.debughost.DebugHostTypeSignature; -import agent.dbgmodel.jna.dbgmodel.debughost.IDebugHostTypeSignature; -import agent.dbgmodel.jna.dbgmodel.main.WrapIModelObject; - -public class DebugHostTypeSignatureImpl implements DebugHostTypeSignatureInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IDebugHostTypeSignature jnaData; - - private DebugHostSymbolEnumeratorInternal wildcardMatches; - - public DebugHostTypeSignatureImpl(IDebugHostTypeSignature jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public int getHashCode() { - ULONGByReference pulHashCode = new ULONGByReference(); - COMUtils.checkRC(jnaData.GetHashCode(pulHashCode)); - return pulHashCode.getValue().intValue(); - } - - @Override - public boolean isMatch(DebugHostType1 type) { - Pointer pType = type.getPointer(); - BOOLByReference pIsMatch = new BOOLByReference(); - PointerByReference ppWildcardMatches = new PointerByReference(); - COMUtils.checkRC(jnaData.IsMatch(pType, pIsMatch, ppWildcardMatches)); - - WrapIModelObject wrap1 = new WrapIModelObject(ppWildcardMatches.getValue()); - try { - wildcardMatches = - DebugHostSymbolEnumeratorInternal.tryPreferredInterfaces(wrap1::QueryInterface); - } - finally { - wrap1.Release(); - } - - return pIsMatch.getValue().booleanValue(); - } - - @Override - public int compareAgainst(DebugHostTypeSignature typeSignature) { - Pointer pTypeSignature = typeSignature.getPointer(); - ULONGByReference pResult = new ULONGByReference(); - COMUtils.checkRC(jnaData.CompareAgainst(pTypeSignature, pResult)); - return pResult.getValue().intValue(); - } - - public DebugHostSymbolEnumeratorInternal getWildcardMatches() { - return wildcardMatches; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostTypeSignatureInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostTypeSignatureInternal.java deleted file mode 100644 index fe897afe63..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/DebugHostTypeSignatureInternal.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.debughost.DebugHostTypeSignature; -import agent.dbgmodel.jna.dbgmodel.debughost.IDebugHostTypeSignature; -import agent.dbgmodel.jna.dbgmodel.debughost.WrapIDebugHostTypeSignature; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface DebugHostTypeSignatureInternal extends DebugHostTypeSignature { - Map CACHE = new WeakValueHashMap<>(); - - static DebugHostTypeSignatureInternal instanceFor(WrapIDebugHostTypeSignature data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, DebugHostTypeSignatureImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IDebugHostTypeSignature.IID_IDEBUG_HOST_TYPE_SIGNATURE, - WrapIDebugHostTypeSignature.class)); - - static DebugHostTypeSignatureInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(DebugHostTypeSignatureInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/X_DebugHostBaseClassImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/X_DebugHostBaseClassImpl.java deleted file mode 100644 index 57ad29f8d5..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/X_DebugHostBaseClassImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.WinDef.ULONGLONGByReference; - -import agent.dbgmodel.jna.dbgmodel.debughost.X_IDebugHostBaseClass; - -import com.sun.jna.platform.win32.COM.COMUtils; - -public class X_DebugHostBaseClassImpl extends DebugHostBaseClassImpl - implements X_DebugHostBaseClassInternal { - @SuppressWarnings("unused") - private final X_IDebugHostBaseClass jnaData; - - public X_DebugHostBaseClassImpl(X_IDebugHostBaseClass jnaData) { - super(jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public long getOffset() { - ULONGLONGByReference ppOffset = new ULONGLONGByReference(); - COMUtils.checkRC(jnaData.GetOffset(ppOffset)); - return ppOffset.getValue().longValue(); - } - - public X_IDebugHostBaseClass getJnaData() { - return jnaData; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/X_DebugHostBaseClassInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/X_DebugHostBaseClassInternal.java deleted file mode 100644 index 27bcb8c77c..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/debughost/X_DebugHostBaseClassInternal.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.debughost; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.debughost.DebugHostBaseClass; -import agent.dbgmodel.jna.dbgmodel.debughost.X_IDebugHostBaseClass; -import agent.dbgmodel.jna.dbgmodel.debughost.X_WrapIDebugHostBaseClass; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface X_DebugHostBaseClassInternal extends DebugHostBaseClass { - Map CACHE = new WeakValueHashMap<>(); - - static X_DebugHostBaseClassInternal instanceFor(X_WrapIDebugHostBaseClass data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, X_DebugHostBaseClassImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(X_IDebugHostBaseClass.IID_IDEBUG_HOST_BASE_CLASS, - X_WrapIDebugHostBaseClass.class)); - - static X_DebugHostBaseClassInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(X_DebugHostBaseClassInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/KeyEnumeratorImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/KeyEnumeratorImpl.java deleted file mode 100644 index c4cf51a2fd..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/KeyEnumeratorImpl.java +++ /dev/null @@ -1,90 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.main; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.OleAuto; -import com.sun.jna.platform.win32.WTypes.BSTR; -import com.sun.jna.platform.win32.WTypes.BSTRByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.platform.win32.COM.COMUtils; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.dbgmodel.COMUtilsExtra; -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.dbgmodel.main.ModelObject; -import agent.dbgmodel.jna.dbgmodel.main.IKeyEnumerator; -import ghidra.util.Msg; - -public class KeyEnumeratorImpl implements KeyEnumeratorInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IKeyEnumerator jnaData; - - private ModelObject value; - - public KeyEnumeratorImpl(IKeyEnumerator jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public void reset() { - COMUtils.checkRC(jnaData.Reset()); - } - - @Override - public String getNext() { - BSTRByReference bref = new BSTRByReference(); - PointerByReference ppValue = new PointerByReference(); - PointerByReference ppMetaData = new PointerByReference(); - try { - HRESULT hr = jnaData.GetNext(bref, ppValue, ppMetaData); - if (hr.equals(COMUtilsExtra.E_BOUNDS) || hr.equals(COMUtilsExtra.E_FAIL)) { - //System.err.println("ret null"); - return null; - } - COMUtils.checkRC(hr); - } - catch (Error e) { - Msg.error(this, e.getMessage()); - } - - Pointer val = ppValue.getValue(); - if (val != null) { - value = ModelObjectImpl.getObjectWithMetadata(ppValue, ppMetaData); - } - else { - value = null; - } - BSTR bstr = bref.getValue(); - String key = bstr.getValue(); - OleAuto.INSTANCE.SysFreeString(bstr); - return key; - } - - @Override - public ModelObject getValue() { - return value; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/KeyEnumeratorInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/KeyEnumeratorInternal.java deleted file mode 100644 index 8b0e511056..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/KeyEnumeratorInternal.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.main; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.main.KeyEnumerator; -import agent.dbgmodel.jna.dbgmodel.main.IKeyEnumerator; -import agent.dbgmodel.jna.dbgmodel.main.WrapIKeyEnumerator; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface KeyEnumeratorInternal extends KeyEnumerator { - Map CACHE = new WeakValueHashMap<>(); - - static KeyEnumeratorInternal instanceFor(WrapIKeyEnumerator data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, KeyEnumeratorImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IKeyEnumerator.IID_IKEY_ENUMERATOR, WrapIKeyEnumerator.class)); - - static KeyEnumeratorInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(KeyEnumeratorInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/KeyStoreImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/KeyStoreImpl.java deleted file mode 100644 index 2e82df8a75..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/KeyStoreImpl.java +++ /dev/null @@ -1,80 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.main; - -import com.sun.jna.Pointer; -import com.sun.jna.WString; -import com.sun.jna.platform.win32.COM.COMUtils; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.dbgmodel.main.KeyStore; -import agent.dbgmodel.dbgmodel.main.ModelObject; -import agent.dbgmodel.jna.dbgmodel.main.IKeyStore; - -public class KeyStoreImpl implements KeyStoreInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IKeyStore jnaData; - - public KeyStoreImpl(IKeyStore jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public ModelObject getKey(WString key) { - PointerByReference ppObject = new PointerByReference(); - PointerByReference ppMetadata = new PointerByReference(); - COMUtils.checkRC(jnaData.GetKey(key, ppObject, ppMetadata)); - - return ModelObjectImpl.getObjectWithMetadata(ppObject, ppMetadata); - } - - @Override - public void setKey(WString key, ModelObject object, KeyStore metadata) { - Pointer pObject = object.getPointer(); - Pointer pMetadata = metadata.getPointer(); - COMUtils.checkRC(jnaData.SetKey(key, pObject, pMetadata)); - } - - @Override - public ModelObject getKeyValue(WString key) { - PointerByReference ppObject = new PointerByReference(); - PointerByReference ppMetadata = new PointerByReference(); - COMUtils.checkRC(jnaData.GetKeyValue(key, ppObject, ppMetadata)); - - return ModelObjectImpl.getObjectWithMetadata(ppObject, ppMetadata); - } - - @Override - public void setKeyValue(WString key, ModelObject object) { - Pointer pObject = object.getPointer(); - COMUtils.checkRC(jnaData.SetKeyValue(key, pObject)); - } - - @Override - public void clearKeys() { - COMUtils.checkRC(jnaData.ClearKeys()); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/KeyStoreInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/KeyStoreInternal.java deleted file mode 100644 index a45b7907da..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/KeyStoreInternal.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.main; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.main.KeyStore; -import agent.dbgmodel.jna.dbgmodel.main.IKeyStore; -import agent.dbgmodel.jna.dbgmodel.main.WrapIKeyStore; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface KeyStoreInternal extends KeyStore { - Map CACHE = new WeakValueHashMap<>(); - - static KeyStoreInternal instanceFor(WrapIKeyStore data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, KeyStoreImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IKeyStore.IID_IKEY_STORE, WrapIKeyStore.class)); - - static KeyStoreInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(KeyStoreInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/ModelIteratorImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/ModelIteratorImpl.java deleted file mode 100644 index 42b07a5abc..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/ModelIteratorImpl.java +++ /dev/null @@ -1,83 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.main; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.WinDef.ULONGLONG; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.platform.win32.COM.COMUtils; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.dbgmodel.COMUtilsExtra; -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.dbgmodel.main.ModelObject; -import agent.dbgmodel.jna.dbgmodel.main.IModelIterator; -import agent.dbgmodel.jna.dbgmodel.main.WrapIModelObject; - -public class ModelIteratorImpl implements ModelIteratorInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IModelIterator jnaData; - - private ModelObject indexers; - - public ModelIteratorImpl(IModelIterator jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public void reset() { - COMUtils.checkRC(jnaData.Reset()); - } - - @Override - public ModelObject getNext(long dimensions) { - PointerByReference ppObject = new PointerByReference(); - ULONGLONG ulDimensions = new ULONGLONG(dimensions); - PointerByReference ppIndexers = new PointerByReference(); - PointerByReference ppMetadata = new PointerByReference(); - HRESULT hr = jnaData.GetNext(ppObject, ulDimensions, ppIndexers, ppMetadata); - if (hr.equals(COMUtilsExtra.E_BOUNDS)) { - return null; - } - COMUtils.checkRC(hr); - - if (ppIndexers.getValue() != null) { - WrapIModelObject wrap = new WrapIModelObject(ppIndexers.getValue()); - try { - indexers = ModelObjectInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - return ModelObjectImpl.getObjectWithMetadata(ppObject, ppMetadata); - } - - @Override - public ModelObject getIndexers() { - return indexers; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/ModelIteratorInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/ModelIteratorInternal.java deleted file mode 100644 index 079e822da6..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/ModelIteratorInternal.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.main; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.main.ModelIterator; -import agent.dbgmodel.jna.dbgmodel.main.IModelIterator; -import agent.dbgmodel.jna.dbgmodel.main.WrapIModelIterator; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface ModelIteratorInternal extends ModelIterator { - Map CACHE = new WeakValueHashMap<>(); - - static ModelIteratorInternal instanceFor(WrapIModelIterator data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, ModelIteratorImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IModelIterator.IID_IMODEL_ITERATOR, WrapIModelIterator.class)); - - static ModelIteratorInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(ModelIteratorInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/ModelKeyReferenceImpl1.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/ModelKeyReferenceImpl1.java deleted file mode 100644 index 31c50f1b6c..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/ModelKeyReferenceImpl1.java +++ /dev/null @@ -1,117 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.main; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.OleAuto; -import com.sun.jna.platform.win32.WTypes.BSTR; -import com.sun.jna.platform.win32.WTypes.BSTRByReference; -import com.sun.jna.platform.win32.COM.COMUtils; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.dbgmodel.main.KeyStore; -import agent.dbgmodel.dbgmodel.main.ModelObject; -import agent.dbgmodel.jna.dbgmodel.main.IModelKeyReference; -import agent.dbgmodel.jna.dbgmodel.main.WrapIModelObject; - -public class ModelKeyReferenceImpl1 implements ModelKeyReferenceInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IModelKeyReference jnaData; - - public ModelKeyReferenceImpl1(IModelKeyReference jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public String getKeyName() { - BSTRByReference bref = new BSTRByReference(); - COMUtils.checkRC(jnaData.GetKeyName(bref)); - BSTR bstr = bref.getValue(); - String keyName = bstr.getValue(); - OleAuto.INSTANCE.SysFreeString(bstr); - return keyName; - } - - @Override - public ModelObject getOriginalObject() { - PointerByReference ppOriginalObject = new PointerByReference(); - COMUtils.checkRC(jnaData.GetOriginalObject(ppOriginalObject)); - - WrapIModelObject wrap = new WrapIModelObject(ppOriginalObject.getValue()); - try { - return ModelObjectInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public ModelObject getContextObject() { - PointerByReference ppContainingObject = new PointerByReference(); - COMUtils.checkRC(jnaData.GetContextObject(ppContainingObject)); - - WrapIModelObject wrap = new WrapIModelObject(ppContainingObject.getValue()); - try { - return ModelObjectInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public ModelObject getKey() { - PointerByReference ppObject = new PointerByReference(); - PointerByReference ppMetadata = new PointerByReference(); - COMUtils.checkRC(jnaData.GetKey(ppObject, ppMetadata)); - - return ModelObjectImpl.getObjectWithMetadata(ppObject, ppMetadata); - } - - @Override - public ModelObject getKeyValue() { - PointerByReference ppObject = new PointerByReference(); - PointerByReference ppMetadata = new PointerByReference(); - COMUtils.checkRC(jnaData.GetKeyValue(ppObject, ppMetadata)); - - return ModelObjectImpl.getObjectWithMetadata(ppObject, ppMetadata); - } - - @Override - public void setKey(ModelObject object, KeyStore metadata) { - Pointer pObject = object.getPointer(); - Pointer pMetadata = metadata.getPointer(); - COMUtils.checkRC(jnaData.SetKey(pObject, pMetadata)); - } - - @Override - public void setKeyValue(ModelObject object, KeyStore metadata) { - Pointer pObject = object.getPointer(); - Pointer pMetadata = metadata.getPointer(); - COMUtils.checkRC(jnaData.SetKey(pObject, pMetadata)); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/ModelKeyReferenceImpl2.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/ModelKeyReferenceImpl2.java deleted file mode 100644 index 6c52fbf60f..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/ModelKeyReferenceImpl2.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.main; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.COM.COMUtils; - -import agent.dbgmodel.dbgmodel.main.ModelKeyReference2; -import agent.dbgmodel.dbgmodel.main.ModelObject; -import agent.dbgmodel.jna.dbgmodel.main.IModelKeyReference2; - -public class ModelKeyReferenceImpl2 extends ModelKeyReferenceImpl1 implements ModelKeyReference2 { - @SuppressWarnings("unused") - private final IModelKeyReference2 jnaData; - - public ModelKeyReferenceImpl2(IModelKeyReference2 jnaData) { - super(jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public void overrideContextObject(ModelObject newContextObject) { - Pointer pNewContextObject = newContextObject.getPointer(); - COMUtils.checkRC(jnaData.OverrideContextObject(pNewContextObject)); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/ModelKeyReferenceInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/ModelKeyReferenceInternal.java deleted file mode 100644 index 71b0474773..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/ModelKeyReferenceInternal.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.main; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.main.ModelKeyReference1; -import agent.dbgmodel.jna.dbgmodel.main.*; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface ModelKeyReferenceInternal extends ModelKeyReference1 { - Map CACHE = new WeakValueHashMap<>(); - - static ModelKeyReferenceInternal instanceFor(WrapIModelKeyReference1 data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, ModelKeyReferenceImpl1::new); - } - - static ModelKeyReferenceInternal instanceFor(WrapIModelKeyReference2 data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, ModelKeyReferenceImpl2::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IModelKeyReference2.IID_IMODEL_REFERENCE2, WrapIModelKeyReference2.class), - new Preferred<>(IModelKeyReference.IID_IMODEL_REFERENCE, WrapIModelKeyReference1.class)); - - static ModelKeyReferenceInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(ModelKeyReferenceInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/ModelMethodImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/ModelMethodImpl.java deleted file mode 100644 index 1c8e0a19f8..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/ModelMethodImpl.java +++ /dev/null @@ -1,56 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.main; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.WinDef.ULONGLONG; -import com.sun.jna.platform.win32.COM.COMUtils; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.dbgmodel.main.ModelObject; -import agent.dbgmodel.jna.dbgmodel.main.IModelMethod; - -public class ModelMethodImpl implements ModelMethodInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IModelMethod jnaData; - - public ModelMethodImpl(IModelMethod jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public ModelObject call(ModelObject contextObject, long argCount, Pointer[] ppArguments) { - Pointer pContextObject = contextObject.getPointer(); - ULONGLONG ulArgCount = new ULONGLONG(argCount); - - PointerByReference ppResult = new PointerByReference(); - PointerByReference ppMetadata = new PointerByReference(); - COMUtils.checkRC( - jnaData.Call(pContextObject, ulArgCount, ppArguments, ppResult, ppMetadata)); - - return ModelObjectImpl.getObjectWithMetadata(ppResult, ppMetadata); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/ModelMethodInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/ModelMethodInternal.java deleted file mode 100644 index b606d6b5af..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/ModelMethodInternal.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.main; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.main.ModelMethod; -import agent.dbgmodel.jna.dbgmodel.main.IModelMethod; -import agent.dbgmodel.jna.dbgmodel.main.WrapIModelMethod; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface ModelMethodInternal extends ModelMethod { - Map CACHE = new WeakValueHashMap<>(); - - static ModelMethodInternal instanceFor(WrapIModelMethod data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, ModelMethodImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IModelMethod.IID_IMODEL_METHOD, WrapIModelMethod.class)); - - static ModelMethodInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(ModelMethodInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/ModelObjectImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/ModelObjectImpl.java deleted file mode 100644 index acf74189cb..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/ModelObjectImpl.java +++ /dev/null @@ -1,1023 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.main; - -import java.util.*; - -import com.sun.jna.Pointer; -import com.sun.jna.WString; -import com.sun.jna.platform.win32.Guid.REFIID; -import com.sun.jna.platform.win32.Variant.VARIANT; -import com.sun.jna.platform.win32.WTypes.VARTYPE; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.platform.win32.COM.COMUtils; -import com.sun.jna.platform.win32.COM.Unknown; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.dbgmodel.*; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.dbgmodel.concept.*; -import agent.dbgmodel.dbgmodel.datamodel.DataModelManager1; -import agent.dbgmodel.dbgmodel.debughost.DebugHostContext; -import agent.dbgmodel.dbgmodel.debughost.DebugHostType1; -import agent.dbgmodel.dbgmodel.main.*; -import agent.dbgmodel.impl.dbgmodel.UnknownExImpl; -import agent.dbgmodel.impl.dbgmodel.UnknownExInternal; -import agent.dbgmodel.impl.dbgmodel.concept.*; -import agent.dbgmodel.impl.dbgmodel.debughost.DebugHostContextInternal; -import agent.dbgmodel.impl.dbgmodel.debughost.DebugHostTypeInternal; -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.*; -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.WrapIUnknownEx; -import agent.dbgmodel.jna.dbgmodel.concept.*; -import agent.dbgmodel.jna.dbgmodel.debughost.WrapIDebugHostContext; -import agent.dbgmodel.jna.dbgmodel.debughost.WrapIDebugHostType1; -import agent.dbgmodel.jna.dbgmodel.main.*; -import ghidra.util.Msg; - -public class ModelObjectImpl implements ModelObjectInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IModelObject jnaData; - - private KeyStore metadata; - private ModelObject contextObject; - - private LOCATION targetLocation; - private ModelObject indexer; - private String key; - - public ModelObjectImpl(IModelObject jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public IModelObject getJnaData() { - return jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public DebugHostContext getContext() { - PointerByReference ppContext = new PointerByReference(); - COMUtils.checkRC(jnaData.GetContext(ppContext)); - - Pointer value = ppContext.getValue(); - if (value == null) { - return null; - } - - WrapIDebugHostContext wrap = new WrapIDebugHostContext(value); - try { - return DebugHostContextInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public ModelObjectKind getKind() { - try { - ULONGByReference pulKind = new ULONGByReference(); - COMUtils.checkRC(jnaData.GetKind(pulKind)); - int i = pulKind.getValue().intValue(); - return ModelObjectKind.values()[i]; - } - catch (Exception e) { - System.err.println("GetKind error " + getSearchKey() + ":" + e); - } - return ModelObjectKind.OBJECT_ERROR; - } - - @Override - public Object getIntrinsicValue() { - VARIANT.ByReference pIntrinsicData = new VARIANT.ByReference(); - HRESULT hr = jnaData.GetIntrinsicValue(pIntrinsicData); - if (hr.equals(COMUtilsExtra.E_FAIL)) { - return null; - } - COMUtils.checkRC(hr); - return pIntrinsicData.getValue(); - } - - @Override - public VARIANT getIntrinsicValueAs(VARTYPE vt) { - VARIANT.ByReference pIntrinsicData = new VARIANT.ByReference(); - COMUtils.checkRC(jnaData.GetIntrinsicValueAs(vt, pIntrinsicData)); - return (VARIANT) pIntrinsicData.getValue(); - } - - @Override - public ModelObject getKeyValue(String searchKey) { - PointerByReference ppObject = new PointerByReference(); - PointerByReference ppMetadata = new PointerByReference(); - HRESULT hr = jnaData.GetKeyValue(new WString(searchKey), ppObject, ppMetadata); - if (!hr.equals(new HRESULT(0)) && - (searchKey.equals("Parameters") || searchKey.equals("LocalVariables"))) { - return null; - } - if (hr.equals(COMUtilsExtra.E_FAIL)) { - System.err.println(searchKey + " failed"); - return null; - } - if (hr.equals(COMUtilsExtra.E_BOUNDS)) { - System.err.println(searchKey + " out of bounds"); - return null; - } - if (hr.equals(COMUtilsExtra.E_INVALID_PARAM)) { - Msg.debug(this, searchKey + " invalid param"); - return null; - } - if (hr.equals(COMUtilsExtra.E_SCOPE_NOT_FOUND)) { - Msg.debug(this, searchKey + " scope not found"); - return null; - } - if (hr.equals(COMUtilsExtra.E_CANNOT_READ)) { - Msg.debug(this, searchKey + " cannot be read"); - return null; - } - if (hr.equals(COMUtilsExtra.E_NOINTERFACE)) { - Msg.debug(this, searchKey + " missing interface"); - return null; - } - COMUtils.checkRC(hr); - - ModelObject retval = getObjectWithMetadata(ppObject, ppMetadata); - retval.setSearchKey(searchKey); - return retval; - } - - @Override - public void setKeyValue(WString key, ModelObject object) { - Pointer pObject = object.getPointer(); - COMUtils.checkRC(jnaData.SetKeyValue(key, pObject)); - } - - @Override - public KeyEnumerator enumerateKeyValues() { - PointerByReference ppEnumerator = new PointerByReference(); - COMUtils.checkRC(jnaData.EnumerateKeyValues(ppEnumerator)); - - WrapIKeyEnumerator wrap = new WrapIKeyEnumerator(ppEnumerator.getValue()); - try { - return KeyEnumeratorInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public ModelObject getRawValue(int kind, WString name, int searchFlags) { - ULONG ulKind = new ULONG(kind); - ULONG ulSearchFlags = new ULONG(searchFlags); - PointerByReference ppObject = new PointerByReference(); - COMUtils.checkRC(jnaData.GetRawValue(ulKind, name, ulSearchFlags, ppObject)); - - WrapIModelObject wrap = new WrapIModelObject(ppObject.getValue()); - try { - return ModelObjectInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public RawEnumerator enumerateRawValues(int kind, int searchFlags) { - ULONG ulKind = new ULONG(kind); - ULONG ulSearchFlags = new ULONG(searchFlags); - PointerByReference ppEnumerator = new PointerByReference(); - COMUtils.checkRC(jnaData.EnumerateRawValues(ulKind, ulSearchFlags, ppEnumerator)); - - WrapIRawEnumerator wrap = new WrapIRawEnumerator(ppEnumerator.getValue()); - try { - return RawEnumeratorInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public ModelObject dereference() { - PointerByReference ppObject = new PointerByReference(); - COMUtils.checkRC(jnaData.Dereference(ppObject)); - - WrapIModelObject wrap = new WrapIModelObject(ppObject.getValue()); - try { - return ModelObjectInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public ModelObject tryCastToRuntimeType() { - PointerByReference ppRuntimeTypedObject = new PointerByReference(); - COMUtils.checkRC(jnaData.TryCastToRuntimeType(ppRuntimeTypedObject)); - - WrapIModelObject wrap = new WrapIModelObject(ppRuntimeTypedObject.getValue()); - try { - return ModelObjectInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public Concept getConcept(REFIID conceptId) { - PointerByReference ppConceptInterface = new PointerByReference(); - PointerByReference ppConceptMetadata = new PointerByReference(); - HRESULT hr = jnaData.GetConcept(conceptId, ppConceptInterface, ppConceptMetadata); - if (hr.equals(COMUtilsExtra.E_NOINTERFACE)) { - //System.err.println("No such interface " + conceptId); - return null; - } - COMUtils.checkRC(hr); - - Concept object = null; - KeyStore mdata = null; - - Pointer value = ppConceptMetadata.getValue(); - if (value != null) { - WrapIKeyStore wrap1 = new WrapIKeyStore(value); - try { - mdata = KeyStoreInternal.tryPreferredInterfaces(wrap1::QueryInterface); - } - finally { - wrap1.Release(); - } - } - - if (conceptId.getValue() - .equals(IStringDisplayableConcept.IID_ISTRING_DISPLAYABLE_CONCEPT)) { - WrapIStringDisplayableConcept wrap = - new WrapIStringDisplayableConcept(ppConceptInterface.getValue()); - try { - object = - StringDisplayableConceptInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - if (conceptId.getValue() - .equals(IPreferredRuntimeTypeConcept.IID_IPREFERRED_RUNTIME_TYPE_CONCEPT)) { - WrapIPreferredRuntimeTypeConcept wrap = - new WrapIPreferredRuntimeTypeConcept(ppConceptInterface.getValue()); - try { - object = PreferredRuntimeTypeConceptInternal - .tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - if (conceptId.getValue().equals(IIterableConcept.IID_IITERABLE_CONCEPT)) { - WrapIIterableConcept wrap = new WrapIIterableConcept(ppConceptInterface.getValue()); - try { - object = IterableConceptInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - if (conceptId.getValue().equals(IIndexableConcept.IID_IINDEXABLE_CONCEPT)) { - WrapIIndexableConcept wrap = new WrapIIndexableConcept(ppConceptInterface.getValue()); - try { - object = IndexableConceptInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - if (conceptId.getValue().equals(IEquatableConcept.IID_IEQUATABLE_CONCEPT)) { - WrapIEquatableConcept wrap = new WrapIEquatableConcept(ppConceptInterface.getValue()); - try { - object = EquatableConceptInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - if (conceptId.getValue() - .equals(IDynamicKeyProviderConcept.IID_IDYNAMIC_KEY_PROVIDER_CONCEPT)) { - WrapIDynamicKeyProviderConcept wrap = - new WrapIDynamicKeyProviderConcept(ppConceptInterface.getValue()); - try { - object = - DynamicKeyProviderConceptInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - if (conceptId.getValue() - .equals(IDynamicConceptProviderConcept.IID_IDYNAMIC_CONCEPT_PROVIDER_CONCEPT)) { - WrapIDynamicConceptProviderConcept wrap = - new WrapIDynamicConceptProviderConcept(ppConceptInterface.getValue()); - try { - object = DynamicConceptProviderConceptInternal - .tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - if (conceptId.getValue().equals(IDataModelConcept.IID_IDATA_MODEL_CONCEPT)) { - WrapIDataModelConcept wrap = new WrapIDataModelConcept(ppConceptInterface.getValue()); - try { - object = DataModelConceptInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - if (conceptId.getValue().equals(IComparableConcept.IID_ICOMPARABLE_CONCEPT)) { - WrapIComparableConcept wrap = new WrapIComparableConcept(ppConceptInterface.getValue()); - try { - object = ComparableConceptInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - if (object != null && mdata != null) { - object.setMetadata(mdata); - } - return object; - } - - @Override - public LOCATION getLocation() { - LOCATION.ByReference pLocation = new LOCATION.ByReference(); - COMUtils.checkRC(jnaData.GetLocation(pLocation)); - return new LOCATION(pLocation); - } - - @Override - public DebugHostType1 getTypeInfo() { - PointerByReference ppType = new PointerByReference(); - COMUtils.checkRC(jnaData.GetTypeInfo(ppType)); - - Pointer value = ppType.getValue(); - if (value == null) { - return null; - } - - WrapIDebugHostType1 wrap = new WrapIDebugHostType1(value); - try { - return DebugHostTypeInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public DebugHostType1 getTargetInfo() { - LOCATION.ByReference pLocation = new LOCATION.ByReference(); - PointerByReference ppType = new PointerByReference(); - COMUtils.checkRC(jnaData.GetTargetInfo(pLocation, ppType)); - - targetLocation = new LOCATION(pLocation); - - Pointer value = ppType.getValue(); - if (value == null) { - return null; - } - - WrapIDebugHostType1 wrap = new WrapIDebugHostType1(value); - try { - return DebugHostTypeInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public long getNumberOfParentModels() { - ULONGLONGByReference pulNumModels = new ULONGLONGByReference(); - COMUtils.checkRC(jnaData.GetNumberOfParentModels(pulNumModels)); - return pulNumModels.getValue().longValue(); - } - - @Override - public ModelObject getParentModel(int i) { - ULONG ulI = new ULONG(i); - PointerByReference ppModel = new PointerByReference(); - PointerByReference ppContextObject = new PointerByReference(); - COMUtils.checkRC(jnaData.GetParentModel(ulI, ppModel, ppContextObject)); - - return getObjectWithContext(ppModel, ppContextObject); - } - - @Override - public void addParentModel(ModelObject model, ModelObject contextObject, boolean override) { - Pointer pModel = model.getPointer(); - Pointer pContextObject = contextObject.getPointer(); - BOOL bOverride = new BOOL(override); - COMUtils.checkRC(jnaData.AddParentModel(pModel, pContextObject, bOverride)); - } - - @Override - public void removeParentModel(ModelObject model) { - Pointer pModel = model.getPointer(); - COMUtils.checkRC(jnaData.RemoveParentModel(pModel)); - } - - @Override - public ModelObject getKey(String searchKey) { - WString kstr = new WString(searchKey); - PointerByReference ppObject = new PointerByReference(); - PointerByReference ppMetadata = new PointerByReference(); - COMUtils.checkRC(jnaData.GetKey(kstr, ppObject, ppMetadata)); - - ModelObject retval = getObjectWithMetadata(ppObject, ppMetadata); - retval.setSearchKey(key); - return retval; - } - - @Override - public ModelObject getKeyReference(String searchKey) { - WString kstr = new WString(searchKey); - PointerByReference ppObjectReference = new PointerByReference(); - PointerByReference ppMetadata = new PointerByReference(); - COMUtils.checkRC(jnaData.GetKeyReference(kstr, ppObjectReference, ppMetadata)); - - ModelObject retval = getObjectWithMetadata(ppObjectReference, ppMetadata); - retval.setSearchKey(key); - return retval; - } - - @Override - public void setKey(WString key, ModelObject object, KeyStore conceptMetadata) { - Pointer pObject = object.getPointer(); - Pointer pMetadata = conceptMetadata.getPointer(); - COMUtils.checkRC(jnaData.SetKey(key, pObject, pMetadata)); - } - - @Override - public void clearKeys() { - COMUtils.checkRC(jnaData.ClearKeys()); - } - - @Override - public KeyEnumerator enumerateKeys() { - PointerByReference ppEnumerator = new PointerByReference(); - COMUtils.checkRC(jnaData.EnumerateKeys(ppEnumerator)); - - WrapIKeyEnumerator wrap = new WrapIKeyEnumerator(ppEnumerator.getValue()); - try { - return KeyEnumeratorInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public KeyEnumerator enumerateKeyReferences() { - PointerByReference ppEnumerator = new PointerByReference(); - COMUtils.checkRC(jnaData.EnumerateKeyReferences(ppEnumerator)); - - WrapIKeyEnumerator wrap = new WrapIKeyEnumerator(ppEnumerator.getValue()); - try { - return KeyEnumeratorInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public void setConcept(REFIID conceptId, ModelObject conceptInterface, - ModelObject conceptMetadata) { - Pointer pConceptInterface = conceptInterface.getPointer(); - Pointer pConceptMetadata = conceptMetadata.getPointer(); - COMUtils.checkRC(jnaData.SetConcept(conceptId, pConceptInterface, pConceptMetadata)); - - } - - @Override - public void clearConcepts() { - COMUtils.checkRC(jnaData.ClearConcepts()); - } - - @Override - public ModelObject getRawReference(int kind, WString name, int searchFlags) { - ULONG ulKind = new ULONG(kind); - ULONG ulSearchFlags = new ULONG(searchFlags); - PointerByReference ppObject = new PointerByReference(); - COMUtils.checkRC(jnaData.GetRawValue(ulKind, name, ulSearchFlags, ppObject)); - - WrapIModelObject wrap = new WrapIModelObject(ppObject.getValue()); - try { - return ModelObjectInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public RawEnumerator enumerateRawReferences(int kind, int searchFlags) { - ULONG ulKind = new ULONG(kind); - ULONG ulSearchFlags = new ULONG(searchFlags); - PointerByReference ppEnumerator = new PointerByReference(); - COMUtils.checkRC(jnaData.EnumerateRawValues(ulKind, ulSearchFlags, ppEnumerator)); - - WrapIRawEnumerator wrap = new WrapIRawEnumerator(ppEnumerator.getValue()); - try { - return RawEnumeratorInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public void setContextForDataModel(ModelObject dataModelObject, IUnknownEx context) { - Pointer pDataModelObject = dataModelObject.getPointer(); - Pointer pContext = context.getPointer(); - COMUtils.checkRC(jnaData.SetContextForDataModel(pDataModelObject, pContext)); - - } - - @Override - public UnknownEx getContextForDataModel(ModelObject dataModelObject) { - Pointer pDataModelObject = dataModelObject.getPointer(); - PointerByReference ppContext = new PointerByReference(); - COMUtils.checkRC(jnaData.GetContextForDataModel(pDataModelObject, ppContext)); - - WrapIUnknownEx wrap = new WrapIUnknownEx(ppContext.getValue()); - try { - return UnknownExInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public boolean compare(ModelObject contextObject, ModelObject other) { - Pointer pOther = other.getPointer(); - BOOLByReference bEqual = new BOOLByReference(); - COMUtils.checkRC(jnaData.Compare(pOther, bEqual)); - return bEqual.getValue().booleanValue(); - } - - /***********************/ - /* CONVENIENCE METHODS */ - /***********************/ - - @Override - public KeyStore getMetadata() { - return metadata; - } - - @Override - public void setMetadata(KeyStore metadata) { - this.metadata = metadata; - } - - public ModelObject getContextObject() { - return contextObject; - } - - @Override - public void setContextObject(ModelObject context) { - this.contextObject = context; - } - - public LOCATION getTargetLocation() { - return targetLocation; - } - - public static ModelObject getObjectWithContext(PointerByReference ppObject, - PointerByReference ppContext) { - WrapIModelObject wrap0 = new WrapIModelObject(ppObject.getValue()); - try { - ModelObject object = ModelObjectInternal.tryPreferredInterfaces(wrap0::QueryInterface); - WrapIModelObject wrap1 = new WrapIModelObject(ppContext.getValue()); - try { - ModelObject context = - ModelObjectInternal.tryPreferredInterfaces(wrap1::QueryInterface); - object.setContextObject(context); - } - finally { - wrap1.Release(); - } - return object; - } - finally { - wrap0.Release(); - } - } - - public static ModelObject getObjectWithMetadata(PointerByReference ppObject, - PointerByReference ppMetadata) { - WrapIModelObject wrap0 = new WrapIModelObject(ppObject.getValue()); - try { - ModelObject object = ModelObjectInternal.tryPreferredInterfaces(wrap0::QueryInterface); - Pointer value = ppMetadata.getValue(); - if (value != null) { - WrapIKeyStore wrap1 = new WrapIKeyStore(value); - try { - KeyStore mdata = KeyStoreInternal.tryPreferredInterfaces(wrap1::QueryInterface); - object.setMetadata(mdata); - } - finally { - wrap1.Release(); - } - } - return object; - } - finally { - wrap0.Release(); - } - } - - public static UnknownEx getUnknownWithMetadata(PointerByReference ppObject, - PointerByReference ppMetadata) { - WrapIUnknownEx wrap0 = new WrapIUnknownEx(ppObject.getValue()); - try { - UnknownEx object = UnknownExInternal.tryPreferredInterfaces(wrap0::QueryInterface); - Pointer value = ppMetadata.getValue(); - if (value != null) { - WrapIKeyStore wrap1 = new WrapIKeyStore(value); - try { - KeyStore mdata = KeyStoreInternal.tryPreferredInterfaces(wrap1::QueryInterface); - ((UnknownExImpl) object).setMetadata(mdata); - } - finally { - wrap1.Release(); - } - } - return object; - } - finally { - wrap0.Release(); - } - } - - @Override - public List getElements() { - List list = new ArrayList(); - REFIID ref = new REFIID(IIterableConcept.IID_IITERABLE_CONCEPT); - IterableConcept concept = (IterableConcept) this.getConcept(ref); - if (concept == null) { - return list; - } - - ModelIterator iterator = concept.getIterator(this); - //long dim = concept.getDefaultIndexDimensionality(this); - if (iterator != null) { - ModelObject next; - int i = 0; - while ((next = iterator.getNext(1)) != null) { - ModelObject index = iterator.getIndexers(); - if (index != null) { - next.setIndexer(index); - } - else { - next.setSearchKey(Integer.toHexString(i)); - } - list.add(next); - i++; - } - } - return list; - } - - @Override - public ModelObject getElement(String key) { - REFIID ref = new REFIID(IIterableConcept.IID_IITERABLE_CONCEPT); - IterableConcept concept = (IterableConcept) this.getConcept(ref); - if (concept == null) { - return null; - } - - ModelIterator iterator = concept.getIterator(this); - //long dim = concept.getDefaultIndexDimensionality(this); - if (iterator != null) { - ModelObject next; - int i = 0; - while ((next = iterator.getNext(1)) != null) { - ModelObject index = iterator.getIndexers(); - if (index != null) { - next.setIndexer(index); - if (next.getSearchKey().equals(key)) { - return next; - } - } - else { - next.setSearchKey(Integer.toHexString(i)); - if (Integer.toHexString(i).equals(key)) { - return next; - } - } - i++; - } - } - return null; - } - - @Override - public ModelObject getChild(DataModelManager1 manager, VARIANT v) { - REFIID ref = new REFIID(IIndexableConcept.IID_IINDEXABLE_CONCEPT); - IndexableConcept indexable = (IndexableConcept) this.getConcept(ref); - if (indexable == null) { - return null; - } - long dimensionality = indexable.getDimensionality(this); - Pointer[] ppIndexers = new Pointer[(int) dimensionality]; - VARIANT.ByReference vbr = new VARIANT.ByReference(v); - ModelObject mo = manager.createIntrinsicObject(ModelObjectKind.OBJECT_INTRINSIC, vbr); - ppIndexers[0] = mo.getPointer(); - return indexable.getAt(this, dimensionality, ppIndexers); - } - - @Override - public void switchTo(DataModelManager1 manager, VARIANT v) { - Pointer[] args = new Pointer[1]; - VARIANT.ByReference vbr = new VARIANT.ByReference(v); - ModelObject mo = manager.createIntrinsicObject(ModelObjectKind.OBJECT_INTRINSIC, vbr); - args[0] = mo.getPointer(); - ModelMethod f = getMethod("SwitchTo"); - f.call(this, 1, args); - } - - @Override - public Object getValue() { - Object val = this.getIntrinsicValue(); - if (val instanceof SHORT) { - return ((SHORT) val).shortValue(); - } - if (val instanceof USHORT) { - return ((USHORT) val).shortValue(); - } - if (val instanceof LONG) { - return ((LONG) val).intValue(); - } - if (val instanceof ULONG) { - return ((ULONG) val).intValue(); - } - if (val instanceof ULONGLONG) { - return ((ULONGLONG) val).longValue(); - } - return val; - } - - @Override - public String getValueString() { - Object val = this.getIntrinsicValue(); - if (val instanceof SHORT) { - return Integer.toHexString(((SHORT) val).shortValue()); - } - if (val instanceof USHORT) { - return Integer.toHexString(((USHORT) val).shortValue()); - } - if (val instanceof LONG) { - return Integer.toHexString(((LONG) val).intValue()); - } - if (val instanceof ULONG) { - return Integer.toHexString(((ULONG) val).intValue()); - } - if (val instanceof ULONGLONG) { - return Long.toHexString(((ULONGLONG) val).longValue()); - } - return val == null ? "" : val.toString(); - } - - @Override - public String toString() { - REFIID ref = new REFIID(IStringDisplayableConcept.IID_ISTRING_DISPLAYABLE_CONCEPT); - StringDisplayableConcept displayable = (StringDisplayableConcept) this.getConcept(ref); - if (displayable == null) { - return super.toString(); - } - return displayable.toDisplayString(this, null); - } - - @Override - public synchronized Map getKeyValueMap() { - TreeMap map = new TreeMap(); - String kstr; - KeyEnumerator enumerator = this.enumerateKeys(); - while ((kstr = enumerator.getNext()) != null) { - ModelObject value = this.getKeyValue(kstr); - //ModelObject v2 = enumerator.getValue(); - //if (!v2.equals(value)) { - // System.err.println("getKVMap: "+kstr+":"+this.getSearchKey()); - //} - if (value != null) { - value.setSearchKey(kstr); - //System.err.println("kv:" + kstr + ":" + value); - map.put(kstr, value); - } - } - return map; - } - - @Override - public synchronized ModelObject getKeyValueByEnum(String key) { - String kstr; - KeyEnumerator enumerator = this.enumerateKeys(); - while ((kstr = enumerator.getNext()) != null) { - if (kstr.equals(key)) { - ModelObject value = this.getKeyValue(kstr); - if (value != null) { - value.setSearchKey(kstr); - return value; - } - } - } - return null; - } - - @Override - public synchronized Map getRawValueMap() { - TreeMap map = new TreeMap(); - TypeKind typeKind = getTypeKind(); - if (typeKind == null) { - return map; - } - SymbolKind kind = null; - switch (typeKind) { - case TYPE_UDT: - kind = SymbolKind.SYMBOL_FIELD; - break; - case TYPE_POINTER: - kind = SymbolKind.SYMBOL_BASE_CLASS; - try { - ModelObject dereference = this.dereference(); - return dereference.getRawValueMap(); - } - catch (Exception e) { - kind = null; - break; - } - case TYPE_INTRINSIC: - case TYPE_ARRAY: - break; - default: - System.err.println(this.getSearchKey() + ":" + typeKind); - break; - } - - if (kind == null) { - return map; - } - String kstr; - RawEnumerator enumerator = this.enumerateRawValues(kind.ordinal(), 0); - while ((kstr = enumerator.getNext()) != null) { - ModelObject value = enumerator.getValue(); - value.setSearchKey(kstr); - map.put(kstr, value); - } - return map; - } - - @Override - public synchronized ModelObject getRawValueByEnum(String key) { - TypeKind typeKind = getTypeKind(); - if (typeKind == null) { - return null; - } - SymbolKind kind = null; - switch (typeKind) { - case TYPE_UDT: - kind = SymbolKind.SYMBOL_FIELD; - break; - case TYPE_POINTER: - kind = SymbolKind.SYMBOL_BASE_CLASS; - try { - ModelObject dereference = this.dereference(); - return dereference.getRawValueByEnum(key); - } - catch (Exception e) { - kind = null; - break; - } - case TYPE_INTRINSIC: - case TYPE_ARRAY: - break; - default: - System.err.println(this.getSearchKey() + ":" + typeKind); - break; - } String kstr; - RawEnumerator enumerator = this.enumerateRawValues(kind.ordinal(), 0); - while ((kstr = enumerator.getNext()) != null) { - ModelObject value = enumerator.getValue(); - value.setSearchKey(kstr); - return value; - } - return null; - } - - @Override - public TypeKind getTypeKind() { - ModelObjectKind modelKind = getKind(); - TypeKind typeKind = null; - if (modelKind.equals(ModelObjectKind.OBJECT_TARGET_OBJECT)) { - DebugHostType1 targetInfo = getTargetInfo(); - typeKind = targetInfo.getTypeKind(); - } - if (modelKind.equals(ModelObjectKind.OBJECT_INTRINSIC)) { - DebugHostType1 typeInfo = getTypeInfo(); - if (typeInfo != null) { - typeKind = typeInfo.getTypeKind(); - } - } - return typeKind; - } - - @Override - public ModelMethod getMethod(String name) { - ModelObject m = getKeyValue(name); - if (m == null || !m.getKind().equals(ModelObjectKind.OBJECT_METHOD)) { - return null; - } - Unknown unk = (Unknown) m.getIntrinsicValue(); - return ModelMethodInternal.tryPreferredInterfaces(unk::QueryInterface); - } - - @Override - public ModelObject getIndexer() { - return indexer; - } - - @Override - public void setIndexer(ModelObject indexer) { - this.indexer = indexer; - String str = "0x" + indexer.getValueString(); - if (!str.equals("")) { - key = str; - } - } - - @Override - public String getSearchKey() { - if (key == null) { - throw new RuntimeException("null key for " + this); - } - ModelObject keyValue = getKeyValueByEnum("BaseAddress"); - if (keyValue != null) { - return keyValue.getValueString(); - } - keyValue = getKeyValueByEnum("Id"); - ModelObject keyValue2 = getKeyValueByEnum("UniqueID"); - if (keyValue != null && keyValue2 != null) { - return keyValue.getValueString(); - } - return key; - } - - @Override - public String getOriginalKey() { - if (key == null) { - throw new RuntimeException("null key for " + this); - } - return key; - } - - @Override - public void setSearchKey(String key) { - this.key = key; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/ModelObjectInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/ModelObjectInternal.java deleted file mode 100644 index 860ccf2eaa..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/ModelObjectInternal.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.main; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.main.ModelObject; -import agent.dbgmodel.jna.dbgmodel.main.IModelObject; -import agent.dbgmodel.jna.dbgmodel.main.WrapIModelObject; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface ModelObjectInternal extends ModelObject { - Map CACHE = new WeakValueHashMap<>(); - - static ModelObjectInternal instanceFor(WrapIModelObject data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, ModelObjectImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IModelObject.IID_IMODEL_OBJECT, WrapIModelObject.class)); - - static ModelObjectInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(ModelObjectInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/ModelPropertyAccessorImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/ModelPropertyAccessorImpl.java deleted file mode 100644 index 796fd186b1..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/ModelPropertyAccessorImpl.java +++ /dev/null @@ -1,73 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.main; - -import com.sun.jna.Pointer; -import com.sun.jna.WString; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.platform.win32.COM.COMUtils; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.dbgmodel.COMUtilsExtra; -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.dbgmodel.main.ModelObject; -import agent.dbgmodel.jna.dbgmodel.main.IModelPropertyAccessor; -import agent.dbgmodel.jna.dbgmodel.main.WrapIModelObject; - -public class ModelPropertyAccessorImpl implements ModelPropertyAccessorInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IModelPropertyAccessor jnaData; - - public ModelPropertyAccessorImpl(IModelPropertyAccessor jnaData) { - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public ModelObject getValue(String key, ModelObject contextObject) { - Pointer pContextObject = contextObject.getPointer(); - PointerByReference ppValue = new PointerByReference(); - HRESULT hr = jnaData.GetValue(new WString(key), pContextObject, ppValue); - if (hr.equals(COMUtilsExtra.E_INVALID_PARAM)) { - System.err.println(key + " invalid param "); - return null; - } - COMUtils.checkRC(hr); - - WrapIModelObject wrap = new WrapIModelObject(ppValue.getValue()); - try { - return ModelObjectInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - } - - @Override - public void setValue(String key, ModelObject contextObject, ModelObject value) { - Pointer pContextObject = contextObject.getPointer(); - Pointer pValue = value.getPointer(); - COMUtils.checkRC(jnaData.SetValue(new WString(key), pContextObject, pValue)); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/ModelPropertyAccessorInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/ModelPropertyAccessorInternal.java deleted file mode 100644 index ecf54e2184..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/ModelPropertyAccessorInternal.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.main; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.main.ModelPropertyAccessor; -import agent.dbgmodel.jna.dbgmodel.main.IModelPropertyAccessor; -import agent.dbgmodel.jna.dbgmodel.main.WrapIModelPropertyAccessor; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface ModelPropertyAccessorInternal extends ModelPropertyAccessor { - Map CACHE = new WeakValueHashMap<>(); - - static ModelPropertyAccessorInternal instanceFor(WrapIModelPropertyAccessor data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, ModelPropertyAccessorImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IModelPropertyAccessor.IID_IMODEL_PROPERTY_ACCESSOR, - WrapIModelPropertyAccessor.class)); - - static ModelPropertyAccessorInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(ModelPropertyAccessorInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/RawEnumeratorImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/RawEnumeratorImpl.java deleted file mode 100644 index 7bbffa9ee4..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/RawEnumeratorImpl.java +++ /dev/null @@ -1,96 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.main; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.OleAuto; -import com.sun.jna.platform.win32.WTypes.BSTR; -import com.sun.jna.platform.win32.WTypes.BSTRByReference; -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinDef.ULONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.platform.win32.COM.COMUtils; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.dbgmodel.COMUtilsExtra; -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.dbgmodel.DbgModel.OpaqueCleanable; -import agent.dbgmodel.dbgmodel.main.ModelObject; -import agent.dbgmodel.impl.dbgmodel.UnknownExImpl; -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.ModelObjectKind; -import agent.dbgmodel.jna.dbgmodel.main.IRawEnumerator; -import agent.dbgmodel.jna.dbgmodel.main.WrapIModelObject; - -public class RawEnumeratorImpl extends UnknownExImpl implements RawEnumeratorInternal { - @SuppressWarnings("unused") - private final OpaqueCleanable cleanable; - private final IRawEnumerator jnaData; - - private ULONG kind; - private ModelObject value; - - public RawEnumeratorImpl(IRawEnumerator jnaData) { - super(jnaData); - this.cleanable = DbgModel.releaseWhenPhantom(this, jnaData); - this.jnaData = jnaData; - } - - @Override - public Pointer getPointer() { - return jnaData.getPointer(); - } - - @Override - public void reset() { - COMUtils.checkRC(jnaData.Reset()); - } - - @Override - public String getNext() { - BSTRByReference bref = new BSTRByReference(); - ULONGByReference ulKind = new ULONGByReference(); - PointerByReference ppValue = new PointerByReference(); - HRESULT hr = jnaData.GetNext(bref, ulKind, ppValue); - if (hr.equals(COMUtilsExtra.E_BOUNDS) || hr.equals(COMUtilsExtra.E_CANNOT_READ)) { - return null; - } - COMUtils.checkRC(hr); - - kind = ulKind.getValue(); - - WrapIModelObject wrap = new WrapIModelObject(ppValue.getValue()); - try { - value = ModelObjectInternal.tryPreferredInterfaces(wrap::QueryInterface); - } - finally { - wrap.Release(); - } - BSTR bstr = bref.getValue(); - String key = bstr.getValue(); - OleAuto.INSTANCE.SysFreeString(bstr); - return key; - } - - @Override - public ModelObjectKind getKind() { - return ModelObjectKind.values()[kind.intValue()]; - } - - @Override - public ModelObject getValue() { - return value; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/RawEnumeratorInternal.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/RawEnumeratorInternal.java deleted file mode 100644 index 69ff7983e4..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/impl/dbgmodel/main/RawEnumeratorInternal.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.impl.dbgmodel.main; - -import java.util.List; -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.dbgeng.impl.dbgeng.DbgEngUtil; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.InterfaceSupplier; -import agent.dbgeng.impl.dbgeng.DbgEngUtil.Preferred; -import agent.dbgmodel.dbgmodel.main.RawEnumerator; -import agent.dbgmodel.jna.dbgmodel.main.IRawEnumerator; -import agent.dbgmodel.jna.dbgmodel.main.WrapIRawEnumerator; -import ghidra.util.datastruct.WeakValueHashMap; - -public interface RawEnumeratorInternal extends RawEnumerator { - Map CACHE = new WeakValueHashMap<>(); - - static RawEnumeratorInternal instanceFor(WrapIRawEnumerator data) { - return DbgEngUtil.lazyWeakCache(CACHE, data, RawEnumeratorImpl::new); - } - - List> PREFERRED_DATA_SPACES_IIDS = List.of( - new Preferred<>(IRawEnumerator.IID_IRAW_ENUMERATOR, WrapIRawEnumerator.class)); - - static RawEnumeratorInternal tryPreferredInterfaces(InterfaceSupplier supplier) { - return DbgEngUtil.tryPreferredInterfaces(RawEnumeratorInternal.class, - PREFERRED_DATA_SPACES_IIDS, supplier); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/cmd/DbgApplyMethodsCommand.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/cmd/DbgApplyMethodsCommand.java deleted file mode 100644 index 65d26f9c97..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/cmd/DbgApplyMethodsCommand.java +++ /dev/null @@ -1,57 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.cmd; - -import java.util.List; - -import agent.dbgeng.manager.cmd.AbstractDbgCommand; -import agent.dbgeng.manager.cmd.DbgPendingCommand; -import agent.dbgeng.model.iface2.DbgModelTargetObject; -import agent.dbgmodel.dbgmodel.main.ModelObject; -import agent.dbgmodel.gadp.impl.WrappedDbgModel; -import agent.dbgmodel.manager.DbgManager2Impl; -import agent.dbgmodel.model.impl.DbgModel2TargetObjectImpl; -import agent.dbgmodel.model.impl.DelegateDbgModel2TargetObject; -import ghidra.dbg.target.TargetObject; - -public class DbgApplyMethodsCommand extends AbstractDbgCommand { - - private WrappedDbgModel access; - private List path; - private DbgModel2TargetObjectImpl targetObject; - private DbgModelTargetObject result; - - public DbgApplyMethodsCommand(DbgManager2Impl manager, List path, - DbgModel2TargetObjectImpl targetObject) { - super(manager); - this.access = manager.getAccess(); - this.path = path; - this.targetObject = targetObject; - } - - @Override - public TargetObject complete(DbgPendingCommand pending) { - return result; - } - - @Override - public void invoke() { - ModelObject obj = access.getMethod(path); - obj.setSearchKey(path.get(path.size() - 1)); - result = DelegateDbgModel2TargetObject.makeProxy(targetObject.getModel(), targetObject, - obj.getSearchKey(), obj); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/cmd/DbgGetRegisterMapCommand.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/cmd/DbgGetRegisterMapCommand.java deleted file mode 100644 index 485b955d6f..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/cmd/DbgGetRegisterMapCommand.java +++ /dev/null @@ -1,63 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.cmd; - -import java.util.*; - -import agent.dbgeng.dbgeng.DebugValue; -import agent.dbgeng.manager.cmd.AbstractDbgCommand; -import agent.dbgeng.manager.cmd.DbgPendingCommand; -import agent.dbgeng.manager.impl.DbgRegister; -import agent.dbgmodel.dbgmodel.main.ModelObject; -import agent.dbgmodel.gadp.impl.WrappedDbgModel; -import agent.dbgmodel.manager.DbgManager2Impl; - -public class DbgGetRegisterMapCommand extends AbstractDbgCommand> { - - private Map map = new HashMap<>(); - - private WrappedDbgModel access; - private List path; - - public DbgGetRegisterMapCommand(DbgManager2Impl manager, List path) { - super(manager); - this.access = manager.getAccess(); - this.path = path; - } - - @Override - public Map complete(DbgPendingCommand pending) { - return map; - } - - @Override - public void invoke() { - List npath = new ArrayList(); - npath.add("Debugger"); - npath.addAll(path); - Map attributes = access.getAttributes(npath); - int i = 0; - for (String key : attributes.keySet()) { - ModelObject modelObject = attributes.get(key); - DebugValue debugValue = access.getDebugValue(modelObject); - if (debugValue != null) { - DbgRegister register = - new DbgRegister(key, i++, debugValue.getValueType().byteLength); - map.put(key, register); - } - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/cmd/DbgListAttributesCommand.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/cmd/DbgListAttributesCommand.java deleted file mode 100644 index 42f828981e..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/cmd/DbgListAttributesCommand.java +++ /dev/null @@ -1,80 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.cmd; - -import java.util.*; - -import agent.dbgeng.manager.cmd.AbstractDbgCommand; -import agent.dbgeng.manager.cmd.DbgPendingCommand; -import agent.dbgeng.model.iface2.DbgModelTargetObject; -import agent.dbgmodel.dbgmodel.main.ModelObject; -import agent.dbgmodel.gadp.impl.WrappedDbgModel; -import agent.dbgmodel.manager.DbgManager2Impl; -import agent.dbgmodel.model.impl.*; -import ghidra.dbg.util.PathUtils.TargetObjectKeyComparator; - -public class DbgListAttributesCommand extends AbstractDbgCommand> { - - private Map updatedAttributes; - - private WrappedDbgModel access; - private List path; - private DbgModel2TargetObjectImpl targetObject; - - public DbgListAttributesCommand(DbgManager2Impl manager, List path, - DbgModel2TargetObjectImpl targetObject) { - super(manager); - this.access = manager.getAccess(); - this.path = path; - this.targetObject = targetObject; - } - - @Override - public Map complete(DbgPendingCommand pending) { - return updatedAttributes; - } - - @Override - public void invoke() { - try { - updatedAttributes = new TreeMap<>(TargetObjectKeyComparator.ATTRIBUTE); - Map map = access.getAttributes(path); - Map existingAttributes = targetObject.getCachedAttributes(); - for (String key : map.keySet()) { - DbgModel2TargetProxy proxyAttribute; - ModelObject obj = map.get(key); - String atKey = obj.getSearchKey(); - Object object = existingAttributes.get(atKey); - if (object != null && (object instanceof DbgModelTargetObject)) { - proxyAttribute = (DbgModel2TargetProxy) object; - DelegateDbgModel2TargetObject delegate = proxyAttribute.getDelegate(); - delegate.setModelObject(obj); - updatedAttributes.put(key, proxyAttribute); - } - else { - proxyAttribute = (DbgModel2TargetProxy) DelegateDbgModel2TargetObject - .makeProxy(targetObject.getModel(), targetObject, atKey, obj); - updatedAttributes.put(key, proxyAttribute); - } - } - updatedAttributes.putAll(targetObject.getIntrinsics()); - } - catch (Exception e) { - System.err.println("Failure in ListAttributes " + targetObject); - e.printStackTrace(); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/cmd/DbgListElementsCommand.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/cmd/DbgListElementsCommand.java deleted file mode 100644 index fbbe571521..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/cmd/DbgListElementsCommand.java +++ /dev/null @@ -1,75 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.cmd; - -import java.util.*; - -import agent.dbgeng.manager.cmd.AbstractDbgCommand; -import agent.dbgeng.manager.cmd.DbgPendingCommand; -import agent.dbgmodel.dbgmodel.main.ModelObject; -import agent.dbgmodel.gadp.impl.WrappedDbgModel; -import agent.dbgmodel.manager.DbgManager2Impl; -import agent.dbgmodel.model.impl.*; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.util.PathUtils; - -public class DbgListElementsCommand extends AbstractDbgCommand> { - - private List updatedElements; - - private WrappedDbgModel access; - private List path; - private DbgModel2TargetObjectImpl targetObject; - - public DbgListElementsCommand(DbgManager2Impl manager, List path, - DbgModel2TargetObjectImpl targetObject) { - super(manager); - this.access = manager.getAccess(); - this.path = path; - this.targetObject = targetObject; - } - - @Override - public List complete(DbgPendingCommand pending) { - return updatedElements; - } - - @Override - public void invoke() { - synchronized (access) { - updatedElements = new ArrayList<>(); - List list = access.getElements(path); - Map existingElements = - targetObject.getCachedElements(); - - for (ModelObject obj : list) { - DbgModel2TargetProxy proxyElement; - String searchKey = obj.getSearchKey(); - String elKey = PathUtils.makeKey(searchKey); - if (existingElements.containsKey(searchKey)) { - proxyElement = (DbgModel2TargetProxy) existingElements.get(searchKey); - DelegateDbgModel2TargetObject delegate = proxyElement.getDelegate(); - delegate.setModelObject(obj); - } - else { - proxyElement = (DbgModel2TargetProxy) DelegateDbgModel2TargetObject - .makeProxy(targetObject.getModel(), targetObject, elKey, obj); - } - updatedElements.add(proxyElement); - } - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/DbgModelNative.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/DbgModelNative.java deleted file mode 100644 index 74626d1d69..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/DbgModelNative.java +++ /dev/null @@ -1,183 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel; - -import java.util.List; - -import com.sun.jna.*; -import com.sun.jna.platform.win32.Guid.REFIID; -import com.sun.jna.platform.win32.WinDef.DWORD; -import com.sun.jna.platform.win32.WinDef.ULONGLONG; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; -import com.sun.jna.win32.StdCallLibrary; - -public interface DbgModelNative extends StdCallLibrary { - DbgModelNative INSTANCE = Native.load("dbgmodel.dll", DbgModelNative.class); - - HRESULT DebugConnect(String RemoteOptions, REFIID InterfaceId, PointerByReference Interface); - - HRESULT DebugConnectWide(WString RemoteOptions, REFIID InterfaceId, - PointerByReference Interface); - - HRESULT DebugCreate(REFIID InterfaceId, PointerByReference Interface); - - HRESULT DebugCreateEx(REFIID InterfaceId, DWORD DbgEngOptions, PointerByReference Interface); - - public static enum ModelObjectKind { - OBJECT_PROPERTY_ACCESSOR, - OBJECT_CONTEXT, - OBJECT_TARGET_OBJECT, - OBJECT_TARGET_OBJECT_REFERENCE, - OBJECT_SYNTHETIC, - OBJECT_NO_VALUE, - OBJECT_ERROR, - OBJECT_INTRINSIC, - OBJECT_METHOD, - OBJECT_KEY_REFERENCE; - } - - public static enum SymbolKind { - SYMBOL, - SYMBOL_MODULE, - SYMBOL_TYPE, - SYMBOL_FIELD, - SYMBOL_CONSTANT, - SYMBOL_DATA, - SYMBOL_BASE_CLASS, - SYMBOL_PUBLIC, - SYMBOL_FUNCTION; - } - - public static enum TypeKind { - TYPE_UDT, - TYPE_POINTER, - TYPE_MEMBER_POINTER, - TYPE_ARRAY, - TYPE_FUNCTION, - TYPE_TYPEDEF, - TYPE_ENUM, - TYPE_INTRINSIC; - } - - public static enum IntrinsicKind { - INTRINSIC_VOID, - INTRINSIC_BOOL, - INTRINSIC_CHAR, - INTRINSIC_WCHAR, - INTRINSIC_INT, - INTRINSIC_UINT, - INTRINSIC_LONG, - INTRINSIC_ULONG, - INTRINSIC_FLOAT, - INTRINSIC_HRESULT, - INTRINSIC_CHAR16, - INTRINSIC_CHAR32; - } - - public static enum PointerKind { - POINTER_STANDARD, POINTER_REFERENCE, POINTER_VALUE_REFERENCE, POINTER_CX_HAT; - } - - public static enum CallingConventionKind { - CALLING_CONVENTION_UNKNOWN, - CALLING_CONVENTION_CDECL, - CALLING_CONVENTION_FASTCALL, - CALLING_CONVENTION_STDCALL, - CALLING_CONVENTION_SYSCALL, - CALLING_CONVENTION_THISCALL; - } - - public static enum LocationKind { - LOCATION_MEMBER, LOCATION_STATIC, LOCATION_CONSTANT, LOCATION_NONE; - } - - public static enum PreferredFormat { - FORMAT_NONE, - FORMAT_SINGLE_CHARACTER, - FORMAT_QUOTED_STRING, - FORMAT_STRING, - FORMAT_QUOTED_UNICODE_STRING, - FORMAT_UNICODE_STRING, - FORMAT_QUOTED_UTF8_STRING, - FORMAT_UTF8_STRING, - FORMAT_BSTR_STRING, - FORMAT_QUOTED_HSTRING, - FORMAT_HSTRING, - FORMAT_RAW, - FORMAT_ENUM_NAME_ONLY, - FORMAT_ESCAPED_STRING_WITH_QUOTE, - FORMAT_UTF32_STRING, - FORMAT_QUOTED_UTF32_STRING; - } - - public static class LOCATION extends Structure { - public static class ByReference extends LOCATION - implements Structure.ByReference { - } - - public LOCATION() { - this.HostDefined = new ULONGLONG(0); - this.Offset = new ULONGLONG(0); - } - - public LOCATION(ULONGLONG virtualAddress) { - this.HostDefined = new ULONGLONG(0); - this.Offset = virtualAddress; - } - - public LOCATION(ByReference pLocation) { - this.HostDefined = pLocation.HostDefined; - this.Offset = pLocation.Offset; - } - - public static final List FIELDS = createFieldsOrder("HostDefined", "Offset"); - - public ULONGLONG HostDefined; - public ULONGLONG Offset; - - @Override - protected List getFieldOrder() { - return FIELDS; - } - } - - public static class ARRAY_DIMENSION extends Structure { - public static class ByReference extends ARRAY_DIMENSION - implements Structure.ByReference { - - public ByReference() { - super(); - // TODO Auto-generated constructor stub - } - } - - public ARRAY_DIMENSION() { - // TODO Auto-generated constructor stub - } - - public ARRAY_DIMENSION(ByReference pLocation) { - // TODO Auto-generated constructor stub - } - - @Override - protected List getFieldOrder() { - // TODO Auto-generated method stub - return null; - } - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/IDebugClientEx.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/IDebugClientEx.java deleted file mode 100644 index d02c985998..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/IDebugClientEx.java +++ /dev/null @@ -1,26 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel; - -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgeng.jna.dbgeng.client.IDebugClient; - -public interface IDebugClientEx extends IDebugClient { - - HRESULT As(PointerByReference hdma); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/IUnknownEx.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/IUnknownEx.java deleted file mode 100644 index 3f97090c93..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/IUnknownEx.java +++ /dev/null @@ -1,25 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.COM.IUnknown; - -public interface IUnknownEx extends IUnknown { - - public Pointer getPointer(); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/UnknownWithUtils.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/UnknownWithUtils.java deleted file mode 100644 index cd4d1e7476..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/UnknownWithUtils.java +++ /dev/null @@ -1,303 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel; - -import java.io.*; -import java.util.*; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.Guid.REFIID; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.platform.win32.COM.Unknown; -import com.sun.jna.ptr.PointerByReference; - -import ghidra.util.Msg; - -public class UnknownWithUtils extends Unknown { - public static void pause() { - try { - new BufferedReader(new InputStreamReader(System.in)).readLine(); - } - catch (IOException e) { - throw new AssertionError(e); - } - } - - public static void error(String message) { - Msg.error(UnknownWithUtils.class, message, new Throwable()); - //pause(); - } - - public interface RefAnalyzer { - default void observeCall(Pointer ptr, UnknownWithUtils wrapper, String name) { - } - - default void observeCall(UnknownWithUtils wrapper, String name) { - } - - default void observedAddRefViaResult(Pointer ptr, UnknownWithUtils wrapper) { - } - - default void observedQueryInterface(REFIID riid, PointerByReference ppvObject, HRESULT hr, - UnknownWithUtils wrapper) { - } - - default void observedAddRef(int count, UnknownWithUtils wrapper) { - } - - default void observedRelease(int count, UnknownWithUtils wrapper) { - } - - default void checkLeaks() { - } - } - - public static class RefAnalyzerEntry { - public final Pointer ptr; - - public long myCount = 0; // presume 1 elsewhere - public Thread thread; - - public RefAnalyzerEntry(Pointer ptr) { - this.ptr = ptr; - } - - public void verifyValid(long actual, UnknownWithUtils wrapper, String name) { - if (this.myCount < 0 || actual < 0) { - error( - "COM mine or actual ref-count below 0 in " + name + - " wrapper=" + wrapper + - ", ptr=" + ptr + - ", myCount=" + this.myCount + - ", actual=" + actual); - } - } - - public int verifyCount(UnknownWithUtils wrapper, String name) { - int actual = wrapper.getRefCount(); - verifyValid(actual, wrapper, name); - return actual; - } - - public void verifyThread() { - Thread current = Thread.currentThread(); - if (this.thread == null) { - this.thread = current; - } - if (this.thread != current) { - // TODO: This could actually cause a problem - // But right now, it's just distracting - if (current.getName().contains("Cleaner")) { - return; - } - //error("COM use by distinct threads ptr=" + ptr + - // ", first=" + thread + - // ", current=" + current); - } - } - } - - public static class DisabledRefAnalyzer implements RefAnalyzer { - } - - public static class EnabledRefAnalyzer implements RefAnalyzer { - public static final Map REFS = new HashMap<>(); - public static final List QIS = new ArrayList<>(); - - protected RefAnalyzerEntry getEntry(Pointer ptr) { - synchronized (REFS) { - return REFS.get(Pointer.nativeValue(ptr)); - } - } - - protected RefAnalyzerEntry getEntryOrCreate(Pointer ptr) { - synchronized (REFS) { - return REFS.computeIfAbsent(Pointer.nativeValue(ptr), - addr -> new RefAnalyzerEntry(ptr)); - } - } - - protected RefAnalyzerEntry removeEntry(Pointer ptr) { - synchronized (REFS) { - return REFS.remove(Pointer.nativeValue(ptr)); - } - } - - protected void expectWrapper(Pointer ptr) { - synchronized (REFS) { - QIS.add(Pointer.nativeValue(ptr)); - } - } - - protected void unexpectWrapper(Pointer ptr) { - synchronized (REFS) { - QIS.remove(Pointer.nativeValue(ptr)); - } - } - - @Override - public void observeCall(Pointer ptr, UnknownWithUtils wrapper, String name) { - synchronized (REFS) { - RefAnalyzerEntry entry = getEntryOrCreate(ptr); - long actual = entry.verifyCount(wrapper, name); - entry.verifyValid(actual, wrapper, name); - entry.verifyThread(); - } - } - - @Override - public void observeCall(UnknownWithUtils wrapper, String name) { - observeCall(wrapper.getPointer(), wrapper, name); - } - - @Override - public void observedAddRefViaResult(Pointer ptr, UnknownWithUtils wrapper) { - Msg.debug(this, "COM Presumed AddRef: " + ptr + ", wrapper=" + wrapper); - synchronized (REFS) { - unexpectWrapper(ptr); - RefAnalyzerEntry entry = getEntryOrCreate(ptr); - Msg.debug(this, "COM count after AddRef: " + wrapper + " mine=" + entry.myCount); - entry.myCount++; - } - } - - @Override - public void observedQueryInterface(REFIID riid, PointerByReference ppvObject, HRESULT hr, - UnknownWithUtils wrapper) { - Pointer ptr = ppvObject.getValue(); - Msg.debug(this, - "COM QueryInterface: " + wrapper + "(riid->" + riid.getValue().toGuidString() + - ",ppvObject->" + ptr + ") = " + hr); - expectWrapper(ptr); - } - - @Override - public void observedAddRef(int count, UnknownWithUtils wrapper) { - Msg.debug(this, "COM AddRef: " + wrapper + "() = " + count); - Pointer ptr = wrapper.getPointer(); - synchronized (REFS) { - RefAnalyzerEntry entry = getEntry(ptr); - if (entry == null) { - error("COM AddRef on non-refed object ptr=" + ptr + ", wrapper=" + wrapper); - return; - } - entry.myCount++; - entry.verifyValid(count, wrapper, "AddRef"); - entry.verifyThread(); - } - } - - @Override - public void observedRelease(int count, UnknownWithUtils wrapper) { - Msg.debug(this, "COM Release: " + wrapper + "() = " + count); - Pointer ptr = wrapper.getPointer(); - synchronized (REFS) { - RefAnalyzerEntry entry = getEntry(ptr); - if (entry == null) { - error("COM Released on non-refed object ptr=" + ptr + ", wrapper=" + wrapper); - return; - } - entry.myCount--; - Msg.debug(this, - "COM count after Release: " + wrapper + " mine=" + entry.myCount + ", actual=" + - count); - if (entry.myCount == 0) { - removeEntry(ptr); - } - entry.verifyValid(count, wrapper, "Release"); - entry.verifyThread(); - } - } - - @Override - public void checkLeaks() { - // TODO: Can't really guarantee all GC has happened - // This will create many false positives - System.gc(); - synchronized (REFS) { - for (RefAnalyzerEntry entry : REFS.values()) { - if (entry.myCount != 0) { - Msg.warn(this, "COM potential ref leak: ptr=" + entry.ptr + ", count=" + - entry.myCount); - } - } - - for (long addr : QIS) { - Msg.error(this, "Observed QueryInterface without a wrapper: ptr=0x" + - Long.toHexString(addr)); - } - } - } - } - - public static final RefAnalyzer ANALYZER = new DisabledRefAnalyzer(); - - public static interface VTableIndex { - int getIndex(); - - public static & VTableIndex> int follow(Class prev) { - I[] all = prev.getEnumConstants(); - int start = all[0].getIndex() - all[0].ordinal(); - return all.length + start; - } - } - - public UnknownWithUtils() { - } - - public UnknownWithUtils(Pointer pvInstance) { - super(pvInstance); - // TODO: HACK? - ANALYZER.observedAddRefViaResult(pvInstance, this); - } - - protected HRESULT _invokeHR(VTableIndex idx, Object... args) { - //Msg.info(this, Thread.currentThread() + " invoked " + idx + Arrays.asList(args)); - return (HRESULT) this._invokeNativeObject(idx.getIndex(), args, HRESULT.class); - } - - @Override - public HRESULT QueryInterface(REFIID riid, PointerByReference ppvObject) { - ANALYZER.observeCall(this, "QueryInterface"); - HRESULT hr = super.QueryInterface(riid, ppvObject); - ANALYZER.observedQueryInterface(riid, ppvObject, hr, this); - return hr; - } - - @Override - public int AddRef() { - int count = super.AddRef(); - ANALYZER.observedAddRef(count, this); - return count; - } - - @Override - public int Release() { - int count = super.Release(); - ANALYZER.observedRelease(count, this); - return count; - } - - public int getRefCount() { - int added = super.AddRef(); - int count = super.Release(); - if (added - 1 != count) { - Msg.warn(this, "COM ref-count impl anomaly wrapper=" + - this + ", added=" + added + ", count=" + count); - } - return count; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/WrapIUnknownEx.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/WrapIUnknownEx.java deleted file mode 100644 index 475f8ad73d..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/WrapIUnknownEx.java +++ /dev/null @@ -1,33 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; - -import agent.dbgmodel.jna.dbgmodel.debughost.WrapIDebugHostType1; - -public class WrapIUnknownEx extends UnknownWithUtils implements IUnknownEx { - public static class ByReference extends WrapIDebugHostType1 implements Structure.ByReference { - } - - public WrapIUnknownEx() { - } - - public WrapIUnknownEx(Pointer pvInstance) { - super(pvInstance); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/bridge/IHostDataModelAccess.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/bridge/IHostDataModelAccess.java deleted file mode 100644 index e136c4b5cc..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/bridge/IHostDataModelAccess.java +++ /dev/null @@ -1,42 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.bridge; - -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IHostDataModelAccess extends IUnknownEx { - final IID IID_IHOST_DATA_MODEL_ACCESS = new IID("F2BCE54E-4835-4f8a-836E-7981E29904D1"); - - enum VTIndices implements VTableIndex { - GET_DATA_MODEL, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT GetDataModel(PointerByReference manager, PointerByReference host); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/bridge/WrapIHostDataModelAccess.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/bridge/WrapIHostDataModelAccess.java deleted file mode 100644 index 96424e5187..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/bridge/WrapIHostDataModelAccess.java +++ /dev/null @@ -1,41 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.bridge; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIHostDataModelAccess extends UnknownWithUtils implements IHostDataModelAccess { - public static class ByReference extends WrapIHostDataModelAccess - implements Structure.ByReference { - } - - public WrapIHostDataModelAccess() { - } - - public WrapIHostDataModelAccess(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT GetDataModel(PointerByReference manager, PointerByReference host) { - return _invokeHR(VTIndices.GET_DATA_MODEL, getPointer(), manager, host); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/IComparableConcept.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/IComparableConcept.java deleted file mode 100644 index 7f2014ec63..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/IComparableConcept.java +++ /dev/null @@ -1,44 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.concept; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.ULONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IComparableConcept extends IUnknownEx { - final IID IID_ICOMPARABLE_CONCEPT = new IID("A7830646-9F0C-4a31-BA19-503F33E6C8A3"); - - enum VTIndices implements VTableIndex { - COMPARE_OBJECTS, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT CompareObjects(Pointer contextObject, Pointer otherObject, - ULONGByReference comparisonResult); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/IDataModelConcept.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/IDataModelConcept.java deleted file mode 100644 index d98839d534..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/IDataModelConcept.java +++ /dev/null @@ -1,47 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.concept; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WTypes.BSTRByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDataModelConcept extends IUnknownEx { - final IID IID_IDATA_MODEL_CONCEPT = new IID("FCB98D1D-1114-4fbf-B24C-EFFCB5DEF0D3"); - - enum VTIndices implements VTableIndex { - INITIALIZE_OBJECT, // - GET_NAME, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT InitializeObject(Pointer modelObject, Pointer matchingTypeSignature, - Pointer wildcardMatches); - - HRESULT GetName(BSTRByReference modelName); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/IDynamicConceptProviderConcept.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/IDynamicConceptProviderConcept.java deleted file mode 100644 index 4f18b5e6d0..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/IDynamicConceptProviderConcept.java +++ /dev/null @@ -1,60 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.concept; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.Guid.REFIID; -import com.sun.jna.platform.win32.WinDef.BOOLByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDynamicConceptProviderConcept extends IUnknownEx { - final IID IID_IDYNAMIC_CONCEPT_PROVIDER_CONCEPT = - new IID("95A7F7DD-602E-483f-9D06-A15C0EE13174"); - - enum VTIndices implements VTableIndex { - GET_CONCEPT, // - SET_CONCEPT, // - NOTIFY_PARENT, // - NOTIFY_PARENT_CHANGE, // - NOTIFY_DESTRUCT, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT GetConcept(Pointer contextObject, REFIID conceptId, PointerByReference conceptInterface, - PointerByReference conceptMetadata, BOOLByReference hasConcept); - - HRESULT SetConcept(Pointer contextObject, REFIID conceptId, Pointer conceptInterface, - Pointer conceptMetadata); - - HRESULT NotifyParent(Pointer parentModel); - - HRESULT NotifyParentChange(Pointer parentModel); - - HRESULT NotifyDestruct(); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/IDynamicKeyProviderConcept.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/IDynamicKeyProviderConcept.java deleted file mode 100644 index 0e44ab9f7d..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/IDynamicKeyProviderConcept.java +++ /dev/null @@ -1,52 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.concept; - -import com.sun.jna.Pointer; -import com.sun.jna.WString; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.BOOLByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDynamicKeyProviderConcept extends IUnknownEx { - final IID IID_IDYNAMIC_KEY_PROVIDER_CONCEPT = new IID("E7983FA1-80A7-498c-988F-518DDC5D4025"); - - enum VTIndices implements VTableIndex { - GET_KEY, // - SET_KEY, // - ENUMERATE_KEYS, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT GetKey(Pointer contextObject, WString key, PointerByReference keyValue, - PointerByReference metadata, BOOLByReference hasKey); - - HRESULT SetKey(Pointer contextObject, WString key, Pointer keyValue, Pointer metadata); - - HRESULT EnumerateKeys(Pointer contextObject, PointerByReference ppEnumerator); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/IEquatableConcept.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/IEquatableConcept.java deleted file mode 100644 index cd51072b78..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/IEquatableConcept.java +++ /dev/null @@ -1,43 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.concept; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.BOOLByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IEquatableConcept extends IUnknownEx { - final IID IID_IEQUATABLE_CONCEPT = new IID("C52D5D3D-609D-4d5d-8A82-46B0ACDEC4F4"); - - enum VTIndices implements VTableIndex { - ARE_OBJECTS_EQUAL, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT AreObjectsEqual(Pointer contextObject, Pointer otherObject, BOOLByReference isEqual); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/IIndexableConcept.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/IIndexableConcept.java deleted file mode 100644 index d539aca4b7..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/IIndexableConcept.java +++ /dev/null @@ -1,53 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.concept; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.ULONGLONG; -import com.sun.jna.platform.win32.WinDef.ULONGLONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IIndexableConcept extends IUnknownEx { - final IID IID_IINDEXABLE_CONCEPT = new IID("D1FAD99F-3F53-4457-850C-8051DF2D3FB5"); - - enum VTIndices implements VTableIndex { - GET_DIMENSIONALITY, // - GET_AT, // - SET_AT, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT GetDimensionality(Pointer contextObject, ULONGLONGByReference dimensionality); - - HRESULT GetAt(Pointer contextObject, ULONGLONG indexerCount, Pointer[] indexers, - PointerByReference object, PointerByReference metadata); - - HRESULT SetAt(Pointer contextObject, ULONGLONG indexerCount, PointerByReference indexers, - Pointer value); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/IIterableConcept.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/IIterableConcept.java deleted file mode 100644 index aa7fd35372..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/IIterableConcept.java +++ /dev/null @@ -1,48 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.concept; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.ULONGLONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IIterableConcept extends IUnknownEx { - final IID IID_IITERABLE_CONCEPT = new IID("F5D49D0C-0B02-4301-9C9B-B3A6037628F3"); - - enum VTIndices implements VTableIndex { - GET_DEFAULT_INDEX_DIMENSIONALITY, // - GET_ITERATOR, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT GetDefaultIndexDimensionality(Pointer contextObject, - ULONGLONGByReference dimensionality); - - HRESULT GetIterator(Pointer contextObject, PointerByReference iterator); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/IPreferredRuntimeTypeConcept.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/IPreferredRuntimeTypeConcept.java deleted file mode 100644 index 337ea28fb6..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/IPreferredRuntimeTypeConcept.java +++ /dev/null @@ -1,43 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.concept; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IPreferredRuntimeTypeConcept extends IUnknownEx { - final IID IID_IPREFERRED_RUNTIME_TYPE_CONCEPT = new IID("9D6C1D7B-A76F-4618-8068-5F76BD9A4E8A"); - - enum VTIndices implements VTableIndex { - CAST_TO_PREFERRED_RUNTIME_TYPE, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT CastToPreferredRuntimeType(Pointer contextObject, PointerByReference object); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/IStringDisplayableConcept.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/IStringDisplayableConcept.java deleted file mode 100644 index 54020faf05..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/IStringDisplayableConcept.java +++ /dev/null @@ -1,43 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.concept; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WTypes.BSTRByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IStringDisplayableConcept extends IUnknownEx { - final IID IID_ISTRING_DISPLAYABLE_CONCEPT = new IID("D28E8D70-6C00-4205-940D-501016601EA3"); - - enum VTIndices implements VTableIndex { - TO_DISPLAY_STRING, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT ToDisplayString(Pointer contextObject, Pointer metadata, BSTRByReference displayString); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/WrapIComparableConcept.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/WrapIComparableConcept.java deleted file mode 100644 index e35df8cab3..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/WrapIComparableConcept.java +++ /dev/null @@ -1,43 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.concept; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinDef.ULONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIComparableConcept extends UnknownWithUtils implements IComparableConcept { - public static class ByReference extends WrapIComparableConcept - implements Structure.ByReference { - } - - public WrapIComparableConcept() { - } - - public WrapIComparableConcept(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT CompareObjects(Pointer contextObject, Pointer otherObject, - ULONGByReference comparisonResult) { - return _invokeHR(VTIndices.COMPARE_OBJECTS, getPointer(), contextObject, otherObject, - comparisonResult); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/WrapIDataModelConcept.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/WrapIDataModelConcept.java deleted file mode 100644 index d1d3a3b6a6..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/WrapIDataModelConcept.java +++ /dev/null @@ -1,48 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.concept; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WTypes.BSTRByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIDataModelConcept extends UnknownWithUtils implements IDataModelConcept { - public static class ByReference extends WrapIDataModelConcept implements Structure.ByReference { - } - - public WrapIDataModelConcept() { - } - - public WrapIDataModelConcept(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT InitializeObject(Pointer modelObject, Pointer matchingTypeSignature, - Pointer wildcardMatches) { - return _invokeHR(VTIndices.INITIALIZE_OBJECT, getPointer(), modelObject, - matchingTypeSignature, wildcardMatches); - } - - @Override - public HRESULT GetName(BSTRByReference modelName) { - return _invokeHR(VTIndices.GET_NAME, getPointer(), modelName); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/WrapIDynamicConceptProviderConcept.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/WrapIDynamicConceptProviderConcept.java deleted file mode 100644 index 88e7ad8752..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/WrapIDynamicConceptProviderConcept.java +++ /dev/null @@ -1,70 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.concept; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.Guid.REFIID; -import com.sun.jna.platform.win32.WinDef.BOOLByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIDynamicConceptProviderConcept extends UnknownWithUtils - implements IDynamicConceptProviderConcept { - public static class ByReference extends WrapIDynamicConceptProviderConcept - implements Structure.ByReference { - } - - public WrapIDynamicConceptProviderConcept() { - } - - public WrapIDynamicConceptProviderConcept(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT GetConcept(Pointer contextObject, REFIID conceptId, - PointerByReference conceptInterface, - PointerByReference conceptMetadata, BOOLByReference hasConcept) { - return _invokeHR(VTIndices.GET_CONCEPT, getPointer(), contextObject, conceptId, - conceptInterface, conceptMetadata, hasConcept); - } - - @Override - public HRESULT SetConcept(Pointer contextObject, REFIID conceptId, Pointer conceptInterface, - Pointer conceptMetadata) { - return _invokeHR(VTIndices.SET_CONCEPT, getPointer(), contextObject, conceptId, - conceptInterface, conceptMetadata); - } - - @Override - public HRESULT NotifyParent(Pointer parentModel) { - return _invokeHR(VTIndices.NOTIFY_PARENT, getPointer(), parentModel); - } - - @Override - public HRESULT NotifyParentChange(Pointer parentModel) { - return _invokeHR(VTIndices.NOTIFY_PARENT_CHANGE, getPointer(), parentModel); - } - - @Override - public HRESULT NotifyDestruct() { - return _invokeHR(VTIndices.NOTIFY_DESTRUCT, getPointer()); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/WrapIDynamicKeyProviderConcept.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/WrapIDynamicKeyProviderConcept.java deleted file mode 100644 index b8c3635294..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/WrapIDynamicKeyProviderConcept.java +++ /dev/null @@ -1,55 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.concept; - -import com.sun.jna.*; -import com.sun.jna.platform.win32.WinDef.BOOLByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIDynamicKeyProviderConcept extends UnknownWithUtils - implements IDynamicKeyProviderConcept { - public static class ByReference extends WrapIDynamicKeyProviderConcept - implements Structure.ByReference { - } - - public WrapIDynamicKeyProviderConcept() { - } - - public WrapIDynamicKeyProviderConcept(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT GetKey(Pointer contextObject, WString key, PointerByReference keyValue, - PointerByReference metadata, BOOLByReference hasKey) { - return _invokeHR(VTIndices.GET_KEY, getPointer(), contextObject, key, keyValue, metadata, - hasKey); - } - - @Override - public HRESULT SetKey(Pointer contextObject, WString key, Pointer keyValue, Pointer metadata) { - return _invokeHR(VTIndices.SET_KEY, getPointer(), contextObject, key, keyValue, metadata); - } - - @Override - public HRESULT EnumerateKeys(Pointer contextObject, PointerByReference ppEnumerator) { - return _invokeHR(VTIndices.ENUMERATE_KEYS, getPointer(), contextObject, ppEnumerator); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/WrapIEquatableConcept.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/WrapIEquatableConcept.java deleted file mode 100644 index 48db71b532..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/WrapIEquatableConcept.java +++ /dev/null @@ -1,43 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.concept; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinDef.BOOLByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIEquatableConcept extends UnknownWithUtils implements IEquatableConcept { - public static class ByReference extends WrapIEquatableConcept implements Structure.ByReference { - } - - public WrapIEquatableConcept() { - } - - public WrapIEquatableConcept(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT AreObjectsEqual(Pointer contextObject, Pointer otherObject, - BOOLByReference isEqual) { - return _invokeHR(VTIndices.ARE_OBJECTS_EQUAL, getPointer(), contextObject, otherObject, - isEqual); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/WrapIIndexableConcept.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/WrapIIndexableConcept.java deleted file mode 100644 index 5187531058..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/WrapIIndexableConcept.java +++ /dev/null @@ -1,57 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.concept; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinDef.ULONGLONG; -import com.sun.jna.platform.win32.WinDef.ULONGLONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIIndexableConcept extends UnknownWithUtils implements IIndexableConcept { - public static class ByReference extends WrapIIndexableConcept implements Structure.ByReference { - } - - public WrapIIndexableConcept() { - } - - public WrapIIndexableConcept(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT GetDimensionality(Pointer contextObject, ULONGLONGByReference dimensionality) { - return _invokeHR(VTIndices.GET_DIMENSIONALITY, getPointer(), contextObject, dimensionality); - } - - @Override - public HRESULT GetAt(Pointer contextObject, ULONGLONG indexerCount, Pointer[] indexers, - PointerByReference object, PointerByReference metadata) { - return _invokeHR(VTIndices.GET_AT, getPointer(), contextObject, indexerCount, indexers, - object, metadata); - } - - @Override - public HRESULT SetAt(Pointer contextObject, ULONGLONG indexerCount, PointerByReference indexers, - Pointer value) { - return _invokeHR(VTIndices.SET_AT, getPointer(), contextObject, indexerCount, indexers, - value); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/WrapIIterableConcept.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/WrapIIterableConcept.java deleted file mode 100644 index 30fe618075..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/WrapIIterableConcept.java +++ /dev/null @@ -1,48 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.concept; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinDef.ULONGLONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIIterableConcept extends UnknownWithUtils implements IIterableConcept { - public static class ByReference extends WrapIIterableConcept implements Structure.ByReference { - } - - public WrapIIterableConcept() { - } - - public WrapIIterableConcept(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT GetDefaultIndexDimensionality(Pointer contextObject, - ULONGLONGByReference dimensionality) { - return _invokeHR(VTIndices.GET_DEFAULT_INDEX_DIMENSIONALITY, getPointer(), dimensionality); - } - - @Override - public HRESULT GetIterator(Pointer contextObject, PointerByReference iterator) { - return _invokeHR(VTIndices.GET_ITERATOR, getPointer(), contextObject, iterator); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/WrapIPreferredRuntimeTypeConcept.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/WrapIPreferredRuntimeTypeConcept.java deleted file mode 100644 index 559a5a22b3..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/WrapIPreferredRuntimeTypeConcept.java +++ /dev/null @@ -1,44 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.concept; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIPreferredRuntimeTypeConcept extends UnknownWithUtils - implements IPreferredRuntimeTypeConcept { - public static class ByReference extends WrapIPreferredRuntimeTypeConcept - implements Structure.ByReference { - } - - public WrapIPreferredRuntimeTypeConcept() { - } - - public WrapIPreferredRuntimeTypeConcept(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT CastToPreferredRuntimeType(Pointer contextObject, PointerByReference object) { - return _invokeHR(VTIndices.CAST_TO_PREFERRED_RUNTIME_TYPE, getPointer(), contextObject, - object); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/WrapIStringDisplayableConcept.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/WrapIStringDisplayableConcept.java deleted file mode 100644 index 1ef2501343..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/concept/WrapIStringDisplayableConcept.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.concept; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WTypes.BSTRByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIStringDisplayableConcept extends UnknownWithUtils - implements IStringDisplayableConcept { - public static class ByReference extends WrapIStringDisplayableConcept - implements Structure.ByReference { - } - - public WrapIStringDisplayableConcept() { - } - - public WrapIStringDisplayableConcept(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT ToDisplayString(Pointer contextObject, Pointer metadata, - BSTRByReference displayString) { - return _invokeHR(VTIndices.TO_DISPLAY_STRING, getPointer(), contextObject, metadata, - displayString); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/IDataModelManager1.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/IDataModelManager1.java deleted file mode 100644 index 59ca1a5f71..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/IDataModelManager1.java +++ /dev/null @@ -1,109 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.datamodel; - -import com.sun.jna.Pointer; -import com.sun.jna.WString; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.Variant.VARIANT; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.LOCATION; -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.ModelObjectKind; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDataModelManager1 extends IUnknownEx { - final IID IID_IDATA_MODEL_MANAGER = new IID("73FE19F4-A110-4500-8ED9-3C28896F508C"); - - enum VTIndices1 implements VTableIndex { - CLOSE, // - CREATE_NO_VALUE, // - CREATE_ERROR_OBJECT, // - CREATE_TYPED_OBJECT, // - CREATE_TYPED_OBJECT_REFERENCE, // - CREATE_SYNTHETIC_OBJECT, // - CREATE_DATA_MODEL_OBJECT, // - CREATE_INTRINSIC_OBJECT, // - CREATE_TYPED_INTRINSIC_OBJECT, // - GET_MODEL_FOR_TYPE_SIGNATURE, // - GET_MODEL_FOR_TYPE, // - REGISTER_MODEL_FOR_TYPE_SIGNATURE, // - UNREGISTER_MODEL_FOR_TYPE_SIGNATURE, // - REGISTER_EXTENSION_FOR_TYPE_SIGNATURE, // - UNREGISTER_EXTENSION_FOR_TYPE_SIGNATURE, // - CREATE_METADATA_STORE, // - GET_ROOT_NAMESPACE, // - REGISTER_NAMED_MODEL, // - UNREGISTER_NAMED_MODEL, // - ACQUIRE_NAMED_MODEL, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT Close(); - - HRESULT CreateNoValue(PointerByReference object); - - HRESULT CreateErrorObject(HRESULT hrError, WString pwszMessage, PointerByReference object); - - HRESULT CreateTypedObject(Pointer context, LOCATION objectLocation, Pointer objectType, - PointerByReference object); - - HRESULT CreateTypedObjectReference(Pointer context, LOCATION objectLocation, Pointer objectTye, - PointerByReference object); - - HRESULT CreateSyntheticObject(Pointer context, PointerByReference object); - - HRESULT CreateDataModelObject(Pointer dataModel, PointerByReference object); - - HRESULT CreateIntrinsicObject(ModelObjectKind objectKind, VARIANT.ByReference intrinsicData, - PointerByReference object); - - HRESULT CreateTypedIntrinsicObject(VARIANT.ByReference intrinsicData, Pointer type, - PointerByReference object); - - HRESULT GetModelForTypeSignature(Pointer typeSignature, PointerByReference dataModel); - - HRESULT GetModelForType(Pointer type, PointerByReference dataModel, - PointerByReference typeSignature, PointerByReference wildcardMatches); - - HRESULT RegisterModelForTypeSignature(Pointer typeSignature, Pointer dataModel); - - HRESULT UnregisterModelForTypeSignature(Pointer dataModel, Pointer typeSignature); - - HRESULT RegisterExtensionForTypeSignature(Pointer typeSignature, Pointer dataModel); - - HRESULT UnregisterExtensionForTypeSignature(Pointer dataModel, Pointer typeSignature); - - HRESULT CreateMetadataStore(Pointer parentStore, PointerByReference metadataStore); - - HRESULT GetRootNamespace(PointerByReference rootNamespace); - - HRESULT RegisterNamedModel(WString modelName, Pointer modelObject); - - HRESULT UnregisterNamedModel(WString modelName); - - HRESULT AcquireNamedModel(WString modelName, PointerByReference modelObject); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/IDataModelManager2.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/IDataModelManager2.java deleted file mode 100644 index 207b547d65..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/IDataModelManager2.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.datamodel; - -import com.sun.jna.Pointer; -import com.sun.jna.WString; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.Variant.VARIANT; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDataModelManager2 extends IDataModelManager1 { - final IID IID_IDATA_MODEL_MANAGER2 = new IID("F412C5EA-2284-4622-A660-A697160D3312"); - - enum VTIndices2 implements VTableIndex { - ACQUIRE_SUBNAMESPACE, // - CREATE_TYPED_INTRINSIC_OBJECT_EX, // - ; - - public int start = VTableIndex.follow(VTIndices1.class); - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT AcquireSubNamespace(WString modelName, WString subNamespaceModelName, - WString accessName, Pointer metadata, PointerByReference namespaceModelObject); - - HRESULT CreateTypedIntrinsicObjectEx(Pointer context, VARIANT.ByReference intrinsicData, - Pointer type, PointerByReference object); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/WrapIDataModelManager1.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/WrapIDataModelManager1.java deleted file mode 100644 index ac15983a75..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/WrapIDataModelManager1.java +++ /dev/null @@ -1,159 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.datamodel; - -import com.sun.jna.*; -import com.sun.jna.platform.win32.Variant.VARIANT; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.LOCATION; -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.ModelObjectKind; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIDataModelManager1 extends UnknownWithUtils implements IDataModelManager1 { - public static class ByReference extends WrapIDataModelManager1 - implements Structure.ByReference { - } - - public WrapIDataModelManager1() { - } - - public WrapIDataModelManager1(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT Close() { - return _invokeHR(VTIndices1.CLOSE, getPointer()); - } - - @Override - public HRESULT CreateNoValue(PointerByReference object) { - return _invokeHR(VTIndices1.CREATE_NO_VALUE, getPointer(), object); - } - - @Override - public HRESULT CreateErrorObject(HRESULT hrError, WString pwszMessage, - PointerByReference object) { - return _invokeHR(VTIndices1.CREATE_ERROR_OBJECT, getPointer(), hrError, pwszMessage, - object); - } - - @Override - public HRESULT CreateTypedObject(Pointer context, LOCATION objectLocation, Pointer objectTye, - PointerByReference object) { - return _invokeHR(VTIndices1.CREATE_TYPED_OBJECT, getPointer(), context, objectLocation, - objectTye, object); - } - - @Override - public HRESULT CreateTypedObjectReference(Pointer context, LOCATION objectLocation, - Pointer objectTye, - PointerByReference object) { - return _invokeHR(VTIndices1.CREATE_TYPED_OBJECT_REFERENCE, getPointer(), context, - objectLocation, objectTye, object); - } - - @Override - public HRESULT CreateSyntheticObject(Pointer context, PointerByReference object) { - return _invokeHR(VTIndices1.CREATE_SYNTHETIC_OBJECT, getPointer(), context, object); - } - - @Override - public HRESULT CreateDataModelObject(Pointer dataModel, PointerByReference object) { - return _invokeHR(VTIndices1.CREATE_DATA_MODEL_OBJECT, getPointer(), dataModel, object); - } - - @Override - public HRESULT CreateIntrinsicObject(ModelObjectKind objectKind, - VARIANT.ByReference intrinsicData, - PointerByReference object) { - return _invokeHR(VTIndices1.CREATE_INTRINSIC_OBJECT, getPointer(), objectKind.ordinal(), - intrinsicData, object); - } - - @Override - public HRESULT CreateTypedIntrinsicObject(VARIANT.ByReference intrinsicData, Pointer type, - PointerByReference object) { - return _invokeHR(VTIndices1.CREATE_TYPED_INTRINSIC_OBJECT, getPointer(), intrinsicData, - type, object); - } - - @Override - public HRESULT GetModelForTypeSignature(Pointer typeSignature, PointerByReference dataModel) { - return _invokeHR(VTIndices1.GET_MODEL_FOR_TYPE_SIGNATURE, getPointer(), typeSignature, - dataModel); - } - - @Override - public HRESULT GetModelForType(Pointer type, PointerByReference dataModel, - PointerByReference typeSignature, PointerByReference wildcardMatches) { - return _invokeHR(VTIndices1.GET_MODEL_FOR_TYPE, getPointer(), type, dataModel, - typeSignature, wildcardMatches); - } - - @Override - public HRESULT RegisterModelForTypeSignature(Pointer typeSignature, Pointer dataModel) { - return _invokeHR(VTIndices1.REGISTER_MODEL_FOR_TYPE_SIGNATURE, getPointer(), typeSignature, - dataModel); - } - - @Override - public HRESULT UnregisterModelForTypeSignature(Pointer dataModel, Pointer typeSignature) { - return _invokeHR(VTIndices1.UNREGISTER_MODEL_FOR_TYPE_SIGNATURE, getPointer(), dataModel, - typeSignature); - } - - @Override - public HRESULT RegisterExtensionForTypeSignature(Pointer typeSignature, Pointer dataModel) { - return _invokeHR(VTIndices1.REGISTER_EXTENSION_FOR_TYPE_SIGNATURE, getPointer(), - typeSignature, dataModel); - } - - @Override - public HRESULT UnregisterExtensionForTypeSignature(Pointer typeSignature, Pointer dataModel) { - return _invokeHR(VTIndices1.UNREGISTER_EXTENSION_FOR_TYPE_SIGNATURE, getPointer(), - typeSignature, dataModel); - } - - @Override - public HRESULT CreateMetadataStore(Pointer parentStore, PointerByReference metadataStore) { - return _invokeHR(VTIndices1.CREATE_METADATA_STORE, getPointer(), parentStore, - metadataStore); - } - - @Override - public HRESULT GetRootNamespace(PointerByReference rootNamespace) { - return _invokeHR(VTIndices1.GET_ROOT_NAMESPACE, getPointer(), rootNamespace); - } - - @Override - public HRESULT RegisterNamedModel(WString modelName, Pointer modelObject) { - return _invokeHR(VTIndices1.REGISTER_NAMED_MODEL, getPointer(), modelName, modelObject); - } - - @Override - public HRESULT UnregisterNamedModel(WString modelName) { - return _invokeHR(VTIndices1.UNREGISTER_NAMED_MODEL, getPointer(), modelName); - } - - @Override - public HRESULT AcquireNamedModel(WString modelName, PointerByReference modelObject) { - return _invokeHR(VTIndices1.ACQUIRE_NAMED_MODEL, getPointer(), modelName, modelObject); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/WrapIDataModelManager2.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/WrapIDataModelManager2.java deleted file mode 100644 index 66999cb48f..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/WrapIDataModelManager2.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.datamodel; - -import com.sun.jna.*; -import com.sun.jna.platform.win32.Variant.VARIANT; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -public class WrapIDataModelManager2 extends WrapIDataModelManager1 implements IDataModelManager2 { - public static class ByReference extends WrapIDataModelManager2 - implements Structure.ByReference { - } - - public WrapIDataModelManager2() { - } - - public WrapIDataModelManager2(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT AcquireSubNamespace(WString modelName, WString subNamespaceModelName, - WString accessName, Pointer metadata, PointerByReference namespaceModelObject) { - return _invokeHR(VTIndices2.ACQUIRE_SUBNAMESPACE, getPointer(), modelName, - subNamespaceModelName, accessName, metadata, namespaceModelObject); - } - - @Override - public HRESULT CreateTypedIntrinsicObjectEx(Pointer context, VARIANT.ByReference intrinsicData, - Pointer type, PointerByReference object) { - return _invokeHR(VTIndices2.CREATE_TYPED_INTRINSIC_OBJECT_EX, getPointer(), context, - intrinsicData, type, object); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/IDataModelNameBinder.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/IDataModelNameBinder.java deleted file mode 100644 index 27b2dff970..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/IDataModelNameBinder.java +++ /dev/null @@ -1,55 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.datamodel.script; - -import com.sun.jna.Pointer; -import com.sun.jna.WString; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDataModelNameBinder extends IUnknownEx { - final IID IID_IDATA_MODEL_NAME_BINDER = new IID("AF352B7B-8292-4c01-B360-2DC3696C65E7"); - - enum VTIndices implements VTableIndex { - BIND_VALUE, // - BIND_REFERENCE, // - ENUMERATE_VALUES, // - ENUMERATE_REFERENCES, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT BindValue(Pointer contextObject, WString name, PointerByReference value, - PointerByReference metadata); - - HRESULT BindReference(Pointer contextObject, WString name, PointerByReference reference, - PointerByReference metadata); - - HRESULT EnumerateValues(Pointer contextObject, PointerByReference enumerator); - - HRESULT EnumerateReferences(Pointer contextObject, PointerByReference enumerator); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/IDataModelScript.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/IDataModelScript.java deleted file mode 100644 index f86f300e16..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/IDataModelScript.java +++ /dev/null @@ -1,63 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.datamodel.script; - -import com.sun.jna.Pointer; -import com.sun.jna.WString; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WTypes.BSTRByReference; -import com.sun.jna.platform.win32.WinDef.BOOLByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDataModelScript extends IUnknownEx { - final IID IID_IDATA_MODEL_SCRIPT = new IID("7B4D30FC-B14A-49f8-8D87-D9A1480C97F7"); - - enum VTIndices implements VTableIndex { - GET_NAME, // - RENAME, // - POPULATE, // - EXECUTE, // - UNLINK, // - IS_INVOCABLE, // - INVOKE_MAIN, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT GetName(BSTRByReference scriptName); - - HRESULT Rename(WString scriptName); - - HRESULT Populate(Pointer contentStream); - - HRESULT Execute(Pointer client); - - HRESULT Unlink(); - - HRESULT IsInvocable(BOOLByReference isInvocable); - - HRESULT InvokeMain(Pointer client); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/IDataModelScriptClient.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/IDataModelScriptClient.java deleted file mode 100644 index a63716f651..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/IDataModelScriptClient.java +++ /dev/null @@ -1,44 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.datamodel.script; - -import com.sun.jna.WString; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDataModelScriptClient extends IUnknownEx { - final IID IID_IDATA_MODEL_SCRIPT_CLIENT = new IID("3B362B0E-89F0-46c6-A663-DFDC95194AEF"); - - enum VTIndices implements VTableIndex { - REPORT_ERROR, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT ReportError(ULONG errClass, HRESULT hrFail, WString message, ULONG line, - ULONG position); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/IDataModelScriptHostContext.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/IDataModelScriptHostContext.java deleted file mode 100644 index 6a3e44e827..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/IDataModelScriptHostContext.java +++ /dev/null @@ -1,47 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.datamodel.script; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDataModelScriptHostContext extends IUnknownEx { - final IID IID_IDATA_MODEL_SCRIPT_HOST_CONTEXT = new IID("014D366A-1F23-4981-9219-B2DB8B402054"); - - enum VTIndices implements VTableIndex { - NOTIFY_SCRIPT_CHANGE, // - GET_NAMESPACE_OBJECT, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT NotifyScriptChange(Pointer script, ULONG changeKind); - - HRESULT GetNamespaceObject(PointerByReference namespaceObject); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/IDataModelScriptManager.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/IDataModelScriptManager.java deleted file mode 100644 index 8fb29908e2..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/IDataModelScriptManager.java +++ /dev/null @@ -1,59 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.datamodel.script; - -import com.sun.jna.Pointer; -import com.sun.jna.WString; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDataModelScriptManager extends IUnknownEx { - final IID IID_IDATA_MODEL_SCRIPT_MANAGER = new IID("6FD11E33-E5AD-410b-8011-68C6BC4BF80D"); - - enum VTIndices implements VTableIndex { - GET_DEFAULT_NAME_BINDER, // - REGISTER_SCRIPT_PROVIDER, // - UNREGISTER_SCRIPT_PROVIDER, // - FIND_PROVIDER_FOR_SCRIPT_TYPE, // - FIND_PROVIDER_FOR_SCRIPT_EXTENSION, // - ENUMERATE_SCRIPT_PROVIDERS, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT GetDefaultNameBinder(PointerByReference ppNameBinder); - - HRESULT RegisterScriptProvider(Pointer provider); - - HRESULT UnregisterScriptProvider(Pointer provider); - - HRESULT FindProviderForScriptType(WString scriptType, PointerByReference provider); - - HRESULT FindProviderForScriptExtension(WString scriptExternsion, PointerByReference provider); - - HRESULT EnumerateScriptProviders(PointerByReference enumerator); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/IDataModelScriptProvider.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/IDataModelScriptProvider.java deleted file mode 100644 index 90e3cbc37d..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/IDataModelScriptProvider.java +++ /dev/null @@ -1,55 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.datamodel.script; - -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WTypes.BSTRByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDataModelScriptProvider extends IUnknownEx { - final IID IID_IDATA_MODEL_SCRIPT_PROVIDER = new IID("513461E0-4FCA-48ce-8658-32F3E2056F3B"); - - enum VTIndices implements VTableIndex { - GET_NAME, // - GET_EXTENSION, // - CREATE_SCRIPT, // - GET_DEFAULT_TEMPLATE_CONTENT, // - ENUMERATE_TEMPLATES, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT GetName(BSTRByReference name); - - HRESULT GetExtension(BSTRByReference extension); - - HRESULT CreateScript(PointerByReference script); - - HRESULT GetDefaultTemplateContent(PointerByReference templateContent); - - HRESULT EnumerateTemplates(PointerByReference enumerator); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/IDataModelScriptProviderEnumerator.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/IDataModelScriptProviderEnumerator.java deleted file mode 100644 index f91ee0301e..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/IDataModelScriptProviderEnumerator.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.datamodel.script; - -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDataModelScriptProviderEnumerator extends IUnknownEx { - final IID IID_IDATA_MODEL_SCRIPT_PROVIDER_ENUMERATOR = - new IID("95BA00E2-704A-4fe2-A8F1-A7E7D8FB0941"); - - enum VTIndices implements VTableIndex { - RESET, // - GET_NEXT, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT Reset(); - - HRESULT GetNext(PointerByReference provider); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/IDataModelScriptTemplate.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/IDataModelScriptTemplate.java deleted file mode 100644 index 7a44b0dac0..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/IDataModelScriptTemplate.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.datamodel.script; - -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WTypes.BSTRByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDataModelScriptTemplate extends IUnknownEx { - final IID IID_IDATA_MODEL_SCRIPT_TEMPLATE = new IID("1303DEC4-FA3B-4F1B-9224-B953D16BABB5"); - - enum VTIndices implements VTableIndex { - GET_NAME, // - GET_DESCRIPTION, // - GET_CONTENT, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT GetName(BSTRByReference templateName); - - HRESULT GetDescription(BSTRByReference templateDescription); - - HRESULT GetContent(PointerByReference contentStream); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/IDataModelScriptTemplateEnumerator.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/IDataModelScriptTemplateEnumerator.java deleted file mode 100644 index 53f17260a3..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/IDataModelScriptTemplateEnumerator.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.datamodel.script; - -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDataModelScriptTemplateEnumerator extends IUnknownEx { - final IID IID_IDATA_MODEL_SCRIPT_TEMPLATE_ENUMERATOR = - new IID("69CE6AE2-2268-4e6f-B062-20CE62BFE677"); - - enum VTIndices implements VTableIndex { - RESET, // - GET_NEXT, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT Reset(); - - HRESULT GetNext(PointerByReference templateContent); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/WrapIDataModelNameBinder.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/WrapIDataModelNameBinder.java deleted file mode 100644 index c57491f027..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/WrapIDataModelNameBinder.java +++ /dev/null @@ -1,59 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.datamodel.script; - -import com.sun.jna.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIDataModelNameBinder extends UnknownWithUtils implements IDataModelNameBinder { - public static class ByReference extends WrapIDataModelNameBinder - implements Structure.ByReference { - } - - public WrapIDataModelNameBinder() { - } - - public WrapIDataModelNameBinder(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT BindValue(Pointer contextObject, WString name, PointerByReference value, - PointerByReference metadata) { - return _invokeHR(VTIndices.BIND_VALUE, getPointer(), contextObject, name, value, metadata); - } - - @Override - public HRESULT BindReference(Pointer contextObject, WString name, PointerByReference reference, - PointerByReference metadata) { - return _invokeHR(VTIndices.BIND_REFERENCE, getPointer(), contextObject, name, reference, - metadata); - } - - @Override - public HRESULT EnumerateValues(Pointer contextObject, PointerByReference enumerator) { - return _invokeHR(VTIndices.ENUMERATE_VALUES, getPointer(), contextObject, enumerator); - } - - @Override - public HRESULT EnumerateReferences(Pointer contextObject, PointerByReference enumerator) { - return _invokeHR(VTIndices.ENUMERATE_REFERENCES, getPointer(), contextObject, enumerator); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/WrapIDataModelScript.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/WrapIDataModelScript.java deleted file mode 100644 index 530f2cda16..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/WrapIDataModelScript.java +++ /dev/null @@ -1,71 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.datamodel.script; - -import com.sun.jna.*; -import com.sun.jna.platform.win32.WTypes.BSTRByReference; -import com.sun.jna.platform.win32.WinDef.BOOLByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIDataModelScript extends UnknownWithUtils implements IDataModelScript { - public static class ByReference extends WrapIDataModelScript implements Structure.ByReference { - } - - public WrapIDataModelScript() { - } - - public WrapIDataModelScript(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT GetName(BSTRByReference scriptName) { - return _invokeHR(VTIndices.GET_NAME, getPointer(), scriptName); - } - - @Override - public HRESULT Rename(WString scriptName) { - return _invokeHR(VTIndices.RENAME, getPointer(), scriptName); - } - - @Override - public HRESULT Populate(Pointer contentStream) { - return _invokeHR(VTIndices.POPULATE, getPointer(), contentStream); - } - - @Override - public HRESULT Execute(Pointer client) { - return _invokeHR(VTIndices.EXECUTE, getPointer(), client); - } - - @Override - public HRESULT Unlink() { - return _invokeHR(VTIndices.UNLINK, getPointer()); - } - - @Override - public HRESULT IsInvocable(BOOLByReference isInvocable) { - return _invokeHR(VTIndices.IS_INVOCABLE, getPointer(), isInvocable); - } - - @Override - public HRESULT InvokeMain(Pointer client) { - return _invokeHR(VTIndices.INVOKE_MAIN, getPointer(), client); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/WrapIDataModelScriptClient.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/WrapIDataModelScriptClient.java deleted file mode 100644 index 08bf64aad9..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/WrapIDataModelScriptClient.java +++ /dev/null @@ -1,43 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.datamodel.script; - -import com.sun.jna.*; -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIDataModelScriptClient extends UnknownWithUtils implements IDataModelScriptClient { - public static class ByReference extends WrapIDataModelScriptClient - implements Structure.ByReference { - } - - public WrapIDataModelScriptClient() { - } - - public WrapIDataModelScriptClient(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT ReportError(ULONG errClass, HRESULT hrFail, WString message, ULONG line, - ULONG position) { - return _invokeHR(VTIndices.REPORT_ERROR, getPointer(), errClass, hrFail, message, line, - position); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/WrapIDataModelScriptHostContext.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/WrapIDataModelScriptHostContext.java deleted file mode 100644 index fa5979dc40..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/WrapIDataModelScriptHostContext.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.datamodel.script; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIDataModelScriptHostContext extends UnknownWithUtils - implements IDataModelScriptHostContext { - public static class ByReference extends WrapIDataModelScriptHostContext - implements Structure.ByReference { - } - - public WrapIDataModelScriptHostContext() { - } - - public WrapIDataModelScriptHostContext(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT NotifyScriptChange(Pointer script, ULONG changeKind) { - return _invokeHR(VTIndices.NOTIFY_SCRIPT_CHANGE, getPointer(), script, changeKind); - } - - @Override - public HRESULT GetNamespaceObject(PointerByReference namespaceObject) { - return _invokeHR(VTIndices.GET_NAMESPACE_OBJECT, getPointer(), namespaceObject); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/WrapIDataModelScriptManager.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/WrapIDataModelScriptManager.java deleted file mode 100644 index dd03612bfa..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/WrapIDataModelScriptManager.java +++ /dev/null @@ -1,70 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.datamodel.script; - -import com.sun.jna.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIDataModelScriptManager extends UnknownWithUtils - implements IDataModelScriptManager { - public static class ByReference extends WrapIDataModelScriptManager - implements Structure.ByReference { - } - - public WrapIDataModelScriptManager() { - } - - public WrapIDataModelScriptManager(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT GetDefaultNameBinder(PointerByReference ppNameBinder) { - return _invokeHR(VTIndices.GET_DEFAULT_NAME_BINDER, getPointer(), ppNameBinder); - } - - @Override - public HRESULT RegisterScriptProvider(Pointer provider) { - return _invokeHR(VTIndices.REGISTER_SCRIPT_PROVIDER, provider); - } - - @Override - public HRESULT UnregisterScriptProvider(Pointer provider) { - return _invokeHR(VTIndices.UNREGISTER_SCRIPT_PROVIDER, getPointer(), provider); - } - - @Override - public HRESULT FindProviderForScriptType(WString scriptType, PointerByReference provider) { - return _invokeHR(VTIndices.FIND_PROVIDER_FOR_SCRIPT_TYPE, getPointer(), scriptType, - provider); - } - - @Override - public HRESULT FindProviderForScriptExtension(WString scriptExternsion, - PointerByReference provider) { - return _invokeHR(VTIndices.FIND_PROVIDER_FOR_SCRIPT_EXTENSION, getPointer(), - scriptExternsion, provider); - } - - @Override - public HRESULT EnumerateScriptProviders(PointerByReference enumerator) { - return _invokeHR(VTIndices.ENUMERATE_SCRIPT_PROVIDERS, getPointer(), enumerator); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/WrapIDataModelScriptProvider.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/WrapIDataModelScriptProvider.java deleted file mode 100644 index c6a97a0044..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/WrapIDataModelScriptProvider.java +++ /dev/null @@ -1,64 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.datamodel.script; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WTypes.BSTRByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIDataModelScriptProvider extends UnknownWithUtils - implements IDataModelScriptProvider { - public static class ByReference extends WrapIDataModelScriptProvider - implements Structure.ByReference { - } - - public WrapIDataModelScriptProvider() { - } - - public WrapIDataModelScriptProvider(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT GetName(BSTRByReference name) { - return _invokeHR(VTIndices.GET_NAME, getPointer(), name); - } - - @Override - public HRESULT GetExtension(BSTRByReference extension) { - return _invokeHR(VTIndices.GET_EXTENSION, getPointer(), extension); - } - - @Override - public HRESULT CreateScript(PointerByReference script) { - return _invokeHR(VTIndices.CREATE_SCRIPT, getPointer(), script); - } - - @Override - public HRESULT GetDefaultTemplateContent(PointerByReference templateContent) { - return _invokeHR(VTIndices.GET_DEFAULT_TEMPLATE_CONTENT, getPointer(), templateContent); - } - - @Override - public HRESULT EnumerateTemplates(PointerByReference enumerator) { - return _invokeHR(VTIndices.ENUMERATE_TEMPLATES, getPointer(), enumerator); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/WrapIDataModelScriptProviderEnumerator.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/WrapIDataModelScriptProviderEnumerator.java deleted file mode 100644 index c731d83a48..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/WrapIDataModelScriptProviderEnumerator.java +++ /dev/null @@ -1,48 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.datamodel.script; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIDataModelScriptProviderEnumerator extends UnknownWithUtils - implements IDataModelScriptProviderEnumerator { - public static class ByReference extends WrapIDataModelScriptProviderEnumerator - implements Structure.ByReference { - } - - public WrapIDataModelScriptProviderEnumerator() { - } - - public WrapIDataModelScriptProviderEnumerator(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT Reset() { - return _invokeHR(VTIndices.RESET, getPointer()); - } - - @Override - public HRESULT GetNext(PointerByReference provider) { - return _invokeHR(VTIndices.GET_NEXT, getPointer(), provider); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/WrapIDataModelScriptTemplate.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/WrapIDataModelScriptTemplate.java deleted file mode 100644 index e7fcc367f1..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/WrapIDataModelScriptTemplate.java +++ /dev/null @@ -1,54 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.datamodel.script; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WTypes.BSTRByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIDataModelScriptTemplate extends UnknownWithUtils - implements IDataModelScriptTemplate { - public static class ByReference extends WrapIDataModelScriptTemplate - implements Structure.ByReference { - } - - public WrapIDataModelScriptTemplate() { - } - - public WrapIDataModelScriptTemplate(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT GetName(BSTRByReference templateName) { - return _invokeHR(VTIndices.GET_NAME, getPointer(), templateName); - } - - @Override - public HRESULT GetDescription(BSTRByReference templateDescription) { - return _invokeHR(VTIndices.GET_DESCRIPTION, getPointer(), templateDescription); - } - - @Override - public HRESULT GetContent(PointerByReference contentStream) { - return _invokeHR(VTIndices.GET_CONTENT, getPointer(), contentStream); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/WrapIDataModelScriptTemplateEnumerator.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/WrapIDataModelScriptTemplateEnumerator.java deleted file mode 100644 index 57a22f615c..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/WrapIDataModelScriptTemplateEnumerator.java +++ /dev/null @@ -1,48 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.datamodel.script; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIDataModelScriptTemplateEnumerator extends UnknownWithUtils - implements IDataModelScriptTemplateEnumerator { - public static class ByReference extends WrapIDataModelScriptTemplateEnumerator - implements Structure.ByReference { - } - - public WrapIDataModelScriptTemplateEnumerator() { - } - - public WrapIDataModelScriptTemplateEnumerator(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT Reset() { - return _invokeHR(VTIndices.RESET, getPointer()); - } - - @Override - public HRESULT GetNext(PointerByReference templateContent) { - return _invokeHR(VTIndices.GET_NEXT, getPointer(), templateContent); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/IDataModelScriptDebug.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/IDataModelScriptDebug.java deleted file mode 100644 index 8935713023..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/IDataModelScriptDebug.java +++ /dev/null @@ -1,75 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.datamodel.script.debug; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WTypes.BSTRByReference; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDataModelScriptDebug extends IUnknownEx { - final IID IID_IDATA_MODEL_SCRIPT_DEBUG = new IID("DE8E0945-9750-4471-AB76-A8F79D6EC350"); - - enum VTIndices implements VTableIndex { - GET_DEBUG_STATE, // - GET_CURRENT_POSITION, // - GET_STACK, // - SET_BREAKPOINT, // - FIND_BREAKPOINT_BY_ID, // - ENUMERATE_BREAKPOINTS, // - GET_EVENT_FILTER, // - SET_EVENT_FILTER, // - START_DEBUGGING, // - STOP_DEBUGGING, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT ScriptDebugState(); - - HRESULT GetDebugState(); - - HRESULT GetCurrentPosition(Pointer currentPosition, Pointer positionSpanEnd, - BSTRByReference lineText); - - HRESULT GetStack(PointerByReference stack); - - HRESULT SetBreakpoint(ULONG linePosition, ULONG columnPosition, PointerByReference breakpoint); - - HRESULT FindBreakpointById(ULONGLONG breakpointId, PointerByReference breakpoint); - - HRESULT EnumerateBreakpoints(PointerByReference breakpointEnum); - - HRESULT GetEventFilter(ULONG eventFilter, BOOLByReference isBreakEnabled); - - HRESULT SetEventFilter(ULONG eventFilter, BOOL isBreakEnabled); - - HRESULT StartDebugging(Pointer debugClient); - - HRESULT StopDebugging(Pointer debugClient); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/IDataModelScriptDebug2.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/IDataModelScriptDebug2.java deleted file mode 100644 index 688c02a8d0..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/IDataModelScriptDebug2.java +++ /dev/null @@ -1,42 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.datamodel.script.debug; - -import com.sun.jna.WString; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDataModelScriptDebug2 extends IDataModelScriptDebug { - final IID IID_IDATA_MODEL_SCRIPT_DEBUG2 = new IID("CBB10ED3-839E-426c-9243-E23535C1AE1A"); - - enum VTIndices2 implements VTableIndex { - SET_BREAKPOINT_AT_FUNCTION, // - ; - - public int start = VTableIndex.follow(VTIndices.class); - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT SetBreakpointAtFunction(WString functionName, PointerByReference breakpoint); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/IDataModelScriptDebugBreakpoint.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/IDataModelScriptDebugBreakpoint.java deleted file mode 100644 index 4a0e015cc9..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/IDataModelScriptDebugBreakpoint.java +++ /dev/null @@ -1,59 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.datamodel.script.debug; - -import com.sun.jna.Pointer; -import com.sun.jna.WString; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDataModelScriptDebugBreakpoint extends IUnknownEx { - final IID IID_IDATA_MODEL_SCRIPT_DEBUG_BREAKPOINT = - new IID("6BB27B35-02E6-47cb-90A0-5371244032DE"); - - enum VTIndices implements VTableIndex { - GET_ID, // - IS_ENABLED, // - ENABLE, // - DISABLE, // - REMOVE, // - GET_POSITION, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT GetId(); - - HRESULT IsEnabled(); - - HRESULT Enable(); - - HRESULT Disable(); - - HRESULT Remove(); - - HRESULT GetPosition(Pointer position, Pointer positionSpanEnd, WString lineText); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/IDataModelScriptDebugBreakpointEnumerator.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/IDataModelScriptDebugBreakpointEnumerator.java deleted file mode 100644 index b86662b17d..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/IDataModelScriptDebugBreakpointEnumerator.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.datamodel.script.debug; - -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDataModelScriptDebugBreakpointEnumerator extends IUnknownEx { - final IID IID_IDATA_MODEL_SCRIPT_DEBUG_BREAKPOINT_ENUMERATOR = - new IID("39484A75-B4F3-4799-86DA-691AFA57B299"); - - enum VTIndices implements VTableIndex { - RESET, // - GET_NEXT, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT Reset(); - - HRESULT GetNext(PointerByReference breakpoint); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/IDataModelScriptDebugClient.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/IDataModelScriptDebugClient.java deleted file mode 100644 index 60c68abd75..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/IDataModelScriptDebugClient.java +++ /dev/null @@ -1,43 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.datamodel.script.debug; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDataModelScriptDebugClient extends IUnknownEx { - final IID IID_IDATA_MODEL_SCRIPT_DEBUG_CLIENT = new IID("53159B6D-D4C4-471b-A863-5B110CA800CA"); - - enum VTIndices implements VTableIndex { - NOTIFY_DEBUG_EVENT, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT NotifyDebugEvent(Pointer pEventInfo, Pointer pScript, Pointer pEventDataObject, - Pointer resumeEventKind); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/IDataModelScriptDebugStack.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/IDataModelScriptDebugStack.java deleted file mode 100644 index 3cc7bf95bf..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/IDataModelScriptDebugStack.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.datamodel.script.debug; - -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.ULONGLONG; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDataModelScriptDebugStack extends IUnknownEx { - final IID IID_IDATA_MODEL_SCRIPT_DEBUG_STACK = new IID("051364DD-E449-443e-9762-FE578F4A5473"); - - enum VTIndices implements VTableIndex { - GET_FRAME_COUNT, // - GET_STACK_FRAME, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT GetFrameCount(); - - HRESULT GetStackFrame(ULONGLONG frameNumber, PointerByReference stackFrame); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/IDataModelScriptDebugStackFrame.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/IDataModelScriptDebugStackFrame.java deleted file mode 100644 index 1a92943b64..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/IDataModelScriptDebugStackFrame.java +++ /dev/null @@ -1,66 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.datamodel.script.debug; - -import com.sun.jna.Pointer; -import com.sun.jna.WString; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WTypes.BSTRByReference; -import com.sun.jna.platform.win32.WinDef.BOOLByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDataModelScriptDebugStackFrame extends IUnknownEx { - final IID IID_IDATA_MODEL_SCRIPT_DEBUG_STACK_FRAME = - new IID("DEC6ED5E-6360-4941-AB4C-A26409DE4F82"); - - enum VTIndices implements VTableIndex { - GET_NAME, // - GET_POSITION, // - IS_TRANSITION_POINT, // - GET_TRANSITION, // - EVALUATE, // - ENUMERATE_LOCALS, // - ENUMERATE_ARGUMENTS, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT GetName(BSTRByReference name); - - HRESULT GetPosition(Pointer position, Pointer positionSpanEnd, BSTRByReference lineText); - - HRESULT IsTransitionPoint(BOOLByReference isTransitionPoint); - - HRESULT GetTransition(PointerByReference transitionScript, - BOOLByReference isTransitionContiguous); - - HRESULT Evaluate(WString pwszExpression, PointerByReference ppResult); - - HRESULT EnumerateLocals(PointerByReference variablesEnum); - - HRESULT EnumerateArguments(PointerByReference variablesEnum); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/IDataModelScriptDebugVariableSetEnumerator.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/IDataModelScriptDebugVariableSetEnumerator.java deleted file mode 100644 index e006bffb55..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/IDataModelScriptDebugVariableSetEnumerator.java +++ /dev/null @@ -1,48 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.datamodel.script.debug; - -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WTypes.BSTRByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDataModelScriptDebugVariableSetEnumerator extends IUnknownEx { - final IID IID_IDATA_MODEL_SCRIPT_DEBUG_VARIABLE_SET_ENUMERATOR = - new IID("0F9FEED7-D045-4ac3-98A8-A98942CF6A35"); - - enum VTIndices implements VTableIndex { - RESET, // - GET_NEXT, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT Reset(); - - HRESULT GetNext(BSTRByReference varableName, PointerByReference variableValue, - PointerByReference variableMetadata); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/WrapIDataModelScriptDebug.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/WrapIDataModelScriptDebug.java deleted file mode 100644 index c7fc96de64..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/WrapIDataModelScriptDebug.java +++ /dev/null @@ -1,98 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.datamodel.script.debug; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WTypes.BSTRByReference; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIDataModelScriptDebug extends UnknownWithUtils implements IDataModelScriptDebug { - public static class ByReference extends WrapIDataModelScriptDebug - implements Structure.ByReference { - } - - public WrapIDataModelScriptDebug() { - } - - public WrapIDataModelScriptDebug(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT ScriptDebugState() { - return _invokeHR(VTIndices.GET_DEBUG_STATE, getPointer()); - } - - @Override - public HRESULT GetDebugState() { - return _invokeHR(VTIndices.GET_DEBUG_STATE, getPointer()); - } - - @Override - public HRESULT GetCurrentPosition(Pointer currentPosition, Pointer positionSpanEnd, - BSTRByReference lineText) { - return _invokeHR(VTIndices.GET_CURRENT_POSITION, getPointer(), currentPosition, - positionSpanEnd, lineText); - } - - @Override - public HRESULT GetStack(PointerByReference stack) { - return _invokeHR(VTIndices.GET_STACK, getPointer(), stack); - } - - @Override - public HRESULT SetBreakpoint(ULONG linePosition, ULONG columnPosition, - PointerByReference breakpoint) { - return _invokeHR(VTIndices.SET_BREAKPOINT, getPointer(), linePosition, columnPosition, - breakpoint); - } - - @Override - public HRESULT FindBreakpointById(ULONGLONG breakpointId, PointerByReference breakpoint) { - return _invokeHR(VTIndices.FIND_BREAKPOINT_BY_ID, getPointer(), breakpointId, breakpoint); - } - - @Override - public HRESULT EnumerateBreakpoints(PointerByReference breakpointEnum) { - return _invokeHR(VTIndices.ENUMERATE_BREAKPOINTS, getPointer(), breakpointEnum); - } - - @Override - public HRESULT GetEventFilter(ULONG eventFilter, BOOLByReference isBreakEnabled) { - return _invokeHR(VTIndices.GET_EVENT_FILTER, getPointer(), eventFilter, isBreakEnabled); - } - - @Override - public HRESULT SetEventFilter(ULONG eventFilter, BOOL isBreakEnabled) { - return _invokeHR(VTIndices.SET_EVENT_FILTER, getPointer(), eventFilter, isBreakEnabled); - } - - @Override - public HRESULT StartDebugging(Pointer debugClient) { - return _invokeHR(VTIndices.START_DEBUGGING, getPointer(), debugClient); - } - - @Override - public HRESULT StopDebugging(Pointer debugClient) { - return _invokeHR(VTIndices.STOP_DEBUGGING, getPointer(), debugClient); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/WrapIDataModelScriptDebug2.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/WrapIDataModelScriptDebug2.java deleted file mode 100644 index 7a0ec235e1..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/WrapIDataModelScriptDebug2.java +++ /dev/null @@ -1,41 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.datamodel.script.debug; - -import com.sun.jna.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -public class WrapIDataModelScriptDebug2 extends WrapIDataModelScriptDebug - implements IDataModelScriptDebug2 { - public static class ByReference extends WrapIDataModelScriptDebug2 - implements Structure.ByReference { - } - - public WrapIDataModelScriptDebug2() { - } - - public WrapIDataModelScriptDebug2(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT SetBreakpointAtFunction(WString functionName, PointerByReference breakpoint) { - return _invokeHR(VTIndices2.SET_BREAKPOINT_AT_FUNCTION, getPointer(), functionName, - breakpoint); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/WrapIDataModelScriptDebugBreakpoint.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/WrapIDataModelScriptDebugBreakpoint.java deleted file mode 100644 index 05fe01fbf4..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/WrapIDataModelScriptDebugBreakpoint.java +++ /dev/null @@ -1,66 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.datamodel.script.debug; - -import com.sun.jna.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIDataModelScriptDebugBreakpoint extends UnknownWithUtils - implements IDataModelScriptDebugBreakpoint { - public static class ByReference extends WrapIDataModelScriptDebugBreakpoint - implements Structure.ByReference { - } - - public WrapIDataModelScriptDebugBreakpoint() { - } - - public WrapIDataModelScriptDebugBreakpoint(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT GetId() { - return _invokeHR(VTIndices.GET_ID, getPointer()); - } - - @Override - public HRESULT IsEnabled() { - return _invokeHR(VTIndices.IS_ENABLED, getPointer()); - } - - @Override - public HRESULT Enable() { - return _invokeHR(VTIndices.ENABLE, getPointer()); - } - - @Override - public HRESULT Disable() { - return _invokeHR(VTIndices.DISABLE, getPointer()); - } - - @Override - public HRESULT Remove() { - return _invokeHR(VTIndices.REMOVE, getPointer()); - } - - @Override - public HRESULT GetPosition(Pointer position, Pointer positionSpanEnd, WString lineText) { - return _invokeHR(VTIndices.GET_POSITION, getPointer(), position, positionSpanEnd, lineText); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/WrapIDataModelScriptDebugBreakpointEnumerator.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/WrapIDataModelScriptDebugBreakpointEnumerator.java deleted file mode 100644 index 693d11b499..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/WrapIDataModelScriptDebugBreakpointEnumerator.java +++ /dev/null @@ -1,48 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.datamodel.script.debug; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIDataModelScriptDebugBreakpointEnumerator extends UnknownWithUtils - implements IDataModelScriptDebugBreakpointEnumerator { - public static class ByReference extends WrapIDataModelScriptDebugBreakpointEnumerator - implements Structure.ByReference { - } - - public WrapIDataModelScriptDebugBreakpointEnumerator() { - } - - public WrapIDataModelScriptDebugBreakpointEnumerator(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT Reset() { - return _invokeHR(VTIndices.RESET, getPointer()); - } - - @Override - public HRESULT GetNext(PointerByReference breakpoint) { - return _invokeHR(VTIndices.GET_NEXT, getPointer(), breakpoint); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/WrapIDataModelScriptDebugClient.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/WrapIDataModelScriptDebugClient.java deleted file mode 100644 index a79d012921..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/WrapIDataModelScriptDebugClient.java +++ /dev/null @@ -1,44 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.datamodel.script.debug; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIDataModelScriptDebugClient extends UnknownWithUtils - implements IDataModelScriptDebugClient { - public static class ByReference extends WrapIDataModelScriptDebugClient - implements Structure.ByReference { - } - - public WrapIDataModelScriptDebugClient() { - } - - public WrapIDataModelScriptDebugClient(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT NotifyDebugEvent(Pointer pEventInfo, Pointer pScript, Pointer pEventDataObject, - Pointer resumeEventKind) { - return _invokeHR(VTIndices.NOTIFY_DEBUG_EVENT, getPointer(), pEventInfo, pScript, - pEventDataObject, resumeEventKind); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/WrapIDataModelScriptDebugStack.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/WrapIDataModelScriptDebugStack.java deleted file mode 100644 index d1cb4ce3a1..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/WrapIDataModelScriptDebugStack.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.datamodel.script.debug; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinDef.ULONGLONG; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIDataModelScriptDebugStack extends UnknownWithUtils - implements IDataModelScriptDebugStack { - public static class ByReference extends WrapIDataModelScriptDebugStack - implements Structure.ByReference { - } - - public WrapIDataModelScriptDebugStack() { - } - - public WrapIDataModelScriptDebugStack(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT GetFrameCount() { - return _invokeHR(VTIndices.GET_FRAME_COUNT, getPointer()); - } - - @Override - public HRESULT GetStackFrame(ULONGLONG frameNumber, PointerByReference stackFrame) { - return _invokeHR(VTIndices.GET_STACK_FRAME, getPointer(), frameNumber, stackFrame); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/WrapIDataModelScriptDebugStackFrame.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/WrapIDataModelScriptDebugStackFrame.java deleted file mode 100644 index 3afada0429..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/WrapIDataModelScriptDebugStackFrame.java +++ /dev/null @@ -1,77 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.datamodel.script.debug; - -import com.sun.jna.*; -import com.sun.jna.platform.win32.WTypes.BSTRByReference; -import com.sun.jna.platform.win32.WinDef.BOOLByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIDataModelScriptDebugStackFrame extends UnknownWithUtils - implements IDataModelScriptDebugStackFrame { - public static class ByReference extends WrapIDataModelScriptDebugStackFrame - implements Structure.ByReference { - } - - public WrapIDataModelScriptDebugStackFrame() { - } - - public WrapIDataModelScriptDebugStackFrame(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT GetName(BSTRByReference name) { - return _invokeHR(VTIndices.GET_NAME, getPointer(), name); - } - - @Override - public HRESULT GetPosition(Pointer position, Pointer positionSpanEnd, - BSTRByReference lineText) { - return _invokeHR(VTIndices.GET_POSITION, getPointer(), position, positionSpanEnd, lineText); - } - - @Override - public HRESULT IsTransitionPoint(BOOLByReference isTransitionPoint) { - return _invokeHR(VTIndices.IS_TRANSITION_POINT, getPointer(), isTransitionPoint); - } - - @Override - public HRESULT GetTransition(PointerByReference transitionScript, - BOOLByReference isTransitionContiguous) { - return _invokeHR(VTIndices.GET_TRANSITION, getPointer(), transitionScript, - isTransitionContiguous); - } - - @Override - public HRESULT Evaluate(WString pwszExpression, PointerByReference ppResult) { - return _invokeHR(VTIndices.EVALUATE, getPointer(), pwszExpression, ppResult); - } - - @Override - public HRESULT EnumerateLocals(PointerByReference variablesEnum) { - return _invokeHR(VTIndices.ENUMERATE_LOCALS, getPointer(), variablesEnum); - } - - @Override - public HRESULT EnumerateArguments(PointerByReference variablesEnum) { - return _invokeHR(VTIndices.ENUMERATE_ARGUMENTS, getPointer(), variablesEnum); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/WrapIDataModelScriptDebugVariableSetEnumerator.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/WrapIDataModelScriptDebugVariableSetEnumerator.java deleted file mode 100644 index efabf00ccc..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/datamodel/script/debug/WrapIDataModelScriptDebugVariableSetEnumerator.java +++ /dev/null @@ -1,51 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.datamodel.script.debug; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WTypes.BSTRByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIDataModelScriptDebugVariableSetEnumerator extends UnknownWithUtils - implements IDataModelScriptDebugVariableSetEnumerator { - public static class ByReference extends WrapIDataModelScriptDebugVariableSetEnumerator - implements Structure.ByReference { - } - - public WrapIDataModelScriptDebugVariableSetEnumerator() { - } - - public WrapIDataModelScriptDebugVariableSetEnumerator(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT Reset() { - return _invokeHR(VTIndices.RESET, getPointer()); - } - - @Override - public HRESULT GetNext(BSTRByReference varableName, PointerByReference variableValue, - PointerByReference variableMetadata) { - return _invokeHR(VTIndices.GET_NEXT, getPointer(), varableName, variableValue, - variableMetadata); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHost.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHost.java deleted file mode 100644 index d5099495e5..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHost.java +++ /dev/null @@ -1,47 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDebugHost extends IUnknownEx { - final IID IID_IDEBUG_HOST = new IID("B8C74943-6B2C-4eeb-B5C5-35D378A6D99D"); - - enum VTIndices implements VTableIndex { - GET_HOST_DEFINED_INTERFACE, // - GET_CURRENT_CONTEXT, // - GET_DEFAULT_METADATA; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT GetHostDefinedInterface(PointerByReference hostUnk); - - HRESULT GetCurrentContext(PointerByReference context); - - HRESULT GetDefaultMetadata(PointerByReference defaultMetadataStore); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostBaseClass.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostBaseClass.java deleted file mode 100644 index 51c3087e74..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostBaseClass.java +++ /dev/null @@ -1,63 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.WString; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WTypes.BSTRByReference; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDebugHostBaseClass extends IUnknownEx { - final IID IID_IDEBUG_HOST_BASE_CLASS = new IID("B94D57D2-390B-40f7-B5B4-B6DB897D974B"); - - enum VTIndices implements VTableIndex { - GET_CONTEXT, // - ENUMERATE_CHILDREN, // - GET_SYMBOL_KIND, // - GET_NAME, // - GET_TYPE, // - GET_CONTAINING_MODULE, // - GET_OFFSET, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT GetContext(PointerByReference context); - - HRESULT EnumerateChildren(ULONG kind, WString name, PointerByReference ppEnum); // SymbolKind - - HRESULT GetSymbolKind(ULONGByReference kind); // SymbolKind* - - HRESULT GetName(BSTRByReference symbolName); //? - - HRESULT GetType(PointerByReference type); - - HRESULT GetContainingModule(PointerByReference containingModule); - - HRESULT GetOffset(ULONGLONGByReference offset); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostConstant.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostConstant.java deleted file mode 100644 index 7e78e163c3..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostConstant.java +++ /dev/null @@ -1,41 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.Variant.VARIANT; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDebugHostConstant extends IDebugHostBaseClass { - final IID IID_IDEBUG_HOST_CONSTANT = new IID("62787EDC-FA76-4690-BD71-5E8C3E2937EC"); - - enum VTIndicesX implements VTableIndex { - GET_VALUE, // - ; - - public int start = VTableIndex.follow(VTIndices.class); - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT GetValue(VARIANT.ByReference value); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostContext.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostContext.java deleted file mode 100644 index eadbec653f..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostContext.java +++ /dev/null @@ -1,43 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.BOOLByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDebugHostContext extends IUnknownEx { - final IID IID_IDEBUG_HOST_CONTEXT = new IID("A68C70D8-5EC0-46e5-B775-3134A48EA2E3"); - - enum VTIndices implements VTableIndex { - IS_EQUAL_TO, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT IsEqualTo(Pointer pContext, BOOLByReference pIsEqual); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostData.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostData.java deleted file mode 100644 index bf611bc07a..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostData.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.Variant.VARIANT; -import com.sun.jna.platform.win32.WinDef.ULONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.LOCATION; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDebugHostData extends IDebugHostBaseClass { - final IID IID_IDEBUG_HOST_DATA = new IID("A3D64993-826C-44fa-897D-926F2FE7AD0B"); - - enum VTIndicesX implements VTableIndex { - GET_LOCATION_KIND, // - GET_LOCATION, // - GET_VALUE, // - ; - - public int start = VTableIndex.follow(VTIndices.class); - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT GetLocationKind(ULONGByReference locationKind); // LocationKind* - - HRESULT GetLocation(LOCATION.ByReference location); - - HRESULT GetValue(VARIANT.ByReference value); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostErrorSink.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostErrorSink.java deleted file mode 100644 index 2e51553939..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostErrorSink.java +++ /dev/null @@ -1,43 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.WString; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDebugHostErrorSink extends IUnknownEx { - final IID IID_IDEBUG_HOST_ERROR_SINK = new IID("C8FF0F0B-FCE9-467e-8BB3-5D69EF109C00"); - - enum VTIndices implements VTableIndex { - REPORT_ERROR, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT ReportError(ULONG errClass, HRESULT hrError, WString message); // ErrorClass - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostEvaluator1.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostEvaluator1.java deleted file mode 100644 index df2478a166..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostEvaluator1.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.WString; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDebugHostEvaluator1 extends IUnknownEx { - final IID IID_IDEBUG_HOST_EVALUATOR = new IID("0FEF9A21-577E-4997-AC7B-1C4883241D99"); - - enum VTIndices1 implements VTableIndex { - EVALUATE_EXPRESSION, // - EVALUATE_EXTENDED_EXPRESSION, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT EvaluateExpression(Pointer context, WString expression, Pointer bindingContext, - PointerByReference result, PointerByReference metadata); - - HRESULT EvaluateExtendedExpression(Pointer context, WString expression, Pointer bindingContext, - PointerByReference result, PointerByReference metadata); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostEvaluator2.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostEvaluator2.java deleted file mode 100644 index 13d2d5dc6c..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostEvaluator2.java +++ /dev/null @@ -1,43 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDebugHostEvaluator2 extends IDebugHostEvaluator1 { - final IID IID_IDEBUG_HOST_EVALUATOR2 = new IID("A117A435-1FB4-4092-A2AB-A929576C1E87"); - - enum VTIndices2 implements VTableIndex { - ASSIGN_TO, // - ; - - public int start = VTableIndex.follow(VTIndices1.class); - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT AssignTo(Pointer assignmentReference, Pointer assignmentValue, - PointerByReference assignmentResult, PointerByReference assignmentMetadata); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostExtensability.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostExtensability.java deleted file mode 100644 index 8dd65fa485..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostExtensability.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.WString; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDebugHostExtensability extends IUnknownEx { - final IID IID_IDEBUG_HOST_EXTENSABILITY = new IID("3C2B24E1-11D0-4f86-8AE5-4DF166F73253"); - - enum VTIndices implements VTableIndex { - CREATE_FUNCTION_ALIAS, // - DESTROY_FUNCTION_ALIAS, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT CreateFunctionAlias(WString aliasName, Pointer functionObject); - - HRESULT DestroyFunctionAlias(WString aliasName); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostField.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostField.java deleted file mode 100644 index 04a7486988..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostField.java +++ /dev/null @@ -1,53 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.Variant.VARIANT; -import com.sun.jna.platform.win32.WinDef.ULONGByReference; -import com.sun.jna.platform.win32.WinDef.ULONGLONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.LOCATION; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDebugHostField extends IDebugHostBaseClass { - final IID IID_IDEBUG_HOST_FIELD = new IID("E06F6495-16BC-4cc9-B11D-2A6B23FA72F3"); - - enum VTIndicesX implements VTableIndex { - GET_LOCATION_KIND, // - GET_OFFSET, // - GET_LOCATION, // - GET_VALUE, // - ; - - public int start = VTableIndex.follow(VTIndices.class); - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT GetLocationKind(ULONGByReference locationKind); // LocationKind* - - HRESULT GetOffset(ULONGLONGByReference offset); - - HRESULT GetLocation(LOCATION.ByReference location); - - HRESULT GetValue(VARIANT.ByReference value); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostMemory1.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostMemory1.java deleted file mode 100644 index f44f2fb519..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostMemory1.java +++ /dev/null @@ -1,64 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import java.nio.ByteBuffer; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WTypes.BSTRByReference; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.LOCATION; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDebugHostMemory1 extends IUnknownEx { - final IID IID_IDEBUG_HOST_MEMORY = new IID("212149C9-9183-4a3e-B00E-4FD1DC95339B"); - - enum VTIndices1 implements VTableIndex { - READ_BYTES, // - WRITE_BYTES, // - READ_POINTERS, // - WRITE_POINTERS, // - GET_DISPLAY_STRING_FOR_LOCATION, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT ReadBytes(Pointer context, LOCATION location, ByteBuffer buffer, ULONGLONG bufferSize, - ULONGLONGByReference bytesRead); - - HRESULT WriteBytes(Pointer context, LOCATION location, ByteBuffer buffer, ULONGLONG bufferSize, - ULONGLONGByReference bytesWritten); - - HRESULT ReadPointers(Pointer context, LOCATION location, ULONGLONG count, - ULONGLONGByReference pointers); - - HRESULT WritePointers(Pointer context, LOCATION location, ULONGLONG count, - ULONGLONGByReference pointers); - - HRESULT GetDisplayStringForLocation(Pointer context, LOCATION location, BOOL verbose, - BSTRByReference locationName); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostMemory2.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostMemory2.java deleted file mode 100644 index cfe8b74b2a..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostMemory2.java +++ /dev/null @@ -1,43 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.LOCATION; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDebugHostMemory2 extends IDebugHostMemory1 { - final IID IID_IDEBUG_HOST_MEMORY2 = new IID("EEA033DE-38F6-416b-A251-1D3771001270"); - - enum VTIndices2 implements VTableIndex { - LINEARIZE_LOCATION, // - ; - - public int start = VTableIndex.follow(VTIndices1.class); - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT LinearizeLocation(Pointer context, LOCATION location, - LOCATION.ByReference pLinearizedLocation); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostModule1.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostModule1.java deleted file mode 100644 index a9bd3467ad..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostModule1.java +++ /dev/null @@ -1,60 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.WString; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WTypes.BSTRByReference; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.LOCATION; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDebugHostModule1 extends IDebugHostBaseClass { - final IID IID_IDEBUG_HOST_MODULE = new IID("C9BA3E18-D070-4378-BBD0-34613B346E1E"); - - enum VTIndices1 implements VTableIndex { - GET_IMAGE_NAME, // - GET_BASE_LOCATION, // - GET_VERSION, // - FIND_TYPE_BY_NAME, // - FIND_SYMBOL_BY_RVA, // - FIND_SYMBOL_BY_NAME, // - ; - - public int start = VTableIndex.follow(VTIndices.class); - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT GetImageName(BOOL allowPath, BSTRByReference imageName); - - HRESULT GetBaseLocation(LOCATION.ByReference moduleBaseLocation); - - HRESULT GetVersion(ULONGLONGByReference fileVersion, ULONGLONGByReference productVersion); - - HRESULT FindTypeByName(WString typeName, PointerByReference type); - - HRESULT FindSymbolByRVA(ULONGLONG rva, PointerByReference symbol); - - HRESULT FindSymbolByName(WString symbolName, PointerByReference symbol); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostModule2.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostModule2.java deleted file mode 100644 index 00de0bbb1d..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostModule2.java +++ /dev/null @@ -1,44 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.ULONGLONG; -import com.sun.jna.platform.win32.WinDef.ULONGLONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDebugHostModule2 extends IDebugHostModule1 { - final IID IID_IDEBUG_HOST_MODULE2 = new IID("B51887E8-BCD0-4e8f-A8C7-434398B78C37"); - - enum VTIndices2 implements VTableIndex { - FIND_CONTAINING_SYMBOL_BY_RVA, // - ; - - public int start = VTableIndex.follow(VTIndices1.class); - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT FindContainingSymbolByRVA(ULONGLONG rva, PointerByReference symbol, - ULONGLONGByReference offset); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostModuleSignature.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostModuleSignature.java deleted file mode 100644 index 686f3da369..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostModuleSignature.java +++ /dev/null @@ -1,43 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.BOOLByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDebugHostModuleSignature extends IUnknownEx { - final IID IID_IDEBUG_HOST_MODULE_SIGNATURE = new IID("31E53A5A-01EE-4BBB-B899-4B46AE7D595C"); - - enum VTIndices implements VTableIndex { - IS_MATCH, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT IsMatch(Pointer pModule, BOOLByReference isMatch); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostPublic.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostPublic.java deleted file mode 100644 index ec17d8ea3d..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostPublic.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.ULONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.LOCATION; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDebugHostPublic extends IDebugHostBaseClass { - final IID IID_IDEBUG_HOST_PUBLIC = new IID("6C597AC9-FB4D-4f6d-9F39-22488539F8F4"); - - enum VTIndicesX implements VTableIndex { - GET_LOCATION_KIND, // - GET_LOCATION, // - ; - - public int start = VTableIndex.follow(VTIndices.class); - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT GetLocationKind(ULONGByReference locationKind); // LocationKind* - - HRESULT GetLocation(LOCATION.ByReference location); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostScriptHost.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostScriptHost.java deleted file mode 100644 index bae1fda5f8..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostScriptHost.java +++ /dev/null @@ -1,43 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDebugHostScriptHost extends IUnknownEx { - final IID IID_IDEBUG_HOST_SCRIPT_HOST = new IID("B70334A4-B92C-4570-93A1-D3EB686649A0"); - - enum VTIndices implements VTableIndex { - CREATE_CONTEXT, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT CreateContext(Pointer script, PointerByReference scriptContext); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostStatus.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostStatus.java deleted file mode 100644 index 7b82eb7f30..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostStatus.java +++ /dev/null @@ -1,42 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.BOOLByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDebugHostStatus extends IUnknownEx { - final IID IID_IDEBUG_HOST_STATUS = new IID("4F3E1CE2-86B2-4C7A-9C65-D0A9D0EECF44"); - - enum VTIndices implements VTableIndex { - POLL_USER_INTERRUPT, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT PollUserInterrupt(BOOLByReference interruptRequested); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostSymbol1.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostSymbol1.java deleted file mode 100644 index 121a9f65b5..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostSymbol1.java +++ /dev/null @@ -1,44 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.BOOLByReference; -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDebugHostSymbol1 extends IDebugHostBaseClass { - final IID IID_IDEBUG_HOST_SYMBOL = new IID("0F819103-87DE-4e96-8277-E05CD441FB22"); - - enum VTIndices1 implements VTableIndex { - COMPARE_AGAINST, // - ; - - public int start = VTableIndex.follow(VTIndices.class); - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT CompareAgainst(Pointer pComparisonSymbol, ULONG comparisonFlags, - BOOLByReference pMatches); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostSymbol2.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostSymbol2.java deleted file mode 100644 index 1ad0aaa261..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostSymbol2.java +++ /dev/null @@ -1,48 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.Structure.ByReference; -import com.sun.jna.WString; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinDef.ULONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDebugHostSymbol2 extends IDebugHostSymbol1 { - final IID IID_IDEBUG_HOST_SYMBOL2 = new IID("21515B67-6720-4257-8A68-077DC944471C"); - - enum VTIndices2 implements VTableIndex { - ENUMERATE_CHILDREN_EX, // - ; - - public int start = VTableIndex.follow(VTIndices1.class); - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT EnumerateChildrenEx(ULONG ulKind, WString name, ByReference searchInfo, - PointerByReference ppEnum); - - HRESULT GetLanguage(ULONGByReference pKind); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostSymbolEnumerator.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostSymbolEnumerator.java deleted file mode 100644 index c760b6d8f4..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostSymbolEnumerator.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDebugHostSymbolEnumerator extends IUnknownEx { - final IID IID_IDEBUG_HOST_SYMBOL_ENUMERATOR = new IID("28D96C86-10A3-4976-B14E-EAEF4790AA1F"); - - enum VTIndices implements VTableIndex { - RESET, // - GET_NEXT, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT Reset(); - - HRESULT GetNext(PointerByReference symbol); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostSymbols.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostSymbols.java deleted file mode 100644 index 87ea35ae6e..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostSymbols.java +++ /dev/null @@ -1,68 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.WString; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.LOCATION; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDebugHostSymbols extends IUnknownEx { - final IID IID_IDEBUG_HOST_SYMBOLS = new IID("854FD751-C2E1-4eb2-B525-6619CB97A588"); - - enum VTIndices implements VTableIndex { - CREATE_MODULE_SIGNATURE, // - CREATE_TYPE_SIGNATURE, // - CREATE_TYPE_SIGNATURE_FOR_MODULE_RANGE, // - ENUMERATE_MODULES, // - FIND_MODULE_BY_NAME, // - FIND_MODULE_BY_LOCATION, // - GET_MOST_DERIVED_OBJECT, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT CreateModuleSignature(WString pwszModuleName, WString pwszMinVersion, - WString pwszMaxVersion, PointerByReference ppModuleSignature); - - HRESULT CreateTypeSignature(WString signatureSpecification, Pointer module, - PointerByReference typeSignature); - - HRESULT CreateTypeSignatureForModuleRange(WString signatureSpecification, WString moduleName, - WString minVersion, WString maxVersion, PointerByReference typeSignature); - - HRESULT EnumerateModules(Pointer context, PointerByReference moduleEnum); - - HRESULT FindModuleByName(Pointer context, WString moduleName, PointerByReference module); - - HRESULT FindModuleByLocation(Pointer context, LOCATION moduleLocation, - PointerByReference module); - - HRESULT GetMostDerivedObject(Pointer pContext, LOCATION location, Pointer objectType, - LOCATION.ByReference derivedLocation, PointerByReference derivedType); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostType1.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostType1.java deleted file mode 100644 index d01ac5010a..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostType1.java +++ /dev/null @@ -1,99 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WTypes.VARTYPEByReference; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.ARRAY_DIMENSION.ByReference; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDebugHostType1 extends IDebugHostBaseClass { - final IID IID_IDEBUG_HOST_TYPE = new IID("3AADC353-2B14-4abb-9893-5E03458E07EE"); - - enum VTIndices1 implements VTableIndex { - GET_TYPE_KIND, // - GET_SIZE, // - GET_BASE_TYPE, // - GET_HASH_CODE, // - GET_INTRINSIC_TYPE, // - GET_BIT_FIELD, // - GET_POINTER_KIND, // - GET_MEMBER_TYPE, // - CREATE_POINTER_TO, // - GET_ARRAY_DIMENSIONALITY, // - GET_ARRAY_DIMENSIONS, // - CREATE_ARRAY_OF, // - GET_FUNCTION_CALLING_CONVENTION, // - GET_FUNCTION_RETURN_TYPE, // - GET_FUNCTION_PARAMETER_TYPE_COUNT, // - GET_FUNCTION_PARAMETER_TYPE_AT, // - IS_GENERIC, // - GET_GENERIC_ARGUMENT_COUNT, // - GET_GENERIC_ARGUMENT_AT, // - ; - - public int start = VTableIndex.follow(VTIndices.class); - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT GetTypeKind(ULONGByReference kind); // TypeKind* - - HRESULT GetSize(ULONGLONGByReference pulSize); - - HRESULT GetBaseType(PointerByReference baseType); - - HRESULT GetHashCode(ULONGByReference hashCode); - - HRESULT GetIntrinsicType(ULONGByReference pulIntrinsicKind, VARTYPEByReference pCarrierType); - - HRESULT GetBitField(ULONGByReference lsbOfField, ULONGByReference lengthOfField); - - HRESULT GetPointerKind(ULONGByReference pointerKind); // PointerKind* - - HRESULT GetMemberType(PointerByReference memberType); - - HRESULT CreatePointerTo(ULONG kind, PointerByReference newType); // PointerKind - - HRESULT GetArrayDimensionality(ULONGLONGByReference pulArrayDimensionality); - - HRESULT GetArrayDimensions(ULONGLONG pDimensions, ByReference ppDimensions); - - HRESULT CreateArrayOf(ULONGLONG ulDimensions, ByReference pDimensions, - PointerByReference newType); - - HRESULT GetFunctionCallingConvention(ULONGByReference conventionKind); // ConventionKind* - - HRESULT GetFunctionReturnType(PointerByReference returnType); - - HRESULT GetFunctionParameterTypeCount(ULONGByReference count); - - HRESULT GetFunctionParameterTypeAt(ULONG i, PointerByReference parameterType); - - HRESULT IsGeneric(BOOLByReference isGeneric); - - HRESULT GetGenericArgumentCount(ULONGLONGByReference pulArgCount); - - HRESULT GetGenericArgumentAt(ULONG i, PointerByReference argument); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostType2.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostType2.java deleted file mode 100644 index 424d7df772..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostType2.java +++ /dev/null @@ -1,55 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.BOOLByReference; -import com.sun.jna.platform.win32.WinDef.ULONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDebugHostType2 extends IDebugHostType1 { - final IID IID_IDEBUG_HOST_TYPE2 = new IID("B28632B9-8506-4676-87CE-8F7E05E59876"); - - enum VTIndices2 implements VTableIndex { - IS_TYPEDEF, // - GET_TYPEDEF_BASE_TYPE, // - GET_TYPEDEF_FINAL_BASE_TYPE, // - GET_FUNCTION_VARARGS_KIND, // - GET_FUNCTION_INSTANCE_POINTER_TYPE, // - ; - - public int start = VTableIndex.follow(VTIndices1.class); - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT IsTypedef(BOOLByReference isTypedef); - - HRESULT GetTypedefBaseType(PointerByReference baseType); - - HRESULT GetTypedefFinalBaseType(PointerByReference finalBaseType); - - HRESULT GetFunctionVarArgsKind(ULONGByReference varArgsKind); // VarArgsKind* - - HRESULT GetFunctionInstancePointerType(PointerByReference instancePointerType); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostTypeSignature.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostTypeSignature.java deleted file mode 100644 index 9feaa89cba..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/IDebugHostTypeSignature.java +++ /dev/null @@ -1,50 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.BOOLByReference; -import com.sun.jna.platform.win32.WinDef.ULONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IDebugHostTypeSignature extends IUnknownEx { - final IID IID_IDEBUG_HOST_TYPE_SIGNATURE = new IID("3AADC353-2B14-4abb-9893-5E03458E07EE"); - - enum VTIndices implements VTableIndex { - GET_HASH_CODE, // - IS_MATCH, // - COMPARE_AGAINST; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT GetHashCode(ULONGByReference hashCode); - - HRESULT IsMatch(Pointer type, BOOLByReference isMatch, PointerByReference wildcardMatches); - - HRESULT CompareAgainst(Pointer typeSignature, ULONGByReference result); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHost.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHost.java deleted file mode 100644 index 23794f90bb..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHost.java +++ /dev/null @@ -1,51 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIDebugHost extends UnknownWithUtils implements IDebugHost { - public static class ByReference extends WrapIDebugHost implements Structure.ByReference { - } - - public WrapIDebugHost() { - } - - public WrapIDebugHost(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT GetHostDefinedInterface(PointerByReference hostUnk) { - return _invokeHR(VTIndices.GET_HOST_DEFINED_INTERFACE, getPointer(), hostUnk); - } - - @Override - public HRESULT GetCurrentContext(PointerByReference context) { - return _invokeHR(VTIndices.GET_CURRENT_CONTEXT, getPointer(), context); - } - - @Override - public HRESULT GetDefaultMetadata(PointerByReference defaultMetadataStore) { - return _invokeHR(VTIndices.GET_DEFAULT_METADATA, getPointer(), defaultMetadataStore); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostBaseClass.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostBaseClass.java deleted file mode 100644 index 336169c958..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostBaseClass.java +++ /dev/null @@ -1,73 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.*; -import com.sun.jna.platform.win32.WTypes.BSTRByReference; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIDebugHostBaseClass extends UnknownWithUtils implements IDebugHostBaseClass { - public static class ByReference extends WrapIDebugHostBaseClass - implements Structure.ByReference { - } - - public WrapIDebugHostBaseClass() { - } - - public WrapIDebugHostBaseClass(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT GetContext(PointerByReference context) { - return _invokeHR(VTIndices.GET_CONTEXT, getPointer(), context); - } - - @Override - public HRESULT EnumerateChildren(ULONG kind, WString name, PointerByReference ppEnum) { - return _invokeHR(VTIndices.ENUMERATE_CHILDREN, getPointer(), kind, name, ppEnum); - } - - @Override - public HRESULT GetSymbolKind(ULONGByReference kind) { - return _invokeHR(VTIndices.GET_SYMBOL_KIND, getPointer(), kind); - } - - @Override - public HRESULT GetName(BSTRByReference symbolName) { - return _invokeHR(VTIndices.GET_NAME, getPointer(), symbolName); - } - - @Override - public HRESULT GetType(PointerByReference type) { - return _invokeHR(VTIndices.GET_TYPE, getPointer(), type); - } - - @Override - public HRESULT GetContainingModule(PointerByReference containingModule) { - return _invokeHR(VTIndices.GET_CONTAINING_MODULE, getPointer(), containingModule); - } - - @Override - public HRESULT GetOffset(ULONGLONGByReference offset) { - return _invokeHR(VTIndices.GET_OFFSET, getPointer(), offset); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostConstant.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostConstant.java deleted file mode 100644 index a983714a34..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostConstant.java +++ /dev/null @@ -1,40 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.Variant.VARIANT; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -public class WrapIDebugHostConstant extends WrapIDebugHostBaseClass implements IDebugHostConstant { - public static class ByReference extends WrapIDebugHostConstant - implements Structure.ByReference { - } - - public WrapIDebugHostConstant() { - } - - public WrapIDebugHostConstant(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT GetValue(VARIANT.ByReference value) { - return _invokeHR(VTIndicesX.GET_VALUE, getPointer(), value); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostContext.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostContext.java deleted file mode 100644 index 8e7fb10dc1..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostContext.java +++ /dev/null @@ -1,41 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinDef.BOOLByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIDebugHostContext extends UnknownWithUtils implements IDebugHostContext { - public static class ByReference extends WrapIDebugHostContext implements Structure.ByReference { - } - - public WrapIDebugHostContext() { - } - - public WrapIDebugHostContext(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT IsEqualTo(Pointer pContext, BOOLByReference pIsEqual) { - return _invokeHR(VTIndices.IS_EQUAL_TO, getPointer(), pContext, pIsEqual); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostData.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostData.java deleted file mode 100644 index 88047d3e32..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostData.java +++ /dev/null @@ -1,52 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.Variant.VARIANT; -import com.sun.jna.platform.win32.WinDef.ULONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.LOCATION; - -public class WrapIDebugHostData extends WrapIDebugHostBaseClass implements IDebugHostData { - public static class ByReference extends WrapIDebugHostData implements Structure.ByReference { - } - - public WrapIDebugHostData() { - } - - public WrapIDebugHostData(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT GetLocationKind(ULONGByReference locationKind) { - return _invokeHR(VTIndicesX.GET_LOCATION_KIND, getPointer(), locationKind); - } - - @Override - public HRESULT GetLocation(LOCATION.ByReference location) { - return _invokeHR(VTIndicesX.GET_LOCATION, getPointer(), location); - } - - @Override - public HRESULT GetValue(VARIANT.ByReference value) { - return _invokeHR(VTIndicesX.GET_VALUE, getPointer(), value); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostErrorSink.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostErrorSink.java deleted file mode 100644 index 5b4396021d..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostErrorSink.java +++ /dev/null @@ -1,40 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.*; -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIDebugHostErrorSink extends UnknownWithUtils implements IDebugHostErrorSink { - public static class ByReference extends WrapIDebugHostErrorSink - implements Structure.ByReference { - } - - public WrapIDebugHostErrorSink() { - } - - public WrapIDebugHostErrorSink(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT ReportError(ULONG errClass, HRESULT hrError, WString message) { - return _invokeHR(VTIndices.REPORT_ERROR, getPointer(), errClass, hrError, message); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostEvaluator1.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostEvaluator1.java deleted file mode 100644 index 726dfadb44..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostEvaluator1.java +++ /dev/null @@ -1,50 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIDebugHostEvaluator1 extends UnknownWithUtils implements IDebugHostEvaluator1 { - public static class ByReference extends WrapIDebugHostEvaluator1 - implements Structure.ByReference { - } - - public WrapIDebugHostEvaluator1() { - } - - public WrapIDebugHostEvaluator1(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT EvaluateExpression(Pointer context, WString expression, Pointer bindingContext, - PointerByReference result, PointerByReference metadata) { - return _invokeHR(VTIndices1.EVALUATE_EXPRESSION, getPointer(), context, expression, - bindingContext, result, metadata); - } - - @Override - public HRESULT EvaluateExtendedExpression(Pointer context, WString expression, - Pointer bindingContext, PointerByReference result, PointerByReference metadata) { - return _invokeHR(VTIndices1.EVALUATE_EXTENDED_EXPRESSION, getPointer(), context, expression, - bindingContext, result, metadata); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostEvaluator2.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostEvaluator2.java deleted file mode 100644 index 853b1b6fcd..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostEvaluator2.java +++ /dev/null @@ -1,43 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -public class WrapIDebugHostEvaluator2 extends WrapIDebugHostEvaluator1 - implements IDebugHostEvaluator2 { - public static class ByReference extends WrapIDebugHostEvaluator2 - implements Structure.ByReference { - } - - public WrapIDebugHostEvaluator2() { - } - - public WrapIDebugHostEvaluator2(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT AssignTo(Pointer assignmentReference, Pointer assignmentValue, - PointerByReference assignmentResult, PointerByReference assignmentMetadata) { - return _invokeHR(VTIndices2.ASSIGN_TO, getPointer(), assignmentReference, assignmentValue, - assignmentResult, assignmentMetadata); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostExtensability.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostExtensability.java deleted file mode 100644 index 601f138361..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostExtensability.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIDebugHostExtensability extends UnknownWithUtils - implements IDebugHostExtensability { - public static class ByReference extends WrapIDebugHostExtensability - implements Structure.ByReference { - } - - public WrapIDebugHostExtensability() { - } - - public WrapIDebugHostExtensability(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT CreateFunctionAlias(WString aliasName, Pointer functionObject) { - return _invokeHR(VTIndices.CREATE_FUNCTION_ALIAS, getPointer(), aliasName, functionObject); - } - - @Override - public HRESULT DestroyFunctionAlias(WString aliasName) { - return _invokeHR(VTIndices.DESTROY_FUNCTION_ALIAS, getPointer(), aliasName); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostField.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostField.java deleted file mode 100644 index 97d7b90f38..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostField.java +++ /dev/null @@ -1,58 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.Variant.VARIANT; -import com.sun.jna.platform.win32.WinDef.ULONGByReference; -import com.sun.jna.platform.win32.WinDef.ULONGLONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.LOCATION; - -public class WrapIDebugHostField extends WrapIDebugHostBaseClass implements IDebugHostField { - public static class ByReference extends WrapIDebugHostField implements Structure.ByReference { - } - - public WrapIDebugHostField() { - } - - public WrapIDebugHostField(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT GetLocationKind(ULONGByReference locationKind) { - return _invokeHR(VTIndicesX.GET_LOCATION_KIND, getPointer(), locationKind); - } - - @Override - public HRESULT GetOffset(ULONGLONGByReference offset) { - return _invokeHR(VTIndicesX.GET_OFFSET, getPointer(), offset); - } - - @Override - public HRESULT GetLocation(LOCATION.ByReference location) { - return _invokeHR(VTIndicesX.GET_LOCATION, getPointer(), location); - } - - @Override - public HRESULT GetValue(VARIANT.ByReference value) { - return _invokeHR(VTIndicesX.GET_VALUE, getPointer(), value); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostMemory1.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostMemory1.java deleted file mode 100644 index a6ba8ecdb9..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostMemory1.java +++ /dev/null @@ -1,79 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import java.nio.ByteBuffer; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WTypes.BSTRByReference; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.LOCATION; - -public class WrapIDebugHostMemory1 extends UnknownWithUtils implements IDebugHostMemory1 { - public static class ByReference extends WrapIDebugHostMemory1 implements Structure.ByReference { - } - - public WrapIDebugHostMemory1() { - } - - public WrapIDebugHostMemory1(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT ReadBytes(Pointer context, LOCATION location, ByteBuffer buffer, - ULONGLONG bufferSize, - ULONGLONGByReference bytesRead) { - return _invokeHR(VTIndices1.READ_BYTES, getPointer(), context, location, buffer, bufferSize, - bytesRead); - } - - @Override - public HRESULT WriteBytes(Pointer context, LOCATION location, ByteBuffer buffer, - ULONGLONG bufferSize, - ULONGLONGByReference bytesWritten) { - return _invokeHR(VTIndices1.WRITE_BYTES, getPointer(), context, location, buffer, - bufferSize, - bytesWritten); - } - - @Override - public HRESULT ReadPointers(Pointer context, LOCATION location, ULONGLONG count, - ULONGLONGByReference pointers) { - return _invokeHR(VTIndices1.READ_POINTERS, getPointer(), context, location, count, - pointers); - } - - @Override - public HRESULT WritePointers(Pointer context, LOCATION location, ULONGLONG count, - ULONGLONGByReference pointers) { - return _invokeHR(VTIndices1.WRITE_POINTERS, getPointer(), context, location, count, - pointers); - } - - @Override - public HRESULT GetDisplayStringForLocation(Pointer context, LOCATION location, BOOL verbose, - BSTRByReference locationName) { - return _invokeHR(VTIndices1.GET_DISPLAY_STRING_FOR_LOCATION, getPointer(), context, - location, - verbose, locationName); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostMemory2.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostMemory2.java deleted file mode 100644 index b84bb29652..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostMemory2.java +++ /dev/null @@ -1,42 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.LOCATION; - -public class WrapIDebugHostMemory2 extends WrapIDebugHostMemory1 implements IDebugHostMemory2 { - public static class ByReference extends WrapIDebugHostMemory2 implements Structure.ByReference { - } - - public WrapIDebugHostMemory2() { - } - - public WrapIDebugHostMemory2(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT LinearizeLocation(Pointer context, LOCATION location, - LOCATION.ByReference pLinearizedLocation) { - return _invokeHR(VTIndices2.LINEARIZE_LOCATION, getPointer(), context, location, - pLinearizedLocation); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostModule1.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostModule1.java deleted file mode 100644 index 4bd13b96c4..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostModule1.java +++ /dev/null @@ -1,68 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.*; -import com.sun.jna.platform.win32.WTypes.BSTRByReference; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.LOCATION; - -public class WrapIDebugHostModule1 extends WrapIDebugHostBaseClass implements IDebugHostModule1 { - public static class ByReference extends WrapIDebugHostModule1 implements Structure.ByReference { - } - - public WrapIDebugHostModule1() { - } - - public WrapIDebugHostModule1(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT GetImageName(BOOL allowPath, BSTRByReference imageName) { - return _invokeHR(VTIndices1.GET_IMAGE_NAME, getPointer(), allowPath, imageName); - } - - @Override - public HRESULT GetBaseLocation(LOCATION.ByReference moduleBaseLocation) { - return _invokeHR(VTIndices1.GET_BASE_LOCATION, getPointer(), moduleBaseLocation); - } - - @Override - public HRESULT GetVersion(ULONGLONGByReference fileVersion, - ULONGLONGByReference productVersion) { - return _invokeHR(VTIndices1.GET_VERSION, getPointer(), fileVersion, productVersion); - } - - @Override - public HRESULT FindTypeByName(WString typeName, PointerByReference type) { - return _invokeHR(VTIndices1.FIND_TYPE_BY_NAME, getPointer(), typeName, type); - } - - @Override - public HRESULT FindSymbolByRVA(ULONGLONG rva, PointerByReference symbol) { - return _invokeHR(VTIndices1.FIND_SYMBOL_BY_RVA, getPointer(), symbol); - } - - @Override - public HRESULT FindSymbolByName(WString symbolName, PointerByReference symbol) { - return _invokeHR(VTIndices1.FIND_SYMBOL_BY_NAME, getPointer(), symbolName, symbol); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostModule2.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostModule2.java deleted file mode 100644 index dbaeee3a82..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostModule2.java +++ /dev/null @@ -1,43 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinDef.ULONGLONG; -import com.sun.jna.platform.win32.WinDef.ULONGLONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -public class WrapIDebugHostModule2 extends WrapIDebugHostModule1 implements IDebugHostModule2 { - public static class ByReference extends WrapIDebugHostModule2 implements Structure.ByReference { - } - - public WrapIDebugHostModule2() { - } - - public WrapIDebugHostModule2(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT FindContainingSymbolByRVA(ULONGLONG rva, PointerByReference symbol, - ULONGLONGByReference offset) { - return _invokeHR(VTIndices2.FIND_CONTAINING_SYMBOL_BY_RVA, getPointer(), rva, symbol, - offset); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostModuleSignature.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostModuleSignature.java deleted file mode 100644 index 1699bed34b..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostModuleSignature.java +++ /dev/null @@ -1,43 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinDef.BOOLByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIDebugHostModuleSignature extends UnknownWithUtils - implements IDebugHostModuleSignature { - public static class ByReference extends WrapIDebugHostModuleSignature - implements Structure.ByReference { - } - - public WrapIDebugHostModuleSignature() { - } - - public WrapIDebugHostModuleSignature(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT IsMatch(Pointer pModule, BOOLByReference isMatch) { - return _invokeHR(VTIndices.IS_MATCH, getPointer(), pModule, isMatch); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostPublic.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostPublic.java deleted file mode 100644 index f075754070..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostPublic.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinDef.ULONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.LOCATION; - -public class WrapIDebugHostPublic extends WrapIDebugHostBaseClass implements IDebugHostPublic { - public static class ByReference extends WrapIDebugHostPublic implements Structure.ByReference { - } - - public WrapIDebugHostPublic() { - } - - public WrapIDebugHostPublic(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT GetLocationKind(ULONGByReference locationKind) { - return _invokeHR(VTIndicesX.GET_LOCATION_KIND, getPointer(), locationKind); - } - - @Override - public HRESULT GetLocation(LOCATION.ByReference location) { - return _invokeHR(VTIndicesX.GET_LOCATION, getPointer(), location); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostScriptHost.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostScriptHost.java deleted file mode 100644 index 9fb93393f3..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostScriptHost.java +++ /dev/null @@ -1,42 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIDebugHostScriptHost extends UnknownWithUtils implements IDebugHostScriptHost { - public static class ByReference extends WrapIDebugHostScriptHost - implements Structure.ByReference { - } - - public WrapIDebugHostScriptHost() { - } - - public WrapIDebugHostScriptHost(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT CreateContext(Pointer script, PointerByReference scriptContext) { - return _invokeHR(VTIndices.CREATE_CONTEXT, getPointer(), script, scriptContext); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostStatus.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostStatus.java deleted file mode 100644 index 8e9b795ba3..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostStatus.java +++ /dev/null @@ -1,41 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinDef.BOOLByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIDebugHostStatus extends UnknownWithUtils implements IDebugHostStatus { - public static class ByReference extends WrapIDebugHostStatus implements Structure.ByReference { - } - - public WrapIDebugHostStatus() { - } - - public WrapIDebugHostStatus(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT PollUserInterrupt(BOOLByReference interruptRequested) { - return _invokeHR(VTIndices.POLL_USER_INTERRUPT, getPointer(), interruptRequested); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostSymbol1.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostSymbol1.java deleted file mode 100644 index 7ebafa1bbc..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostSymbol1.java +++ /dev/null @@ -1,42 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinDef.BOOLByReference; -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -public class WrapIDebugHostSymbol1 extends WrapIDebugHostBaseClass implements IDebugHostSymbol1 { - public static class ByReference extends WrapIDebugHostSymbol1 implements Structure.ByReference { - } - - public WrapIDebugHostSymbol1() { - } - - public WrapIDebugHostSymbol1(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT CompareAgainst(Pointer pComparisonSymbol, ULONG comparisonFlags, - BOOLByReference pMatches) { - return _invokeHR(VTIndices1.COMPARE_AGAINST, getPointer(), pComparisonSymbol, - comparisonFlags, pMatches); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostSymbol2.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostSymbol2.java deleted file mode 100644 index 3088702637..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostSymbol2.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.*; -import com.sun.jna.platform.win32.WinDef.ULONG; -import com.sun.jna.platform.win32.WinDef.ULONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -public class WrapIDebugHostSymbol2 extends WrapIDebugHostSymbol1 implements IDebugHostSymbol2 { - public static class ByReference extends WrapIDebugHostSymbol2 implements Structure.ByReference { - } - - public WrapIDebugHostSymbol2() { - } - - public WrapIDebugHostSymbol2(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT EnumerateChildrenEx(ULONG kind, WString name, - com.sun.jna.Structure.ByReference searchInfo, - PointerByReference ppEnum) { - return _invokeHR(VTIndices2.ENUMERATE_CHILDREN_EX, getPointer(), kind, name, searchInfo, - ppEnum); - } - - @Override - public HRESULT GetLanguage(ULONGByReference pKind) { - // TODO Auto-generated method stub - return null; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostSymbolEnumerator.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostSymbolEnumerator.java deleted file mode 100644 index dfb83522ca..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostSymbolEnumerator.java +++ /dev/null @@ -1,48 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIDebugHostSymbolEnumerator extends UnknownWithUtils - implements IDebugHostSymbolEnumerator { - public static class ByReference extends WrapIDebugHostSymbolEnumerator - implements Structure.ByReference { - } - - public WrapIDebugHostSymbolEnumerator() { - } - - public WrapIDebugHostSymbolEnumerator(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT Reset() { - return _invokeHR(VTIndices.RESET, getPointer()); - } - - @Override - public HRESULT GetNext(PointerByReference symbol) { - return _invokeHR(VTIndices.GET_NEXT, getPointer(), symbol); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostSymbols.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostSymbols.java deleted file mode 100644 index 2830d313cc..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostSymbols.java +++ /dev/null @@ -1,83 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.LOCATION; - -public class WrapIDebugHostSymbols extends UnknownWithUtils implements IDebugHostSymbols { - public static class ByReference extends WrapIDebugHostSymbols implements Structure.ByReference { - } - - public WrapIDebugHostSymbols() { - } - - public WrapIDebugHostSymbols(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT CreateModuleSignature(WString pwszModuleName, WString pwszMinVersion, - WString pwszMaxVersion, PointerByReference ppModuleSignature) { - return _invokeHR(VTIndices.CREATE_MODULE_SIGNATURE, getPointer(), pwszModuleName, - pwszMinVersion, pwszMaxVersion, ppModuleSignature); - } - - @Override - public HRESULT CreateTypeSignature(WString signatureSpecification, Pointer module, - PointerByReference typeSignature) { - return _invokeHR(VTIndices.CREATE_TYPE_SIGNATURE, getPointer(), signatureSpecification, - module, typeSignature); - } - - @Override - public HRESULT CreateTypeSignatureForModuleRange(WString signatureSpecification, - WString moduleName, - WString minVersion, WString maxVersion, PointerByReference typeSignature) { - return _invokeHR(VTIndices.CREATE_TYPE_SIGNATURE_FOR_MODULE_RANGE, getPointer(), - signatureSpecification, moduleName, minVersion, maxVersion, typeSignature); - } - - @Override - public HRESULT EnumerateModules(Pointer context, PointerByReference moduleEnum) { - return _invokeHR(VTIndices.ENUMERATE_MODULES, getPointer(), context, moduleEnum); - } - - @Override - public HRESULT FindModuleByName(Pointer context, WString moduleName, - PointerByReference module) { - return _invokeHR(VTIndices.FIND_MODULE_BY_NAME, getPointer(), context, moduleName, module); - } - - @Override - public HRESULT FindModuleByLocation(Pointer context, LOCATION moduleLocation, - PointerByReference module) { - return _invokeHR(VTIndices.FIND_MODULE_BY_LOCATION, getPointer(), context, moduleLocation, - module); - } - - @Override - public HRESULT GetMostDerivedObject(Pointer pContext, LOCATION location, Pointer objectType, - LOCATION.ByReference derivedLocation, PointerByReference derivedType) { - return _invokeHR(VTIndices.GET_MOST_DERIVED_OBJECT, getPointer(), pContext, location, - objectType, derivedLocation, derivedType); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostType1.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostType1.java deleted file mode 100644 index 53a282884f..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostType1.java +++ /dev/null @@ -1,136 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WTypes.VARTYPEByReference; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.ARRAY_DIMENSION; - -public class WrapIDebugHostType1 extends WrapIDebugHostBaseClass implements IDebugHostType1 { - public static class ByReference extends WrapIDebugHostType1 implements Structure.ByReference { - } - - public WrapIDebugHostType1() { - } - - public WrapIDebugHostType1(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT GetTypeKind(ULONGByReference kind) { - return _invokeHR(VTIndices1.GET_TYPE_KIND, getPointer(), kind); - } // TypeKind* - - @Override - public HRESULT GetSize(ULONGLONGByReference size) { - return _invokeHR(VTIndices1.GET_SIZE, getPointer(), size); - } - - @Override - public HRESULT GetBaseType(PointerByReference baseType) { - return _invokeHR(VTIndices1.GET_BASE_TYPE, getPointer(), baseType); - } - - @Override - public HRESULT GetHashCode(ULONGByReference hashCode) { - return _invokeHR(VTIndices1.GET_HASH_CODE, getPointer(), hashCode); - } - - @Override - public HRESULT GetIntrinsicType(ULONGByReference intrinsicKind, - VARTYPEByReference carrierType) { - return _invokeHR(VTIndices1.GET_INTRINSIC_TYPE, getPointer(), intrinsicKind, carrierType); - } - - @Override - public HRESULT GetBitField(ULONGByReference lsbOfField, ULONGByReference lengthOfField) { - return _invokeHR(VTIndices1.GET_BIT_FIELD, getPointer(), lsbOfField, lengthOfField); - } - - @Override - public HRESULT GetPointerKind(ULONGByReference pointerKind) { - return _invokeHR(VTIndices1.GET_POINTER_KIND, getPointer(), pointerKind); - } // PointerKind* - - @Override - public HRESULT GetMemberType(PointerByReference memberType) { - return _invokeHR(VTIndices1.GET_MEMBER_TYPE, getPointer(), memberType); - } - - @Override - public HRESULT CreatePointerTo(ULONG kind, PointerByReference newType) { - return _invokeHR(VTIndices1.CREATE_POINTER_TO, getPointer(), kind, newType); - } // PointerKind - - @Override - public HRESULT GetArrayDimensionality(ULONGLONGByReference arrayDimensionality) { - return _invokeHR(VTIndices1.GET_ARRAY_DIMENSIONALITY, getPointer(), arrayDimensionality); - } - - @Override - public HRESULT GetArrayDimensions(ULONGLONG dimensions, - ARRAY_DIMENSION.ByReference pDimensions) { - return _invokeHR(VTIndices1.GET_ARRAY_DIMENSIONS, getPointer(), dimensions, pDimensions); - } - - @Override - public HRESULT CreateArrayOf(ULONGLONG dimensions, ARRAY_DIMENSION.ByReference pDimensions, - PointerByReference newType) { - return _invokeHR(VTIndices1.CREATE_ARRAY_OF, getPointer(), dimensions, pDimensions, - newType); - } - - @Override - public HRESULT GetFunctionCallingConvention(ULONGByReference conventionKind) { - return _invokeHR(VTIndices1.GET_FUNCTION_CALLING_CONVENTION, getPointer(), conventionKind); - } // ConventionKind* - - @Override - public HRESULT GetFunctionReturnType(PointerByReference returnType) { - return _invokeHR(VTIndices1.GET_FUNCTION_RETURN_TYPE, getPointer(), returnType); - } - - @Override - public HRESULT GetFunctionParameterTypeCount(ULONGByReference count) { - return _invokeHR(VTIndices1.GET_FUNCTION_PARAMETER_TYPE_COUNT, getPointer(), count); - } - - @Override - public HRESULT GetFunctionParameterTypeAt(ULONG i, PointerByReference parameterType) { - return _invokeHR(VTIndices1.GET_FUNCTION_PARAMETER_TYPE_AT, getPointer(), i, parameterType); - } - - @Override - public HRESULT IsGeneric(BOOLByReference isGeneric) { - return _invokeHR(VTIndices1.IS_GENERIC, getPointer(), isGeneric); - } - - @Override - public HRESULT GetGenericArgumentCount(ULONGLONGByReference argCount) { - return _invokeHR(VTIndices1.GET_GENERIC_ARGUMENT_COUNT, getPointer(), argCount); - } - - @Override - public HRESULT GetGenericArgumentAt(ULONG i, PointerByReference argument) { - return _invokeHR(VTIndices1.GET_GENERIC_ARGUMENT_AT, getPointer(), i, argument); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostType2.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostType2.java deleted file mode 100644 index af6511769f..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostType2.java +++ /dev/null @@ -1,62 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinDef.BOOLByReference; -import com.sun.jna.platform.win32.WinDef.ULONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -public class WrapIDebugHostType2 extends WrapIDebugHostType1 implements IDebugHostType2 { - public static class ByReference extends WrapIDebugHostType2 implements Structure.ByReference { - } - - public WrapIDebugHostType2() { - } - - public WrapIDebugHostType2(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT IsTypedef(BOOLByReference isTypedef) { - return _invokeHR(VTIndices2.IS_TYPEDEF, getPointer(), isTypedef); - } - - @Override - public HRESULT GetTypedefBaseType(PointerByReference baseType) { - return _invokeHR(VTIndices2.GET_TYPEDEF_BASE_TYPE, getPointer(), baseType); - } - - @Override - public HRESULT GetTypedefFinalBaseType(PointerByReference finalBaseType) { - return _invokeHR(VTIndices2.GET_TYPEDEF_FINAL_BASE_TYPE, getPointer(), finalBaseType); - } - - @Override - public HRESULT GetFunctionVarArgsKind(ULONGByReference varArgsKind) { - return _invokeHR(VTIndices2.GET_FUNCTION_VARARGS_KIND, getPointer(), varArgsKind); - } // VarArgsKind* - - @Override - public HRESULT GetFunctionInstancePointerType(PointerByReference instancePointerType) { - return _invokeHR(VTIndices2.GET_FUNCTION_INSTANCE_POINTER_TYPE, getPointer(), - instancePointerType); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostTypeSignature.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostTypeSignature.java deleted file mode 100644 index 39053aa532..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/WrapIDebugHostTypeSignature.java +++ /dev/null @@ -1,56 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinDef.BOOLByReference; -import com.sun.jna.platform.win32.WinDef.ULONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIDebugHostTypeSignature extends UnknownWithUtils - implements IDebugHostTypeSignature { - public static class ByReference extends WrapIDebugHostTypeSignature - implements Structure.ByReference { - } - - public WrapIDebugHostTypeSignature() { - } - - public WrapIDebugHostTypeSignature(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT GetHashCode(ULONGByReference hashCode) { - return _invokeHR(VTIndices.GET_HASH_CODE, getPointer(), hashCode); - } - - @Override - public HRESULT IsMatch(Pointer type, BOOLByReference isMatch, - PointerByReference wildcardMatches) { - return _invokeHR(VTIndices.IS_MATCH, getPointer(), type, isMatch, wildcardMatches); - } - - @Override - public HRESULT CompareAgainst(Pointer typeSignature, ULONGByReference result) { - return _invokeHR(VTIndices.COMPARE_AGAINST, getPointer(), typeSignature, result); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/X_IDebugHostBaseClass.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/X_IDebugHostBaseClass.java deleted file mode 100644 index 635e89deb0..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/X_IDebugHostBaseClass.java +++ /dev/null @@ -1,40 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.ULONGLONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface X_IDebugHostBaseClass extends IDebugHostBaseClass { - final IID IID_IDEBUG_HOST_BASE_CLASS = new IID("B94D57D2-390B-40f7-B5B4-B6DB897D974B"); - - enum VTIndicesX implements VTableIndex { - ; - - public int start = VTableIndex.follow(VTIndices.class); - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT GetOffset(ULONGLONGByReference offset); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/X_WrapIDebugHostBaseClass.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/X_WrapIDebugHostBaseClass.java deleted file mode 100644 index bfe0576bcf..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/debughost/X_WrapIDebugHostBaseClass.java +++ /dev/null @@ -1,41 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.debughost; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinDef.ULONGLONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -public class X_WrapIDebugHostBaseClass extends WrapIDebugHostBaseClass - implements X_IDebugHostBaseClass { - public static class ByReference extends X_WrapIDebugHostBaseClass - implements Structure.ByReference { - } - - public X_WrapIDebugHostBaseClass() { - } - - public X_WrapIDebugHostBaseClass(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT GetOffset(ULONGLONGByReference offset) { - return _invokeHR(VTIndices.GET_OFFSET, getPointer(), offset); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/IKeyEnumerator.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/IKeyEnumerator.java deleted file mode 100644 index 765a2e04e4..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/IKeyEnumerator.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.main; - -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WTypes.BSTRByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IKeyEnumerator extends IUnknownEx { - final IID IID_IKEY_ENUMERATOR = new IID("345FA92E-5E00-4319-9CAE-971F7601CDCF"); - - enum VTIndices implements VTableIndex { - RESET, // - GET_NEXT, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT Reset(); - - HRESULT GetNext(BSTRByReference key, PointerByReference value, PointerByReference metadata); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/IKeyStore.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/IKeyStore.java deleted file mode 100644 index 5229d6386a..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/IKeyStore.java +++ /dev/null @@ -1,56 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.main; - -import com.sun.jna.Pointer; -import com.sun.jna.WString; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IKeyStore extends IUnknownEx { - final IID IID_IKEY_STORE = new IID("0FC7557D-401D-4fca-9365-DA1E9850697C"); - - enum VTIndices implements VTableIndex { - GET_KEY, // - SET_KEY, // - GET_KEY_VALUE, // - SET_KEY_VALUE, // - CLEAR_KEYS, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT GetKey(WString key, PointerByReference object, PointerByReference metadata); - - HRESULT SetKey(WString key, Pointer object, Pointer metadata); - - HRESULT GetKeyValue(WString key, PointerByReference object, PointerByReference metadata); - - HRESULT SetKeyValue(WString key, Pointer object); - - HRESULT ClearKeys(); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/IModelIterator.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/IModelIterator.java deleted file mode 100644 index a071dafba9..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/IModelIterator.java +++ /dev/null @@ -1,47 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.main; - -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.ULONGLONG; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IModelIterator extends IUnknownEx { - final IID IID_IMODEL_ITERATOR = new IID("E4622136-927D-4490-874F-581F3E4E3688"); - - enum VTIndices implements VTableIndex { - RESET, // - GET_NEXT, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT Reset(); - - HRESULT GetNext(PointerByReference object, ULONGLONG ulDimensions, PointerByReference indexers, - PointerByReference metadata); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/IModelKeyReference.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/IModelKeyReference.java deleted file mode 100644 index 9db835757b..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/IModelKeyReference.java +++ /dev/null @@ -1,62 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.main; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WTypes.BSTRByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IModelKeyReference extends IUnknownEx { - final IID IID_IMODEL_REFERENCE = new IID("5253DCF8-5AFF-4c62-B302-56A289E00998"); - - enum VTIndices implements VTableIndex { - GET_KEY_NAME, // - GET_ORIGINAL_OBJECT, // - GET_CONTAINING_OBJECT, // - GET_KEY, // - GET_KEY_VALUE, // - SET_KEY, // - SET_KEY_VALUE, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT GetKeyName(BSTRByReference keyName); - - HRESULT GetOriginalObject(PointerByReference originalObject); - - HRESULT GetContextObject(PointerByReference containingObject); - - HRESULT GetKey(PointerByReference object, PointerByReference metadata); - - HRESULT GetKeyValue(PointerByReference object, PointerByReference metadata); - - HRESULT SetKey(Pointer object, Pointer metadata); - - HRESULT SetKeyValue(Pointer object); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/IModelKeyReference2.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/IModelKeyReference2.java deleted file mode 100644 index b393bf51ec..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/IModelKeyReference2.java +++ /dev/null @@ -1,41 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.main; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IModelKeyReference2 extends IModelKeyReference { - final IID IID_IMODEL_REFERENCE2 = new IID("80E2F7C5-7159-4e92-887E-7E0347E88406"); - - enum VTIndices2 implements VTableIndex { - OVERRIDE_CONTEXT_OBJECT, // - ; - - public int start = VTableIndex.follow(VTIndices.class); - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT OverrideContextObject(Pointer newContextObject); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/IModelMethod.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/IModelMethod.java deleted file mode 100644 index 6771d349b7..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/IModelMethod.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.main; - -import com.sun.jna.Pointer; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinDef.ULONGLONG; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IModelMethod extends IUnknownEx { - final IID IID_IMODEL_METHOD = new IID("80600C1F-B90B-4896-82AD-1C00207909E8"); - - enum VTIndices implements VTableIndex { - CALL, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT Call(Pointer pContextObject, ULONGLONG ulArgCount, Pointer[] ppArguments, - PointerByReference ppResult, PointerByReference ppMetadata); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/IModelObject.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/IModelObject.java deleted file mode 100644 index 04a18f3ee5..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/IModelObject.java +++ /dev/null @@ -1,150 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.main; - -import com.sun.jna.Pointer; -import com.sun.jna.WString; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.Guid.REFIID; -import com.sun.jna.platform.win32.Variant.VARIANT; -import com.sun.jna.platform.win32.WTypes.VARTYPE; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.LOCATION; -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.LOCATION.ByReference; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IModelObject extends IUnknownEx { - final IID IID_IMODEL_OBJECT = new IID("E28C7893-3F4B-4b96-BACA-293CDC55F45D"); - - enum VTIndices implements VTableIndex { - GET_CONTEXT, // - GET_KIND, // - GET_INTRINSIC_VALUE, // - GET_INTRINSIC_VALUE_AS, // - GET_KEY_VALUE, // - SET_KEY_VALUE, // - ENUMERATE_KEY_VALUES, // - GET_RAW_VALUE, // - ENUMERATE_RAW_VALUES, // - DEREFERENCE, // - TRY_CAST_TO_RUNTIME_TYPE, // - GET_CONCEPT, // - GET_LOCATION, // - GET_TYPE_INFO, // - GET_TARGET_INFO, // - GET_NUMBER_OF_PARENT_MODELS, // - GET_PARENT_MODEL, // - ADD_PARENT_MODEL, // - REMOVE_PARENT_MODEL, // - GET_KEY, // - GET_KEY_REFERENCE, // - SET_KEY, // - CLEAR_KEYS, // - ENUMERATE_KEYS, // - ENUMERATE_KEY_REFERENCES, // - SET_CONCEPT, // - CLEAR_CONCEPTS, // - GET_RAW_REFERENCE, // - ENUMERATE_RAW_REFERENCES, // - SET_CONTEXT_FOR_DATA_MODEL, // - GET_CONTEXT_FOR_DATA_MODEL, // - COMPARE, // - IS_EQUAL_TO, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT GetContext(PointerByReference context); - - HRESULT GetKind(ULONGByReference kind); - - HRESULT GetIntrinsicValue(VARIANT.ByReference intrinsicData); - - HRESULT GetIntrinsicValueAs(VARTYPE vt, VARIANT.ByReference intrinsicData); - - HRESULT GetKeyValue(WString key, PointerByReference object, PointerByReference metadata); - - HRESULT SetKeyValue(WString key, Pointer object); - - HRESULT EnumerateKeyValues(PointerByReference enumerator); - - HRESULT GetRawValue(ULONG kind, WString name, ULONG searchFlags, PointerByReference object); // SymbolKind - - HRESULT EnumerateRawValues(ULONG kind, ULONG searchFlags, PointerByReference enumerator); // SymbolKind - - HRESULT Dereference(PointerByReference object); - - HRESULT TryCastToRuntimeType(PointerByReference runtimeTypedObject); - - HRESULT GetConcept(REFIID conceptId, PointerByReference conceptInterface, - PointerByReference conceptMetadata); - - HRESULT GetLocation(ByReference pLocation); - - HRESULT GetTypeInfo(PointerByReference type); - - HRESULT GetTargetInfo(LOCATION.ByReference location, PointerByReference type); - - HRESULT GetNumberOfParentModels(ULONGLONGByReference pulNumModels); - - HRESULT GetParentModel(ULONG i, PointerByReference model, PointerByReference contextObject); - - HRESULT AddParentModel(Pointer model, Pointer contextObject, BOOL override); - - HRESULT RemoveParentModel(Pointer model); - - HRESULT GetKey(WString key, PointerByReference object, PointerByReference metadata); - - HRESULT GetKeyReference(WString key, PointerByReference objectReference, - PointerByReference metadata); - - HRESULT SetKey(WString key, Pointer object, Pointer metadata); - - HRESULT ClearKeys(); - - HRESULT EnumerateKeys(PointerByReference enumerator); - - HRESULT EnumerateKeyReferences(PointerByReference enumerator); - - HRESULT SetConcept(REFIID conceptId, Pointer conceptInterface, Pointer conceptMetadata); - - HRESULT ClearConcepts(); - - HRESULT GetRawReference(ULONG kind, WString name, ULONG searchFlags, - PointerByReference object); // SymbolKind - - HRESULT EnumerateRawReferences(ULONGByReference kind, ULONG searchFlags, - PointerByReference enumerator); - - HRESULT SetContextForDataModel(Pointer dataModelObject, Pointer pContext); - - HRESULT GetContextForDataModel(Pointer dataModelObject, PointerByReference context); - - HRESULT Compare(Pointer other, BOOLByReference bEqual); - - HRESULT IsEqualTo(Pointer other, BOOLByReference equal); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/IModelPropertyAccessor.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/IModelPropertyAccessor.java deleted file mode 100644 index 39d5cd6979..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/IModelPropertyAccessor.java +++ /dev/null @@ -1,47 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.main; - -import com.sun.jna.Pointer; -import com.sun.jna.WString; -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IModelPropertyAccessor extends IUnknownEx { - final IID IID_IMODEL_PROPERTY_ACCESSOR = new IID("5A0C63D9-0526-42b8-960C-9516A3254C85"); - - enum VTIndices implements VTableIndex { - GET_VALUE, // - SET_VALUE, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT GetValue(WString key, Pointer contextObject, PointerByReference value); - - HRESULT SetValue(WString key, Pointer contextObject, Pointer pValue); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/IRawEnumerator.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/IRawEnumerator.java deleted file mode 100644 index 68aebe2bb3..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/IRawEnumerator.java +++ /dev/null @@ -1,47 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.main; - -import com.sun.jna.platform.win32.Guid.IID; -import com.sun.jna.platform.win32.WTypes.BSTRByReference; -import com.sun.jna.platform.win32.WinDef.ULONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.IUnknownEx; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils.VTableIndex; - -public interface IRawEnumerator extends IUnknownEx { - final IID IID_IRAW_ENUMERATOR = new IID("E13613F9-3A3C-40b5-8F48-1E5EBFB9B21B"); - - enum VTIndices implements VTableIndex { - RESET, // - GET_NEXT, // - ; - - static int start = 3; - - @Override - public int getIndex() { - return this.ordinal() + start; - } - } - - HRESULT Reset(); - - HRESULT GetNext(BSTRByReference name, ULONGByReference kind, PointerByReference value); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/WrapIKeyEnumerator.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/WrapIKeyEnumerator.java deleted file mode 100644 index a313afc7f4..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/WrapIKeyEnumerator.java +++ /dev/null @@ -1,48 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.main; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WTypes.BSTRByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIKeyEnumerator extends UnknownWithUtils implements IKeyEnumerator { - public static class ByReference extends WrapIKeyEnumerator implements Structure.ByReference { - } - - public WrapIKeyEnumerator() { - } - - public WrapIKeyEnumerator(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT Reset() { - return _invokeHR(VTIndices.RESET, getPointer()); - } - - @Override - public HRESULT GetNext(BSTRByReference key, PointerByReference value, - PointerByReference metadata) { - return _invokeHR(VTIndices.GET_NEXT, getPointer(), key, value, metadata); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/WrapIKeyStore.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/WrapIKeyStore.java deleted file mode 100644 index c524edcfab..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/WrapIKeyStore.java +++ /dev/null @@ -1,61 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.main; - -import com.sun.jna.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIKeyStore extends UnknownWithUtils implements IKeyStore { - public static class ByReference extends WrapIKeyStore implements Structure.ByReference { - } - - public WrapIKeyStore() { - } - - public WrapIKeyStore(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT GetKey(WString key, PointerByReference object, PointerByReference metadata) { - return _invokeHR(VTIndices.GET_KEY, getPointer(), key, object, metadata); - } - - @Override - public HRESULT SetKey(WString key, Pointer object, Pointer metadata) { - return _invokeHR(VTIndices.SET_KEY, getPointer(), key, object, metadata); - } - - @Override - public HRESULT GetKeyValue(WString key, PointerByReference object, - PointerByReference metadata) { - return _invokeHR(VTIndices.GET_KEY_VALUE, getPointer(), key, object, metadata); - } - - @Override - public HRESULT SetKeyValue(WString key, Pointer object) { - return _invokeHR(VTIndices.SET_KEY_VALUE, getPointer(), key, object); - } - - @Override - public HRESULT ClearKeys() { - return _invokeHR(VTIndices.CLEAR_KEYS, getPointer()); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/WrapIModelIterator.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/WrapIModelIterator.java deleted file mode 100644 index a3ffe25e68..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/WrapIModelIterator.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.main; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinDef.ULONGLONG; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIModelIterator extends UnknownWithUtils implements IModelIterator { - public static class ByReference extends WrapIModelIterator implements Structure.ByReference { - } - - public WrapIModelIterator() { - } - - public WrapIModelIterator(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT Reset() { - return _invokeHR(VTIndices.RESET, getPointer()); - } - - @Override - public HRESULT GetNext(PointerByReference object, ULONGLONG dimensions, - PointerByReference indexers, - PointerByReference metadata) { - return _invokeHR(VTIndices.GET_NEXT, getPointer(), object, dimensions, indexers, metadata); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/WrapIModelKeyReference1.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/WrapIModelKeyReference1.java deleted file mode 100644 index 45409c4615..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/WrapIModelKeyReference1.java +++ /dev/null @@ -1,73 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.main; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WTypes.BSTRByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIModelKeyReference1 extends UnknownWithUtils implements IModelKeyReference { - public static class ByReference extends WrapIModelKeyReference1 - implements Structure.ByReference { - } - - public WrapIModelKeyReference1() { - } - - public WrapIModelKeyReference1(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT GetKeyName(BSTRByReference keyName) { - return _invokeHR(VTIndices.GET_KEY_NAME, getPointer(), keyName); - } - - @Override - public HRESULT GetOriginalObject(PointerByReference originalObject) { - return _invokeHR(VTIndices.GET_ORIGINAL_OBJECT, getPointer(), originalObject); - } - - @Override - public HRESULT GetContextObject(PointerByReference containingObject) { - return _invokeHR(VTIndices.GET_CONTAINING_OBJECT, getPointer(), containingObject); - } - - @Override - public HRESULT GetKey(PointerByReference object, PointerByReference metadata) { - return _invokeHR(VTIndices.GET_KEY, getPointer(), object, metadata); - } - - @Override - public HRESULT GetKeyValue(PointerByReference object, PointerByReference metadata) { - return _invokeHR(VTIndices.GET_KEY_VALUE, getPointer(), object, metadata); - } - - @Override - public HRESULT SetKey(Pointer object, Pointer metadata) { - return _invokeHR(VTIndices.SET_KEY, getPointer(), object, object, metadata); - } - - @Override - public HRESULT SetKeyValue(Pointer object) { - return _invokeHR(VTIndices.SET_KEY_VALUE, getPointer(), object); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/WrapIModelKeyReference2.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/WrapIModelKeyReference2.java deleted file mode 100644 index 4d57681a54..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/WrapIModelKeyReference2.java +++ /dev/null @@ -1,40 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.main; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -public class WrapIModelKeyReference2 extends WrapIModelKeyReference1 - implements IModelKeyReference2 { - public static class ByReference extends WrapIModelKeyReference2 - implements Structure.ByReference { - } - - public WrapIModelKeyReference2() { - } - - public WrapIModelKeyReference2(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT OverrideContextObject(Pointer newContextObject) { - return _invokeHR(VTIndices2.OVERRIDE_CONTEXT_OBJECT, getPointer(), newContextObject); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/WrapIModelMethod.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/WrapIModelMethod.java deleted file mode 100644 index c8e2d281ee..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/WrapIModelMethod.java +++ /dev/null @@ -1,44 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.main; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WinDef.ULONGLONG; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIModelMethod extends UnknownWithUtils implements IModelMethod { - public static class ByReference extends WrapIModelMethod implements Structure.ByReference { - } - - public WrapIModelMethod() { - } - - public WrapIModelMethod(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT Call(Pointer pContextObject, ULONGLONG argCount, Pointer[] ppArguments, - PointerByReference ppResult, PointerByReference ppMetadata) { - return _invokeHR(VTIndices.CALL, getPointer(), pContextObject, argCount, ppArguments, - ppResult, ppMetadata); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/WrapIModelObject.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/WrapIModelObject.java deleted file mode 100644 index 455aa99bae..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/WrapIModelObject.java +++ /dev/null @@ -1,220 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.main; - -import com.sun.jna.*; -import com.sun.jna.platform.win32.Guid.REFIID; -import com.sun.jna.platform.win32.Variant.VARIANT; -import com.sun.jna.platform.win32.WTypes.VARTYPE; -import com.sun.jna.platform.win32.WinDef.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.LOCATION; - -public class WrapIModelObject extends UnknownWithUtils implements IModelObject { - public static class ByReference extends WrapIModelObject implements Structure.ByReference { - } - - public WrapIModelObject() { - } - - public WrapIModelObject(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT GetContext(PointerByReference context) { - return _invokeHR(VTIndices.GET_CONTEXT, getPointer(), context); - } - - @Override - public HRESULT GetKind(ULONGByReference kind) { - return _invokeHR(VTIndices.GET_KIND, getPointer(), kind); - } - - @Override - public HRESULT GetIntrinsicValue(VARIANT.ByReference intrinsicData) { - return _invokeHR(VTIndices.GET_INTRINSIC_VALUE, getPointer(), intrinsicData); - } - - @Override - public HRESULT GetIntrinsicValueAs(VARTYPE vt, VARIANT.ByReference intrinsicData) { - return _invokeHR(VTIndices.GET_INTRINSIC_VALUE, getPointer(), vt, intrinsicData); - } - - @Override - public HRESULT GetKeyValue(WString key, PointerByReference object, - PointerByReference metadata) { - return _invokeHR(VTIndices.GET_KEY_VALUE, getPointer(), key, object, metadata); - } - - @Override - public HRESULT SetKeyValue(WString key, Pointer object) { - return _invokeHR(VTIndices.SET_KEY_VALUE, getPointer(), key, object); - } - - @Override - public HRESULT EnumerateKeyValues(PointerByReference enumerator) { - return _invokeHR(VTIndices.ENUMERATE_KEY_VALUES, getPointer(), enumerator); - } - - @Override - public HRESULT GetRawValue(ULONG kind, WString name, ULONG searchFlags, - PointerByReference object) { - return _invokeHR(VTIndices.GET_RAW_VALUE, getPointer(), kind, name, searchFlags, object); - } - - @Override - public HRESULT EnumerateRawValues(ULONG kind, ULONG searchFlags, - PointerByReference enumerator) { - return _invokeHR(VTIndices.ENUMERATE_RAW_VALUES, getPointer(), kind, searchFlags, - enumerator); - } - - @Override - public HRESULT Dereference(PointerByReference object) { - return _invokeHR(VTIndices.DEREFERENCE, getPointer(), object); - } - - @Override - public HRESULT TryCastToRuntimeType(PointerByReference runtimeTypedObject) { - return _invokeHR(VTIndices.TRY_CAST_TO_RUNTIME_TYPE, getPointer(), runtimeTypedObject); - } - - @Override - public HRESULT GetConcept(REFIID conceptId, PointerByReference conceptInterface, - PointerByReference conceptMetadata) { - return _invokeHR(VTIndices.GET_CONCEPT, getPointer(), conceptId, conceptInterface, - conceptMetadata); - } - - @Override - public HRESULT GetLocation(LOCATION.ByReference location) { - return _invokeHR(VTIndices.GET_LOCATION, getPointer(), location); - } - - @Override - public HRESULT GetTypeInfo(PointerByReference type) { - return _invokeHR(VTIndices.GET_TYPE_INFO, getPointer(), type); - } - - @Override - public HRESULT GetTargetInfo(LOCATION.ByReference location, PointerByReference type) { - return _invokeHR(VTIndices.GET_TARGET_INFO, getPointer(), location, type); - } - - @Override - public HRESULT GetNumberOfParentModels(ULONGLONGByReference numModels) { - return _invokeHR(VTIndices.GET_NUMBER_OF_PARENT_MODELS, getPointer(), numModels); - } - - @Override - public HRESULT GetParentModel(ULONG i, PointerByReference model, - PointerByReference contextObject) { - return _invokeHR(VTIndices.GET_PARENT_MODEL, getPointer(), i, model, contextObject); - } - - @Override - public HRESULT AddParentModel(Pointer model, Pointer contextObject, BOOL override) { - return _invokeHR(VTIndices.ADD_PARENT_MODEL, getPointer(), model, contextObject, override); - } - - @Override - public HRESULT RemoveParentModel(Pointer model) { - return _invokeHR(VTIndices.REMOVE_PARENT_MODEL, getPointer(), model); - } - - @Override - public HRESULT GetKey(WString key, PointerByReference object, PointerByReference metadata) { - return _invokeHR(VTIndices.GET_KEY, getPointer(), key, object, metadata); - } - - @Override - public HRESULT GetKeyReference(WString key, PointerByReference objectReference, - PointerByReference metadata) { - return _invokeHR(VTIndices.GET_KEY_REFERENCE, getPointer(), key, objectReference, metadata); - } - - @Override - public HRESULT SetKey(WString key, Pointer object, Pointer metadata) { - return _invokeHR(VTIndices.SET_KEY, getPointer(), key, object, metadata); - } - - @Override - public HRESULT ClearKeys() { - return _invokeHR(VTIndices.CLEAR_KEYS, getPointer()); - } - - @Override - public HRESULT EnumerateKeys(PointerByReference enumerator) { - return _invokeHR(VTIndices.ENUMERATE_KEYS, getPointer(), enumerator); - } - - @Override - public HRESULT EnumerateKeyReferences(PointerByReference enumerator) { - return _invokeHR(VTIndices.ENUMERATE_KEY_REFERENCES, getPointer(), enumerator); - } - - @Override - public HRESULT SetConcept(REFIID conceptId, Pointer conceptInterface, Pointer conceptMetadata) { - return _invokeHR(VTIndices.SET_CONCEPT, getPointer(), conceptId, conceptInterface, - conceptMetadata); - } - - @Override - public HRESULT ClearConcepts() { - return _invokeHR(VTIndices.CLEAR_CONCEPTS, getPointer()); - } - - @Override - public HRESULT GetRawReference(ULONG kind, WString name, ULONG searchFlags, - PointerByReference object) { - return _invokeHR(VTIndices.GET_RAW_REFERENCE, getPointer(), kind, name, searchFlags, - object); - } - - @Override - public HRESULT EnumerateRawReferences(ULONGByReference kind, ULONG searchFlags, - PointerByReference enumerator) { - return _invokeHR(VTIndices.ENUMERATE_RAW_REFERENCES, getPointer(), kind, searchFlags, - enumerator); - } - - @Override - public HRESULT SetContextForDataModel(Pointer dataModelObject, Pointer context) { - return _invokeHR(VTIndices.SET_CONTEXT_FOR_DATA_MODEL, getPointer(), dataModelObject, - context); - } - - @Override - public HRESULT GetContextForDataModel(Pointer dataModelObject, PointerByReference context) { - return _invokeHR(VTIndices.GET_CONTEXT_FOR_DATA_MODEL, getPointer(), dataModelObject, - context); - } - - @Override - public HRESULT Compare(Pointer other, BOOLByReference ppResult) { - return _invokeHR(VTIndices.COMPARE, getPointer(), other, ppResult); - } - - @Override - public HRESULT IsEqualTo(Pointer other, BOOLByReference equal) { - return _invokeHR(VTIndices.IS_EQUAL_TO, getPointer(), other, equal); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/WrapIModelPropertyAccessor.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/WrapIModelPropertyAccessor.java deleted file mode 100644 index cee541f160..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/WrapIModelPropertyAccessor.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.main; - -import com.sun.jna.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIModelPropertyAccessor extends UnknownWithUtils implements IModelPropertyAccessor { - public static class ByReference extends WrapIModelPropertyAccessor - implements Structure.ByReference { - } - - public WrapIModelPropertyAccessor() { - } - - public WrapIModelPropertyAccessor(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT GetValue(WString key, Pointer contextObject, PointerByReference value) { - return _invokeHR(VTIndices.GET_VALUE, getPointer(), key, contextObject, value); - } - - @Override - public HRESULT SetValue(WString key, Pointer contextObject, Pointer value) { - return _invokeHR(VTIndices.SET_VALUE, getPointer(), key, contextObject, value); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/WrapIRawEnumerator.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/WrapIRawEnumerator.java deleted file mode 100644 index 7ba3c77dc9..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/dbgmodel/main/WrapIRawEnumerator.java +++ /dev/null @@ -1,48 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.dbgmodel.main; - -import com.sun.jna.Pointer; -import com.sun.jna.Structure; -import com.sun.jna.platform.win32.WTypes.BSTRByReference; -import com.sun.jna.platform.win32.WinDef.ULONGByReference; -import com.sun.jna.platform.win32.WinNT.HRESULT; -import com.sun.jna.ptr.PointerByReference; - -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; - -public class WrapIRawEnumerator extends UnknownWithUtils implements IRawEnumerator { - public static class ByReference extends WrapIRawEnumerator implements Structure.ByReference { - } - - public WrapIRawEnumerator() { - } - - public WrapIRawEnumerator(Pointer pvInstance) { - super(pvInstance); - } - - @Override - public HRESULT Reset() { - return _invokeHR(VTIndices.RESET, getPointer()); - } - - @Override - public HRESULT GetNext(BSTRByReference name, ULONGByReference kind, PointerByReference value) { - return _invokeHR(VTIndices.GET_NEXT, getPointer(), name, kind, value); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/javaprovider/JavaProviderNative.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/javaprovider/JavaProviderNative.java deleted file mode 100644 index 25f551e58e..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/jna/javaprovider/JavaProviderNative.java +++ /dev/null @@ -1,25 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.jna.javaprovider; - -import com.sun.jna.*; -import com.sun.jna.platform.win32.WinNT.HRESULT; - -public interface JavaProviderNative extends Library { - JavaProviderNative INSTANCE = Native.loadLibrary("javaprovider", JavaProviderNative.class); - - HRESULT createClient(Pointer client); -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/manager/DbgManager2Impl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/manager/DbgManager2Impl.java deleted file mode 100644 index dbe4df879e..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/manager/DbgManager2Impl.java +++ /dev/null @@ -1,138 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.manager; - -import static ghidra.async.AsyncUtils.*; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.atomic.AtomicReference; - -import agent.dbgeng.dbgeng.DebugClient; -import agent.dbgeng.manager.DbgCause.Causes; -import agent.dbgeng.manager.DbgState; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgmodel.dbgmodel.DbgModel; -import agent.dbgmodel.gadp.impl.DbgModelClientThreadExecutor; -import agent.dbgmodel.gadp.impl.WrappedDbgModel; -import agent.dbgmodel.jna.cmd.*; -import agent.dbgmodel.model.impl.DbgModel2TargetObjectImpl; -import ghidra.async.TypeSpec; -import ghidra.dbg.target.TargetObject; -import ghidra.util.Msg; - -public class DbgManager2Impl extends DbgManagerImpl { - - private DebugClient client; - private WrappedDbgModel dbgmodel; - - /** - * Instantiate a new manager - */ - public DbgManager2Impl() { - super(); - } - - public WrappedDbgModel getAccess() { - return dbgmodel; - } - - @Override - public DebugClient getClient() { - return client; - } - - @Override - public CompletableFuture start(String[] args) { - state.set(DbgState.STARTING, Causes.UNCLAIMED); - boolean create = true; - if (args.length == 0) { - engThread = new DbgModelClientThreadExecutor(() -> DbgModel.debugCreate()); - } - else { - String remoteOptions = String.join(" ", args); - engThread = - new DbgModelClientThreadExecutor(() -> DbgModel.debugConnect(remoteOptions)); - create = false; - } - engThread.setManager(this); - AtomicReference creat = new AtomicReference<>(create); - return sequence(TypeSpec.VOID).then(engThread, (seq) -> { - doExecute(creat.get()); - seq.exit(); - }).finish().exceptionally((exc) -> { - Msg.error(this, "start failed"); - return null; - }); - } - - @Override - protected void doExecute(Boolean create) { - dbgmodel = ((DbgModelClientThreadExecutor) engThread).getAccess(); - reentrantClient = dbgmodel.getClient(); - client = super.getClient(); - super.doExecute(create); - } - - public CompletableFuture> listElements(List path, - DbgModel2TargetObjectImpl targetObject) { - return execute(new DbgListElementsCommand(this, path, targetObject)); - } - - public CompletableFuture> listAttributes(List path, - DbgModel2TargetObjectImpl targetObject) { - return execute(new DbgListAttributesCommand(this, path, targetObject)); - } - - public CompletableFuture applyMethods(List path, - DbgModel2TargetObjectImpl targetObject) { - return execute(new DbgApplyMethodsCommand(this, path, targetObject)); - } - - public CompletableFuture> getRegisterMap(List path) { - return execute(new DbgGetRegisterMapCommand(this, path)); - } - - /* - @Override - public DbgSessionImpl getCurrentSession() { - ModelObject currentSession = dbgmodel.getUtil().getCurrentSession(); - ModelObject keyValue = currentSession.getKeyValue("Id"); - Object val = keyValue.getValue(); - DebugSessionId sid = new DebugSessionId((Integer) val); - curSession = getSessionComputeIfAbsent(sid); - return curSession; - } - - @Override - public DbgProcessImpl getCurrentProcess() { - synchronized (processes) { - DebugProcessId id = getSystemObjects().getCurrentProcessId(); - return processes.get(id); - } - } - - @Override - public DbgThreadImpl getCurrentThread() { - synchronized (threads) { - DebugThreadId id = getSystemObjects().getCurrentThreadId(); - return threads.get(id); - } - } - */ - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/model/impl/DbgModel2DefaultTargetModelRoot.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/model/impl/DbgModel2DefaultTargetModelRoot.java deleted file mode 100644 index eddbf88c26..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/model/impl/DbgModel2DefaultTargetModelRoot.java +++ /dev/null @@ -1,32 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.model.impl; - -import ghidra.dbg.target.TargetAggregate; -import ghidra.dbg.target.schema.TargetObjectSchema; - -public class DbgModel2DefaultTargetModelRoot extends DbgModel2TargetObjectImpl - implements TargetAggregate { - - public DbgModel2DefaultTargetModelRoot(DbgModel2Impl model, String typeHint) { - super(model, null, null, typeHint); - } - - public DbgModel2DefaultTargetModelRoot(DbgModel2Impl model, String typeHint, - TargetObjectSchema schema) { - super(model, null, null, typeHint, schema); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/model/impl/DbgModel2Impl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/model/impl/DbgModel2Impl.java deleted file mode 100644 index add4f98515..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/model/impl/DbgModel2Impl.java +++ /dev/null @@ -1,211 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.model.impl; - -import java.io.IOException; -import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.RejectedExecutionException; - -import org.apache.commons.lang3.exception.ExceptionUtils; -import org.jdom.JDOMException; - -import agent.dbgeng.manager.impl.*; -import agent.dbgeng.model.AbstractDbgModel; -import agent.dbgeng.model.iface2.DbgModelTargetObject; -import agent.dbgeng.model.iface2.DbgModelTargetSession; -import agent.dbgmodel.manager.DbgManager2Impl; -import ghidra.async.AsyncUtils; -import ghidra.dbg.DebuggerModelClosedReason; -import ghidra.dbg.agent.AbstractTargetObject; -import ghidra.dbg.agent.AbstractTargetObject.ProxyFactory; -import ghidra.dbg.agent.SpiTargetObject; -import ghidra.dbg.error.DebuggerModelTerminatingException; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.TargetObjectSchema; -import ghidra.dbg.target.schema.XmlSchemaContext; -import ghidra.program.model.address.*; -import ghidra.util.Msg; -import utilities.util.ProxyUtilities; - -public class DbgModel2Impl extends AbstractDbgModel - implements ProxyFactory>> { - // TODO: Need some minimal memory modeling per architecture on the model/agent side. - // The model must convert to and from Ghidra's address space names - protected static final String SPACE_NAME = "ram"; - - public static final XmlSchemaContext SCHEMA_CTX; - public static final TargetObjectSchema ROOT_SCHEMA; - static { - try { - //SCHEMA_CTX = - // XmlSchemaContext.deserialize(ResourceManager.getResourceAsStream("dbgmodel.xml")); - SCHEMA_CTX = XmlSchemaContext - .deserialize(DbgModel2Impl.class.getResourceAsStream("dbgmodel_schema.xml")); - ROOT_SCHEMA = SCHEMA_CTX.getSchema(SCHEMA_CTX.name("Debugger")); - } - catch (IOException | JDOMException e) { - throw new AssertionError(e); - } - } - - // Don't make this static, so each model has a unique "ram" space - protected final AddressSpace space = - new GenericAddressSpace(SPACE_NAME, 64, AddressSpace.TYPE_RAM, 0); - protected final AddressFactory addressFactory = - new DefaultAddressFactory(new AddressSpace[] { space }); - - protected final DbgManager2Impl dbg; - protected DbgModelTargetSession session; - - protected Map objectMap = new HashMap<>(); - private boolean suppressDescent = false; - - public DbgModel2Impl() { - this.dbg = new DbgManager2Impl(); - //System.out.println(XmlSchemaContext.serialize(SCHEMA_CTX)); - this.root = new DbgModel2TargetRootImpl(this, ROOT_SCHEMA); - this.completedRoot = CompletableFuture.completedFuture(root); - addModelRoot(root); - } - - @Override - public SpiTargetObject createProxy(AbstractTargetObject delegate, - List> mixins) { - mixins.add(DbgModel2TargetProxy.class); - return ProxyUtilities.composeOnDelegate(DbgModelTargetObject.class, - (DbgModelTargetObject) delegate, mixins, DelegateDbgModel2TargetObject.LOOKUP); - } - - @Override - public String getBrief() { - return "DBGMODEL@" + Integer.toHexString(System.identityHashCode(this)); - } - - @Override - public AddressSpace getAddressSpace(String name) { - if (!SPACE_NAME.equals(name)) { - return null; - } - return space; - } - - // TODO: Place make this a model method? - @Override - public AddressFactory getAddressFactory() { - return addressFactory; - } - - @Override - public CompletableFuture startDbgEng(String[] args) { - return dbg.start(args).thenApplyAsync(__ -> null, clientExecutor); - } - - @Override - public boolean isRunning() { - return dbg.isRunning(); - } - - @Override - public void terminate() throws IOException { - broadcast().modelClosed(DebuggerModelClosedReason.NORMAL); - root.invalidateSubtree(root, "Dbgmodel is terminating"); - dbg.terminate(); - } - - @Override - public TargetObjectSchema getRootSchema() { - return root.getSchema(); - } - - @Override - public CompletableFuture fetchModelRoot() { - return completedRoot; - } - - @Override - public DbgManagerImpl getManager() { - return dbg; - } - - @Override - public CompletableFuture close() { - try { - terminate(); - return super.close(); - } - catch (RejectedExecutionException e) { - reportError(this, "Model is already closing", e); - return AsyncUtils.nil(); - } - catch (Throwable t) { - return CompletableFuture.failedFuture(t); - } - } - - @Override - public DbgModelTargetSession getSession() { - return session; - } - - @Override - public void addModelObject(Object object, TargetObject modelObject) { - if (modelObject == null) { - Msg.error(this, "Attempt to add null for key: " + object); - return; - } - objectMap.put(object, modelObject); - if (object instanceof DbgProcessImpl) { - DbgProcessImpl impl = (DbgProcessImpl) object; - objectMap.put(impl.getId(), modelObject); - } - if (object instanceof DbgThreadImpl) { - DbgThreadImpl impl = (DbgThreadImpl) object; - objectMap.put(impl.getId(), modelObject); - } - } - - @Override - public TargetObject getModelObject(Object object) { - return objectMap.get(object); - } - - @Override - public void deleteModelObject(Object object) { - objectMap.remove(object); - } - - @Override - public CompletableFuture gateFuture(CompletableFuture future) { - return super.gateFuture(future).exceptionally(ex -> { - for (Throwable cause = ex; cause != null; cause = cause.getCause()) { - if (cause instanceof RejectedExecutionException) { - throw new DebuggerModelTerminatingException("dbgeng is terminating", ex); - } - } - return ExceptionUtils.rethrow(ex); - }); - } - - @Override - public boolean isSuppressDescent() { - return suppressDescent; - } - - public void setSuppressDescent(boolean suppressDescent) { - this.suppressDescent = suppressDescent; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/model/impl/DbgModel2TargetAvailableContainerImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/model/impl/DbgModel2TargetAvailableContainerImpl.java deleted file mode 100644 index a98e58222a..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/model/impl/DbgModel2TargetAvailableContainerImpl.java +++ /dev/null @@ -1,69 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.model.impl; - -import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import org.apache.commons.lang3.tuple.Pair; - -import agent.dbgeng.model.iface2.*; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.TargetObject; -import ghidra.util.datastruct.WeakValueHashMap; - -public class DbgModel2TargetAvailableContainerImpl extends DbgModel2TargetObjectImpl - implements DbgModelTargetAvailableContainer { - - protected final Map attachablesById = - new WeakValueHashMap<>(); - - public DbgModel2TargetAvailableContainerImpl(DbgModelTargetObject obj) { - super(obj.getModel(), obj, "Available", "AvailableContainer"); - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - return getManager().listAvailableProcesses().thenAccept(list -> { - List available; - synchronized (this) { - // NOTE: If more details added to entries, should clear attachablesById - available = - list.stream().map(this::getTargetAttachableEx).collect(Collectors.toList()); - } - setElements(available, Map.of(), "Refreshed"); - }); - } - - @Override - public CompletableFuture requestAttributes(RefreshBehavior refresh) { - Map nmap = new HashMap<>(); - return addModelObjectAttributes(nmap); - } - - public synchronized DbgModelTargetAvailable getTargetAttachableEx(Pair pair) { - return attachablesById.computeIfAbsent(pair.getLeft(), - i -> new DbgModel2TargetAvailableImpl(this, pair.getLeft(), pair.getRight())); - } - - @Override - public synchronized DbgModelTargetAvailable getTargetAttachable(int pid) { - return attachablesById.computeIfAbsent(pid, - i -> new DbgModel2TargetAvailableImpl(this, pid)); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/model/impl/DbgModel2TargetAvailableImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/model/impl/DbgModel2TargetAvailableImpl.java deleted file mode 100644 index 7a192cf43b..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/model/impl/DbgModel2TargetAvailableImpl.java +++ /dev/null @@ -1,74 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.model.impl; - -import java.util.List; -import java.util.Map; - -import agent.dbgeng.model.iface2.DbgModelTargetAvailable; -import agent.dbgeng.model.iface2.DbgModelTargetAvailableContainer; -import ghidra.dbg.util.PathUtils; - -public class DbgModel2TargetAvailableImpl extends DbgModel2TargetObjectImpl - implements DbgModelTargetAvailable { - - protected static final String PID_ATTRIBUTE_NAME = PREFIX_INVISIBLE + "pid"; - // TODO: DESCRIPTION, TYPE, USER? - - protected static String indexAttachable(int pid) { - return Integer.toHexString(pid); - } - - protected static String keyAttachable(int pid) { - return PathUtils.makeKey(indexAttachable(pid)); - } - - protected final int pid; - private String name; - - public DbgModel2TargetAvailableImpl(DbgModelTargetAvailableContainer parent, int pid, - String name) { - super(parent.getModel(), parent, keyAttachable(pid), name); - this.pid = pid; - this.name = name; - - this.changeAttributes(List.of(), List.of(), Map.of(// - PID_ATTRIBUTE_NAME, (long) pid, // - DISPLAY_ATTRIBUTE_NAME, keyAttachable(pid) + " : " + name.trim() // - ), "Initialized"); - } - - public DbgModel2TargetAvailableImpl(DbgModelTargetAvailableContainer parent, int pid) { - super(parent.getModel(), parent, keyAttachable(pid), "Attachable"); - this.pid = pid; - - this.changeAttributes(List.of(), List.of(), Map.of(// - PID_ATTRIBUTE_NAME, (long) pid, // - DISPLAY_ATTRIBUTE_NAME, keyAttachable(pid) // - ), "Initialized"); - } - - @Override - public long getPid() { - return pid; - } - - @Override - public void setBase(Object value) { - // Nothing for now - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/model/impl/DbgModel2TargetObjectImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/model/impl/DbgModel2TargetObjectImpl.java deleted file mode 100644 index db31a66407..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/model/impl/DbgModel2TargetObjectImpl.java +++ /dev/null @@ -1,592 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.model.impl; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.TreeMap; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import agent.dbgeng.manager.*; -import agent.dbgeng.manager.breakpoint.DbgBreakpointInfo; -import agent.dbgeng.model.AbstractDbgModel; -import agent.dbgeng.model.iface1.DbgModelSelectableObject; -import agent.dbgeng.model.iface2.DbgModelTargetBreakpointSpec; -import agent.dbgeng.model.iface2.DbgModelTargetDebugContainer; -import agent.dbgeng.model.iface2.DbgModelTargetEventContainer; -import agent.dbgeng.model.iface2.DbgModelTargetExceptionContainer; -import agent.dbgeng.model.iface2.DbgModelTargetMemoryContainer; -import agent.dbgeng.model.iface2.DbgModelTargetModule; -import agent.dbgeng.model.iface2.DbgModelTargetObject; -import agent.dbgeng.model.iface2.DbgModelTargetProcess; -import agent.dbgeng.model.iface2.DbgModelTargetSession; -import agent.dbgeng.model.iface2.DbgModelTargetStackFrame; -import agent.dbgeng.model.iface2.DbgModelTargetTTD; -import agent.dbgeng.model.iface2.DbgModelTargetThread; -import agent.dbgeng.model.impl.DbgModelTargetEventContainerImpl; -import agent.dbgeng.model.impl.DbgModelTargetExceptionContainerImpl; -import agent.dbgeng.model.impl.DbgModelTargetMemoryContainerImpl; -import agent.dbgeng.model.impl.DbgModelTargetProcessImpl; -import agent.dbgeng.model.impl.DbgModelTargetThreadImpl; -import agent.dbgmodel.dbgmodel.main.ModelObject; -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.ModelObjectKind; -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.TypeKind; -import agent.dbgmodel.manager.DbgManager2Impl; -import ghidra.async.AsyncUtils; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.agent.DefaultTargetObject; -import ghidra.dbg.target.TargetAccessConditioned; -import ghidra.dbg.target.TargetAttacher; -import ghidra.dbg.target.TargetBreakpointSpec; -import ghidra.dbg.target.TargetBreakpointSpec.TargetBreakpointKind; -import ghidra.dbg.target.TargetBreakpointSpecContainer; -import ghidra.dbg.target.TargetBreakpointSpecContainer.TargetBreakpointKindSet; -import ghidra.dbg.target.TargetEnvironment; -import ghidra.dbg.target.TargetExecutionStateful; -import ghidra.dbg.target.TargetExecutionStateful.TargetExecutionState; -import ghidra.dbg.target.TargetInterpreter; -import ghidra.dbg.target.TargetModule; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.TargetProcess; -import ghidra.dbg.target.TargetRegister; -import ghidra.dbg.target.TargetRegisterBank; -import ghidra.dbg.target.TargetStackFrame; -import ghidra.dbg.target.TargetSteppable; -import ghidra.dbg.target.TargetThread; -import ghidra.dbg.target.schema.TargetObjectSchema; -import ghidra.dbg.util.PathUtils; -import ghidra.dbg.util.PathUtils.TargetObjectKeyComparator; -import ghidra.util.Msg; -import ghidra.util.datastruct.WeakValueHashMap; - -public class DbgModel2TargetObjectImpl extends DefaultTargetObject - implements DbgModelTargetObject { - - protected final Map elementsByKey = new WeakValueHashMap<>(); - - protected DbgModelSelectableObject focus; - public boolean accessible = true; - - private ModelObject modelObject = null; - protected Map intrinsics = new TreeMap<>(TargetObjectKeyComparator.ATTRIBUTE); - - protected String bptId; - protected static Map bptInfoMap = new HashMap<>(); - - protected String DBG_PROMPT = "(kd2)"; // Used by DbgModelTargetEnvironment - - protected static String indexObject(ModelObject obj) { - return obj.getSearchKey(); - } - - public static String keyObject(ModelObject obj) { - return PathUtils.makeKey(indexObject(obj)); - } - - protected static String getHintForObject(ModelObject obj) { - TypeKind typeKind = obj.getTypeKind(); - return typeKind == null ? "" : typeKind.name(); - } - - public DbgModel2TargetObjectImpl(AbstractDbgModel model, TargetObject parent, String name, - String typeHint) { - super(model, parent, name, typeHint); - } - - public DbgModel2TargetObjectImpl(AbstractDbgModel model, TargetObject parent, String name, - String typeHint, TargetObjectSchema schema) { - super(model, parent, name, typeHint, schema); - } - - public DbgModel2TargetObjectImpl(ProxyFactory proxyFactory, I proxyInfo, - AbstractDbgModel model, TargetObject parent, String name, String typeHint) { - super(proxyFactory, proxyInfo, model, parent, name, typeHint); - } - - @Override - public DbgModel2Impl getModel() { - return (DbgModel2Impl) super.getModel(); - } - - @Override - public CompletableFuture> requestNativeElements() { - DbgManager2Impl manager2 = (DbgManager2Impl) getManager(); - List pathX = PathUtils.extend(List.of("Debugger"), path); - return manager2.listElements(pathX, this); - } - - @Override - public CompletableFuture> requestNativeAttributes() { - DbgManager2Impl manager2 = (DbgManager2Impl) getManager(); - List pathX = PathUtils.extend(List.of("Debugger"), path); - return manager2.listAttributes(pathX, this); - } - - @Override - public CompletableFuture requestAugmentedAttributes() { - return requestAttributes(RefreshBehavior.REFRESH_NEVER); - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - List nlist = new ArrayList<>(); - List rlist = new ArrayList<>(); - return requestNativeElements().thenCompose(list -> { - synchronized (elements) { - for (Entry entry : elements.entrySet()) { - TargetObject element = entry.getValue(); - if (!list.contains(element)) { - if (element instanceof DbgStateListener) { - getManager().removeStateListener((DbgStateListener) element); - } - if (element instanceof DbgEventsListener) { - getManager().removeEventsListener((DbgEventsListener) element); - } - rlist.add(entry.getKey()); - } - } - nlist.addAll(list); - return AsyncUtils.nil(); - //return processModelObjectElements(nlist); - } - }).thenAccept(__ -> { - changeElements(rlist, nlist, Map.of(), "Refreshed"); - }); - } - - protected boolean isReallyValid() { - //synchronized (model.lock) { - //System.out.println("checking validity: " + getJoinedPath(".") + "," + - // this.getDelegate().getClass()); - for (TargetObject p = this; p != null; p = p.getParent()) { - //System.out.print(" ."); - if (!p.isValid()) { - //System.out.println("x"); - return false; - } - } - //System.out.println("_"); - //} - return true; - } - - @Override - public CompletableFuture requestAttributes(RefreshBehavior refresh) { - Map nmap = new HashMap<>(); - List rlist = new ArrayList<>(); - return requestNativeAttributes().thenCompose(map -> { - synchronized (attributes) { - if (map != null) { - Collection values = map.values(); - for (Entry entry : attributes.entrySet()) { - Object attribute = entry.getValue(); - if (!values.contains(attribute)) { - if (attribute instanceof DbgStateListener) { - getManager().removeStateListener((DbgStateListener) attribute); - } - if (attribute instanceof DbgEventsListener) { - getManager().removeEventsListener((DbgEventsListener) attribute); - } - rlist.add(entry.getKey()); - } - } - nmap.putAll(map); - } - return addModelObjectAttributes(nmap); - } - }).thenAccept(__ -> { - // Meh - if (!isReallyValid()) { - return; - } - changeAttributes(List.of(), nmap, "Refreshed"); - }); - } - - protected CompletableFuture processModelObjectElements(List list) { - List> futures = - list.stream().map(to -> processElement(to)).collect(Collectors.toList()); - CompletableFuture allOf = - CompletableFuture.allOf(futures.toArray(new CompletableFuture[futures.size()])); - return allOf; - } - - private CompletableFuture processElement(TargetObject targetObject) { - if (targetObject instanceof DbgModelTargetObject) { - DbgModel2TargetProxy proxy = (DbgModel2TargetProxy) targetObject; - DelegateDbgModel2TargetObject delegate = proxy.getDelegate(); - if (proxy instanceof TargetStackFrame || // - proxy instanceof TargetModule || // - proxy instanceof TargetBreakpointSpec) { - return delegate.requestAttributes(RefreshBehavior.REFRESH_NEVER); - } - } - return CompletableFuture.completedFuture(null); - } - - protected CompletableFuture addModelObjectAttributes(Map attrs) { - if (modelObject == null || !valid) { - return CompletableFuture.completedFuture(null); - } - String key = modelObject.getSearchKey(); - ModelObjectKind kind = modelObject.getKind(); - TypeKind tk = modelObject.getTypeKind(); - String value = modelObject.getValueString(); - - attrs.put(DISPLAY_ATTRIBUTE_NAME, key); - if (kind != null) { - attrs.put(KIND_ATTRIBUTE_NAME, kind.toString()); - } - if (tk != null) { - attrs.put(TYPE_ATTRIBUTE_NAME, tk.toString()); - } - if (value != null && !value.equals("")) { - attrs.put(VALUE_ATTRIBUTE_NAME, value); - if (!Objects.equals(kind, ModelObjectKind.OBJECT_PROPERTY_ACCESSOR)) { - synchronized (attributes) { - String oldval = (String) attributes.get(DISPLAY_ATTRIBUTE_NAME); - String newval = getName() + " : " + value; - attrs.put(DISPLAY_ATTRIBUTE_NAME, newval); - setModified(attrs, !newval.equals(oldval)); - } - } - if (tk == null) { - Object val = modelObject.getIntrinsicValue(); - if (val != null) { - attrs.put(TYPE_ATTRIBUTE_NAME, val.getClass().getSimpleName()); - } - } - } - if (this instanceof DelegateDbgModel2TargetObject) { - DelegateDbgModel2TargetObject delegate = (DelegateDbgModel2TargetObject) this; - TargetObject proxy = delegate.getProxy(); - if (proxy instanceof TargetAccessConditioned) { - attrs.put(TargetAccessConditioned.ACCESSIBLE_ATTRIBUTE_NAME, accessible); - } - if (proxy instanceof TargetExecutionStateful) { - if (isValid()) { - TargetExecutionStateful stateful = (TargetExecutionStateful) proxy; - TargetExecutionState state = stateful.getExecutionState(); - attrs.put(TargetExecutionStateful.STATE_ATTRIBUTE_NAME, state); - } - } - if (proxy instanceof TargetAttacher) { - attrs.put(TargetAttacher.SUPPORTED_ATTACH_KINDS_ATTRIBUTE_NAME, - DbgModelTargetProcessImpl.SUPPORTED_KINDS); - } - if (proxy instanceof TargetSteppable) { - attrs.put(TargetSteppable.SUPPORTED_STEP_KINDS_ATTRIBUTE_NAME, - DbgModelTargetThreadImpl.SUPPORTED_KINDS); - } - if (proxy instanceof TargetInterpreter) { - attrs.put(TargetInterpreter.PROMPT_ATTRIBUTE_NAME, DBG_PROMPT); - } - if (proxy instanceof TargetBreakpointSpecContainer) { - attrs.put(TargetBreakpointSpecContainer.SUPPORTED_BREAK_KINDS_ATTRIBUTE_NAME, - TargetBreakpointKindSet.of(TargetBreakpointKind.values())); - } - if (proxy instanceof TargetBreakpointSpec) { - DbgModelTargetBreakpointSpec spec = (DbgModelTargetBreakpointSpec) proxy; - return spec.init(attrs); - } - if (proxy instanceof TargetEnvironment) { - attrs.put(TargetEnvironment.ARCH_ATTRIBUTE_NAME, "x86_64"); - attrs.put(TargetEnvironment.DEBUGGER_ATTRIBUTE_NAME, "dbgeng"); - attrs.put(TargetEnvironment.OS_ATTRIBUTE_NAME, "Windows"); - attrs.put(TargetEnvironment.ENDIAN_ATTRIBUTE_NAME, "little"); - } - if (proxy instanceof TargetModule) { - //attrs.put(TargetObject.ORDER_ATTRIBUTE_NAME, - // Integer.decode(modelObject.getOriginalKey())); - DbgModelTargetModule module = (DbgModelTargetModule) proxy; - return module.init(attrs); - } - if (proxy instanceof TargetProcess) { - DbgModelTargetMemoryContainer memory; - if (attributes.containsKey("Memory")) { - memory = (DbgModelTargetMemoryContainer) attributes.get("Memory"); - } - else { - memory = new DbgModelTargetMemoryContainerImpl((DbgModelTargetProcess) proxy); - } - attrs.put(memory.getName(), memory); - memory.requestElements(RefreshBehavior.REFRESH_ALWAYS); - } - if (proxy instanceof TargetThread) { - DbgModelTargetThread targetThread = (DbgModelTargetThread) proxy; - DbgThread thread = targetThread.getThread(); - if (thread != null) { - String executionType = - thread.getExecutingProcessorType().description; - attrs.put(TargetEnvironment.ARCH_ATTRIBUTE_NAME, executionType); - } - } - if (proxy instanceof TargetRegister) { - DbgModelTargetObject bank = (DbgModelTargetObject) getParent(); - TargetObject container = bank.getParent(); - attrs.put(TargetRegister.CONTAINER_ATTRIBUTE_NAME, container); - } - if (proxy instanceof TargetRegisterBank) { - attrs.put(TargetRegisterBank.DESCRIPTIONS_ATTRIBUTE_NAME, getParent()); - } - if (proxy instanceof TargetStackFrame) { - DbgModelTargetStackFrame frame = (DbgModelTargetStackFrame) proxy; - return frame.init(attrs); - } - if (proxy instanceof DbgModelTargetTTD) { - DbgModelTargetTTD ttd = (DbgModelTargetTTD) proxy; - return ttd.init(attrs); - } - if (proxy instanceof DbgModelTargetDebugContainer) { - DbgModelTargetEventContainer events; - if (attributes.containsKey("Events")) { - events = (DbgModelTargetEventContainer) attributes.get("Events"); - } - else { - events = - new DbgModelTargetEventContainerImpl((DbgModelTargetDebugContainer) proxy); - } - attrs.put(events.getName(), events); - DbgModelTargetExceptionContainer exceptions; - if (attributes.containsKey("Exceptions")) { - exceptions = (DbgModelTargetExceptionContainer) attributes.get("Exceptions"); - } - else { - exceptions = - new DbgModelTargetExceptionContainerImpl( - (DbgModelTargetDebugContainer) proxy); - } - attrs.put(exceptions.getName(), exceptions); - } - } - - return CompletableFuture.completedFuture(null); - } - - @Override - public CompletableFuture fetchChild(final String key) { - /* Would like to do this, but has some very bad effects - return getModel().gateFuture(doFetchChild(key)); - } - public CompletableFuture doFetchChild(final String key) { - */ - synchronized (elements) { - if (key.startsWith("[") && key.endsWith("]")) { - String trimKey = key.substring(1, key.length() - 1); - if (elements.containsKey(trimKey)) { - return CompletableFuture.completedFuture(elements.get(trimKey)); - } - return requestElements(RefreshBehavior.REFRESH_NEVER).thenApply(__ -> getCachedElements().get(trimKey)); - } - } - synchronized (attributes) { - if (attributes.containsKey(key)) { - return CompletableFuture.completedFuture(attributes.get(key)); - } - if (key.endsWith(")")) { - DbgManager2Impl manager2 = (DbgManager2Impl) getManager(); - List pathX = PathUtils.extend(List.of("Debugger"), path); - pathX = PathUtils.extend(pathX, key); - return manager2.applyMethods(pathX, this).thenApply(obj -> { - changeAttributes(List.of(), List.of(), Map.of( // - key, obj // - ), "Initialized"); - return obj; - }); - } - return requestAttributes(RefreshBehavior.REFRESH_NEVER).thenApply(__ -> getCachedAttribute(key)); - } - } - - //@Override - //public TargetAccessibility getAccessibility() { - // return accessibility; - //} - - public DbgModelSelectableObject getFocus() { - return focus; - } - - public Map getIntrinsics() { - return intrinsics; - } - - public void setModelObject(ModelObject modelObject) { - this.modelObject = modelObject; - Map attrs = new HashMap<>(); - addModelObjectAttributes(attrs).thenAccept(__ -> { - if (isReallyValid() && !attrs.isEmpty()) { - changeAttributes(List.of(), List.of(), attrs, "Refreshed"); - } - }).exceptionally(ex -> { - Msg.error(this, "Problem setting model object" + PathUtils.toString(getPath()) + ": ", - ex); - return null; - }); - } - - @Override - public DbgModelTargetSession getParentSession() { - DbgModelTargetObject test = (DbgModelTargetObject) parent; - while (test != null && !(test.getProxy() instanceof DbgModelTargetSession)) { - test = (DbgModelTargetObject) test.getParent(); - } - return test == null ? null : (DbgModelTargetSession) test.getProxy(); - } - - @Override - public DbgModelTargetProcess getParentProcess() { - DbgModelTargetObject test = (DbgModelTargetObject) parent; - while (test != null && !(test.getProxy() instanceof TargetProcess)) { - test = (DbgModelTargetObject) test.getParent(); - } - return test == null ? null : (DbgModelTargetProcess) test.getProxy(); - } - - @Override - public DbgModelTargetThread getParentThread() { - DbgModelTargetObject test = (DbgModelTargetObject) parent; - while (test != null && !(test.getProxy() instanceof TargetThread)) { - test = (DbgModelTargetObject) test.getParent(); - } - return test == null ? null : (DbgModelTargetThread) test.getProxy(); - } - - @Override - public void setModified(Map attrs, boolean modified) { - if (modified) { - attrs.put(MODIFIED_ATTRIBUTE_NAME, modified); - } - } - - @Override - public void setModified(boolean modified) { - if (modified) { - changeAttributes(List.of(), List.of(), Map.of( // - MODIFIED_ATTRIBUTE_NAME, modified // - ), "Refreshed"); - } - } - - @Override - public void resetModified() { - if (getCachedAttribute(MODIFIED_ATTRIBUTE_NAME) != null) { - changeAttributes(List.of(), List.of(), Map.of( // - MODIFIED_ATTRIBUTE_NAME, false // - ), "Refreshed"); - } - } - - /* - protected static Set> dependencySet = Set.of(// - TargetProcess.class, // - TargetThread.class, // - TargetStack.class, // - TargetStackFrame.class, // - TargetRegisterBank.class, // - TargetRegisterContainer.class, // - TargetRegister.class, // - TargetMemory.class, // - TargetMemoryRegion.class, // - TargetModule.class, // - TargetModuleContainer.class, // - TargetSection.class, // - TargetBreakpointContainer.class, // - TargetBreakpointSpec.class, // - TargetBreakpointLocation.class, // - TargetEventScope.class, // - TargetFocusScope.class, // - TargetExecutionStateful.class // - ); - - private CompletableFuture findDependencies(TargetObjectListener l) { - System.err.println("findDependencies " + this); - Map resultAttrs = new HashMap<>(); - Map resultElems = new HashMap<>(); - AsyncFence fence = new AsyncFence(); - fence.include(fetchAttributes(false).thenCompose(attrs -> { - AsyncFence af = new AsyncFence(); - for (String key : attrs.keySet()) { //requiredObjKeys) { - Object object = attrs.get(key); - if (!(object instanceof TargetObjectRef)) { - continue; - } - TargetObjectRef ref = (TargetObjectRef) object; - if (PathUtils.isLink(getPath(), key, ref.getPath())) { - continue; - } - af.include(ref.fetch().thenAccept(obj -> { - if (isDependency(obj)) { - synchronized (this) { - resultAttrs.put(key, obj); - obj.addListener(l); - } - } - })); - } - return af.ready(); - })); - fence.include(fetchElements(false).thenCompose(elems -> { - AsyncFence ef = new AsyncFence(); - for (Entry entry : elems.entrySet()) { - ef.include(entry.getValue().fetch().thenAccept(obj -> { - synchronized (this) { - resultElems.put(entry.getKey(), obj); - obj.addListener(l); - } - })); - } - return ef.ready(); - })); - return fence.ready().thenAccept(__ -> { - listeners.fire.attributesChanged(this, List.of(), resultAttrs); - listeners.fire.elementsChanged(this, List.of(), resultElems); - }); - } - - public boolean isDependency(TargetObject object) { - String name = object.getName(); - if (name != null) { - if (name.equals("Debug")) - return true; - if (name.equals("Stack")) - return true; - } - - Set> interfaces = object.getSchema().getInterfaces(); - for (Class ifc : interfaces) { - if (dependencySet.contains(ifc)) { - return true; - } - } - return false; - } - - @Override - public void addListener(TargetObjectListener l) { - listeners.add(l); - if (isDependency(this)) { - findDependencies(l); - } - } - */ -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/model/impl/DbgModel2TargetProxy.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/model/impl/DbgModel2TargetProxy.java deleted file mode 100644 index a412f5b99f..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/model/impl/DbgModel2TargetProxy.java +++ /dev/null @@ -1,25 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.model.impl; - -import agent.dbgeng.model.iface2.DbgModelTargetObject; - -public interface DbgModel2TargetProxy extends DbgModelTargetObject { - - @Override - public DelegateDbgModel2TargetObject getDelegate(); - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/model/impl/DbgModel2TargetRootImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/model/impl/DbgModel2TargetRootImpl.java deleted file mode 100644 index e112f1ae96..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/model/impl/DbgModel2TargetRootImpl.java +++ /dev/null @@ -1,648 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.model.impl; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.dbgeng.DebugModuleInfo; -import agent.dbgeng.dbgeng.DebugProcessId; -import agent.dbgeng.dbgeng.DebugSessionId; -import agent.dbgeng.dbgeng.DebugSystemObjects; -import agent.dbgeng.dbgeng.DebugThreadId; -import agent.dbgeng.manager.DbgCause; -import agent.dbgeng.manager.DbgProcess; -import agent.dbgeng.manager.DbgReason; -import agent.dbgeng.manager.DbgSession; -import agent.dbgeng.manager.DbgStackFrame; -import agent.dbgeng.manager.DbgState; -import agent.dbgeng.manager.DbgThread; -import agent.dbgeng.manager.breakpoint.DbgBreakpointInfo; -import agent.dbgeng.manager.reason.DbgEndSteppingRangeReason; -import agent.dbgeng.manager.reason.DbgExitNormallyReason; -import agent.dbgeng.manager.reason.DbgExitedReason; -import agent.dbgeng.manager.reason.DbgSignalReceivedReason; -import agent.dbgeng.model.iface1.DbgModelSelectableObject; -import agent.dbgeng.model.iface1.DbgModelTargetExecutionStateful; -import agent.dbgeng.model.iface2.DbgModelTargetBreakpointSpec; -import agent.dbgeng.model.iface2.DbgModelTargetConnector; -import agent.dbgeng.model.iface2.DbgModelTargetModule; -import agent.dbgeng.model.iface2.DbgModelTargetObject; -import agent.dbgeng.model.iface2.DbgModelTargetProcess; -import agent.dbgeng.model.iface2.DbgModelTargetProcessContainer; -import agent.dbgeng.model.iface2.DbgModelTargetRoot; -import agent.dbgeng.model.iface2.DbgModelTargetThread; -import agent.dbgeng.model.iface2.DbgModelTargetThreadContainer; -import agent.dbgeng.model.impl.DbgModelTargetConnectorContainerImpl; -import agent.dbgeng.model.impl.DbgModelTargetProcessImpl; -import agent.dbgmodel.dbgmodel.main.ModelObject; -import agent.dbgmodel.manager.DbgManager2Impl; -import ghidra.async.AsyncUtils; -import ghidra.async.TypeSpec; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.TargetEventScope; -import ghidra.dbg.target.TargetExecutionStateful; -import ghidra.dbg.target.TargetExecutionStateful.TargetExecutionState; -import ghidra.dbg.target.TargetFocusScope; -import ghidra.dbg.target.TargetMethod; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.TargetThread; -import ghidra.dbg.target.schema.TargetObjectSchema; -import ghidra.dbg.util.PathUtils; -import ghidra.util.Msg; - -public class DbgModel2TargetRootImpl extends DbgModel2DefaultTargetModelRoot - implements DbgModelTargetRoot { - - protected final DbgModel2Impl impl; - - protected final DbgModel2TargetAvailableContainerImpl available; - protected final DbgModelTargetConnectorContainerImpl connectors; - protected final DbgModel2TargetSystemMarkerImpl systemMarker; - - public DbgModel2TargetRootImpl(DbgModel2Impl impl) { - super(impl, "Debugger"); - this.impl = impl; - - this.available = new DbgModel2TargetAvailableContainerImpl(this); - this.connectors = new DbgModelTargetConnectorContainerImpl(this); - this.systemMarker = new DbgModel2TargetSystemMarkerImpl(this); - - DbgModelTargetConnector defaultConnector = connectors.getDefaultConnector(); - changeAttributes(List.of(), List.of( // - available, // - connectors, // - systemMarker // - ), Map.of( // - ACCESSIBLE_ATTRIBUTE_NAME, true, // - DISPLAY_ATTRIBUTE_NAME, "Debugger", // - FOCUS_ATTRIBUTE_NAME, this, // - TargetMethod.PARAMETERS_ATTRIBUTE_NAME, defaultConnector.getParameters() // - // ARCH_ATTRIBUTE_NAME, "x86_64", // - // DEBUGGER_ATTRIBUTE_NAME, "dbgeng", // - // OS_ATTRIBUTE_NAME, "Windows", // - ), "Initialized"); - impl.getManager().addEventsListener(this); - } - - public DbgModel2TargetRootImpl(DbgModel2Impl impl, TargetObjectSchema schema) { - super(impl, "Debugger", schema); - this.impl = impl; - - this.available = new DbgModel2TargetAvailableContainerImpl(this); - this.connectors = new DbgModelTargetConnectorContainerImpl(this); - this.systemMarker = new DbgModel2TargetSystemMarkerImpl(this); - - DbgModelTargetConnector defaultConnector = connectors.getDefaultConnector(); - changeAttributes(List.of(), List.of( // - available, // - connectors, // - systemMarker // - ), Map.of( // - ACCESSIBLE_ATTRIBUTE_NAME, true, // - DISPLAY_ATTRIBUTE_NAME, "Debugger", // - FOCUS_ATTRIBUTE_NAME, this, // - TargetMethod.PARAMETERS_ATTRIBUTE_NAME, defaultConnector.getParameters() // - // ARCH_ATTRIBUTE_NAME, "x86_64", // - // DEBUGGER_ATTRIBUTE_NAME, "dbgeng", // - // OS_ATTRIBUTE_NAME, "Windows", // - ), "Initialized"); - - impl.getManager().addEventsListener(this); - } - - @Override - public boolean setFocus(DbgModelSelectableObject sel) { - boolean doFire; - synchronized (this) { - doFire = !Objects.equals(this.focus, sel); - if (doFire && focus != null) { - List focusPath = focus.getPath(); - List selPath = sel.getPath(); - doFire = !PathUtils.isAncestor(selPath, focusPath); - } - } - if (doFire) { - this.focus = sel; - changeAttributes(List.of(), List.of(), Map.of( // - TargetFocusScope.FOCUS_ATTRIBUTE_NAME, focus // - ), "Focus changed"); - intrinsics.put(TargetFocusScope.FOCUS_ATTRIBUTE_NAME, focus); - //DbgModelTargetSession session = focus.getParentSession(); - //session.setActive(); - } - return doFire; - } - - @Override - public void setDefaultConnector(DbgModelTargetConnector defaultConnector) { - changeAttributes(List.of(), List.of(), - Map.of(TargetMethod.PARAMETERS_ATTRIBUTE_NAME, defaultConnector.getParameters()), - "Default connector changed"); - } - - @Override - public void sessionSelected(DbgSession session, DbgCause cause) { - objectSelected(session); - } - - @Override - public void processSelected(DbgProcess process, DbgCause cause) { - if (process != null) { - objectSelected(process); - } - } - - @Override - public void threadSelected(DbgThread thread, DbgStackFrame frame, DbgCause cause) { - if (thread != null) { - objectSelected(thread); - if (frame != null) { - objectSelected(frame); - } - } - } - - public void objectSelected(Object object) { - List objPath = findObject(object); - model.fetchModelObject(objPath, RefreshBehavior.REFRESH_WHEN_ABSENT) - .thenAccept(obj -> update(obj)); - } - - @Override - public void sessionAdded(DbgSession session, DbgCause cause) { - changeAttributes(List.of(), List.of( // - new DbgModel2TargetSystemMarkerImpl(this) // - ), Map.of(), "System"); - getObject(session); - } - - @Override - public void processAdded(DbgProcess proc, DbgCause cause) { - getObject(proc).thenAccept(obj -> { - DbgModelTargetProcess targetProcess = (DbgModelTargetProcess) obj; - if (targetProcess == null) { - return; - } - DbgModelTargetProcessContainer container = - (DbgModelTargetProcessContainer) targetProcess.getParent(); - DelegateDbgModel2TargetObject delegate = - (DelegateDbgModel2TargetObject) container.getDelegate(); - delegate.init(); - - broadcast().event(getProxy(), null, TargetEventType.PROCESS_CREATED, - "Process " + proc.getId() + " started " + " pid=" + proc.getPid(), - List.of(targetProcess)); - }); - } - - @Override - public void threadCreated(DbgThread thread, DbgCause cause) { - getObject(thread).thenAccept(obj -> { - DbgModelTargetThread targetThread = (DbgModelTargetThread) obj; - if (targetThread == null) { - return; - } - DbgModelTargetThreadContainer container = - (DbgModelTargetThreadContainer) targetThread.getParent(); - DelegateDbgModel2TargetObject cdelegate = - (DelegateDbgModel2TargetObject) container.getDelegate(); - cdelegate.init(); - - broadcast().event(getProxy(), targetThread, TargetEventType.THREAD_CREATED, - "Thread " + thread.getId() + " started", List.of(targetThread)); - DelegateDbgModel2TargetObject delegate = - (DelegateDbgModel2TargetObject) targetThread.getDelegate(); - delegate.threadStateChangedSpecific(DbgState.STARTING, DbgReason.Reasons.UNKNOWN); - }); - } - - @Override - public void moduleLoaded(DbgProcess proc, DebugModuleInfo info, DbgCause cause) { - getObjectRevisited(proc, List.of("Modules"), info).thenAccept(obj -> { - DbgModelTargetModule mod = (DbgModelTargetModule) obj; - if (mod == null) { - return; - } - getObject(getManager().getEventProcess()).thenAccept(p -> { - DbgModelTargetProcess eventProcess = (DbgModelTargetProcess) p; - DbgModel2TargetObjectImpl memory = - (DbgModel2TargetObjectImpl) eventProcess.getCachedAttribute("Memory"); - memory.requestElements(RefreshBehavior.REFRESH_NEVER); - }); - }); - } - - @Override - public void moduleUnloaded(DbgProcess proc, DebugModuleInfo info, DbgCause cause) { - getObjectRevisited(proc, List.of("Modules"), info).thenAccept(obj -> { - DbgModelTargetModule mod = (DbgModelTargetModule) obj; - if (mod == null) { - return; - } - getObject(getManager().getEventProcess()).thenAccept(p -> { - DbgModelTargetProcess eventProcess = (DbgModelTargetProcess) p; - DbgModel2TargetObjectImpl memory = - (DbgModel2TargetObjectImpl) eventProcess.getCachedAttribute("Memory"); - memory.requestElements(RefreshBehavior.REFRESH_NEVER); - }); - }); - } - - private CompletableFuture getObject(Object object) { - DbgModelTargetObject modelObject = (DbgModelTargetObject) getModel().getModelObject(object); - if (modelObject != null) { - return CompletableFuture.completedFuture(modelObject); - } - List objPath = findObject(object); - if (objPath == null) { - return CompletableFuture.completedFuture(null); - } - // NB: fetchModelObject uses overriden DbgModel2TargetObjectImpl::fetchChild - // which forces refresh for empty containers - return AsyncUtils.sequence(TypeSpec.cls(DbgModelTargetObject.class)).then(seq -> { - getModel().fetchModelObject(objPath).handle(seq::next); - }, TypeSpec.cls(TargetObject.class)).then((pobj, seq) -> { - DbgModelTargetObject pimpl = (DbgModelTargetObject) pobj; - seq.exit(pimpl); - }).finish(); - } - - private CompletableFuture getObjectRevisited(Object object, - List ext, Object info) { - List objPath = findObject(object); - if (objPath == null) { - return CompletableFuture.completedFuture(null); - } - List xpath = new ArrayList<>(); - xpath.addAll(objPath); - xpath.addAll(ext); - // NB: fetchModelObject may have to be called with false - return AsyncUtils.sequence(TypeSpec.cls(DbgModelTargetObject.class)).then(seq -> { - getModel().fetchModelObject(xpath, RefreshBehavior.REFRESH_NEVER).handle(seq::next); - }, TypeSpec.cls(TargetObject.class)).then((pobj, seq) -> { - if (pobj == null) { - seq.exit(); - return; - } - DbgModel2TargetProxy proxy = (DbgModel2TargetProxy) pobj; - DelegateDbgModel2TargetObject delegate = proxy.getDelegate(); - Map existingElements = - delegate.getCachedElements(); - - xpath.add(0, "Debugger"); - DbgManager2Impl manager = (DbgManager2Impl) getManager(); - List list = manager.getAccess().getElements(xpath); - for (ModelObject obj : list) { - String searchKey = obj.getSearchKey(); - if (searchKey.equals(info.toString())) { - String elKey = PathUtils.makeKey(searchKey); - DbgModel2TargetProxy proxyElement; - if (existingElements.containsKey(searchKey)) { - proxyElement = (DbgModel2TargetProxy) existingElements.get(searchKey); - DelegateDbgModel2TargetObject elementDelegate = proxyElement.getDelegate(); - elementDelegate.setModelObject(obj); - } - else { - proxyElement = (DbgModel2TargetProxy) DelegateDbgModel2TargetObject - .makeProxy((DbgModel2Impl) proxy.getModel(), proxy, elKey, obj); - } - //DbgModel2TargetProxy proxyElement = - // (DbgModel2TargetProxy) DelegateDbgModel2TargetObject - // .makeProxy(delegate.getModel(), delegate, elKey, obj); - delegate.changeElements(List.of(), List.of(proxyElement), "Created"); - seq.exit(proxyElement); - } - } - }).finish(); - } - - private CompletableFuture getObjectAndRemove(Object object, - List ext, Object info) { - List objPath = findObject(object); - if (objPath == null) { - return CompletableFuture.completedFuture(null); - } - List xpath = new ArrayList<>(); - xpath.addAll(objPath); - xpath.addAll(ext); - return AsyncUtils.sequence(TypeSpec.cls(Void.class)).then(seq -> { - getModel().fetchModelObject(xpath).handle(seq::next); - }, TypeSpec.cls(TargetObject.class)).then((pobj, seq) -> { - if (pobj == null) { - return; - } - DbgModel2TargetProxy proxy = (DbgModel2TargetProxy) pobj; - DelegateDbgModel2TargetObject delegate = proxy.getDelegate(); - delegate.changeElements(List.of(info.toString()), List.of(), "Deleted"); - }).finish(); - } - - @Override - public void sessionRemoved(DebugSessionId sessionId, DbgCause cause) { - getObject(sessionId); - } - - @Override - public void processRemoved(DebugProcessId processId, DbgCause cause) { - getObject(processId).thenAccept(object -> { - if (object == null) { - return; - } - DbgModelTargetProcess process = (DbgModelTargetProcess) object.getProxy(); - if (!process.getExecutionState().equals(TargetExecutionState.TERMINATED)) { - process.setExecutionState(TargetExecutionState.INACTIVE, "Detached"); - } - DbgModelTargetObject container = (DbgModelTargetObject) process.getParent(); - DelegateDbgModel2TargetObject delegate = - (DelegateDbgModel2TargetObject) container.getDelegate(); - delegate.changeElements(List.of( // - process.getIndex() // - ), List.of(), Map.of(), "Removed"); - process.getParent().resync(); - }); - } - - @Override - public void processExited(DbgProcess proc, DbgCause cause) { - DbgModelTargetProcess targetProcess = - (DbgModelTargetProcess) getModel().getModelObject(proc); - if (targetProcess != null) { - if (targetProcess.isValid()) { - targetProcess.changeAttributes(List.of(), Map.of( // - TargetExecutionStateful.STATE_ATTRIBUTE_NAME, TargetExecutionState.TERMINATED, // - DbgModelTargetProcessImpl.EXIT_CODE_ATTRIBUTE_NAME, proc.getExitCode() // - ), "Exited"); - } - broadcast().event(targetProcess.getProxy(), null, - TargetEventType.PROCESS_EXITED, - "Process " + proc.getId() + " exited code=" + proc.getExitCode(), - List.of(getProxy())); - } - } - - @Override - public void threadExited(DebugThreadId threadId, DbgProcess process, DbgCause cause) { - getObject(threadId).thenAccept(thread -> { - if (thread == null) { - return; - } - DbgModelTargetThread targetThread = (DbgModelTargetThread) thread.getProxy(); - broadcast().event(getProxy(), targetThread, TargetEventType.THREAD_EXITED, - "Thread " + threadId + " exited", List.of(targetThread)); - }); - } - - @Override - public void threadStateChanged(DbgThread thread, DbgState state, DbgCause cause, - DbgReason reason) { - stateChanged(thread, state, reason.desc()).thenAccept(obj -> { - DbgModelTargetThread targetThread = (DbgModelTargetThread) obj; - if (targetThread == null) { - return; - } - changeAttributes(List.of(), List.of(), Map.of( // - TargetEventScope.EVENT_OBJECT_ATTRIBUTE_NAME, targetThread // - ), reason.desc()); - intrinsics.put(TargetEventScope.EVENT_OBJECT_ATTRIBUTE_NAME, targetThread); - TargetEventType eventType = getEventType(state, cause, reason); - broadcast().event(getProxy(), targetThread, eventType, - "Thread " + thread.getId() + " state changed", List.of(targetThread)); - DelegateDbgModel2TargetObject delegate = - (DelegateDbgModel2TargetObject) targetThread.getDelegate(); - delegate.threadStateChangedSpecific(state, reason); - }); - } - - private CompletableFuture stateChanged(Object object, DbgState state, - String reason) { - List objPath = findObject(object); - DbgModelTargetObject obj = (DbgModelTargetObject) getModel().getModelObject(objPath); - if (obj instanceof DbgModelTargetExecutionStateful) { - DbgModelTargetExecutionStateful stateful = - (DbgModelTargetExecutionStateful) obj; - TargetExecutionState execState = stateful.convertState(state); - stateful.setExecutionState(execState, reason); - } - return CompletableFuture.completedFuture(obj); - /* - return AsyncUtils.sequence(TypeSpec.cls(DbgModelTargetObject.class)).then(seq -> { - getModel().fetchModelValue(objPath).handle(seq::next); - }, TypeSpec.cls(Object.class)) - .then((obj, seq) -> { - // This is quite possibly redundant - if (obj instanceof DbgModelTargetExecutionStateful) { - DbgModelTargetExecutionStateful stateful = - (DbgModelTargetExecutionStateful) obj; - TargetExecutionState execState = stateful.convertState(state); - stateful.setExecutionState(execState, reason); - } - seq.exit((DbgModelTargetObject) obj); - }) - .finish(); - */ - } - - @Override - public void breakpointCreated(DbgBreakpointInfo info, DbgCause cause) { - int id = info.getId(); - bptInfoMap.put(id, info); - getObjectRevisited(info.getProc(), List.of("Debug", "Breakpoints"), info); - } - - @Override - public void breakpointModified(DbgBreakpointInfo newInfo, DbgBreakpointInfo oldInfo, - DbgCause cause) { - int id = newInfo.getId(); - bptInfoMap.put(id, newInfo); - getObjectRevisited(newInfo.getProc(), List.of("Debug", "Breakpoints"), newInfo); - } - - @Override - public void breakpointDeleted(DbgBreakpointInfo info, DbgCause cause) { - bptInfoMap.remove((int) info.getNumber()); - getObjectAndRemove(info.getProc(), List.of("Debug", "Breakpoints"), info); - } - - @Override - public void breakpointHit(DbgBreakpointInfo info, DbgCause cause) { - getObjectRevisited(info.getProc(), List.of("Debug", "Breakpoints"), info) - .thenAccept(obj -> { - DbgModelTargetBreakpointSpec bpt = (DbgModelTargetBreakpointSpec) obj; - if (bpt == null) { - Msg.error(this, "Stopped for breakpoint unknown to the agent: " + - info.getNumber() + " (pc=" + info.getExpression() + ")"); - return; - } - - DbgThread thread = info.getEventThread(); - TargetObject targetThread = getModel().getModelObject(thread); - broadcast().breakpointHit(bpt.getParent(), targetThread, null, bpt, bpt); - bpt.breakpointHit(); - }); - } - - /* - @Override - public void consoleOutput(String output, int mask) { - Channel chan = TargetConsole.Channel.STDOUT; - if (((mask & DebugOutputFlags.DEBUG_OUTPUT_ERROR.getValue()) // - == DebugOutputFlags.DEBUG_OUTPUT_ERROR.getValue()) || // - ((mask & DebugOutputFlags.DEBUG_OUTPUT_WARNING.getValue()) // - == DebugOutputFlags.DEBUG_OUTPUT_WARNING.getValue())) { - chan = TargetConsole.Channel.STDERR; - } - final Channel channel = chan; - getObject("cursession").thenAccept(session -> { - listeners.fire(TargetInterpreterListener.class).consoleOutput(session, channel, output); - }); - } - */ - - private List findObject(Object obj) { - DebugSystemObjects so = getManager().getSystemObjects(); - List objpath = new ArrayList<>(); - DebugSessionId sid = so.getCurrentSystemId(); - String skey = sid.value() < 0 ? PathUtils.makeKey("0x0") - : PathUtils.makeKey("0x" + sid.id()); - if (obj instanceof DbgSession) { - DbgSession session = (DbgSession) obj; - skey = PathUtils.makeKey("0x" + session.getId().id()); - } - if (obj instanceof DbgSession || obj instanceof String) { - objpath = List.of("Sessions", skey); - return objpath; - } - int pid = so.getCurrentProcessSystemId(); - String pkey = PathUtils.makeKey("0x" + Integer.toHexString(pid)); - if (obj instanceof DbgProcess) { - DbgProcess process = (DbgProcess) obj; - pkey = PathUtils.makeKey("0x" + Long.toHexString(process.getPid())); - } - if (obj instanceof DbgProcess || obj instanceof DebugProcessId) { - objpath = List.of("Sessions", skey, "Processes", pkey); - return objpath; - } - int tid = so.getCurrentThreadSystemId(); - String tkey = PathUtils.makeKey("0x" + Integer.toHexString(tid)); - if (obj instanceof DbgThread) { - DbgThread thread = (DbgThread) obj; - DbgProcess process = thread.getProcess(); - tkey = PathUtils.makeKey("0x" + Long.toHexString(thread.getTid())); - pkey = PathUtils.makeKey("0x" + Long.toHexString(process.getPid())); - if (getManager().isKernelMode()) { - if (tkey.equals("[0x0]")) { - // Weird, but necessary... - pkey = "[0x0]"; - } - } - } - if (obj instanceof DbgStackFrame) { - DbgStackFrame frame = (DbgStackFrame) obj; - DbgThread thread = frame.getThread(); - DbgProcess process = thread.getProcess(); - int level = frame.getLevel(); - String fkey = "[0x" + Integer.toHexString(level) + "]"; - tkey = PathUtils.makeKey("0x" + Long.toHexString(thread.getTid())); - pkey = PathUtils.makeKey("0x" + Long.toHexString(process.getPid())); - objpath = List.of("Sessions", skey, "Processes", pkey, "Threads", tkey, "Stack", - "Frames", fkey); - } - if (obj instanceof DbgThread || obj instanceof DebugThreadId) { - objpath = List.of("Sessions", skey, "Processes", pkey, "Threads", tkey); - } - return objpath; - } - - private void update(TargetObject obj) { - if (obj instanceof DbgModelSelectableObject) { - setFocus((DbgModelSelectableObject) obj); - } - if (obj instanceof DbgModelTargetExecutionStateful) { - activate((DbgModelTargetExecutionStateful) obj); - // OK, this sucks, but not all threads are parented to activated objects - DbgModelTargetProcess parentProcess = ((DbgModelTargetObject) obj).getParentProcess(); - if (parentProcess != null && obj instanceof DbgModelTargetExecutionStateful) { - activate(parentProcess); - } - } - } - - private void activate(DbgModelTargetExecutionStateful stateful) { - TargetExecutionState state = stateful.getExecutionState(); - if (state.equals(TargetExecutionState.INACTIVE)) { - stateful.changeAttributes(List.of(), Map.of( // - TargetExecutionStateful.STATE_ATTRIBUTE_NAME, TargetExecutionState.ALIVE // - ), "Selected"); - stateful.fetchAttributes(RefreshBehavior.REFRESH_ALWAYS); - } - } - - private TargetEventType getEventType(DbgState state, DbgCause cause, DbgReason reason) { - switch (state) { - case RUNNING: - return TargetEventType.RUNNING; - case STOPPED: - case EXIT: - if (reason instanceof DbgEndSteppingRangeReason) { - return TargetEventType.STEP_COMPLETED; - } - if (reason instanceof DbgSignalReceivedReason) { - return TargetEventType.SIGNAL; - } - if (reason instanceof DbgExitedReason) { - return TargetEventType.EXCEPTION; - } - if (reason instanceof DbgExitNormallyReason) { - return TargetEventType.THREAD_EXITED; - } - return TargetEventType.STOPPED; - case SESSION_EXIT: - return TargetEventType.PROCESS_EXITED; - default: - break; - } - return null; - } - - @Override - public CompletableFuture requestAttributes(RefreshBehavior refresh) { - DbgManager2Impl manager2 = (DbgManager2Impl) getManager(); - List pathX = PathUtils.extend(List.of("Debugger"), path); - intrinsics.put(available.getName(), available); - intrinsics.put(connectors.getName(), connectors); - intrinsics.put(systemMarker.getName(), systemMarker); - return manager2.listAttributes(pathX, this).thenAccept(map -> { - if (map == null) { - return; - } - changeAttributes(List.of(), map, "Refreshed"); - }); - } - - @Override - public boolean isAccessible() { - return accessible; - } - - @Override - public void setAccessible(boolean accessible) { - this.accessible = accessible; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/model/impl/DbgModel2TargetSystemMarkerImpl.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/model/impl/DbgModel2TargetSystemMarkerImpl.java deleted file mode 100644 index a1364e8b66..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/model/impl/DbgModel2TargetSystemMarkerImpl.java +++ /dev/null @@ -1,41 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.model.impl; - -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.model.iface1.DbgModelTargetInterruptible; -import agent.dbgeng.model.iface2.DbgModelTargetObject; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; - -public class DbgModel2TargetSystemMarkerImpl extends DbgModel2TargetObjectImpl - implements DbgModelTargetInterruptible { - - // NB: this is an invisible marker whose only purpose if to enable an - // interrupt when connecting in kernel-mode to a running target - public DbgModel2TargetSystemMarkerImpl(DbgModelTargetObject obj) { - super(obj.getModel(), obj, "_system", "SystemMarker"); - } - - @Override - public CompletableFuture requestAttributes(RefreshBehavior refresh) { - Map nmap = new HashMap<>(); - return addModelObjectAttributes(nmap); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/model/impl/DelegateDbgModel2TargetObject.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/model/impl/DelegateDbgModel2TargetObject.java deleted file mode 100644 index f4c121f037..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/java/agent/dbgmodel/model/impl/DelegateDbgModel2TargetObject.java +++ /dev/null @@ -1,469 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.model.impl; - -import java.lang.invoke.MethodHandles; -import java.lang.ref.Cleaner; -import java.lang.ref.Cleaner.Cleanable; -import java.util.*; - -import agent.dbgeng.manager.*; -import agent.dbgeng.manager.breakpoint.DbgBreakpointInfo; -import agent.dbgeng.manager.impl.DbgManagerImpl; -import agent.dbgeng.model.iface1.*; -import agent.dbgeng.model.iface2.*; -import agent.dbgmodel.dbgmodel.main.ModelObject; -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.ModelObjectKind; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetBreakpointSpec.TargetBreakpointAction; -import ghidra.dbg.util.PathUtils; -import ghidra.util.datastruct.ListenerSet; - -public class DelegateDbgModel2TargetObject extends DbgModel2TargetObjectImpl implements // - DbgModelTargetAccessConditioned, // - DbgModelTargetExecutionStateful, // - DbgModel2TargetProxy, DbgModelTargetBptHelper { - // Probably don-t need any of the handler-map or annotation stuff - - protected final DbgStateListener accessListener = this::checkExited; - - protected static String indexObject(ModelObject obj) { - return obj.getSearchKey(); - } - - public static String keyObject(ModelObject obj) { - return PathUtils.makeKey(indexObject(obj)); - } - - protected static final Cleaner CLEANER = Cleaner.create(); - - // For resource management, I highly recommend keeping the ProxyState stuff. - // It's contents will look different - protected static class ProxyState implements Runnable { - protected final DbgModel2Impl model; - protected final ModelObject modelObject; - - public ProxyState(DbgModel2Impl model, ModelObject modelObject) { - this.model = model; - this.modelObject = modelObject; - } - - @Override - public void run() { - modelObject.dereference(); // Or whatever COM thing to free it here - } - } - - protected static Class lookupWrapperType(String type, - String parentName) { - switch (type) { - case "Available": - return DbgModelTargetAvailableContainer.class; - case "Sessions": - return DbgModelTargetSessionContainer.class; - case "Processes": - return DbgModelTargetProcessContainer.class; - case "Threads": - return DbgModelTargetThreadContainer.class; - case "Modules": - return DbgModelTargetModuleContainer.class; - case "Frames": - return DbgModelTargetStack.class; - case "Registers": - return DbgModelTargetRegisterContainer.class; - case "Attributes": - return DbgModelTargetSessionAttributes.class; - case "Breakpoints": - return DbgModelTargetBreakpointContainer.class; - case "cursession": - return DbgModelTargetSession.class; - case "curprocess": - return DbgModelTargetProcess.class; - case "curthread": - return DbgModelTargetThread.class; - case "curframe": - return DbgModelTargetStackFrame.class; - case "User": - return DbgModelTargetRegisterBank.class; - case "TTD": - return DbgModelTargetTTD.class; - case "Debug": - return DbgModelTargetDebugContainer.class; - } - if (parentName != null) { - switch (parentName) { - case "Available": - return DbgModelTargetAvailable.class; - case "Sessions": - return DbgModelTargetSession.class; - case "Processes": - return DbgModelTargetProcess.class; - case "Threads": - return DbgModelTargetThread.class; - case "Modules": - return DbgModelTargetModule.class; - case "Frames": - return DbgModelTargetStackFrame.class; - case "Breakpoints": - return DbgModelTargetBreakpointSpec.class; - // case "Registers": - // return DbgModelTargetRegisterBank.class; - case "FloatingPoint": - case "Kernel": - case "SIMD": - case "VFP": - case "User": - return DbgModelTargetRegister.class; - } - } - return null; - } - - public static DbgModelTargetObject makeProxy(DbgModel2Impl model, DbgModelTargetObject parent, - String key, ModelObject object) { - List> mixins = new ArrayList<>(); - String lkey = key; - String pname = parent.getName(); - - if (object.getKind().equals(ModelObjectKind.OBJECT_METHOD)) { - mixins.add(DbgModelTargetMethod.class); - } - else { - Class mixin = lookupWrapperType(lkey, pname); - if (mixin != null) { - mixins.add(mixin); - } - } - return new DelegateDbgModel2TargetObject(model, parent, key, object, mixins).getProxy(); - } - - protected static final MethodHandles.Lookup LOOKUP = MethodHandles.lookup(); - - // NOTE: The Cleanable stuff is the replacement for overriding - // Object.finalize(), which - // is now deprecated. - protected final ProxyState state; - protected final Cleanable cleanable; - - private boolean breakpointEnabled; - - private final ListenerSet breakpointActions = - new ListenerSet<>(TargetBreakpointAction.class, false); - - // Extending DefaultTargetObject may spare you from listeners, elements, and - // attributes - // protected final ListenerSet listeners = - // new ListenerSet<>(TargetObjectListener.class); - - // any other fields you need to support your impl - - public DelegateDbgModel2TargetObject(DbgModel2Impl model, DbgModelTargetObject parent, - String key, ModelObject modelObject, List> mixins) { - super(model, mixins, model, parent.getProxy(), key, getHintForObject(modelObject)); - // System.err.println(this); - this.state = new ProxyState(model, modelObject); - this.cleanable = CLEANER.register(this, state); - - getManager().addStateListener(accessListener); - - if (proxy instanceof DbgEventsListener) { - model.getManager().addEventsListener((DbgEventsListener) proxy); - } - setModelObject(modelObject); - init(); - } - - public DelegateDbgModel2TargetObject clone(String key, ModelObject modelObject) { - DbgModelTargetObject p = (DbgModelTargetObject) getParent(); - List> mixins = new ArrayList<>(); - Class mixin = lookupWrapperType(key, p.getName()); - if (mixin != null) { - mixins.add(mixin); - } - DelegateDbgModel2TargetObject delegate = - new DelegateDbgModel2TargetObject(getModel(), p, key, modelObject, mixins); - return delegate; - } - - @Override - public DbgModelTargetObject getProxy() { - return (DbgModelTargetObject) proxy; - } - - protected static String getHintForObject(ModelObject obj) { - ModelObjectKind kind = obj.getKind(); - String ret = kind == null ? "" : kind.name(); - if (kind.equals(ModelObjectKind.OBJECT_INTRINSIC)) { - ret += " " + obj.getValueString(); - } - return ret; - } - - @Override - protected void doInvalidate(TargetObject branch, String reason) { - super.doInvalidate(branch, reason); - getManager().removeStateListener(accessListener); - } - - protected void checkExited(DbgState state, DbgCause cause) { - TargetExecutionState exec = TargetExecutionState.INACTIVE; - switch (state) { - case NOT_STARTED: { - exec = TargetExecutionState.INACTIVE; - break; - } - case STARTING: { - exec = TargetExecutionState.ALIVE; - break; - } - case RUNNING: { - exec = TargetExecutionState.RUNNING; - resetModified(); - onRunning(); - break; - } - case STOPPED: { - exec = TargetExecutionState.STOPPED; - onStopped(); - break; - } - case EXIT: { - exec = TargetExecutionState.TERMINATED; - onExit(); - break; - } - case SESSION_EXIT: { - getModel().close(); - return; - } - } - if (proxy instanceof TargetExecutionStateful) { - if (proxy instanceof DbgModelTargetSession) { - if (state != DbgState.EXIT) { - setExecutionState(exec, "Refreshed"); - } - } - else { - TargetExecutionState previous = this.getExecutionState(); - if (!previous.equals(TargetExecutionState.INACTIVE)) { - setExecutionState(exec, "Refreshed"); - } - } - } - } - - private void invalidate() { - if (proxy instanceof DbgModelTargetMemoryContainer || // - proxy instanceof DbgModelTargetBreakpointContainer || // - proxy instanceof DbgModelTargetRegisterContainer || // - proxy instanceof DbgModelTargetRegisterBank || // - proxy instanceof DbgModelTargetStackFrame || // - proxy instanceof DbgModelTargetStack || // - proxy instanceof DbgModelTargetTTD) { - // listeners.fire.invalidateCacheRequested(proxy); - return; - } - } - - public void init() { - if (PathUtils.isLink(parent.getPath(), proxy.getName(), proxy.getPath())) { - return; - } - DbgManagerImpl manager = getModel().getManager(); - boolean kernelMode = manager.isKernelMode(); - if (proxy instanceof DbgModelTargetSession) { - DbgModelTargetSession targetSession = (DbgModelTargetSession) proxy; - targetSession.getSession(false); - } - if (proxy instanceof DbgModelTargetProcess) { - DbgModelTargetProcess targetProcess = (DbgModelTargetProcess) proxy; - DbgProcess process = targetProcess.getProcess(false); - if (kernelMode) { - Long offset = process.getOffset(); - if (offset == null) { - return; - } - } - } - if (proxy instanceof DbgModelTargetThread) { - DbgModelTargetThread targetThread = (DbgModelTargetThread) proxy; - DbgThread thread = targetThread.getThread(false); - if (kernelMode) { - Long offset = thread.getOffset(); - if (offset == null) { - return; - } - } - } - - if (getModel().isSuppressDescent()) { - return; - } - - if (proxy instanceof DbgModelTargetSession || // - proxy instanceof DbgModelTargetProcess || // - proxy instanceof DbgModelTargetThread) { - requestAttributes(RefreshBehavior.REFRESH_NEVER); - return; - } - if (proxy instanceof DbgModelTargetRegisterContainer || // - proxy instanceof DbgModelTargetRegisterBank || // - proxy.getName().equals("Stack") || proxy.getName().equals("Debug")) { - requestAttributes(RefreshBehavior.REFRESH_NEVER); - return; - } - if (proxy instanceof DbgModelTargetProcessContainer || // - proxy instanceof DbgModelTargetThreadContainer || // - proxy instanceof DbgModelTargetModuleContainer || // - proxy instanceof DbgModelTargetBreakpointContainer || // - proxy instanceof DbgModelTargetStack) { - requestElements(RefreshBehavior.REFRESH_NEVER); - return; - } - } - - public void onRunning() { - invalidate(); - setAccessible(false); - } - - public void onStopped() { - setAccessible(true); - } - - public void onExit() { - setAccessible(true); - } - - @Override - public boolean isAccessible() { - return accessible; - } - - @Override - public void setAccessible(boolean accessible) { - synchronized (attributes) { - if (this.accessible == accessible) { - return; - } - this.accessible = accessible; - } - if (proxy instanceof TargetAccessConditioned) { - changeAttributes(List.of(), List.of(), Map.of( // - TargetAccessConditioned.ACCESSIBLE_ATTRIBUTE_NAME, accessible // - ), "Accessibility changed"); - } - } - - @Override - public DelegateDbgModel2TargetObject getDelegate() { - return this; - } - - // Methods required for DbgModelTargetBreakpointSpec mixin - - @Override - public DbgBreakpointInfo getBreakpointInfo() { - return bptInfoMap.get(Integer.decode(bptId)); - } - - @Override - public void setBreakpointId(String id) { - this.bptId = id; - } - - @Override - public void setBreakpointInfo(DbgBreakpointInfo info) { - TargetObject id = (TargetObject) this.getCachedAttribute("Id"); - String idstr = id.getCachedAttribute(VALUE_ATTRIBUTE_NAME).toString(); - bptInfoMap.put(Integer.decode(idstr), info); - } - - @Override - public boolean isBreakpointEnabled() { - return breakpointEnabled; - } - - @Override - public void setBreakpointEnabled(boolean enabled) { - this.breakpointEnabled = enabled; - } - - @Override - public ListenerSet getActions() { - return breakpointActions; - } - - public void threadStateChangedSpecific(DbgState state, DbgReason reason) { - if (state.equals(DbgState.RUNNING)) { - return; - } - if (proxy instanceof TargetThread) { - List delegates = new ArrayList<>(); - TargetObject stack = (TargetObject) getCachedAttribute("Stack"); - if (stack != null) { - DbgModelTargetStack frames = - (DbgModelTargetStack) stack.getCachedAttribute("Frames"); - delegates.add((DelegateDbgModel2TargetObject) frames.getDelegate()); - } - DbgModelTargetRegisterContainer container = - (DbgModelTargetRegisterContainer) getCachedAttribute("Registers"); - if (container == null) { - return; - } - delegates.add((DelegateDbgModel2TargetObject) container.getDelegate()); - DbgModelTargetRegisterBank bank = - (DbgModelTargetRegisterBank) container.getCachedAttribute("User"); - if (bank == null) { - return; - } - delegates.add((DelegateDbgModel2TargetObject) bank.getDelegate()); - for (DelegateDbgModel2TargetObject delegate : delegates) { - delegate.threadStateChangedSpecific(state, reason); - } - } - if (proxy instanceof TargetRegisterContainer) { - if (!getModel().isSuppressDescent()) { - requestElements(RefreshBehavior.REFRESH_NEVER); - } - requestAttributes(RefreshBehavior.REFRESH_NEVER); - } - if (proxy instanceof TargetRegisterBank) { - TargetRegisterBank bank = (TargetRegisterBank) proxy; - // requestElements(false); - requestAttributes(RefreshBehavior.REFRESH_NEVER).thenAccept(__ -> { - bank.readRegistersNamed(getCachedAttributes().keySet()); - }); - } - if (proxy instanceof TargetStack) { - requestAttributes(RefreshBehavior.REFRESH_NEVER); - requestElements(RefreshBehavior.REFRESH_NEVER).thenAccept(__ -> { - for (TargetObject obj : getCachedElements().values()) { - if (obj instanceof TargetStackFrame) { - DbgModelTargetObject frame = (DbgModelTargetObject) obj; - DelegateDbgModel2TargetObject delegate = - (DelegateDbgModel2TargetObject) frame.getDelegate(); - delegate.threadStateChangedSpecific(state, reason); - } - } - }); - } - if (proxy instanceof TargetStackFrame) { - requestAttributes(RefreshBehavior.REFRESH_NEVER); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/resources/agent/dbgmodel/model/impl/dbgmodel_schema.xml b/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/resources/agent/dbgmodel/model/impl/dbgmodel_schema.xml deleted file mode 100644 index 407efc794a..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/main/resources/agent/dbgmodel/model/impl/dbgmodel_schema.xml +++ /dev/null @@ -1,625 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/sctldbg/cpp/sctldbg.cpp b/Ghidra/Debug/Debugger-agent-dbgmodel/src/sctldbg/cpp/sctldbg.cpp deleted file mode 100644 index b01c2055d8..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/sctldbg/cpp/sctldbg.cpp +++ /dev/null @@ -1,316 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include -#include - -#define INITGUID -#include -#include -#include - -#include - -JavaVM* jvm = NULL; -JNIEnv* env = NULL; - -char JDK_JVM_DLL_PATH[] = "\\jre\\bin\\server\\jvm.dll"; -char JRE_JVM_DLL_PATH[] = "\\bin\\server\\jvm.dll"; - -char MAIN_CLASS[] = "sctldbgmodel/sctl/DbgModelSctlServer"; - -char CP_PREFIX[] = "-Djava.class.path="; - -typedef jint (_cdecl *CreateJavaVMFunc)(JavaVM**, void**, void*); - - -#define CHECK_RC(v, f, x) do { \ - HRESULT ___hr = (x); \ - if (___hr < 0) { \ - fprintf(stderr, "FAILED on line %d: HRESULT=%08x\n", __LINE__, ___hr); \ - goto f; \ - } else if (___hr == S_OK) { \ - v = 1; \ - } else { \ - v = 0; \ - } \ -} while (0) - - -#if 0 -class MyEventCallbacks : public DebugBaseEventCallbacks { -public: - STDMETHOD_(ULONG, AddRef)(THIS) { - InterlockedIncrement(&m_ulRefCount); - return m_ulRefCount; - } - - STDMETHOD_(ULONG, Release)(THIS) { - ULONG ulRefCount = InterlockedDecrement(&m_ulRefCount); - if (m_ulRefCount == 0) { - delete this; - } - return ulRefCount; - } - - STDMETHOD(GetInterestMask)(_Out_ PULONG Mask) { - *Mask = DEBUG_EVENT_CREATE_PROCESS | DEBUG_EVENT_CREATE_THREAD; - return S_OK; - } - - STDMETHOD(CreateProcess)( - THIS_ - _In_ ULONG64 ImageFileHandle, - _In_ ULONG64 Handle, - _In_ ULONG64 BaseOffset, - _In_ ULONG ModuleSize, - _In_ PCSTR ModuleName, - _In_ PCSTR ImageName, - _In_ ULONG CheckSum, - _In_ ULONG TimeDateStamp, - _In_ ULONG64 InitialThreadHandle, - _In_ ULONG64 ThreadDataOffset, - _In_ ULONG64 StartOffset - ) { - UNREFERENCED_PARAMETER(ImageFileHandle); - UNREFERENCED_PARAMETER(Handle); - UNREFERENCED_PARAMETER(BaseOffset); - UNREFERENCED_PARAMETER(ModuleSize); - UNREFERENCED_PARAMETER(ModuleName); - UNREFERENCED_PARAMETER(ImageName); - UNREFERENCED_PARAMETER(CheckSum); - UNREFERENCED_PARAMETER(TimeDateStamp); - UNREFERENCED_PARAMETER(InitialThreadHandle); - UNREFERENCED_PARAMETER(ThreadDataOffset); - UNREFERENCED_PARAMETER(StartOffset); - return DEBUG_STATUS_BREAK; - } - - STDMETHOD(CreateThread)( - THIS_ - _In_ ULONG64 Handle, - _In_ ULONG64 DataOffset, - _In_ ULONG64 StartOffset - ) { - UNREFERENCED_PARAMETER(Handle); - UNREFERENCED_PARAMETER(DataOffset); - UNREFERENCED_PARAMETER(StartOffset); - return DEBUG_STATUS_BREAK; - } -private: - ULONG m_ulRefCount = 0; -}; - -int main_exp00(int argc, char** argv) { - PDEBUG_CLIENT5 pClient5 = NULL; - PDEBUG_CONTROL4 pControl4 = NULL; - PDEBUG_SYMBOLS3 pSymbols3 = NULL; - int ok = 0; - - CHECK_RC(ok, EXIT, DebugCreate(IID_IDebugClient5, (PVOID*) &pClient5)); - CHECK_RC(ok, EXIT, pClient5->QueryInterface(IID_IDebugControl4, (PVOID*) &pControl4)); - CHECK_RC(ok, EXIT, pClient5->QueryInterface(IID_IDebugSymbols3, (PVOID*) &pSymbols3)); - - pClient5->SetEventCallbacks(new MyEventCallbacks()); - - CHECK_RC(ok, EXIT, pControl4->Execute(DEBUG_OUTCTL_ALL_CLIENTS, ".create notepad", DEBUG_EXECUTE_ECHO)); - CHECK_RC(ok, EXIT, pControl4->WaitForEvent(0, INFINITE)); - CHECK_RC(ok, EXIT, pControl4->Execute(DEBUG_OUTCTL_ALL_CLIENTS, "g", DEBUG_EXECUTE_ECHO)); - CHECK_RC(ok, EXIT, pControl4->WaitForEvent(0, INFINITE)); - - ULONG64 ul64MatchHandle = 0; - CHECK_RC(ok, EXIT, pSymbols3->StartSymbolMatch("*", &ul64MatchHandle)); - while (true) { - char aBuffer[1024] = { 0 }; - ULONG64 ul64Offset = 0; - CHECK_RC(ok, FINISH, pSymbols3->GetNextSymbolMatch(ul64MatchHandle, aBuffer, sizeof(aBuffer), NULL, &ul64Offset)); - printf("%016x: %s\n", ul64Offset, aBuffer); - } -FINISH: - - fprintf(stderr, "SUCCESS\n"); -EXIT: - pClient5->SetEventCallbacks(NULL); - pControl4->Release(); - pClient5->Release(); - return 0; -} - -int main_exp01(int argc, char** argv) { - PDEBUG_CLIENT5 pClient5 = NULL; - int ok = 0; - - CHECK_RC(ok, EXIT, DebugCreate(IID_IDebugClient5, (PVOID*) &pClient5)); - - CHECK_RC(ok, EXIT, pClient5->StartProcessServerWide(DEBUG_CLASS_USER_WINDOWS, L"tcp:port=11200", NULL)); - CHECK_RC(ok, EXIT, pClient5->WaitForProcessServerEnd(INFINITE)); -EXIT: - if (pClient5 != NULL) { - pClient5->Release(); - } - return 0; -} -#endif - -int main_sctldbg(int argc, char** argv) { - if (argc < 1) { - fprintf(stderr, "Something is terribly wrong: argc == 0\n"); - } - char* env_java_home = getenv("JAVA_HOME"); - if (env_java_home == NULL) { - fprintf(stderr, "JAVA_HOME is not set\n"); - fflush(stderr); - return -1; - } - char* java_home = strdup(env_java_home); - size_t home_len = strlen(java_home); - if (java_home[home_len - 1] == '\\') { - java_home[home_len - 1] = '\0'; - } - size_t full_len = home_len + sizeof(JDK_JVM_DLL_PATH); - char* full_path = new char[full_len]; - HMODULE jvmDll = NULL; - // Try the JRE path first; - strcpy_s(full_path, full_len, java_home); - strcat_s(full_path, full_len, JRE_JVM_DLL_PATH); - fprintf(stderr, "Trying to find jvm.dll at %s\n", full_path); - fflush(stderr); - jvmDll = LoadLibraryA(full_path); - if (jvmDll == NULL) { - // OK, then try the JDK path - strcpy_s(full_path, full_len, java_home); - strcat_s(full_path, full_len, JDK_JVM_DLL_PATH); - fprintf(stderr, "Trying to find jvm.dll at %s\n", full_path); - fflush(stderr); - jvmDll = LoadLibraryA(full_path); - } - - free(full_path); - free(java_home); - - if (jvmDll == NULL) { - fprintf(stderr, "Could not find the jvm.dll\n"); - fflush(stderr); - return -1; - } - fprintf(stderr, "Found it!\n"); - fflush(stderr); - -#define USE_EXE_AS_JAR -#ifdef USE_EXE_AS_JAR - DWORD fullpath_len = GetFullPathNameA(argv[0], 0, NULL, NULL); - char* fullpath = new char[fullpath_len]; - GetFullPathNameA(argv[0], fullpath_len, fullpath, NULL); - size_t cp_opt_len = sizeof(CP_PREFIX) + strlen(fullpath); - char* cp_opt = new char[cp_opt_len]; - strcpy_s(cp_opt, cp_opt_len, CP_PREFIX); - strcat_s(cp_opt, cp_opt_len, fullpath); - fflush(stderr); -#endif - - JavaVMOption options[2]; - JavaVMInitArgs vm_args = { 0 }; - vm_args.version = JNI_VERSION_1_8; - vm_args.nOptions = sizeof(options)/sizeof(options[0]); - vm_args.options = options; - options[0].optionString = "-Xrs"; -#ifdef USE_EXE_AS_JAR - fprintf(stderr, "Classpath: %s\n", cp_opt); - options[1].optionString = cp_opt; -#else - options[1].optionString = "-Djava.class.path=sctldbgmodel.jar"; -#endif - //options[2].optionString = "-verbose:class"; - vm_args.ignoreUnrecognized = false; - CreateJavaVMFunc create_jvm = NULL; - //create_jvm = JNI_CreateJavaVM; - create_jvm = (CreateJavaVMFunc) GetProcAddress(jvmDll, "JNI_CreateJavaVM"); - jint jni_result = create_jvm(&jvm, (void**)&env, &vm_args); - -#ifdef USE_EXE_AS_JAR - free(cp_opt); -#endif - - if (jni_result != JNI_OK) { - jvm = NULL; - fprintf(stderr, "Could not initialize JVM: %d: ", jni_result); - switch (jni_result) { - case JNI_ERR: - fprintf(stderr, "unknown error"); - break; - case JNI_EDETACHED: - fprintf(stderr, "thread detached from the VM"); - break; - case JNI_EVERSION: - fprintf(stderr, "JNI version error"); - break; - case JNI_ENOMEM: - fprintf(stderr, "not enough memory"); - break; - case JNI_EEXIST: - fprintf(stderr, "VM already created"); - break; - case JNI_EINVAL: - fprintf(stderr, "invalid arguments"); - break; - } - fprintf(stderr, "\n"); - fflush(stderr); - return -1; - } - - jclass mainCls = env->FindClass(MAIN_CLASS); - if (mainCls == NULL) { - fprintf(stderr, "Could not find main class: %s\n", MAIN_CLASS); - jvm->DestroyJavaVM(); - return -1; - } - - jmethodID mainMeth = env->GetStaticMethodID(mainCls, "main", "([Ljava/lang/String;)V"); - if (mainMeth == NULL) { - fprintf(stderr, "No main(String[] args) method in main class\n"); - jvm->DestroyJavaVM(); - return -1; - } - - jclass stringCls = env->FindClass("java/lang/String"); - - jobjectArray jargs = env->NewObjectArray(argc - 1, stringCls, NULL); - for (int i = 1; i < argc; i++) { - jstring a = env->NewStringUTF(argv[i]); - if (a == NULL) { - fprintf(stderr, "Could not create Java string for arguments.\n"); - jvm->DestroyJavaVM(); - return -1; - } - env->SetObjectArrayElement(jargs, i - 1, a); - } - - env->CallStaticVoidMethod(mainCls, mainMeth, (jvalue*) jargs); - - if (env->ExceptionCheck()) { - env->ExceptionDescribe(); - env->ExceptionClear(); - } - - jvm->DestroyJavaVM(); - - return 0; -} - -int main(int argc, char** argv) { - main_sctldbg(argc, argv); -} - diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/dbgmodel/DbgModelSetContextMWETest.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/dbgmodel/DbgModelSetContextMWETest.java deleted file mode 100644 index 340d7da16e..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/dbgmodel/DbgModelSetContextMWETest.java +++ /dev/null @@ -1,332 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - -import java.io.*; -import java.util.*; - -import org.junit.*; - -import agent.dbgeng.dbgeng.*; -import agent.dbgeng.dbgeng.DebugBreakpoint.BreakFlags; -import agent.dbgeng.dbgeng.DebugBreakpoint.BreakType; -import agent.dbgeng.dbgeng.DebugClient.*; -import agent.dbgeng.jna.dbgeng.DbgEngNative.DEBUG_STACK_FRAME; -import agent.dbgmodel.dbgmodel.bridge.HostDataModelAccess; -import agent.dbgmodel.dbgmodel.main.ModelObject; -import agent.dbgmodel.impl.dbgmodel.bridge.HDMAUtil; -import ghidra.comm.util.BitmaskSet; -import ghidra.dbg.util.PathUtils; -import ghidra.test.AbstractGhidraHeadlessIntegrationTest; -import ghidra.util.Msg; - -@Ignore("deprecated") -public class DbgModelSetContextMWETest extends AbstractGhidraHeadlessIntegrationTest { - - @Before - public void setUp() { - DbgEngTest.assumeDbgengDLLLoadable(); - } - - @Test - public void testMWE() throws IOException { - HostDataModelAccess access = DbgModel.debugCreate(); - DebugClient client = access.getClient(); - DebugControl control = client.getControl(); - DebugRegisters registers = client.getRegisters(); - DebugSystemObjects so = client.getSystemObjects(); - HDMAUtil util = new HDMAUtil(access); - - var cb = new NoisyDebugEventCallbacksAdapter(DebugStatus.GO) { - volatile boolean hit = false; - - private void dumpAllThreads(Runnable runnable, boolean reverse, boolean shuffle) { - try { - DebugThreadId restore = so.getCurrentThreadId(); - try { - List threads = so.getThreads(); - if (shuffle) { - Collections.shuffle(threads); - } - if (reverse) { - Collections.reverse(threads); - } - for (DebugThreadId id : threads) { - so.setCurrentThreadId(id); - runnable.run(); - } - } - finally { - so.setCurrentThreadId(restore); - } - } - catch (Exception e) { - Msg.error(this, "Issue getting current thread: " + e); - } - } - - private void dumpRegsViaDX() { - DebugThreadId id = so.getCurrentThreadId(); - if (id.value() == -1) { - return; - } - - int pid = so.getCurrentProcessSystemId(); - int tid = so.getCurrentThreadSystemId(); - String prefix = String.format( - "Debugger.Sessions[0x0].Processes[0x%x].Threads[0x%x]", pid, tid); - - try { - control.execute("dx " + prefix + ".Registers.User"); - } - catch (Exception e) { - Msg.error(this, "Could not dump regs of " + prefix + ": " + e); - } - } - - private void dumpFrame0ViaDX() { - DebugThreadId id = so.getCurrentThreadId(); - if (id.value() == -1) { - return; - } - - int pid = so.getCurrentProcessSystemId(); - int tid = so.getCurrentThreadSystemId(); - String prefix = String.format( - "Debugger.Sessions[0x0].Processes[0x%x].Threads[0x%x]", pid, tid); - - String path = prefix + ".Stack.Frames[0x0].Attributes.InstructionOffset"; - List parsed = PathUtils.parse(path); - try { - //for (int i = 0; i < parsed.size(); i++) { - //List sub = parsed.subList(0, i + 1); - List sub = parsed; - ModelObject obj = util.getTerminalModelObject(sub); - Msg.info(this, PathUtils.toString(sub) + "=" + obj); - //} - } - catch (Exception e) { - Msg.error(this, "Could not get object " + path + ": " + e); - } - - try { - control.execute("dx " + path); - } - catch (Exception e) { - Msg.error(this, "Could not execute dx " + path + ": " + e); - } - } - - private void dumpFrame0ViaK() { - DebugThreadId id = so.getCurrentThreadId(); - if (id.value() == -1) { - return; - } - try { - DebugStackInformation stackInfo = control.getStackTrace(0, 0, 0); - if (stackInfo.getNumberOfFrames() == 0) { - Msg.info(this, "t" + id.id() + ".Stack is empty?"); - } - else { - DEBUG_STACK_FRAME frame = stackInfo.getFrame(0); - Msg.info(this, - String.format("t%d.Frame[0].io=%08x", id.id(), - frame.InstructionOffset.longValue())); - } - } - catch (Exception e) { - Msg.info(this, "Could not read t" + id.id() + ".Frame[0].io: " + e); - } - } - - private void dumpPCViaRegsAPI() { - DebugThreadId id = so.getCurrentThreadId(); - if (id.value() == -1) { - return; - } - try { - Msg.info(this, String.format("t%d.rip=%s", id.id(), - registers.getValueByName("rip"))); - } - catch (Exception e) { - Msg.info(this, "Could not read t" + id.id() + ".RIP: " + e); - } - try { - Msg.info(this, String.format("t%d.eip=%s", id.id(), - registers.getValueByName("eip"))); - } - catch (Exception e) { - Msg.info(this, "Could not read t" + id.id() + ".EIP: " + e); - } - } - - private void dumpCurrentThread() { - dumpRegsViaDX(); - dumpFrame0ViaDX(); - dumpFrame0ViaK(); - dumpPCViaRegsAPI(); - } - - @Override - public DebugStatus breakpoint(DebugBreakpoint bp) { - super.breakpoint(bp); - hit = true; - Msg.info(this, "HIT!!!!"); - //dumpAllThreads(); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus exception(DebugExceptionRecord64 exception, boolean firstChance) { - DebugStatus status = super.exception(exception, firstChance); - //dumpAllThreads(); - return status; - } - - @Override - public DebugStatus changeEngineState(BitmaskSet flags, - long argument) { - DebugStatus status = super.changeEngineState(flags, argument); - if (flags.contains(ChangeEngineState.CURRENT_THREAD)) { - return status; - } - if (!flags.contains(ChangeEngineState.EXECUTION_STATUS)) { - return status; - } - if (DebugStatus.isInsideWait(argument)) { - return status; - } - if (DebugStatus.fromArgument(argument) != DebugStatus.BREAK) { - return status; - } - //dumpAllThreads(this::dumpRegsViaDX, false, false); - //dumpAllThreads(this::dumpFrame0ViaDX, false, false); - return status; - } - - @Override - public DebugStatus changeDebuggeeState(BitmaskSet flags, - long argument) { - DebugStatus status = super.changeDebuggeeState(flags, argument); - return status; - } - - Map frame0sByT = new HashMap<>(); - - protected void cacheFrame0() { - dumpAllThreads(() -> { - int pid = so.getCurrentProcessSystemId(); - int tid = so.getCurrentThreadSystemId(); - String path = makePrefix(pid, tid) + ".Stack.Frames"; - ModelObject object = getObject(path); - if (object == null) { - Msg.error(this, "Could not get object: " + path); - } - else { - frame0sByT.put(tid, object); - } - }, false, false); - } - - @Override - public DebugStatus createThread(DebugThreadInfo debugThreadInfo) { - DebugStatus status = super.createThread(debugThreadInfo); - cacheFrame0(); - return status; - } - - @Override - public DebugStatus createProcess(DebugProcessInfo debugProcessInfo) { - DebugStatus status = super.createProcess(debugProcessInfo); - cacheFrame0(); - return status; - } - - private ModelObject getObject(String path) { - List parsed = PathUtils.parse(path); - return util.getTerminalModelObject(parsed); - } - - private String makePrefix(int pid, int tid) { - return String.format("Debugger.Sessions[0x0].Processes[0x%x].Threads[0x%x]", - pid, tid); - } - - @Override - public DebugStatus exitThread(int exitCode) { - DebugStatus status = super.exitThread(exitCode); - return status; - } - }; - - try (ProcMaker maker = new ProcMaker(client, "C:\\Software\\Winmine__XP.exe")) { - maker.start(); - - client.setEventCallbacks(cb); - - DebugSymbols symbols = client.getSymbols(); - //assertEquals(1, symbols.getNumberLoadedModules()); - - DebugModule modWinmine = symbols.getModuleByModuleName("winmine", 0); - assertNotNull(modWinmine); - long baseWinmine = modWinmine.getBase(); - assertEquals(0x01000000, baseWinmine); - - DebugBreakpoint bpt0 = control.addBreakpoint(BreakType.CODE); - - bpt0.setOffset(baseWinmine + 0x367a); - bpt0.setFlags(BreakFlags.ENABLED); - - control.setExecutionStatus(DebugStatus.GO); - - while (!cb.hit) { - Msg.info(this, "Not hit yet. Waiting"); - control.waitForEvent(); - Msg.info(this, " ..."); - } - Msg.info(this, "DONE"); - - for (Map.Entry ent : cb.frame0sByT.entrySet()) { - Msg.info(this, String.format("IO-cached(0x%x): %s", ent.getKey(), - ent.getValue() - .getElements() - .get(0) - .getKeyValue("Attributes") - .getKeyValue("InstructionOffset"))); - } - cb.dumpFrame0ViaDX(); - - BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); - while (true) { - System.err.print(control.getPromptText()); - //control.prompt(BitmaskSet.of(), "Hello?>"); - String cmd = in.readLine(); - control.execute(cmd); - if (control.getExecutionStatus().shouldWait) { - control.waitForEvent(); - } - } - - /** - * TODO: Didn't finish because the SetContext failed issue turned out to be mixed and/or - * broken DLLs. - */ - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/dbgmodel/DbgModelTest.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/dbgmodel/DbgModelTest.java deleted file mode 100644 index 0166d4a123..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/dbgmodel/DbgModelTest.java +++ /dev/null @@ -1,1132 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel; - -import static org.junit.Assert.*; - -import java.io.*; -import java.nio.ByteBuffer; -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import org.junit.*; - -import com.sun.jna.Pointer; -import com.sun.jna.WString; -import com.sun.jna.platform.win32.Variant.VARIANT; -import com.sun.jna.platform.win32.COM.COMException; -import com.sun.jna.platform.win32.COM.Unknown; - -import agent.dbgeng.dbgeng.*; -import agent.dbgeng.dbgeng.DebugBreakpoint.BreakType; -import agent.dbgeng.dbgeng.DebugClient.DebugStatus; -import agent.dbgeng.dbgeng.DebugDataSpaces.*; -import agent.dbgeng.dbgeng.DebugModule.DebugModuleName; -import agent.dbgeng.dbgeng.DebugRegisters.DebugRegisterDescription; -import agent.dbgeng.dbgeng.DebugRegisters.DebugRegisterSource; -import agent.dbgeng.dbgeng.DebugValue.DebugInt64Value; -import agent.dbgmodel.dbgmodel.bridge.HostDataModelAccess; -import agent.dbgmodel.dbgmodel.datamodel.DataModelManager1; -import agent.dbgmodel.dbgmodel.datamodel.script.*; -import agent.dbgmodel.dbgmodel.debughost.*; -import agent.dbgmodel.dbgmodel.main.*; -import agent.dbgmodel.gadp.impl.WrappedDbgModel; -import agent.dbgmodel.impl.dbgmodel.bridge.HDMAUtil; -import agent.dbgmodel.impl.dbgmodel.debughost.DebugHostModuleImpl1; -import agent.dbgmodel.impl.dbgmodel.main.ModelPropertyAccessorInternal; -import agent.dbgmodel.jna.dbgmodel.DbgModelNative.*; -import agent.dbgmodel.jna.dbgmodel.UnknownWithUtils; -import ghidra.test.AbstractGhidraHeadlessIntegrationTest; -import ghidra.util.NumericUtilities; - -@Ignore("deprecated") -public class DbgModelTest extends AbstractGhidraHeadlessIntegrationTest { - protected static HostDataModelAccess cachedAccess = null; - protected static DebugClient cachedClient = null; - - protected HostDataModelAccess doDebugCreate() { - System.out.println("Creating a client"); - return DbgModel.debugCreate(); - } - - protected HostDataModelAccess doDebugConnect() { - System.out.println("Connecting to a client"); - String options = "tcp:Port=54321"; - return DbgModel.debugConnect(options); - } - - protected void debugCreate() { - //if (cachedClient == null) { - cachedAccess = doDebugCreate(); - cachedClient = cachedAccess.getClient(); - //} - } - - protected void debugConnect() { - cachedAccess = doDebugConnect(); - cachedClient = cachedAccess.getClient(); - } - - protected HostDataModelAccess access; - protected DebugClient client; - protected DebugControl control; - - @Before - public void setUp() { - DbgEngTest.assumeDbgengDLLLoadable(); - debugCreate(); - //debugConnect(); - access = cachedAccess; - client = cachedClient; - control = client.getControl(); - } - - @Test - public void testServer() { - try (ProcMaker maker = new ProcMaker(client, "notepad")) { - maker.start(); - - control.execute(".server tcp:port=54321"); - - int count = 0; - try { - while (true) { - count++; - } - } - catch (Exception e) { - System.err.println(e); - } - } - } - - @Test - public void testOpenTrace() { - try (ProcMaker maker = new ProcMaker(client, "notepad")) { - maker.start(); - - // NB: This does not work! TTDReplay must live in TTD\TTReplay.dll wherever - // dbgeng.dll lives - //client.getControl().execute(".load c:\\Software\\windbg\\amd64\\ttd\\TTDReplay.dll"); - - client.getControl().execute(".load TTDReplay.dll"); - client.getControl().execute(".load TTDAnalyze.dll"); - client.openDumpFileWide("notepad01.run"); - } - } - - @Test - public void testOpenTraceWithoutProcess() { - final CompletableFuture procInfo = new CompletableFuture<>(); - final CompletableFuture threadInfo = new CompletableFuture<>(); - final CompletableFuture procExit = new CompletableFuture<>(); - - StringBuilder outputCapture = null; - client.setEventCallbacks(new NoisyDebugEventCallbacksAdapter(DebugStatus.NO_CHANGE) { - @Override - public DebugStatus createProcess(DebugProcessInfo debugProcessInfo) { - super.createProcess(debugProcessInfo); - procInfo.complete(debugProcessInfo); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus createThread(DebugThreadInfo debugThreadInfo) { - super.createThread(debugThreadInfo); - threadInfo.complete(debugThreadInfo); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus exitProcess(int exitCode) { - super.exitProcess(exitCode); - procExit.complete(exitCode); - return DebugStatus.BREAK; - } - }); - client.setOutputCallbacks(new DebugOutputCallbacks() { - @Override - public void output(int mask, String text) { - System.out.print(text); - if (outputCapture != null) { - outputCapture.append(text); - } - } - }); - - client.openDumpFileWide("notepad01.run"); - control.waitForEvent(); - control.execute("g"); - control.waitForEvent(); - DebugProcessInfo pi = procInfo.getNow(null); - DebugThreadInfo ti = threadInfo.getNow(null); - DebugSystemObjects so = client.getSystemObjects(); - int currentProcessSystemId = so.getCurrentProcessSystemId(); - DebugProcessId currentProcessId = so.getCurrentProcessId(); - DebugThreadId currentThreadId = so.getCurrentThreadId(); - DebugProcessId eventProcess = so.getEventProcess(); - DebugThreadId eventThread = so.getEventThread(); - List processes = so.getProcesses(); - List threads = so.getThreads(); - System.err.println(threads); - } - - @Test - public void testInterfaces() { - try (ProcMaker maker = new ProcMaker(client, "notepad")) { - maker.start(); - - HDMAUtil util = new HDMAUtil(access); - DataModelManager1 manager = util.getManager(); - assertNotNull("manager not null", manager); - DebugHost host = util.getHost(); - assertNotNull("host not null", host); - //KeyStore defaultMetadata = host.getDefaultMetadata(); - //UnknownEx hostDefinedInterface = host.getHostDefinedInterface(); - - ModelObject rootNamespace = util.getRootNamespace(); - assertNotNull("rootNamespace not null", rootNamespace); - enumerate(rootNamespace, " "); - //enumerateR(rootNamespace, " "); - System.out.println("END"); - } - } - - @Test - public void testHammerEnumerate() { - try (ProcMaker maker = new ProcMaker(client, "notepad")) { - maker.start(); - - HDMAUtil util = new HDMAUtil(access); - DataModelManager1 manager = util.getManager(); - assertNotNull("manager not null", manager); - DebugHost host = util.getHost(); - assertNotNull("host not null", host); - - ModelObject rootNamespace = util.getRootNamespace(); - assertNotNull("rootNamespace not null", rootNamespace); - for (int i = 0; i < 10; i++) { - enumerate(rootNamespace, " "); - System.gc(); - } - System.out.println("END"); - } - UnknownWithUtils.ANALYZER.checkLeaks(); - } - - HashSet seen = new HashSet(); - - private void enumerate(ModelObject obj, String tab) { - String key; - KeyEnumerator enumerateKeys = obj.enumerateKeyValues(); - do { - key = enumerateKeys.getNext(); - ModelObject value = enumerateKeys.getValue(); - if (value == null || key == null || key.equals("Registers")) { - continue; - } - //if (!value.getKind().equals(ModelObjectKind.OBJECT_METHOD)) { - String desc = tab + key + ":" + value.getKind(); - if (value.getKind().equals(ModelObjectKind.OBJECT_INTRINSIC)) { - desc += ":" + value.getIntrinsicValue(); - } - if (!seen.contains(key)) { - System.out.println(desc); - seen.add(key); - enumerate(value, tab + " "); - } - //} - } - while (key != null); - - List children = obj.getElements(); - ListIterator iter = children.listIterator(); - if (iter.hasNext()) { - ModelObject child = iter.next(); - System.err.println(tab + child.toString()); - enumerate(child, tab + " "); - } - - if (obj.getKind().equals(ModelObjectKind.OBJECT_TARGET_OBJECT)) { - RawEnumerator enumerateRaw = - obj.enumerateRawValues(SymbolKind.SYMBOL_FIELD.ordinal(), 0); - while ((key = enumerateRaw.getNext()) != null) { - ModelObject value = enumerateRaw.getValue(); - String desc = tab + key + ":" + value.getKind(); - if (value.getKind().equals(ModelObjectKind.OBJECT_INTRINSIC)) { - desc += ":" + value.getIntrinsicValue(); - } - if (!seen.contains(key.toString())) { - System.out.println(desc); - seen.add(key.toString()); - enumerate(value, tab + " "); - } - } - } - } - - @Test - public void testGetChild() { - try (ProcMaker maker = new ProcMaker(client, "notepad")) { - maker.start(); - - HDMAUtil util = new HDMAUtil(access); - ModelObject currentProcess = util.getCurrentProcess(); - String ctlid = util.getCtlId(currentProcess); - ModelObject process = util.getProcess(util.getCurrentSession(), ctlid); - assertTrue(ctlid.equals(util.getCtlId(process))); - } - } - - @Test - public void testEnv() { - try (ProcMaker maker = new ProcMaker(client, "notepad")) { - maker.start(); - - //control.execute(".server tcp:port=54321"); - - HDMAUtil util = new HDMAUtil(access); - //DataModelManager1 manager = util.getManager(); - - ModelObject currentProcess = util.getCurrentProcess(); - ModelObject env = currentProcess.getKeyValue("Environment"); - ModelObject eb = env.getKeyValue("EnvironmentBlock"); - System.out.println(eb.getKind()); - System.out.println(eb.toString()); - - DebugHostType1 targetInfo = eb.getTargetInfo(); - //DebugHostContext context = targetInfo.getContext(); - System.out.println(targetInfo.getSymbolKind()); - System.out.println(targetInfo.getName()); - //DebugHostType1 type = targetInfo.getType(); - DebugHostModule1 containingModule = targetInfo.getContainingModule(); - System.out.println(containingModule.getName()); - DebugHostType1 typeByName = containingModule.findTypeByName("_PEB"); - System.out.println(typeByName.getName()); - - //System.out.println(targetInfo.getOffset()); - System.out.println(targetInfo.getTypeKind()); - System.out.println(targetInfo.getSize()); - - System.out.println(Integer.toHexString(targetInfo.getHashCode())); - - System.out.println(targetInfo.getPointerKind()); - - DebugHostSymbolEnumerator enumerator = - targetInfo.enumerateChildren(SymbolKind.SYMBOL, null); - DebugHostSymbol1 next; - while ((next = enumerator.getNext()) != null) { - System.out.println(next.getName()); - } - } - } - - @Test - public void testEnvEx() { - try (ProcMaker maker = new ProcMaker(client, "notepad")) { - maker.start(); - - //control.execute(".server tcp:port=54321"); - - HDMAUtil util = new HDMAUtil(access); - DebugHost host = util.getHost(); - //DebugHostContext currentContext = host.getCurrentContext(); - //DataModelManager1 manager = util.getManager(); - - ModelObject currentProcess = util.getCurrentProcess(); - ModelObject env = currentProcess.getKeyValue("Environment"); - ModelObject eb = env.getKeyValue("EnvironmentBlock"); - - client.getControl().execute("dt nt!_PEB"); - client.getControl() - .execute( - "dx Debugger.State.DebuggerVariables.curprocess.Environment.EnvironmentBlock"); - System.err.println(eb.hashCode()); - System.err.println(eb.getLocation().Offset); - DebugHostType2 targetInfo = (DebugHostType2) eb.getTargetInfo(); - DebugHostSymbolEnumerator enumerator = - targetInfo.enumerateChildren(SymbolKind.SYMBOL, null); - DebugHostSymbol1 next; - while ((next = enumerator.getNext()) != null) { - System.out.println(next.getName()); - } - System.err.println(targetInfo.getTypeKind()); - - System.err.println(eb.getKeyValueMap().size()); - System.err.println(eb.getElements().size()); - RawEnumerator enumeratorR = eb.enumerateRawValues(SymbolKind.SYMBOL.ordinal(), 0); - String nextR; - // SYMBOL, SYMBOL_CONSTANT, SYMBOL_DATA, SYMBOL_FIELD return the same values - // SYMBOL_BASE_CLASS, SYMBOL_PUBLIC, SYMBOL_TYPE return nothing - // SYMBOL_FUNCTION, SYMBOL_MODULE throw an error - while ((nextR = enumeratorR.getNext()) != null) { - System.out.println(nextR); - System.out.println(enumeratorR.getKind()); - } - } - } - - /* - @Test - public void testPrintln() { - CompletableFuture cb = new CompletableFuture<>(); - client.setOutputCallbacks(new DebugOutputCallbacks() { - @Override - public void output(int mask, String text) { - System.out.print(text); - cb.complete(text); - } - }); - control.outln("Hello, World!"); - String back = cb.getNow(null); - // NOTE: I'd like to be precise wrt/ new lines, but it seems to vary with version. - assertEquals("Hello, World!", back.trim()); - } - */ - - @Test - public void testGetProcessSystemIds() { - try (ProcMaker maker = new ProcMaker(client, "notepad")) { - maker.start(); - - HDMAUtil util = new HDMAUtil(access); - ModelObject currentSession = util.getCurrentSession(); - String ctlid = util.getCtlId(currentSession); - List procs = util.getRunningProcesses(ctlid); - System.out.println("Total: " + procs.size()); - procs.sort(null); - for (ModelObject p : procs) { - System.out.println("ID: " + util.getCtlId(p)); - } - } - } - - @Test - public void testGetProcesses() { - DebugSystemObjects so = access.getClient().getSystemObjects(); - try (ProcMaker maker = new ProcMaker(client, "notepad")) { - maker.start(); - System.out.println(so.getNumberProcesses()); - - HDMAUtil util = new HDMAUtil(access); - ModelObject currentProcess = util.getCurrentProcess(); - String ctlid = util.getCtlId(currentProcess); - System.out.println("ID: " + ctlid); - List processes = so.getProcesses(); - for (DebugProcessId id : processes) { - System.out.println("ID: " + id); - DebugProcessId pid = so.getProcessIdBySystemId(Integer.parseUnsignedInt(ctlid, 16)); - System.out.println("ID: " + pid); - } - } - } - - @Test - public void testGetProcessDescriptions() { - try (ProcMaker maker = new ProcMaker(client, "notepad")) { - maker.start(); - - HDMAUtil util = new HDMAUtil(access); - ModelObject currentSession = util.getCurrentSession(); - String ctlid = util.getCtlId(currentSession); - List procs = util.getRunningProcesses(ctlid); - System.out.println("Total: " + procs.size()); - procs.sort(null); - for (ModelObject p : procs) { - try { - System.out.println(p.toString()); - } - catch (COMException e) { - System.out - .println("Error with PID " + util.getCtlId(p) + ": " + e.getMessage()); - } - } - } - } - - @Test - public void testGetRegistersNew() { - try (ProcMaker maker = new ProcMaker(client, "notepad")) { - maker.start(); - - HDMAUtil util = new HDMAUtil(access); - ModelObject currentThread = util.getCurrentThread(); - ModelObject registers = currentThread.getKeyValue("Registers").getKeyValue("User"); - Map map = registers.getKeyValueMap(); - for (String key : map.keySet()) { - ModelObject mo = map.get(key); - Object value = mo.getValue(); - System.out.println(key + ":" + Long.toHexString(Long.parseLong(value.toString()))); - } - } - } - - @Test - public void testGetAllRegisters() { - try (ProcMaker maker = new ProcMaker(client, "notepad")) { - maker.start(); - - WrappedDbgModel dbgmodel = new WrappedDbgModel(access); - Set descs = dbgmodel.getAllRegisterDescriptions(); - for (DebugRegisterDescription desc : descs) { - System.out.println(desc.index + ":" + desc.name); - } - } - } - - @Test - public void testGetRegisters() { - try (ProcMaker maker = new ProcMaker(client, "notepad")) { - maker.start(); - - List out = maker.execCapture("r"); - String expected = out.stream().filter(s -> s.startsWith("rax")).findAny().get(); - - WrappedDbgModel dbgmodel = new WrappedDbgModel(access); - DebugRegisters regs = dbgmodel.getRegisters(); - List indices = new ArrayList<>(); - int raxIdx = regs.getIndexByName("rax"); - int rbxIdx = regs.getIndexByName("rbx"); - int rcxIdx = regs.getIndexByName("rcx"); - indices.add(raxIdx); - indices.add(rbxIdx); - indices.add(rcxIdx); - Map values = - regs.getValues(DebugRegisterSource.DEBUG_REGSRC_DEBUGGEE, indices); - - String actual = String.format("rax=%016x rbx=%016x rcx=%016x", - ((DebugInt64Value) values.get(raxIdx)).longValue(), - ((DebugInt64Value) values.get(rbxIdx)).longValue(), - ((DebugInt64Value) values.get(rcxIdx)).longValue()); - System.out.println(actual); - assertEquals(expected, actual); - } - } - - @Test - public void testSetCurrentThread() { - try (ProcMaker maker = new ProcMaker(client, "notepad")) { - maker.start(); - - HDMAUtil util = new HDMAUtil(access); - ModelObject currentProcess = util.getCurrentProcess(); - ModelObject currentThread = util.getCurrentThread(); - System.out.println(currentThread); - String ctlid = util.getCtlId(currentThread); - VARIANT v = new VARIANT(ctlid); - currentProcess.switchTo(util.getManager(), v); - currentThread = util.getCurrentThread(); - ; - System.out.println(currentThread); - } - } - - @Test - public void testGetElements() { - try (ProcMaker maker = new ProcMaker(client, "notepad")) { - maker.start(); - - HDMAUtil util = new HDMAUtil(access); - List children = - util.getElements(List.of("Debugger", "Sessions[0]", "Processes")); - for (ModelObject obj : children) { - System.err.println(obj.getSearchKey()); - } - } - } - - @Test - public void testGetAttributes() { - try (ProcMaker maker = new ProcMaker(client, "notepad")) { - maker.start(); - - HDMAUtil util = new HDMAUtil(access); - Map map = util.getAttributes(List.of("Debugger", "Sessions")); - for (String key : map.keySet()) { - System.err.println(key); - } - } - } - - @Test - public void testCall() { - try (ProcMaker maker = new ProcMaker(client, "notepad")) { - maker.start(); - - HDMAUtil util = new HDMAUtil(access); - DataModelManager1 manager = util.getManager(); - Pointer[] args = new Pointer[0]; - //VARIANT.ByReference vbr = new VARIANT.ByReference(v); - //ModelObject mo = manager.createIntrinsicObject(ModelObjectKind.OBJECT_INTRINSIC, vbr); - //args[0] = mo.getPointer(); - ModelObject sessions = util.getSessionOf(null); - ModelMethod f = sessions.getMethod("Last"); - ModelObject ret = f.call(sessions, 0, args); - System.err.println("=====>" + ret.getSearchKey()); - } - } - - @Test - public void testCallWithParameter() { - try (ProcMaker maker = new ProcMaker(client, "notepad")) { - maker.start(); - - HDMAUtil util = new HDMAUtil(access); - DebugHost host = util.getHost(); - DebugHostEvaluator2 eval = host.asEvaluator(); - Pointer[] args = new Pointer[1]; - ModelObject process = util.getCurrentProcess(); - ModelObject threads = process.getKeyValue("Threads"); - DebugHostContext context = host.getCurrentContext(); - ModelObject mo = - eval.evaluateExtendedExpression(context, new WString("c => c.Id"), threads); - args[0] = mo.getPointer(); - ModelMethod f = threads.getMethod("OrderByDescending"); - ModelObject ret = f.call(threads, 1, args); - List children = ret.getElements(); - for (ModelObject child : children) { - System.err.println("=====>" + child.getSearchKey()); - } - } - } - - @Test - public void testCallWithParametersEx() { - try (ProcMaker maker = new ProcMaker(client, "notepad")) { - maker.start(); - - HDMAUtil util = new HDMAUtil(access); - DebugHost host = util.getHost(); - DebugHostEvaluator2 eval = host.asEvaluator(); - ModelObject process = util.getCurrentProcess(); - ModelObject modules = process.getKeyValue("Modules"); - DebugHostContext context = host.getCurrentContext(); - ModelObject mo = eval.evaluateExtendedExpression(context, - new WString("OrderByDescending(c => c.BaseAddress)"), modules); - List children = mo.getElements(); - for (ModelObject child : children) { - ModelObject value = child.getKeyValue("BaseAddress"); - System.err.println("=====>" + child.getSearchKey() + ":" + value); - } - } - } - -/* - @Test - public void testSetSingleRegister() { - try (ProcMaker maker = new ProcMaker(client,"notepad")) { - maker.start(); - - DebugRegisters regs = client.getRegisters(); - regs.setValueByName("rax", new DebugInt64Value(0x0102030405060708L)); - - List out = maker.execCapture("r"); - String actual = - out.stream().filter(s -> s.startsWith("rax")).findAny().get().split("\\s+")[0]; - assertEquals("rax=0102030405060708", actual); - } - } - - @Test - public void testSetRegisters() { - try (ProcMaker maker = new ProcMaker(client,"notepad")) { - maker.start(); - - DebugRegisters regs = client.getRegisters(); - // Purposefully choosing non-linked variant. - // Want to know that order does not make a difference. - Map values = new HashMap<>(); - values.put(regs.getIndexByName("rax"), new DebugInt64Value(0x0102030405060708L)); - values.put(regs.getIndexByName("rbx"), new DebugInt64Value(0x1122334455667788L)); - values.put(regs.getIndexByName("rcx"), new DebugInt64Value(0x8877665544332211L)); - regs.setValues(DebugRegisterSource.DEBUG_REGSRC_DEBUGGEE, values); - - List out = maker.execCapture("r"); - String actual = out.stream().filter(s -> s.startsWith("rax")).findAny().get(); - assertEquals("rax=0102030405060708 rbx=1122334455667788 rcx=8877665544332211", actual); - } - } - - @Test - public void testQueryVirtual() { - // Also, an experiment to figure out how it works - try (ProcMaker maker = new ProcMaker(client,"notepad")) { - maker.start(); - - List collected1 = new ArrayList<>(); - try { - long last = 0; - long offset = 0; - do { - System.out.print(Long.toHexString(offset) + ": "); - DebugMemoryBasicInformation info = client.getDataSpaces().queryVirtual(offset); - System.out.println(info); - collected1.add(info); - last = offset; - offset += info.regionSize; - } - while (Long.compareUnsigned(last, offset) < 0); - } - catch (COMException e) { - if (!e.getMessage().contains("HRESULT: 80004002")) { - throw e; - } - } - - List collected2 = new ArrayList<>(); - for (DebugMemoryBasicInformation info : client.getDataSpaces().iterateVirtual(0)) { - collected2.add(info); - } - - assertTrue(collected1.size() > 0); - assertEquals(collected1, collected2); - } - } -*/ - - @Test - public void testModules() { - try (ProcMaker maker = new ProcMaker(client, "notepad")) { - maker.start(); - - HDMAUtil util = new HDMAUtil(access); - DebugHost host = util.getHost(); - DebugHostSymbols symbols = host.asSymbols(); - DebugHostSymbolEnumerator enumerator = - symbols.enumerateModules(util.getCurrentContext()); - DebugHostSymbol1 next; - while ((next = enumerator.getNext()) != null) { - DebugHostModule1 module = next.asModule(); - System.out.println(" Ctxt: " + module.getContext()); - System.out.println( - " Kind: " + SymbolKind.values()[module.getSymbolKind().ordinal()]); - System.out.println(" Load: " + module.getName().toString()); - DebugHostModule1 containingModule = module.getContainingModule(); - System.out.println(" CMod: " + containingModule); - - System.out.println(" Img: " + module.getImageName(true).toString()); - LOCATION base = module.getBaseLocation(); - System.out.println(" Base: " + Long.toHexString(base.Offset.longValue())); - module.getVersion(); - DebugHostModuleImpl1 impl = (DebugHostModuleImpl1) module; - System.out.println(" FVer: " + Long.toHexString(impl.getFileVersion())); - System.out.println(" Pvar: " + Long.toHexString(impl.getProductVersion())); - } - } - } - - @Test - public void testStack() { - try (ProcMaker maker = new ProcMaker(client, "notepad")) { - maker.start(); - - HDMAUtil util = new HDMAUtil(access); - ModelObject currentStack = util.getCurrentStack(); - ModelObject frames = currentStack.getKeyValue("Frames"); - List children = frames.getElements(); - for (ModelObject child : children) { - System.out.println(child); - Map map = child.getKeyValueMap(); - for (String key : map.keySet()) { - ModelObject value = map.get(key); - System.out.println(key + ":" + value); - if (value.getKind().equals(ModelObjectKind.OBJECT_PROPERTY_ACCESSOR)) { - Unknown v = (Unknown) value.getIntrinsicValue(); - System.out.println(v); - ModelPropertyAccessorInternal ifc = - ModelPropertyAccessorInternal.tryPreferredInterfaces(v::QueryInterface); - System.out.println(ifc); - ModelObject result = ifc.getValue("All", null); - System.out.println(result); - } - } - } - } - } - - @Test - public void testReadMemory() throws FileNotFoundException, IOException { - try (ProcMaker maker = new ProcMaker(client, "notepad")) { - maker.start(); - - int len = 256; - - HDMAUtil util = new HDMAUtil(access); - DebugHostContext currentContext = util.getCurrentContext(); - DebugHost host = util.getHost(); - DebugHostSymbols symbols = host.asSymbols(); - DebugHostModule1 module = symbols.findModuleByName(currentContext, "notepad"); - LOCATION base = module.getBaseLocation(); - System.out.println("Base: " + Long.toHexString(base.Offset.longValue())); - - DebugHostMemory1 memory = host.asMemory(); - - ByteBuffer data = ByteBuffer.allocate(len); - memory.readBytes(currentContext, base, data, len); - System.out.println(NumericUtilities.convertBytesToString(data.array())); - - // TODO: Avoid hardcoding path to notepad - try (FileInputStream fis = new FileInputStream("C:\\Windows\\notepad.exe")) { - byte[] fromFile = new byte[len]; - fis.read(fromFile); - System.out.println(NumericUtilities.convertBytesToString(fromFile)); - assertArrayEquals(fromFile, data.array()); - } - - //data.clear(); - //data.putInt(0x12345678); - //client.getDataSpaces().readVirtual(notepadModule.getBase(), data, data.remaining()); - //data.flip(); - - //assertEquals(0x12345678, data.getInt()); - } - } - - @Test - public void testScriptInterface() throws FileNotFoundException, IOException { - try (ProcMaker maker = new ProcMaker(client, "notepad")) { - maker.start(); - - client.getControl() - .execute(".load c:\\Software\\windbg\\amd64\\winext\\JSProvider.dll"); - client.getControl().execute(".load c:\\Software\\windbg\\amd64\\ttd\\TTDReplayCPU.dll"); - client.getControl().execute(".load c:\\Software\\windbg\\amd64\\ttd\\TTDAnalyze.dll"); - client.getControl().execute(".load c:\\Software\\windbg\\amd64\\ttd\\TtdExt.dll"); - client.getControl().execute("!tt 1:0"); - - HDMAUtil util = new HDMAUtil(access); - DebugHostContext currentContext = util.getCurrentContext(); - DebugHost host = util.getHost(); - DebugHostScriptHost scriptHost = host.asScriptHost(); - DataModelManager1 manager = util.getManager(); - DataModelScriptManager scriptManager = manager.asScriptManager(); - //DataModelScriptProvider jsProvider = - // scriptManager.findProviderForScriptType("JavaScript"); - DataModelScriptProviderEnumerator enumerator = - scriptManager.enumeratorScriptProviders(); - DataModelScriptProvider next; - while ((next = enumerator.getNext()) != null) { - System.out.println(next.getName()); - DataModelScriptTemplateEnumerator enumerator2 = next.enumerateTemplates(); - DataModelScriptTemplate nextTemplate; - while ((nextTemplate = enumerator2.getNext()) != null) { - System.out.println(nextTemplate.getName()); - System.out.println(nextTemplate.getDescription()); - } - } - } - } - - @Test - public void testBreakpoints() { - try (ProcMaker maker = new ProcMaker(client, "notepad")) { - maker.start(); - - DebugBreakpoint bpt = control.addBreakpoint(BreakType.CODE); - System.out.println("Breakpoint id: " + bpt.getId()); - System.out.println("Flags: " + bpt.getFlags()); - DebugBreakpoint bpt2 = control.getBreakpointById(bpt.getId()); - assertEquals(bpt, bpt2); - - HDMAUtil util = new HDMAUtil(access); - ModelObject currentProcess = util.getCurrentProcess(); - - ModelObject bpts = currentProcess.getKeyValue("Debug").getKeyValue("Breakpoints"); - List children = bpts.getElements(); - for (ModelObject child : children) { - //List gc = child.getChildren(); - Map pairs = child.getKeyValueMap(); - for (String key : pairs.keySet()) { - System.out.println(key); - } - } - - } - } - - @Test - public void testSymbols() { - try (ProcMaker maker = - new ProcMaker(client, "c:\\Users\\user\\Desktop\\ConsoleApplication1.exe")) { - maker.start(); - - DebugSymbols ds = client.getSymbols(); - System.out.println(ds.getSymbolPath()); - ds.setSymbolPath("srv*c:\\Symbols*https://msdl.microsoft.com/downloads/symbols"); - System.out.println(ds.getSymbolOptions()); - ds.setSymbolOptions(0x80000046); - - WrappedDbgModel dbgmodel = new WrappedDbgModel(access); - ModelObject symbolSettings = dbgmodel.getUtil().getSettings().getKeyValue("Symbols"); - ModelObject sympath = symbolSettings.getKeyValue("Sympath"); - sympath.getIntrinsicValue(); - List modules2 = dbgmodel.getDebugHostModules(); - for (DebugHostModule1 module : modules2) { - System.out.println(module.getName().toString()); - System.out.println(module.getSymbolKind()); - - List symbol0 = client.getSymbols().getSymbolIdsByName(""); - System.out.println(symbol0.size()); - - try { - DebugHostSymbolEnumerator enumerator = - module.enumerateChildren(SymbolKind.SYMBOL_PUBLIC, null); - if (enumerator != null) { - DebugHostSymbol1 next; - int count = 0; - while ((next = enumerator.getNext()) != null) { - - System.out.println(next.getName() + ":" + next.getSymbolKind()); - if (next.getSymbolKind().equals(SymbolKind.SYMBOL_PUBLIC)) { - DebugHostPublic pub = next.asPublic(); - try { - System.out.println(pub.getLocationKind()); - System.out.println(pub.getLocation().Offset); - } - catch (Exception e) { - e.printStackTrace(); - } - } - - count++; - } - System.out.println(count); - } - } - catch (Exception e) { - e.printStackTrace(); - } - } - - Set symbols = new LinkedHashSet<>(); - Set modules = new LinkedHashSet<>(); - for (DebugSymbolName sym : client.getSymbols().iterateSymbolMatches("*")) { - String[] parts = sym.name.split("!"); - symbols.add(sym); - modules.add(parts[0]); - } - System.out.println("Total Symbols: " + symbols.size()); - System.out.println("Total Modules (by symbol name): " + modules.size()); - - // These make assumptions that could be broken later. - // It used to expect at least 10 modules (devised when testing on Win7). Now it's 5! - assertTrue("Fewer than 1000 symbols: " + symbols.size(), symbols.size() > 1000); - assertTrue("Fewer than 3 modules: " + modules.size(), modules.size() > 3); - } - } - - //@Test(expected = COMException.class) - public void testModuleOutOfBounds() { - try (ProcMaker maker = new ProcMaker(client, "notepad")) { - maker.start(); - - DebugModule umod = client.getSymbols() - .getModuleByIndex(client.getSymbols().getNumberLoadedModules() + 1); - System.out.println(umod.getBase()); - } - } - - @Test - public void testQueryVirtualWithModule() { - try (ProcMaker maker = new ProcMaker(client, "notepad")) { - maker.start(); - - for (DebugMemoryBasicInformation info : client.getDataSpaces().iterateVirtual(0)) { - if (info.state != PageState.FREE) { - DebugModule mod = null; - String name = "[NONE]"; - try { - mod = client.getSymbols().getModuleByOffset(info.baseAddress, 0); - name = mod.getName(DebugModuleName.IMAGE); - } - catch (COMException e) { - name = "[ERR:" + e + "]"; - } - System.out.println(String.format("%016x", info.baseAddress) + ":" + - Long.toHexString(info.regionSize) + ":" + info.state + " from " + name + - " " + info.type + info.protect); - } - } - } - } - - @Test - public void testSymbolInfo() { - try (ProcMaker maker = new ProcMaker(client, "notepad")) { - maker.start(); - - int count = 0; - for (DebugSymbolId symid : client.getSymbols().getSymbolIdsByName("ntdll!*")) { - //System.out.println(symid); - DebugSymbolEntry syment = client.getSymbols().getSymbolEntry(symid); - if (syment.typeId != 0) { - System.out.println(" " + syment); - } - count++; - } - - assertTrue(count > 10); - } - } - - //@Test - public void testWriteMemory() { - try (ProcMaker maker = new ProcMaker(client, "notepad")) { - maker.start(); - - // TODO: How to write to protected memory? - // Debugger should be able to modify program code. - DebugMemoryBasicInformation writable = null; - space: for (DebugMemoryBasicInformation info : client.getDataSpaces() - .iterateVirtual(0)) { - for (PageProtection prot : info.protect) { - if (prot.isWrite()) { - writable = info; - break space; - } - } - } - if (writable == null) { - throw new AssertionError("No writable pages?"); - } - System.out.println("writable: " + writable); - ByteBuffer toWrite = ByteBuffer.allocate(10); - toWrite.putInt(0x12345678); - toWrite.putInt(0x89abcdef); - toWrite.putShort((short) 0x5555); - toWrite.flip(); - client.getDataSpaces().writeVirtual(writable.baseAddress, toWrite, toWrite.remaining()); - - ByteBuffer toRead = ByteBuffer.allocate(10); - client.getDataSpaces().readVirtual(writable.baseAddress, toRead, toRead.remaining()); - - assertArrayEquals(toWrite.array(), toRead.array()); - } - } - - /* - @Test - public void testFreezeUnfreeze() { - try (ProcMaker maker = new ProcMaker(client,"notepad")) { - maker.start(); - - // Trying to see if any events will help me track frozen threads - System.out.println("****Freezing"); - control.execute("~0 f"); - System.out.println("****Unfreezing"); - control.execute("~0 u"); - System.out.println("****Done"); - // Well, that result stinks. - // There is no event to tell me about frozenness - } - } - */ - - /* - @Test - @Ignore("I can't find a reliable means to detect the last thread. " + - "There's supposed to be an initial break, but it is rarely reported. " + - "I thought about toolhelp, but that presumes local live debugging.") - public void testMultiThreadAttach() throws Exception { - // I need to see how to attach to multi-threaded processes. There must be some event - // or condition to indicate when all threads have been discovered. - String specimen = - Application.getOSFile("sctldbgeng", "expCreateThreadSpin.exe").getCanonicalPath(); - client.setOutputCallbacks(new DebugOutputCallbacks() { - @Override - public void output(int mask, String text) { - System.out.print(text); - System.out.flush(); - } - }); - client.setEventCallbacks(new DebugEventCallbacksAdapter() { - @Override - public DebugStatus breakpoint(DebugBreakpoint bp) { - control.outln("*** Breakpoint: " + bp); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus exception(DebugExceptionRecord64 exception, boolean firstChance) { - control.outln("*** Exception: " + exception + "," + firstChance); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus createThread(DebugThreadInfo debugThreadInfo) { - control.outln("*** CreateThread: " + debugThreadInfo); - System.out.println("Threads: " + client.getSystemObjects().getThreads()); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus createProcess(DebugProcessInfo debugProcessInfo) { - control.outln("*** CreateProcess: " + debugProcessInfo); - System.out.println("Threads: " + client.getSystemObjects().getThreads()); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus exitThread(int exitCode) { - control.outln("*** ExitThread: code=" + exitCode + ", " + - client.getSystemObjects().getEventThread()); - System.out.println("Threads: " + client.getSystemObjects().getThreads()); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus exitProcess(int exitCode) { - control.outln("*** ExitProcess: code=" + exitCode + ", " + - client.getSystemObjects().getEventProcess()); - System.out.println("Threads: " + client.getSystemObjects().getThreads()); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus changeEngineState(BitmaskSet flags, - long argument) { - if (flags.contains(ChangeEngineState.EXECUTION_STATUS)) { - control.outln("*** ExecutionStatus: " + control.getExecutionStatus()); - } - return DebugStatus.NO_CHANGE; - } - }); - try (DummyProc proc = new DummyProc(specimen)) { - System.out.println("Started " + specimen + " with PID=" + proc.pid); - Thread.sleep(1000); - System.out.println("Attaching..."); - client.attachProcess(client.getLocalServer(), proc.pid, BitmaskSet.of()); - if (true) { - for (int i = 0; i < 10; i++) { - System.out.println("WAIT " + i + "..."); - control.waitForEvent(100); - System.out.println("STATUS: " + control.getExecutionStatus()); - System.out.println("DONE " + i); - // control.execute("~*"); - } - } - } - finally { - client.setEventCallbacks(null); - } - } - */ - - @Test - public void testPrompt() throws Exception { - - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/dbgmodel/NoisyDebugEventCallbacksAdapter.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/dbgmodel/NoisyDebugEventCallbacksAdapter.java deleted file mode 100644 index e80e57c3a1..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/dbgmodel/NoisyDebugEventCallbacksAdapter.java +++ /dev/null @@ -1,118 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel; - -import agent.dbgeng.dbgeng.*; -import agent.dbgeng.dbgeng.DebugClient.*; -import agent.dbgeng.dbgeng.util.DebugEventCallbacksAdapter; -import ghidra.comm.util.BitmaskSet; -import ghidra.util.Msg; - -public abstract class NoisyDebugEventCallbacksAdapter - extends DebugEventCallbacksAdapter { - - final DebugStatus defaultStatus; - - public NoisyDebugEventCallbacksAdapter(DebugStatus defaultStatus) { - this.defaultStatus = defaultStatus; - } - - @Override - public DebugStatus createProcess(DebugProcessInfo debugProcessInfo) { - Msg.info(this, "createProcess: " + debugProcessInfo); - return defaultStatus; - } - - @Override - public DebugStatus createThread(DebugThreadInfo debugThreadInfo) { - Msg.info(this, "createThread: " + debugThreadInfo); - return defaultStatus; - } - - @Override - public DebugStatus exitProcess(int exitCode) { - Msg.info(this, "exitProcess: " + Integer.toHexString(exitCode)); - return defaultStatus; - } - - @Override - public DebugStatus breakpoint(DebugBreakpoint bp) { - Msg.info(this, "breakpoint: " + bp); - return defaultStatus; - } - - @Override - public DebugStatus changeDebuggeeState(BitmaskSet flags, - long argument) { - Msg.info(this, "changeDebuggeeState: " + flags + ", " + Long.toHexString(argument)); - return defaultStatus; - } - - @Override - public DebugStatus changeEngineState(BitmaskSet flags, long argument) { - if (flags.contains(ChangeEngineState.EXECUTION_STATUS)) { - DebugStatus status = DebugStatus.values()[(int) (argument & 0x0_ffff_ffffL)]; - Msg.info(this, "changeEngineState: " + flags + ", " + - Long.toHexString(argument) + " (" + status + ")"); - } - else { - Msg.info(this, "changeEngineState: " + flags + ", " + Long.toHexString(argument)); - } - return defaultStatus; - } - - @Override - public DebugStatus changeSymbolState(BitmaskSet flags, long argument) { - Msg.info(this, "changeSymbolState: " + flags + ", " + Long.toHexString(argument)); - return defaultStatus; - } - - @Override - public DebugStatus exception(DebugExceptionRecord64 exception, boolean firstChance) { - Msg.info(this, "exception: " + exception + ", " + firstChance); - return defaultStatus; - } - - @Override - public DebugStatus exitThread(int exitCode) { - Msg.info(this, "exitThread: " + Integer.toHexString(exitCode)); - return defaultStatus; - } - - @Override - public DebugStatus loadModule(DebugModuleInfo debugModuleInfo) { - Msg.info(this, "loadModule: " + debugModuleInfo); - return defaultStatus; - } - - @Override - public DebugStatus sessionStatus(SessionStatus status) { - Msg.info(this, "sessionStatus: " + status); - return defaultStatus; - } - - @Override - public DebugStatus systemError(int error, int level) { - Msg.info(this, "systemError: " + error + ", " + level); - return defaultStatus; - } - - @Override - public DebugStatus unloadModule(String imageBaseName, long baseOffset) { - Msg.info(this, "unloadModule: " + imageBaseName + ", " + baseOffset); - return defaultStatus; - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/dbgmodel/ProcMaker.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/dbgmodel/ProcMaker.java deleted file mode 100644 index 73e3fe1cde..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/dbgmodel/ProcMaker.java +++ /dev/null @@ -1,116 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.dbgmodel; - -import static org.junit.Assert.assertNotNull; - -import java.util.Arrays; -import java.util.List; -import java.util.concurrent.CompletableFuture; - -import agent.dbgeng.dbgeng.*; -import agent.dbgeng.dbgeng.DebugClient.DebugStatus; -import ghidra.util.Msg; - -public class ProcMaker implements AutoCloseable { - final DebugClient client; - final DebugControl control; - final String cmdLine; - - final CompletableFuture procInfo = new CompletableFuture<>(); - final CompletableFuture threadInfo = new CompletableFuture<>(); - final CompletableFuture procExit = new CompletableFuture<>(); - - StringBuilder outputCapture = null; - - public ProcMaker(DebugClient client, String cmdLine) { - this.client = client; - this.cmdLine = cmdLine; - - this.control = client.getControl(); - } - - public void start() { - client.setEventCallbacks(new NoisyDebugEventCallbacksAdapter(DebugStatus.NO_CHANGE) { - @Override - public DebugStatus createProcess(DebugProcessInfo debugProcessInfo) { - super.createProcess(debugProcessInfo); - procInfo.complete(debugProcessInfo); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus createThread(DebugThreadInfo debugThreadInfo) { - super.createThread(debugThreadInfo); - threadInfo.complete(debugThreadInfo); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus exitProcess(int exitCode) { - super.exitProcess(exitCode); - procExit.complete(exitCode); - return DebugStatus.BREAK; - } - }); - client.setOutputCallbacks(new DebugOutputCallbacks() { - @Override - public void output(int mask, String text) { - System.out.print(text); - if (outputCapture != null) { - outputCapture.append(text); - } - } - }); - - Msg.debug(this, "Starting " + cmdLine + " with client " + client); - control.execute(".create " + cmdLine); - control.waitForEvent(); - DebugProcessInfo pi = procInfo.getNow(null); - assertNotNull(pi); - control.execute("g"); - control.waitForEvent(); - DebugThreadInfo ti = threadInfo.getNow(null); - assertNotNull(ti); - } - - public void kill() { - Msg.debug(this, "Killing " + cmdLine); - control.execute(".kill"); - control.waitForEvent(); - Integer exitCode = procExit.getNow(null); - client.setOutputCallbacks(null); - assertNotNull(exitCode); - } - - public List execCapture(String command) { - try { - outputCapture = new StringBuilder(); - control.execute(command); - return Arrays.asList(outputCapture.toString().split("\n")); - } - finally { - outputCapture = null; - } - } - - @Override - public void close() { - if (procInfo.isDone() && !procExit.isDone()) { - kill(); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmDbgmodelModelHost.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmDbgmodelModelHost.java deleted file mode 100644 index cc858c36d7..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmDbgmodelModelHost.java +++ /dev/null @@ -1,29 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.model.invm; - -import agent.dbgeng.dbgeng.DbgEngTest; -import agent.dbgeng.model.AbstractDbgengModelHost; -import agent.dbgmodel.DbgModelInJvmDebuggerModelFactory; -import ghidra.dbg.DebuggerModelFactory; - -public class InVmDbgmodelModelHost extends AbstractDbgengModelHost { - @Override - public DebuggerModelFactory getModelFactory() { - DbgEngTest.assumeDbgengDLLLoadable(); - return new DbgModelInJvmDebuggerModelFactory(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelBreakpointsTest.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelBreakpointsTest.java deleted file mode 100644 index 292677cf29..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelBreakpointsTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.model.invm; - -import org.junit.Ignore; - -import agent.dbgeng.model.AbstractModelForDbgengBreakpointsTest; -import ghidra.dbg.util.PathPattern; -import ghidra.dbg.util.PathUtils; - -@Ignore("deprecated") -public class InVmModelForDbgmodelBreakpointsTest extends AbstractModelForDbgengBreakpointsTest { - - @Override - protected PathPattern getBreakPattern() { - return new PathPattern(PathUtils.parse("Sessions[0x0].Processes[].Debug.Breakpoints[]")); - } - - @Override - public ModelHost modelHost() throws Throwable { - return new InVmDbgmodelModelHost(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelFactoryTest.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelFactoryTest.java deleted file mode 100644 index 9ba3704e44..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelFactoryTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.model.invm; - -import org.junit.Ignore; - -import agent.dbgeng.model.AbstractModelForDbgengFactoryTest; -import ghidra.dbg.testutil.TestDebuggerModelProvider.ModelHost.WithoutThreadValidation; - -@Ignore("deprecated") -public class InVmModelForDbgmodelFactoryTest extends AbstractModelForDbgengFactoryTest { - - @Override - public ModelHost modelHost() throws Throwable { - return new InVmDbgmodelModelHost(); - } - - @Override - public void validateCompletionThread() { - super.validateCompletionThread(); - } - - /** - * The externally-accessible fetchX methods are being invoked internally. Unfortunately, this - * demarcation was not made clear at the beginning, so now, adding a gate kicks internal object - * retrieval off the DebugClient thread, which spells disaster for synchronization. The "real - * fix" will be to write internal object retrieval methods. These internal implementations will - * probably be left to each particular model. Dbgeng/model should be able to implement them - * synchronously. External invocations will still need to be handed to the DebugClient thread - * asynchronously. For now, we're going to disable the assertion. - */ - @Override - public void testNonExistentPathGivesNull() throws Throwable { - try (WithoutThreadValidation wtv = m.withoutThreadValidation()) { - super.testNonExistentPathGivesNull(); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelFrameActivationTest.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelFrameActivationTest.java deleted file mode 100644 index b25273bace..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelFrameActivationTest.java +++ /dev/null @@ -1,38 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.model.invm; - -import org.junit.Ignore; - -import agent.dbgeng.model.AbstractModelForDbgengFrameActivationTest; -import ghidra.dbg.util.PathPattern; -import ghidra.dbg.util.PathUtils; - -@Ignore("deprecated") -public class InVmModelForDbgmodelFrameActivationTest - extends AbstractModelForDbgengFrameActivationTest { - - @Override - protected PathPattern getStackPattern() { - return new PathPattern( - PathUtils.parse("Sessions[0x0].Processes[].Threads[].Stack.Frames[]")); - } - - @Override - public ModelHost modelHost() throws Throwable { - return new InVmDbgmodelModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelInterpreterTest.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelInterpreterTest.java deleted file mode 100644 index 7c1cbeea9f..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelInterpreterTest.java +++ /dev/null @@ -1,89 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.model.invm; - -import static org.junit.Assert.assertNull; -import static org.junit.Assume.assumeTrue; - -import java.util.List; - -import org.junit.Ignore; -import org.junit.Test; - -import agent.dbgeng.model.AbstractModelForDbgengInterpreterTest; -import agent.dbgeng.model.WindowsSpecimen; -import agent.dbgeng.model.iface2.DbgModelTargetProcess; -import ghidra.dbg.target.TargetInterpreter; -import ghidra.dbg.target.TargetProcess; -import ghidra.dbg.test.AbstractDebuggerModelTest; -import ghidra.dbg.test.ProvidesTargetViaLaunchSpecimen; -import ghidra.dbg.util.PathUtils; - -@Ignore("deprecated") -public class InVmModelForDbgmodelInterpreterTest extends AbstractModelForDbgengInterpreterTest - implements ProvidesTargetViaLaunchSpecimen { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmDbgmodelModelHost(); - } - - @Override - public AbstractDebuggerModelTest getTest() { - return this; - } - - @Override - protected List seedPath() { - return PathUtils.parse(""); - } - - @Override - public List getExpectedInterpreterPath() { - return PathUtils.parse("Sessions[0x0]"); - } - - @Override - protected void ensureInterpreterAvailable() throws Throwable { - obtainTarget(); - } - - @Override - @Ignore - @Test - public void testAttachViaInterpreterShowsInProcessContainer() throws Throwable { - super.testAttachViaInterpreterShowsInProcessContainer(); - } - - @Override - @Test - public void testLaunchViaInterpreterShowsInProcessContainer() throws Throwable { - assumeTrue(m.hasProcessContainer()); - m.build(); - DbgModelTargetProcess initialTarget = (DbgModelTargetProcess) obtainTarget(); - - DebuggerTestSpecimen specimen = WindowsSpecimen.NOTEPAD; - assertNull(getProcessRunning(specimen, this)); - TargetInterpreter interpreter = findInterpreter(); - for (String line : specimen.getLaunchScript()) { - waitOn(interpreter.execute(line)); - } - TargetProcess process = retryForProcessRunning(specimen, this); - initialTarget.detach(); - - runTestKillViaInterpreter(process, interpreter); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelProcessActivationTest.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelProcessActivationTest.java deleted file mode 100644 index 386fead163..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelProcessActivationTest.java +++ /dev/null @@ -1,67 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.model.invm; - -import java.util.List; - -import org.junit.Ignore; - -import agent.dbgeng.model.AbstractModelForDbgengProcessActivationTest; -import ghidra.dbg.target.TargetInterpreter; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.util.PathPattern; -import ghidra.dbg.util.PathUtils; - -@Ignore("deprecated") -public class InVmModelForDbgmodelProcessActivationTest - extends AbstractModelForDbgengProcessActivationTest { - - @Override - protected PathPattern getProcessPattern() { - return new PathPattern(PathUtils.parse("Sessions[0x0].Processes[]")); - } - - @Override - public ModelHost modelHost() throws Throwable { - return new InVmDbgmodelModelHost(); - } - - @Override - public List getExpectedSessionPath() { - return PathUtils.parse("Sessions[0x0]"); - } - - @Override - public String getIdFromCapture(String line) { - return "0x" + line.split("\\s+")[3]; - } - - @Override - protected void activateViaInterpreter(TargetObject obj, TargetInterpreter interpreter) - throws Throwable { - String processId = obj.getName(); - processId = processId.substring(3, processId.length() - 1); - String output = waitOn(interpreter.executeCapture("|")); - String[] lines = output.split("\n"); - for (String l : lines) { - if (l.contains(processId)) { - processId = l.split("\\s+")[1]; - break; - } - } - waitOn(interpreter.execute("|" + processId + " s")); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelRootAttacherTest.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelRootAttacherTest.java deleted file mode 100644 index f5433dec39..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelRootAttacherTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.model.invm; - -import org.junit.Ignore; -import org.junit.Test; - -import agent.dbgeng.model.AbstractModelForDbgengRootAttacherTest; - -@Ignore("deprecated") -public class InVmModelForDbgmodelRootAttacherTest extends AbstractModelForDbgengRootAttacherTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmDbgmodelModelHost(); - } - - @Override - @Ignore - @Test - // Takes forever - passes w/ OTE on Memory in tear down - public void testAttachByPidThenResumeInterrupt() throws Throwable { - super.testAttachByPidThenResumeInterrupt(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelRootLauncherTest.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelRootLauncherTest.java deleted file mode 100644 index 3a0d73e902..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelRootLauncherTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.model.invm; - -import org.junit.Ignore; - -import agent.dbgeng.model.AbstractModelForDbgengRootLauncherTest; - -@Ignore("deprecated") -public class InVmModelForDbgmodelRootLauncherTest extends AbstractModelForDbgengRootLauncherTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmDbgmodelModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelScenarioCloneExitTest.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelScenarioCloneExitTest.java deleted file mode 100644 index 700d59213a..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelScenarioCloneExitTest.java +++ /dev/null @@ -1,29 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.model.invm; - -import org.junit.Ignore; - -import agent.dbgeng.model.AbstractModelForDbgengScenarioCloneExitTest; - -@Ignore("deprecated") -public class InVmModelForDbgmodelScenarioCloneExitTest - extends AbstractModelForDbgengScenarioCloneExitTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmDbgmodelModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelScenarioForkExitTest.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelScenarioForkExitTest.java deleted file mode 100644 index 7105156b4e..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelScenarioForkExitTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.model.invm; - -import org.junit.Ignore; -import org.junit.Test; - -import agent.dbgeng.model.AbstractModelForDbgengScenarioForkExitTest; - -@Ignore("deprecated") -public class InVmModelForDbgmodelScenarioForkExitTest - extends AbstractModelForDbgengScenarioForkExitTest { - - @Override - @Ignore("Specimen is currently defunct") - @Test - public void testScenario() throws Throwable { - } - - @Override - public ModelHost modelHost() throws Throwable { - return new InVmDbgmodelModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelScenarioMemoryTest.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelScenarioMemoryTest.java deleted file mode 100644 index 8c32893b3d..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelScenarioMemoryTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.model.invm; - -import java.util.*; - -import org.junit.Ignore; - -import agent.dbgeng.model.AbstractModelForDbgengScenarioMemoryTest; -import ghidra.dbg.target.TargetModule; -import ghidra.dbg.target.TargetProcess; -import ghidra.dbg.util.PathUtils; -import ghidra.program.model.address.Address; -import ghidra.program.model.address.AddressRange; - -@Ignore("deprecated") -public class InVmModelForDbgmodelScenarioMemoryTest - extends AbstractModelForDbgengScenarioMemoryTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmDbgmodelModelHost(); - } - - @Override - protected Address getAddressToWrite(TargetProcess process) throws Throwable { - // It seems this is the only test case that exercises module symbols. - List modulePath = PathUtils.extend(process.getPath(), - PathUtils.parse("Modules")); - Map, TargetModule> modules = m.findAll(TargetModule.class, modulePath, true); - Collection values = modules.values(); - TargetModule test = (TargetModule) values.toArray()[0]; - AddressRange range = - (AddressRange) test.fetchAttribute(TargetModule.RANGE_ATTRIBUTE_NAME).get(); - return range.getMinAddress().add(0x15000); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelScenarioStackTest.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelScenarioStackTest.java deleted file mode 100644 index e09e965598..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelScenarioStackTest.java +++ /dev/null @@ -1,38 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.model.invm; - -import org.junit.Ignore; - -import agent.dbgeng.model.AbstractModelForDbgengScenarioStackTest; -import ghidra.dbg.target.TargetProcess; -import ghidra.program.model.address.Address; - -@Ignore("deprecated") -public class InVmModelForDbgmodelScenarioStackTest extends AbstractModelForDbgengScenarioStackTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmDbgmodelModelHost(); - } - - @Override - protected void postLaunch(TargetProcess process) throws Throwable { - } - - @Override - protected void validateFramePC(int index, Address pc) { - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelScenarioX64RegistersTest.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelScenarioX64RegistersTest.java deleted file mode 100644 index afa5d300be..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelScenarioX64RegistersTest.java +++ /dev/null @@ -1,30 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.model.invm; - -import org.junit.Ignore; - -import agent.dbgeng.model.AbstractModelForDbgengScenarioX64RegistersTest; - -@Ignore("deprecated") -public class InVmModelForDbgmodelScenarioX64RegistersTest - extends AbstractModelForDbgengScenarioX64RegistersTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmDbgmodelModelHost(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelSessionActivationTest.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelSessionActivationTest.java deleted file mode 100644 index 1ef3e0a1f3..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelSessionActivationTest.java +++ /dev/null @@ -1,29 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.model.invm; - -import org.junit.Ignore; - -import agent.dbgeng.model.AbstractModelForDbgengSessionActivationTest; - -@Ignore("Don't know how to make multiple sessions, deprecated") -public class InVmModelForDbgmodelSessionActivationTest - extends AbstractModelForDbgengSessionActivationTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmDbgmodelModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelSteppableTest.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelSteppableTest.java deleted file mode 100644 index 0bfe92eb6b..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelSteppableTest.java +++ /dev/null @@ -1,29 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.model.invm; - -import org.junit.Ignore; - -import agent.dbgeng.model.AbstractModelForDbgengSteppableTest; - -@Ignore("deprecated") -public class InVmModelForDbgmodelSteppableTest extends AbstractModelForDbgengSteppableTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmDbgmodelModelHost(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelThreadActivationTest.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelThreadActivationTest.java deleted file mode 100644 index a697e4cc6d..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelThreadActivationTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.model.invm; - -import java.util.List; - -import org.junit.Ignore; - -import agent.dbgeng.model.AbstractModelForDbgengThreadActivationTest; -import ghidra.dbg.target.TargetInterpreter; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.util.PathPattern; -import ghidra.dbg.util.PathUtils; - -@Ignore("deprecated") -public class InVmModelForDbgmodelThreadActivationTest - extends AbstractModelForDbgengThreadActivationTest { - - @Override - protected PathPattern getThreadPattern() { - return new PathPattern(PathUtils.parse("Sessions[0x0].Processes[].Threads[]")); - } - - @Override - public ModelHost modelHost() throws Throwable { - return new InVmDbgmodelModelHost(); - } - - @Override - public List getExpectedSessionPath() { - return PathUtils.parse("Sessions[0x0]"); - } - - @Override - public String getIdFromCapture(String line) { - return "0x" + line.split("\\s+")[3].split("\\.")[1]; - } - - @Override - protected void activateViaInterpreter(TargetObject obj, TargetInterpreter interpreter) - throws Throwable { - String threadId = obj.getName(); - threadId = threadId.substring(3, threadId.length() - 1); - String output = waitOn(interpreter.executeCapture("~")); - String[] lines = output.split("\n"); - for (String l : lines) { - if (l.contains(threadId)) { - threadId = l.split("\\s+")[1]; - break; - } - } - waitOn(interpreter.execute("~" + threadId + " s")); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelX64RegistersTest.java b/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelX64RegistersTest.java deleted file mode 100644 index 92e2f750e5..0000000000 --- a/Ghidra/Debug/Debugger-agent-dbgmodel/src/test/java/agent/dbgmodel/model/invm/InVmModelForDbgmodelX64RegistersTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.dbgmodel.model.invm; - -import java.util.List; -import java.util.Map; - -import org.junit.Ignore; -import org.junit.Test; - -import agent.dbgeng.model.AbstractModelForDbgengX64RegistersTest; -import ghidra.dbg.util.PathUtils; - -@Ignore("deprecated") -public class InVmModelForDbgmodelX64RegistersTest extends AbstractModelForDbgengX64RegistersTest { - - public final Map REG_VALSX = Map.ofEntries( - Map.entry("rax", arr("0123456789abcdef")), - Map.entry("rdx", arr("fedcba9876543210"))); - - @Override - public ModelHost modelHost() throws Throwable { - return new InVmDbgmodelModelHost(); - } - - @Override - public boolean isRegisterBankAlsoContainer() { - return false; - } - - @Override - public List getExpectedRegisterBankPath(List threadPath) { - return PathUtils.extend(threadPath, List.of("Registers", "User")); - } - - @Override - public Map getRegisterWrites() { - return REG_VALSX; - } - - @Override - @Ignore - @Test - public void testRegistersHaveExpectedSizes() throws Throwable { - super.testRegistersHaveExpectedSizes(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/Module.manifest b/Ghidra/Debug/Debugger-agent-frida/Module.manifest deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/Ghidra/Debug/Debugger-agent-frida/README.md b/Ghidra/Debug/Debugger-agent-frida/README.md deleted file mode 100644 index 633598a024..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# Debugger-agent-frida - -## Random Notes on the Implementation of Debugger-agent-frida - -Building libfrida-core.so: -* You can download libfrida-core.a for Frida by grabbing the latest frida-core-devkit for your OS - from https://github.com/frida/frida/releases or by downloading the Frida source and running: - `python3 devkit.py frida-core linux-x86_64 DEVKIT` from the `releng` directory. - -Ghidra needs a dynamically-loadable version of libfrida-core.a which you can generate by something like: -```bash -cp ghidra_wrapper.c into the directory with libfrida-core.a and frida-core.h (distro or DEVKIT) -g++ -shared ghidra_wrapper.c ./libfrida-core.a -o libfrida-core.so -``` - -Libfrida-core.so should then be added to the `j`na.library.path`or put someplace like -`/usr/lib/x86_64-linux-gnu`, where it will get picked up by `Native.load()`. - -### Frida Functionality -The most interesting bits of Frida are available as "methods" from the Objects Tree. For instance, -if you select a function and hit `M`, you will get a dialog with available methods. Selecting, -for example, `intercept` will bring up a second dialog with the relevant parameters. For many of -these, you will want to provide your own Javascript `on` functions, e.g. `onEnter` for the -Interceptor. Stalking is available on Threads and the individual thread entries. Scan, protect, and -watch functions are available on Memory. You can also redirect the output to GhidraScript, although -this relies on a bit of a hack. If your Javascript `Name` parameter is something like -`interpreter`, prepend `interpreter<=` to the output from your Javascript, and the results will be -passed to both the console and the script. - -### State in Frida -Commands in Frida are, generally speaking, not state-dependent, i.e. they do not depend on whether -the target is running or not, only on whether the frida-agent thread is running. Many of the -gum-based commands do, however, depend on ptrace. If you have a ptrace-based debugger attached to -the target, they will time out. You can attach a debugger after Frida, but you will have to detach -it to regain the gum-based functionality. "Detach" in most debuggers includes "resume", so it is -difficult to get state other than the "initial" state from the frida-agent injection point. It -would be nice if "disconnect" worked, but "disconnect" (i.e. detach without resuming) also leaves -Frida in a partially disabled state. - -### Errors in Frida -The cloaking logic in Frida, e.g. in `gum_cloak_add_thread` and `gum_cloak_index_of_thread`, is -broken as of the writing of this note. `gum_cloak_add_thread` is called for every thread, and -`gum_cloak_index_of_thread` returns a non-negative result for every call but the first. As a -result, every thread but one is cloaked, and `enumerateThreads`returns only a single thread. This is -documented in `Issue #625` for the frida-gum project. A quick fix is to comment out the cloaking -call in `frida-gum/gum/gumprocess.c::gum_emit_thread_if_not_cloaked`. Obviously, this may have -other undesirable effects, but... - -The logic in the ordering of exception handlers also appears to be broken (`Issue #627`). New -handlers are appended to the queue, in most cases after `gum_exceptor_handle_scope_exception` and -`gum_quick_core_handle_crashed_js`. `gum_exceptor_handle_scope_exception` almost always returns -`TRUE`, breaking out of the queue and causing any remaining handlers to be ignored. This means any -handler added with `Process.setExceptionHandler` is likely to be ignored. A quick fix is to modify -`gum_exceptor_add` to use `g_slist_prepend instead` of `g_slist_append`. - -Not really an error, but worth noting: building `libfrida-core.so` from the source may result in a -library with glib2.0 dependencies that are incompatible with the current version of Eclipse. The -not-so-simple solution is to build Eclipse on the machine that you used to build `libfrida-core`. diff --git a/Ghidra/Debug/Debugger-agent-frida/build.gradle b/Ghidra/Debug/Debugger-agent-frida/build.gradle deleted file mode 100644 index 2537a86cd6..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/build.gradle +++ /dev/null @@ -1,55 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -apply from: "$rootProject.projectDir/gradle/javaProject.gradle" -apply from: "$rootProject.projectDir/gradle/jacocoProject.gradle" -apply from: "$rootProject.projectDir/gradle/javaTestProject.gradle" -apply from: "$rootProject.projectDir/gradle/nativeProject.gradle" -apply from: "$rootProject.projectDir/gradle/distributableGhidraModule.gradle" - -apply from: "$rootProject.projectDir/gradle/debugger/hasExecutableJar.gradle" - -apply plugin: 'eclipse' -eclipse.project.name = 'Debug Debugger-agent-frida' - -dependencies { - api project(':Framework-AsyncComm') - api project(':Framework-Debugging') - api project(':Debugger') - api project(':Debugger-gadp') - - testImplementation project(path: ':Framework-AsyncComm', configuration: 'testArtifacts') - testImplementation project(path: ':Framework-Debugging', configuration: 'testArtifacts') - testImplementation project(path: ':Debugger-gadp', configuration: 'testArtifacts') -} - -tasks.nodepJar { - manifest { - attributes['Main-Class'] = 'agent.lldb.gadp.FridaGadpServer' - } -} - -tasks.executableJar { - ext.outjar = file("${buildDir}/bin/gadp-agent-frida") -} - -test { - if ("linux_x86_64".equals(getCurrentPlatformName())) { - dependsOn(":Framework-Debugging:testSpecimenLinux_x86_64") - } - if ("mac_x86_64".equals(getCurrentPlatformName())) { - dependsOn(":Framework-Debugging:testSpecimenMac_x86_64") - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/certification.manifest b/Ghidra/Debug/Debugger-agent-frida/certification.manifest deleted file mode 100644 index 39d62132cd..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/certification.manifest +++ /dev/null @@ -1,12 +0,0 @@ -##VERSION: 2.0 -##MODULE IP: Apache License 2.0 -##MODULE IP: Apache License 2.0 with LLVM Exceptions -Module.manifest||GHIDRA||||END| -README.md||GHIDRA||||END| -build.gradle||GHIDRA||||END| -data/scripts/onAccess.js||GHIDRA||||END| -data/scripts/onAccessExt.js||GHIDRA||||END| -data/scripts/onCallSummary.js||GHIDRA||||END| -data/scripts/onEnter.js||GHIDRA||||END| -data/scripts/onLeave.js||GHIDRA||||END| -data/scripts/onReceive.js||GHIDRA||||END| diff --git a/Ghidra/Debug/Debugger-agent-frida/data/scripts/onAccess.js b/Ghidra/Debug/Debugger-agent-frida/data/scripts/onAccess.js deleted file mode 100644 index f5c36eb3b1..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/data/scripts/onAccess.js +++ /dev/null @@ -1,5 +0,0 @@ -onAccess: function(details) { - console.log(details.from + " " + details.operation + " " + details.address); - console.log("pages: completed=" + details.pagesCompleted + " total=" + details.pageTotal); -} - diff --git a/Ghidra/Debug/Debugger-agent-frida/data/scripts/onAccessExt.js b/Ghidra/Debug/Debugger-agent-frida/data/scripts/onAccessExt.js deleted file mode 100644 index 00604973b5..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/data/scripts/onAccessExt.js +++ /dev/null @@ -1,18 +0,0 @@ -function monitorMemory(base, length, interceptedInstructions = new Set()) { - const baseAddress = ptr(base.toString()); - MemoryAccessMonitor.enable({ base: baseAddress, size: length }, { - onAccess: function(details) { - console.log(details.from + " " + details.operation + " " + details.address); - let instruction = Instruction.parse(details.from); - const nextInstr = ptr(instruction.next.toString()); - if (interceptedInstructions.has(nextInstr.toString())) { - return; - } - interceptedInstructions.add(nextInstr.toString()); - Interceptor.attach(nextInstr, function(_) { - monitorMemory(baseAddress, length, inteceptedInstructions); - }); - } - }); -} - diff --git a/Ghidra/Debug/Debugger-agent-frida/data/scripts/onCallSummary.js b/Ghidra/Debug/Debugger-agent-frida/data/scripts/onCallSummary.js deleted file mode 100644 index 3d0a0ba4d7..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/data/scripts/onCallSummary.js +++ /dev/null @@ -1 +0,0 @@ -onCallSummary(summary) { console.log(JSON.stringify(summary)); } diff --git a/Ghidra/Debug/Debugger-agent-frida/data/scripts/onEnter.js b/Ghidra/Debug/Debugger-agent-frida/data/scripts/onEnter.js deleted file mode 100644 index fc6bc94ae3..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/data/scripts/onEnter.js +++ /dev/null @@ -1,2 +0,0 @@ -onEnter: function(args) {console.log("entering");} - diff --git a/Ghidra/Debug/Debugger-agent-frida/data/scripts/onLeave.js b/Ghidra/Debug/Debugger-agent-frida/data/scripts/onLeave.js deleted file mode 100644 index 1e2d8790cf..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/data/scripts/onLeave.js +++ /dev/null @@ -1,2 +0,0 @@ -onEnter: function(args) {console.log("intercept=>leaving");} - diff --git a/Ghidra/Debug/Debugger-agent-frida/data/scripts/onReceive.js b/Ghidra/Debug/Debugger-agent-frida/data/scripts/onReceive.js deleted file mode 100644 index 51b47bbb3e..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/data/scripts/onReceive.js +++ /dev/null @@ -1 +0,0 @@ -onReceive(events) { console.log(JSON.stringify(events)); } diff --git a/Ghidra/Debug/Debugger-agent-frida/ghidra_scripts/FridaTestScript.java b/Ghidra/Debug/Debugger-agent-frida/ghidra_scripts/FridaTestScript.java deleted file mode 100644 index fd184ec4f4..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/ghidra_scripts/FridaTestScript.java +++ /dev/null @@ -1,24 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import ghidra.app.script.GhidraScript; - -public class FridaTestScript extends GhidraScript { - @Override - protected void run() throws Exception { - String[] args = getScriptArgs(); - System.err.println("scriptOutput: "+args[0]); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/cpp/ghidra_wrapper.c b/Ghidra/Debug/Debugger-agent-frida/src/main/cpp/ghidra_wrapper.c deleted file mode 100644 index 5b7b8fafe5..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/cpp/ghidra_wrapper.c +++ /dev/null @@ -1,216 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "frida-core.h" -#include -#include - -extern "C" { - -void GH_frida_init (void) { - frida_init (); -} - -FridaDeviceManager * GH_frida_device_manager_new (void) { - return frida_device_manager_new(); -} - -void GH_frida_device_manager_close_sync (FridaDeviceManager * self, GCancellable * cancellable, GError ** error) { - frida_device_manager_close_sync(self, cancellable, error); -} - - -FridaDevice * GH_frida_device_manager_find_device_by_type_sync (FridaDeviceManager * self, FridaDeviceType type, gint timeout, GCancellable * cancellable, GError ** error) { - return frida_device_manager_find_device_by_type_sync(self, type, timeout, cancellable, error); -} - -FridaDevice * GH_frida_device_manager_find_device_by_id_sync (FridaDeviceManager * self, const gchar * id, gint timeout, GCancellable * cancellable, GError ** error) { - return frida_device_manager_find_device_by_id_sync(self, id, timeout, cancellable, error); -} - -FridaDeviceList * GH_frida_device_manager_enumerate_devices_sync (FridaDeviceManager * self, GCancellable * cancellable, GError ** error) { - return frida_device_manager_enumerate_devices_sync(self, cancellable, error); -} - -gint GH_frida_device_list_size (FridaDeviceList * self) { - return frida_device_list_size (self); -} - -FridaDevice * GH_frida_device_list_get (FridaDeviceList * self, gint index) { - return frida_device_list_get(self, index); -} - -const gchar * GH_frida_device_get_id (FridaDevice * self) { - return frida_device_get_id(self); -} - -const gchar * GH_frida_device_get_name (FridaDevice * self) { - return frida_device_get_name(self); -} - - -FridaProcessList * GH_frida_device_enumerate_processes_sync (FridaDevice * self, FridaProcessQueryOptions * options, GCancellable * cancellable, GError ** error) { - return frida_device_enumerate_processes_sync(self, options, cancellable, error); -} - -/* ProcessList */ -gint GH_frida_process_list_size (FridaProcessList * self) { - return frida_process_list_size(self); -} - -FridaProcess * GH_frida_process_list_get (FridaProcessList * self, gint index) { - return frida_process_list_get(self, index); -} - -/* Process */ -guint GH_frida_process_get_pid (FridaProcess * self) { - return frida_process_get_pid(self); -} - -const gchar * GH_frida_process_get_name (FridaProcess * self) { - return frida_process_get_name(self); -} - -GHashTable * GH_frida_process_get_parameters (FridaProcess * self) { - return frida_process_get_parameters(self); -} - - -FridaApplicationList * GH_frida_device_enumerate_applications_sync (FridaDevice * self, FridaApplicationQueryOptions * options, GCancellable * cancellable, GError ** error) { - return frida_device_enumerate_applications_sync(self, options, cancellable, error); -} - -/* ApplicationList */ -gint GH_frida_application_list_size (FridaApplicationList * self) { - return frida_application_list_size(self); -} - -FridaApplication * GH_frida_application_list_get (FridaApplicationList * self, gint index) { - return frida_application_list_get(self, index); -} - -/* Application */ -const gchar * GH_frida_application_get_identifier (FridaApplication * self) { - return frida_application_get_identifier(self); -} - -const gchar * GH_frida_application_get_name (FridaApplication * self) { - return frida_application_get_name(self); -} - -guint GH_frida_application_get_pid (FridaApplication * self) { - return frida_application_get_pid(self); -} - -GHashTable * GH_frida_application_get_parameters (FridaApplication * self) { - return frida_application_get_parameters(self); -} - - -FridaSession * GH_frida_device_attach_sync (FridaDevice * self, guint pid, FridaSessionOptions * options, GCancellable * cancellable, GError ** error) { - return frida_device_attach_sync(self, pid, options, cancellable, error); -} - -guint GH_frida_device_spawn_sync (FridaDevice * self, const gchar * program, FridaSpawnOptions * options, GCancellable * cancellable, GError ** error) { - return frida_device_spawn_sync(self, program, options, cancellable, error); -} - -/* Session */ -guint GH_frida_session_get_pid (FridaSession * self) { - return frida_session_get_pid(self); -} - -FridaProcess * GH_frida_device_get_process_by_pid_sync (FridaDevice * self, guint pid, FridaProcessMatchOptions * options, GCancellable * cancellable, GError ** error) { - return frida_device_get_process_by_pid_sync(self, pid, options, cancellable, error); -} - -void GH_frida_device_resume_sync (FridaDevice * self, guint pid, GCancellable * cancellable, GError ** error) { - frida_device_resume_sync(self, pid, cancellable, error); -} - -void GH_frida_device_kill_sync (FridaDevice * self, guint pid, GCancellable * cancellable, GError ** error) { - frida_device_kill_sync(self, pid, cancellable, error); -} - - -gboolean GH_frida_session_is_detached (FridaSession * self) { - return frida_session_is_detached(self); - -} - -void GH_frida_session_detach_sync (FridaSession * self, GCancellable * cancellable, GError ** error) { - frida_session_detach_sync(self, cancellable, error); -} - -void GH_frida_session_resume_sync (FridaSession * self, GCancellable * cancellable, GError ** error) { - frida_session_resume_sync(self, cancellable, error); -} - - -/* ScriptOptions */ -FridaScriptOptions * GH_frida_script_options_new (void) { - return frida_script_options_new(); -} - -void GH_frida_script_options_set_name (FridaScriptOptions * self, const gchar * value) { - frida_script_options_set_name(self, value); -} - -void GH_frida_script_options_set_runtime (FridaScriptOptions * self, FridaScriptRuntime value) { - frida_script_options_set_runtime(self, value); -} - -FridaScript * GH_frida_session_create_script_sync (FridaSession * self, const gchar * source, FridaScriptOptions * options, GCancellable * cancellable, GError ** error) { - return frida_session_create_script_sync(self, source, options, cancellable, error); -} - -/* Object lifetime */ -void GH_frida_unref (gpointer obj) { - frida_unref(obj); -} - -/* Script */ -void GH_frida_script_load_sync (FridaScript * self, GCancellable * cancellable, GError ** error) { - frida_script_load_sync(self, cancellable, error); -} - -void GH_frida_script_unload_sync (FridaScript * self, GCancellable * cancellable, GError ** error) { - frida_script_unload_sync(self, cancellable, error); -} - -void GH_frida_session_enable_debugger_sync (FridaSession * self, guint16 port, GCancellable * cancellable, GError ** error) { - frida_session_enable_debugger_sync(self, port, cancellable, error); -} - - -gulong GH_g_signal_connect_data (gpointer instance, const gchar *detailed_signal, GCallback c_handler, gpointer data, GClosureNotify destroy_data, GConnectFlags connect_flags) { - return g_signal_connect_data(instance, detailed_signal, c_handler, data, destroy_data, connect_flags); -} - -void GH_g_signal_handler_disconnect (gpointer instance, gulong handler_id) { - g_signal_handler_disconnect(instance, handler_id); -} - -void GH_g_signal_emit_by_name (FridaHostSession *session, const gchar *signal_name, const gchar *message) { - g_signal_emit_by_name(session, signal_name, message); -} - -guint GH_g_signal_new (const gchar *signal_name, GType itype, GSignalFlags signal_flags, guint class_offset, GSignalAccumulator accumulator, gpointer accu_data, GSignalCMarshaller c_marshaller, GType return_type, guint n_params, ...) { - va_list args; - va_start(args, n_params); - return g_signal_new(signal_name, itype, signal_flags, class_offset, accumulator, accu_data, c_marshaller, return_type, n_params, args); -} - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/FridaInJvmDebuggerModelFactory.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/FridaInJvmDebuggerModelFactory.java deleted file mode 100644 index a319117896..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/FridaInJvmDebuggerModelFactory.java +++ /dev/null @@ -1,55 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida; - -import java.util.concurrent.CompletableFuture; - -import agent.frida.model.impl.FridaModelImpl; -import ghidra.dbg.DebuggerModelFactory; -import ghidra.dbg.DebuggerObjectModel; -import ghidra.dbg.util.ConfigurableFactory.FactoryDescription; -import ghidra.program.model.listing.Program; - -@FactoryDescription( - brief = "PROTOTYPE: Frida", - htmlDetails = """ - Connect to Frida. - This is an experimental connector. Use at your own risk. - This will access the native API, which may put Ghidra's JVM at risk.""") -public class FridaInJvmDebuggerModelFactory implements DebuggerModelFactory { - - @Override - public CompletableFuture build() { - FridaModelImpl model = new FridaModelImpl(); - return model.startFrida(new String[] {}).thenApply(__ -> model); - } - - @Override - public int getPriority(Program program) { - String osname = System.getProperty("os.name").toLowerCase(); - if (!(osname.contains("mac os x") || osname.contains("linux") || - osname.contains("windows"))) { - return -1; - } - if (program != null) { - String exe = program.getExecutablePath(); - if (exe == null || exe.isBlank()) { - return -1; - } - } - return 30; - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/frida/FridaClient.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/frida/FridaClient.java deleted file mode 100644 index 74a9add7ba..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/frida/FridaClient.java +++ /dev/null @@ -1,397 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.frida; - -import java.util.List; -import java.util.Map; - -import agent.frida.manager.*; -import ghidra.comm.util.BitmaskUniverse; -import ghidra.dbg.target.TargetExecutionStateful.TargetExecutionState; - -/** - * A wrapper for FridaDebugger - */ -public interface FridaClient extends FridaClientReentrant { - - /** - * Create a debug client. - * - * @return a new client - */ - public static FridaClient debugCreate() { - return new FridaClientImpl(); - } - - public static enum ExecutionState { - RUNNING, STOPPED; - } - - public static enum DebugStatus { - NO_CHANGE(false, null, 13), // - GO(true, ExecutionState.RUNNING, 10), // - GO_HANDLED(true, ExecutionState.RUNNING, 9), // - GO_NOT_HANDLED(true, ExecutionState.RUNNING, 8), // - STEP_OVER(true, ExecutionState.RUNNING, 7), // - STEP_INTO(true, ExecutionState.RUNNING, 5), // - BREAK(false, ExecutionState.STOPPED, 0), // - NO_DEBUGGEE(true, null, 1), // shouldWait is true to handle process creation - STEP_BRANCH(true, ExecutionState.RUNNING, 6), // - IGNORE_EVENT(false, null, 11), // - RESTART_REQUESTED(true, null, 12), // - REVERSE_GO(true, null, 0xff), // - REVERSE_STEP_BRANCH(true, null, 0xff), // - REVERSE_STEP_OVER(true, null, 0xff), // - REVERSE_STEP_INTO(true, null, 0xff), // - OUT_OF_SYNC(false, null, 2), // - WAIT_INPUT(false, null, 3), // - TIMEOUT(false, null, 4), // - ; - - public static final long MASK = 0xaf; - public static final long INSIDE_WAIT = 0x100000000L; - public static final long WAIT_TIMEOUT = 0x200000000L; - - DebugStatus(boolean shouldWait, ExecutionState threadState, int precedence) { - this.shouldWait = shouldWait; - this.threadState = threadState; - this.precedence = precedence; - } - - public final boolean shouldWait; - public final ExecutionState threadState; - public final int precedence; // 0 is highest - - public static DebugStatus fromArgument(FridaState state) { - if (state == null) { - return DebugStatus.NO_DEBUGGEE; - } - switch (state) { - case FRIDA_THREAD_UNINTERRUPTIBLE: - return DebugStatus.GO; - case FRIDA_THREAD_STOPPED: - return DebugStatus.BREAK; - case FRIDA_THREAD_RUNNING: - return DebugStatus.GO; - //case 7: // eStateStepping - // return DebugStatus.STEP_INTO; - case FRIDA_THREAD_HALTED: - case FRIDA_THREAD_WAITING: - return DebugStatus.NO_DEBUGGEE; - default: - return DebugStatus.NO_CHANGE; - } - } - - } - - public static enum SessionStatus { - ACTIVE, // - END_SESSION_ACTIVE_TERMINATE,// - END_SESSION_ACTIVE_DETACH, // - END_SESSION_PASSIVE, // - END, // - REBOOT, // - HIBERNATE, // - FAILURE, // - ; - } - - public static enum ChangeSessionState implements BitmaskUniverse { - SESSION_ALL(0xffffffff), // - ; - - private ChangeSessionState(long eBroadcastBitBreakpointChanged) { - this.mask = (int) eBroadcastBitBreakpointChanged; - } - - private final int mask; - - @Override - public long getMask() { - return mask; - } - } - - public static enum ChangeProcessState implements BitmaskUniverse { - PROCESS_ALL(0xffffffff), // - ; - - private ChangeProcessState(long eBroadcastBitStateChanged) { - this.mask = (int) eBroadcastBitStateChanged; - } - - private final int mask; - - @Override - public long getMask() { - return mask; - } - } - - public static enum ChangeThreadState implements BitmaskUniverse { - THREAD_ALL(0xffffffff), // - ; - - private ChangeThreadState(long eBroadcastBitStackChanged) { - this.mask = (int) eBroadcastBitStackChanged; - } - - private final int mask; - - @Override - public long getMask() { - return mask; - } - } - - public static enum DebugAttachFlags implements BitmaskUniverse { - DEFAULT(0), // - NONINVASIVE(1 << 0), // - EXISTING(1 << 1), // - NONINVASIVE_NO_SUSPEND(1 << 2), // - INVASIVE_NO_INITIAL_BREAK(1 << 3), // - INVASIVE_RESUME_PROCESS(1 << 4), // - NONINVASIVE_ALLOW_PARTIAL(1 << 5), // - ; - - DebugAttachFlags(int mask) { - this.mask = mask; - } - - private final int mask; - - @Override - public long getMask() { - return mask; - } - } - - public static enum DebugCreateFlags implements BitmaskUniverse { - LAUNCH_DEFAULT(0), // - LAUNCH_EXEC(1 << 0), // - LAUNCH_DEBUG(1 << 1), // - LAUNCH_STOP_AT_ENTRY(1 << 2), // - LAUNCH_DISABLE_ASLR(1 << 3), // - LAUNCH_DISABLE_STDIO(1 << 4), // - LAUNCH_IN_TTY(1 << 5), // - LAUNCH_IN_SHELL(1 << 6), // - LAUNCH_IN_SEP_GROUP(1 << 7), // - LAUNCH_DONT_SET_EXIT_STATUS(1 << 8), // - LAUNCH_DETACH_ON_ERROR(1 << 9), // - LAUNCH_SHELL_EXPAND_ARGS(1 << 10), // - LAUNCH_CLOSE_TTY_ON_EXIT(1 << 11), // - LAUNCH_INHERIT_FROM_PARENT(1 << 12) // - ; - - DebugCreateFlags(int mask) { - this.mask = mask; - } - - private final int mask; - - @Override - public long getMask() { - return mask; - } - } - - public enum DebugEndSessionFlags { - DEBUG_END_PASSIVE(0x00000000), - DEBUG_END_ACTIVE_TERMINATE(0x00000001), - DEBUG_END_ACTIVE_DETACH(0x00000002), - DEBUG_END_REENTRANT(0x00000003), - DEBUG_END_DISCONNECT(0x00000004); - - DebugEndSessionFlags(int value) { - this.value = value; - } - - private final int value; - - public long getValue() { - return value; - } - } - - public enum DebugOutputFlags { - DEBUG_OUTPUT_NORMAL(0x1), // - DEBUG_OUTPUT_ERROR(0x2), // - DEBUG_OUTPUT_WARNING(0x4), // - DEBUG_OUTPUT_VERBOSE(0x8), // - DEBUG_OUTPUT_PROMPT(0x10), // - DEBUG_OUTPUT_PROMPT_REGISTERS(0x20), // - DEBUG_OUTPUT_EXTENSION_WARNING(0x40), // - DEBUG_OUTPUT_DEBUGGEE(0x80), // - DEBUG_OUTPUT_DEBUGGEE_PROMPT(0x100), // - DEBUG_OUTPUT_SYMBOLS(0x200); - - DebugOutputFlags(int value) { - this.value = value; - } - - private final int value; - - public long getValue() { - return value; - } - } - - public static String getModelKey(Object modelObject) { - if (modelObject == null) { - return null; - } - return modelObject.getClass() + ":" + getId(modelObject); - } - - public static String getId(Object modelObject) { - if (modelObject instanceof FridaTarget) { - FridaTarget target = (FridaTarget) modelObject; - return target.getId(); - } - if (modelObject instanceof FridaSession) { // global - FridaSession session = (FridaSession) modelObject; - return Integer.toHexString(session.getProcess().getPID().intValue()); - } - if (modelObject instanceof FridaProcess) { // global - FridaProcess process = (FridaProcess) modelObject; - return Long.toHexString(process.getPID()); - } - if (modelObject instanceof FridaThread) { // global - FridaThread thread = (FridaThread) modelObject; - return Long.toHexString(thread.getTid()); - } - if (modelObject instanceof FridaFrame) { - FridaFrame frame = (FridaFrame) modelObject; - return Long.toString(frame.getFrameID()); - } - if (modelObject instanceof FridaValue) { - FridaValue val = (FridaValue) modelObject; - return val.getKey(); - } - if (modelObject instanceof FridaModule) { - FridaModule module = (FridaModule) modelObject; - return module.getName(); - } - if (modelObject instanceof FridaSection) { - FridaSection section = (FridaSection) modelObject; - return section.getRangeAddress(); - } - if (modelObject instanceof FridaMemoryRegionInfo) { - FridaMemoryRegionInfo region = (FridaMemoryRegionInfo) modelObject; - return region.getRangeAddress(); - } - if (modelObject instanceof FridaSymbol) { - FridaSymbol sym = (FridaSymbol) modelObject; - return sym.getName(); - } - if (modelObject instanceof FridaImport) { - FridaImport imp = (FridaImport) modelObject; - return imp.getName(); - } - if (modelObject instanceof FridaExport) { - FridaExport exp = (FridaExport) modelObject; - return exp.getName(); - } - if (modelObject instanceof FridaFunction) { - FridaFunction fn = (FridaFunction) modelObject; - return fn.getFunctionName(); - } - if (modelObject instanceof FridaFileSpec) { - FridaFileSpec spec = (FridaFileSpec) modelObject; - return spec.getPath(); - } - throw new RuntimeException("Unknown object " + modelObject.getClass()); - } - - public static TargetExecutionState convertState(FridaState state) { - if (state == null) { - return TargetExecutionState.STOPPED; - } - switch (state) { - case FRIDA_THREAD_RUNNING: - return TargetExecutionState.RUNNING; - case FRIDA_THREAD_WAITING: - return TargetExecutionState.INACTIVE; - case FRIDA_THREAD_UNINTERRUPTIBLE: - return TargetExecutionState.ALIVE; - case FRIDA_THREAD_STOPPED: - return TargetExecutionState.STOPPED; - case FRIDA_THREAD_HALTED: - return TargetExecutionState.TERMINATED; - default: - return TargetExecutionState.STOPPED; - } - } - - public static FridaState convertState(TargetExecutionState state) { - switch (state) { - case RUNNING: - return FridaState.FRIDA_THREAD_RUNNING; - case INACTIVE: - return FridaState.FRIDA_THREAD_WAITING; - case ALIVE: - return FridaState.FRIDA_THREAD_UNINTERRUPTIBLE; - case STOPPED: - return FridaState.FRIDA_THREAD_STOPPED; - case TERMINATED: - return FridaState.FRIDA_THREAD_HALTED; - default: - return FridaState.FRIDA_THREAD_STOPPED; - } - } - - /** - * The ID for the local server - * - * @return the ID - */ - FridaServerId getLocalServer(); - - FridaSession attachProcess(FridaServerId si, int keyType, String key, boolean wait, - boolean async); - - FridaSession createProcess(FridaServerId si, String fileName); - - FridaSession createProcess(FridaServerId si, String fileName, - List args, List envp, String workingDir); - - FridaSession createProcess(FridaServerId si, String fileName, List args, - List envp, - List pathsIO, - String workingDir, long createFlags, boolean stopAtEntry); - - void terminateCurrentProcess(FridaTarget target); - - void destroyCurrentProcess(FridaTarget target); - - void detachCurrentProcess(FridaTarget target); - - FridaTarget connectSession(String commandLine); - - Map listSessions(); - - void endSession(FridaTarget target, DebugEndSessionFlags flags); - - DebugStatus getExecutionStatus(); - - void processEvent(FridaEvent fridaEvt); - - boolean getInterrupt(); - - public void setManager(FridaManager manager); - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/frida/FridaClientImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/frida/FridaClientImpl.java deleted file mode 100644 index 5f1f7755c5..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/frida/FridaClientImpl.java +++ /dev/null @@ -1,228 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.frida; - -import java.math.BigInteger; -import java.util.*; - -import agent.frida.manager.*; -import ghidra.util.Msg; - -public class FridaClientImpl implements FridaClient { - - private FridaManager manager; - private FridaDebugger d; - private FridaTarget initialTarget; - private List targets; - - public FridaClientImpl() { - } - - @Override - public FridaClient createClient() { - d = FridaEng.init(); - targets = new ArrayList<>(); - initialTarget = FridaEng.createTarget(d); - targets.add(initialTarget); - //cmd = sbd.GetCommandInterpreter(); - return this; - } - - public FridaTarget createTargetById(String id) { - FridaTarget target = FridaEng.createTargetById(d, id); - targets.add(target); - manager.setCurrentTarget(target); - return target; - } - - public FridaTarget createTargetByType(String type) { - Integer typeid = 0; - if (type.equalsIgnoreCase("Remote")) { - typeid = 1; - } - if (type.equalsIgnoreCase("USB")) { - typeid = 2; - } - FridaTarget target = FridaEng.createTargetByType(d, typeid); - targets.add(target); - manager.setCurrentTarget(target); - return target; - } - - public FridaDebugger getDebugger() { - return d; - } - - @Override - public FridaServerId getLocalServer() { - return new FridaServerId(0); - } - - @Override - public FridaSession attachProcess(FridaServerId si, int keyType, String key, boolean wait, - boolean async) { - FridaError error = new FridaError(); - FridaTarget target = manager.getCurrentTarget(); - if (target == null) { - target = createNullSession(); - targets.add(target); - manager.setCurrentTarget(target); - } - - int radix = 10; - if (key.startsWith("0x")) { - key = key.substring(2); - radix = 16; - } - BigInteger processId = new BigInteger(key, radix); - FridaSession session = target.attach(processId, error); - if (!error.success()) { - Msg.error(this, "Error while attaching to " + key); - Msg.error(this, error.getDescription()); - return null; - } - - manager.updateState(session); - target.setSession(session); - return session; - } - - @Override - public FridaSession createProcess(FridaServerId si, String fileName) { - return createProcess(si, fileName, new ArrayList(), new ArrayList(), ""); - } - - @Override - public FridaSession createProcess(FridaServerId si, String fileName, - List args, List envp, String workingDir) { - FridaError error = new FridaError(); - - String[] argArr = args.toArray(new String[args.size()]); - String[] envArr = envp.isEmpty() ? null : envp.toArray(new String[envp.size()]); - FridaSession session = manager.getCurrentTarget().launchSimple(argArr, envArr, workingDir); - if (!error.success()) { - Msg.error(this, "Error for create process"); - Msg.error(this, error.getDescription()); - return null; - } - manager.updateState(session); - return session; - } - - @Override - public FridaSession createProcess(FridaServerId si, String fileName, - List args, List envp, List pathsIO, - String workingDir, long createFlags, boolean stopAtEntry) { - FridaTarget target = manager.getCurrentTarget(); - - String[] argArr = args.toArray(new String[args.size()]); - // null for envp means use the default environment - String[] envArr = envp.isEmpty() ? null : envp.toArray(new String[envp.size()]); - String pathSTDIN = pathsIO.get(0); - String pathSTDOUT = pathsIO.get(1); - String pathSTDERR = pathsIO.get(2); - FridaError error = new FridaError(); - FridaSession session = target.launch(fileName, argArr, envArr, - pathSTDIN, pathSTDOUT, pathSTDERR, workingDir, createFlags, stopAtEntry, error); - //FridaProcess process = session.Launch(listener, null, null, "", "", "", "", 0, true, error); - if (!error.success()) { - Msg.error(this, "Error while launching " + fileName); - Msg.error(this, error.getDescription()); - return null; - } - - manager.updateState(session); - return session; - } - - @Override - public void terminateCurrentProcess(FridaTarget target) { - FridaProcess process = target.getProcess(); - if (process != null) { - FridaError error = process.kill(); - if (!error.success()) { - Msg.error(this, error.getDescription()); - } - } - } - - @Override - public void destroyCurrentProcess(FridaTarget target) { - FridaProcess process = target.getProcess(); - FridaError error = process.destroy(); - if (!error.success()) { - Msg.error(this, error.getDescription()); - } - } - - @Override - public void detachCurrentProcess(FridaTarget target) { - FridaProcess process = target.getProcess(); - FridaError error = process.destroy(); - if (!error.success()) { - Msg.error(this, error.getDescription()); - } - } - - public FridaTarget createNullSession() { - return FridaEng.createTarget(d); - } - - @Override - public FridaTarget connectSession(String fileName) { - return FridaEng.createTarget(d); - } - - @Override - public Map listSessions() { - Map map = new HashMap<>(); - //List targets = FridaEng.enumerateDevices(d); - for (FridaTarget t : targets) { - FridaSession session = t.getSession(); - if (session != null) { - map.put(FridaClient.getId(session), session); - } - } - return map; - } - - @Override - public void endSession(FridaTarget target, DebugEndSessionFlags flags) { - } - - @Override - public void processEvent(FridaEvent fridaEvt) { - manager.processEvent(fridaEvt); - } - - @Override - public DebugStatus getExecutionStatus() { - FridaState state = manager.getState(); - return DebugStatus.fromArgument(state); - } - - @Override - public boolean getInterrupt() { - return false; - } - - @Override - public void setManager(FridaManager manager) { - this.manager = manager; - manager.setCurrentTarget(initialTarget); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/frida/FridaClientReentrant.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/frida/FridaClientReentrant.java deleted file mode 100644 index 5da8f83bab..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/frida/FridaClientReentrant.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.frida; - -/** - * An interface containing the subset of {@link FridaClient} methods which are reentrant. - * - * All other methods should be called only by the thread which created the client. - */ -public interface FridaClientReentrant { - /** - * Create a new client for the calling thread, connected to the same session as this client. - * - * @return the new client - */ - FridaClient createClient(); - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/frida/FridaEng.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/frida/FridaEng.java deleted file mode 100644 index a40a54fc3c..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/frida/FridaEng.java +++ /dev/null @@ -1,351 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.frida; - -import java.util.ArrayList; -import java.util.List; - -import com.sun.jna.NativeLong; -import com.sun.jna.Pointer; - -import agent.frida.jna.FridaNative; -import agent.frida.manager.*; -import ghidra.comm.util.BitmaskSet; -import ghidra.util.Msg; - -/** - * A wrapper for Microsoft's {@code dbgeng.dll} that presents a Java-friendly interface. - * - * This is the "root interface" from which all other interfaces to {@code dbgeng.dll} are generated. - * Not every method listed in the documentation, nor every method present in the header, is - * implemented. Only those that were necessary to implement the SCTL adapter. However, the class and - * interface hierarchy was designed so that adding the remaining methods should be fairly - * straightforward. This wrapper attempts to obtain the most capable COM interfaces for the debug - * client that it knows. Again, newer interfaces should be fairly straightforward to add. - * - * Methods that are "obviously" wrappers for a COM method are left undocumented, unless there is - * some nuance to how it has been wrapped. In many cases, a parameter which is an integer in the COM - * method may be presented as an {@code enum} or {@link BitmaskSet} by the wrapper. Consult the MSDN - * for the meaning of the various values and bit flags. - * - * Each wrapper interface is implemented by several COM interface wrappers: one for each known COM - * interface version. The wrapper is optimistic, in that it declares wrapper methods even for COM - * methods that are only available in later versions. The implementations limited to earlier COM - * interfaces should either emulate the operation, or throw an - * {@link UnsupportedOperationException}. Where a newer method is provided by a newer interface, a - * wrapper implementation should prefer the latest. For example, one series of interfaces introduces - * {@code *Wide} variants of existing methods. Since Java also uses a UTF-16-like string encoding - * internally, JNA permits wide strings to be passed by reference. Thus, the wide variant is always - * preferred. - * - * Pay careful attention to the threading requirements imposed by {@code dbgeng.dll} these can be - * found in the MSDN. As a general rule of thumb, if the method is reentrant (i.e., it can be called - * from any thread), it is declared in the {@code *Reentrant} variant of the wrapper interface. - * There are few of these. Unless the documentation explicitly lists the method as reentrant, do not - * declare it there. Many methods appear to execute successfully from the wrong thread, but cause - * latent issues. A practice to prevent accidental use of non-reentrant methods outside of the - * client's owning thread is to ensure that only the owning thread can see the full interface. All - * other threads should only have access to the reentrant interface. - * - * If you implement methods that introduce a new callback class, use the existing callback type - * hierarchies as a model. There are many classes to implement. Furthermore, be sure to keep a - * reference to any active callback instances within the wrapper that uses them. The JNA has no way - * of knowing whether or not the instance is still being used by the external C/C++ library. If you - * do not store a reference, the JVM will think it's garbage and free it, even though COM is still - * using it. Drop the reference only when you are certain nothing external has a reference to it. - */ -public class FridaEng { - - private static final NativeLong FRIDA_REALM_NATIVE = new NativeLong(0); - public enum FridaDeviceType { - TYPE_LOCAL, - TYPE_REMOTE, - TYPE_USB - } - - /** - * Create a debug client. - * - * @return a pointer to the device manager - */ - public static FridaDebugger init() { - FridaNative.INSTANCE.GH_frida_init(); - return new FridaDebugger(FridaNative.INSTANCE.GH_frida_device_manager_new()); - } - - public static FridaTarget createTarget(FridaDebugger d) { - return createTargetByType(d, FridaDeviceType.TYPE_LOCAL.ordinal()); - } - - public static FridaTarget createTargetByType(FridaDebugger d, long type) { - Pointer deviceManager = d.getPointer(); - FridaError err = new FridaError(); - Pointer device = FridaNative.INSTANCE.GH_frida_device_manager_find_device_by_type_sync( - deviceManager, new NativeLong(type), new NativeLong(10), null, err.error); - if (device == null) { - Msg.error(d, err); - return null; - } - String id = FridaNative.INSTANCE.GH_frida_device_get_id(device); - String name = FridaNative.INSTANCE.GH_frida_device_get_name(device); - FridaTarget target = new FridaTarget(device, id, name); - Msg.warn(d, "current target: "+id); - - return target; - } - - public static FridaTarget createTargetById(FridaDebugger d, String id) { - Pointer deviceManager = d.getPointer(); - FridaError err = new FridaError(); - Pointer device = FridaNative.INSTANCE.GH_frida_device_manager_find_device_by_id_sync( - deviceManager, id, new NativeLong(10), null, err.error); - if (device == null) { - Msg.error(d, err); - return null; - } - String name = FridaNative.INSTANCE.GH_frida_device_get_name(device); - FridaTarget target = new FridaTarget(device, id, name); - Msg.warn(d, "current target: "+id); - - return target; - } - - public static List enumerateDevices(FridaDebugger d) { - Pointer deviceManager = d.getPointer(); - FridaError err = new FridaError(); - Pointer deviceList = FridaNative.INSTANCE - .GH_frida_device_manager_enumerate_devices_sync(deviceManager, null, err.error); - if (deviceList == null) { - Msg.error(d, err); - return null; - } - Integer numDevices = FridaNative.INSTANCE.GH_frida_device_list_size(deviceList); - List targetList = new ArrayList<>(numDevices); - for (int i = 0; i != numDevices; i++) { - Pointer device = FridaNative.INSTANCE.GH_frida_device_list_get(deviceList, i); - String id = FridaNative.INSTANCE.GH_frida_device_get_id(device); - String name = FridaNative.INSTANCE.GH_frida_device_get_name(device); - FridaTarget t = new FridaTarget(device, id, name); - targetList.add(t); - } - return targetList; - } - - public static List enumerateProcesses(FridaTarget t) { - Pointer device = t.getPointer(); - FridaError err = new FridaError(); - Pointer list = FridaNative.INSTANCE.GH_frida_device_enumerate_processes_sync(device, null, - null, err.error); - if (list == null) { - Msg.error(t, err); - return null; - } - Integer numProcesses = FridaNative.INSTANCE.GH_frida_process_list_size(list); - List processList = new ArrayList<>(numProcesses); - for (int i = 0; i != numProcesses; i++) { - Pointer process = FridaNative.INSTANCE.GH_frida_process_list_get(list, i); - NativeLong pid = FridaNative.INSTANCE.GH_frida_process_get_pid(process); - String name = FridaNative.INSTANCE.GH_frida_process_get_name(process); - FridaProcess p = new FridaProcess(process, pid); - p.setName(name); - processList.add(p); - } - return processList; - } - - public static List enumerateApplications(FridaTarget t) { - Pointer device = t.getPointer(); - FridaError err = new FridaError(); - Pointer list = FridaNative.INSTANCE.GH_frida_device_enumerate_applications_sync(device, - null, null, err.error); - if (list == null) { - Msg.error(t, err); - return null; - } - Integer numApplications = FridaNative.INSTANCE.GH_frida_process_list_size(list); - List processList = new ArrayList<>(numApplications); - for (int i = 0; i != numApplications; i++) { - Pointer application = FridaNative.INSTANCE.GH_frida_application_list_get(list, i); - NativeLong pid = FridaNative.INSTANCE.GH_frida_application_get_pid(application); - String name = FridaNative.INSTANCE.GH_frida_application_get_name(application); - String identifier = - FridaNative.INSTANCE.GH_frida_application_get_identifier(application); - FridaProcess p = new FridaProcess(application, pid); - p.setName(name); - p.setIdentifier(identifier); - processList.add(p); - } - return processList; - } - - public static FridaSession attach(FridaTarget t, NativeLong pid, FridaError err) { - Pointer localDevice = t.getPointer(); - FridaNative.GError.ByReference ref = new FridaNative.GError.ByReference(); - Pointer session = FridaNative.INSTANCE.GH_frida_device_attach_sync(localDevice, pid, - FridaEng.FRIDA_REALM_NATIVE, null, ref); - if (session == null) { - Msg.error(t, ref); - return null; - } - Pointer process = FridaNative.INSTANCE.GH_frida_device_get_process_by_pid_sync(localDevice, - pid, null, null, err.error); - if (process == null) { - Msg.error(t, err); - return null; - } - FridaProcess p = new FridaProcess(process, pid); - FridaSession s = new FridaSession(session, p); - p.setSession(s); - s.setTarget(t); - t.setSession(s); - return s; - } - - public static FridaSession spawn(FridaTarget t, String fileName, FridaError err) { - Pointer localDevice = t.getPointer(); - NativeLong pid = FridaNative.INSTANCE.GH_frida_device_spawn_sync(localDevice, fileName, - FridaEng.FRIDA_REALM_NATIVE, null, err.error); - if (!err.success()) { - Msg.error(t, err); - return null; - } - return attach(t, pid, err); - } - - public static void resume(FridaTarget t, NativeLong pid, FridaError err) { - Pointer localDevice = t.getPointer(); - FridaNative.INSTANCE.GH_frida_device_resume_sync(localDevice, pid, null, err.error); - if (!err.success()) { - Msg.error(t, err); - } - } - - public static void kill(FridaTarget t, NativeLong pid, FridaError err) { - Pointer localDevice = t.getPointer(); - FridaNative.INSTANCE.GH_frida_device_kill_sync(localDevice, pid, null, err.error); - if (!err.success()) { - Msg.error(t, err); - } - } - - public static void detach(FridaSession s, FridaError err) { - Pointer session = s.getPointer(); - FridaNative.INSTANCE.GH_frida_session_detach_sync(session, null, err.error); - if (!err.success()) { - Msg.error(s, err); - } - } - - public static void resume(FridaSession s, FridaError err) { - Pointer session = s.getPointer(); - FridaNative.INSTANCE.GH_frida_session_resume_sync(session, null, err.error); - if (!err.success()) { - Msg.error(s, err); - } - } - - public static NativeLong connectSignal(FridaScript s, String signal, - FridaNative.MessageCallback cb, Pointer userData) { - Pointer script = s.getPointer(); - return FridaNative.INSTANCE.GH_g_signal_connect_data(script, signal, cb, userData, null, - new NativeLong(0)); - } - - public static void disconnectSignal(FridaScript s, NativeLong signal) { - Pointer script = s.getPointer(); - FridaNative.INSTANCE.GH_g_signal_handler_disconnect(script, signal); - } - - public static NativeLong createSignal(String signal) { - return FridaNative.INSTANCE.GH_g_signal_new( - signal, - FridaNative.INSTANCE.GH_frida_bus_session_get_type(), // type_from_class - new NativeLong(2), // G_SIGNAL_RUN_LAST - new NativeLong(0), // class_ofset - null, // accumulator - null, // accu_data - null, // closure - new NativeLong(1), // G_TYPE_NULL - new NativeLong(1), // 1 param - new NativeLong(16) // G_TYPE_STRING - ); - } - - public static void emitSignal(FridaSession s, String signal) { - Pointer script = s.getPointer(); - FridaNative.INSTANCE.GH_g_signal_emit_by_name(script, signal); - } - - public static NativeLong getBusType() { - return FridaNative.INSTANCE.GH_frida_bus_session_get_type(); - } - - public static FridaScript createScript(FridaSession s, String commands, Pointer options) { - if (s == null) { - Msg.error(s, "null session"); - return null; - } - Pointer session = s.getPointer(); - FridaError err = new FridaError(); - Pointer script = FridaNative.INSTANCE.GH_frida_session_create_script_sync(session, commands, - options, null, err.error); - if (script == null) { - Msg.error(s, "Unable to create script: " + commands); - return null; - } - return new FridaScript(script); - } - - public static void unref(FridaScript s) { - Pointer script = s.getPointer(); - FridaNative.INSTANCE.GH_frida_unref(script); - } - - public static void loadScript(FridaScript s) { - Pointer script = s.getPointer(); - FridaError err = new FridaError(); - FridaNative.INSTANCE.GH_frida_script_load_sync(script, null, err.error); - if (!err.success()) { - Msg.error(s, err); - } - } - - public static void unloadScript(FridaScript s) { - Pointer script = s.getPointer(); - FridaError err = new FridaError(); - FridaNative.INSTANCE.GH_frida_script_unload_sync(script, null, err.error); - if (!err.success()) { - Msg.error(s, err); - } - } - - public static Pointer createOptions(String name) { - Pointer options = FridaNative.INSTANCE.GH_frida_script_options_new(); - FridaNative.INSTANCE.GH_frida_script_options_set_name(options, name); - FridaNative.INSTANCE.GH_frida_script_options_set_runtime(options, new NativeLong(0L)); - return options; - } - - public static void enableDebugger(FridaSession s, NativeLong port) { - Pointer session = s.getPointer(); - FridaError err = new FridaError(); - FridaNative.INSTANCE.GH_frida_session_enable_debugger_sync(session, port, null, err.error); - if (!err.success()) { - Msg.error(s, err); - } - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/frida/FridaModuleInfo.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/frida/FridaModuleInfo.java deleted file mode 100644 index 0a6c6cb60a..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/frida/FridaModuleInfo.java +++ /dev/null @@ -1,84 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.frida; - -import java.util.HashMap; -import java.util.Map; - -import agent.frida.manager.*; - -/** - * Information about a module (program or library image). - * - * The fields correspond to the parameters taken by {@code LoadModule} of - * {@code IDebugEventCallbacks}. They also appear as a subset of parameters taken by - * {@code CreateProcess} of {@code IDebugEventCallbacks}. - */ -public class FridaModuleInfo { - - private FridaProcess process; - private long numModules; - private Map modules = new HashMap<>(); - - public FridaModuleInfo(FridaProcess process, FridaModule module) { - this.process = process; - numModules = 1; - modules.put(0, module); - } - - public FridaModuleInfo(FridaKernelModule module) { - this.process = null; - numModules = 1; - modules.put(0, module); - } - - public Long getNumberOfModules() { - return numModules; - } - - public FridaModule getModule(int index) { - return modules.get(index); - } - - public String toString(int index) { - FridaModule module = modules.get(index); - return module.toString(); - } - - public String getModuleName(int index) { - FridaModule module = modules.get(index); - return FridaClient.getId(module); - } - - public void setModuleName(int index, String moduleName) { - FridaModule module = modules.get(index); - module.setName(moduleName); - } - - public String getImageName(int index) { - FridaModule module = modules.get(index); - return module.getPath(); - } - - public void setImageName(int index, String dirName, String imageName) { - FridaModule module = modules.get(index); - module.setPath(imageName); - } - - public FridaProcess getProcess() { - return process; - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/frida/FridaProcessInfo.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/frida/FridaProcessInfo.java deleted file mode 100644 index 642e99f459..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/frida/FridaProcessInfo.java +++ /dev/null @@ -1,43 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.frida; - -import agent.frida.manager.FridaProcess; -import agent.frida.manager.FridaState; - -/** - * Information about a module (program or library image). - * - * The fields correspond to the parameters taken by {@code LoadModule} of - * {@code IDebugEventCallbacks}. They also appear as a subset of parameters taken by - * {@code CreateProcess} of {@code IDebugEventCallbacks}. - */ -public class FridaProcessInfo { - - public FridaProcess process; - public FridaState state; - public String id; - - public FridaProcessInfo(FridaProcess process) { - this.process = process; - this.id = FridaClient.getId(process); - } - - public String toString() { - return id; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/frida/FridaRegionInfo.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/frida/FridaRegionInfo.java deleted file mode 100644 index 94e52184e2..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/frida/FridaRegionInfo.java +++ /dev/null @@ -1,76 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.frida; - -import java.util.HashMap; -import java.util.Map; - -import agent.frida.manager.*; - -/** - * - * The fields correspond to the parameters taken by {@code LoadModule} of - * {@code IDebugEventCallbacks}. They also appear as a subset of parameters taken by - * {@code CreateProcess} of {@code IDebugEventCallbacks}. - */ -public class FridaRegionInfo { - - private FridaProcess process; - private long numRegions; - private Map regions = new HashMap<>(); - - public FridaRegionInfo(FridaProcess process, FridaMemoryRegionInfo region) { - this.process = process; - numRegions = 1; - regions.put(0, region); - } - - public FridaRegionInfo(FridaKernelMemoryRegionInfo region) { - this.process = null; - numRegions = 1; - regions.put(0, region); - } - - public Long getNumberOfRegions() { - return numRegions; - } - - public FridaMemoryRegionInfo getRegion(int index) { - return regions.get(index); - } - - public String toString(int index) { - FridaMemoryRegionInfo region = regions.get(index); - return region.toString(); - } - - public String getRegionName(int index) { - FridaMemoryRegionInfo region = regions.get(index); - return FridaClient.getId(region); - } - - public void setRegionName(int index, String regionName) { - FridaMemoryRegionInfo region = regions.get(index); - FridaFileSpec filespec = region.getFileSpec(); - if (filespec != null) { - filespec.setPath(regionName); - } - } - - public FridaProcess getProcess() { - return process; - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/frida/FridaServerId.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/frida/FridaServerId.java deleted file mode 100644 index 36ed6d874e..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/frida/FridaServerId.java +++ /dev/null @@ -1,58 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.frida; - -/** - * The ID of a debug server. - * - * Each server to which a client is connected is assigned a server ID. The local server, to which - * every client is connected by default, has the ID 0. This is essentially just a boxed integer, but - * having an explicit data type prevents confusion with other integral values. - */ -public class FridaServerId implements Comparable { - public final long id; - - public FridaServerId(long id) { - this.id = id; - } - - @Override - public int hashCode() { - return Long.hashCode(id); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof FridaServerId)) { - return false; - } - FridaServerId that = (FridaServerId) obj; - if (this.id != that.id) { - return false; - } - return true; - } - - @Override - public int compareTo(FridaServerId that) { - return Long.compare(this.id, that.id); - } - - @Override - public String toString() { - return ""; - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/frida/FridaSessionInfo.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/frida/FridaSessionInfo.java deleted file mode 100644 index fbf94f6c8d..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/frida/FridaSessionInfo.java +++ /dev/null @@ -1,40 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.frida; - -import agent.frida.manager.FridaSession; - -/** - * Information about a session. - * - * The fields correspond to the parameters taken by {@code LoadModule} of - * {@code IDebugEventCallbacks}. They also appear as a subset of parameters taken by - * {@code CreateProcess} of {@code IDebugEventCallbacks}. - */ -public class FridaSessionInfo { - - public FridaSession session; - public String id; - - public FridaSessionInfo(FridaSession session) { - this.session = session; - this.id = FridaClient.getId(session); - } - - public String toString() { - return id; - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/frida/FridaThreadInfo.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/frida/FridaThreadInfo.java deleted file mode 100644 index 5f1d6c78d4..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/frida/FridaThreadInfo.java +++ /dev/null @@ -1,41 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.frida; - -import agent.frida.manager.FridaFrame; -import agent.frida.manager.FridaThread; - -/** - * Information about a module (program or library image). - * - * The fields correspond to the parameters taken by {@code LoadModule} of - * {@code IDebugEventCallbacks}. They also appear as a subset of parameters taken by - * {@code CreateProcess} of {@code IDebugEventCallbacks}. - */ -public class FridaThreadInfo { - - public FridaThread thread; - public String id; - - public FridaThreadInfo(FridaThread thread) { - this.thread = thread; - this.id = FridaClient.getId(thread); - } - - public String toString() { - return id; - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/gadp/FridaGadpDebuggerModelFactory.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/gadp/FridaGadpDebuggerModelFactory.java deleted file mode 100644 index 8222f6dc80..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/gadp/FridaGadpDebuggerModelFactory.java +++ /dev/null @@ -1,63 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.gadp; - -import java.util.List; - -import ghidra.dbg.gadp.server.AbstractGadpLocalDebuggerModelFactory; -import ghidra.dbg.util.ConfigurableFactory.FactoryDescription; -import ghidra.program.model.listing.Program; - -@FactoryDescription( - brief = "PROTOTYPE: Frida via GADP", - htmlDetails = """ - Connect to Frida. - This is an experimental connector. Use at your own risk. - This will protect Ghidra's JVM by using a subprocess to access the native API.""") -public class FridaGadpDebuggerModelFactory extends AbstractGadpLocalDebuggerModelFactory { - - @Override - public int getPriority(Program program) { - String osname = System.getProperty("os.name").toLowerCase(); - if (!(osname.contains("mac os x") || osname.contains("linux") || - osname.contains("windows"))) { - return -1; - } - if (program != null) { - String exe = program.getExecutablePath(); - if (exe == null || exe.isBlank()) { - return -1; - } - } - return 25; - } - - @Override - protected String getThreadName() { - return "Local Frida Agent stdout"; - } - - protected Class getServerClass() { - return FridaGadpServer.class; - } - - @Override - protected void completeCommandLine(List cmd) { - cmd.add(getServerClass().getCanonicalName()); - cmd.addAll(List.of("-H", host)); - cmd.addAll(List.of("-p", Integer.toString(port))); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/gadp/FridaGadpServer.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/gadp/FridaGadpServer.java deleted file mode 100644 index 5f61e8c381..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/gadp/FridaGadpServer.java +++ /dev/null @@ -1,192 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.gadp; - -import java.io.IOException; -import java.net.InetSocketAddress; -import java.net.SocketAddress; -import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutionException; - -import agent.frida.gadp.impl.FridaGadpServerImpl; -import ghidra.async.AsyncUtils; -import ghidra.dbg.agent.AgentWindow; -import ghidra.util.Msg; - -public interface FridaGadpServer extends AutoCloseable { - public static final String USAGE = - """ - This is the GADP server for Frida. Usage: - - gadp-agent-frida [-H HOST/ADDR] [-p PORT] - - Options: - --host/-H The address of the interface on which to listen. Default is - localhost - --port/-p The TCP port on which to listen for GADP. Default is 12345 - """; - - /** - * The entry point for the Frida server in stand-alone mode - * - * Run it to see help. - * - * @param args the command-line arguments - * @throws IOException if an I/O error occurs - * @throws ExecutionException - * @throws InterruptedException - */ - public static void main(String[] args) throws Exception { - new FridaRunner().run(args); - } - - /** - * Create a new instance of the server - * - * @param addr the address to bind the SCTL server to - * @param busId the client ID the server should use on the bus for synthesized commands - * @return the server instance - * @throws IOException - */ - public static FridaGadpServer newInstance(SocketAddress addr) throws IOException { - return new FridaGadpServerImpl(addr); - } - - /** - * Runs the server from the command line - */ - public class FridaRunner { - protected InetSocketAddress bindTo; - protected List fridaArgs = new ArrayList<>(); - protected byte busId = 1; - protected String remote = null; - - public FridaRunner() { - } - - public void run(String args[]) - throws IOException, InterruptedException, ExecutionException { - parseArguments(args); - - try (FridaGadpServer server = newInstance(bindTo)) { - //TODO: fix/test the debugConnect case when args are passed - server.startFrida(fridaArgs.toArray(new String[] {})).exceptionally(e -> { - e = AsyncUtils.unwrapThrowable(e); - Msg.error(this, "Error starting Frida/GADP: " + e); - System.exit(-1); - return null; - }); - new AgentWindow("Frida Agent for Ghidra", server.getLocalAddress()); - while (server.isRunning()) { - Thread.sleep(1000); - } - System.exit(0); - } - } - - protected void parseArguments(String[] args) { - String iface = "localhost"; - int port = 12345; - // NOTE: Maybe commons-cli or Argparse4j? - Iterator ait = Arrays.asList(args).iterator(); - while (ait.hasNext()) { - String a = ait.next(); - if ("-h".equals(a) || "--help".equals(a)) { - printUsage(); - System.exit(0); - } - else if ("-p".equals(a) || "--port".equals(a)) { - if (!ait.hasNext()) { - System.err.println("Expected PORT"); - printUsage(); - System.exit(-1); - } - String portStr = ait.next(); - try { - port = Integer.parseInt(portStr); - } - catch (NumberFormatException e) { - System.err.println("Integer required. Got " + portStr); - printUsage(); - System.exit(-1); - } - } - else if ("-H".equals(a) || "--host".equals(a)) { - if (!ait.hasNext()) { - System.err.println("Expected HOST/ADDR"); - printUsage(); - System.exit(-1); - } - iface = ait.next(); - } - else { - System.err.println("Unknown option: " + a); - printUsage(); - System.exit(-1); - } - } - - bindTo = new InetSocketAddress(iface, port); - } - - protected void printUsage() { - System.out.println(USAGE); - } - } - - /** - * Start the debugging server - * - * @return a future that completes when the server is ready - */ - CompletableFuture startFrida(String[] args); - - /** - * Get the local address to which the SCTL server is bound. - * - * @return the local socket address - */ - SocketAddress getLocalAddress(); - - /** - * Close all connections and ports, GADP and Process Server, and terminate the server - * - * @throws IOException if an I/O error occurs - */ - public void terminate() throws IOException; - - /** - * Check if the server is running - * - * This will return false: 1) Before the server has been started, 2) After a call to - * {@link #terminate()}, or 3) When an error occurs causing the server to terminate - * unexpectedly. Otherwise, it returns true. - * - * @return true if the server is currently running. - */ - public boolean isRunning(); - - /** - * Calls {@link #terminate()} - * - * @throws IOException if an I/O error occurs - */ - @Override - default void close() throws IOException { - terminate(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/gadp/impl/AbstractClientThreadExecutor.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/gadp/impl/AbstractClientThreadExecutor.java deleted file mode 100644 index 3e26de5709..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/gadp/impl/AbstractClientThreadExecutor.java +++ /dev/null @@ -1,199 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.gadp.impl; - -import java.util.*; -import java.util.concurrent.*; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.function.Consumer; - -import agent.frida.frida.FridaClient; -import agent.frida.frida.FridaClient.DebugStatus; -import agent.frida.manager.FridaManager; -import ghidra.util.Msg; - -/** - * A single-threaded executor which creates and exclusively accesses the {@code frida} client. - * - *

- * The executor also has a priority mechanism, so that callbacks may register follow-on handlers - * which take precedence over other tasks in the queue (which could trigger additional callbacks). - * This is required since certain operation are not allowed during normal callback processing. For - * example, changing the current process is typically not allowed, but it is necessary to retrieve a - * thread's context. - */ -public abstract class AbstractClientThreadExecutor extends AbstractExecutorService { - private static final int DEFAULT_PRIORITY = 10; - - protected FridaClient client; - protected boolean shuttingDown = false; - protected final Queue queue = new PriorityQueue<>(); - protected Thread thread = new Thread(this::run, "DebugClient"); - protected final AtomicBoolean waitRegistered = new AtomicBoolean(); - - protected abstract void init(); - - public static class Entry implements Comparable { - final int priority; - public final Runnable command; - - public Entry(int priority, Runnable command) { - this.priority = priority; - this.command = command; - } - - @Override - public int compareTo(Entry that) { - return Integer.compare(this.priority, that.priority); - } - } - - /** - * Obtain a reference to the client, only if the calling thread is this executor's thread. - * - * @return the client - */ - public FridaClient getClient() { - return client; - } - - public void cancelWait() { - waitRegistered.set(false); - } - - public void registerWait() { - waitRegistered.set(true); - } - - private Entry pollQueue() { - synchronized (queue) { - return queue.poll(); - } - } - - private void run() { - /** - * The general idea is to run indefinitely, taking every precaution to protect this thread's - * life, since only it can access the client. Granted, if it turns out to be too difficult, - * we can always create a new thread and client, using the existing client's reentrant - * methods. - */ - try { - init(); - while (!shuttingDown) { - Entry next; - while (null != (next = pollQueue())) { - if (shuttingDown) { - return; - } - try { - //System.out.println("Executing: " + next); - next.command.run(); - //System.out.println("Done"); - } - catch (Throwable t) { - Msg.error(this, "Task in executor threw: " + t); - } - } - - DebugStatus status = client.getExecutionStatus(); - if (status.shouldWait && status != DebugStatus.NO_DEBUGGEE || - waitRegistered.get()) { - waitRegistered.set(false); - } - - } - } - catch (Throwable t) { - Msg.error(this, "Non-respawnable executor terminated unexpectedly", t); - shuttingDown = true; - } - } - - @Override - public void shutdown() { - shuttingDown = true; - } - - @Override - public List shutdownNow() { - shuttingDown = true; - thread.interrupt(); - List left = new ArrayList<>(queue.size()); - for (Entry ent : queue) { - left.add(ent.command); - } - return left; - } - - @Override - public boolean isShutdown() { - return shuttingDown; - } - - @Override - public boolean isTerminated() { - return !thread.isAlive(); - } - - @Override - public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException { - long millis = TimeUnit.MILLISECONDS.convert(timeout, unit); - thread.join(millis); - return !thread.isAlive(); - } - - @Override - public void execute(Runnable command) { - execute(DEFAULT_PRIORITY, command); - } - - /** - * Schedule a task with a given priority. - * - * @param priority the priority - * @param command the task - */ - public void execute(int priority, Runnable command) { - if (shuttingDown) { - throw new RejectedExecutionException("Executor is shutting down"); - } - if (!thread.isAlive()) { - throw new RejectedExecutionException("Executor has terminated"); - } - synchronized (queue) { - queue.add(new Entry(priority, command)); - } - } - - public boolean isCurrentThread() { - return thread.equals(Thread.currentThread()); - } - - /** - * Schedule a task with the given priority, taking a reference to the client. - * - * @param priority the priority - * @param command the task - */ - public void execute(int priority, Consumer command) { - execute(priority, () -> command.accept(client)); - } - - public abstract FridaManager getManager(); - - public abstract void setManager(FridaManager manager); -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/gadp/impl/FridaClientThreadExecutor.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/gadp/impl/FridaClientThreadExecutor.java deleted file mode 100644 index e637c051f1..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/gadp/impl/FridaClientThreadExecutor.java +++ /dev/null @@ -1,64 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.gadp.impl; - -import java.util.function.Supplier; - -import agent.frida.frida.FridaClient; -import agent.frida.manager.FridaManager; - -/** - * A single-threaded executor which creates and exclusively accesses the {@code Frida} client. - * - * The executor also has a priority mechanism, so that callbacks may register follow-on handlers - * which take precedence over other tasks in the queue (which could trigger additional callbacks). - * This is required since certain operation are not allowed during normal callback processing. For - * example, changing the current process is typically not allowed, but it is necessary to retrieve a - * thread's context. - */ -public class FridaClientThreadExecutor extends AbstractClientThreadExecutor { - - private final Supplier makeClient; - private FridaManager manager; - - /** - * Instantiate a new executor, providing a means of creating the client - * - * @param makeClient the callback to create the client - */ - public FridaClientThreadExecutor(Supplier makeClient) { - this.makeClient = makeClient; - thread.setDaemon(true); - thread.start(); - } - - @Override - protected void init() { - this.client = makeClient.get(); - client.setManager(manager); - } - - @Override - public FridaManager getManager() { - return manager; - } - - @Override - public void setManager(FridaManager manager) { - this.manager = manager; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/gadp/impl/FridaGadpServerImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/gadp/impl/FridaGadpServerImpl.java deleted file mode 100644 index 365eed3273..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/gadp/impl/FridaGadpServerImpl.java +++ /dev/null @@ -1,64 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.gadp.impl; - -import java.io.IOException; -import java.net.SocketAddress; -import java.util.concurrent.CompletableFuture; - -import agent.frida.gadp.FridaGadpServer; -import agent.frida.model.AbstractFridaModel; -import agent.frida.model.impl.FridaModelImpl; -import ghidra.dbg.gadp.server.AbstractGadpServer; - -public class FridaGadpServerImpl implements FridaGadpServer { - public class GadpSide extends AbstractGadpServer { - public GadpSide(AbstractFridaModel model, SocketAddress addr) - throws IOException { - super(model, addr); - } - } - - protected final AbstractFridaModel model; - protected final GadpSide server; - - public FridaGadpServerImpl(SocketAddress addr) throws IOException { - super(); - this.model = new FridaModelImpl(); - this.server = new GadpSide(model, addr); - } - - @Override - public CompletableFuture startFrida(String[] args) { - return model.startFrida(args).thenCompose(__ -> server.launchAsyncService()); - } - - @Override - public SocketAddress getLocalAddress() { - return server.getLocalAddress(); - } - - @Override - public boolean isRunning() { - return model.isRunning(); - } - - @Override - public void terminate() throws IOException { - model.terminate(); - server.terminate(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/jna/FridaNative.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/jna/FridaNative.java deleted file mode 100644 index 1b405e48d1..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/jna/FridaNative.java +++ /dev/null @@ -1,338 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.jna; - -import java.util.List; - -import com.sun.jna.*; -import com.sun.jna.platform.linux.LibC; - -public interface FridaNative extends LibC { - - FridaNative INSTANCE = Native.load("frida-core", FridaNative.class); //?? - - public static final int GUM_MAX_PATH = 261; - public static final int GUM_MAX_SYMBOL_NAME = 2049; - public static final int GUM_MAX_BACKTRACE_DEPTH = 16; - - public enum GumOs { - GUM_OS_WINDOWS("windows"), - GUM_OS_MACOS("macos"), - GUM_OS_LINUX("linux"), - GUM_OS_IOS("ios"), - GUM_OS_ANDROID("android"), - GUM_OS_FREEBSD("freebsd"), - GUM_OS_QNX("qnx"); - - final String str; - - GumOs(String str) { - this.str = str; - } - - @Override - public String toString() { - return str; - } - } - - public enum GumThreadState { - GUM_THREAD_RUNNING("running"), - GUM_THREAD_STOPPED("stopped"), - GUM_THREAD_WAITING("waiting"), - GUM_THREAD_UNINTERRUPTIBLE("uninterruptible"), - GUM_THREAD_HALTED("halted"); - - final String str; - - GumThreadState(String str) { - this.str = str; - } - - @Override - public String toString() { - return str; - } - } - - public static class GError extends Structure { - public static class ByReference extends GError - implements Structure.ByReference { - // NO CODE - } - - public static final List FIELDS = createFieldsOrder("domain", "code", "message"); - - public volatile int domain; - public volatile int code; - public volatile String message; - - @Override - protected List getFieldOrder() { - return FIELDS; - } - } - - public static class GumMemoryRange extends Structure { - public static class ByReference extends GumMemoryRange - implements Structure.ByReference { - // NO CODE - } - - public static final List FIELDS = createFieldsOrder("address", "size"); - - public NativeLong address; - public NativeLong size; - - @Override - protected List getFieldOrder() { - return FIELDS; - } - } - - public static class GumFileMapping extends Structure { - public static class ByReference extends GumFileMapping - implements Structure.ByReference { - // NO CODE - } - - public static final List FIELDS = createFieldsOrder("path", "offset", "size"); - - public Pointer path; - public NativeLong offset; - public NativeLong size; - - @Override - protected List getFieldOrder() { - return FIELDS; - } - } - - public static class GumModuleDetails extends Structure { - public static class ByReference extends GumModuleDetails - implements Structure.ByReference { - // NO CODE - } - - public static final List FIELDS = createFieldsOrder("name", "range", "path"); - - public Pointer name; - public GumMemoryRange.ByReference range; - public Pointer path; - - @Override - protected List getFieldOrder() { - return FIELDS; - } - } - - public static class GumRangeDetails extends Structure { - public static class ByReference extends GumRangeDetails - implements Structure.ByReference { - // NO CODE - } - - public static final List FIELDS = createFieldsOrder("range", "protection", "file"); - - public GumMemoryRange.ByReference range; - public NativeLong protection; - public GumFileMapping.ByReference file; - - @Override - protected List getFieldOrder() { - return FIELDS; - } - } - - public static class GumReturnAddressDetails extends Structure { - - public static class ByReference extends GumReturnAddressDetails - implements Structure.ByReference { - // NO CODE - } - - public static final List FIELDS = createFieldsOrder("address", - "moduleName", "functionName", "fileName", "lineNumber"); - - public NativeLong address; - public byte[] moduleName = new byte[GUM_MAX_PATH]; - public byte[] functionName = new byte[GUM_MAX_SYMBOL_NAME]; - public byte[] fileName = new byte[GUM_MAX_PATH]; - public NativeLong lineNumber; - - @Override - protected List getFieldOrder() { - return FIELDS; - } - } - - public static class GumReturnAddressArray extends Structure { - public static class ByReference extends GumReturnAddressArray - implements Structure.ByReference { - // NO CODE - } - - public static final List FIELDS = createFieldsOrder("len", "items"); - - public NativeLong len; - public NativeLong[] items = new NativeLong[GUM_MAX_BACKTRACE_DEPTH]; - - @Override - protected List getFieldOrder() { - return FIELDS; - } - } - - public static class GumMallocRangeDetails extends Structure { - public static class ByReference extends GumMallocRangeDetails - implements Structure.ByReference { - // NO CODE - } - - public static final List FIELDS = createFieldsOrder("range"); - - public GumMemoryRange.ByReference range; - - @Override - protected List getFieldOrder() { - return FIELDS; - } - } - - public static interface ExceptionCallback extends Callback { - void invoke(Pointer details); - } - - public static interface MessageCallback extends Callback { - void invoke(Pointer script, String message, Pointer data, Pointer userData); - } - - void GH_frida_init(); - - Pointer GH_frida_device_manager_new(); - - void GH_frida_device_manager_close_sync(Pointer manager, Pointer cancellable, - GError.ByReference error); - - Pointer GH_frida_device_manager_find_device_by_id_sync(Pointer manager, String id, - NativeLong timeout, Pointer cancellable, GError.ByReference error); - - Pointer GH_frida_device_manager_find_device_by_type_sync(Pointer manager, NativeLong type, - NativeLong timeout, Pointer cancellable, GError.ByReference error); - - Pointer GH_frida_device_manager_enumerate_devices_sync(Pointer manager, Pointer cancellable, - GError.ByReference error); - - Integer GH_frida_device_list_size(Pointer deviceList); - - Pointer GH_frida_device_list_get(Pointer deviceList, int i); - - String GH_frida_device_get_id(Pointer device); - - String GH_frida_device_get_name(Pointer device); - - Pointer GH_frida_device_enumerate_processes_sync(Pointer device, NativeLong options, - Pointer cancellable, GError.ByReference error); - - Integer GH_frida_process_list_size(Pointer processList); - - Pointer GH_frida_process_list_get(Pointer processList, int i); - - NativeLong GH_frida_process_get_pid(Pointer process); - - String GH_frida_process_get_name(Pointer process); - - Pointer GH_frida_process_get_parameters(Pointer process); - - Pointer GH_frida_device_enumerate_applications_sync(Pointer device, NativeLong options, - Pointer cancellable, GError.ByReference error); - - Integer GH_frida_application_list_size(Pointer processList); - - Pointer GH_frida_application_list_get(Pointer processList, int i); - - NativeLong GH_frida_application_get_pid(Pointer process); - - String GH_frida_application_get_name(Pointer process); - - String GH_frida_application_get_identifier(Pointer process); - - Pointer GH_frida_application_get_parameters(Pointer process); - - Pointer GH_frida_device_attach_sync(Pointer localDevice, NativeLong pid, NativeLong options, - Pointer cancellable, GError.ByReference error); - - NativeLong GH_frida_device_spawn_sync(Pointer localDevice, String fileName, NativeLong options, - Pointer cancellable, GError.ByReference error); - - NativeLong GH_frida_session_get_pid(Pointer session); - - Pointer GH_frida_device_get_process_by_pid_sync(Pointer localDevice, NativeLong pid, - Pointer options, Pointer cancellable, GError.ByReference error); - - Pointer GH_frida_device_resume_sync(Pointer localDevice, NativeLong pid, Pointer cancellable, - GError.ByReference error); - - Pointer GH_frida_device_kill_sync(Pointer localDevice, NativeLong pid, Pointer cancellable, - GError.ByReference error); - - boolean GH_frida_session_is_detached(Pointer session); - - void GH_frida_session_detach_sync(Pointer session, Pointer cancellable, - GError.ByReference error); - - void GH_frida_session_resume_sync(Pointer session, Pointer cancellable, - GError.ByReference error); - - Pointer GH_frida_script_options_new(); - - void GH_frida_script_options_set_name(Pointer options, String name); - - void GH_frida_script_options_set_runtime(Pointer options, NativeLong runtime); - - Pointer GH_frida_session_create_script_sync(Pointer session, String commands, Pointer options, - Pointer cancellable, GError.ByReference error); - - void GH_frida_unref(Pointer script); - - void GH_frida_script_load_sync(Pointer script, Pointer cancellable, GError.ByReference error); - - void GH_frida_script_unload_sync(Pointer script, Pointer cancellable, GError.ByReference error); - - void GH_frida_session_enable_debugger_sync(Pointer session, NativeLong port, - Pointer cancellable, GError.ByReference error); - - NativeLong GH_frida_bus_session_get_type(); - - // These are equivalent but version-dependent - NativeLong GH__frida_g_signal_connect_data(Pointer script, String signal, - MessageCallback closure, Pointer data, Pointer notify, NativeLong after); - - NativeLong GH_g_signal_connect_data(Pointer script, String signal, MessageCallback closure, - Pointer data, Pointer notify, NativeLong after); - - // These are equivalent but version-dependent - void GH__frida_g_signal_handler_disconnect(Pointer script, NativeLong signalHandle); - - void GH_g_signal_handler_disconnect(Pointer script, NativeLong signalHandle); - - void GH_g_signal_emit_by_name(Pointer instance, String detailed_signal); - - NativeLong GH_g_signal_new(String signal_name, NativeLong itype, NativeLong signal_flags, - NativeLong class_offset, Pointer accumulator, Pointer accu_data, - Pointer c_marshaller, NativeLong return_type, NativeLong n_params, NativeLong ptype); - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaApplication.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaApplication.java deleted file mode 100644 index 23af4faa14..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaApplication.java +++ /dev/null @@ -1,52 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager; - -import com.sun.jna.NativeLong; -import com.sun.jna.Pointer; - -public class FridaApplication extends FridaPointer { - - private NativeLong pid; - private String name; - private String identifier; - - public FridaApplication(Pointer process, NativeLong pid) { - super(process); - this.pid = pid; - } - - public Long getPID() { - return pid.longValue(); - } - - public String getIdentifier() { - return identifier; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public void setIdentifier(String identifier) { - this.identifier = identifier; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaCause.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaCause.java deleted file mode 100644 index a6de51b20a..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaCause.java +++ /dev/null @@ -1,33 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager; - -import agent.frida.manager.cmd.FridaPendingCommand; - -/** - * Identifies the cause of an event emitted by frida - * - * This is not a concept native to frida. Rather, it is a means to distinguish events that result - * from commands issued by the {@link FridaManager} from those issued by the user or some other means. - * For example, a call to {@link FridaManager#addProcess()} will emit a - * {@link FridaEventsListener#processAdded(FridaProcess, FridaCause)} event, identifying the - * {@link FridaPendingCommand} as the cause. - */ -public interface FridaCause { - public enum Causes implements FridaCause { - UNCLAIMED; - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaCommand.java deleted file mode 100644 index 87114efd39..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaCommand.java +++ /dev/null @@ -1,82 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager; - -import java.util.concurrent.CompletableFuture; - -import agent.frida.manager.cmd.FridaPendingCommand; - -/** - * The interface for frida command implementations - * - * Commands are executed by frida in serial. In order to distinguish the likely cause of events, the - * manager will wait to issue each command until it has seen a prompt. Thus, commands are queued up, - * and the manager uses the {@link CompletableFuture} pattern to "return" results after execution - * completes. - * - * To begin executing the command, the manager invokes the command, using {@link #invoke()}. Any - * event that occurs during command execution is given to - * {@link #handle(FridaEvent, FridaPendingCommand)}. The implementor then has the option to "claim" or - * "steal" the event. When claimed, any subsequent event processor or listener is provided this - * command as the event's cause. When stolen, no subsequent event processors are called. The - * implementation ought to keep a list of claimed and stolen events. Once frida has finished executing - * the command, the manager calls {@link #complete(FridaPendingCommand)}, allowing the implementation - * to process its claimed and stolen events and return the result of the command. - * - * @param the type of object "returned" by the command - */ -public interface FridaCommand { - - /** - * Check if this command can be executed given frida's current state - * - * @param state frida's state - * @return true if it can be executed, false otherwise - */ - public boolean validInState(FridaState state); - - /** - * Invoke the command - */ - public void invoke(); - - /** - * Parse the command results - * @param result string returned - * @param data unused - */ - public void parse(String result, Object data); - - /** - * Handle an event that occurred during the execution of this command - * - * @param evt the event - * @param pending a copy of the executing command instance - * @return true if the command is now ready to be completed - */ - public boolean handle(FridaEvent evt, FridaPendingCommand pending); - - /** - * Called when the manager believes this command is finished executing - * - * This is presumed when the manager receives the prompt after issuing the encoded command - * - * @param pending a copy of the now-finished-executing command instance - * @return the object "returned" by the command - */ - public T complete(FridaPendingCommand pending); - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaContext.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaContext.java deleted file mode 100644 index 8a1227ad0d..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaContext.java +++ /dev/null @@ -1,42 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager; - -import java.util.HashMap; -import java.util.Map; -import java.util.Map.Entry; - -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonPrimitive; - -public class FridaContext { - - private Map map; - - public FridaContext(JsonObject cpuContext) { - this.map = new HashMap<>(); - for (Entry element : cpuContext.entrySet()) { - JsonPrimitive primitive = element.getValue().getAsJsonPrimitive(); - map.put(element.getKey(), primitive.getAsString()); - } - } - - public Map getChildren() { - return map; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaDebugger.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaDebugger.java deleted file mode 100644 index 9cac2c63e2..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaDebugger.java +++ /dev/null @@ -1,26 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager; - -import com.sun.jna.Pointer; - -public class FridaDebugger extends FridaPointer { - - public FridaDebugger(Pointer deviceManager) { - super(deviceManager); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaError.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaError.java deleted file mode 100644 index f377dd8c22..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaError.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager; - -import agent.frida.jna.FridaNative; - -public class FridaError { - - public FridaNative.GError.ByReference error; - - public FridaError() { - error = new FridaNative.GError.ByReference(); - } - - public long getValue() { - return error.code; - } - - public boolean success() { - return getValue() == 0L; - } - - - public String getDescription() { - return error.code + ":" +error.message; - } - - public String toString() { - return getDescription(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaEvent.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaEvent.java deleted file mode 100644 index 4a4e287ec9..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaEvent.java +++ /dev/null @@ -1,63 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager; - -import agent.frida.manager.cmd.FridaPendingCommand; - -public interface FridaEvent { - /** - * Get the information detailing the event - * - * @return the information - */ - public T getInfo(); - - /** - * Use {@link FridaPendingCommand#claim(FridaEvent)} instead - * - * @param cause the cause - */ - public void claim(FridaPendingCommand cause); - - /** - * If claimed, get the cause of this event - * - * @return the cause - */ - public FridaCause getCause(); - - /** - * Use {@link FridaPendingCommand#steal(FridaEvent)} instead - */ - public void steal(); - - /** - * Check if this event is stolen - * - * A stolen event should not be processed further, except by the thief - * - * @return true if stolen, false otherwise - */ - public boolean isStolen(); - - /** - * If this event implies a new frida state, get that state - * - * @return the new state, or null for no change - */ - public FridaState newState(); - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaEventsListener.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaEventsListener.java deleted file mode 100644 index f4c9a6afb1..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaEventsListener.java +++ /dev/null @@ -1,224 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager; - -import agent.frida.frida.FridaRegionInfo; -import agent.frida.frida.FridaModuleInfo; - -public interface FridaEventsListener { - - /** - * A session has been added - * - * @param session a handle to the new session - * @param cause the cause of this event - */ - void sessionAdded(FridaSession session, FridaCause cause); - - /** - * A session has been replaced - * - * @param session a handle to the new session - * @param cause the cause of this event - */ - void sessionReplaced(FridaSession session, FridaCause cause); - - /** - * A session has been removed - * - * @param sessionId the ID of the now-defunct session - * @param cause the cause of this event - */ - void sessionRemoved(String sessionId, FridaCause cause); - - /** - * A different session has been selected (gained focus) - * - * @param session a handle to the selected session - * @param cause the cause of this event - */ - void sessionSelected(FridaSession session, FridaCause cause); - - /** - * An Process has been added to the session - * - * @param process a handle to the new process - * @param cause the cause of this event - */ - void processAdded(FridaProcess process, FridaCause cause); - - /** - * An Process has been replaced in the session - * - * @param process a handle to the new process - * @param cause the cause of this event - */ - void processReplaced(FridaProcess process, FridaCause cause); - - /** - * An process has been removed from the session - * - * @param processId the ID of the now-defunct process - * @param cause the cause of this event - */ - void processRemoved(String processId, FridaCause cause); - - /** - * A different process has been selected (gained focus) - * - * @param process a handle to the selected process - * @param cause the cause of this event - */ - void processSelected(FridaProcess process, FridaCause cause); - - /** - * Execution has been started in an process - * - * @param process a handle to the now-executing process - * @param cause the cause of this event - */ - void processStarted(FridaProcess process, FridaCause cause); - - /** - * Execution has terminated in an process - * - * @param process a handle to the now-stopped process - * @param cause the cause of this event - */ - void processExited(FridaProcess process, FridaCause cause); - - /** - * A thread has been created - * - * Use {@link FridaThread#getProcess()} to get a handle to the process in which the thread was - * created. - * - * @param thread a handle to the new thread - * @param cause the cause of this event - */ - void threadCreated(FridaThread thread, FridaCause cause); - - /** - * A thread has been replaced - * - * Use {@link FridaThread#getProcess()} to get a handle to the process in which the thread was - * created. - * - * @param thread a handle to the new thread - * @param cause the cause of this event - */ - void threadReplaced(FridaThread thread, FridaCause cause); - - /** - * A thread's state has changed - * - * @param thread a handle to the thread whose state has changed - * @param state the state to which the thread changed - * @param cause the cause of this event - * @param reason the reason for the state change - */ - void threadStateChanged(FridaThread thread, FridaState state, FridaCause cause, FridaReason reason); - - /** - * A thread has exited - * - * @param thread the now-defunct thread - * @param process a handle to the process to which the thread belonged - * @param cause the cause of this event - */ - void threadExited(FridaThread thread, FridaProcess process, FridaCause cause); - - /** - * A different thread has been selected (gained focus) - * - * @param thread a handle to the selected thread - * @param frame a handle to the current frame - * @param cause the cause of this event - */ - void threadSelected(FridaThread thread, FridaFrame frame, FridaCause cause); - - /** - * A module has been loaded by an process - * - * @param process a handle to the process which loaded the module - * @param info the name of the module on the target - * @param index in-order index - * @param cause the cause of this event - */ - void moduleLoaded(FridaProcess process, FridaModuleInfo info, int index, FridaCause cause); - - /** - * A module has been loaded by an process - * - * @param process a handle to the process which loaded the module - * @param info the name of the module on the target - * @param index in-order index - * @param cause the cause of this event - */ - void moduleReplaced(FridaProcess process, FridaModuleInfo info, int index, FridaCause cause); - - /** - * A module has been unloaded from an process - * - * @param process a handle to the process which unloaded the module - * @param info the name of the module on the target - * @param index in-order index - * @param cause the cause of this event - */ - void moduleUnloaded(FridaProcess process, FridaModuleInfo info, int index, FridaCause cause); - - /** - * A module has been loaded by an process - * - * @param process a handle to the process which loaded the module - * @param info the name of the region on the target - * @param index in-order index - * @param cause the cause of this event - */ - void regionAdded(FridaProcess process, FridaRegionInfo info, int index, FridaCause cause); - - /** - * A module has been loaded by an process - * - * @param process a handle to the process which loaded the module - * @param info the name of the region on the target - * @param index in-order index - * @param cause the cause of this event - */ - void regionReplaced(FridaProcess process, FridaRegionInfo info, int index, FridaCause cause); - - /** - * A module has been unloaded from an process - * - * @param process a handle to the process which unloaded the module - * @param info the name of the region on the target - * @param index in-order index - * @param cause the cause of this event - */ - void regionRemoved(FridaProcess process, FridaRegionInfo info, int index, FridaCause cause); - - /** - * @param output console output - * @param mask class of output - */ - void consoleOutput(String output, int mask); - - /** - * @param prompt for console output - */ - void promptChanged(String prompt); - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaEventsListenerAdapter.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaEventsListenerAdapter.java deleted file mode 100644 index 51d6a9f843..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaEventsListenerAdapter.java +++ /dev/null @@ -1,146 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager; - -import agent.frida.frida.FridaRegionInfo; -import agent.frida.frida.FridaModuleInfo; - -public interface FridaEventsListenerAdapter extends FridaEventsListener { - - @Override - public default void sessionAdded(FridaSession session, FridaCause cause) { - // Extension point - } - - @Override - public default void sessionReplaced(FridaSession session, FridaCause cause) { - // Extension point - } - - @Override - public default void sessionRemoved(String sessionId, FridaCause cause) { - // Extension point - } - - @Override - public default void sessionSelected(FridaSession session, FridaCause cause) { - // Extension point - } - - @Override - public default void processAdded(FridaProcess process, FridaCause cause) { - // Extension point - } - - @Override - public default void processReplaced(FridaProcess process, FridaCause cause) { - // Extension point - } - - @Override - public default void processRemoved(String processId, FridaCause cause) { - // Extension point - } - - @Override - public default void processSelected(FridaProcess process, FridaCause cause) { - // Extension point - } - - @Override - public default void processStarted(FridaProcess process, FridaCause cause) { - // Extension point - } - - @Override - public default void processExited(FridaProcess process, FridaCause cause) { - // Extension point - } - - @Override - public default void threadCreated(FridaThread thread, FridaCause cause) { - // Extension point - } - - @Override - public default void threadReplaced(FridaThread thread, FridaCause cause) { - // Extension point - } - - @Override - public default void threadStateChanged(FridaThread thread, FridaState state, FridaCause cause, - FridaReason reason) { - // Extension point - } - - @Override - public default void threadExited(FridaThread thread, FridaProcess process, FridaCause cause) { - // Extension point - - } - - @Override - public default void threadSelected(FridaThread thread, FridaFrame frame, FridaCause cause) { - // Extension point - } - - @Override - public default void moduleLoaded(FridaProcess process, FridaModuleInfo info, int index, - FridaCause cause) { - // Extension point - } - - @Override - public default void moduleReplaced(FridaProcess process, FridaModuleInfo info, int index, - FridaCause cause) { - // Extension point - } - - @Override - public default void moduleUnloaded(FridaProcess process, FridaModuleInfo info, int index, - FridaCause cause) { - // Extension point - } - - @Override - public default void regionAdded(FridaProcess process, FridaRegionInfo info, int index, - FridaCause cause) { - // Extension point - } - - @Override - public default void regionReplaced(FridaProcess process, FridaRegionInfo info, int index, - FridaCause cause) { - // Extension point - } - - @Override - public default void regionRemoved(FridaProcess process, FridaRegionInfo info, int index, - FridaCause cause) { - // Extension point - } - - @Override - public default void consoleOutput(String output, int mask) { - // Extension point - } - - @Override - public default void promptChanged(String prompt) { - // Extension point - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaExport.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaExport.java deleted file mode 100644 index 339d64c977..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaExport.java +++ /dev/null @@ -1,57 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager; - -public class FridaExport { - - private FridaModule module; - private String type; - private String name; - private String address; - - public FridaExport(FridaModule module) { - this.module = module; - } - - public FridaModule getModule() { - return module; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? "" : type; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? "" : name; - } - - public String getAddress() { - return address; - } - - public void setAddress(String address) { - this.address = address == null ? "" : address; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaFileSpec.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaFileSpec.java deleted file mode 100644 index 42fb224f10..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaFileSpec.java +++ /dev/null @@ -1,62 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager; - -public class FridaFileSpec { - - private String path; - private Long offset; - private Long size; - - public FridaFileSpec(String path) { - this.path = path; - } - - public String getPath() { - return path; - } - - public void setPath(String path) { - this.path = path; - } - - public String getFilename() { - int index = path.lastIndexOf("/"); - return index < 0 ? path : path.substring(index+1); - } - - public String getDirectory() { - int index = path.lastIndexOf("/"); - return index < 0 ? path : path.substring(0, index); - } - - public Long getOffset() { - return offset; - } - - public void setOffset(Long offset) { - this.offset = offset; - } - - public Long getSize() { - return size; - } - - public void setSize(Long size) { - this.size = size; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaFrame.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaFrame.java deleted file mode 100644 index 30912c2320..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaFrame.java +++ /dev/null @@ -1,66 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager; - -import java.util.Map; - -import com.google.gson.JsonElement; - -public class FridaFrame { - - private String address; - private int frameId; - private FridaFunction function; - - public FridaFrame(Map map, int n) { - this.address = map.get("address").getAsString(); - this.frameId = n; - this.function = new FridaFunction(map); - } - - public int getFrameID() { - return frameId; - } - - public String getModuleName() { - return function.getModuleName(); - } - - public String getFunctionName() { - return function.getFunctionName(); - } - - public String getFileName() { - return function.getFileName(); - } - - public long getLineNumber() { - return function.getLineNumber(); - } - - public FridaFunction getFunction() { - return function; - } - - public String getAddress() { - return address; - } - - public Long getPC() { - return Long.decode(address); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaFunction.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaFunction.java deleted file mode 100644 index 7d1b630df4..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaFunction.java +++ /dev/null @@ -1,68 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager; - -import java.util.Map; - -import com.google.gson.JsonElement; - -public class FridaFunction { - - private String moduleName; - private String functionName; - private String fileName; - private Long lineNumber; - - public FridaFunction(Map map) { - this.setModuleName(map.get("moduleName").getAsString()); - this.setFunctionName(map.get("name").getAsString()); - this.setFileName(map.get("fileName").getAsString()); - this.setLineNumber(map.get("lineNumber").getAsLong()); - } - - public String getModuleName() { - return moduleName; - } - - public void setModuleName(String moduleName) { - this.moduleName = moduleName; - } - - public String getFunctionName() { - return functionName; - } - - public void setFunctionName(String functionName) { - this.functionName = functionName; - } - - public String getFileName() { - return fileName; - } - - public void setFileName(String fileName) { - this.fileName = fileName; - } - - public Long getLineNumber() { - return lineNumber; - } - - public void setLineNumber(Long lineNumber) { - this.lineNumber = lineNumber; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaImport.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaImport.java deleted file mode 100644 index 678a84bd6d..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaImport.java +++ /dev/null @@ -1,75 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager; - -public class FridaImport { - - private FridaModule module; - private String type; - private String slot = ""; - private String mod; - private String name = ""; - private String address; - - public FridaImport(FridaModule module) { - this.module = module; - } - - public FridaModule getModule() { - return module; - } - - public String getSlot() { - return slot; - } - - public void setSlot(String slot) { - this.slot = slot == null ? "" : slot; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? "" : type; - } - - public String getMod() { - return mod; - } - - public void setMod(String module) { - this.mod = module == null ? "" : module; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? "" : name; - } - - public String getAddress() { - return address; - } - - public void setAddress(String address) { - this.address = address == null ? "" : address; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaKernelMemoryRegionInfo.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaKernelMemoryRegionInfo.java deleted file mode 100644 index 3bc9850c52..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaKernelMemoryRegionInfo.java +++ /dev/null @@ -1,36 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager; - -public class FridaKernelMemoryRegionInfo extends FridaMemoryRegionInfo { - - public FridaKernelMemoryRegionInfo() { - super(null); - } - - public String getFilePath() { - return ""; - } - - public Long getFileOffset() { - return 0L; - } - - public Long getFileSize() { - return 0L; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaKernelModule.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaKernelModule.java deleted file mode 100644 index 199aca0543..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaKernelModule.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager; - -public class FridaKernelModule extends FridaModule { - - public FridaKernelModule() { - super(null); - } - - public String getPath() { - return ""; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaManager.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaManager.java deleted file mode 100644 index 76b044f24b..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaManager.java +++ /dev/null @@ -1,405 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import org.apache.commons.lang3.tuple.Pair; - -import agent.frida.frida.FridaClient.DebugStatus; -import agent.frida.manager.impl.FridaManagerImpl; - -public interface FridaManager extends AutoCloseable { - - static FridaManager newInstance() { - return new FridaManagerImpl(); - } - - /** - * Launch Frida - * - * @param args cmd plus args - * @return a future which completes when Frida is ready to accept commands - */ - CompletableFuture start(String[] args); - - /** - * Terminate Frida - */ - void terminate(); - - /** - * Check if Frida is alive - * - * Note this is not about the state of inferiors in Frida. If the Frida controlling process is - * alive, Frida is alive. - * - * @return true if Frida is alive, false otherwise - */ - boolean isRunning(); - - /** - * Add a listener for Frida's state - * - * @see #getState() - * @param listener the listener to add - */ - void addStateListener(FridaStateListener listener); - - /** - * Remove a listener for Frida's state - * - * @see #getState() - * @param listener the listener to remove - */ - void removeStateListener(FridaStateListener listener); - - /** - * Add a listener for events on processes - * - * @param listener the listener to add - */ - void addEventsListener(FridaEventsListener listener); - - /** - * Remove a listener for events on inferiors - * - * @param listener the listener to remove - */ - void removeEventsListener(FridaEventsListener listener); - - /** - * Get a thread by its Frida-assigned ID - * - * Frida numbers its threads using a global counter. These IDs are unrelated to the OS-assigned - * TID. This method can retrieve a thread by its ID no matter which inferior it belongs to. - * - * @param process wrapper for Frida pointer - * @param id the Frida-asigned thread ID - * @return a handle to the thread, if it exists - */ - FridaThread getThread(FridaProcess process, String id); - - /** - * Get an process by its Frida-assigned ID - * - * Frida numbers processes incrementally. All inferiors and created and destroyed by the user. - * See {@link #addProcess()}. - * - * @param session wrapper for Frida pointer - * @param id the process ID - * @return a handle to the process, if it exists - */ - FridaProcess getProcess(FridaSession session, String id); - - /** - * Get an session by its Frida-assigned ID - * - * Frida numbers processes incrementally. All inferiors and created and destroyed by the user. - * See {@link #addSession()}. - * - * @param id the process ID - * @return a handle to the process, if it exists - */ - FridaSession getSession(String id); - - /** - * Get an session by its Frida-assigned ID - * - * Frida numbers processes incrementally. All inferiors and created and destroyed by the user. - * See {@link #addSession()}. - * - * @param process wrapper for Frida pointer - * @param id the process ID - * @return a handle to the process, if it exists - */ - FridaModule getModule(FridaProcess process, String id); - - /** - * Get an memory region by its Frida-assigned ID - * - * Frida numbers processes incrementally. All inferiors and created and destroyed by the user. - * See {@link #addSession()}. - * - * @param process wrapper for Frida pointer - * @param id the process ID - * @return a handle to the process, if it exists - */ - FridaMemoryRegionInfo getMemoryRegion(FridaProcess process, String id); - - /** - * Get all threads known to the manager - * - * This does not ask Frida to lists its known threads. Rather it returns a read-only view of the - * manager's understanding of the current threads based on its tracking of Frida events. - * - * @param process wrapper for Frida pointer - * @return a map of Frida-assigned thread IDs to corresponding thread handles - */ - Map getKnownThreads(FridaProcess process); - - /** - * Get all processes known to the manager - * - * This does not ask Frida to list its processes. Rather it returns a read-only view of the - * manager's understanding of the current processes based on its tracking of Frida events. - * - * @param session wrapper for Frida pointer - * @return a map of process IDs to corresponding process handles - */ - Map getKnownProcesses(FridaSession session); - - /** - * Get all sessions known to the manager - * - * This does not ask Frida to list its processes. Rather it returns a read-only view of the - * manager's understanding of the current inferiors based on its tracking of Frida events. - * - * @return a map of session IDs to corresponding session handles - */ - Map getKnownSessions(); - - /** - * Get all sessions known to the manager - * - * This does not ask Frida to list its processes. Rather it returns a read-only view of the - * manager's understanding of the current inferiors based on its tracking of Frida events. - * - * @param process wrapper for Frida pointer - * @return a map of session IDs to corresponding session handles - */ - Map getKnownModules(FridaProcess process); - - /** - * Get all sessions known to the manager - * - * This does not ask Frida to list its processes. Rather it returns a read-only view of the - * manager's understanding of the current inferiors based on its tracking of Frida events. - * - * @param process wrapper for Frida pointer - * @return a map of session IDs to corresponding session handles - */ - Map getKnownRegions(FridaProcess process); - - /** - * Get the state of the Frida session - * - * In all-stop mode, if any thread is running, Frida is said to be in the running state and is - * unable to process commands. Otherwise, if all threads are stopped, then Frida is said to be - * in the stopped state and can accept and process commands. This manager has not been tested in - * non-stop mode. - * - * @return the state - */ - FridaState getState(); - - /** - * Add a process - * - * @return a future which completes with the handle to the new process - */ - CompletableFuture addProcess(); - - /** - * Remove a process - * - * @param process the process to remove - * @return a future which completes then Frida has executed the command - */ - CompletableFuture removeProcess(FridaProcess process); - - /** - * Add a session - * - * @return a future which completes with the handle to the new process - */ - CompletableFuture addSession(); - - /** - * Execute an arbitrary CLI command, printing output to the CLI console - * - * @param command the command to execute - * @return a future that completes when Frida has executed the command - */ - CompletableFuture console(String command); - - /** - * Execute an arbitrary CLI command, capturing its console output - * - * The output will not be printed to the CLI console. - * - * @param command the command to execute - * @return a future that completes with the captured output when Frida has executed the command - */ - CompletableFuture consoleCapture(String command); - - /** - * List Frida's threads - * - * @param process wrapper for Frida pointer - * @return a future that completes with a map of process IDs to process handles - */ - CompletableFuture listThreads(FridaProcess process); - - /** - * List Frida's processes - * - * @param session wrapper for Frida pointer - * @return a future that completes with a map of process IDs to process handles - */ - CompletableFuture> listProcesses(FridaSession session); - - /** - * List the available processes on target - * - * @return a future that completes with a list of PIDs - */ - CompletableFuture>> listAvailableProcesses(); - - /** - * List the available targets - * - * @return a future that completes with a list of IDs - */ - CompletableFuture>> listAvailableDevices(); - - /** - * List Frida's sessions - * - * @return a future that completes with a map of session IDs to session handles - */ - CompletableFuture> listSessions(); - - /** - * List Frida's stack frames - * - * @param thread wrapper for Frida pointer - * @return a future that completes with a map of session IDs to session handles - */ - CompletableFuture> listStackFrames(FridaThread thread); - - /** - * List Frida's stack frame registers - * - * @param thread wrapper for Frida pointer - * @return a future that completes with a map of session IDs to session handles - */ - CompletableFuture> listRegisters(FridaThread thread); - - /** - * List Frida's modules - * - * @param process wrapper for Frida pointer - * @return a future that completes with a map of session IDs to session handles - */ - public CompletableFuture listModules(FridaProcess process); - - /** - * List Frida's module sections - * - * @param module wrapper for Frida pointer - * @return a future that completes with a map of session IDs to session handles - */ - public CompletableFuture> listModuleSections(FridaModule module); - - /** - * List Frida's module symbols - * - * @param module wrapper for Frida pointer - * @return a future that completes with a map of session IDs to session handles - */ - public CompletableFuture> listModuleSymbols(FridaModule module); - - /** - * List Frida's module imports - * - * @param module wrapper for Frida pointer - * @return a future that completes with a map of session IDs to session handles - */ - public CompletableFuture> listModuleImports(FridaModule module); - - /** - * List Frida's module exports - * - * @param module wrapper for Frida pointer - * @return a future that completes with a map of session IDs to session handles - */ - public CompletableFuture> listModuleExports(FridaModule module); - - /** - * List Frida's memory - * - * @param process wrapper for Frida pointer - * @return a future that completes with a map of session IDs to session handles - */ - public CompletableFuture listMemory(FridaProcess process); - - /** - * List Frida's heap memory - * - * @param process wrapper for Frida pointer - * @return a future that completes with a map of session IDs to session handles - */ - public CompletableFuture listHeapMemory(FridaProcess process); - - /** - * List Frida's heap memory - * - * @param process wrapper for Frida pointer - * @return a future that completes with a map of session IDs to session handles - */ - public CompletableFuture setExceptionHandler(FridaProcess process); - - CompletableFuture attach(String pid); - - CompletableFuture attachDeviceById(String id); - - CompletableFuture attachDeviceByType(String type); - - CompletableFuture launch(String fileName, List args); - - CompletableFuture launch(Map args); - - /********** NEEDED FOR TESTING ************/ - - /** - * Returns the current process - * - * @return the current process - */ - FridaProcess currentProcess(); - - CompletableFuture waitForPrompt(); - - CompletableFuture execute(FridaCommand cmd); - - DebugStatus processEvent(FridaEvent evt); - - DebugStatus getStatus(); - - void updateState(FridaSession session); - - FridaTarget getCurrentTarget(); - - void setCurrentTarget(FridaTarget target); - - CompletableFuture getSessionAttributes(FridaSession session); - - void enableDebugger(FridaSession session, int port); - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaMemoryRegionInfo.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaMemoryRegionInfo.java deleted file mode 100644 index 315c49dc70..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaMemoryRegionInfo.java +++ /dev/null @@ -1,99 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager; - -public class FridaMemoryRegionInfo { - - private FridaProcess process; - private String protection; - private String rangeAddress; - private Long rangeSize; - private FridaFileSpec fileSpec; - - public FridaMemoryRegionInfo(FridaProcess process) { - this.process = process; - } - - public String getProtection() { - return protection; - } - - public void setProtection(String protection) { - this.protection = protection; - } - - public String getRangeAddress() { - return rangeAddress; - } - - public void setRangeAddress(String rangeAddress) { - this.rangeAddress = rangeAddress; - } - - public Long getRangeSize() { - return rangeSize; - } - - public void setRangeSize(Long rangeSize) { - this.rangeSize = rangeSize; - } - - public String getFilePath() { - return fileSpec.getPath(); - } - - public void setFilePath(String filePath) { - this.fileSpec = new FridaFileSpec(filePath); - } - - public Long getFileOffset() { - return fileSpec.getOffset(); - } - - public void setFileOffset(Long fileOffset) { - fileSpec.setOffset(fileOffset); - } - - public Long getFileSize() { - return fileSpec.getSize(); - } - - public void setFileSize(Long fileSize) { - fileSpec.setSize(fileSize); - } - - public Boolean isReadable() { - return protection.contains("r"); - } - - public Boolean isWritable() { - return protection.contains("w"); - } - - public Boolean isExecutable() { - return protection.contains("x"); - } - - public FridaFileSpec getFileSpec() { - return fileSpec; - } - - public FridaProcess getProcess() { - return process; - } - - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaModule.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaModule.java deleted file mode 100644 index b26a5e2906..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaModule.java +++ /dev/null @@ -1,66 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager; - -public class FridaModule { - - private FridaProcess process; - private String name; - private String path; - private String rangeAddress; - private Long rangeSize; - - public FridaModule(FridaProcess process) { - this.process = process; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? "" : name; - } - - public String getPath() { - return path; - } - - public void setPath(String path) { - this.path = path == null ? "" : path; - } - - public String getRangeAddress() { - return rangeAddress; - } - - public void setRangeAddress(String rangeAddress) { - this.rangeAddress = rangeAddress == null ? "0" : rangeAddress; - } - - public Long getRangeSize() { - return rangeSize; - } - - public void setRangeSize(Long rangeSize) { - this.rangeSize = rangeSize; - } - - public FridaProcess getProcess() { - return process; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaOS.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaOS.java deleted file mode 100644 index 0cf37d443b..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaOS.java +++ /dev/null @@ -1,43 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager; - -import com.sun.jna.NativeLong; - -public enum FridaOS { - FRIDA_OS_WINDOWS("windows"), - FRIDA_OS_MACOS("macos"), - FRIDA_OS_LINUX("linux"), - FRIDA_OS_IOS("ios"), - FRIDA_OS_ANDROID("android"), - FRIDA_OS_FREEBSD("freebsd"), - FRIDA_OS_QNX("qnx"); - - final String str; - - FridaOS(String str) { - this.str = str; - } - - @Override - public String toString() { - return str; - } - - public static FridaOS getOS(NativeLong state) { - return FridaOS.values()[state.intValue()]; - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaPointer.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaPointer.java deleted file mode 100644 index e83e7d7a16..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaPointer.java +++ /dev/null @@ -1,35 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager; - -import com.sun.jna.Pointer; - -public class FridaPointer { - - Pointer pointer; - - public FridaPointer(Pointer pointer) { - this.pointer = pointer; - } - - public Pointer getPointer() { - return pointer; - } - - public void setPointer(Pointer pointer) { - this.pointer = pointer; - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaProcess.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaProcess.java deleted file mode 100644 index 07860439d8..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaProcess.java +++ /dev/null @@ -1,96 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager; - -import com.sun.jna.NativeLong; -import com.sun.jna.Pointer; - -public class FridaProcess extends FridaPointer { - - private NativeLong pid; - private String name; - private FridaSession session; - private String identifier; - - public FridaProcess(Pointer process, NativeLong pid) { - super(process); - this.pid = pid; - } - - // Kernel-case - public FridaProcess() { - super(null); - this.pid = new NativeLong(-1L); - } - - public Long getPID() { - return pid.longValue(); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public FridaSession getSession() { - return session; - } - - public void setSession(FridaSession session) { - this.session = session; - } - - public String getIdentifier() { - return identifier; - } - - public void setIdentifier(String identifier) { - this.identifier = identifier; - } - - public FridaTarget getTarget() { - return session.getTarget(); - } - - public FridaError resume() { - FridaTarget target = getTarget(); - FridaError error = new FridaError(); - target.resumeProcess(pid, error); - return error; - } - - public FridaError destroy() { - FridaTarget target = getTarget(); - FridaError error = new FridaError(); - target.killProcess(pid, error); - return error; - } - - public FridaError kill() { - FridaTarget target = getTarget(); - FridaError error = new FridaError(); - target.killProcess(pid, error); - return error; - } - - public String getDescription() { - return getName(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaReason.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaReason.java deleted file mode 100644 index a8ed2cadf8..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaReason.java +++ /dev/null @@ -1,44 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager; - -public interface FridaReason { - - /** - * Reasons other than those given by Frida - */ - enum Reasons implements FridaReason { - /** - * No reason was given - */ - NONE, - /** - * A reason was given, but the manager does not understand it - */ - UNKNOWN; - - @Override - public String desc() { - return "Unknown"; - } - } - - static FridaReason getReason(String info) { - return Reasons.UNKNOWN; - } - - public String desc(); -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaScript.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaScript.java deleted file mode 100644 index 08b7edcae7..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaScript.java +++ /dev/null @@ -1,37 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager; - -import com.sun.jna.NativeLong; -import com.sun.jna.Pointer; - -public class FridaScript extends FridaPointer { - - private NativeLong signal; - - public FridaScript(Pointer script) { - super(script); - } - - public NativeLong getSignal() { - return signal; - } - - public void setSignal(NativeLong signal) { - this.signal = signal; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaSection.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaSection.java deleted file mode 100644 index 85817a18a7..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaSection.java +++ /dev/null @@ -1,98 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager; - -public class FridaSection { - - private FridaModule module; - private String protection; - private String rangeAddress; - private Long rangeSize; - private FridaFileSpec fileSpec; - - public FridaSection(FridaModule module) { - this.module = module; - } - - public String getProtection() { - return protection; - } - - public void setProtection(String protection) { - this.protection = protection; - } - - public String getRangeAddress() { - return rangeAddress; - } - - public void setRangeAddress(String rangeAddress) { - this.rangeAddress = rangeAddress; - } - - public Long getRangeSize() { - return rangeSize; - } - - public void setRangeSize(Long rangeSize) { - this.rangeSize = rangeSize; - } - - public String getFilePath() { - return fileSpec.getPath(); - } - - public void setFilePath(String filePath) { - this.fileSpec = new FridaFileSpec(filePath); - } - - public Long getFileOffset() { - return fileSpec.getOffset(); - } - - public void setFileOffset(Long fileOffset) { - fileSpec.setOffset(fileOffset); - } - - public Long getFileSize() { - return fileSpec.getSize(); - } - - public void setFileSize(Long fileSize) { - fileSpec.setSize(fileSize); - } - - public Boolean isReadable() { - return protection.contains("r"); - } - - public Boolean isWritable() { - return protection.contains("w"); - } - - public Boolean isExecutable() { - return protection.contains("x"); - } - - public FridaFileSpec getFileSpec() { - return fileSpec; - } - - public FridaModule getModule() { - return module; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaSession.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaSession.java deleted file mode 100644 index 2378e9c428..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaSession.java +++ /dev/null @@ -1,75 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager; - -import java.util.Map; - -import com.sun.jna.Pointer; - -import agent.frida.frida.FridaEng; - -public class FridaSession extends FridaPointer { - - private FridaTarget target; - private FridaProcess process; - private Map attributes; - - public FridaSession(Pointer session, FridaProcess process) { - super(session); - this.process = process; - } - - public FridaTarget getTarget() { - return target; - } - - public void setTarget(FridaTarget target) { - this.target = target; - } - - public FridaProcess getProcess() { - return process; - } - - public void setProcess(FridaProcess process) { - this.process = process; - } - - public String getAttribute(String key) { - Object object = attributes.get(key); - if (object == null) { - return "N/A"; - } - return object.toString(); - } - - public void setAttributes(Map attributes) { - this.attributes = attributes; - } - - public FridaError detach() { - FridaError error = new FridaError(); - FridaEng.detach(this, error); - return error; - } - - public FridaError resume() { - FridaError error = new FridaError(); - FridaEng.resume(this, error); - return error; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaState.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaState.java deleted file mode 100644 index 629127bc73..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaState.java +++ /dev/null @@ -1,55 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager; - -import com.sun.jna.NativeLong; - -import ghidra.util.Msg; - -public enum FridaState { - - FRIDA_THREAD_RUNNING("running"), - FRIDA_THREAD_STOPPED("stopped"), - FRIDA_THREAD_WAITING("waiting"), - FRIDA_THREAD_UNINTERRUPTIBLE("uninterruptible"), - FRIDA_THREAD_HALTED("halted"); - - final String str; - - FridaState(String str) { - this.str = str; - } - - @Override - public String toString() { - return str; - } - - public static FridaState byValue(String val) { - for (FridaState state : values()) { - if (state.str.equals(val)) { - return state; - } - } - Msg.warn(FridaState.class, "No such value: " + val); - return null; - } - - public static FridaState getState(NativeLong state) { - return FridaState.values()[state.intValue()]; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaStateListener.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaStateListener.java deleted file mode 100644 index 4fb992a97e..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaStateListener.java +++ /dev/null @@ -1,36 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager; - -import ghidra.util.TriConsumer; - -/** - * A listener for changes in Frida's state - */ -public interface FridaStateListener extends TriConsumer { - /** - * The state has changed because of the given cause - * - * @param state the new state - * @param cause the reason for the change - */ - void stateChanged(FridaState state, FridaCause cause); - - @Override - default void accept(FridaState oldVal, FridaState newVal, FridaCause u) { - stateChanged(newVal, u); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaSymbol.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaSymbol.java deleted file mode 100644 index 914f307e3c..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaSymbol.java +++ /dev/null @@ -1,84 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager; - -public class FridaSymbol { - - private FridaModule module; - private boolean isGlobal; - private String type; - private String sectionId; - private String name; - private String address; - private Long size; - - public FridaSymbol(FridaModule module) { - this.module = module; - } - - public FridaModule getModule() { - return module; - } - - public boolean isGlobal() { - return isGlobal; - } - - public void setGlobal(boolean isGlobal) { - this.isGlobal = isGlobal; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getSectionId() { - return sectionId; - } - - public void setSectionId(String section) { - this.sectionId = section; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getAddress() { - return address; - } - - public void setAddress(String address) { - this.address = address; - } - - public Long getSize() { - return size; - } - - public void setSize(Long size) { - this.size = size; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaTarget.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaTarget.java deleted file mode 100644 index 453facba9c..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaTarget.java +++ /dev/null @@ -1,88 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager; - -import java.math.BigInteger; - -import com.sun.jna.NativeLong; -import com.sun.jna.Pointer; - -import agent.frida.frida.FridaEng; - -public class FridaTarget extends FridaPointer { - - private String id; - private String name; - private FridaSession session; - - public FridaTarget(Pointer device, String id, String name) { - super(device); - this.id = id; - this.name = name; - } - - public FridaSession attach(BigInteger processId, FridaError error) { - return FridaEng.attach(this, new NativeLong(processId.longValue()), error); - } - - public FridaSession launchSimple(String[] argArr, String[] envArr, String workingDir) { - return FridaEng.spawn(this, argArr[0], new FridaError()); - } - - public FridaSession launch(String fileName, String[] argArr, String[] envArr, String pathSTDIN, - String pathSTDOUT, String pathSTDERR, String workingDir, long createFlags, - boolean stopAtEntry, - FridaError error) { - return FridaEng.spawn(this, fileName, error); - } - - public void resumeProcess(NativeLong processId, FridaError error) { - FridaEng.resume(this, processId, error); - } - - public void killProcess(NativeLong processId, FridaError error) { - FridaEng.kill(this, processId, error); - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public FridaSession getSession() { - return session; - } - - public void setSession(FridaSession session) { - this.session = session; - } - - public FridaProcess getProcess() { - return session == null ? null : session.getProcess(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaThread.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaThread.java deleted file mode 100644 index bfb921e656..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaThread.java +++ /dev/null @@ -1,61 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager; - -public class FridaThread { - - private FridaProcess process; - private Long tid; - private FridaState state; - private FridaContext context; - - public FridaThread(FridaProcess process) { - this.process = process; - } - - public Long getTid() { - return tid; - } - - public void setTid(Long tid) { - this.tid = tid; - } - - public FridaState getState() { - return state; - } - - public void setState(FridaState state) { - this.state = state; - } - - public FridaContext getContext() { - return context; - } - - public void setContext(FridaContext context) { - this.context = context; - } - - public FridaProcess getProcess() { - return process; - } - - public String getDescription() { - return Long.toString(getTid()); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaValue.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaValue.java deleted file mode 100644 index 17fcbfab16..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/FridaValue.java +++ /dev/null @@ -1,47 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager; - -import com.google.gson.JsonElement; -import com.sun.jna.NativeLong; - -public class FridaValue { - - private String key; - private String value; - - public FridaValue(String key, String value) { - this.key = key; - this.value = value; - } - - public String getValue() { - return value; - } - - public String getKey() { - return key; - } - - public int getByteSize() { - return 8; - } - - public void setValue(String value) { - this.value = value; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/AbstractFridaCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/AbstractFridaCommand.java deleted file mode 100644 index 88cbd77924..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/AbstractFridaCommand.java +++ /dev/null @@ -1,158 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParser; -import com.google.gson.JsonPrimitive; - -import agent.frida.frida.FridaEng; -import agent.frida.manager.FridaCommand; -import agent.frida.manager.FridaEvent; -import agent.frida.manager.FridaScript; -import agent.frida.manager.FridaState; -import agent.frida.manager.evt.FridaCommandDoneEvent; -import agent.frida.manager.impl.FridaManagerImpl; -import ghidra.util.Msg; - -/** - * A base class for interacting with specific Frida commands - * - * @param the type of object "returned" by the command - */ -public abstract class AbstractFridaCommand implements FridaCommand { - protected final FridaManagerImpl manager; - private String name; - private FridaScript script; - - /** - * Construct a new command to be executed by the given manager - * - * @param manager the manager to execute the command - */ - protected AbstractFridaCommand(FridaManagerImpl manager) { - this.manager = manager; - } - - @Override - public boolean validInState(FridaState state) { - return true; // With dual interpreters, shouldn't have to worry. - } - - @Override - public boolean handle(FridaEvent evt, FridaPendingCommand pending) { - if (evt instanceof FridaCommandDoneEvent) { - return pending.getCommand().equals(((FridaCommandDoneEvent) evt).getCmd()); - } - return false; - } - - @Override - public T complete(FridaPendingCommand pending) { - return null; - } - - @Override - public void invoke() { - // Nothing - } - - - @Override - public void parse(String result, Object data) { - JsonObject jobj = JsonParser.parseString(result).getAsJsonObject(); - if (jobj.has("type")) { - String type = jobj.get("type").getAsString(); - if (type.equals("error")) { - String desc = jobj.get("description").getAsString(); - manager.getEventListeners().invoke().consoleOutput(desc+"\n", 0); - Msg.error(this, desc); - return; - } - } - if (jobj.has("payload")) { - Object object = jobj.get("payload"); - if (!(object instanceof JsonPrimitive)) { - manager.getEventListeners().invoke().consoleOutput(object+" not a String\n", 0); - Msg.error(this, object); - return; - } - - String value = ((JsonPrimitive) object).getAsString(); - if (!value.startsWith("{")) { - manager.getEventListeners().invoke().consoleOutput(object+"\n", 0); - return; - } - JsonElement res = JsonParser.parseString(value); - if (res instanceof JsonObject) { - JsonObject keyValue = (JsonObject) res; - JsonElement element = keyValue.get("key"); - if (element != null) { - res = keyValue.get("value"); - String key = element.getAsString(); - if (!key.equals(name)) { - manager.getEventListeners().invoke().consoleOutput(res+"\n", 0); - return; - } - } else { - manager.getEventListeners().invoke().consoleOutput(object+"\n", 0); - } - } else { - manager.getEventListeners().invoke().consoleOutput(object+"\n", 0); - } - if ("[]".equals(res.toString())) { - Msg.error(this, "nothing returned for "+this); - return; - } - if (res instanceof JsonArray) { - JsonArray arr = (JsonArray) res; - for (JsonElement l : arr) { - parseSpecifics(l); - } - } else { - parseSpecifics(res); - } - } - cleanup(); - } - - public void parseSpecifics(JsonElement object) { - // Nothing - } - - public void cleanup() { - if (script != null) { - FridaEng.unloadScript(script); - FridaEng.disconnectSignal(script, script.getSignal()); - FridaEng.unref(script); - } - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public void setScript(FridaScript script) { - this.script = script; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/AbstractFridaReadCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/AbstractFridaReadCommand.java deleted file mode 100644 index c7d54a0364..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/AbstractFridaReadCommand.java +++ /dev/null @@ -1,59 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import java.nio.ByteBuffer; - -import com.google.gson.JsonElement; - -import agent.frida.manager.impl.FridaManagerImpl; -import ghidra.program.model.address.*; -import ghidra.util.NumericUtilities; - -public abstract class AbstractFridaReadCommand extends AbstractFridaCommand { - - protected final Address addr; - protected final ByteBuffer buf; - protected final int len; - - protected AbstractFridaReadCommand(FridaManagerImpl manager, Address addr, ByteBuffer buf, - int len) { - super(manager); - this.addr = addr; - this.buf = buf; - this.len = len; - } - - @Override - public AddressSetView complete(FridaPendingCommand pending) { - return new AddressSet(addr, addr.add(len - 1)); - } - - @Override - public void parseSpecifics(JsonElement element) { - String payload = element.getAsString(); - String[] lines = payload.split("\n"); - int n = 0; - for (String l : lines) { - String[] split = l.split(" "); - byte[] bytes = NumericUtilities.convertStringToBytes(split[1]); - for (int i = 0; i < 16; i++) { - buf.put(n + i, bytes[i]); - } - n += 16; - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaAddProcessCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaAddProcessCommand.java deleted file mode 100644 index 2c9e0845c7..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaAddProcessCommand.java +++ /dev/null @@ -1,37 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import agent.frida.manager.FridaManager; -import agent.frida.manager.FridaProcess; -import agent.frida.manager.impl.FridaManagerImpl; - -/** - * Implementation of {@link FridaManager#addProcess()} - */ -public class FridaAddProcessCommand extends AbstractFridaCommand { - - public FridaAddProcessCommand(FridaManagerImpl manager) { - super(manager); - } - - @Override - public FridaProcess complete(FridaPendingCommand pending) { - // Not apparent this is needed - return null; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaAddSessionCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaAddSessionCommand.java deleted file mode 100644 index 79a780eb22..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaAddSessionCommand.java +++ /dev/null @@ -1,37 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import agent.frida.manager.FridaManager; -import agent.frida.manager.FridaSession; -import agent.frida.manager.impl.FridaManagerImpl; - -/** - * Implementation of {@link FridaManager#addSession()} - */ -public class FridaAddSessionCommand extends AbstractFridaCommand { - - public FridaAddSessionCommand(FridaManagerImpl manager) { - super(manager); - } - - @Override - public FridaSession complete(FridaPendingCommand pending) { - // Not apparent this is needed - return null; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaAttachCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaAttachCommand.java deleted file mode 100644 index 09a0284573..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaAttachCommand.java +++ /dev/null @@ -1,91 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import java.math.BigInteger; -import java.util.LinkedHashSet; -import java.util.Set; - -import agent.frida.frida.FridaClient; -import agent.frida.frida.FridaThreadInfo; -import agent.frida.manager.*; -import agent.frida.manager.evt.*; -import agent.frida.manager.impl.FridaManagerImpl; - -/** - * Implementation of {@link FridaTarget#attach(BigInteger processId, FridaError error)} - */ -public class FridaAttachCommand extends AbstractFridaCommand> { - - private FridaProcessCreatedEvent created = null; - private boolean completed = false; - private String key; - private int keyType = 0; - private boolean wait = true; - private boolean async = false; - - public FridaAttachCommand(FridaManagerImpl manager, String key) { - this(manager, key, true, false); - this.keyType = 0; - } - - public FridaAttachCommand(FridaManagerImpl manager, String key, boolean wait) { - this(manager, key, wait, false); - this.keyType = 1; - } - - public FridaAttachCommand(FridaManagerImpl manager, String key, boolean wait, boolean async) { - super(manager); - this.key = key; - this.wait = wait; - this.async = async; - this.keyType = 2; - } - - @Override - public boolean handle(FridaEvent evt, FridaPendingCommand pending) { - if (evt instanceof AbstractFridaCompletedCommandEvent && pending.getCommand().equals(this)) { - completed = true; - } - else if (evt instanceof FridaProcessCreatedEvent) { - created = (FridaProcessCreatedEvent) evt; - } - else if (evt instanceof FridaThreadCreatedEvent) { - pending.claim(evt); - } - else if (evt instanceof FridaStoppedEvent) { - pending.claim(evt); - } - return completed && (created != null); - } - - @Override - public Set complete(FridaPendingCommand pending) { - Set threads = new LinkedHashSet<>(); - for (FridaThreadCreatedEvent adds : pending.findAllOf(FridaThreadCreatedEvent.class)) { - FridaThreadInfo info = adds.getInfo(); - threads.add(info.thread); - } - return threads; - } - - @Override - public void invoke() { - FridaClient client = manager.getClient(); - client.attachProcess(client.getLocalServer(), keyType, key, wait, async); - // NB: manager.waitForEventEx - embedded in attach - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaAttachDeviceByIdCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaAttachDeviceByIdCommand.java deleted file mode 100644 index dfffb58a81..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaAttachDeviceByIdCommand.java +++ /dev/null @@ -1,52 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import java.math.BigInteger; - -import agent.frida.frida.FridaClientImpl; -import agent.frida.manager.*; -import agent.frida.manager.impl.FridaManagerImpl; - -/** - * Implementation of {@link FridaTarget#attach(BigInteger processId, FridaError error)} - */ -public class FridaAttachDeviceByIdCommand extends AbstractFridaCommand { - - private String key; - - public FridaAttachDeviceByIdCommand(FridaManagerImpl manager, String key) { - super(manager); - this.key = key; - } - - @Override - public boolean handle(FridaEvent evt, FridaPendingCommand pending) { - return true; - } - - @Override - public Void complete(FridaPendingCommand pending) { - return null; - } - - @Override - public void invoke() { - FridaClientImpl client = (FridaClientImpl) manager.getClient(); - client.createTargetById(key); - // NB: manager.waitForEventEx - embedded in attach - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaAttachDeviceByTypeCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaAttachDeviceByTypeCommand.java deleted file mode 100644 index 5f61c80f15..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaAttachDeviceByTypeCommand.java +++ /dev/null @@ -1,52 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import java.math.BigInteger; - -import agent.frida.frida.FridaClientImpl; -import agent.frida.manager.*; -import agent.frida.manager.impl.FridaManagerImpl; - -/** - * Implementation of {@link FridaTarget#attach(BigInteger processId, FridaError error)} - */ -public class FridaAttachDeviceByTypeCommand extends AbstractFridaCommand { - - private String key; - - public FridaAttachDeviceByTypeCommand(FridaManagerImpl manager, String key) { - super(manager); - this.key = key; - } - - @Override - public boolean handle(FridaEvent evt, FridaPendingCommand pending) { - return true; - } - - @Override - public Void complete(FridaPendingCommand pending) { - return null; - } - - @Override - public void invoke() { - FridaClientImpl client = (FridaClientImpl) manager.getClient(); - client.createTargetByType(key); - // NB: manager.waitForEventEx - embedded in attach - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaCommandError.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaCommandError.java deleted file mode 100644 index 071e46096c..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaCommandError.java +++ /dev/null @@ -1,59 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import agent.frida.manager.FridaCommand; - -/** - * Exception generated by the default "^error" handler - */ -public class FridaCommandError extends RuntimeException { - /** - * - */ - private static final long serialVersionUID = -812711163503400398L; - private final Object info; - - /** - * Construct an error with the given details - * - * @param info the detail information - * @param cmd source of error - */ - public FridaCommandError(Object info, FridaCommand cmd) { - super(cmd + " caused '" + info + "'"); - this.info = info; - } - - /** - * Construct an error with the given message - * - * @param message the message - */ - public FridaCommandError(String message) { - super(message); - this.info = null; - } - - /** - * Get the details, if present - * - * @return the details, or null - */ - public Object getInfo() { - return info; - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaConsoleExecCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaConsoleExecCommand.java deleted file mode 100644 index 35b4f805d5..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaConsoleExecCommand.java +++ /dev/null @@ -1,81 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import com.google.gson.JsonElement; - -import agent.frida.manager.FridaEvent; -import agent.frida.manager.FridaManager; -import agent.frida.manager.evt.AbstractFridaCompletedCommandEvent; -import agent.frida.manager.evt.FridaConsoleOutputEvent; -import agent.frida.manager.impl.FridaManagerImpl; - -/** - * Implementation of {@link FridaManager#console(String)} and similar - */ -public class FridaConsoleExecCommand extends AbstractFridaCommand { - public enum Output { - CONSOLE, CAPTURE; - } - - private String command; - private Output to; - - public FridaConsoleExecCommand(FridaManagerImpl manager, String command, Output to) { - super(manager); - this.command = command; - this.to = to; - } - - @Override - public boolean handle(FridaEvent evt, FridaPendingCommand pending) { - if (evt instanceof AbstractFridaCompletedCommandEvent && - pending.getCommand().equals(this)) { - return true; - } - else if (evt instanceof FridaConsoleOutputEvent && to == Output.CAPTURE) { - pending.steal(evt); - } - return false; - } - - @Override - public String complete(FridaPendingCommand pending) { - if (to == Output.CONSOLE) { - return null; - } - StringBuilder builder = new StringBuilder(); - for (FridaConsoleOutputEvent out : pending.findAllOf(FridaConsoleOutputEvent.class)) { - builder.append(out.getOutput()); - } - return builder.toString(); - } - - @Override - public void invoke() { - if (!command.isEmpty()) { - manager.loadScript(this, "exec", command); - } - } - - @Override - public void parseSpecifics(JsonElement element) { - String res = element.isJsonPrimitive() ? element.getAsString() : element.toString() + "\n"; - manager.getClient().processEvent(new FridaConsoleOutputEvent(0, res)); - //manager.getEventListeners().fire.consoleOutput(object+"\n", 0); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaContinueCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaContinueCommand.java deleted file mode 100644 index c8871a096c..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaContinueCommand.java +++ /dev/null @@ -1,72 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import agent.frida.manager.*; -import agent.frida.manager.evt.*; -import agent.frida.manager.impl.FridaManagerImpl; -import ghidra.dbg.target.TargetExecutionStateful.TargetExecutionState; -import ghidra.util.Msg; - -/** - * Implementation of {@link FridaManager#continue()} - */ -public class FridaContinueCommand extends AbstractFridaCommand { - - private FridaProcess process; - - public FridaContinueCommand(FridaManagerImpl manager, FridaProcess process) { - super(manager); - this.process = process; - } - - public FridaContinueCommand(FridaManagerImpl manager) { - super(manager); - this.process = null; - } - - @Override - public boolean handle(FridaEvent evt, FridaPendingCommand pending) { - if (evt instanceof AbstractFridaCompletedCommandEvent && pending.getCommand().equals(this)) { - pending.claim(evt); - boolean b = evt instanceof FridaCommandErrorEvent || - !pending.findAllOf(FridaRunningEvent.class).isEmpty(); - return b; - } - else if (evt instanceof FridaRunningEvent) { - // Event happens no matter which interpreter received the command - pending.claim(evt); - boolean b = !pending.findAllOf(AbstractFridaCompletedCommandEvent.class).isEmpty(); - return b; - } - return false; - } - - @Override - public Void complete(FridaPendingCommand pending) { - return null; - } - - @Override - public void invoke() { - FridaError res = process == null ? manager.getCurrentSession().resume() : process.resume(); - if (!res.success()) { - Msg.error(this, res.getDescription()); - } - TargetExecutionState state = TargetExecutionState.RUNNING; - manager.getClient().processEvent(new FridaStateChangedEvent(process, state)); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaDestroyCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaDestroyCommand.java deleted file mode 100644 index 9c462f9dc0..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaDestroyCommand.java +++ /dev/null @@ -1,38 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import agent.frida.frida.FridaClient; -import agent.frida.manager.evt.FridaProcessExitedEvent; -import agent.frida.manager.impl.FridaManagerImpl; - -/** - * Implementation of {@link FridaManager#destroy()} - */ -public class FridaDestroyCommand extends AbstractFridaCommand { - public FridaDestroyCommand(FridaManagerImpl manager) { - super(manager); - } - - @Override - public void invoke() { - FridaClient client = manager.getClient(); - // NB: process the event before terminating - manager.processEvent(new FridaProcessExitedEvent(0)); - client.terminateCurrentProcess(manager.getCurrentTarget()); - //client.detachCurrentProcess(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaDetachCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaDetachCommand.java deleted file mode 100644 index 4ec1e18aae..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaDetachCommand.java +++ /dev/null @@ -1,60 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -import agent.frida.frida.FridaClient; -import agent.frida.manager.*; -import agent.frida.manager.impl.FridaManagerImpl; -import ghidra.util.Msg; - -/** - * Implementation of {@link FridaProcess#detach()} - */ -public class FridaDetachCommand extends AbstractFridaCommand { - - private final FridaSession session; - - public FridaDetachCommand(FridaManagerImpl manager, FridaSession session) { - super(manager); - this.session = session; - } - - @Override - public Void complete(FridaPendingCommand pending) { - FridaProcess process = session.getProcess(); - String pid = FridaClient.getId(process); - Map threads = manager.getKnownThreads(process); - List list= new ArrayList<>(); - list.addAll(threads.values()); - for (FridaThread thread : list) { - manager.removeThread(pid, FridaClient.getId(thread)); - } - manager.getEventListeners().invoke().processRemoved(pid, FridaCause.Causes.UNCLAIMED); - return null; - } - - @Override - public void invoke() { - FridaError res = session.detach(); - if (!res.success()) { - Msg.error(this, res.getDescription()); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaGetSessionAttributesCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaGetSessionAttributesCommand.java deleted file mode 100644 index fad5726157..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaGetSessionAttributesCommand.java +++ /dev/null @@ -1,69 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import java.util.HashMap; -import java.util.Map; -import java.util.Map.Entry; - -import com.google.gson.JsonElement; - -import agent.frida.manager.FridaSession; -import agent.frida.manager.impl.FridaManagerImpl; - -public class FridaGetSessionAttributesCommand extends AbstractFridaCommand { - - protected final FridaSession session; - private Map attributes = new HashMap<>(); - - public FridaGetSessionAttributesCommand(FridaManagerImpl manager, FridaSession session) { - super(manager); - this.session = session; - } - - @Override - public void invoke() { - manager.setCurrentSession(session); - manager.loadScript(this, "get_session_attributes", - "var d = {};" + - "d['version'] = Frida.version;" + - "d['heapSize'] = Frida.heapSize;" + - "d['id'] = Process.id;" + - "d['arch'] = Process.arch;" + - "d['os'] = Process.platform;" + - "d['pageSize'] = Process.pageSize;" + - "d['pointerSize'] = Process.pointerSize;" + - "d['codeSigning'] = Process.codeSigningPolicy;" + - "d['debugger'] = Process.isDebuggerAttached();" + - "d['runtime'] = Script.runtime;" + - "d['kernel'] = Kernel.available;" + - "if (Kernel.available) {" + - " d['kbase'] = Kernel.base;" + - " d['kPageSize'] = Kernel.pageSize;" + - "}" + - "result = d;"); - session.setAttributes(attributes); - } - - @Override - public void parseSpecifics(JsonElement element) { - attributes = new HashMap<>(); - for (Entry entry : element.getAsJsonObject().entrySet()) { - attributes.put(entry.getKey(), entry.getValue().getAsString()); - } - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaInterceptFunctionCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaInterceptFunctionCommand.java deleted file mode 100644 index 868bc0bdb3..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaInterceptFunctionCommand.java +++ /dev/null @@ -1,70 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import java.io.*; -import java.util.Map; - -import com.google.gson.JsonElement; - -import agent.frida.manager.impl.FridaManagerImpl; -import ghidra.util.Msg; - -public class FridaInterceptFunctionCommand extends AbstractFridaCommand { - - private String address; - private Map arguments; - - public FridaInterceptFunctionCommand(FridaManagerImpl manager, String address, Map arguments) { - super(manager); - this.address = address; - this.arguments = arguments; - } - - @Override - public void invoke() { - String cmd = "Interceptor.attach(ptr(" + address + "), {"; - try { - String onEnter = (String) arguments.get("OnEnter"); - FileInputStream fis; - if (!onEnter.isEmpty()) { - fis = new FileInputStream(new File(onEnter)); - byte[] bytes = fis.readAllBytes(); - String str = new String(bytes); - cmd += str + ","; - } - String onLeave = (String) arguments.get("OnLeave"); - if (!onLeave.isEmpty()) { - fis = new FileInputStream(new File(onLeave)); - byte[] bytes = fis.readAllBytes(); - String str = new String(bytes); - cmd += str + ","; - } - cmd = cmd.substring(0, cmd.length()-1) + "});"; - } - catch (IOException e) { - e.printStackTrace(); - return; - } - - manager.loadPermanentScript(this, (String) arguments.get("Name"), cmd); - } - - @Override - public void parseSpecifics(JsonElement element) { - Msg.info(this, element.getAsString()); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaKillCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaKillCommand.java deleted file mode 100644 index 4184411c82..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaKillCommand.java +++ /dev/null @@ -1,39 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import agent.frida.frida.FridaClient; -import agent.frida.manager.FridaProcess; -import agent.frida.manager.evt.FridaProcessExitedEvent; -import agent.frida.manager.impl.FridaManagerImpl; - -/** - * Implementation of {@link FridaProcess#kill()} - */ -public class FridaKillCommand extends AbstractFridaCommand { - public FridaKillCommand(FridaManagerImpl manager) { - super(manager); - } - - @Override - public void invoke() { - FridaClient client = manager.getClient(); - // NB: process the event before terminating - manager.processEvent(new FridaProcessExitedEvent(0)); - client.terminateCurrentProcess(manager.getCurrentTarget()); - //client.detachCurrentProcess(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaLaunchProcessCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaLaunchProcessCommand.java deleted file mode 100644 index d51d99e8c0..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaLaunchProcessCommand.java +++ /dev/null @@ -1,88 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import java.util.ArrayList; -import java.util.List; - -import agent.frida.frida.FridaClient; -import agent.frida.manager.*; -import agent.frida.manager.evt.AbstractFridaCompletedCommandEvent; -import agent.frida.manager.evt.FridaProcessCreatedEvent; -import agent.frida.manager.impl.FridaManagerImpl; - -/** - * Implementation of {@link FridaProcess#launch(String)} - */ -public class FridaLaunchProcessCommand extends AbstractFridaCommand { - - private FridaProcessCreatedEvent created = null; - private boolean completed = false; - private String fileName; - private List args; - private List envp; - private List pathsIO; - private String wdir; - private long flags; - private boolean stopAtEntry; - - public FridaLaunchProcessCommand(FridaManagerImpl manager, String fileName, List args) { - this(manager, fileName, args, null, null, "", 0L, true); - } - - public FridaLaunchProcessCommand(FridaManagerImpl manager, String fileName, List args, - List envp, - List pathsIO, String workingDirectory, long flags, boolean stopAtEntry) { - super(manager); - this.fileName = fileName; - this.args = args == null ? new ArrayList<>() : args; - this.envp = envp == null ? new ArrayList<>() : envp; - this.pathsIO = pathsIO; - if (pathsIO == null) { - this.pathsIO = new ArrayList<>(); - this.pathsIO.add(""); - this.pathsIO.add(""); - this.pathsIO.add(""); - } - this.wdir = workingDirectory; - this.flags = flags; - this.stopAtEntry = stopAtEntry; - } - - @Override - public boolean handle(FridaEvent evt, FridaPendingCommand pending) { - if (evt instanceof AbstractFridaCompletedCommandEvent && pending.getCommand().equals(this)) { - completed = true; - } - else if (evt instanceof FridaProcessCreatedEvent) { - created = (FridaProcessCreatedEvent) evt; - } - return completed && (created != null); - } - - @Override - public FridaThread complete(FridaPendingCommand pending) { - return manager.getCurrentThread(); - } - - @Override - public void invoke() { - FridaClient client = manager.getClient(); - //client.createProcess(client.getLocalServer(), fileName); - client.createProcess(client.getLocalServer(), fileName, args, envp, pathsIO, wdir, flags, - stopAtEntry); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaLaunchProcessWithOptionsCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaLaunchProcessWithOptionsCommand.java deleted file mode 100644 index f4d7ffb16a..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaLaunchProcessWithOptionsCommand.java +++ /dev/null @@ -1,124 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; - -import agent.frida.frida.FridaClient; -import agent.frida.frida.FridaClient.DebugCreateFlags; -import agent.frida.manager.*; -import agent.frida.manager.evt.AbstractFridaCompletedCommandEvent; -import agent.frida.manager.evt.FridaProcessCreatedEvent; -import agent.frida.manager.impl.FridaManagerImpl; - -/** - * Implementation of {@link FridaTarget#launch(String)} - */ -public class FridaLaunchProcessWithOptionsCommand extends AbstractFridaCommand { - - private FridaProcessCreatedEvent created = null; - private boolean completed = false; - private String fileName; - private List args; - private List envp; - private List pathsIO; - private String wdir; - private long flags; - private boolean stopAtEntry; - - public FridaLaunchProcessWithOptionsCommand(FridaManagerImpl manager, Map args) { - super(manager); - this.fileName = (String) args.get("File"); - String argstr = (String) args.get("Args"); - this.args = argstr.equals("") ? new ArrayList() : Arrays.asList(argstr.split(" ")); - String envstr = (String) args.get("Env"); - this.envp = envstr.equals("") ? new ArrayList() : Arrays.asList(envstr.split(" ")); - this.pathsIO = new ArrayList<>(); - this.pathsIO.add((String)args.get("STDIN")); - this.pathsIO.add((String)args.get("STDOUT")); - this.pathsIO.add((String)args.get("STDERR")); - this.wdir = (String) args.get("Dir"); - this.flags = DebugCreateFlags.LAUNCH_DEFAULT.getMask(); - this.stopAtEntry = false; - if ((boolean) args.get("Exec")) { - flags |= DebugCreateFlags.LAUNCH_EXEC.getMask(); - } - if ((boolean) args.get("BreakOnLaunch")) { - flags |= DebugCreateFlags.LAUNCH_DEBUG.getMask(); - } - if ((boolean) args.get("BreakOnEntry")) { - flags |= DebugCreateFlags.LAUNCH_STOP_AT_ENTRY.getMask(); - stopAtEntry = true; - } - if ((boolean) args.get("ASLR")) { - flags |= DebugCreateFlags.LAUNCH_DISABLE_ASLR.getMask(); - } - if ((boolean) args.get("STDIO")) { - flags |= DebugCreateFlags.LAUNCH_DISABLE_STDIO.getMask(); - } - if ((boolean) args.get("NewTTY")) { - flags |= DebugCreateFlags.LAUNCH_IN_TTY.getMask(); - } - if ((boolean) args.get("Shell")) { - flags |= DebugCreateFlags.LAUNCH_IN_SHELL.getMask(); - } - if ((boolean) args.get("NewGroup")) { - flags |= DebugCreateFlags.LAUNCH_IN_SEP_GROUP.getMask(); - } - if ((boolean) args.get("ExitRace")) { - flags |= DebugCreateFlags.LAUNCH_DONT_SET_EXIT_STATUS.getMask(); - } - if ((boolean) args.get("Detach")) { - flags |= DebugCreateFlags.LAUNCH_DETACH_ON_ERROR.getMask(); - } - if ((boolean) args.get("ExpandArgs")) { - flags |= DebugCreateFlags.LAUNCH_SHELL_EXPAND_ARGS.getMask(); - } - if ((boolean) args.get("CloseTTY")) { - flags |= DebugCreateFlags.LAUNCH_CLOSE_TTY_ON_EXIT.getMask(); - } - if ((boolean) args.get("Inherit")) { - flags |= DebugCreateFlags.LAUNCH_INHERIT_FROM_PARENT.getMask(); - } - } - - - @Override - public boolean handle(FridaEvent evt, FridaPendingCommand pending) { - if (evt instanceof AbstractFridaCompletedCommandEvent && pending.getCommand().equals(this)) { - completed = true; - } - else if (evt instanceof FridaProcessCreatedEvent) { - created = (FridaProcessCreatedEvent) evt; - } - return completed && (created != null); - } - - @Override - public FridaThread complete(FridaPendingCommand pending) { - return manager.getCurrentThread(); - } - - @Override - public void invoke() { - FridaClient client = manager.getClient(); - client.createProcess(client.getLocalServer(), fileName, args, envp, pathsIO, wdir, flags, - stopAtEntry); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListAvailableDevicesCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListAvailableDevicesCommand.java deleted file mode 100644 index 65f27257b3..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListAvailableDevicesCommand.java +++ /dev/null @@ -1,53 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.lang3.tuple.ImmutablePair; -import org.apache.commons.lang3.tuple.Pair; - -import agent.frida.frida.FridaClientImpl; -import agent.frida.frida.FridaEng; -import agent.frida.manager.FridaTarget; -import agent.frida.manager.impl.FridaManagerImpl; - -public class FridaListAvailableDevicesCommand - extends AbstractFridaCommand>> { - - private List targetList; - - public FridaListAvailableDevicesCommand(FridaManagerImpl manager) { - super(manager); - } - - @Override - public List> complete(FridaPendingCommand pending) { - List> result = new ArrayList<>(); - for (FridaTarget p : targetList) { - result.add(new ImmutablePair(p.getId(), p.getName())); - } - return result; - } - - @Override - public void invoke() { - FridaClientImpl client = (FridaClientImpl) manager.getClient(); - targetList = FridaEng.enumerateDevices(client.getDebugger()); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListAvailableProcessesCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListAvailableProcessesCommand.java deleted file mode 100644 index 26c8f6e4b0..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListAvailableProcessesCommand.java +++ /dev/null @@ -1,51 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.lang3.tuple.ImmutablePair; -import org.apache.commons.lang3.tuple.Pair; - -import agent.frida.frida.FridaEng; -import agent.frida.manager.FridaProcess; -import agent.frida.manager.impl.FridaManagerImpl; - -public class FridaListAvailableProcessesCommand - extends AbstractFridaCommand>> { - - private List processList; - - public FridaListAvailableProcessesCommand(FridaManagerImpl manager) { - super(manager); - } - - @Override - public List> complete(FridaPendingCommand pending) { - List> result = new ArrayList<>(); - for (FridaProcess p : processList) { - result.add(new ImmutablePair(Long.toString(p.getPID()), p.getName())); - } - return result; - } - - @Override - public void invoke() { - processList = FridaEng.enumerateProcesses(manager.getCurrentTarget()); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListHeapMemoryRegionsCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListHeapMemoryRegionsCommand.java deleted file mode 100644 index 56bbd738e5..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListHeapMemoryRegionsCommand.java +++ /dev/null @@ -1,63 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; - -import agent.frida.manager.FridaMemoryRegionInfo; -import agent.frida.manager.FridaProcess; -import agent.frida.manager.impl.FridaManagerImpl; - -public class FridaListHeapMemoryRegionsCommand extends AbstractFridaCommand { - - private FridaProcess process; - private List regions = new ArrayList<>(); - - public FridaListHeapMemoryRegionsCommand(FridaManagerImpl manager, FridaProcess process) { - super(manager); - this.process = process; - } - - /* - @Override - public List complete(FridaPendingCommand pending) { - return memoryRegions; - } - */ - - @Override - public void invoke() { - manager.loadScript(this, "list_malloc_ranges", - "result = Process.enumerateMallocRanges('---');"); - for (FridaMemoryRegionInfo region : regions) { - manager.addMemoryRegionIfAbsent(process, region); - } - } - - @Override - public void parseSpecifics(JsonElement element) { - FridaMemoryRegionInfo region = new FridaMemoryRegionInfo(process); - JsonObject memDetails = element.getAsJsonObject(); - region.setRangeAddress(memDetails.get("base").getAsString()); - region.setRangeSize(memDetails.get("size").getAsLong()); - regions.add(region); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListKernelMemoryRegionsCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListKernelMemoryRegionsCommand.java deleted file mode 100644 index 18912092cd..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListKernelMemoryRegionsCommand.java +++ /dev/null @@ -1,53 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; - -import agent.frida.manager.FridaKernelMemoryRegionInfo; -import agent.frida.manager.impl.FridaManagerImpl; - -public class FridaListKernelMemoryRegionsCommand extends AbstractFridaCommand { - - private List regions = new ArrayList<>(); - - public FridaListKernelMemoryRegionsCommand(FridaManagerImpl manager) { - super(manager); - } - - @Override - public void invoke() { - manager.loadScript(this, "list_ranges", - "result = Kernel.enumerateRanges('---');"); - for (FridaKernelMemoryRegionInfo region : regions) { - manager.addKernelMemoryRegionIfAbsent(region); - } - } - - @Override - public void parseSpecifics(JsonElement element) { - FridaKernelMemoryRegionInfo region = new FridaKernelMemoryRegionInfo(); - JsonObject memDetails = element.getAsJsonObject(); - region.setRangeAddress(memDetails.get("base").getAsString()); - region.setRangeSize(memDetails.get("size").getAsLong()); - region.setProtection(memDetails.get("protection").getAsString()); - regions.add(region); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListKernelModulesCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListKernelModulesCommand.java deleted file mode 100644 index 7c556603c7..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListKernelModulesCommand.java +++ /dev/null @@ -1,53 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; - -import agent.frida.manager.FridaKernelModule; -import agent.frida.manager.impl.FridaManagerImpl; - -public class FridaListKernelModulesCommand extends AbstractFridaCommand { - - private List modules = new ArrayList<>(); - - public FridaListKernelModulesCommand(FridaManagerImpl manager) { - super(manager); - } - - @Override - public void invoke() { - manager.loadScript(this, "list_modules", - "result = Kernel.enumerateModules();"); - for (FridaKernelModule module : modules) { - manager.addKernelModuleIfAbsent(module); - } - } - - @Override - public void parseSpecifics(JsonElement element) { - FridaKernelModule module = new FridaKernelModule(); - JsonObject modDetails = element.getAsJsonObject(); - module.setName(modDetails.get("name").getAsString()); - module.setRangeAddress(modDetails.get("base").getAsString()); - module.setRangeSize(modDetails.get("size").getAsLong()); - modules.add(module); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListMemoryRegionsCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListMemoryRegionsCommand.java deleted file mode 100644 index a04c63d136..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListMemoryRegionsCommand.java +++ /dev/null @@ -1,62 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; - -import agent.frida.manager.FridaMemoryRegionInfo; -import agent.frida.manager.FridaProcess; -import agent.frida.manager.impl.FridaManagerImpl; - -public class FridaListMemoryRegionsCommand extends AbstractFridaCommand { - - private FridaProcess process; - private List regions = new ArrayList<>(); - - public FridaListMemoryRegionsCommand(FridaManagerImpl manager, FridaProcess process) { - super(manager); - this.process = process; - } - - @Override - public void invoke() { - manager.loadScript(this, "list_ranges", - "result = Process.enumerateRanges('---');"); - for (FridaMemoryRegionInfo region : regions) { - manager.addMemoryRegionIfAbsent(process, region); - } - } - - @Override - public void parseSpecifics(JsonElement element) { - FridaMemoryRegionInfo region = new FridaMemoryRegionInfo(process); - JsonObject memDetails = element.getAsJsonObject(); - region.setRangeAddress(memDetails.get("base").getAsString()); - region.setRangeSize(memDetails.get("size").getAsLong()); - region.setProtection(memDetails.get("protection").getAsString()); - JsonObject memFile = (JsonObject) memDetails.get("file"); - if (memFile != null) { - region.setFilePath(memFile.get("path").getAsString()); - region.setFileOffset(memFile.get("offset").getAsLong()); - region.setFileSize(memFile.get("size").getAsLong()); - } - regions.add(region); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListModuleExportsCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListModuleExportsCommand.java deleted file mode 100644 index 546a5bef39..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListModuleExportsCommand.java +++ /dev/null @@ -1,63 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; - -import agent.frida.frida.FridaClient; -import agent.frida.manager.FridaExport; -import agent.frida.manager.FridaModule; -import agent.frida.manager.impl.FridaManagerImpl; - -public class FridaListModuleExportsCommand extends AbstractFridaCommand> { - protected final FridaModule module; - private Map exports; - - public FridaListModuleExportsCommand(FridaManagerImpl manager, FridaModule module) { - super(manager); - this.module = module; - } - - @Override - public Map complete(FridaPendingCommand pending) { - return exports; - } - - @Override - public void invoke() { - exports = new HashMap<>(); - manager.loadScript(this, "list_module_Exports", - "result = Process.findModuleByAddress('"+module.getRangeAddress()+"').enumerateExports();"); - for (FridaExport imp : exports.values()) { - exports.put(FridaClient.getId(imp), imp); - } - } - - @Override - public void parseSpecifics(JsonElement element) { - FridaExport export = new FridaExport(module); - JsonObject symDetails = element.getAsJsonObject(); - export.setAddress(symDetails.get("address").getAsString()); - export.setName(symDetails.get("name").getAsString()); - export.setType(symDetails.get("type").getAsString()); - exports.put(FridaClient.getId(export), export); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListModuleImportsCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListModuleImportsCommand.java deleted file mode 100644 index aabef58fc1..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListModuleImportsCommand.java +++ /dev/null @@ -1,68 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; - -import agent.frida.frida.FridaClient; -import agent.frida.manager.FridaImport; -import agent.frida.manager.FridaModule; -import agent.frida.manager.impl.FridaManagerImpl; - -public class FridaListModuleImportsCommand extends AbstractFridaCommand> { - protected final FridaModule module; - private Map imports; - - public FridaListModuleImportsCommand(FridaManagerImpl manager, FridaModule module) { - super(manager); - this.module = module; - } - - @Override - public Map complete(FridaPendingCommand pending) { - return imports; - } - - @Override - public void invoke() { - imports = new HashMap<>(); - manager.loadScript(this, "list_module_imports", - "result = Process.findModuleByAddress('"+module.getRangeAddress()+"').enumerateImports();"); - for (FridaImport imp : imports.values()) { - imports.put(FridaClient.getId(imp), imp); - } - } - - @Override - public void parseSpecifics(JsonElement element) { - FridaImport imp = new FridaImport(module); - JsonObject symDetails = element.getAsJsonObject(); - imp.setName(symDetails.get("name").getAsString()); - imp.setAddress(symDetails.get("address").getAsString()); - imp.setType(symDetails.get("type").getAsString()); - imp.setMod(symDetails.get("module").getAsString()); - JsonElement slot = symDetails.get("slot"); - if (slot != null) { - imp.setSlot(slot.getAsString()); - } - imports.put(FridaClient.getId(imp), imp); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListModuleSectionsCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListModuleSectionsCommand.java deleted file mode 100644 index ed2599bbac..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListModuleSectionsCommand.java +++ /dev/null @@ -1,69 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; - -import agent.frida.frida.FridaClient; -import agent.frida.manager.FridaModule; -import agent.frida.manager.FridaSection; -import agent.frida.manager.impl.FridaManagerImpl; - -public class FridaListModuleSectionsCommand extends AbstractFridaCommand> { - protected final FridaModule module; - private Map sections; - - public FridaListModuleSectionsCommand(FridaManagerImpl manager, FridaModule module) { - super(manager); - this.module = module; - } - - @Override - public Map complete(FridaPendingCommand pending) { - return sections; - } - - @Override - public void invoke() { - sections = new HashMap<>(); - manager.loadScript(this, "list_module_ranges", - "result = Process.findModuleByAddress('"+module.getRangeAddress()+"').enumerateRanges('---');"); - for (FridaSection section : sections.values()) { - sections.put(FridaClient.getId(section), section); - } - } - - @Override - public void parseSpecifics(JsonElement element) { - FridaSection section = new FridaSection(module); - JsonObject sectionDetails = element.getAsJsonObject(); - section.setRangeAddress((String) sectionDetails.get("base").getAsString()); - section.setRangeSize((Long) sectionDetails.get("size").getAsLong()); - section.setProtection((String) sectionDetails.get("protection").getAsString()); - JsonObject sectionFile = (JsonObject) sectionDetails.get("file"); - if (sectionFile != null) { - section.setFilePath(sectionFile.get("path").getAsString()); - section.setFileOffset(sectionFile.get("offset").getAsLong()); - section.setFileSize(sectionFile.get("size").getAsLong()); - } - sections.put(FridaClient.getId(section), section); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListModuleSymbolsCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListModuleSymbolsCommand.java deleted file mode 100644 index ca951279d8..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListModuleSymbolsCommand.java +++ /dev/null @@ -1,70 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; - -import agent.frida.frida.FridaClient; -import agent.frida.manager.FridaModule; -import agent.frida.manager.FridaSymbol; -import agent.frida.manager.impl.FridaManagerImpl; - -public class FridaListModuleSymbolsCommand extends AbstractFridaCommand> { - protected final FridaModule module; - private Map symbols; - - public FridaListModuleSymbolsCommand(FridaManagerImpl manager, FridaModule module) { - super(manager); - this.module = module; - } - - @Override - public Map complete(FridaPendingCommand pending) { - return symbols; - } - - @Override - public void invoke() { - symbols = new HashMap<>(); - manager.loadScript(this, "list_module_symbols", - "result = Process.findModuleByAddress('"+module.getRangeAddress()+"').enumerateSymbols();"); - for (FridaSymbol symbol : symbols.values()) { - symbols.put(FridaClient.getId(symbol), symbol); - } - } - - @Override - public void parseSpecifics(JsonElement element) { - FridaSymbol symbol = new FridaSymbol(module); - JsonObject symDetails = element.getAsJsonObject(); - symbol.setAddress(symDetails.get("address").getAsString()); - symbol.setSize(symDetails.get("size").getAsLong()); - symbol.setType(symDetails.get("type").getAsString()); - symbol.setName(symDetails.get("name").getAsString()); - symbol.setGlobal(symDetails.get("isGlobal").getAsBoolean()); - Object sect = symDetails.get("section"); - if (sect != null) { - JsonObject section = (JsonObject) sect; - symbol.setSectionId(section.get("id").getAsString()); - } - symbols.put(FridaClient.getId(symbol), symbol); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListModulesCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListModulesCommand.java deleted file mode 100644 index f20da98ae3..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListModulesCommand.java +++ /dev/null @@ -1,57 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; - -import agent.frida.manager.FridaModule; -import agent.frida.manager.FridaProcess; -import agent.frida.manager.impl.FridaManagerImpl; - -public class FridaListModulesCommand extends AbstractFridaCommand { - - protected final FridaProcess process; - private List modules = new ArrayList<>(); - - public FridaListModulesCommand(FridaManagerImpl manager, FridaProcess process) { - super(manager); - this.process = process; - } - - @Override - public void invoke() { - manager.loadScript(this, "list_modules", - "result = Process.enumerateModules();"); - for (FridaModule module : modules) { - manager.addModuleIfAbsent(process, module); - } - } - - @Override - public void parseSpecifics(JsonElement element) { - FridaModule module = new FridaModule(process); - JsonObject modDetails = element.getAsJsonObject(); - module.setName(modDetails.get("name").getAsString()); - module.setPath(modDetails.get("path").getAsString()); - module.setRangeAddress(modDetails.get("base").getAsString()); - module.setRangeSize(modDetails.get("size").getAsLong()); - modules.add(module); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListProcessesCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListProcessesCommand.java deleted file mode 100644 index eebd5fa2b0..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListProcessesCommand.java +++ /dev/null @@ -1,63 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import java.util.*; - -import agent.frida.frida.FridaClient; -import agent.frida.manager.*; -import agent.frida.manager.FridaCause.Causes; -import agent.frida.manager.impl.FridaManagerImpl; - -/** - * Implementation of {@link FridaManager#listProcesses(FridaSession session)} - */ -public class FridaListProcessesCommand extends AbstractFridaCommand> { - private Map updatedProcesses; - private FridaSession session; - - public FridaListProcessesCommand(FridaManagerImpl manager, FridaSession session) { - super(manager); - this.session = session; - } - - @Override - public Map complete(FridaPendingCommand pending) { - Map allProcesses = manager.getKnownProcesses(session); - Set cur = allProcesses.keySet(); - for (String id : updatedProcesses.keySet()) { - if (cur.contains(id)) { - continue; // Do nothing, we're in sync - } - manager.addProcessIfAbsent(session, updatedProcesses.get(id)); - } - String sessionId = FridaClient.getId(session); - for (String id : new ArrayList<>(cur)) { - if (updatedProcesses.containsKey(id)) { - continue; // Do nothing, we're in sync - } - manager.removeProcess(sessionId, id, Causes.UNCLAIMED); - } - return allProcesses; - } - - @Override - public void invoke() { - FridaProcess p = session.getProcess(); - updatedProcesses = new HashMap<>(); - updatedProcesses.put(FridaClient.getId(p), p); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListRegistersCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListRegistersCommand.java deleted file mode 100644 index 6874f7f831..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListRegistersCommand.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import java.util.Map; - -import com.google.gson.JsonElement; - -import agent.frida.manager.FridaContext; -import agent.frida.manager.FridaThread; -import agent.frida.manager.impl.FridaManagerImpl; - -public class FridaListRegistersCommand extends AbstractFridaCommand> { - protected final FridaThread thread; - private Map result; - - public FridaListRegistersCommand(FridaManagerImpl manager, FridaThread thread) { - super(manager); - this.thread = thread; - } - - @Override - public Map complete(FridaPendingCommand pending) { - return result; - } - - @Override - public void invoke() { - FridaContext context = thread.getContext(); - result = context.getChildren(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListSessionsCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListSessionsCommand.java deleted file mode 100644 index 731dfd117e..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListSessionsCommand.java +++ /dev/null @@ -1,61 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import java.util.ArrayList; -import java.util.Map; -import java.util.Set; - -import agent.frida.manager.FridaCause.Causes; -import agent.frida.manager.FridaManager; -import agent.frida.manager.FridaSession; -import agent.frida.manager.impl.FridaManagerImpl; - -/** - * Implementation of {@link FridaManager#listSessions()} - */ -public class FridaListSessionsCommand extends AbstractFridaCommand> { - private Map updatedSessions; - - public FridaListSessionsCommand(FridaManagerImpl manager) { - super(manager); - } - - @Override - public Map complete(FridaPendingCommand pending) { - Map allSessions = manager.getKnownSessions(); - Set cur = allSessions.keySet(); - for (String id : updatedSessions.keySet()) { - if (cur.contains(id)) { - continue; // Do nothing, we're in sync - } - manager.addSessionIfAbsent(updatedSessions.get(id)); - } - for (String id : new ArrayList<>(cur)) { - if (updatedSessions.containsKey(id)) { - continue; // Do nothing, we're in sync - } - manager.removeSession(id, Causes.UNCLAIMED); - } - return allSessions; - } - - @Override - public void invoke() { - updatedSessions = manager.getClient().listSessions(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListStackFramesCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListStackFramesCommand.java deleted file mode 100644 index 7ef0c29a30..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListStackFramesCommand.java +++ /dev/null @@ -1,62 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import java.util.HashMap; -import java.util.Map; -import java.util.Map.Entry; - -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; - -import agent.frida.frida.FridaClient; -import agent.frida.manager.FridaFrame; -import agent.frida.manager.FridaThread; -import agent.frida.manager.impl.FridaManagerImpl; - -public class FridaListStackFramesCommand extends AbstractFridaCommand> { - protected final FridaThread thread; - private Map frames = new HashMap<>(); - private int frameCount = 0; - - public FridaListStackFramesCommand(FridaManagerImpl manager, FridaThread thread) { - super(manager); - this.thread = thread; - } - - @Override - public Map complete(FridaPendingCommand pending) { - return frames; - } - - @Override - public void invoke() { - manager.loadScript(this, "list_stack_frames", - "result = Thread.backtrace(this.context, Backtracer.ACCURATE).map(DebugSymbol.fromAddress);"); - //"console.log(JSON.stringify(Thread.backtrace(this.context, Backtracer.ACCURATE)));"); - } - - @Override - public void parseSpecifics(JsonElement element) { - JsonObject jobj = element.getAsJsonObject(); - Map map = new HashMap<>(); - for (Entry l : jobj.entrySet()) { - map.put(l.getKey(), l.getValue()); - } - FridaFrame frame = new FridaFrame(map, frameCount++); - frames.put(FridaClient.getId(frame), frame); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListThreadsCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListThreadsCommand.java deleted file mode 100644 index 970b7e6293..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaListThreadsCommand.java +++ /dev/null @@ -1,62 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import java.util.ArrayList; -import java.util.List; - -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; - -import agent.frida.manager.*; -import agent.frida.manager.impl.FridaManagerImpl; -import ghidra.util.Msg; - -public class FridaListThreadsCommand extends AbstractFridaCommand { - - protected final FridaProcess process; - private List threads = new ArrayList<>(); - - public FridaListThreadsCommand(FridaManagerImpl manager, FridaProcess process) { - super(manager); - this.process = process; - } - - @Override - public void invoke() { - manager.loadScript(this, "list_threads", "result = Process.enumerateThreads();"); - for (FridaThread thread : threads) { - manager.addThreadIfAbsent(process, thread); - } - } - - @Override - public void parseSpecifics(JsonElement element) { - FridaThread thread = new FridaThread(process); - if (element.isJsonPrimitive()) { - Msg.error(this, element.getAsString()); - return; - } - JsonObject modDetails = element.getAsJsonObject(); - thread.setTid(modDetails.get("id").getAsLong()); - String state = modDetails.get("state").getAsString(); - thread.setState(FridaState.byValue(state)); - JsonObject cpuContext = (JsonObject) modDetails.get("context"); - thread.setContext(new FridaContext(cpuContext)); - threads.add(thread); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaPendingCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaPendingCommand.java deleted file mode 100644 index c8889b2704..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaPendingCommand.java +++ /dev/null @@ -1,211 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Set; -import java.util.concurrent.CompletableFuture; - -import agent.frida.manager.FridaCause; -import agent.frida.manager.FridaCommand; -import agent.frida.manager.FridaEvent; -import agent.frida.manager.evt.AbstractFridaCompletedCommandEvent; -import agent.frida.manager.evt.FridaCommandErrorEvent; - -/** - * A command queued on the frida manager - * - * A {@link FridaCommand} is queued by wrapping it in a {@link FridaPendingCommand} and submitting it - * to the manager implementation's executor. This object also keep track of claimed/stolen events - * and provides convenience methods for sifting through them. - * - * @param the type "returned" by the command - */ -public class FridaPendingCommand extends CompletableFuture implements FridaCause { - private final FridaCommand cmd; - private final Set> evts = new LinkedHashSet<>(); - - /** - * Wrap a command for execution - * - * @param cmd the command - */ - public FridaPendingCommand(FridaCommand cmd) { - this.cmd = cmd; - } - - /** - * Get the command being executed - * - * @return cmd - */ - public FridaCommand getCommand() { - return cmd; - } - - /** - * Finish the execution of this command - */ - public void finish() { - //Msg.trace(this, "Finishing " + cmd); - try { - T result = cmd.complete(this); - complete(result); - } - catch (Throwable e) { - completeExceptionally(e); - } - } - - /** - * Handle an event - * - * This gives the command implementation the first chance to claim or steal an event - * - * @param evt the event - * @return true if the command is ready to be completed - */ - public boolean handle(FridaEvent evt) { - return cmd.handle(evt, this); - } - - /** - * Claim an event - * - * This stores the event for later retrieval and processing. - * - * @param evt the event - */ - public void claim(FridaEvent evt) { - evt.claim(this); - evts.add(evt); - } - - /** - * Steal an event - * - * This stores the event for later retrieval and processing. - * - * @param evt the event - */ - public void steal(FridaEvent evt) { - claim(evt); - evt.steal(); - } - - /** - * Assume a single event of particular type was claimed/stolen, and get that event - * - * @param cls the type of the event - * @return the event cast to the type - * @throws IllegalStateException if more than one event was claimed/stolen - * @throws ClassCastException if the event cannot be cast to the given type - */ - public > E castSingleEvent(Class cls) { - if (evts.size() != 1) { - throw new IllegalStateException("Command did not claim exactly one event"); - } - return cls.cast(evts.iterator().next()); - } - - /** - * Find the first claimed/stolen event of a given type - * - * @param cls the type of the event - * @return the event cast to the type - * @throws IllegalStateException if no event of the given type was claimed/stolen - */ - public > E findFirstOf(Class cls) { - for (FridaEvent evt : evts) { - if (cls.isAssignableFrom(evt.getClass())) { - return cls.cast(evt); - } - } - throw new IllegalStateException("Command did not claim any " + cls); - } - - /** - * Find all events claimed/stolen of a given type - * - * @param cls the type of the events - * @return the list of events cast to the type - */ - public > List findAllOf(Class cls) { - List found = new ArrayList<>(); - for (FridaEvent evt : evts) { - if (cls.isAssignableFrom(evt.getClass())) { - found.add(cls.cast(evt)); - } - } - return found; - } - - /** - * Assume exactly one event of the given type was claimed/stolen, and get that event - * - * @param cls the type of the event - * @return the event cast to the type - * @throws IllegalStateException if more than one event matches - */ - public > E findSingleOf(Class cls) { - List found = findAllOf(cls); - if (found.size() != 1) { - throw new IllegalStateException( - "Command did not claim exactly one " + cls + ". Have " + evts); - } - return found.get(0); - } - - /** - * Check that the command completed with one of the given results - * - * {@link FridaCommandErrorEvent} need not be listed. This method will handle it as a special - * case already. To avoid the special treatment, list it explicitly. - * - * @param classes the completion type to accept - * @return the completion event, cast to the greatest common subclass - */ - @SafeVarargs - public final E checkCompletion( - Class... classes) { - AbstractFridaCompletedCommandEvent completion = - findSingleOf(AbstractFridaCompletedCommandEvent.class); - // Allow query for exact class to override error interpretation - for (Class cls : classes) { - if (cls == completion.getClass()) { - return cls.cast(completion); - } - } - if (completion instanceof FridaCommandErrorEvent) { - throw new FridaCommandError(completion.getInfo(), cmd); - } - for (Class cls : classes) { - if (cls.isAssignableFrom(completion.getClass())) { - return cls.cast(completion); - } - } - throw new IllegalStateException( - "Command completed with " + completion + ", not any of " + Arrays.asList(classes)); - } - - @Override - public String toString() { - return super.toString() + "(" + cmd + ")"; - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaReadKernelMemoryCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaReadKernelMemoryCommand.java deleted file mode 100644 index ebd3d35223..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaReadKernelMemoryCommand.java +++ /dev/null @@ -1,37 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import java.nio.ByteBuffer; - -import agent.frida.manager.impl.FridaManagerImpl; -import ghidra.program.model.address.Address; - -public class FridaReadKernelMemoryCommand extends AbstractFridaReadCommand { - - public FridaReadKernelMemoryCommand(FridaManagerImpl manager, Address addr, ByteBuffer buf, - int len) { - super(manager, addr, buf, len); - } - - @Override - public void invoke() { - manager.loadScript(this, "read_memory", - "var buf = Kernel.readByteArray(ptr(0x" + addr + ")," + len + - "); result = hexdump(buf, {header:false});"); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaReadMemoryCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaReadMemoryCommand.java deleted file mode 100644 index 5c9cfc1ddf..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaReadMemoryCommand.java +++ /dev/null @@ -1,36 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import java.nio.ByteBuffer; - -import agent.frida.manager.impl.FridaManagerImpl; -import ghidra.program.model.address.Address; - -public class FridaReadMemoryCommand extends AbstractFridaReadCommand { - - public FridaReadMemoryCommand(FridaManagerImpl manager, Address addr, ByteBuffer buf, int len) { - super(manager, addr, buf, len); - } - - @Override - public void invoke() { - manager.loadScript(this, "read_memory", - "var buf = ptr(0x" + addr + ").readByteArray(" + len + - "); result = hexdump(buf, {header:false});"); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaRemoveProcessCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaRemoveProcessCommand.java deleted file mode 100644 index dfe7c54435..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaRemoveProcessCommand.java +++ /dev/null @@ -1,35 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import agent.frida.manager.FridaSession; -import agent.frida.manager.impl.FridaManagerImpl; - -public class FridaRemoveProcessCommand extends AbstractFridaCommand { - private FridaSession session; - private String id; - - public FridaRemoveProcessCommand(FridaManagerImpl manager, FridaSession session, String id) { - super(manager); - this.session = session; - this.id = id; - } - - @Override - public void invoke() { - manager.removeProcess(manager.getProcess(session, id)); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaRepeatableWatchMemoryCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaRepeatableWatchMemoryCommand.java deleted file mode 100644 index 26250add08..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaRepeatableWatchMemoryCommand.java +++ /dev/null @@ -1,65 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.util.Map; - -import com.google.gson.JsonElement; - -import agent.frida.manager.impl.FridaManagerImpl; -import ghidra.util.Msg; - -public class FridaRepeatableWatchMemoryCommand extends AbstractFridaCommand { - - private Map arguments; - - public FridaRepeatableWatchMemoryCommand(FridaManagerImpl manager, Map arguments) { - super(manager); - this.arguments = arguments; - } - - @Override - public void invoke() { - String addr = (String) arguments.get("Address"); - if (!addr.startsWith("0x")) { - addr = "0x" + addr; - } - Long size = (Long) arguments.get("Size"); - String cmd; - try { - String onAccess = (String) arguments.get("OnAccess"); - FileInputStream fis = new FileInputStream(new File(onAccess)); - byte[] bytes = fis.readAllBytes(); - String str = new String(bytes); - cmd = str + "; monitorMemory( ptr(" + addr + "), " +size + ");"; - } - catch (IOException e) { - e.printStackTrace(); - return; - } - - manager.loadPermanentScript(this, (String) arguments.get("Name"), cmd); - } - - @Override - public void parseSpecifics(JsonElement element) { - Msg.info(this, element.getAsString()); - //manager.unloadPermanentScript(getName()); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaRequestActivationCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaRequestActivationCommand.java deleted file mode 100644 index ae5cd162d4..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaRequestActivationCommand.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import agent.frida.manager.impl.FridaManagerImpl; -import agent.frida.model.iface1.FridaModelTargetActiveScope; -import ghidra.dbg.target.TargetObject; - -public class FridaRequestActivationCommand extends AbstractFridaCommand { - - private FridaModelTargetActiveScope activator; - private TargetObject obj; - - /** - * Set focus for the current ref - * - * @param manager the manager to execute the command - * @param activator in most cases the root object (must be an ancestor for the ref) - * @param obj the desired object to be made active - */ - public FridaRequestActivationCommand(FridaManagerImpl manager, - FridaModelTargetActiveScope activator, - TargetObject obj) { - super(manager); - this.activator = activator; - this.obj = obj; - } - - @Override - public void invoke() { - activator.doRequestActivation(obj); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaRequestFocusCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaRequestFocusCommand.java deleted file mode 100644 index 4b1428d2bc..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaRequestFocusCommand.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import agent.frida.manager.impl.FridaManagerImpl; -import agent.frida.model.iface1.FridaModelTargetFocusScope; -import ghidra.dbg.target.TargetObject; - -public class FridaRequestFocusCommand extends AbstractFridaCommand { - - private FridaModelTargetFocusScope scope; - private TargetObject obj; - - /** - * Set focus for the current ref - * - * @param manager the manager to execute the command - * @param scope in most cases the root object (must be an ancestor for the ref) - * @param obj the desired focus - */ - public FridaRequestFocusCommand(FridaManagerImpl manager, FridaModelTargetFocusScope scope, - TargetObject obj) { - super(manager); - this.scope = scope; - this.obj = obj; - } - - @Override - public void invoke() { - scope.doRequestFocus(obj); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaSetExceptionHandlerCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaSetExceptionHandlerCommand.java deleted file mode 100644 index e7ba238044..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaSetExceptionHandlerCommand.java +++ /dev/null @@ -1,37 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import agent.frida.manager.FridaProcess; -import agent.frida.manager.impl.FridaManagerImpl; - -public class FridaSetExceptionHandlerCommand extends AbstractFridaCommand { - - protected final FridaProcess process; - - public FridaSetExceptionHandlerCommand(FridaManagerImpl manager, FridaProcess process) { - super(manager); - this.process = process; - } - - @Override - public void invoke() { - manager.loadPermanentScript(this, "set_exception_handler", - "Process.setExceptionHandler(ex => {send(ex, null);});"); - } - - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaStalkThreadCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaStalkThreadCommand.java deleted file mode 100644 index 0b0d545527..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaStalkThreadCommand.java +++ /dev/null @@ -1,75 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.util.Map; - -import com.google.gson.JsonElement; - -import agent.frida.manager.impl.FridaManagerImpl; -import ghidra.util.Msg; - -public class FridaStalkThreadCommand extends AbstractFridaCommand { - - private Map arguments; - private String tid; - - public FridaStalkThreadCommand(FridaManagerImpl manager, String tid, Map arguments) { - super(manager); - this.tid = tid; - this.arguments = arguments; - } - - @Override - public void invoke() { - String cmd = - "Stalker.follow(" + tid + ", {" + - " events: { " + - " call: " + arguments.get("EventCall") + "," + - " ret: " + arguments.get("EventRet") + "," + - " exec: " + arguments.get("EventExec") + "," + - " block: " + arguments.get("EventBlock") + "," + - " compile: " + arguments.get("EventCompile") + - " }, "; - try { - String onReceive = (String) arguments.get("OnReceive"); - String onCallSummary = (String) arguments.get("OnCallSummary"); - FileInputStream fis; - if (!onReceive.isEmpty()) { - fis = new FileInputStream(new File(onReceive)); - } else { - fis = new FileInputStream(new File(onCallSummary)); - } - byte[] bytes = fis.readAllBytes(); - String str = new String(bytes); - cmd += str + "});"; - } - catch (IOException e) { - e.printStackTrace(); - return; - } - - manager.loadPermanentScript(this, (String) arguments.get("Name"), cmd); - } - - @Override - public void parseSpecifics(JsonElement element) { - Msg.info(this, element); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaWatchMemoryCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaWatchMemoryCommand.java deleted file mode 100644 index 06fbb278c7..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaWatchMemoryCommand.java +++ /dev/null @@ -1,68 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.util.Map; - -import com.google.gson.JsonElement; - -import agent.frida.manager.impl.FridaManagerImpl; -import ghidra.util.Msg; - -public class FridaWatchMemoryCommand extends AbstractFridaCommand { - - private Map arguments; - - public FridaWatchMemoryCommand(FridaManagerImpl manager, Map arguments) { - super(manager); - this.arguments = arguments; - } - - @Override - public void invoke() { - String addr = (String) arguments.get("Address"); - if (!addr.startsWith("0x")) { - addr = "0x" + addr; - } - Long size = (Long) arguments.get("Size"); - String cmd = "MemoryAccessMonitor.enable(" + - "{ base: ptr(" + addr + "), " + - " size: " + size + " }, " + - "{ "; - try { - String onAccess = (String) arguments.get("OnAccess"); - FileInputStream fis = new FileInputStream(new File(onAccess)); - byte[] bytes = fis.readAllBytes(); - String str = new String(bytes); - cmd += str + "});"; - } - catch (IOException e) { - e.printStackTrace(); - return; - } - - manager.loadPermanentScript(this, (String) arguments.get("Name"), cmd); - } - - @Override - public void parseSpecifics(JsonElement element) { - Msg.info(this, element); - manager.unloadPermanentScript(getName()); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaWriteKernelMemoryCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaWriteKernelMemoryCommand.java deleted file mode 100644 index 7ce0706341..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaWriteKernelMemoryCommand.java +++ /dev/null @@ -1,51 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import java.nio.ByteBuffer; - -import agent.frida.manager.impl.FridaManagerImpl; -import ghidra.program.model.address.Address; - -public class FridaWriteKernelMemoryCommand extends AbstractFridaCommand { - - private final Address addr; - private final ByteBuffer buf; - private final int len; - - public FridaWriteKernelMemoryCommand(FridaManagerImpl manager, Address addr, ByteBuffer buf, int len) { - super(manager); - this.addr = addr; - this.buf = buf.duplicate(); - this.len = len; - } - - @Override - public void invoke() { - //TODO: This is completely untested and probably will not work - String bufstr = buf.toString(); - manager.loadScript(this, "write_memory", - "var buf = []; " + - "var str = '" + bufstr + "';" + - "var len = " + len + ";" + - "for (var i = 0; i < len; ++i) {" + - " var code = str.charCodeAt(i);" + - " buf = buf.concat([code]);" + - "}" + - "Kernel.writeByteArray(ptr(0x"+addr+")buf);"); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaWriteMemoryCommand.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaWriteMemoryCommand.java deleted file mode 100644 index 67bf783804..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/cmd/FridaWriteMemoryCommand.java +++ /dev/null @@ -1,51 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.cmd; - -import java.nio.ByteBuffer; - -import agent.frida.manager.impl.FridaManagerImpl; -import ghidra.program.model.address.Address; - -public class FridaWriteMemoryCommand extends AbstractFridaCommand { - - private final Address addr; - private final ByteBuffer buf; - private final int len; - - public FridaWriteMemoryCommand(FridaManagerImpl manager, Address addr, ByteBuffer buf, int len) { - super(manager); - this.addr = addr; - this.buf = buf.duplicate(); - this.len = len; - } - - @Override - public void invoke() { - //TODO: This is completely untested and probably will not work - String bufstr = buf.toString(); - manager.loadScript(this, "write_memory", - "var buf = []; " + - "var str = '" + bufstr + "';" + - "var len = " + len + ";" + - "for (var i = 0; i < len; ++i) {" + - " var code = str.charCodeAt(i);" + - " buf = buf.concat([code]);" + - "}" + - "ptr(0x"+addr+").writeByteArray(buf);"); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/AbstractFridaCompletedCommandEvent.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/AbstractFridaCompletedCommandEvent.java deleted file mode 100644 index 5ea7631360..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/AbstractFridaCompletedCommandEvent.java +++ /dev/null @@ -1,34 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.evt; - -import agent.frida.manager.FridaState; - -public class AbstractFridaCompletedCommandEvent extends AbstractFridaEvent { - - public AbstractFridaCompletedCommandEvent(String message) { - super(message); - } - - public AbstractFridaCompletedCommandEvent() { - super(null); - } - - public FridaState newState() { - return null; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/AbstractFridaEvent.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/AbstractFridaEvent.java deleted file mode 100644 index 4ad0fefa11..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/AbstractFridaEvent.java +++ /dev/null @@ -1,84 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.evt; - -import agent.frida.manager.FridaCause; -import agent.frida.manager.FridaCause.Causes; -import agent.frida.manager.FridaEvent; -import agent.frida.manager.FridaReason; -import agent.frida.manager.FridaState; -import agent.frida.manager.cmd.FridaPendingCommand; - -/** - * A base class for frida events - * - * @param the type of information detailing the event - */ -public abstract class AbstractFridaEvent implements FridaEvent { - private final T info; - protected FridaCause cause = Causes.UNCLAIMED; - protected boolean stolen = false; - //protected DebugStatus status = DebugStatus.NO_CHANGE; - - /** - * Construct a new event with the given information - * - * @param info the information - */ - protected AbstractFridaEvent(T info) { - this.info = info; - } - - @Override - public T getInfo() { - return info; - } - - @Override - public void claim(FridaPendingCommand cmd) { - cause = cmd; - } - - @Override - public FridaCause getCause() { - return cause; - } - - public FridaReason getReason() { - return FridaReason.getReason(null); - } - - @Override - public void steal() { - stolen = true; - } - - @Override - public boolean isStolen() { - return stolen; - } - - @Override - public String toString() { - return "<" + getClass().getSimpleName() + " " + info + " >"; - } - - @Override - public FridaState newState() { - return null; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaCommandDoneEvent.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaCommandDoneEvent.java deleted file mode 100644 index ae1fbd2873..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaCommandDoneEvent.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.evt; - -import agent.frida.manager.FridaCommand; -import agent.frida.manager.FridaState; - -public class FridaCommandDoneEvent extends AbstractFridaCompletedCommandEvent { - - private FridaCommand cmd; - - /** - * Construct a new event, parsing the tail for information - */ - public FridaCommandDoneEvent() { - super(); - } - - public FridaCommandDoneEvent(FridaCommand cmd) { - super(cmd.toString()); - this.cmd = cmd; - } - - @Override - public FridaState newState() { - return FridaState.FRIDA_THREAD_STOPPED; - } - - public FridaCommand getCmd() { - return cmd; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaCommandErrorEvent.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaCommandErrorEvent.java deleted file mode 100644 index 43b007bed2..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaCommandErrorEvent.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.evt; - -import agent.frida.manager.FridaEvent; -import agent.frida.manager.FridaState; - -public class FridaCommandErrorEvent extends AbstractFridaCompletedCommandEvent { - - /** - * Construct a new event using the given error message - * - * @param message the message - * @return the new event - */ - public static FridaEvent fromMessage(String message) { - return new FridaCommandErrorEvent(message); - } - - protected FridaCommandErrorEvent() { - super(); - } - - protected FridaCommandErrorEvent(String message) { - super(message); - } - - @Override - public FridaState newState() { - return FridaState.FRIDA_THREAD_STOPPED; - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaConsoleOutputEvent.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaConsoleOutputEvent.java deleted file mode 100644 index 3433952ee4..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaConsoleOutputEvent.java +++ /dev/null @@ -1,41 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.evt; - -import agent.frida.frida.FridaProcessInfo; - -/** - * The event corresponding with FridaProcess.eBroadcastBitSTDERR & FridaProcess.eBroadcastBitSTDOUT - */ -public class FridaConsoleOutputEvent extends AbstractFridaEvent { - - private int mask; - private String text; - - public FridaConsoleOutputEvent(int mask, String text) { - super(null); - this.mask = mask; - this.text = text; - } - - public String getOutput() { - return text; - } - - public int getMask() { - return mask; - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaInterruptEvent.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaInterruptEvent.java deleted file mode 100644 index 316d32a3ee..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaInterruptEvent.java +++ /dev/null @@ -1,26 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.evt; - -import agent.frida.frida.FridaProcessInfo; - -public class FridaInterruptEvent extends AbstractFridaEvent { - - public FridaInterruptEvent(FridaProcessInfo info) { - super(info); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaMemoryRegionAddedEvent.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaMemoryRegionAddedEvent.java deleted file mode 100644 index 7d0f943a53..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaMemoryRegionAddedEvent.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.evt; - -import agent.frida.frida.FridaRegionInfo; - -/** - * The event corresponding with SBTarget.eBroadcastBitModulesLoaded - */ -public class FridaMemoryRegionAddedEvent extends AbstractFridaEvent { - - public FridaMemoryRegionAddedEvent(FridaRegionInfo info) { - super(info); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaMemoryRegionRemovedEvent.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaMemoryRegionRemovedEvent.java deleted file mode 100644 index ea5e56ba2e..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaMemoryRegionRemovedEvent.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.evt; - -import agent.frida.frida.FridaRegionInfo; - -/** - * The event corresponding with SBTarget.eBroadcastBitModulesUnloaded - */ -public class FridaMemoryRegionRemovedEvent extends AbstractFridaEvent { - - public FridaMemoryRegionRemovedEvent(FridaRegionInfo info) { - super(info); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaMemoryRegionReplacedEvent.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaMemoryRegionReplacedEvent.java deleted file mode 100644 index 9815eeb1ea..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaMemoryRegionReplacedEvent.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.evt; - -import agent.frida.frida.FridaRegionInfo; - -/** - * The event corresponding with SBTarget.eBroadcastBitModulesLoaded - */ -public class FridaMemoryRegionReplacedEvent extends AbstractFridaEvent { - - public FridaMemoryRegionReplacedEvent(FridaRegionInfo info) { - super(info); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaModuleLoadedEvent.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaModuleLoadedEvent.java deleted file mode 100644 index 65c08ceaa8..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaModuleLoadedEvent.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.evt; - -import agent.frida.frida.FridaModuleInfo; - -/** - * The event corresponding with SBTarget.eBroadcastBitModulesLoaded - */ -public class FridaModuleLoadedEvent extends AbstractFridaEvent { - - public FridaModuleLoadedEvent(FridaModuleInfo info) { - super(info); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaModuleReplacedEvent.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaModuleReplacedEvent.java deleted file mode 100644 index 9b586bed34..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaModuleReplacedEvent.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.evt; - -import agent.frida.frida.FridaModuleInfo; - -/** - * The event corresponding with SBTarget.eBroadcastBitModulesLoaded - */ -public class FridaModuleReplacedEvent extends AbstractFridaEvent { - - public FridaModuleReplacedEvent(FridaModuleInfo info) { - super(info); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaModuleUnloadedEvent.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaModuleUnloadedEvent.java deleted file mode 100644 index c8ecf9a844..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaModuleUnloadedEvent.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.evt; - -import agent.frida.frida.FridaModuleInfo; - -/** - * The event corresponding with SBTarget.eBroadcastBitModulesUnloaded - */ -public class FridaModuleUnloadedEvent extends AbstractFridaEvent { - - public FridaModuleUnloadedEvent(FridaModuleInfo info) { - super(info); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaProcessCreatedEvent.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaProcessCreatedEvent.java deleted file mode 100644 index 2efd1774d4..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaProcessCreatedEvent.java +++ /dev/null @@ -1,32 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.evt; - -import agent.frida.frida.FridaProcessInfo; -import agent.frida.manager.FridaState; - -public class FridaProcessCreatedEvent extends AbstractFridaEvent { - - public FridaProcessCreatedEvent(FridaProcessInfo info) { - super(info); - } - - @Override - public FridaState newState() { - return FridaState.FRIDA_THREAD_UNINTERRUPTIBLE; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaProcessExitedEvent.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaProcessExitedEvent.java deleted file mode 100644 index cf98b97b48..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaProcessExitedEvent.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.evt; - -import agent.frida.manager.FridaState; - -public class FridaProcessExitedEvent extends AbstractFridaEvent { - - public FridaProcessExitedEvent(Integer exitCode) { - super(exitCode); - } - - @Override - public FridaState newState() { - return FridaState.FRIDA_THREAD_HALTED; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaProcessReplacedEvent.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaProcessReplacedEvent.java deleted file mode 100644 index 6f251f5dba..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaProcessReplacedEvent.java +++ /dev/null @@ -1,38 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.evt; - -import agent.frida.frida.FridaProcessInfo; -import agent.frida.manager.FridaState; - -public class FridaProcessReplacedEvent extends AbstractFridaEvent { - - public FridaProcessReplacedEvent(FridaProcessInfo info) { - super(info); - } - - @Override - public FridaState newState() { - // NB: it's very tempting to relay the info we have, but - // doing so fouls up a lot of the tests because the stopped - // message arrives ahead of breakpointHit - - //DebugProcessInfo pinfo = (DebugProcessInfo) getInfo(); - //return pinfo.process.GetState(); - return null; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaProcessSelectedEvent.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaProcessSelectedEvent.java deleted file mode 100644 index 4844d19bce..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaProcessSelectedEvent.java +++ /dev/null @@ -1,44 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.evt; - -import agent.frida.frida.FridaClient; -import agent.frida.manager.FridaProcess; - -public class FridaProcessSelectedEvent extends AbstractFridaEvent { - private final String id; - private FridaProcess process; - - public FridaProcessSelectedEvent(FridaProcess process) { - super(FridaClient.getId(process)); - this.process = process; - this.id = FridaClient.getId(process); - } - - /** - * Get the selected process ID - * - * @return the process ID - */ - public String getProcessId() { - return id; - } - - public FridaProcess getProcess() { - return process; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaRunningEvent.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaRunningEvent.java deleted file mode 100644 index 96bc3418a0..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaRunningEvent.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.evt; - -import agent.frida.manager.FridaState; - -public class FridaRunningEvent extends AbstractFridaEvent { - private final String id; - - /** - * Construct a new event, parsing the tail for information - * - * A thread ID must be specified by frida. - * - * @param id the event info - */ - public FridaRunningEvent(String id) { - super(id); - this.id = id; - } - - /** - * Get the ID of the thread causing the event - * - * @return the thread ID - */ - public String getThreadId() { - return id; - } - - @Override - public FridaState newState() { - return FridaState.FRIDA_THREAD_RUNNING; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaSelectedFrameChangedEvent.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaSelectedFrameChangedEvent.java deleted file mode 100644 index 3a01dd9c94..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaSelectedFrameChangedEvent.java +++ /dev/null @@ -1,62 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.evt; - -import agent.frida.frida.FridaClient; -import agent.frida.frida.FridaThreadInfo; -import agent.frida.manager.*; - -/** - * The event corresponding with FridaThread.eBroadcastBitSelectedFrameChanged - */ -public class FridaSelectedFrameChangedEvent extends AbstractFridaEvent { - private final String id; - private FridaState state; - private FridaThread thread; - private FridaFrame frame; - - /** - * @param info thread info - */ - public FridaSelectedFrameChangedEvent(FridaThreadInfo info) { - super(FridaClient.getId(info.thread)); - this.id = FridaClient.getId(thread); - this.state = info.thread.getState(); - this.thread = info.thread; - } - - /** - * Get the selected thread ID - * - * @return the thread ID - */ - public String getThreadId() { - return id; - } - - public FridaState getState() { - return state; - } - - public FridaThread getThread() { - return thread; - } - - public FridaFrame getFrame() { - return frame; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaSessionCreatedEvent.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaSessionCreatedEvent.java deleted file mode 100644 index 3653584294..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaSessionCreatedEvent.java +++ /dev/null @@ -1,25 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.evt; - -import agent.frida.frida.FridaSessionInfo; - -public class FridaSessionCreatedEvent extends AbstractFridaEvent { - - public FridaSessionCreatedEvent(FridaSessionInfo info) { - super(info); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaSessionExitedEvent.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaSessionExitedEvent.java deleted file mode 100644 index b8fe1b4ef2..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaSessionExitedEvent.java +++ /dev/null @@ -1,36 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.evt; - -import agent.frida.manager.FridaState; - -public class FridaSessionExitedEvent extends AbstractFridaEvent { - - public String sessionId; - public Integer exitCode; - - public FridaSessionExitedEvent(String sessionId, Integer exitCode) { - super(exitCode); - this.sessionId = sessionId; - this.exitCode = exitCode; - } - - @Override - public FridaState newState() { - return FridaState.FRIDA_THREAD_HALTED; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaSessionReplacedEvent.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaSessionReplacedEvent.java deleted file mode 100644 index 087f701c9c..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaSessionReplacedEvent.java +++ /dev/null @@ -1,26 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.evt; - -import agent.frida.frida.FridaSessionInfo; - -public class FridaSessionReplacedEvent extends AbstractFridaEvent { - - public FridaSessionReplacedEvent(FridaSessionInfo next) { - super(next); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaSessionSelectedEvent.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaSessionSelectedEvent.java deleted file mode 100644 index 3989164eec..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaSessionSelectedEvent.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.evt; - -import agent.frida.frida.FridaClient; -import agent.frida.manager.FridaSession; - -public class FridaSessionSelectedEvent extends AbstractFridaEvent { - private final String id; - private FridaSession session; - - /** - * The selected session ID must be specified by Frida. - * - * @param session Frida-defined session - */ - public FridaSessionSelectedEvent(FridaSession session) { - super(FridaClient.getId(session)); - this.session = session; - this.id = FridaClient.getId(session); - } - - /** - * Get the selected session ID - * - * @return the session ID - */ - public String getSessionId() { - return id; - } - - public FridaSession getSession() { - return session; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaStateChangedEvent.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaStateChangedEvent.java deleted file mode 100644 index a8cfb426d2..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaStateChangedEvent.java +++ /dev/null @@ -1,53 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.evt; - -import agent.frida.frida.FridaClient; -import agent.frida.manager.*; -import ghidra.dbg.target.TargetExecutionStateful.TargetExecutionState; - -/** - * The event corresponding with FridaProcess.eBroadcastBitStateChanged - */ -public class FridaStateChangedEvent extends AbstractFridaEvent { - - private FridaState state = null; - private String id; - - public FridaStateChangedEvent(Object obj, TargetExecutionState state) { - super(state); - this.state = FridaClient.convertState(state); - this.id = FridaClient.getId(obj); - } - - public FridaFrame getFrame(FridaThread thread) { - return null; - } - - @Override - public FridaState newState() { - return state; - } - - public void setState(FridaState state) { - this.state = state; - } - - public String getId() { - return id; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaStoppedEvent.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaStoppedEvent.java deleted file mode 100644 index 823dfb3370..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaStoppedEvent.java +++ /dev/null @@ -1,60 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.evt; - -import agent.frida.manager.FridaFrame; -import agent.frida.manager.FridaThread; -import agent.frida.manager.FridaState; - -public class FridaStoppedEvent extends AbstractFridaEvent { - private final String id; - - /** - * Construct a new event, parsing the tail for information - * - * A thread ID must be specified by frida. - * - * @param id the event info - */ - public FridaStoppedEvent(String id) { - super(id); - this.id = id; - } - - /** - * Get the ID of the thread causing the event - * - * @return the thread ID - */ - public String getThreadId() { - return id; - } - - /** - * Get the current frame, if applicable - * - * @param thread the current thread - * @return the frame - */ - public FridaFrame getFrame(FridaThread thread) { - return null; - } - - @Override - public FridaState newState() { - return FridaState.FRIDA_THREAD_STOPPED; - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaThreadCreatedEvent.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaThreadCreatedEvent.java deleted file mode 100644 index 9e7598219b..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaThreadCreatedEvent.java +++ /dev/null @@ -1,26 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.evt; - -import agent.frida.frida.FridaThreadInfo; - -public class FridaThreadCreatedEvent extends AbstractFridaEvent { - - public FridaThreadCreatedEvent(FridaThreadInfo info) { - super(info); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaThreadExitedEvent.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaThreadExitedEvent.java deleted file mode 100644 index 2b2684301c..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaThreadExitedEvent.java +++ /dev/null @@ -1,24 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.evt; - -public class FridaThreadExitedEvent extends AbstractFridaEvent { - - public FridaThreadExitedEvent(Integer exitCode) { - super(exitCode); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaThreadReplacedEvent.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaThreadReplacedEvent.java deleted file mode 100644 index 64d55f8910..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaThreadReplacedEvent.java +++ /dev/null @@ -1,26 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.evt; - -import agent.frida.frida.FridaThreadInfo; - -public class FridaThreadReplacedEvent extends AbstractFridaEvent { - - public FridaThreadReplacedEvent(FridaThreadInfo info) { - super(info); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaThreadResumedEvent.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaThreadResumedEvent.java deleted file mode 100644 index b0255ba084..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaThreadResumedEvent.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.evt; - -import agent.frida.frida.FridaThreadInfo; - -/** - * The event corresponding with SBThread.eBroadcastBitThreadResumed - */ -public class FridaThreadResumedEvent extends AbstractFridaEvent { - - public FridaThreadResumedEvent(FridaThreadInfo info) { - super(info); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaThreadSelectedEvent.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaThreadSelectedEvent.java deleted file mode 100644 index a55a8bf3e0..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaThreadSelectedEvent.java +++ /dev/null @@ -1,62 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.evt; - -import agent.frida.frida.FridaClient; -import agent.frida.frida.FridaThreadInfo; -import agent.frida.manager.*; - -/** - * The event corresponding with FridaThread.eBroadcastBitThreadSelected - */ -public class FridaThreadSelectedEvent extends AbstractFridaEvent { - private final String id; - private FridaState state; - private FridaThread thread; - private FridaFrame frame; - - /** - * @param info thread info - */ - public FridaThreadSelectedEvent(FridaThreadInfo info) { - super(FridaClient.getId(info.thread)); - this.id = FridaClient.getId(info.thread); - this.state = info.thread.getState(); - this.thread = info.thread; - } - - /** - * Get the selected thread ID - * - * @return the thread ID - */ - public String getThreadId() { - return id; - } - - public FridaState getState() { - return state; - } - - public FridaThread getThread() { - return thread; - } - - public FridaFrame getFrame() { - return frame; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaThreadStackChangedEvent.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaThreadStackChangedEvent.java deleted file mode 100644 index 21f5c631d0..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaThreadStackChangedEvent.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.evt; - -import agent.frida.frida.FridaThreadInfo; - -/** - * The event corresponding with SBThread.eBroadcastBitStackChanged - */ -public class FridaThreadStackChangedEvent extends AbstractFridaEvent { - - public FridaThreadStackChangedEvent(FridaThreadInfo info) { - super(info); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaThreadSuspendedEvent.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaThreadSuspendedEvent.java deleted file mode 100644 index 40f7c4949e..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/evt/FridaThreadSuspendedEvent.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.evt; - -import agent.frida.frida.FridaThreadInfo; - -/** - * The event corresponding with SBThread.eBroadcastBitThreadSuspended - */ -public class FridaThreadSuspendedEvent extends AbstractFridaEvent { - - public FridaThreadSuspendedEvent(FridaThreadInfo info) { - super(info); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/impl/FridaManagerImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/impl/FridaManagerImpl.java deleted file mode 100644 index 072ee6765e..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/manager/impl/FridaManagerImpl.java +++ /dev/null @@ -1,1322 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.manager.impl; - -import static ghidra.async.AsyncUtils.*; - -import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicReference; - -import org.apache.commons.lang3.tuple.Pair; - -import com.sun.jna.NativeLong; -import com.sun.jna.Pointer; - -import agent.frida.frida.*; -import agent.frida.frida.FridaClient.DebugEndSessionFlags; -import agent.frida.frida.FridaClient.DebugStatus; -import agent.frida.gadp.impl.AbstractClientThreadExecutor; -import agent.frida.gadp.impl.FridaClientThreadExecutor; -import agent.frida.manager.*; -import agent.frida.manager.FridaCause.Causes; -import agent.frida.manager.cmd.*; -import agent.frida.manager.evt.*; -import agent.frida.model.iface1.*; -import ghidra.async.*; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.util.HandlerMap; -import ghidra.lifecycle.Internal; -import ghidra.util.Msg; -import ghidra.util.datastruct.ListenerSet; - -public class FridaManagerImpl implements FridaManager { - - public DebugStatus status; - - protected AbstractClientThreadExecutor executor; - protected FridaClientReentrant reentrantClient; - - private List> activeCmds = new ArrayList<>(); - - protected final Map sessions = new LinkedHashMap<>(); - protected FridaTarget curSession = null; - private final Map unmodifiableSessions = - Collections.unmodifiableMap(sessions); - - protected final Map> processes = new LinkedHashMap<>(); - protected final Map> threads = new LinkedHashMap<>(); - protected final Map> modules = new LinkedHashMap<>(); - protected final Map> regions = new LinkedHashMap<>(); - - protected final Map kmodules = new LinkedHashMap<>(); - protected final Map kregions = new LinkedHashMap<>(); - - protected final AsyncReference state = new AsyncReference<>(null); - private final HandlerMap, Void, DebugStatus> handlerMap = new HandlerMap<>(); - private final Map, DebugStatus> statusMap = new LinkedHashMap<>(); - private final ListenerSet listenersEvent = - new ListenerSet<>(FridaEventsListener.class, true); - - private FridaTarget currentTarget; - private FridaSession currentSession; - private FridaProcess currentProcess; - private FridaThread currentThread; - private volatile boolean waiting = false; - private boolean kernelMode = false; - private CompletableFuture continuation; - - private Map scripts = new HashMap<>(); - - /** - * Instantiate a new manager - */ - public FridaManagerImpl() { - defaultHandlers(); - } - - /** - * @param processId the process ID to remove - * @param id the thread ID to remove - */ - public void removeThread(String processId, String id) { - synchronized (threads) { - if (threads.get(processId).remove(id) == null) { - throw new IllegalArgumentException("There is no thread with id " + id); - } - } - } - - @Override - public FridaThread getThread(FridaProcess process, String tid) { - synchronized (threads) { - return threads.get(FridaClient.getId(process)).get(tid); - } - } - - public void addThreadIfAbsent(FridaProcess process, FridaThread thread) { - synchronized (threads) { - Map map = threads.get(FridaClient.getId(process)); - if (map == null) { - map = new HashMap<>(); - threads.put(FridaClient.getId(process), map); - } - if (thread == null) { - return; - } - String id = FridaClient.getId(thread); - FridaThread pred = map.get(id); - if (!map.containsKey(id) || !thread.equals(pred)) { - FridaThreadInfo info = new FridaThreadInfo(thread); - if (!map.containsKey(id)) { - getClient().processEvent(new FridaThreadCreatedEvent(info)); - } - else { - getClient().processEvent(new FridaThreadReplacedEvent(info)); - } - map.put(id, thread); - } - } - } - - /** - * @param sessionId the session ID to remove - * @param id the process ID to remove - * @param cause the cause of removal - */ - @Internal - public void removeProcess(String sessionId, String id, FridaCause cause) { - synchronized (processes) { - FridaProcess proc = processes.get(sessionId).remove(id); - if (proc == null) { - throw new IllegalArgumentException("There is no process with id " + id); - } - Set toRemove = new HashSet<>(); - String processId = FridaClient.getId(proc); - for (String tid : threads.get(processId).keySet()) { - FridaThread thread = threads.get(processId).get(tid); - String pid = FridaClient.getId(thread.getProcess()); - if (pid.equals(id)) { - toRemove.add(tid); - } - } - for (String tid : toRemove) { - removeThread(processId, tid); - } - getEventListeners().invoke().processRemoved(id, cause); - } - } - - /** - * Update the selected process - * - * @param session wrapper for Frida pointer - * @param id process pid - * @return success status - */ - @Override - public FridaProcess getProcess(FridaSession session, String id) { - synchronized (processes) { - String sessionId = FridaClient.getId(session); - FridaProcess result = processes.get(sessionId).get(id); - if (result == null) { - throw new IllegalArgumentException("There is no process with id " + id); - } - return result; - } - } - - public void addProcessIfAbsent(FridaSession session, FridaProcess process) { - synchronized (processes) { - String sessionId = FridaClient.getId(session); - Map map = processes.get(sessionId); - if (map == null) { - map = new HashMap<>(); - processes.put(sessionId, map); - } - String id = FridaClient.getId(process); - FridaProcess pred = map.get(id); - if (!map.containsKey(id) || !process.equals(pred)) { - FridaProcessInfo info = new FridaProcessInfo(process); - if (!map.containsKey(id)) { - getClient().processEvent(new FridaProcessCreatedEvent(info)); - } - else { - getClient().processEvent(new FridaProcessReplacedEvent(info)); - } - map.put(id, process); - } - } - } - - /** - * @param id the session ID to remove - * @param cause the cause of removal - */ - @Internal - public void removeSession(String id, FridaCause cause) { - synchronized (sessions) { - if (sessions.remove(id) == null) { - throw new IllegalArgumentException("There is no session with id " + id); - } - getEventListeners().invoke().sessionRemoved(id, cause); - } - } - - @Override - public FridaSession getSession(String id) { - synchronized (sessions) { - FridaSession result = sessions.get(id); - if (result == null) { - throw new IllegalArgumentException("There is no session with id " + id); - } - return result; - } - } - - public void addSessionIfAbsent(FridaSession session) { - synchronized (sessions) { - String id = FridaClient.getId(session); - FridaSession pred = sessions.get(id); - if (!sessions.containsKey(id) || !session.equals(pred)) { - FridaSessionInfo info = new FridaSessionInfo(session); - if (sessions.containsKey(id)) { - //removeSession(sessions.get(id)); - getClient().processEvent(new FridaSessionReplacedEvent(info)); - } - else { - getClient().processEvent(new FridaSessionCreatedEvent(info)); - } - sessions.put(id, session); - } - } - } - - /** - * @param process wrapper for Frida pointer - * @param id the module name to remove - */ - public void removeModule(FridaProcess process, String id) { - synchronized (modules) { - if (modules.get(FridaClient.getId(process)).remove(id) == null) { - throw new IllegalArgumentException("There is no module with id " + id); - } - } - } - - @Override - public FridaModule getModule(FridaProcess process, String id) { - synchronized (modules) { - return modules.get(FridaClient.getId(process)).get(id); - } - } - - public void addModuleIfAbsent(FridaProcess process, FridaModule module) { - synchronized (modules) { - String sessionId = FridaClient.getId(process); - Map map = modules.get(sessionId); - if (map == null) { - map = new HashMap<>(); - modules.put(sessionId, map); - } - if (module == null) { - return; - } - String id = FridaClient.getId(module); - FridaModule pred = map.get(id); - if (!map.containsKey(id) || !module.equals(pred)) { - FridaModuleInfo info = new FridaModuleInfo(process, module); - if (!map.containsKey(id)) { - getClient().processEvent(new FridaModuleLoadedEvent(info)); - } - else { - getClient().processEvent(new FridaModuleReplacedEvent(info)); - } - map.put(id, module); - } - } - } - - public void addKernelModuleIfAbsent(FridaKernelModule module) { - synchronized (kmodules) { - if (module == null) { - return; - } - String id = FridaClient.getId(module); - FridaKernelModule pred = kmodules.get(id); - if (!kmodules.containsKey(id) || !module.equals(pred)) { - FridaModuleInfo info = new FridaModuleInfo(module); - if (!kmodules.containsKey(id)) { - getClient().processEvent(new FridaModuleLoadedEvent(info)); - } - else { - getClient().processEvent(new FridaModuleReplacedEvent(info)); - } - kmodules.put(id, module); - } - } - } - - /** - * @param process wrapper for Frida pointer - * @param id the module name to remove - */ - public void removeMemoryRegion(FridaProcess process, String id) { - synchronized (regions) { - if (regions.get(FridaClient.getId(process)).remove(id) == null) { - throw new IllegalArgumentException("There is no region with id " + id); - } - } - } - - @Override - public FridaMemoryRegionInfo getMemoryRegion(FridaProcess process, String id) { - synchronized (regions) { - return regions.get(FridaClient.getId(process)).get(id); - } - } - - public void addMemoryRegionIfAbsent(FridaProcess process, FridaMemoryRegionInfo region) { - synchronized (regions) { - String sessionId = FridaClient.getId(process); - Map map = regions.get(sessionId); - if (map == null) { - map = new HashMap<>(); - regions.put(sessionId, map); - } - String id = FridaClient.getId(region); - FridaMemoryRegionInfo pred = map.get(id); - if (!map.containsKey(id) || !region.equals(pred)) { - FridaRegionInfo info = new FridaRegionInfo(process, region); - if (!map.containsKey(id)) { - getClient().processEvent(new FridaMemoryRegionAddedEvent(info)); - } - else { - getClient().processEvent(new FridaMemoryRegionReplacedEvent(info)); - } - map.put(id, region); - } - } - } - - public void addKernelMemoryRegionIfAbsent(FridaKernelMemoryRegionInfo region) { - synchronized (kregions) { - String id = FridaClient.getId(region); - FridaKernelMemoryRegionInfo pred = kregions.get(id); - if (!kregions.containsKey(id) || !region.equals(pred)) { - FridaRegionInfo info = new FridaRegionInfo(region); - if (!kregions.containsKey(id)) { - getClient().processEvent(new FridaMemoryRegionAddedEvent(info)); - } - else { - getClient().processEvent(new FridaMemoryRegionReplacedEvent(info)); - } - kregions.put(id, region); - } - } - } - - @Override - public Map getKnownThreads(FridaProcess process) { - String processId = FridaClient.getId(process); - Map map = threads.get(processId); - if (map == null) { - map = new HashMap<>(); - threads.put(FridaClient.getId(process), map); - } - return map; - } - - @Override - public Map getKnownProcesses(FridaSession target) { - String sessionId = FridaClient.getId(target); - Map map = processes.get(sessionId); - if (map == null) { - map = new HashMap<>(); - processes.put(sessionId, map); - } - return map; - } - - @Override - public Map getKnownSessions() { - return unmodifiableSessions; - } - - @Override - public Map getKnownModules(FridaProcess process) { - String processId = FridaClient.getId(process); - Map map = modules.get(processId); - if (map == null) { - map = new HashMap<>(); - modules.put(processId, map); - } - return map; - } - - @Override - public Map getKnownRegions(FridaProcess process) { - String processId = FridaClient.getId(process); - Map map = regions.get(processId); - if (map == null) { - map = new HashMap<>(); - regions.put(processId, map); - } - return map; - } - - @Override - public CompletableFuture start(String[] args) { - state.set(null, Causes.UNCLAIMED); - boolean create = true; - if (args.length == 0) { - executor = - new FridaClientThreadExecutor(() -> FridaClient.debugCreate().createClient()); - } - else { - // TODO - process args? - executor = - new FridaClientThreadExecutor(() -> FridaClient.debugCreate().createClient()); - create = false; - } - executor.setManager(this); - AtomicReference creat = new AtomicReference<>(create); - return sequence(TypeSpec.VOID).then(executor, (seq) -> { - doExecute(creat.get()); - seq.exit(); - }).finish().exceptionally((exc) -> { - Msg.error(this, "start failed"); - return null; - }); - } - - protected void doExecute(Boolean create) { - FridaClient client = executor.getClient(); - reentrantClient = client; - - status = client.getExecutionStatus(); - } - - @Override - public boolean isRunning() { - return !executor.isShutdown() && !executor.isTerminated(); - } - - @Override - public void terminate() { - executor.execute(100, client -> { - Msg.debug(this, "Disconnecting DebugClient from session"); - client.endSession(getCurrentTarget(), DebugEndSessionFlags.DEBUG_END_DISCONNECT); - //client.setOutputCallbacks(null); - }); - executor.shutdown(); - try { - executor.awaitTermination(5000, TimeUnit.MILLISECONDS); - } - catch (InterruptedException e) { - // Eh, just go on - } - } - - @Override - public void close() throws Exception { - terminate(); - } - - /** - * Schedule a command for execution - * - * @param cmd the command to execute - * @return the pending command, which acts as a future for later completion - */ - //@Override - @Override - public CompletableFuture execute(FridaCommand cmd) { - assert cmd != null; - FridaPendingCommand pcmd = new FridaPendingCommand<>(cmd); - - if (executor.isCurrentThread()) { - try { - addCommand(cmd, pcmd); - } - catch (Throwable exc) { - pcmd.completeExceptionally(exc); - } - } - else { - CompletableFuture.runAsync(() -> { - addCommand(cmd, pcmd); - }, executor).exceptionally((exc) -> { - pcmd.completeExceptionally(exc); - return null; - }); - } - return pcmd; - } - - private void addCommand(FridaCommand cmd, FridaPendingCommand pcmd) { - synchronized (this) { - if (!cmd.validInState(state.get())) { - throw new FridaCommandError( - "Command " + cmd + " is not valid while " + state.get()); - } - activeCmds.add(pcmd); - } - cmd.invoke(); - processEvent(new FridaCommandDoneEvent(cmd)); - } - - @Override - public DebugStatus processEvent(FridaEvent evt) { - if (state == null) { - state.set(FridaState.FRIDA_THREAD_STOPPED, Causes.UNCLAIMED); - } - FridaState newState = evt.newState(); - if (newState != null && !(evt instanceof FridaCommandDoneEvent)) { - Msg.debug(this, evt + " transitions state to " + newState); - state.set(newState, evt.getCause()); - } - - boolean cmdFinished = false; - List> toRemove = new ArrayList>(); - for (FridaPendingCommand pcmd : activeCmds) { - cmdFinished = pcmd.handle(evt); - if (cmdFinished) { - pcmd.finish(); - toRemove.add(pcmd); - } - } - for (FridaPendingCommand pcmd : toRemove) { - activeCmds.remove(pcmd); - } - - synchronized (this) { - boolean waitState = isWaiting(); - waiting = false; - DebugStatus ret = evt.isStolen() ? null : handlerMap.handle(evt, null); - if (ret == null) { - ret = DebugStatus.NO_CHANGE; - } - waiting = ret.equals(DebugStatus.NO_DEBUGGEE) ? false : waitState; - return ret; - } - } - - @Override - public void addStateListener(FridaStateListener listener) { - state.addChangeListener(listener); - } - - @Override - public void removeStateListener(FridaStateListener listener) { - state.removeChangeListener(listener); - } - - public ListenerSet getEventListeners() { - return listenersEvent; - } - - @Override - public void addEventsListener(FridaEventsListener listener) { - getEventListeners().add(listener); - } - - @Override - public void removeEventsListener(FridaEventsListener listener) { - getEventListeners().remove(listener); - } - - private void defaultHandlers() { - handlerMap.put(FridaInterruptEvent.class, this::processInterrupt); - handlerMap.put(FridaThreadCreatedEvent.class, this::processThreadCreated); - handlerMap.put(FridaThreadReplacedEvent.class, this::processThreadReplaced); - handlerMap.put(FridaThreadExitedEvent.class, this::processThreadExited); - handlerMap.put(FridaThreadSelectedEvent.class, this::processThreadSelected); - handlerMap.put(FridaProcessCreatedEvent.class, this::processProcessCreated); - handlerMap.put(FridaProcessReplacedEvent.class, this::processProcessReplaced); - handlerMap.put(FridaProcessExitedEvent.class, this::processProcessExited); - handlerMap.put(FridaSessionCreatedEvent.class, this::processSessionCreated); - handlerMap.put(FridaSessionReplacedEvent.class, this::processSessionReplaced); - handlerMap.put(FridaSessionExitedEvent.class, this::processSessionExited); - handlerMap.put(FridaProcessSelectedEvent.class, this::processProcessSelected); - handlerMap.put(FridaSelectedFrameChangedEvent.class, this::processFrameSelected); - handlerMap.put(FridaModuleLoadedEvent.class, this::processModuleLoaded); - handlerMap.put(FridaModuleReplacedEvent.class, this::processModuleReplaced); - handlerMap.put(FridaModuleUnloadedEvent.class, this::processModuleUnloaded); - handlerMap.put(FridaMemoryRegionAddedEvent.class, this::processMemoryRegionAdded); - handlerMap.put(FridaMemoryRegionReplacedEvent.class, this::processMemoryRegionReplaced); - handlerMap.put(FridaModuleUnloadedEvent.class, this::processModuleUnloaded); - handlerMap.put(FridaStateChangedEvent.class, this::processStateChanged); - handlerMap.putVoid(FridaCommandDoneEvent.class, this::processDefault); - handlerMap.putVoid(FridaStoppedEvent.class, this::processDefault); - handlerMap.putVoid(FridaRunningEvent.class, this::processDefault); - handlerMap.putVoid(FridaConsoleOutputEvent.class, this::processConsoleOutput); - - statusMap.put(FridaProcessCreatedEvent.class, DebugStatus.BREAK); - statusMap.put(FridaProcessExitedEvent.class, DebugStatus.NO_DEBUGGEE); - statusMap.put(FridaStateChangedEvent.class, DebugStatus.NO_CHANGE); - statusMap.put(FridaStoppedEvent.class, DebugStatus.BREAK); - statusMap.put(FridaInterruptEvent.class, DebugStatus.BREAK); - } - - @Override - public void updateState(FridaSession session) { - getSessionAttributes(session); - currentSession = session; - FridaProcess process = session.getProcess(); - currentProcess = process; - if (currentSession == null || - !currentSession.equals(process.getSession())) { - FridaSession candidateSession = currentProcess.getSession(); - if (candidateSession != null) { - currentSession = candidateSession; - } - } - /* - if (currentThread == null || - !currentThread.equals(process.GetSelectedThread())) { - FridaThread candidateThread = currentProcess.GetSelectedThread(); - if (candidateThread != null) { - currentThread = candidateThread; - } - } - */ - addSessionIfAbsent(currentSession); - addProcessIfAbsent(currentSession, currentProcess); - addThreadIfAbsent(currentProcess, currentThread); - } - - /** - * Default handler for events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processDefault(AbstractFridaEvent evt, Void v) { - return statusMap.get(evt.getClass()); - } - - /** - * Handler for breakpoint events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processInterrupt(FridaInterruptEvent evt, Void v) { - return statusMap.get(evt.getClass()); - } - - /** - * Handler for thread created events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processThreadCreated(FridaThreadCreatedEvent evt, Void v) { - FridaThread thread = evt.getInfo().thread; - currentThread = thread; - getEventListeners().invoke().threadCreated(thread, FridaCause.Causes.UNCLAIMED); - getEventListeners().invoke().threadSelected(thread, null, evt.getCause()); - return statusMap.get(evt.getClass()); - } - - /** - * Handler for thread created events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processThreadReplaced(FridaThreadReplacedEvent evt, Void v) { - FridaThread thread = evt.getInfo().thread; - getEventListeners().invoke().threadReplaced(thread, FridaCause.Causes.UNCLAIMED); - getEventListeners().invoke().threadSelected(thread, null, evt.getCause()); - return statusMap.get(evt.getClass()); - } - - /** - * Handler for thread exited events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processThreadExited(FridaThreadExitedEvent evt, Void v) { - getEventListeners().invoke().threadExited(currentThread, currentProcess, evt.getCause()); - return statusMap.get(evt.getClass()); - } - - /** - * Handler for thread selected events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processThreadSelected(FridaThreadSelectedEvent evt, Void v) { - currentThread = evt.getThread(); - getEventListeners().invoke().threadSelected(currentThread, evt.getFrame(), evt.getCause()); - return statusMap.get(evt.getClass()); - } - - /** - * Handler for frame selected events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processFrameSelected(FridaSelectedFrameChangedEvent evt, Void v) { - currentThread = evt.getThread(); - getEventListeners().invoke().threadSelected(currentThread, evt.getFrame(), evt.getCause()); - return statusMap.get(evt.getClass()); - } - - /** - * Handler for process created events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processProcessCreated(FridaProcessCreatedEvent evt, Void v) { - FridaProcessInfo info = evt.getInfo(); - FridaProcess proc = info.process; - getEventListeners().invoke().processAdded(proc, FridaCause.Causes.UNCLAIMED); - getEventListeners().invoke().processSelected(proc, evt.getCause()); - - /* - FridaThread thread = proc.GetSelectedThread(); - getEventListeners().fire.threadSelected(thread, null, evt.getCause()); - */ - return statusMap.get(evt.getClass()); - } - - /** - * Handler for process replaced events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processProcessReplaced(FridaProcessReplacedEvent evt, Void v) { - FridaProcessInfo info = evt.getInfo(); - FridaProcess proc = info.process; - getEventListeners().invoke().processReplaced(proc, FridaCause.Causes.UNCLAIMED); - getEventListeners().invoke().processSelected(proc, evt.getCause()); - - /* - FridaThread thread = proc.GetSelectedThread(); - getEventListeners().fire.threadSelected(thread, null, evt.getCause()); - */ - return statusMap.get(evt.getClass()); - } - - /** - * Handler for process exited events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processProcessExited(FridaProcessExitedEvent evt, Void v) { - FridaThread thread = getCurrentThread(); - FridaProcess process = getCurrentProcess(); - getEventListeners().invoke().threadExited(thread, process, evt.getCause()); - getEventListeners().invoke().processExited(process, evt.getCause()); - getEventListeners().invoke().processRemoved(process.getPID().toString(), evt.getCause()); - return statusMap.get(evt.getClass()); - } - - /** - * Handler for process selected events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processProcessSelected(FridaProcessSelectedEvent evt, Void v) { - currentProcess = evt.getProcess(); - getEventListeners().invoke().processSelected(currentProcess, evt.getCause()); - return statusMap.get(evt.getClass()); - } - - /** - * Handler for session created events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processSessionCreated(FridaSessionCreatedEvent evt, Void v) { - FridaSessionInfo info = evt.getInfo(); - getEventListeners().invoke().sessionAdded(info.session, FridaCause.Causes.UNCLAIMED); - getEventListeners().invoke().sessionSelected(info.session, evt.getCause()); - return statusMap.get(evt.getClass()); - } - - /** - * Handler for session replaced events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processSessionReplaced(FridaSessionReplacedEvent evt, Void v) { - FridaSessionInfo info = evt.getInfo(); - getEventListeners().invoke().sessionReplaced(info.session, FridaCause.Causes.UNCLAIMED); - getEventListeners().invoke().sessionSelected(info.session, evt.getCause()); - return statusMap.get(evt.getClass()); - } - - /** - * Handler for session exited events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processSessionExited(FridaSessionExitedEvent evt, Void v) { - removeSession(evt.sessionId, FridaCause.Causes.UNCLAIMED); - getEventListeners().invoke().sessionRemoved(evt.sessionId, evt.getCause()); - getEventListeners().invoke().threadExited(currentThread, currentProcess, evt.getCause()); - getEventListeners().invoke().processExited(currentProcess, evt.getCause()); - getEventListeners().invoke().processRemoved(currentProcess.getPID().toString(), - evt.getCause()); - return statusMap.get(evt.getClass()); - } - - /** - * Handler for module loaded events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processModuleLoaded(FridaModuleLoadedEvent evt, Void v) { - FridaModuleInfo info = evt.getInfo(); - long n = info.getNumberOfModules(); - FridaProcess process = info.getProcess(); - for (int i = 0; i < n; i++) { - getEventListeners().invoke().moduleLoaded(process, info, i, evt.getCause()); - } - return statusMap.get(evt.getClass()); - } - - /** - * Handler for module replaced events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processModuleReplaced(FridaModuleReplacedEvent evt, Void v) { - FridaModuleInfo info = evt.getInfo(); - long n = info.getNumberOfModules(); - FridaProcess process = info.getProcess(); - for (int i = 0; i < n; i++) { - getEventListeners().invoke().moduleReplaced(process, info, i, evt.getCause()); - } - return statusMap.get(evt.getClass()); - } - - /** - * Handler for module unloaded events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processModuleUnloaded(FridaModuleUnloadedEvent evt, Void v) { - FridaModuleInfo info = evt.getInfo(); - long n = info.getNumberOfModules(); - FridaProcess process = info.getProcess(); - for (int i = 0; i < n; i++) { - getEventListeners().invoke().moduleUnloaded(process, info, i, evt.getCause()); - } - return statusMap.get(evt.getClass()); - } - - /** - * Handler for module loaded events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processMemoryRegionAdded(FridaMemoryRegionAddedEvent evt, Void v) { - FridaRegionInfo info = evt.getInfo(); - long n = info.getNumberOfRegions(); - FridaProcess process = info.getProcess(); - for (int i = 0; i < n; i++) { - getEventListeners().invoke().regionAdded(process, info, i, evt.getCause()); - } - return statusMap.get(evt.getClass()); - } - - /** - * Handler for module replaced events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processMemoryRegionReplaced(FridaMemoryRegionReplacedEvent evt, Void v) { - FridaRegionInfo info = evt.getInfo(); - long n = info.getNumberOfRegions(); - FridaProcess process = info.getProcess(); - for (int i = 0; i < n; i++) { - getEventListeners().invoke().regionReplaced(process, info, i, evt.getCause()); - } - return statusMap.get(evt.getClass()); - } - - /** - * Handler for module unloaded events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processMemoryRegionRemoved(FridaMemoryRegionRemovedEvent evt, Void v) { - FridaRegionInfo info = evt.getInfo(); - long n = info.getNumberOfRegions(); - FridaProcess process = info.getProcess(); - for (int i = 0; i < n; i++) { - getEventListeners().invoke().regionRemoved(process, info, i, evt.getCause()); - } - return statusMap.get(evt.getClass()); - } - - /** - * Handler for state changed events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processStateChanged(FridaStateChangedEvent evt, Void v) { - status = DebugStatus.fromArgument(evt.newState()); - - String id = currentThread == null ? FridaClient.getId(currentProcess) - : FridaClient.getId(currentThread); - if (status.equals(DebugStatus.NO_DEBUGGEE)) { - waiting = false; - if (state.get().equals(FridaState.FRIDA_THREAD_HALTED)) { - if (currentThread != null) { - processEvent(new FridaRunningEvent(id)); - } - processEvent(new FridaProcessExitedEvent(0)); - processEvent(new FridaSessionExitedEvent(FridaClient.getId(currentSession), 0)); - } - return DebugStatus.NO_DEBUGGEE; - } - if (status.equals(DebugStatus.BREAK)) { - waiting = false; - FridaProcess process = getCurrentProcess(); - if (process != null) { - processEvent(new FridaProcessSelectedEvent(process)); - if (currentThread != null) { - FridaThreadInfo tinfo = new FridaThreadInfo(currentThread); - processEvent(new FridaThreadSelectedEvent(tinfo)); - } - } - processEvent(new FridaStoppedEvent(id)); - return DebugStatus.BREAK; - } - if (status.equals(DebugStatus.GO)) { - waiting = true; - processEvent(new FridaRunningEvent(id)); - return DebugStatus.GO; - } - - waiting = false; - return DebugStatus.NO_CHANGE; - } - - /** - * Handler for session selected events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processSessionSelected(FridaSessionSelectedEvent evt, Void v) { - FridaSession session = evt.getSession(); - getEventListeners().invoke().sessionSelected(session, evt.getCause()); - return statusMap.get(evt.getClass()); - } - - protected void processConsoleOutput(FridaConsoleOutputEvent evt, Void v) { - if (evt.getOutput() != null) { - getEventListeners().invoke().consoleOutput(evt.getOutput(), evt.getMask()); - } - } - - @Override - public CompletableFuture listThreads(FridaProcess process) { - return execute(new FridaListThreadsCommand(this, process)); - } - - @Override - public CompletableFuture> listProcesses(FridaSession session) { - return execute(new FridaListProcessesCommand(this, session)); - } - - @Override - public CompletableFuture>> listAvailableProcesses() { - return execute(new FridaListAvailableProcessesCommand(this)); - } - - @Override - public CompletableFuture>> listAvailableDevices() { - return execute(new FridaListAvailableDevicesCommand(this)); - } - - @Override - public CompletableFuture> listSessions() { - return execute(new FridaListSessionsCommand(this)); - } - - @Override - public CompletableFuture> listStackFrames(FridaThread thread) { - return execute(new FridaListStackFramesCommand(this, thread)); - } - - @Override - public CompletableFuture> listRegisters(FridaThread thread) { - return execute(new FridaListRegistersCommand(this, thread)); - } - - @Override - public CompletableFuture listModules(FridaProcess process) { - return execute(new FridaListModulesCommand(this, process)); - } - - public CompletableFuture listKernelModules() { - return execute(new FridaListKernelModulesCommand(this)); - } - - @Override - public CompletableFuture> listModuleSections(FridaModule module) { - return execute(new FridaListModuleSectionsCommand(this, module)); - } - - @Override - public CompletableFuture> listModuleSymbols(FridaModule module) { - return execute(new FridaListModuleSymbolsCommand(this, module)); - } - - @Override - public CompletableFuture> listModuleImports(FridaModule module) { - return execute(new FridaListModuleImportsCommand(this, module)); - } - - @Override - public CompletableFuture> listModuleExports(FridaModule module) { - return execute(new FridaListModuleExportsCommand(this, module)); - } - - @Override - public CompletableFuture listMemory(FridaProcess process) { - return execute(new FridaListMemoryRegionsCommand(this, process)); - } - - public CompletableFuture listKernelMemory() { - return execute(new FridaListKernelMemoryRegionsCommand(this)); - } - - @Override - public CompletableFuture listHeapMemory(FridaProcess process) { - return execute(new FridaListHeapMemoryRegionsCommand(this, process)); - } - - @Override - public CompletableFuture setExceptionHandler(FridaProcess process) { - return execute(new FridaSetExceptionHandlerCommand(this, process)); - } - - @Override - public CompletableFuture getSessionAttributes(FridaSession session) { - return execute(new FridaGetSessionAttributesCommand(this, session)); - } - - @Override - public CompletableFuture addProcess() { - return execute(new FridaAddProcessCommand(this)); - } - - @Override - public CompletableFuture removeProcess(FridaProcess process) { - return execute(new FridaRemoveProcessCommand(this, process.getSession(), - process.getPID().toString())); - } - - @Override - public CompletableFuture addSession() { - return execute(new FridaAddSessionCommand(this)); - } - - @Override - public CompletableFuture attach(String pid) { - return execute(new FridaAttachCommand(this, pid)); - } - - @Override - public CompletableFuture attachDeviceById(String id) { - return execute(new FridaAttachDeviceByIdCommand(this, id)); - } - - @Override - public CompletableFuture attachDeviceByType(String id) { - return execute(new FridaAttachDeviceByTypeCommand(this, id)); - } - - @Override - public CompletableFuture launch(String fileName, List args) { - return execute(new FridaLaunchProcessCommand(this, fileName, args)); - } - - @Override - public CompletableFuture launch(Map args) { - return execute(new FridaLaunchProcessWithOptionsCommand(this, args)); - } - - public FridaClient getClient() { - return executor.getClient(); - } - - public FridaThread getCurrentThread() { - return currentThread; - } - - public void setCurrentThread(FridaThread thread) { - currentThread = thread; - } - - public void setCurrentThreadById(String tid) { - currentProcess = currentSession.getProcess(); - if (currentProcess != null) { - String key = FridaClient.getId(currentProcess); - currentThread = threads.get(key).get(tid); - } - } - - public FridaProcess getCurrentProcess() { - return currentProcess; - } - - public FridaSession getCurrentSession() { - return currentSession; - } - - public void setCurrentSession(FridaSession session) { - currentSession = session; - } - - @Override - public FridaTarget getCurrentTarget() { - return currentTarget; - } - - @Override - public void setCurrentTarget(FridaTarget target) { - currentTarget = target; - } - - public CompletableFuture requestFocus(FridaModelTargetFocusScope scope, - TargetObject obj) { - return execute(new FridaRequestFocusCommand(this, scope, obj)); - } - - public CompletableFuture requestActivation(FridaModelTargetActiveScope activator, - TargetObject obj) { - return execute(new FridaRequestActivationCommand(this, activator, obj)); - } - - @Override - public CompletableFuture console(String command) { - if (continuation != null) { - String prompt = command.equals("") ? FridaModelTargetInterpreter.FRIDA_PROMPT : ">>>"; - getEventListeners().invoke().promptChanged(prompt); - continuation.complete(command); - setContinuation(null); - return AsyncUtils.nil(); - } - return execute( - new FridaConsoleExecCommand(this, command, FridaConsoleExecCommand.Output.CONSOLE)) - .thenApply(e -> null); - } - - @Override - public CompletableFuture consoleCapture(String command) { - return execute( - new FridaConsoleExecCommand(this, command, FridaConsoleExecCommand.Output.CAPTURE)); - } - - @Override - public FridaState getState() { - if (currentThread == null) { - return null; - } - if (currentThread != null) { - return FridaState.FRIDA_THREAD_RUNNING; - } - return currentThread.getState(); - } - - @Override - public FridaProcess currentProcess() { - return getCurrentProcess(); - } - - @Override - public CompletableFuture waitForPrompt() { - return CompletableFuture.completedFuture(null); - } - - public CompletableFuture> getRegisterMap(List path) { - return null; - } - - public boolean isWaiting() { - return waiting; - } - - public boolean isKernelMode() { - return kernelMode; - } - - public void setKernelMode(boolean kernelMode) { - this.kernelMode = kernelMode; - } - - public void setContinuation(CompletableFuture continuation) { - this.continuation = continuation; - } - - @Override - public DebugStatus getStatus() { - return status; - } - - public FridaScript loadPermanentScript(AbstractFridaCommand caller, String name, - String scriptText) { - caller.setName(name); - Pointer options = FridaEng.createOptions(name); - FridaScript script = FridaEng.createScript(currentSession, scriptText, options); - NativeLong signal = - FridaEng.connectSignal(script, "message", (__s, message, data, userData) -> { - caller.parse(message, data); - }, null); - script.setSignal(signal); - FridaEng.loadScript(script); - scripts.put(name, script); - return script; - } - - public void unloadPermanentScript(String name) { - FridaScript script = scripts.get(name); - NativeLong signal = script.getSignal(); - FridaEng.disconnectSignal(script, signal); - FridaEng.unloadScript(script); - FridaEng.unref(script); - } - - public FridaScript loadScript(AbstractFridaCommand caller, String name, String scriptText) { - caller.setName(name); - Pointer options = FridaEng.createOptions(name); - String wrapperText = scriptText.contains("result") ? "var result = '';" + scriptText + - "var msg = { key: '" + name + "', value: result};" + - "send(JSON.stringify(msg));" : "send(JSON.stringify(" + scriptText + "));"; - FridaScript script = FridaEng.createScript(currentSession, wrapperText, options); - if (script != null) { - NativeLong signal = - FridaEng.connectSignal(script, "message", (__s, message, data, userData) -> { - caller.parse(message, data); - }, null); - script.setSignal(signal); - FridaEng.loadScript(script); - caller.setScript(script); - FridaEng.disconnectSignal(script, signal); - FridaEng.unloadScript(script); - FridaEng.unref(script); - } - return script; - } - - @Override - public void enableDebugger(FridaSession session, int port) { - FridaEng.enableDebugger(session, new NativeLong(port)); - } - - public CompletableFuture stalkThread(String tid, Map arguments) { - return execute(new FridaStalkThreadCommand(this, tid, arguments)); - } - - public CompletableFuture interceptFunction(String address, Map arguments) { - return execute(new FridaInterceptFunctionCommand(this, address, arguments)); - } - - public CompletableFuture watchMemory(Map arguments) { - return execute(new FridaWatchMemoryCommand(this, arguments)); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/AbstractFridaModel.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/AbstractFridaModel.java deleted file mode 100644 index eba5138250..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/AbstractFridaModel.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model; - -import java.io.IOException; -import java.util.concurrent.CompletableFuture; - -import agent.frida.manager.FridaManager; -import agent.frida.model.iface2.FridaModelTargetSession; -import ghidra.dbg.agent.AbstractDebuggerObjectModel; -import ghidra.dbg.target.TargetObject; -import ghidra.program.model.address.AddressFactory; - -public abstract class AbstractFridaModel extends AbstractDebuggerObjectModel { - - public abstract FridaManager getManager(); - - public abstract CompletableFuture startFrida(String[] args); - - public abstract boolean isRunning(); - - public abstract void terminate() throws IOException; - - public abstract AddressFactory getAddressFactory(); - - public abstract FridaModelTargetSession getSession(); - - public abstract void addModelObject(Object object, TargetObject targetObject); - - public abstract TargetObject getModelObject(Object object); - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelSelectableObject.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelSelectableObject.java deleted file mode 100644 index dbcdc81bf2..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelSelectableObject.java +++ /dev/null @@ -1,35 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface1; - -import java.util.concurrent.CompletableFuture; - -import agent.frida.model.iface2.FridaModelTargetObject; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "SelectableObject", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(type = Void.class) - }) -public interface FridaModelSelectableObject extends FridaModelTargetObject { - - public CompletableFuture setActive(); - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetAccessConditioned.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetAccessConditioned.java deleted file mode 100644 index df5060bb74..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetAccessConditioned.java +++ /dev/null @@ -1,36 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface1; - -import agent.frida.model.iface2.FridaModelTargetObject; -import ghidra.dbg.target.TargetAccessConditioned; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface FridaModelTargetAccessConditioned - extends FridaModelTargetObject, TargetAccessConditioned { - - @Override - public boolean isAccessible(); - - public void setAccessible(boolean accessible); - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetActiveScope.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetActiveScope.java deleted file mode 100644 index eb5ba3d9d7..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetActiveScope.java +++ /dev/null @@ -1,68 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface1; - -import java.util.concurrent.CompletableFuture; - -import agent.frida.model.iface2.FridaModelTargetObject; -import ghidra.async.AsyncUtils; -import ghidra.dbg.error.DebuggerIllegalArgumentException; -import ghidra.dbg.target.TargetActiveScope; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.util.PathUtils; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface FridaModelTargetActiveScope extends FridaModelTargetObject, TargetActiveScope { - - // NB: requesActivation request change in active object - propagates down to manager - // (but, of course, may then cause change in state) - @Override - public default CompletableFuture requestActivation(TargetObject obj) { - return getModel().gateFuture(getManager().requestActivation(this, obj)); - } - - public default CompletableFuture doRequestActivation(TargetObject obj) { - if (getManager().isWaiting()) { - return AsyncUtils.nil(); - } - getModel().assertMine(TargetObject.class, obj); - if (!PathUtils.isAncestor(this.getPath(), obj.getPath())) { - throw new DebuggerIllegalArgumentException("Can only focus a successor of the scope"); - } - TargetObject cur = obj; - while (cur != null) { - if (cur instanceof FridaModelSelectableObject) { - FridaModelSelectableObject sel = (FridaModelSelectableObject) cur; - //System.err.println("requestActivation " + obj); - return sel.setActive(); - } - if (cur instanceof FridaModelTargetObject) { - FridaModelTargetObject def = (FridaModelTargetObject) cur; - cur = def.getParent(); - continue; - } - throw new AssertionError(); - } - return AsyncUtils.nil(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetAttachable.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetAttachable.java deleted file mode 100644 index 55e4fb54bb..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetAttachable.java +++ /dev/null @@ -1,32 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface1; - -import agent.frida.model.iface2.FridaModelTargetObject; -import ghidra.dbg.target.TargetAttachable; - -/** - * An interface which indicates this object is capable of launching targets. - * - *

- * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface FridaModelTargetAttachable extends FridaModelTargetObject, TargetAttachable { - String PID_ATTRIBUTE_NAME = PREFIX_INVISIBLE + "pid"; - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetAttacher.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetAttacher.java deleted file mode 100644 index 1a4afd9e8b..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetAttacher.java +++ /dev/null @@ -1,40 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface1; - -import java.util.concurrent.CompletableFuture; - -import agent.frida.model.iface2.FridaModelTargetObject; -import ghidra.dbg.target.TargetAttachable; -import ghidra.dbg.target.TargetAttacher; - -/** - * An interface which indicates this object is capable of launching targets. - * - *

- * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface FridaModelTargetAttacher extends FridaModelTargetObject, TargetAttacher { - - @Override - public CompletableFuture attach(TargetAttachable attachable); - - @Override - public CompletableFuture attach(long pid); - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetConfigurable.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetConfigurable.java deleted file mode 100644 index 50db71db08..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetConfigurable.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface1; - -import agent.frida.model.iface2.FridaModelTargetObject; -import ghidra.dbg.target.TargetConfigurable; - -/** - * An interface which indicates this object is configurable. - * - * @param type for this - */ -public interface FridaModelTargetConfigurable extends FridaModelTargetObject, TargetConfigurable { - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetDeletable.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetDeletable.java deleted file mode 100644 index c7ce002045..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetDeletable.java +++ /dev/null @@ -1,35 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface1; - -import java.util.concurrent.CompletableFuture; - -import agent.frida.model.iface2.FridaModelTargetObject; -import ghidra.dbg.target.TargetDeletable; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface FridaModelTargetDeletable extends FridaModelTargetObject, TargetDeletable { - - @Override - public CompletableFuture delete(); - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetDetachable.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetDetachable.java deleted file mode 100644 index 348bb38ff6..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetDetachable.java +++ /dev/null @@ -1,35 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface1; - -import java.util.concurrent.CompletableFuture; - -import agent.frida.model.iface2.FridaModelTargetObject; -import ghidra.dbg.target.TargetDetachable; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface FridaModelTargetDetachable extends FridaModelTargetObject, TargetDetachable { - - @Override - public CompletableFuture detach(); - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetEnvironment.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetEnvironment.java deleted file mode 100644 index fb39fad79c..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetEnvironment.java +++ /dev/null @@ -1,38 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface1; - -import agent.frida.model.iface2.FridaModelTargetObject; -import ghidra.dbg.target.TargetEnvironment; - -public interface FridaModelTargetEnvironment extends FridaModelTargetObject, TargetEnvironment { - - @Override - public default String getArchitecture() { - return getTypedAttributeNowByName(ARCH_ATTRIBUTE_NAME, String.class, ""); - } - - @Override - public default String getDebugger() { - return getTypedAttributeNowByName(DEBUGGER_ATTRIBUTE_NAME, String.class, ""); - } - - @Override - public default String getOperatingSystem() { - return getTypedAttributeNowByName(OS_ATTRIBUTE_NAME, String.class, ""); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetEventScope.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetEventScope.java deleted file mode 100644 index 6f9c19f93b..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetEventScope.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface1; - -import agent.frida.model.iface2.FridaModelTargetObject; -import ghidra.dbg.target.TargetEventScope; - -/** - * The object can emit events affecting itself and its successors - * - * @param type for this - */ -public interface FridaModelTargetEventScope extends FridaModelTargetObject, TargetEventScope { - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetExecutionStateful.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetExecutionStateful.java deleted file mode 100644 index 8a06622f5c..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetExecutionStateful.java +++ /dev/null @@ -1,44 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface1; - -import java.util.List; -import java.util.Map; - -import agent.frida.model.iface2.FridaModelTargetObject; -import ghidra.dbg.target.TargetExecutionStateful; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface FridaModelTargetExecutionStateful - extends FridaModelTargetObject, TargetExecutionStateful { - - public default void setExecutionState(TargetExecutionState state, String reason) { - changeAttributes(List.of(), Map.of( // - STATE_ATTRIBUTE_NAME, state // - ), reason); - if (this instanceof FridaModelTargetAccessConditioned) { - FridaModelTargetAccessConditioned conditioned = (FridaModelTargetAccessConditioned) this; - conditioned.setAccessible(!state.isRunning()); - } - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetFocusScope.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetFocusScope.java deleted file mode 100644 index baa77fd388..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetFocusScope.java +++ /dev/null @@ -1,78 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface1; - -import java.util.concurrent.CompletableFuture; - -import agent.frida.model.iface2.FridaModelTargetObject; -import ghidra.async.AsyncUtils; -import ghidra.dbg.error.DebuggerIllegalArgumentException; -import ghidra.dbg.target.TargetFocusScope; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.util.PathUtils; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface FridaModelTargetFocusScope extends FridaModelTargetObject, TargetFocusScope { - - @Override - public FridaModelSelectableObject getFocus(); - - // NB: setFocus changes attributes - propagates up to client - public boolean setFocus(FridaModelSelectableObject sel); - - // NB: requestFocus request change in focused object - propagates down to manager - // (but, of course, may then cause change in state) - @Override - public default CompletableFuture requestFocus(TargetObject obj) { - return getModel().gateFuture(getManager().requestFocus(this, obj)); - } - - public default CompletableFuture doRequestFocus(TargetObject obj) { - if (getManager().isWaiting()) { - return AsyncUtils.nil(); - } - getModel().assertMine(TargetObject.class, obj); - if (obj.equals(getFocus())) { - return AsyncUtils.nil(); - } - if (!PathUtils.isAncestor(this.getPath(), obj.getPath())) { - throw new DebuggerIllegalArgumentException("Can only focus a successor of the scope"); - } - TargetObject cur = obj; - while (cur != null) { - if (cur instanceof FridaModelSelectableObject) { - FridaModelSelectableObject sel = (FridaModelSelectableObject) cur; - //System.err.println("requestFocus " + obj); - setFocus(sel); - return AsyncUtils.nil(); - } - if (cur instanceof FridaModelTargetObject) { - FridaModelTargetObject def = (FridaModelTargetObject) cur; - cur = def.getParent(); - continue; - } - throw new AssertionError(); - } - return AsyncUtils.nil(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetInterpreter.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetInterpreter.java deleted file mode 100644 index 9aecaeb572..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetInterpreter.java +++ /dev/null @@ -1,44 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface1; - -import java.util.concurrent.CompletableFuture; - -import agent.frida.model.iface2.FridaModelTargetObject; -import ghidra.dbg.target.TargetInterpreter; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface FridaModelTargetInterpreter extends FridaModelTargetObject, TargetInterpreter { - - public static final String FRIDA_PROMPT = "(frida)"; - - @Override - public default CompletableFuture execute(String cmd) { - return getModel().gateFuture(getManager().console(cmd)); - } - - @Override - public default CompletableFuture executeCapture(String cmd) { - return getModel().gateFuture(getManager().consoleCapture(cmd)); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetKillable.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetKillable.java deleted file mode 100644 index 854415fec0..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetKillable.java +++ /dev/null @@ -1,37 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface1; - -import java.util.concurrent.CompletableFuture; - -import agent.frida.model.iface2.FridaModelTargetObject; -import ghidra.dbg.target.TargetKillable; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface FridaModelTargetKillable extends FridaModelTargetObject, TargetKillable { - - public CompletableFuture destroy(); - - @Override - public CompletableFuture kill(); - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetLauncher.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetLauncher.java deleted file mode 100644 index 7f9df24d5e..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetLauncher.java +++ /dev/null @@ -1,36 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface1; - -import java.util.List; -import java.util.concurrent.CompletableFuture; - -import agent.frida.model.iface2.FridaModelTargetObject; -import ghidra.dbg.target.TargetLauncher.TargetCmdLineLauncher; - -/** - * An interface which indicates this object is capable of launching targets. - * - *

- * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface FridaModelTargetLauncher extends FridaModelTargetObject, TargetCmdLineLauncher { - - @Override - public CompletableFuture launch(List args); -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetMethod.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetMethod.java deleted file mode 100644 index 1804f21373..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetMethod.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface1; - -import agent.frida.model.iface2.FridaModelTargetObject; -import ghidra.dbg.target.TargetMethod; - -/** - * An interface which indicates this object is a method in its parent. - * - * @param type for this - */ -public interface FridaModelTargetMethod extends FridaModelTargetObject, TargetMethod { - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetResumable.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetResumable.java deleted file mode 100644 index 280c6b6534..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetResumable.java +++ /dev/null @@ -1,35 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface1; - -import java.util.concurrent.CompletableFuture; - -import agent.frida.model.iface2.FridaModelTargetObject; -import ghidra.dbg.target.TargetResumable; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface FridaModelTargetResumable extends FridaModelTargetObject, TargetResumable { - - @Override - public CompletableFuture resume(); - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetSteppable.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetSteppable.java deleted file mode 100644 index 58100d05dd..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface1/FridaModelTargetSteppable.java +++ /dev/null @@ -1,30 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface1; - -import agent.frida.model.iface2.FridaModelTargetObject; -import ghidra.dbg.target.TargetSteppable; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface FridaModelTargetSteppable extends FridaModelTargetObject, TargetSteppable { - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetAvailableDevice.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetAvailableDevice.java deleted file mode 100644 index 976a7b55f3..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetAvailableDevice.java +++ /dev/null @@ -1,27 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface2; - -import ghidra.dbg.target.TargetAttachable; - -public interface FridaModelTargetAvailableDevice extends FridaModelTargetObject, TargetAttachable { - String ID_ATTRIBUTE_NAME = PREFIX_INVISIBLE + "id"; - - public String getId(); - - public void setBase(Object value); - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetAvailableDevicesContainer.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetAvailableDevicesContainer.java deleted file mode 100644 index aeb2d5e1d6..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetAvailableDevicesContainer.java +++ /dev/null @@ -1,22 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface2; - -public interface FridaModelTargetAvailableDevicesContainer extends FridaModelTargetObject { - - public FridaModelTargetAvailableDevice getTargetAttachable(String pid); - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetAvailableProcess.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetAvailableProcess.java deleted file mode 100644 index b57cf18046..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetAvailableProcess.java +++ /dev/null @@ -1,27 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface2; - -import ghidra.dbg.target.TargetAttachable; - -public interface FridaModelTargetAvailableProcess extends FridaModelTargetObject, TargetAttachable { - String PID_ATTRIBUTE_NAME = PREFIX_INVISIBLE + "pid"; - - public Long getPid(); - - public void setBase(Object value); - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetAvailableProcessesContainer.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetAvailableProcessesContainer.java deleted file mode 100644 index af93b1be09..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetAvailableProcessesContainer.java +++ /dev/null @@ -1,22 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface2; - -public interface FridaModelTargetAvailableProcessesContainer extends FridaModelTargetObject { - - public FridaModelTargetAvailableProcess getTargetAttachable(String pid); - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetConnector.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetConnector.java deleted file mode 100644 index bb0d8ff05d..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetConnector.java +++ /dev/null @@ -1,41 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface2; - -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import agent.frida.model.iface1.FridaModelSelectableObject; -import ghidra.dbg.target.TargetLauncher; -import ghidra.dbg.target.TargetMethod.TargetParameterMap; - -public interface FridaModelTargetConnector - extends FridaModelSelectableObject, TargetLauncher { - - @Override - public default String getDisplay() { - return getName(); - } - - @Override - public CompletableFuture setActive(); - - @Override - public TargetParameterMap getParameters(); - - @Override - public CompletableFuture launch(Map args); -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetConnectorContainer.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetConnectorContainer.java deleted file mode 100644 index cdc7f278f0..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetConnectorContainer.java +++ /dev/null @@ -1,22 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface2; - -public interface FridaModelTargetConnectorContainer extends FridaModelTargetObject { - - public FridaModelTargetAvailableProcess getTargetAttachable(int pid); - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetExport.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetExport.java deleted file mode 100644 index 6937ef65c9..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetExport.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface2; - -import ghidra.program.model.address.Address; - -public interface FridaModelTargetExport extends FridaModelTargetObject { - - @Override - public String getName(); - - @Override - public Address getValue(); - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetExportContainer.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetExportContainer.java deleted file mode 100644 index 3e98627195..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetExportContainer.java +++ /dev/null @@ -1,26 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface2; - -import agent.frida.manager.FridaExport; -import agent.frida.model.impl.FridaModelTargetExportImpl; - -public interface FridaModelTargetExportContainer - extends FridaModelTargetObject { - - public FridaModelTargetExportImpl getTargetExport(FridaExport exp); - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetFileSpec.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetFileSpec.java deleted file mode 100644 index ca7e4d1f1d..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetFileSpec.java +++ /dev/null @@ -1,22 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface2; - -import ghidra.dbg.target.TargetObject; - -public interface FridaModelTargetFileSpec extends FridaModelTargetObject, TargetObject { - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetFunction.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetFunction.java deleted file mode 100644 index 90f10aac75..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetFunction.java +++ /dev/null @@ -1,20 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface2; - -public interface FridaModelTargetFunction extends FridaModelTargetObject { - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetImport.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetImport.java deleted file mode 100644 index 86d2011101..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetImport.java +++ /dev/null @@ -1,29 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface2; - -import ghidra.program.model.address.Address; - -public interface FridaModelTargetImport extends FridaModelTargetObject { - - @Override - public String getName(); - - @Override - public Address getValue(); - - public long getSize(); -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetImportContainer.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetImportContainer.java deleted file mode 100644 index 1bb498df44..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetImportContainer.java +++ /dev/null @@ -1,26 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface2; - -import agent.frida.manager.FridaImport; -import agent.frida.model.impl.FridaModelTargetImportImpl; - -public interface FridaModelTargetImportContainer - extends FridaModelTargetObject { - - public FridaModelTargetImportImpl getTargetImport(FridaImport imp); - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetMemoryContainer.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetMemoryContainer.java deleted file mode 100644 index 8932453d98..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetMemoryContainer.java +++ /dev/null @@ -1,42 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface2; - -import java.util.concurrent.CompletableFuture; - -import agent.frida.frida.FridaRegionInfo; -import agent.frida.manager.*; -import ghidra.dbg.target.TargetMemory; -import ghidra.program.model.address.Address; - -public interface FridaModelTargetMemoryContainer extends FridaModelTargetObject, TargetMemory, // - FridaEventsListenerAdapter { - - public FridaModelTargetMemoryRegion getTargetMemory(FridaMemoryRegionInfo region); - - public void regionAdded(FridaProcess process, FridaRegionInfo info, int index, FridaCause cause); - - public void regionReplaced(FridaProcess process, FridaRegionInfo info, int index, FridaCause cause); - - public void regionRemoved(FridaProcess process, FridaRegionInfo info, int index, FridaCause cause); - - @Override - public CompletableFuture readMemory(Address address, int length); - - @Override - public CompletableFuture writeMemory(Address address, byte[] data); - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetMemoryRegion.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetMemoryRegion.java deleted file mode 100644 index 655208b7cc..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetMemoryRegion.java +++ /dev/null @@ -1,35 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface2; - -import ghidra.dbg.target.TargetMemoryRegion; -import ghidra.program.model.address.AddressRange; - -public interface FridaModelTargetMemoryRegion extends FridaModelTargetObject, TargetMemoryRegion { - - @Override - public AddressRange getRange(); - - @Override - public boolean isReadable(); - - @Override - public boolean isWritable(); - - @Override - public boolean isExecutable(); - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetModule.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetModule.java deleted file mode 100644 index bfa0dc9202..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetModule.java +++ /dev/null @@ -1,73 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface2; - -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import agent.frida.manager.FridaModule; -import ghidra.dbg.target.TargetModule; -import ghidra.dbg.target.TargetObject; -import ghidra.program.model.address.Address; -import ghidra.program.model.address.AddressRange; -import ghidra.program.model.address.AddressRangeImpl; -import ghidra.program.model.address.AddressSpace; - -public interface FridaModelTargetModule extends FridaModelTargetObject, TargetModule { - - FridaModule getModule(); - - @Override - public default CompletableFuture init(Map map) { - AddressSpace space = getModel().getAddressSpace("ram"); - return requestNativeAttributes().thenAccept(attrs -> { - if (attrs != null) { - map.putAll(attrs); - TargetObject baseOffset2 = (TargetObject) attrs.get("BaseAddress"); - TargetObject nameAttr = (TargetObject) attrs.get("Name"); - TargetObject size = (TargetObject) attrs.get("Size"); - String basestr = baseOffset2 == null ? "0" - : baseOffset2.getCachedAttribute(VALUE_ATTRIBUTE_NAME).toString(); - String namestr = nameAttr == null ? "" - : nameAttr.getCachedAttribute(VALUE_ATTRIBUTE_NAME).toString(); - String sizestr = - size == null ? "1" : size.getCachedAttribute(VALUE_ATTRIBUTE_NAME).toString(); - String shortnamestr = namestr; - int sep = shortnamestr.lastIndexOf('\\'); - if (sep > 0 && sep < shortnamestr.length()) { - shortnamestr = shortnamestr.substring(sep + 1); - } - Long base = Long.parseUnsignedLong(basestr, 16); - Integer sz = Integer.parseInt(sizestr, 16); - Address min = space.getAddress(base); - Address max = min.add(sz - 1); - AddressRange range = new AddressRangeImpl(min, max); - if (range != null) { - map.put(RANGE_ATTRIBUTE_NAME, range); - } - - String oldval = (String) getCachedAttribute(DISPLAY_ATTRIBUTE_NAME); - map.put(MODULE_NAME_ATTRIBUTE_NAME, namestr); - map.put(SHORT_DISPLAY_ATTRIBUTE_NAME, shortnamestr); - map.put(DISPLAY_ATTRIBUTE_NAME, shortnamestr); - setModified(map, !shortnamestr.equals(oldval)); - } - }); - } - - void setRange(AddressRangeImpl addressRangeImpl); - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetModuleContainer.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetModuleContainer.java deleted file mode 100644 index 94111b3026..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetModuleContainer.java +++ /dev/null @@ -1,42 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface2; - -import java.util.concurrent.CompletableFuture; - -import agent.frida.frida.FridaModuleInfo; -import agent.frida.manager.*; -import agent.frida.model.iface1.FridaModelTargetEventScope; -import ghidra.dbg.target.TargetModule; -import ghidra.dbg.target.TargetModuleContainer; - -public interface FridaModelTargetModuleContainer - extends FridaModelTargetEventScope, // - TargetModuleContainer, // - FridaEventsListenerAdapter { - - @Override - public CompletableFuture addSyntheticModule(String name); - - public FridaModelTargetModule getTargetModule(FridaModule module); - - public void moduleLoaded(FridaProcess proc, FridaModuleInfo info, int index, FridaCause cause); - - public void moduleReplaced(FridaProcess proc, FridaModuleInfo info, int index, FridaCause cause); - - public void moduleUnloaded(FridaProcess proc, FridaModuleInfo info, int index, FridaCause cause); - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetModuleSection.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetModuleSection.java deleted file mode 100644 index 1493f31b62..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetModuleSection.java +++ /dev/null @@ -1,26 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface2; - -import ghidra.dbg.target.TargetSection; -import ghidra.program.model.address.AddressRange; - -public interface FridaModelTargetModuleSection extends FridaModelTargetObject, TargetSection { - - @Override - public AddressRange getRange(); - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetModuleSectionContainer.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetModuleSectionContainer.java deleted file mode 100644 index eab6180591..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetModuleSectionContainer.java +++ /dev/null @@ -1,23 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface2; - -import ghidra.dbg.target.TargetSectionContainer; - -public interface FridaModelTargetModuleSectionContainer - extends FridaModelTargetObject, TargetSectionContainer { - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetObject.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetObject.java deleted file mode 100644 index d37e25e87d..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetObject.java +++ /dev/null @@ -1,83 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface2; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import agent.frida.manager.impl.FridaManagerImpl; -import agent.frida.model.AbstractFridaModel; -import ghidra.async.AsyncUtils; -import ghidra.dbg.agent.SpiTargetObject; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.util.CollectionUtils.Delta; - -public interface FridaModelTargetObject extends SpiTargetObject { - - @Override - public AbstractFridaModel getModel(); - - public default CompletableFuture init(Map map) { - return CompletableFuture.completedFuture(null); - } - - public default FridaManagerImpl getManager() { - return (FridaManagerImpl) getModel().getManager(); - } - - public default FridaManagerImpl getManagerWithCheck() { - FridaManagerImpl impl = (FridaManagerImpl) getModel().getManager(); - if (impl == null) { - return impl; - } - return impl; - } - - public Delta changeAttributes(List remove, Map add, String reason); - - public CompletableFuture> requestNativeAttributes(); - - public default CompletableFuture requestAugmentedAttributes() { - return AsyncUtils.nil(); - } - - public CompletableFuture> requestNativeElements(); - - public FridaModelTargetSession getParentSession(); - - public FridaModelTargetProcess getParentProcess(); - - public FridaModelTargetThread getParentThread(); - - public TargetObject getProxy(); - - public void setModified(Map map, boolean b); - - public void setModified(boolean modified); - - public void resetModified(); - - public Object getModelObject(); - - public void setModelObject(Object modelObject); - - public void addMapObject(Object object, TargetObject targetObject); - - public TargetObject getMapObject(Object object); - - public void deleteMapObject(Object object); -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetProcess.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetProcess.java deleted file mode 100644 index 92acbb0879..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetProcess.java +++ /dev/null @@ -1,55 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface2; - -import java.util.concurrent.CompletableFuture; - -import agent.frida.manager.FridaEventsListenerAdapter; -import agent.frida.manager.FridaProcess; -import agent.frida.model.iface1.*; -import ghidra.dbg.target.TargetAggregate; -import ghidra.dbg.target.TargetProcess; - -public interface FridaModelTargetProcess extends // - TargetAggregate, // - TargetProcess, // - FridaModelTargetExecutionStateful, // - //FridaModelTargetAccessConditioned, // - FridaModelTargetAttacher, // - FridaModelTargetAttachable, // - FridaModelTargetLauncher, // - FridaModelTargetDeletable, // - FridaModelTargetDetachable, // - FridaModelTargetKillable, // - FridaModelTargetResumable, // - //FridaModelTargetSteppable, // - //FridaModelTargetInterruptible, // - FridaEventsListenerAdapter, // - FridaModelSelectableObject { - - public void processStarted(FridaProcess proc); - - public FridaModelTargetThreadContainer getThreads(); - - public FridaModelTargetMemoryContainer getMemory(); - - public FridaProcess getProcess(); - - @Override - public CompletableFuture setActive(); - - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetProcessContainer.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetProcessContainer.java deleted file mode 100644 index 6ec2823cd8..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetProcessContainer.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface2; - -import agent.frida.manager.FridaEventsListenerAdapter; -import agent.frida.manager.FridaProcess; -import agent.frida.model.iface1.FridaModelTargetEventScope; - -public interface FridaModelTargetProcessContainer extends // - FridaModelTargetEventScope, // - FridaEventsListenerAdapter { - - public FridaModelTargetProcess getTargetProcess(FridaProcess process); - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetRegister.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetRegister.java deleted file mode 100644 index e9024f879a..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetRegister.java +++ /dev/null @@ -1,37 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface2; - -import java.math.BigInteger; - -import agent.frida.manager.FridaValue; -import ghidra.dbg.target.TargetRegister; -import ghidra.dbg.util.ConversionUtils; - -public interface FridaModelTargetRegister extends FridaModelTargetObject, TargetRegister { - - @Override - public int getBitLength(); - - public FridaValue getRegister(); - - public default byte[] getBytes() { - String val = (String) getCachedAttributes().get(VALUE_ATTRIBUTE_NAME); - BigInteger value = new BigInteger(val, 16); - return ConversionUtils.bigIntegerToBytes(getBitLength() / 8, value); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetRegisterBank.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetRegisterBank.java deleted file mode 100644 index 8954b46fe7..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetRegisterBank.java +++ /dev/null @@ -1,61 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface2; - -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; -import java.util.Map.Entry; -import java.util.concurrent.CompletableFuture; - -import agent.frida.manager.FridaReason; -import agent.frida.manager.FridaValue; -import agent.frida.manager.FridaState; -import ghidra.dbg.target.TargetRegisterBank; - -public interface FridaModelTargetRegisterBank extends FridaModelTargetObject, TargetRegisterBank { - - public FridaModelTargetRegister getTargetRegister(FridaValue register); - - public default void threadStateChangedSpecific(FridaState state, FridaReason reason) { - readRegistersNamed(getCachedElements().keySet()); - } - - @Override - public CompletableFuture> readRegistersNamed( - Collection names); - - @Override - public CompletableFuture writeRegistersNamed(Map values); - - @Override - public default Map getCachedRegisters() { - return getValues(); - } - - public default Map getValues() { - Map result = new HashMap<>(); - for (Entry entry : this.getCachedAttributes().entrySet()) { - if (entry.getValue() instanceof FridaModelTargetRegister) { - FridaModelTargetRegister reg = (FridaModelTargetRegister) entry.getValue(); - byte[] bytes = reg.getBytes(); - result.put(entry.getKey(), bytes); - } - } - return result; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetRegisterContainer.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetRegisterContainer.java deleted file mode 100644 index 3a7eb8bc3f..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetRegisterContainer.java +++ /dev/null @@ -1,23 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface2; - -import ghidra.dbg.target.TargetRegisterContainer; - -public interface FridaModelTargetRegisterContainer - extends FridaModelTargetObject, TargetRegisterContainer { - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetRegisterContainerAndBank.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetRegisterContainerAndBank.java deleted file mode 100644 index 891343a6ff..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetRegisterContainerAndBank.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface2; - -import java.util.Map.Entry; - -import ghidra.dbg.target.TargetRegisterBank; -import ghidra.dbg.target.TargetRegisterContainer; - -public interface FridaModelTargetRegisterContainerAndBank extends // - FridaModelTargetObject, // - TargetRegisterContainer, // - TargetRegisterBank { - - @SuppressWarnings("rawtypes") - public FridaModelTargetRegister getTargetRegister(Entry register); - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetRoot.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetRoot.java deleted file mode 100644 index a9c33b2c4f..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetRoot.java +++ /dev/null @@ -1,35 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface2; - -import agent.frida.manager.FridaEventsListenerAdapter; -import agent.frida.model.iface1.*; - -public interface FridaModelTargetRoot extends // - //FridaModelTargetObject, - FridaModelTargetAccessConditioned, // - FridaModelTargetAttacher, // - FridaModelTargetActiveScope, // - FridaModelTargetEventScope, // - FridaModelTargetLauncher, // - FridaModelTargetFocusScope, // - FridaEventsListenerAdapter { - - void setDefaultConnector(FridaModelTargetConnector defaultConnector); - - // getActive & requestActivation implemented by FridaModelTargetObject & FridaModelTargetActiveScope - // getFocus & requestFocus implemented by FridaModelTargetObject & FridaModelTargetFocusScope -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetSession.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetSession.java deleted file mode 100644 index 39588f6291..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetSession.java +++ /dev/null @@ -1,63 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface2; - -import java.util.List; -import java.util.Map; - -import agent.frida.frida.FridaClient.DebugOutputFlags; -import agent.frida.manager.FridaEventsListenerAdapter; -import agent.frida.model.iface1.*; -import ghidra.dbg.target.TargetAggregate; -import ghidra.dbg.target.TargetConsole; -import ghidra.dbg.target.TargetConsole.Channel; - -public interface FridaModelTargetSession extends // - //FridaModelTargetAccessConditioned, // - //FridaModelTargetFocusScope, // - FridaModelTargetExecutionStateful, // - FridaModelTargetInterpreter, // - //FridaModelTargetInterruptible, // - FridaModelTargetResumable, // - FridaEventsListenerAdapter, // - FridaModelSelectableObject, // - TargetAggregate { - - FridaModelTargetProcessContainer getProcesses(); - - FridaModelTargetModuleContainer getModules(); - - @Override - public default void consoleOutput(String output, int mask) { - - Channel chan = TargetConsole.Channel.STDOUT; - if (((mask & DebugOutputFlags.DEBUG_OUTPUT_ERROR.getValue()) // - == DebugOutputFlags.DEBUG_OUTPUT_ERROR.getValue()) || // - ((mask & DebugOutputFlags.DEBUG_OUTPUT_WARNING.getValue()) // - == DebugOutputFlags.DEBUG_OUTPUT_WARNING.getValue())) { - chan = TargetConsole.Channel.STDERR; - } - broadcast().consoleOutput(getProxy(), chan, output); - } - - @Override - public default void promptChanged(String prompt) { - changeAttributes(List.of(), Map.of( // - PROMPT_ATTRIBUTE_NAME, prompt // - ), "Refreshed"); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetSessionAttributes.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetSessionAttributes.java deleted file mode 100644 index 24ca7fa58a..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetSessionAttributes.java +++ /dev/null @@ -1,25 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface2; - -import agent.frida.manager.FridaEventsListenerAdapter; -import agent.frida.model.iface1.FridaModelTargetEnvironment; - -public interface FridaModelTargetSessionAttributes extends - FridaModelTargetEnvironment, // - FridaEventsListenerAdapter { - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetSessionAttributesEnvironment.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetSessionAttributesEnvironment.java deleted file mode 100644 index 964a49e716..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetSessionAttributesEnvironment.java +++ /dev/null @@ -1,24 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface2; - -import agent.frida.manager.FridaEventsListenerAdapter; - -public interface FridaModelTargetSessionAttributesEnvironment extends // - FridaModelTargetObject, // - FridaEventsListenerAdapter { - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetSessionAttributesPlatform.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetSessionAttributesPlatform.java deleted file mode 100644 index c4fed82892..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetSessionAttributesPlatform.java +++ /dev/null @@ -1,24 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface2; - -import agent.frida.manager.FridaEventsListenerAdapter; - -public interface FridaModelTargetSessionAttributesPlatform extends // - FridaModelTargetObject, // - FridaEventsListenerAdapter { - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetSessionContainer.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetSessionContainer.java deleted file mode 100644 index 74ced9322f..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetSessionContainer.java +++ /dev/null @@ -1,36 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface2; - -import agent.frida.manager.FridaCause; -import agent.frida.manager.FridaEventsListenerAdapter; -import agent.frida.manager.FridaSession; - -public interface FridaModelTargetSessionContainer - extends FridaModelTargetObject, FridaEventsListenerAdapter { - - @Override - public void sessionAdded(FridaSession session, FridaCause cause); - - @Override - public void sessionReplaced(FridaSession session, FridaCause cause); - - @Override - public void sessionRemoved(String sessionId, FridaCause cause); - - public FridaModelTargetSession getTargetSession(FridaSession session); - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetStack.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetStack.java deleted file mode 100644 index 11a04f7f74..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetStack.java +++ /dev/null @@ -1,26 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface2; - -import agent.frida.manager.FridaFrame; -import ghidra.dbg.target.TargetStack; - -public interface FridaModelTargetStack - extends FridaModelTargetObject, TargetStack { - - public FridaModelTargetStackFrame getTargetFrame(FridaFrame frame); - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetStackFrame.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetStackFrame.java deleted file mode 100644 index 4938c97b29..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetStackFrame.java +++ /dev/null @@ -1,102 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface2; - -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import agent.frida.manager.FridaEventsListenerAdapter; -import agent.frida.manager.FridaFrame; -import agent.frida.model.iface1.FridaModelSelectableObject; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.TargetStackFrame; -import ghidra.program.model.address.Address; -import ghidra.program.model.address.AddressSpace; - -public interface FridaModelTargetStackFrame extends // - TargetStackFrame, // - FridaEventsListenerAdapter, // - FridaModelSelectableObject { - - public static final String FUNC_ATTRIBUTE_NAME = "function"; - public static final String FILE_ATTRIBUTE_NAME = "file"; - public static final String MODULE_ATTRIBUTE_NAME = "module"; - public static final String LINE_ATTRIBUTE_NAME = "line"; - public static final String FUNC_TABLE_ENTRY_ATTRIBUTE_NAME = "Table Entry"; - public static final String FRAME_OFFSET_ATTRIBUTE_NAME = "Frame Offset"; - public static final String INST_OFFSET_ATTRIBUTE_NAME = "Inst. Offset"; - public static final String RETURN_OFFSET_ATTRIBUTE_NAME = "Return Offset"; - public static final String CALL_FRAME_OFFSET_ATTRIBUTE_NAME = "Call Frame Offset"; - public static final String STACK_OFFSET_ATTRIBUTE_NAME = "Stack Offset"; - public static final String VIRTUAL_ATTRIBUTE_NAME = "Virtual"; - public static final String PARAM0_ATTRIBUTE_NAME = "Param[0]"; - public static final String PARAM1_ATTRIBUTE_NAME = "Param[1]"; - public static final String PARAM2_ATTRIBUTE_NAME = "Param[2]"; - public static final String PARAM3_ATTRIBUTE_NAME = "Param[3]"; - - @Override - public default CompletableFuture setActive() { - return CompletableFuture.completedFuture(null); - } - - @Override - public default CompletableFuture init(Map map) { - AddressSpace space = getModel().getAddressSpace("ram"); - return requestNativeAttributes().thenCompose(attrs -> { - if (attrs == null) { - return CompletableFuture.completedFuture(null); - } - map.putAll(attrs); - FridaModelTargetObject attributes = (FridaModelTargetObject) attrs.get("Attributes"); - if (attributes == null) { - return CompletableFuture.completedFuture(null); - } - return attributes.requestAugmentedAttributes().thenCompose(ax -> { - Map subattrs = attributes.getCachedAttributes(); - if (subattrs == null) { - return CompletableFuture.completedFuture(null); - } - FridaModelTargetObject frameNumber = - (FridaModelTargetObject) subattrs.get("FrameNumber"); - return frameNumber.requestAugmentedAttributes().thenCompose(bx -> { - Object noval = frameNumber.getCachedAttribute(VALUE_ATTRIBUTE_NAME); - String nostr = noval.toString(); - FridaModelTargetObject instructionOffset = - (FridaModelTargetObject) subattrs.get("InstructionOffset"); - return instructionOffset.requestAugmentedAttributes().thenAccept(cx -> { - String oldval = (String) getCachedAttribute(DISPLAY_ATTRIBUTE_NAME); - Object pcval = instructionOffset.getCachedAttribute(VALUE_ATTRIBUTE_NAME); - String pcstr = pcval.toString(); - long pc = Long.parseUnsignedLong(pcstr, 16); - map.put(PC_ATTRIBUTE_NAME, space.getAddress(pc)); - String display = String.format("#%s 0x%s", nostr, pcstr); - map.put(DISPLAY_ATTRIBUTE_NAME, display); - setModified(map, !display.equals(oldval)); - }); - }); - }); - }); - } - - public void setFrame(FridaFrame frame); - - public TargetObject getThread(); - - public Address getPC(); - - public FridaModelTargetProcess getProcess(); - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetStackFrameRegister.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetStackFrameRegister.java deleted file mode 100644 index 78b0067ff9..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetStackFrameRegister.java +++ /dev/null @@ -1,50 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface2; - -import java.math.BigInteger; - -import agent.frida.manager.FridaValue; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetElementType; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; -import ghidra.dbg.util.ConversionUtils; - -@TargetObjectSchemaInfo( - name = "RegisterValueInterface", - elementResync = ResyncMode.ALWAYS, - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(type = Object.class) - }, - canonicalContainer = true) -public interface FridaModelTargetStackFrameRegister extends FridaModelTargetRegister { - - @Override - public int getBitLength(); - - public FridaValue getRegister(); - - public default byte[] getBytes() { - String val = (String) getCachedAttributes().get(VALUE_ATTRIBUTE_NAME); - BigInteger value = new BigInteger(val, 16); - return ConversionUtils.bigIntegerToBytes(16, value); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetStackFrameRegisterBank.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetStackFrameRegisterBank.java deleted file mode 100644 index 3a116773b0..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetStackFrameRegisterBank.java +++ /dev/null @@ -1,40 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface2; - -import agent.frida.manager.FridaValue; -import agent.frida.model.impl.FridaModelTargetRegisterImpl; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetElementType; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; - -@TargetObjectSchemaInfo( - name = "RegisterValueBankInterface", - elementResync = ResyncMode.ALWAYS, - elements = { - @TargetElementType(type = FridaModelTargetRegisterImpl.class) - }, - attributes = { - @TargetAttributeType(type = Object.class) - }, - canonicalContainer = true) -public interface FridaModelTargetStackFrameRegisterBank - extends FridaModelTargetRegisterBank { - - public FridaModelTargetRegister getTargetRegister(FridaValue register); - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetStackFrameRegisterContainer.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetStackFrameRegisterContainer.java deleted file mode 100644 index 873359f4bc..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetStackFrameRegisterContainer.java +++ /dev/null @@ -1,47 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface2; - - -import agent.frida.manager.FridaValue; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; - -@TargetObjectSchemaInfo( - name = "RegisterContainerInterface", - attributeResync = ResyncMode.ALWAYS, - attributes = { - @TargetAttributeType( - name = "General Purpose Registers", - type = FridaModelTargetStackFrameRegisterBank.class, - required = true), - @TargetAttributeType( - name = "Exception State Registers", - type = FridaModelTargetStackFrameRegisterBank.class, - required = true), - @TargetAttributeType( - name = "Floating Point Registers", - type = FridaModelTargetStackFrameRegisterBank.class, - required = true), - @TargetAttributeType(type = Void.class) - }) -public interface FridaModelTargetStackFrameRegisterContainer - extends FridaModelTargetRegisterContainer { - - public FridaModelTargetObject getTargetRegisterBank(FridaValue val); - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetSymbol.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetSymbol.java deleted file mode 100644 index e2f29ae8fb..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetSymbol.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface2; - -import ghidra.dbg.target.TargetSymbol; -import ghidra.program.model.address.Address; - -public interface FridaModelTargetSymbol extends FridaModelTargetObject, TargetSymbol { - - @Override - public boolean isConstant(); - - @Override - public Address getValue(); - - @Override - public long getSize(); -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetSymbolContainer.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetSymbolContainer.java deleted file mode 100644 index 72cac9b03b..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetSymbolContainer.java +++ /dev/null @@ -1,27 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface2; - -import agent.frida.manager.FridaSymbol; -import agent.frida.model.impl.FridaModelTargetSymbolImpl; -import ghidra.dbg.target.TargetSymbolNamespace; - -public interface FridaModelTargetSymbolContainer - extends FridaModelTargetObject, TargetSymbolNamespace { - - public FridaModelTargetSymbolImpl getTargetSymbol(FridaSymbol symbol); - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetThread.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetThread.java deleted file mode 100644 index dd54b7ce66..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetThread.java +++ /dev/null @@ -1,57 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface2; - -import java.util.concurrent.CompletableFuture; - -import agent.frida.manager.*; -import agent.frida.model.iface1.FridaModelSelectableObject; -import agent.frida.model.iface1.FridaModelTargetExecutionStateful; -import agent.frida.model.impl.FridaModelTargetStackImpl; -import ghidra.dbg.target.*; - -public interface FridaModelTargetThread extends // - TargetThread, // - //FridaModelTargetAccessConditioned, // - FridaModelTargetExecutionStateful, // - //FridaModelTargetSteppable, // - FridaStateListener, // - FridaEventsListenerAdapter, // - FridaModelSelectableObject { - - public default FridaThread getThread() { - return (FridaThread) getModelObject(); - } - - public default void threadStateChangedSpecific(FridaState state, FridaReason reason) { - TargetRegisterContainer container = - (TargetRegisterContainer) getCachedAttribute("Registers"); - TargetRegisterBank bank = (TargetRegisterBank) container.getCachedAttribute("User"); - if (state.equals(FridaState.FRIDA_THREAD_STOPPED)) { - bank.readRegistersNamed(getCachedElements().keySet()); - } - } - - @Override - public default CompletableFuture setActive() { - return CompletableFuture.completedFuture(null); - } - - public FridaModelTargetStackImpl getStack(); - - public String getExecutingProcessorType(); - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetThreadContainer.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetThreadContainer.java deleted file mode 100644 index 4f68592ec1..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/iface2/FridaModelTargetThreadContainer.java +++ /dev/null @@ -1,33 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.iface2; - -import agent.frida.manager.*; -import agent.frida.model.iface1.FridaModelTargetEventScope; - -public interface FridaModelTargetThreadContainer extends // - FridaModelTargetEventScope, // - FridaEventsListenerAdapter { - - public FridaModelTargetThread getTargetThread(FridaThread thread); - - public void threadCreated(FridaThread thread, FridaCause cause); - - public void threadReplaced(FridaThread thread, FridaCause cause); - - public void threadExited(FridaThread thread, FridaCause caus); - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelDefaultTargetModelRoot.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelDefaultTargetModelRoot.java deleted file mode 100644 index 541a511cb0..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelDefaultTargetModelRoot.java +++ /dev/null @@ -1,33 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import ghidra.dbg.target.TargetAggregate; -import ghidra.dbg.target.schema.TargetObjectSchema; - -public class FridaModelDefaultTargetModelRoot extends FridaModelTargetObjectImpl - implements TargetAggregate { - - public FridaModelDefaultTargetModelRoot(FridaModelImpl model, String typeHint) { - super(model, null, null, null, typeHint); - } - - public FridaModelDefaultTargetModelRoot(FridaModelImpl model, String typeHint, - TargetObjectSchema schema) { - super(model, null, null, null, typeHint, schema); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelImpl.java deleted file mode 100644 index 0068898b81..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelImpl.java +++ /dev/null @@ -1,185 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.RejectedExecutionException; - -import org.apache.commons.lang3.exception.ExceptionUtils; - -import agent.frida.frida.FridaClient; -import agent.frida.manager.FridaManager; -import agent.frida.manager.impl.FridaManagerImpl; -import agent.frida.model.AbstractFridaModel; -import agent.frida.model.iface2.FridaModelTargetProcess; -import agent.frida.model.iface2.FridaModelTargetSession; -import ghidra.async.AsyncUtils; -import ghidra.dbg.DebuggerModelClosedReason; -import ghidra.dbg.DebuggerObjectModelWithMemory; -import ghidra.dbg.error.DebuggerModelTerminatingException; -import ghidra.dbg.target.TargetMemory; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.AnnotatedSchemaContext; -import ghidra.dbg.target.schema.TargetObjectSchema; -import ghidra.program.model.address.*; - -public class FridaModelImpl extends AbstractFridaModel implements DebuggerObjectModelWithMemory { - // The model must convert to and from Ghidra's address space names - protected static final String SPACE_NAME = "ram"; - - protected static final AnnotatedSchemaContext SCHEMA_CTX = new AnnotatedSchemaContext(); - protected static final TargetObjectSchema ROOT_SCHEMA = - SCHEMA_CTX.getSchemaForClass(FridaModelTargetRootImpl.class); - - // Don't make this static, so each model has a unique "Frida" space - protected final AddressSpace space = - new GenericAddressSpace(SPACE_NAME, 64, AddressSpace.TYPE_RAM, 0); - protected final AddressFactory addressFactory = - new DefaultAddressFactory(new AddressSpace[] { space }); - - protected FridaManager manager; - protected FridaModelTargetSession session; - - protected final FridaModelTargetRootImpl root; - protected final CompletableFuture completedRoot; - - protected Map objectMap = new HashMap<>(); - - public FridaModelImpl() { - this.manager = FridaManager.newInstance(); - this.root = new FridaModelTargetRootImpl(this, ROOT_SCHEMA); - this.completedRoot = CompletableFuture.completedFuture(root); - addModelRoot(root); - } - - @Override - public String getBrief() { - return "FRIDA@" + Integer.toHexString(System.identityHashCode(this)); - } - - @Override - public AddressSpace getAddressSpace(String name) { - if (!SPACE_NAME.equals(name)) { - return null; - } - return space; - } - - @Override - public AddressFactory getAddressFactory() { - return addressFactory; - } - - @Override - public CompletableFuture startFrida(String[] args) { - return manager.start(args).thenApplyAsync(__ -> null, clientExecutor); - } - - @Override - public boolean isRunning() { - return manager.isRunning(); - } - - @Override - public void terminate() throws IOException { - broadcast().modelClosed(DebuggerModelClosedReason.NORMAL); - root.invalidateSubtree(root, "Frida is terminating"); - manager.terminate(); - } - - @Override - public TargetObjectSchema getRootSchema() { - return root.getSchema(); - } - - @Override - public CompletableFuture fetchModelRoot() { - return completedRoot; - } - - @Override - public FridaManagerImpl getManager() { - return (FridaManagerImpl) manager; - } - - @Override - public CompletableFuture close() { - try { - terminate(); - return super.close(); - } - catch (RejectedExecutionException e) { - reportError(this, "Model is already closing", e); - return AsyncUtils.nil(); - } - catch (Throwable t) { - return CompletableFuture.failedFuture(t); - } - } - - @Override - public FridaModelTargetSession getSession() { - return session; - } - - @Override - public TargetMemory getMemory(TargetObject target, Address address, int length) { - if (target instanceof FridaModelTargetProcess) { - FridaModelTargetProcess process = (FridaModelTargetProcess) target; - return new FridaModelTargetMemoryContainerImpl(process); - } - return null; - } - - @Override - public void addModelObject(Object object, TargetObject targetObject) { - if (object == null) { - return; - } - objectMap.put(FridaClient.getModelKey(object), targetObject); - } - - @Override - public TargetObject getModelObject(Object object) { - if (object == null) { - return null; - } - return objectMap.get(FridaClient.getModelKey(object)); - } - - public void deleteModelObject(Object object) { - if (object == null) { - return; - } - objectMap.remove(FridaClient.getModelKey(object)); - } - - @Override - public CompletableFuture gateFuture(CompletableFuture future) { - return super.gateFuture(future).exceptionally(ex -> { - for (Throwable cause = ex; cause != null; cause = cause.getCause()) { - if (cause instanceof RejectedExecutionException) { - throw new DebuggerModelTerminatingException("Frida is terminating", ex); - } - } - return ExceptionUtils.rethrow(ex); - }); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetAvailableDeviceImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetAvailableDeviceImpl.java deleted file mode 100644 index 9fe42d1de9..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetAvailableDeviceImpl.java +++ /dev/null @@ -1,85 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.util.List; -import java.util.Map; - -import agent.frida.model.iface2.FridaModelTargetAvailableDevice; -import agent.frida.model.iface2.FridaModelTargetAvailableDevicesContainer; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.util.PathUtils; - -@TargetObjectSchemaInfo( - name = "AvailableDevice", - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType(type = Void.class) }) -public class FridaModelTargetAvailableDeviceImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetAvailableDevice { - - protected static String keyAttachable(String id) { - return PathUtils.makeKey(id); - } - - protected final String id; - protected final String name; - - public FridaModelTargetAvailableDeviceImpl(FridaModelTargetAvailableDevicesContainer parent, - String id, - String name) { - super(parent.getModel(), parent, keyAttachable(id), name); - this.name = name; - this.id = id; - - this.changeAttributes(List.of(), List.of(), Map.of(// - ID_ATTRIBUTE_NAME, id, // - DISPLAY_ATTRIBUTE_NAME, getDisplay() // - ), "Initialized"); - } - - public FridaModelTargetAvailableDeviceImpl(FridaModelTargetAvailableDevicesContainer parent, - String id) { - super(parent.getModel(), parent, keyAttachable(id), "Attachable"); - this.id = id; - this.name = ""; - - this.changeAttributes(List.of(), List.of(), Map.of(// - ID_ATTRIBUTE_NAME, id, // - DISPLAY_ATTRIBUTE_NAME, keyAttachable(id) // - ), "Initialized"); - } - - @TargetAttributeType(name = ID_ATTRIBUTE_NAME, hidden = true) - @Override - public String getId() { - return id; - } - - @Override - public String getDisplay() { - return "[" + id + "] : " + name.trim(); - } - - @Override - public void setBase(Object value) { - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDisplay()// - ), "Started"); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetAvailableDevicesContainerImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetAvailableDevicesContainerImpl.java deleted file mode 100644 index ec1b81408b..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetAvailableDevicesContainerImpl.java +++ /dev/null @@ -1,102 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import org.apache.commons.lang3.tuple.Pair; - -import agent.frida.model.iface1.FridaModelTargetConfigurable; -import agent.frida.model.iface2.*; -import ghidra.async.AsyncUtils; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.error.DebuggerIllegalArgumentException; -import ghidra.dbg.target.TargetConfigurable; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; -import ghidra.util.datastruct.WeakValueHashMap; - -@TargetObjectSchemaInfo( - name = "AvailableDevicesContainer", - elements = { - @TargetElementType(type = FridaModelTargetAvailableDeviceImpl.class) // - }, - elementResync = ResyncMode.ALWAYS, - attributes = { // - @TargetAttributeType(name = TargetConfigurable.BASE_ATTRIBUTE_NAME, type = Integer.class), // - @TargetAttributeType(type = Void.class) // - }, - canonicalContainer = true) -public class FridaModelTargetAvailableDevicesContainerImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetAvailableDevicesContainer, FridaModelTargetConfigurable { - - protected final Map attachablesById = - new WeakValueHashMap<>(); - - public FridaModelTargetAvailableDevicesContainerImpl(FridaModelTargetRoot root) { - super(root.getModel(), root, "AvailableDevices", "AvailableDevicesContainer"); - this.changeAttributes(List.of(), Map.of(BASE_ATTRIBUTE_NAME, 16), "Initialized"); - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - return getManager().listAvailableDevices().thenAccept(list -> { - List available; - synchronized (this) { - // NOTE: If more details added to entries, should clear attachablesById - available = - list.stream().map(this::getTargetAttachableEx).collect(Collectors.toList()); - } - setElements(available, Map.of(), "Refreshed"); - }); - } - - public synchronized FridaModelTargetAvailableDevice getTargetAttachableEx( - Pair pair) { - return attachablesById.computeIfAbsent(pair.getLeft(), - i -> new FridaModelTargetAvailableDeviceImpl(this, pair.getLeft(), pair.getRight())); - } - - @Override - public synchronized FridaModelTargetAvailableDevice getTargetAttachable(String pid) { - return attachablesById.computeIfAbsent(pid, - i -> new FridaModelTargetAvailableDeviceImpl(this, pid)); - } - - @Override - public CompletableFuture writeConfigurationOption(String key, Object value) { - switch (key) { - case BASE_ATTRIBUTE_NAME: - if (value instanceof Integer) { - this.changeAttributes(List.of(), Map.of(BASE_ATTRIBUTE_NAME, value), - "Modified"); - for (FridaModelTargetAvailableDevice child : attachablesById.values()) { - child.setBase(value); - } - } - else { - throw new DebuggerIllegalArgumentException("Base should be numeric"); - } - default: - } - return AsyncUtils.nil(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetAvailableProcessImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetAvailableProcessImpl.java deleted file mode 100644 index 52c4562ec9..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetAvailableProcessImpl.java +++ /dev/null @@ -1,91 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.util.List; -import java.util.Map; - -import agent.frida.model.iface2.FridaModelTargetAvailableProcess; -import agent.frida.model.iface2.FridaModelTargetAvailableProcessesContainer; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.util.PathUtils; - -@TargetObjectSchemaInfo( - name = "AvailableProcess", - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType(type = Void.class) }) -public class FridaModelTargetAvailableProcessImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetAvailableProcess { - - protected static String keyAttachable(String pid) { - return PathUtils.makeKey(pid); - } - - protected final String pid; - protected final String name; - private Integer base = 10; - - public FridaModelTargetAvailableProcessImpl(FridaModelTargetAvailableProcessesContainer parent, String pid, - String name) { - super(parent.getModel(), parent, keyAttachable(pid), name); - this.name = name; - this.pid = pid; - - this.changeAttributes(List.of(), List.of(), Map.of(// - PID_ATTRIBUTE_NAME, Long.parseLong(pid, 10), // - DISPLAY_ATTRIBUTE_NAME, getDisplay() // - ), "Initialized"); - } - - public FridaModelTargetAvailableProcessImpl(FridaModelTargetAvailableProcessesContainer parent, String pid) { - super(parent.getModel(), parent, keyAttachable(pid), "Attachable"); - this.pid = pid; - this.name = ""; - - this.changeAttributes(List.of(), List.of(), Map.of(// - PID_ATTRIBUTE_NAME, Long.parseLong(pid, 10), // - DISPLAY_ATTRIBUTE_NAME, keyAttachable(pid) // - ), "Initialized"); - } - - @TargetAttributeType(name = PID_ATTRIBUTE_NAME, hidden = true) - @Override - public Long getPid() { - return Long.parseLong(pid); - } - - @Override - public String getDisplay() { - Long p = Long.decode(pid); - String pidstr = ""; - if (base == 16) { - pidstr = "0x" + Long.toHexString(p); - } else { - pidstr = pid; - } - return "[" + pidstr + "] : " + name.trim(); - } - - public void setBase(Object value) { - this.base = (Integer) value; - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDisplay()// - ), "Started"); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetAvailableProcessesContainerImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetAvailableProcessesContainerImpl.java deleted file mode 100644 index d4ac36cef1..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetAvailableProcessesContainerImpl.java +++ /dev/null @@ -1,102 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import org.apache.commons.lang3.tuple.Pair; - -import agent.frida.model.iface1.FridaModelTargetConfigurable; -import agent.frida.model.iface2.*; -import ghidra.async.AsyncUtils; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.error.DebuggerIllegalArgumentException; -import ghidra.dbg.target.TargetConfigurable; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; -import ghidra.util.datastruct.WeakValueHashMap; - -@TargetObjectSchemaInfo( - name = "AvailableProcessesContainer", - elements = { - @TargetElementType(type = FridaModelTargetAvailableProcessImpl.class) // - }, - elementResync = ResyncMode.ALWAYS, - attributes = { // - @TargetAttributeType(name = TargetConfigurable.BASE_ATTRIBUTE_NAME, type = Integer.class), // - @TargetAttributeType(type = Void.class) // - }, - canonicalContainer = true) -public class FridaModelTargetAvailableProcessesContainerImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetAvailableProcessesContainer, FridaModelTargetConfigurable { - - protected final Map attachablesById = - new WeakValueHashMap<>(); - - public FridaModelTargetAvailableProcessesContainerImpl(FridaModelTargetRoot root) { - super(root.getModel(), root, "AvailableProcesses", "AvailableProcessContainer"); - this.changeAttributes(List.of(), Map.of(BASE_ATTRIBUTE_NAME, 16), "Initialized"); - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - return getManager().listAvailableProcesses().thenAccept(list -> { - List available; - synchronized (this) { - // NOTE: If more details added to entries, should clear attachablesById - available = - list.stream().map(this::getTargetAttachableEx).collect(Collectors.toList()); - } - setElements(available, Map.of(), "Refreshed"); - }); - } - - public synchronized FridaModelTargetAvailableProcess getTargetAttachableEx( - Pair pair) { - return attachablesById.computeIfAbsent(pair.getLeft(), - i -> new FridaModelTargetAvailableProcessImpl(this, pair.getLeft(), pair.getRight())); - } - - @Override - public synchronized FridaModelTargetAvailableProcess getTargetAttachable(String pid) { - return attachablesById.computeIfAbsent(pid, - i -> new FridaModelTargetAvailableProcessImpl(this, pid)); - } - - @Override - public CompletableFuture writeConfigurationOption(String key, Object value) { - switch (key) { - case BASE_ATTRIBUTE_NAME: - if (value instanceof Integer) { - this.changeAttributes(List.of(), Map.of(BASE_ATTRIBUTE_NAME, value), - "Modified"); - for (FridaModelTargetAvailableProcess child : attachablesById.values()) { - child.setBase(value); - } - } - else { - throw new DebuggerIllegalArgumentException("Base should be numeric"); - } - default: - } - return AsyncUtils.nil(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetConnectorContainerImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetConnectorContainerImpl.java deleted file mode 100644 index fdbf20e6ad..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetConnectorContainerImpl.java +++ /dev/null @@ -1,106 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.util.List; -import java.util.Map; - -import agent.frida.model.iface2.FridaModelTargetConnector; -import agent.frida.model.iface2.FridaModelTargetRoot; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; - -@TargetObjectSchemaInfo( - name = "ConnectorContainer", - attributes = { - @TargetAttributeType( - name = "Launch process", - type = FridaModelTargetProcessLaunchConnectorImpl.class, - required = true, - fixed = true), - @TargetAttributeType( - name = "Launch process w/ options", - type = FridaModelTargetProcessLaunchWithOptionsConnectorImpl.class, - required = false, - fixed = true), - @TargetAttributeType( - name = "Attach to process by pid", - type = FridaModelTargetProcessAttachByPidConnectorImpl.class, - required = true, - fixed = true), - @TargetAttributeType( - name = "Attach to device by id", - type = FridaModelTargetDeviceAttachByIdConnectorImpl.class, - required = true, - fixed = true), - @TargetAttributeType( - name = "Attach to device by type", - type = FridaModelTargetDeviceAttachByTypeConnectorImpl.class, - required = true, - fixed = true), - @TargetAttributeType(type = Void.class) - }, - canonicalContainer = true) -public class FridaModelTargetConnectorContainerImpl extends FridaModelTargetObjectImpl { - - protected final FridaModelTargetRoot root; - - private FridaModelTargetConnector defaultConnector; - - protected final FridaModelTargetProcessLaunchConnectorImpl processLauncher; - protected final FridaModelTargetProcessLaunchWithOptionsConnectorImpl processLauncherEx; - protected final FridaModelTargetProcessAttachByPidConnectorImpl processAttacherByPid; - protected final FridaModelTargetDeviceAttachByIdConnectorImpl targetAttacherById; - protected final FridaModelTargetDeviceAttachByTypeConnectorImpl targetAttacherByType; - - public FridaModelTargetConnectorContainerImpl(FridaModelTargetRoot root) { - super(root.getModel(), root, "Connectors", "ConnectorsContainer"); - this.root = root; - - this.processLauncher = - new FridaModelTargetProcessLaunchConnectorImpl(this, "Launch process"); - this.processLauncherEx = - new FridaModelTargetProcessLaunchWithOptionsConnectorImpl(this, - "Launch process w/ options"); - this.processAttacherByPid = - new FridaModelTargetProcessAttachByPidConnectorImpl(this, "Attach to process by pid"); - this.targetAttacherById = - new FridaModelTargetDeviceAttachByIdConnectorImpl(this, "Attach to device by id"); - this.targetAttacherByType = - new FridaModelTargetDeviceAttachByTypeConnectorImpl(this, "Attach to device by type"); - this.defaultConnector = processLauncher; - - changeAttributes(List.of(), List.of( // - targetAttacherById, // - targetAttacherByType, // - processAttacherByPid, // - processLauncher, // - processLauncherEx // - ), Map.of( // - DISPLAY_ATTRIBUTE_NAME, "Connectors" // - ), "Initialized"); - } - - public FridaModelTargetConnector getDefaultConnector() { - return defaultConnector; - } - - public void setDefaultConnector(FridaModelTargetConnector defaultConnector) { - this.defaultConnector = defaultConnector; - root.setDefaultConnector(defaultConnector); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetDeviceAttachByIdConnectorImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetDeviceAttachByIdConnectorImpl.java deleted file mode 100644 index 78d242a05f..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetDeviceAttachByIdConnectorImpl.java +++ /dev/null @@ -1,86 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import agent.frida.model.iface2.FridaModelTargetConnector; -import ghidra.async.AsyncUtils; -import ghidra.async.TypeSpec; -import ghidra.dbg.error.DebuggerUserException; -import ghidra.dbg.target.TargetMethod; -import ghidra.dbg.target.TargetMethod.ParameterDescription; -import ghidra.dbg.target.TargetMethod.TargetParameterMap; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "DeviceAttachByIdConnector", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(type = Void.class) - }) -public class FridaModelTargetDeviceAttachByIdConnectorImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetConnector { - - protected final FridaModelTargetConnectorContainerImpl connectors; - protected final TargetParameterMap paramDescs; - - public FridaModelTargetDeviceAttachByIdConnectorImpl( - FridaModelTargetConnectorContainerImpl connectors, - String name) { - super(connectors.getModel(), connectors, name, name); - this.connectors = connectors; - - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDisplay(), // - TargetMethod.PARAMETERS_ATTRIBUTE_NAME, - paramDescs = TargetParameterMap.copyOf(computeParameters()) // - ), "Initialized"); - } - - @Override - public CompletableFuture setActive() { - connectors.setDefaultConnector(this); - return CompletableFuture.completedFuture(null); - } - - protected Map> computeParameters() { - HashMap> map = - new HashMap>(); - ParameterDescription param = ParameterDescription.create(String.class, "Id", true, - "", "Id", "device id"); - map.put("Id", param); - return map; - } - - @Override - public TargetParameterMap getParameters() { - return TargetMethod.getParameters(this); - } - - @Override - public CompletableFuture launch(Map args) { - String idstr = (String) args.get("Id"); - return AsyncUtils.sequence(TypeSpec.VOID).then(seq -> { - getManager().attachDeviceById(idstr).handle(seq::nextIgnore); - }).finish().exceptionally((exc) -> { - throw new DebuggerUserException("Launch failed for " + args); - }); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetDeviceAttachByTypeConnectorImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetDeviceAttachByTypeConnectorImpl.java deleted file mode 100644 index f5fb39633a..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetDeviceAttachByTypeConnectorImpl.java +++ /dev/null @@ -1,93 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import agent.frida.model.iface2.FridaModelTargetConnector; -import ghidra.async.AsyncUtils; -import ghidra.async.TypeSpec; -import ghidra.dbg.error.DebuggerUserException; -import ghidra.dbg.target.TargetMethod; -import ghidra.dbg.target.TargetMethod.ParameterDescription; -import ghidra.dbg.target.TargetMethod.TargetParameterMap; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "DeviceAttachByTypeConnector", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(type = Void.class) - }) -public class FridaModelTargetDeviceAttachByTypeConnectorImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetConnector { - - protected final FridaModelTargetConnectorContainerImpl connectors; - protected final TargetParameterMap paramDescs; - - public FridaModelTargetDeviceAttachByTypeConnectorImpl( - FridaModelTargetConnectorContainerImpl connectors, - String name) { - super(connectors.getModel(), connectors, name, name); - this.connectors = connectors; - - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDisplay(), // - TargetMethod.PARAMETERS_ATTRIBUTE_NAME, - paramDescs = TargetParameterMap.copyOf(computeParameters()) // - ), "Initialized"); - } - - @Override - public CompletableFuture setActive() { - connectors.setDefaultConnector(this); - return CompletableFuture.completedFuture(null); - } - - protected Map> computeParameters() { - HashMap> map = - new HashMap>(); - //ParameterDescription param = ParameterDescription.create(String.class, "Type", true, - // "", "Type", "device type"); - List choices = new ArrayList(); - choices.add("Local"); - choices.add("Remote"); - choices.add("USB"); - - ParameterDescription param = ParameterDescription.choices(String.class, "Type", - choices, "Type", "device type"); - map.put("Type", param); - return map; - } - - @Override - public TargetParameterMap getParameters() { - return TargetMethod.getParameters(this); - } - - @Override - public CompletableFuture launch(Map args) { - String idstr = (String) args.get("Type"); - return AsyncUtils.sequence(TypeSpec.VOID).then(seq -> { - getManager().attachDeviceByType(idstr).handle(seq::nextIgnore); - }).finish().exceptionally((exc) -> { - throw new DebuggerUserException("Launch failed for " + args); - }); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetExportContainerImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetExportContainerImpl.java deleted file mode 100644 index b9c8b80933..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetExportContainerImpl.java +++ /dev/null @@ -1,74 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import agent.frida.manager.FridaExport; -import agent.frida.model.iface2.FridaModelTargetExportContainer; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetElementType; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; - -@TargetObjectSchemaInfo( - name = "ExportContainer", - elements = { - @TargetElementType(type = FridaModelTargetExportImpl.class) }, - elementResync = ResyncMode.ONCE, - attributes = { - @TargetAttributeType(type = Void.class) }, - canonicalContainer = true) -public class FridaModelTargetExportContainerImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetExportContainer { - - protected final FridaModelTargetModuleImpl module; - - public FridaModelTargetExportContainerImpl(FridaModelTargetModuleImpl module) { - super(module.getModel(), module, "Exports", "ExportContainer"); - this.module = module; - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - return getManager().listModuleExports(module.getModule()).thenAccept(byName -> { - List symbols; - synchronized (this) { - symbols = byName.values() - .stream() - .map(this::getTargetExport) - .collect(Collectors.toList()); - } - setElements(symbols, Map.of(), "Refreshed"); - }); - } - - @Override - public synchronized FridaModelTargetExportImpl getTargetExport(FridaExport symbol) { - TargetObject targetObject = getMapObject(symbol); - if (targetObject != null) { - FridaModelTargetExportImpl targetExport = (FridaModelTargetExportImpl) targetObject; - targetExport.setModelObject(symbol); - return targetExport; - } - return new FridaModelTargetExportImpl(this, symbol); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetExportImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetExportImpl.java deleted file mode 100644 index 566bd1b28f..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetExportImpl.java +++ /dev/null @@ -1,101 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.util.List; -import java.util.Map; - -import agent.frida.manager.FridaExport; -import agent.frida.model.iface2.FridaModelTargetExport; -import agent.frida.model.methods.FridaModelTargetFunctionInterceptorImpl; -import agent.frida.model.methods.FridaModelTargetUnloadScriptImpl; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.TargetSymbol; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetElementType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; -import ghidra.dbg.util.PathUtils; -import ghidra.program.model.address.Address; -import ghidra.program.model.address.AddressFormatException; - -@TargetObjectSchemaInfo( - name = "Export", - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType(name = TargetObject.VALUE_ATTRIBUTE_NAME, type = Address.class), - @TargetAttributeType(name = TargetSymbol.SIZE_ATTRIBUTE_NAME, type = long.class), - @TargetAttributeType(name = "Address", type = Address.class), - @TargetAttributeType(name = "Name", type = String.class), - @TargetAttributeType(name = "Type", type = String.class), - @TargetAttributeType(type = Object.class) }) -public class FridaModelTargetExportImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetExport { - protected static String indexExport(FridaExport symbol) { - return symbol.getName(); - } - - protected static String keyExport(FridaExport symbol) { - return PathUtils.makeKey(indexExport(symbol)); - } - - protected final boolean constant; - protected Address value; - protected String name; - private FridaModelTargetFunctionInterceptorImpl intercept; - private FridaModelTargetUnloadScriptImpl unload; - - public FridaModelTargetExportImpl(FridaModelTargetExportContainerImpl exports, - FridaExport export) { - super(exports.getModel(), exports, keyExport(export), export, "Export"); - this.constant = false; - try { - this.value = exports.getModel() - .getAddressSpace("ram") - .getAddress(export.getAddress()); - } catch (AddressFormatException e) { - e.printStackTrace(); - } - this.name = export.getName(); - this.intercept = new FridaModelTargetFunctionInterceptorImpl(this); - this.unload = new FridaModelTargetUnloadScriptImpl(this, intercept.getName()); - - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDescription(0), // - VALUE_ATTRIBUTE_NAME, value, // - "Address", value, // - "Name", export.getName(), // - "Type", export.getType(), // - intercept.getName(), intercept, // - unload.getName(), unload // - ), "Initialized"); - } - - public String getDescription(int level) { - FridaExport symbol = (FridaExport) getModelObject(); - return symbol.getName(); - } - - @Override - public Address getValue() { - return value; - } - - @Override - public String getName() { - return name; - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetFileSpecImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetFileSpecImpl.java deleted file mode 100644 index 8e83a46f9c..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetFileSpecImpl.java +++ /dev/null @@ -1,62 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.util.List; -import java.util.Map; - -import agent.frida.frida.FridaClient; -import agent.frida.manager.FridaFileSpec; -import agent.frida.model.iface2.FridaModelTargetFileSpec; -import agent.frida.model.iface2.FridaModelTargetMemoryRegion; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; -import ghidra.dbg.util.PathUtils; - -@TargetObjectSchemaInfo( - name = "FileSpec", - attributes = { - @TargetAttributeType(type = Object.class) - }, - canonicalContainer = true) -public class FridaModelTargetFileSpecImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetFileSpec { - - protected static String keyFileSpec(FridaFileSpec file) { - return PathUtils.makeKey(FridaClient.getId(file)); - } - - private FridaFileSpec fileSpec; - - public FridaModelTargetFileSpecImpl(FridaModelTargetMemoryRegion region, FridaFileSpec fileSpec) { - super(region.getModel(), region, "File", "FileSpec"); - this.fileSpec = fileSpec; - - if (fileSpec != null) { - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDescription(), // - "Path", fileSpec.getPath(), // - "Offset", fileSpec.getOffset(), // - "Size", fileSpec.getSize() // - ), "Initialized"); - } - } - - public String getDescription() { - return fileSpec.getFilename(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetFunctionImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetFunctionImpl.java deleted file mode 100644 index 878acf9a85..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetFunctionImpl.java +++ /dev/null @@ -1,64 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.util.List; -import java.util.Map; - -import agent.frida.frida.FridaClient; -import agent.frida.manager.FridaFunction; -import agent.frida.model.iface2.FridaModelTargetFunction; -import agent.frida.model.iface2.FridaModelTargetStackFrame; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; -import ghidra.dbg.util.PathUtils; - -@TargetObjectSchemaInfo( - name = "Function", - attributes = { - @TargetAttributeType(type = Object.class) - }, - canonicalContainer = true) -public class FridaModelTargetFunctionImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetFunction { - - protected static String keyFunction(FridaFunction fn) { - return PathUtils.makeKey(FridaClient.getId(fn)); - } - - protected final FridaModelTargetStackFrame frame; - - public FridaModelTargetFunctionImpl(FridaModelTargetStackFrame frame, FridaFunction function) { - super(frame.getModel(), frame, "Function", function, "Function"); - this.frame = frame; - - if (function != null) { - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDescription(0), // - "Module Name", function.getModuleName(), // - "Function Name", function.getFunctionName(), // - "File Name", function.getFileName(), // - "Line Number", function.getLineNumber() // - ), "Initialized"); - } - } - - public String getDescription(int level) { - FridaFunction function = (FridaFunction) getModelObject(); - return function.getFunctionName(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetHeapMemoryContainerImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetHeapMemoryContainerImpl.java deleted file mode 100644 index 6451634487..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetHeapMemoryContainerImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.util.concurrent.CompletableFuture; - -import agent.frida.model.iface2.FridaModelTargetProcess; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; - -@TargetObjectSchemaInfo( - name = "Memory", - elementResync = ResyncMode.ALWAYS, - elements = { - @TargetElementType(type = FridaModelTargetMemoryRegionImpl.class) - }, - attributes = { - @TargetAttributeType(type = Void.class) - }, - canonicalContainer = true) -public class FridaModelTargetHeapMemoryContainerImpl extends FridaModelTargetMemoryContainerImpl { - - public FridaModelTargetHeapMemoryContainerImpl(FridaModelTargetProcess process) { - super(process, "Memory (Heap)"); - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - return getManager().listHeapMemory(process.getProcess()); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetImportContainerImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetImportContainerImpl.java deleted file mode 100644 index bdde165dab..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetImportContainerImpl.java +++ /dev/null @@ -1,74 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import agent.frida.manager.FridaImport; -import agent.frida.model.iface2.FridaModelTargetImportContainer; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetElementType; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; - -@TargetObjectSchemaInfo( - name = "ImportContainer", - elements = { - @TargetElementType(type = FridaModelTargetImportImpl.class) }, - elementResync = ResyncMode.ONCE, - attributes = { - @TargetAttributeType(type = Void.class) }, - canonicalContainer = true) -public class FridaModelTargetImportContainerImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetImportContainer { - - protected final FridaModelTargetModuleImpl module; - - public FridaModelTargetImportContainerImpl(FridaModelTargetModuleImpl module) { - super(module.getModel(), module, "Imports", "ImportContainer"); - this.module = module; - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - return getManager().listModuleImports(module.getModule()).thenAccept(byName -> { - List symbols; - synchronized (this) { - symbols = byName.values() - .stream() - .map(this::getTargetImport) - .collect(Collectors.toList()); - } - setElements(symbols, Map.of(), "Refreshed"); - }); - } - - @Override - public synchronized FridaModelTargetImportImpl getTargetImport(FridaImport symbol) { - TargetObject targetObject = getMapObject(symbol); - if (targetObject != null) { - FridaModelTargetImportImpl targetImport = (FridaModelTargetImportImpl) targetObject; - targetImport.setModelObject(symbol); - return targetImport; - } - return new FridaModelTargetImportImpl(this, symbol); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetImportImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetImportImpl.java deleted file mode 100644 index c5be8eae73..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetImportImpl.java +++ /dev/null @@ -1,113 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.util.List; -import java.util.Map; - -import agent.frida.manager.FridaImport; -import agent.frida.model.iface2.FridaModelTargetImport; -import agent.frida.model.methods.FridaModelTargetFunctionInterceptorImpl; -import agent.frida.model.methods.FridaModelTargetUnloadScriptImpl; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.TargetSymbol; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetElementType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; -import ghidra.dbg.util.PathUtils; -import ghidra.program.model.address.Address; -import ghidra.program.model.address.AddressFormatException; - -@TargetObjectSchemaInfo( - name = "Import", - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType(name = TargetObject.VALUE_ATTRIBUTE_NAME, type = Address.class), - @TargetAttributeType(name = TargetSymbol.SIZE_ATTRIBUTE_NAME, type = long.class), - @TargetAttributeType(name = "Name", type = String.class), - @TargetAttributeType(name = "Address", type = Address.class), - @TargetAttributeType(name = "Type", type = String.class), - @TargetAttributeType(name = "Slot", type = String.class), - @TargetAttributeType(type = Object.class) }) -public class FridaModelTargetImportImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetImport { - protected static String indexImport(FridaImport symbol) { - return symbol.getName(); - } - - protected static String keyImport(FridaImport symbol) { - return PathUtils.makeKey(indexImport(symbol)); - } - - protected final boolean constant; - protected Address value; - protected long size; - protected String name; - private FridaModelTargetFunctionInterceptorImpl intercept; - private FridaModelTargetUnloadScriptImpl unload; - - public FridaModelTargetImportImpl(FridaModelTargetImportContainerImpl imports, - FridaImport imp) { - super(imports.getModel(), imports, keyImport(imp), imp, "Import"); - this.constant = false; - try { - this.value = imports.getModel() - .getAddressSpace("ram") - .getAddress(imp.getAddress()); - } catch (AddressFormatException e) { - e.printStackTrace(); - } - this.name = imp.getName(); - this.intercept = new FridaModelTargetFunctionInterceptorImpl(this); - this.unload = new FridaModelTargetUnloadScriptImpl(this, intercept.getName()); - - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDescription(0), // - VALUE_ATTRIBUTE_NAME, value, // - "Address", value, // - "Name", imp.getName(), // - "Type", imp.getType(), // - "Slot", imp.getSlot(), // - intercept.getName(), intercept, // - unload.getName(), unload // - ), "Initialized"); - } - - public String getDescription(int level) { - FridaImport symbol = (FridaImport) getModelObject(); - return symbol.getName(); - } - - public boolean isConstant() { - return constant; - } - - @Override - public Address getValue() { - return value; - } - - @Override - public long getSize() { - return size; - } - - @Override - public String getName() { - return name; - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetKernelImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetKernelImpl.java deleted file mode 100644 index fcbb78a13b..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetKernelImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.util.List; -import java.util.Map; - -import agent.frida.model.iface2.FridaModelTargetMemoryContainer; -import agent.frida.model.iface2.FridaModelTargetModuleContainer; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; - -@TargetObjectSchemaInfo( - name = "DebugContainer", - attributes = { - @TargetAttributeType( - name = "Modules", - type = FridaModelTargetModuleContainerImpl.class, - required = true, - fixed = true), - @TargetAttributeType( - name = "Memory", - type = FridaModelTargetMemoryContainerImpl.class, - required = true, - fixed = true), - @TargetAttributeType(type = Object.class) - }, - canonicalContainer = true) -public class FridaModelTargetKernelImpl extends FridaModelTargetObjectImpl { - - protected final FridaModelTargetKernelMemoryContainerImpl memory; - protected final FridaModelTargetKernelModuleContainerImpl modules; - - public FridaModelTargetKernelImpl(FridaModelTargetSessionImpl session) { - super(session.getModel(), session, "Kernel", "Kernel"); - - this.memory = new FridaModelTargetKernelMemoryContainerImpl(this); - this.modules = new FridaModelTargetKernelModuleContainerImpl(this); - - changeAttributes(List.of(), List.of( // - memory, - modules // - ), Map.of( - "Base", session.getSession().getAttribute("kbase"), // - "PageSize", session.getSession().getAttribute("kPageSize") // - ), "Initialized"); - } - - public FridaModelTargetMemoryContainer getMemory() { - return memory; - } - - public FridaModelTargetModuleContainer getModules() { - return modules; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetKernelMemoryContainerImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetKernelMemoryContainerImpl.java deleted file mode 100644 index b767269956..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetKernelMemoryContainerImpl.java +++ /dev/null @@ -1,202 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.nio.ByteBuffer; -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import agent.frida.frida.FridaRegionInfo; -import agent.frida.manager.*; -import agent.frida.manager.cmd.FridaReadKernelMemoryCommand; -import agent.frida.manager.cmd.FridaWriteKernelMemoryCommand; -import agent.frida.manager.impl.FridaManagerImpl; -import agent.frida.model.iface2.FridaModelTargetMemoryContainer; -import agent.frida.model.iface2.FridaModelTargetMemoryRegion; -import agent.frida.model.methods.*; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.error.DebuggerMemoryAccessException; -import ghidra.dbg.error.DebuggerModelAccessException; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; -import ghidra.program.model.address.*; -import ghidra.util.Msg; -import ghidra.util.datastruct.WeakValueHashMap; - -@TargetObjectSchemaInfo( - name = "Memory", - elementResync = ResyncMode.ALWAYS, - elements = { - @TargetElementType(type = FridaModelTargetMemoryRegionImpl.class) - }, - attributes = { - @TargetAttributeType(type = Object.class) - }, - canonicalContainer = true) -public class FridaModelTargetKernelMemoryContainerImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetMemoryContainer { - - protected final FridaModelTargetKernelImpl kernel; - protected final FridaModelTargetMemoryScanImpl scan; - protected final FridaModelTargetMemoryProtectImpl prot; - protected final FridaModelTargetMemoryWatchImpl watch; - protected final FridaModelTargetUnloadScriptImpl unload; - - protected final Map memoryRegions = - new WeakValueHashMap<>(); - - public FridaModelTargetKernelMemoryContainerImpl(FridaModelTargetKernelImpl kernel) { - super(kernel.getModel(), kernel, "Memory", "MemoryContainer"); - this.kernel = kernel; - - this.scan = new FridaModelTargetMemoryScanImpl(this, true); - this.prot = new FridaModelTargetMemoryProtectImpl(this, true); - this.watch = new FridaModelTargetMemoryWatchImpl(this); - this.unload = new FridaModelTargetUnloadScriptImpl(this, watch.getName()); - this.changeAttributes(List.of(), List.of(), Map.of( // - scan.getName(), scan, // - prot.getName(), prot, // - watch.getName(), watch, // - unload.getName(), unload // - ), "Initialized"); - - getManager().addEventsListener(this); - requestElements(RefreshBehavior.REFRESH_NEVER); - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - if (refresh.equals(RefreshBehavior.REFRESH_ALWAYS)) { - broadcast().invalidateCacheRequested(this); - } - return getManager().listKernelMemory(); - } - - @Override - public synchronized FridaModelTargetMemoryRegion getTargetMemory(FridaMemoryRegionInfo region) { - TargetObject targetObject = getMapObject(region); - if (targetObject != null) { - FridaModelTargetMemoryRegion targetRegion = (FridaModelTargetMemoryRegion) targetObject; - targetRegion.setModelObject(region); - return targetRegion; - } - return new FridaModelTargetMemoryRegionImpl(this, region); - } - - private byte[] readAssist(Address address, ByteBuffer buf, AddressSetView set) { - if (set == null) { - return new byte[0]; - } - AddressRange range = set.getRangeContaining(address); - if (range == null) { - throw new DebuggerMemoryAccessException("Cannot read at " + address); - } - broadcast().memoryUpdated(getProxy(), address, buf.array()); - return Arrays.copyOf(buf.array(), (int) range.getLength()); - } - - private void writeAssist(Address address, byte[] data) { - broadcast().memoryUpdated(getProxy(), address, data); - } - - @Override - public CompletableFuture readMemory(Address address, int length) { - return model.gateFuture(doReadMemory(address, length)); - } - - protected CompletableFuture doReadMemory(Address address, int length) { - FridaManagerImpl manager = getManager(); - if (manager.isWaiting()) { - throw new DebuggerModelAccessException( - "Cannot process command readMemory while engine is waiting for events"); - } - ByteBuffer buf = ByteBuffer.allocate(length); - if (!manager.isKernelMode() || address.getAddressSpace().getName().equals("ram")) { - return manager - .execute( - new FridaReadKernelMemoryCommand(manager, address, buf, buf.remaining())) - .thenApply(set -> { - return readAssist(address, buf, set); - }); - } - return CompletableFuture.completedFuture(new byte[length]); - } - - @Override - public CompletableFuture writeMemory(Address address, byte[] data) { - return model.gateFuture(doWriteMemory(address, data)); - } - - protected CompletableFuture doWriteMemory(Address address, byte[] data) { - FridaManagerImpl manager = getManager(); - if (manager.isWaiting()) { - throw new DebuggerModelAccessException( - "Cannot process command writeMemory while engine is waiting for events"); - } - ByteBuffer buf = ByteBuffer.wrap(data); - if (!manager.isKernelMode() || address.getAddressSpace().getName().equals("ram")) { - return manager - .execute( - new FridaWriteKernelMemoryCommand(manager, address, buf, buf.remaining())) - .thenAccept(___ -> { - writeAssist(address, data); - }); - } - return CompletableFuture.completedFuture(null); - } - - @Override - public void regionAdded(FridaProcess process, FridaRegionInfo info, int index, - FridaCause cause) { - FridaModelTargetMemoryRegion targetRegion; - FridaMemoryRegionInfo region = info.getRegion(index); - synchronized (this) { - /** - * It's not a good idea to remove "stale" entries. If the entry's already present, it's - * probably because several modules were loaded at once, at it has already had its - * sections loaded. Removing it will cause it to load all module sections again! - */ - //modulesByName.remove(name); - targetRegion = getTargetMemory(region); - } - if (targetRegion == null) { - Msg.error(this, "Region " + region.getRangeAddress() + " not found!"); - return; - } - changeElements(List.of(), List.of(targetRegion), Map.of(), "Added"); - } - - @Override - public void regionReplaced(FridaProcess process, FridaRegionInfo info, int index, - FridaCause cause) { - FridaMemoryRegionInfo region = info.getRegion(index); - changeElements(List.of(), List.of(getTargetMemory(region)), Map.of(), "Replaced"); - FridaModelTargetMemoryRegion targetRegion = getTargetMemory(region); - changeElements(List.of(), List.of(targetRegion), Map.of(), "Replaced"); - } - - @Override - public void regionRemoved(FridaProcess process, FridaRegionInfo info, int index, - FridaCause cause) { - FridaModelTargetMemoryRegion targetRegion = getTargetMemory(info.getRegion(index)); - if (targetRegion != null) { - FridaModelImpl impl = (FridaModelImpl) model; - impl.deleteModelObject(targetRegion.getModelObject()); - } - changeElements(List.of(targetRegion.getName()), List.of(), Map.of(), "Removed"); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetKernelModuleContainerImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetKernelModuleContainerImpl.java deleted file mode 100644 index feebbad837..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetKernelModuleContainerImpl.java +++ /dev/null @@ -1,125 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import agent.frida.frida.FridaModuleInfo; -import agent.frida.manager.*; -import agent.frida.model.iface2.FridaModelTargetModule; -import agent.frida.model.iface2.FridaModelTargetModuleContainer; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.*; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; -import ghidra.util.Msg; - -@TargetObjectSchemaInfo( - name = "ModuleContainer", - elements = { // - @TargetElementType(type = FridaModelTargetModuleImpl.class) // - }, // - elementResync = ResyncMode.ONCE, // - attributes = { // - @TargetAttributeType(type = Object.class) // - }, - canonicalContainer = true) -public class FridaModelTargetKernelModuleContainerImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetModuleContainer { - - protected final FridaModelTargetKernelImpl kernel; - - public FridaModelTargetKernelModuleContainerImpl(FridaModelTargetKernelImpl kernel) { - super(kernel.getModel(), kernel, "Modules", "ModuleContainer"); - this.kernel = kernel; - - getManager().addEventsListener(this); - requestElements(RefreshBehavior.REFRESH_NEVER); - } - - @Override - public void moduleLoaded(FridaProcess proc, FridaModuleInfo info, int index, FridaCause cause) { - FridaModelTargetModule targetModule; - FridaModule module = info.getModule(index); - synchronized (this) { - /** - * It's not a good idea to remove "stale" entries. If the entry's already present, it's - * probably because several modules were loaded at once, at it has already had its - * sections loaded. Removing it will cause it to load all module sections again! - */ - //modulesByName.remove(name); - targetModule = getTargetModule(module); - } - if (targetModule == null) { - Msg.error(this, "Module " + info.getModuleName(index) + " not found!"); - return; - } - changeElements(List.of(), List.of(targetModule), Map.of(), "Loaded"); - } - - @Override - public void moduleReplaced(FridaProcess proc, FridaModuleInfo info, int index, - FridaCause cause) { - FridaModule module = info.getModule(index); - changeElements(List.of(), List.of(getTargetModule(module)), Map.of(), "Replaced"); - FridaModelTargetModule targetModule = getTargetModule(module); - changeElements(List.of(), List.of(targetModule), Map.of(), "Replaced"); - } - - @Override - public void moduleUnloaded(FridaProcess proc, FridaModuleInfo info, int index, - FridaCause cause) { - FridaModelTargetModule targetModule = getTargetModule(info.getModule(index)); - if (targetModule != null) { - FridaModelImpl impl = (FridaModelImpl) model; - impl.deleteModelObject(targetModule.getModule()); - } - changeElements(List.of(info.getModuleName(index)), List.of(), Map.of(), "Unloaded"); - } - - @Override - public boolean supportsSyntheticModules() { - return false; - } - - @Override - public CompletableFuture addSyntheticModule(String name) { - throw new UnsupportedOperationException("frida does not support synthetic modules"); - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - if (refresh.equals(RefreshBehavior.REFRESH_ALWAYS)) { - broadcast().invalidateCacheRequested(this); - } - return getManager().listKernelModules(); - } - - @Override - public FridaModelTargetKernelModuleImpl getTargetModule(FridaModule module) { - TargetObject targetObject = getMapObject(module); - if (targetObject != null) { - FridaModelTargetKernelModuleImpl targetModule = - (FridaModelTargetKernelModuleImpl) targetObject; - targetModule.setModelObject(module); - return targetModule; - } - return new FridaModelTargetKernelModuleImpl(this, (FridaKernelModule) module); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetKernelModuleImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetKernelModuleImpl.java deleted file mode 100644 index 1551dbe5ef..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetKernelModuleImpl.java +++ /dev/null @@ -1,103 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.util.List; -import java.util.Map; - -import agent.frida.frida.FridaClient; -import agent.frida.manager.*; -import agent.frida.model.iface2.FridaModelTargetModule; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.util.PathUtils; -import ghidra.program.model.address.*; - -@TargetObjectSchemaInfo( - name = "Module", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(name = "BaseAddress", type = Address.class), - @TargetAttributeType(name = "ImageName", type = String.class), - //@TargetAttributeType(name = "UUID", type = String.class), - @TargetAttributeType(name = "Len", type = String.class), - @TargetAttributeType(type = Void.class) - }) -public class FridaModelTargetKernelModuleImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetModule { - - protected static String indexModule(FridaModule module) { - return FridaClient.getId(module); - } - - protected static String keyModule(FridaModule module) { - return PathUtils.makeKey(indexModule(module)); - } - - public FridaModelTargetKernelModuleImpl(FridaModelTargetKernelModuleContainerImpl modules, FridaKernelModule module) { - super(modules.getModel(), modules, keyModule(module), module, "Module"); - - AddressSpace space = getModel().getAddressSpace("ram"); - Address address; - changeAttributes(List.of(), List.of(), Map.of( // - //DISPLAY_ATTRIBUTE_NAME, getDescription(0), // - SHORT_DISPLAY_ATTRIBUTE_NAME, module.getName(), // - MODULE_NAME_ATTRIBUTE_NAME, module.getPath(), // - "ImageName", module.getPath() // - //"UUID", module.GetUUIDString() // - ), "Initialized"); - - try { - address = space.getAddress(module.getRangeAddress()); - AddressRangeImpl range = new AddressRangeImpl(address, module.getRangeSize()); - changeAttributes(List.of(), List.of(), Map.of( // - RANGE_ATTRIBUTE_NAME, range, // - "BaseAddress", address, // - "Len", Long.toHexString(module.getRangeSize()) // - ), "Initialized"); - } catch (AddressFormatException | AddressOverflowException e) { - // Nothing - } - - } - - public String getDescription(int level) { - FridaModule module = (FridaModule) getModelObject(); - return module.getName(); - } - - protected Address doGetBase() { - return null; //getModel().getAddressSpace("ram").getAddress(module.getKnownBase()); - } - - @Override - public FridaModule getModule() { - return (FridaModule) getModelObject(); - } - - @Override - public void setRange(AddressRangeImpl range) { - if (range != null) { - changeAttributes(List.of(), List.of(), Map.of( // - RANGE_ATTRIBUTE_NAME, range, // - "BaseAddress", range.getMinAddress(), // - "Len", Long.toHexString(range.getLength()) // - ), "Initialized"); - } - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetMemoryContainerImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetMemoryContainerImpl.java deleted file mode 100644 index 177d6482fc..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetMemoryContainerImpl.java +++ /dev/null @@ -1,221 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.nio.ByteBuffer; -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import agent.frida.frida.FridaRegionInfo; -import agent.frida.manager.*; -import agent.frida.manager.cmd.FridaReadMemoryCommand; -import agent.frida.manager.cmd.FridaWriteMemoryCommand; -import agent.frida.manager.impl.FridaManagerImpl; -import agent.frida.model.iface2.*; -import agent.frida.model.methods.*; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.error.DebuggerMemoryAccessException; -import ghidra.dbg.error.DebuggerModelAccessException; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; -import ghidra.program.model.address.*; -import ghidra.util.Msg; -import ghidra.util.datastruct.WeakValueHashMap; - -@TargetObjectSchemaInfo( - name = "Memory", - elementResync = ResyncMode.ALWAYS, - elements = { - @TargetElementType(type = FridaModelTargetMemoryRegionImpl.class) - }, - attributes = { - @TargetAttributeType(type = Object.class) - }, - canonicalContainer = true) -public class FridaModelTargetMemoryContainerImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetMemoryContainer { - - protected final FridaModelTargetProcess process; - protected final FridaModelTargetMemoryScanImpl scan; - protected final FridaModelTargetMemoryPatchImpl patch; - protected final FridaModelTargetMemoryProtectImpl prot; - protected final FridaModelTargetMemoryWatchImpl watch; - protected final FridaModelTargetUnloadScriptImpl unload; - - protected final Map memoryRegions = - new WeakValueHashMap<>(); - - public FridaModelTargetMemoryContainerImpl(FridaModelTargetProcess process) { - super(process.getModel(), process, "Memory", "MemoryContainer"); - this.process = process; - - this.scan = new FridaModelTargetMemoryScanImpl(this, false); - this.patch = new FridaModelTargetMemoryPatchImpl(this); - this.prot = new FridaModelTargetMemoryProtectImpl(this, false); - this.watch = new FridaModelTargetMemoryWatchImpl(this); - this.unload = new FridaModelTargetUnloadScriptImpl(this, watch.getName()); - this.changeAttributes(List.of(), List.of(), Map.of( // - scan.getName(), scan, // - patch.getName(), patch, // - prot.getName(), prot, // - watch.getName(), watch, // - unload.getName(), unload // - ), "Initialized"); - - getManager().addEventsListener(this); - requestElements(RefreshBehavior.REFRESH_ALWAYS); - } - - public FridaModelTargetMemoryContainerImpl(FridaModelTargetProcess process, String name) { - super(process.getModel(), process, name, "MemoryContainer"); - this.process = process; - - this.scan = new FridaModelTargetMemoryScanImpl(this, false); - this.patch = new FridaModelTargetMemoryPatchImpl(this); - this.prot = new FridaModelTargetMemoryProtectImpl(this, false); - this.watch = new FridaModelTargetMemoryWatchImpl(this); - this.unload = new FridaModelTargetUnloadScriptImpl(this, watch.getName()); - this.changeAttributes(List.of(), List.of(), Map.of( // - scan.getName(), scan, // - patch.getName(), patch, // - prot.getName(), prot, // - watch.getName(), watch, // - unload.getName(), unload // - ), "Initialized"); - - requestElements(RefreshBehavior.REFRESH_NEVER); - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - if (refresh.equals(RefreshBehavior.REFRESH_ALWAYS)) { - broadcast().invalidateCacheRequested(this); - } - return getManager().listMemory(process.getProcess()); - } - - @Override - public synchronized FridaModelTargetMemoryRegion getTargetMemory(FridaMemoryRegionInfo region) { - TargetObject targetObject = getMapObject(region); - if (targetObject != null) { - FridaModelTargetMemoryRegion targetRegion = (FridaModelTargetMemoryRegion) targetObject; - targetRegion.setModelObject(region); - return targetRegion; - } - return new FridaModelTargetMemoryRegionImpl(this, region); - } - - private byte[] readAssist(Address address, ByteBuffer buf, AddressSetView set) { - if (set == null) { - return new byte[0]; - } - AddressRange range = set.getRangeContaining(address); - if (range == null) { - throw new DebuggerMemoryAccessException("Cannot read at " + address); - } - broadcast().memoryUpdated(getProxy(), address, buf.array()); - return Arrays.copyOf(buf.array(), (int) range.getLength()); - } - - private void writeAssist(Address address, byte[] data) { - broadcast().memoryUpdated(getProxy(), address, data); - } - - @Override - public CompletableFuture readMemory(Address address, int length) { - return model.gateFuture(doReadMemory(address, length)); - } - - protected CompletableFuture doReadMemory(Address address, int length) { - FridaManagerImpl manager = getManager(); - if (manager.isWaiting()) { - throw new DebuggerModelAccessException( - "Cannot process command readMemory while engine is waiting for events"); - } - ByteBuffer buf = ByteBuffer.allocate(length); - if (!manager.isKernelMode() || address.getAddressSpace().getName().equals("ram")) { - return manager - .execute(new FridaReadMemoryCommand(manager, address, buf, buf.remaining())) - .thenApply(set -> { - return readAssist(address, buf, set); - }); - } - return CompletableFuture.completedFuture(new byte[length]); - } - - @Override - public CompletableFuture writeMemory(Address address, byte[] data) { - return model.gateFuture(doWriteMemory(address, data)); - } - - protected CompletableFuture doWriteMemory(Address address, byte[] data) { - FridaManagerImpl manager = getManager(); - if (manager.isWaiting()) { - throw new DebuggerModelAccessException( - "Cannot process command writeMemory while engine is waiting for events"); - } - ByteBuffer buf = ByteBuffer.wrap(data); - if (!manager.isKernelMode() || address.getAddressSpace().getName().equals("ram")) { - return manager - .execute(new FridaWriteMemoryCommand(manager, address, buf, buf.remaining())) - .thenAccept(___ -> { - writeAssist(address, data); - }); - } - return CompletableFuture.completedFuture(null); - } - - @Override - public void regionAdded(FridaProcess proc, FridaRegionInfo info, int index, FridaCause cause) { - FridaModelTargetMemoryRegion targetRegion; - FridaMemoryRegionInfo region = info.getRegion(index); - synchronized (this) { - /** - * It's not a good idea to remove "stale" entries. If the entry's already present, it's - * probably because several modules were loaded at once, at it has already had its - * sections loaded. Removing it will cause it to load all module sections again! - */ - //modulesByName.remove(name); - targetRegion = getTargetMemory(region); - } - if (targetRegion == null) { - Msg.error(this, "Region " + region.getRangeAddress() + " not found!"); - return; - } - changeElements(List.of(), List.of(targetRegion), Map.of(), "Added"); - } - - @Override - public void regionReplaced(FridaProcess proc, FridaRegionInfo info, int index, - FridaCause cause) { - FridaMemoryRegionInfo region = info.getRegion(index); - changeElements(List.of(), List.of(getTargetMemory(region)), Map.of(), "Replaced"); - FridaModelTargetMemoryRegion targetRegion = getTargetMemory(region); - changeElements(List.of(), List.of(targetRegion), Map.of(), "Replaced"); - } - - @Override - public void regionRemoved(FridaProcess proc, FridaRegionInfo info, int index, - FridaCause cause) { - FridaModelTargetMemoryRegion targetRegion = getTargetMemory(info.getRegion(index)); - if (targetRegion != null) { - FridaModelImpl impl = (FridaModelImpl) model; - impl.deleteModelObject(targetRegion.getModelObject()); - } - changeElements(List.of(targetRegion.getName()), List.of(), Map.of(), "Removed"); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetMemoryRegionImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetMemoryRegionImpl.java deleted file mode 100644 index da20931675..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetMemoryRegionImpl.java +++ /dev/null @@ -1,136 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.util.List; -import java.util.Map; - -import agent.frida.manager.FridaMemoryRegionInfo; -import agent.frida.model.iface2.FridaModelTargetMemoryContainer; -import agent.frida.model.iface2.FridaModelTargetMemoryRegion; -import ghidra.dbg.target.TargetMemoryRegion; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetElementType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; -import ghidra.dbg.util.PathUtils; -import ghidra.program.model.address.Address; -import ghidra.program.model.address.AddressFormatException; -import ghidra.program.model.address.AddressRange; -import ghidra.program.model.address.AddressRangeImpl; -import ghidra.program.model.address.AddressSpace; - -@TargetObjectSchemaInfo( - name = "MemoryRegion", - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType( - name = TargetMemoryRegion.MEMORY_ATTRIBUTE_NAME, - type = FridaModelTargetMemoryContainerImpl.class), - @TargetAttributeType( - name = "File", - type = FridaModelTargetFileSpecImpl.class), - @TargetAttributeType(name = "RegionBase", type = Address.class), - @TargetAttributeType(name = "RegionEnd", type = Address.class), - @TargetAttributeType(name = "RegionSize", type = String.class), - @TargetAttributeType(name = "Protection", type = String.class), - @TargetAttributeType(type = Object.class) }) -public class FridaModelTargetMemoryRegionImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetMemoryRegion { - - protected static String keySection(FridaMemoryRegionInfo region) { - return PathUtils.makeKey(region.getRangeAddress()); - } - - protected AddressRange range; - protected List protect; - protected List allocProtect; - private boolean isRead; - private boolean isWrite; - private boolean isExec; - private FridaModelTargetFileSpecImpl fileSpec; - - public FridaModelTargetMemoryRegionImpl(FridaModelTargetMemoryContainer memory, - FridaMemoryRegionInfo region) { - super(memory.getModel(), memory, keySection(region), region, "Region"); - - this.isRead = region.isReadable(); - this.isWrite = region.isWritable(); - this.isExec = region.isExecutable(); - this.changeAttributes(List.of(), List.of(), Map.of( // - MEMORY_ATTRIBUTE_NAME, memory, // - READABLE_ATTRIBUTE_NAME, isRead, // - WRITABLE_ATTRIBUTE_NAME, isWrite, // - EXECUTABLE_ATTRIBUTE_NAME, isExec, // - "Protection", region.getProtection() // - ), "Initialized"); - - range = doGetRange(region); - if (range != null) { - this.changeAttributes(List.of(), List.of(), Map.of( // - RANGE_ATTRIBUTE_NAME, range, // - "RegionBase", range.getMinAddress(), // - "RegionEnd", range.getMaxAddress(), // - "RegionSize", Long.toHexString(range.getMaxAddress().subtract(range.getMinAddress()) + 1) // - ), "Initialized"); - } - - if (region.getFileSpec() != null) { - this.fileSpec = new FridaModelTargetFileSpecImpl(this, region.getFileSpec()); - this.changeAttributes(List.of(), List.of(), Map.of( // - "File", fileSpec // - ), "Initialized"); - } - - } - - protected AddressRange doGetRange(FridaMemoryRegionInfo s) { - try { - AddressSpace addressSpace = getModel().getAddressSpace("ram"); - Address min = addressSpace.getAddress(s.getRangeAddress()); - Address max = min.add(s.getRangeSize() - 1); - return max.getOffset() > min.getOffset() ? new AddressRangeImpl(min, max) - : new AddressRangeImpl(min, min); - } catch (AddressFormatException e) { - return null; - } - } - - @Override - public AddressRange getRange() { - return range; - } - - @Override - public boolean isReadable() { - return isRead; - } - - @Override - public boolean isWritable() { - return isWrite; - } - - @Override - public boolean isExecutable() { - return isExec; - } - - public boolean isSame(FridaMemoryRegionInfo section) { - return range.equals(doGetRange(section)); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetModuleContainerImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetModuleContainerImpl.java deleted file mode 100644 index 134f4d3430..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetModuleContainerImpl.java +++ /dev/null @@ -1,142 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import agent.frida.frida.FridaModuleInfo; -import agent.frida.manager.*; -import agent.frida.model.iface2.*; -import agent.frida.model.methods.*; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.*; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; -import ghidra.util.Msg; - -@TargetObjectSchemaInfo( - name = "ModuleContainer", - elements = { // - @TargetElementType(type = FridaModelTargetModuleImpl.class) // - }, // - elementResync = ResyncMode.ONCE, // - attributes = { // - @TargetAttributeType(type = Object.class) // - }, - canonicalContainer = true) -public class FridaModelTargetModuleContainerImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetModuleContainer { - - protected final FridaModelTargetSession targetSession; - protected final FridaSession session; - private FridaModelTargetModuleLoadImpl load; - private FridaModelTargetModuleInitImpl init; - private FridaModelTargetModuleInterceptorImpl intercept; - private FridaModelTargetUnloadScriptImpl unload; - - public FridaModelTargetModuleContainerImpl(FridaModelTargetSession session) { - super(session.getModel(), session, "Modules", "ModuleContainer"); - this.targetSession = session; - this.session = (FridaSession) session.getModelObject(); - - this.load = new FridaModelTargetModuleLoadImpl(this); - this.init = new FridaModelTargetModuleInitImpl(this); - this.intercept = new FridaModelTargetModuleInterceptorImpl(this); - this.unload = new FridaModelTargetUnloadScriptImpl(this, intercept.getName()); - this.changeAttributes(List.of(), List.of( // - load, // - init, // - intercept, // - unload // - ), Map.of( // - ), "Initialized"); - - getManager().addEventsListener(this); - requestElements(RefreshBehavior.REFRESH_ALWAYS); - } - - @Override - public void moduleLoaded(FridaProcess proc, FridaModuleInfo info, int index, FridaCause cause) { - FridaModelTargetModule targetModule; - FridaModule module = info.getModule(index); - synchronized (this) { - /** - * It's not a good idea to remove "stale" entries. If the entry's already present, it's - * probably because several modules were loaded at once, at it has already had its - * sections loaded. Removing it will cause it to load all module sections again! - */ - //modulesByName.remove(name); - targetModule = getTargetModule(module); - } - if (targetModule == null) { - Msg.error(this, "Module " + info.getModuleName(index) + " not found!"); - return; - } - changeElements(List.of(), List.of(targetModule), Map.of(), "Loaded"); - } - - @Override - public void moduleReplaced(FridaProcess proc, FridaModuleInfo info, int index, - FridaCause cause) { - FridaModule module = info.getModule(index); - changeElements(List.of(), List.of(getTargetModule(module)), Map.of(), "Replaced"); - FridaModelTargetModule targetModule = getTargetModule(module); - changeElements(List.of(), List.of(targetModule), Map.of(), "Replaced"); - } - - @Override - public void moduleUnloaded(FridaProcess proc, FridaModuleInfo info, int index, - FridaCause cause) { - FridaModelTargetModule targetModule = getTargetModule(info.getModule(index)); - if (targetModule != null) { - FridaModelImpl impl = (FridaModelImpl) model; - impl.deleteModelObject(targetModule.getModule()); - } - changeElements(List.of(info.getModuleName(index)), List.of(), Map.of(), "Unloaded"); - } - - @Override - public boolean supportsSyntheticModules() { - return false; - } - - @Override - public CompletableFuture addSyntheticModule(String name) { - throw new UnsupportedOperationException("frida does not support synthetic modules"); - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - if (refresh.equals(RefreshBehavior.REFRESH_ALWAYS)) { - broadcast().invalidateCacheRequested(this); - } - return getManager().listModules(session.getProcess()); - } - - @Override - public FridaModelTargetModule getTargetModule(FridaModule module) { - TargetObject targetObject = getMapObject(module); - if (targetObject != null) { - FridaModelTargetModule targetModule = (FridaModelTargetModule) targetObject; - targetModule.setModelObject(module); - return targetModule; - } - return new FridaModelTargetModuleImpl(this, module); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetModuleImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetModuleImpl.java deleted file mode 100644 index 02b7769738..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetModuleImpl.java +++ /dev/null @@ -1,146 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.util.List; -import java.util.Map; - -import agent.frida.frida.FridaClient; -import agent.frida.manager.FridaModule; -import agent.frida.manager.FridaSession; -import agent.frida.model.iface2.FridaModelTargetModule; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.util.PathUtils; -import ghidra.program.model.address.*; - -@TargetObjectSchemaInfo( - name = "Module", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType( - name = "Sections", - type = FridaModelTargetModuleSectionContainerImpl.class, - required = true, - fixed = true), - @TargetAttributeType( - name = "Symbols", - type = FridaModelTargetSymbolContainerImpl.class, - required = true, - fixed = true), - @TargetAttributeType( - name = "Imports", - type = FridaModelTargetImportContainerImpl.class, - required = true, - fixed = true), - @TargetAttributeType( - name = "Exports", - type = FridaModelTargetExportContainerImpl.class, - required = true, - fixed = true), - @TargetAttributeType(name = "BaseAddress", type = Address.class), - @TargetAttributeType(name = "ImageName", type = String.class), - //@TargetAttributeType(name = "UUID", type = String.class), - @TargetAttributeType(name = "Len", type = String.class), - @TargetAttributeType(type = Void.class) - }) -public class FridaModelTargetModuleImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetModule { - - protected static String indexModule(FridaModule module) { - return FridaClient.getId(module); - } - - protected static String keyModule(FridaModule module) { - return PathUtils.makeKey(indexModule(module)); - } - - protected final FridaSession session; - - protected final FridaModelTargetSymbolContainerImpl symbols; - protected final FridaModelTargetImportContainerImpl imports; - protected final FridaModelTargetExportContainerImpl exports; - protected final FridaModelTargetModuleSectionContainerImpl sections; - - public FridaModelTargetModuleImpl(FridaModelTargetModuleContainerImpl modules, FridaModule module) { - super(modules.getModel(), modules, keyModule(module), module, "Module"); - this.session = modules.session; - - this.symbols = new FridaModelTargetSymbolContainerImpl(this); - this.imports = new FridaModelTargetImportContainerImpl(this); - this.exports = new FridaModelTargetExportContainerImpl(this); - this.sections = new FridaModelTargetModuleSectionContainerImpl(this); - - AddressSpace space = getModel().getAddressSpace("ram"); - Address address; - changeAttributes(List.of(), List.of( // - sections, // - symbols, // - imports, // - exports // - ), Map.of( // - //DISPLAY_ATTRIBUTE_NAME, getDescription(0), // - SHORT_DISPLAY_ATTRIBUTE_NAME, module.getName(), // - MODULE_NAME_ATTRIBUTE_NAME, module.getPath(), // - "ImageName", module.getPath() // - //"UUID", module.GetUUIDString() // - ), "Initialized"); - - try { - address = space.getAddress(module.getRangeAddress()); - AddressRangeImpl range = new AddressRangeImpl(address, module.getRangeSize()); - changeAttributes(List.of(), List.of(), Map.of( // - RANGE_ATTRIBUTE_NAME, range, // - "BaseAddress", address, // - "Len", Long.toHexString(module.getRangeSize()) // - ), "Initialized"); - } catch (AddressFormatException | AddressOverflowException e) { - // Nothing - } - - } - - public String getDescription(int level) { - FridaModule module = (FridaModule) getModelObject(); - return module.getName(); - } - - protected Address doGetBase() { - return null; //getModel().getAddressSpace("ram").getAddress(module.getKnownBase()); - } - - @Override - public FridaModule getModule() { - return (FridaModule) getModelObject(); - } - - public FridaSession getSession() { - return session; - } - - @Override - public void setRange(AddressRangeImpl range) { - if (range != null) { - changeAttributes(List.of(), List.of(), Map.of( // - RANGE_ATTRIBUTE_NAME, range, // - "BaseAddress", range.getMinAddress(), // - "Len", Long.toHexString(range.getLength()) // - ), "Initialized"); - } - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetModuleSectionContainerImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetModuleSectionContainerImpl.java deleted file mode 100644 index 1bc27084ac..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetModuleSectionContainerImpl.java +++ /dev/null @@ -1,108 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import agent.frida.manager.FridaModule; -import agent.frida.manager.FridaSection; -import agent.frida.model.iface2.FridaModelTargetModule; -import agent.frida.model.iface2.FridaModelTargetModuleSection; -import agent.frida.model.iface2.FridaModelTargetModuleSectionContainer; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetElementType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; -import ghidra.program.model.address.Address; -import ghidra.program.model.address.AddressRangeImpl; - -@TargetObjectSchemaInfo( - name = "SectionContainer", - elements = { - @TargetElementType(type = FridaModelTargetModuleSectionImpl.class) }, - attributes = { - @TargetAttributeType(type = Void.class) }, - canonicalContainer = true) -public class FridaModelTargetModuleSectionContainerImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetModuleSectionContainer { - - protected final FridaModelTargetModule module; - - public FridaModelTargetModuleSectionContainerImpl(FridaModelTargetModule module) { - super(module.getModel(), module, "Sections", "ModuleSections"); - this.module = module; - requestElements(RefreshBehavior.REFRESH_NEVER); - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - return getManager().listModuleSections(module.getModule()).thenAccept(byStart -> { - List sections; - synchronized (this) { - sections = byStart.values() - .stream() - .map(this::getModuleSection) - .collect(Collectors.toList()); - setElements(sections, "Refreshed"); - updateRange(); - } - }); - } - - protected synchronized FridaModelTargetModuleSection getModuleSection(FridaSection section) { - TargetObject targetObject = getMapObject(section); - if (targetObject != null) { - FridaModelTargetModuleSection targetSection = - (FridaModelTargetModuleSection) targetObject; - targetSection.setModelObject(section); - return targetSection; - } - return new FridaModelTargetModuleSectionImpl(this, section); - } - - public void updateRange() { - Map els = getCachedElements(); - Address min = null; - Address max = null; - for (TargetObject element : els.values()) { - FridaModelTargetModuleSectionImpl section = (FridaModelTargetModuleSectionImpl) element; - Address start = section.getStart(); - if (start.getOffset() > 0) { - if (min == null || min.getOffset() > start.getOffset()) { - min = start; - } - } - Address stop = section.getEnd(); - if (stop.getOffset() > 0) { - if (max == null || max.getOffset() < stop.getOffset()) { - max = stop; - } - } - } - if (min != null & max != null) { - module.setRange(new AddressRangeImpl(min, max)); - } - } - - public FridaModule getModule() { - return module.getModule(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetModuleSectionImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetModuleSectionImpl.java deleted file mode 100644 index 5061e6c47d..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetModuleSectionImpl.java +++ /dev/null @@ -1,99 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.util.List; -import java.util.Map; - -import agent.frida.manager.FridaSection; -import agent.frida.model.iface2.FridaModelTargetModuleSection; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetElementType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; -import ghidra.dbg.util.PathUtils; -import ghidra.program.model.address.Address; -import ghidra.program.model.address.AddressRange; -import ghidra.program.model.address.AddressRangeImpl; -import ghidra.program.model.address.AddressSpace; - -@TargetObjectSchemaInfo( - name = "Section", - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType(type = Object.class) }) -public class FridaModelTargetModuleSectionImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetModuleSection { - - protected static String keySection(FridaSection section) { - return PathUtils.makeKey(section.getRangeAddress()); - } - - protected static final String OBJFILE_ATTRIBUTE_NAME = PREFIX_INVISIBLE + "objfile"; - - protected AddressRange range; - - public FridaModelTargetModuleSectionImpl(FridaModelTargetModuleSectionContainerImpl sections, - FridaSection section) { - super(sections.getModel(), sections, keySection(section), section, "Section"); - - AddressSpace space = getModel().getAddressSpace("ram"); - Address min = space.getAddress(0L); - long lval = Long.decode(section.getRangeAddress()); - if (lval != -1) { - min = space.getAddress(lval); - } - // Ghidra ranges are not inclusive at the end. - long sz = section.getRangeSize().longValue(); - Address max = min.add(sz); - range = new AddressRangeImpl(min, max); - if (range != null) { - changeAttributes(List.of(), List.of(), Map.of( // - RANGE_ATTRIBUTE_NAME, range // - ), "Initialized"); - } - - changeAttributes(List.of(), List.of(), Map.of( // - MODULE_ATTRIBUTE_NAME, sections.getParent(), // - DISPLAY_ATTRIBUTE_NAME, getDescription(2), // - "Address", min, // - "File Offset", section.getFileOffset(), // - "Size", Long.toHexString(sz), // - "Permissions", section.getProtection() // - ), "Initialized"); - } - - public String getDescription(int level) { - FridaSection section = (FridaSection) getModelObject(); - String description = section.getRangeAddress(); - if (level > 0) { - description += " " + section.getProtection(); - } - if (level > 1) { - description += " " + Long.toHexString(section.getFileOffset()); - } - if (level > 2) { - description += " " + section.getFilePath(); - } - return description; - } - - @Override - public AddressRange getRange() { - return range; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetObjectImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetObjectImpl.java deleted file mode 100644 index ada514d632..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetObjectImpl.java +++ /dev/null @@ -1,264 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import agent.frida.frida.FridaClient; -import agent.frida.manager.FridaCause; -import agent.frida.manager.FridaStateListener; -import agent.frida.manager.FridaState; -import agent.frida.model.AbstractFridaModel; -import agent.frida.model.iface1.FridaModelTargetAccessConditioned; -import agent.frida.model.iface1.FridaModelTargetExecutionStateful; -import agent.frida.model.iface2.FridaModelTargetObject; -import agent.frida.model.iface2.FridaModelTargetProcess; -import agent.frida.model.iface2.FridaModelTargetSession; -import agent.frida.model.iface2.FridaModelTargetThread; -import ghidra.dbg.agent.DefaultTargetObject; -import ghidra.dbg.target.TargetAccessConditioned; -import ghidra.dbg.target.TargetExecutionStateful.TargetExecutionState; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.TargetProcess; -import ghidra.dbg.target.TargetThread; -import ghidra.dbg.target.schema.TargetObjectSchema; - -public class FridaModelTargetObjectImpl extends DefaultTargetObject - implements FridaModelTargetObject { - - protected boolean accessible = true; - protected final FridaStateListener accessListener = this::checkExited; - private boolean modified; - - private Object modelObject; - protected Map objectMap = new HashMap<>(); - - public FridaModelTargetObjectImpl(AbstractFridaModel impl, TargetObject parent, String name, - String typeHint) { - super(impl, parent, name, typeHint); - this.setModelObject(((FridaModelTargetObject) parent).getModelObject()); - getManager().addStateListener(accessListener); - } - - public FridaModelTargetObjectImpl(AbstractFridaModel impl, TargetObject parent, String name, - Object modelObject, - String typeHint) { - super(impl, parent, name, typeHint); - //((FridaModelTargetObject) parent).addMapObject(modelObject, this); - this.setModelObject(modelObject); - getManager().addStateListener(accessListener); - } - - public FridaModelTargetObjectImpl(AbstractFridaModel impl, TargetObject parent, String name, - Object modelObject, - String typeHint, TargetObjectSchema schema) { - super(impl, parent, name, typeHint, schema); - this.setModelObject(modelObject); - getManager().addStateListener(accessListener); - } - - public void setAttribute(String key, String value) { - changeAttributes(List.of(), List.of(), Map.of( // - key, value), "Initialized"); - } - - @Override - protected void doInvalidate(TargetObject branch, String reason) { - super.doInvalidate(branch, reason); - getManager().removeStateListener(accessListener); - } - - public void setAccessible(boolean accessible) { - synchronized (attributes) { - if (this.accessible == accessible) { - return; - } - this.accessible = accessible; - } - if (this instanceof FridaModelTargetAccessConditioned) { - changeAttributes(List.of(), List.of(), Map.of( // - TargetAccessConditioned.ACCESSIBLE_ATTRIBUTE_NAME, accessible // - ), "Accessibility changed"); - } - } - - @Override - public AbstractFridaModel getModel() { - return (AbstractFridaModel) model; - } - - public void onRunning() { - setAccessible(false); - } - - public void onStopped() { - setAccessible(true); - } - - public void onExit() { - setAccessible(true); - } - - protected void checkExited(FridaState state, FridaCause cause) { - TargetExecutionState exec = TargetExecutionState.INACTIVE; - switch (state) { - case FRIDA_THREAD_WAITING: - { - exec = TargetExecutionState.INACTIVE; - break; - } - case FRIDA_THREAD_UNINTERRUPTIBLE: - { - exec = TargetExecutionState.ALIVE; - break; - } - case FRIDA_THREAD_STOPPED: { - exec = TargetExecutionState.STOPPED; - onStopped(); - break; - } - case FRIDA_THREAD_RUNNING: - { - exec = TargetExecutionState.RUNNING; - resetModified(); - onRunning(); - break; - } - case FRIDA_THREAD_HALTED: { - exec = TargetExecutionState.TERMINATED; - if (getParentProcess() != null || this instanceof TargetProcess) { - getManager().removeStateListener(accessListener); - } - onExit(); - break; - } - } - if (this instanceof FridaModelTargetExecutionStateful) { - FridaModelTargetExecutionStateful stateful = (FridaModelTargetExecutionStateful) this; - stateful.setExecutionState(exec, "Refreshed"); - } - } - - @Override - public CompletableFuture> requestNativeAttributes() { - throw new AssertionError(); // shouldn't ever be here - } - - @Override - public CompletableFuture> requestNativeElements() { - throw new AssertionError(); // shouldn't ever be here - } - - @Override - public FridaModelTargetSession getParentSession() { - FridaModelTargetObject test = (FridaModelTargetObject) parent; - while (test != null && !(test instanceof FridaModelTargetSession)) { - test = (FridaModelTargetObject) test.getParent(); - } - return test == null ? null : (FridaModelTargetSession) test; - } - - @Override - public FridaModelTargetProcess getParentProcess() { - FridaModelTargetObject test = (FridaModelTargetObject) parent; - while (test != null && !(test instanceof TargetProcess)) { - test = (FridaModelTargetObject) test.getParent(); - } - return test == null ? null : (FridaModelTargetProcess) test; - } - - @Override - public FridaModelTargetThread getParentThread() { - FridaModelTargetObject test = (FridaModelTargetObject) parent; - while (test != null && !(test instanceof TargetThread)) { - test = (FridaModelTargetObject) test.getParent(); - } - return test == null ? null : (FridaModelTargetThread) test; - } - - @Override - public void setModified(Map map, boolean b) { - if (modified) { - map.put(MODIFIED_ATTRIBUTE_NAME, modified); - } - } - - @Override - public void setModified(boolean modified) { - if (modified) { - changeAttributes(List.of(), List.of(), Map.of( // - MODIFIED_ATTRIBUTE_NAME, modified // - ), "Refreshed"); - } - } - - @Override - public void resetModified() { - changeAttributes(List.of(), List.of(), Map.of( // - MODIFIED_ATTRIBUTE_NAME, false // - ), "Refreshed"); - } - - public TargetObject searchForSuitable(Class type) { - List pathToClass = model.getRootSchema().searchForSuitable(type, path); - return model.getModelObject(pathToClass); - } - - public String getDescription(int level) { - return getName(); - } - - @Override - public Object getModelObject() { - return modelObject; - } - - @Override - public void setModelObject(Object modelObject) { - if (modelObject != null) { - ((FridaModelTargetObject) parent).addMapObject(modelObject, this); - } - this.modelObject = modelObject; - } - - @Override - public void addMapObject(Object object, TargetObject targetObject) { - if (object == null) { - return; - } - objectMap.put(FridaClient.getModelKey(object), targetObject); - } - - @Override - public TargetObject getMapObject(Object object) { - if (object == null) { - return null; - } - return objectMap.get(FridaClient.getModelKey(object)); - } - - @Override - public void deleteMapObject(Object object) { - if (object == null) { - return; - } - objectMap.remove(FridaClient.getModelKey(object)); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetProcessAttachByPidConnectorImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetProcessAttachByPidConnectorImpl.java deleted file mode 100644 index e791468e23..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetProcessAttachByPidConnectorImpl.java +++ /dev/null @@ -1,86 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import agent.frida.model.iface2.FridaModelTargetConnector; -import ghidra.async.AsyncUtils; -import ghidra.async.TypeSpec; -import ghidra.dbg.error.DebuggerUserException; -import ghidra.dbg.target.TargetMethod; -import ghidra.dbg.target.TargetMethod.ParameterDescription; -import ghidra.dbg.target.TargetMethod.TargetParameterMap; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "ProcessAttachByPidConnector", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(type = Void.class) - }) -public class FridaModelTargetProcessAttachByPidConnectorImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetConnector { - - protected final FridaModelTargetConnectorContainerImpl connectors; - protected final TargetParameterMap paramDescs; - - public FridaModelTargetProcessAttachByPidConnectorImpl( - FridaModelTargetConnectorContainerImpl connectors, - String name) { - super(connectors.getModel(), connectors, name, name); - this.connectors = connectors; - - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDisplay(), // - TargetMethod.PARAMETERS_ATTRIBUTE_NAME, - paramDescs = TargetParameterMap.copyOf(computeParameters()) // - ), "Initialized"); - } - - @Override - public CompletableFuture setActive() { - connectors.setDefaultConnector(this); - return CompletableFuture.completedFuture(null); - } - - protected Map> computeParameters() { - HashMap> map = - new HashMap>(); - ParameterDescription param = ParameterDescription.create(String.class, "Pid", true, - "", "Pid", "process id for the target process"); - map.put("Pid", param); - return map; - } - - @Override - public TargetParameterMap getParameters() { - return TargetMethod.getParameters(this); - } - - @Override - public CompletableFuture launch(Map args) { - String pidstr = (String) args.get("Pid"); - return AsyncUtils.sequence(TypeSpec.VOID).then(seq -> { - getManager().attach(pidstr).handle(seq::nextIgnore); - }).finish().exceptionally((exc) -> { - throw new DebuggerUserException("Launch failed for " + args); - }); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetProcessContainerImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetProcessContainerImpl.java deleted file mode 100644 index 1a8a13247b..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetProcessContainerImpl.java +++ /dev/null @@ -1,150 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import agent.frida.frida.*; -import agent.frida.manager.*; -import agent.frida.model.iface1.FridaModelTargetConfigurable; -import agent.frida.model.iface2.*; -import ghidra.async.AsyncUtils; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.error.DebuggerIllegalArgumentException; -import ghidra.dbg.target.TargetConfigurable; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "ProcessContainer", - elements = { // - @TargetElementType(type = FridaModelTargetProcessImpl.class) // - }, - attributes = { // - @TargetAttributeType(name = TargetConfigurable.BASE_ATTRIBUTE_NAME, type = Integer.class), // - @TargetAttributeType(type = Void.class) // - }, - canonicalContainer = true) -public class FridaModelTargetProcessContainerImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetProcessContainer, FridaModelTargetConfigurable { - - private FridaModelTargetSessionImpl session; - - public FridaModelTargetProcessContainerImpl(FridaModelTargetSessionImpl session) { - super(session.getModel(), session, "Processes", "ProcessContainer"); - this.session = session; - this.changeAttributes(List.of(), Map.of(BASE_ATTRIBUTE_NAME, 16), "Initialized"); - - getManager().addEventsListener(this); - } - - @Override - public void processAdded(FridaProcess proc, FridaCause cause) { - FridaSession parentSession = (FridaSession) session.getModelObject(); - FridaSession procSession = proc.getSession(); - if (!FridaClient.getId(parentSession).equals(FridaClient.getId(procSession))) { - return; - } - session.setAccessible(true); - FridaModelTargetProcess process = getTargetProcess(proc); - changeElements(List.of(), List.of(process), Map.of(), "Added"); - process.processStarted(proc); - broadcast().event(getProxy(), null, TargetEventType.PROCESS_CREATED, - "Process " + FridaClient.getId(proc) + " started " + process.getName(), - List.of(process)); - } - - @Override - public void processReplaced(FridaProcess proc, FridaCause cause) { - session.setAccessible(true); - FridaModelTargetProcess process = getTargetProcess(proc); - changeElements(List.of(), List.of(process), Map.of(), "Added"); - } - - @Override - public void processStarted(FridaProcess proc, FridaCause cause) { - FridaModelTargetProcess process = getTargetProcess(proc); - process.processStarted(proc); - } - - @Override - public void processRemoved(String processId, FridaCause cause) { - changeElements(List.of( // - processId // - ), List.of(), Map.of(), "Removed"); - } - - /* - @Override - public void threadStateChanged(FridaThread thread, FridaState state, FridaCause cause, - FridaReason reason) { - FridaModelTargetProcess process = getTargetProcess(thread.getProcess()); - process.threadStateChanged(thread, state, cause, reason); - } - */ - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - return getManager().listProcesses(session.getSession()).thenAccept(byIID -> { - List processes; - synchronized (this) { - processes = byIID.values() - .stream() - .map(this::getTargetProcess) - .collect(Collectors.toList()); - } - setElements(processes, Map.of(), "Refreshed"); - }); - } - - @Override - public synchronized FridaModelTargetProcess getTargetProcess(FridaProcess process) { - TargetObject targetObject = getMapObject(process); - if (targetObject != null) { - FridaModelTargetProcess targetProcess = (FridaModelTargetProcess) targetObject; - targetProcess.setModelObject(process); - return targetProcess; - } - return new FridaModelTargetProcessImpl(this, process); - } - - @Override - public CompletableFuture writeConfigurationOption(String key, Object value) { - switch (key) { - case BASE_ATTRIBUTE_NAME: - if (value instanceof Integer) { - this.changeAttributes(List.of(), Map.of(BASE_ATTRIBUTE_NAME, value), - "Modified"); - for (TargetObject child : getCachedElements().values()) { - if (child instanceof FridaModelTargetProcessImpl) { - FridaModelTargetProcessImpl targetProcess = - (FridaModelTargetProcessImpl) child; - targetProcess.setBase(value); - } - } - } - else { - throw new DebuggerIllegalArgumentException("Base should be numeric"); - } - default: - } - return AsyncUtils.nil(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetProcessImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetProcessImpl.java deleted file mode 100644 index 67487c2db3..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetProcessImpl.java +++ /dev/null @@ -1,272 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import agent.frida.frida.FridaClient; -import agent.frida.manager.*; -import agent.frida.manager.cmd.*; -import agent.frida.model.iface1.FridaModelTargetFocusScope; -import agent.frida.model.iface2.*; -import ghidra.async.AsyncUtils; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetEventScope.TargetEventType; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; -import ghidra.dbg.util.PathUtils; - -@TargetObjectSchemaInfo( - name = "Process", - attributeResync = ResyncMode.ALWAYS, - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType( - name = "Memory", - type = FridaModelTargetMemoryContainerImpl.class, - required = true, - fixed = true), - @TargetAttributeType( - name = "Memory (Heap)", - type = FridaModelTargetMemoryContainerImpl.class, - required = false, - fixed = true), - @TargetAttributeType( - name = "Threads", - type = FridaModelTargetThreadContainerImpl.class, - required = true, - fixed = true), - @TargetAttributeType( - name = FridaModelTargetProcessImpl.EXIT_CODE_ATTRIBUTE_NAME, - type = String.class), - @TargetAttributeType(type = Void.class) }) -public class FridaModelTargetProcessImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetProcess { - - public static final String PID_ATTRIBUTE_NAME = PREFIX_INVISIBLE + "pid"; - public static final String EXIT_CODE_ATTRIBUTE_NAME = PREFIX_INVISIBLE + "exit_code"; - - public static final TargetAttachKindSet SUPPORTED_KINDS = TargetAttachKindSet.of( // - TargetAttachKind.BY_OBJECT_REF, TargetAttachKind.BY_ID); - - protected static String indexProcess(FridaProcess process) { - return FridaClient.getId(process); - } - - protected static String keyProcess(FridaProcess process) { - return PathUtils.makeKey(indexProcess(process)); - } - - protected final FridaModelTargetMemoryContainerImpl memory; - protected final FridaModelTargetHeapMemoryContainerImpl heap; - protected final FridaModelTargetThreadContainerImpl threads; - - private Integer base = 10; - - public FridaModelTargetProcessImpl(FridaModelTargetProcessContainer processes, - FridaProcess process) { - super(processes.getModel(), processes, keyProcess(process), process, "Process"); - getModel().addModelObject(process, this); - - this.memory = new FridaModelTargetMemoryContainerImpl(this); - this.heap = new FridaModelTargetHeapMemoryContainerImpl(this); - this.threads = new FridaModelTargetThreadContainerImpl(this); - TargetExecutionState state = FridaClient.convertState(getManager().getState()); - - changeAttributes(List.of(), List.of( // - memory, // - heap, // - threads // - ), Map.of( // - //ACCESSIBLE_ATTRIBUTE_NAME, accessible = false, // - DISPLAY_ATTRIBUTE_NAME, getDisplay(), // - TargetMethod.PARAMETERS_ATTRIBUTE_NAME, PARAMETERS, // - STATE_ATTRIBUTE_NAME, state, // - SUPPORTED_ATTACH_KINDS_ATTRIBUTE_NAME, SUPPORTED_KINDS // - //SUPPORTED_STEP_KINDS_ATTRIBUTE_NAME, FridaModelTargetThreadImpl.SUPPORTED_KINDS // - ), "Initialized"); - setExecutionState(state, "Initialized"); - - getManager().addEventsListener(this); - } - - @Override - public void setModelObject(Object modelObject) { - super.setModelObject(modelObject); - getModel().addModelObject(modelObject, this); - } - - @Override - public String getDescription(int level) { - FridaProcess process = (FridaProcess) getModelObject(); - return process.getDescription(); - } - - @Override - public String getDisplay() { - String pidstr = FridaClient.getId(getProcess()); - if (base == 16) { - pidstr = "0x" + pidstr; - } - else { - pidstr = Long.toString(Long.parseLong(pidstr, 16)); - } - return "[" + pidstr + "]"; - } - - @Override - public void processSelected(FridaProcess eventProcess, FridaCause cause) { - if (eventProcess.getPID().equals(getProcess().getPID())) { - ((FridaModelTargetFocusScope) searchForSuitable(TargetFocusScope.class)).setFocus(this); - } - } - - @Override - public void threadStateChanged(FridaThread thread, FridaState state, FridaCause cause, - FridaReason reason) { - TargetExecutionState targetState = FridaClient.convertState(state); - setExecutionState(targetState, "ThreadStateChanged"); - // NB: Asking for threads on 32-bit Android targets will kill the server right now - /* - if (state.equals(FridaState.FRIDA_THREAD_STOPPED)) { - threads.requestElements(true); - } - */ - } - - @Override - public CompletableFuture launch(List args) { - model.gateFuture(getManager().execute(new FridaLaunchProcessCommand(getManager(), - getProcess().getName(), args))); - return AsyncUtils.nil(); - } - - @Override - public CompletableFuture resume() { - return model.gateFuture( - getManager().execute(new FridaContinueCommand(getManager(), getProcess()))); - } - - @Override - public CompletableFuture kill() { - return model.gateFuture(getManager().execute(new FridaKillCommand(getManager()))); - } - - @Override - public CompletableFuture destroy() { - return model.gateFuture(getManager().execute(new FridaDestroyCommand(getManager()))); - } - - @Override - public CompletableFuture attach(TargetAttachable attachable) { - getModel().assertMine(TargetObject.class, attachable); - // NOTE: Get the object and type check it myself. - // The typed ref could have been unsafely cast - FridaProcess proc = (FridaProcess) getModelObject(); - long pid = proc.getPID().longValue(); - return model.gateFuture( - getManager().execute(new FridaAttachCommand(getManager(), Long.toString(pid))) - .thenApply(__ -> null)); - } - - @Override - public CompletableFuture attach(long pid) { - return model.gateFuture( - getManager().execute(new FridaAttachCommand(getManager(), Long.toString(pid))) - .thenApply(__ -> null)); - } - - @Override - public CompletableFuture detach() { - return model.gateFuture( - getManager().execute(new FridaDetachCommand(getManager(), getProcess().getSession()))); - } - - @Override - public CompletableFuture delete() { - return AsyncUtils.nil(); - //return model.gateFuture(process.remove()); - } - - /* - @Override - public CompletableFuture step(TargetStepKind kind) { - return getManager().execute(new FridaStepCommand(getManager(), null, kind, null)); - } - - @Override - public CompletableFuture step(Map args) { - return getManager().execute(new FridaStepCommand(getManager(), null, null, args)); - } - */ - - @Override - public void processStarted(FridaProcess proc) { - if (proc != null) { - changeAttributes(List.of(), List.of(), Map.of( // - PID_ATTRIBUTE_NAME, getProcess().getPID().longValue(), // - DISPLAY_ATTRIBUTE_NAME, getDisplay(), // - STATE_ATTRIBUTE_NAME, TargetExecutionState.STOPPED // - ), "Started"); - } - setExecutionState(TargetExecutionState.STOPPED, "Started"); - } - - @Override - public void processExited(FridaProcess proc, FridaCause cause) { - if (proc.getPID().equals(this.getProcess().getPID())) { - String exitDesc = "NONE"; - changeAttributes(List.of(), List.of(), Map.of( // - STATE_ATTRIBUTE_NAME, TargetExecutionState.TERMINATED, // - EXIT_CODE_ATTRIBUTE_NAME, exitDesc // - ), "Exited"); - broadcast().event(getProxy(), null, TargetEventType.PROCESS_EXITED, - "Process " + FridaClient.getId(getProcess()) + " exited code=" + exitDesc, - List.of(getProxy())); - } - } - - @Override - public CompletableFuture setActive() { - return CompletableFuture.completedFuture(null); - } - - @Override - public FridaModelTargetThreadContainer getThreads() { - return threads; - } - - @Override - public FridaModelTargetMemoryContainer getMemory() { - return memory; - } - - @Override - public FridaProcess getProcess() { - return (FridaProcess) getModelObject(); - } - - public void setBase(Object value) { - this.base = (Integer) value; - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDisplay()// - ), "Started"); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetProcessLaunchConnectorImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetProcessLaunchConnectorImpl.java deleted file mode 100644 index 2da3dad8f8..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetProcessLaunchConnectorImpl.java +++ /dev/null @@ -1,97 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import agent.frida.model.iface2.FridaModelTargetConnector; -import ghidra.async.AsyncUtils; -import ghidra.async.TypeSpec; -import ghidra.dbg.error.DebuggerUserException; -import ghidra.dbg.target.TargetMethod; -import ghidra.dbg.target.TargetMethod.ParameterDescription; -import ghidra.dbg.target.TargetMethod.TargetParameterMap; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetElementType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; - -@TargetObjectSchemaInfo( - name = "ProcessLaunchConnector", - elements = { // - @TargetElementType(type = Void.class) // - }, - attributes = { // - @TargetAttributeType(type = Void.class) // - }) -public class FridaModelTargetProcessLaunchConnectorImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetConnector { - - protected final FridaModelTargetConnectorContainerImpl connectors; - protected final TargetParameterMap paramDescs; - - public FridaModelTargetProcessLaunchConnectorImpl( - FridaModelTargetConnectorContainerImpl connectors, - String name) { - super(connectors.getModel(), connectors, name, name); - this.connectors = connectors; - - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDisplay(), // - TargetMethod.PARAMETERS_ATTRIBUTE_NAME, - paramDescs = TargetParameterMap.copyOf(computeParameters()) // - ), "Initialized"); - } - - @Override - public CompletableFuture setActive() { - connectors.setDefaultConnector(this); - return CompletableFuture.completedFuture(null); - } - - protected Map> computeParameters() { - HashMap> map = - new HashMap>(); - ParameterDescription param = ParameterDescription.create(String.class, "args", true, - "", "Command Line", "space-separated command-line arguments"); - map.put("args", param); - return map; - } - - @Override - public TargetParameterMap getParameters() { - return TargetMethod.getParameters(this); - } - - @Override - public CompletableFuture launch(Map args) { - return launch( - CmdLineParser.tokenize(TargetCmdLineLauncher.PARAMETER_CMDLINE_ARGS.get(args))); - } - - public CompletableFuture launch(List args) { - String fileName = args.get(0); - List nargs = new ArrayList<>(); - for (int i = 1; i < args.size(); i++) { - nargs.add(args.get(i)); - } - return AsyncUtils.sequence(TypeSpec.VOID).then(seq -> { - getManager().launch(fileName, nargs).handle(seq::nextIgnore); - }).finish().exceptionally((exc) -> { - throw new DebuggerUserException("Launch failed for " + args); - }); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetProcessLaunchWithOptionsConnectorImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetProcessLaunchWithOptionsConnectorImpl.java deleted file mode 100644 index e5b9518574..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetProcessLaunchWithOptionsConnectorImpl.java +++ /dev/null @@ -1,160 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import agent.frida.model.iface2.FridaModelTargetConnector; -import ghidra.async.AsyncUtils; -import ghidra.async.TypeSpec; -import ghidra.dbg.error.DebuggerUserException; -import ghidra.dbg.target.TargetMethod; -import ghidra.dbg.target.TargetMethod.ParameterDescription; -import ghidra.dbg.target.TargetMethod.TargetParameterMap; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "ProcessLaunchWithOptionsConnector", - elements = { // - @TargetElementType(type = Void.class) // - }, - attributes = { // - @TargetAttributeType(type = Void.class) // - }) -public class FridaModelTargetProcessLaunchWithOptionsConnectorImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetConnector { - - protected final FridaModelTargetConnectorContainerImpl connectors; - protected final TargetParameterMap paramDescs; - - public FridaModelTargetProcessLaunchWithOptionsConnectorImpl( - FridaModelTargetConnectorContainerImpl connectors, - String name) { - super(connectors.getModel(), connectors, name, name); - this.connectors = connectors; - - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDisplay(), // - TargetMethod.PARAMETERS_ATTRIBUTE_NAME, - paramDescs = TargetParameterMap.copyOf(computeParameters()) // - ), "Initialized"); - } - - @Override - public CompletableFuture setActive() { - connectors.setDefaultConnector(this); - return CompletableFuture.completedFuture(null); - } - - protected Map> computeParameters() { - HashMap> map = - new LinkedHashMap>(); - ParameterDescription p0 = ParameterDescription.create(String.class, "File", true, - "", "File", "executable to be launched"); - map.put("File", p0); - ParameterDescription p1 = ParameterDescription.create(String.class, "Args", false, - "", "Args", "command-line arguments"); - map.put("Args", p1); - ParameterDescription p2 = ParameterDescription.create(String.class, "Env", false, - "", "Env", "environment arguments"); - map.put("Env", p2); - ParameterDescription p3 = ParameterDescription.create(String.class, "STDIN", false, - "", "STDIN", "path for STDIN"); - map.put("STDIN", p3); - ParameterDescription p4 = ParameterDescription.create(String.class, "STDOUT", false, - "", "STDOUT", "path for STDOUT"); - map.put("STDOUT", p4); - ParameterDescription p5 = ParameterDescription.create(String.class, "STDERR", false, - "", "STDERR", "path for STDERR"); - map.put("STDERR", p5); - ParameterDescription p6 = ParameterDescription.create(String.class, "Dir", false, - "", "Dir", "working directory"); - map.put("Dir", p6); - - ParameterDescription pF0 = ParameterDescription.create(Boolean.class, "Exec", - false, - false, "Exec", "exec when launching and turn the calling process into a new process"); - map.put("Exec", pF0); - ParameterDescription pF1 = - ParameterDescription.create(Boolean.class, "BreakOnLaunch", false, - true, "Break on launch", - "stop as soon as the process launches to allow the process to be debugged"); - map.put("BreakOnLaunch", pF1); - ParameterDescription pF2 = ParameterDescription.create(Boolean.class, - "BreakOnEntry", false, - true, "Break on entry", "stop at the program entry point instead of auto-continuing"); - map.put("BreakOnEntry", pF2); - ParameterDescription pF3 = - ParameterDescription.create(Boolean.class, "ASLR", false, - false, "Disable ASLR", "disable Address Space Layout Randomization (ASLR)"); - map.put("ASLR", pF3); - ParameterDescription pF4 = - ParameterDescription.create(Boolean.class, "STDIO", false, - false, "Disable STDIO", "disable stdio for inferior process (e.g. for a GUI app)"); - map.put("STDIO", pF4); - ParameterDescription pF5 = - ParameterDescription.create(Boolean.class, "NewTTY", false, - false, "New TTY", "launch the process in a new TTY if supported by the host"); - map.put("NewTTY", pF5); - ParameterDescription pF6 = ParameterDescription.create(Boolean.class, "Shell", - false, - false, "Launch from shell", "launch the process inside a shell to get shell expansion"); - map.put("Shell", pF6); - ParameterDescription pF7 = ParameterDescription.create(Boolean.class, "NewGroup", - false, - false, "New group", - "launch the process in a separate process group if you are going to hand the process off (e.g. to debugserver)"); - map.put("NewGroup", pF7); - ParameterDescription pF8 = - ParameterDescription.create(Boolean.class, "ExitRace", false, - false, "Suppress race on exit", - "set this flag so frida & the handee don't race to set its exit status"); - map.put("ExitRace", pF8); - ParameterDescription pF9 = ParameterDescription.create(Boolean.class, "Detach", - false, - false, "Detach on disconnect", - "client stub should detach rather than killing the debugee if it loses connection with frida"); - map.put("Detach", pF9); - ParameterDescription pFA = - ParameterDescription.create(Boolean.class, "ExpandArgs", false, - false, "Shell-style expansion", "perform shell-style argument expansion"); - map.put("ExpandArgs", pFA); - ParameterDescription pFB = - ParameterDescription.create(Boolean.class, "CloseTTY", false, - false, "Close TTY on exit", "close the open TTY on exit"); - map.put("CloseTTY", pFB); - ParameterDescription pFC = - ParameterDescription.create(Boolean.class, "Inherit", false, - false, "Inherit TCC", "inherit TCC permissions from the parent"); - map.put("Inherit", pFC); - return map; - } - - @Override - public TargetParameterMap getParameters() { - return TargetMethod.getParameters(this); - } - - @Override - public CompletableFuture launch(Map args) { - return AsyncUtils.sequence(TypeSpec.VOID).then(seq -> { - getManager().launch(args).handle(seq::nextIgnore); - }).finish().exceptionally((exc) -> { - throw new DebuggerUserException("Launch failed for " + args); - }); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetRegisterContainerImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetRegisterContainerImpl.java deleted file mode 100644 index df899382fa..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetRegisterContainerImpl.java +++ /dev/null @@ -1,153 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.math.BigInteger; -import java.util.*; -import java.util.Map.Entry; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import agent.frida.manager.*; -import agent.frida.model.iface2.*; -import ghidra.async.AsyncUtils; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.error.DebuggerRegisterAccessException; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.TargetRegisterBank; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; - -@TargetObjectSchemaInfo( - name = "RegisterContainer", - attributeResync = ResyncMode.ALWAYS, - elements = { // - @TargetElementType(type = FridaModelTargetRegisterImpl.class) // - }, - attributes = { - @TargetAttributeType( - name = TargetRegisterBank.DESCRIPTIONS_ATTRIBUTE_NAME, - type = FridaModelTargetRegisterContainerImpl.class), - @TargetAttributeType(type = Void.class) - }, - canonicalContainer = true) -public class FridaModelTargetRegisterContainerImpl - extends FridaModelTargetObjectImpl - implements FridaModelTargetRegisterContainerAndBank { - public static final String NAME = "Registers"; - - protected final FridaModelTargetThreadImpl thread; - - public FridaModelTargetRegisterContainerImpl(FridaModelTargetThreadImpl thread) { - super(thread.getModel(), thread, NAME, "RegisterContainer"); - this.thread = thread; - - changeAttributes(List.of(), List.of(), Map.of( - DISPLAY_ATTRIBUTE_NAME, getName(), - DESCRIPTIONS_ATTRIBUTE_NAME, this), "Initialized"); - - requestElements(RefreshBehavior.REFRESH_NEVER); - } - - /** - * Does both descriptions and then populates values - */ - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - if (refresh.equals(RefreshBehavior.REFRESH_ALWAYS)) { - broadcast().invalidateCacheRequested(this); - } - return getManager().listRegisters(thread.getThread()).thenAccept(registers -> { - List targetRegisters; - synchronized (this) { - targetRegisters = registers.entrySet() - .stream() - .map(this::getTargetRegister) - .collect(Collectors.toList()); - } - setElements(targetRegisters, Map.of(), "Refreshed"); - if (!getCachedElements().isEmpty()) { - readRegistersNamed(getCachedElements().keySet()); - } - //changeAttributes(List.of(), targetRegisters, Map.of(), "Refreshed"); - }); - } - - @SuppressWarnings("rawtypes") - @Override - public FridaModelTargetRegister getTargetRegister(Entry entry) { - FridaValue val = new FridaValue((String) entry.getKey(), (String) entry.getValue()); - TargetObject targetObject = getMapObject(val); - if (targetObject != null) { - FridaModelTargetRegister targetRegister = (FridaModelTargetRegister) targetObject; - targetRegister.setModelObject(val); - return targetRegister; - } - return new FridaModelTargetRegisterImpl(this, val); - } - - public void threadStateChangedSpecific(FridaState state, FridaReason reason) { - if (state.equals(FridaState.FRIDA_THREAD_STOPPED)) { - requestAttributes(RefreshBehavior.REFRESH_NEVER).thenAccept(__ -> { - for (Object attribute : getCachedAttributes().values()) { - if (attribute instanceof FridaModelTargetRegisterBank) { - FridaModelTargetRegisterBank bank = - (FridaModelTargetRegisterBank) attribute; - bank.threadStateChangedSpecific(state, reason); - } - } - }); - } - } - - @Override - public CompletableFuture> readRegistersNamed( - Collection names) { - Map result = new HashMap<>(); - Map els = getCachedElements(); - for (String regname : names) { - if (!elements.containsKey(regname)) { - throw new DebuggerRegisterAccessException("No such register: " + regname); - } - FridaModelTargetRegisterImpl register = - (FridaModelTargetRegisterImpl) els.get(regname); - byte[] bytes = register.getBytes(); - result.put(regname, bytes); - } - //if (getName().contains("General")) { - broadcast().registersUpdated(this, result); - //} - return CompletableFuture.completedFuture(result); - } - - @Override - public CompletableFuture writeRegistersNamed(Map values) { - Map els = getCachedElements(); - for (Map.Entry ent : values.entrySet()) { - String regname = ent.getKey(); - FridaModelTargetRegisterImpl reg = - (FridaModelTargetRegisterImpl) els.get(regname); - if (reg == null) { - throw new DebuggerRegisterAccessException("No such register: " + regname); - } - BigInteger val = new BigInteger(1, ent.getValue()); - reg.getRegister().setValue(val.toString()); - } - broadcast().registersUpdated(getProxy(), values); - return AsyncUtils.nil(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetRegisterImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetRegisterImpl.java deleted file mode 100644 index 64ce344a01..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetRegisterImpl.java +++ /dev/null @@ -1,123 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.math.BigInteger; -import java.util.List; -import java.util.Map; - -import agent.frida.manager.FridaValue; -import agent.frida.model.iface2.FridaModelTargetStackFrameRegister; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.util.ConversionUtils; -import ghidra.dbg.util.PathUtils; - -@TargetObjectSchemaInfo( - name = "RegisterValue", - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType(type = Object.class) }) -public class FridaModelTargetRegisterImpl - extends FridaModelTargetObjectImpl - implements FridaModelTargetStackFrameRegister { - - protected static String indexRegister(FridaValue register) { - return register.getKey(); - } - - protected static String keyRegister(FridaValue register) { - return PathUtils.makeKey(indexRegister(register)); - } - - String value = ""; - - public FridaModelTargetRegisterImpl(FridaModelTargetRegisterContainerImpl registers, - FridaValue register) { - super(registers.getModel(), registers, keyRegister(register), register, "Register"); - value = getValue(); - - changeAttributes(List.of(), Map.of( // - CONTAINER_ATTRIBUTE_NAME, registers, // - BIT_LENGTH_ATTRIBUTE_NAME, getBitLength(), // - DISPLAY_ATTRIBUTE_NAME, getDescription(0), // - VALUE_ATTRIBUTE_NAME, value == null ? "0" : value, // - MODIFIED_ATTRIBUTE_NAME, false // - ), "Initialized"); - } - - @Override - public String getDescription(int level) { - return getName() + " : " + getValue(); - } - - @Override - public int getBitLength() { - return getRegister().getByteSize() * 8; - } - - @Override - public String getValue() { - String val = getRegister().getValue(); - if (val == null) { - return null; - } - if (!val.startsWith("0x")) { - return val; - } - return val.substring(2); - } - - @Override - public FridaValue getRegister() { - return (FridaValue) getModelObject(); - } - - @Override - public byte[] getBytes() { - String oldValue = value; - value = getValue(); - if (value == null) { - return new byte[0]; - } - if (value.startsWith("{")) { - String trim = value.substring(1, value.length() - 1); - String[] split = trim.split(" "); - value = split[0].substring(2) + split[1].substring(2); - } - BigInteger val = new BigInteger(value, 16); - byte[] bytes = ConversionUtils.bigIntegerToBytes(getRegister().getByteSize(), val); - changeAttributes(List.of(), Map.of( // - VALUE_ATTRIBUTE_NAME, value // - ), "Refreshed"); - if (val.longValue() != 0) { - String newval = getDescription(0); - if (newval != null) { - changeAttributes(List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, newval // - ), "Refreshed"); - setModified(!value.equals(oldValue)); - } - } - return bytes; - } - - @Override - public String getDisplay() { - return getValue() == null ? getName() : getName() + " : " + getValue(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetRootImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetRootImpl.java deleted file mode 100644 index 8337a8c382..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetRootImpl.java +++ /dev/null @@ -1,184 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import agent.frida.manager.*; -import agent.frida.manager.cmd.FridaAttachCommand; -import agent.frida.model.iface1.FridaModelSelectableObject; -import agent.frida.model.iface2.*; -import ghidra.dbg.error.DebuggerUserException; -import ghidra.dbg.target.*; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.util.PathUtils; - -@TargetObjectSchemaInfo( - name = "Debugger", - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType( - name = "AvailableDevices", - type = FridaModelTargetAvailableDevicesContainerImpl.class, - required = true, - fixed = true), - @TargetAttributeType( - name = "AvailableProcesses", - type = FridaModelTargetAvailableProcessesContainerImpl.class, - required = true, - fixed = true), - @TargetAttributeType( - name = "Connectors", - type = FridaModelTargetConnectorContainerImpl.class, - required = true, - fixed = true), - @TargetAttributeType( - name = "Sessions", - type = FridaModelTargetSessionContainerImpl.class, - required = true, - fixed = true), - @TargetAttributeType(type = Void.class) }) -public class FridaModelTargetRootImpl extends FridaModelDefaultTargetModelRoot - implements FridaModelTargetRoot { - - protected final FridaModelTargetAvailableDevicesContainerImpl availableDevices; - protected final FridaModelTargetAvailableProcessesContainerImpl availableProcesses; - protected final FridaModelTargetConnectorContainerImpl connectors; - protected final FridaModelTargetSessionContainerImpl sessions; - - protected String debugger = "Frida"; // Used by FridaModelTargetEnvironment - - protected FridaModelSelectableObject focus; - - public FridaModelTargetRootImpl(FridaModelImpl impl, TargetObjectSchema schema) { - super(impl, "Debugger", schema); - - this.availableDevices = new FridaModelTargetAvailableDevicesContainerImpl(this); - this.availableProcesses = new FridaModelTargetAvailableProcessesContainerImpl(this); - this.connectors = new FridaModelTargetConnectorContainerImpl(this); - this.sessions = new FridaModelTargetSessionContainerImpl(this); - - FridaModelTargetConnector defaultConnector = connectors.getDefaultConnector(); - changeAttributes(List.of(), List.of( // - availableDevices, // - availableProcesses, // - connectors, // - sessions // - ), Map.of( // - ACCESSIBLE_ATTRIBUTE_NAME, accessible, // - DISPLAY_ATTRIBUTE_NAME, "Debugger", // - FOCUS_ATTRIBUTE_NAME, this, // - SUPPORTED_ATTACH_KINDS_ATTRIBUTE_NAME, FridaModelTargetProcessImpl.SUPPORTED_KINDS, // - TargetMethod.PARAMETERS_ATTRIBUTE_NAME, defaultConnector.getParameters() // - ), "Initialized"); - impl.getManager().addEventsListener(this); - } - - @Override - public FridaModelSelectableObject getFocus() { - return focus; - } - - @Override - public void setDefaultConnector(FridaModelTargetConnector defaultConnector) { - changeAttributes(List.of(), List.of(), - Map.of(TargetMethod.PARAMETERS_ATTRIBUTE_NAME, defaultConnector.getParameters()), - "Default connector changed"); - } - - @Override - public boolean setFocus(FridaModelSelectableObject sel) { - boolean doFire; - synchronized (this) { - doFire = !Objects.equals(this.focus, sel); - if (doFire && focus != null) { - List focusPath = focus.getPath(); - List selPath = sel.getPath(); - doFire = !PathUtils.isAncestor(selPath, focusPath); - } - } - if (doFire) { - this.focus = sel; - changeAttributes(List.of(), List.of(), Map.of( // - TargetFocusScope.FOCUS_ATTRIBUTE_NAME, focus // - ), "Focus changed"); - } - return doFire; - } - - @Override - public CompletableFuture launch(List args) { - FridaModelTargetProcessLaunchConnectorImpl targetConnector = connectors.processLauncher; - return model.gateFuture(targetConnector.launch(args)).exceptionally(exc -> { - throw new DebuggerUserException("Launch failed for " + args); - }); - } - - @Override - public CompletableFuture launch(Map args) { - FridaModelTargetConnector targetConnector = connectors.getDefaultConnector(); - return model.gateFuture(targetConnector.launch(args)).exceptionally(exc -> { - throw new DebuggerUserException("Launch failed for " + args); - }); - } - - @Override - public CompletableFuture attach(TargetAttachable attachable) { - if (attachable instanceof FridaModelTargetAvailableDevice) { - FridaModelTargetDeviceAttachByIdConnectorImpl targetConnector = - connectors.targetAttacherById; - String key = ((FridaModelTargetAvailableDevice) attachable).getId(); - Map map = new HashMap<>(); - map.put("Id", key); - return model.gateFuture(targetConnector.launch(map)).exceptionally(exc -> { - throw new DebuggerUserException("Launch failed for " + key); - }); - } - FridaModelTargetProcessAttachByPidConnectorImpl targetConnector = - connectors.processAttacherByPid; - String key = attachable.getName(); - Map map = new HashMap<>(); - map.put("Pid", key.substring(1, key.length() - 1)); - return model.gateFuture(targetConnector.launch(map)).exceptionally(exc -> { - throw new DebuggerUserException("Launch failed for " + key); - }); - } - - @Override - public CompletableFuture attach(long pid) { - return model.gateFuture( - getManager().execute(new FridaAttachCommand(getManager(), Long.toString(pid))) - .thenApply(__ -> null)); - } - - @Override - public void threadStateChanged(FridaThread thread, FridaState state, FridaCause cause, - FridaReason reason) { - FridaModelTargetThread targetThread = - (FridaModelTargetThread) getModel().getModelObject(thread); - changeAttributes(List.of(), List.of(), Map.of( // - TargetEventScope.EVENT_OBJECT_ATTRIBUTE_NAME, targetThread // - ), reason.desc()); - } - - @Override - public boolean isAccessible() { - return true; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetSessionAttributesEnvironmentImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetSessionAttributesEnvironmentImpl.java deleted file mode 100644 index 3cf7ec3dcd..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetSessionAttributesEnvironmentImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.util.List; -import java.util.Map; - -import agent.frida.manager.FridaSession; -import agent.frida.model.iface2.FridaModelTargetSessionAttributes; -import agent.frida.model.iface2.FridaModelTargetSessionAttributesEnvironment; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; - -@TargetObjectSchemaInfo( - name = "SessionAttributesEnvironment", - attributes = { - @TargetAttributeType(type = Object.class) - }) -public class FridaModelTargetSessionAttributesEnvironmentImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetSessionAttributesEnvironment { - - FridaSession session; - - public FridaModelTargetSessionAttributesEnvironmentImpl( - FridaModelTargetSessionAttributes attributes) { - super(attributes.getModel(), attributes, "Environment", "SessionAttributesEnvironment"); - - session = (FridaSession) getModelObject(); - - changeAttributes(List.of(), List.of(), Map.of( // - "Debugger", "Frida", // - "Debugger Attached", session.getAttribute("debugger"), // - "Debugger Version", session.getAttribute("version"), // - "Code Signing", session.getAttribute("codeSigning"), // - "Page Size", session.getAttribute("pageSize"), // - "Pointer Size", session.getAttribute("pointerSize"), // - "Heap Size", session.getAttribute("heapSize"), // - "Runtime", session.getAttribute("runtime"), // - "Kernel", session.getAttribute("kernel") // - ), "Initialized"); - - getManager().addEventsListener(this); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetSessionAttributesImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetSessionAttributesImpl.java deleted file mode 100644 index 52aa4ca399..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetSessionAttributesImpl.java +++ /dev/null @@ -1,71 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.util.List; -import java.util.Map; - -import agent.frida.manager.FridaSession; -import agent.frida.model.iface2.FridaModelTargetSession; -import agent.frida.model.iface2.FridaModelTargetSessionAttributes; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "SessionAttributes", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType( - name = "Environment", - type = FridaModelTargetSessionAttributesEnvironmentImpl.class, - fixed = true), - @TargetAttributeType( - name = "Platform", - type = FridaModelTargetSessionAttributesPlatformImpl.class, - fixed = true), - @TargetAttributeType(type = Void.class) - }) -public class FridaModelTargetSessionAttributesImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetSessionAttributes { - - protected final FridaModelTargetSessionAttributesPlatformImpl platformAttributes; - protected final FridaModelTargetSessionAttributesEnvironmentImpl environment; - - public FridaModelTargetSessionAttributesImpl(FridaModelTargetSession session) { - super(session.getModel(), session, "Attributes", "SessionAttributes"); - - this.platformAttributes = new FridaModelTargetSessionAttributesPlatformImpl(this); - this.environment = new FridaModelTargetSessionAttributesEnvironmentImpl(this); - - requestAttributes(RefreshBehavior.REFRESH_NEVER); - - FridaSession s = (FridaSession) session.getModelObject(); - changeAttributes(List.of(), List.of( // - platformAttributes, // - environment // - ), Map.of( // - ARCH_ATTRIBUTE_NAME, s.getAttribute("arch"), // - DEBUGGER_ATTRIBUTE_NAME, "Frida", // - OS_ATTRIBUTE_NAME, s.getAttribute("os") // - //ENDIAN_ATTRIBUTE_NAME, orderStr // - ), "Initialized"); - - getManager().addEventsListener(this); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetSessionAttributesPlatformImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetSessionAttributesPlatformImpl.java deleted file mode 100644 index d64f732858..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetSessionAttributesPlatformImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.util.List; -import java.util.Map; - -import agent.frida.manager.*; -import agent.frida.model.iface2.FridaModelTargetSessionAttributes; -import agent.frida.model.iface2.FridaModelTargetSessionAttributesPlatform; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "SessionAttributesPlatform", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(type = Object.class) - }) -public class FridaModelTargetSessionAttributesPlatformImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetSessionAttributesPlatform { - - static String ARCH_ATTRIBUTE_NAME = "Arch"; - static String OS_ATTRIBUTE_NAME = "OS"; - static String DEBUGGER_ATTRIBUTE_NAME = "Debugger"; - - FridaSession session; - - public FridaModelTargetSessionAttributesPlatformImpl( - FridaModelTargetSessionAttributes attributes) { - super(attributes.getModel(), attributes, "Platform", "SessionAttributesPlatform"); - - session = (FridaSession) getModelObject(); - - changeAttributes(List.of(), List.of(), Map.of( // - ARCH_ATTRIBUTE_NAME, session.getAttribute("arch"), // - OS_ATTRIBUTE_NAME, session.getAttribute("os"), // - DEBUGGER_ATTRIBUTE_NAME, "Frida" // - ), "Initialized"); - - getManager().addEventsListener(this); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetSessionContainerImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetSessionContainerImpl.java deleted file mode 100644 index f298c7f150..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetSessionContainerImpl.java +++ /dev/null @@ -1,94 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import agent.frida.manager.FridaCause; -import agent.frida.manager.FridaSession; -import agent.frida.model.iface2.FridaModelTargetRoot; -import agent.frida.model.iface2.FridaModelTargetSession; -import agent.frida.model.iface2.FridaModelTargetSessionContainer; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetElementType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; - -@TargetObjectSchemaInfo( - name = "SessionContainer", - elements = { - @TargetElementType(type = FridaModelTargetSessionImpl.class) }, - attributes = { - @TargetAttributeType(type = Void.class) }, - canonicalContainer = true) -public class FridaModelTargetSessionContainerImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetSessionContainer { - - public FridaModelTargetSessionContainerImpl(FridaModelTargetRoot root) { - super(root.getModel(), root, "Sessions", "SessionContainer"); - - getManager().addEventsListener(this); - } - - @Override - public void sessionAdded(FridaSession sess, FridaCause cause) { - FridaModelTargetSession session = getTargetSession(sess); - changeElements(List.of(), List.of(session), Map.of(), "Added"); - } - - @Override - public void sessionReplaced(FridaSession sess, FridaCause cause) { - FridaModelTargetSession session = getTargetSession(sess); - changeElements(List.of(), List.of(session), Map.of(), "Replaced"); - } - - @Override - public void sessionRemoved(String sessionId, FridaCause cause) { - changeElements(List.of( // - sessionId // - ), List.of(), Map.of(), "Removed"); - } - - @Override - public synchronized FridaModelTargetSession getTargetSession(FridaSession session) { - TargetObject targetObject = getMapObject(session); - if (targetObject != null) { - FridaModelTargetSession targetSession = (FridaModelTargetSession) targetObject; - targetSession.setModelObject(session); - return targetSession; - } - return new FridaModelTargetSessionImpl(this, session); - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - return getManager().listSessions().thenAccept(byIID -> { - List sessions; - synchronized (this) { - sessions = byIID.values() - .stream() - .map(this::getTargetSession) - .collect(Collectors.toList()); - } - setElements(sessions, "Refreshed"); - }); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetSessionImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetSessionImpl.java deleted file mode 100644 index 11e61a69f8..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetSessionImpl.java +++ /dev/null @@ -1,147 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import agent.frida.frida.FridaClient; -import agent.frida.manager.FridaSession; -import agent.frida.manager.cmd.FridaContinueCommand; -import agent.frida.model.iface1.FridaModelTargetInterpreter; -import agent.frida.model.iface2.FridaModelTargetModuleContainer; -import agent.frida.model.iface2.FridaModelTargetProcessContainer; -import agent.frida.model.iface2.FridaModelTargetSession; -import agent.frida.model.methods.FridaModelTargetUnloadScriptImpl; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetElementType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; -import ghidra.dbg.util.PathUtils; - -@TargetObjectSchemaInfo( - name = "Session", - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType( - name = "Attributes", - type = FridaModelTargetSessionAttributesImpl.class, - fixed = true), - @TargetAttributeType( - name = "Processes", - type = FridaModelTargetProcessContainerImpl.class, - required = true, - fixed = true), - @TargetAttributeType( - name = "Modules", - type = FridaModelTargetModuleContainerImpl.class, - required = true, - fixed = true), - @TargetAttributeType(type = Object.class) }) -public class FridaModelTargetSessionImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetSession { - - protected static final String FRIDA_PROMPT = "(frida)"; - private Integer base = 10; - - // NB: This should almost certainly always be implemented by the root of the object tree - - protected static String indexSession(FridaSession session) { - return FridaClient.getId(session); - } - - protected static String keySession(FridaSession session) { - return PathUtils.makeKey(indexSession(session)); - } - - protected final FridaModelTargetModuleContainer modules; - protected final FridaModelTargetSessionAttributesImpl attrs; - protected final FridaModelTargetProcessContainerImpl processes; - - private FridaModelTargetUnloadScriptImpl unload; - private FridaModelTargetKernelImpl kernel; - protected String debugger = "frida"; // Used by FridaModelTargetEnvironment - - public FridaModelTargetSessionImpl(FridaModelTargetSessionContainerImpl sessions, - FridaSession session) { - super(sessions.getModel(), sessions, keySession(session), session, "Session"); - - this.attrs = new FridaModelTargetSessionAttributesImpl(this); - this.processes = new FridaModelTargetProcessContainerImpl(this); - this.modules = new FridaModelTargetModuleContainerImpl(this); - - this.unload = new FridaModelTargetUnloadScriptImpl(this, ""); - - changeAttributes(List.of(), List.of( // - attrs, // - processes, // - modules // - ), Map.of( // - //DISPLAY_ATTRIBUTE_NAME, getDescription(0), // - PROMPT_ATTRIBUTE_NAME, FridaModelTargetInterpreter.FRIDA_PROMPT, // - STATE_ATTRIBUTE_NAME, TargetExecutionState.ALIVE, // - unload.getName(), unload // - ), "Initialized"); - - if (session.getAttribute("kernel").equals("true")) { - this.kernel = new FridaModelTargetKernelImpl(this); - changeAttributes(List.of(), List.of( // - kernel // - ), Map.of(), "Initialized"); - } - - getManager().addEventsListener(this); - } - - @Override - public String getDisplay() { - FridaSession session = (FridaSession) getModelObject(); - String pidstr = FridaClient.getId(session.getProcess()); - if (base == 16) { - pidstr = "0x" + pidstr; - } - else { - pidstr = Long.toString(Long.parseLong(pidstr, 16)); - } - return "[" + pidstr + "]"; - } - - @Override - public CompletableFuture setActive() { - return CompletableFuture.completedFuture(null); - } - - @Override - public FridaModelTargetProcessContainer getProcesses() { - return processes; - } - - @Override - public FridaModelTargetModuleContainer getModules() { - return modules; - } - - public FridaSession getSession() { - return (FridaSession) getModelObject(); - } - - @Override - public CompletableFuture resume() { - return model.gateFuture(getManager().execute(new FridaContinueCommand(getManager()))); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetStackFrameImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetStackFrameImpl.java deleted file mode 100644 index f0d6772613..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetStackFrameImpl.java +++ /dev/null @@ -1,182 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.util.List; -import java.util.Map; - -import agent.frida.frida.FridaClient; -import agent.frida.manager.*; -import agent.frida.model.iface1.FridaModelTargetFocusScope; -import agent.frida.model.iface2.*; -import ghidra.dbg.target.TargetFocusScope; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; -import ghidra.dbg.util.PathUtils; -import ghidra.program.model.address.Address; - -@TargetObjectSchemaInfo( - name = "StackFrame", - attributeResync = ResyncMode.ALWAYS, - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType( - name = "Function", - type = FridaModelTargetFunctionImpl.class), - @TargetAttributeType( - name = FridaModelTargetStackFrame.FUNC_ATTRIBUTE_NAME, - type = String.class), - @TargetAttributeType( - name = FridaModelTargetStackFrame.INST_OFFSET_ATTRIBUTE_NAME, - type = String.class), - @TargetAttributeType( - name = FridaModelTargetStackFrame.FRAME_OFFSET_ATTRIBUTE_NAME, - type = String.class), - @TargetAttributeType( - name = FridaModelTargetStackFrame.RETURN_OFFSET_ATTRIBUTE_NAME, - type = String.class), - @TargetAttributeType( - name = FridaModelTargetStackFrame.CALL_FRAME_OFFSET_ATTRIBUTE_NAME, - type = String.class), - @TargetAttributeType( - name = FridaModelTargetStackFrame.STACK_OFFSET_ATTRIBUTE_NAME, - type = String.class), - @TargetAttributeType(type = Void.class) }) -public class FridaModelTargetStackFrameImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetStackFrame { - - protected static String indexFrame(FridaFrame frame) { - return FridaClient.getId(frame); - } - - protected static String keyFrame(FridaFrame frame) { - return PathUtils.makeKey(indexFrame(frame)); - } - - protected final FridaModelTargetThread thread; - - protected Address pc; - protected String func; - protected String file; - protected String module; - protected Long line; - protected String display; - - private final FridaModelTargetFunctionImpl function; - - //private Long frameOffset = -1L; - //private Long stackOffset = -1L; - //private Long callFrameOffset = -1L; - //private Long returnOffset = -1L; - - public FridaModelTargetStackFrameImpl(FridaModelTargetStack stack, FridaModelTargetThread thread, - FridaFrame frame) { - super(stack.getModel(), stack, keyFrame(frame), frame, "StackFrame"); - this.thread = thread; - this.pc = getModel().getAddressSpace("ram").getAddress(-1); - - this.function = new FridaModelTargetFunctionImpl(this, frame.getFunction()); - - changeAttributes(List.of(), List.of( - function // - ), Map.of( // - DISPLAY_ATTRIBUTE_NAME, display = computeDisplay(frame), // - PC_ATTRIBUTE_NAME, pc // - ), "Initialized"); - setFrame(frame); - - getManager().addEventsListener(this); - } - - protected static String computeDisplay(FridaFrame frame) { - if (frame.getFunctionName() == null) { - frame.getPC(); - return String.format("#%s 0x%s", FridaClient.getId(frame), Long.toHexString(frame.getPC())); - } - return String.format("#%s 0x%s in %s ()", FridaClient.getId(frame), Long.toHexString(frame.getPC()), - frame.getFunctionName()); - } - - @Override - public void threadSelected(FridaThread eventThread, FridaFrame eventFrame, FridaCause cause) { - if (eventFrame != null && eventFrame.equals(getFrame())) { - ((FridaModelTargetFocusScope) searchForSuitable(TargetFocusScope.class)).setFocus(this); - } - } - - @Override - public void setFrame(FridaFrame frame) { - setModelObject(frame); - Long address = frame.getPC(); - long lval = address == null ? -1 : address; - this.pc = getModel().getAddressSpace("ram").getAddress(lval); - this.func = frame.getFunctionName(); - if (func == null) { - func = "UNKNOWN"; - } - this.file = frame.getFileName(); - if (file == null) { - file = "UNKNOWN"; - } - this.module = frame.getModuleName(); - if (module == null) { - module = "UNKNOWN"; - } - this.line = frame.getLineNumber(); - //this.frameOffset = frame.GetFP().longValue(); - //this.stackOffset = frame.GetSP().longValue(); - //this.callFrameOffset = frame.GetCFA().longValue(); - - changeAttributes(List.of(), List.of(), Map.of( // - PC_ATTRIBUTE_NAME, pc, // - //DISPLAY_ATTRIBUTE_NAME, display = getDescription(0), //computeDisplay(frame), // - FUNC_ATTRIBUTE_NAME, func // - //FILE_ATTRIBUTE_NAME, file, // - //MODULE_ATTRIBUTE_NAME, module, // - //LINE_ATTRIBUTE_NAME, line // - //INST_OFFSET_ATTRIBUTE_NAME, Long.toHexString(lval), // - //FRAME_OFFSET_ATTRIBUTE_NAME, Long.toHexString(frameOffset), // - //STACK_OFFSET_ATTRIBUTE_NAME, Long.toHexString(stackOffset), // - //CALL_FRAME_OFFSET_ATTRIBUTE_NAME, Long.toHexString(callFrameOffset) // - ), "Refreshed"); - } - - @Override - public TargetObject getThread() { - return thread; - } - - public FridaFrame getFrame() { - return (FridaFrame) getModelObject(); - } - - @Override - public Address getPC() { - return pc; - } - - @Override - public FridaModelTargetProcess getProcess() { - return ((FridaModelTargetThreadImpl) thread).getProcess(); - } - - public void threadStateChangedSpecific(FridaState state, FridaReason reason) { - setFrame(getFrame()); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetStackImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetStackImpl.java deleted file mode 100644 index 55ae720100..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetStackImpl.java +++ /dev/null @@ -1,101 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import agent.frida.manager.FridaFrame; -import agent.frida.manager.FridaReason; -import agent.frida.manager.FridaState; -import agent.frida.model.iface2.FridaModelTargetProcess; -import agent.frida.model.iface2.FridaModelTargetStack; -import agent.frida.model.iface2.FridaModelTargetStackFrame; -import agent.frida.model.iface2.FridaModelTargetThread; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetElementType; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; -import ghidra.util.datastruct.WeakValueHashMap; - -@TargetObjectSchemaInfo( - name = "Stack", - elementResync = ResyncMode.ALWAYS, - elements = { - @TargetElementType(type = FridaModelTargetStackFrameImpl.class) - }, - attributes = { - @TargetAttributeType(type = Void.class) - }, - canonicalContainer = true) -public class FridaModelTargetStackImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetStack { - - protected final FridaModelTargetThread thread; - - public static final String NAME = "Stack"; - - protected final Map framesByLevel = - new WeakValueHashMap<>(); - - public FridaModelTargetStackImpl(FridaModelTargetThread thread, FridaModelTargetProcess process) { - super(thread.getModel(), thread, NAME, "Stack"); - this.thread = thread; - requestElements(RefreshBehavior.REFRESH_NEVER); - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - return getManager().listStackFrames(thread.getThread()).thenAccept(f -> { - List frames; - synchronized (this) { - frames = - f.values().stream().map(this::getTargetFrame).collect(Collectors.toList()); - } - setElements(frames, Map.of(), "Refreshed"); - }); - } - - @Override - public synchronized FridaModelTargetStackFrame getTargetFrame(FridaFrame frame) { - return framesByLevel.compute(frame.getFrameID(), (l, f) -> { - if (f == null) { - return new FridaModelTargetStackFrameImpl(this, thread, frame); - } - f.setFrame(frame); - return f; - }); - } - - public void threadStateChangedSpecific(FridaState state, FridaReason reason) { - if (state.equals(FridaState.FRIDA_THREAD_STOPPED)) { - requestElements(RefreshBehavior.REFRESH_ALWAYS).thenAccept(__ -> { - for (TargetObject element : getCachedElements().values()) { - if (element instanceof FridaModelTargetStackFrame) { - FridaModelTargetStackFrameImpl frame = - (FridaModelTargetStackFrameImpl) element; - frame.threadStateChangedSpecific(state, reason); - } - } - }); - } - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetSymbolContainerImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetSymbolContainerImpl.java deleted file mode 100644 index c5ac77263f..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetSymbolContainerImpl.java +++ /dev/null @@ -1,88 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import agent.frida.manager.FridaSymbol; -import agent.frida.model.iface2.FridaModelTargetSymbolContainer; -import agent.frida.model.methods.*; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetElementType; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; - -@TargetObjectSchemaInfo( - name = "SymbolContainer", - elements = { - @TargetElementType(type = FridaModelTargetSymbolImpl.class) }, - elementResync = ResyncMode.ONCE, - attributes = { - @TargetAttributeType(type = Object.class) }, - canonicalContainer = true) -public class FridaModelTargetSymbolContainerImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetSymbolContainer { - - protected final FridaModelTargetModuleImpl module; - private FridaModelTargetSymbolFromAddressImpl fromAddr; - private FridaModelTargetSymbolFromNameImpl fromName; - private FridaModelTargetSymbolLoadImpl load; - - public FridaModelTargetSymbolContainerImpl(FridaModelTargetModuleImpl module) { - super(module.getModel(), module, "Symbols", "SymbolContainer"); - this.module = module; - - this.fromAddr = new FridaModelTargetSymbolFromAddressImpl(this); - this.fromName = new FridaModelTargetSymbolFromNameImpl(this); - this.load = new FridaModelTargetSymbolLoadImpl(this); - this.changeAttributes(List.of(), List.of( // - fromAddr, // - fromName, // - load // - ), Map.of(), "Initialized"); - - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - return getManager().listModuleSymbols(module.getModule()).thenAccept(byName -> { - List symbols; - synchronized (this) { - symbols = byName.values() - .stream() - .map(this::getTargetSymbol) - .collect(Collectors.toList()); - } - setElements(symbols, Map.of(), "Refreshed"); - }); - } - - @Override - public synchronized FridaModelTargetSymbolImpl getTargetSymbol(FridaSymbol symbol) { - TargetObject targetObject = getMapObject(symbol); - if (targetObject != null) { - FridaModelTargetSymbolImpl targetSymbol = (FridaModelTargetSymbolImpl) targetObject; - targetSymbol.setModelObject(symbol); - return targetSymbol; - } - return new FridaModelTargetSymbolImpl(this, symbol); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetSymbolImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetSymbolImpl.java deleted file mode 100644 index feef23721b..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetSymbolImpl.java +++ /dev/null @@ -1,122 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.util.List; -import java.util.Map; - -import agent.frida.manager.FridaSymbol; -import agent.frida.model.iface2.FridaModelTargetSymbol; -import agent.frida.model.methods.FridaModelTargetFunctionInterceptorImpl; -import agent.frida.model.methods.FridaModelTargetUnloadScriptImpl; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.TargetSymbol; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetElementType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; -import ghidra.dbg.util.PathUtils; -import ghidra.program.model.address.Address; -import ghidra.program.model.address.AddressFormatException; - -@TargetObjectSchemaInfo( - name = "Symbol", - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType( - name = TargetSymbol.NAMESPACE_ATTRIBUTE_NAME, - type = FridaModelTargetSymbolContainerImpl.class), - @TargetAttributeType(name = TargetObject.VALUE_ATTRIBUTE_NAME, type = Address.class), - @TargetAttributeType(name = TargetSymbol.SIZE_ATTRIBUTE_NAME, type = long.class), - @TargetAttributeType(name = "Name", type = String.class), - @TargetAttributeType(name = "Size", type = long.class), - @TargetAttributeType(name = "TypeId", type = int.class), - @TargetAttributeType(name = "Tag", type = int.class), - @TargetAttributeType(type = Object.class) }) -public class FridaModelTargetSymbolImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetSymbol { - protected static String indexSymbol(FridaSymbol symbol) { - return symbol.getName(); - } - - protected static String keySymbol(FridaSymbol symbol) { - return PathUtils.makeKey(indexSymbol(symbol)); - } - - protected final boolean constant; - protected Address value; - protected long size; - private FridaModelTargetFunctionInterceptorImpl intercept; - private FridaModelTargetUnloadScriptImpl unload; - - public FridaModelTargetSymbolImpl(FridaModelTargetSymbolContainerImpl symbols, - FridaSymbol symbol) { - super(symbols.getModel(), symbols, keySymbol(symbol), symbol, "Symbol"); - this.constant = false; - try { - this.value = symbols.getModel() - .getAddressSpace("ram") - .getAddress(symbol.getAddress()); - } catch (AddressFormatException e) { - e.printStackTrace(); - } - this.size = symbol.getSize(); - this.intercept = new FridaModelTargetFunctionInterceptorImpl(this); - this.unload = new FridaModelTargetUnloadScriptImpl(this, intercept.getName()); - - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDescription(0), // - NAMESPACE_ATTRIBUTE_NAME, symbols, // - VALUE_ATTRIBUTE_NAME, value, // - SIZE_ATTRIBUTE_NAME, size // - ), "Initialized"); - changeAttributes(List.of(), List.of(), Map.of( // - "Name", symbol.getName(), // - "Address", symbol.getAddress(), // - "Size", size, // - //"Module", symbol.getModule(), // - "Type", symbol.getType(), // - "IsGlobal", symbol.isGlobal(), // - intercept.getName(), intercept, // - unload.getName(), unload // - ), "Initialized"); - if (symbol.getSectionId() != null) { - changeAttributes(List.of(), List.of(), Map.of( // - "Section", symbol.getSectionId()// - ), "Initialized"); - } - } - - public String getDescription(int level) { - FridaSymbol symbol = (FridaSymbol) getModelObject(); - return symbol.getName(); - } - - @Override - public boolean isConstant() { - return constant; - } - - @Override - public Address getValue() { - return value; - } - - @Override - public long getSize() { - return size; - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetThreadContainerImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetThreadContainerImpl.java deleted file mode 100644 index 9a122ec508..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetThreadContainerImpl.java +++ /dev/null @@ -1,176 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import agent.frida.frida.FridaClient; -import agent.frida.manager.*; -import agent.frida.model.iface1.FridaModelTargetConfigurable; -import agent.frida.model.iface2.*; -import agent.frida.model.methods.*; -import ghidra.async.AsyncUtils; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.error.DebuggerIllegalArgumentException; -import ghidra.dbg.target.TargetConfigurable; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; - -@TargetObjectSchemaInfo( - name = "ThreadContainer", - elementResync = ResyncMode.ALWAYS, - elements = { // - @TargetElementType(type = FridaModelTargetThreadImpl.class) // - }, - attributes = { // - @TargetAttributeType(name = TargetConfigurable.BASE_ATTRIBUTE_NAME, type = Integer.class), // - @TargetAttributeType(type = Object.class) // - }, - canonicalContainer = true) -public class FridaModelTargetThreadContainerImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetThreadContainer, FridaModelTargetConfigurable { - - protected final FridaProcess process; - private FridaModelTargetThreadSleepImpl sleep; - private FridaModelTargetThreadStalkImpl stalk; - private FridaModelTargetUnloadScriptImpl unload; - - public FridaModelTargetThreadContainerImpl(FridaModelTargetProcessImpl process) { - super(process.getModel(), process, "Threads", "ThreadContainer"); - this.process = process.getProcess(); - this.changeAttributes(List.of(), Map.of(BASE_ATTRIBUTE_NAME, 16), "Initialized"); - - this.sleep = new FridaModelTargetThreadSleepImpl(this); - this.stalk = new FridaModelTargetThreadStalkImpl(this); - this.unload = new FridaModelTargetUnloadScriptImpl(this, stalk.getName()); - this.changeAttributes(List.of(), List.of( // - sleep, // - stalk, // - unload // - ), Map.of(), "Initialized"); - - getManager().addEventsListener(this); - // NB: Asking for threads on 32-bit Android targets will kill the server right now - //requestElements(true); - } - - @Override - public void threadCreated(FridaThread thread, FridaCause cause) { - changeElements(List.of(), List.of(getTargetThread(thread)), Map.of(), "Created"); - FridaModelTargetThread targetThread = getTargetThread(thread); - changeElements(List.of(), List.of(targetThread), Map.of(), "Created"); - targetThread.threadStateChangedSpecific(FridaState.FRIDA_THREAD_UNINTERRUPTIBLE, - FridaReason.getReason(null)); - broadcast().event(getProxy(), targetThread, TargetEventType.THREAD_CREATED, - "Thread " + FridaClient.getId(thread) + " started", List.of(targetThread)); - } - - @Override - public void threadReplaced(FridaThread thread, FridaCause cause) { - changeElements(List.of(), List.of(getTargetThread(thread)), Map.of(), "Created"); - FridaModelTargetThread targetThread = getTargetThread(thread); - changeElements(List.of(), List.of(targetThread), Map.of(), "Created"); - } - - @Override - public void threadExited(FridaThread thread, FridaCause cause) { - if (thread == null) { - return; - } - String threadId = FridaModelTargetThreadImpl.indexThread(thread); - FridaModelTargetThread targetThread = (FridaModelTargetThread) getMapObject(thread); - if (targetThread != null) { - broadcast().event(getProxy(), targetThread, TargetEventType.THREAD_EXITED, - "Thread " + threadId + " exited", List.of(targetThread)); - } - changeElements(List.of( // - threadId // - ), List.of(), Map.of(), "Exited"); - } - - @Override - public void threadStateChanged(FridaThread thread, FridaState state, FridaCause cause, - FridaReason reason) { - FridaModelTargetThread targetThread = getTargetThread(thread); - TargetEventType eventType = getEventType(state, cause, reason); - broadcast().event(getProxy(), targetThread, eventType, - "Thread " + FridaClient.getId(thread) + " state changed", List.of(targetThread)); - targetThread.threadStateChangedSpecific(state, reason); - } - - private TargetEventType getEventType(FridaState state, FridaCause cause, FridaReason reason) { - switch (state) { - case FRIDA_THREAD_WAITING: - return TargetEventType.RUNNING; - case FRIDA_THREAD_HALTED: - return TargetEventType.PROCESS_EXITED; - case FRIDA_THREAD_UNINTERRUPTIBLE: - return TargetEventType.PROCESS_CREATED; - case FRIDA_THREAD_STOPPED: - return TargetEventType.STOPPED; - case FRIDA_THREAD_RUNNING: - return TargetEventType.RUNNING; - default: - return TargetEventType.STOPPED; - } - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - if (refresh.equals(RefreshBehavior.REFRESH_ALWAYS)) { - broadcast().invalidateCacheRequested(this); - } - return getManager().listThreads(process); - } - - @Override - public synchronized FridaModelTargetThread getTargetThread(FridaThread thread) { - TargetObject targetObject = getMapObject(thread); - if (targetObject != null) { - FridaModelTargetThread targetThread = (FridaModelTargetThread) targetObject; - targetThread.setModelObject(thread); - return targetThread; - } - return new FridaModelTargetThreadImpl(this, (FridaModelTargetProcess) parent, thread); - } - - @Override - public CompletableFuture writeConfigurationOption(String key, Object value) { - switch (key) { - case BASE_ATTRIBUTE_NAME: - if (value instanceof Integer) { - this.changeAttributes(List.of(), Map.of(BASE_ATTRIBUTE_NAME, value), - "Modified"); - for (TargetObject child : getCachedElements().values()) { - if (child instanceof FridaModelTargetThreadImpl) { - FridaModelTargetThreadImpl targetThread = - (FridaModelTargetThreadImpl) child; - targetThread.setBase(value); - } - } - } - else { - throw new DebuggerIllegalArgumentException("Base should be numeric"); - } - default: - } - return AsyncUtils.nil(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetThreadImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetThreadImpl.java deleted file mode 100644 index b13634c245..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/impl/FridaModelTargetThreadImpl.java +++ /dev/null @@ -1,196 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import agent.frida.frida.FridaClient; -import agent.frida.manager.*; -import agent.frida.manager.FridaReason.Reasons; -import agent.frida.model.iface1.FridaModelTargetFocusScope; -import agent.frida.model.iface2.*; -import agent.frida.model.methods.FridaModelTargetThreadStalkImpl; -import agent.frida.model.methods.FridaModelTargetUnloadScriptImpl; -import ghidra.dbg.target.TargetEnvironment; -import ghidra.dbg.target.TargetFocusScope; -import ghidra.dbg.target.TargetSteppable.TargetStepKindSet; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; -import ghidra.dbg.util.PathUtils; - -@TargetObjectSchemaInfo( - name = "Thread", - attributeResync = ResyncMode.ALWAYS, - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType( - name = "Registers", - type = FridaModelTargetRegisterContainerImpl.class, - required = true, - fixed = true), - @TargetAttributeType( - name = "Stack", - type = FridaModelTargetStackImpl.class, - required = true, - fixed = true), - @TargetAttributeType(name = TargetEnvironment.ARCH_ATTRIBUTE_NAME, type = String.class), - @TargetAttributeType(type = Object.class) }) -public class FridaModelTargetThreadImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetThread { - - public static final TargetStepKindSet SUPPORTED_KINDS = TargetStepKindSet.of(); /* - TargetStepKind.ADVANCE, // - TargetStepKind.FINISH, // - TargetStepKind.LINE, // - TargetStepKind.OVER, // - TargetStepKind.OVER_LINE, // - TargetStepKind.RETURN, // - TargetStepKind.UNTIL, // - TargetStepKind.EXTENDED); - */ - - protected static String indexThread(Integer id) { - return PathUtils.makeIndex(id); - } - - protected static String indexThread(FridaThread thread) { - return FridaClient.getId(thread); - } - - protected static String keyThread(FridaThread thread) { - return PathUtils.makeKey(indexThread(thread)); - } - - protected final FridaModelTargetStackImpl stack; - - private FridaModelTargetProcess process; - private Integer base = 10; - - private FridaModelTargetRegisterContainerImpl registers; - private FridaModelTargetThreadStalkImpl stalk; - private FridaModelTargetUnloadScriptImpl unload; - - public FridaModelTargetThreadImpl(FridaModelTargetThreadContainer threads, - FridaModelTargetProcess process, FridaThread thread) { - super(threads.getModel(), threads, keyThread(thread), thread, "Thread"); - this.process = process; - - this.registers = new FridaModelTargetRegisterContainerImpl(this); - this.stack = new FridaModelTargetStackImpl(this, process); - - this.stalk = new FridaModelTargetThreadStalkImpl(this); - this.unload = new FridaModelTargetUnloadScriptImpl(this, stalk.getName()); - - changeAttributes(List.of(), List.of( // - registers, - stack, // - stalk, // - unload // - ), Map.of( // - //ACCESSIBLE_ATTRIBUTE_NAME, accessible = false, // - DISPLAY_ATTRIBUTE_NAME, getDisplay(), // - STATE_ATTRIBUTE_NAME, TargetExecutionState.ALIVE // - //SUPPORTED_STEP_KINDS_ATTRIBUTE_NAME, SUPPORTED_KINDS // - ), "Initialized"); - - getManager().addStateListener(this); - getManager().addEventsListener(this); - } - - @Override - public void setModelObject(Object modelObject) { - super.setModelObject(modelObject); - getModel().addModelObject(modelObject, this); - } - - public String getDescription(int level) { - FridaThread thread = (FridaThread) getModelObject(); - return thread.getDescription(); - } - - @Override - public String getDisplay() { - String tidstr = FridaClient.getId(getThread()); - if (base == 16) { - tidstr = "0x" + tidstr; - } else { - tidstr = Long.toString(Long.parseLong(tidstr,16)); - } - return "[" + tidstr + "]"; - } - - @Override - public void threadSelected(FridaThread eventThread, FridaFrame frame, FridaCause cause) { - if (eventThread.getTid().equals(getThread().getTid())) { - ((FridaModelTargetFocusScope) searchForSuitable(TargetFocusScope.class)).setFocus(this); - } - } - - @Override - public void threadStateChangedSpecific(FridaState state, FridaReason reason) { - TargetExecutionState targetState = FridaClient.convertState(state); - changeAttributes(List.of(), List.of(), Map.of( // - STATE_ATTRIBUTE_NAME, targetState // - ), reason.desc()); - stack.threadStateChangedSpecific(state, reason); - registers.threadStateChangedSpecific(state, reason); - } - - @Override - public CompletableFuture setActive() { - return CompletableFuture.completedFuture(null); - } - - @Override - public FridaModelTargetStackImpl getStack() { - return stack; - } - - @Override - public FridaThread getThread() { - return (FridaThread) getModelObject(); - } - - public FridaModelTargetProcess getProcess() { - return process; - } - - @Override - public String getExecutingProcessorType() { - return null; //thread.getExecutingProcessorType().description; - } - - public void setBase(Object value) { - this.base = (Integer) value; - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDisplay()// - ), "Started"); - } - - @Override - public void stateChanged(FridaState state, FridaCause cause) { - FridaModelTargetThreadContainer container = (FridaModelTargetThreadContainer) getParent(); - Reasons unknown = FridaReason.Reasons.UNKNOWN; - process.threadStateChanged(getThread(), state, cause, unknown); - container.threadStateChanged(getThread(), state, cause, unknown); - //registers.threadStateChanged(getThread(), state, cause, unknown); - threadStateChangedSpecific(state, unknown); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetFunctionInterceptorImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetFunctionInterceptorImpl.java deleted file mode 100644 index 6d0e6ebc48..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetFunctionInterceptorImpl.java +++ /dev/null @@ -1,88 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.methods; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import agent.frida.manager.*; -import agent.frida.model.iface1.FridaModelTargetMethod; -import agent.frida.model.iface2.FridaModelTargetObject; -import agent.frida.model.impl.FridaModelTargetObjectImpl; -import ghidra.dbg.target.TargetMethod; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "FunctionIntercept", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(type = Object.class) - }, - canonicalContainer = true) -public class FridaModelTargetFunctionInterceptorImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetMethod { - - protected final TargetParameterMap paramDescs; - - public FridaModelTargetFunctionInterceptorImpl(FridaModelTargetObject parent) { - super(parent.getModel(), parent, "intercept", "FunctionIntercept"); - - changeAttributes(List.of(), List.of(), Map.of( // - TargetMethod.PARAMETERS_ATTRIBUTE_NAME, - paramDescs = TargetParameterMap.copyOf(computeParameters()) // - ), "Initialized"); - } - - protected Map> computeParameters() { - HashMap> map = - new HashMap>(); - ParameterDescription onEnter = ParameterDescription.create(String.class, "OnEnter", - false, "", "onEnter file", "JS file with onEnter implementation"); - ParameterDescription onLeave = ParameterDescription.create(String.class, "OnLeave", - false, "", "onLeave file", "JS file with onLeave implementation"); - ParameterDescription name = ParameterDescription.create(String.class, "Name", - false, "intercept", "name", "name for future unload"); - ParameterDescription script = ParameterDescription.create(String.class, "Script", - false, "", "script", "script to execute on result"); - map.put("OnEnter", onEnter); - map.put("OnLeave", onLeave); - map.put("Name", name); - map.put("Script", script); - return map; - } - - @Override - public CompletableFuture invoke(Map arguments) { - Object modelObject = getModelObject(); - String address = null; - if (modelObject instanceof FridaImport) { - address = ((FridaImport) modelObject).getAddress(); - } - if (modelObject instanceof FridaExport) { - address = ((FridaExport) modelObject).getAddress(); - } - if (modelObject instanceof FridaSymbol) { - address = ((FridaSymbol) modelObject).getAddress(); - } - if (address != null) { - getManager().interceptFunction(address, arguments); - } - return CompletableFuture.completedFuture(null); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetMemoryPatchImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetMemoryPatchImpl.java deleted file mode 100644 index d3dc883b4f..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetMemoryPatchImpl.java +++ /dev/null @@ -1,78 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.methods; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import agent.frida.model.iface1.FridaModelTargetMethod; -import agent.frida.model.iface2.FridaModelTargetMemoryContainer; -import agent.frida.model.impl.FridaModelTargetObjectImpl; -import ghidra.dbg.target.TargetMethod; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "MemoryPatch", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(type = Object.class) - }, - canonicalContainer = true) -public class FridaModelTargetMemoryPatchImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetMethod { - - protected final TargetParameterMap paramDescs; - - public FridaModelTargetMemoryPatchImpl(FridaModelTargetMemoryContainer memory) { - super(memory.getModel(), memory, "patch", "MemoryPatch"); - - changeAttributes(List.of(), List.of(), Map.of( // - TargetMethod.PARAMETERS_ATTRIBUTE_NAME, - paramDescs = TargetParameterMap.copyOf(computeParameters()) // - ), "Initialized"); - } - - protected Map> computeParameters() { - HashMap> map = - new HashMap>(); - ParameterDescription address = ParameterDescription.create(String.class, "Address", - true, "", "Address", "addres to patch"); - ParameterDescription size = ParameterDescription.create(Long.class, "Size", true, - 0L, "Size", "size of patch"); - ParameterDescription pattern = ParameterDescription.create(String.class, "Callback", - true, "", "Callback", "e.g. code => {const cw = new X86Writer(code, { pc: addr }); cw.putRet(); cw.flush();}"); - map.put("Address", address); - map.put("Size", size); - map.put("Callback", pattern); - return map; - } - - @Override - public CompletableFuture invoke(Map arguments) { - String addr = (String) arguments.get("Address"); - if (!addr.startsWith("0x")) { - addr = "0x" + addr; - } - getManager().console("Memory.patchCode(" + - "ptr(" + addr + "), " + - arguments.get("Size") + ", " + - arguments.get("Callback") + ");"); - return CompletableFuture.completedFuture(null); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetMemoryProtectImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetMemoryProtectImpl.java deleted file mode 100644 index c5c7c72baa..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetMemoryProtectImpl.java +++ /dev/null @@ -1,77 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.methods; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import agent.frida.model.iface1.FridaModelTargetMethod; -import agent.frida.model.iface2.FridaModelTargetMemoryContainer; -import agent.frida.model.impl.FridaModelTargetObjectImpl; -import ghidra.dbg.target.TargetMethod; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "MemoryProtect", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(type = Object.class) - }, - canonicalContainer = true) -public class FridaModelTargetMemoryProtectImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetMethod { - - protected final TargetParameterMap paramDescs; - private boolean kernel; - - public FridaModelTargetMemoryProtectImpl(FridaModelTargetMemoryContainer memory, boolean kernel) { - super(memory.getModel(), memory, "protect", "MemoryProtect"); - this.kernel = kernel; - - changeAttributes(List.of(), List.of(), Map.of( // - TargetMethod.PARAMETERS_ATTRIBUTE_NAME, - paramDescs = TargetParameterMap.copyOf(computeParameters()) // - ), "Initialized"); - } - - protected Map> computeParameters() { - HashMap> map = - new HashMap>(); - ParameterDescription address = ParameterDescription.create(String.class, "Address", - true, "", "Address", "starting address"); - ParameterDescription size = ParameterDescription.create(Long.class, "Size", true, - 4096L, "Size", "size to protect"); - ParameterDescription protection = ParameterDescription.create(String.class, "Prot", - true, "", "Protection", "e.g. r-x"); - map.put("Address", address); - map.put("Size", size); - map.put("Prot", protection); - return map; - } - - @Override - public CompletableFuture invoke(Map arguments) { - String cmd = kernel ? "Kernel" : "Memory"; - getManager().console(cmd + ".protect(" + - "ptr(0x" + arguments.get("Address") + "), " + - arguments.get("Size") + ", " + - "'" + arguments.get("Prot") + "');"); - return CompletableFuture.completedFuture(null); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetMemoryScanImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetMemoryScanImpl.java deleted file mode 100644 index 2e0a369bd3..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetMemoryScanImpl.java +++ /dev/null @@ -1,100 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.methods; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import agent.frida.model.iface1.FridaModelTargetMethod; -import agent.frida.model.iface2.FridaModelTargetMemoryContainer; -import agent.frida.model.impl.FridaModelTargetObjectImpl; -import ghidra.dbg.target.TargetMethod; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetElementType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; - -@TargetObjectSchemaInfo( - name = "MemoryScan", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(type = Object.class) - }, - canonicalContainer = true) -public class FridaModelTargetMemoryScanImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetMethod { - - protected final TargetParameterMap paramDescs; - private boolean kernel; - - public FridaModelTargetMemoryScanImpl(FridaModelTargetMemoryContainer memory, boolean kernel) { - super(memory.getModel(), memory, "scan", "MemoryScan"); - this.kernel = kernel; - - changeAttributes(List.of(), List.of(), Map.of( // - TargetMethod.PARAMETERS_ATTRIBUTE_NAME, - paramDescs = TargetParameterMap.copyOf(computeParameters()) // - ), "Initialized"); - } - - protected Map> computeParameters() { - HashMap> map = - new HashMap>(); - ParameterDescription address = ParameterDescription.create(String.class, "Address", - true, "", "Address", "starting address"); - ParameterDescription size = ParameterDescription.create(Long.class, "Size", true, - 0x1000L, "Size", "size to scan"); - ParameterDescription pattern = ParameterDescription.create(String.class, "Pattern", - true, "", "Pattern", "e.g. DE AD ?? BE EF"); - ParameterDescription stopOnMatch = ParameterDescription.create(Boolean.class, "Stop", - true, true, "Stop on match", "stop on match"); - ParameterDescription script = ParameterDescription.create(String.class, "Script", - false, "", "script", "script to execute on result"); - map.put("Address", address); - map.put("Size", size); - map.put("Pattern", pattern); - map.put("Stop", stopOnMatch); - map.put("Script", script); - return map; - } - - @Override - public CompletableFuture invoke(Map arguments) { - String ret = (boolean) arguments.get("Stop") ? " return 'stop'; " : ""; - String addr = (String) arguments.get("Address"); - if (!addr.startsWith("0x")) { - addr = "0x" + addr; - } - String cmd = kernel ? "Kernel" : "Memory"; - getManager().console("result = " + cmd + ".scan(" + - "ptr(" + addr + "), " + - arguments.get("Size") + ", " + - "'" + arguments.get("Pattern") + "', " + - "{ onMatch(address, size) { " + - " console.log('Found match at ', address); " + - ret + - " }," + - " onComplete() { " + - " console.log('scan complete'); " + - " } " + - "});"); - return CompletableFuture.completedFuture(null); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetMemoryWatchImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetMemoryWatchImpl.java deleted file mode 100644 index ef14d7239c..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetMemoryWatchImpl.java +++ /dev/null @@ -1,77 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.methods; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import agent.frida.model.iface1.FridaModelTargetMethod; -import agent.frida.model.iface2.FridaModelTargetMemoryContainer; -import agent.frida.model.impl.FridaModelTargetObjectImpl; -import ghidra.dbg.target.TargetMethod; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "MemoryWatch", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(type = Object.class) - }, - canonicalContainer = true) -public class FridaModelTargetMemoryWatchImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetMethod { - - protected final TargetParameterMap paramDescs; - - public FridaModelTargetMemoryWatchImpl(FridaModelTargetMemoryContainer memory) { - super(memory.getModel(), memory, "watch", "MemoryWatch"); - - changeAttributes(List.of(), List.of(), Map.of( // - TargetMethod.PARAMETERS_ATTRIBUTE_NAME, - paramDescs = TargetParameterMap.copyOf(computeParameters()) // - ), "Initialized"); - } - - protected Map> computeParameters() { - HashMap> map = - new HashMap>(); - ParameterDescription address = ParameterDescription.create(String.class, "Address", - true, "", "Address", "starting address"); - ParameterDescription size = ParameterDescription.create(Long.class, "Size", true, - 1L, "Size", "size to scan"); - ParameterDescription onAccess = ParameterDescription.create(String.class, "OnAccess", - true, "", "onAccess file", "JS file with onAccess implementation"); - ParameterDescription name = ParameterDescription.create(String.class, "Name", - false, "watch", "name", "name for future unload"); - ParameterDescription script = ParameterDescription.create(String.class, "Script", - false, "", "script", "script to execute on result"); - map.put("Address", address); - map.put("Size", size); - map.put("OnAccess", onAccess); - map.put("Name", name); - map.put("Script", script); - return map; - } - - @Override - public CompletableFuture invoke(Map arguments) { - getManager().watchMemory(arguments); - return CompletableFuture.completedFuture(null); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetModuleInitImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetModuleInitImpl.java deleted file mode 100644 index 03119f857d..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetModuleInitImpl.java +++ /dev/null @@ -1,66 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.methods; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import agent.frida.model.iface1.FridaModelTargetMethod; -import agent.frida.model.iface2.FridaModelTargetModuleContainer; -import agent.frida.model.impl.FridaModelTargetObjectImpl; -import ghidra.dbg.target.TargetMethod; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "ModuleInit", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(type = Object.class) - }, - canonicalContainer = true) -public class FridaModelTargetModuleInitImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetMethod { - - protected final TargetParameterMap paramDescs; - - public FridaModelTargetModuleInitImpl(FridaModelTargetModuleContainer modules) { - super(modules.getModel(), modules, "init", "ModuleInit"); - - changeAttributes(List.of(), List.of(), Map.of( // - TargetMethod.PARAMETERS_ATTRIBUTE_NAME, - paramDescs = TargetParameterMap.copyOf(computeParameters()) // - ), "Initialized"); - } - - protected Map> computeParameters() { - HashMap> map = - new HashMap>(); - ParameterDescription fpath = ParameterDescription.create(String.class, "Name", - true, "", "Name", "module name"); - map.put("Name", fpath); - return map; - } - - @Override - public CompletableFuture invoke(Map arguments) { - getManager().console("Module.enusureInitialized(" + - "'" + arguments.get("Name") + "');"); - return CompletableFuture.completedFuture(null); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetModuleInterceptorImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetModuleInterceptorImpl.java deleted file mode 100644 index d0c0247ab5..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetModuleInterceptorImpl.java +++ /dev/null @@ -1,81 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.methods; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import agent.frida.model.iface1.FridaModelTargetMethod; -import agent.frida.model.iface2.FridaModelTargetObject; -import agent.frida.model.impl.FridaModelTargetObjectImpl; -import ghidra.dbg.target.TargetMethod; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "ModuleIntercept", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(type = Object.class) - }, - canonicalContainer = true) -public class FridaModelTargetModuleInterceptorImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetMethod { - - protected final TargetParameterMap paramDescs; - - public FridaModelTargetModuleInterceptorImpl(FridaModelTargetObject parent) { - super(parent.getModel(), parent, "intercept", "ModuleIntercept"); - - changeAttributes(List.of(), List.of(), Map.of( // - TargetMethod.PARAMETERS_ATTRIBUTE_NAME, - paramDescs = TargetParameterMap.copyOf(computeParameters()) // - ), "Initialized"); - } - - protected Map> computeParameters() { - HashMap> map = - new HashMap>(); - ParameterDescription address = ParameterDescription.create(String.class, "Address", - true, "", "Address", "function address"); - ParameterDescription onEnter = ParameterDescription.create(String.class, "OnEnter", - true, "", "onEnter file", "JS file with onEnter implementation"); - ParameterDescription onLeave = ParameterDescription.create(String.class, "OnLeave", - true, "", "onLeave file", "JS file with onLeave implementation"); - ParameterDescription name = ParameterDescription.create(String.class, "Name", - false, "intercept", "name", "name for future unload"); - ParameterDescription script = ParameterDescription.create(String.class, "Script", - false, "", "script", "script to execute on result"); - map.put("Address", address); - map.put("OnEnter", onEnter); - map.put("OnLeave", onLeave); - map.put("Name", name); - map.put("Script", script); - return map; - } - - @Override - public CompletableFuture invoke(Map arguments) { - String address = (String) arguments.get("Address"); - if (!address.startsWith("0x")) { - address = "0x" + address; - } - getManager().interceptFunction(address, arguments); - return CompletableFuture.completedFuture(null); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetModuleLoadImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetModuleLoadImpl.java deleted file mode 100644 index 68bac5cc5b..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetModuleLoadImpl.java +++ /dev/null @@ -1,66 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.methods; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import agent.frida.model.iface1.FridaModelTargetMethod; -import agent.frida.model.iface2.FridaModelTargetModuleContainer; -import agent.frida.model.impl.FridaModelTargetObjectImpl; -import ghidra.dbg.target.TargetMethod; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "ModuleLoad", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(type = Object.class) - }, - canonicalContainer = true) -public class FridaModelTargetModuleLoadImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetMethod { - - protected final TargetParameterMap paramDescs; - - public FridaModelTargetModuleLoadImpl(FridaModelTargetModuleContainer modules) { - super(modules.getModel(), modules, "load", "ModuleLoad"); - - changeAttributes(List.of(), List.of(), Map.of( // - TargetMethod.PARAMETERS_ATTRIBUTE_NAME, - paramDescs = TargetParameterMap.copyOf(computeParameters()) // - ), "Initialized"); - } - - protected Map> computeParameters() { - HashMap> map = - new HashMap>(); - ParameterDescription fpath = ParameterDescription.create(String.class, "Path", - true, "", "Path", "filesystem path"); - map.put("Path", fpath); - return map; - } - - @Override - public CompletableFuture invoke(Map arguments) { - getManager().console("Module.load(" + - "'" + arguments.get("Path") + "');"); - return CompletableFuture.completedFuture(null); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetSymbolFromAddressImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetSymbolFromAddressImpl.java deleted file mode 100644 index 391a836ae1..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetSymbolFromAddressImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.methods; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import agent.frida.model.iface1.FridaModelTargetMethod; -import agent.frida.model.iface2.FridaModelTargetSymbolContainer; -import agent.frida.model.impl.FridaModelTargetObjectImpl; -import ghidra.dbg.target.TargetMethod; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "SymbolFromAddress", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(type = Object.class) - }, - canonicalContainer = true) -public class FridaModelTargetSymbolFromAddressImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetMethod { - - protected final TargetParameterMap paramDescs; - - public FridaModelTargetSymbolFromAddressImpl(FridaModelTargetSymbolContainer symbols) { - super(symbols.getModel(), symbols, "fromAddress", "SymbolFromAddress"); - - changeAttributes(List.of(), List.of(), Map.of( // - TargetMethod.PARAMETERS_ATTRIBUTE_NAME, - paramDescs = TargetParameterMap.copyOf(computeParameters()) // - ), "Initialized"); - } - - protected Map> computeParameters() { - HashMap> map = - new HashMap>(); - ParameterDescription address = ParameterDescription.create(String.class, "Address", - true, "", "Address", "starting address"); - map.put("Address", address); - return map; - } - - @Override - public CompletableFuture invoke(Map arguments) { - String addr = (String) arguments.get("Address"); - if (!addr.startsWith("0x")) { - addr = "0x" + addr; - } - getManager().console("DebugSymbol.fromAddress(" + - "ptr(" + addr + "));"); - return CompletableFuture.completedFuture(null); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetSymbolFromNameImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetSymbolFromNameImpl.java deleted file mode 100644 index 68cd8cbf80..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetSymbolFromNameImpl.java +++ /dev/null @@ -1,67 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.methods; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import agent.frida.model.iface1.FridaModelTargetMethod; -import agent.frida.model.iface2.FridaModelTargetSymbolContainer; -import agent.frida.model.impl.FridaModelTargetObjectImpl; -import ghidra.dbg.target.TargetMethod; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "SymbolFromName", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(type = Object.class) - }, - canonicalContainer = true) -public class FridaModelTargetSymbolFromNameImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetMethod { - - protected final TargetParameterMap paramDescs; - - public FridaModelTargetSymbolFromNameImpl(FridaModelTargetSymbolContainer symbols) { - super(symbols.getModel(), symbols, "fromName", "SymbolFromName"); - - changeAttributes(List.of(), List.of(), Map.of( // - TargetMethod.PARAMETERS_ATTRIBUTE_NAME, - paramDescs = TargetParameterMap.copyOf(computeParameters()) // - ), "Initialized"); - } - - protected Map> computeParameters() { - HashMap> map = - new HashMap>(); - ParameterDescription name = ParameterDescription.create(String.class, "Name", - true, "", "Name", "symbol name"); - map.put("Name", name); - return map; - } - - @Override - public CompletableFuture invoke(Map arguments) { - String name = (String) arguments.get("Name"); - getManager().console("DebugSymbol.fromName(" + - name + ");"); - return CompletableFuture.completedFuture(null); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetSymbolLoadImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetSymbolLoadImpl.java deleted file mode 100644 index d9bff53689..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetSymbolLoadImpl.java +++ /dev/null @@ -1,66 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.methods; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import agent.frida.model.iface1.FridaModelTargetMethod; -import agent.frida.model.iface2.FridaModelTargetSymbolContainer; -import agent.frida.model.impl.FridaModelTargetObjectImpl; -import ghidra.dbg.target.TargetMethod; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "SymbolLoad", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(type = Object.class) - }, - canonicalContainer = true) -public class FridaModelTargetSymbolLoadImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetMethod { - - protected final TargetParameterMap paramDescs; - - public FridaModelTargetSymbolLoadImpl(FridaModelTargetSymbolContainer modules) { - super(modules.getModel(), modules, "load", "SymbolLoad"); - - changeAttributes(List.of(), List.of(), Map.of( // - TargetMethod.PARAMETERS_ATTRIBUTE_NAME, - paramDescs = TargetParameterMap.copyOf(computeParameters()) // - ), "Initialized"); - } - - protected Map> computeParameters() { - HashMap> map = - new HashMap>(); - ParameterDescription fpath = ParameterDescription.create(String.class, "Path", - true, "", "Path", "filesystem path"); - map.put("Path", fpath); - return map; - } - - @Override - public CompletableFuture invoke(Map arguments) { - getManager().console("DebugSymbol.load(" + - "'" + arguments.get("Path") + "');"); - return CompletableFuture.completedFuture(null); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetThreadSleepImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetThreadSleepImpl.java deleted file mode 100644 index 454a7190fd..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetThreadSleepImpl.java +++ /dev/null @@ -1,66 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.methods; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import agent.frida.model.iface1.FridaModelTargetMethod; -import agent.frida.model.impl.FridaModelTargetObjectImpl; -import agent.frida.model.impl.FridaModelTargetThreadContainerImpl; -import ghidra.dbg.target.TargetMethod; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "ThreadSleep", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(type = Void.class) - }, - canonicalContainer = true) -public class FridaModelTargetThreadSleepImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetMethod { - - protected final TargetParameterMap paramDescs; - - public FridaModelTargetThreadSleepImpl(FridaModelTargetThreadContainerImpl threads) { - super(threads.getModel(), threads, "sleep", "ThreadSleep"); - - changeAttributes(List.of(), List.of(), Map.of( // - TargetMethod.PARAMETERS_ATTRIBUTE_NAME, - paramDescs = TargetParameterMap.copyOf(computeParameters()) // - ), "Initialized"); - } - - protected Map> computeParameters() { - HashMap> map = - new HashMap>(); - ParameterDescription fpath = ParameterDescription.create(Long.class, "Delay", - true, 100L, "Delay", "sleep for current thread (seconds)"); - map.put("Delay", fpath); - return map; - } - - @Override - public CompletableFuture invoke(Map arguments) { - getManager().console("Thread.sleep(" + - "'" + arguments.get("Delay") + "');"); - return CompletableFuture.completedFuture(null); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetThreadStalkImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetThreadStalkImpl.java deleted file mode 100644 index a642a159f4..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetThreadStalkImpl.java +++ /dev/null @@ -1,116 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.methods; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import agent.frida.manager.FridaThread; -import agent.frida.model.iface1.FridaModelTargetMethod; -import agent.frida.model.iface2.FridaModelTargetThreadContainer; -import agent.frida.model.impl.FridaModelTargetObjectImpl; -import agent.frida.model.impl.FridaModelTargetThreadImpl; -import ghidra.dbg.target.TargetMethod; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "ThreadStalk", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(type = Object.class) - }, - canonicalContainer = true) -public class FridaModelTargetThreadStalkImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetMethod { - - protected final TargetParameterMap paramDescs; - private boolean useCurrentThread; - - public FridaModelTargetThreadStalkImpl(FridaModelTargetThreadContainer threads) { - super(threads.getModel(), threads, "stalk", "ThreadStalk"); - useCurrentThread = true; - - changeAttributes(List.of(), List.of(), Map.of( // - TargetMethod.PARAMETERS_ATTRIBUTE_NAME, - paramDescs = TargetParameterMap.copyOf(computeParameters()) // - ), "Initialized"); - } - - public FridaModelTargetThreadStalkImpl(FridaModelTargetThreadImpl thread) { - super(thread.getModel(), thread, "stalk", "ThreadStalk"); - useCurrentThread = false; - - changeAttributes(List.of(), List.of(), Map.of( // - TargetMethod.PARAMETERS_ATTRIBUTE_NAME, - paramDescs = TargetParameterMap.copyOf(computeParameters()) // - ), "Initialized"); - } - - public String getTid() { - Long tid = 0L; - if (useCurrentThread) { - FridaThread currentThread = getManager().getCurrentThread(); - if (currentThread != null) { - tid = currentThread.getTid(); - } - } else { - tid = ((FridaThread) getModelObject()).getTid(); - } - return Long.toString(tid); - } - - public Map> computeParameters() { - HashMap> map = - new HashMap>(); - ParameterDescription e_calls = ParameterDescription.create(Boolean.class, "EventCall", - true, true, "event=call", "CALL instruction"); - ParameterDescription e_ret = ParameterDescription.create(Boolean.class, "EventRet", - true, false, "event=ret", "RET instructions"); - ParameterDescription e_exec = ParameterDescription.create(Boolean.class, "EventExec", - true, false, "event=exec", "all instructions (not recommended)"); - ParameterDescription e_block = ParameterDescription.create(Boolean.class, "EventBlock", - true, false, "event=block", "block executed"); - ParameterDescription e_compile = ParameterDescription.create(Boolean.class, "EventCompile", - true, false, "event=compile", "block compiled"); - ParameterDescription onReceive = ParameterDescription.create(String.class, "OnReceive", - false, "", "onRecv file", "JS file with onReceive implementation"); - ParameterDescription onCallSummary = ParameterDescription.create(String.class, "OnCallSummary", - false, "", "onCall file", "JS file with onCallSummary implementation"); - ParameterDescription name = ParameterDescription.create(String.class, "Name", - false, "stalk", "name", "name for future unload"); - ParameterDescription script = ParameterDescription.create(String.class, "Script", - false, "", "script", "script to execute on result"); - map.put("EventCall", e_calls); - map.put("EventRet", e_ret); - map.put("EventExec", e_exec); - map.put("EventBlock", e_block); - map.put("EventCompile", e_compile); - map.put("OnReceive", onReceive); - map.put("OnCallSummary", onCallSummary); - map.put("Name", name); - map.put("Script", script); - return map; - } - - @Override - public CompletableFuture invoke(Map arguments) { - getManager().stalkThread(getTid(), arguments); - return CompletableFuture.completedFuture(null); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetUnloadScriptImpl.java b/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetUnloadScriptImpl.java deleted file mode 100644 index fd66b4bc31..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/java/agent/frida/model/methods/FridaModelTargetUnloadScriptImpl.java +++ /dev/null @@ -1,71 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.methods; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import agent.frida.model.iface1.FridaModelTargetMethod; -import agent.frida.model.iface2.FridaModelTargetObject; -import agent.frida.model.impl.FridaModelTargetObjectImpl; -import ghidra.dbg.target.TargetMethod; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetElementType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; - -@TargetObjectSchemaInfo( - name = "UnloadScript", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(type = Void.class) - }, - canonicalContainer = true) -public class FridaModelTargetUnloadScriptImpl extends FridaModelTargetObjectImpl - implements FridaModelTargetMethod { - - protected final TargetParameterMap paramDescs; - private String target; - - public FridaModelTargetUnloadScriptImpl(FridaModelTargetObject object, String target) { - super(object.getModel(), object, "unload", "UnloadScript"); - this.target = target; - - changeAttributes(List.of(), List.of(), Map.of( // - TargetMethod.PARAMETERS_ATTRIBUTE_NAME, - paramDescs = TargetParameterMap.copyOf(computeParameters()) // - ), "Initialized"); - } - - protected Map> computeParameters() { - HashMap> map = - new HashMap>(); - ParameterDescription scriptName = ParameterDescription.create(String.class, "Name", - true, target, "Script", "script to be unloaded"); - map.put("Name", scriptName); - return map; - } - - @Override - public CompletableFuture invoke(Map arguments) { - getManager().unloadPermanentScript((String) arguments.get("Name")); - return CompletableFuture.completedFuture(null); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/main/sh/execjar.sh b/Ghidra/Debug/Debugger-agent-frida/src/main/sh/execjar.sh deleted file mode 100644 index 26738bd11d..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/main/sh/execjar.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/bash -## ### -# IP: GHIDRA -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -## -# This clever bit can be prepended to a JAR to make it self-executable - -set -e - -java -jar "$0" ${@:1} -exit diff --git a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/AbstractFridaModelHost.java b/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/AbstractFridaModelHost.java deleted file mode 100644 index 574dbf169e..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/AbstractFridaModelHost.java +++ /dev/null @@ -1,27 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model; - -import java.util.Map; - -import ghidra.dbg.test.AbstractModelHost; - -public abstract class AbstractFridaModelHost extends AbstractModelHost { - @Override - public Map getFactoryOptions() { - return Map.ofEntries(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/AbstractModelForFridaActivationTest.java b/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/AbstractModelForFridaActivationTest.java deleted file mode 100644 index ea472fbefd..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/AbstractModelForFridaActivationTest.java +++ /dev/null @@ -1,127 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model; - -import static org.junit.Assume.*; - -import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; - -import org.junit.Ignore; -import org.junit.Test; - -import generic.Unique; -import ghidra.dbg.target.*; -import ghidra.dbg.test.AbstractDebuggerModelActivationTest; -import ghidra.dbg.util.PathPattern; - -/** - * Test model object activation and focus - * - *

- * Activation and focus are related but separate concepts. Focus is a little looser, and is allowed - * by the model to exactly match the client's notion of focus, usually indicating the object of the - * user's interest. Activation, however, commands the model to make the given object the "current" - * object. This implies any commands issued to the CLI will affect the active object. The model - * reflects the active object back to the client via focus. This allows the model and client to - * synchronize their "active" objects, while reducing the likelihood of event feedback loops. - * Furthermore, not every object can be activated. For example, activating a register will likely - * result in the containing thread or frame becoming active instead. Or, activating a thread may - * result in its innermost frame becoming active as well. - */ -public abstract class AbstractModelForFridaActivationTest - extends AbstractDebuggerModelActivationTest { - - @Override - @Ignore - @Test - public void testDefaultFocusIsAsExpected() throws Throwable { - // Disabled as of 220609 - List expectedDefaultFocus = getExpectedDefaultActivePath(); - assumeNotNull(expectedDefaultFocus); - m.build(); - - PathPattern pathPattern = new PathPattern(expectedDefaultFocus); - Set activatable = getActivatableThings(); - // The default must be one of the activatable objects - TargetObject obj = Unique.assertOne(activatable.stream() - .filter(f -> pathPattern.matches(f.getPath())) - .collect(Collectors.toList())); - if (m.hasInterpreter()) { - TargetInterpreter interpreter = findInterpreter(); - assertActiveViaInterpreter(obj, interpreter); - } - } - - @Override - @Ignore - @Test - public void testActivateEachOnce() throws Throwable { - // Disabled as of 220609 - m.build(); - - TargetActiveScope activeScope = findActiveScope(); - Set activatable = getActivatableThings(); - for (TargetObject obj : activatable) { - waitOn(activeScope.requestActivation(obj)); - if (m.hasInterpreter()) { - TargetInterpreter interpreter = findInterpreter(); - assertActiveViaInterpreter(obj, interpreter); - } - } - - } - - @Override - @Ignore - @Test - public void testActivateEachTwice() throws Throwable { - // Disabled as of 220609 - m.build(); - - TargetActiveScope activeScope = findActiveScope(); - Set activatable = getActivatableThings(); - for (TargetObject obj : activatable) { - waitOn(activeScope.requestActivation(obj)); - if (m.hasInterpreter()) { - TargetInterpreter interpreter = findInterpreter(); - assertActiveViaInterpreter(obj, interpreter); - } - waitOn(activeScope.requestActivation(obj)); - if (m.hasInterpreter()) { - TargetInterpreter interpreter = findInterpreter(); - assertActiveViaInterpreter(obj, interpreter); - } - } - } - - @Override - @Ignore - @Test - public void testActivateEachViaInterpreter() throws Throwable { - // Disabled as of 220609 - assumeTrue(m.hasInterpreter()); - m.build(); - - Set activatable = getActivatableThings(); - TargetInterpreter interpreter = findInterpreter(); - for (TargetObject obj : activatable) { - activateViaInterpreter(obj, interpreter); - assertActiveViaInterpreter(obj, interpreter); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/AbstractModelForFridaFactoryTest.java b/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/AbstractModelForFridaFactoryTest.java deleted file mode 100644 index 8ebd64ea87..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/AbstractModelForFridaFactoryTest.java +++ /dev/null @@ -1,73 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model; - -import java.util.Map; - -import org.junit.Ignore; -import org.junit.Test; - -import ghidra.dbg.test.AbstractDebuggerModelFactoryTest; - -public abstract class AbstractModelForFridaFactoryTest extends AbstractDebuggerModelFactoryTest { - @Override - protected Map getFailingFactoryOptions() { - return Map.ofEntries(); - } - - @Override - @Ignore - @Test - public void testBuildAndClose() throws Throwable { - // Disabled as of 220609 - } - - @Override - @Ignore - @Test - public void testBuildFailingOptionsErr() throws Throwable { - // Disabled as of 220609 - } - - @Override - @Ignore - @Test - public void testPing() throws Throwable { - // Disabled as of 220609 - } - - @Override - @Ignore - @Test - public void testWaitRootAccess() throws Throwable { - // Disabled as of 220609 - } - - @Override - @Ignore - @Test - public void testHasNonEnumerableRootSchema() throws Throwable { - // Disabled as of 220609 - } - - @Override - @Ignore - @Test - public void testNonExistentPathGivesNull() throws Throwable { - // Disabled as of 220609 - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/AbstractModelForFridaInterpreterTest.java b/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/AbstractModelForFridaInterpreterTest.java deleted file mode 100644 index bad76c2ab2..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/AbstractModelForFridaInterpreterTest.java +++ /dev/null @@ -1,101 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model; - -import java.util.List; - -import org.junit.Ignore; -import org.junit.Test; - -import ghidra.dbg.target.TargetProcess; -import ghidra.dbg.test.*; -import ghidra.dbg.util.PathUtils; - -public abstract class AbstractModelForFridaInterpreterTest - extends AbstractDebuggerModelInterpreterTest - implements ProvidesTargetViaLaunchSpecimen { - - @Override - public AbstractDebuggerModelTest getTest() { - return this; - } - - @Override - protected void ensureInterpreterAvailable() throws Throwable { - obtainTarget(); - } - - @Override - protected List seedPath() { - return List.of(); - //return PathUtils.parse("Sessions[1]"); - } - - @Override - public List getExpectedInterpreterPath() { - return PathUtils.parse("Sessions"); - } - - @Override - protected String getEchoCommand(String msg) { - return "result = '" + msg + "';"; - } - - @Override - protected String getQuitCommand() { - return "quit"; - } - - @Override - protected String getAttachCommand() { - return "process attach " + Long.toHexString(dummy.pid); - } - - @Override - protected String getDetachCommand(TargetProcess process) { - return "process detach"; - } - - @Override - protected String getKillCommand(TargetProcess process) { - return "kill"; - } - - @Override - public DebuggerTestSpecimen getAttachSpecimen() { - return FridaLinuxSpecimen.SPIN_STRIPPED; - } - - @Override - public DebuggerTestSpecimen getLaunchSpecimen() { - return FridaLinuxSpecimen.PRINT; - } - - @Override - @Ignore - @Test - public void testExecute() throws Throwable { - // Disabled as of 220609 - } - - @Override - @Ignore - @Test - public void testExecuteCapture() throws Throwable { - // Disabled as of 220609 - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/AbstractModelForFridaMethodsTest.java b/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/AbstractModelForFridaMethodsTest.java deleted file mode 100644 index b46371c964..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/AbstractModelForFridaMethodsTest.java +++ /dev/null @@ -1,301 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model; - -import static org.junit.Assert.*; -import static org.junit.Assume.*; - -import java.util.*; -import java.util.Map.Entry; - -import org.junit.Ignore; -import org.junit.Test; - -import agent.frida.manager.FridaEventsListenerAdapter; -import agent.frida.model.iface2.FridaModelTargetProcess; -import agent.frida.model.iface2.FridaModelTargetSymbol; -import agent.frida.model.impl.*; -import agent.frida.model.methods.*; -import generic.jar.ResourceFile; -import ghidra.dbg.DebugModelConventions; -import ghidra.dbg.DebugModelConventions.AsyncState; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetExecutionStateful.TargetExecutionState; -import ghidra.dbg.test.AbstractDebuggerModelTest; -import ghidra.dbg.test.RequiresLaunchSpecimen; -import ghidra.dbg.util.PathUtils; -import ghidra.framework.Application; -import ghidra.program.model.address.Address; - -public abstract class AbstractModelForFridaMethodsTest extends AbstractDebuggerModelTest - implements RequiresLaunchSpecimen { - - protected NavigableMap symbolsByKey = new TreeMap<>(); - - @Override - public FridaLinuxSpecimen getLaunchSpecimen() { - return FridaLinuxSpecimen.PRINT; - } - - public FridaLinuxSpecimen getPrintSpecimen() { - return FridaLinuxSpecimen.PRINT; - } - - public FridaLinuxSpecimen getStackSpecimen() { - return FridaLinuxSpecimen.STACK; - } - - public FridaLinuxSpecimen getSpinSpecimen() { - return FridaLinuxSpecimen.SPIN_STRIPPED; - } - - protected TargetProcess runTestLaunch(DebuggerTestSpecimen specimen, TargetLauncher launcher) - throws Throwable { - waitAcc(launcher); - waitOn(launcher.launch(specimen.getLauncherArgs())); - - TargetProcess process = retryForProcessRunning(specimen, this); - TargetObject session = process.getParent().getParent(); - TargetModuleContainer modules = m.find(TargetModuleContainer.class, session.getPath()); - TargetModule binMod = (TargetModule) waitOn(m.getAddedWaiter() - .wait(PathUtils.index(modules.getPath(), - ((FridaLinuxSpecimen) specimen).getShortName()))); - - // NB. this heuristic assumes all function bodies are contiguous in memory - TargetSymbolNamespace symbols = m.find(TargetSymbolNamespace.class, binMod.getPath()); - // NB. ONCE is recommended resync mode for module symbols - for (Entry entry : waitOn(symbols.fetchElements()) - .entrySet()) { - symbolsByKey.put(entry.getKey(), entry.getValue().as(TargetSymbol.class)); - } - - return process; - } - - protected void runTestResume(DebuggerTestSpecimen specimen) throws Throwable { - TargetProcess process = retryForProcessRunning(specimen, this); - TargetResumable resumable = m.suitable(TargetResumable.class, process.getPath()); - AsyncState state = - new AsyncState(m.suitable(TargetExecutionStateful.class, process.getPath())); - TargetExecutionState st = waitOn(state.waitUntil(s -> s != TargetExecutionState.RUNNING)); - assertTrue(st.isAlive()); - waitOn(resumable.resume()); - retryVoid(() -> assertTrue(DebugModelConventions.isProcessAlive(process)), - List.of(AssertionError.class)); - } - - @Override - protected void runTestKill(DebuggerTestSpecimen specimen) throws Throwable { - TargetProcess process = retryForProcessRunning(specimen, this); - TargetKillable killable = m.suitable(TargetKillable.class, process.getPath()); - waitOn(killable.kill()); - } - - protected void runTestLaunchThenResume(TargetLauncher launcher) throws Throwable { - DebuggerTestSpecimen specimen = getPrintSpecimen(); - assertNull(getProcessRunning(specimen, this)); - runTestLaunch(specimen, launcher); - runTestResumeTerminates(specimen); - } - - @Ignore - @Test - public void testLaunchResumeKill() throws Throwable { - // Disabled as of 220609 - assumeTrue(m.hasKillableProcesses()); - m.build(); - - TargetLauncher launcher = findLauncher(); - DebuggerTestSpecimen specimen = getPrintSpecimen(); - assertNull(getProcessRunning(specimen, this)); - runTestLaunch(specimen, launcher); - runTestResume(specimen); - runTestKill(specimen); - } - - @Ignore - @Test - public void testScan() throws Throwable { - // Disabled as of 220609 - assumeTrue(m.hasKillableProcesses()); - m.build(); - - TargetLauncher launcher = findLauncher(); - DebuggerTestSpecimen specimen = getPrintSpecimen(); - assertNull(getProcessRunning(specimen, this)); - TargetProcess process = runTestLaunch(specimen, launcher); - - FridaModelTargetProcess fproc = (FridaModelTargetProcess) process; - ConsoleEventListener listener = new ConsoleEventListener("Found match at"); - fproc.getManager().addEventsListener(listener); - - FridaModelTargetMemoryContainerImpl memory = - (FridaModelTargetMemoryContainerImpl) fproc.getCachedAttribute("Memory"); - FridaModelTargetMemoryScanImpl scan = - (FridaModelTargetMemoryScanImpl) memory.getCachedAttribute("scan"); - Map map = new HashMap<>(); - Address address = symbolsByKey.get("overwrite").getValue(); - map.put("Address", address.toString()); - map.put("Size", 10L); - map.put("Pattern", "48 65 6C 6C 6F"); - map.put("Stop", true); - scan.invoke(map); - - waitForCondition(() -> { - return listener.foundMatch(); - }, "Console output timed out"); - assertTrue(listener.getMatchingOutput().contains(address.toString())); - runTestKill(specimen); - } - - @Ignore - @Test - public void testWatch() throws Throwable { - assumeTrue(m.hasKillableProcesses()); - m.build(); - - TargetLauncher launcher = findLauncher(); - DebuggerTestSpecimen specimen = getPrintSpecimen(); - assertNull(getProcessRunning(specimen, this)); - TargetProcess process = runTestLaunch(specimen, launcher); - - FridaModelTargetProcess fproc = (FridaModelTargetProcess) process; - ConsoleEventListener listener = new ConsoleEventListener("read"); - fproc.getManager().addEventsListener(listener); - - FridaModelTargetMemoryContainerImpl memory = - (FridaModelTargetMemoryContainerImpl) fproc.getCachedAttribute("Memory"); - FridaModelTargetMemoryWatchImpl watch = - (FridaModelTargetMemoryWatchImpl) memory.getCachedAttribute("watch"); - Map map = new HashMap<>(); - Address address = symbolsByKey.get("overwrite").getValue(); - map.put("Address", address.toString()); - map.put("Size", 1L); - ResourceFile script = Application.getModuleDataFile("/scripts/onAccess.js"); - map.put("OnAccess", script.getAbsolutePath()); - watch.invoke(map); - runTestResume(specimen); - - waitForCondition(() -> { - return listener.foundMatch(); - }, "Console output timed out"); - assertTrue(listener.getMatchingOutput().contains(address.toString())); - runTestKill(specimen); - } - - @Ignore - @Test - public void testInterceptor() throws Throwable { - // Disabled as of 220609 - assumeTrue(m.hasKillableProcesses()); - m.build(); - - TargetLauncher launcher = findLauncher(); - DebuggerTestSpecimen specimen = getStackSpecimen(); - assertNull(getProcessRunning(specimen, this)); - TargetProcess process = runTestLaunch(specimen, launcher); - - FridaModelTargetProcess fproc = (FridaModelTargetProcess) process; - ConsoleEventListener listener = new ConsoleEventListener("entering"); - fproc.getManager().addEventsListener(listener); - - Map map = new HashMap<>(); - FridaModelTargetSymbol symbol = (FridaModelTargetSymbol) symbolsByKey.get("break_here"); - FridaModelTargetFunctionInterceptorImpl intercept = - (FridaModelTargetFunctionInterceptorImpl) symbol.getCachedAttribute("intercept"); - ResourceFile script = Application.getModuleDataFile("/scripts/onEnter.js"); - map.put("OnEnter", script.getAbsolutePath()); - map.put("OnLeave", ""); - intercept.invoke(map); - runTestResume(specimen); - - waitForCondition(() -> { - return listener.foundMatch(); - }, "Console output timed out"); - runTestKill(specimen); - } - - @Ignore - @Test - public void testStalker() throws Throwable { - // Disabled as of 220609 - assumeTrue(m.hasKillableProcesses()); - m.build(); - - TargetLauncher launcher = findLauncher(); - DebuggerTestSpecimen specimen = getSpinSpecimen(); - assertNull(getProcessRunning(specimen, this)); - TargetProcess process = runTestLaunch(specimen, launcher); - - FridaModelTargetProcess fproc = (FridaModelTargetProcess) process; - waitOn(fproc.resume()); - ConsoleEventListener listener = new ConsoleEventListener(":1"); - fproc.getManager().addEventsListener(listener); - FridaModelTargetThreadContainerImpl threads = - (FridaModelTargetThreadContainerImpl) fproc.getCachedAttribute("Threads"); - Map elements = - (Map) waitOn(threads.fetchElements()); - FridaModelTargetThreadImpl thread = - (FridaModelTargetThreadImpl) elements.values().iterator().next(); - - Map map = new HashMap<>(); - FridaModelTargetThreadStalkImpl stalk = - (FridaModelTargetThreadStalkImpl) thread.getCachedAttribute("stalk"); - ResourceFile script = Application.getModuleDataFile("/scripts/onCallSummary.js"); - map.put("OnCallSummary", script.getAbsolutePath()); - map.put("EventCall", true); - map.put("EventRet", false); - map.put("EventExec", false); - map.put("EventBlock", false); - map.put("EventCompile", false); - map.put("OnReceive", ""); - stalk.invoke(map); - //runTestResume(specimen); - - waitForCondition(() -> { - return listener.foundMatch(); - }, "Console output timed out"); - runTestKill(specimen); - } - - private class ConsoleEventListener implements FridaEventsListenerAdapter { - - private String match; - private boolean foundMatch = false; - private String matchingOutput; - - public ConsoleEventListener(String match) { - this.match = match; - } - - @Override - public void consoleOutput(String output, int mask) { - if (output.contains(match)) { - foundMatch = true; - matchingOutput = output; - } - } - - public boolean foundMatch() { - return foundMatch; - } - - public String getMatchingOutput() { - return matchingOutput; - } - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/AbstractModelForFridaRootAttacherTest.java b/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/AbstractModelForFridaRootAttacherTest.java deleted file mode 100644 index 253c4d260c..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/AbstractModelForFridaRootAttacherTest.java +++ /dev/null @@ -1,164 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model; - -import static org.junit.Assert.*; - -import java.util.List; -import java.util.concurrent.TimeUnit; - -import org.junit.*; - -import agent.frida.model.iface1.FridaModelTargetKillable; -import ghidra.dbg.DebugModelConventions; -import ghidra.dbg.error.DebuggerIllegalArgumentException; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetMethod.TargetParameterMap; -import ghidra.dbg.test.AbstractDebuggerModelAttacherTest; -import ghidra.dbg.util.PathUtils; -import ghidra.util.Msg; - -public abstract class AbstractModelForFridaRootAttacherTest - extends AbstractDebuggerModelAttacherTest { - - @Override - public List getExpectedAttachableContainerPath() { - return List.of("Available"); - } - - @Override - public List getExpectedAttacherPath() { - return PathUtils.parse(""); - } - - @Override - public DebuggerTestSpecimen getAttachSpecimen() { - return FridaLinuxSpecimen.SPIN_STRIPPED; - } - - @Override - public TargetParameterMap getExpectedAttachParameters() { - return null; - } - - @Override - public void assertEnvironment(TargetEnvironment environment) { - assertTrue(environment.getArchitecture().startsWith("x64")); - assertTrue(environment.getDebugger().toLowerCase().contains("frida")); - } - - @Override - @Ignore - @After - public void tearDownDebuggerModelTest() throws Throwable { - // Disabled as of 220609 - /** - * NB. Model has to be closed before dummy. If dummy is suspended by a debugger, terminating - * it, even forcibly, may fail. - */ - if (m != null) { - m.close(); - } - if (dummy != null) { - if (!dummy.process.destroyForcibly().waitFor(1000, TimeUnit.MILLISECONDS)) { - Msg.error(this, "Could not terminate process " + dummy.process.pid()); - //throw new TimeoutException("Could not terminate process " + pid); - } - //dummy.close(); - } - } - - @Override - @Ignore - @Test - public void testAttachByPidThenResumeInterrupt() throws Throwable { - } - - @Override - @Ignore - @Test - public void testAttachByPidThenKill() throws Throwable { - } - - @Override - protected void runTestKill(DebuggerTestSpecimen specimen) - throws Throwable { - TargetProcess process = retryForProcessRunning(specimen, this); - FridaModelTargetKillable killable = - (FridaModelTargetKillable) m.suitable(TargetKillable.class, process.getPath()); - waitAcc(killable); - waitOn(killable.destroy()); - retryVoid(() -> assertFalse(DebugModelConventions.isProcessAlive(process)), - List.of(AssertionError.class)); - } - - @Override - @Ignore - @Test - public void testAttacherIsWhereExpected() throws Throwable { - // Disabled as of 220609 - } - - @Override - @Ignore - @Test - public void testAttachableContainerIsWhereExpected() throws Throwable { - // Disabled as of 220609 - } - - @Override - @Ignore - @Test - public void testListAttachable() throws Throwable { - // Disabled as of 220609 - } - - @Override - @Ignore - @Test - public void testAttachByPid() throws Throwable { - // Disabled as of 220609 - } - - @Override - @Ignore - @Test - public void testAttachByObj() throws Throwable { - // Disabled as of 220609 - } - - @Override - @Ignore - @Test(expected = DebuggerIllegalArgumentException.class) - public void testAttachByObjBogusThrowsException() throws Throwable { - // Disabled as of 220609 - } - - @Override - @Ignore - @Test - public void testAttachByPidThenDetach() throws Throwable { - // Disabled as of 220609 - } - - @Override - @Ignore - @Test - public void testAttachShowsInProcessContainer() throws Throwable { - // Disabled as of 220609 - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/AbstractModelForFridaRootLauncherTest.java b/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/AbstractModelForFridaRootLauncherTest.java deleted file mode 100644 index e24606daa6..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/AbstractModelForFridaRootLauncherTest.java +++ /dev/null @@ -1,130 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model; - -import static org.junit.Assert.*; - -import java.util.List; -import java.util.Map; - -import org.junit.Ignore; -import org.junit.Test; - -import ghidra.dbg.DebugModelConventions.AsyncState; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetExecutionStateful.TargetExecutionState; -import ghidra.dbg.target.TargetMethod.ParameterDescription; -import ghidra.dbg.target.TargetMethod.TargetParameterMap; -import ghidra.dbg.test.AbstractDebuggerModelLauncherTest; -import ghidra.dbg.util.PathUtils; - -public abstract class AbstractModelForFridaRootLauncherTest - extends AbstractDebuggerModelLauncherTest { - - @Override - public List getExpectedLauncherPath() { - return PathUtils.parse(""); - } - - @Override - public DebuggerTestSpecimen getLaunchSpecimen() { - return FridaLinuxSpecimen.PRINT; - } - - @Override - public TargetParameterMap getExpectedLauncherParameters() { - return TargetParameterMap.copyOf(Map.ofEntries( - Map.entry("args", ParameterDescription.create(String.class, "args", true, "", - "Command Line", "space-separated command-line arguments")))); - } - - @Override - public void assertEnvironment(TargetEnvironment environment) { - assertEquals("x64", environment.getArchitecture()); - //assertTrue(environment.getOperatingSystem().startsWith("macos")); - assertTrue(environment.getDebugger().toLowerCase().contains("frida")); - } - - @Override - protected void runTestDetach(DebuggerTestSpecimen specimen) - throws Throwable { - TargetProcess process = retryForProcessRunning(specimen, this); - TargetDetachable detachable = m.suitable(TargetDetachable.class, process.getPath()); - waitAcc(detachable); - waitOn(detachable.detach()); - } - - @Override - protected void runTestResumeTerminates(DebuggerTestSpecimen specimen) throws Throwable { - TargetProcess process = retryForProcessRunning(specimen, this); - TargetResumable resumable = m.suitable(TargetResumable.class, process.getPath()); - AsyncState state = - new AsyncState(m.suitable(TargetExecutionStateful.class, process.getPath())); - TargetExecutionState st = waitOn(state.waitUntil(s -> s == TargetExecutionState.STOPPED)); - assertTrue(st.isAlive()); - waitOn(resumable.resume()); - } - - @Override - @Ignore - @Test - public void testLauncherIsWhereExpected() throws Throwable { - // Disabled as of 220609 - } - - @Override - @Ignore - @Test - public void testLaunchParameters() throws Throwable { - // Disabled as of 220609 - } - - @Override - @Ignore - @Test - public void testLaunch() throws Throwable { - // Disabled as of 220609 - } - - @Override - @Ignore - @Test - public void testLaunchThenDetach() throws Throwable { - // Disabled as of 220609 - } - - @Override - @Ignore - @Test - public void testLaunchThenKill() throws Throwable { - // Disabled as of 220609 - } - - @Override - @Ignore - @Test - public void testLaunchThenResume() throws Throwable { - // Disabled as of 220609 - } - - @Override - @Ignore - @Test - public void testLaunchShowsInProcessContainer() throws Throwable { - // Disabled as of 220609 - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/AbstractModelForFridaScenarioStackTest.java b/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/AbstractModelForFridaScenarioStackTest.java deleted file mode 100644 index 10a3a12d4f..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/AbstractModelForFridaScenarioStackTest.java +++ /dev/null @@ -1,143 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import java.util.List; -import java.util.Map.Entry; - -import org.junit.Ignore; -import org.junit.Test; - -import agent.frida.model.iface2.FridaModelTargetProcess; -import agent.frida.model.impl.FridaModelTargetThreadContainerImpl; - -import java.util.NavigableMap; -import java.util.TreeMap; - -import ghidra.dbg.DebugModelConventions; -import ghidra.dbg.DebugModelConventions.AsyncState; -import ghidra.dbg.target.TargetExecutionStateful; -import ghidra.dbg.target.TargetLauncher; -import ghidra.dbg.target.TargetModule; -import ghidra.dbg.target.TargetModuleContainer; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.TargetProcess; -import ghidra.dbg.target.TargetStack; -import ghidra.dbg.target.TargetStackFrame; -import ghidra.dbg.target.TargetSymbol; -import ghidra.dbg.target.TargetSymbolNamespace; -import ghidra.dbg.test.AbstractDebuggerModelScenarioStackTest; -import ghidra.dbg.util.PathMatcher; -import ghidra.dbg.util.PathPattern; -import ghidra.dbg.util.PathUtils; -import ghidra.program.model.address.Address; -import ghidra.util.Msg; - -public abstract class AbstractModelForFridaScenarioStackTest - extends AbstractDebuggerModelScenarioStackTest { - protected static List expectedSymbols = - List.of("_end", "_end", "_end", "_end"); - protected NavigableMap symbolsByAddress = new TreeMap<>(); - - @Override - protected FridaLinuxSpecimen getSpecimen() { - return FridaLinuxSpecimen.SPIN_STRIPPED; - } - - @Override - //@Ignore // Fails for distributed version - @Ignore - @Test - public void testScenario() throws Throwable { - DebuggerTestSpecimen specimen = getSpecimen(); - m.build(); - - Msg.debug(this, "Launching " + specimen); - TargetLauncher launcher = findLauncher(); - waitOn(launcher.launch(specimen.getLauncherArgs())); - Msg.debug(this, " Done launching"); - TargetProcess process = retryForProcessRunning(specimen, this); - postLaunch(process); - - assertTrue(DebugModelConventions.isProcessAlive(process)); - AsyncState state = - new AsyncState(m.suitable(TargetExecutionStateful.class, process.getPath())); - - assertTrue(state.get().isAlive()); - - FridaModelTargetProcess fproc = (FridaModelTargetProcess) process; - waitOn(fproc.resume()); - FridaModelTargetThreadContainerImpl threads = (FridaModelTargetThreadContainerImpl) fproc.getCachedAttribute("Threads"); - waitOn(threads.fetchElements()); - - TargetStack stack = findStack(process.getPath()); - PathMatcher matcher = stack.getSchema().searchFor(TargetStackFrame.class, true); - PathPattern pattern = matcher.getSingletonPattern(); - assertNotNull("Frames are not clearly indexable", pattern); - assertEquals("Frames are not clearly indexable", 1, pattern.countWildcards()); - // Sort by path should present them innermost to outermost - List frames = retry(() -> { - List result = - List.copyOf(m.findAll(TargetStackFrame.class, stack.getPath(), true).values()); - assertTrue("Fewer than 4 frames", result.size() > 4); - return result; - }, List.of(AssertionError.class)); - for (int i = 0; i < 4; i++) { - TargetStackFrame f = frames.get(i); - validateFramePC(i, f.getProgramCounter()); - } - - } - - @Override - protected void postLaunch(TargetProcess process) throws Throwable { - TargetObject session = process.getParent().getParent(); - TargetModuleContainer modules = m.find(TargetModuleContainer.class, session.getPath()); - // NB. NEVER is recommended resync mode for modules container - // It's not guaranteed to come before process is alive, though - TargetModule binMod = (TargetModule) waitOn(m.getAddedWaiter() - .wait(PathUtils.index(modules.getPath(), getSpecimen().getShortName()))); - - // NB. this heuristic assumes all function bodies are contiguous in memory - TargetSymbolNamespace symbols = m.find(TargetSymbolNamespace.class, binMod.getPath()); - // NB. ONCE is recommended resync mode for module symbols - for (Entry entry : waitOn(symbols.fetchElements()) - .entrySet()) { - symbolsByAddress.put(entry.getValue().as(TargetSymbol.class).getValue(), - entry.getKey()); - } - } - - @Override - protected TargetStack findStack(List seedPath) throws Throwable { - return m.findAny(TargetStack.class, seedPath); - } - - @Override - protected void validateFramePC(int index, Address pc) { - assertEquals(expectedSymbols.get(index), symbolsByAddress.floorEntry(pc).getValue()); - } - - @Override - protected String getBreakpointExpression() { - return null; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/AbstractModelForFridaX64RegistersTest.java b/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/AbstractModelForFridaX64RegistersTest.java deleted file mode 100644 index c7e344abe6..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/AbstractModelForFridaX64RegistersTest.java +++ /dev/null @@ -1,186 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model; - -import static org.junit.Assert.*; -import static org.junit.Assume.*; - -import java.util.*; -import java.util.Map.Entry; - -import org.junit.Ignore; -import org.junit.Test; - -import agent.frida.model.iface2.FridaModelTargetProcess; -import agent.frida.model.impl.FridaModelTargetThreadContainerImpl; -import ghidra.dbg.target.*; -import ghidra.dbg.test.*; -import ghidra.dbg.util.PathUtils; - -public abstract class AbstractModelForFridaX64RegistersTest - extends AbstractDebuggerModelRegistersTest - implements ProvidesTargetViaLaunchSpecimen { - public final Map REG_VALS = Map.ofEntries( - Map.entry("rax", arr("0123456789abcdef")), - Map.entry("rsp", arr("0123456789abcdef"))); - - @Override - public AbstractDebuggerModelTest getTest() { - return this; - } - - @Override - public boolean isRegisterBankAlsoContainer() { - return true; - } - - @Override - public List getExpectedRegisterBankPath(List threadPath) { - return PathUtils.extend(threadPath, PathUtils.parse("Registers")); - } - - @Override - public Map getRegisterWrites() { - return REG_VALS; - } - - @Override - public DebuggerTestSpecimen getLaunchSpecimen() { - return FridaLinuxSpecimen.SPIN_STRIPPED; - } - - @Override - protected TargetObject maybeSubstituteThread(TargetObject target) throws Throwable { - FridaModelTargetProcess fproc = (FridaModelTargetProcess) target; - waitOn(fproc.resume()); - FridaModelTargetThreadContainerImpl threads = - (FridaModelTargetThreadContainerImpl) fproc.getCachedAttribute("Threads"); - waitOn(threads.fetchElements()); - TargetThread thread = findAnyThread(target.getPath()); - return thread == null ? target : thread; - } - - @Override - @Ignore - @Test - public void testRegistersHaveExpectedSizes() throws Throwable { - // Disabled as of 220609 - m.build(); - - TargetObject target = maybeSubstituteThread(obtainTarget()); - Map, TargetRegisterBank> banks = findRegisterBanks(target.getPath()); - for (TargetRegisterBank bank : banks.values()) { - List path = bank.getPath(); - for (Entry ent : getRegisterWrites().entrySet()) { - String regName = ent.getKey(); - Map, TargetRegister> regs = m.findAll(TargetRegister.class, - path, pred -> pred.applyKeys(regName), false); - for (TargetRegister reg : regs.values()) { - assertEquals(ent.getValue().length, (reg.getBitLength() + 7) / 8); - } - } - } - } - - @Override - @Ignore - @Test - public void testRegisterBankIsWhereExpected() throws Throwable { - // Disabled as of 220609 - m.build(); - - TargetObject target = maybeSubstituteThread(obtainTarget()); - List expectedRegisterBankPath = - getExpectedRegisterBankPath(target.getPath()); - assumeNotNull(expectedRegisterBankPath); - - Map, TargetRegisterBank> banks = findRegisterBanks(target.getPath()); - for (TargetRegisterBank bank : banks.values()) { - List path = bank.getPath(); - assertTrue(path.containsAll(expectedRegisterBankPath)); - } - } - - @Override - @Ignore - @Test - public void testReadRegisters() throws Throwable { - // Disabled as of 220609 - m.build(); - - TargetObject target = maybeSubstituteThread(obtainTarget()); - TargetRegisterContainer c = Objects.requireNonNull( - m.findWithIndex(TargetRegisterContainer.class, "0", target.getPath())); - Map, TargetRegisterBank> banks = - m.findAll(TargetRegisterBank.class, c.getPath(), true); - Map exp = getRegisterWrites(); - Map read = new HashMap<>(); - for (TargetRegisterBank bank : banks.values()) { - for (String name : exp.keySet()) { - Map, TargetRegister> regs = m.findAll(TargetRegister.class, - bank.getPath(), pred -> pred.applyKeys(name), false); - for (TargetRegister reg : regs.values()) { - byte[] bytes = waitOn(bank.readRegister(reg)); - read.put(name, bytes); - expectRegisterObjectValue(bank, name, bytes); - assertEquals(exp.get(name).length, bytes.length); - } - } - } - assertEquals("Not all registers were read, or extras were read", exp.keySet(), - read.keySet()); - } - - @Override - @Ignore - @Test - public void testWriteRegisters() throws Throwable { - m.build(); - - TargetObject target = maybeSubstituteThread(obtainTarget()); - TargetRegisterContainer c = Objects.requireNonNull( - m.findWithIndex(TargetRegisterContainer.class, "0", target.getPath())); - Map, TargetRegisterBank> banks = - m.findAll(TargetRegisterBank.class, c.getPath(), true); - Map write = getRegisterWrites(); - Map read = new HashMap<>(); - for (TargetRegisterBank bank : banks.values()) { - for (String name : write.keySet()) { - Map, TargetRegister> regs = m.findAll(TargetRegister.class, - bank.getPath(), pred -> pred.applyKeys(name), false); - for (TargetRegister reg : regs.values()) { - waitOn(bank.writeRegister(reg, write.get(name))); - - // NB. This only really tests the cache, if applicable. A scenario checks for efficacy. - byte[] bytes = waitOn(bank.readRegister(reg)); - read.put(name, bytes); - expectRegisterObjectValue(bank, name, bytes); - assertArrayEquals(write.get(name), bytes); - } - } - } - assertEquals("Not all registers were read, or extras were read", write.keySet(), - read.keySet()); - } - - @Override - @Ignore - @Test - public void testBanksAreContainersConventionIsAsExpected() throws Throwable { - // Disabled as of 220609 - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/FridaLinuxSpecimen.java b/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/FridaLinuxSpecimen.java deleted file mode 100644 index e2ecd08a7c..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/FridaLinuxSpecimen.java +++ /dev/null @@ -1,126 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model; - -import java.util.*; - -import agent.frida.model.iface1.FridaModelTargetAttachable; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetLauncher.TargetCmdLineLauncher; -import ghidra.dbg.test.AbstractDebuggerModelTest; -import ghidra.dbg.test.AbstractDebuggerModelTest.DebuggerTestSpecimen; -import ghidra.dbg.testutil.DebuggerModelTestUtils; -import ghidra.dbg.testutil.DummyProc; -import ghidra.dbg.util.ShellUtils; - -public enum FridaLinuxSpecimen implements DebuggerTestSpecimen, DebuggerModelTestUtils { - SLEEP { - @Override - String getShortName() { - return "sleep"; - } - @Override - String getCommandLine() { - return "sleep 100000"; - } - }, - PRINT { - @Override - String getShortName() { - return "expPrint"; - } - @Override - String getCommandLine() { - return DummyProc.which("expPrint"); - } - }, - REGISTERS { - @Override - String getShortName() { - return "expRegisters"; - } - @Override - String getCommandLine() { - return DummyProc.which("expRegisters"); - } - }, - SPIN_STRIPPED { - @Override - String getShortName() { - return "expSpin"; - } - @Override - String getCommandLine() { - return DummyProc.which("expSpin"); - } - }, - STACK { - @Override - String getShortName() { - return "expStack"; - } - @Override - String getCommandLine() { - return DummyProc.which("expStack"); - } - }; - - abstract String getShortName(); - abstract String getCommandLine(); - - @Override - public DummyProc runDummy() throws Throwable { - return DummyProc.run(ShellUtils.parseArgs(getCommandLine()).toArray(String[]::new)); - } - - @Override - public Map getLauncherArgs() { - return Map.ofEntries( - Map.entry(TargetCmdLineLauncher.CMDLINE_ARGS_NAME, getCommandLine())); - } - - @Override - public List getLaunchScript() { - List script = new ArrayList<>(); - List parsed = ShellUtils.parseArgs(getCommandLine()); - if (parsed.size() > 1) { - script.add("set args " + ShellUtils.generateLine(parsed.subList(1, parsed.size()))); - } - script.add("file " + ShellUtils.generateLine(parsed.subList(0, 1))); - script.add("start"); - return script; - } - - @Override - public boolean isRunningIn(TargetProcess process, AbstractDebuggerModelTest test) - throws Throwable { - String expected = getCommandLine(); - TargetObject session = process.getParent().getParent(); - Collection modules = - test.m.findAll(TargetModule.class, session.getPath(), false).values(); - return modules.stream() - .anyMatch(m -> expected.contains(m.getShortDisplay())); - } - - @Override - public boolean isAttachable(DummyProc dummy, TargetAttachable attachable, - AbstractDebuggerModelTest test) throws Throwable { - waitOn(attachable.fetchAttributes()); - long pid = attachable.getTypedAttributeNowByName( - FridaModelTargetAttachable.PID_ATTRIBUTE_NAME, Long.class, -1L); - return pid == dummy.pid; - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/gadp/GadpFridaModelHost.java b/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/gadp/GadpFridaModelHost.java deleted file mode 100644 index 84496f9b87..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/gadp/GadpFridaModelHost.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.gadp; - -import static org.junit.Assume.assumeFalse; - -import agent.frida.gadp.FridaGadpDebuggerModelFactory; -import agent.frida.model.AbstractFridaModelHost; -import ghidra.dbg.DebuggerModelFactory; -import ghidra.util.SystemUtilities; - -class GadpFridaModelHost extends AbstractFridaModelHost { - @Override - public DebuggerModelFactory getModelFactory() { - assumeFalse("Not ready for CI", SystemUtilities.isInTestingBatchMode()); - return new FridaGadpDebuggerModelFactory(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/gadp/GadpModelForFridaFactoryTest.java b/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/gadp/GadpModelForFridaFactoryTest.java deleted file mode 100644 index 28eea867da..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/gadp/GadpModelForFridaFactoryTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.gadp; - -import org.junit.Ignore; - -import agent.frida.model.AbstractModelForFridaFactoryTest; - -@Ignore("deprecated") -public class GadpModelForFridaFactoryTest extends AbstractModelForFridaFactoryTest { - @Override - public ModelHost modelHost() throws Throwable { - return new GadpFridaModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/gadp/GadpModelForFridaInterpreterTest.java b/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/gadp/GadpModelForFridaInterpreterTest.java deleted file mode 100644 index b506a3bf1f..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/gadp/GadpModelForFridaInterpreterTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.gadp; - -import org.junit.Ignore; -import org.junit.Test; - -import agent.frida.model.AbstractModelForFridaInterpreterTest; -import ghidra.dbg.test.ProvidesTargetViaLaunchSpecimen; - -@Ignore("deprecated") -public class GadpModelForFridaInterpreterTest extends AbstractModelForFridaInterpreterTest - implements ProvidesTargetViaLaunchSpecimen { - @Override - public ModelHost modelHost() throws Throwable { - return new GadpFridaModelHost(); - } - - // Not sure what the behavior for these two should be... - // "file target" will change the process and this isn't handled - // also getLaunchScript in MacOSSpecimen is currently wrong - @Override - @Ignore - @Test - public void testLaunchViaInterpreterShowsInProcessContainer() throws Throwable { - super.testLaunchViaInterpreterShowsInProcessContainer(); - } - - @Override - @Ignore - @Test - public void testAttachViaInterpreterShowsInProcessContainer() throws Throwable { - super.testAttachViaInterpreterShowsInProcessContainer(); - } - - // "quit" does not have the desired behavior - @Override - @Ignore - @Test - public void testExecuteQuit() throws Throwable { - super.testExecuteQuit(); - } - - @Override - @Ignore - @Test - public void testInterpreterIsWhereExpected() throws Throwable { - super.testInterpreterIsWhereExpected(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/gadp/GadpModelForFridaRootLauncherTest.java b/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/gadp/GadpModelForFridaRootLauncherTest.java deleted file mode 100644 index 55f5183943..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/gadp/GadpModelForFridaRootLauncherTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.gadp; - -import org.junit.Ignore; - -import agent.frida.model.AbstractModelForFridaRootLauncherTest; - -@Ignore("deprecated") -public class GadpModelForFridaRootLauncherTest extends AbstractModelForFridaRootLauncherTest { - @Override - public ModelHost modelHost() throws Throwable { - return new GadpFridaModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/gadp/GadpModelForFridaScenarioStackTest.java b/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/gadp/GadpModelForFridaScenarioStackTest.java deleted file mode 100644 index df70819e9b..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/gadp/GadpModelForFridaScenarioStackTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.gadp; - -import org.junit.Ignore; - -import agent.frida.model.AbstractModelForFridaScenarioStackTest; - -@Ignore("deprecated") -public class GadpModelForFridaScenarioStackTest extends AbstractModelForFridaScenarioStackTest { - @Override - public ModelHost modelHost() throws Throwable { - return new GadpFridaModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/gadp/GadpModelForFridaX64RegistersTest.java b/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/gadp/GadpModelForFridaX64RegistersTest.java deleted file mode 100644 index 43ccb22c4d..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/gadp/GadpModelForFridaX64RegistersTest.java +++ /dev/null @@ -1,30 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.gadp; - -import org.junit.Ignore; - -import agent.frida.model.AbstractModelForFridaX64RegistersTest; - -@Ignore("deprecated") -public class GadpModelForFridaX64RegistersTest extends AbstractModelForFridaX64RegistersTest { - - @Override - public ModelHost modelHost() throws Throwable { - return new GadpFridaModelHost(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/invm/InVmFridaModelHost.java b/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/invm/InVmFridaModelHost.java deleted file mode 100644 index 03ea2c3a6e..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/invm/InVmFridaModelHost.java +++ /dev/null @@ -1,27 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.invm; - -import agent.frida.FridaInJvmDebuggerModelFactory; -import agent.frida.model.AbstractFridaModelHost; -import ghidra.dbg.DebuggerModelFactory; - -public class InVmFridaModelHost extends AbstractFridaModelHost { - @Override - public DebuggerModelFactory getModelFactory() { - return new FridaInJvmDebuggerModelFactory(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/invm/InVmModelForFridaFactoryTest.java b/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/invm/InVmModelForFridaFactoryTest.java deleted file mode 100644 index a46c4ebfdc..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/invm/InVmModelForFridaFactoryTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.invm; - -import org.junit.Ignore; -import org.junit.experimental.categories.Category; - -import agent.frida.model.AbstractModelForFridaFactoryTest; -import generic.test.category.NightlyCategory; - -@Ignore("deprecated") -@Category(NightlyCategory.class) // this may actually be an @PortSensitive test -public class InVmModelForFridaFactoryTest extends AbstractModelForFridaFactoryTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmFridaModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/invm/InVmModelForFridaInterpreterTest.java b/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/invm/InVmModelForFridaInterpreterTest.java deleted file mode 100644 index 0268476f31..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/invm/InVmModelForFridaInterpreterTest.java +++ /dev/null @@ -1,67 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.invm; - -import org.junit.Ignore; -import org.junit.Test; -import org.junit.experimental.categories.Category; - -import agent.frida.model.AbstractModelForFridaInterpreterTest; -import generic.test.category.NightlyCategory; -import ghidra.dbg.test.ProvidesTargetViaLaunchSpecimen; - -@Ignore("deprecated") -@Category(NightlyCategory.class) // this may actually be an @PortSensitive test -public class InVmModelForFridaInterpreterTest extends AbstractModelForFridaInterpreterTest - implements ProvidesTargetViaLaunchSpecimen { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmFridaModelHost(); - } - - // Not sure what the behavior for these two should be... - // "file target" will change the process and this isn't handled - // also getLaunchScript in MacOSSpecimen is currently wrong - @Override - @Ignore - @Test - public void testLaunchViaInterpreterShowsInProcessContainer() throws Throwable { - super.testLaunchViaInterpreterShowsInProcessContainer(); - } - - @Override - @Ignore - @Test - public void testAttachViaInterpreterShowsInProcessContainer() throws Throwable { - super.testAttachViaInterpreterShowsInProcessContainer(); - } - - // "quit" does not have the desired behavior - @Override - @Ignore - @Test - public void testExecuteQuit() throws Throwable { - super.testExecuteQuit(); - } - - @Override - @Ignore - @Test - public void testInterpreterIsWhereExpected() throws Throwable { - super.testInterpreterIsWhereExpected(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/invm/InVmModelForFridaMethodsTest.java b/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/invm/InVmModelForFridaMethodsTest.java deleted file mode 100644 index 374d1e2d60..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/invm/InVmModelForFridaMethodsTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.invm; - -import org.junit.Ignore; -import org.junit.experimental.categories.Category; - -import agent.frida.model.AbstractModelForFridaMethodsTest; -import generic.test.category.NightlyCategory; - -@Ignore("deprecated") -@Category(NightlyCategory.class) // this may actually be an @PortSensitive test -public class InVmModelForFridaMethodsTest extends AbstractModelForFridaMethodsTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmFridaModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/invm/InVmModelForFridaRootAttacherTest.java b/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/invm/InVmModelForFridaRootAttacherTest.java deleted file mode 100644 index b84cd70da4..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/invm/InVmModelForFridaRootAttacherTest.java +++ /dev/null @@ -1,44 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.invm; - -import org.junit.Ignore; -import org.junit.Test; -import org.junit.experimental.categories.Category; - -import agent.frida.model.AbstractModelForFridaRootAttacherTest; -import generic.test.category.NightlyCategory; - -@Ignore("deprecated") -@Category(NightlyCategory.class) // this may actually be an @PortSensitive test -public class InVmModelForFridaRootAttacherTest extends AbstractModelForFridaRootAttacherTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmFridaModelHost(); - } - - // NB: These tests need debugger rights, which means either: - // (1) on macos, codesigning the executables - // (2) on linux, "sudo su; echo 0 > /proc/sys/kernel/yama/ptrace_scope" - - @Override - @Ignore // test requires ability to attach by object & frida version requires pid - @Test - public void testAttachByObjBogusThrowsException() throws Throwable { - super.testAttachByObjBogusThrowsException(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/invm/InVmModelForFridaRootLauncherTest.java b/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/invm/InVmModelForFridaRootLauncherTest.java deleted file mode 100644 index 9db202d577..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/invm/InVmModelForFridaRootLauncherTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.invm; - -import org.junit.Ignore; -import org.junit.experimental.categories.Category; - -import agent.frida.model.AbstractModelForFridaRootLauncherTest; -import generic.test.category.NightlyCategory; - -@Ignore("deprecated") -@Category(NightlyCategory.class) // this may actually be an @PortSensitive test -public class InVmModelForFridaRootLauncherTest extends AbstractModelForFridaRootLauncherTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmFridaModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/invm/InVmModelForFridaScenarioStackTest.java b/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/invm/InVmModelForFridaScenarioStackTest.java deleted file mode 100644 index 060f98e276..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/invm/InVmModelForFridaScenarioStackTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.invm; - -import org.junit.Ignore; -import org.junit.experimental.categories.Category; - -import agent.frida.model.AbstractModelForFridaScenarioStackTest; -import generic.test.category.NightlyCategory; - -@Ignore("deprecated") -@Category(NightlyCategory.class) // this may actually be an @PortSensitive test -public class InVmModelForFridaScenarioStackTest extends AbstractModelForFridaScenarioStackTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmFridaModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/invm/InVmModelForFridaX64RegistersTest.java b/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/invm/InVmModelForFridaX64RegistersTest.java deleted file mode 100644 index 01c2c90e0a..0000000000 --- a/Ghidra/Debug/Debugger-agent-frida/src/test/java/agent/frida/model/invm/InVmModelForFridaX64RegistersTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.frida.model.invm; - -import org.junit.Ignore; -import org.junit.experimental.categories.Category; - -import agent.frida.model.AbstractModelForFridaX64RegistersTest; -import generic.test.category.NightlyCategory; - -@Ignore("deprecated") -@Category(NightlyCategory.class) // this may actually be an @PortSensitive test -public class InVmModelForFridaX64RegistersTest extends AbstractModelForFridaX64RegistersTest { - - @Override - public ModelHost modelHost() throws Throwable { - return new InVmFridaModelHost(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/build.gradle b/Ghidra/Debug/Debugger-agent-gdb/build.gradle index a1cb88c35f..79d29ae2ef 100644 --- a/Ghidra/Debug/Debugger-agent-gdb/build.gradle +++ b/Ghidra/Debug/Debugger-agent-gdb/build.gradle @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -23,31 +23,3 @@ apply from: "$rootProject.projectDir/gradle/debugger/hasExecutableJar.gradle" apply plugin: 'eclipse' eclipse.project.name = 'Debug Debugger-agent-gdb' - -dependencies { - api project(':Framework-AsyncComm') - api project(':Framework-Debugging') - api project(':Debugger-gadp') - api project(':Pty') - - testImplementation project(path: ':Pty', configuration: 'testArtifacts') - testImplementation project(path: ':Framework-AsyncComm', configuration: 'testArtifacts') - testImplementation project(path: ':Framework-Debugging', configuration: 'testArtifacts') - testImplementation project(path: ':Debugger-gadp', configuration: 'testArtifacts') -} - -tasks.nodepJar { - manifest { - attributes['Main-Class'] = 'agent.gdb.gadp.GdbGadpServer' - } -} - -tasks.executableJar { - ext.outjar = file("${buildDir}/bin/gadp-agent-gdb") -} - -test { - if ("linux_x86_64".equals(getCurrentPlatformName())) { - dependsOn(":Framework-Debugging:testSpecimenLinux_x86_64") - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/GdbCompatibility.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/GdbCompatibility.java deleted file mode 100644 index 8570e20d61..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/GdbCompatibility.java +++ /dev/null @@ -1,51 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb; - -import java.io.IOException; -import java.lang.ProcessBuilder.Redirect; -import java.util.*; - -import ghidra.dbg.util.ShellUtils; - -public enum GdbCompatibility { - INSTANCE; - - public static boolean checkGdbPresent(String path) { - try { - ProcessBuilder builder = new ProcessBuilder(path, "--version"); - builder.redirectError(Redirect.INHERIT); - builder.redirectOutput(Redirect.INHERIT); - @SuppressWarnings("unused") - Process gdb = builder.start(); - // TODO: Once supported versions are decided, check the version. - return true; - } - catch (IOException e) { - return false; - } - } - - private final Map cache = new HashMap<>(); - - public boolean isCompatible(String gdbCmd) { - List args = ShellUtils.parseArgs(gdbCmd); - if (args.isEmpty()) { - return false; - } - return cache.computeIfAbsent(gdbCmd, p -> checkGdbPresent(args.get(0))); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/GdbInJvmDebuggerModelFactory.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/GdbInJvmDebuggerModelFactory.java deleted file mode 100644 index 4b2a4cbd5d..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/GdbInJvmDebuggerModelFactory.java +++ /dev/null @@ -1,109 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb; - -import java.util.List; -import java.util.concurrent.CompletableFuture; - -import agent.gdb.manager.GdbManager; -import agent.gdb.model.impl.GdbModelImpl; -import ghidra.dbg.DebuggerModelFactory; -import ghidra.dbg.DebuggerObjectModel; -import ghidra.dbg.util.ConfigurableFactory.FactoryDescription; -import ghidra.dbg.util.ShellUtils; -import ghidra.program.model.listing.Program; -import ghidra.pty.PtyFactory; - -@FactoryDescription( - brief = "gdb", - htmlDetails = """ - Connect to gdb. - This is best for most Linux and Unix userspace targets, and many embedded targets. - It may also be used with gdbserver by connecting to gdb, then using target remote - .... - This will access the native API, which may put Ghidra's JVM at risk.""") -public class GdbInJvmDebuggerModelFactory implements DebuggerModelFactory { - - private String gdbCmd = GdbManager.DEFAULT_GDB_CMD; - @FactoryOption("GDB launch command") - public final Property gdbCommandOption = - Property.fromAccessors(String.class, this::getGdbCommand, this::setGdbCommand); - - private boolean existing = false; - @FactoryOption("Use existing session via new-ui") - public final Property useExistingOption = - Property.fromAccessors(boolean.class, this::isUseExisting, this::setUseExisting); - - private boolean useCrlf = System.lineSeparator().equals("\r\n");; - @FactoryOption("Use DOS line endings (unchecked for UNIX and Cygwin))") - public final Property crlfNewLineOption = - Property.fromAccessors(Boolean.class, this::isUseCrlf, this::setUseCrlf); - - @Override - public CompletableFuture build() { - List gdbCmdLine = ShellUtils.parseArgs(gdbCmd); - GdbModelImpl model = new GdbModelImpl(PtyFactory.local()); - if (useCrlf) { - model.setDosNewLine(); - } - else { - model.setUnixNewLine(); - } - return model - .startGDB(existing ? null : gdbCmdLine.get(0), - gdbCmdLine.subList(1, gdbCmdLine.size()).toArray(String[]::new)) - .thenApply(__ -> model); - } - - public boolean isUseCrlf() { - return useCrlf; - } - - public void setUseCrlf(boolean useCrlf) { - this.useCrlf = useCrlf; - } - - @Override - public int getPriority(Program program) { - if (!GdbCompatibility.INSTANCE.isCompatible(gdbCmd)) { - return -1; - } - if (program != null) { - String exe = program.getExecutablePath(); - if (exe == null || exe.isBlank()) { - return -1; - } - } - return 80; - } - - public String getGdbCommand() { - return gdbCmd; - } - - public void setGdbCommand(String gdbCmd) { - this.gdbCmd = gdbCmd; - } - - public boolean isUseExisting() { - return existing; - } - - public void setUseExisting(boolean existing) { - this.existing = existing; - gdbCommandOption.setEnabled(!existing); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/GdbOverSshDebuggerModelFactory.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/GdbOverSshDebuggerModelFactory.java deleted file mode 100644 index 1abea7487f..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/GdbOverSshDebuggerModelFactory.java +++ /dev/null @@ -1,164 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb; - -import java.util.List; -import java.util.concurrent.CompletableFuture; - -import agent.gdb.model.impl.GdbModelImpl; -import ghidra.dbg.DebuggerModelFactory; -import ghidra.dbg.DebuggerObjectModel; -import ghidra.dbg.util.ShellUtils; -import ghidra.dbg.util.ConfigurableFactory.FactoryDescription; -import ghidra.program.model.listing.Program; -import ghidra.pty.ssh.GhidraSshPtyFactory; - -@FactoryDescription( - brief = "gdb via SSH", - htmlDetails = """ - Connect to gdb using SSH. - This is best for remote Linux and Unix userspace targets when gdb is installed on the - remote host.""") -public class GdbOverSshDebuggerModelFactory implements DebuggerModelFactory { - - private String gdbCmd = "/usr/bin/gdb"; - @FactoryOption("GDB launch command") - public final Property gdbCommandOption = - Property.fromAccessors(String.class, this::getGdbCommand, this::setGdbCommand); - - private boolean existing = false; - @FactoryOption("Use existing session via new-ui") - public final Property useExistingOption = - Property.fromAccessors(boolean.class, this::isUseExisting, this::setUseExisting); - - private String hostname = GhidraSshPtyFactory.DEFAULT_HOSTNAME; - @FactoryOption("SSH hostname") - public final Property hostnameOption = - Property.fromAccessors(String.class, this::getHostname, this::setHostname); - - private int port = GhidraSshPtyFactory.DEFAULT_PORT; - @FactoryOption("SSH TCP port") - public final Property portOption = - Property.fromAccessors(Integer.class, this::getPort, this::setPort); - - private String username = GhidraSshPtyFactory.DEFAULT_USERNAME; - @FactoryOption("SSH username") - public final Property usernameOption = - Property.fromAccessors(String.class, this::getUsername, this::setUsername); - - private String configFile = GhidraSshPtyFactory.DEFAULT_CONFIG_FILE; - @FactoryOption("Open SSH config file") - public final Property keyFileOption = - Property.fromAccessors(String.class, this::getConfigFile, this::setConfigFile); - - // Always default to false, despite local system, because remote is likely Linux. - private boolean useCrlf = false; - @FactoryOption("Use DOS line endings (unchecked for UNIX remote)") - public final Property crlfNewLineOption = - Property.fromAccessors(Boolean.class, this::isUseCrlf, this::setUseCrlf); - - @Override - public CompletableFuture build() { - List gdbCmdLine = ShellUtils.parseArgs(gdbCmd); - return CompletableFuture.supplyAsync(() -> { - GhidraSshPtyFactory factory = new GhidraSshPtyFactory(); - factory.setHostname(hostname); - factory.setPort(port); - factory.setConfigFile(configFile); - factory.setUsername(username); - return new GdbModelImpl(factory); - }).thenCompose(model -> { - if (useCrlf) { - model.setDosNewLine(); - } - else { - model.setUnixNewLine(); - } - return model - .startGDB(existing ? null : gdbCmdLine.get(0), - gdbCmdLine.subList(1, gdbCmdLine.size()).toArray(String[]::new)) - .thenApply(__ -> model); - }); - } - - @Override - public int getPriority(Program program) { - if (program != null) { - String exe = program.getExecutablePath(); - if (exe == null || exe.isBlank()) { - return -1; - } - } - return 75; - } - - public String getGdbCommand() { - return gdbCmd; - } - - public void setGdbCommand(String gdbCmd) { - this.gdbCmd = gdbCmd; - } - - public boolean isUseExisting() { - return existing; - } - - public void setUseExisting(boolean existing) { - this.existing = existing; - gdbCommandOption.setEnabled(!existing); - } - - public String getHostname() { - return hostname; - } - - public void setHostname(String hostname) { - this.hostname = hostname; - } - - public int getPort() { - return port; - } - - public void setPort(int port) { - this.port = port; - } - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getConfigFile() { - return configFile; - } - - public void setConfigFile(String configFile) { - this.configFile = configFile; - } - - public boolean isUseCrlf() { - return useCrlf; - } - - public void setUseCrlf(boolean useCrlf) { - this.useCrlf = useCrlf; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/gadp/GdbGadpDebuggerModelFactory.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/gadp/GdbGadpDebuggerModelFactory.java deleted file mode 100644 index 14356d1e88..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/gadp/GdbGadpDebuggerModelFactory.java +++ /dev/null @@ -1,103 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.gadp; - -import java.util.List; - -import agent.gdb.GdbCompatibility; -import agent.gdb.manager.GdbManager; -import ghidra.dbg.gadp.server.AbstractGadpLocalDebuggerModelFactory; -import ghidra.dbg.util.ConfigurableFactory.FactoryDescription; -import ghidra.dbg.util.ShellUtils; -import ghidra.program.model.listing.Program; - -@FactoryDescription( - brief = "gdb via GADP", - htmlDetails = """ - Connect to gdb. - This is best for most Linux and Unix userspace targets, and many embedded targets. - This will protect Ghidra's JVM by using a subprocess to access the native API. - If you are using gdbserver, you must connect to gdb first (consider the non-GADP - connector), then use target remote ... to connect to your target.""") -public class GdbGadpDebuggerModelFactory extends AbstractGadpLocalDebuggerModelFactory { - - private String gdbCmd = GdbManager.DEFAULT_GDB_CMD; - @FactoryOption("GDB launch command") - public final Property gdbCommandOption = - Property.fromAccessors(String.class, this::getGdbCommand, this::setGdbCommand); - - private boolean existing = false; - @FactoryOption("Use existing session via new-ui") - public final Property useExistingOption = - Property.fromAccessors(boolean.class, this::isUseExisting, this::setUseExisting); - - // TODO: newLine option? - - @Override - public int getPriority(Program program) { - if (!GdbCompatibility.INSTANCE.isCompatible(gdbCmd)) { - return -1; - } - if (program != null) { - String exe = program.getExecutablePath(); - if (exe == null || exe.isBlank()) { - return -1; - } - } - return 60; - } - - public String getGdbCommand() { - return gdbCmd; - } - - public void setGdbCommand(String gdbCmd) { - this.gdbCmd = gdbCmd; - } - - public boolean isUseExisting() { - return existing; - } - - public void setUseExisting(boolean existing) { - this.existing = existing; - gdbCommandOption.setEnabled(!existing); - } - - @Override - protected String getThreadName() { - return "Local gdb Agent stdout"; - } - - @Override - protected void completeCommandLine(List cmd) { - List gdbCmdLine = ShellUtils.parseArgs(gdbCmd); - cmd.add(GdbGadpServer.class.getCanonicalName()); - if (!existing && gdbCmdLine.size() >= 2) { - cmd.addAll(gdbCmdLine.subList(1, gdbCmdLine.size())); - } - cmd.add("--agent-args"); - cmd.addAll(List.of("-H", host)); - cmd.addAll(List.of("-p", Integer.toString(port))); // Available ephemeral port - if (!existing && gdbCmdLine.size() >= 1) { - cmd.add("-g"); - cmd.add(gdbCmdLine.get(0)); - } - else { - cmd.add("-x"); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/gadp/GdbGadpServer.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/gadp/GdbGadpServer.java deleted file mode 100644 index 70200ff652..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/gadp/GdbGadpServer.java +++ /dev/null @@ -1,211 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.gadp; - -import java.io.IOException; -import java.net.InetSocketAddress; -import java.net.SocketAddress; -import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutionException; - -import org.apache.commons.lang3.exception.ExceptionUtils; - -import agent.gdb.gadp.impl.GdbGadpServerImpl; -import ghidra.async.AsyncUtils; -import ghidra.dbg.agent.AgentWindow; -import ghidra.util.Msg; - -public interface GdbGadpServer extends AutoCloseable { - public static final String USAGE = - """ - This is the GADP wrapper for GDB. Usage: - - gadp-agent-gdb [GDB options] [--agent-args [-H HOST/ADDR] [-p PORT] - [-g CMD] [-x]] - - Options: - - Use gdb -h for suitable [GDB options] - - THE FOLLOWING OPTIONS MUST BE PRECEDED BY --agent-args - --host/-H The address of the interface on which to listen. Default is - localhost - --port/-p The TCP port on which to listen. Default is 12345. 0 for - automatic. - --gdb-cmd/-g The command to launch gdb. Default is 'gdb' - --existing/-x Do not launch gdb. Instead just open a pty - - Starts a GDB-based GADP server "agent". In general, it can be invoked in the - same manner as standard gdb. Arguments to control the GADP server and GDB - invocation are given after the --gadp-args flag. Once the server has started, it - will print the interface IP and port. The -g and -x flags are mutually - exclusive. The one appearing last get preference. The -x flags causes the agent - to refrain from launching its own gdb process. Instead, it prints the file name - of a pseudo terminal (pty) where it expects a GDB/MI v2 interpreter from an - existing gdb process. Use the new-ui command (available since GDB version 7.12) - to join the agent to the existing session: - - (gdb) new-ui mi2 /dev/ptyXX - """; - - public static void main(String[] args) throws Exception { - try { - new Runner().run(args); - } - catch (Throwable t) { - System.err.println(ExceptionUtils.getMessage(t)); - System.exit(1); - } - } - - public static GdbGadpServer newInstance(SocketAddress addr) throws IOException { - return new GdbGadpServerImpl(addr); - } - - public class Runner { - private String gdbCmd = "gdb"; - private List gdbArgs = new ArrayList<>(); - private InetSocketAddress bindTo; - - public void run(String args[]) - throws IOException, InterruptedException, ExecutionException { - parseArguments(args); - - try (GdbGadpServer server = newInstance(bindTo)) { - server.startGDB(gdbCmd, gdbArgs.toArray(new String[] {})).exceptionally(e -> { - e = AsyncUtils.unwrapThrowable(e); - Msg.error(this, "Error starting GDB/GADP: " + e); - System.exit(-1); - return null; - }); - new AgentWindow("GDB Agent for Ghidra", server.getLocalAddress()); - server.consoleLoop(); - } - System.exit(0); - } - - private void parseArguments(String[] args) { - String iface = "localhost"; - int port = 12345; - // NOTE: Maybe we should import commons-cli (Apache 2.0) or Argparse4j (MIT).... - Iterator ait = Arrays.asList(args).iterator(); - while (ait.hasNext()) { - String a = ait.next(); - if ("--agent-args".equals(a)) { - break; - } - else if ("-h".equals(a) || "--help".equals(a)) { - printUsage(); - System.exit(0); - } - else { - gdbArgs.add(a); - } - } - while (ait.hasNext()) { - String a = ait.next(); - if ("-p".equals(a) || "--port".equals(a)) { - if (!ait.hasNext()) { - System.err.println("Expected PORT"); - printUsage(); - System.exit(-1); - } - String portStr = ait.next(); - try { - port = Integer.parseInt(portStr); - } - catch (NumberFormatException e) { - System.err.println("Integer required. Got " + portStr); - printUsage(); - System.exit(-1); - } - } - else if ("-H".equals(a) || "--host".equals(a)) { - if (!ait.hasNext()) { - System.err.println("Expected HOST/ADDR"); - printUsage(); - System.exit(-1); - } - iface = ait.next(); - } - else if ("-g".equals(a) || "--gdb-cmd".equals(a)) { - if (!ait.hasNext()) { - System.err.println("Expected CMD"); - printUsage(); - System.exit(-1); - } - gdbCmd = ait.next(); - } - else if ("-x".equals(a) || "--existing".equals(a)) { - gdbCmd = null; - } - else { - System.err.println("Unknown option: " + a); - printUsage(); - System.exit(-1); - } - } - bindTo = new InetSocketAddress(iface, port); - } - - private void printUsage() { - System.out.println(USAGE); - } - } - - /** - * Start the GDB session - * - * @param gdbCmd the command to execute GDB - * @param args arguments to pass to GDB, except for -i - * @return a future that completes when GDB is ready - */ - CompletableFuture startGDB(String gdbCmd, String[] args); - - /** - * Get the local address to which the SCTL server is bound. - * - * @return the local socket address - */ - SocketAddress getLocalAddress(); - - /** - * Starts the GDB manager's console loop - * - * @throws IOException if an I/O error occurs - */ - public void consoleLoop() throws IOException; - - /** - * Close all SCTL connections and ports, and terminate the GDB session - * - * @throws IOException if an I/O error occurs - */ - public void terminate() throws IOException; - - /** - * Calls {@link #terminate()} - * - * @throws IOException if an I/O error occurs - */ - @Override - default void close() throws IOException { - terminate(); - } - - void setExitOnClosed(boolean exitOnClosed); -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/gadp/GdbGadpServerLaunchShim.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/gadp/GdbGadpServerLaunchShim.java deleted file mode 100644 index ed51cf4677..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/gadp/GdbGadpServerLaunchShim.java +++ /dev/null @@ -1,37 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.gadp; - -import org.apache.commons.lang3.exception.ExceptionUtils; - -import agent.gdb.gadp.GdbGadpServer.Runner; -import ghidra.GhidraApplicationLayout; -import ghidra.GhidraLaunchable; - -public class GdbGadpServerLaunchShim implements GhidraLaunchable { - - @Override - public void launch(GhidraApplicationLayout layout, String[] args) throws Exception { - try { - new Runner().run(args); - } - catch (Throwable t) { - System.err.println(ExceptionUtils.getMessage(t)); - System.exit(1); - } - } - -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/gadp/impl/GdbGadpServerImpl.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/gadp/impl/GdbGadpServerImpl.java deleted file mode 100644 index ba6ae22066..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/gadp/impl/GdbGadpServerImpl.java +++ /dev/null @@ -1,68 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.gadp.impl; - -import java.io.IOException; -import java.net.SocketAddress; -import java.util.concurrent.CompletableFuture; - -import agent.gdb.gadp.GdbGadpServer; -import agent.gdb.model.impl.GdbModelImpl; -import ghidra.dbg.gadp.server.AbstractGadpServer; -import ghidra.pty.PtyFactory; - -public class GdbGadpServerImpl implements GdbGadpServer { - public class GadpSide extends AbstractGadpServer { - public GadpSide(GdbModelImpl model, SocketAddress addr) throws IOException { - super(model, addr); - } - } - - protected final GdbModelImpl model; - protected final GadpSide server; - - public GdbGadpServerImpl(SocketAddress addr) throws IOException { - super(); - this.model = new GdbModelImpl(PtyFactory.local()); - this.server = new GadpSide(model, addr); - } - - @Override - public CompletableFuture startGDB(String gdbCmd, String[] args) { - return model.startGDB(gdbCmd, args).thenCompose(__ -> server.launchAsyncService()); - } - - @Override - public SocketAddress getLocalAddress() { - return server.getLocalAddress(); - } - - @Override - public void consoleLoop() throws IOException { - model.consoleLoop(); - } - - @Override - public void terminate() throws IOException { - model.terminate(); - server.terminate(); - } - - @Override - public void setExitOnClosed(boolean exitOnClosed) { - server.setExitOnClosed(exitOnClosed); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbCause.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbCause.java deleted file mode 100644 index 2b1c5e7797..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbCause.java +++ /dev/null @@ -1,36 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager; - -import agent.gdb.manager.impl.GdbPendingCommand; - -/** - * Identifies the cause of an event emitted by GDB - * - *

- * This is not a concept native to GDB. Rather, it is a means to distinguish events that result from - * commands issued by the {@link GdbManager} from those issued by the user or some other means. For - * example, a call to {@link GdbManager#addInferior()} will emit a - * {@link GdbEventsListener#inferiorAdded(GdbInferior, GdbCause)} event, identifying the - * {@link GdbPendingCommand} as the cause. However, a call to {@link GdbManager#console(String)} - * issuing an "add-inferior" command will emit the same event, but the cause will be - * {@link GdbCause.Causes#UNCLAIMED}. - */ -public interface GdbCause { - public enum Causes implements GdbCause { - UNCLAIMED; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbConsoleOperations.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbConsoleOperations.java deleted file mode 100644 index bd20bde21a..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbConsoleOperations.java +++ /dev/null @@ -1,70 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager; - -import java.util.concurrent.CompletableFuture; - -import agent.gdb.manager.impl.cmd.GdbConsoleExecCommand.CompletesWithRunning; - -public interface GdbConsoleOperations { - /** - * Execute an arbitrary CLI command, printing output to the CLI console - * - *

- * The command is executed in the context of this object. If more specific context is necessary, - * it will take from whatever happens to be selected, e.g., the current thread. - * - * @param command the command to execute - * @param cwr specifies expected state change behavior - * @return a future that completes when GDB has executed the command - */ - CompletableFuture console(String command, CompletesWithRunning cwr); - - /** - * Equivalent to {@link #console(String, CompletesWithRunning)} with no behavior restriction - * - * @param command the command to execute - * @return a future that completes when GDB has executed the command - */ - default CompletableFuture console(String command) { - return console(command, CompletesWithRunning.CAN); - } - - /** - * Execute an arbitrary CLI command, capturing its console output - * - *

- * The output will not be printed to the CLI console. The command is executed in the context of - * this object. If more specific context is necessary, it will take from whatever happens to be - * selected, e.g., the current thread. - * - * @param command the command to execute - * @param cwr specifies expected state change behavior - * @return a future that completes with the captured output when GDB has executed the command - */ - CompletableFuture consoleCapture(String command, CompletesWithRunning cwr); - - /** - * Equivalent to {@link #consoleCapture(String, CompletesWithRunning)} with no behavior - * restriction - * - * @param command the command to execute - * @return a future that completes with the captured output when GDB has executed the command - */ - default CompletableFuture consoleCapture(String command) { - return consoleCapture(command, CompletesWithRunning.CAN); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbConsoleOutputListener.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbConsoleOutputListener.java deleted file mode 100644 index 8a8d9692a8..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbConsoleOutputListener.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager; - -import agent.gdb.manager.GdbManager.Channel; - -public interface GdbConsoleOutputListener { - /** - * GDB outputted some text - * - * @param channel indicates stderr or stdout - * @param out the output - */ - void output(Channel channel, String out); -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbContextualOperations.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbContextualOperations.java deleted file mode 100644 index a749a4570a..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbContextualOperations.java +++ /dev/null @@ -1,50 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager; - -import java.math.BigInteger; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.CompletableFuture; - -public interface GdbContextualOperations extends GdbConsoleOperations { - /** - * Evaluate an expression - * - * This evaluates an expression in the same way that the CLI commands {@code print}, - * {@code output}, and {@code call} would. - * - * @param expression the expression to evaluate - * @return a future that completes with the string representation of the value - */ - CompletableFuture evaluate(String expression); - - /** - * Read the values of a given set of registers - * - * @param regs the set of registers - * @return a future that completes with a map of register descriptors to value - */ - CompletableFuture> readRegisters(Set regs); - - /** - * Write the values of a given set of registers - * - * @param regVals a map of register descriptors to value - * @return a future that completes when the registers have been written - */ - CompletableFuture writeRegisters(Map regVals); -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbEventsListener.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbEventsListener.java deleted file mode 100644 index 1dde22bdb3..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbEventsListener.java +++ /dev/null @@ -1,197 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager; - -import java.util.Collection; - -import agent.gdb.manager.breakpoint.GdbBreakpointInfo; -import agent.gdb.manager.reason.GdbReason; - -/** - * A listener for events related to objects known to the manager - */ -public interface GdbEventsListener { - - /** - * An inferior has been added to the session - * - * @param inferior a handle to the new inferior - * @param cause the cause of this event - */ - void inferiorAdded(GdbInferior inferior, GdbCause cause); - - /** - * An inferior has been removed from the session - * - * @param inferiorId the ID of the now-defunct inferior - * @param cause the cause of this event - */ - void inferiorRemoved(int inferiorId, GdbCause cause); - - /** - * A different inferior has been selected (gained focus) - * - * @param inferior a handle to the selected inferior - * @param cause the cause of this event - */ - void inferiorSelected(GdbInferior inferior, GdbCause cause); - - /** - * Execution has been started in an inferior - * - * @param inferior a handle to the now-executing inferior - * @param cause the cause of this event - */ - void inferiorStarted(GdbInferior inferior, GdbCause cause); - - /** - * Execution has terminated in an inferior - * - * @param inferior a handle to the now-stopped inferior - * @param cause the cause of this event - */ - void inferiorExited(GdbInferior inferior, GdbCause cause); - - /** - * An inferior's state has changed - * - * Note this event is also parceled out to each affected thread via - * {@link #threadStateChanged(GdbThread, GdbState, GdbCause, GdbReason)} immediately after this - * callback. - * - * @param inf the inferior which is running - * @param threads the threads of the inferior whose states have changed - * @param state the state to which the inferior changed - * @param thread if applicable, the thread which caused the change to {@link GdbState#STOPPED} - * @param cause the cause of this event - * @param reason the reason for the state change - */ - void inferiorStateChanged(GdbInferior inf, Collection threads, GdbState state, - GdbThread thread, - GdbCause cause, GdbReason reason); - - /** - * A thread has been created - * - * Use {@link GdbThread#getInferior()} to get a handle to the inferior in which the thread was - * created. - * - * @param thread a handle to the new thread - * @param cause the cause of this event - */ - void threadCreated(GdbThread thread, GdbCause cause); - - /** - * A thread's state has changed, e.g., {@link GdbState#RUNNING} to {@link GdbState#STOPPED} - * - * @param thread a handle to the thread whose state has changed - * @param state the state to which the thread changed - * @param cause the cause of this event - * @param reason the reason for the state change - */ - void threadStateChanged(GdbThread thread, GdbState state, GdbCause cause, GdbReason reason); - - /** - * A thread has exited - * - * @param threadId the ID of the now-defuct thread - * @param inferior a handle to the inferior to which the thread belonged - * @param cause the cause of this event - */ - void threadExited(int threadId, GdbInferior inferior, GdbCause cause); - - /** - * A different thread has been selected (gained focus) - * - * @param thread a handle to the selected thread - * @param frame a handle to the current frame - * @param cause the cause of this event - */ - void threadSelected(GdbThread thread, GdbStackFrame frame, GdbCause cause); - - /** - * A library has been loaded by an inferior - * - * @param inferior a handle to the inferior which loaded the library - * @param name the name of the library on the target - * @param cause the cause of this event - */ - void libraryLoaded(GdbInferior inferior, String name, GdbCause cause); - - /** - * A library has been unloaded from an inferior - * - * @param inferior a handle to the inferior which unloaded the library - * @param name the name of the library on the target - * @param cause the cause of this event - */ - void libraryUnloaded(GdbInferior inferior, String name, GdbCause cause); - - /** - * A breakpoint has been created in the session - * - * @param info information about the new breakpoint - * @param cause the cause of this event - */ - void breakpointCreated(GdbBreakpointInfo info, GdbCause cause); - - /** - * A breakpoint in the session has been modified - * - * @param newInfo new information about the modified breakpoint - * @param oldInfo old information about the modified breakpoint - * @param cause the cause of this event - */ - void breakpointModified(GdbBreakpointInfo newInfo, GdbBreakpointInfo oldInfo, GdbCause cause); - - /** - * A breakpoint has been deleted from the session - * - * @param info information about the now-deleted breakpoint - * @param cause the cause of this event - */ - void breakpointDeleted(GdbBreakpointInfo info, GdbCause cause); - - /** - * The user has changed the target memory - * - *

- * This event is emitted only when GDB changes the target's memory, usually because of a user - * command. It does not get emitted when the target changes its own memory. - * - * @param inferior the inferior whose memory changed - * @param addr the address of the change - * @param len the length, with the address, bounding the region of change - * @param cause the cause of this event - */ - void memoryChanged(GdbInferior inferior, long addr, int len, GdbCause cause); - - /** - * The user has changed a GDB parameter, typically via a {@code set} command - * - *

- * Unfortunately, this does not detect the real value of "{@code auto}"-valued parameters. For - * example, If the user types {@code set arch auto}, this will report the change of "arch" to - * "auto." However, suppose the user then types {@code file echo}, referring to an x86-64 - * executable. This will not report the arch automatically detected by GDB. It's still - * just "auto." - * - * @param param the name of the parameter whose value changed - * @param value the new value of the parameter - * @param cause the cause of this event - */ - void paramChanged(String param, String value, GdbCause cause); -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbEventsListenerAdapter.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbEventsListenerAdapter.java deleted file mode 100644 index 8db4b1c065..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbEventsListenerAdapter.java +++ /dev/null @@ -1,99 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager; - -import java.util.Collection; - -import agent.gdb.manager.breakpoint.GdbBreakpointInfo; -import agent.gdb.manager.reason.GdbReason; - -/** - * An adapter for {@link GdbEventsListener} - * - * This provides an empty default implementation of each method. - */ -public interface GdbEventsListenerAdapter extends GdbEventsListener { - @Override - default void inferiorAdded(GdbInferior inferior, GdbCause cause) { - } - - @Override - default void inferiorRemoved(int inferiorId, GdbCause cause) { - } - - @Override - default void inferiorSelected(GdbInferior inferior, GdbCause cause) { - } - - @Override - default void inferiorStarted(GdbInferior inferior, GdbCause cause) { - } - - @Override - default void inferiorExited(GdbInferior inferior, GdbCause cause) { - } - - @Override - default void inferiorStateChanged(GdbInferior inf, Collection threads, - GdbState state, GdbThread thread, GdbCause cause, GdbReason reason) { - } - - @Override - default void threadCreated(GdbThread thread, GdbCause cause) { - } - - @Override - default void threadStateChanged(GdbThread thread, GdbState state, GdbCause cause, - GdbReason reason) { - } - - @Override - default void threadExited(int threadId, GdbInferior inferior, GdbCause cause) { - } - - @Override - default void threadSelected(GdbThread thread, GdbStackFrame frame, GdbCause cause) { - } - - @Override - default void libraryLoaded(GdbInferior inferior, String name, GdbCause cause) { - } - - @Override - default void libraryUnloaded(GdbInferior inferior, String name, GdbCause cause) { - } - - @Override - default void breakpointCreated(GdbBreakpointInfo info, GdbCause cause) { - } - - @Override - default void breakpointModified(GdbBreakpointInfo newInfo, GdbBreakpointInfo oldInfo, - GdbCause cause) { - } - - @Override - default void breakpointDeleted(GdbBreakpointInfo info, GdbCause cause) { - } - - @Override - default void memoryChanged(GdbInferior inferior, long addr, int len, GdbCause cause) { - } - - @Override - default void paramChanged(String param, String value, GdbCause cause) { - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbInferior.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbInferior.java deleted file mode 100644 index 9e17934fd5..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbInferior.java +++ /dev/null @@ -1,328 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager; - -import java.math.BigInteger; -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import agent.gdb.manager.GdbManager.StepCmd; -import agent.gdb.manager.impl.GdbMemoryMapping; - -/** - * A handle to a GDB inferior - * - *

- * Each inferior controlled by GDB is numbered and usually corresponds to a target process. Methods - * that return a {@link CompletableFuture} send a command to GDB via its GDB/MI interpreter. Each - * method issuing a command will first change focus to this inferior. The returned future completes - * when GDB has finished executing the command. - */ -public interface GdbInferior extends GdbConsoleOperations, GdbMemoryOperations { - - /** - * Get the GDB-assigned inferior number - * - * @return the number - */ - int getId(); - - /** - * If started, get the OS-assigned ID of the process - * - * @return the process ID - */ - Long getPid(); - - /** - * If exited (implying a previous start), get the process exit code - * - *

- * This may be slightly system-dependent, as the exit code may specify either the status of a - * normal exit, or the cause of an abnormal exit. - * - * @return the exit code - */ - Long getExitCode(); - - /** - * Get the executable path - * - *

- * TODO: I presume path on the target system - * - * @return the executable - */ - String getExecutable(); - - /** - * Get a thread belonging to this inferior - * - *

- * GDB (at least recent versions) numbers its threads using a global counter. The thread ID is - * this number, not the OS-assigned TID. - * - * @param tid the GDB-assigned thread ID - * @return a handle to the thread, if it exists - */ - GdbThread getThread(int tid); - - /** - * Enumerate the threads known to the manager to belong to this inferior - * - *

- * This does not send any commands to GDB. Rather it simply returns a read-only handle to the - * manager's internal map for tracking threads and inferiors. - * - * @return a map of GDB-assigned thread IDs to thread handles - */ - Map getKnownThreads(); - - /** - * List GDB's threads in this inferior (thread group) - * - *

- * This is equivalent to the CLI command: {@code info threads}. - * - * @return a future that completes with a map of global thread IDs to thread handles - */ - CompletableFuture> listThreads(); - - /** - * Enumerate the modules known to the manager to belong to this inferior - * - *

- * This does not send any commands to GDB. Rather it simply returns a read-only handle to the - * manager's internal map for tracking modules. - * - * @return a map of GDB-assigned names to module handles - */ - Map getKnownModules(); - - /** - * List GDB's modules in this inferior (process, thread group) - * - *

- * This is equivalent to the CLI command: {@code maintenance info sections -all-objects}. This - * command is more thorough than {@code info shared} as it contains the executable module, - * shared libraries, system-supplied objects, and enumerates all sections thereof, not just - * {@code .text}. By default, the manager will only refresh this list on the first call or the - * next call since a module-loaded event. Otherwise, it will just return its cached list. - * - * @param refresh force the manager to refresh its modules and sections lists - * @return a future that completes with a map of module names to module handles - */ - CompletableFuture> listModules(boolean refresh); - - /** - * Enumerate the memory mappings known to the manager to belong to this inferior's process - * - * @return a map of start addresses to mapped memory regions - */ - NavigableMap getKnownMappings(); - - /** - * List the memory mappings of this inferior's process - * - * @return a future that completes with a map of start addresses to mapped memory regions - */ - CompletableFuture> listMappings(); - - /** - * Change CLI focus to this inferior - * - *

- * This is equivalent to the CLI command: {@code inferior [THIS_ID]}. - * - *

- * GDB's CLI has the concept of focus. That is, commands issued must be applied to some - * "current" inferior. This method changes GDB's current inferior so that subsequent commands - * will apply to this inferior. Commands issued from this handle are always executed with this - * inferior in focus, so it is rare to invoke his method directly. - * - * @param internal true to prevent announcement of the change - * @return a future that completes when GDB has executed the command - */ - CompletableFuture setActive(boolean internal); - - /** - * Specify a binary image for execution and debug symbols - * - *

- * This is equivalent to the CLI command: {@code file [FILE]}. - * - * @param file the path to the binary image - * @return a future that completes when GDB has executed the command - */ - CompletableFuture fileExecAndSymbols(String file); - - /** - * Begin execution - * - *

- * This is equivalent to the CLI command: {@code run}. Note this will not stop at - * {@code main}. The caller should first set breakpoints if an immediate stop is desired. - * - *

- * This command completes as soon as the inferior is running. If a stop is expected at a - * breakpoint, then the caller should listen for that event before issuing additional commands. - * Alternatively, the caller may interrupt the inferior. The manager has only been tested on GDB - * in all-stop mode; GDB cannot process commands while an inferior is running. - * - * @return a future that completes with a handle to the first thread of the running inferior - */ - CompletableFuture run(); - - /** - * Begin execution, stopping at {@code main} - * - *

- * This is equivalent to the CLI command: {@code start}. Otherwise, it behaves the same as - * {@link #run()}. - * - * @return a future that completes with a handle to the first thread of the running inferior - */ - CompletableFuture start(); - - /** - * Begin execution, stopping at the first instruction - * - *

- * This is equivalent to the CLI command: {@code starti}. Otherwise, it behaves the same as - * {@link #run()}. Note that {@code starti} is a relatively new command to GDB. Your version may - * not support it. - * - * @return a future that completes with a handle to the first thread of the running inferior - */ - CompletableFuture starti(); - - /** - * Attach to a running process - * - *

- * This is equivalent to the CLI command: {@code attach [PID]}. - * - * @param pid the OS-assigned process ID of the target process - * @return a future that completes with a set of handles to all threads of the attached inferior - */ - CompletableFuture> attach(long pid); - - /** - * Continue execution - * - *

- * This is equivalent to the CLI command: {@code continue}. - * - * @return a future that completes once the inferior is running - */ - CompletableFuture cont(); - - /** - * Step execution - * - *

- * This is equivalent to the CLI command: {@code step}. - * - * @param suffix specifies how far to step, or on what conditions stepping ends. - * - * @return a future that completes once the inferior has stepped - */ - CompletableFuture step(StepCmd suffix); - - /** - * Evaluate an expression - * - *

- * This evaluates an expression in the same way that the CLI commands {@code print}, - * {@code output}, and {@code call} would. - * - * @param expression the expression to evaluate - * @return a future that completes with the string representation of the value - */ - CompletableFuture evaluate(String expression); - - /** - * Set the controlling TTY for future executions - * - *

- * This is equivalent to the CLI command: {@code set inferior-tty [TTY]}. It does not affect the - * currently running process, if any. This is useful, e.g., to separate target output from GDB's - * output. If, e.g., a program outputs lines which look like GDB/MI records, the manager will - * interpret them possibly leading to strange behavior. Using this command can redirect the - * output to an alternative console to avoid any mis-interpretation. - * - * @param tty the controlling TTY for future executions - * @return a future that completes when GDB has executed the command - */ - CompletableFuture setTty(String tty); - - /** - * Get the value of an internal GDB variable - * - *

- * This is equivalent to the CLI command: {@code show [VAR_NAME]}. - * - * @param varName the name of the GDB variable - * @return a future that completes with the string representation of the value - */ - CompletableFuture getVar(String varName); - - /** - * Set the value of an internal GDB variable - * - *

- * This is equivalent to the CLI command: {@code set [VAR_NAME]=[VAL]}. - * - * @param varName the name of the GDB variable - * @param val the value to assign - * @return a future that completes when GDB has executed the command - */ - CompletableFuture setVar(String varName, String val); - - /** - * Detach from the process - * - * This is equivalent to the CLI command {@code detach}. - * - * @return a future that completes when GDB has executed the command - */ - CompletableFuture detach(); - - /** - * Kill the process - * - *

- * This is equivalent to the CLI command {@code kill}. - * - * @return a future that completes when GDB has executed the command - */ - CompletableFuture kill(); - - /** - * Remove this inferior from the session - * - * @return a future that completes when GDB has executed the command - */ - CompletableFuture remove(); - - /** - * Get the "Descriptor" column, usually a process id - * - * @return the descriptor - */ - String getDescriptor(); - -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbInferiorThreadGroup.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbInferiorThreadGroup.java deleted file mode 100644 index 189768405e..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbInferiorThreadGroup.java +++ /dev/null @@ -1,54 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager; - -public class GdbInferiorThreadGroup { - private final int iid; - private final String type; - private final Long pid; - private final Long exitCode; - private final String executable; - // TODO: cores - - public GdbInferiorThreadGroup(int iid, String type, Long pid, Long exitCode, - String executable) { - this.iid = iid; - this.type = type; - this.pid = pid; - this.exitCode = exitCode; - this.executable = executable; - } - - public int getInferiorId() { - return iid; - } - - public String getType() { - return type; - } - - public Long getPid() { - return pid; - } - - public Long getExitCode() { - return exitCode; - } - - public String getExecutable() { - return executable; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbLibraryId.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbLibraryId.java deleted file mode 100644 index d45b59dfa8..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbLibraryId.java +++ /dev/null @@ -1,27 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager; - -/** - * An opaque handle identifying a library - * - * GDB leaves a lot of variability in how libraries are uniquely identified within an inferior. This - * interface provides a means for an implementor to define it arbitrarily. It seems GDB actually - * uses the path of the library, but one should not depend on it. - */ -public interface GdbLibraryId { - // An opaque handle -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbManager.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbManager.java deleted file mode 100644 index 16f5195f7d..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbManager.java +++ /dev/null @@ -1,518 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager; - -import java.io.IOException; -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutionException; - -import agent.gdb.manager.breakpoint.GdbBreakpointInfo; -import agent.gdb.manager.breakpoint.GdbBreakpointInsertions; -import agent.gdb.manager.impl.GdbManagerImpl; -import ghidra.pty.PtyFactory; -import ghidra.pty.unix.UnixPty; - -/** - * The controlling side of a GDB session, using GDB/MI, usually via a pseudo-terminal - * - * This facilitates the implementation of GDB front ends. This piece communicates with the GDB back - * end, providing a more object-oriented programmatic interface. The methods returning - * {@link CompletableFuture} all send commands to GDB, and the future completes when the command has - * been executed. - */ -public interface GdbManager extends AutoCloseable, GdbConsoleOperations, GdbBreakpointInsertions { - public static final String DEFAULT_GDB_CMD = "/usr/bin/gdb"; - - /** - * Possible values for {@link GdbThread#step(StepCmd)} - */ - public enum StepCmd { - FINISH("finish"), - NEXT("next"), - NEXTI("nexti", "next-instruction"), - RETURN("return"), - STEP("step"), - STEPI("stepi", "step-instruction"), - UNTIL("until"); - - public final String mi2; - public final String cli; - - StepCmd(String cli, String execSuffix) { - this.cli = cli; - this.mi2 = "-exec-" + execSuffix; - } - - StepCmd(String cli) { - this(cli, cli); - } - - @Override - public String toString() { - return mi2; - } - } - - /** - * Just a vanilla demo of the manager - * - *

- * This presents the usual GDB CLI, using GDB/MI on the back end. The manager is keeps track of - * events; however, in this vanilla front end, nothing consumes them. This also provides a quick - * test to ensure the console loop operates correctly, or at least closely enough to actual GDB. - * - * @param args additional arguments to pass to GDB. Passing -i will cause problems. - * @throws InterruptedException - * @throws ExecutionException - * @throws IOException - */ - public static void main(String[] args) - throws InterruptedException, ExecutionException, IOException { - try (GdbManager mgr = newInstance(PtyFactory.local())) { - mgr.start(DEFAULT_GDB_CMD, args); - mgr.runRC().get(); - mgr.consoleLoop(); - } - } - - public enum Channel { - STDOUT, STDERR; - } - - /** - * Get a new manager instance, without starting GDB - * - * @return the manager - */ - public static GdbManager newInstance(PtyFactory ptyFactory) { - return new GdbManagerImpl(ptyFactory); - } - - /** - * Set the line terminator (separator) used to serialize commands to GDB - * - *

- * Because the manager may be communicating to GDB running remotely, possibly on another - * platform, it may be necessary to customize the line terminator. The manager will default to - * the line terminator used by the local system, i.e., {@link System#lineSeparator()}. - * - *

- * While permitted, it is not advisable to modify this parameter while the manager is running. - * Chances are, if this was mis-configured, the manager and session are hopelessly out of sync. - * Start a new properly configured session instead. - * - * @param newLine the line separator to use - */ - public void setNewLine(String newLine); - - /** - * Set to UNIX-style (CR) line terminator - */ - default void setUnixNewLine() { - setNewLine("\n"); - } - - /** - * Set to DOS-style (CRLF) line terminator - */ - default void setDosNewLine() { - setNewLine("\r\n"); - } - - /** - * Launch GDB - * - * @return a future which completes when GDB is ready to accept commands - * @throws IOException if GDB cannot be started - */ - default void start() throws IOException { - start(DEFAULT_GDB_CMD); - } - - /** - * Launch GDB, providing a custom path to GDB - * - * @param gdbCmd the path to the GDB executable - * @param args additional arguments to pass. Passing -i will cause problems. - * @return a future which completes when GDB is ready to accept commands - * @throws IOException if GDB cannot be started - */ - void start(String gdbCmd, String... args) throws IOException; - - /** - * Wait for a prompt and run any rc (initial configuration) commands - * - * @return a future which completes when rc has finished - */ - CompletableFuture runRC(); - - /** - * Terminates GDB - */ - @Override - default void close() { - terminate(); - } - - /** - * Execute a console loop in this thread - * - *

- * Note this does not follow the asynchronous pattern. - * - * @throws IOException if an I/O error occurs - */ - void consoleLoop() throws IOException; - - /** - * Terminate GDB - */ - void terminate(); - - /** - * Check if GDB is alive - * - *

- * Note this is not about the state of inferiors in GDB. If the GDB controlling process is - * alive, GDB is alive. - * - * @return true if GDB is alive, false otherwise - */ - boolean isAlive(); - - /** - * Add a listener for GDB's state - * - * @see #getState() - * @param listener the listener to add - */ - void addStateListener(GdbStateListener listener); - - /** - * Remove a listener for GDB's state - * - * @see #getState() - * @param listener the listener to remove - */ - void removeStateListener(GdbStateListener listener); - - /** - * Add a listener for events on inferiors - * - * @param listener the listener to add - */ - void addEventsListener(GdbEventsListener listener); - - /** - * Remove a listener for events on inferiors - * - * @param listener the listener to remove - */ - void removeEventsListener(GdbEventsListener listener); - - /** - * Add a listener for target output - * - *

- * Note: depending on the target, its output may not be communicated via this listener. Local - * targets, e.g., tend to just print output to GDB's controlling TTY. See - * {@link GdbInferior#setTty(String)} for a means to more reliably interact with a target's - * input and output. See also {@link UnixPty} for a means to easily acquire a new TTY from - * Java. - * - * @param listener the listener to add - */ - void addTargetOutputListener(GdbTargetOutputListener listener); - - /** - * Remove a listener for target output - * - * @see #addTargetOutputListener(GdbTargetOutputListener) - * @param listener - */ - void removeTargetOutputListener(GdbTargetOutputListener listener); - - /** - * Add a listener for console output - * - * @param listener the listener to add - */ - void addConsoleOutputListener(GdbConsoleOutputListener listener); - - /** - * Remove a listener for console output - * - * @param listener - */ - void removeConsoleOutputListener(GdbConsoleOutputListener listener); - - /** - * Get a thread by its GDB-assigned ID - * - *

- * GDB numbers its threads using a global counter. These IDs are unrelated to the OS-assigned - * TID. This method can retrieve a thread by its ID no matter which inferior it belongs to. - * - * @param tid the GDB-asigned thread ID - * @return a handle to the thread, if it exists - */ - GdbThread getThread(int tid); - - /** - * Get an inferior by its GDB-assigned ID - * - *

- * GDB numbers inferiors incrementally. All inferiors and created and destroyed by the user. See - * {@link #addInferior()}. - * - * @param iid the inferior ID - * @return a handle to the inferior, if it exists - */ - GdbInferior getInferior(int iid); - - /** - * Get the inferior which currently has focus - * - * @see GdbInferior#setActive() - * @return a handle to the inferior with focus - */ - GdbInferior currentInferior(); - - /** - * Get all inferiors known to the manager - * - *

- * This does not ask GDB to list its inferiors. Rather it returns a read-only view of the - * manager's understanding of the current inferiors based on its tracking of GDB events. - * - * @return a map of inferior IDs to corresponding inferior handles - */ - Map getKnownInferiors(); - - /** - * Get all threads known to the manager - * - *

- * This does not ask GDB to lists its known threads. Rather it returns a read-only view of the - * manager's understanding of the current threads based on its tracking of GDB events. - * - * @return a map of GDB-assigned thread IDs to corresponding thread handles - */ - Map getKnownThreads(); - - /** - * Get all breakpoints known to the manager - * - *

- * This does not ask GDB to list its breakpoints. Rather it returns a read-only view of the - * manager's understanding of the current breakpoints based on its tracking of GDB events. - * - * @return a map of GDB-assigned breakpoint IDs to corresponding breakpoint information - */ - Map getKnownBreakpoints(); - - /** - * Send an interrupt to GDB regardless of other queued commands - * - *

- * This may be useful if the manager's command queue is stalled because an inferior is running. - * If this doesn't clear the stall, try {@link #cancelCurrentCommand()}. - * - * @throws IOException if an I/O error occurs - * @throws InterruptedException - */ - void sendInterruptNow() throws IOException; - - /** - * Cancel the current command - * - *

- * Occasionally, a command gets stalled up waiting for an event, which for other reasons, will - * no longer occur. This will free up the queue for other commands to (hopefully) be processed. - * If {@link #sendInterruptNow()} doesn't clear the stall, try this. - */ - void cancelCurrentCommand(); - - /** - * Get the state of the GDB session - * - *

- * In all-stop mode, if any thread is running, GDB is said to be in the running state and is - * unable to process commands. Otherwise, if all threads are stopped, then GDB is said to be in - * the stopped state and can accept and process commands. This manager has not been tested in - * non-stop mode. - * - * @return the state - */ - GdbState getState(); - - /** - * Wait for GDB to enter the given state - * - * @param forState the state to wait for - * @return a future which completes when GDB enters the given state - */ - CompletableFuture waitForState(GdbState forState); - - /** - * Wait for GDB to present a prompt - * - *

- * This waits for a prompt from GDB unless the last line printed is already a prompt. This is - * generally not necessary following normal commands. Note that depending on circumstances and - * GDB version, the MI console may produce a prompt before it produces all of the events - * associated with an interrupt. If the last line is not currently a prompt, then the - * returned future will not be complete. In other words, this is not a reliable way of verifying - * GDB is waiting for a command. It's primary use is confirming that GDB has started - * successfully and is awaiting its first command. - * - * @return a future which completes when GDB presents a prompt - */ - CompletableFuture waitForPrompt(); - - /** - * A dummy command which claims as cause a stopped event and waits for the next prompt - * - *

- * This is used to squelch normal processing of a stopped event until the next prompt - * - * @return a future which completes when the "command" has finished execution - * @deprecated I don't see this being used anywhere. Probably defunct. - */ - @Deprecated - CompletableFuture claimStopped(); - - /** - * Add an inferior - * - *

- * This is equivalent to the CLI command: {@code add-inferior}. - * - * @return a future which completes with the handle to the new inferior - */ - CompletableFuture addInferior(); - - /** - * Find an unused inferior, possibly creating a new one - * - * @return a future which completes with the handle to the found inferior - */ - CompletableFuture availableInferior(); - - /** - * Remove an inferior - * - *

- * This is equivalent to the CLI command: {@code remove-inferior}. - * - *

- * Note that unlike the CLI, it is possible to remove the current inferior, in which case, the - * lowest-id inferior is selected. Like the CLI, it is not possible to remove an active inferior - * or the last inferior. - * - * @param inferior the inferior to remove - * @return a future which completes then GDB has executed the command - */ - CompletableFuture removeInferior(GdbInferior inferior); - - /** - * List GDB's inferiors - * - *

- * This is equivalent to the CLI command: {@code inferiors}. - * - * @return a future that completes with a map of inferior IDs to inferior handles - */ - CompletableFuture> listInferiors(); - - /** - * List information for all breakpoints - * - *

- * This is equivalent to the CLI command {@code info break}. - * - * @return a future that completes with a list of information for all breakpoints - */ - CompletableFuture> listBreakpoints(); - - /** - * Disable the given breakpoints - * - *

- * This is equivalent to the CLI command {@code disable breakpoint [NUMBER]}. - * - * @param numbers the GDB-assigned breakpoint numbers - * @return a future that completes when GDB has executed the command - */ - CompletableFuture disableBreakpoints(long... numbers); - - /** - * Enable the given breakpoints - * - *

- * This is equivalent to the CLI command {@code enable breakpoint [NUMBER]}. - * - * @param numbers the GDB-assigned breakpoint numbers - * @return a future that completes when GDB has executed the command - */ - CompletableFuture enableBreakpoints(long... numbers); - - /** - * Delete a breakpoint - * - *

- * This is equivalent to the CLI command {@code delete breakpoint [NUMBER]}. - * - * @param numbers the GDB-assigned breakpoint numbers - * @return a future that completes when GDB has executed the command - */ - CompletableFuture deleteBreakpoints(long... numbers); - - /** - * List the available processes on target - * - * @return a future that completes with a list of PIDs - */ - CompletableFuture> listAvailableProcesses(); - - /** - * Gather information about the host OS - * - *

- * This is equivalent to the CLI command: {@code info os [TYPE]}. - * - * @param type the type of OS information to gather - * @return a future which completes with a table of information - */ - CompletableFuture infoOs(String type); - - /** - * Get the name of the mi2 pty for this GDB session - * - * @return the filename - * @throws IOException if the filename could not be determined - */ - String getMi2PtyName() throws IOException; - - /** - * Get a description for the pty for this GDB session - * - * @return the description - */ - String getPtyDescription(); -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbMemoryOperations.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbMemoryOperations.java deleted file mode 100644 index f93a9618b3..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbMemoryOperations.java +++ /dev/null @@ -1,70 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager; - -import java.nio.ByteBuffer; -import java.util.concurrent.CompletableFuture; - -import generic.ULongSpan.ULongSpanSet; - -public interface GdbMemoryOperations { - - /** - * Read memory - * - * @param addr the address to begin reading at - * @param buf the buffer to read into - * @param len the length of data to read - * @return a future which completes giving the ranges successfully read - */ - CompletableFuture readMemory(long addr, ByteBuffer buf, int len); - - /** - * Read memory - * - * The length is determined by the available space in the destination buffer - * - * @param addr the address to begin reading at - * @param buf the buffer to read into - * @return a future which completes giving the ranges successfully read - */ - default CompletableFuture readMemory(long addr, ByteBuffer buf) { - return readMemory(addr, buf, buf.remaining()); - } - - /** - * Write memory - * - * @param addr the address to begin writing at - * @param buf the buffer to copy from - * @param len the length of data to write - * @return a future that completes when the write succeeds in its entirety - */ - CompletableFuture writeMemory(long addr, ByteBuffer buf, int len); - - /** - * Write memory - * - * The length is determined by the available data in the source buffer - * - * @param addr the address to begin writing at - * @param buf the buffer to copy from - * @return a future that completes when the write succeeds in its entirety - */ - default CompletableFuture writeMemory(long addr, ByteBuffer buf) { - return writeMemory(addr, buf, buf.remaining()); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbModule.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbModule.java deleted file mode 100644 index 2a038ef02b..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbModule.java +++ /dev/null @@ -1,35 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager; - -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import agent.gdb.manager.impl.GdbMinimalSymbol; - -public interface GdbModule { - String getName(); - - Long getBase(); - - Long getMax(); - - CompletableFuture> listSections(boolean refresh); - - Map getKnownSections(); - - CompletableFuture> listMinimalSymbols(); -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbModuleSection.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbModuleSection.java deleted file mode 100644 index 190d0c8339..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbModuleSection.java +++ /dev/null @@ -1,30 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager; - -import java.util.List; - -public interface GdbModuleSection { - String getName(); - - long getVmaStart(); - - long getVmaEnd(); - - long getFileOffset(); - - List getAttributes(); -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbProcessThreadGroup.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbProcessThreadGroup.java deleted file mode 100644 index f85db8fde5..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbProcessThreadGroup.java +++ /dev/null @@ -1,50 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager; - -/** - * A description of an available process - * - * NOTE: This list of available processes can change at any time. The pid may not be valid or - * describe the same process. - */ -public class GdbProcessThreadGroup { - private final int pid; - private final String description; - - public GdbProcessThreadGroup(int pid, String description) { - this.pid = pid; - this.description = description; - } - - /** - * Get the process ID - * - * @return the PID - */ - public int getPid() { - return pid; - } - - /** - * Get a description of the process, usually the command line - * - * @return the description - */ - public String getDescription() { - return description; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbRegister.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbRegister.java deleted file mode 100644 index 695d716fd8..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbRegister.java +++ /dev/null @@ -1,77 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager; - -/** - * A handle/descriptor to a GDB register - * - * This contains a register's name and number - */ -public class GdbRegister implements Comparable { - private final String name; - private final int number; - private final int size; - - /** - * Construct a new register descriptor - * - * @param name the register's name - * @param number the GDB-assigned register number - * @param the size in bytes - */ - public GdbRegister(String name, int number, int size) { - this.name = name; - this.number = number; - this.size = size; - } - - /** - * Get the register's name - * - * @return the name - */ - public String getName() { - return name; - } - - /** - * Get the register's GDB-assigned number - * - * @return the number - */ - public int getNumber() { - return number; - } - - /** - * Get the register's size in bytes - * - * @return the size - */ - public int getSize() { - return size; - } - - @Override - public int compareTo(GdbRegister that) { - return this.number - that.number; - } - - @Override - public String toString() { - return "<" + getClass().getSimpleName() + " " + name + " (" + number + ")>"; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbRegisterSet.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbRegisterSet.java deleted file mode 100644 index afed95f62a..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbRegisterSet.java +++ /dev/null @@ -1,73 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager; - -import java.util.*; - -/** - * A collection of registers indexed by name and number - * - * Iteration is in order of register number - */ -public class GdbRegisterSet extends AbstractSet { - private final Map byName = new HashMap<>(); - private final Map byNumber = new TreeMap<>(); - - /** - * Construct a set from the given collection - * - * Note that regs need not be presented in any particular order; however, there must be at most - * one register per number. Otherwise, there may be undefined behavior. - * - * @param regs the registers to index - */ - public GdbRegisterSet(Collection regs) { - for (GdbRegister r : regs) { - byName.put(r.getName(), r); - byNumber.put(r.getNumber(), r); - } - } - - /** - * Get a register by name - * - * @param name the name - * @return the register - */ - public GdbRegister get(String name) { - return byName.get(name); - } - - /** - * Get a register by number - * - * @param number the number - * @return the register - */ - public GdbRegister get(int number) { - return byNumber.get(number); - } - - @Override - public Iterator iterator() { - return byNumber.values().iterator(); - } - - @Override - public int size() { - return byNumber.size(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbStackFrame.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbStackFrame.java deleted file mode 100644 index e8108cdff7..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbStackFrame.java +++ /dev/null @@ -1,73 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager; - -import java.math.BigInteger; -import java.util.concurrent.CompletableFuture; - -public interface GdbStackFrame extends GdbContextualOperations { - // TODO: from, args? - - /** - * Get the address of the program counter - * - * @return the program counter - */ - BigInteger getAddress(); - - /** - * Get the name of the function where the program counter is - * - * @return the function name - */ - String getFunction(); - - /** - * Get the level of the frame - * - * Frame 0 is the actual machine state, and each increment unwinds the stack 1 frame. - * - * @return the frame level - */ - int getLevel(); - - /** - * Make this frame the current frame - * - * @param internal true to prevent announcement of the change - * @return a future that completes when the frame is the current frame - */ - CompletableFuture setActive(boolean internal); - - /** - * Get the thread for this frame - * - * @return the thread - */ - GdbThread getThread(); - - /** - * Fill in missing address and function fields with those from the given frame - * - *

- * If the given frame is null, or is also missing those fields, they will be filled is with 0 - * and "". - * - * @param frame - * @return - */ - GdbStackFrame fillWith(GdbStackFrame frame); -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbState.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbState.java deleted file mode 100644 index afeb6571b9..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbState.java +++ /dev/null @@ -1,79 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager; - -/** - * Describes the running state of GDB - * - * The manager is initialized in the {@link #NOT_STARTED} state. When {@link GdbManager#start()} is - * called, it enters the {@link #STARTING} state immediately upon successfully launching the GDB - * session. Once GDB issues its first prompt, it enters the {@link #STOPPED} state. The state then - * switches between {@link #RUNNING} and {@link #STOPPED} according to the execution state of its - * inferior(s). When the GDB session exits, it enters the {@link #EXIT} state. - * - * This is also used to describe the state of threads and inferiors. Only {@link #STOPPED}, - * {@link #RUNNING}, and {@link #EXIT} apply to inferiors. Only {@link #STOPPED} and - * {@link #RUNNING} apply to threads. - */ -public enum GdbState { - /** - * GDB is not alive, because it has not be started - */ - NOT_STARTED { - @Override - public boolean isAlive() { - return false; - } - }, - /** - * GDB is alive, but has not issued its first prompt, yet - */ - STARTING { - @Override - public boolean isAlive() { - return true; - } - }, - /** - * GDB, the inferior, or the thread, is stopped - */ - STOPPED { - @Override - public boolean isAlive() { - return true; - } - }, - /** - * GDB, the inferior, or the thread, is running - */ - RUNNING { - @Override - public boolean isAlive() { - return true; - } - }, - /** - * GDB or the inferior has exited - */ - EXIT { - @Override - public boolean isAlive() { - return false; - } - }; - - public abstract boolean isAlive(); -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbStateListener.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbStateListener.java deleted file mode 100644 index 657543aa7e..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbStateListener.java +++ /dev/null @@ -1,36 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager; - -import ghidra.util.TriConsumer; - -/** - * A listener for changes in GDB's state - */ -public interface GdbStateListener extends TriConsumer { - /** - * The state has changed because of the given cause - * - * @param state the new state - * @param cause the reason for the change - */ - void stateChanged(GdbState state, GdbCause cause); - - @Override - default void accept(GdbState oldSt, GdbState newSt, GdbCause u) { - stateChanged(newSt, u); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbTable.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbTable.java deleted file mode 100644 index e191339739..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbTable.java +++ /dev/null @@ -1,320 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager; - -import java.util.*; -import java.util.Map.Entry; - -import agent.gdb.manager.parsing.GdbMiParser.GdbMiFieldList; -import ghidra.util.Msg; - -/** - * A parsed table output from a GDB/MI command - * - * GDB provides many equivalent GDB/MI commands for CLI commands that output formatted tables of - * information. The GDB/MI format can be a little obtuse to traverse, but at least it is relatively - * well structured. This object provides two views of the table: as rows and columns. Generally, a - * table has column headings and entries. Viewed as rows, it is a collection of entries where each - * entry is a map of column head to cell value. Viewed as columns, it is a map of column head to - * column where each column is a collection of cells. - */ -public class GdbTable { - /* - * Piece for parsing the table data - */ - private static class Column { - final int num; - final String name; - final String head; - - Column(int num, String name, String head) { - this.num = num; - this.name = name; - this.head = head; - } - - Column(int num, GdbMiFieldList map) { - this(num, map.getString("col_name"), map.getString("colhdr")); - } - } - - /* - * Implementation of the row-oriented view - * - * view is a list of maps: TableRowView - * - * each item is a map: TableRowCellMap - * - * each map has an entry set, a set of head-cell pairs: TableRowCellSet - * - * each entry set must be iterable, an iterator of head-cell pairs: TableRowCellIterator - * - * each iterator traverses the head-cell pairs: TableRowCellEntry - * - * The other methods are implemented by the abstract base classes provided by Java's - * collections. - */ - - private class TableRowCellEntry implements Entry { - @Override - public String getKey() { - return columns[colIndex].head; - } - - @Override - public String getValue() { - return cells[rowIndex * colCount + colIndex]; - } - - @Override - public String setValue(String value) { - throw new UnsupportedOperationException(); - } - } - - private class TableRowCellIterator implements Iterator> { - @Override - public boolean hasNext() { - return colIndex < colCount - 1; - } - - @Override - public Entry next() { - colIndex++; - return rowCellEntry; - } - } - - private class TableRowCellSet extends AbstractSet> { - @Override - public Iterator> iterator() { - colIndex = -1; - return rowCellIterator; - } - - @Override - public int size() { - return colCount; - } - } - - private class TableRowCellMap extends AbstractMap { - @Override - public int size() { - return colCount; - } - - @Override - public boolean containsKey(Object key) { - return colsByHead.containsKey(key); - } - - @Override - public String get(Object key) { - Column col = colsByHead.get(key); - if (col == null) { - return null; - } - return cells[rowIndex * colCount + col.num]; - } - - @Override - public Set> entrySet() { - return rowCellSet; - } - } - - public class TableRowView extends AbstractList> { - @Override - public Map get(int index) { - if (0 <= index && index < rowCount) { - rowIndex = index; - return rowCellMap; - } - throw new IndexOutOfBoundsException(Integer.toString(index)); - } - - @Override - public int size() { - return rowCount; - } - } - - /* - * Implementation of the column-oriented view - * - * view is a map of lists: TableColumnView - * - * the map has an entry set, a set of head-list pairs: TableColumnSet - * - * the set must be iteratable, an iterator of head-list pairs: TableColumnIterator - * - * the iterator traverses head-list pairs: TableColumnEntry - * - * each list is a list of cells: TableColumnCellList - * - * The other methods are implemented by the abstract base classes provided by Java's - * collections. - */ - - private class TableColumnCellList extends AbstractList { - @Override - public String get(int index) { - return cells[index * colCount + colIndex]; - } - - @Override - public int size() { - return rowCount; - } - } - - private class TableColumnEntry implements Entry> { - @Override - public String getKey() { - return columns[colIndex].head; - } - - @Override - public List getValue() { - return columnCellList; - } - - @Override - public List setValue(List value) { - throw new UnsupportedOperationException(); - } - } - - private class TableColumnIterator implements Iterator>> { - @Override - public boolean hasNext() { - return colIndex < colCount - 1; - } - - @Override - public Entry> next() { - colIndex++; - return columnEntry; - } - } - - private class TableColumnSet extends AbstractSet>> { - @Override - public Iterator>> iterator() { - colIndex = -1; - return columnIterator; - } - - @Override - public int size() { - return colCount; - } - } - - public class TableColumnView extends AbstractMap> { - @Override - public Set>> entrySet() { - return columnSet; - } - } - - /* - * Table class definition - */ - - private final int rowCount; - private final int colCount; - private final String[] cells; - private final Column[] columns; - private final Map colsByHead; - //private final Map colsByName = new HashMap<>(); - - private int rowIndex = -1; - private int colIndex = -1; - - private final TableRowView rowView = new TableRowView(); - private final TableRowCellMap rowCellMap = new TableRowCellMap(); - private final TableRowCellSet rowCellSet = new TableRowCellSet(); - private final TableRowCellIterator rowCellIterator = new TableRowCellIterator(); - private final TableRowCellEntry rowCellEntry = new TableRowCellEntry(); - - private final TableColumnView columnView = new TableColumnView(); - private final TableColumnSet columnSet = new TableColumnSet(); - private final TableColumnIterator columnIterator = new TableColumnIterator(); - private final TableColumnEntry columnEntry = new TableColumnEntry(); - private final TableColumnCellList columnCellList = new TableColumnCellList(); - - /** - * Convert a parsed GDB/MI structure into a table - * - * See GDB's GDB/MI documentation for any command yielding a table for more information on the - * expected structure of GDB/MI table data. - * - * @param dataMap the parsed structure - * @param rowKey the key assigned to each row - */ - public GdbTable(GdbMiFieldList dataMap, String rowKey) { - rowCount = Integer.parseInt(dataMap.getString("nr_rows")); - colCount = Integer.parseInt(dataMap.getString("nr_cols")); - cells = new String[rowCount * colCount]; - columns = new Column[colCount]; - - List hdr = dataMap.getListOf(GdbMiFieldList.class, "hdr"); - if (hdr.size() != colCount) { - Msg.warn(this, "hdr contains fewer than nr_cols"); - } - Map byHead = new LinkedHashMap<>(); - for (int colno = 0; colno < colCount; colno++) { - Column column = new Column(colno, hdr.get(colno)); - columns[colno] = column; - //colsByName.put(column.name, column); - byHead.put(column.head, column); - } - this.colsByHead = Collections.unmodifiableMap(byHead); - - @SuppressWarnings({ "unchecked", "rawtypes" }) - Collection body = (Collection) dataMap.getFieldList("body").get(rowKey); - if (body.size() != rowCount) { - Msg.warn(this, "body contains fewer than nr_rows"); - } - int rowno = 0; - for (GdbMiFieldList row : body) { - for (Column column : columns) { - cells[colCount * rowno + column.num] = row.getString(column.name); - } - rowno++; - } - } - - /** - * Get the table as rows: a list of head-to-cell maps - * - * @return the row view - */ - public TableRowView rows() { - return rowView; - } - - /** - * Get the table as columns: a head-to-cell-list map - * - * @return the column view - */ - public TableColumnView columns() { - return columnView; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbTargetOutputListener.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbTargetOutputListener.java deleted file mode 100644 index d81af32c5f..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbTargetOutputListener.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager; - -/** - * A listener for target console output - * - * Note the details of this listener are not well established, for lack of examples that use - * GDB/MI's target output record. - */ -public interface GdbTargetOutputListener { - /** - * The target outputted some text - * - * @param out the output - */ - void output(String out); -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbThread.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbThread.java deleted file mode 100644 index cab6a3ddae..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/GdbThread.java +++ /dev/null @@ -1,172 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager; - -import java.util.List; -import java.util.concurrent.CompletableFuture; - -import agent.gdb.manager.GdbManager.StepCmd; -import agent.gdb.manager.breakpoint.GdbBreakpointInsertions; -import agent.gdb.manager.impl.GdbThreadInfo; - -/** - * A handle to a thread controlled by GDB - * - *

- * Each thread is numbered by GDB. Methods that return a {@link CompletableFuture} send a command to - * GDB via its GDB/MI interpreter. Where applicable, the {@code --thread} parameter is provided to - * GDB to ensure commands are executed on this thread. The returned future completes when GDB has - * finished executing the command. - */ -public interface GdbThread - extends GdbBreakpointInsertions, GdbMemoryOperations, GdbContextualOperations { - - /** - * Get the inferior to which this thread belongs - * - * @return the inferior - */ - GdbInferior getInferior(); - - /** - * Get the GDB-assigned thread number - * - *

- * This is not the OS-assigned TID. - * - * @return the number - */ - int getId(); - - /** - * Get the GDB thread information - * - * @return info - */ - CompletableFuture getInfo(); - - /** - * Get the state of the thread, {@link GdbState#RUNNING} or {@link GdbState#STOPPED}. - * - * @return the state - */ - GdbState getState(); - - /** - * Make this thread the current thread - * - * @param internal true to prevent announcement of the change - * @return a future that completes when the thread is the current thread - */ - CompletableFuture setActive(boolean internal); - - /** - * Set the value of an internal GDB variable - * - *

- * This is equivalent to the CLI command: {@code set [VAR_NAME]=[VAL]}. - * - * @param varName the name of the GDB variable - * @param val the value to assign - * @return a future that completes when GDB has executed the command - */ - CompletableFuture setVar(String varName, String val); - - /** - * List the registers available to this thread - * - * @return a future that completes with a map of register names to descriptors - */ - CompletableFuture listRegisters(); - - /** - * List the frames of this thread's stack - * - * @return - */ - CompletableFuture> listStackFrames(); - - /** - * Continue execution - * - *

- * This is equivalent to the CLI command: {@code continue}. Depending on GDB's execution mode, - * this may allow other threads to execute, too. - * - * @return a future that completes once the thread is running - */ - CompletableFuture cont(); - - /** - * Step the thread - * - *

- * Note that the command can complete before the thread has finished stepping. The command - * completes as soon as the thread is running. A separate stop event is emitted when the step is - * completed. - * - * @param suffix specifies how far to step, or on what conditions stepping ends. - * @return a future that completes once the thread is running - */ - CompletableFuture step(StepCmd suffix); - - /** - * Advance the thread to the given location - * - *

- * This is equivalent to the CLI command {@code advance}. - * - *

- * Note that the command can complete before the thread has finished advancing. The command - * completes as soon as the thread is running. A separate stop event is emitted when the thread - * has stopped. - * - * @param loc the location to stop at, same syntax as breakpoint locations - * @return a future that completes once the thread is running - */ - CompletableFuture advance(String loc); - - /** - * Advance the thread to the given address - * - * @param addr the address - * @see #advance(String) - */ - CompletableFuture advance(long addr); - - /** - * Detach from the entire process - * - *

- * This is equivalent to the CLI command {@code detach}. It will detach the entire process, not - * just this thread. - * - * @return a future that completes when GDB has executed the command - */ - CompletableFuture kill(); - - /** - * Kill the entire process - * - *

- * This is equivalent to the CLI command {@code kill}. It will kill the entire process, not just - * this thread. - * - * @return a future that completes when GDB has executed the command - */ - CompletableFuture detach(); - -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/breakpoint/GdbBreakpointDisp.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/breakpoint/GdbBreakpointDisp.java deleted file mode 100644 index ad81096c51..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/breakpoint/GdbBreakpointDisp.java +++ /dev/null @@ -1,68 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.breakpoint; - -/** - * GDB breakpoint disposition - * - * GDB allows the user to specify what happens to a breakpoint after it has been hit. Different - * targets may also have different default/preferred behavior. The breakpoint may remain, or it may - * be deleted after the target stops at that breakpoint. - */ -public enum GdbBreakpointDisp { - /** - * The breakpoint should remain until deleted by the user - */ - KEEP("keep"), - /** - * The breakpoint should be deleted once it is hit - */ - DEL("del"), - /** - * Some disposition unknown to the manager - */ - OTHER(""); - - /** - * Parse a disposition from a GDB/MI breakpoint information block - * - * @param string the value of disposition parsed - * @return the enum constant, or {@link #OTHER} if unrecognized - */ - public static GdbBreakpointDisp fromStr(String string) { - try { - return valueOf(string.toUpperCase()); - } - catch (IllegalArgumentException e) { - return OTHER; - } - } - - private final String name; - - private GdbBreakpointDisp(String name) { - this.name = name; - } - - @Override - public String toString() { - return name; - } - - public String getName() { - return name; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/breakpoint/GdbBreakpointInfo.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/breakpoint/GdbBreakpointInfo.java deleted file mode 100644 index 4618850521..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/breakpoint/GdbBreakpointInfo.java +++ /dev/null @@ -1,403 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.breakpoint; - -import java.util.*; - -import agent.gdb.manager.parsing.GdbMiParser; -import agent.gdb.manager.parsing.GdbMiParser.GdbMiFieldList; -import agent.gdb.manager.parsing.GdbParsingUtils; - -/** - * Information about a GDB breakpoint - * - *

- * This contains the semantic processing for GDB breakpoint information. Mostly, it just stores the - * information, but it also enumerates the locations of a breakpoint and generates the "effective" - * breakpoints. - * - *

- * Note this is not a handle to the breakpoint. Rather, this is the captured information from some - * event or request. If other commands have been executed since this information was gathered, the - * information may be stale. - */ -public class GdbBreakpointInfo { - private static List parseIids(GdbMiFieldList bkpt) { - List iids = new ArrayList<>(); - List gids = bkpt.getListOf(String.class, "thread-groups"); - if (gids == null) { - return null; - } - for (String gid : gids) { - iids.add(GdbParsingUtils.parseInferiorId(gid)); - } - return iids; - } - - /** - * Process a parsed GDB breakpoint information block - * - *

- * The passed info should be the field list containing "{@code bkpt={...}}." - * - *

- * It may also contain {@code wpt}, {@code hw-awpt}, or {@code hw-rwpt}, in which case the - * "parsed info" is synthesized to match what would be given by {@code -break-list} for that - * watchpoint. - * - * @param info the parsed information block - * @param curIid in case of a watchpoint, the current inferior id - * @return the processed GDB breakpoint information - */ - public static GdbBreakpointInfo parse(GdbMiFieldList info, Integer curIid) { - GdbMiFieldList bkpt = info.getFieldList("bkpt"); - if (bkpt != null) { - return parseBkpt(bkpt, parseLocations(info), curIid); - } - GdbMiFieldList wpt = info.getFieldList("wpt"); - if (wpt != null) { - return parseWpt(wpt, GdbBreakpointType.HW_WATCHPOINT, - GdbBreakpointType.HW_WATCHPOINT.getName(), curIid); - } - GdbMiFieldList hwAWpt = info.getFieldList("hw-awpt"); - if (hwAWpt != null) { - return parseWpt(hwAWpt, GdbBreakpointType.ACCESS_WATCHPOINT, - GdbBreakpointType.ACCESS_WATCHPOINT.getName(), curIid); - } - GdbMiFieldList hwRWpt = info.getFieldList("hw-rwpt"); - if (hwRWpt != null) { - return parseWpt(hwRWpt, GdbBreakpointType.READ_WATCHPOINT, - GdbBreakpointType.READ_WATCHPOINT.getName(), curIid); - } - throw new AssertionError("No breakpoint or watchpoint in info: " + info); - } - - /** - * Parse the usual {@code bkpt} fields - * - * @param bkpt the breakpoint field list - * @param allLocs all (sub)locations given in the info or table body - * @param curIid in case of missing {@code thread-ids} field, the current inferior id - * @return the info - */ - public static GdbBreakpointInfo parseBkpt(GdbMiFieldList bkpt, - List allLocs, Integer curIid) { - // TODO: A more polymorphic approach to info types? - long number = Long.parseLong(bkpt.getString("number")); - String typeName = bkpt.getString("type"); - GdbBreakpointType type = GdbBreakpointType.fromStr(typeName); - GdbBreakpointDisp disp = GdbBreakpointDisp.fromStr(bkpt.getString("disp")); - boolean enabled = "y".equals(bkpt.getString("enabled")); - String addr = bkpt.getString("addr"); - String what = bkpt.getString("at"); - if (what == null) { - what = bkpt.getString("what"); - } - String catchType = bkpt.getString("catch-type"); - String origLoc = bkpt.getString("original-location"); - String pending = bkpt.getString("pending"); - int times = Integer.parseInt(bkpt.getString("times")); - List locations = new ArrayList<>(); - - if (type == GdbBreakpointType.CATCHPOINT) { - // no locations - } - else if ("".equals(addr)) { - allLocs.stream().filter(l -> l.getNumber() == number).forEachOrdered(locations::add); - } - else { - List iids = parseIids(bkpt); - if (iids == null) { - iids = curIid == null ? List.of() : List.of(curIid); - } - locations.add(new GdbBreakpointLocation(number, 1, true, addr, iids)); - } - return new GdbBreakpointInfo(number, type, typeName, disp, addr, what, catchType, origLoc, - pending, enabled, times, locations); - } - - /** - * Parse watchpoint fields and synthesize the info - * - * @param wpt the watchpoint field list - * @param type the type of watchpoint - * @param curIid the inferior id in which the watchpoint was created - * @return the info - */ - public static GdbBreakpointInfo parseWpt(GdbMiFieldList wpt, GdbBreakpointType type, - String typeName, int curIid) { - int number = Integer.parseInt(wpt.getString("number")); - String origLoc = wpt.getString("exp"); - - List locs; - if (origLoc.startsWith(GdbBreakpointLocation.WATCHPOINT_LOCATION_PREFIX)) { - locs = List.of(new GdbBreakpointLocation(number, 1, true, null, List.of(curIid))); - } - else { - locs = List.of(); - } - return new GdbBreakpointInfo(number, type, typeName, GdbBreakpointDisp.KEEP, null, origLoc, - null, origLoc, null, true, 0, locs); - } - - /** - * Parse all (sub)locations from the given info or table body - * - * @param info the info or table body - * @return all locations parsed - */ - public static List parseLocations(GdbMiFieldList info) { - List locations = new ArrayList<>(); - for (Object obj : info.get(GdbMiParser.UNNAMED)) { - GdbMiFieldList loc = (GdbMiFieldList) obj; - String[] locIdParts = loc.getString("number").split("\\."); - long locNumber = Long.parseLong(locIdParts[0]); - long locSub = Long.parseLong(locIdParts[1]); - boolean locEnabled = "y".equals(loc.getString("enabled")); - String locAddr = loc.getString("addr"); - List locIids = parseIids(loc); - - locations.add( - new GdbBreakpointLocation(locNumber, locSub, locEnabled, locAddr, locIids)); - } - return locations; - } - - private final long number; - private final GdbBreakpointType type; - private final String typeName; - private final GdbBreakpointDisp disp; - private final String addr; - private final String what; - private final String catchType; - private final String originalLocation; - private final String pending; - private final boolean enabled; - private final int times; - private final List locations; - - /** - * Construct GDB breakpoint information - * - * @param number the GDB-assigned breakpoint number - * @param type the type of breakpoint - * @param disp the breakpoint disposition - * @param addr the location of the breakpoint - * @param what the "what" of the breakpoint - * @param pending if pending, the location that is not yet resolved - * @param enabled true if the breakpoint is enabled, false otherwise - * @param times the number of times the breakpoint has been hit - * @param locations the resolved address(es) of this breakpoint - */ - GdbBreakpointInfo(long number, GdbBreakpointType type, String typeName, GdbBreakpointDisp disp, - String addr, String what, String catchType, String origLoc, String pending, - boolean enabled, int times, List locations) { - this.number = number; - this.type = type; - this.typeName = typeName; - this.disp = disp; - this.addr = addr; - this.what = what; - this.catchType = catchType; - this.originalLocation = origLoc; - this.pending = pending; - this.enabled = enabled; - this.times = times; - this.locations = Collections.unmodifiableList(locations); - } - - @Override - public int hashCode() { - return Objects.hash(number, type, disp, addr, pending, enabled, times, locations); - } - - @Override - public String toString() { - return String.format( - "<%s id=%08x,number=%d,type=%s,disp=%s,addr=%s,pending=%s,enabled=%s,times=%d,locations=%s>", - getClass().getSimpleName(), System.identityHashCode(this), number, type, disp, addr, - pending, enabled, times, locations); - } - - @Override - public boolean equals(Object obj) { - if (!((obj instanceof GdbBreakpointInfo))) { - return false; - } - GdbBreakpointInfo that = (GdbBreakpointInfo) obj; - if (this.number != that.number) { - return false; - } - if (this.type != that.type) { - return false; - } - if (this.disp != that.disp) { - return false; - } - if (!Objects.equals(this.addr, that.addr)) { - return false; - } - if (!Objects.equals(this.pending, that.pending)) { - return false; - } - if (this.enabled != that.enabled) { - return false; - } - if (this.times != that.times) { - return false; - } - if (!Objects.equals(this.locations, that.locations)) { - return false; - } - return true; - } - - /** - * Get the GDB-assigned breakpoint number - * - * This is the key into GDB's breakpoint table to locate the breakpoint this information - * describes. - * - * @return the number - */ - public long getNumber() { - return number; - } - - /** - * Get the type of breakpoint - * - * @return the type - */ - public GdbBreakpointType getType() { - return type; - } - - /** - * Get the type of breakpoint as named by GDB - * - *

- * In case of {@link GdbBreakpointType#OTHER}, this at least reports the string GDB uses to name - * the type. - * - * @return the type name - */ - public String getTypeName() { - return typeName; - } - - /** - * Get the breakpoint disposition, i.e., what happens to the breakpoint once it has been hit - * - * @return the disposition - */ - public GdbBreakpointDisp getDisp() { - return disp; - } - - /** - * Get the location of the breakpoint - * - * @return the location (address) - */ - public String getAddress() { - return addr; - } - - /** - * Get the user-specified location ("What" column) - * - * @return the location - */ - public String getWhat() { - return what; - } - - /** - * For a catchpoint, get the event being caught - * - * @return the catch-type - */ - public String getCatchType() { - return catchType; - } - - /** - * Get the location as specified by the user - * - * @return the original location - */ - public String getOriginalLocation() { - return originalLocation; - } - - /** - * Assuming the location is an address, get it as a long - * - * @return the address - */ - public long addrAsLong() { - return GdbParsingUtils.parsePrefixedHex(addr); - } - - /** - * If the breakpoint is pending resolution, get the location that is pending - * - * @return the pending location - */ - public String getPending() { - return pending; - } - - /** - * Check if the breakpoint is enabled - * - * @return true if enabled, false otherwise - */ - public boolean isEnabled() { - return enabled; - } - - /** - * Get the number of times the breakpoint has been hit - * - * @return the hit count - */ - public int getTimes() { - return times; - } - - /** - * Get a list of resolved addresses - * - * The effective locations may change for a variety of reasons. Most notable, a new module may - * be loaded, having location(s) that match the desired location of this breakpoint. The binary - * addresses within will become new effective locations of this breakpoint. - * - * @return the list of locations at the time the breakpoint information was captured - */ - public List getLocations() { - return locations; - } - - public GdbBreakpointInfo withEnabled(@SuppressWarnings("hiding") boolean enabled) { - if (isEnabled() == enabled) { - return this; - } - return new GdbBreakpointInfo(number, type, typeName, disp, addr, what, catchType, - originalLocation, pending, enabled, times, locations); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/breakpoint/GdbBreakpointInsertions.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/breakpoint/GdbBreakpointInsertions.java deleted file mode 100644 index 7712cd070d..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/breakpoint/GdbBreakpointInsertions.java +++ /dev/null @@ -1,78 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.breakpoint; - -import java.util.concurrent.CompletableFuture; - -public interface GdbBreakpointInsertions { - /** - * Insert a breakpoint - * - *

- * This is equivalent to the CLI command: {@code break [LOC]}, or {@code watch [LOC]}, etc. - * - *

- * Breakpoints in GDB can get pretty complicated. Depending on the location specification, the - * actual location of the breakpoint may change during the lifetime of an inferior. Take note of - * the breakpoint number to track those changes across breakpoint modification events. - * - * @param loc the location (address, symbol, line number, etc.) to place the breakpoint at - * @param type the type of breakpoint (or watchpoint) to add - * @return a copy of the resulting breakpoint information once GDB has executed the command - */ - CompletableFuture insertBreakpoint(String loc, GdbBreakpointType type); - - /** - * Insert a (usually software) execution breakpoint - * - * @see #insertBreakpoint(String, GdbBreakpointType) - */ - default CompletableFuture insertBreakpoint(String loc) { - return insertBreakpoint(loc, GdbBreakpointType.BREAKPOINT); - } - - /** - * Insert a breakpoint (usually a watchpoint) at the given address range - * - *

- * Note, this implements the length by casting the address pointer to a - * fixed-length-char-array-pointer where the array has the given length. Support for specific - * lengths may vary by platform. - * - * @param addr the starting address - * @param len the length of the range - * @param type the type of breakpoint (usually a watchpoint) - * @see #insertBreakpoint(String, GdbBreakpointType) - */ - default CompletableFuture insertBreakpoint(long addr, int len, - GdbBreakpointType type) { - if (len != 1 && type.isWatchpoint()) { - return insertBreakpoint(String.format("*((char(*)[%d]) 0x%x)", len, addr), type); - } - return insertBreakpoint(String.format("*0x%x", addr), type); - } - - /** - * Insert a (usually software) execution breakpoint at the given address offset - * - * Note, this uses the "Address Notation" specified by GDB. - * - * @see #insertBreakpoint(String, GdbBreakpointType) - */ - default CompletableFuture insertBreakpoint(long addr) { - return insertBreakpoint(String.format("*0x%x", addr)); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/breakpoint/GdbBreakpointLocation.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/breakpoint/GdbBreakpointLocation.java deleted file mode 100644 index 7fde987b86..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/breakpoint/GdbBreakpointLocation.java +++ /dev/null @@ -1,145 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.breakpoint; - -import java.util.*; - -import agent.gdb.manager.parsing.GdbParsingUtils; - -/** - * A location of a breakpoint - * - * Some breakpoint information blocks list multiple locations. Keeping this information in a - * separate object allows the parsing and tracking of these locations. Usually multiple locations - * are presented by GDB when a single location specification resolves to multiple addresses. - */ -public class GdbBreakpointLocation { - public static final String WATCHPOINT_LOCATION_PREFIX = "-location "; - - private final long number; - private final long sub; - private final boolean enabled; - private final String addr; - private final List inferiorIds; - - /** - * Construct a breakpoint location - * - * @param number the number of breakpoint location, i.e., {@code x} in {@code x.y} - * @param sub the number of the breakpoint location, i.e., {@code y} in {@code x.y} - * @param enabled true if the location is enabled, false otherwise - * @param addr the address of this location, usually resolved, but maybe not - * @param inferiorIds a list of inferior IDs to which this location applies - */ - GdbBreakpointLocation(long number, long sub, boolean enabled, String addr, - List inferiorIds) { - this.number = number; - this.sub = sub; - this.enabled = enabled; - this.addr = addr; - this.inferiorIds = Collections.unmodifiableList(inferiorIds); - } - - @Override - public String toString() { - return ""; - } - - /** - * Get the breakpoint number, i.e., {@code x} in {@code x.y} - * - * @return the breakpoint number - */ - public long getNumber() { - return number; - } - - /** - * If present, get the location number, i.e., {@code y} in {@code x.y} - * - * @return the location number, or 0 - */ - public long getSub() { - return sub; - } - - /** - * Check if the location is enabled - * - * @return true if enabled, false otherwise - */ - public boolean isEnabled() { - return enabled; - } - - /** - * Get the address, usually resolved, but maybe not - * - * @see {@link GdbBreakpointInfo#getPending()} - * @return the address - */ - public String getAddr() { - return addr; - } - - /** - * If numerical, get the address as a long - * - * @return the address - */ - public long addrAsLong() { - return GdbParsingUtils.parsePrefixedHex(addr); - } - - /** - * Get a list of inferior IDs to which this location applies - * - * @return the list of inferiors - */ - public List getInferiorIds() { - return inferiorIds; - } - - @Override - public int hashCode() { - return Objects.hash(number, sub, enabled, addr, inferiorIds); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof GdbBreakpointLocation)) { - return false; - } - GdbBreakpointLocation that = (GdbBreakpointLocation) obj; - if (this.number != that.number) { - return false; - } - if (this.sub != that.sub) { - return false; - } - if (this.enabled != that.enabled) { - return false; - } - if (!Objects.equals(this.addr, that.addr)) { - return false; - } - if (!Objects.equals(this.inferiorIds, that.inferiorIds)) { - return false; - } - return true; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/breakpoint/GdbBreakpointType.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/breakpoint/GdbBreakpointType.java deleted file mode 100644 index 8d74c980ab..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/breakpoint/GdbBreakpointType.java +++ /dev/null @@ -1,92 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.breakpoint; - -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -/** - * The type of GDB breakpoint - */ -public enum GdbBreakpointType { - /** - * A software execution breakpoint, usually set via {@code break} - */ - BREAKPOINT("breakpoint", false), - /** - * A hardware execution breakpoint, usually set via {@code hbreak} - */ - HW_BREAKPOINT("hw breakpoint", false), - /** - * A debug printf point, usually set via {@code dprint} - */ - DPRINTF("dprintf", false), - /** - * A hardware (write) watchpoint, usually set via {@code watch} - */ - HW_WATCHPOINT("hw watchpoint", true), - /** - * A read watchpoint, usually set via {@code rwatch} - */ - READ_WATCHPOINT("read watchpoint", true), - /** - * An access (r/w) watchpoint, usually set via {@code awatch} - */ - ACCESS_WATCHPOINT("acc watchpoint", true), - /** - * A catchpoint to catch (break on) events, usual set via {@code catch} - */ - CATCHPOINT("catchpoint", false), - /** - * Some type not known to the manager - */ - OTHER("", false); - - public static final Map BY_NAME = - List.of(values()).stream().collect(Collectors.toMap(v -> v.getName(), v -> v)); - - /** - * Parse a type from a GDB/MI breakpoint information block - * - * @param string the value of type parsed - * @return the enum constant, or {@link #OTHER} if unrecognized - */ - public static GdbBreakpointType fromStr(String string) { - return BY_NAME.getOrDefault(string, OTHER); - } - - private final String name; - private final boolean isWatchpoint; - - private GdbBreakpointType(String name, boolean isWatchpoint) { - this.name = name; - this.isWatchpoint = isWatchpoint; - } - - @Override - public String toString() { - return name; - } - - public String getName() { - return name; - } - - public boolean isWatchpoint() { - return isWatchpoint; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/AbstractGdbCompletedCommandEvent.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/AbstractGdbCompletedCommandEvent.java deleted file mode 100644 index 6bbfd4288f..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/AbstractGdbCompletedCommandEvent.java +++ /dev/null @@ -1,65 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.evt; - -import agent.gdb.manager.parsing.GdbMiParser.GdbMiFieldList; -import agent.gdb.manager.parsing.GdbParsingUtils; -import agent.gdb.manager.parsing.GdbParsingUtils.GdbParseError; - -/** - * A base class for GDB command completion events - * - * Subclasses must specify the state implied by GDB issuing the event - */ -public abstract class AbstractGdbCompletedCommandEvent extends AbstractGdbEventWithFields { - - /** - * Construct a new event, parsing the tail for information - * - * @param tail the text following the event type in the GDB/MI event record - * @throws GdbParseError if the tail cannot be parsed - */ - public AbstractGdbCompletedCommandEvent(CharSequence tail) throws GdbParseError { - super(tail); - } - - /** - * Construct a new event with the given information - * - * @param info the information - */ - public AbstractGdbCompletedCommandEvent(GdbMiFieldList fields) { - super(fields); - } - - /** - * Assume an inferior is specified, and get its ID - * - * @return the inferior ID - */ - public int assumeInferior() { - return GdbParsingUtils.parseInferiorId(getInfo().getString("inferior")); - } - - /** - * Assume a message is specified, and get that message - * - * @return the message - */ - public String assumeMsg() { - return getInfo().getString("msg"); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/AbstractGdbEvent.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/AbstractGdbEvent.java deleted file mode 100644 index bbc0879eac..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/AbstractGdbEvent.java +++ /dev/null @@ -1,99 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.evt; - -import agent.gdb.manager.GdbCause; -import agent.gdb.manager.GdbState; -import agent.gdb.manager.impl.GdbEvent; -import agent.gdb.manager.impl.GdbPendingCommand; -import agent.gdb.manager.parsing.GdbParsingUtils.GdbParseError; - -/** - * A base class for GDB events - * - * @param the type of information detailing the event - */ -public abstract class AbstractGdbEvent implements GdbEvent { - private final T info; - protected GdbCause cause = Causes.UNCLAIMED; - protected boolean stolen = false; - - /** - * Construct a new event, parsing the tail for information - * - * @param tail the text following the event type in the GDB/MI event record - * @throws GdbParseError if the tail cannot be parsed - */ - protected AbstractGdbEvent(CharSequence tail) throws GdbParseError { - this.info = parseInfo(tail); - } - - /** - * Construct a new event with the given information - * - * @param info the information - */ - protected AbstractGdbEvent(T info) { - this.info = info; - } - - /** - * Parse the tail into the required information type - * - * @param tail the text following the event type in the GDB/MI event record - * @return the parsed information - * @throws GdbParseError if the tail cannot be parsed - */ - protected abstract T parseInfo(CharSequence tail) throws GdbParseError; - - @Override - public T getInfo() { - return info; - } - - @Override - public void claim(GdbPendingCommand cmd) { - if (cause != Causes.UNCLAIMED) { - throw new IllegalStateException("Event is already claimed by " + cause); - } - cause = cmd; - } - - @Override - public GdbCause getCause() { - return cause; - } - - @Override - public void steal() { - stolen = true; - } - - @Override - public boolean isStolen() { - return stolen; - } - - @Override - public String toString() { - return "<" + getClass().getSimpleName() + " " + info + " >"; - } - - @Override - public GdbState newState() { - return null; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/AbstractGdbEventWithFields.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/AbstractGdbEventWithFields.java deleted file mode 100644 index ffd03727da..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/AbstractGdbEventWithFields.java +++ /dev/null @@ -1,50 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.evt; - -import agent.gdb.manager.parsing.GdbMiParser; -import agent.gdb.manager.parsing.GdbMiParser.GdbMiFieldList; -import agent.gdb.manager.parsing.GdbParsingUtils.GdbParseError; - -/** - * A base class for GDB events whose details are a list of fields - */ -public abstract class AbstractGdbEventWithFields extends AbstractGdbEvent { - - /** - * Construct a new event, parsing the tail for information - * - * @param tail the text following the event type in the GDB/MI event record - * @throws GdbParseError if the tail cannot be parsed - */ - public AbstractGdbEventWithFields(CharSequence tail) throws GdbParseError { - super(tail); - } - - /** - * Construct a new event with the given fields - * - * @param fields the fields - */ - public AbstractGdbEventWithFields(GdbMiFieldList fields) { - super(fields); - } - - @Override - protected GdbMiFieldList parseInfo(CharSequence tail) throws GdbParseError { - return GdbMiParser.parseFields(tail); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/AbstractGdbEventWithStateChange.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/AbstractGdbEventWithStateChange.java deleted file mode 100644 index a22de6cf36..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/AbstractGdbEventWithStateChange.java +++ /dev/null @@ -1,53 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.evt; - -import agent.gdb.manager.GdbState; -import agent.gdb.manager.parsing.GdbParsingUtils.GdbParseError; -import agent.gdb.manager.reason.GdbReason; - -/** - * A base class for GDB events notifying of state changes - * - * Subclasses must specify the state implied by GDB issuing the event. This base class will parse - * the reason if it is given by GDB. - */ -public abstract class AbstractGdbEventWithStateChange extends AbstractGdbEventWithFields { - private final GdbReason reason; - - /** - * Construct a new event, parsing the tail for information - * - * @param tail the text following the event type in the GDB/MI event record - * @throws GdbParseError if the tail cannot be parsed - */ - public AbstractGdbEventWithStateChange(CharSequence tail) throws GdbParseError { - super(tail); - this.reason = GdbReason.getReason(getInfo()); - } - - /** - * If applicable, get the reason for the event - * - * @return the reason, or {@link GdbReason.Reasons#NONE} - */ - public GdbReason getReason() { - return reason; - } - - @Override - public abstract GdbState newState(); -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/AbstractGdbEventWithString.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/AbstractGdbEventWithString.java deleted file mode 100644 index 3db056a340..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/AbstractGdbEventWithString.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.evt; - -import agent.gdb.manager.parsing.GdbMiParser; -import agent.gdb.manager.parsing.GdbParsingUtils.GdbParseError; - -/** - * A base class for GDB events whose details are a string - */ -public abstract class AbstractGdbEventWithString extends AbstractGdbEvent { - - /** - * Construct a new event, parsing the tail for information - * - * @param tail the text following the event type in the GDB/MI event record - * @throws GdbParseError if the tail cannot be parsed - */ - protected AbstractGdbEventWithString(CharSequence tail) throws GdbParseError { - super(tail); - } - - /** - * Construct a new event with the given information - * - * @param info the information - */ - public AbstractGdbEventWithString(String info) { - super(info); - } - - @Override - protected String parseInfo(CharSequence tail) throws GdbParseError { - return GdbMiParser.parseString(tail); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/AbstractGdbLibraryEvent.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/AbstractGdbLibraryEvent.java deleted file mode 100644 index e66d135d06..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/AbstractGdbLibraryEvent.java +++ /dev/null @@ -1,102 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.evt; - -import java.util.Objects; - -import agent.gdb.manager.GdbLibraryId; -import agent.gdb.manager.parsing.GdbParsingUtils; -import agent.gdb.manager.parsing.GdbParsingUtils.GdbParseError; - -/** - * A base class for GDB events regarding loaded libraries - */ -public abstract class AbstractGdbLibraryEvent extends AbstractGdbEventWithFields { - private final GdbLibraryId lid; - private final String targetName; - private final Integer iid; - - private static class LibId implements GdbLibraryId { - private final String id; - - public LibId(String id) { - this.id = id; - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof LibId)) { - return false; - } - LibId that = (LibId) obj; - return Objects.equals(this.id, that.id); - } - - @Override - public int hashCode() { - return id.hashCode(); - } - } - - /** - * Construct a new event, parsing the tail for information - * - * The library's ID and target name must be specified by GDB. The applicable inferiors - * (actually, thread groups) may also be specified. If not, the manager assumes all inferiors. - * - * @param tail the text following the event type in the GDB/MI event record - * @throws GdbParseError if the tail cannot be parsed - */ - public AbstractGdbLibraryEvent(CharSequence tail) throws GdbParseError { - super(tail); - this.lid = new LibId(getInfo().getString("id")); - this.targetName = getInfo().getString("target-name"); - String gid = getInfo().getString("thread-group"); - if (gid == null) { - this.iid = null; - } - else { - this.iid = GdbParsingUtils.parseInferiorId(gid); - } - } - - /** - * Get the library ID - * - * @return the ID - */ - public GdbLibraryId getLibraryId() { - return lid; - } - - /** - * Get the target's name for the library - * - * @return the name - */ - public String getTargetName() { - return targetName; - } - - /** - * Get the applicable - * - * @return - */ - public Integer getInferiorId() { - return iid; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/AbstractGdbOutputEvent.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/AbstractGdbOutputEvent.java deleted file mode 100644 index e7c9525e4d..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/AbstractGdbOutputEvent.java +++ /dev/null @@ -1,71 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.evt; - -import java.io.PrintWriter; - -import agent.gdb.manager.impl.GdbManagerImpl.Interpreter; -import agent.gdb.manager.parsing.GdbParsingUtils.GdbParseError; - -/** - * A base class for GDB output records - */ -public abstract class AbstractGdbOutputEvent extends AbstractGdbEventWithString { - protected final Interpreter interpreter; - - /** - * Construct a new event, parsing the tail for information - * - * @param tail the text following the event type in the GDB/MI event record - * @throws GdbParseError if the tail cannot be parsed - */ - public AbstractGdbOutputEvent(CharSequence tail) throws GdbParseError { - super(tail); - this.interpreter = Interpreter.MI2; - } - - /** - * Construct a new event for the given output - * - * @param output the output - */ - public AbstractGdbOutputEvent(String output) { - super(output); - this.interpreter = Interpreter.CLI; - } - - /** - * Get the output - * - * GDB includes explicit line terminators, so the output may not necessarily be a complete line. - * It should be printed using, e.g., {@link PrintWriter#print(String)}, not - * {@link PrintWriter#println(String)}. - * - * @return the output - */ - public String getOutput() { - return getInfo(); - } - - /** - * Get the interpreter that produced this output - * - * @return the interpreter - */ - public Interpreter getInterpreter() { - return interpreter; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/AbstractGdbThreadEvent.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/AbstractGdbThreadEvent.java deleted file mode 100644 index c7c4cf90fa..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/AbstractGdbThreadEvent.java +++ /dev/null @@ -1,60 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.evt; - -import agent.gdb.manager.parsing.GdbParsingUtils; -import agent.gdb.manager.parsing.GdbParsingUtils.GdbParseError; - -/** - * A base class for GDB events that involve a thread ID (including inferior ID) - */ -public abstract class AbstractGdbThreadEvent extends AbstractGdbEventWithFields { - private final int tid; - private final int iid; - - /** - * Construct a new event by parsing the tail for information - * - * The thread ID and thread group ID must be specified by GDB in the "id" and "group-id" fields, - * respectively. - * - * @param tail the text following the event type in the GDB/MI event record - * @throws GdbParseError if the tail cannot be parsed - */ - public AbstractGdbThreadEvent(CharSequence tail) throws GdbParseError { - super(tail); - this.tid = Integer.parseInt(getInfo().getString("id")); - this.iid = GdbParsingUtils.parseInferiorId(getInfo().getString("group-id")); - } - - /** - * Get the thread ID - * - * @return the thread ID - */ - public int getThreadId() { - return tid; - } - - /** - * Get the inferior ID - * - * @return the inferior ID - */ - public int getInferiorId() { - return iid; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/AbstractGdbThreadGroupEvent.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/AbstractGdbThreadGroupEvent.java deleted file mode 100644 index 4825e728ed..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/AbstractGdbThreadGroupEvent.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.evt; - -import agent.gdb.manager.parsing.GdbParsingUtils; -import agent.gdb.manager.parsing.GdbParsingUtils.GdbParseError; - -/** - * A base class for GDB events that involve an inferior (a special kind of thread group) - */ -public abstract class AbstractGdbThreadGroupEvent extends AbstractGdbEventWithFields { - private final int iid; - - /** - * Construct a new event by parsing the tail for information - * - *

- * The thread group ID must be specified by GDB in the "id" field. - * - * @param tail the text following the event type in the GDB/MI event record - * @throws GdbParseError if the tail cannot be parsed - */ - public AbstractGdbThreadGroupEvent(CharSequence tail) throws GdbParseError { - super(tail); - this.iid = GdbParsingUtils.parseInferiorId(getInfo().getString("id")); - } - - /** - * Get the inferior ID - * - * @return the inferior ID - */ - public int getInferiorId() { - return iid; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbBreakpointCreatedEvent.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbBreakpointCreatedEvent.java deleted file mode 100644 index 677a8b2fa4..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbBreakpointCreatedEvent.java +++ /dev/null @@ -1,50 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.evt; - -import agent.gdb.manager.breakpoint.GdbBreakpointInfo; -import agent.gdb.manager.impl.GdbManagerImpl; -import agent.gdb.manager.parsing.GdbParsingUtils.GdbParseError; - -/** - * The event corresponding with "{@code =breakpoint-created}" - */ -public class GdbBreakpointCreatedEvent extends AbstractGdbEventWithFields { - private final GdbBreakpointInfo bkptInfo; - - /** - * Construct a new event by parsing the tail for information - * - * The breakpoint information must be specified by GDB. - * - * @param tail the text following the event type in the GDB/MI event record - * @throws GdbParseError if the tail cannot be parsed - */ - public GdbBreakpointCreatedEvent(CharSequence tail, GdbManagerImpl manager) - throws GdbParseError { - super(tail); - this.bkptInfo = GdbBreakpointInfo.parse(getInfo(), manager.currentInferior().getId()); - } - - /** - * Get the breakpoint information - * - * @return the parsed, but not processed, breakpoint information - */ - public GdbBreakpointInfo getBreakpointInfo() { - return bkptInfo; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbBreakpointDeletedEvent.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbBreakpointDeletedEvent.java deleted file mode 100644 index 0de06c0a18..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbBreakpointDeletedEvent.java +++ /dev/null @@ -1,48 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.evt; - -import agent.gdb.manager.parsing.GdbParsingUtils.GdbParseError; - -/** - * The event corresponding with "{@code =breakpoint-deleted}" - */ -public class GdbBreakpointDeletedEvent extends AbstractGdbEventWithFields { - private final long number; - - /** - * Construct a new event by parsing the tail for information - * - * The breakpoint number must be specified by GDB. - * - * @param tail the text following the event type in the GDB/MI event record - * @throws GdbParseError if the tail cannot be parsed - */ - public GdbBreakpointDeletedEvent(CharSequence tail) throws GdbParseError { - super(tail); - this.number = Long.parseLong(getInfo().getString("id")); - // TODO: See what happens if I am allowed to delete x.y form breakpoint locations - } - - /** - * Get the breakpoint number - * - * @return the breakpoint number - */ - public long getNumber() { - return number; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbBreakpointModifiedEvent.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbBreakpointModifiedEvent.java deleted file mode 100644 index 65c7c718f2..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbBreakpointModifiedEvent.java +++ /dev/null @@ -1,48 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.evt; - -import agent.gdb.manager.breakpoint.GdbBreakpointInfo; -import agent.gdb.manager.parsing.GdbParsingUtils.GdbParseError; - -/** - * The event corresponding with "{@code =breakpoint-modified}" - */ -public class GdbBreakpointModifiedEvent extends AbstractGdbEventWithFields { - private final GdbBreakpointInfo bkptInfo; - - /** - * Construct a new event by parsing the tail for information - * - * The breakpoint information must be specified by GDB. - * - * @param tail the text following the event type in the GDB/MI event record - * @throws GdbParseError if the tail cannot be parsed - */ - public GdbBreakpointModifiedEvent(CharSequence tail) throws GdbParseError { - super(tail); - this.bkptInfo = GdbBreakpointInfo.parse(getInfo(), null); - } - - /** - * Get the breakpoint information - * - * @return the parsed, but not processed, breakpoint information - */ - public GdbBreakpointInfo getBreakpointInfo() { - return bkptInfo; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbCommandConnectedEvent.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbCommandConnectedEvent.java deleted file mode 100644 index b0a2b79ede..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbCommandConnectedEvent.java +++ /dev/null @@ -1,34 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.evt; - -import agent.gdb.manager.parsing.GdbParsingUtils.GdbParseError; - -/** - * The event corresponding with "{@code ^connected}" - */ -public class GdbCommandConnectedEvent extends AbstractGdbCompletedCommandEvent { - - /** - * Construct a new event, parsing the tail for information - * - * @param tail the text following the event type in the GDB/MI event record - * @throws GdbParseError if the tail cannot be parsed - */ - public GdbCommandConnectedEvent(CharSequence tail) throws GdbParseError { - super(tail); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbCommandDoneEvent.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbCommandDoneEvent.java deleted file mode 100644 index bd216e7a6e..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbCommandDoneEvent.java +++ /dev/null @@ -1,227 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.evt; - -import java.util.ArrayList; -import java.util.List; - -import agent.gdb.manager.GdbInferiorThreadGroup; -import agent.gdb.manager.GdbProcessThreadGroup; -import agent.gdb.manager.parsing.GdbMiParser.GdbMiFieldList; -import agent.gdb.manager.parsing.GdbParsingUtils; -import agent.gdb.manager.parsing.GdbParsingUtils.GdbParseError; -import ghidra.util.Msg; - -/** - * The event corresponding with "{@code ^done}" - */ -public class GdbCommandDoneEvent extends AbstractGdbCompletedCommandEvent { - private static Long parseLong(String nullable) { - return nullable == null ? null : Long.parseLong(nullable); - } - - /** - * Construct a new event, parsing the tail for information - * - * @param tail the text following the event type in the GDB/MI event record - * @throws GdbParseError if the tail cannot be parsed - */ - public GdbCommandDoneEvent(CharSequence tail) throws GdbParseError { - super(tail); - } - - /** - * Assume inferior groups are specified, and get those groups' IDs - * - * @return the list of inferior thread-group IDs - */ - public List assumeInferiorGroups() { - List groups = getInfo().getListOf(GdbMiFieldList.class, "groups"); - List iids = new ArrayList<>(); - for (GdbMiFieldList groupInfo : groups) { - String gid = groupInfo.getString("id"); - if (!gid.startsWith("i")) { - continue; - } - int iid = GdbParsingUtils.parseInferiorId(gid); - String type = groupInfo.getString("type"); - String pid = groupInfo.getString("pid"); - String exitCode = groupInfo.getString("exit-code"); - String executable = groupInfo.getString("executable"); - iids.add(new GdbInferiorThreadGroup(iid, type, parseLong(pid), parseLong(exitCode), - executable)); - } - return iids; - } - - /** - * Assume process groups are specified, and get those processes' descriptions - * - * @return the list of (available) process thread-groups - */ - public List assumeProcessGroups() { - List groups = getInfo().getListOf(GdbMiFieldList.class, "groups"); - List pids = new ArrayList<>(); - for (GdbMiFieldList groupInfo : groups) { - if (!"process".equals(groupInfo.getString("type"))) { - Msg.error(this, "Unexpected type in available thread groups: " + groupInfo); - // TODO: If necessary, communicate type and id in the returned list - continue; - } - String gid = groupInfo.getString("id"); - String desc = groupInfo.getString("description"); - try { - pids.add(new GdbProcessThreadGroup(Integer.parseInt(gid), desc)); - } - catch (NumberFormatException e) { - Msg.error(this, "Unexpected group id in available thread groups: " + groupInfo); - } - } - return pids; - } - - /** - * Assume threads are specified, and get those threads' IDs - * - * @return the list of thread IDs - */ - public List assumeThreadIds() { - List threads = getInfo().getListOf(GdbMiFieldList.class, "threads"); - List tids = new ArrayList<>(); - for (GdbMiFieldList threadInfo : threads) { - String tid = threadInfo.getString("id"); - try { - tids.add(Integer.parseInt(tid)); - } - catch (NumberFormatException e) { - Msg.error(this, "Unexpected thread id in: " + threadInfo); - } - } - return tids; - } - - /** - * Check if a new thread is specified - * - * @return the new thread id, or null if unspecified - */ - public Integer checkNewThreadId() { - String newTid = getInfo().getString("new-thread-id"); - if (newTid == null) { - return null; - } - try { - return Integer.parseInt(newTid); - } - catch (NumberFormatException e) { - Msg.error(this, "Unexpected thread id in: " + newTid); - } - return null; - } - - /** - * Check if a new frame is specified - * - * @return the new frame, or null if unspecified - */ - public GdbMiFieldList checkFrame() { - return getInfo().getFieldList("frame"); - } - - /** - * Assume a value is specified, and get it as a string - * - * @return the value - */ - public String assumeValue() { - return getInfo().getString("value"); - } - - /** - * Check if a value is specified, and get it as a string - * - * @return the value, or null if not specified - */ - public String maybeValue() { - if (getInfo().containsKey("value")) { - return assumeValue(); - } - return null; - } - - /** - * Assume an "OSDataTable" is specified, and get that table - * - * @return the parsed, but not processed, table - */ - public GdbMiFieldList assumeOSDataTable() { - return getInfo().getFieldList("OSDataTable"); - } - - /** - * Assume a register name list is specified, and get that list - * - * @return the parsed, but not processed, list - */ - public List assumeRegisterNameList() { - return getInfo().getListOf(String.class, "register-names"); - } - - /** - * Assume a register value list is specified, and get that list - * - * @return the parsed, but not processed, list - */ - public List assumeRegisterValueList() { - return getInfo().getListOf(GdbMiFieldList.class, "register-values"); - } - - /** - * Assume a memory contents list is specified, and get that list - * - * @return the parsed, but not processed, list - */ - public List assumeMemoryContentsList() { - return getInfo().getListOf(GdbMiFieldList.class, "memory"); - } - - /** - * Assume a thread info list is specified, and get that list - * - * @return the parsed, but not processed, list - */ - public List assumeThreadInfoList() { - return getInfo().getListOf(GdbMiFieldList.class, "threads"); - } - - /** - * Assume a breakpoint table is specified, and get that table - * - * @return the parsed, but not processed, table - */ - public GdbMiFieldList assumeBreakpointTable() { - return getInfo().getFieldList("BreakpointTable"); - } - - /** - * Assume a stack is specified, and get that stack - * - * @return the parsed, but not processed, stack - */ - public GdbMiFieldList assumeStack() { - return getInfo().getFieldList("stack"); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbCommandEchoEvent.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbCommandEchoEvent.java deleted file mode 100644 index 8e40041119..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbCommandEchoEvent.java +++ /dev/null @@ -1,43 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.evt; - -import agent.gdb.manager.parsing.GdbParsingUtils.GdbParseError; - -/** - * An "event" corresponding with GDB/MI commands - * - *

- * If using a PTY configured with local echo, the manager needs to recognize and ignore the commands - * it issued. GDB/MI makes them easy to distinguish, because they start with "-". - */ -public class GdbCommandEchoEvent extends AbstractGdbEvent { - - /** - * Construct a new "event", passing the tail through as information - * - * @param tail the text following the event type in the GDB/MI event record - * @throws GdbParseError if the tail cannot be parsed - */ - public GdbCommandEchoEvent(CharSequence tail) throws GdbParseError { - super(tail); - } - - @Override - protected String parseInfo(CharSequence tail) throws GdbParseError { - return tail.toString(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbCommandEchoInterruptEvent.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbCommandEchoInterruptEvent.java deleted file mode 100644 index c13bd366ce..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbCommandEchoInterruptEvent.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.evt; - -import agent.gdb.manager.parsing.GdbParsingUtils.GdbParseError; - -/** - * An "event" corresponding with the {@code -exec-interrupt} GDB/MI command - * - *

- * If issued, the {@code -exec-interrupt} command is always issued "out of band". It skips the queue - * and is printed straight to GDB's pty, usually preceded by a Ctrl-C (char 3). As a result, GDB is - * going to print {@code ^done}, which will get mistaken for the completion of a command in the - * queue. By recognizing the command being echoed back, we can identify the done event that does - * with it, and ignore it. - */ -public class GdbCommandEchoInterruptEvent extends AbstractGdbEvent { - - /** - * Construct a new "event", passing the tail through as information - * - * @param tail the text following the event type in the GDB/MI event record - * @throws GdbParseError if the tail cannot be parsed - */ - public GdbCommandEchoInterruptEvent(CharSequence tail) throws GdbParseError { - super(tail); - } - - @Override - protected String parseInfo(CharSequence tail) throws GdbParseError { - return tail.toString(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbCommandErrorEvent.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbCommandErrorEvent.java deleted file mode 100644 index c506be9925..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbCommandErrorEvent.java +++ /dev/null @@ -1,55 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.evt; - -import agent.gdb.manager.impl.GdbEvent; -import agent.gdb.manager.parsing.GdbMiParser.GdbMiFieldList; -import agent.gdb.manager.parsing.GdbParsingUtils.GdbParseError; - -/** - * The event corresponding with "{@code ^error}" - */ -public class GdbCommandErrorEvent extends AbstractGdbCompletedCommandEvent { - - /** - * Construct a new event, parsing the tail for information - * - * @param tail the text following the event type in the GDB/MI event record - * @return the new event - * @throws GdbParseError if the tail cannot be parsed - */ - public static GdbCommandErrorEvent fromMi2(CharSequence tail) throws GdbParseError { - return new GdbCommandErrorEvent(tail); - } - - /** - * Construct a new event using the given error message - * - * @param message the message - * @return the new event - */ - public static GdbEvent fromMessage(String message) { - return new GdbCommandErrorEvent(message); - } - - protected GdbCommandErrorEvent(CharSequence tail) throws GdbParseError { - super(tail); - } - - protected GdbCommandErrorEvent(String message) { - super(GdbMiFieldList.builder().add("msg", message.trim()).build()); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbCommandExitEvent.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbCommandExitEvent.java deleted file mode 100644 index 857b528bd9..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbCommandExitEvent.java +++ /dev/null @@ -1,40 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.evt; - -import agent.gdb.manager.GdbState; -import agent.gdb.manager.parsing.GdbParsingUtils.GdbParseError; - -/** - * The event corresponding with "{@code ^exit}" - */ -public class GdbCommandExitEvent extends AbstractGdbCompletedCommandEvent { - - /** - * Construct a new event, parsing the tail for information - * - * @param tail the text following the event type in the GDB/MI event record - * @throws GdbParseError if the tail cannot be parsed - */ - public GdbCommandExitEvent(CharSequence tail) throws GdbParseError { - super(tail); - } - - @Override - public GdbState newState() { - return GdbState.EXIT; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbCommandRunningEvent.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbCommandRunningEvent.java deleted file mode 100644 index 4b2b9bbe9f..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbCommandRunningEvent.java +++ /dev/null @@ -1,48 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.evt; - -import agent.gdb.manager.GdbState; -import agent.gdb.manager.parsing.GdbMiParser.GdbMiFieldList; -import agent.gdb.manager.parsing.GdbParsingUtils.GdbParseError; - -/** - * The event corresponding with "{@code ^running}" - */ -public class GdbCommandRunningEvent extends AbstractGdbCompletedCommandEvent { - - /** - * Construct a new event, parsing the tail for information - * - * @param tail the text following the event type in the GDB/MI event record - * @throws GdbParseError if the tail cannot be parsed - */ - public GdbCommandRunningEvent(CharSequence tail) throws GdbParseError { - super(tail); - } - - /** - * Construct a new event with no information - */ - public GdbCommandRunningEvent() { - super(GdbMiFieldList.builder().build()); - } - - @Override - public GdbState newState() { - return null; // Let *running cause change, as it has more info. - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbConsoleOutputEvent.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbConsoleOutputEvent.java deleted file mode 100644 index 61f5238cb9..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbConsoleOutputEvent.java +++ /dev/null @@ -1,55 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.evt; - -import agent.gdb.manager.parsing.GdbParsingUtils.GdbParseError; - -/** - * The event corresponding with "{@code ~""}" output records - */ -public class GdbConsoleOutputEvent extends AbstractGdbOutputEvent { - - /** - * Construct a new event, parsing the tail for information - * - * @param tail the text following the event type in the GDB/MI event record - * @return the new event - * @throws GdbParseError if the tail cannot be parsed - */ - public static GdbConsoleOutputEvent fromMi2(CharSequence tail) throws GdbParseError { - return new GdbConsoleOutputEvent(tail); - } - - /** - * Construct a new event with the given output - * - * @param output the line of output - * @return the new event - */ - public static GdbConsoleOutputEvent fromCli(String output) { - return new GdbConsoleOutputEvent(output + "\n"); - } - - // Hidden in favor of named factory methods - protected GdbConsoleOutputEvent(CharSequence tail) throws GdbParseError { - super(tail); - } - - // Hidden in favor of named factory methods, as this is easily called accidentally - protected GdbConsoleOutputEvent(String output) { - super(output); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbDebugOutputEvent.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbDebugOutputEvent.java deleted file mode 100644 index b28b23fb82..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbDebugOutputEvent.java +++ /dev/null @@ -1,34 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.evt; - -import agent.gdb.manager.parsing.GdbParsingUtils.GdbParseError; - -/** - * The event corresponding with "{@code &""}" output records - */ -public class GdbDebugOutputEvent extends AbstractGdbOutputEvent { - - /** - * Construct a new event, parsing the tail for information - * - * @param tail the text following the event type in the GDB/MI event record - * @throws GdbParseError if the tail cannot be parsed - */ - public GdbDebugOutputEvent(CharSequence tail) throws GdbParseError { - super(tail); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbLibraryLoadedEvent.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbLibraryLoadedEvent.java deleted file mode 100644 index 3cbb5a18e2..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbLibraryLoadedEvent.java +++ /dev/null @@ -1,37 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.evt; - -import agent.gdb.manager.parsing.GdbParsingUtils.GdbParseError; - -/** - * The event corresponding with "{@code =library-loaded}" - */ -public class GdbLibraryLoadedEvent extends AbstractGdbLibraryEvent { - - /** - * Construct a new event, parsing the tail for information - * - * The library's ID and target name must be specified by GDB. The applicable inferiors - * (actually, thread groups) may also be specified. If not, the manager assumes all inferiors. - * - * @param tail the text following the event type in the GDB/MI event record - * @throws GdbParseError if the tail cannot be parsed - */ - public GdbLibraryLoadedEvent(CharSequence tail) throws GdbParseError { - super(tail); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbLibraryUnloadedEvent.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbLibraryUnloadedEvent.java deleted file mode 100644 index 4d5ee62acc..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbLibraryUnloadedEvent.java +++ /dev/null @@ -1,37 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.evt; - -import agent.gdb.manager.parsing.GdbParsingUtils.GdbParseError; - -/** - * The event corresponding with "{@code =library-unloaded}" - */ -public class GdbLibraryUnloadedEvent extends AbstractGdbLibraryEvent { - - /** - * Construct a new event, parsing the tail for information - * - * The library's ID and target name must be specified by GDB. The applicable inferiors - * (actually, thread groups) may also be specified. If not, the manager assumes all inferiors. - * - * @param tail the text following the event type in the GDB/MI event record - * @throws GdbParseError if the tail cannot be parsed - */ - public GdbLibraryUnloadedEvent(CharSequence tail) throws GdbParseError { - super(tail); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbMemoryChangedEvent.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbMemoryChangedEvent.java deleted file mode 100644 index d944da4b00..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbMemoryChangedEvent.java +++ /dev/null @@ -1,71 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.evt; - -import agent.gdb.manager.parsing.GdbParsingUtils; -import agent.gdb.manager.parsing.GdbParsingUtils.GdbParseError; - -/** - * The event corresponding with "{@code =memory-changed}" - */ -public class GdbMemoryChangedEvent extends AbstractGdbEventWithFields { - private final int iid; - private final long addr; - private final int len; - - /** - * Construct a new event by parsing the tail for information - * - *

- * The thread group, start address, and length must be specified by GDB. - * - * @param tail the text following the event type in the GDB/MI event record - * @throws GdbParseError if the tail cannot be parsed - */ - public GdbMemoryChangedEvent(CharSequence tail) throws GdbParseError { - super(tail); - this.iid = GdbParsingUtils.parseInferiorId(getInfo().getString("thread-group")); - this.addr = GdbParsingUtils.parsePrefixedHex(getInfo().getString("addr")); - this.len = (int) GdbParsingUtils.parsePrefixedHex(getInfo().getString("len")); - } - - /** - * Get the inferior ID - * - * @return the inferior ID - */ - public int getInferiorId() { - return iid; - } - - /** - * Get the starting address of the change - * - * @return the starting address - */ - public long getAddress() { - return addr; - } - - /** - * Get the length of the change - * - * @return the length - */ - public int getLength() { - return len; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbParamChangedEvent.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbParamChangedEvent.java deleted file mode 100644 index fef57f8064..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbParamChangedEvent.java +++ /dev/null @@ -1,59 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.evt; - -import agent.gdb.manager.parsing.GdbParsingUtils.GdbParseError; - -/** - * The event corresponding to "@{code =cmd-param-changed}" - */ -public class GdbParamChangedEvent extends AbstractGdbEventWithFields { - private final String param; - private final String value; - - /** - * Construct a new event by parsing the tail for information - * - *

- * The param (name) and value must be specified by GDB. - * - * @param tail the text following the event type in the GDB/MI event record - * @throws GdbParseError if the tail cannot be parsed - */ - public GdbParamChangedEvent(CharSequence tail) throws GdbParseError { - super(tail); - this.param = getInfo().getString("param"); - this.value = getInfo().getString("value"); - } - - /** - * Get the parameter name - * - * @return the name - */ - public String getParam() { - return param; - } - - /** - * Get the parameter value - * - * @return the value - */ - public String getValue() { - return value; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbRunningEvent.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbRunningEvent.java deleted file mode 100644 index aa54db6f97..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbRunningEvent.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.evt; - -import agent.gdb.manager.GdbState; -import agent.gdb.manager.parsing.GdbParsingUtils.GdbParseError; - -/** - * The event corresponding with "{@code *running}" - */ -public class GdbRunningEvent extends AbstractGdbEventWithStateChange { - - /** - * Construct a new event, parsing the tail for information - * - * @param tail the text following the event type in the GDB/MI event record - * @throws GdbParseError if the tail cannot be parsed - */ - public GdbRunningEvent(CharSequence tail) throws GdbParseError { - super(tail); - } - - @Override - public GdbState newState() { - return GdbState.RUNNING; - } - - /** - * Assume a thread ID is specified, and get that ID - * - * @return the ID - */ - public String assumeThreadId() { - return getInfo().getString("thread-id"); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbStoppedEvent.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbStoppedEvent.java deleted file mode 100644 index 46b48cfa99..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbStoppedEvent.java +++ /dev/null @@ -1,77 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.evt; - -import agent.gdb.manager.GdbState; -import agent.gdb.manager.impl.GdbStackFrameImpl; -import agent.gdb.manager.impl.GdbThreadImpl; -import agent.gdb.manager.parsing.GdbMiParser.GdbMiFieldList; -import agent.gdb.manager.parsing.GdbParsingUtils.GdbParseError; - -/** - * The event corresponding with "{@code *stopped}" - */ -public class GdbStoppedEvent extends AbstractGdbEventWithStateChange { - private final Integer tid; - - /** - * Construct a new event, parsing the tail for information - * - * A thread ID must be specified by GDB. - * - * @param tail the text following the event type in the GDB/MI event record - * @throws GdbParseError if the tail cannot be parsed - */ - public GdbStoppedEvent(CharSequence tail) throws GdbParseError { - super(tail); - String tidStr = getInfo().getString("thread-id"); - this.tid = tidStr == null ? null : Integer.parseInt(tidStr); - } - - /** - * Get the ID of the thread causing the event - * - * @return the thread ID - */ - public Integer getThreadId() { - return tid; - } - - /** - * Get the current frame, if applicable - * - * @param thread the current thread - * @return the frame - */ - public GdbStackFrameImpl getFrame(GdbThreadImpl thread) { - GdbMiFieldList fields = getInfo().getFieldList("frame"); - return fields == null ? null : GdbStackFrameImpl.fromFieldList(thread, fields); - } - - /** - * Get the list of threads stopped by this event - * - * @return the list as a string, possibly "all" - */ - public String assumeStoppedThreads() { - return getInfo().getString("stopped-threads"); - } - - @Override - public GdbState newState() { - return GdbState.STOPPED; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbTargetOutputEvent.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbTargetOutputEvent.java deleted file mode 100644 index 6dfbad1ec2..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbTargetOutputEvent.java +++ /dev/null @@ -1,34 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.evt; - -import agent.gdb.manager.parsing.GdbParsingUtils.GdbParseError; - -/** - * The event corresponding with "{@code @""}" output records - */ -public class GdbTargetOutputEvent extends AbstractGdbOutputEvent { - - /** - * Construct a new event, parsing the tail for information - * - * @param tail the text following the event type in the GDB/MI event record - * @throws GdbParseError if the tail cannot be parsed - */ - public GdbTargetOutputEvent(CharSequence tail) throws GdbParseError { - super(tail); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbThreadCreatedEvent.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbThreadCreatedEvent.java deleted file mode 100644 index 9448288a19..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbThreadCreatedEvent.java +++ /dev/null @@ -1,36 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.evt; - -import agent.gdb.manager.parsing.GdbParsingUtils.GdbParseError; - -/** - * The event corresponding with "{@code =thread-created}" - */ -public class GdbThreadCreatedEvent extends AbstractGdbThreadEvent { - - /** - * Construct a new event by parsing the tail for information - * - * The thread ID and thread group ID must be specified by GDB. - * - * @param tail the text following the event type in the GDB/MI event record - * @throws GdbParseError if the tail cannot be parsed - */ - public GdbThreadCreatedEvent(CharSequence tail) throws GdbParseError { - super(tail); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbThreadExitedEvent.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbThreadExitedEvent.java deleted file mode 100644 index bc8d9ebfef..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbThreadExitedEvent.java +++ /dev/null @@ -1,36 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.evt; - -import agent.gdb.manager.parsing.GdbParsingUtils.GdbParseError; - -/** - * The event corresponding with "{@code =thread-exited}" - */ -public class GdbThreadExitedEvent extends AbstractGdbThreadEvent { - - /** - * Construct a new event by parsing the tail for information - * - * The thread ID and thread group ID must be specified by GDB. - * - * @param tail the text following the event type in the GDB/MI event record - * @throws GdbParseError if the tail cannot be parsed - */ - public GdbThreadExitedEvent(CharSequence tail) throws GdbParseError { - super(tail); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbThreadGroupAddedEvent.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbThreadGroupAddedEvent.java deleted file mode 100644 index 4cdf15af00..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbThreadGroupAddedEvent.java +++ /dev/null @@ -1,36 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.evt; - -import agent.gdb.manager.parsing.GdbParsingUtils.GdbParseError; - -/** - * The event corresponding with "{@code =thread-group-added}" - */ -public class GdbThreadGroupAddedEvent extends AbstractGdbThreadGroupEvent { - - /** - * Construct a new event by parsing the tail for information - * - * The thread group ID must be specified by GDB in the "id" field. - * - * @param tail the text following the event type in the GDB/MI event record - * @throws GdbParseError if the tail cannot be parsed - */ - public GdbThreadGroupAddedEvent(CharSequence tail) throws GdbParseError { - super(tail); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbThreadGroupExitedEvent.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbThreadGroupExitedEvent.java deleted file mode 100644 index 4b6e4e4dec..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbThreadGroupExitedEvent.java +++ /dev/null @@ -1,63 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.evt; - -import agent.gdb.manager.parsing.GdbParsingUtils; -import agent.gdb.manager.parsing.GdbParsingUtils.GdbParseError; - -/** - * The event corresponding with "{@code =thread-group-exited}" - */ -public class GdbThreadGroupExitedEvent extends AbstractGdbThreadGroupEvent { - private Long exitCode; - - /** - * Construct a new event by parsing the tail for information - * - * The thread group ID must be specified by GDB in the "id" field. - * - * @param tail the text following the event type in the GDB/MI event record - * @throws GdbParseError if the tail cannot be parsed - */ - public GdbThreadGroupExitedEvent(CharSequence tail) throws GdbParseError { - super(tail); - String exitCodeStr = getInfo().getString("exit-code"); - if (exitCodeStr != null) { - this.exitCode = GdbParsingUtils.parsePrefixedOctal(exitCodeStr); - } - else { - this.exitCode = null; - } - } - - /** - * Check if the event specifies an exit code - * - * @return true if an exit code is present, false otherwise - */ - public boolean hasExitCode() { - return exitCode != null; - } - - /** - * Get the exit code - * - * @return the exit code if present, or null - */ - public Long getExitCode() { - return exitCode; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbThreadGroupRemovedEvent.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbThreadGroupRemovedEvent.java deleted file mode 100644 index 8904609077..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbThreadGroupRemovedEvent.java +++ /dev/null @@ -1,36 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.evt; - -import agent.gdb.manager.parsing.GdbParsingUtils.GdbParseError; - -/** - * The event corresponding with "{@code =thread-group-removed}" - */ -public class GdbThreadGroupRemovedEvent extends AbstractGdbThreadGroupEvent { - - /** - * Construct a new event by parsing the tail for information - * - * The thread group ID must be specified by GDB in the "id" field. - * - * @param tail the text following the event type in the GDB/MI event record - * @throws GdbParseError if the tail cannot be parsed - */ - public GdbThreadGroupRemovedEvent(CharSequence tail) throws GdbParseError { - super(tail); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbThreadGroupStartedEvent.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbThreadGroupStartedEvent.java deleted file mode 100644 index 73de7b4016..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbThreadGroupStartedEvent.java +++ /dev/null @@ -1,48 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.evt; - -import agent.gdb.manager.parsing.GdbParsingUtils.GdbParseError; - -/** - * The event corresponding with "{@code =thread-group-started}" - */ -public class GdbThreadGroupStartedEvent extends AbstractGdbThreadGroupEvent { - private final long pid; - - /** - * Construct a new event by parsing the tail for information - * - * The thread group ID must be specified by GDB in the "id" field. The process ID of the new - * process must also be specified. - * - * @param tail the text following the event type in the GDB/MI event record - * @throws GdbParseError if the tail cannot be parsed - */ - public GdbThreadGroupStartedEvent(CharSequence tail) throws GdbParseError { - super(tail); - this.pid = Long.parseLong(getInfo().getString("pid")); - } - - /** - * Get the process ID - * - * @return the process ID - */ - public long getPid() { - return pid; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbThreadSelectedEvent.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbThreadSelectedEvent.java deleted file mode 100644 index 13fec119ad..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/evt/GdbThreadSelectedEvent.java +++ /dev/null @@ -1,62 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.evt; - -import agent.gdb.manager.impl.GdbStackFrameImpl; -import agent.gdb.manager.impl.GdbThreadImpl; -import agent.gdb.manager.parsing.GdbMiParser.GdbMiFieldList; -import agent.gdb.manager.parsing.GdbParsingUtils.GdbParseError; - -/** - * The event corresponding with "{@code =thread-selected}" - */ -public class GdbThreadSelectedEvent extends AbstractGdbEventWithFields { - private final int tid; - - /** - * Construct a new event by parsing the tail for information - * - *

- * The selected thread ID must be specified by GDB. - * - * @param tail the text following the event type in the GDB/MI event record - * @throws GdbParseError if the tail cannot be parsed - */ - public GdbThreadSelectedEvent(CharSequence tail) throws GdbParseError { - super(tail); - this.tid = Integer.parseInt(getInfo().getString("id")); - } - - /** - * Get the selected thread ID - * - * @return the thread ID - */ - public int getThreadId() { - return tid; - } - - /** - * Get the selected frame, if applicable - * - * @param thread the selected thread - * @return the frame - */ - public GdbStackFrameImpl getFrame(GdbThreadImpl thread) { - GdbMiFieldList fields = getInfo().getFieldList("frame"); - return fields == null ? null : GdbStackFrameImpl.fromFieldList(thread, fields); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbCommand.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbCommand.java deleted file mode 100644 index ab44836c02..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbCommand.java +++ /dev/null @@ -1,128 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl; - -import java.util.concurrent.CompletableFuture; - -import agent.gdb.manager.GdbState; -import agent.gdb.manager.impl.GdbManagerImpl.Interpreter; -import agent.gdb.manager.impl.cmd.AbstractGdbCommand; -import agent.gdb.manager.impl.cmd.AbstractGdbCommandWithThreadId; - -/** - * The interface for GDB command implementations - * - *

- * Commands are executed by GDB in serial. In order to distinguish the likely cause of events, the - * manager will wait to issue each command until it has seen a prompt. Thus, commands are queued up, - * and the manager uses the {@link CompletableFuture} pattern to "return" results after execution - * completes. Once issued, a command is presumed to be executing until another prompt is received. - * This generally immediately follows the command result, i.e., the "^..." result line in GDB/MI. - * The command implementation is responsible for handling the command result. Implementors ought to - * use {@link AbstractGdbCommand} or {@link AbstractGdbCommandWithThreadId} to ensure consistent - * processing. - * - *

- * Before executing the command, the manager calls {@link #preCheck(GdbPendingCommand)}, giving the - * implementation an opportunity to cancel the command or complete it early. If the command is - * completed after the pre-check, the manager will not encode it, and instead proceed to the next - * command. This is useful for eliminating unneeded "focus" commands. To begin executing the - * command, the manager encodes the command, using {@link #encode()}. Any event that occurs during - * command execution is given to {@link #handle(GdbEvent, GdbPendingCommand)}. The implementor then - * has the option to "claim" or "steal" the event. When claimed, any subsequent event processor or - * listener is provided this command as the event's cause. When stolen, no subsequent event - * processors are called. The implementation ought to keep a list of claimed and stolen events. Once - * GDB has finished executing the command, the manager calls {@link #complete(GdbPendingCommand)}, - * allowing the implementation to process its claimed and stolen events and return the result of the - * command. - * - * @param the type of object "returned" by the command - */ -public interface GdbCommand { - - /** - * Check if this command can be executed given GDB's current state - * - * @param state GDB's state - * @return true if it can be executed, false otherwise - */ - public boolean validInState(GdbState state); - - /** - * Perform any pre-execution screening for this command - * - *

- * Complete {@code} pending with a result to short-circuit the execution of this command. - * - * @param pending the pend@Override ing command result - */ - void preCheck(GdbPendingCommand pending); - - /** - * Encode the command in GDB/MI - * - * @return the encoded command - */ - public String encode(); - - /** - * If executing this command changes the current thread, return that thread's ID - * - * @return the new current thread ID - */ - public Integer impliesCurrentThreadId(); - - /** - * If executing this command change the current frame, return that frame's ID - * - * @return the new current frame ID - */ - public Integer impliesCurrentFrameId(); - - /** - * Check if focus announcements from this command should be suppressed - * - * @return true to suppress announcements - */ - public boolean isFocusInternallyDriven(); - - /** - * Handle an event that occurred during the execution of this command - * - * @param evt the event - * @param pending a copy of the executing command instance - * @return true if the command is now ready to be completed - */ - public boolean handle(GdbEvent evt, GdbPendingCommand pending); - - /** - * Called when the manager believes this command is finished executing - * - *

- * This is presumed when the manager receives the prompt after issuing the encoded command - * - * @param pending a copy of the now-finished-executing command instance - * @return the object "returned" by the command - */ - public T complete(GdbPendingCommand pending); - - /** - * Get the interpreter for which this command is encoded - * - * @return the interpreter - */ - public Interpreter getInterpreter(); -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbEvent.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbEvent.java deleted file mode 100644 index baf4c9ba5e..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbEvent.java +++ /dev/null @@ -1,69 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl; - -import agent.gdb.manager.GdbCause; -import agent.gdb.manager.GdbState; - -/** - * The interface for GDB events - * - * @param the type of parsed information detailing the event - */ -public interface GdbEvent extends GdbCause { - - /** - * Get the information detailing the event - * - * @return the information - */ - public T getInfo(); - - /** - * Use {@link GdbPendingCommand#claim(GdbEvent)} instead - * - * @param cause the cause - */ - public void claim(GdbPendingCommand cause); - - /** - * If claimed, get the cause of this event - * - * @return the cause - */ - public GdbCause getCause(); - - /** - * Use {@link GdbPendingCommand#steal(GdbEvent)} instead - */ - public void steal(); - - /** - * Check if this event is stolen - * - * A stolen event should not be processed further, except by the thief - * - * @return true if stolen, false otherwise - */ - public boolean isStolen(); - - /** - * If this event implies a new GDB state, get that state - * - * @return the new state, or null for no change - */ - public GdbState newState(); -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbFrameInfo.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbFrameInfo.java deleted file mode 100644 index a44af599ad..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbFrameInfo.java +++ /dev/null @@ -1,116 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl; - -import java.util.*; - -import agent.gdb.manager.parsing.GdbMiParser.GdbMiFieldList; - -/** - * Information about a GDB frame - * - *

- * The contains the semantic processing for GDB frame information. - * - *

- * Note this is not a handle to the frame. Rather, this is the captured information from some event - * or request. If other commands have been executed since this information was gathered, the - * information may be stale. - */ -public class GdbFrameInfo { - - /** - * Process a parsed GDB frame information - * - * @param info the parsed information block - * @return the processed GDB frame information - */ - public static GdbFrameInfo parseInfo(GdbMiFieldList info) { - String level = info.getString("level"); - String addr = info.getString("addr"); - String func = info.getString("func"); - Collection arginfo = info.get("args"); - List args = new ArrayList<>(); - for (Object object : arginfo) { - if (object instanceof GdbMiFieldList) { - args.add(((GdbMiFieldList) object).toString()); - } - } - return new GdbFrameInfo(level, addr, func, args); - } - - private final String level; - private final String addr; - private final String func; - private final List args; - - /** - * Construct GDB frame information - * - * @param level frame id - * @param addr the stack address - * @param func the enclosing function - * @param args the function args - */ - GdbFrameInfo(String level, String addr, String func, List args) { - this.level = level; - this.addr = addr; - this.func = func; - this.args = args; - } - - @Override - public int hashCode() { - return Objects.hash(getLevel(), getAddr()); - } - - @Override - public String toString() { - return ""; - } - - @Override - public boolean equals(Object obj) { - if (!((obj instanceof GdbFrameInfo))) { - return false; - } - GdbFrameInfo that = (GdbFrameInfo) obj; - if (this.getLevel() != that.getLevel()) { - return false; - } - if (this.getAddr() != that.getAddr()) { - return false; - } - return true; - } - - public String getLevel() { - return level; - } - - public String getAddr() { - return addr; - } - - public String getFunc() { - return func; - } - - public List getArgs() { - return args; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbInferiorImpl.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbInferiorImpl.java deleted file mode 100644 index 331b17b351..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbInferiorImpl.java +++ /dev/null @@ -1,520 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl; - -import java.math.BigInteger; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; -import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import agent.gdb.manager.*; -import agent.gdb.manager.GdbCause.Causes; -import agent.gdb.manager.GdbManager.StepCmd; -import agent.gdb.manager.impl.cmd.*; -import agent.gdb.manager.impl.cmd.GdbConsoleExecCommand.CompletesWithRunning; -import generic.ULongSpan.ULongSpanSet; -import ghidra.async.AsyncLazyValue; -import ghidra.lifecycle.Internal; -import ghidra.util.Msg; - -/** - * The implementation of {@link GdbInferior} - */ -public class GdbInferiorImpl implements GdbInferior { - protected static final Pattern MEMORY_MAPPING_WOUT_FLAGS_LINE_PATTERN = - Pattern.compile("\\s*" + - "0x(?[0-9,A-F,a-f]+)\\s+" + - "0x(?[0-9,A-F,a-f]+)\\s+" + - "0x(?[0-9,A-F,a-f]+)\\s+" + - "0x(?[0-9,A-F,a-f]+)\\s+" + - "(?.*)"); - - protected static final Pattern MEMORY_MAPPING_LINE_PATTERN = - Pattern.compile("\\s*" + // - "0x(?[0-9,A-F,a-f]+)\\s+" + - "0x(?[0-9,A-F,a-f]+)\\s+" + - "0x(?[0-9,A-F,a-f]+)\\s+" + - "0x(?[0-9,A-F,a-f]+)\\s+" + - "(?[rwsxp\\-]+)\\s+" + - "(?.*)"); - - protected final GdbManagerImpl manager; - private final int id; - - private Long pid; // Not always present - private Long exitCode; // Not always present - private String executable; // Not always present - - private ByteOrder endianness; - - private final Map threads = new LinkedHashMap<>(); - private final Map unmodifiableThreads = - Collections.unmodifiableMap(threads); - - private final Map modules = new LinkedHashMap<>(); - private final Map unmodifiableModules = Collections.unmodifiableMap(modules); - protected final AsyncLazyValue> listModules = - new AsyncLazyValue<>(this::doListModules); - - private final NavigableMap mappings = new TreeMap<>(); - private final NavigableMap unmodifiableMappings = - Collections.unmodifiableNavigableMap(mappings); - - public GdbInferiorImpl(GdbManagerImpl manager, int id) { - this.manager = manager; - this.id = id; - } - - /** - * Construct a new inferior - * - * @param manager the manager creating the inferior - * @param id the GDB-assigned inferior ID - */ - public GdbInferiorImpl(GdbManagerImpl manager, GdbInferiorThreadGroup g) { - this(manager, g.getInferiorId()); - update(g); - } - - public void update(GdbInferiorThreadGroup g) { - Long oldPid = pid; - this.pid = g.getPid(); - this.exitCode = g.getExitCode(); - this.executable = g.getExecutable(); - - // Because we're only called to resync, we should synth started, if needed - if (oldPid == null && pid != null) { - manager.fireInferiorStarted(this, Causes.UNCLAIMED, "resyncInferiorStarted"); - } - } - - @Override - public String toString() { - return ""; - } - - @Override - public int getId() { - return id; - } - - /** - * Set the process ID of this inferior - * - * An inferior is associated to exactly one process at a time, but since it may be restarted, it - * may be associated with different processes at different times. This method allows the manager - * to set the PID when it changes. - * - * @param pid the PID - */ - public void setPid(long pid) { - this.pid = pid; - } - - @Override - public Long getPid() { - return pid; - } - - /** - * Set the inferior exit code - * - * When the inferior exits (or rather its associated process exits), this allows the manager to - * set the exit code. - * - * @param exitCode the exit code (status or signal) - */ - public void setExitCode(Long exitCode) { - this.exitCode = exitCode; - } - - @Override - public Long getExitCode() { - return exitCode; - } - - @Override - public String getExecutable() { - return executable; - } - - /** - * Add this inferior to the manager's list of inferiors, because of a given cause - * - * @param cause the cause of the new inferior - */ - public void add(GdbCause cause) { - manager.addInferior(this, cause); - } - - /** - * Remove this inferior from the manager's list of inferiors, because of a given cause - * - * @param cause the cause of removal - */ - public void remove(GdbCause cause) { - manager.removeInferior(id, cause); - } - - /** - * Use {@link GdbThreadImpl#add()} instead - * - * @param thread the thread to add - */ - public void addThread(GdbThreadImpl thread) { - GdbThreadImpl exists = threads.get(thread.getId()); - if (exists != null) { - throw new IllegalArgumentException("There is already thread " + exists); - } - threads.put(thread.getId(), thread); - - } - - @Override - public GdbThreadImpl getThread(int tid) { - GdbThreadImpl result = threads.get(tid); - if (result == null) { - throw new IllegalArgumentException("There is no thread with id " + tid); - } - return result; - } - - /** - * Use {@link GdbThreadImpl#remove()} instead - * - * @param tid the ID of the thread to remove - */ - public void removeThread(int tid) { - if (threads.remove(tid) == null) { - throw new IllegalArgumentException("There is no thread with id " + tid); - } - } - - @Override - public Map getKnownThreads() { - return unmodifiableThreads; - } - - public Map getKnownThreadsImpl() { - return threads; - } - - protected CompletableFuture execute(GdbCommand cmd) { - /** - * Queue select and execute one immediately after the other. If I do thenCompose, it's - * possible for some other command to get inserted between, which means this inferior may no - * longer be current for the actual command execution. NB: The select command will cancel - * itself if this inferior is already current. - */ - return setActive(true).thenCombine(manager.execute(cmd), (s, e) -> e); - } - - @Override - public CompletableFuture> listThreads() { - return execute(new GdbListThreadsCommand(manager, this)); - } - - @Override - public Map getKnownModules() { - return unmodifiableModules; - } - - @Override - public CompletableFuture> listModules(boolean refresh) { - if (refresh) { - if (listModules.isBusy()) { - manager.logInfo("Refresh requested while busy. Keeping cache."); - } - else { - manager.logInfo("Refresh requested. Forgetting module cache."); - listModules.forget(); - } - } - manager.logInfo("Modules requested"); - return listModules.request(); - } - - protected CompletableFuture> doListModules() { - return manager.execMaintInfoSectionsAllObjects(this).thenCompose(lines -> { - return listMappings().thenApply(mappings -> { - GdbMemoryMapping.Index index = new GdbMemoryMapping.Index(mappings); - parseAndUpdateAllModuleSections(lines, index); - return unmodifiableModules; - }); - }); - } - - protected GdbModuleImpl resyncCreateModule(String name) { - //Msg.warn(this, "Resync: Missed loaded module/library: " + name); - //manager.listenersInferior.fire.libraryLoaded(this, name, Causes.UNCLAIMED); - return createModule(name); - } - - protected GdbModuleImpl createModule(String name) { - return new GdbModuleImpl(this, name); - } - - protected void libraryLoaded(String name) { - manager.logInfo("Module loaded: " + name + ". Forgeting module cache."); - listModules.forget(); - } - - protected void libraryUnloaded(String name) { - modules.remove(name); - } - - protected void resyncRetainModules(Set names) { - /** - * NOTE: We used to fire libraryUnloaded on removes detected during resync. For that, we - * used an iterator. Without a listener callback, we have simplified. - */ - modules.keySet().retainAll(names); - } - - protected String nameFromLine(String line) { - Matcher nameMatcher = manager.matchFileLine(line); - if (nameMatcher == null) { - return null; - } - String name = nameMatcher.group("name"); - if (name.startsWith(GdbModuleImpl.GNU_DEBUGDATA_PREFIX)) { - return null; - } - return name; - } - - protected void parseAndUpdateAllModuleSections(String[] lines, GdbMemoryMapping.Index index) { - Set modNamesSeen = new HashSet<>(); - Set secNamesSeen = new HashSet<>(); - GdbModuleImpl curModule = null; - for (String line : lines) { - String name = nameFromLine(line); - if (name != null) { - if (curModule != null) { - curModule.resyncRetainSections(secNamesSeen); - secNamesSeen.clear(); - } - modNamesSeen.add(name); - curModule = modules.computeIfAbsent(name, this::resyncCreateModule); - } - else if (curModule != null) { - curModule.processSectionLine(line, secNamesSeen, index); - } - } - if (curModule != null) { - curModule.resyncRetainSections(secNamesSeen); - // No need to clear secNamesSeen - } - resyncRetainModules(modNamesSeen); - } - - @Override - public NavigableMap getKnownMappings() { - return unmodifiableMappings; - } - - @Override - public CompletableFuture> listMappings() { - return consoleCapture("info proc mappings", CompletesWithRunning.CANNOT) - .thenApply(this::parseMappings); - } - - protected GdbMemoryMapping parseMappingLine(String line) throws NumberFormatException { - Matcher mappingMatcher = MEMORY_MAPPING_LINE_PATTERN.matcher(line); - if (!mappingMatcher.matches()) { - return null; - } - BigInteger start = new BigInteger(mappingMatcher.group("start"), 16); - BigInteger end = new BigInteger(mappingMatcher.group("end"), 16); - BigInteger size = new BigInteger(mappingMatcher.group("size"), 16); - BigInteger offset = new BigInteger(mappingMatcher.group("offset"), 16); - String flags = mappingMatcher.group("flags"); - String objfile = mappingMatcher.group("file"); - return new GdbMemoryMapping(start, end, size, offset, flags, objfile); - } - - protected GdbMemoryMapping parseMappingsLineWOutFlags(String line) - throws NumberFormatException { - Matcher mappingMatcher = MEMORY_MAPPING_WOUT_FLAGS_LINE_PATTERN.matcher(line); - if (!mappingMatcher.matches()) { - return null; - } - BigInteger start = new BigInteger(mappingMatcher.group("start"), 16); - BigInteger end = new BigInteger(mappingMatcher.group("end"), 16); - BigInteger size = new BigInteger(mappingMatcher.group("size"), 16); - BigInteger offset = new BigInteger(mappingMatcher.group("offset"), 16); - String objfile = mappingMatcher.group("file"); - return new GdbMemoryMapping(start, end, size, offset, "rwx", objfile); - } - - protected NavigableMap parseMappings(String out) { - Set startsSeen = new TreeSet<>(); - for (String line : out.split("\n")) { - try { - GdbMemoryMapping mapping = parseMappingLine(line); - if (mapping == null) { - mapping = parseMappingsLineWOutFlags(line); - } - if (mapping == null) { // still, so it matches neither pattern - continue; // It's just a throw-away line, or the format changed again. - } - startsSeen.add(mapping.getStart()); - mappings.put(mapping.getStart(), mapping); - } - catch (NumberFormatException e) { - Msg.error(this, "Could not parse mapping entry: " + line, e); - } - } - mappings.keySet().retainAll(startsSeen); - return unmodifiableMappings; - } - - @Override - public CompletableFuture setActive(boolean internal) { - return manager.setActiveInferior(this, internal); - } - - @Override - public CompletableFuture fileExecAndSymbols(String file) { - return execute(new GdbFileExecAndSymbolsCommand(manager, file)); - } - - @Override - public CompletableFuture run() { - return execute(new GdbRunCommand(manager)); - } - - @Override - public CompletableFuture start() { - return execute(new GdbStartCommand(manager)); - } - - @Override - public CompletableFuture starti() { - return execute(new GdbStartInstructionCommand(manager)); - } - - @Override - public CompletableFuture> attach(long toPid) { - return execute(new GdbAttachCommand(manager, toPid)); - } - - @Override - public CompletableFuture console(String command, CompletesWithRunning cwr) { - return execute(new GdbConsoleExecCommand(manager, null, null, command, - GdbConsoleExecCommand.Output.CONSOLE, cwr)).thenApply(e -> null); - } - - @Override - public CompletableFuture consoleCapture(String command, CompletesWithRunning cwr) { - return execute(new GdbConsoleExecCommand(manager, null, null, command, - GdbConsoleExecCommand.Output.CAPTURE, cwr)); - } - - @Override - public CompletableFuture cont() { - return execute(new GdbContinueCommand(manager, null)); - } - - @Override - public CompletableFuture step(StepCmd suffix) { - return execute(new GdbStepCommand(manager, null, suffix)); - } - - @Override - public CompletableFuture evaluate(String expression) { - return execute(new GdbEvaluateCommand(manager, null, null, expression)); - } - - @Override - public CompletableFuture setTty(String tty) { - return execute(new GdbSetInferiorTtyCommand(manager, tty)); - } - - @Override - public CompletableFuture getVar(String varName) { - // TODO: Are these actually per-inferior? - // If so, should make them accessible via thread - return execute(new GdbGetVarCommand(manager, varName)); - } - - @Override - public CompletableFuture setVar(String varName, String val) { - // TODO: Are these actually per-inferior? - // If so, should make them accessible via thread - return execute(new GdbSetVarCommand(manager, null, varName, val)); - } - - @Override - public CompletableFuture detach() { - return execute(new GdbDetachCommand(manager, this, null)); - } - - @Override - public CompletableFuture kill() { - return execute(new GdbKillCommand(manager, null)); - } - - @Override - public CompletableFuture readMemory(long addr, ByteBuffer buf, int len) { - return execute(new GdbReadMemoryCommand(manager, null, addr, buf, len)); - } - - @Override - public CompletableFuture writeMemory(long addr, ByteBuffer buf, int len) { - return execute(new GdbWriteMemoryCommand(manager, null, addr, buf, len)); - } - - @Override - public CompletableFuture remove() { - return manager.removeInferior(this); - } - - @Override - public String getDescriptor() { - if (pid != null) { - return "process " + pid; - } - return ""; - } - - @Internal - public CompletableFuture syncEndianness() { - return consoleCapture("show endian", CompletesWithRunning.CANNOT).thenAccept(out -> { - if (out.toLowerCase().contains("little endian")) { - endianness = ByteOrder.LITTLE_ENDIAN; - } - else if (out.toLowerCase().contains("big endian")) { - endianness = ByteOrder.BIG_ENDIAN; - } - else { - endianness = null; - } - }); - } - - @Internal - public ByteOrder getEndianness() { - if (endianness == null) { - throw new AssertionError("Could not determine target endianness"); - } - return endianness; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbManagerImpl.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbManagerImpl.java deleted file mode 100644 index 8bec0c0af2..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbManagerImpl.java +++ /dev/null @@ -1,1928 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl; - -import java.io.*; -import java.text.MessageFormat; -import java.util.*; -import java.util.Map.Entry; -import java.util.concurrent.*; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicReference; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import javax.swing.JDialog; -import javax.swing.JOptionPane; - -import org.apache.commons.lang3.exception.ExceptionUtils; - -import agent.gdb.manager.*; -import agent.gdb.manager.GdbCause.Causes; -import agent.gdb.manager.breakpoint.GdbBreakpointInfo; -import agent.gdb.manager.breakpoint.GdbBreakpointType; -import agent.gdb.manager.evt.*; -import agent.gdb.manager.impl.cmd.*; -import agent.gdb.manager.impl.cmd.GdbConsoleExecCommand.CompletesWithRunning; -import agent.gdb.manager.parsing.GdbMiParser; -import agent.gdb.manager.parsing.GdbMiParser.GdbMiFieldList; -import agent.gdb.manager.parsing.GdbParsingUtils.GdbParseError; -import ghidra.GhidraApplicationLayout; -import ghidra.async.*; -import ghidra.async.AsyncLock.Hold; -import ghidra.dbg.error.DebuggerModelTerminatingException; -import ghidra.dbg.util.HandlerMap; -import ghidra.dbg.util.PrefixMap; -import ghidra.framework.OperatingSystem; -import ghidra.lifecycle.Internal; -import ghidra.pty.*; -import ghidra.pty.PtyChild.Echo; -import ghidra.pty.windows.AnsiBufferedInputStream; -import ghidra.util.Msg; -import ghidra.util.SystemUtilities; -import ghidra.util.datastruct.ListenerSet; -import sun.misc.Signal; -import sun.misc.SignalHandler; - -/** - * Implementation of {@link GdbManager} - * - *

- * This is implemented using the asynchronous chaining library and executors. A single-threaded - * executor handles issuing GDB command and processing events. Another thread handles reading GDB's - * output and parsing events. Those events are then scheduled for processing on the executor. The - * executor guarantees that commands are executed serially while reducing the risk of deadlock since - * the asynchronous calls return futures immediately. - * - *

- * A {@link PrefixMap} aids in parsing GDB events. The event details are then parsed with the - * {@link GdbMiParser} and passed around for processing. If a command is currently executed, that - * command has the first option to claim or steal the event. If it is stolen, no further processing - * takes place in the manager. If no command is executing, or the command does not steal it, the - * event is processed using a {@link HandlerMap}. - */ -public class GdbManagerImpl implements GdbManager { - private static final int TIMEOUT_SEC = 10; - private static final String GDB_IS_TERMINATING = "GDB is terminating"; - public static final int MAX_CMD_LEN = 4094; // Account for longest possible line end - - private static final boolean IS_WINDOWS = - OperatingSystem.CURRENT_OPERATING_SYSTEM == OperatingSystem.WINDOWS; - private static final short PTY_COLS = IS_WINDOWS ? Short.MAX_VALUE : 0; - private static final short PTY_ROWS = IS_WINDOWS ? (short) 1 : 0; - - private String maintInfoSectionsCmd = GdbModuleImpl.MAINT_INFO_SECTIONS_CMD_V11; - private Pattern fileLinePattern = GdbModuleImpl.OBJECT_FILE_LINE_PATTERN_V11; - private Pattern sectionLinePattern = GdbModuleImpl.OBJECT_SECTION_LINE_PATTERN_V10; - - private static final String PTY_DIALOG_MESSAGE_PATTERN = - "

Please enter:

" + - "
new-ui mi2 {0}
" + "" + - "

into an existing gdb session.


" + - "

Alternatively, to launch a new session, cancel this dialog. " + - "Then, retry with use existing session disabled.

"; - - private static final String CANCEL = "Cancel"; - - @Internal - public enum Interpreter { - CLI, MI2; - } - - private static final boolean LOG_IO = - Boolean.getBoolean("agent.gdb.manager.log") || SystemUtilities.isInDevelopmentMode(); - private static PrintWriter DBG_LOG = null; - private static final String PROMPT_GDB = "(gdb)"; - public static final int INTERRUPT_MAX_RETRIES = 3; - public static final int INTERRUPT_RETRY_PERIOD_MILLIS = 100; - - class PtyThread extends Thread { - final Pty pty; - final BufferedReader reader; - final Channel channel; - - Interpreter interpreter; - PrintWriter writer; - CompletableFuture hasWriter; - - PtyThread(Pty pty, Channel channel, Interpreter interpreter) { - this.pty = pty; - this.channel = channel; - InputStream inputStream = pty.getParent().getInputStream(); - // TODO: This should really only be applied to the MI2 console - // But, we don't know what we have until we read it.... - if (IS_WINDOWS) { - inputStream = new AnsiBufferedInputStream(inputStream); - } - this.reader = new BufferedReader(new InputStreamReader(inputStream)); - this.interpreter = interpreter; - hasWriter = new CompletableFuture<>(); - } - - @Override - public void run() { - if (LOG_IO && DBG_LOG == null) { - initLog(); - } - try { - String line; - while (GdbManagerImpl.this.isAlive() && null != (line = reader.readLine())) { - String l = line; - if (interpreter == null) { - if (l.startsWith("=") || l.startsWith("~")) { - interpreter = Interpreter.MI2; - } - else { - interpreter = Interpreter.CLI; - } - } - if (writer == null) { - writer = new PrintWriter(pty.getParent().getOutputStream()); - hasWriter.complete(null); - } - //Msg.debug(this, channel + ": " + line); - submit(() -> { - if (LOG_IO) { - DBG_LOG.println("<" + interpreter + ": " + l); - DBG_LOG.flush(); - } - processLine(l, channel, interpreter); - }); - } - } - catch (Throwable e) { - terminate(); - Msg.debug(this, channel + "," + interpreter + " reader exiting because " + e); - //throw new AssertionError(e); - } - } - } - - class PtyInfoDialogThread extends Thread { - private final JOptionPane pane; - private final JDialog dialog; - final CompletableFuture result = new CompletableFuture<>(); - - public PtyInfoDialogThread(String ptyName) { - String message = MessageFormat.format(PTY_DIALOG_MESSAGE_PATTERN, ptyName); - pane = new JOptionPane(message, JOptionPane.PLAIN_MESSAGE, 0, null, - new Object[] { CANCEL }); - dialog = pane.createDialog("Waiting for GDB/MI session"); - } - - @Override - public void run() { - dialog.setVisible(true); - Object sel = pane.getValue(); - if (CANCEL.equals(sel)) { - result.complete(JOptionPane.CANCEL_OPTION); - } - else { - result.complete(JOptionPane.CLOSED_OPTION); - } - } - } - - private final PtyFactory ptyFactory; - - private final AsyncReference state = - new AsyncReference<>(GdbState.NOT_STARTED); - // A copy of state, which is updated on the eventThread. - private final AsyncReference asyncState = new AsyncReference<>(state.get()); - private Interpreter runningInterpreter; - private final AsyncReference mi2Prompt = new AsyncReference<>(false); - - private final PrefixMap, GdbParseError> mi2PrefixMap = new PrefixMap<>(); - private final HandlerMap, Void, Void> handlerMap = new HandlerMap<>(); - private final AtomicBoolean exited = new AtomicBoolean(false); - - private PtySession gdb; - private Thread gdbWaiter; - - private PtyThread iniThread; - private PtyThread cliThread; - private PtyThread mi2Thread; - - private String newLine = System.lineSeparator(); - - private final AsyncLock cmdLock = new AsyncLock(); - private final AtomicReference cmdLockHold = new AtomicReference<>(null); - private ExecutorService executor; - - private GdbPendingCommand curCmd = null; - private int interruptCount = 0; - - private final Map inferiors = new LinkedHashMap<>(); - private GdbInferiorImpl curInferior = null; - private final Map unmodifiableInferiors = - Collections.unmodifiableMap(inferiors); - - private final Map threads = new LinkedHashMap<>(); - private final Map unmodifiableThreads = - Collections.unmodifiableMap(threads); - - private final Map breakpoints = new LinkedHashMap<>(); - private final Map unmodifiableBreakpoints = - Collections.unmodifiableMap(breakpoints); - - protected final ListenerSet listenersEvent = - new ListenerSet<>(GdbEventsListener.class, true); - protected final ListenerSet listenersTargetOutput = - new ListenerSet<>(GdbTargetOutputListener.class, true); - protected final ListenerSet listenersConsoleOutput = - new ListenerSet<>(GdbConsoleOutputListener.class, true); - protected final ExecutorService eventThread = Executors.newSingleThreadExecutor(); - - /** - * Instantiate a new manager - * - * @param ptyFactory a factory for creating Pty's for child GDBs - */ - public GdbManagerImpl(PtyFactory ptyFactory) { - this.ptyFactory = ptyFactory; - - state.filter(this::stateFilter); - state.addChangeListener(this::trackRunningInterpreter); - state.addChangeListener((os, ns, c) -> event(() -> asyncState.set(ns, c), "managerState")); - defaultPrefixes(); - defaultHandlers(); - } - - private void initLog() { - try { - GhidraApplicationLayout layout = new GhidraApplicationLayout(); - File userSettings = layout.getUserSettingsDir(); - File logFile = new File(userSettings, "GDB.log"); - try { - logFile.getParentFile().mkdirs(); - logFile.createNewFile(); - } - catch (Exception e) { - throw new AssertionError(logFile.getPath() + " appears to be unwritable", e); - } - DBG_LOG = new PrintWriter(new FileOutputStream(logFile)); - } - catch (IOException e) { - throw new AssertionError(e); - } - } - - CompletableFuture event(Runnable r, String text) { - //Msg.debug(this, "Queueing event: " + text); - return CompletableFuture.runAsync(r, eventThread).exceptionally(ex -> { - Msg.error(this, "Error in event callback:", ex); - return ExceptionUtils.rethrow(ex); - }); - } - - private GdbState stateFilter(GdbState cur, GdbState set, GdbCause cause) { - if (set == null) { - return cur; - } - return set; - } - - private void trackRunningInterpreter(GdbState oldSt, GdbState st, GdbCause cause) { - if (st == GdbState.RUNNING && cause instanceof GdbPendingCommand) { - GdbPendingCommand pcmd = (GdbPendingCommand) cause; - runningInterpreter = pcmd.getCommand().getInterpreter(); - //Msg.debug(this, "Entered " + st + " with interpreter: " + runningInterpreter); - } - else { - runningInterpreter = null; - } - } - - private void defaultPrefixes() { - mi2PrefixMap.put("-exec-interrupt", GdbCommandEchoInterruptEvent::new); - mi2PrefixMap.put("-", GdbCommandEchoEvent::new); - mi2PrefixMap.put("~", GdbConsoleOutputEvent::fromMi2); - mi2PrefixMap.put("@", GdbTargetOutputEvent::new); - mi2PrefixMap.put("&", GdbDebugOutputEvent::new); - - mi2PrefixMap.put("^done", GdbCommandDoneEvent::new); - mi2PrefixMap.put("^running", GdbCommandRunningEvent::new); - mi2PrefixMap.put("^connected", GdbCommandConnectedEvent::new); - mi2PrefixMap.put("^exit", GdbCommandExitEvent::new); - mi2PrefixMap.put("^error", GdbCommandErrorEvent::fromMi2); - - mi2PrefixMap.put("*running", GdbRunningEvent::new); - mi2PrefixMap.put("*stopped", GdbStoppedEvent::new); - - mi2PrefixMap.put("=thread-group-added", GdbThreadGroupAddedEvent::new); - mi2PrefixMap.put("=thread-group-removed", GdbThreadGroupRemovedEvent::new); - mi2PrefixMap.put("=thread-group-started", GdbThreadGroupStartedEvent::new); - mi2PrefixMap.put("=thread-group-exited", GdbThreadGroupExitedEvent::new); - - mi2PrefixMap.put("=thread-created", GdbThreadCreatedEvent::new); - mi2PrefixMap.put("=thread-exited", GdbThreadExitedEvent::new); - mi2PrefixMap.put("=thread-selected", GdbThreadSelectedEvent::new); - mi2PrefixMap.put("=library-loaded", GdbLibraryLoadedEvent::new); - mi2PrefixMap.put("=library-unloaded", GdbLibraryUnloadedEvent::new); - mi2PrefixMap.put("=breakpoint-created", t -> new GdbBreakpointCreatedEvent(t, this)); - mi2PrefixMap.put("=breakpoint-modified", GdbBreakpointModifiedEvent::new); - mi2PrefixMap.put("=breakpoint-deleted", GdbBreakpointDeletedEvent::new); - - mi2PrefixMap.put("=memory-changed", GdbMemoryChangedEvent::new); - mi2PrefixMap.put("=cmd-param-changed", GdbParamChangedEvent::new); - } - - private void defaultHandlers() { - handlerMap.putVoid(GdbCommandEchoInterruptEvent.class, this::pushCmdInterrupt); - handlerMap.putVoid(GdbCommandEchoEvent.class, this::ignoreCmdEcho); - handlerMap.putVoid(GdbConsoleOutputEvent.class, this::processStdOut); - handlerMap.putVoid(GdbTargetOutputEvent.class, this::processTargetOut); - handlerMap.putVoid(GdbDebugOutputEvent.class, this::processStdErr); - - handlerMap.putVoid(GdbCommandDoneEvent.class, this::processCommandDone); - handlerMap.putVoid(GdbCommandRunningEvent.class, this::processCommandRunning); - handlerMap.putVoid(GdbCommandConnectedEvent.class, this::processCommandConnected); - handlerMap.putVoid(GdbCommandExitEvent.class, this::processCommandExit); - handlerMap.putVoid(GdbCommandErrorEvent.class, this::processCommandError); - - handlerMap.putVoid(GdbRunningEvent.class, this::processRunning); - handlerMap.putVoid(GdbStoppedEvent.class, this::processStopped); - - handlerMap.putVoid(GdbThreadGroupAddedEvent.class, this::processThreadGroupAdded); - handlerMap.putVoid(GdbThreadGroupRemovedEvent.class, this::processThreadGroupRemoved); - handlerMap.putVoid(GdbThreadGroupStartedEvent.class, this::processThreadGroupStarted); - handlerMap.putVoid(GdbThreadGroupExitedEvent.class, this::processThreadGroupExited); - - handlerMap.putVoid(GdbThreadCreatedEvent.class, this::processThreadCreated); - handlerMap.putVoid(GdbThreadExitedEvent.class, this::processThreadExited); - handlerMap.putVoid(GdbThreadSelectedEvent.class, this::processThreadSelected); - handlerMap.putVoid(GdbLibraryLoadedEvent.class, this::processLibraryLoaded); - handlerMap.putVoid(GdbLibraryUnloadedEvent.class, this::processLibraryUnloaded); - handlerMap.putVoid(GdbBreakpointCreatedEvent.class, this::processBreakpointCreated); - handlerMap.putVoid(GdbBreakpointModifiedEvent.class, this::processBreakpointModified); - handlerMap.putVoid(GdbBreakpointDeletedEvent.class, this::processBreakpointDeleted); - - handlerMap.putVoid(GdbMemoryChangedEvent.class, this::processMemoryChanged); - handlerMap.putVoid(GdbParamChangedEvent.class, this::processParamChanged); - } - - @Override - public boolean isAlive() { - return state.get().isAlive(); - } - - @Override - public void addStateListener(GdbStateListener listener) { - asyncState.addChangeListener(listener); - } - - @Override - public void removeStateListener(GdbStateListener listener) { - asyncState.removeChangeListener(listener); - } - - @Override - public void addEventsListener(GdbEventsListener listener) { - listenersEvent.add(listener); - } - - @Override - public void removeEventsListener(GdbEventsListener listener) { - listenersEvent.remove(listener); - } - - @Internal // for detach command - public void fireThreadExited(int tid, GdbInferiorImpl inferior, GdbCause cause) { - event(() -> listenersEvent.invoke().threadExited(tid, inferior, cause), "threadExited"); - } - - @Override - public void addTargetOutputListener(GdbTargetOutputListener listener) { - listenersTargetOutput.add(listener); - } - - @Override - public void removeTargetOutputListener(GdbTargetOutputListener listener) { - listenersTargetOutput.remove(listener); - } - - @Override - public void addConsoleOutputListener(GdbConsoleOutputListener listener) { - listenersConsoleOutput.add(listener); - } - - @Override - public void removeConsoleOutputListener(GdbConsoleOutputListener listener) { - listenersConsoleOutput.remove(listener); - } - - /** - * Use {@link GdbThreadImpl#add()} instead - * - * @param thread the thread to add - */ - public void addThread(GdbThreadImpl thread) { - GdbThreadImpl exists = threads.get(thread.getId()); - if (exists != null) { - throw new IllegalArgumentException("There is already thread " + exists); - } - threads.put(thread.getId(), thread); - } - - @Override - public GdbThreadImpl getThread(int tid) { - GdbThreadImpl result = threads.get(tid); - if (result == null) { - throw new IllegalArgumentException("There is no thread with id " + tid); - } - return result; - } - - public CompletableFuture getThreadInfo(int threadId) { - return execute(new GdbGetThreadInfoCommand(this, threadId)); - } - - /** - * Use {@link GdbThreadImpl#remove()} instead - * - * @param tid the thread ID to remove - */ - public void removeThread(int tid) { - if (threads.remove(tid) == null) { - throw new IllegalArgumentException("There is no thread with id " + tid); - } - } - - /** - * Use {@link GdbInferiorImpl#add(GdbCause)} instead - * - * @param inferior the inferior to add - * @param cause the cause of the new inferior - */ - @Internal - public void addInferior(GdbInferiorImpl inferior, GdbCause cause) { - GdbInferiorImpl exists = inferiors.get(inferior.getId()); - if (exists != null) { - throw new IllegalArgumentException("There is already inferior " + exists); - } - inferiors.put(inferior.getId(), inferior); - event(() -> listenersEvent.invoke().inferiorAdded(inferior, cause), "addInferior"); - } - - /** - * Use {@link GdbInferiorImpl#remove(GdbCause)} instead - * - * @param iid the inferior ID to remove - * @param cause the cause of removal - */ - @Internal - public void removeInferior(int iid, GdbCause cause) { - if (inferiors.remove(iid) == null) { - throw new IllegalArgumentException("There is no inferior with id " + iid); - } - event(() -> listenersEvent.invoke().inferiorRemoved(iid, cause), "removeInferior"); - } - - /** - * Update the selected inferior - * - * @param inferior the inferior that now has focus - * @param cause the cause of the focus change - */ - protected boolean updateCurrentInferior(GdbInferiorImpl inferior, GdbCause cause, - boolean fire) { - // GDB will not permit removing all inferiors, so one is guaranteed to exist - // GDB may actually have already selected it, but without generating events - GdbInferiorImpl inf = inferior != null ? inferior : inferiors.values().iterator().next(); - if (curInferior != inf) { - curInferior = inf; - if (fire) { - event(() -> listenersEvent.invoke().inferiorSelected(inf, cause), - "updateCurrentInferior"); - } - return true; - } - return false; - } - - @Override - public GdbInferiorImpl getInferior(int iid) { - GdbInferiorImpl result = inferiors.get(iid); - if (result == null) { - throw new IllegalArgumentException("There is no inferior with id " + iid); - } - return result; - } - - private void checkStarted() { - if (state.get() == GdbState.NOT_STARTED) { - throw new IllegalStateException( - "GDB has not been started or has not finished starting"); - } - } - - private void checkStartedNotExit() { - checkStarted(); - if (state.get() == GdbState.EXIT) { - throw new DebuggerModelTerminatingException(GDB_IS_TERMINATING); - } - } - - @Override - public GdbInferior currentInferior() { - checkStartedNotExit(); - return curInferior; - } - - @Override - public Map getKnownInferiors() { - return unmodifiableInferiors; - } - - @Internal - public Map getKnownInferiorsInternal() { - return inferiors; - } - - @Override - public Map getKnownThreads() { - return unmodifiableThreads; - } - - @Override - public Map getKnownBreakpoints() { - return unmodifiableBreakpoints; - } - - @Internal - public Map getKnownBreakpointsInternal() { - return breakpoints; - } - - public GdbBreakpointInfo addKnownBreakpoint(GdbBreakpointInfo bkpt, boolean expectExisting) { - GdbBreakpointInfo old = breakpoints.put(bkpt.getNumber(), bkpt); - if (expectExisting && old == null) { - Msg.warn(this, "Was missing breakpoint " + bkpt.getNumber()); - } - else if (!expectExisting && old != null) { - Msg.warn(this, "Already had breakpoint " + bkpt.getNumber()); - } - return old; - } - - private GdbBreakpointInfo getKnownBreakpoint(long number) { - GdbBreakpointInfo info = breakpoints.get(number); - if (info == null) { - Msg.warn(this, "Breakpoint " + number + " is not known"); - } - return info; - } - - public GdbBreakpointInfo removeKnownBreakpoint(long number) { - GdbBreakpointInfo del = breakpoints.remove(number); - if (del == null) { - Msg.warn(this, "Deleted missing breakpoint " + number); - } - return del; - } - - @Override - public CompletableFuture insertBreakpoint(String loc, - GdbBreakpointType type) { - return execute(new GdbInsertBreakpointCommand(this, null, loc, type)); - } - - @Override - public CompletableFuture disableBreakpoints(long... numbers) { - return execute(new GdbDisableBreakpointsCommand(this, numbers)); - } - - @Override - public CompletableFuture enableBreakpoints(long... numbers) { - return execute(new GdbEnableBreakpointsCommand(this, numbers)); - } - - @Override - public CompletableFuture deleteBreakpoints(long... numbers) { - return execute(new GdbDeleteBreakpointsCommand(this, numbers)); - } - - @Override - public CompletableFuture> listBreakpoints() { - return execute(new GdbListBreakpointsCommand(this, null)); - } - - private void submit(Runnable runnable) { - checkStartedNotExit(); - executor.submit(() -> { - try { - runnable.run(); - } - catch (Throwable e) { - e.printStackTrace(); - } - }); - } - - @Override - public void setNewLine(String newLine) { - this.newLine = newLine; - } - - protected void waitCheckExit(CompletableFuture future) - throws InterruptedException, ExecutionException, TimeoutException, IOException { - CompletableFuture.anyOf(future, state.waitValue(GdbState.EXIT)) - .get(TIMEOUT_SEC, TimeUnit.SECONDS); - if (state.get() == GdbState.EXIT) { - throw new IOException( - "GDB terminated early or could not be executed. Check your command line."); - } - } - - @Override - public void start(String gdbCmd, String... args) throws IOException { - List fullargs = new ArrayList<>(); - fullargs.addAll(Arrays.asList(gdbCmd)); - fullargs.addAll(Arrays.asList(args)); - - state.set(GdbState.STARTING, Causes.UNCLAIMED); - executor = Executors.newSingleThreadExecutor(); - - if (gdbCmd != null) { - iniThread = - new PtyThread(ptyFactory.openpty(PTY_COLS, PTY_ROWS), Channel.STDOUT, null); - - Msg.info(this, "Starting gdb with: " + fullargs); - gdb = - iniThread.pty.getChild().session(fullargs.toArray(new String[] {}), null, Echo.OFF); - gdbWaiter = new Thread(this::waitGdbExit, "GDB WaitExit"); - gdbWaiter.start(); - - iniThread.start(); - try { - waitCheckExit(iniThread.hasWriter); - } - catch (InterruptedException | ExecutionException | TimeoutException e) { - throw new IOException( - "Could not detect GDB's interpreter mode. Try " + gdbCmd + " -i mi2"); - } - switch (iniThread.interpreter) { - case CLI: - Pty mi2Pty = ptyFactory.openpty(); - - cliThread = iniThread; - cliThread.setName("GDB Read CLI"); - // Looks terrible, but we're already in this world - cliThread.writer.print("set confirm off" + newLine); - cliThread.writer.print("set pagination off" + newLine); - String ptyName; - try { - ptyName = Objects.requireNonNull(mi2Pty.getChild().nullSession(Echo.OFF)); - } - catch (UnsupportedOperationException e) { - throw new IOException( - "Pty implementation does not support null sessions. Try " + gdbCmd + - " -i mi2", - e); - } - cliThread.writer.print("new-ui mi2 " + ptyName + newLine); - cliThread.writer.flush(); - - mi2Thread = new PtyThread(mi2Pty, Channel.STDOUT, Interpreter.MI2); - mi2Thread.setName("GDB Read MI2"); - mi2Thread.start(); - try { - waitCheckExit(mi2Thread.hasWriter); - } - catch (InterruptedException | ExecutionException | TimeoutException e) { - throw new IOException( - "Could not obtain GDB/MI2 interpreter. Try " + gdbCmd + " -i mi2"); - } - break; - case MI2: - mi2Thread = iniThread; - mi2Thread.setName("GDB Read MI2"); - break; - } - } - else { - Pty mi2Pty = ptyFactory.openpty(Short.MAX_VALUE, (short) 1); - String mi2PtyName = mi2Pty.getChild().nullSession(Echo.OFF); - Msg.info(this, "Agent is waiting for GDB/MI v2 interpreter at " + mi2PtyName); - mi2Thread = new PtyThread(mi2Pty, Channel.STDOUT, Interpreter.MI2); - mi2Thread.setName("GDB Read MI2"); - - mi2Thread.start(); - - PtyInfoDialogThread dialog = new PtyInfoDialogThread(mi2PtyName); - dialog.start(); - dialog.result.thenAccept(choice -> { - if (choice == JOptionPane.CANCEL_OPTION) { - mi2Thread.hasWriter.cancel(false); - // This will cause - } - }); - - // Yes, wait on the user indefinitely. - try { - mi2Thread.hasWriter.get(); - } - catch (InterruptedException | ExecutionException e) { - Msg.info(this, "The user cancelled, or something else: " + e); - terminate(); - } - dialog.dialog.setVisible(false); - } - - // Do this whether or not joining existing. It's possible .gdbinit did stuff. - resync(); - } - - @Override - public CompletableFuture runRC() { - return waitForPrompt().thenCompose(__ -> rc()); - } - - /** - * Execute commands upon GDB startup - * - * @return a future which completes when the rc commands are complete - */ - protected CompletableFuture rc() { - if (cliThread != null) { - // NB. confirm and pagination are already disabled here - return AsyncUtils.nil(); - } - // NB. Don't disable pagination here. MI2 is not paginated. - return CompletableFuture.allOf( - console("set confirm off", CompletesWithRunning.CANNOT), - console("set new-console on", CompletesWithRunning.CANNOT).exceptionally(e -> { - // not Windows. So what? - return null; - })); - } - - protected void resync() { - AsyncFence fence = new AsyncFence(); - fence.include(listInferiors().thenCompose(infs -> { - AsyncFence inner = new AsyncFence(); - for (GdbInferior inf : infs.values()) { - // NOTE: Mappings need not be constantly synced - // NOTE: Modules need not be constantly synced - inner.include(inf.listThreads()); - } - return inner.ready(); - })); - fence.include(listBreakpoints()); - // NOTE: Available processes need not be constantly synced - fence.ready().exceptionally(ex -> { - Msg.error(this, "Could not resync the GDB session: " + ex); - return null; - }); - } - - private void waitGdbExit() { - try { - int exitcode = gdb.waitExited(); - state.set(GdbState.EXIT, Causes.UNCLAIMED); - exited.set(true); - if (!executor.isShutdown()) { - processGdbExited(exitcode); - terminate(); - } - } - catch (InterruptedException e) { - terminate(); - } - } - - @Override - public synchronized void terminate() { - Msg.debug(this, "Terminating " + this); - checkStarted(); - exited.set(true); - executor.shutdownNow(); - if (gdbWaiter != null) { - gdbWaiter.interrupt(); - } - if (gdb != null) { - gdb.destroyForcibly(); - } - try { - if (cliThread != null) { - cliThread.interrupt(); - cliThread.pty.close(); - } - if (mi2Thread != null) { - mi2Thread.interrupt(); - mi2Thread.pty.close(); - } - } - catch (IOException e) { - Msg.error(this, "Problem closing PTYs to GDB."); - } - DebuggerModelTerminatingException reason = - new DebuggerModelTerminatingException(GDB_IS_TERMINATING); - cmdLock.dispose(reason); - state.dispose(reason); - mi2Prompt.dispose(reason); - for (GdbThreadImpl thread : threads.values()) { - thread.dispose(reason); - } - GdbPendingCommand cc = this.curCmd; // read volatile - if (cc != null && !cc.isDone()) { - cc.completeExceptionally(reason); - } - } - - protected CompletableFuture execute(GdbCommand cmd) { - // NB. curCmd::finish is passed to eventThread already - return doExecute(cmd);//.thenApplyAsync(t -> t, eventThread); - } - - /** - * Schedule a command for execution - * - * @param cmd the command to execute - * @return the pending command, which acts as a future for later completion - */ - protected GdbPendingCommand doExecute(GdbCommand cmd) { - assert cmd != null; - checkStartedNotExit(); - GdbPendingCommand pcmd = new GdbPendingCommand<>(cmd); - - //Msg.debug(this, "WAITING cmdLock: " + pcmd); - cmdLock.acquire(null).thenAccept(hold -> { - cmdLockHold.set(hold); - //Msg.debug(this, "ACQUIRED cmdLock: " + pcmd); - synchronized (this) { - if (curCmd != null) { - throw new AssertionError("Cannot execute more than one command at a time"); - } - if (gdb != null && !cmd.validInState(state.get())) { - throw new GdbCommandError( - "Command " + cmd + " is not valid while " + state.get()); - } - cmd.preCheck(pcmd); - if (pcmd.isDone()) { - cmdLockHold.getAndSet(null).release(); - return; - } - curCmd = pcmd; - //Msg.debug(this, "CURCMD = " + curCmd); - if (LOG_IO) { - DBG_LOG.println("*CMD: " + cmd.getClass()); - DBG_LOG.flush(); - } - String text = cmd.encode(); - if (text != null) { - Interpreter interpreter = cmd.getInterpreter(); - PrintWriter wr = getWriter(interpreter); - //Msg.debug(this, "STDIN: " + text); - wr.print(text + newLine); - wr.flush(); - if (LOG_IO) { - DBG_LOG.println(">" + interpreter + ": " + text); - DBG_LOG.flush(); - } - } - } - }).exceptionally((exc) -> { - pcmd.completeExceptionally(exc); - //Msg.debug(this, "ON_EXCEPTION: CURCMD = " + curCmd); - synchronized (this) { - curCmd = null; - } - //Msg.debug(this, "SET CURCMD = null"); - //Msg.debug(this, "RELEASING cmdLock"); - Hold hold = cmdLockHold.getAndSet(null); - if (hold != null) { - hold.release(); - } - return null; - }); - return pcmd; - } - - @Override - public void cancelCurrentCommand() { - GdbPendingCommand curCmd; - synchronized (this) { - curCmd = this.curCmd; - this.curCmd = null; - } - if (curCmd != null) { - Msg.info(this, "Cancelling current command: " + curCmd); - curCmd.cancel(false); - } - Hold hold = cmdLockHold.getAndSet(null); - if (hold != null) { - hold.release(); - } - } - - protected PrintWriter getWriter(Interpreter interpreter) { - switch (interpreter) { - case CLI: - return cliThread == null ? null : cliThread.writer; - case MI2: - return mi2Thread == null ? null : mi2Thread.writer; - default: - throw new AssertionError(); - } - } - - protected void checkImpliedFocusChange() { - Integer tid = curCmd.impliesCurrentThreadId(); - GdbThreadImpl thread = null; - if (tid != null) { - thread = threads.get(tid); - if (thread == null) { - Msg.info(this, "Thread " + tid + " no longer exists"); - return; - // Presumably, some event will have announced the new current thread - } - } - Integer level = curCmd.impliesCurrentFrameId(); - GdbStackFrameImpl frame = null; - if (level != null) { - frame = new GdbStackFrameImpl(thread, level, null, null); - } - if (thread != null) { - doThreadSelected(thread, frame, curCmd); - } - } - - protected synchronized void processEvent(GdbEvent evt) { - if (evt instanceof AbstractGdbCompletedCommandEvent && interruptCount > 0) { - interruptCount--; - Msg.debug(this, "Ignoring " + evt + - " from -exec-interrupt. new count = " + interruptCount); - return; - } - /** - * NOTE: I've forgotten why, but the state update needs to happen between handle and - * finish. - */ - boolean cmdFinished = false; - if (curCmd != null) { - cmdFinished = curCmd.handle(evt); - if (cmdFinished) { - checkImpliedFocusChange(); - } - } - - GdbState newState = evt.newState(); - //Msg.debug(this, evt + " transitions state to " + newState); - state.set(newState, evt.getCause()); - - // NOTE: Do not check if claimed here. - // Downstream processing should check for cause - handlerMap.handle(evt, null); - - if (cmdFinished) { - event(curCmd::finish, "curCmd::finish"); - curCmd = null; - cmdLockHold.getAndSet(null).release(); - } - } - - /** - * Schedule a line of GDB output for processing - * - *

- * Before the implementation started using a PTY, the channel was used to distinguish whether - * the line was read from stdout or stderr. Now, all output is assumed to be from stdout. - * - * @param line the line - * @param channel the channel producing the line (stdout) - */ - protected synchronized void processLine(String line, Channel channel, Interpreter interpreter) { - if (interpreter == Interpreter.CLI) { - processEvent(GdbConsoleOutputEvent.fromCli(line)); - return; - } - if ("".equals(line.trim())) { - return; - } - //Msg.debug(this, "processing: " + channel + ": " + line); - mi2Prompt.set(false, null); // Go ahead and fire on a second consecutive prompt - if (PROMPT_GDB.equals(line.trim())) { - if (state.get() == GdbState.STARTING) { - state.set(GdbState.STOPPED, Causes.UNCLAIMED); - } - //Msg.debug(this, "AT_PROMPT: CURCMD = " + curCmd); - /*if (curCmd != null) { - curCmd.finish(); - curCmd = null; - //Msg.debug(this, "SET CURCMD = null"); - //Msg.debug(this, "RELEASING cmdLock"); - cmdLockHold.getAndSet(null).release(); - }*/ - mi2Prompt.set(true, null); - } - else { - GdbEvent evt = null; - try { - while (line.startsWith("^C")) { - Msg.info(this, "Got ^C"); - line = line.substring(2); - } - evt = mi2PrefixMap.construct(line); - if (evt == null) { - Msg.warn(this, "Unknown event: " + line); - return; - } - processEvent(evt); - } - catch (GdbParseError e) { - throw new RuntimeException("GDB gave an unrecognized response", e); - } - catch (IllegalArgumentException e) { - Msg.warn(this, "Error processing GDB output", e); - } - } - } - - protected void processGdbExited(int exitcode) { - Msg.info(this, "GDB exited with code " + exitcode); - } - - protected void pushCmdInterrupt(GdbCommandEchoInterruptEvent evt, Void v) { - interruptCount++; - } - - /** - * Called for lines starting with "-", which are just commands echoed back by the PTY - * - * @param evt the "event" - * @param v nothing - */ - protected void ignoreCmdEcho(GdbCommandEchoEvent evt, Void v) { - // Do nothing - } - - /** - * Called for lines starting with "~", which are lines GDB would like printed to stdout - * - * @param evt the event - * @param v nothing - */ - protected void processStdOut(GdbConsoleOutputEvent evt, Void v) { - String out = evt.getOutput(); - //System.out.print(out); - if (!evt.isStolen()) { - listenersConsoleOutput.invoke().output(Channel.STDOUT, out); - } - if (evt.getInterpreter() == Interpreter.MI2 && - out.toLowerCase().contains("switching to inferior")) { - String[] parts = out.trim().split("\\s+"); - int iid = Integer.parseInt(parts[3]); - updateCurrentInferior(getInferior(iid), evt.getCause(), true); - } - } - - /** - * Called for lines starting with "@", which are lines printed by the target (limited support) - * - * @param evt the event - * @param v nothing - */ - protected void processTargetOut(GdbTargetOutputEvent evt, Void v) { - listenersTargetOutput.invoke().output(evt.getOutput()); - } - - /** - * Called for lines starting with "&", which are lines GDB would like printed to stderr - * - * @param evt the event - * @param v nothing - */ - protected void processStdErr(GdbDebugOutputEvent evt, Void v) { - String out = evt.getOutput(); - //System.err.print(out); - if (!evt.isStolen()) { - listenersConsoleOutput.invoke().output(Channel.STDERR, out); - } - } - - /** - * Handler for "=thread-group-added" events - * - * @param evt the event - * @param v nothing - */ - protected void processThreadGroupAdded(GdbThreadGroupAddedEvent evt, Void v) { - int iid = evt.getInferiorId(); - GdbInferiorImpl inferior = new GdbInferiorImpl(this, iid); - /** - * Update currentInferior, but delay event. inferiorAdded callbacks may ask for - * currentInferior, so it must be up-to-date. However, inferiorSelected callbacks should not - * refer to an inferior that has not appeared in an inferiorAdded event. - */ - boolean fireSelected = false; - if (inferiors.isEmpty()) { - fireSelected = updateCurrentInferior(inferior, evt.getCause(), false); - } - inferior.add(evt.getCause()); - if (fireSelected) { - event(() -> listenersEvent.invoke().inferiorSelected(inferior, evt.getCause()), - "groupAdded-sel"); - } - } - - /** - * Handler for "=thread-group-removed" events - * - * @param evt the event - * @param v nothing - */ - protected void processThreadGroupRemoved(GdbThreadGroupRemovedEvent evt, Void v) { - int iid = evt.getInferiorId(); - GdbInferiorImpl inferior = getInferior(iid); - GdbInferiorImpl cur; - boolean fireSelected = false; - if (curInferior == inferior) { - // Select a new current before removing, so no event is generated yet - cur = inferiors.values().stream().filter(i -> i != inferior).findFirst().get(); - // Can't remove all, so this should always come out true - fireSelected = updateCurrentInferior(cur, evt.getCause(), false); - } - else { - cur = null; - } - inferior.remove(evt.getCause()); - if (fireSelected) { - event(() -> listenersEvent.invoke().inferiorSelected(cur, evt.getCause()), - "groupRemoved-sel"); - // Also cause GDB to generate thread selection events, if applicable - setActiveInferior(cur, false); - } - } - - /** - * Handler for "=thread-group-started" events - * - * @param evt the event - * @param v nothing - */ - protected void processThreadGroupStarted(GdbThreadGroupStartedEvent evt, Void v) { - int iid = evt.getInferiorId(); - GdbInferiorImpl inf = getInferior(iid); - inf.setPid(evt.getPid()); - fireInferiorStarted(inf, evt.getCause(), "inferiorStarted"); - } - - public void fireInferiorStarted(GdbInferiorImpl inf, GdbCause cause, String text) { - event(() -> listenersEvent.invoke().inferiorStarted(inf, cause), text); - } - - /** - * Handler for "=thread-group-exited" events - * - * @param evt the event - * @param v nothing - */ - protected void processThreadGroupExited(GdbThreadGroupExitedEvent evt, Void v) { - int iid = evt.getInferiorId(); - GdbInferiorImpl inf = getInferior(iid); - inf.setExitCode(evt.getExitCode()); - event(() -> listenersEvent.invoke().inferiorExited(inf, evt.getCause()), "inferiorExited"); - } - - /** - * Handler for "=thread-created" events - * - * @param evt the event - * @param v nothing - */ - protected void processThreadCreated(GdbThreadCreatedEvent evt, Void v) { - int tid = evt.getThreadId(); - int iid = evt.getInferiorId(); - GdbInferiorImpl inf = getInferior(iid); - GdbThreadImpl thread = new GdbThreadImpl(this, inf, tid); - thread.add(); - event(() -> listenersEvent.invoke().threadCreated(thread, evt.getCause()), "threadCreated"); - } - - /** - * Handler for "=thread-exited" events - * - * @param evt the event - * @param v nothing - */ - protected void processThreadExited(GdbThreadExitedEvent evt, Void v) { - int tid = evt.getThreadId(); - int iid = evt.getInferiorId(); - GdbInferiorImpl inf = getInferior(iid); - GdbThreadImpl thread = inf.getThread(tid); - thread.remove(); - event(() -> listenersEvent.invoke().threadExited(tid, inf, evt.getCause()), "threadExited"); - } - - /** - * Handler for "=thread-selected" events - * - * @param evt the event - * @param v nothing - */ - protected void processThreadSelected(GdbThreadSelectedEvent evt, Void v) { - int tid = evt.getThreadId(); - GdbThreadImpl thread = getThread(tid); - GdbStackFrameImpl frame = evt.getFrame(thread); - doThreadSelected(thread, frame, evt.getCause()); - } - - /** - * Fire thread (and frame) selection event - * - * @param thread the new thread - * @param frame the new frame - * @param cause the cause of the selection change - */ - public void doThreadSelected(GdbThreadImpl thread, GdbStackFrame frame, GdbCause cause) { - updateCurrentInferior(thread.getInferior(), cause, true); - event(() -> listenersEvent.invoke().threadSelected(thread, frame, cause), "threadSelected"); - } - - /** - * Handler for "=library-loaded" events - * - * @param evt the event - * @param v nothing - */ - protected void processLibraryLoaded(GdbLibraryLoadedEvent evt, Void v) { - Integer iid = evt.getInferiorId(); - String name = evt.getTargetName(); - if (iid == null) { // Context of all inferiors - for (GdbInferiorImpl inf : inferiors.values()) { - inf.libraryLoaded(name); - event(() -> listenersEvent.invoke().libraryLoaded(inf, name, evt.getCause()), - "libraryLoaded"); - } - } - else { - GdbInferiorImpl inf = getInferior(iid); - inf.libraryLoaded(name); - event(() -> listenersEvent.invoke().libraryLoaded(inf, name, evt.getCause()), - "libraryLoaded"); - } - } - - /** - * Handler for "=library-unloaded" events - * - * @param evt the event - * @param v nothing - */ - protected void processLibraryUnloaded(GdbLibraryUnloadedEvent evt, Void v) { - Integer iid = evt.getInferiorId(); - String name = evt.getTargetName(); - if (iid == null) { // Context of all inferiors - for (GdbInferiorImpl inf : inferiors.values()) { - inf.libraryUnloaded(name); - event(() -> listenersEvent.invoke().libraryUnloaded(inf, name, evt.getCause()), - "libraryUnloaded"); - } - } - else { - GdbInferiorImpl inf = getInferior(iid); - inf.libraryUnloaded(name); - event(() -> listenersEvent.invoke().libraryUnloaded(inf, name, evt.getCause()), - "libraryUnloaded"); - } - } - - /** - * Fire breakpoint created event - * - * @param newInfo the new information - * @param cause the cause of the creation - */ - @Internal - public void doBreakpointCreated(GdbBreakpointInfo newInfo, GdbCause cause) { - addKnownBreakpoint(newInfo, false); - event(() -> listenersEvent.invoke().breakpointCreated(newInfo, cause), "breakpointCreated"); - } - - /** - * Handler for "=breakpoint-created" events - * - * @param evt the event - * @param v nothing - */ - protected void processBreakpointCreated(GdbBreakpointCreatedEvent evt, Void v) { - doBreakpointCreated(evt.getBreakpointInfo(), evt.getCause()); - } - - /** - * Fire breakpoint modified event - * - * @param newInfo the new information - * @param cause the cause of the modification - */ - @Internal - public void doBreakpointModified(GdbBreakpointInfo newInfo, GdbCause cause) { - GdbBreakpointInfo oldInfo = addKnownBreakpoint(newInfo, true); - event(() -> listenersEvent.invoke().breakpointModified(newInfo, oldInfo, cause), - "breakpointModified"); - } - - /** - * Handler for "=breakpoint-modified" events - * - * @param evt the event - * @param v nothing - */ - protected void processBreakpointModified(GdbBreakpointModifiedEvent evt, Void v) { - doBreakpointModified(evt.getBreakpointInfo(), evt.getCause()); - } - - /** - * Fire breakpoint deleted event - * - * @param number the deleted breakpoint number - * @param cause the cause of the deletion - */ - @Internal - public void doBreakpointDeleted(long number, GdbCause cause) { - GdbBreakpointInfo oldInfo = removeKnownBreakpoint(number); - if (oldInfo == null) { - return; - } - event(() -> listenersEvent.invoke().breakpointDeleted(oldInfo, cause), "breakpointDeleted"); - } - - protected void doBreakpointModifiedSameLocations(GdbBreakpointInfo newInfo, - GdbBreakpointInfo oldInfo, GdbCause cause) { - if (Objects.equals(newInfo, oldInfo)) { - return; - } - addKnownBreakpoint(newInfo, true); - event(() -> listenersEvent.invoke().breakpointModified(newInfo, oldInfo, cause), - "breakpointModified"); - } - - @Internal - public void doBreakpointDisabled(long number, GdbCause cause) { - GdbBreakpointInfo oldInfo = getKnownBreakpoint(number); - if (oldInfo == null) { - return; - } - GdbBreakpointInfo newInfo = oldInfo.withEnabled(false); - //oldInfo = oldInfo.withEnabled(true); - doBreakpointModifiedSameLocations(newInfo, oldInfo, cause); - } - - @Internal - public void doBreakpointEnabled(long number, GdbCause cause) { - GdbBreakpointInfo oldInfo = getKnownBreakpoint(number); - if (oldInfo == null) { - return; - } - GdbBreakpointInfo newInfo = oldInfo.withEnabled(true); - //oldInfo = oldInfo.withEnabled(false); - doBreakpointModifiedSameLocations(newInfo, oldInfo, cause); - } - - /** - * Handler for "=breakpoint-deleted" events - * - * @param evt the event - * @param v nothing - */ - protected void processBreakpointDeleted(GdbBreakpointDeletedEvent evt, Void v) { - doBreakpointDeleted(evt.getNumber(), evt.getCause()); - } - - /** - * Handler for "=memory-changed" events - * - * @param evt the event - * @param v nothing - */ - protected void processMemoryChanged(GdbMemoryChangedEvent evt, Void v) { - int iid = evt.getInferiorId(); - GdbInferior inf = getInferior(iid); - event(() -> listenersEvent.invoke().memoryChanged(inf, evt.getAddress(), evt.getLength(), - evt.getCause()), "memoryChanged"); - } - - /** - * Handler for "=cmd-param-changed" events - * - * @param evt the event - * @param v nothing - */ - protected void processParamChanged(GdbParamChangedEvent evt, Void v) { - event(() -> listenersEvent.invoke().paramChanged(evt.getParam(), evt.getValue(), - evt.getCause()), "paramChanged"); - } - - /** - * Check that a command completion event was claimed - * - *

- * Except under certain error conditions, GDB should never issue a command completed event that - * is not associated with a command. A command implementation in the manager must claim the - * completion event. This is an assertion to ensure no implementation forgets to do that. - * - * @param evt the event - */ - protected void checkClaimed(GdbEvent evt) { - if (evt.getCause() == Causes.UNCLAIMED) { - if (evt instanceof AbstractGdbCompletedCommandEvent) { - AbstractGdbCompletedCommandEvent completed = (AbstractGdbCompletedCommandEvent) evt; - String msg = completed.assumeMsg(); - if (msg != null) { - if (evt instanceof GdbCommandErrorEvent) { - Msg.error(this, msg); - } - else { - Msg.info(this, msg); - throw new AssertionError("Command completion left unclaimed!"); - } - } - } - } - } - - private void emitNewThreadFrameIfSpecified(GdbCommandDoneEvent evt) { - Integer newTid = evt.checkNewThreadId(); - if (newTid == null) { - return; - } - GdbThreadImpl thread = threads.get(newTid); - if (thread == null) { - return; - } - GdbMiFieldList newFrame = evt.checkFrame(); - GdbStackFrameImpl frame = - newFrame == null ? null : GdbStackFrameImpl.fromFieldList(thread, newFrame); - event(() -> listenersEvent.invoke().threadSelected(thread, frame, evt), "command-done"); - } - - /** - * Handler for "^done" - * - * @param evt the event - * @param v nothing - */ - protected void processCommandDone(GdbCommandDoneEvent evt, Void v) { - emitNewThreadFrameIfSpecified(evt); - checkClaimed(evt); - } - - /** - * Handler for "^running" - * - * @param evt the event - * @param v nothing - */ - protected void processCommandRunning(GdbCommandRunningEvent evt, Void v) { - checkClaimed(evt); - Msg.debug(this, "Target is running"); - } - - /** - * Handler for "^connected" - * - * @param evt the event - * @param v nothing - */ - protected void processCommandConnected(GdbCommandConnectedEvent evt, Void v) { - checkClaimed(evt); - Msg.debug(this, "Connected to target"); - } - - /** - * Handler for "^exit" - * - * @param evt the event - * @param v nothing - */ - protected void processCommandExit(GdbCommandExitEvent evt, Void v) { - checkClaimed(evt); - Msg.debug(this, "GDB is exiting...."); - } - - /** - * Handler for "^error" - * - * @param evt the event - * @param v nothing - */ - protected void processCommandError(GdbCommandErrorEvent evt, Void v) { - checkClaimed(evt); - } - - /** - * Handler for "*running" - * - * @param evt the event - * @param v nothing - */ - protected void processRunning(GdbRunningEvent evt, Void v) { - String threadId = evt.assumeThreadId(); - if (threadId == null) { - threadId = "all"; - } - if ("all".equals(threadId)) { - GdbInferiorImpl cur = curInferior; - event(() -> { - listenersEvent.invoke().inferiorStateChanged(cur, cur.getKnownThreads().values(), - evt.newState(), null, evt.getCause(), evt.getReason()); - }, "inferiorState-running"); - for (GdbThreadImpl thread : curInferior.getKnownThreadsImpl().values()) { - thread.setState(evt.newState(), evt.getCause(), evt.getReason()); - } - } - else { - int id = Integer.parseUnsignedInt(threadId); - GdbThreadImpl thread = threads.get(id); - event(() -> { - listenersEvent.invoke().inferiorStateChanged(thread.getInferior(), - List.of(thread), evt.newState(), null, evt.getCause(), evt.getReason()); - }, "inferiorState-running"); - thread.setState(evt.newState(), evt.getCause(), evt.getReason()); - } - } - - /** - * Handler for "*stopped" - * - * @param evt the event - * @param v nothing - */ - protected void processStopped(GdbStoppedEvent evt, Void v) { - String stoppedThreadsStr = evt.assumeStoppedThreads(); - Collection stoppedThreads; - if (null == stoppedThreadsStr || "all".equals(stoppedThreadsStr)) { - stoppedThreads = threads.values(); - } - else { - stoppedThreads = new LinkedHashSet<>(); - for (String stopped : stoppedThreadsStr.split(",")) { - stoppedThreads.add(threads.get(Integer.parseInt(stopped))); - } - } - - Integer tid = evt.getThreadId(); - GdbThreadImpl evtThread = tid == null ? null : threads.get(tid); - Map> byInf = new LinkedHashMap<>(); - for (GdbThreadImpl thread : stoppedThreads) { - thread.setState(evt.newState(), evt.getCause(), evt.getReason()); - byInf.computeIfAbsent(thread.getInferior(), i -> new LinkedHashSet<>()).add(thread); - } - for (Map.Entry> ent : byInf.entrySet()) { - event(() -> { - listenersEvent.invoke().inferiorStateChanged(ent.getKey(), ent.getValue(), - evt.newState(), evtThread, evt.getCause(), evt.getReason()); - }, "inferiorState-stopped"); - } - if (evtThread != null) { - GdbStackFrameImpl frame = evt.getFrame(evtThread); - event(() -> listenersEvent.invoke().threadSelected(evtThread, frame, evt), - "inferiorState-stopped"); - } - } - - /** - * An interface for taking lines of input - */ - public interface LineReader { - String readLine(String prompt) throws IOException; - } - - /** - * An implementation of {@link LineReader} that does not use GPL code - */ - public static class BufferedReaderLineReader implements LineReader { - private BufferedReader reader; - - BufferedReaderLineReader() { - this.reader = new BufferedReader(new InputStreamReader(System.in)); - } - - @Override - public String readLine(String prompt) throws IOException { - System.out.print(prompt); - return reader.readLine(); - } - } - - @Override - public void consoleLoop() throws IOException { - checkStarted(); - Signal sigInterrupt = new Signal("INT"); - SignalHandler oldHandler = Signal.handle(sigInterrupt, (sig) -> { - try { - sendInterruptNow(); - } - catch (IOException e) { - e.printStackTrace(); - } - }); - try { - /* - * prompt.addChangeListener((p, v) -> { if (p) { System.out.print(PROMPT_GDB + " "); } - * }); - */ - LineReader reader = new BufferedReaderLineReader(); - //LineReader reader = new GnuReadlineLineReader(); - // System.out.print(PROMPT_GDB + " "); - while (isAlive()) { - String cmd = reader.readLine(PROMPT_GDB + " "); - if (cmd == null) { - System.out.println("quit"); - return; - } - console(cmd).exceptionally((e) -> { - Throwable realExc = AsyncUtils.unwrapThrowable(e); - if (realExc instanceof GdbCommandError) { - return null; // Gdb will have already printed it - } - e.printStackTrace(); - //System.out.print(PROMPT_GDB + " "); - return null; - }); - } - } - finally { - Signal.handle(sigInterrupt, oldHandler); - } - } - - public void sendInterruptNow(PtyThread thread, byte[] bytes) throws IOException { - Msg.info(this, "Interrupting by Ctrl-C on " + thread + "'s pty"); - OutputStream os = thread.pty.getParent().getOutputStream(); - os.write(bytes); - os.flush(); - } - - @Override - public void sendInterruptNow() throws IOException { - checkStarted(); - /*Msg.info(this, "Interrupting while runningInterpreter = " + runningInterpreter); - if (runningInterpreter == Interpreter.MI2) { - if (cliThread != null) { - Msg.info(this, "Interrupting by 'interrupt' on CLI"); - OutputStream os = cliThread.pty.getParent().getOutputStream(); - os.write(("interrupt" + newLine).getBytes()); - os.flush(); - } - else { - sendInterruptNow(mi2Thread); - } - } - else*/ - if (cliThread != null) { - sendInterruptNow(cliThread, (((char) 3) + "interrupt" + newLine).getBytes()); - } - else if (mi2Thread != null) { - sendInterruptNow(mi2Thread, (((char) 3) + "-exec-interrupt" + newLine).getBytes()); - } - } - - @Internal - public void injectInput(Interpreter interpreter, String input) { - PrintWriter writer = getWriter(interpreter); - writer.print(input); - writer.flush(); - } - - @Internal - public void synthesizeConsoleOut(Channel channel, String line) { - listenersConsoleOutput.invoke().output(channel, line); - } - - @Override - public synchronized GdbState getState() { - return state.get(); - } - - @Override - public synchronized CompletableFuture waitForState(GdbState forState) { - checkStarted(); - return state.waitValue(forState); - } - - @Override - public CompletableFuture waitForPrompt() { - return mi2Prompt.waitValue(true); - } - - @Override - @Deprecated - public CompletableFuture claimStopped() { - return execute(new GdbClaimStopped(this)); - } - - @Override - public CompletableFuture addInferior() { - return execute(new GdbAddInferiorCommand(this)); - } - - @Override - public CompletableFuture availableInferior() { - return listInferiors().thenCompose(map -> { - for (GdbInferior inf : map.values()) { - if (inf.getPid() == null) { - return CompletableFuture.completedFuture(inf); - } - } - return addInferior(); - }); - } - - @Override - public CompletableFuture removeInferior(GdbInferior inferior) { - return execute(new GdbRemoveInferiorCommand(this, inferior.getId())); - } - - /** - * Select the given inferior - * - *

- * This issues a command to GDB to change its focus. It is not just a manager concept. - * - * @param inferior the inferior to select - * @param internal true to prevent announcement of the change - * @return a future that completes when GDB has executed the command - */ - CompletableFuture setActiveInferior(GdbInferior inferior, boolean internal) { - return execute(new GdbInferiorSelectCommand(this, inferior.getId(), internal)); - } - - @Override - public CompletableFuture console(String command, CompletesWithRunning cwr) { - return execute(new GdbConsoleExecCommand(this, null, null, command, - GdbConsoleExecCommand.Output.CONSOLE, cwr)).thenApply(e -> null); - } - - @Override - public CompletableFuture consoleCapture(String command, CompletesWithRunning cwr) { - return execute(new GdbConsoleExecCommand(this, null, null, command, - GdbConsoleExecCommand.Output.CAPTURE, cwr)); - } - - @Override - public CompletableFuture> listInferiors() { - return execute(new GdbListInferiorsCommand(this)); - } - - @Override - public CompletableFuture> listAvailableProcesses() { - return execute(new GdbListAvailableProcessesCommand(this)); - } - - @Override - public CompletableFuture infoOs(String type) { - return execute(new GdbInfoOsCommand(this, type)); - } - - @Override - public String getMi2PtyName() throws IOException { - return mi2Thread.pty.getChild().nullSession(); - } - - @Override - public String getPtyDescription() { - return ptyFactory.getDescription(); - } - - public boolean hasCli() { - return cliThread != null && cliThread.pty != null; - } - - public Interpreter getRunningInterpreter() { - return runningInterpreter; - } - - private boolean isProbablyValid(String out) { - return out.contains("->0x"); - } - - private CompletableFuture> nextMaintInfoSections( - GdbInferiorImpl inferior, String cmds[], List results) { - if (results.size() == cmds.length) { - int best = 0; - for (int i = 0; i < cmds.length; i++) { - if (results.get(i).length > results.get(best).length) { - best = i; - } - } - return CompletableFuture.completedFuture(Map.entry(cmds[best], results.get(best))); - } - String cmd = cmds[results.size()]; - return inferior.consoleCapture(cmd, CompletesWithRunning.CANNOT).thenCompose(out -> { - String[] lines = out.split("\n"); - if (isProbablyValid(out)) { - return CompletableFuture.completedFuture(Map.entry(cmd, lines)); - } - results.add(lines); - return nextMaintInfoSections(inferior, cmds, results); - }); - } - - /** - * Execute "maintenance info sections" for all objects, starting with the syntax that last - * worked best - * - *

- * If any syntax yields at least 10 lines of output, then it is taken immediately, and the "last - * best" syntax is updated. In most cases, the first execution is the only time this will need - * to try more than once, since the underlying version should not change during the manager's - * lifetime. If none give more than 10, then the one which yielded the most lines is selected. - * This could happen in vacuous cases, e.g., if modules are requested without a target file. - * - * @param inferior the inferior for context when executing the command - * @return a future which completes with the list of lines - */ - protected CompletableFuture execMaintInfoSectionsAllObjects( - GdbInferiorImpl inferior) { - // TODO: Would be nice to choose based on version - CompletableFuture futureOut = - inferior.consoleCapture(maintInfoSectionsCmd, CompletesWithRunning.CANNOT); - return futureOut.thenCompose(out -> { - String[] lines = out.split("\n"); - if (isProbablyValid(out)) { - return CompletableFuture.completedFuture(lines); - } - CompletableFuture> futureBest = nextMaintInfoSections(inferior, - GdbModuleImpl.MAINT_INFO_SECTIONS_CMDS, new ArrayList<>()); - return futureBest.thenApply(best -> { - maintInfoSectionsCmd = best.getKey(); - return best.getValue(); - }); - }); - } - - /** - * Match a module file line, starting with the last working pattern - * - *

- * In most cases, only the first attempt to parse causes an update to the "last working" - * pattern, since the underlying GDB version should not change during the lifetime of the - * manager. - * - * @param line the line to parse - * @return the matcher or null - */ - protected Matcher matchFileLine(String line) { - Matcher matcher; - matcher = fileLinePattern.matcher(line); - if (matcher.matches()) { - return matcher; - } - for (Pattern pattern : GdbModuleImpl.OBJECT_FILE_LINE_PATTERNS) { - matcher = pattern.matcher(line); - if (matcher.matches()) { - fileLinePattern = pattern; - return matcher; - } - } - return null; - } - - /** - * Match a module section line, starting with the last working pattern - * - *

- * In most cases, only the first attempt to parse causes an update to the "last working" - * pattern, since the underlying GDB version should not change during the lifetime of the - * manager. - * - * @param line the line to parse - * @return the matcher or null - */ - protected Matcher matchSectionLine(String line) { - Matcher matcher; - matcher = sectionLinePattern.matcher(line); - if (matcher.matches()) { - return matcher; - } - for (Pattern pattern : GdbModuleImpl.OBJECT_SECTION_LINE_PATTERNS) { - matcher = pattern.matcher(line); - if (matcher.matches()) { - sectionLinePattern = pattern; - return matcher; - } - } - return null; - } - - public void logInfo(String string) { - if (LOG_IO) { - DBG_LOG.println("INFO: " + string); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbMemoryMapping.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbMemoryMapping.java deleted file mode 100644 index 899e376950..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbMemoryMapping.java +++ /dev/null @@ -1,153 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl; - -import java.math.BigInteger; -import java.util.*; -import java.util.Map.Entry; - -/** - * The abstraction for a line of output from {@code info proc mappings} - */ -public class GdbMemoryMapping { - - static class Index { - final NavigableMap mappings; - final Map bases; - - public Index(NavigableMap mappings) { - this.mappings = mappings; - this.bases = new HashMap<>(); - for (GdbMemoryMapping mapping : mappings.values()) { - if (mapping.objfile == null || mapping.objfile.isBlank()) { - continue; - } - // Values should be ordered ascending by address - if (bases.containsKey(mapping.objfile)) { - continue; - } - bases.put(mapping.objfile, mapping.start); - } - } - - public BigInteger computeBase(BigInteger vma) { - Entry floor = mappings.floorEntry(vma); - if (floor == null) { - return vma; - } - GdbMemoryMapping mapping = floor.getValue(); - // NB. Ends given by GDB are exclusive - if (mapping.objfile.isBlank() || mapping.end.compareTo(vma) <= 0) { - return vma; - } - return Objects.requireNonNull(bases.get(mapping.objfile)); - } - - public long computeBase(long vma) { - return computeBase(BigInteger.valueOf(vma)).longValueExact(); - } - } - - private final BigInteger start; - private final BigInteger end; - private final BigInteger size; - private final BigInteger offset; - private final String flags; - private final String objfile; - - /** - * Construct a memory mapping - * - * @param start the start offset - * @param end the end offset - * @param size the size (must be end - start) - * @param offset if backed by a file, the offset into that file - * @param flags the flags: rwxsp for read, write, execute, shared, private. If not known, the - * default "rwx" should be used. - * @param objfile if backed by a file, the name of that file - */ - public GdbMemoryMapping(BigInteger start, BigInteger end, BigInteger size, BigInteger offset, - String flags, String objfile) { - this.start = start; - this.end = end; - this.size = size; - this.offset = offset; - this.flags = flags; - this.objfile = objfile; - - assert Objects.equals(start.add(size), end); - } - - /** - * The start offset - * - * @return the offset - */ - public BigInteger getStart() { - return start; - } - - /** - * The end offset - * - * @return the end - */ - public BigInteger getEnd() { - return end; - } - - /** - * The size - * - * @return the size - */ - public BigInteger getSize() { - return size; - } - - /** - * If backed by a file, the offset into that file - * - * @return the offset - */ - public BigInteger getOffset() { - return offset; - } - - /** - * The flags - * - *

- * As of gdb-12.1, this is a four-character string, e.g., r--p, where the first three indicate - * read, write, and execute. Each position is either the character - * indicating the flag is present, or a dash indicating the flag is absent. The final position - * is either {@code s} or {@code p} to indicate shared or private. - * - * @return the flags - */ - public String getFlags() { - return flags; - } - - /** - * If backed by a file, the name of that file - * - * @return the file - */ - public String getObjfile() { - return objfile; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbMinimalSymbol.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbMinimalSymbol.java deleted file mode 100644 index b95a2a8846..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbMinimalSymbol.java +++ /dev/null @@ -1,48 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl; - -public class GdbMinimalSymbol { - protected final long index; - protected final String type; - protected final String name; - protected final long address; - - public GdbMinimalSymbol(long index, String type, String name, long address) { - this.index = index; - this.type = type; - this.name = name; - this.address = address; - } - - public long getIndex() { - return index; - } - - public String getType() { - // TODO: Interpret these types - // Observed: t, T, D, S - return type; - } - - public String getName() { - return name; - } - - public long getAddress() { - return address; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbModuleImpl.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbModuleImpl.java deleted file mode 100644 index a88140e4cd..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbModuleImpl.java +++ /dev/null @@ -1,197 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl; - -import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import agent.gdb.manager.GdbModule; -import agent.gdb.manager.GdbModuleSection; -import agent.gdb.manager.impl.cmd.GdbConsoleExecCommand.CompletesWithRunning; -import ghidra.async.AsyncLazyValue; -import ghidra.util.MathUtilities; -import ghidra.util.Msg; - -public class GdbModuleImpl implements GdbModule { - protected static final String MAINT_INFO_SECTIONS_CMD_V8 = - "maintenance info sections ALLOBJ"; - protected static final String MAINT_INFO_SECTIONS_CMD_V11 = - "maintenance info sections -all-objects"; - protected static final String[] MAINT_INFO_SECTIONS_CMDS = new String[] { - MAINT_INFO_SECTIONS_CMD_V11, - MAINT_INFO_SECTIONS_CMD_V8, - }; - - protected static final Pattern OBJECT_FILE_LINE_PATTERN_V8 = - Pattern.compile("\\s*Object file: (?.*)"); - protected static final Pattern OBJECT_FILE_LINE_PATTERN_V11 = - Pattern.compile("\\s*((Object)|(Exec)) file: `(?.*)', file type (?.*)"); - - protected static final Pattern[] OBJECT_FILE_LINE_PATTERNS = new Pattern[] { - OBJECT_FILE_LINE_PATTERN_V11, - OBJECT_FILE_LINE_PATTERN_V8, - }; - - protected static final String GNU_DEBUGDATA_PREFIX = ".gnu_debugdata for "; - - // Pattern observed in GDB 8 (probably applies to previous, too) - protected static final Pattern OBJECT_SECTION_LINE_PATTERN_V8 = Pattern.compile( - "\\s*" + // - "0x(?[0-9A-Fa-f]+)\\s*->\\s*" + // - "0x(?[0-9A-Fa-f]+)\\s+at\\s+" + // - "0x(?[0-9A-Fa-f]+)\\s*:\\s*" + // - "(?\\S+)\\s+" + // - "(?.*)"); - - // Pattern observed in GDB 10 (may apply in 9, too) - protected static final Pattern OBJECT_SECTION_LINE_PATTERN_V10 = Pattern.compile( - "\\s*" + // - "\\[\\s*(?\\d+)\\]\\s+" + // - "0x(?[0-9A-Fa-f]+)\\s*->\\s*" + // - "0x(?[0-9A-Fa-f]+)\\s+at\\s+" + // - "0x(?[0-9A-Fa-f]+)\\s*:\\s*" + // - "(?\\S+)\\s+" + // - "(?.*)"); - - protected static final Pattern[] OBJECT_SECTION_LINE_PATTERNS = new Pattern[] { - OBJECT_SECTION_LINE_PATTERN_V10, - OBJECT_SECTION_LINE_PATTERN_V8, - }; - - protected static final Pattern MSYMBOL_LINE_PATTERN = Pattern.compile( - "\\s*" + // - "\\[\\s*(?\\d+)\\]\\s+" + // - "(?\\S+)\\s+" + // - "0x(?[0-9A-Fa-f]+)\\s+" + // - "(?\\S+)\\s+" + // - ".*"); - - protected final GdbInferiorImpl inferior; - protected final String name; - protected Long base = null; - protected Long max = null; - - protected final Map sections = new LinkedHashMap<>(); - protected final Map unmodifiableSections = - Collections.unmodifiableMap(sections); - - protected final AsyncLazyValue> minimalSymbols = - new AsyncLazyValue<>(this::doGetMinimalSymbols); - - public GdbModuleImpl(GdbInferiorImpl inferior, String name) { - this.inferior = inferior; - this.name = name; - } - - @Override - public String getName() { - return name; - } - - @Override - public Long getBase() { - return base; - } - - @Override - public Long getMax() { - return max; - } - - @Override - public CompletableFuture> listSections(boolean refresh) { - return inferior.listModules(refresh).thenApply(__ -> unmodifiableSections); - } - - @Override - public Map getKnownSections() { - return unmodifiableSections; - } - - protected CompletableFuture> doGetMinimalSymbols() { - // TODO: Apparently, this is using internal GDB-debugging commands.... - // TODO: Also make methods for "full" symbols (DWARF?) - String cmd = "maintenance print msymbols -objfile " + name; - return inferior.consoleCapture(cmd, CompletesWithRunning.CANNOT).thenApply(out -> { - Map result = new LinkedHashMap<>(); - for (String line : out.split("\n")) { - Matcher mat = MSYMBOL_LINE_PATTERN.matcher(line); - if (!mat.matches()) { - continue; - } - long index = Long.parseLong(mat.group("idx")); - String type = Objects.requireNonNull(mat.group("type")); - long address = Long.parseLong(mat.group("addr"), 16); - String symName = Objects.requireNonNull(mat.group("name")); - result.put(symName, new GdbMinimalSymbol(index, type, symName, address)); - } - return Collections.unmodifiableMap(result); - }); - } - - @Override - public CompletableFuture> listMinimalSymbols() { - // TODO: getKnownMinimalSymbols method, too? - return minimalSymbols.request(); - } - - protected void processSectionLine(String line, Set namesSeen, - GdbMemoryMapping.Index index) { - Matcher matcher = inferior.manager.matchSectionLine(line); - if (matcher != null) { - try { - long vmaStart = Long.parseLong(matcher.group("vmaS"), 16); - long vmaEnd = Long.parseLong(matcher.group("vmaE"), 16); - long offset = Long.parseLong(matcher.group("offset"), 16); - - String sectionName = matcher.group("name"); - namesSeen.add(sectionName); - List attrs = new ArrayList<>(); - for (String a : matcher.group("attrs").split("\\s+")) { - if (a.length() != 0) { - attrs.add(a); - } - } - if (attrs.contains("ALLOC")) { - long b = index.computeBase(vmaStart); - base = base == null ? b : MathUtilities.unsignedMin(base, b); - max = max == null ? b : MathUtilities.unsignedMax(max, vmaEnd); - } - if (sections.put(sectionName, - new GdbModuleSectionImpl(sectionName, vmaStart, vmaEnd, offset, - attrs)) != null) { - } - } - catch (NumberFormatException e) { - Msg.error(this, "Invalid number in section entry: " + line); - } - } - } - - protected void resyncRetainSections(Set names) { - /** - * The need for this seems dubious. If it's the same module, why would its sections ever - * change? However, in theory, a module could be unloaded, replaced on disk, and reloaded. - * If all those happen between two queries, then yes, it'll seem as though an existing - * module's sections changed. - * - * If we ever need a callback, we'll have to use an iterator-based implementation. - */ - sections.keySet().retainAll(names); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbModuleSectionImpl.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbModuleSectionImpl.java deleted file mode 100644 index 7b283369c1..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbModuleSectionImpl.java +++ /dev/null @@ -1,62 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl; - -import java.util.List; - -import agent.gdb.manager.GdbModuleSection; - -public class GdbModuleSectionImpl implements GdbModuleSection { - protected final String name; - protected final long vmaStart; - protected final long vmaEnd; - protected final long fileOffset; - protected final List attrs; - - public GdbModuleSectionImpl(String name, long vmaStart, long vmaEnd, long fileOffset, - List attrs) { - this.name = name; - this.vmaStart = vmaStart; - this.vmaEnd = vmaEnd; - this.fileOffset = fileOffset; - this.attrs = List.copyOf(attrs); - } - - @Override - public String getName() { - return name; - } - - @Override - public long getVmaStart() { - return vmaStart; - } - - @Override - public long getVmaEnd() { - return vmaEnd; - } - - @Override - public long getFileOffset() { - return fileOffset; - } - - @Override - public List getAttributes() { - return attrs; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbPendingCommand.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbPendingCommand.java deleted file mode 100644 index 27933b4bce..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbPendingCommand.java +++ /dev/null @@ -1,245 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import agent.gdb.manager.GdbCause; -import agent.gdb.manager.evt.AbstractGdbCompletedCommandEvent; -import agent.gdb.manager.evt.GdbCommandErrorEvent; -import agent.gdb.manager.impl.cmd.GdbCommandError; - -/** - * A command queued on the GDB manager - * - *

- * A {@link GdbCommand} is queued by wrapping it in a {@link GdbPendingCommand} and submitting it to - * the manager implementation's executor. This object also keep track of claimed/stolen events and - * provides convenience methods for sifting through them. - * - * @param the type "returned" by the command - */ -public class GdbPendingCommand extends CompletableFuture implements GdbCause { - private final GdbCommand cmd; - private final Set> evts = new LinkedHashSet<>(); - - /** - * Wrap a command for execution - * - * @param cmd the command - */ - public GdbPendingCommand(GdbCommand cmd) { - this.cmd = cmd; - } - - /** - * Get the command being executed - * - * @return - */ - public GdbCommand getCommand() { - return cmd; - } - - public Integer impliesCurrentThreadId() { - return cmd.impliesCurrentThreadId(); - } - - public Integer impliesCurrentFrameId() { - return cmd.impliesCurrentFrameId(); - } - - /** - * Finish the execution of this command - */ - public void finish() { - //Msg.trace(this, "Finishing " + cmd); - try { - T result = cmd.complete(this); - complete(result); - } - catch (Throwable e) { - completeExceptionally(e); - } - } - - /** - * Handle an event - * - *

- * This gives the command implementation the first chance to claim or steal an event - * - * @param evt the event - * @return true if the command is ready to be completed - */ - public boolean handle(GdbEvent evt) { - return cmd.handle(evt, this); - } - - /** - * Claim an event - * - *

- * This stores the event for later retrieval and processing. - * - * @param evt the event - */ - public void claim(GdbEvent evt) { - evt.claim(this); - evts.add(evt); - } - - /** - * Steal an event - * - *

- * This stores the event for later retrieval and processing. - * - * @param evt the event - */ - public void steal(GdbEvent evt) { - claim(evt); - evt.steal(); - } - - /** - * Assume a single event was claimed/stolen, and get that event as the given type - * - * @param cls the type of the event - * @return the event cast to the type - * @throws IllegalStateException if more than one event was claimed/stolen - * @throws ClassCastException if the event cannot be cast to the given type - */ - public > E castSingleEvent(Class cls) { - if (evts.size() != 1) { - throw new IllegalStateException("Command did not claim exactly one event"); - } - return cls.cast(evts.iterator().next()); - } - - /** - * Get the first claimed/stolen event of a given type - * - * @param the type of the event - * @param cls the class of the event - * @return the event cast to the type, or null - */ - public > E getFirstOf(Class cls) { - for (GdbEvent evt : evts) { - if (cls.isAssignableFrom(evt.getClass())) { - return cls.cast(evt); - } - } - return null; - } - - /** - * Find the first claimed/stolen event of a given type - * - * @param the type of the event - * @param cls the class of the event - * @return the event cast to the type - * @throws IllegalStateException if no event of the given type was claimed/stolen - */ - public > E findFirstOf(Class cls) { - E first = getFirstOf(cls); - if (first != null) { - return first; - } - throw new IllegalStateException("Command did not claim any " + cls); - } - - /** - * Check if any event of a given type has been claimed - * - * @param cls the class of the event - * @return true if at least one is claimed, false otherwise - */ - public boolean hasAny(Class> cls) { - return getFirstOf(cls) != null; - } - - /** - * Find all events claimed/stolen of a given type - * - * @param cls the type of the events - * @return the list of events cast to the type - */ - public > List findAllOf(Class cls) { - List found = new ArrayList<>(); - for (GdbEvent evt : evts) { - if (cls.isAssignableFrom(evt.getClass())) { - found.add(cls.cast(evt)); - } - } - return found; - } - - /** - * Assume exactly one event of the given type was claimed/stolen, and get that event - * - * @param cls the type of the event - * @return the event cast to the type - * @throws IllegalStateException if more than one event matches - */ - public > E findSingleOf(Class cls) { - List found = findAllOf(cls); - if (found.size() != 1) { - throw new IllegalStateException( - "Command did not claim exactly one " + cls + ". Have " + evts); - } - return found.get(0); - } - - /** - * Check that the command completed with one of the given results - * - *

- * {@link GdbCommandErrorEvent} need not be listed. This method will handle it as a special case - * already. To avoid the special treatment, list it explicitly. - * - * @param classes the completion type to accept - * @return the completion event, cast to the greatest common subclass - */ - @SafeVarargs - public final E checkCompletion( - Class... classes) { - AbstractGdbCompletedCommandEvent completion = - findSingleOf(AbstractGdbCompletedCommandEvent.class); - // Allow query for exact class to override error interpretation - for (Class cls : classes) { - if (cls == completion.getClass()) { - return cls.cast(completion); - } - } - if (completion instanceof GdbCommandErrorEvent) { - throw new GdbCommandError(completion.getInfo(), cmd); - } - for (Class cls : classes) { - if (cls.isAssignableFrom(completion.getClass())) { - return cls.cast(completion); - } - } - throw new IllegalStateException( - "Command completed with " + completion + ", not any of " + Arrays.asList(classes)); - } - - @Override - public String toString() { - return super.toString() + "(" + cmd + ")"; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbStackFrameImpl.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbStackFrameImpl.java deleted file mode 100644 index 1fae594f0f..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbStackFrameImpl.java +++ /dev/null @@ -1,176 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl; - -import java.math.BigInteger; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.CompletableFuture; - -import agent.gdb.manager.GdbRegister; -import agent.gdb.manager.GdbStackFrame; -import agent.gdb.manager.impl.cmd.*; -import agent.gdb.manager.impl.cmd.GdbConsoleExecCommand.CompletesWithRunning; -import agent.gdb.manager.parsing.GdbMiParser.GdbMiFieldList; -import agent.gdb.manager.parsing.GdbParsingUtils; - -public class GdbStackFrameImpl implements GdbStackFrame { - protected final GdbManagerImpl manager; - protected final GdbThreadImpl thread; - protected final int level; - protected final BigInteger addr; - protected final String func; - - public static GdbStackFrameImpl fromFieldList(GdbThreadImpl thread, GdbMiFieldList fields) { - String lvlString = fields.getString("level"); - // NOTE: When given with breakpoint-hit, level is absent. Safe to assume innermost. - int level = lvlString == null ? 0 : Integer.parseInt(lvlString); - BigInteger addr = GdbParsingUtils.parsePrefixedHexBig(fields.getString("addr")); - String func = fields.getString("func"); - return new GdbStackFrameImpl(thread, level, addr, func); - } - - public GdbStackFrameImpl(GdbThreadImpl thread, int level, BigInteger addr, String func) { - this.manager = thread.manager; - this.thread = thread; - this.level = level; - this.addr = addr; - this.func = func; - } - - @Override - public String toString() { - String strAddr = addr == null ? "" : addr.toString(16); - String strFunc = func == null ? "" : func.toString(); - return ""; - } - - @Override - public int getLevel() { - return level; - } - - @Override - public BigInteger getAddress() { - return addr; - } - - @Override - public String getFunction() { - return func; - } - - @Override - public GdbThreadImpl getThread() { - return thread; - } - - @Override - public GdbStackFrame fillWith(GdbStackFrame frame) { - if (addr != null && func != null) { - return this; - } - BigInteger fAddr = addr; - if (fAddr == null) { - if (frame != null && frame.getAddress() != null) { - fAddr = frame.getAddress(); - } - else { - fAddr = BigInteger.ZERO; - } - } - String fFunc = func; - if (fFunc == null) { - if (frame != null && frame.getFunction() != null) { - fFunc = frame.getFunction(); - } - else { - fFunc = ""; - } - } - return new GdbStackFrameImpl(thread, level, fAddr, fFunc); - } - - @Override - public CompletableFuture setActive(boolean internal) { - /** - * Since gdb-13.1, it seems there is no longer a way to select the thread and frame in a - * single command. I think it's a bug, but it's hard to tell what their intended behavior - * is. Take the following example MI command: - * - *

-		 * -interpreter-exec --thread 1 console "frame 2"
-		 * 
- * - * This will produce console output and an MI event indicating a frame context change: - * - *
-		 * ~"#2 0x... in ... ()\n"
-		 * =thread-selected,id="1",frame={level="2",...}
-		 * 
- * - * However, the console has not actually changed context. If we then issue the {@code frame} - * command, we get: - * - *
-		 * &"frame\n" ~"#0 0x... in read () from /.../libc.so.6\n"
-		 * ^done
-		 * (gdb)
-		 * 
- * - * I'd expect either the context change to persist, or there not to be an event reported. - * Until or unless this is fixed, we will have to select the thread using - * {@code -thread-select}, then the frame using {@code -interpreter exec console "frame"}. - * Even if it is fixed, because we code to the least common denominator, we'll probably - * leave the two-command approach in place. - */ - return thread.setActive(true).thenCompose(__ -> { - return manager.execute( - new GdbSetActiveFrameCommand(manager, null, level, internal)); - }); - } - - @Override - public CompletableFuture evaluate(String expression) { - return manager.execute(new GdbEvaluateCommand(manager, thread.getId(), level, expression)); - } - - @Override - public CompletableFuture> readRegisters(Set regs) { - return thread.getInferior().syncEndianness().thenCompose(__ -> { - return manager.execute(new GdbReadRegistersCommand(manager, thread, level, regs)); - }); - } - - @Override - public CompletableFuture writeRegisters(Map regVals) { - return thread.getInferior().syncEndianness().thenCompose(__ -> { - return manager.execute(new GdbWriteRegistersCommand(manager, thread, level, regVals)); - }); - } - - @Override - public CompletableFuture console(String command, CompletesWithRunning cwr) { - return manager.execute(new GdbConsoleExecCommand(manager, thread.getId(), level, command, - GdbConsoleExecCommand.Output.CONSOLE, cwr)).thenApply(e -> null); - } - - @Override - public CompletableFuture consoleCapture(String command, CompletesWithRunning cwr) { - return manager.execute(new GdbConsoleExecCommand(manager, thread.getId(), level, command, - GdbConsoleExecCommand.Output.CAPTURE, cwr)); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbThreadImpl.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbThreadImpl.java deleted file mode 100644 index ed7d35d50d..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbThreadImpl.java +++ /dev/null @@ -1,319 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl; - -import java.math.BigInteger; -import java.nio.ByteBuffer; -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import agent.gdb.manager.*; -import agent.gdb.manager.GdbManager.StepCmd; -import agent.gdb.manager.breakpoint.GdbBreakpointInfo; -import agent.gdb.manager.breakpoint.GdbBreakpointType; -import agent.gdb.manager.impl.cmd.*; -import agent.gdb.manager.impl.cmd.GdbConsoleExecCommand.CompletesWithRunning; -import agent.gdb.manager.parsing.GdbCValueParser; -import agent.gdb.manager.parsing.GdbParsingUtils.GdbParseError; -import agent.gdb.manager.reason.GdbReason; -import generic.ULongSpan.ULongSpanSet; -import ghidra.async.*; - -/** - * The implementation of {@link GdbThread} - */ -public class GdbThreadImpl implements GdbThread { - private static class CauseReasonPair { - private final GdbCause cause; - private final GdbReason reason; - - CauseReasonPair(GdbCause cause, GdbReason reason) { - this.cause = cause; - this.reason = reason; - } - } - - protected final GdbManagerImpl manager; - private final int id; - private final GdbInferiorImpl inferior; - - private final AsyncReference state = - new AsyncReference<>(GdbState.RUNNING); - - private final AsyncLazyValue registers = - new AsyncLazyValue<>(this::doListRegisters); - - /** - * Construct a new thread - * - * @param manager the manager creating the thread - * @param inferior the inferior to which the thread belongs - * @param id the GDB-assigned thread ID - */ - public GdbThreadImpl(GdbManagerImpl manager, GdbInferiorImpl inferior, int id) { - this.manager = manager; - this.id = id; - this.inferior = inferior; - } - - @Override - public GdbInferiorImpl getInferior() { - return inferior; - } - - /** - * Add this thread to the inferior and manager - */ - public void add() { - this.inferior.addThread(this); - this.manager.addThread(this); - state.addChangeListener((oldState, newState, pair) -> { - manager.event(() -> manager.listenersEvent.invoke().threadStateChanged(this, newState, - pair.cause, pair.reason), "threadState"); - }); - } - - /** - * Remove this thread from the inferior and manager - */ - public void remove() { - this.inferior.removeThread(id); - this.manager.removeThread(id); - } - - @Override - public int getId() { - return id; - } - - @Override - public String toString() { - return ""; - } - - @Override - public GdbState getState() { - return state.get(); - } - - /** - * Set the state of this thread - * - * @param state the new state - * @param cause the cause for the change - * @param reason the reason (usually a stop reason) for the change - * @return true if the state actually changed - */ - protected boolean setState(GdbState state, GdbCause cause, GdbReason reason) { - return this.state.set(state, new CauseReasonPair(cause, reason)); - } - - protected CompletableFuture execute(AbstractGdbCommand cmd) { - switch (cmd.getInterpreter()) { - case CLI: - return setActive(true).thenCombine(manager.execute(cmd), (__, v) -> v); - case MI2: - return manager.execute(cmd); - default: - throw new AssertionError(); - } - } - - @Override - public CompletableFuture setActive(boolean internal) { - // Bypass the select-me-first logic - return manager.execute(new GdbSetActiveThreadCommand(manager, id, internal)); - } - - @Override - public CompletableFuture evaluate(String expression) { - return execute(new GdbEvaluateCommand(manager, id, null, expression)); - } - - @Override - public CompletableFuture setVar(String varName, String val) { - return execute(new GdbSetVarCommand(manager, id, varName, val)); - } - - @Override - // TODO: Is this per thread or per inferior? - public CompletableFuture listRegisters() { - return registers.request(); - } - - private List generateEvaluateSizesParts(Collection names) { - List result = new ArrayList<>(); - StringBuffer buf = new StringBuffer("{"); - for (String n : names) { - String toAdd = "sizeof($" + n + "),"; - if (buf.length() + toAdd.length() > GdbEvaluateCommand.MAX_EXPR_LEN) { - assert buf.length() > 0; - // Remove trailing comma - result.add(buf.substring(0, buf.length() - 1) + "}"); - buf.delete(1, buf.length()); // Leave leading brace - } - buf.append(toAdd); - } - if (buf.length() > 0) { - result.add(buf.substring(0, buf.length() - 1) + "}"); - } - return result; - } - - private CompletableFuture> doEvaluateSizesInParts(Collection names) { - List parts = generateEvaluateSizesParts(names); - if (parts.isEmpty()) { - // I guess names was empty - return CompletableFuture.completedFuture(List.of()); - } - if (parts.size() == 1) { - return evaluate(parts.get(0)).thenApply(List::of); - } - AsyncFence fence = new AsyncFence(); - String[] result = new String[parts.size()]; - for (int i = 0; i < result.length; i++) { - String p = parts.get(i); - final int j = i; - fence.include(evaluate(p).thenAccept(r -> { - result[j] = r; - })); - } - return fence.ready().thenApply(__ -> Arrays.asList(result)); - } - - private CompletableFuture doListRegisters() { - Map namesByNumber = new TreeMap<>(); - return execute(new GdbListRegisterNamesCommand(manager, id)).thenCompose(names -> { - for (int i = 0; i < names.size(); i++) { - String n = names.get(i); - if ("".equals(n)) { - continue; - } - namesByNumber.put(i, n); - } - return doEvaluateSizesInParts(namesByNumber.values()); - }).thenApply(values -> { - List regs = new ArrayList<>(); - List sizes = new ArrayList<>(); - for (String v : values) { - try { - sizes.addAll(GdbCValueParser.parseArray(v).expectInts()); - } - catch (GdbParseError e) { - throw new AssertionError("GDB did not give an integer array!"); - } - } - if (sizes.size() != namesByNumber.size()) { - throw new AssertionError("GDB did not give all the sizes!"); - } - Iterator sit = sizes.iterator(); - Iterator> eit = namesByNumber.entrySet().iterator(); - while (sit.hasNext()) { - int size = sit.next(); - Map.Entry ent = eit.next(); - regs.add(new GdbRegister(ent.getValue(), ent.getKey(), size)); - } - return new GdbRegisterSet(regs); - }); - } - - @Override - public CompletableFuture> listStackFrames() { - return execute(new GdbStackListFramesCommand(manager, this)); - } - - @Override - public CompletableFuture> readRegisters(Set regs) { - // TODO: Re-sync not ideal, but it works - return inferior.syncEndianness().thenCompose(__ -> { - return execute(new GdbReadRegistersCommand(manager, this, null, regs)); - }); - } - - @Override - public CompletableFuture writeRegisters(Map regVals) { - return execute(new GdbWriteRegistersCommand(manager, this, null, regVals)); - } - - @Override - public CompletableFuture readMemory(long addr, ByteBuffer buf, int len) { - return execute(new GdbReadMemoryCommand(manager, id, addr, buf, len)); - } - - @Override - public CompletableFuture writeMemory(long addr, ByteBuffer buf, int len) { - return execute(new GdbWriteMemoryCommand(manager, id, addr, buf, len)); - } - - @Override - public CompletableFuture insertBreakpoint(String loc, - GdbBreakpointType type) { - return execute(new GdbInsertBreakpointCommand(manager, id, loc, type)); - } - - @Override - public CompletableFuture console(String command, CompletesWithRunning cwr) { - return execute(new GdbConsoleExecCommand(manager, id, null, command, - GdbConsoleExecCommand.Output.CONSOLE, cwr)).thenApply(e -> null); - } - - @Override - public CompletableFuture consoleCapture(String command, CompletesWithRunning cwr) { - return execute(new GdbConsoleExecCommand(manager, id, null, command, - GdbConsoleExecCommand.Output.CAPTURE, cwr)); - } - - @Override - public CompletableFuture cont() { - return execute(new GdbContinueCommand(manager, id)); - } - - @Override - public CompletableFuture step(StepCmd suffix) { - return execute(new GdbStepCommand(manager, id, suffix)); - } - - @Override - public CompletableFuture advance(String loc) { - // There's no exec-advance or similar in MI2.... - return console("advance " + loc, CompletesWithRunning.MUST); - } - - @Override - public CompletableFuture advance(long addr) { - return advance(String.format("*0x%x", addr)); - } - - @Override - public CompletableFuture kill() { - return execute(new GdbKillCommand(manager, id)); - } - - @Override - public CompletableFuture detach() { - return execute(new GdbDetachCommand(manager, inferior, id)); - } - - public void dispose(Throwable reason) { - state.dispose(reason); - } - - @Override - public CompletableFuture getInfo() { - return manager.getThreadInfo(id); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbThreadInfo.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbThreadInfo.java deleted file mode 100644 index f1096a8884..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/GdbThreadInfo.java +++ /dev/null @@ -1,165 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl; - -import java.math.BigInteger; -import java.util.*; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import agent.gdb.manager.parsing.GdbMiParser.GdbMiFieldList; -import ghidra.util.Msg; - -/** - * Information about a GDB thread - */ -public class GdbThreadInfo { - - protected static final Pattern TARGET_ID_LINE_PATTERN0 = Pattern.compile("\\s*" + // - "Thread 0x(?[0-9,A-F,a-f]+)\\s+" + // - "\\(LWP (?[0-9]+)\\)\\s*"); - protected static final Pattern TARGET_ID_LINE_PATTERN1 = Pattern.compile("\\s*" + // - "process (?[0-9]+)\\s*"); - - /** - * Process a parsed GDB thread information - * - * @param info the parsed information block - * @return the processed GDB thread information - */ - public static GdbThreadInfo parseInfo(GdbMiFieldList info) { - String id = info.getString("id"); - String targetId = info.getString("target-id"); - String name = info.getString("name"); - String state = info.getString("state"); - String core = info.getString("core"); - Collection finfo = info.get("frame"); - List frames = new ArrayList<>(); - for (Object object : finfo) { - if (object instanceof GdbMiFieldList) { - frames.add(GdbFrameInfo.parseInfo((GdbMiFieldList) object)); - } - } - return new GdbThreadInfo(id, targetId, name, state, core, frames); - } - - private final String id; - private final String targetId; - private final String name; - private final String state; - private final String core; - private final List frames; - private BigInteger addr; - private Integer tid; - - /** - * Construct GDB thread information - * - * @param id the GDB-assigned id - * @param targetId the system id - * @param name the inferior name - * @param state current thread state - * @param core the active core - * @param frames thread stack - */ - GdbThreadInfo(String id, String targetId, String name, String state, String core, - List frames) { - this.id = id; - this.targetId = targetId; - this.name = name; - this.frames = frames; - this.state = state; - this.core = core; - Matcher mappingMatcher = TARGET_ID_LINE_PATTERN0.matcher(targetId); - if (mappingMatcher.matches()) { - try { - this.addr = new BigInteger(mappingMatcher.group("addr"), 16); - this.tid = Integer.parseInt(mappingMatcher.group("tid")); - return; - } - catch (NumberFormatException e) { - Msg.error(this, "Could not parse target id: " + targetId, e); - } - } - mappingMatcher = TARGET_ID_LINE_PATTERN1.matcher(targetId); - if (mappingMatcher.matches()) { - try { - this.tid = Integer.parseInt(mappingMatcher.group("tid")); - } - catch (NumberFormatException e) { - Msg.error(this, "Could not parse target id: " + targetId, e); - } - } - } - - @Override - public int hashCode() { - return Objects.hash(getId(), getTargetId()); - } - - @Override - public String toString() { - return ""; - } - - @Override - public boolean equals(Object obj) { - if (!((obj instanceof GdbThreadInfo))) { - return false; - } - GdbThreadInfo that = (GdbThreadInfo) obj; - if (this.getId() != that.getId()) { - return false; - } - if (this.getTargetId() != that.getTargetId()) { - return false; - } - return true; - } - - public String getId() { - return id; - } - - public String getTargetId() { - return targetId; - } - - public String getInferiorName() { - return name; - } - - public String getState() { - return state; - } - - public String getCore() { - return core; - } - - public List getFrames() { - return frames; - } - - public BigInteger getAddr() { - return addr; - } - - public Integer getTid() { - return tid; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/AbstractGdbCommand.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/AbstractGdbCommand.java deleted file mode 100644 index e0bc6378c5..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/AbstractGdbCommand.java +++ /dev/null @@ -1,105 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl.cmd; - -import agent.gdb.manager.GdbState; -import agent.gdb.manager.evt.*; -import agent.gdb.manager.impl.*; -import agent.gdb.manager.impl.GdbManagerImpl.Interpreter; -import agent.gdb.manager.parsing.GdbParsingUtils.GdbParseError; -import ghidra.util.Msg; - -/** - * A base class for interacting with specific GDB commands - * - * @param the type of object "returned" by the command - */ -public abstract class AbstractGdbCommand implements GdbCommand { - protected final GdbManagerImpl manager; - - /** - * Construct a new command to be executed by the given manager - * - * @param manager the manager to execute the command - */ - protected AbstractGdbCommand(GdbManagerImpl manager) { - this.manager = manager; - } - - @Override - public boolean validInState(GdbState state) { - //return state == GdbState.STOPPED; - return true; // With dual interpreters, shouldn't have to worry. - } - - @Override - public void preCheck(GdbPendingCommand pending) { - } - - @Override - public String toString() { - return ""; - } - - /** - * {@inheritDoc} - * - *

- * Selects mi2 by default. Check {@link GdbManagerImpl#hasCli()} before selecting the - * command-line (console) interface. - */ - @Override - public Interpreter getInterpreter() { - return Interpreter.MI2; - } - - @Override - public boolean handle(GdbEvent evt, GdbPendingCommand pending) { - /** - * Unfortunately, GDB prints {@code ^running} even if the command causing that result is - * issued from the CLI. This is a problem when "using an existing session," because the user - * will likely type "start" into the existing CLI. Thus, we have to be careful not to let - * spurious {@code ^running} command-completion events actually complete any command, except - * ones where we expect that result. This seems a bug in GDB to me. - * - * UPDATE: It looks like this will be fixed in gdb-14. Despite the fix we leave this - * workaround in place while we still support older gdb versions. - */ - if (evt instanceof GdbCommandRunningEvent) { - return false; - } - if (evt instanceof AbstractGdbCompletedCommandEvent) { - pending.claim(evt); - return true; - } - return false; - } - - @Override - public Integer impliesCurrentThreadId() { - return null; - } - - @Override - public Integer impliesCurrentFrameId() { - return null; - } - - @Override - public boolean isFocusInternallyDriven() { - return true; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/AbstractGdbCommandWithThreadAndFrameId.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/AbstractGdbCommandWithThreadAndFrameId.java deleted file mode 100644 index 6124c9f39b..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/AbstractGdbCommandWithThreadAndFrameId.java +++ /dev/null @@ -1,82 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl.cmd; - -import agent.gdb.manager.impl.GdbManagerImpl; - -/** - * An extension to {@link AbstractGdbCommandWithThreadId} that also passes the "{@code --frame}" - * argument - * - * @param the type of object "returned" by the command - */ -public abstract class AbstractGdbCommandWithThreadAndFrameId - extends AbstractGdbCommandWithThreadId { - protected static final String MI2_FRAME_PREFIX = " --frame "; - protected final Integer frameId; - - /** - * Construct a frame-specific command to be executed by the given manager - * - * @param manager the manager to execute the command - * @param threadId the ID of the thread to pass to "{@code --thread}" - * @param frameId the ID "level" of the frame to pass to "{@code --frame}" - */ - protected AbstractGdbCommandWithThreadAndFrameId(GdbManagerImpl manager, Integer threadId, - Integer frameId) { - super(manager, threadId); - this.frameId = frameId; - } - - protected String makeFramePart() { - return frameId == null ? "" : MI2_FRAME_PREFIX + frameId; - } - - /** - * Get the level of the frame to pass to "{@code --frame}" - * - * @return the frame level - */ - public Integer getFrameId() { - return frameId; - } - - @Override - public Integer impliesCurrentFrameId() { - return frameId; - } - - @Override - protected String encode(String threadPart) { - return encode(threadPart, makeFramePart()); - } - - /** - * Encode the command in GDB/MI, given the pre-constructed thread and frame parts - * - * The given parts are preceded by spaces, but not followed by spaces. For example, a command - * can be properly constructed as: - * - *

-	 * return "-some-command" + threadPart + threadPart + " some-argument";
-	 * 
- * - * @param threadPart the "{@code --thread [ID]}" part - * @param framePart the "{@code --frame [level]}" part - * @return the encoded command - */ - protected abstract String encode(String threadPart, String framePart); -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/AbstractGdbCommandWithThreadId.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/AbstractGdbCommandWithThreadId.java deleted file mode 100644 index 6efdf3529b..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/AbstractGdbCommandWithThreadId.java +++ /dev/null @@ -1,78 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl.cmd; - -import agent.gdb.manager.impl.GdbManagerImpl; - -/** - * An extension to {@link AbstractGdbCommand} that passes the "{@code --thread}" argument - * - * @param the type of object "returned" by the command - */ -public abstract class AbstractGdbCommandWithThreadId extends AbstractGdbCommand { - protected static final String MI2_THREAD_PREFIX = " --thread "; - protected final Integer threadId; - - /** - * Construct a thread-specific command to be executed by the given manager - * - * @param manager the manager to execute the command - * @param threadId the ID of the thread to pass to "{@code --thread}" - */ - protected AbstractGdbCommandWithThreadId(GdbManagerImpl manager, Integer threadId) { - super(manager); - this.threadId = threadId; - } - - protected String makeThreadPart() { - return threadId == null ? "" : MI2_THREAD_PREFIX + threadId; - } - - @Override - public String encode() { - return encode(makeThreadPart()); - } - - /** - * Get the ID of the thread to pass to "{@code --thread}" - * - * @return the thread ID - */ - public Integer getThreadId() { - return threadId; - } - - @Override - public Integer impliesCurrentThreadId() { - return threadId; - } - - /** - * Encode the command in GDB/MI, given the pre-constructed thread argument part - * - *

- * The given thread argument is preceded by a space, but not followed by one. For example, a - * command can be properly constructed as: - * - *

-	 * return "-some-command" + threadPart + " some-argument";
-	 * 
- * - * @param threadPart the "{@code --thread [ID]}" part - * @return the encoded command - */ - protected abstract String encode(String threadPart); -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/AbstractLaunchGdbCommand.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/AbstractLaunchGdbCommand.java deleted file mode 100644 index 3cb9665397..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/AbstractLaunchGdbCommand.java +++ /dev/null @@ -1,59 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl.cmd; - -import agent.gdb.manager.GdbThread; -import agent.gdb.manager.evt.*; -import agent.gdb.manager.impl.*; -import agent.gdb.manager.impl.GdbManagerImpl.Interpreter; - -public abstract class AbstractLaunchGdbCommand extends AbstractGdbCommand - implements MixinResumeInCliGdbCommand { - - protected AbstractLaunchGdbCommand(GdbManagerImpl manager) { - super(manager); - } - - @Override - public Interpreter getInterpreter() { - //return getInterpreter(manager); - - /** - * A lot of good event-handling logic is factored in the Mixin interface. However, errors - * from CLI commands are catastrophically mishandled or just missed entirely, so we will - * still use MI2 for these. - */ - return Interpreter.MI2; - } - - @Override - public boolean handle(GdbEvent evt, GdbPendingCommand pending) { - if (evt instanceof GdbThreadCreatedEvent) { - pending.claim(evt); - } - return handleExpectingRunning(evt, pending); - } - - @Override - public GdbThread complete(GdbPendingCommand pending) { - completeOnRunning(pending); - - // Just take the first thread. Others are considered clones. - GdbThreadCreatedEvent created = pending.findFirstOf(GdbThreadCreatedEvent.class); - int tid = created.getThreadId(); - return manager.getThread(tid); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbAddInferiorCommand.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbAddInferiorCommand.java deleted file mode 100644 index 48321868b4..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbAddInferiorCommand.java +++ /dev/null @@ -1,43 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl.cmd; - -import agent.gdb.manager.GdbInferior; -import agent.gdb.manager.GdbManager; -import agent.gdb.manager.evt.GdbCommandDoneEvent; -import agent.gdb.manager.impl.GdbManagerImpl; -import agent.gdb.manager.impl.GdbPendingCommand; - -/** - * Implementation of {@link GdbManager#addInferior()} - */ -public class GdbAddInferiorCommand extends AbstractGdbCommand { - public GdbAddInferiorCommand(GdbManagerImpl manager) { - super(manager); - } - - @Override - public String encode() { - return "-add-inferior"; - } - - @Override - public GdbInferior complete(GdbPendingCommand pending) { - GdbCommandDoneEvent done = pending.checkCompletion(GdbCommandDoneEvent.class); - int iid = done.assumeInferior(); - return manager.getInferior(iid); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbAttachCommand.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbAttachCommand.java deleted file mode 100644 index 956f10e642..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbAttachCommand.java +++ /dev/null @@ -1,66 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl.cmd; - -import java.util.LinkedHashSet; -import java.util.Set; - -import agent.gdb.manager.GdbInferior; -import agent.gdb.manager.GdbThread; -import agent.gdb.manager.evt.GdbCommandDoneEvent; -import agent.gdb.manager.evt.GdbThreadCreatedEvent; -import agent.gdb.manager.impl.*; - -/** - * Implementation of {@link GdbInferior#attach(long)} - */ -public class GdbAttachCommand extends AbstractGdbCommand> { - - private final long pid; - - public GdbAttachCommand(GdbManagerImpl manager, long pid) { - super(manager); - this.pid = pid; - } - - @Override - public String encode() { - return "-target-attach " + pid; - } - - @Override - public boolean handle(GdbEvent evt, GdbPendingCommand pending) { - if (super.handle(evt, pending)) { - return true; - } - else if (evt instanceof GdbThreadCreatedEvent) { - pending.claim(evt); - } - return false; - } - - @Override - public Set complete(GdbPendingCommand pending) { - pending.checkCompletion(GdbCommandDoneEvent.class); - - Set threads = new LinkedHashSet<>(); - for (GdbThreadCreatedEvent created : pending.findAllOf(GdbThreadCreatedEvent.class)) { - int tid = created.getThreadId(); - threads.add(manager.getThread(tid)); - } - return threads; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbClaimStopped.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbClaimStopped.java deleted file mode 100644 index f8bd806981..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbClaimStopped.java +++ /dev/null @@ -1,60 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl.cmd; - -import agent.gdb.manager.GdbManager; -import agent.gdb.manager.GdbState; -import agent.gdb.manager.evt.GdbStoppedEvent; -import agent.gdb.manager.impl.*; - -/** - * Implementation of {@link GdbManager#claimStopped()} - * - * @deprecated I don't see this being used anywhere. Probably defunct. - */ -@Deprecated -public class GdbClaimStopped extends AbstractGdbCommand { - public GdbClaimStopped(GdbManagerImpl manager) { - super(manager); - } - - @Override - public boolean validInState(GdbState state) { - return state == GdbState.RUNNING; - } - - @Override - public String encode() { - // This is not really a command, it just claims *stopped - // The executor will also wait for (gdb). Good. - return null; - } - - @Override - public boolean handle(GdbEvent evt, GdbPendingCommand pending) { - if (evt instanceof GdbStoppedEvent) { - pending.claim(evt); - return true; - } - return false; - } - - @Override - public Void complete(GdbPendingCommand pending) { - pending.findSingleOf(GdbStoppedEvent.class); - return null; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbCommandError.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbCommandError.java deleted file mode 100644 index 155e6ba618..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbCommandError.java +++ /dev/null @@ -1,55 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl.cmd; - -import agent.gdb.manager.impl.GdbCommand; -import agent.gdb.manager.parsing.GdbMiParser.GdbMiFieldList; - -/** - * Exception generated by the default "^error" handler - */ -public class GdbCommandError extends RuntimeException { - private final GdbMiFieldList info; - - /** - * Construct an error with the given details - * - * @param info the detail information - */ - public GdbCommandError(GdbMiFieldList info, GdbCommand cmd) { - super(cmd + " caused '" + info + "'"); - this.info = info; - } - - /** - * Construct an error with the given message - * - * @param message the message - */ - public GdbCommandError(String message) { - super(message); - this.info = null; - } - - /** - * Get the details, if present - * - * @return the details, or null - */ - public GdbMiFieldList getInfo() { - return info; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbConsoleExecCommand.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbConsoleExecCommand.java deleted file mode 100644 index e411c2f4ba..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbConsoleExecCommand.java +++ /dev/null @@ -1,180 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl.cmd; - -import org.apache.commons.text.StringEscapeUtils; - -import agent.gdb.manager.GdbManager; -import agent.gdb.manager.GdbManager.Channel; -import agent.gdb.manager.evt.*; -import agent.gdb.manager.impl.*; -import agent.gdb.manager.impl.GdbManagerImpl.Interpreter; - -/** - * Implementation of {@link GdbManager#console(String)} and similar - */ -public class GdbConsoleExecCommand extends AbstractGdbCommandWithThreadAndFrameId { - public enum CompletesWithRunning { - /** - * Ignore {@code ^running} events, because they cannot complete this command - */ - CANNOT(AbstractGdbCompletedCommandEvent.class) { - @Override - boolean handleRunning(GdbCommandRunningEvent evt, GdbPendingCommand pending) { - return false; - } - }, - /** - * Allow any completion, including a {@code ^running} event, to complete this command - * - *

- * Use this when the nature of the command is unknown, e.g., when it was input by the user. - */ - CAN(AbstractGdbCompletedCommandEvent.class) { - @Override - boolean handleRunning(GdbCommandRunningEvent evt, GdbPendingCommand pending) { - pending.claim(evt); - return true; - } - }, - /** - * Require completion by a {@code ^running} event - */ - MUST(GdbCommandRunningEvent.class) { - @Override - boolean handleRunning(GdbCommandRunningEvent evt, GdbPendingCommand pending) { - pending.claim(evt); - return true; - } - }; - - private final Class completionClass; - - private CompletesWithRunning( - Class completionClass) { - this.completionClass = completionClass; - } - - abstract boolean handleRunning(GdbCommandRunningEvent evt, GdbPendingCommand pending); - } - - public enum Output { - CONSOLE, CAPTURE; - } - - private final String command; - private final Output to; - private final CompletesWithRunning cwr; - - public GdbConsoleExecCommand(GdbManagerImpl manager, Integer threadId, Integer frameId, - String command, Output to, CompletesWithRunning cwr) { - super(manager, threadId, frameId); - this.command = command; - this.to = to; - this.cwr = cwr; - } - - /** - * TODO: I think there should be a separate command for arbitrary CLI input. I'm not sure yet - * whether it should wait in the queue or just be sent immediately. - */ - @Override - public Interpreter getInterpreter() { - /*if (to == Output.CONSOLE && manager.hasCli() && threadId == null && frameId == null) { - return Interpreter.CLI; - }*/ - return Interpreter.MI2; - } - - @Override - public String encode(String threadPart, String framePart) { - switch (getInterpreter()) { - case CLI: - return command; - case MI2: - return "-interpreter-exec" + threadPart + framePart + " console \"" + - StringEscapeUtils.escapeJava(command) + "\""; - default: - throw new AssertionError(); - } - } - - @Override - public boolean handle(GdbEvent evt, GdbPendingCommand pending) { - if (getInterpreter() == Interpreter.CLI) { - // At the very least, I should expect to see the (gdb) prompt. - if (evt instanceof GdbConsoleOutputEvent) { - GdbConsoleOutputEvent out = (GdbConsoleOutputEvent) evt; - if (out.getInterpreter() == Interpreter.CLI) { - return true; - } - } - return false; - } - // MI2 - if (evt instanceof GdbCommandRunningEvent) { - return cwr.handleRunning((GdbCommandRunningEvent) evt, pending); - } - else if (evt instanceof AbstractGdbCompletedCommandEvent) { - pending.claim(evt); - return true; - } - else if (evt instanceof GdbConsoleOutputEvent) { - GdbConsoleOutputEvent out = (GdbConsoleOutputEvent) evt; - // This is not a great check... - if (out.getInterpreter() == Interpreter.MI2 && ">".equals(out.getOutput().trim()) && - !command.trim().startsWith("ec")) { - manager.injectInput(Interpreter.MI2, "end\n"); - manager.synthesizeConsoleOut(Channel.STDERR, - "Ghidra GDB Agent: Multi-line / follow-up input is not currently supported. " + - "I just typed 'end' for you.\n"); - } - if (to == Output.CAPTURE) { - if (out.getInterpreter() == getInterpreter()) { - pending.steal(evt); - } - } - } - return false; - } - - @Override - public String complete(GdbPendingCommand pending) { - if (getInterpreter() == Interpreter.CLI) { - return null; - } - // MI2 - pending.checkCompletion(cwr.completionClass); - - if (to == Output.CONSOLE) { - return null; - } - StringBuilder builder = new StringBuilder(); - for (GdbConsoleOutputEvent out : pending.findAllOf(GdbConsoleOutputEvent.class)) { - builder.append(out.getOutput()); - } - return builder.toString(); - } - - public Output getOutputTo() { - return to; - } - - @Override - public boolean isFocusInternallyDriven() { - return to == Output.CAPTURE; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbContinueCommand.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbContinueCommand.java deleted file mode 100644 index ed03a67f27..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbContinueCommand.java +++ /dev/null @@ -1,54 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl.cmd; - -import agent.gdb.manager.GdbInferior; -import agent.gdb.manager.impl.*; -import agent.gdb.manager.impl.GdbManagerImpl.Interpreter; - -/** - * Implementation of {@link GdbInferior#cont()} - */ -public class GdbContinueCommand extends AbstractGdbCommandWithThreadId - implements MixinResumeInCliGdbCommand { - public GdbContinueCommand(GdbManagerImpl manager, Integer threadId) { - super(manager, threadId); - } - - @Override - public Interpreter getInterpreter() { - return getInterpreter(manager); - } - - @Override - public String encode(String threadPart) { - if (getInterpreter() == Interpreter.CLI) { - return "continue"; - } - return "-exec-continue" + threadPart; - } - - @Override - public boolean handle(GdbEvent evt, GdbPendingCommand pending) { - return handleExpectingRunning(evt, pending); - } - - @Override - public Void complete(GdbPendingCommand pending) { - completeOnRunning(pending); - return null; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbDeleteBreakpointsCommand.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbDeleteBreakpointsCommand.java deleted file mode 100644 index 8841926515..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbDeleteBreakpointsCommand.java +++ /dev/null @@ -1,62 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl.cmd; - -import org.apache.commons.lang3.StringUtils; - -import agent.gdb.manager.GdbInferior; -import agent.gdb.manager.evt.GdbBreakpointDeletedEvent; -import agent.gdb.manager.evt.GdbCommandDoneEvent; -import agent.gdb.manager.impl.*; - -/** - * Implementation of {@link GdbInferior#deleteBreakpoint(long)} - */ -public class GdbDeleteBreakpointsCommand extends AbstractGdbCommand { - - private final long[] numbers; - - public GdbDeleteBreakpointsCommand(GdbManagerImpl manager, long... numbers) { - super(manager); - this.numbers = numbers; - } - - @Override - public String encode() { - return "-break-delete " + StringUtils.join(numbers, ' '); - } - - @Override - public boolean handle(GdbEvent evt, GdbPendingCommand pending) { - if (super.handle(evt, pending)) { - return true; - } - if (evt instanceof GdbBreakpointDeletedEvent) { - pending.claim(evt); - } - return false; - } - - @Override - public Void complete(GdbPendingCommand pending) { - pending.checkCompletion(GdbCommandDoneEvent.class); - // GDB does not give notification for breakpoints removed by GDB/MI commands - for (long number : numbers) { - manager.doBreakpointDeleted(number, pending); - } - return null; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbDetachCommand.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbDetachCommand.java deleted file mode 100644 index 9425d6de17..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbDetachCommand.java +++ /dev/null @@ -1,69 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl.cmd; - -import java.util.ArrayList; -import java.util.Collection; - -import agent.gdb.manager.GdbInferior; -import agent.gdb.manager.evt.*; -import agent.gdb.manager.impl.*; - -/** - * Implementation of {@link GdbInferior#detach()} - */ -public class GdbDetachCommand extends AbstractGdbCommandWithThreadId { - private final GdbInferiorImpl inferior; - - public GdbDetachCommand(GdbManagerImpl manager, GdbInferiorImpl inferior, Integer threadId) { - super(manager, threadId); - this.inferior = inferior; - } - - @Override - public String encode(String threadPart) { - return "-target-detach" + threadPart; - } - - @Override - public boolean handle(GdbEvent evt, GdbPendingCommand pending) { - if (super.handle(evt, pending)) { - return true; - } - else if (evt instanceof GdbThreadExitedEvent) { - pending.claim(evt); - } - else if (evt instanceof GdbThreadGroupExitedEvent) { - pending.claim(evt); - } - return false; - } - - @Override - public Void complete(GdbPendingCommand pending) { - pending.checkCompletion(GdbCommandDoneEvent.class); - - // GDB does not notify thread exit when detaching. At least not via GDB/MI - // TODO: Copy on write instead? - Collection threads = - new ArrayList<>(inferior.getKnownThreadsImpl().values()); - for (GdbThreadImpl t : threads) { - manager.fireThreadExited(t.getId(), inferior, pending); - t.remove(); - } - return null; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbDisableBreakpointsCommand.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbDisableBreakpointsCommand.java deleted file mode 100644 index 8b5b0df363..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbDisableBreakpointsCommand.java +++ /dev/null @@ -1,61 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl.cmd; - -import org.apache.commons.lang3.StringUtils; - -import agent.gdb.manager.GdbInferior; -import agent.gdb.manager.evt.*; -import agent.gdb.manager.impl.*; - -/** - * Implementation of {@link GdbInferior#deleteBreakpoint(long)} - */ -public class GdbDisableBreakpointsCommand extends AbstractGdbCommand { - - private final long[] numbers; - - public GdbDisableBreakpointsCommand(GdbManagerImpl manager, long... numbers) { - super(manager); - this.numbers = numbers; - } - - @Override - public String encode() { - return "-break-disable " + StringUtils.join(numbers, ' '); - } - - @Override - public boolean handle(GdbEvent evt, GdbPendingCommand pending) { - if (super.handle(evt, pending)) { - return true; - } - if (evt instanceof GdbBreakpointModifiedEvent) { - pending.claim(evt); - } - return false; - } - - @Override - public Void complete(GdbPendingCommand pending) { - pending.checkCompletion(GdbCommandDoneEvent.class); - // GDB does not give notification for breakpoints added by GDB/MI commands - for (long number : numbers) { - manager.doBreakpointDisabled(number, pending); - } - return null; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbEnableBreakpointsCommand.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbEnableBreakpointsCommand.java deleted file mode 100644 index fff2408803..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbEnableBreakpointsCommand.java +++ /dev/null @@ -1,61 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl.cmd; - -import org.apache.commons.lang3.StringUtils; - -import agent.gdb.manager.GdbInferior; -import agent.gdb.manager.evt.*; -import agent.gdb.manager.impl.*; - -/** - * Implementation of {@link GdbInferior#deleteBreakpoint(long)} - */ -public class GdbEnableBreakpointsCommand extends AbstractGdbCommand { - - private final long[] numbers; - - public GdbEnableBreakpointsCommand(GdbManagerImpl manager, long... numbers) { - super(manager); - this.numbers = numbers; - } - - @Override - public String encode() { - return "-break-enable " + StringUtils.join(numbers, ' '); - } - - @Override - public boolean handle(GdbEvent evt, GdbPendingCommand pending) { - if (super.handle(evt, pending)) { - return true; - } - if (evt instanceof GdbBreakpointModifiedEvent) { - pending.claim(evt); - } - return false; - } - - @Override - public Void complete(GdbPendingCommand pending) { - pending.checkCompletion(GdbCommandDoneEvent.class); - // GDB does not give notification for breakpoints added by GDB/MI commands - for (long number : numbers) { - manager.doBreakpointEnabled(number, pending); - } - return null; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbEvaluateCommand.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbEvaluateCommand.java deleted file mode 100644 index a2e4b0e8b8..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbEvaluateCommand.java +++ /dev/null @@ -1,52 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl.cmd; - -import org.apache.commons.text.StringEscapeUtils; - -import agent.gdb.manager.GdbInferior; -import agent.gdb.manager.evt.GdbCommandDoneEvent; -import agent.gdb.manager.impl.GdbManagerImpl; -import agent.gdb.manager.impl.GdbPendingCommand; - -/** - * Implementation of {@link GdbInferior#evaluate(String)} - */ -public class GdbEvaluateCommand extends AbstractGdbCommandWithThreadAndFrameId { - private static final String MI2_CMD = "-data-evaluate-expression"; - // 6 accounts for digits in threadId and frameId. 999 each should be plenty.... - public static final int MAX_EXPR_LEN = GdbManagerImpl.MAX_CMD_LEN - MI2_CMD.length() - - MI2_THREAD_PREFIX.length() - MI2_FRAME_PREFIX.length() - 6; - private final String expression; - - public GdbEvaluateCommand(GdbManagerImpl manager, Integer threadId, Integer frameId, - String expression) { - super(manager, threadId, frameId); - this.expression = expression; - } - - @Override - protected String encode(String threadPart, String framePart) { - return MI2_CMD + threadPart + framePart + " \"" + - StringEscapeUtils.escapeJava(expression) + '"'; - } - - @Override - public String complete(GdbPendingCommand pending) { - GdbCommandDoneEvent done = pending.checkCompletion(GdbCommandDoneEvent.class); - return done.assumeValue(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbFileExecAndSymbolsCommand.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbFileExecAndSymbolsCommand.java deleted file mode 100644 index 7b752329c3..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbFileExecAndSymbolsCommand.java +++ /dev/null @@ -1,47 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl.cmd; - -import org.apache.commons.text.StringEscapeUtils; - -import agent.gdb.manager.GdbInferior; -import agent.gdb.manager.evt.GdbCommandDoneEvent; -import agent.gdb.manager.impl.GdbManagerImpl; -import agent.gdb.manager.impl.GdbPendingCommand; - -/** - * Implementation of {@link GdbInferior#fileExecAndSymbols(String)} - */ -public class GdbFileExecAndSymbolsCommand extends AbstractGdbCommand { - - private final String file; - - public GdbFileExecAndSymbolsCommand(GdbManagerImpl manager, String file) { - super(manager); - this.file = file; - } - - @Override - public String encode() { - return "-file-exec-and-symbols \"" + StringEscapeUtils.escapeJava(file) + "\""; - } - - @Override - public Void complete(GdbPendingCommand pending) { - pending.checkCompletion(GdbCommandDoneEvent.class); - return null; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbGetThreadInfoCommand.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbGetThreadInfoCommand.java deleted file mode 100644 index c1f055d442..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbGetThreadInfoCommand.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl.cmd; - -import java.util.List; - -import agent.gdb.manager.evt.GdbCommandDoneEvent; -import agent.gdb.manager.impl.*; -import agent.gdb.manager.parsing.GdbMiParser.GdbMiFieldList; - -/** - * Implementation of {@link GdbManagerImpl#getThreadInfo()} - */ -public class GdbGetThreadInfoCommand extends AbstractGdbCommandWithThreadId { - - public GdbGetThreadInfoCommand(GdbManagerImpl manager, Integer threadId) { - super(manager, threadId); - } - - @Override - protected String encode(String threadPart) { - return "-thread-info " + threadId; // Note the trailing space - } - - @Override - public Integer impliesCurrentThreadId() { - return null; - } - - @Override - public GdbThreadInfo complete(GdbPendingCommand pending) { - GdbCommandDoneEvent done = pending.checkCompletion(GdbCommandDoneEvent.class); - List infoList = done.assumeThreadInfoList(); - return GdbThreadInfo.parseInfo(infoList.get(0)); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbGetVarCommand.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbGetVarCommand.java deleted file mode 100644 index 514dbee907..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbGetVarCommand.java +++ /dev/null @@ -1,44 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl.cmd; - -import agent.gdb.manager.GdbInferior; -import agent.gdb.manager.evt.GdbCommandDoneEvent; -import agent.gdb.manager.impl.GdbManagerImpl; -import agent.gdb.manager.impl.GdbPendingCommand; - -/** - * Implementation of {@link GdbInferior#getVar(String)} - */ -public class GdbGetVarCommand extends AbstractGdbCommand { - private final String varName; - - public GdbGetVarCommand(GdbManagerImpl manager, String varName) { - super(manager); - this.varName = varName; - } - - @Override - public String encode() { - return "-gdb-show " + varName; - } - - @Override - public String complete(GdbPendingCommand pending) { - GdbCommandDoneEvent done = pending.checkCompletion(GdbCommandDoneEvent.class); - return done.maybeValue(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbInferiorSelectCommand.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbInferiorSelectCommand.java deleted file mode 100644 index 27ffdb932a..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbInferiorSelectCommand.java +++ /dev/null @@ -1,68 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl.cmd; - -import agent.gdb.manager.evt.GdbCommandDoneEvent; -import agent.gdb.manager.evt.GdbThreadSelectedEvent; -import agent.gdb.manager.impl.*; - -public class GdbInferiorSelectCommand extends AbstractGdbCommand { - private final int id; - private final boolean internal; - - public GdbInferiorSelectCommand(GdbManagerImpl manager, int id, boolean internal) { - super(manager); - this.id = id; - this.internal = internal; - } - - @Override - public void preCheck(GdbPendingCommand pending) { - if (manager.currentInferior().getId() == id) { - pending.complete(null); - } - } - - @Override - public String encode() { - /** - * There does not appear to be a real -inferior-select command - */ - return "-interpreter-exec console \"inferior " + id + "\""; - } - - @Override - public boolean handle(GdbEvent evt, GdbPendingCommand pending) { - if (super.handle(evt, pending)) { - return true; - } - if (evt instanceof GdbThreadSelectedEvent) { - pending.claim(evt); - } - return false; - } - - @Override - public Void complete(GdbPendingCommand pending) { - pending.checkCompletion(GdbCommandDoneEvent.class); - return null; - } - - @Override - public boolean isFocusInternallyDriven() { - return internal; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbInfoOsCommand.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbInfoOsCommand.java deleted file mode 100644 index 482be4cf05..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbInfoOsCommand.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl.cmd; - -import agent.gdb.manager.GdbManager; -import agent.gdb.manager.GdbTable; -import agent.gdb.manager.evt.GdbCommandDoneEvent; -import agent.gdb.manager.impl.GdbManagerImpl; -import agent.gdb.manager.impl.GdbPendingCommand; - -/** - * Implementation of {@link GdbManager#infoOs(String)} - */ -public class GdbInfoOsCommand extends AbstractGdbCommand { - private final String type; - - public GdbInfoOsCommand(GdbManagerImpl manager, String type) { - super(manager); - this.type = type; - } - - @Override - public String encode() { - return "-info-os " + type; - } - - @Override - public GdbTable complete(GdbPendingCommand pending) { - GdbCommandDoneEvent done = pending.checkCompletion(GdbCommandDoneEvent.class); - return new GdbTable(done.assumeOSDataTable(), "item"); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbInsertBreakpointCommand.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbInsertBreakpointCommand.java deleted file mode 100644 index 5d8d35d60b..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbInsertBreakpointCommand.java +++ /dev/null @@ -1,97 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl.cmd; - -import org.apache.commons.text.StringEscapeUtils; - -import agent.gdb.manager.GdbInferior; -import agent.gdb.manager.breakpoint.GdbBreakpointInfo; -import agent.gdb.manager.breakpoint.GdbBreakpointType; -import agent.gdb.manager.evt.*; -import agent.gdb.manager.impl.*; - -/** - * Implementation of {@link GdbInferior#insertBreakpoint(String)} - */ -public class GdbInsertBreakpointCommand extends AbstractGdbCommandWithThreadId { - private final String loc; - private final GdbBreakpointType type; - - public GdbInsertBreakpointCommand(GdbManagerImpl manager, Integer threadId, String loc, - GdbBreakpointType type) { - super(manager, threadId); - this.loc = loc; - this.type = type; - } - - @Override - protected String makeThreadPart() { - return threadId == null ? "" : " -p " + threadId; - } - - protected static String esc(String param) { - return '"' + StringEscapeUtils.escapeJava(param) + '"'; - } - - @Override - protected String encode(String threadPart) { - String cmd; - switch (type) { - case BREAKPOINT: - return "-break-insert" + threadPart + " " + esc(loc); - case HW_BREAKPOINT: - return "-break-insert -h" + threadPart + " " + esc(loc); - case DPRINTF: - return "-dprintf-insert" + threadPart + " " + esc(loc); - case HW_WATCHPOINT: - cmd = "watch -l " + loc; // escaping here causes GDB to treat as literal??? - return "-interpreter-exec" + threadPart + " console " + esc(cmd); - case READ_WATCHPOINT: - cmd = "rwatch -l " + loc; - return "-interpreter-exec" + threadPart + " console " + esc(cmd); - case ACCESS_WATCHPOINT: - cmd = "awatch -l " + loc; - return "-interpreter-exec" + threadPart + " console " + esc(cmd); - default: - throw new IllegalArgumentException("type=" + type); - } - } - - @Override - public boolean handle(GdbEvent evt, GdbPendingCommand pending) { - if (super.handle(evt, pending)) { - return true; - } - else if (evt instanceof GdbBreakpointCreatedEvent) { - pending.claim(evt); - } - return false; - } - - @Override - public GdbBreakpointInfo complete(GdbPendingCommand pending) { - GdbCommandDoneEvent done = pending.checkCompletion(GdbCommandDoneEvent.class); - if (type.isWatchpoint()) { - GdbBreakpointCreatedEvent evt = pending.findSingleOf(GdbBreakpointCreatedEvent.class); - return evt.getBreakpointInfo(); - } - GdbBreakpointInfo bkpt = - GdbBreakpointInfo.parse(done.getInfo(), manager.currentInferior().getId()); - // GDB does not give notification for breakpoints added by GDB/MI commands - manager.doBreakpointCreated(bkpt, pending); - return bkpt; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbKillCommand.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbKillCommand.java deleted file mode 100644 index 1e0461bac7..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbKillCommand.java +++ /dev/null @@ -1,55 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl.cmd; - -import agent.gdb.manager.GdbInferior; -import agent.gdb.manager.evt.*; -import agent.gdb.manager.impl.*; - -/** - * Implementation of {@link GdbInferior#kill()} - */ -public class GdbKillCommand extends AbstractGdbCommandWithThreadId { - public GdbKillCommand(GdbManagerImpl manager, Integer threadId) { - super(manager, threadId); - } - - @Override - public String encode(String threadPart) { - // NOTE: In later versions, the GDB/MI command is "-exec-abort" - return "-interpreter-exec" + threadPart + " console kill"; - } - - @Override - public boolean handle(GdbEvent evt, GdbPendingCommand pending) { - if (super.handle(evt, pending)) { - return true; - } - else if (evt instanceof GdbThreadExitedEvent) { - pending.claim(evt); - } - else if (evt instanceof GdbThreadGroupExitedEvent) { - pending.claim(evt); - } - return false; - } - - @Override - public Void complete(GdbPendingCommand pending) { - pending.checkCompletion(GdbCommandDoneEvent.class); - return null; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbListAvailableProcessesCommand.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbListAvailableProcessesCommand.java deleted file mode 100644 index 446555fdd4..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbListAvailableProcessesCommand.java +++ /dev/null @@ -1,42 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl.cmd; - -import java.util.List; - -import agent.gdb.manager.GdbProcessThreadGroup; -import agent.gdb.manager.evt.GdbCommandDoneEvent; -import agent.gdb.manager.impl.GdbManagerImpl; -import agent.gdb.manager.impl.GdbPendingCommand; - -public class GdbListAvailableProcessesCommand - extends AbstractGdbCommand> { - public GdbListAvailableProcessesCommand(GdbManagerImpl manager) { - super(manager); - } - - @Override - public String encode() { - return "-list-thread-groups --available"; - } - - @Override - public List complete(GdbPendingCommand pending) { - GdbCommandDoneEvent done = pending.checkCompletion(GdbCommandDoneEvent.class); - // There is no GDB event for changes in available processes, so not tracking for now. - return done.assumeProcessGroups(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbListBreakpointsCommand.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbListBreakpointsCommand.java deleted file mode 100644 index 3249ab5580..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbListBreakpointsCommand.java +++ /dev/null @@ -1,82 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl.cmd; - -import java.util.*; - -import agent.gdb.manager.GdbCause.Causes; -import agent.gdb.manager.GdbInferior; -import agent.gdb.manager.breakpoint.GdbBreakpointInfo; -import agent.gdb.manager.breakpoint.GdbBreakpointLocation; -import agent.gdb.manager.evt.GdbCommandDoneEvent; -import agent.gdb.manager.impl.GdbManagerImpl; -import agent.gdb.manager.impl.GdbPendingCommand; -import agent.gdb.manager.parsing.GdbMiParser.GdbMiFieldList; -import ghidra.util.Msg; - -/** - * Implementation of {@link GdbInferior#listBreakpoints()} - */ -public class GdbListBreakpointsCommand - extends AbstractGdbCommandWithThreadId> { - - public GdbListBreakpointsCommand(GdbManagerImpl manager, Integer threadId) { - super(manager, threadId); - } - - @Override - protected String encode(String threadPart) { - return "-break-list" + threadPart; - } - - @Override - public Map complete(GdbPendingCommand pending) { - GdbCommandDoneEvent done = pending.checkCompletion(GdbCommandDoneEvent.class); - // Do not use GdbTable here, since col_names provide good IDs - // Also, there are some bonus fields that don't appear in cells.... - GdbMiFieldList tbl = done.assumeBreakpointTable(); - GdbMiFieldList body = tbl.getFieldList("body"); - Set nums = new HashSet<>(); - Map allBreakpoints = manager.getKnownBreakpointsInternal(); - List allLocs = GdbBreakpointInfo.parseLocations(body); - for (Object bkpt : body.get("bkpt")) { - GdbBreakpointInfo info = - GdbBreakpointInfo.parseBkpt((GdbMiFieldList) bkpt, allLocs, null); - nums.add(info.getNumber()); - GdbBreakpointInfo exists = allBreakpoints.get(info.getNumber()); - if (exists != null) { - if (!exists.equals(info)) { - // Need to update as if =breakpoint-modified - Msg.warn(this, "Resync: Missed breakpoint modification: " + info); - manager.doBreakpointModified(info, Causes.UNCLAIMED); - } - continue; - } - // Need to add as if =breakpoint-created - Msg.warn(this, "Resync: Was missing breakpoint: " + info); - manager.doBreakpointCreated(info, Causes.UNCLAIMED); - } - for (long num : new ArrayList<>(manager.getKnownBreakpoints().keySet())) { - if (nums.contains(num)) { - continue; // Do nothing, we're in sync - } - // Need to remove as if =breakpoint-deleted - Msg.warn(this, "Resync: Had extra breakpoint: " + num); - manager.doBreakpointDeleted(num, Causes.UNCLAIMED); - } - return manager.getKnownBreakpoints(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbListInferiorsCommand.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbListInferiorsCommand.java deleted file mode 100644 index 7865b8a079..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbListInferiorsCommand.java +++ /dev/null @@ -1,67 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl.cmd; - -import java.util.*; - -import agent.gdb.manager.*; -import agent.gdb.manager.GdbCause.Causes; -import agent.gdb.manager.evt.GdbCommandDoneEvent; -import agent.gdb.manager.impl.*; -import ghidra.util.Msg; - -/** - * Implementation of {@link GdbManager#listInferiors()} - */ -public class GdbListInferiorsCommand extends AbstractGdbCommand> { - public GdbListInferiorsCommand(GdbManagerImpl manager) { - super(manager); - } - - @Override - public String encode() { - return "-list-thread-groups"; - } - - @Override - public Map complete(GdbPendingCommand pending) { - GdbCommandDoneEvent done = pending.checkCompletion(GdbCommandDoneEvent.class); - List groups = done.assumeInferiorGroups(); - Set ids = new HashSet<>(); - Map allInferiors = manager.getKnownInferiorsInternal(); - Set curIds = allInferiors.keySet(); - for (GdbInferiorThreadGroup g : groups) { - ids.add(g.getInferiorId()); - GdbInferiorImpl exists = allInferiors.get(g.getInferiorId()); - if (exists != null) { - exists.update(g); - continue; // Otherwise, we're in sync - } - // Need to create the inferior as if we received =thread-group-created - Msg.warn(this, "Resync: Was missing group: i" + g); - manager.addInferior(new GdbInferiorImpl(manager, g), Causes.UNCLAIMED); - } - for (int id : new ArrayList<>(curIds)) { - if (ids.contains(id)) { - continue; // Do nothing, we're in sync - } - // Need to remove the inferior as if we received =thread-group-removed - Msg.warn(this, "Resync: Had extra group: i" + id); - manager.removeInferior(id, Causes.UNCLAIMED); - } - return manager.getKnownInferiors(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbListRegisterNamesCommand.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbListRegisterNamesCommand.java deleted file mode 100644 index 7097d1eae2..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbListRegisterNamesCommand.java +++ /dev/null @@ -1,44 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl.cmd; - -import java.util.List; - -import agent.gdb.manager.GdbThread; -import agent.gdb.manager.evt.GdbCommandDoneEvent; -import agent.gdb.manager.impl.GdbManagerImpl; -import agent.gdb.manager.impl.GdbPendingCommand; - -/** - * Implementation of {@link GdbThread#listRegisters()} - */ -public class GdbListRegisterNamesCommand extends AbstractGdbCommandWithThreadId> { - - public GdbListRegisterNamesCommand(GdbManagerImpl manager, Integer threadId) { - super(manager, threadId); - } - - @Override - protected String encode(String threadPart) { - return "-data-list-register-names" + threadPart; - } - - @Override - public List complete(GdbPendingCommand pending) { - GdbCommandDoneEvent done = pending.checkCompletion(GdbCommandDoneEvent.class); - return done.assumeRegisterNameList(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbListThreadsCommand.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbListThreadsCommand.java deleted file mode 100644 index 5446176a34..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbListThreadsCommand.java +++ /dev/null @@ -1,64 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl.cmd; - -import java.util.*; - -import agent.gdb.manager.GdbThread; -import agent.gdb.manager.evt.GdbCommandDoneEvent; -import agent.gdb.manager.impl.*; -import ghidra.util.Msg; - -public class GdbListThreadsCommand extends AbstractGdbCommand> { - protected final GdbInferiorImpl inferior; - - public GdbListThreadsCommand(GdbManagerImpl manager, GdbInferiorImpl inferior) { - super(manager); - this.inferior = inferior; - } - - @Override - public String encode() { - return "-list-thread-groups i" + inferior.getId(); - } - - @Override - public Map complete(GdbPendingCommand pending) { - GdbCommandDoneEvent done = pending.checkCompletion(GdbCommandDoneEvent.class); - List ids = done.assumeThreadIds(); - Map infThreads = inferior.getKnownThreads(); - Set cur = infThreads.keySet(); - for (int id : ids) { - if (cur.contains(id)) { - continue; // Do nothing, we're in sync - } - // Need to create the thread as if we receive =thread-created - Msg.warn(this, "Resync: Was missing thread: " + id); - new GdbThreadImpl(manager, inferior, id).add(); - } - for (int id : new ArrayList<>(cur)) { - if (ids.contains(id)) { - continue; // Do nothing, we're in sync - } - // Need to remove the thread as if we received =thread-exited - Msg.warn(this, "Resync: Had extra thread: " + id); - inferior.removeThread(id); - manager.removeThread(id); - } - return infThreads; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbReadMemoryCommand.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbReadMemoryCommand.java deleted file mode 100644 index 39d67a4664..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbReadMemoryCommand.java +++ /dev/null @@ -1,82 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl.cmd; - -import java.nio.ByteBuffer; -import java.util.List; - -import agent.gdb.manager.GdbThread; -import agent.gdb.manager.evt.GdbCommandDoneEvent; -import agent.gdb.manager.impl.GdbManagerImpl; -import agent.gdb.manager.impl.GdbPendingCommand; -import agent.gdb.manager.parsing.GdbMiParser.GdbMiFieldList; -import agent.gdb.manager.parsing.GdbParsingUtils; -import generic.ULongSpan; -import generic.ULongSpan.*; -import ghidra.util.Msg; -import ghidra.util.NumericUtilities; - -/** - * Implementation of {@link GdbThread#readMemory(long, ByteBuffer, int)} - */ -public class GdbReadMemoryCommand extends AbstractGdbCommandWithThreadId { - - private final long addr; - private final ByteBuffer buf; - private final int len; - - public GdbReadMemoryCommand(GdbManagerImpl manager, Integer threadId, long addr, ByteBuffer buf, - int len) { - super(manager, threadId); - this.addr = addr; - this.buf = buf; - this.len = len; - } - - @Override - protected String encode(String threadPart) { - return "-data-read-memory-bytes" + threadPart + " 0x" + Long.toHexString(addr) + " " + len; - } - - @Override - public ULongSpanSet complete(GdbPendingCommand pending) { - GdbCommandDoneEvent done = pending.checkCompletion(GdbCommandDoneEvent.class); - List rangeList = done.assumeMemoryContentsList(); - MutableULongSpanSet spanSet = new DefaultULongSpanSet(); - int pos = buf.position(); - int max = pos; - for (GdbMiFieldList r : rangeList) { - long begin = GdbParsingUtils.parsePrefixedHex(r.getString("begin")); - long offset = GdbParsingUtils.parsePrefixedHex(r.getString("offset")); - long end = GdbParsingUtils.parsePrefixedHex(r.getString("end")); - byte[] contents = NumericUtilities.convertStringToBytes(r.getString("contents")); - - long start = begin + offset; - int length = (int) (end - start); - if (length != contents.length) { - Msg.warn(this, "Received fewer bytes than indicated by bounds"); - } - int diff = (int) (start - addr); - int newPos = pos + diff; - max = Math.max(max, newPos + length); - buf.position(newPos); - buf.put(contents); - spanSet.add(ULongSpan.extent(start, length)); - } - buf.position(max); - return spanSet; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbReadRegistersCommand.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbReadRegistersCommand.java deleted file mode 100644 index d21d4344dc..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbReadRegistersCommand.java +++ /dev/null @@ -1,217 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl.cmd; - -import java.math.BigInteger; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; -import java.util.*; -import java.util.stream.Collectors; - -import agent.gdb.manager.GdbRegister; -import agent.gdb.manager.GdbContextualOperations; -import agent.gdb.manager.evt.*; -import agent.gdb.manager.impl.*; -import agent.gdb.manager.parsing.GdbCValueParser; -import agent.gdb.manager.parsing.GdbCValueParser.*; -import agent.gdb.manager.parsing.GdbMiParser.GdbMiFieldList; -import agent.gdb.manager.parsing.GdbParsingUtils.GdbParseError; -import ghidra.pcode.utils.Utils; -import ghidra.util.Msg; - -/** - * Implementation of {@link GdbContextualOperations#readRegisters(Set)} - */ -public class GdbReadRegistersCommand - extends AbstractGdbCommandWithThreadAndFrameId> { - - protected static BigInteger tryStructPatterns(GdbCompositeValue cv, int byteCount, - ByteOrder endianness) { - for (Map.Entry ent : cv.entrySet()) { - switch (ent.getKey()) { - case "v1_int8", "v2_int8", "v4_int8", "v8_int8", "v16_int8", "v32_int8", "v64_int8": - // Observed on i386:x86-64 - case "u8": { - // Observed on armv7 - BigInteger result = (ent.getValue() instanceof GdbArrayValue arr) - ? packElements(arr, byteCount, 1, endianness) - : null; - if (result != null) { - return result; - } - } - case "b": { - // Observed on aarch64 - BigInteger result = (ent.getValue() instanceof GdbCompositeValue nested) - ? tryStructPatternsB(nested, byteCount, endianness) - : null; - if (result != null) { - return result; - } - } - } - } - return null; - } - - protected static BigInteger tryStructPatternsB(GdbCompositeValue cv, int byteCount, - ByteOrder endianness) { - for (Map.Entry ent : cv.entrySet()) { - switch (ent.getKey()) { - case "u": { - // Observed on aarch64, nested in "b" - BigInteger result = (ent.getValue() instanceof GdbArrayValue arr) - ? packElements(arr, byteCount, 1, endianness) - : null; - if (result != null) { - return result; - } - } - } - } - return null; - } - - private final Set regs; - private final GdbThreadImpl thread; - - public GdbReadRegistersCommand(GdbManagerImpl manager, GdbThreadImpl thread, Integer frameId, - Set regs) { - super(manager, thread.getId(), frameId); - this.thread = thread; - this.regs = regs; - } - - @Override - protected String encode(String threadPart, String framePart) { - if (regs.isEmpty()) { - return "-interpreter-exec console echo"; - } - StringBuilder b = new StringBuilder(); - b.append("-data-list-register-values"); - b.append(threadPart); - b.append(framePart); - b.append(" x"); - for (GdbRegister r : regs) { - b.append(" "); - b.append(r.getNumber()); - } - return b.toString(); - } - - public static BigInteger packElements(GdbArrayValue av, int byteCount, int bytesPer, - ByteOrder endianness) { - assert bytesPer * av.size() == byteCount; - List elems = av.expectBigInts(); - byte[] packed = new byte[byteCount]; - ByteBuffer buf = ByteBuffer.wrap(packed); - int i = endianness == ByteOrder.BIG_ENDIAN ? 0 : packed.length - bytesPer; - int step = endianness == ByteOrder.BIG_ENDIAN ? bytesPer : -bytesPer; - for (BigInteger elem : elems) { - buf.position(i); - switch (bytesPer) { - case 1: - buf.put(elem.byteValue()); - break; - case 2: - buf.putShort(elem.shortValue()); - break; - case 4: - buf.putInt(elem.intValue()); - break; - case 8: - buf.putLong(elem.longValue()); - break; - default: - buf.put(Utils.bigIntegerToBytes(elem, bytesPer, true)); - break; - } - i += step; - } - return new BigInteger(1, packed); - } - - public static BigInteger parseAndFindInteger(String val, int byteCount, ByteOrder endianness) - throws GdbParseError { - if (val.contains("lbound")) { - /** - * TODO: This might be useful information, but I've only ever seen - * lbound=0x0,ubound=0xfff...fff} : size -1, so I'm just going to call this 0 and spare - * the log a mess. - */ - return BigInteger.ZERO; - } - GdbCValue value = GdbCValueParser.parseValue(val); - if (value instanceof GdbIntValue) { - GdbIntValue iv = (GdbIntValue) value; - return iv.getValue(); - } - if (value instanceof GdbCompositeValue) { - GdbCompositeValue cv = (GdbCompositeValue) value; - for (GdbCValue v : cv.values()) { - if (v instanceof GdbIntValue) { - GdbIntValue iv = (GdbIntValue) v; - return iv.getValue(); - } - } - BigInteger result = tryStructPatterns(cv, byteCount, endianness); - if (result != null) { - return result; - } - } - if (value instanceof GdbArrayValue) { - GdbArrayValue av = (GdbArrayValue) value; - if (byteCount % av.size() != 0) { - throw new AssertionError("Cannot divide bytes evenly among vector elements. size=" + - byteCount + ", value=" + val); - } - int bytesPer = byteCount / av.size(); - return packElements(av, byteCount, bytesPer, endianness); - } - throw new AssertionError( - "Expected an int, a union containing an int, or an array. Got " + val); - } - - @Override - public Map complete(GdbPendingCommand pending) { - GdbCommandDoneEvent done = pending.checkCompletion(GdbCommandDoneEvent.class); - if (regs.isEmpty()) { - return Collections.emptyMap(); - } - Map regsByNumber = - regs.stream().collect(Collectors.toMap(GdbRegister::getNumber, r -> r)); - List valueList = done.assumeRegisterValueList(); - Map result = new LinkedHashMap<>(); - ByteOrder endianness = thread.getInferior().getEndianness(); - for (GdbMiFieldList fields : valueList) { - int number = Integer.parseInt(fields.getString("number")); - String value = fields.getString("value"); - GdbRegister r = regsByNumber.get(number); - if (r == null) { - Msg.error(this, "GDB gave value for non-requested register: " + number); - continue; - } - try { - result.put(r, parseAndFindInteger(value, r.getSize(), endianness)); - } - catch (GdbParseError | AssertionError e) { - Msg.warn(this, - "Could not figure register value for [" + number + "] = " + value/*, e*/); - } - } - return result; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbRemoveInferiorCommand.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbRemoveInferiorCommand.java deleted file mode 100644 index 5804940175..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbRemoveInferiorCommand.java +++ /dev/null @@ -1,52 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl.cmd; - -import agent.gdb.manager.evt.GdbCommandDoneEvent; -import agent.gdb.manager.evt.GdbThreadGroupRemovedEvent; -import agent.gdb.manager.impl.*; - -public class GdbRemoveInferiorCommand extends AbstractGdbCommand { - - private final int id; - - public GdbRemoveInferiorCommand(GdbManagerImpl manager, int id) { - super(manager); - this.id = id; - } - - @Override - public String encode() { - return "-remove-inferior i" + id; - } - - @Override - public boolean handle(GdbEvent evt, GdbPendingCommand pending) { - if (super.handle(evt, pending)) { - return true; - } - if (evt instanceof GdbThreadGroupRemovedEvent) { - pending.claim(evt); - } - return false; - } - - @Override - public Void complete(GdbPendingCommand pending) { - pending.checkCompletion(GdbCommandDoneEvent.class); - return null; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbRunCommand.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbRunCommand.java deleted file mode 100644 index 7c113a1849..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbRunCommand.java +++ /dev/null @@ -1,43 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl.cmd; - -import agent.gdb.manager.GdbInferior; -import agent.gdb.manager.impl.GdbManagerImpl; -import agent.gdb.manager.impl.GdbManagerImpl.Interpreter; - -/** - * Implementation of {@link GdbInferior#run()} - */ -public class GdbRunCommand extends AbstractLaunchGdbCommand { - - public GdbRunCommand(GdbManagerImpl manager) { - super(manager); - } - - /*@Override - public Interpreter getInterpreter() { - return Interpreter.MI2; - }*/ - - @Override - public String encode() { - if (getInterpreter() == Interpreter.CLI) { - return "run"; - } - return "-exec-run"; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbSetActiveFrameCommand.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbSetActiveFrameCommand.java deleted file mode 100644 index f0381a27c8..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbSetActiveFrameCommand.java +++ /dev/null @@ -1,67 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl.cmd; - -import agent.gdb.manager.evt.GdbCommandDoneEvent; -import agent.gdb.manager.evt.GdbThreadSelectedEvent; -import agent.gdb.manager.impl.*; - -public class GdbSetActiveFrameCommand extends AbstractGdbCommandWithThreadId { - private final Integer frameId; - private final boolean internal; - - /** - * Select the given thread and frame - * - * @param manager the manager to execute the command - * @param threadId the desired thread Id - * @param frameId the desired frame level - * @param internal true to prevent announcement of the change - */ - public GdbSetActiveFrameCommand(GdbManagerImpl manager, Integer threadId, int frameId, - boolean internal) { - super(manager, threadId); - this.frameId = frameId; - this.internal = internal; - } - - @Override - protected String encode(String threadPart) { - return "-interpreter-exec" + threadPart + " console \"frame " + frameId + "\""; - } - - @Override - public boolean handle(GdbEvent evt, GdbPendingCommand pending) { - if (super.handle(evt, pending)) { - return true; - } - else if (evt instanceof GdbThreadSelectedEvent) { - pending.claim(evt); - } - return false; - } - - @Override - public Void complete(GdbPendingCommand pending) { - pending.checkCompletion(GdbCommandDoneEvent.class); - return null; - } - - @Override - public boolean isFocusInternallyDriven() { - return internal; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbSetActiveThreadCommand.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbSetActiveThreadCommand.java deleted file mode 100644 index fbf2116312..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbSetActiveThreadCommand.java +++ /dev/null @@ -1,66 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl.cmd; - -import agent.gdb.manager.evt.GdbCommandDoneEvent; -import agent.gdb.manager.evt.GdbThreadSelectedEvent; -import agent.gdb.manager.impl.*; - -public class GdbSetActiveThreadCommand extends AbstractGdbCommand { - private final int threadId; - private final boolean internal; - - /** - * Select the given thread - * - * @param manager the manager to execute the command - * @param threadId the desired thread Id - * @param frameId the desired frame level - * @param internal true to prevent announcement of the change - */ - public GdbSetActiveThreadCommand(GdbManagerImpl manager, int threadId, boolean internal) { - super(manager); - this.threadId = threadId; - this.internal = internal; - } - - @Override - public String encode() { - return "-thread-select " + threadId; - } - - @Override - public boolean handle(GdbEvent evt, GdbPendingCommand pending) { - if (super.handle(evt, pending)) { - return true; - } - else if (evt instanceof GdbThreadSelectedEvent) { - pending.claim(evt); - } - return false; - } - - @Override - public Void complete(GdbPendingCommand pending) { - pending.checkCompletion(GdbCommandDoneEvent.class); - return null; - } - - @Override - public boolean isFocusInternallyDriven() { - return internal; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbSetInferiorTtyCommand.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbSetInferiorTtyCommand.java deleted file mode 100644 index e8986cf082..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbSetInferiorTtyCommand.java +++ /dev/null @@ -1,44 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl.cmd; - -import agent.gdb.manager.GdbInferior; -import agent.gdb.manager.evt.GdbCommandDoneEvent; -import agent.gdb.manager.impl.GdbManagerImpl; -import agent.gdb.manager.impl.GdbPendingCommand; - -/** - * Implementation of {@link GdbInferior#setTty(String)} - */ -public class GdbSetInferiorTtyCommand extends AbstractGdbCommand { - private final String tty; - - public GdbSetInferiorTtyCommand(GdbManagerImpl manager, String tty) { - super(manager); - this.tty = tty; - } - - @Override - public String encode() { - return "-inferior-tty-set " + tty; - } - - @Override - public Void complete(GdbPendingCommand pending) { - pending.checkCompletion(GdbCommandDoneEvent.class); - return null; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbSetVarCommand.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbSetVarCommand.java deleted file mode 100644 index c2f38606e0..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbSetVarCommand.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl.cmd; - -import agent.gdb.manager.GdbInferior; -import agent.gdb.manager.evt.GdbCommandDoneEvent; -import agent.gdb.manager.impl.GdbManagerImpl; -import agent.gdb.manager.impl.GdbPendingCommand; - -/** - * Implementation of {@link GdbInferior#setVar(String, String)} - */ -public class GdbSetVarCommand extends AbstractGdbCommandWithThreadId { - private final String varName; - private final String val; - - public GdbSetVarCommand(GdbManagerImpl manager, Integer threadId, String varName, String val) { - super(manager, threadId); - this.varName = varName; - this.val = val; - } - - @Override - public String encode(String threadPart) { - return "-gdb-set" + threadPart + " " + varName + " " + val; - } - - @Override - public Void complete(GdbPendingCommand pending) { - pending.checkCompletion(GdbCommandDoneEvent.class); - return null; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbStackListFramesCommand.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbStackListFramesCommand.java deleted file mode 100644 index a025b59535..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbStackListFramesCommand.java +++ /dev/null @@ -1,51 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl.cmd; - -import java.util.ArrayList; -import java.util.List; - -import agent.gdb.manager.GdbStackFrame; -import agent.gdb.manager.evt.GdbCommandDoneEvent; -import agent.gdb.manager.impl.*; -import agent.gdb.manager.parsing.GdbMiParser.GdbMiFieldList; - -public class GdbStackListFramesCommand extends AbstractGdbCommandWithThreadId> { - protected final GdbThreadImpl thread; - - public GdbStackListFramesCommand(GdbManagerImpl manager, GdbThreadImpl thread) { - super(manager, thread.getId()); - this.thread = thread; - } - - @Override - protected String encode(String threadPart) { - return "-stack-list-frames" + threadPart; - } - - @Override - public List complete(GdbPendingCommand pending) { - GdbCommandDoneEvent done = pending.checkCompletion(GdbCommandDoneEvent.class); - GdbMiFieldList stack = done.assumeStack(); - List result = new ArrayList<>(stack.size()); - for (Object obj : stack.get("frame")) { - GdbMiFieldList f = (GdbMiFieldList) obj; - GdbStackFrame frame = GdbStackFrameImpl.fromFieldList(thread, f); - result.add(frame); - } - return result; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbStartCommand.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbStartCommand.java deleted file mode 100644 index fb22aa9a8e..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbStartCommand.java +++ /dev/null @@ -1,43 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl.cmd; - -import agent.gdb.manager.GdbInferior; -import agent.gdb.manager.impl.GdbManagerImpl; -import agent.gdb.manager.impl.GdbManagerImpl.Interpreter; - -/** - * Implementation of {@link GdbInferior#start()} - */ -public class GdbStartCommand extends AbstractLaunchGdbCommand { - - public GdbStartCommand(GdbManagerImpl manager) { - super(manager); - } - - /*@Override - public Interpreter getInterpreter() { - return Interpreter.MI2; - }*/ - - @Override - public String encode() { - if (getInterpreter() == Interpreter.CLI) { - return "start"; - } - return "-exec-run --start"; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbStartInstructionCommand.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbStartInstructionCommand.java deleted file mode 100644 index ddfb4458f2..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbStartInstructionCommand.java +++ /dev/null @@ -1,43 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl.cmd; - -import agent.gdb.manager.GdbInferior; -import agent.gdb.manager.impl.GdbManagerImpl; -import agent.gdb.manager.impl.GdbManagerImpl.Interpreter; - -/** - * Implementation of {@link GdbInferior#starti()} - */ -public class GdbStartInstructionCommand extends AbstractLaunchGdbCommand { - - public GdbStartInstructionCommand(GdbManagerImpl manager) { - super(manager); - } - - /*@Override - public Interpreter getInterpreter() { - return Interpreter.MI2; - }*/ - - @Override - public String encode() { - if (getInterpreter() == Interpreter.CLI) { - return "starti"; - } - return "-interpreter-exec console starti"; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbStateChangeRecord.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbStateChangeRecord.java deleted file mode 100644 index 62c877d808..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbStateChangeRecord.java +++ /dev/null @@ -1,108 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl.cmd; - -import java.util.Collection; - -import agent.gdb.manager.*; -import agent.gdb.manager.reason.GdbReason; - -/** - * A record of a state change in GDB - */ -public class GdbStateChangeRecord { - private GdbInferior inferior; - private GdbThread eventThread; - private Collection affectedThreads; - private GdbState state; - private GdbCause cause; - private GdbReason reason; - - /** - * Construct a new record - * - * @param inferior the inferior affected by this changed - * @param affectedThreads the threads affected by this change (includes only those from this - * inferior) - * @param state the new state of the inferior and threads - * @param eventThread the thread causing the change (may not be from this inferior) - * @param cause the user-driven cause of this change, e.g., a command - * @param reason the target-driven reason for this change, e.g., an event - */ - public GdbStateChangeRecord(GdbInferior inferior, Collection affectedThreads, - GdbState state, GdbThread eventThread, GdbCause cause, GdbReason reason) { - this.inferior = inferior; - this.affectedThreads = affectedThreads; - this.state = state; - this.eventThread = eventThread; - this.cause = cause; - this.reason = reason; - } - - /** - * Get the inferior affected by this change - * - * @return the inferior - */ - public GdbInferior getInferior() { - return inferior; - } - - /** - * Get the thread causing this change - * - * @return the event thread - */ - public GdbThread getEventThread() { - return eventThread; - } - - /** - * Get the threads affected by this change - * - * @return the threads - */ - public Collection getAffectedThreads() { - return affectedThreads; - } - - /** - * Get the new state of the affected items - * - * @return the new state - */ - public GdbState getState() { - return state; - } - - /** - * Get the user-driven cause of the change - * - * @return the cause - */ - public GdbCause getCause() { - return cause; - } - - /** - * Get the target-driven reason for this change - * - * @return the reason - */ - public GdbReason getReason() { - return reason; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbStepCommand.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbStepCommand.java deleted file mode 100644 index 2eceb8c5cb..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbStepCommand.java +++ /dev/null @@ -1,58 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl.cmd; - -import agent.gdb.manager.GdbManager.StepCmd; -import agent.gdb.manager.GdbThread; -import agent.gdb.manager.impl.*; -import agent.gdb.manager.impl.GdbManagerImpl.Interpreter; - -/** - * Implementation of {@link GdbThread#stepInstruction()} - */ -public class GdbStepCommand extends AbstractGdbCommandWithThreadId - implements MixinResumeInCliGdbCommand { - protected final StepCmd cmd; - - public GdbStepCommand(GdbManagerImpl manager, Integer threadId, StepCmd cmd) { - super(manager, threadId); - this.cmd = cmd; - } - - @Override - public Interpreter getInterpreter() { - return getInterpreter(manager); - } - - @Override - protected String encode(String threadPart) { - if (getInterpreter() == Interpreter.CLI) { - return cmd.cli; - } - return cmd.mi2 + threadPart; - } - - @Override - public boolean handle(GdbEvent evt, GdbPendingCommand pending) { - return handleExpectingRunning(evt, pending); - } - - @Override - public Void complete(GdbPendingCommand pending) { - completeOnRunning(pending); - return null; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbWriteMemoryCommand.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbWriteMemoryCommand.java deleted file mode 100644 index 4800d3bc8b..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbWriteMemoryCommand.java +++ /dev/null @@ -1,66 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl.cmd; - -import java.nio.ByteBuffer; - -import agent.gdb.manager.GdbThread; -import agent.gdb.manager.evt.GdbCommandDoneEvent; -import agent.gdb.manager.impl.GdbManagerImpl; -import agent.gdb.manager.impl.GdbPendingCommand; - -/** - * Implementation of {@link GdbThread#writeMemory(long, ByteBuffer, int)} - */ -public class GdbWriteMemoryCommand extends AbstractGdbCommandWithThreadId { - - private final long addr; - private final ByteBuffer buf; - private final int len; - - public GdbWriteMemoryCommand(GdbManagerImpl manager, Integer threadId, long addr, - ByteBuffer buf, int len) { - super(manager, threadId); - this.addr = addr; - this.buf = buf.duplicate(); - this.len = len; - } - - @Override - protected String encode(String threadPart) { - ByteBuffer dup = buf.duplicate(); - StringBuilder b = new StringBuilder(); - b.append("-data-write-memory-bytes"); - b.append(threadPart); - b.append(" 0x"); - b.append(Long.toHexString(addr)); - b.append(" "); - for (int i = 0; i < len; i++) { - int n = dup.get(); - if (n < 0) { - n += 256; - } - b.append(String.format("%02x", n)); - } - return b.toString(); - } - - @Override - public Void complete(GdbPendingCommand pending) { - pending.checkCompletion(GdbCommandDoneEvent.class); - return null; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbWriteRegistersCommand.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbWriteRegistersCommand.java deleted file mode 100644 index 3617e20ed7..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/GdbWriteRegistersCommand.java +++ /dev/null @@ -1,130 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl.cmd; - -import java.math.BigInteger; -import java.nio.ByteOrder; -import java.util.Map; - -import org.apache.commons.lang3.ArrayUtils; - -import agent.gdb.manager.GdbRegister; -import agent.gdb.manager.GdbContextualOperations; -import agent.gdb.manager.evt.GdbCommandDoneEvent; -import agent.gdb.manager.impl.*; -import ghidra.dbg.util.ConversionUtils; - -/** - * Implementation of {@link GdbContextualOperations#writeRegisters(Map)} - */ -public class GdbWriteRegistersCommand extends AbstractGdbCommandWithThreadAndFrameId { - protected static final BigInteger UINT128_MAX = - BigInteger.ONE.shiftLeft(128).subtract(BigInteger.ONE); - - private final GdbThreadImpl thread; - private final Map regVals; - - public GdbWriteRegistersCommand(GdbManagerImpl manager, GdbThreadImpl thread, Integer frameId, - Map regVals) { - super(manager, thread.getId(), frameId); - this.thread = thread; - - this.regVals = regVals; - } - - protected void encodeInt8Array(StringBuilder b, BigInteger value, int bytes) { - ByteOrder endianness = thread.getInferior().getEndianness(); - byte[] arr = ConversionUtils.bigIntegerToBytes(bytes, value); - if (endianness != ByteOrder.BIG_ENDIAN) { - ArrayUtils.reverse(arr); - } - boolean first = true; - for (int i = 0; i < bytes; i++) { - if (first) { - first = false; - } - else { - b.append(','); - } - int v = arr[i] & 0xff; - b.append(v); - } - } - - @Override - // Opting for console command, as -data-write-register-values is buggy - protected String encode(String threadPart, String framePart) { - StringBuilder b = new StringBuilder(); - b.append("-interpreter-exec"); - b.append(threadPart); - b.append(framePart); - b.append(" console \"set"); - boolean first = true; - for (Map.Entry ent : regVals.entrySet()) { - if (first) { - b.append(' '); - first = false; - } - else { - b.append(','); - } - b.append('$'); - GdbRegister reg = ent.getKey(); - b.append(reg.getName()); - - BigInteger value = ent.getValue(); - //if the register is 16 or fewer bytes, just use the name - if (reg.getSize() <= 16) { - b.append('='); - b.append(value.toString()); - } - //if the register is more than 16 bytes use gdb's struct syntax - //note: this only works for x64 - else { - b.append(".v"); - b.append(reg.getSize()); - b.append("_int8={"); - encodeInt8Array(b, value, reg.getSize()); - b.append('}'); - } - } - b.append("\""); - return b.toString(); - } - - // This command can't seem to take larger than uint128 - // Attempting vector-ish stuff here may cause GDB to segfault - protected String encodeForMi(String threadPart, String framePart) { - StringBuilder b = new StringBuilder(); - b.append("-data-write-register-values"); - b.append(threadPart); - b.append(framePart); - b.append(" x"); - for (Map.Entry ent : regVals.entrySet()) { - b.append(" "); - b.append(ent.getKey().getNumber()); - b.append(" 0x"); - b.append(ent.getValue().toString(16)); - } - return b.toString(); - } - - @Override - public Void complete(GdbPendingCommand pending) { - pending.checkCompletion(GdbCommandDoneEvent.class); - return null; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/MixinResumeInCliGdbCommand.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/MixinResumeInCliGdbCommand.java deleted file mode 100644 index 9d55a01cad..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/impl/cmd/MixinResumeInCliGdbCommand.java +++ /dev/null @@ -1,93 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl.cmd; - -import agent.gdb.manager.evt.*; -import agent.gdb.manager.impl.*; -import agent.gdb.manager.impl.GdbManagerImpl.Interpreter; - -/** - * A marker and mixin for dealing with commands where resuming in a secondary (mi2) ui seems - * problematic. - * - *

- * I'm not sure if it's a bug in GDB or Linux, or what, but if I attach to a target that doesn't - * have a tty then resume (i.e., continue or step) from the mi2 interpreter, it seems I cannot use - * "interrupt" from the primary (console) interpreter. So, for these resumes, I need to issue the - * command from the console, allowing ^C to work. - */ -public interface MixinResumeInCliGdbCommand extends GdbCommand { - - default Interpreter getInterpreter(GdbManagerImpl manager) { - if (manager.hasCli()) { - return Interpreter.CLI; - } - return Interpreter.MI2; - } - - default boolean handleExpectingRunning(GdbEvent evt, GdbPendingCommand pending) { - if (getInterpreter() == Interpreter.CLI) { - /** - * As of gdb-14 (anticipated based on build from git commit b6ac461a), the MI2 console - * will no longer receive ^running from commands issued to the CLI that resume the - * target. I suspect only the console that issues the command is meant to receive the - * ^running result, and that the behavior we had been taking advantage of was in fact a - * bug. Thus, we should only expect the *running event. For the sake of older versions, - * when we receive ^running, we'll still claim it, so long as it comes before *running. - */ - if (evt instanceof GdbRunningEvent) { - pending.claim(evt); - return true; - } - else if (evt instanceof AbstractGdbCompletedCommandEvent) { - pending.claim(evt); - return false; - } - } - else { - /** - * This situation should only occur with versions before about 8.0, anyway, since those - * supporting new-ui should have the CLI. I guess a user could still pass -i mi2 to a - * modern version, which might induce this. In any case, if we're issuing the command - * from MI2, we should expect both the *running event and the ^running result. - */ - if (evt instanceof GdbCommandRunningEvent) { - pending.claim(evt); - return pending.hasAny(GdbRunningEvent.class); - } - else if (evt instanceof AbstractGdbCompletedCommandEvent) { - pending.claim(evt); - return true; // Not the expected Completed event - } - else if (evt instanceof GdbRunningEvent) { - // Event happens no matter which interpreter received the command - pending.claim(evt); - return pending.hasAny(GdbCommandRunningEvent.class); - } - } - return false; - } - - default void completeOnRunning(GdbPendingCommand pending) { - // See comments in handleExpectingRunning - if (getInterpreter() == Interpreter.CLI) { - pending.findSingleOf(GdbRunningEvent.class); - } - else { // MI2 - pending.checkCompletion(GdbCommandRunningEvent.class); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/parsing/GdbCValueParser.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/parsing/GdbCValueParser.java deleted file mode 100644 index e594ef1677..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/parsing/GdbCValueParser.java +++ /dev/null @@ -1,328 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.parsing; - -import java.math.BigInteger; -import java.util.*; -import java.util.regex.Pattern; -import java.util.stream.Collectors; - -import org.apache.commons.collections4.list.AbstractListDecorator; -import org.apache.commons.collections4.map.AbstractMapDecorator; - -import agent.gdb.manager.parsing.GdbParsingUtils.AbstractGdbParser; -import agent.gdb.manager.parsing.GdbParsingUtils.GdbParseError; -import utility.function.ExceptionalFunction; - -public class GdbCValueParser extends AbstractGdbParser { - public interface GdbCValue { - public GdbCValue EMPTY = new GdbCValue() { - @Override - public boolean isEmpty() { - return true; - } - }; - - boolean isEmpty(); - - default int expectInt() { - return ((GdbIntValue) this).val.intValueExact(); - } - - default long expectLong() { - return ((GdbIntValue) this).val.longValueExact(); - } - - default BigInteger expectedBigInt() { - return ((GdbIntValue) this).val; - } - } - - public interface GdbCompositeValue extends GdbCValue, Map { - public GdbCompositeValue EMPTY = new DefaultGdbCompositeValue(Map.of()); - - public static class Builder { - private final Map map = new LinkedHashMap<>(); - - private Builder() { - } - - public Builder put(String name, GdbCValue value) { - if (map.containsKey(name)) { - throw new IllegalArgumentException("field " + name + " already present"); - } - map.put(name, value); - return this; - } - - public GdbCompositeValue build() { - return new DefaultGdbCompositeValue(Map.copyOf(map)); - } - } - - public static Builder builder() { - return new Builder(); - } - } - - public static class DefaultGdbCompositeValue extends AbstractMapDecorator - implements GdbCompositeValue { - private DefaultGdbCompositeValue(Map map) { - super(map); - } - } - - public interface GdbArrayValue extends GdbCValue, List { - public GdbArrayValue EMPTY = new DefaultGdbArrayValue(List.of()); - - public static class Builder { - private final List list = new ArrayList<>(); - - private Builder() { - } - - public Builder add(GdbCValue value) { - list.add(value); - return this; - } - - public GdbArrayValue build() { - return new DefaultGdbArrayValue(List.copyOf(list)); - } - } - - public static Builder builder() { - return new Builder(); - } - - public default List expectInts() { - return stream().map(v -> v.expectInt()).collect(Collectors.toList()); - } - - public default List expectLongs() { - return stream().map(v -> v.expectLong()).collect(Collectors.toList()); - } - - public default List expectBigInts() { - return stream().map(v -> v.expectedBigInt()).collect(Collectors.toList()); - } - } - - public static class DefaultGdbArrayValue extends AbstractListDecorator - implements GdbArrayValue { - private DefaultGdbArrayValue(List list) { - super(list); - } - } - - public static class GdbIntValue implements GdbCValue { - public static GdbIntValue valueOf(BigInteger val) { - // There shouldn't be a lot of these around to need to intern them - return new GdbIntValue(val); - } - - public static GdbIntValue valueOf(long val) { - return valueOf(BigInteger.valueOf(val)); - } - - @Override - public String toString() { - return "0x" + val.toString(16); - } - - @Override - public int hashCode() { - return val.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof GdbIntValue)) { - return false; - } - GdbIntValue that = (GdbIntValue) obj; - return Objects.equals(this.val, that.val); - } - - private final BigInteger val; - - private GdbIntValue(BigInteger val) { - this.val = val; - } - - public BigInteger getValue() { - return val; - } - - @Override - public boolean isEmpty() { - return false; - } - } - - protected static final Pattern COMMA = Pattern.compile(","); - protected static final Pattern LBRACE = Pattern.compile("\\{"); - protected static final Pattern RBRACE = Pattern.compile("\\}"); - protected static final Pattern ID = Pattern.compile("(?[A-Za-z_][0-9A-Za-z_]*)"); - protected static final Pattern EQUALS = Pattern.compile("="); - protected static final Pattern REPEATS = Pattern.compile(""); - protected static final Pattern INT_OCT = Pattern.compile("0(?[0-7]+)"); - protected static final Pattern INT_DEC = Pattern.compile("(?\\d+)"); - protected static final Pattern INT_HEX = Pattern.compile("0x(?[0-9A-Fa-f]+)"); - - public static T parseValue(CharSequence text, - ExceptionalFunction func) throws GdbParseError { - GdbCValueParser parser = new GdbCValueParser(text); - T val = func.apply(parser); - parser.checkEmpty(true); - return val; - } - - public static GdbCValue parseValue(CharSequence text) throws GdbParseError { - return parseValue(text, GdbCValueParser::parseValue); - } - - public static GdbArrayValue parseArray(CharSequence text) throws GdbParseError { - return parseValue(text, GdbCValueParser::parseArray); - } - - public GdbCValueParser(CharSequence text) { - super(text); - } - - public GdbCValue parseValue() throws GdbParseError { - switch (peek(true)) { - case '{': - return parseCompositeOrArray(); - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - return parseInteger(); - default: - throw new GdbParseError("{ or digit", buf); - } - } - - public GdbIntValue parseInteger() throws GdbParseError { - // Try hex first, so 0 in 0x doesn't get chewed by INT_DEC - try { - String match = match(INT_HEX, true, "hex"); - return GdbIntValue.valueOf(new BigInteger(match, 16)); - } - catch (GdbParseError e) { - // Just try next match - } - try { - String match = match(INT_OCT, true, "oct"); - return GdbIntValue.valueOf(new BigInteger(match, 8)); - } - catch (GdbParseError e) { - // Just try next match - } - try { - String match = match(INT_DEC, true, "dec"); - return GdbIntValue.valueOf(new BigInteger(match, 10)); - } - catch (GdbParseError e) { - // Fall through to error report - } - - throw new GdbParseError("0x[hex], 0[oct], or [dec]", buf); - } - - public GdbCValue parseCompositeOrArray() throws GdbParseError { - match(LBRACE, true); - char c = peek(true); - if (c == '}') { - match(RBRACE, true); - return GdbCValue.EMPTY; - } - if (Character.isAlphabetic(c) || c == '_') { - return parseCompositeAfterOpen(); - } - return parseArrayAfterOpen(); - } - - public GdbCompositeValue parseCompositeAfterOpen() throws GdbParseError { - GdbCompositeValue.Builder result = GdbCompositeValue.builder(); - while (true) { - String id = match(ID, true); - match(EQUALS, true); - GdbCValue val = parseValue(); - result.put(id, val); - - char c = peek(true); - if (c == '}') { - match(RBRACE, false); - return result.build(); - } - else if (c == ',') { - match(COMMA, false); - } - else { - throw new GdbParseError("} or ,", buf); - } - } - } - - public GdbArrayValue parseArray() throws GdbParseError { - match(LBRACE, true); - char c = peek(true); - if (c == '}') { - match(RBRACE, false); - return GdbArrayValue.EMPTY; - } - return parseArrayAfterOpen(); - } - - public GdbArrayValue parseArrayAfterOpen() throws GdbParseError { - GdbArrayValue.Builder result = GdbArrayValue.builder(); - while (true) { - GdbCValue val = parseValue(); - result.add(val); - - char c = peek(true); - if (c == '<') { - match(REPEATS, false); - GdbIntValue count = parseInteger(); - match(TIMES, false); // Pattern includes required whitespace - long n = count.val.longValueExact(); - for (int i = 1 /* Already did i=0 */; i < n; i++) { - result.add(val); - } - c = peek(true); - } - if (c == '}') { - match(RBRACE, false); - return result.build(); - } - else if (c == ',') { - match(COMMA, false); - } - else { - throw new GdbParseError("} , or - * While this is a much more machine-friendly format, it has some interesting idiosyncrasies that - * make it annoying even within a machine. This class attempts to impose a nice abstraction of these - * records while dealing with nuances particular to certain records, but in general. Examine GDB's - * documentation for some example records. - * - *

- * There seem to be one primitive type and two (and a half?) aggregate types in these records. The - * one primitive type is a string. The aggregates are lists and maps, and maybe "field lists" which - * behave like multi-valued maps. Maps introduce IDs, which comprise the map keys or field names. - * Strings are enclosed in double quotes, lists (including field lists) are enclosed in square - * brackets, and maps (and sometimes field lists) are enclosed in curly braces. If the outermost - * object is a field list, it may not be enclosed at all. These objects may be deeply nested. This - * seems to resemble JSON, but rest assured, it is not. To avoid the need for backtracking or - * recasting, maps are treated as field lists. - */ -public class GdbMiParser extends AbstractGdbParser { - public static final String UNNAMED = ""; - - /** - * The class used to store parsed maps and field lists - * - * A field list is simply a multi-valued map. A single key may occur multiple times with - * different values. - */ - public static class GdbMiFieldList { - /** - * For testing, start building a field list, as if parsed - * - * @return a builder - */ - public static Builder builder() { - return new Builder(); - } - - /** - * The builder for constructing test field lists - */ - public static class Builder { - private final GdbMiFieldList list; - - private Builder() { - list = new GdbMiFieldList(false); - } - - /** - * Add a key-value pair to the field list - * - * @param key the key - * @param value the associated value - * @return this builder - */ - public Builder add(String key, Object value) { - list.add(key, value); - return this; - } - - /** - * Build the field list - * - * @return the field list - */ - public GdbMiFieldList build() { - return list; - } - } - - /** - * A key-value entry in the field list - * - * @param key the key - * @param value the value - */ - public record Entry(String key, Object value) { - } - - private MultiValuedMap map = new ArrayListValuedHashMap(); - private MultiValuedMap unmodifiableMap = - MultiMapUtils.unmodifiableMultiValuedMap(map); - private final List entryList = new ArrayList<>(); - private final List unmodifiableEntries = Collections.unmodifiableList(entryList); - private final boolean enclosed; - - private GdbMiFieldList(boolean enclosed) { - this.enclosed = enclosed; - } - - private void add(String key, Object value) { - entryList.add(new Entry(key, value)); - map.put(key, value); - } - - /** - * Get the list of entries, in order of appearance - * - * @return the list of key-value entries - */ - public List entries() { - return unmodifiableEntries; - } - - /** - * Get all values associated with the given key - * - * @param key the key - * @return the unordered collection of values - */ - public Collection get(String key) { - return unmodifiableMap.get(key); - } - - /** - * Assume only a single value is associated with the key, and get that value - * - * @param key the key - * @return the value - * @throws IllegalStateException if more than one value is associated - */ - public Object getSingleton(String key) { - Collection col = map.get(key); - if (col.size() == 0) { - return null; - } - if (col.size() != 1) { - throw new IllegalStateException("Key " + key + " is multi-valued: " + col); - } - return col.iterator().next(); - } - - /** - * Assume only a single string is associated with the key, and get that string - * - * @param key the key - * @return the value - * @throws IllegalStateException if more than one value is associated - */ - public String getString(String key) { - return (String) getSingleton(key); - } - - /** - * Assume only a single list is associated with the key, and get that list - * - *

- * For convenience, the list is cast to a list of elements of a given type. This cast is - * unchecked. - * - * @param cls the type of elements in the list - * @param key the key - * @return the value - * @throws IllegalStateException if more than one value is associated - */ - @SuppressWarnings("unchecked") - public List getListOf(Class cls, String key) { - return (List) getSingleton(key); - } - - /** - * Assume only a single field list is associated with the key, and get that list - * - * @param key the key - * @return the value - * @throws IllegalStateException if more than one value is associated - */ - public GdbMiFieldList getFieldList(String key) { - Object obj = getSingleton(key); - if (obj instanceof List list && list.isEmpty()) { - return GdbMiFieldList.builder().build(); - } - return (GdbMiFieldList) obj; - } - - /** - * Check if a key is present in the field list - * - * @param key the key - * @return true if present, false otherwise - */ - public boolean containsKey(String key) { - return map.containsKey(key); - } - - /** - * Count the number of entries (not keys) in the field list - * - * @return the count - */ - public int size() { - return entryList.size(); - } - - @Override - public String toString() { - return map.toString(); - } - - @Override - public int hashCode() { - return map.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof GdbMiFieldList)) { - return false; - } - GdbMiFieldList that = (GdbMiFieldList) obj; - return Objects.equals(this.map, that.map); - } - } - - protected static final Pattern COMMA = Pattern.compile(","); - protected static final Pattern LBRACKET = Pattern.compile("\\["); - protected static final Pattern RBRACKET = Pattern.compile("\\]"); - protected static final Pattern FIELD_ID = Pattern.compile("([0-9A-Za-z_]|-)+"); - protected static final Pattern EQUALS = Pattern.compile("="); - protected static final Pattern LBRACE = Pattern.compile("\\{"); - protected static final Pattern RBRACE = Pattern.compile("\\}"); - - /** - * Construct a parser of the given text - * - * The static methods {@link #parseObject(CharSequence)}, {@link #parseString(CharSequence)}, - * {@link #parseFields(CharSequence)} should probably be used instead. - * - * @param text the text to parse - */ - public GdbMiParser(CharSequence text) { - super(text); - } - - /** - * Parse the object in the text - * - * @param text the text to parse - * @return the object defined in the text - * @throws GdbParseError if no text matches the pattern - */ - public static Object parseObject(CharSequence text) throws GdbParseError { - GdbMiParser parser = new GdbMiParser(text); - Object result = parser.parseObject(); - parser.checkEmpty(true); - return result; - } - - /** - * Parse the string literal in the text - * - * @param text the text to parse - * @return the string parsed - * @throws GdbParseError if no text matches the pattern - */ - public static String parseString(CharSequence text) throws GdbParseError { - GdbMiParser parser = new GdbMiParser(text); - String result = parser.parseString(); - parser.checkEmpty(true); - return result; - } - - /** - * Parse the fields in the text - * - * @param text the text to parse - * @return the string parsed - * @throws GdbParseError if no text matches the pattern - */ - public static GdbMiFieldList parseFields(CharSequence text) throws GdbParseError { - GdbMiParser parser = new GdbMiParser(text); - GdbMiFieldList result = parser.parseFields(false); - parser.checkEmpty(true); - return result; - } - - /** - * Parse the object at the cursor - * - * @see #parseObject(CharSequence) - * @return the object - * @throws GdbParseError if no text matches - */ - public Object parseObject() throws GdbParseError { - switch (peek(true)) { - case '"': - return parseString(); - case '[': - return parseList(); - case '{': - return parseMap(); - default: - // TODO: I'm a little uneasy about this - // It's basically a malformed map - return parseFields(false); - } - } - - /** - * Parse the string at the cursor, undoing GDB's printchar transformation. - * - * @see #parseString(CharSequence) - * @return the string - * @throws GdbParseError if no text matches the pattern - */ - public String parseString() throws GdbParseError { - if ('"' != peek(false)) { // Keep whitespace that is in the string - throw new GdbParseError("\"", buf); - } - buf.get(); // consume " - - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - while (true) { - char ch = buf.get(); - if (ch > 0xff) { - throw new GdbParseError("byte", "U+" + String.format("%04X", ch)); - } - else if (ch == '"') { - break; - } - else if (ch != '\\') { - baos.write(ch); - continue; - } - - /* Handle backslash-escape */ - ch = buf.get(); - switch (ch) { - case 'n': - baos.write('\n'); - break; - case 'b': - baos.write('\b'); - break; - case 't': - baos.write('\t'); - break; - case 'f': - baos.write('\f'); - break; - case 'r': - baos.write('\r'); - break; - case 'e': - baos.write(0x1b); - break; - case 'a': - baos.write(0x07); - break; - case '0': - case '1': - case '2': - case '3': - char ch2 = buf.get(); - if (ch2 < '0' || ch2 > '9') { - throw new GdbParseError("octal", "" + ch2); - } - char ch3 = buf.get(); - if (ch3 < '0' || ch3 > '9') { - throw new GdbParseError("octal", "" + ch3); - } - int octchar = ((ch - '0') << 6) | ((ch2 - '0') << 3) | (ch3 - '0'); - baos.write(octchar); - break; - case '\\': - case '"': - baos.write(ch); - break; - default: - throw new GdbParseError("escape", "" + ch); - } - } - return baos.toString(StandardCharsets.UTF_8); - } - - /** - * Parse the list at the cursor - * - * @return the list - * @throws GdbParseError if no text matches the pattern - */ - public Object parseList() throws GdbParseError { - match(LBRACKET, true); - List result = new ArrayList<>(); - while (buf.hasRemaining()) { - char c = peek(true); - if (c == ']') { - match(RBRACKET, false); - break; - } - if (c == ',') { - match(COMMA, false); - } - result.add(parseObject()); - } - if (result.size() == 1) { - Object maybeFieldList = result.get(0); - if (maybeFieldList instanceof GdbMiFieldList) { - GdbMiFieldList fieldList = (GdbMiFieldList) maybeFieldList; - if (!fieldList.enclosed) { - return maybeFieldList; - } - } - } - return Collections.unmodifiableList(result); - } - - /** - * Parse the map at the cursor - * - * @return the map (as a field list) - * @throws GdbParseError if no text matches the pattern - */ - public GdbMiFieldList parseMap() throws GdbParseError { - match(LBRACE, true); - GdbMiFieldList result = parseFields(true); - match(RBRACE, true); - return result; - } - - /** - * Parse the fields at the cursor - * - * @see #parseFields(CharSequence) - * @param enclosed true if the field list is enclosed in brackets/braces - * @return the field list - * @throws GdbParseError if no text matches the pattern - */ - public GdbMiFieldList parseFields(boolean enclosed) throws GdbParseError { - GdbMiFieldList result = new GdbMiFieldList(enclosed); - while (buf.hasRemaining()) { - char c = peek(true); - if (c == ']' || c == '}') { - break; - } - if (c == ',') { - match(COMMA, false); - } - c = peek(true); - if (c == '{') { - Object fieldVal = parseObject(); - result.add(UNNAMED, fieldVal); - continue; - } - if (c == '"') { - String bareString = parseString(); - result.add(null, bareString); - continue; - } - String fieldId = match(FIELD_ID, true); - match(EQUALS, true); - Object fieldVal = parseObject(); - result.add(fieldId, fieldVal); - } - return result; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/parsing/GdbParsingUtils.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/parsing/GdbParsingUtils.java deleted file mode 100644 index 44719850a5..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/parsing/GdbParsingUtils.java +++ /dev/null @@ -1,175 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.parsing; - -import java.math.BigInteger; -import java.nio.CharBuffer; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * Some utility methods for working with GDB - */ -public enum GdbParsingUtils { - ; - - public static abstract class AbstractGdbParser { - protected final CharBuffer buf; - - protected AbstractGdbParser(CharSequence text) { - this.buf = CharBuffer.wrap(text); - } - - protected String match(Pattern pat, boolean chompWhitespace) throws GdbParseError { - return match(pat, chompWhitespace, null); - } - - protected String match(Pattern pat, boolean chompWhitespace, String group) - throws GdbParseError { - if (chompWhitespace) { - chompWhitespace(); - } - Matcher mat = pat.matcher(buf); - if (mat.lookingAt()) { - String result = group == null ? mat.group() : mat.group(group); - // TODO: Might just need end? - int length = mat.end() - mat.start(); - buf.position(buf.position() + length); - return result; - } - throw new GdbParseError("" + pat, buf); - } - - /** - * Peek at the next character - * - * @param chompWhitespace true to consume all whitespace at the current position first - * @return the next character - */ - protected char peek(boolean chompWhitespace) { - if (chompWhitespace) { - chompWhitespace(); - } - if (!buf.hasRemaining()) { - return '\0'; - } - return buf.get(buf.position()); - } - - /** - * Advance the buffer position past any whitespace - */ - protected void chompWhitespace() { - while (buf.hasRemaining() && Character.isWhitespace(buf.get(buf.position()))) { - buf.get(); - } - } - - /** - * Check that the parser has reached the end of the line (EOL) - * - * @throws GdbParseError if there is text remaining - */ - protected void checkEmpty(boolean chompWhitespace) throws GdbParseError { - if (chompWhitespace) { - chompWhitespace(); - } - if (buf.hasRemaining()) { - throw new GdbParseError("EOL", buf); - } - } - } - - /** - * An exception that is thrown when the manager cannot parse a command result, event, or value - */ - public static class GdbParseError extends Exception { - /** - * Construct a description of a parse error - * - * @param expected the character(s) expected - * @param s the tail from the first rejected character - */ - public GdbParseError(String expected, CharSequence s) { - super("Expected [" + expected + "] at tail '" + s + "'"); - } - } - - /** - * Parse a hex string to a long - * - *

- * The string must have the {@code 0x} prefix - * - * @param hex the string - * @return the parsed long - */ - public static long parsePrefixedHex(String hex) { - if (!hex.startsWith("0x")) { - throw new NumberFormatException("Hex must start with 0x"); - } - return Long.parseUnsignedLong(hex.substring(2), 16); - } - - /** - * Parse a hex string to a big integer - * - *

- * The string must have the {@code 0x} prefix - * - * @param hex the string - * @return the parsed big integer - */ - public static BigInteger parsePrefixedHexBig(String hex) { - if (!hex.startsWith("0x")) { - throw new NumberFormatException("Hex must start with 0x"); - } - return new BigInteger(hex.substring(2), 16); - } - - /** - * Parse an octal string to a long - * - *

- * The string must have the {@code 0} prefix - * - * @param oct the string - * @return the parsed long - */ - public static long parsePrefixedOctal(String oct) { - if (!oct.startsWith("0")) { - throw new NumberFormatException("Octal must start with 0"); - } - return Long.parseUnsignedLong(oct, 8); - } - - /** - * Parse an inferior id - * - *

- * The id must have the {@code i} prefix - * - * @param id the string - * @return the parsed integer - */ - public static int parseInferiorId(String id) { - if (!id.startsWith("i")) { - throw new IllegalArgumentException( - "Map id does not specify an inferior. Must start with 'i'"); - } - return Integer.parseInt(id.substring(1)); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/reason/GdbBreakpointHitReason.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/reason/GdbBreakpointHitReason.java deleted file mode 100644 index 1d6078bc0c..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/reason/GdbBreakpointHitReason.java +++ /dev/null @@ -1,77 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.reason; - -import agent.gdb.manager.GdbStackFrame; -import agent.gdb.manager.GdbThread; -import agent.gdb.manager.impl.GdbStackFrameImpl; -import agent.gdb.manager.impl.GdbThreadImpl; -import agent.gdb.manager.parsing.GdbMiParser.GdbMiFieldList; - -/** - * The inferior stopped because a thread hit a breakpoint - */ -public class GdbBreakpointHitReason implements GdbReason { - private final GdbMiFieldList frame; - private final long bkptno; - private final int threadId; - - public GdbBreakpointHitReason(GdbMiFieldList info) { - this.bkptno = Long.parseLong(info.getString("bkptno")); - this.threadId = Integer.parseInt(info.getString("thread-id")); - this.frame = info.getFieldList("frame"); - } - - /** - * Get the ID of the breakpoint that was hit - * - * @return the breakpoint number - */ - public long getBreakpointId() { - return bkptno; - } - - /** - * Get the stack frame where the breakpoint was hit - * - * TODO: Why would this ever be non-zero, again? - * - * @param thread the thread - * @return the frame - */ - public GdbStackFrame getFrame(GdbThread thread) { - return GdbStackFrameImpl.fromFieldList((GdbThreadImpl) thread, frame); - } - - /** - * Get the ID of the thread that hit the breakpoint - * - * @return the thread ID - */ - public int getThreadId() { - return threadId; - } - - @Override - public String toString() { - return ""; - } - - @Override - public String desc() { - return "Breakpoint " + bkptno + " hit"; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/reason/GdbEndSteppingRangeReason.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/reason/GdbEndSteppingRangeReason.java deleted file mode 100644 index bd9b791602..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/reason/GdbEndSteppingRangeReason.java +++ /dev/null @@ -1,32 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.reason; - -import agent.gdb.manager.parsing.GdbMiParser.GdbMiFieldList; - -/** - * The inferior stopped because it finished stepping - */ -public class GdbEndSteppingRangeReason implements GdbReason { - public GdbEndSteppingRangeReason(GdbMiFieldList info) { - // Nothing additional to parse - } - - @Override - public String desc() { - return "Stepping ended"; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/reason/GdbExitNormallyReason.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/reason/GdbExitNormallyReason.java deleted file mode 100644 index 6bc84a6e4b..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/reason/GdbExitNormallyReason.java +++ /dev/null @@ -1,33 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.reason; - -import agent.gdb.manager.parsing.GdbMiParser.GdbMiFieldList; - -/** - * The inferior stopped because it has exited (with status 0) - */ -public class GdbExitNormallyReason extends GdbExitedReason { - public GdbExitNormallyReason(GdbMiFieldList info) { - super(0); - // Nothing additional to parse - } - - @Override - public String desc() { - return "Exited normally (with code 0)"; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/reason/GdbExitedReason.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/reason/GdbExitedReason.java deleted file mode 100644 index b8a71d3037..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/reason/GdbExitedReason.java +++ /dev/null @@ -1,47 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.reason; - -import agent.gdb.manager.parsing.GdbMiParser.GdbMiFieldList; - -/** - * The inferior stopped because it has exited - */ -public class GdbExitedReason implements GdbReason { - private final int exitCode; - - public GdbExitedReason(GdbMiFieldList info) { - this.exitCode = Integer.parseInt(info.getString("exit-code")); - } - - public GdbExitedReason(int exitCode) { - this.exitCode = exitCode; - } - - /** - * Get the exit code of the inferior - * - * @return the exit code - */ - public int getExitCode() { - return exitCode; - } - - @Override - public String desc() { - return "Exited with code " + exitCode; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/reason/GdbReason.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/reason/GdbReason.java deleted file mode 100644 index 5fea26c781..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/reason/GdbReason.java +++ /dev/null @@ -1,91 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.reason; - -import java.util.Map; -import java.util.function.Function; - -import agent.gdb.manager.GdbState; -import agent.gdb.manager.parsing.GdbMiParser.GdbMiFieldList; -import ghidra.util.Msg; - -/** - * Indicates the reason for a thread's state to change, usually only when {@link GdbState#STOPPED} - * - * This concept is native to GDB. When a thread stops, GDB may communicate the reason, e.g., a - * breakpoint was hit, or the thread exited. The manager attempts to parse information for the - * reasons it understands and provides it in e.g., a {@link GdbBreakpointHitReason}. If GDB provides - * a reason that is not understood by the manager, then {@link GdbReason.Reasons#UNKNOWN} is given. - * If no reason is provided, then {@link GdbReason.Reasons#NONE} is given. - */ -public interface GdbReason { - /** - * A map of reason strings to reason classes - */ - static final Map> TYPES = - Map.ofEntries( - Map.entry("signal-received", GdbSignalReceivedReason::new), - Map.entry("breakpoint-hit", GdbBreakpointHitReason::new), - Map.entry("end-stepping-range", GdbEndSteppingRangeReason::new), - Map.entry("exited", GdbExitedReason::new), - Map.entry("exited-normally", GdbExitNormallyReason::new)); - - /** - * Reasons other than those given by GDB - */ - enum Reasons implements GdbReason { - /** - * No reason was given - */ - NONE("No reason"), - /** - * A reason was given, but the manager does not understand it - */ - UNKNOWN("Unknown"); - - final String desc; - - private Reasons(String desc) { - this.desc = desc; - } - - @Override - public String desc() { - return desc; - } - } - - /** - * Process the parsed reason information to get the reason for a state change - * - * @param info the parsed information, i.e., the map containing "{@code reason={...}}" - * @return the reason - */ - static GdbReason getReason(GdbMiFieldList info) { - String reasonStr = info.getString("reason"); - if (reasonStr == null) { - return Reasons.NONE; - } - Function cons = TYPES.get(reasonStr); - if (cons == null) { - Msg.warn(GdbReason.class, "Unknown stop reason: " + reasonStr); - return Reasons.UNKNOWN; - } - return cons.apply(info); - } - - public String desc(); -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/reason/GdbSignalReceivedReason.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/reason/GdbSignalReceivedReason.java deleted file mode 100644 index cc7737f116..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/manager/reason/GdbSignalReceivedReason.java +++ /dev/null @@ -1,43 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.reason; - -import agent.gdb.manager.parsing.GdbMiParser.GdbMiFieldList; - -/** - * The inferior stopped because it has received a signal - */ -public class GdbSignalReceivedReason implements GdbReason { - private final String signalName; - - public GdbSignalReceivedReason(GdbMiFieldList info) { - this.signalName = info.getString("signal-name"); - } - - /** - * Get the (POSIX) name of the signal received - * - * @return the signal name - */ - public String getSignalName() { - return signalName; - } - - @Override - public String desc() { - return "Signalled with " + getSignalName(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelImpl.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelImpl.java deleted file mode 100644 index 1e371fd4e5..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelImpl.java +++ /dev/null @@ -1,209 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.impl; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import org.apache.commons.lang3.exception.ExceptionUtils; - -import agent.gdb.manager.*; -import agent.gdb.manager.impl.cmd.GdbCommandError; -import ghidra.async.AsyncUtils; -import ghidra.dbg.DebuggerModelClosedReason; -import ghidra.dbg.agent.AbstractDebuggerObjectModel; -import ghidra.dbg.error.DebuggerModelTerminatingException; -import ghidra.dbg.error.DebuggerUserException; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.AnnotatedSchemaContext; -import ghidra.dbg.target.schema.TargetObjectSchema; -import ghidra.program.model.address.*; -import ghidra.pty.PtyFactory; - -public class GdbModelImpl extends AbstractDebuggerObjectModel { - // TODO: Need some minimal memory modeling per architecture on the model/agent side. - // The model must convert to and from Ghidra's address space names - protected static final String SPACE_NAME = "ram"; - - protected static final AnnotatedSchemaContext SCHEMA_CTX = new AnnotatedSchemaContext(); - protected static final TargetObjectSchema ROOT_SCHEMA = - SCHEMA_CTX.getSchemaForClass(GdbModelTargetSession.class); - - protected static T translateEx(Throwable ex) { - Throwable t = AsyncUtils.unwrapThrowable(ex); - if (t instanceof GdbCommandError) { - GdbCommandError err = (GdbCommandError) t; - throw new DebuggerUserException(err.getInfo().getString("msg")); - } - return ExceptionUtils.rethrow(ex); - } - - // Don't make this static, so each model has a unique "GDB" space - protected final AddressSpace space = - new GenericAddressSpace(SPACE_NAME, 64, AddressSpace.TYPE_RAM, 0); - protected final AddressFactory addressFactory = - new DefaultAddressFactory(new AddressSpace[] { space }); - - protected final GdbManager gdb; - protected final GdbModelTargetSession session; - private volatile boolean closed; - - protected final CompletableFuture completedSession; - protected final GdbStateListener gdbExitListener = this::checkExited; - - protected Map objectMap = new HashMap<>(); - - public GdbModelImpl(PtyFactory ptyFactory) { - this.gdb = GdbManager.newInstance(ptyFactory); - this.session = new GdbModelTargetSession(this, ROOT_SCHEMA); - - this.completedSession = CompletableFuture.completedFuture(session); - - gdb.addStateListener(gdbExitListener); - addModelRoot(session); - } - - @Override - public TargetObjectSchema getRootSchema() { - return ROOT_SCHEMA; - } - - @Override - public String getBrief() { - return "GDB@" + Integer.toHexString(System.identityHashCode(this)) + " " + - gdb.getPtyDescription(); - } - - @Override - public AddressSpace getAddressSpace(String name) { - if (!SPACE_NAME.equals(name)) { - return null; - } - return space; - } - - // TODO: Place make this a model method? - @Override - public AddressFactory getAddressFactory() { - return addressFactory; - } - - protected void checkExited(GdbState state, GdbCause cause) { - switch (state) { - case NOT_STARTED: { - break; - } - case STARTING: { - break; - } - case RUNNING: { - session.setAccessible(false); - break; - } - case STOPPED: { - session.setAccessible(true); - break; - } - case EXIT: { - try { - terminate(); - } - catch (IOException e) { - throw new AssertionError(e); - } - break; - } - } - } - - public void setUnixNewLine() { - gdb.setUnixNewLine(); - } - - public void setDosNewLine() { - gdb.setDosNewLine(); - } - - public CompletableFuture startGDB(String gdbCmd, String[] args) { - return CompletableFuture.runAsync(() -> { - try { - if (closed) { - return; - } - gdb.start(gdbCmd, args); - } - catch (IOException e) { - if (closed) { - return; - } - throw new DebuggerModelTerminatingException( - "Error while starting GDB: " + e.getMessage(), e); - } - }).thenCompose(__ -> { - if (closed) { - return AsyncUtils.nil(); - } - return gdb.runRC(); - }); - } - - public void consoleLoop() throws IOException { - gdb.consoleLoop(); - } - - public void terminate() throws IOException { - broadcast().modelClosed(DebuggerModelClosedReason.NORMAL); - session.invalidateSubtree(session, "GDB is terminating"); - gdb.terminate(); - } - - @Override - public CompletableFuture fetchModelRoot() { - return completedSession; - } - - @Override - public boolean isAlive() { - return gdb.getState().isAlive(); - } - - @Override - public CompletableFuture close() { - closed = true; - try { - terminate(); - return super.close(); - } - catch (Throwable t) { - return CompletableFuture.failedFuture(t); - } - } - - public void addModelObject(Object object, TargetObject targetObject) { - objectMap.put(object, targetObject); - } - - public TargetObject getModelObject(Object object) { - return objectMap.get(object); - } - - public void deleteModelObject(Object object) { - objectMap.remove(object); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelImplUtils.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelImplUtils.java deleted file mode 100644 index e485c894e3..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelImplUtils.java +++ /dev/null @@ -1,56 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.impl; - -import java.util.List; -import java.util.concurrent.CompletableFuture; -import java.util.function.Supplier; - -import agent.gdb.manager.GdbInferior; -import agent.gdb.manager.GdbThread; -import ghidra.dbg.util.ShellUtils; - -public enum GdbModelImplUtils { - ; - - /** - * Perform the file-args-start sequence to launch a target in an inferior - * - * @param inferior the inferior to assign the target - * @param args the command-line arguments, including the executable at args[0] - * @param useStarti true to use {@code starti}, false to use {@code start} - * @param postFile a caller-specified routine to execute after the {@code file} part of the - * sequence. This is useful to grab auto-derived environment information - * @return a future which completes with the initial thread of the target - */ - public static CompletableFuture launch(GdbInferior inferior, - List args, boolean useStarti, Supplier> postFile) { - // Queue all these up to avoid other commands getting between. - CompletableFuture feas = inferior.fileExecAndSymbols(args.get(0)); - CompletableFuture post = postFile.get(); - CompletableFuture sargs = - inferior.setVar("args", ShellUtils.generateLine(args.subList(1, args.size()))); - CompletableFuture start = useStarti ? inferior.starti() : inferior.start(); - return feas - .thenCombine(post, (v, t) -> t) - .thenCombine(sargs, (v, t) -> t) - .thenCombine(start, (v, t) -> t); - } - - public static V noDupMerge(V first, V second) { - throw new AssertionError(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelSelectableObject.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelSelectableObject.java deleted file mode 100644 index 1cee498889..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelSelectableObject.java +++ /dev/null @@ -1,30 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.impl; - -import java.util.concurrent.CompletableFuture; - -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; - -@TargetObjectSchemaInfo( - name = "Selectable", - attributes = { - @TargetAttributeType(type = Void.class) }) -interface GdbModelSelectableObject extends TargetObject { - CompletableFuture setActive(); -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetAttachable.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetAttachable.java deleted file mode 100644 index 378aab729b..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetAttachable.java +++ /dev/null @@ -1,87 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.impl; - -import java.util.List; -import java.util.Map; - -import agent.gdb.manager.GdbProcessThreadGroup; -import ghidra.dbg.agent.DefaultTargetObject; -import ghidra.dbg.target.TargetAttachable; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.util.PathUtils; - -@TargetObjectSchemaInfo(name = "Attachable", elements = { - @TargetElementType(type = Void.class) }, attributes = { - @TargetAttributeType(type = Void.class) }) -public class GdbModelTargetAttachable - extends DefaultTargetObject - implements TargetAttachable { - - public static final String PID_ATTRIBUTE_NAME = PREFIX_INVISIBLE + "pid"; - // TODO: DESCRIPTION, TYPE, USER? - - protected static String indexAttachable(GdbProcessThreadGroup process) { - return PathUtils.makeIndex(process.getPid()); - } - - protected static String keyAttachable(GdbProcessThreadGroup process) { - return PathUtils.makeKey(indexAttachable(process)); - } - - protected static String computeDisplay(GdbProcessThreadGroup process, Integer base) { - if (base == 16) { - return String.format("0x%x %s", process.getPid(), process.getDescription()); - } - return String.format("%d %s", process.getPid(), process.getDescription()); - } - - private GdbProcessThreadGroup process; - protected long pid; - protected String display; - - public GdbModelTargetAttachable(GdbModelImpl impl, GdbModelTargetAvailableContainer parent, - GdbProcessThreadGroup process) { - super(impl, parent, keyAttachable(process), "Attachable"); - this.process = process; - this.pid = process.getPid(); - this.display = computeDisplay(process, 10); - - this.changeAttributes(List.of(), List.of(), Map.of( // - PID_ATTRIBUTE_NAME, pid, // - DISPLAY_ATTRIBUTE_NAME, display // - ), "Initialized"); - } - - @TargetAttributeType(name = PID_ATTRIBUTE_NAME, hidden = true) - public long getPid() { - return pid; - } - - @Override - public String getDisplay() { - return display; - } - - public void setBase(Object value) { - this.display = computeDisplay(process, (Integer) value); - this.changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, display // - ), "Initialized"); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetAvailableContainer.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetAvailableContainer.java deleted file mode 100644 index b0d3e59b26..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetAvailableContainer.java +++ /dev/null @@ -1,92 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import agent.gdb.manager.GdbProcessThreadGroup; -import ghidra.async.AsyncUtils; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.agent.DefaultTargetObject; -import ghidra.dbg.error.DebuggerIllegalArgumentException; -import ghidra.dbg.target.TargetConfigurable; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; -import ghidra.util.datastruct.WeakValueHashMap; - -@TargetObjectSchemaInfo(name = "AvailableContainer", elementResync = ResyncMode.ALWAYS, attributes = { - @TargetAttributeType(name = TargetConfigurable.BASE_ATTRIBUTE_NAME, type = Integer.class), // - @TargetAttributeType(type = Void.class) // -}, canonicalContainer = true) -public class GdbModelTargetAvailableContainer - extends DefaultTargetObject - implements TargetConfigurable { - public static final String NAME = "Available"; - - protected final GdbModelImpl impl; - - protected final Map attachablesById = - new WeakValueHashMap<>(); - - public GdbModelTargetAvailableContainer(GdbModelTargetSession session) { - super(session.impl, session, NAME, "AvailableContainer"); - this.impl = session.impl; - this.changeAttributes(List.of(), Map.of(BASE_ATTRIBUTE_NAME, 10), "Initialized"); - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - return impl.gdb.listAvailableProcesses().thenAccept(list -> { - List available; - synchronized (this) { - // NOTE: If more details added to entries, should clear attachablesById - available = - list.stream().map(this::getTargetAttachable).collect(Collectors.toList()); - } - setElements(available, "Refreshed"); - }); - } - - protected synchronized GdbModelTargetAttachable getTargetAttachable( - GdbProcessThreadGroup process) { - return attachablesById.computeIfAbsent(process.getPid(), - i -> new GdbModelTargetAttachable(impl, this, process)); - } - - @Override - public CompletableFuture writeConfigurationOption(String key, Object value) { - switch (key) { - case BASE_ATTRIBUTE_NAME: - if (value instanceof Integer) { - this.changeAttributes(List.of(), Map.of(BASE_ATTRIBUTE_NAME, value), - "Modified"); - for (GdbModelTargetAttachable child : this.getCachedElements().values()) { - child.setBase(value); - } - } - else { - throw new DebuggerIllegalArgumentException("Base should be numeric"); - } - default: - } - return AsyncUtils.nil(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetBreakpointContainer.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetBreakpointContainer.java deleted file mode 100644 index 59a821313a..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetBreakpointContainer.java +++ /dev/null @@ -1,194 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.impl; - -import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.function.Function; -import java.util.stream.Collectors; - -import agent.gdb.manager.GdbCause; -import agent.gdb.manager.GdbEventsListenerAdapter; -import agent.gdb.manager.breakpoint.GdbBreakpointInfo; -import agent.gdb.manager.breakpoint.GdbBreakpointType; -import agent.gdb.manager.impl.cmd.GdbStateChangeRecord; -import ghidra.async.AsyncFence; -import ghidra.async.AsyncUtils; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.agent.DefaultTargetObject; -import ghidra.dbg.target.TargetBreakpointSpec.TargetBreakpointKind; -import ghidra.dbg.target.TargetBreakpointSpecContainer; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; -import ghidra.program.model.address.AddressRange; -import ghidra.util.Msg; -import ghidra.util.datastruct.WeakValueHashMap; - -@TargetObjectSchemaInfo( - name = "BreakpointContainer", - attributes = { - @TargetAttributeType(type = Void.class) }, - canonicalContainer = true) -public class GdbModelTargetBreakpointContainer - extends DefaultTargetObject - implements TargetBreakpointSpecContainer, GdbEventsListenerAdapter { - public static final String NAME = "Breakpoints"; - - protected static final TargetBreakpointKindSet SUPPORTED_KINDS = - TargetBreakpointKindSet.of(TargetBreakpointKind.values()); - - protected final GdbModelImpl impl; - - protected final Map specsByNumber = - new WeakValueHashMap<>(); - - public GdbModelTargetBreakpointContainer(GdbModelTargetSession session) { - super(session.impl, session, NAME, "BreakpointContainer"); - this.impl = session.impl; - - impl.gdb.addEventsListener(this); - - changeAttributes(List.of(), Map.of( // - // TODO: Seems terrible to duplicate this static attribute on each instance - SUPPORTED_BREAK_KINDS_ATTRIBUTE_NAME, SUPPORTED_KINDS // - ), "Initialized"); - } - - @Override - public void breakpointCreated(GdbBreakpointInfo info, GdbCause cause) { - GdbModelTargetBreakpointSpec spec = getTargetBreakpointSpec(info); - spec.init().thenRun(() -> { - changeElements(List.of(), List.of(spec), "Created"); - }).exceptionally(ex -> { - model.reportError(this, "Could not update created breakpoint", ex); - return null; - }); - } - - @Override - public void breakpointModified(GdbBreakpointInfo newInfo, GdbBreakpointInfo oldInfo, - GdbCause cause) { - GdbModelTargetBreakpointSpec spec = getTargetBreakpointSpec(oldInfo); - spec.updateInfo(oldInfo, newInfo, "Modified").exceptionally(ex -> { - model.reportError(this, "Could not updated modified breakpoint", ex); - return null; - }); - } - - protected GdbModelTargetBreakpointLocation breakpointHit(long bpId, - GdbModelTargetStackFrame frame) { - GdbModelTargetBreakpointSpec spec = getTargetBreakpointSpecIfPresent(bpId); - if (spec == null) { - Msg.error(this, "Stopped for breakpoint unknown to the agent: " + bpId + " (pc=" + - frame.getProgramCounter() + ")"); - return null; - } - - GdbModelTargetBreakpointLocation loc = spec.findLocation(frame); - if (loc == null) { - Msg.warn(this, "Stopped for a breakpoint whose location is unknown to the agent: " + - spec + " (pc=" + frame.getProgramCounter() + ")"); - //return; // Not ideal, but eb == null should be fine, since the spec holds the actions - } - broadcast().breakpointHit(this, frame.thread, frame, spec, loc); - spec.breakpointHit(frame, loc); - return loc; - } - - @Override - public void breakpointDeleted(GdbBreakpointInfo info, GdbCause cause) { - synchronized (this) { - specsByNumber.remove(info.getNumber()); - } - changeElements(List.of(GdbModelTargetBreakpointSpec.indexBreakpoint(info)), List.of(), - "Deleted"); - } - - protected CompletableFuture doPlaceBreakpoint(Set kinds, - Function> placer) { - AsyncFence fence = new AsyncFence(); - if (kinds.contains(TargetBreakpointKind.READ) && - kinds.contains(TargetBreakpointKind.WRITE)) { - fence.include(placer.apply(GdbBreakpointType.ACCESS_WATCHPOINT)); - } - else if (kinds.contains(TargetBreakpointKind.READ)) { - fence.include(placer.apply(GdbBreakpointType.READ_WATCHPOINT)); - } - else if (kinds.contains(TargetBreakpointKind.WRITE)) { - fence.include(placer.apply(GdbBreakpointType.HW_WATCHPOINT)); - } - if (kinds.contains(TargetBreakpointKind.HW_EXECUTE)) { - fence.include(placer.apply(GdbBreakpointType.HW_BREAKPOINT)); - } - if (kinds.contains(TargetBreakpointKind.SW_EXECUTE)) { - fence.include(placer.apply(GdbBreakpointType.BREAKPOINT)); - } - return impl.gateFuture(fence.ready().exceptionally(GdbModelImpl::translateEx)); - } - - @Override - public CompletableFuture placeBreakpoint(String expression, - Set kinds) { - return doPlaceBreakpoint(kinds, t -> impl.gdb.insertBreakpoint(expression, t)); - } - - @Override - public CompletableFuture placeBreakpoint(AddressRange range, - Set kinds) { - long offset = range.getMinAddress().getOffset(); - int len = (int) range.getLength(); - return doPlaceBreakpoint(kinds, t -> impl.gdb.insertBreakpoint(offset, len, t)); - } - - public synchronized GdbModelTargetBreakpointSpec getTargetBreakpointSpec( - GdbBreakpointInfo info) { - return specsByNumber.computeIfAbsent(info.getNumber(), - i -> new GdbModelTargetBreakpointSpec(this, info)); - } - - public synchronized GdbModelTargetBreakpointSpec getTargetBreakpointSpecIfPresent(long number) { - return specsByNumber.get(number); - } - - protected CompletableFuture updateUsingBreakpoints( - Map byNumber) { - List specs; - synchronized (this) { - specs = byNumber.values() - .stream() - .map(this::getTargetBreakpointSpec) - .collect(Collectors.toList()); - } - return CompletableFuture - .allOf(specs.stream().map(s -> s.init()).toArray(CompletableFuture[]::new)) - .thenRun(() -> { - setElements(specs, "Refreshed"); - }); - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - if (!refresh.equals(RefreshBehavior.REFRESH_ALWAYS)) { - return updateUsingBreakpoints(impl.gdb.getKnownBreakpoints()); - } - return impl.gdb.listBreakpoints().thenCompose(this::updateUsingBreakpoints); - } - - public CompletableFuture stateChanged(GdbStateChangeRecord sco) { - // NB. This container should be updated via GDB's events. - return AsyncUtils.nil(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetBreakpointLocation.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetBreakpointLocation.java deleted file mode 100644 index 320fabd56a..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetBreakpointLocation.java +++ /dev/null @@ -1,186 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.function.Function; - -import agent.gdb.manager.breakpoint.GdbBreakpointLocation; -import agent.gdb.manager.parsing.GdbCValueParser; -import agent.gdb.manager.parsing.GdbParsingUtils.GdbParseError; -import generic.Unique; -import ghidra.async.AsyncUtils; -import ghidra.dbg.agent.DefaultTargetObject; -import ghidra.dbg.target.TargetBreakpointLocation; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.util.PathUtils; -import ghidra.program.model.address.*; -import ghidra.util.Msg; - -@TargetObjectSchemaInfo( - name = "BreakpointLocation", - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType(type = Void.class) }) -public class GdbModelTargetBreakpointLocation - extends DefaultTargetObject - implements TargetBreakpointLocation { - - /** prefix used in GDB's watchpoint specs for static locations */ - protected static final String LOC_PREFIX = "-location"; - - protected static String indexLocation(GdbBreakpointLocation loc) { - return PathUtils.makeIndex(loc.getSub()); - } - - protected static String keyLocation(GdbBreakpointLocation loc) { - return PathUtils.makeKey(indexLocation(loc)); - } - - protected final GdbModelImpl impl; - protected final GdbBreakpointLocation loc; - - protected AddressRange range; - protected String display; - - public GdbModelTargetBreakpointLocation(GdbModelTargetBreakpointSpec spec, - GdbBreakpointLocation loc) { - super(spec.impl, spec, keyLocation(loc), "BreakpointLocation"); - this.impl = spec.impl; - this.loc = loc; - impl.addModelObject(loc, this); - - if (!spec.info.getType().isWatchpoint()) { - Address addr = impl.space.getAddress(loc.addrAsLong()); - this.range = new AddressRangeImpl(addr, addr); - doChangeAttributes("Initialized"); - } - } - - protected void doChangeAttributes(String reason) { - this.changeAttributes(List.of(), Map.of( - SPEC_ATTRIBUTE_NAME, parent, - RANGE_ATTRIBUTE_NAME, range, - DISPLAY_ATTRIBUTE_NAME, display = computeDisplay()), - reason); - placeLocations(); - } - - /** - * Initialize watchpoint attributes via expression evaluation - * - *

- * This has to be async because it involves interacting with GDB. GDB does not give the address - * or location information for location-specified watchpoints. Instead we take the expression - * and ask GDB to evaluate its address and size. - * - * @return a future which completes when the (watchpoint) location has been initialized. - */ - protected CompletableFuture initWpt() { - assert loc.getAddr() == null; - String what = parent.info.getWhat(); - String exp = what.startsWith(LOC_PREFIX) ? what.substring(LOC_PREFIX.length()) : what; - int iid = Unique.assertOne(loc.getInferiorIds()); - GdbModelTargetInferior inf = impl.session.inferiors.getTargetInferior(iid); - String addrSizeExp = String.format("{(long long)&(%s), (long long)sizeof(%s)}", exp, exp); - return inf.inferior.evaluate(addrSizeExp).thenApply(result -> { - List vals; - try { - vals = GdbCValueParser.parseArray(result).expectLongs(); - } - catch (GdbParseError e) { - throw new AssertionError("Unexpected result type: " + result, e); - } - if (vals.size() != 2) { - throw new AssertionError("Unexpected result count: " + result); - } - - range = makeRange(impl.space.getAddress(vals.get(0)), vals.get(1).intValue()); - doChangeAttributes("Initialized"); - return AsyncUtils.nil(Void.class); - }).exceptionally(ex -> { - CompletableFuture secondTry = - inf.inferior.evaluate(String.format("(long long)&(%s)", exp)); - return secondTry.thenAccept(result -> { - long addr; - try { - addr = GdbCValueParser.parseValue(result).expectLong(); - } - catch (GdbParseError e) { - throw new AssertionError("Unexpected result type: " + result, e); - } - range = makeRange(impl.space.getAddress(addr), 1); - doChangeAttributes("Initialized, but defaulted length=1"); - }).exceptionally(ex2 -> { - Msg.warn(this, - "Could not evaluated breakpoint location and/or size: " + ex2); - Address addr = impl.space.getAddress(0); - range = new AddressRangeImpl(addr, addr); - doChangeAttributes("Defaulted for eval/parse error"); - return null; - }); - }).thenCompose(Function.identity()); - } - - protected String computeDisplay() { - return String.format("%d.%d %s", parent.info.getNumber(), loc.getSub(), - range.getMinAddress()); - } - - // Avoid the checked exception on new AddressRangeImpl(min, length) - protected static AddressRange makeRange(Address min, int length) { - Address max = min.add(length - 1); - return new AddressRangeImpl(min, max); - } - - protected void placeLocations() { - for (GdbModelTargetInferior inf : impl.session.inferiors.getCachedElements().values()) { - if (loc.getInferiorIds().contains(inf.inferior.getId())) { - inf.addBreakpointLocation(this); - } - else { - inf.removeBreakpointLocation(this); - } - } - } - - @Override - protected void doInvalidate(TargetObject branch, String reason) { - removeLocations(); - super.doInvalidate(branch, reason); - } - - protected void removeLocations() { - // TODO: Shouldn't the framework do this for us? The location is invalidated. - for (GdbModelTargetInferior inf : impl.session.inferiors.getCachedElements().values()) { - inf.removeBreakpointLocation(this); - } - } - - @Override - public AddressRange getRange() { - return range; - } - - @Override - public GdbModelTargetBreakpointSpec getSpecification() { - return parent; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetBreakpointLocationContainer.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetBreakpointLocationContainer.java deleted file mode 100644 index 355df02564..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetBreakpointLocationContainer.java +++ /dev/null @@ -1,55 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.impl; - -import java.util.List; -import java.util.Map; - -import ghidra.dbg.agent.DefaultTargetObject; -import ghidra.dbg.target.TargetBreakpointLocationContainer; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; - -/** - * This is a container of links only, as a way to encode "affects" within the model - */ -@TargetObjectSchemaInfo( - name = "BreakpointLocationContainer", - canonicalContainer = true, - attributes = { - @TargetAttributeType(type = Void.class) - }) -public class GdbModelTargetBreakpointLocationContainer - extends DefaultTargetObject - implements TargetBreakpointLocationContainer { - public static final String NAME = "Breakpoints"; - - protected static String indexLoc(GdbModelTargetBreakpointLocation loc) { - return loc.getSpecification().getIndex() + "," + loc.getIndex(); - } - - public GdbModelTargetBreakpointLocationContainer(GdbModelTargetInferior inferior) { - super(inferior.impl, inferior, NAME, "BreakpointLocationContainer"); - } - - public void addBreakpointLocation(GdbModelTargetBreakpointLocation loc) { - changeElements(List.of(), Map.of(indexLoc(loc), loc), "Added"); - } - - public void removeBreakpointLocation(GdbModelTargetBreakpointLocation loc) { - changeElements(List.of(indexLoc(loc)), Map.of(), "Removed"); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetBreakpointSpec.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetBreakpointSpec.java deleted file mode 100644 index 8aba8a6e35..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetBreakpointSpec.java +++ /dev/null @@ -1,292 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import agent.gdb.manager.breakpoint.*; -import ghidra.async.AsyncUtils; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.agent.DefaultTargetObject; -import ghidra.dbg.target.TargetBreakpointSpec; -import ghidra.dbg.target.TargetBreakpointSpecContainer.TargetBreakpointKindSet; -import ghidra.dbg.target.TargetDeletable; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; -import ghidra.dbg.util.PathUtils; -import ghidra.util.Msg; -import ghidra.util.datastruct.ListenerSet; -import ghidra.util.datastruct.WeakValueHashMap; - -@TargetObjectSchemaInfo(name = "BreakpointSpec", attributes = { - @TargetAttributeType(type = Void.class) }, canonicalContainer = true) -public class GdbModelTargetBreakpointSpec extends - DefaultTargetObject - implements TargetBreakpointSpec, TargetDeletable { - - protected static String indexBreakpoint(GdbBreakpointInfo info) { - return PathUtils.makeIndex(info.getNumber()); - } - - protected static String keyBreakpoint(GdbBreakpointInfo info) { - return PathUtils.makeKey(indexBreakpoint(info)); - } - - protected final GdbModelImpl impl; - protected final long number; - protected GdbBreakpointInfo info; - protected boolean enabled; - protected String expression; - protected String display; - protected TargetBreakpointKindSet kinds; - - protected final Map breaksBySub = - new WeakValueHashMap<>(); - protected final ListenerSet actions = - new ListenerSet<>(TargetBreakpointAction.class, false); - - public GdbModelTargetBreakpointSpec(GdbModelTargetBreakpointContainer breakpoints, - GdbBreakpointInfo info) { - super(breakpoints.impl, breakpoints, keyBreakpoint(info), "BreakpointSpec"); - this.impl = breakpoints.impl; - this.number = info.getNumber(); - this.info = info; - impl.addModelObject(info, this); - - changeAttributes(List.of(), Map.of(CONTAINER_ATTRIBUTE_NAME, breakpoints), "Initialized"); - } - - protected CompletableFuture init() { - return updateInfo(info, info, "Created").exceptionally(ex -> { - Msg.info(this, "Initial breakpoint info update failed", ex); - return null; - }); - } - - @Override - public CompletableFuture delete() { - return impl.gateFuture(impl.gdb.deleteBreakpoints(number)); - } - - @Override - public boolean isEnabled() { - return enabled; - } - - @Override - public String getExpression() { - return expression; - } - - protected TargetBreakpointKindSet computeKinds(GdbBreakpointInfo from) { - switch (from.getType()) { - case BREAKPOINT: - return TargetBreakpointKindSet.of(TargetBreakpointKind.SW_EXECUTE); - case HW_BREAKPOINT: - return TargetBreakpointKindSet.of(TargetBreakpointKind.HW_EXECUTE); - case HW_WATCHPOINT: - return TargetBreakpointKindSet.of(TargetBreakpointKind.WRITE); - case READ_WATCHPOINT: - return TargetBreakpointKindSet.of(TargetBreakpointKind.READ); - case ACCESS_WATCHPOINT: - return TargetBreakpointKindSet.of(TargetBreakpointKind.READ, - TargetBreakpointKind.WRITE); - default: - return TargetBreakpointKindSet.of(); - } - } - - @Override - public TargetBreakpointKindSet getKinds() { - return kinds; - } - - @Override - public void addAction(TargetBreakpointAction action) { - actions.add(action); - } - - @Override - public void removeAction(TargetBreakpointAction action) { - actions.remove(action); - } - - protected CompletableFuture getInfo(RefreshBehavior refresh) { - if (!refresh.equals(RefreshBehavior.REFRESH_ALWAYS)) { - return CompletableFuture.completedFuture(impl.gdb.getKnownBreakpoints().get(number)); - } - return impl.gdb.listBreakpoints() - .thenApply(__ -> impl.gdb.getKnownBreakpoints().get(number)); - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - return getInfo(refresh).thenCompose(i -> { - return updateInfo(info, i, "Refreshed"); - }); - } - - @Override - public CompletableFuture disable() { - return impl.gateFuture(impl.gdb.disableBreakpoints(number)); - } - - @Override - public CompletableFuture enable() { - return impl.gateFuture(impl.gdb.enableBreakpoints(number)); - } - - protected CompletableFuture updateInfo(GdbBreakpointInfo oldInfo, - GdbBreakpointInfo newInfo, String reason) { - if (newInfo.getType().isWatchpoint()) { - return updateWptInfo(oldInfo, newInfo, reason); - } - else { - return updateBktpInfo(oldInfo, newInfo, reason); - } - } - - protected void updateAttributesFromInfo(String reason) { - changeAttributes(List.of(), - Map.of(ENABLED_ATTRIBUTE_NAME, enabled = info.isEnabled(), EXPRESSION_ATTRIBUTE_NAME, - expression = info.getType() == GdbBreakpointType.CATCHPOINT ? info.getCatchType() - : info.getOriginalLocation(), - KINDS_ATTRIBUTE_NAME, kinds = computeKinds(info), DISPLAY_ATTRIBUTE_NAME, - display = computeDisplay()), - reason); - } - - protected synchronized List setInfoAndComputeLocations( - GdbBreakpointInfo oldInfo, GdbBreakpointInfo newInfo) { - if (oldInfo != this.info) { - Msg.error(this, "Manager and model breakpoint info was/is out of sync!"); - } - this.info = newInfo; - List effectives = newInfo.getLocations() - .stream() - .filter(l -> !"".equals(l.getAddr())) - .map(this::getTargetBreakpointLocation) - .collect(Collectors.toList()); - breaksBySub.keySet() - .retainAll( - effectives.stream().map(e -> e.loc.getSub()).collect(Collectors.toSet())); - return effectives; - } - - protected CompletableFuture updateBktpInfo(GdbBreakpointInfo oldInfo, - GdbBreakpointInfo newInfo, String reason) { - List locs = setInfoAndComputeLocations(oldInfo, newInfo); - updateAttributesFromInfo(reason); - setElements(locs, reason); - return AsyncUtils.nil(); - } - - protected CompletableFuture updateWptInfo(GdbBreakpointInfo oldInfo, - GdbBreakpointInfo newInfo, String reason) { - List locs = setInfoAndComputeLocations(oldInfo, newInfo); - updateAttributesFromInfo(reason); - assert locs.size() == 1; - return locs.get(0).initWpt().thenAccept(__ -> { - setElements(locs, reason); - }); - } - - protected GdbModelTargetBreakpointLocation findLocation(GdbModelTargetStackFrame frame) { - for (GdbModelTargetBreakpointLocation bp : breaksBySub.values()) { - // TODO: Is this necessary? - /*if (bp.range.contains(frame.pc)) { - continue; - }*/ - if (!bp.loc.getInferiorIds().contains(frame.inferior.inferior.getId())) { - continue; - } - return bp; - } - return null; - } - - protected void breakpointHit(GdbModelTargetStackFrame frame, - GdbModelTargetBreakpointLocation eb) { - actions.invoke().breakpointHit(this, frame.thread, frame, eb); - } - - public synchronized GdbModelTargetBreakpointLocation getTargetBreakpointLocation( - GdbBreakpointLocation loc) { - return breaksBySub.computeIfAbsent(loc.getSub(), - i -> new GdbModelTargetBreakpointLocation(this, loc)); - } - - protected String addressFromInfo() { - if (info.getAddress() != null) { - return info.getAddress(); - } - List locs = info.getLocations(); - if (locs.isEmpty()) { - return ""; - } - if (locs.size() == 1) { - String addr = locs.get(0).getAddr(); - if (addr == null) { - return ""; - } - return addr; - } - return ""; - } - - protected String computeDisplay() { - Object enb = info.isEnabled() ? "y" : "n"; - String addr = addressFromInfo(); - String what = info.getWhat() == null ? "" : info.getWhat(); - switch (info.getType()) { - case ACCESS_WATCHPOINT: - case HW_WATCHPOINT: - case READ_WATCHPOINT: - case BREAKPOINT: - case HW_BREAKPOINT: - case OTHER: - return String - .format("%d %s %s %s %s %s", info.getNumber(), info.getTypeName(), - info.getDisp(), enb, addr, what) - .trim(); - case CATCHPOINT: - return String - .format("%d %s %s %s %s", info.getNumber(), info.getTypeName(), - info.getDisp(), enb, what) - .trim(); - case DPRINTF: - // TODO: script? - return String - .format("%d %s %s %s %s %s", info.getNumber(), info.getTypeName(), - info.getDisp(), enb, addr, what) - .trim(); - } - throw new AssertionError(); - } - - @Override - public String getDisplay() { - return display; - } - - @Override - public GdbModelTargetBreakpointContainer getContainer() { - return parent; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetEnvironment.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetEnvironment.java deleted file mode 100644 index dc9f0fd6ed..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetEnvironment.java +++ /dev/null @@ -1,217 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import agent.gdb.manager.impl.cmd.GdbConsoleExecCommand.CompletesWithRunning; -import ghidra.async.AsyncFence; -import ghidra.dbg.agent.DefaultTargetObject; -import ghidra.dbg.target.TargetEnvironment; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "Environment", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(type = Void.class) - }) -public class GdbModelTargetEnvironment - extends DefaultTargetObject - implements TargetEnvironment { - public static final String NAME = "Environment"; - - public static final String VISIBLE_ARCH_ATTRIBUTE_NAME = "arch"; - public static final String VISIBLE_OS_ATTRIBUTE_NAME = "os"; - public static final String VISIBLE_ENDIAN_ATTRIBUTE_NAME = "endian"; - - protected final GdbModelImpl impl; - - protected String arch = "(unknown)"; - protected String os = "(unknown)"; - protected String endian = "(unknown)"; - - public GdbModelTargetEnvironment(GdbModelTargetInferior inferior) { - super(inferior.impl, inferior, NAME, "Environment"); - this.impl = inferior.impl; - - changeAttributes(List.of(), Map.of( - DEBUGGER_ATTRIBUTE_NAME, impl.session.debugger, - ARCH_ATTRIBUTE_NAME, arch, - OS_ATTRIBUTE_NAME, os, - ENDIAN_ATTRIBUTE_NAME, endian, - VISIBLE_ARCH_ATTRIBUTE_NAME, arch, - VISIBLE_OS_ATTRIBUTE_NAME, os, - VISIBLE_ENDIAN_ATTRIBUTE_NAME, endian), - "Initialized"); - refreshInternal(); - } - - protected CompletableFuture refreshArchitecture() { - /** - * GDB/MI is less informative than I'd like here. If the architecture is unset (i.e., - * "auto"), then using -gdb-show architecture gives no fields at all. If the user sets it to - * "auto", then it just says value="auto". Useless. The same issue applies to the - * =cmd-param-changed event. The console, while not readily machine consumable, provides the - * information I need. Unfortunately, when the "auto" architecture changes, there is no - * notification. The best I can do is refresh when an inferior is started. In 8.0, the auto - * architecture is actually updated on "file", but it doesn't really matter until the target - * is running, anyway. - */ - /** - * TODO: This assumes the relevant inferior is the current one, or that the current - * inferior's environment is the same as the one starting, which I think is Good Enough. - * Attempting to switch inferiors while something is starting is a no-go, anyway. If there - * is a known thread -- unlikely for an inferior that is just starting -- we could use the - * --thread parameter. - */ - return CompletableFuture.supplyAsync(() -> null).thenCompose(__ -> { - return impl.gdb.consoleCapture("show architecture", CompletesWithRunning.CANNOT); - }).thenAccept(out -> { - String[] tokens = out.split("\\s+"); - String arch = tokens[tokens.length - 1].trim(); - while (arch.endsWith(".") || arch.endsWith(")") || arch.endsWith("\"")) { - arch = arch.substring(0, arch.length() - 1); - } - while (arch.startsWith("\"")) { - arch = arch.substring(1); - } - // e.g., The target architecture is set automatically (currently i386) - // e.g., The target architecture is assumed to be i386 - // e.g., The target architecture is set to "auto" (currently "i386"). - // TODO: I don't have a way to detect if this parsing strategy fails. - // TODO: I could search using a list of support architectures - // Use "set architecture" to get "Valid arguments" - // But, that may also be (perhaps more) version dependent - this.arch = arch; - }).exceptionally(e -> { - model.reportError(this, "Could not get target architecture", e); - return null; - }); - } - - protected CompletableFuture refreshOS() { - /** - * GDB/MI is similarly un-informative when os is "auto". See comments in - * refreshArchitecture. - */ - /** - * TODO: Ditto the "current inferior" issue as refreshArchitecture - */ - return CompletableFuture.supplyAsync(() -> null).thenCompose(__ -> { - return impl.gdb.consoleCapture("show os", CompletesWithRunning.CANNOT); - }).thenAccept(out -> { - String[] tokens = out.split("\n")[0].split("\\s+"); - String os = tokens[tokens.length - 1].trim(); - if (os.endsWith(".")) { - os = os.substring(0, os.length() - 1); - } - if (os.endsWith(")")) { - os = os.substring(0, os.length() - 1); - } - if (os.startsWith("\"") && os.endsWith("\"")) { - os = os.substring(1, os.length() - 1); - } - // e.g., The current OS ABI is "auto" (currently "GNU/Linux"). - // ... The default OS ABI is "GNU/Linux". - // e.g., The current OS ABI is "GNU/Linux". - // TODO: I don't have a way to detect if this parsing strategy fails. - // TODO: Use "set os" to get "Valid arguments"? - // Would need to ignore "auto", "default", and "none"? - this.os = os; - }).exceptionally(e -> { - model.reportError(this, "Could not get target os", e); - return null; - }); - } - - protected CompletableFuture refreshEndian() { - // TODO: This duplicates GdbInferiorImpl.syncEndianness.... - return CompletableFuture.supplyAsync(() -> null).thenCompose(__ -> { - return impl.gdb.consoleCapture("show endian", CompletesWithRunning.CANNOT); - }).thenAccept(out -> { - if (out.toLowerCase().contains("little endian")) { - endian = "little"; - } - else if (out.toLowerCase().contains("big endian")) { - endian = "big"; - } - else { - endian = "(unknown)"; - } - }).exceptionally(e -> { - model.reportError(this, "Could not get target endian", e); - return null; - }); - } - - protected CompletableFuture refreshInternal() { - AsyncFence fence = new AsyncFence(); - fence.include(refreshArchitecture()); - fence.include(refreshOS()); - fence.include(refreshEndian()); - return fence.ready().thenAccept(__ -> { - changeAttributes(List.of(), Map.of( - ARCH_ATTRIBUTE_NAME, arch, - OS_ATTRIBUTE_NAME, os, - ENDIAN_ATTRIBUTE_NAME, endian, - VISIBLE_ARCH_ATTRIBUTE_NAME, arch, - VISIBLE_OS_ATTRIBUTE_NAME, os, - VISIBLE_ENDIAN_ATTRIBUTE_NAME, endian // - ), "Refreshed"); - }); - } - - @TargetAttributeType(name = VISIBLE_ARCH_ATTRIBUTE_NAME) - public String getVisibleArch() { - return arch; - } - - @TargetAttributeType(name = VISIBLE_OS_ATTRIBUTE_NAME) - public String getVisibleOs() { - return os; - } - - @TargetAttributeType(name = VISIBLE_ENDIAN_ATTRIBUTE_NAME) - public String getVisibleEndian() { - return endian; - } - - @Override - public String getDebugger() { - return impl.session.debugger; - } - - @Override - public String getArchitecture() { - return arch; - } - - @Override - public String getOperatingSystem() { - return os; - } - - @Override - public String getEndian() { - return endian; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetInferior.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetInferior.java deleted file mode 100644 index 8501a1b3ff..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetInferior.java +++ /dev/null @@ -1,480 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.impl; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import agent.gdb.manager.*; -import agent.gdb.manager.impl.cmd.GdbStateChangeRecord; -import agent.gdb.manager.reason.*; -import ghidra.async.AsyncFence; -import ghidra.dbg.agent.DefaultTargetObject; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetEventScope.TargetEventType; -import ghidra.dbg.target.TargetMethod.ParameterDescription; -import ghidra.dbg.target.TargetMethod.TargetParameterMap; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.util.PathUtils; -import ghidra.lifecycle.Internal; - -@TargetObjectSchemaInfo( - name = "Inferior", - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType(type = Void.class) }) -public class GdbModelTargetInferior - extends DefaultTargetObject - implements TargetProcess, TargetAggregate, TargetExecutionStateful, TargetAttacher, - TargetDeletable, TargetDetachable, TargetKillable, TargetLauncher, TargetResumable, - TargetSteppable, TargetInterruptible, GdbModelSelectableObject { - - public static final String EXIT_CODE_ATTRIBUTE_NAME = PREFIX_INVISIBLE + "exit_code"; - - public static final ParameterDescription PARAMETER_STARTI = - ParameterDescription.create(Boolean.class, "starti", false, false, - "Break on first instruction (use starti)", - "true to use starti, false to use start. Requires GDB 8.1 or later."); - - public static final TargetParameterMap PARAMETERS = - TargetMethod.makeParameters(TargetCmdLineLauncher.PARAMETER_CMDLINE_ARGS, PARAMETER_STARTI); - - protected static final TargetAttachKindSet SUPPORTED_KINDS = TargetAttachKindSet.of( // - TargetAttachKind.BY_OBJECT_REF, TargetAttachKind.BY_ID); - - protected static String indexInferior(int inferiorId) { - return PathUtils.makeIndex(inferiorId); - } - - protected static String indexInferior(GdbInferior inferior) { - return indexInferior(inferior.getId()); - } - - protected static String keyInferior(GdbInferior inferior) { - return PathUtils.makeKey(indexInferior(inferior)); - } - - protected final GdbModelImpl impl; - protected final GdbInferior inferior; - - protected String display; - protected TargetExecutionState state; - /** - * When state=INACTIVE/TERMINATED, and we're waiting on a refresh, this keep the "real" state, - * which is the last state actually reported by *running or *stopped. - */ - protected TargetExecutionState realState; - - protected final GdbModelTargetEnvironment environment; - protected final GdbModelTargetProcessMemory memory; - protected final GdbModelTargetModuleContainer modules; - //protected final GdbModelTargetRegisterContainer registers; - protected final GdbModelTargetThreadContainer threads; - protected final GdbModelTargetBreakpointLocationContainer breakpoints; - - protected Long exitCode; - private Integer base = 10; - - public GdbModelTargetInferior(GdbModelTargetInferiorContainer inferiors, GdbInferior inferior) { - super(inferiors.impl, inferiors, keyInferior(inferior), "Inferior"); - this.impl = inferiors.impl; - this.inferior = inferior; - impl.addModelObject(inferior, this); - impl.addModelObject(inferior.getId(), this); - - this.environment = new GdbModelTargetEnvironment(this); - this.memory = new GdbModelTargetProcessMemory(this); - this.modules = new GdbModelTargetModuleContainer(this); - //this.registers = new GdbModelTargetRegisterContainer(this); - this.threads = new GdbModelTargetThreadContainer(this); - this.breakpoints = new GdbModelTargetBreakpointLocationContainer(this); - - this.realState = - inferior.getPid() == null ? TargetExecutionState.INACTIVE : TargetExecutionState.ALIVE; - - changeAttributes(List.of(), // - List.of( // - environment, // - memory, // - modules, // - //registers, // - threads, // - breakpoints), // - Map.of( // - STATE_ATTRIBUTE_NAME, state = realState, // - DISPLAY_ATTRIBUTE_NAME, updateDisplay(), // - TargetMethod.PARAMETERS_ATTRIBUTE_NAME, PARAMETERS, // - SUPPORTED_ATTACH_KINDS_ATTRIBUTE_NAME, SUPPORTED_KINDS, // - SUPPORTED_STEP_KINDS_ATTRIBUTE_NAME, GdbModelTargetThread.SUPPORTED_KINDS), // - "Initialized"); - } - - protected TargetParameterMap computeParams() { - return TargetMethod.makeParameters( - TargetCmdLineLauncher.PARAMETER_CMDLINE_ARGS, - PARAMETER_STARTI); - } - - @Override - public TargetParameterMap getParameters() { - return PARAMETERS; - } - - @TargetAttributeType(name = GdbModelTargetEnvironment.NAME, required = true, fixed = true) - public GdbModelTargetEnvironment getEnvironment() { - return environment; - } - - @TargetAttributeType(name = GdbModelTargetProcessMemory.NAME, required = true, fixed = true) - public GdbModelTargetProcessMemory getMemory() { - return memory; - } - - @TargetAttributeType(name = GdbModelTargetModuleContainer.NAME, required = true, fixed = true) - public GdbModelTargetModuleContainer getModules() { - return modules; - } - - /* - @TargetAttributeType(name = GdbModelTargetRegisterContainer.NAME, required = true, fixed = true) - public GdbModelTargetRegisterContainer getRegisters() { - return registers; - } - */ - - @TargetAttributeType(name = GdbModelTargetThreadContainer.NAME, required = true, fixed = true) - public GdbModelTargetThreadContainer getThreads() { - return threads; - } - - @TargetAttributeType( - name = GdbModelTargetBreakpointLocationContainer.NAME, - required = true, - fixed = true) - public GdbModelTargetBreakpointLocationContainer getBreakpoints() { - return breakpoints; - } - - @Override - public CompletableFuture launch(Map args) { - List cmdLineArgs = - CmdLineParser.tokenize(TargetCmdLineLauncher.PARAMETER_CMDLINE_ARGS.get(args)); - Boolean useStarti = PARAMETER_STARTI.get(args); - return impl.gateFuture( - GdbModelImplUtils.launch(inferior, cmdLineArgs, useStarti, () -> { - return environment.refreshInternal(); - }).thenApply(__ -> null)); - } - - @Override - public CompletableFuture resume() { - return impl.gateFuture(inferior.cont()); - } - - @Override - public CompletableFuture step(TargetStepKind kind) { - switch (kind) { - case SKIP: - case EXTENDED: - throw new UnsupportedOperationException(kind.name()); - default: - return model.gateFuture(inferior.step(GdbModelTargetThread.convertToGdb(kind))); - } - } - - @Override - public CompletableFuture kill() { - return model.gateFuture(inferior.kill()); - } - - @Override - public CompletableFuture interrupt() { - return impl.session.interrupt(); - } - - @Override - public CompletableFuture attach(TargetAttachable attachable) { - GdbModelTargetAttachable mine = impl.assertMine(GdbModelTargetAttachable.class, attachable); - return attach(mine.pid); - } - - @Override - public CompletableFuture attach(long pid) { - return model.gateFuture(inferior.attach(pid)).thenApply(__ -> null); - } - - @Override - public CompletableFuture detach() { - return model.gateFuture(inferior.detach()); - } - - @Override - public CompletableFuture delete() { - return model.gateFuture(inferior.remove()); - } - - protected CompletableFuture inferiorStarted(Long pid) { - broadcast().event(parent, null, TargetEventType.PROCESS_CREATED, - "Inferior " + inferior.getId() + " started " + inferior.getExecutable() + " pid=" + pid, - List.of(this)); - /*System.err.println("inferiorStarted: realState = " + realState); - changeAttributes(List.of(), Map.ofEntries( - // This is hacky, but =inferior-started comes before ^running. - // Is it ever not followed by ^running, except on failure? - Map.entry(STATE_ATTRIBUTE_NAME, state = TargetExecutionState.RUNNING), - Map.entry(PID_ATTRIBUTE_NAME, pid), - Map.entry(DISPLAY_ATTRIBUTE_NAME, updateDisplay())), - "Refresh on started");*/ - AsyncFence fence = new AsyncFence(); - fence.include(memory.refreshInternal()); // In case of resync - fence.include(modules.refreshInternal()); - fence.include(threads.refreshInternal()); // In case of resync - fence.include(environment.refreshInternal()); - fence.include(impl.gdb.listInferiors()); // HACK to update inferior.getExecutable() - return fence.ready().thenAccept(__ -> { - // NB. Hack also updates inferior.getPid() - Long p = pid; - if (p == null) { - // Might have become null if it quickly terminates - // Also, we should save it before waiting on the refresh - p = inferior.getPid(); - } - if (p == null) { - changeAttributes(List.of(), Map.ofEntries( - Map.entry(STATE_ATTRIBUTE_NAME, state = realState), - Map.entry(DISPLAY_ATTRIBUTE_NAME, updateDisplay())), - "Refresh on initial break"); - } - else { - if (!realState.isAlive()) { - realState = TargetExecutionState.ALIVE; - } - changeAttributes(List.of(), Map.ofEntries( - Map.entry(STATE_ATTRIBUTE_NAME, state = realState), - Map.entry(PID_ATTRIBUTE_NAME, p), - Map.entry(DISPLAY_ATTRIBUTE_NAME, updateDisplay())), - "Refresh on initial break"); - } - }); - } - - protected void inferiorExited(Long exitCode) { - this.exitCode = exitCode; - if (exitCode != null) { - changeAttributes(List.of(), Map.of( // - STATE_ATTRIBUTE_NAME, state = realState = TargetExecutionState.TERMINATED, // - EXIT_CODE_ATTRIBUTE_NAME, exitCode, // - DISPLAY_ATTRIBUTE_NAME, updateDisplay() // - ), "Exited"); - } - else { - changeAttributes(List.of(), Map.of( // - STATE_ATTRIBUTE_NAME, state = realState = TargetExecutionState.TERMINATED, // - DISPLAY_ATTRIBUTE_NAME, updateDisplay() // - ), "Exited"); - } - } - - protected void gatherThreads(List into, - Collection from) { - for (GdbThread t : from) { - GdbModelTargetThread p = threads.getTargetThread(t); - if (p != null) { - into.add(p); - } - } - } - - protected void emitEvent(GdbStateChangeRecord sco, GdbModelTargetThread targetEventThread) { - GdbReason reason = sco.getReason(); - if (reason instanceof GdbBreakpointHitReason) { - GdbBreakpointHitReason bpHit = (GdbBreakpointHitReason) reason; - List params = new ArrayList<>(); - GdbModelTargetBreakpointLocation loc = threads.breakpointHit(bpHit); - if (loc != null) { - // e.g. target could execute INT3, causing "trapped" for unknown bp/loc - params.add(loc); - } - gatherThreads(params, sco.getAffectedThreads()); - broadcast().event(impl.session, targetEventThread, TargetEventType.BREAKPOINT_HIT, - bpHit.desc(), params); - } - else if (reason instanceof GdbEndSteppingRangeReason) { - List params = new ArrayList<>(); - gatherThreads(params, sco.getAffectedThreads()); - broadcast().event(impl.session, targetEventThread, TargetEventType.STEP_COMPLETED, - reason.desc(), params); - } - else if (reason instanceof GdbSignalReceivedReason) { - GdbSignalReceivedReason signal = (GdbSignalReceivedReason) reason; - List params = new ArrayList<>(); - params.add(signal.getSignalName()); - gatherThreads(params, sco.getAffectedThreads()); - broadcast().event(impl.session, targetEventThread, TargetEventType.SIGNAL, - reason.desc(), params); - } - else { - List params = new ArrayList<>(); - gatherThreads(params, sco.getAffectedThreads()); - broadcast().event(impl.session, targetEventThread, TargetEventType.STOPPED, - reason.desc(), params); - } - } - - protected void inferiorRunning(GdbReason reason) { - realState = TargetExecutionState.RUNNING; - if (!state.isAlive()) { - return; - } - changeAttributes(List.of(), Map.of( // - STATE_ATTRIBUTE_NAME, state = realState // - ), reason.desc()); - } - - protected void inferiorStopped(GdbReason reason) { - realState = TargetExecutionState.STOPPED; - if (!state.isAlive()) { - return; - } - changeAttributes(List.of(), Map.of( // - STATE_ATTRIBUTE_NAME, state = realState // - ), reason.desc()); - } - - protected void updateDisplayAttribute() { - changeAttributes(List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, updateDisplay() // - ), "Display changed"); - } - - protected String updateDisplay() { - if (inferior.getPid() == null) { - return display = String.format("%d - ", inferior.getId()); - } - String descriptor = inferior.getDescriptor(); - String[] split = descriptor.split(" "); - if (base == 16) { - descriptor = split[0] + " 0x" + Long.toHexString(Long.decode(split[1])); - } - return display = - String.format("%d - %s - %s", inferior.getId(), descriptor, inferior.getExecutable()); - } - - @Override - public String getDisplay() { - return display; - } - - @Override - public TargetExecutionState getExecutionState() { - return state; - } - - protected void invalidateMemoryAndRegisterCaches() { - memory.invalidateMemoryCaches(); - threads.invalidateRegisterCaches(); - } - - @Override - @Internal - public CompletableFuture setActive() { - return impl.gateFuture(inferior.setActive(false)); - } - - @TargetAttributeType(name = EXIT_CODE_ATTRIBUTE_NAME) - public Long getExitCode() { - return exitCode; - } - - /** - * Handle state changes for this inferior - * - *

- * Desired order of updates: - *

    - *
  1. TargetEvent emitted
  2. - *
  3. Thread states/stacks updated
  4. - *
  5. Memory regions updated (Ew)
  6. - *
- * - *

- * Note that the event thread may not belong to this inferior. When it does not, this inferior - * will not emit any event(). Presumably, this same method will be called on the relevant - * inferior, which will report the event. However, this inferior must still update its state. - * Without this screening: - *

    - *
  1. The thread gets replicated into a different inferior
  2. - *
  3. The event() gets replicated on a different inferior
    - * (We only need to report state changes, not event, for non-event inferiors
  4. - *
- * - * @param sco the record of the change - */ - public CompletableFuture stateChanged(GdbStateChangeRecord sco) { - - GdbModelTargetThread targetEventThread = null; - GdbThread gdbEventThread = sco.getEventThread(); - if (gdbEventThread != null && gdbEventThread.getInferior() == inferior) { - targetEventThread = threads.getTargetThread(gdbEventThread); - } - if (sco.getState() == GdbState.RUNNING) { - inferiorRunning(sco.getReason()); - List params = new ArrayList<>(); - gatherThreads(params, sco.getAffectedThreads()); - if (targetEventThread == null && !params.isEmpty()) { - targetEventThread = - threads.getTargetThread(sco.getAffectedThreads().iterator().next()); - } - if (targetEventThread != null) { - broadcast().event(impl.session, targetEventThread, TargetEventType.RUNNING, - "Running", params); - invalidateMemoryAndRegisterCaches(); - } - } - if (sco.getState() != GdbState.STOPPED) { - return threads.stateChanged(sco); - } - - if (targetEventThread != null) { - emitEvent(sco, targetEventThread); - } - - AsyncFence fence = new AsyncFence(); - // TODO: How does GDB for Windows handle WoW64? - // Can there be architecture changes during execution? Per thread? - //fence.include(environment.refreshArchitecture()); - fence.include(threads.stateChanged(sco)); - inferiorStopped(sco.getReason()); - //registers.stateChanged(sco); - fence.include(memory.stateChanged(sco)); - return fence.ready(); - } - - public void addBreakpointLocation(GdbModelTargetBreakpointLocation loc) { - breakpoints.addBreakpointLocation(loc); - } - - public void removeBreakpointLocation(GdbModelTargetBreakpointLocation loc) { - breakpoints.removeBreakpointLocation(loc); - } - - public void setBase(Object value) { - this.base = (Integer) value; - updateDisplayAttribute(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetInferiorContainer.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetInferiorContainer.java deleted file mode 100644 index 6967ef7d27..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetInferiorContainer.java +++ /dev/null @@ -1,192 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import agent.gdb.manager.*; -import agent.gdb.manager.impl.cmd.GdbStateChangeRecord; -import ghidra.async.AsyncUtils; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.agent.DefaultTargetObject; -import ghidra.dbg.error.DebuggerIllegalArgumentException; -import ghidra.dbg.target.TargetConfigurable; -import ghidra.dbg.target.TargetEventScope.TargetEventType; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; - -@TargetObjectSchemaInfo( - name = "InferiorContainer", - attributes = { - @TargetAttributeType(name = TargetConfigurable.BASE_ATTRIBUTE_NAME, type = Integer.class), // - @TargetAttributeType(type = Void.class) // - }, - canonicalContainer = true) -public class GdbModelTargetInferiorContainer - extends DefaultTargetObject - implements TargetConfigurable, GdbEventsListenerAdapter { - public static final String NAME = "Inferiors"; - - protected final GdbModelImpl impl; - - public GdbModelTargetInferiorContainer(GdbModelTargetSession session) { - super(session.impl, session, NAME, "InferiorContainer"); - this.impl = session.impl; - this.changeAttributes(List.of(), Map.of(BASE_ATTRIBUTE_NAME, 10), "Initialized"); - - impl.gdb.addEventsListener(this); - } - - @Override - public void inferiorAdded(GdbInferior inferior, GdbCause cause) { - GdbModelTargetInferior inf = getTargetInferior(inferior); - changeElements(List.of(), List.of(inf), "Added"); - } - - @Override - public void inferiorStarted(GdbInferior inf, GdbCause cause) { - GdbModelTargetInferior inferior = getTargetInferior(inf); - inferior.inferiorStarted(inf.getPid()).exceptionally(ex -> { - impl.reportError(this, "Could not notify inferior started", ex); - return null; - }); - } - - @Override - public void inferiorExited(GdbInferior inf, GdbCause cause) { - GdbModelTargetInferior inferior = getTargetInferior(inf); - broadcast().event(parent, null, TargetEventType.PROCESS_EXITED, - "Inferior " + inf.getId() + " exited code=" + inf.getExitCode(), List.of(inferior)); - inferior.inferiorExited(inf.getExitCode()); - } - - @Override - public void inferiorRemoved(int inferiorId, GdbCause cause) { - synchronized (this) { - impl.deleteModelObject(inferiorId); - } - changeElements(List.of(GdbModelTargetInferior.indexInferior(inferiorId)), List.of(), - "Removed"); - } - - @Override - public void threadCreated(GdbThread thread, GdbCause cause) { - GdbModelTargetInferior inferior = getTargetInferior(thread.getInferior()); - GdbModelTargetThread targetThread = inferior.threads.threadCreated(thread); - broadcast().event(parent, targetThread, TargetEventType.THREAD_CREATED, - "Thread " + thread.getId() + " started", List.of(targetThread)); - } - - @Override - public void threadExited(int threadId, GdbInferior inf, GdbCause cause) { - GdbModelTargetInferior inferior = getTargetInferior(inf); - GdbModelTargetThread targetThread = - inferior.threads.getCachedElements().get(GdbModelTargetThread.indexThread(threadId)); - broadcast().event(parent, targetThread, TargetEventType.THREAD_EXITED, - "Thread " + threadId + " exited", List.of(targetThread)); - inferior.threads.threadExited(threadId); - } - - @Override - public void libraryLoaded(GdbInferior inf, String name, GdbCause cause) { - GdbModelTargetInferior inferior = getTargetInferior(inf); - inferior.modules.libraryLoaded(name); - } - - @Override - public void libraryUnloaded(GdbInferior inf, String name, GdbCause cause) { - GdbModelTargetInferior inferior = getTargetInferior(inf); - inferior.modules.libraryUnloaded(name); - } - - @Override - public void memoryChanged(GdbInferior inf, long addr, int len, GdbCause cause) { - GdbModelTargetInferior inferior = getTargetInferior(inf); - inferior.memory.memoryChanged(addr, len); - } - - private void updateUsingInferiors(Map byIID) { - List inferiors; - synchronized (this) { - inferiors = - byIID.values().stream().map(this::getTargetInferior).collect(Collectors.toList()); - } - setElements(inferiors, "Refreshed"); - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - if (!refresh.equals(RefreshBehavior.REFRESH_ALWAYS)) { - updateUsingInferiors(impl.gdb.getKnownInferiors()); - return AsyncUtils.nil(); - } - return impl.gdb.listInferiors().thenAccept(this::updateUsingInferiors); - } - - // NOTE: Does no good to override fetchElement - // Cache should be kept in sync all the time, anyway - - public synchronized GdbModelTargetInferior getTargetInferior(int id) { - TargetObject modelObject = impl.getModelObject(id); - if (modelObject != null) { - return (GdbModelTargetInferior) modelObject; - } - return new GdbModelTargetInferior(this, impl.gdb.getKnownInferiors().get(id)); - } - - public synchronized GdbModelTargetInferior getTargetInferior(GdbInferior inferior) { - TargetObject modelObject = impl.getModelObject(inferior); - if (modelObject != null) { - return (GdbModelTargetInferior) modelObject; - } - return new GdbModelTargetInferior(this, inferior); - } - - protected void invalidateMemoryAndRegisterCaches() { - for (GdbInferior inf : impl.gdb.getKnownInferiors().values()) { - GdbModelTargetInferior targetInf = (GdbModelTargetInferior) impl.getModelObject(inf); - targetInf.invalidateMemoryAndRegisterCaches(); - } - } - - public CompletableFuture stateChanged(GdbStateChangeRecord sco) { - return getTargetInferior(sco.getInferior()).stateChanged(sco); - } - - @Override - public CompletableFuture writeConfigurationOption(String key, Object value) { - switch (key) { - case BASE_ATTRIBUTE_NAME: - if (value instanceof Integer) { - this.changeAttributes(List.of(), Map.of(BASE_ATTRIBUTE_NAME, value), - "Modified"); - for (GdbModelTargetInferior child : this.getCachedElements().values()) { - child.setBase(value); - } - } - else { - throw new DebuggerIllegalArgumentException("Base should be numeric"); - } - default: - } - return AsyncUtils.nil(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetMemoryRegion.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetMemoryRegion.java deleted file mode 100644 index 068d0305d4..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetMemoryRegion.java +++ /dev/null @@ -1,154 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import agent.gdb.manager.impl.GdbMemoryMapping; -import agent.gdb.manager.impl.cmd.GdbStateChangeRecord; -import ghidra.async.AsyncUtils; -import ghidra.dbg.agent.DefaultTargetObject; -import ghidra.dbg.target.TargetMemoryRegion; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.util.PathUtils; -import ghidra.program.model.address.*; - -@TargetObjectSchemaInfo( - name = "MemoryRegion", - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType(type = Void.class) }) -public class GdbModelTargetMemoryRegion - extends DefaultTargetObject - implements TargetMemoryRegion { - protected static final String OBJFILE_ATTRIBUTE_NAME = PREFIX_INVISIBLE + "objfile"; - protected static final String OFFSET_ATTRIBUTE_NAME = PREFIX_INVISIBLE + "offset"; - - protected static String indexRegion(GdbMemoryMapping mapping) { - return mapping.getStart().toString(16); - } - - protected static String keyRegion(GdbMemoryMapping mapping) { - return PathUtils.makeKey(indexRegion(mapping)); - } - - protected static String computeDisplay(GdbMemoryMapping mapping) { - // NOTE: This deviates from GDB's table display, as it'd be confusing in isolation - if (mapping.getObjfile() == null || mapping.getObjfile().length() == 0) { - return String.format("?? (0x%x-0x%x)", mapping.getStart(), mapping.getEnd()); - } - return String.format("%s (0x%x-0x%x,0x%x)", mapping.getObjfile(), mapping.getStart(), - mapping.getEnd(), mapping.getOffset()); - } - - protected AddressRangeImpl range; - protected final String flags; - protected final String objfile; - protected final long offset; - protected final String display; - - public GdbModelTargetMemoryRegion(GdbModelTargetProcessMemory memory, - GdbMemoryMapping mapping) { - super(memory.impl, memory, keyRegion(mapping), "MemoryRegion"); - memory.impl.addModelObject(mapping, this); - try { - Address min = memory.impl.getAddressFactory() - .getDefaultAddressSpace() - .getAddress(mapping.getStart().toString(16)); - this.range = new AddressRangeImpl(min, mapping.getSize().longValue()); - } - catch (AddressFormatException | AddressOverflowException e) { - throw new AssertionError(e); - } - this.flags = mapping.getFlags(); - changeAttributes(List.of(), Map.of( // - MEMORY_ATTRIBUTE_NAME, memory, // - RANGE_ATTRIBUTE_NAME, range, // - READABLE_ATTRIBUTE_NAME, isReadable(), // - WRITABLE_ATTRIBUTE_NAME, isWritable(), // - EXECUTABLE_ATTRIBUTE_NAME, isExecutable(), // - OBJFILE_ATTRIBUTE_NAME, objfile = mapping.getObjfile(), // - OFFSET_ATTRIBUTE_NAME, offset = mapping.getOffset().longValue(), // - DISPLAY_ATTRIBUTE_NAME, display = computeDisplay(mapping) // - ), "Initialized"); - } - - protected boolean isSame(GdbMemoryMapping mapping) { - // Hacky, but effective - // TODO: Check/update permissions? - return display.equals(computeDisplay(mapping)); - } - - @Override - public AddressRange getRange() { - return range; - } - - @Override - public String getDisplay() { - return display; - } - - @Override - public GdbModelTargetProcessMemory getMemory() { - return parent; - } - - @Override - public boolean isReadable() { - // This was added at or near gdb-12.1 - return flags.contains("r"); - } - - @Override - public boolean isWritable() { - // This was added at or near gdb-12.1 - return flags.contains("w"); - } - - @Override - public boolean isExecutable() { - // This was added at or near gdb-12.1 - return flags.contains("x"); - } - - @TargetAttributeType( - name = OBJFILE_ATTRIBUTE_NAME, - required = true, - fixed = true, - hidden = true) - public String getObjfile() { - return objfile; - } - - @TargetAttributeType( - name = OFFSET_ATTRIBUTE_NAME, - required = true, - fixed = true, - hidden = true) - public long getOffset() { - return offset; - } - - public CompletableFuture stateChanged(GdbStateChangeRecord sco) { - // Nothing to do here - return AsyncUtils.nil(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetModule.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetModule.java deleted file mode 100644 index 8a35ffd10b..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetModule.java +++ /dev/null @@ -1,148 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import agent.gdb.manager.GdbInferior; -import agent.gdb.manager.GdbModule; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.agent.DefaultTargetObject; -import ghidra.dbg.target.TargetModule; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.util.PathUtils; -import ghidra.program.model.address.*; - -@TargetObjectSchemaInfo( - name = "Module", - elements = { // - @TargetElementType(type = Void.class) // - }, - attributes = { // - @TargetAttributeType(type = Void.class) // - }) -public class GdbModelTargetModule extends - DefaultTargetObject implements TargetModule { - - public static final String VISIBLE_RANGE_ATTRIBUTE_NAME = "Range"; - public static final String VISIBLE_MODULE_NAME_ATTRIBUTE_NAME = "module name"; - - protected static String indexModule(GdbModule module) { - return module.getName(); - } - - protected static String keyModule(GdbModule module) { - return PathUtils.makeKey(indexModule(module)); - } - - protected final GdbModelImpl impl; - protected final GdbInferior inferior; - protected final GdbModule module; - - protected final GdbModelTargetSectionContainer sections; - protected final GdbModelTargetSymbolContainer symbols; - // TODO Types? See GDB's ptype, but that'll require some C parsing - - protected AddressRange range; - - public GdbModelTargetModule(GdbModelTargetModuleContainer modules, GdbModule module) { - super(modules.impl, modules, keyModule(module), "Module"); - this.impl = modules.impl; - this.inferior = modules.inferior; - this.module = module; - impl.addModelObject(module, this); - impl.addModelObject(module.getName(), this); - - this.sections = new GdbModelTargetSectionContainer(this); - this.symbols = new GdbModelTargetSymbolContainer(this); - - range = doGetRange(); // Likely [0,0] - changeAttributes(List.of(), List.of(sections, symbols), Map.of( // - VISIBLE_RANGE_ATTRIBUTE_NAME, range, // - VISIBLE_MODULE_NAME_ATTRIBUTE_NAME, module.getName(), // - RANGE_ATTRIBUTE_NAME, range, // - MODULE_NAME_ATTRIBUTE_NAME, module.getName(), // - SHORT_DISPLAY_ATTRIBUTE_NAME, getDisplay(), // - DISPLAY_ATTRIBUTE_NAME, getDisplay() // - ), "Initialized"); - } - - public CompletableFuture init() { - return sections.requestElements(RefreshBehavior.REFRESH_ALWAYS).exceptionally(ex -> { - impl.reportError(this, "Could not initialize module sections and base", ex); - return null; - }); - } - - @TargetAttributeType(name = GdbModelTargetSectionContainer.NAME, required = true, fixed = true) - public GdbModelTargetSectionContainer getSections() { - return sections; - } - - @TargetAttributeType(name = GdbModelTargetSymbolContainer.NAME, required = true, fixed = true) - public GdbModelTargetSymbolContainer getSymbols() { - return symbols; - } - - @Override - public String getDisplay() { - String shortName = module.getName(); - int sep = shortName.lastIndexOf('/'); - if (sep > 0 && sep < shortName.length()) { - shortName = shortName.substring(sep + 1); - } - return shortName; - } - - protected AddressRange doGetRange() { - Long base = module.getBase(); - Long max = module.getMax(); - max = max == null ? base : (Long) (max - 1); // GDB gives end+1 - if (base == null) { - Address addr = impl.space.getMinAddress(); - return new AddressRangeImpl(addr, addr); - } - return new AddressRangeImpl(impl.space.getAddress(base), impl.space.getAddress(max)); - } - - public void sectionsRefreshed() { - range = doGetRange(); - changeAttributes(List.of(), - Map.of(RANGE_ATTRIBUTE_NAME, range, VISIBLE_RANGE_ATTRIBUTE_NAME, range), - "Sections Refreshed"); - } - - @Override - public AddressRange getRange() { - return range; - } - - // TODO: Consider a way to override the "hidden" field of an attribute - // Otherwise, this information is duplicated in memory and on the wire - @TargetAttributeType(name = VISIBLE_RANGE_ATTRIBUTE_NAME) - public AddressRange getVisibleRange() { - return range; - } - - @TargetAttributeType(name = VISIBLE_MODULE_NAME_ATTRIBUTE_NAME) - public String getVisibleModuleName() { - return module.getName(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetModuleContainer.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetModuleContainer.java deleted file mode 100644 index a438729a6a..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetModuleContainer.java +++ /dev/null @@ -1,141 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.impl; - -import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import agent.gdb.manager.GdbInferior; -import agent.gdb.manager.GdbModule; -import ghidra.async.AsyncFence; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.agent.DefaultTargetObject; -import ghidra.dbg.error.DebuggerUserException; -import ghidra.dbg.target.*; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; -import ghidra.lifecycle.Internal; - -@TargetObjectSchemaInfo( - name = "ModuleContainer", - elementResync = ResyncMode.ONCE, // TODO: Should this be NEVER? - attributes = { @TargetAttributeType(type = Void.class) }, - canonicalContainer = true) -public class GdbModelTargetModuleContainer - extends DefaultTargetObject - implements TargetModuleContainer { - // NOTE: -file-list-shared-libraries omits the main module and system-supplied DSO. - public static final String NAME = "Modules"; - - protected final GdbModelImpl impl; - protected final GdbInferior inferior; - - public GdbModelTargetModuleContainer(GdbModelTargetInferior inferior) { - super(inferior.impl, inferior, NAME, "ModuleContainer"); - this.impl = inferior.impl; - this.inferior = inferior.inferior; - } - - @Internal - public GdbModelTargetModule libraryLoaded(String name) { - GdbModule mod = inferior.getKnownModules().get(name); - if (mod == null) { - // We'll catch it the next time around. - return null; - } - GdbModelTargetModule module = getTargetModule(mod); - changeElements(List.of(), List.of(module), "Loaded"); - return module; - } - - @Internal - public void libraryUnloaded(String name) { - synchronized (this) { - impl.deleteModelObject(name); - } - changeElements(List.of(name), List.of(), "Unloaded"); - } - - @Override - public boolean supportsSyntheticModules() { - return false; - } - - @Override - public CompletableFuture addSyntheticModule(String name) { - throw new DebuggerUserException("GDB Does not support synthetic modules"); - } - - protected CompletableFuture updateUsingModules(Map byName) { - List modules; - synchronized (this) { - modules = - byName.values().stream().map(this::getTargetModule).collect(Collectors.toList()); - } - AsyncFence fence = new AsyncFence(); - for (GdbModelTargetModule mod : modules) { - fence.include(mod.init()); - } - - /** - * NB. Modules may have changed by the time the fence completes. We'll just remove invalid - * modules, since any additions should cause a follow-on update. - */ - return fence.ready().thenAccept(__ -> { - List validOnly = - modules.stream().filter(m -> m.isValid()).collect(Collectors.toList()); - changeElements(List.of(), validOnly, "Refreshed"); - }); - } - - @Override - protected CompletableFuture requestElements(RefreshBehavior refresh) { - // listModules is now cached by the manager - return doRefresh(refresh.isRefresh(elements.keySet())); - } - - protected CompletableFuture doRefresh(boolean force) { - return inferior.listModules(force).thenCompose(byName -> { - for (String modName : inferior.getKnownModules().keySet()) { - if (!byName.keySet().contains(modName)) { - impl.deleteModelObject(byName.get(modName)); - } - } - return updateUsingModules(byName); - }); - } - - protected synchronized GdbModelTargetModule getTargetModule(GdbModule module) { - TargetObject modelObject = impl.getModelObject(module); - if (modelObject != null) { - return (GdbModelTargetModule) modelObject; - } - return new GdbModelTargetModule(this, module); - } - - public synchronized GdbModelTargetModule getTargetModuleIfPresent(String name) { - return (GdbModelTargetModule) impl.getModelObject(name); - } - - protected CompletableFuture refreshInternal() { - return doRefresh(false).exceptionally(ex -> { - impl.reportError(this, "Problem refreshing inferior's modules", ex); - return null; - }); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetProcessMemory.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetProcessMemory.java deleted file mode 100644 index 697bd5ce18..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetProcessMemory.java +++ /dev/null @@ -1,228 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.impl; - -import java.math.BigInteger; -import java.nio.ByteBuffer; -import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import org.apache.commons.lang3.exception.ExceptionUtils; - -import agent.gdb.manager.GdbInferior; -import agent.gdb.manager.impl.GdbMemoryMapping; -import agent.gdb.manager.impl.cmd.GdbCommandError; -import agent.gdb.manager.impl.cmd.GdbStateChangeRecord; -import generic.ULongSpan; -import ghidra.async.AsyncFence; -import ghidra.async.AsyncUtils; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.agent.DefaultTargetObject; -import ghidra.dbg.error.DebuggerMemoryAccessException; -import ghidra.dbg.target.TargetMemory; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; -import ghidra.program.model.address.*; -import ghidra.util.Msg; -import ghidra.util.datastruct.WeakValueHashMap; - -@TargetObjectSchemaInfo( - name = "Memory", - attributes = { - @TargetAttributeType(type = Void.class) }, - canonicalContainer = true) -public class GdbModelTargetProcessMemory - extends DefaultTargetObject - implements TargetMemory { - public static final String NAME = "Memory"; - - protected final GdbModelImpl impl; - protected final GdbInferior inferior; - - protected final Map regionsByStart = - new WeakValueHashMap<>(); - - public GdbModelTargetProcessMemory(GdbModelTargetInferior inferior) { - super(inferior.impl, inferior, NAME, "ProcessMemory"); - this.impl = inferior.impl; - this.inferior = inferior.inferior; - } - - protected CompletableFuture> defaultUsingAddressSize() { - return inferior.evaluate("sizeof(int*)").thenApply(sizeStr -> { - int size; - try { - size = Integer.parseInt(sizeStr); - } - catch (NumberFormatException e) { - throw new GdbCommandError("Couldn't determine address size: " + e); - } - - BigInteger start = BigInteger.ZERO; - BigInteger end = BigInteger.ONE.shiftLeft(size * 8); - if (size >= 0 && size < 8) { - GdbMemoryMapping mapping = new GdbMemoryMapping(start, end, - end.subtract(start), BigInteger.ZERO, "rwx", "default"); - return Map.of(start, mapping); - } - if (size == 8) { - // TODO: This split shouldn't be necessary. - BigInteger lowEnd = BigInteger.valueOf(Long.MAX_VALUE); - BigInteger highStart = lowEnd.add(BigInteger.ONE); - - GdbMemoryMapping lowMapping = new GdbMemoryMapping(start, lowEnd, - lowEnd.subtract(start), BigInteger.ZERO, "rwx", "defaultLow"); - GdbMemoryMapping highMapping = new GdbMemoryMapping(highStart, end, - end.subtract(highStart), BigInteger.ZERO, "rwx", "defaultHigh"); - return Map.of(start, lowMapping, highStart, highMapping); - } - throw new GdbCommandError("Unexpected address size: " + size); - }); - } - - protected void updateUsingMappings(Map byStart) { - synchronized (this) { - if (!valid) { - setElements(List.of(), "Refreshed"); - } - } - CompletableFuture> maybeDefault = - byStart.isEmpty() ? defaultUsingAddressSize() - : CompletableFuture.completedFuture(byStart); - maybeDefault.thenAccept(mappings -> { - List regions; - synchronized (this) { - regions = mappings.values() - .stream() - .map(this::getTargetRegion) - .collect(Collectors.toList()); - } - setElements(regions, "Refreshed"); - }).exceptionally(ex -> { - Msg.info(this, "Failed to update regions: " + ex); - return null; - }); - } - - @Override - protected CompletableFuture requestElements(RefreshBehavior refresh) { - // Can't use refresh getKnownMappings is only populated by listMappings - return doRefresh(); - } - - protected CompletableFuture doRefresh() { - if (inferior.getPid() == null) { - setElements(List.of(), "Refreshed (while no process)"); - return AsyncUtils.nil(); - } - return inferior.listMappings().exceptionally(ex -> { - Msg.error(this, "Could not list regions. Using default."); - // empty map will be replaced with default - return new TreeMap<>(); - }).thenAccept(this::updateUsingMappings); - } - - protected synchronized GdbModelTargetMemoryRegion getTargetRegion(GdbMemoryMapping mapping) { - GdbModelTargetMemoryRegion region = regionsByStart.get(mapping.getStart()); - if (region != null && region.isSame(mapping)) { - return region; - } - region = new GdbModelTargetMemoryRegion(this, mapping); - regionsByStart.put(mapping.getStart(), region); - return region; - } - - protected CompletableFuture doReadMemory(Address address, long offset, int length) { - ByteBuffer buf = ByteBuffer.allocate(length); - AddressRange range; - try { - range = new AddressRangeImpl(address, length); - } - catch (AddressOverflowException e) { - throw new IllegalArgumentException("address,length", e); - } - return inferior.readMemory(offset, buf).thenApply(set -> { - ULongSpan s = set.spanContaining(offset); - if (s == null) { - throw new DebuggerMemoryAccessException("Cannot read at " + address); - } - byte[] content = Arrays.copyOf(buf.array(), (int) s.length()); - broadcast().memoryUpdated(this, address, content); - return content; - }).exceptionally(e -> { - e = AsyncUtils.unwrapThrowable(e); - if (e instanceof GdbCommandError) { - GdbCommandError gce = (GdbCommandError) e; - e = new DebuggerMemoryAccessException( - "Cannot read at " + address + ": " + gce.getInfo().getString("msg")); - broadcast().memoryReadError(this, range, (DebuggerMemoryAccessException) e); - } - if (e instanceof DebuggerMemoryAccessException) { - broadcast().memoryReadError(this, range, (DebuggerMemoryAccessException) e); - } - return ExceptionUtils.rethrow(e); - }); - } - - @Override - public CompletableFuture readMemory(Address address, int length) { - return impl.gateFuture(doReadMemory(address, address.getOffset(), length)); - } - - @Override - public CompletableFuture writeMemory(Address address, byte[] data) { - CompletableFuture future = - inferior.writeMemory(address.getOffset(), ByteBuffer.wrap(data)); - return impl.gateFuture(future.thenAccept(__ -> { - broadcast().memoryUpdated(this, address, data); - })); - } - - protected void invalidateMemoryCaches() { - if (!valid) { - return; - } - broadcast().invalidateCacheRequested(this); - } - - public void memoryChanged(long offset, int len) { - Address address = impl.getAddressFactory().getDefaultAddressSpace().getAddress(offset); - doReadMemory(address, offset, len).exceptionally(ex -> { - Msg.error(this, "Failed to update memory contents on memory-changed event", ex); - return null; - }); - } - - // TODO: Seems this is only called when sco.getState() == STOPPED. - // Maybe should name it such - public CompletableFuture stateChanged(GdbStateChangeRecord sco) { - return doRefresh().thenCompose(__ -> { - AsyncFence fence = new AsyncFence(); - for (GdbModelTargetMemoryRegion modelRegion : regionsByStart.values()) { - fence.include(modelRegion.stateChanged(sco)); - } - return fence.ready(); - }); - } - - protected CompletableFuture refreshInternal() { - return doRefresh().exceptionally(ex -> { - impl.reportError(this, "Problem refreshing inferior's memory regions", ex); - return null; - }); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetRegister.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetRegister.java deleted file mode 100644 index 058a98252a..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetRegister.java +++ /dev/null @@ -1,86 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.impl; - -import java.util.List; -import java.util.Map; - -import agent.gdb.manager.GdbRegister; -import agent.gdb.manager.impl.cmd.GdbStateChangeRecord; -import ghidra.dbg.agent.DefaultTargetObject; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.TargetRegister; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.util.PathUtils; - -@TargetObjectSchemaInfo(name = "RegisterDescriptor", elements = { - @TargetElementType(type = Void.class) }, attributes = { - @TargetAttributeType(type = Void.class) }) -public class GdbModelTargetRegister - extends DefaultTargetObject - implements TargetRegister { - - protected static String indexRegister(GdbRegister register) { - String name = register.getName(); - if ("".equals(name)) { - return "UNNAMED," + register.getNumber(); - } - return name; - } - - protected static String keyRegister(GdbRegister register) { - return PathUtils.makeKey(indexRegister(register)); - } - - protected final GdbModelImpl impl; - protected final GdbRegister register; - - protected final int bitLength; - - public GdbModelTargetRegister(GdbModelTargetRegisterContainer registers, GdbRegister register) { - super(registers.impl, registers, keyRegister(register), "Register"); - this.impl = registers.impl; - this.register = register; - impl.addModelObject(register, this); - - this.bitLength = register.getSize() * 8; - - changeAttributes(List.of(), Map.of( // - CONTAINER_ATTRIBUTE_NAME, registers, // - BIT_LENGTH_ATTRIBUTE_NAME, bitLength, // - DISPLAY_ATTRIBUTE_NAME, getName() // - ), "Initialized"); - } - - @Override - public int getBitLength() { - return bitLength; - } - - @Override - public String getDisplay() { - return getName(); - } - - @Override - public GdbModelTargetRegisterContainer getContainer() { - return parent; - } - - public void stateChanged(GdbStateChangeRecord sco) { - } - -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetRegisterContainer.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetRegisterContainer.java deleted file mode 100644 index 09c22f560b..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetRegisterContainer.java +++ /dev/null @@ -1,107 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import agent.gdb.manager.*; -import agent.gdb.manager.impl.cmd.GdbStateChangeRecord; -import ghidra.async.AsyncUtils; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.agent.DefaultTargetObject; -import ghidra.dbg.target.TargetRegisterContainer; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; -import ghidra.util.Msg; -import ghidra.util.datastruct.WeakValueHashMap; - -@TargetObjectSchemaInfo( - name = "RegisterContainer", - attributes = { - @TargetAttributeType(type = Void.class) }, - canonicalContainer = true) -public class GdbModelTargetRegisterContainer - extends DefaultTargetObject - implements TargetRegisterContainer { - public static final String NAME = "Registers"; - - protected final GdbModelImpl impl; - protected final GdbInferior inferior; - - protected final Map registersByNumber = - new WeakValueHashMap<>(); - - public GdbModelTargetRegisterContainer(GdbModelTargetInferior inferior) { - super(inferior.impl, inferior, NAME, "RegisterContainer"); - this.impl = inferior.impl; - this.inferior = inferior.inferior; - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - if (!refresh.equals(RefreshBehavior.REFRESH_ALWAYS)) { - return completeUsingThreads(inferior.getKnownThreads()); - } - return doRefresh(); - } - - protected CompletableFuture doRefresh() { - return inferior.listThreads().thenCompose(this::completeUsingThreads); - } - - protected CompletableFuture completeUsingThreads(Map byId) { - if (byId.isEmpty()) { - setElements(List.of(), "Refreshed (with no thread)"); - return AsyncUtils.nil(); - } - GdbThread thread = byId.values().iterator().next(); - return thread.listRegisters().thenAccept(regs -> { - List registers; - synchronized (this) { // calls getTargetRegister - // No stale garbage. New architecture may re-use numbers, so clear cache out! - registersByNumber.clear(); - registers = regs.stream().map(this::getTargetRegister).collect(Collectors.toList()); - } - // TODO: Equality only considers paths, i.e., name. If a name is re-used, the old - // stuff has to go. Not sure how to accomplish that, yet. - setElements(registers, "Refreshed"); - }); - } - - protected synchronized GdbModelTargetRegister getTargetRegister(GdbRegister register) { - return registersByNumber.computeIfAbsent(register.getNumber(), - n -> new GdbModelTargetRegister(this, register)); - } - - public CompletableFuture refreshInternal() { - return doRefresh().exceptionally(ex -> { - Msg.error(this, "Problem refreshing inferior's register descriptions", ex); - return null; - }); - } - - public void stateChanged(GdbStateChangeRecord sco) { - requestElements(RefreshBehavior.REFRESH_NEVER).thenAccept(__ -> { - for (GdbModelTargetRegister modelRegister : registersByNumber.values()) { - modelRegister.stateChanged(sco); - } - }); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetSection.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetSection.java deleted file mode 100644 index 216d5e8859..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetSection.java +++ /dev/null @@ -1,100 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.impl; - -import java.util.List; -import java.util.Map; - -import agent.gdb.manager.GdbModuleSection; -import ghidra.dbg.agent.DefaultTargetObject; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.TargetSection; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.util.PathUtils; -import ghidra.program.model.address.*; - -@TargetObjectSchemaInfo( - name = "Section", - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType(type = Void.class) }) -public class GdbModelTargetSection extends - DefaultTargetObject implements TargetSection { - - public static final String VISIBLE_RANGE_ATTRIBUTE_NAME = "Range"; - - protected static String indexSection(GdbModuleSection section) { - return section.getName(); - } - - protected static String keySection(GdbModuleSection section) { - return PathUtils.makeKey(indexSection(section)); - } - - protected final GdbModelImpl impl; - protected final GdbModuleSection section; - - protected final GdbModelTargetModule module; - protected final AddressRange range; - - public GdbModelTargetSection(GdbModelTargetSectionContainer sections, - GdbModelTargetModule module, GdbModuleSection section) { - super(sections.impl, sections, keySection(section), "Section"); - this.impl = sections.impl; - this.section = section; - impl.addModelObject(section, this); - - this.module = module; - this.range = doGetRange(); - this.changeAttributes(List.of(), List.of(), Map.of( - MODULE_ATTRIBUTE_NAME, module, - RANGE_ATTRIBUTE_NAME, range, - VISIBLE_RANGE_ATTRIBUTE_NAME, range, - DISPLAY_ATTRIBUTE_NAME, section.getName()), - "Initialized"); - } - - @Override - public GdbModelTargetModule getModule() { - return module; - } - - protected AddressRange doGetRange() { - if (section.getVmaStart() == section.getVmaEnd()) { - return null; // zero-length range - } - Address min = impl.space.getAddress(section.getVmaStart()); - // Ghidra ranges are inclusive at the end. GDB's are not. - Address max = impl.space.getAddress(section.getVmaEnd() - 1); - return new AddressRangeImpl(min, max); - } - - @Override - public AddressRange getRange() { - return range; - } - - @TargetAttributeType(name = VISIBLE_RANGE_ATTRIBUTE_NAME) - public AddressRange getVisibleRange() { - return range; - } - - @Override - public String getDisplay() { - return section.getName(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetSectionContainer.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetSectionContainer.java deleted file mode 100644 index 8b8d8c6e04..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetSectionContainer.java +++ /dev/null @@ -1,79 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import agent.gdb.manager.GdbModuleSection; -import ghidra.async.AsyncUtils; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.agent.DefaultTargetObject; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.TargetSectionContainer; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; - -@TargetObjectSchemaInfo( - name = "SectionContainer", - attributes = { - @TargetAttributeType(type = Void.class) }, - canonicalContainer = true) -public class GdbModelTargetSectionContainer - extends DefaultTargetObject - implements TargetSectionContainer { - public static final String NAME = "Sections"; - - protected final GdbModelImpl impl; - protected final GdbModelTargetModule module; - - public GdbModelTargetSectionContainer(GdbModelTargetModule module) { - super(module.impl, module, NAME, "SectionContainer"); - this.impl = module.impl; - this.module = module; - } - - protected void updateUsingSections(Map byName) { - List sections; - synchronized (this) { - sections = byName.values() - .stream() - .filter(s -> s.getAttributes().contains("ALLOC")) - .map(this::getTargetSection) - .collect(Collectors.toList()); - } - setElements(sections, "Refreshed"); - parent.sectionsRefreshed(); // recompute base - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - if (!refresh.isRefresh(elements.keySet())) { - return AsyncUtils.nil(); - } - return module.module.listSections(true).thenAccept(this::updateUsingSections); - } - - protected synchronized GdbModelTargetSection getTargetSection(GdbModuleSection section) { - TargetObject modelObject = impl.getModelObject(section); - if (modelObject != null) { - return (GdbModelTargetSection) modelObject; - } - return new GdbModelTargetSection(this, module, section); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetSession.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetSession.java deleted file mode 100644 index 55ea252f77..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetSession.java +++ /dev/null @@ -1,361 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.impl; - -import java.io.IOException; -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import agent.gdb.manager.*; -import agent.gdb.manager.impl.*; -import agent.gdb.manager.impl.cmd.GdbConsoleExecCommand.CompletesWithRunning; -import agent.gdb.manager.impl.cmd.GdbStateChangeRecord; -import agent.gdb.manager.reason.GdbReason; -import ghidra.async.AsyncUtils; -import ghidra.dbg.agent.DefaultTargetModelRoot; -import ghidra.dbg.error.DebuggerIllegalArgumentException; -import ghidra.dbg.target.*; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.util.PathUtils; -import ghidra.util.Msg; - -/** - * TODO: We should probably expose the raw CLI (if available) via TargetConsole, and perhaps re-work - * the UI to use it when available. This could more generally solve the multi-line input thing, and - * provide a distinction between API access (where {@link TargetInterpreter} makes more sense), and - * I/O access (where {@link TargetConsole}) makes more sense. I'm hoping this will also allow the - * CLI to prompt the user when appropriate, e.g., on {@code quit} when an inferior is active. NOTE: - * Probably should not expose raw MI2 via TargetConsole - */ -@TargetObjectSchemaInfo( - name = "Session", - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType(type = Void.class) }) -public class GdbModelTargetSession extends DefaultTargetModelRoot - implements TargetAccessConditioned, TargetAttacher, TargetInterpreter, TargetInterruptible, - TargetLauncher, TargetActiveScope, TargetEventScope, TargetFocusScope, - GdbConsoleOutputListener, GdbEventsListenerAdapter { - protected static final String GDB_PROMPT = "(gdb)"; - - protected final GdbModelImpl impl; - protected String display = "GNU gdb (GDB)"; - - protected final GdbModelTargetInferiorContainer inferiors; - protected final GdbModelTargetAvailableContainer available; - protected final GdbModelTargetBreakpointContainer breakpoints; - - private boolean accessible = true; - protected GdbModelSelectableObject focus; - - protected String debugger = "gdb"; // Used by GdbModelTargetEnvironment - - public GdbModelTargetSession(GdbModelImpl impl, TargetObjectSchema schema) { - super(impl, "Session", schema); - this.impl = impl; - //impl.addModelObject(session, this); - - this.inferiors = new GdbModelTargetInferiorContainer(this); - this.available = new GdbModelTargetAvailableContainer(this); - this.breakpoints = new GdbModelTargetBreakpointContainer(this); - - changeAttributes(List.of(), Map.of( // - inferiors.getName(), inferiors, // - available.getName(), available, // - breakpoints.getName(), breakpoints, // - ACCESSIBLE_ATTRIBUTE_NAME, accessible, // - PROMPT_ATTRIBUTE_NAME, GDB_PROMPT, // - DISPLAY_ATTRIBUTE_NAME, display, // - TargetMethod.PARAMETERS_ATTRIBUTE_NAME, GdbModelTargetInferior.PARAMETERS, // - SUPPORTED_ATTACH_KINDS_ATTRIBUTE_NAME, GdbModelTargetInferior.SUPPORTED_KINDS, // - FOCUS_ATTRIBUTE_NAME, this // Satisfy schema. Will be set to first inferior. - ), "Initialized"); - impl.gdb.addEventsListener(this); - impl.gdb.addConsoleOutputListener(this); - - getVersion(); - } - - @TargetAttributeType(name = GdbModelTargetInferiorContainer.NAME, required = true, fixed = true) - public GdbModelTargetInferiorContainer getInferiors() { - return inferiors; - } - - @TargetAttributeType( - name = GdbModelTargetAvailableContainer.NAME, - required = true, - fixed = true) - public GdbModelTargetAvailableContainer getAvailable() { - return available; - } - - @TargetAttributeType( - name = GdbModelTargetBreakpointContainer.NAME, - required = true, - fixed = true) - public GdbModelTargetBreakpointContainer getBreakpoints() { - return breakpoints; - } - - protected void getVersion() { - impl.gdb.waitForPrompt().thenCompose(__ -> { - return impl.gdb.consoleCapture("show version", CompletesWithRunning.CANNOT); - }).thenAccept(out -> { - debugger = out; - changeAttributes(List.of(), - Map.of(DISPLAY_ATTRIBUTE_NAME, display = out.split("\n")[0].strip() // - ), "Version refreshed"); - }).exceptionally(e -> { - model.reportError(this, "Could not get GDB version", e); - debugger = "gdb"; - return null; - }); - } - - @Override - public String getDisplay() { - return display; - } - - @Override - public void output(GdbManager.Channel gdbChannel, String out) { - if (!valid) { - return; - } - TargetConsole.Channel dbgChannel; - switch (gdbChannel) { - case STDOUT: - dbgChannel = TargetConsole.Channel.STDOUT; - break; - case STDERR: - dbgChannel = TargetConsole.Channel.STDERR; - break; - default: - throw new AssertionError(); - } - broadcast().consoleOutput(this, dbgChannel, out); - } - - @Override - public void inferiorSelected(GdbInferior inferior, GdbCause cause) { - if (inferior.getKnownThreads().isEmpty()) { - GdbModelTargetInferior inf = inferiors.getTargetInferior(inferior); - setFocus(inf); - } - // Otherwise, we'll presumably get the =thread-selected event - } - - /** - * TODO: This check should be done in the manager? This "internal" concept is either a manager - * concept or a model concept. Right now, it breaches the interface. - * - * @param cause the cause to examine - * @return true if internal - */ - protected boolean isFocusInternallyDriven(GdbCause cause) { - if (cause == null || cause == GdbCause.Causes.UNCLAIMED) { - return false; - } - if (cause instanceof GdbEvent) { - return false; - } - if (cause instanceof GdbPendingCommand) { - GdbPendingCommand pcmd = (GdbPendingCommand) cause; - GdbCommand cmd = pcmd.getCommand(); - return cmd.isFocusInternallyDriven(); - } - return true; - } - - @Override - public void threadSelected(GdbThread thread, GdbStackFrame frame, GdbCause cause) { - if (isFocusInternallyDriven(cause)) { - return; - } - GdbModelTargetInferior inf = inferiors.getTargetInferior(thread.getInferior()); - GdbModelTargetThread t = inf.threads.getTargetThread(thread); - if (frame == null) { - GdbModelSelectableObject curFocus = getFocus(); - if (curFocus != null && !PathUtils.isAncestor(t.getPath(), curFocus.getPath())) { - setFocus(t); - } - return; - } - GdbModelTargetStackFrame f = t.stack.getTargetFrame(frame); - setFocus(f); - } - - public void setAccessible(boolean accessible) { - changeAttributes(List.of(), Map.of( // - ACCESSIBLE_ATTRIBUTE_NAME, this.accessible = accessible // - ), "Accessibility changed"); - } - - @Override - public boolean isAccessible() { - return accessible; - } - - @Override - public CompletableFuture launch(Map args) { - List cmdLineArgs = - CmdLineParser.tokenize(TargetCmdLineLauncher.PARAMETER_CMDLINE_ARGS.get(args)); - Boolean useStarti = GdbModelTargetInferior.PARAMETER_STARTI.get(args); - return impl.gateFuture(impl.gdb.availableInferior().thenCompose(inf -> { - return GdbModelImplUtils.launch(inf, cmdLineArgs, useStarti, () -> { - return inferiors.getTargetInferior(inf).environment.refreshInternal(); - }); - }).thenApply(__ -> null)); - } - - @Override - public CompletableFuture attach(TargetAttachable attachable) { - GdbModelTargetAttachable mine = impl.assertMine(GdbModelTargetAttachable.class, attachable); - return attach(mine.pid); - } - - @Override - public CompletableFuture attach(long pid) { - return impl.gateFuture(impl.gdb.availableInferior().thenCompose(inf -> { - return inf.attach(pid).thenApply(__ -> null); - })); - } - - @Override - public CompletableFuture interrupt() { - //return impl.gdb.interrupt(); - try { - impl.gdb.sendInterruptNow(); - //impl.gdb.cancelCurrentCommand(); - } - catch (IOException e) { - Msg.error(this, "Could not interrupt", e); - } - return AsyncUtils.nil(); - } - - @Override - public CompletableFuture execute(String cmd) { - return impl.gateFuture(impl.gdb.console(cmd).exceptionally(GdbModelImpl::translateEx)); - } - - @Override - public CompletableFuture executeCapture(String cmd) { - return impl - .gateFuture(impl.gdb.consoleCapture(cmd).exceptionally(GdbModelImpl::translateEx)); - } - - @Override - public CompletableFuture requestActivation(TargetObject obj) { - impl.assertMine(TargetObject.class, obj); - /** - * Yes, this is pointless, since I'm the root, but do it right (TM), since this may change - * or be used as an example for other implementations. - */ - if (!PathUtils.isAncestor(this.getPath(), obj.getPath())) { - throw new DebuggerIllegalArgumentException( - "Can only activate a successor of the scope"); - } - TargetObject cur = obj; - while (cur != null) { - if (cur instanceof GdbModelSelectableObject) { - GdbModelSelectableObject sel = (GdbModelSelectableObject) cur; - return sel.setActive(); - } - cur = cur.getParent(); - } - return AsyncUtils.nil(); - - } - - @Override - public CompletableFuture requestFocus(TargetObject obj) { - impl.assertMine(TargetObject.class, obj); - /** - * Yes, this is pointless, since I'm the root, but do it right (TM), since this may change - * or be used as an example for other implementations. - */ - if (!PathUtils.isAncestor(this.getPath(), obj.getPath())) { - throw new DebuggerIllegalArgumentException("Can only focus a successor of the scope"); - } - TargetObject cur = obj; - while (cur != null) { - if (cur instanceof GdbModelSelectableObject) { - GdbModelSelectableObject sel = (GdbModelSelectableObject) cur; - setFocus(sel); - return AsyncUtils.nil(); - } - cur = cur.getParent(); - } - return AsyncUtils.nil(); - } - - protected void invalidateMemoryAndRegisterCaches() { - inferiors.invalidateMemoryAndRegisterCaches(); - } - - protected void setFocus(GdbModelSelectableObject focus) { - changeAttributes(List.of(), Map.of( // - FOCUS_ATTRIBUTE_NAME, this.focus = focus // - ), "Focus changed"); - } - - @Override - public GdbModelSelectableObject getFocus() { - return focus; - } - - @Override - public void inferiorStateChanged(GdbInferior inf, Collection threads, GdbState state, - GdbThread thread, GdbCause cause, GdbReason reason) { - /** - * TODO: It might be nice if the manager gave a manager-level callback for *stopped and - * *running events. Without that, I can't really specify an action to execute, *after* all - * inferiors have completed the stateChanged routines. - */ - GdbStateChangeRecord sco = - new GdbStateChangeRecord(inf, threads, state, thread, cause, reason); - - CompletableFuture infUpdates = - CompletableFuture.allOf(breakpoints.stateChanged(sco), inferiors.stateChanged(sco)); - infUpdates.whenComplete((v, t) -> { - if (thread == null) { - return; - } - /** - * I have to do this for all inferiors, because I don't know in what order they will - * complete. - */ - if (impl.gdb.getKnownThreads().get(thread.getId()) != thread) { - return; - } - thread.setActive(true).exceptionally(ex -> { - impl.reportError(this, "Could not restore event thread", ex); - return null; - }); - }); - } - - @Override - public void threadStateChanged(GdbThread thread, GdbState state, GdbCause cause, - GdbReason reason) { - TargetThread targetThread = (TargetThread) impl.getModelObject(thread); - changeAttributes(List.of(), List.of(), Map.of( // - TargetEventScope.EVENT_OBJECT_ATTRIBUTE_NAME, targetThread // - ), reason.desc()); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetStack.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetStack.java deleted file mode 100644 index f30ff2a153..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetStack.java +++ /dev/null @@ -1,107 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import agent.gdb.manager.GdbStackFrame; -import agent.gdb.manager.GdbThread; -import agent.gdb.manager.impl.cmd.GdbStateChangeRecord; -import ghidra.async.AsyncUtils; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.agent.DefaultTargetObject; -import ghidra.dbg.target.TargetStack; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; -import ghidra.util.datastruct.WeakValueHashMap; - -@TargetObjectSchemaInfo( - name = "Stack", - attributes = { - @TargetAttributeType(type = Void.class) }, - canonicalContainer = true) -public class GdbModelTargetStack extends - DefaultTargetObject implements TargetStack { - public static final String NAME = "Stack"; - - protected final GdbModelImpl impl; - protected final GdbModelTargetInferior inferior; - protected final GdbThread thread; - - protected final Map framesByLevel = new WeakValueHashMap<>(); - - public GdbModelTargetStack(GdbModelTargetThread thread, GdbModelTargetInferior inferior) { - super(thread.impl, thread, NAME, "Stack"); - this.impl = thread.impl; - this.inferior = inferior; - this.thread = thread.thread; - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - return thread.listStackFrames().thenAccept(f -> { - List frames; - synchronized (this) { - frames = f.stream().map(this::getTargetFrame).collect(Collectors.toList()); - } - setElements(frames, "Refreshed"); - //Msg.debug(this, "Completed stack frames update"); - }); - } - - protected synchronized GdbModelTargetStackFrame getTargetFrame(GdbStackFrame frame) { - return framesByLevel.compute(frame.getLevel(), (l, f) -> { - if (f == null) { - return new GdbModelTargetStackFrame(this, parent, inferior, frame); - } - f.setFrame(frame); - return f; - }); - } - - protected synchronized GdbModelTargetStackFrame getTargetFrameByLevel(int i) { - return framesByLevel.get(i); - } - - protected void invalidateRegisterCaches() { - for (GdbModelTargetStackFrame frame : framesByLevel.values()) { - frame.invalidateRegisterCaches(); - } - } - - /** - * Re-fetch the stack frames, generating events for updates - * - *

- * GDB doesn't produce stack change events, but they should only ever happen by running a - * target. Thus, every time we're STOPPED, this method should be called. - */ - public CompletableFuture stateChanged(GdbStateChangeRecord sco) { - return requestElements(RefreshBehavior.REFRESH_ALWAYS).thenCompose(__ -> { - GdbModelTargetStackFrame innermost = framesByLevel.get(0); - if (innermost != null) { - return innermost.stateChanged(sco); - } - return AsyncUtils.nil(); - }).exceptionally(e -> { - impl.reportError(this, "Could not update stack " + this + " on STOPPED", e); - return null; - }); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetStackFrame.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetStackFrame.java deleted file mode 100644 index 84bc602c05..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetStackFrame.java +++ /dev/null @@ -1,141 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import agent.gdb.manager.GdbStackFrame; -import agent.gdb.manager.impl.cmd.GdbStateChangeRecord; -import ghidra.dbg.agent.DefaultTargetObject; -import ghidra.dbg.target.*; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.util.PathUtils; -import ghidra.lifecycle.Internal; -import ghidra.program.model.address.Address; - -@TargetObjectSchemaInfo( - name = "StackFrame", - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType(type = Void.class) }) -public class GdbModelTargetStackFrame - extends DefaultTargetObject - implements TargetStackFrame, TargetAggregate, GdbModelSelectableObject { - public static final String FUNC_ATTRIBUTE_NAME = PREFIX_INVISIBLE + "function"; - public static final String FROM_ATTRIBUTE_NAME = PREFIX_INVISIBLE + "from"; // TODO - - protected static String indexFrame(GdbStackFrame frame) { - return PathUtils.makeIndex(frame.getLevel()); - } - - protected static String keyFrame(GdbStackFrame frame) { - return PathUtils.makeKey(indexFrame(frame)); - } - - protected static String computeDisplay(GdbStackFrame frame) { - // TODO: Alternative formats when function is not known? - return String.format("#%d 0x%s in %s ()", frame.getLevel(), frame.getAddress().toString(16), - frame.getFunction()); - } - - protected final GdbModelImpl impl; - protected final GdbModelTargetThread thread; - protected final GdbModelTargetInferior inferior; - - protected GdbStackFrame frame; - protected Address pc; - protected String func; - protected String display; - - private final GdbModelTargetStackFrameRegisterContainer registers; - - public GdbModelTargetStackFrame(GdbModelTargetStack stack, GdbModelTargetThread thread, - GdbModelTargetInferior inferior, GdbStackFrame frame) { - super(stack.impl, stack, keyFrame(frame), "StackFrame"); - this.impl = stack.impl; - this.thread = thread; - this.inferior = inferior; - impl.addModelObject(frame, this); - - this.registers = new GdbModelTargetStackFrameRegisterContainer(this); - - changeAttributes(List.of(), - List.of( - registers), - Map.of( - DISPLAY_ATTRIBUTE_NAME, display = computeDisplay(frame)), - "Initialized"); - setFrame(frame); - } - - @TargetAttributeType( - name = GdbModelTargetStackFrameRegisterContainer.NAME, - required = true, - fixed = true) - public GdbModelTargetStackFrameRegisterContainer getRegisters() { - return registers; - } - - protected void setFrame(GdbStackFrame frame) { - frame = frame.fillWith(this.frame); - if (this.frame == frame) { - return; - } - this.frame = frame; - this.pc = impl.space.getAddress(frame.getAddress().longValue()); - this.func = frame.getFunction(); - // TODO: module? "from" - - changeAttributes(List.of(), - List.of( - registers), - Map.of( - PC_ATTRIBUTE_NAME, pc, - FUNC_ATTRIBUTE_NAME, func, - DISPLAY_ATTRIBUTE_NAME, display = computeDisplay(frame)), - "Refreshed"); - } - - protected void invalidateRegisterCaches() { - if (!valid) { - return; - } - broadcast().invalidateCacheRequested(this); - } - - @Override - @Internal - public CompletableFuture setActive() { - return impl.gateFuture(frame.setActive(false)); - } - - @TargetAttributeType(name = FUNC_ATTRIBUTE_NAME, hidden = true) - public String getFunction() { - return func; - } - - @Override - public Address getProgramCounter() { - return pc; - } - - public CompletableFuture stateChanged(GdbStateChangeRecord sco) { - return registers.stateChanged(sco); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetStackFrameRegister.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetStackFrameRegister.java deleted file mode 100644 index 55403c9381..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetStackFrameRegister.java +++ /dev/null @@ -1,92 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.impl; - -import java.math.BigInteger; -import java.util.List; -import java.util.Map; - -import agent.gdb.manager.GdbRegister; -import ghidra.dbg.agent.DefaultTargetObject; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.TargetRegister; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.util.PathUtils; - -@TargetObjectSchemaInfo( - name = "RegisterValue", - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType(type = Void.class) }) -public class GdbModelTargetStackFrameRegister - extends DefaultTargetObject - implements TargetRegister { - - protected static String indexRegister(GdbRegister register) { - String name = register.getName(); - if ("".equals(name)) { - return "UNNAMED," + register.getNumber(); - } - return name; - } - - protected static String keyRegister(GdbRegister register) { - return PathUtils.makeKey(indexRegister(register)); - } - - protected final GdbModelImpl impl; - protected final GdbRegister register; - - protected final int bitLength; - - public GdbModelTargetStackFrameRegister(GdbModelTargetStackFrameRegisterContainer registers, - GdbRegister register) { - super(registers.impl, registers, keyRegister(register), "Register"); - this.impl = registers.impl; - this.register = register; - impl.addModelObject(register, this); - - this.bitLength = register.getSize() * 8; - - changeAttributes(List.of(), Map.of( // - CONTAINER_ATTRIBUTE_NAME, registers, // - BIT_LENGTH_ATTRIBUTE_NAME, bitLength, // - DISPLAY_ATTRIBUTE_NAME, getName(), // - MODIFIED_ATTRIBUTE_NAME, false // - ), "Initialized"); - } - - @Override - public String getDisplay() { - return getCachedAttribute(DISPLAY_ATTRIBUTE_NAME).toString(); - } - - public void stateChanged(byte[] bytes) { - BigInteger bigval = new BigInteger(1, bytes); - String value = bigval.toString(16); - Object oldval = getCachedAttributes().get(VALUE_ATTRIBUTE_NAME); - boolean modified = (bigval.longValue() != 0 && value.equals(oldval)); - - String newval = getName() + " : " + value; - changeAttributes(List.of(), Map.of( // - VALUE_ATTRIBUTE_NAME, value, // - DISPLAY_ATTRIBUTE_NAME, newval, // - MODIFIED_ATTRIBUTE_NAME, modified // - ), "Value Updated"); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetStackFrameRegisterContainer.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetStackFrameRegisterContainer.java deleted file mode 100644 index eb216c5805..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetStackFrameRegisterContainer.java +++ /dev/null @@ -1,200 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.impl; - -import java.math.BigInteger; -import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import agent.gdb.manager.GdbRegister; -import agent.gdb.manager.impl.cmd.GdbStateChangeRecord; -import ghidra.async.AsyncUtils; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.agent.DefaultTargetObject; -import ghidra.dbg.error.DebuggerRegisterAccessException; -import ghidra.dbg.target.TargetRegisterBank; -import ghidra.dbg.target.TargetRegisterContainer; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; -import ghidra.dbg.util.ConversionUtils; -import ghidra.util.Msg; -import ghidra.util.datastruct.WeakValueHashMap; - -@TargetObjectSchemaInfo( - name = "RegisterValueContainer", - elementResync = ResyncMode.ONCE, - attributes = { - @TargetAttributeType(type = Void.class) }, - canonicalContainer = true) -public class GdbModelTargetStackFrameRegisterContainer - extends DefaultTargetObject - implements TargetRegisterContainer, TargetRegisterBank { - public static final String NAME = "Registers"; - - protected final GdbModelImpl impl; - protected final GdbModelTargetStackFrame frame; - protected final GdbModelTargetThread thread; - - private Map regValues = new HashMap<>(); - - protected final Map registersByNumber = - new WeakValueHashMap<>(); - protected final Set allRegisters = new LinkedHashSet<>(); - - public GdbModelTargetStackFrameRegisterContainer(GdbModelTargetStackFrame frame) { - super(frame.impl, frame, NAME, "StackFrameRegisterContainer"); - this.impl = frame.impl; - this.frame = frame; - this.thread = frame.thread; - - changeAttributes(List.of(), List.of(), Map.of(DESCRIPTIONS_ATTRIBUTE_NAME, this), - "Initialized"); - } - - @Override - public GdbModelTargetStackFrameRegisterContainer getDescriptions() { - return this; - } - - protected CompletableFuture> ensureRegisterDescriptions() { - if (elements.isEmpty()) { - return populateRegisterDescriptions().thenApply(__ -> elements); - } - return CompletableFuture.completedFuture(elements); - } - - /** - * Get the descriptors without populating the values - * - *

- * This need only be called once, but values must be updated every STOPPED/read - */ - protected CompletableFuture populateRegisterDescriptions() { - return thread.thread.listRegisters().thenAccept(regs -> { - if (!valid) { - return; - } - List registers; - synchronized (this) { - if (regs.size() != registersByNumber.size()) { - allRegisters.clear(); - registersByNumber.clear(); - } - allRegisters.addAll(regs); - registers = regs.stream().map(this::getTargetRegister).collect(Collectors.toList()); - } - setElements(registers, Map.of(), "Refreshed"); - }); - } - - protected CompletableFuture> updateRegisterValues(Set toRead) { - return frame.frame.readRegisters(toRead).thenApply(vals -> { - Map result = new LinkedHashMap<>(); - for (Map.Entry ent : vals.entrySet()) { - GdbRegister reg = ent.getKey(); - String regName = reg.getName(); - BigInteger val = ent.getValue(); - if (val == null) { - Msg.warn(this, "Register " + regName + " value came back null."); - continue; - } - byte[] bytes = ConversionUtils.bigIntegerToBytes(reg.getSize(), val); - result.put(regName, bytes); - elements.get(regName).stateChanged(bytes); - } - this.regValues = result; - broadcast().registersUpdated(this, result); - return result; - }); - } - - /** - * Does both descriptions and then populates values - */ - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - // NB. GDB manager caches these per thread - return ensureRegisterDescriptions().thenCompose(regs -> { - if (!regs.isEmpty()) { - return updateRegisterValues(allRegisters); - } - return AsyncUtils.nil(); - }).thenApply(__ -> null); - } - - protected synchronized GdbModelTargetStackFrameRegister getTargetRegister( - GdbRegister register) { - return registersByNumber.computeIfAbsent(register.getNumber(), - n -> new GdbModelTargetStackFrameRegister(this, register)); - } - - @Override - public CompletableFuture> readRegistersNamed( - Collection names) { - return model.gateFuture(ensureRegisterDescriptions().thenCompose(regs -> { - Set toRead = new LinkedHashSet<>(); - for (String regname : names) { - GdbModelTargetStackFrameRegister reg = regs.get(regname); - if (reg == null) { - throw new DebuggerRegisterAccessException("No such register: " + regname); - } - toRead.add(reg.register); - } - return updateRegisterValues(toRead); - })); - } - - @Override - public Map getCachedRegisters() { - return regValues; - } - - @Override - public CompletableFuture writeRegistersNamed(Map values) { - Map toWrite = new LinkedHashMap<>(); - return model.gateFuture(ensureRegisterDescriptions().thenCompose(regs -> { - for (Map.Entry ent : values.entrySet()) { - String regname = ent.getKey(); - GdbModelTargetStackFrameRegister reg = regs.get(regname); - if (reg == null) { - throw new DebuggerRegisterAccessException("No such register: " + regname); - } - BigInteger val = new BigInteger(1, ent.getValue()); - toWrite.put(reg.register, val); - } - return frame.frame.writeRegisters(toWrite); - }).thenCompose(__ -> { - return updateRegisterValues(toWrite.keySet()); - }).thenCompose(__ -> { - return frame.getParent().fetchElements(RefreshBehavior.REFRESH_ALWAYS); - })).thenApply(__ -> null); - } - - public CompletableFuture stateChanged(GdbStateChangeRecord sco) { - return requestElements(RefreshBehavior.REFRESH_NEVER).exceptionally(ex -> { - if (!valid) { - Msg.info(this, - "Ignoring error when refreshing now-invalid thread registers: " + ex); - } - else { - impl.reportError(this, "Trouble updating registers on state change", ex); - } - return null; - }); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetSymbol.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetSymbol.java deleted file mode 100644 index 01d43bbecb..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetSymbol.java +++ /dev/null @@ -1,85 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.impl; - -import java.util.List; -import java.util.Map; - -import agent.gdb.manager.impl.GdbMinimalSymbol; -import ghidra.dbg.agent.DefaultTargetObject; -import ghidra.dbg.target.*; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.util.PathUtils; -import ghidra.program.model.address.Address; - -@TargetObjectSchemaInfo( - name = "Symbol", - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType(name = TargetBreakpointSpec.AS_BPT_ATTRIBUTE_NAME, type = String.class), - @TargetAttributeType(type = Void.class) }) -public class GdbModelTargetSymbol extends - DefaultTargetObject implements TargetSymbol { - protected static String indexSymbol(GdbMinimalSymbol symbol) { - return symbol.getName(); - } - - protected static String keySymbol(GdbMinimalSymbol symbol) { - return PathUtils.makeKey(indexSymbol(symbol)); - } - - protected final boolean constant; - protected final Address value; - protected final long size; - - public GdbModelTargetSymbol(GdbModelTargetSymbolContainer symbols, GdbMinimalSymbol symbol) { - super(symbols.impl, symbols, keySymbol(symbol), "Symbol"); - symbols.impl.addModelObject(symbol, this); - this.constant = false; - this.value = symbols.impl.space.getAddress(symbol.getAddress()); - this.size = 0; - - changeAttributes(List.of(), Map.of( - NAMESPACE_ATTRIBUTE_NAME, symbols, - // TODO: DATA_TYPE - VALUE_ATTRIBUTE_NAME, value, - SIZE_ATTRIBUTE_NAME, size, - DISPLAY_ATTRIBUTE_NAME, symbol.getName(), - TargetBreakpointSpec.AS_BPT_ATTRIBUTE_NAME, symbol.getName()), - "Initialized"); - } - - @Override - public GdbModelTargetSymbolContainer getNamespace() { - return parent; - } - - @Override - public boolean isConstant() { - return constant; - } - - @Override - public Address getValue() { - return value; - } - - @Override - public long getSize() { - return size; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetSymbolContainer.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetSymbolContainer.java deleted file mode 100644 index 9f1c77623a..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetSymbolContainer.java +++ /dev/null @@ -1,72 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.impl; - -import java.util.List; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import agent.gdb.manager.impl.GdbMinimalSymbol; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.agent.DefaultTargetObject; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.TargetSymbolNamespace; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; - -@TargetObjectSchemaInfo( - name = "SymbolContainer", - elementResync = ResyncMode.ONCE, - attributes = { - @TargetAttributeType(type = Void.class) }, - canonicalContainer = true) -public class GdbModelTargetSymbolContainer - extends DefaultTargetObject - implements TargetSymbolNamespace { - public static final String NAME = "Symbols"; - - protected final GdbModelImpl impl; - protected final GdbModelTargetModule module; - - public GdbModelTargetSymbolContainer(GdbModelTargetModule module) { - super(module.impl, module, NAME, "SymbolContainer"); - this.impl = module.impl; - this.module = module; - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - return module.module.listMinimalSymbols().thenAccept(byName -> { - List symbols; - synchronized (this) { - symbols = byName.values() - .stream() - .map(this::getTargetSymbol) - .collect(Collectors.toList()); - } - setElements(symbols, "Refreshed"); - }); - } - - protected synchronized GdbModelTargetSymbol getTargetSymbol(GdbMinimalSymbol symbol) { - TargetObject modelObject = impl.getModelObject(symbol); - if (modelObject != null) { - return (GdbModelTargetSymbol) modelObject; - } - return new GdbModelTargetSymbol(this, symbol); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetThread.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetThread.java deleted file mode 100644 index 85ca55c132..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetThread.java +++ /dev/null @@ -1,273 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.impl; - -import java.lang.invoke.MethodHandles; -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import agent.gdb.manager.*; -import agent.gdb.manager.GdbManager.StepCmd; -import agent.gdb.manager.impl.GdbFrameInfo; -import agent.gdb.manager.impl.GdbThreadInfo; -import agent.gdb.manager.impl.cmd.GdbStateChangeRecord; -import agent.gdb.manager.reason.GdbBreakpointHitReason; -import ghidra.async.AsyncUtils; -import ghidra.dbg.agent.DefaultTargetObject; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetMethod.AnnotatedTargetMethod; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.util.PathUtils; -import ghidra.lifecycle.Internal; -import ghidra.program.model.address.Address; -import ghidra.util.Msg; - -@TargetObjectSchemaInfo( - name = "Thread", - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType(type = Void.class) }) -public class GdbModelTargetThread - extends DefaultTargetObject implements - TargetThread, TargetExecutionStateful, TargetSteppable, TargetAggregate, - GdbModelSelectableObject { - protected static final TargetStepKindSet SUPPORTED_KINDS = TargetStepKindSet.of( - TargetStepKind.FINISH, - TargetStepKind.LINE, - TargetStepKind.OVER, - TargetStepKind.OVER_LINE, - TargetStepKind.RETURN, - TargetStepKind.UNTIL); - - protected static String indexThread(int threadId) { - return PathUtils.makeIndex(threadId); - } - - protected static String indexThread(GdbThread thread) { - return indexThread(thread.getId()); - } - - protected static String keyThread(GdbThread thread) { - return PathUtils.makeKey(indexThread(thread)); - } - - protected final GdbModelImpl impl; - protected final GdbThread thread; - private GdbInferior inferior; - protected String display; - protected String shortDisplay; - protected GdbThreadInfo info; - protected TargetExecutionState state = TargetExecutionState.INACTIVE; - private Integer base = 10; - - protected final GdbModelTargetStack stack; - - public GdbModelTargetThread(GdbModelTargetThreadContainer threads, - GdbModelTargetInferior inferior, GdbThread thread) { - super(threads.impl, threads, keyThread(thread), "Thread"); - this.impl = threads.impl; - this.inferior = inferior.inferior; - this.thread = thread; - impl.addModelObject(thread, this); - - this.stack = new GdbModelTargetStack(this, inferior); - - changeAttributes(List.of(), List.of(), - AnnotatedTargetMethod.collectExports(MethodHandles.lookup(), impl, this), - "Methods"); - changeAttributes(List.of(), List.of(stack), Map.of( - STATE_ATTRIBUTE_NAME, state = convertState(thread.getState()), - SUPPORTED_STEP_KINDS_ATTRIBUTE_NAME, SUPPORTED_KINDS, - SHORT_DISPLAY_ATTRIBUTE_NAME, shortDisplay = computeShortDisplay(), - DISPLAY_ATTRIBUTE_NAME, display = computeDisplay()), - "Initialized"); - - updateInfo().exceptionally(ex -> { - Msg.error(this, "Could not initialize thread info"); - return null; - }); - } - - @TargetAttributeType(name = GdbModelTargetStack.NAME, required = true, fixed = true) - public GdbModelTargetStack getStack() { - return stack; - } - - private static Long intToLong(Integer i) { - return i == null ? null : i.longValue(); - } - - private CompletableFuture updateInfo() { - return thread.getInfo().thenAccept(res -> { - this.info = res; - changeAttributes(List.of(), Map.of( // - SHORT_DISPLAY_ATTRIBUTE_NAME, shortDisplay = computeShortDisplay(), // - TID_ATTRIBUTE_NAME, intToLong(info.getTid()), // - DISPLAY_ATTRIBUTE_NAME, display = computeDisplay() // - ), "Initialized"); - }); - } - - protected String computeDisplay() { - StringBuilder sb = new StringBuilder(); - sb.append(shortDisplay); - if (info != null) { - sb.append(" "); - sb.append(info.getInferiorName()); - sb.append(" "); - sb.append(state.name().toLowerCase()); - sb.append(" "); - List frames = info.getFrames(); - if (!frames.isEmpty()) { - GdbFrameInfo frame = frames.get(0); - sb.append("at 0x"); - sb.append(frame.getAddr()); - sb.append(" in "); - sb.append(frame.getFunc()); - } - } - else { - sb.append(" "); - String executableName = stack.inferior.inferior.getExecutable(); - if (executableName != null) { - sb.append(executableName); - } - GdbModelTargetStackFrame top = stack.framesByLevel.get(0); - if (top == null) { - return sb.toString(); - } - sb.append(" 0x"); - sb.append(top.frame.getAddress().toString(16)); - sb.append(" in "); - sb.append(top.frame.getFunction()); - sb.append(" ()"); - } - return sb.toString(); - } - - protected String computeShortDisplay() { - StringBuilder sb = new StringBuilder(); - sb.append("["); - sb.append(inferior.getId()); - sb.append("."); - if (info == null) { - sb.append(thread.getId()); - } - else { - sb.append(info.getId()); - Integer tid = info.getTid(); - if (tid != null) { - String tidstr = Integer.toString(tid, base); - if (base == 16) { - tidstr = "0x" + tidstr; - } - sb.append(":"); - sb.append(tidstr); - } - } - sb.append("]"); - return sb.toString(); - } - - protected TargetExecutionState convertState(GdbState state) { - switch (state) { - case RUNNING: - return TargetExecutionState.RUNNING; - case STOPPED: - default: - return TargetExecutionState.STOPPED; - } - } - - protected static StepCmd convertToGdb(TargetStepKind kind) { - switch (kind) { - case FINISH: - return StepCmd.FINISH; - case INTO: - return StepCmd.STEPI; - case LINE: - return StepCmd.STEP; - case OVER: - return StepCmd.NEXTI; - case OVER_LINE: - return StepCmd.NEXT; - case RETURN: - return StepCmd.RETURN; - case UNTIL: - return StepCmd.UNTIL; - default: - throw new AssertionError(); - } - } - - @Override - public CompletableFuture step(TargetStepKind kind) { - switch (kind) { - case SKIP: - case EXTENDED: - throw new UnsupportedOperationException(kind.name()); - default: - return model.gateFuture(thread.step(convertToGdb(kind))); - } - } - - @TargetMethod.Export("Advance") - public CompletableFuture advance( - @TargetMethod.Param( - name = "target", - display = "Target", - description = "The address to advance to") Address target) { - return impl.gateFuture(thread.advance(target.getOffset())); - } - - protected void invalidateRegisterCaches() { - stack.invalidateRegisterCaches(); - } - - @Override - @Internal - public CompletableFuture setActive() { - return impl.gateFuture(thread.setActive(false)); - } - - public GdbModelTargetBreakpointLocation breakpointHit(GdbBreakpointHitReason reason) { - GdbStackFrame frame = reason.getFrame(thread); - GdbModelTargetStackFrame targetFrame = stack.getTargetFrame(frame); - long bpId = reason.getBreakpointId(); - return impl.session.breakpoints.breakpointHit(bpId, targetFrame); - } - - public CompletableFuture stateChanged(GdbStateChangeRecord sco) { - GdbState gdbState = sco.getState(); - CompletableFuture result = AsyncUtils.nil(); - if (gdbState == GdbState.STOPPED) { - Msg.debug(this, "Updating stack for " + this); - result = CompletableFuture.allOf(updateInfo(), stack.stateChanged(sco)); - } - changeAttributes(List.of(), Map.of( // - STATE_ATTRIBUTE_NAME, state = convertState(gdbState), // - DISPLAY_ATTRIBUTE_NAME, display = computeDisplay() // - ), sco.getReason().desc()); - return result; - } - - public void setBase(Object value) { - this.base = (Integer) value; - updateInfo(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetThreadContainer.java b/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetThreadContainer.java deleted file mode 100644 index d56737d475..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/main/java/agent/gdb/model/impl/GdbModelTargetThreadContainer.java +++ /dev/null @@ -1,190 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import agent.gdb.manager.*; -import agent.gdb.manager.impl.cmd.GdbStateChangeRecord; -import agent.gdb.manager.reason.GdbBreakpointHitReason; -import ghidra.async.AsyncFence; -import ghidra.async.AsyncUtils; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.agent.DefaultTargetObject; -import ghidra.dbg.error.DebuggerIllegalArgumentException; -import ghidra.dbg.target.TargetConfigurable; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; -import ghidra.dbg.util.CollectionUtils.Delta; -import ghidra.util.Msg; - -@TargetObjectSchemaInfo( - name = "ThreadContainer", - attributes = { - @TargetAttributeType(name = TargetConfigurable.BASE_ATTRIBUTE_NAME, type = Integer.class), // - @TargetAttributeType(type = Void.class) // - }, - canonicalContainer = true) -public class GdbModelTargetThreadContainer - extends DefaultTargetObject - implements TargetConfigurable { - public static final String NAME = "Threads"; - - protected final GdbModelImpl impl; - protected final GdbInferior inferior; - - public GdbModelTargetThreadContainer(GdbModelTargetInferior inferior) { - super(inferior.impl, inferior, NAME, "ThreadContainer"); - this.impl = inferior.impl; - this.inferior = inferior.inferior; - this.changeAttributes(List.of(), Map.of(BASE_ATTRIBUTE_NAME, 10), "Initialized"); - } - - public GdbModelTargetThread threadCreated(GdbThread thread) { - // TODO: Can I get a better reason? - GdbModelTargetThread targetThread = getTargetThread(thread); - changeElements(List.of(), List.of(targetThread), "Created"); - return targetThread; - } - - public void threadExited(int threadId) { - synchronized (this) { - GdbModelTargetThread targetThread = - getCachedElements().get(GdbModelTargetThread.indexThread(threadId)); - if (targetThread == null) { - Msg.error(this, "Thread " + threadId + " exited, but was not in model."); - } - else { - impl.deleteModelObject(targetThread.thread); - } - } - changeElements(List.of(GdbModelTargetThread.indexThread(threadId)), List.of(), "Exited"); - } - - protected void updateUsingThreads(Map byTID) { - List threads; - synchronized (this) { - threads = - byTID.values().stream().map(this::getTargetThread).collect(Collectors.toList()); - } - Delta delta = setElements(threads, "Refreshed"); - for (GdbModelTargetThread targetThread : delta.removed.values()) { - impl.deleteModelObject(targetThread.thread); - } - } - - @Override - protected CompletableFuture requestElements(RefreshBehavior refresh) { - if (!refresh.equals(RefreshBehavior.REFRESH_ALWAYS)) { - updateUsingThreads(inferior.getKnownThreads()); - return AsyncUtils.nil(); - } - return doRefresh(); - } - - protected CompletableFuture doRefresh() { - return inferior.listThreads().thenAccept(byTID -> { - updateUsingThreads(byTID); - }); - } - - public synchronized GdbModelTargetThread getTargetThread(GdbThread thread) { - assert thread.getInferior() == inferior; - TargetObject modelObject = impl.getModelObject(thread); - if (modelObject != null) { - return (GdbModelTargetThread) modelObject; - } - return new GdbModelTargetThread(this, parent, thread); - } - - public synchronized GdbModelTargetThread getTargetThreadIfPresent(GdbThread thread) { - return (GdbModelTargetThread) impl.getModelObject(thread); - } - - protected void invalidateRegisterCaches() { - for (GdbThread thread : inferior.getKnownThreads().values()) { - GdbModelTargetThread targetThread = (GdbModelTargetThread) impl.getModelObject(thread); - if (targetThread != null) { - targetThread.invalidateRegisterCaches(); - } - } - } - - public CompletableFuture stateChanged(GdbStateChangeRecord sco) { - /** - * No sense refreshing anything unless we're stopped. Worse yet, because of fun timing - * issues, we often see RUNNING just a little late, since the callbacks are all issued on a - * separate thread. If that RUNNING is received after the manager has processed a - * =thread-exited, we will wind up invalidating that thread early. - */ - if (sco.getState() != GdbState.STOPPED) { - return updateThreadStates(sco); - } - return requestElements(RefreshBehavior.REFRESH_NEVER).thenCompose(__ -> { - return updateThreadStates(sco); - }).exceptionally(__ -> { - Msg.error(this, "Could not update threads " + this + " on STOPPED"); - return null; - }); - } - - protected CompletableFuture updateThreadStates(GdbStateChangeRecord sco) { - AsyncFence fence = new AsyncFence(); - for (GdbThread thread : inferior.getKnownThreads().values()) { - GdbModelTargetThread targetThread = - (GdbModelTargetThread) impl.getModelObject(thread); - if (targetThread != null) { - fence.include(targetThread.stateChanged(sco)); - } - } - return fence.ready(); - } - - public GdbModelTargetBreakpointLocation breakpointHit(GdbBreakpointHitReason reason) { - GdbThread thread = impl.gdb.getThread(reason.getThreadId()); - return getTargetThread(thread).breakpointHit(reason); - } - - @Override - public CompletableFuture writeConfigurationOption(String key, Object value) { - switch (key) { - case BASE_ATTRIBUTE_NAME: - if (value instanceof Integer) { - this.changeAttributes(List.of(), Map.of(BASE_ATTRIBUTE_NAME, value), - "Modified"); - for (GdbModelTargetThread child : this.getCachedElements().values()) { - child.setBase(value); - } - } - else { - throw new DebuggerIllegalArgumentException("Base should be numeric"); - } - default: - } - return AsyncUtils.nil(); - } - - protected CompletableFuture refreshInternal() { - return doRefresh().exceptionally(ex -> { - impl.reportError(this, "Problem refreshing inferior's threads", ex); - return null; - }); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/manager/GdbTableTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/manager/GdbTableTest.java deleted file mode 100644 index 7c1108312d..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/manager/GdbTableTest.java +++ /dev/null @@ -1,175 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager; - -import static org.junit.Assert.*; - -import java.util.*; -import java.util.function.Consumer; - -import org.junit.Ignore; -import org.junit.Test; - -import agent.gdb.manager.parsing.GdbMiParser.GdbMiFieldList; - -@Ignore("deprecated") -public class GdbTableTest { - protected GdbMiFieldList buildFieldList(Consumer conf) { - GdbMiFieldList.Builder builder = GdbMiFieldList.builder(); - conf.accept(builder); - return builder.build(); - } - - protected Map buildMap(Consumer> conf) { - Map builder = new HashMap<>(); - conf.accept(builder); - return Map.copyOf(builder); - } - - protected List buildList(Consumer> conf) { - List builder = new ArrayList<>(); - conf.accept(builder); - return List.copyOf(builder); - } - - protected GdbTable buildTestTable() { - return new GdbTable(buildFieldList((data) -> { - data.add("nr_rows", "3"); - data.add("nr_cols", "2"); - data.add("hdr", buildList((hdr) -> { - hdr.add(buildFieldList((col) -> { - col.add("col_name", "c0"); - col.add("colhdr", "First Column"); - })); - hdr.add(buildFieldList((col) -> { - col.add("col_name", "c1"); - col.add("colhdr", "Second Column"); - })); - })); - data.add("body", buildFieldList((body) -> { - body.add("item", buildFieldList((item) -> { - item.add("c0", "Col1Row1"); - item.add("c1", "Col2Row1"); - })); - body.add("item", buildFieldList((item) -> { - item.add("c1", "Col2Row2"); - item.add("c0", "Col1Row2"); - })); - body.add("item", buildFieldList((item) -> { - item.add("c0", "Col1Row3"); - item.add("c1", "Col2Row3"); - })); - })); - }), "item"); - } - - @Test - public void testBuildGdbTable() { - buildTestTable(); - } - - @Test - public void testColumns() { - GdbTable table = buildTestTable(); - assertEquals(2, table.columns().size()); - assertEquals(new LinkedHashSet<>(Arrays.asList("First Column", "Second Column")), - table.columns().keySet()); - } - - @Test - public void testRowCount() { - GdbTable table = buildTestTable(); - assertEquals(3, table.rows().size()); - assertNotNull(table.rows().get(0)); - assertNotNull(table.rows().get(1)); - assertNotNull(table.rows().get(2)); - try { - table.rows().get(3); - fail(); - } - catch (IndexOutOfBoundsException e) { - // pass - } - } - - @Test - public void testRowContents() { - GdbTable table = buildTestTable(); - Map row; - - row = table.rows().get(0); - assertEquals(2, row.size()); - assertEquals(new HashSet<>(Arrays.asList("First Column", "Second Column")), row.keySet()); - assertEquals("Col1Row1", row.get("First Column")); - assertEquals("Col2Row1", row.get("Second Column")); - - row = table.rows().get(1); - assertEquals(2, row.size()); - assertEquals(new HashSet<>(Arrays.asList("First Column", "Second Column")), row.keySet()); - assertEquals("Col1Row2", row.get("First Column")); - assertEquals("Col2Row2", row.get("Second Column")); - - row = table.rows().get(2); - assertEquals(2, row.size()); - assertEquals(new HashSet<>(Arrays.asList("First Column", "Second Column")), row.keySet()); - assertEquals("Col1Row3", row.get("First Column")); - assertEquals("Col2Row3", row.get("Second Column")); - } - - @Test - public void testRowIterator() { - GdbTable table = buildTestTable(); - List> copied = new ArrayList<>(); - for (Map row : table.rows()) { - copied.add(new LinkedHashMap<>(row)); - } - assertEquals(buildList((expTable) -> { - expTable.add(buildMap((row) -> { - row.put("First Column", "Col1Row1"); - row.put("Second Column", "Col2Row1"); - })); - expTable.add(buildMap((row) -> { - row.put("First Column", "Col1Row2"); - row.put("Second Column", "Col2Row2"); - })); - expTable.add(buildMap((row) -> { - row.put("First Column", "Col1Row3"); - row.put("Second Column", "Col2Row3"); - })); - }), copied); - } - - @Test - public void testColumnIterator() { - GdbTable table = buildTestTable(); - Map> copied = new LinkedHashMap<>(); - for (Map.Entry> col : table.columns().entrySet()) { - copied.put(col.getKey(), new ArrayList<>(col.getValue())); - } - assertEquals(buildMap((expTable) -> { - expTable.put("First Column", buildList((col) -> { - col.add("Col1Row1"); - col.add("Col1Row2"); - col.add("Col1Row3"); - })); - expTable.put("Second Column", buildList((col) -> { - col.add("Col2Row1"); - col.add("Col2Row2"); - col.add("Col2Row3"); - })); - }), copied); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/manager/impl/AbstractGdbManagerTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/manager/impl/AbstractGdbManagerTest.java deleted file mode 100644 index dda44f4063..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/manager/impl/AbstractGdbManagerTest.java +++ /dev/null @@ -1,478 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl; - -import static ghidra.dbg.testutil.DummyProc.run; -import static org.junit.Assert.*; -import static org.junit.Assume.assumeFalse; -import static org.junit.Assume.assumeTrue; - -import java.io.File; -import java.io.IOException; -import java.math.BigInteger; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; -import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.TimeUnit; -import java.util.function.Predicate; -import java.util.stream.Collectors; - -import org.hamcrest.Matchers; -import org.junit.*; - -import agent.gdb.manager.*; -import agent.gdb.manager.GdbManager.StepCmd; -import agent.gdb.manager.breakpoint.GdbBreakpointInfo; -import generic.ULongSpan; -import generic.ULongSpan.ULongSpanSet; -import ghidra.async.AsyncReference; -import ghidra.dbg.testutil.DummyProc; -import ghidra.pty.PtyFactory; -import ghidra.test.AbstractGhidraHeadlessIntegrationTest; -import ghidra.util.Msg; -import ghidra.util.SystemUtilities; - -public abstract class AbstractGdbManagerTest extends AbstractGhidraHeadlessIntegrationTest { - protected static final long TIMEOUT_MILLISECONDS = - SystemUtilities.isInTestingBatchMode() ? 5000 : Long.MAX_VALUE; - - protected File gdbBin; - - protected File findGdbBin() { - return new File(System.getProperty("test.gdbmanager.path", GdbManager.DEFAULT_GDB_CMD)); - } - - @Before - public void findAndCheckGdb() { - gdbBin = findGdbBin(); - assumeTrue(gdbBin.exists()); - } - - protected PtyFactory getPtyFactory() { - return PtyFactory.local(); - } - - protected abstract CompletableFuture startManager(GdbManager manager); - - protected void stopManager() throws IOException { - // Nothing by default - } - - protected T waitOn(CompletableFuture future) throws Throwable { - return future.get(TIMEOUT_MILLISECONDS, TimeUnit.MILLISECONDS); - } - - @After - public void tearDownGdbManagerTest() throws IOException { - stopManager(); - } - - @Test - public void testAddInferior() throws Throwable { - try (GdbManager mgr = GdbManager.newInstance(getPtyFactory())) { - waitOn(startManager(mgr)); - GdbInferior inferior = waitOn(mgr.addInferior()); - assertEquals(2, inferior.getId()); - assertEquals(Set.of(1, 2), mgr.getKnownInferiors().keySet()); - } - } - - @Test - public void testRemoveInferior() throws Throwable { - try (GdbManager mgr = GdbManager.newInstance(getPtyFactory())) { - waitOn(startManager(mgr)); - GdbInferior inf = waitOn(mgr.addInferior()); - assertEquals(2, mgr.getKnownInferiors().size()); - waitOn(inf.remove()); - assertEquals(1, mgr.getKnownInferiors().size()); - assertEquals(1, mgr.currentInferior().getId()); - assertEquals(Set.of(1), mgr.getKnownInferiors().keySet()); - } - } - - @Test - public void testRemoveCurrentInferior() throws Throwable { - try (GdbManager mgr = GdbManager.newInstance(getPtyFactory())) { - List selEvtIdsTemp = new ArrayList<>(); - AsyncReference, Void> selEvtIds = new AsyncReference<>(List.of()); - mgr.addEventsListener(new GdbEventsListenerAdapter() { - @Override - public void inferiorSelected(GdbInferior inferior, GdbCause cause) { - selEvtIdsTemp.add(inferior.getId()); - selEvtIds.set(List.copyOf(selEvtIdsTemp), null); - } - }); - waitOn(startManager(mgr)); - waitOn(selEvtIds.waitValue(List.of(1))); - waitOn(mgr.addInferior()); - assertEquals(2, mgr.getKnownInferiors().size()); - waitOn(mgr.currentInferior().remove()); - assertEquals(1, mgr.getKnownInferiors().size()); - assertEquals(2, mgr.currentInferior().getId()); - assertEquals(Set.of(2), mgr.getKnownInferiors().keySet()); - waitOn(selEvtIds.waitValue(List.of(1, 2))); - } - } - - @Test - public void testConsoleCapture() throws Throwable { - try (GdbManager mgr = GdbManager.newInstance(getPtyFactory())) { - waitOn(startManager(mgr)); - String out = waitOn(mgr.consoleCapture("echo test")); - assertEquals("test", out.trim()); - } - } - - @Test - public void testListInferiors() throws Throwable { - try (GdbManager mgr = GdbManager.newInstance(getPtyFactory())) { - waitOn(startManager(mgr)); - Map inferiors = waitOn(mgr.listInferiors()); - assertEquals(new HashSet<>(Arrays.asList(new Integer[] { 1 })), inferiors.keySet()); - } - } - - @Test - public void testListAvailableProcesses() throws Throwable { - try (GdbManager mgr = GdbManager.newInstance(getPtyFactory())) { - waitOn(startManager(mgr)); - List procs = waitOn(mgr.listAvailableProcesses()); - List pids = procs.stream().map(p -> p.getPid()).collect(Collectors.toList()); - assertTrue(pids.contains(1)); // Weak check, but on Linux, 1 (init) is always running - } - } - - @Test - public void testListModulesAndSections() throws Throwable { - try (GdbManager mgr = GdbManager.newInstance(getPtyFactory())) { - // See testStartInterrupt - LibraryWaiter libcLoaded = new LibraryWaiter(name -> name.contains("libc")); - mgr.addEventsListener(libcLoaded); - waitOn(startManager(mgr)); - GdbInferior inferior = mgr.currentInferior(); - waitOn(inferior.fileExecAndSymbols("/usr/bin/echo")); - waitOn(inferior.start()); // listModules now requires info proc mappings - waitOn(libcLoaded); - Thread.sleep(100); // TODO: Why? - mgr.sendInterruptNow(); - Map modules = waitOn(inferior.listModules(false)); - GdbModule modEcho = modules.get("/usr/bin/echo"); - assertNotNull(modEcho); - Map sectionsEcho = waitOn(modEcho.listSections(false)); - GdbModuleSection secEchoText = sectionsEcho.get(".text"); - assertNotNull(secEchoText); - } - } - - @Test - public void testInfoOs() throws Throwable { - try (GdbManager mgr = GdbManager.newInstance(getPtyFactory())) { - waitOn(startManager(mgr)); - GdbTable infoThreads = waitOn(mgr.infoOs("threads")); - assertEquals(new LinkedHashSet<>(Arrays.asList("pid", "command", "tid", "core")), - infoThreads.columns().keySet()); - assertTrue(infoThreads.columns().get("command").contains("java")); - } - } - - @Test - public void testStart() throws Throwable { - try (GdbManager mgr = GdbManager.newInstance(getPtyFactory())) { - waitOn(startManager(mgr)); - waitOn(mgr.currentInferior().fileExecAndSymbols("/usr/bin/echo")); - waitOn(mgr.console("break main")); - GdbThread thread = waitOn(mgr.currentInferior().run()); - assertNotNull(thread.getInferior().getPid()); - } - } - - @Test - public void testAttachDetach() throws Throwable { - try (DummyProc echo = run("dd"); GdbManager mgr = GdbManager.newInstance(getPtyFactory())) { - waitOn(startManager(mgr)); - Set threads = waitOn(mgr.currentInferior().attach(echo.pid)); - // Attach stops the process, so no need to wait for STOPPED or prompt - for (GdbThread t : threads) { - assertEquals(echo.pid, (long) t.getInferior().getPid()); - waitOn(t.detach()); - } - } - } - - @Test - @Ignore("At developer's desk only") - public void stressTestStartInterrupt() throws Throwable { - // Just re-run the testStartInterrupt test many,many times - for (int i = 0; i < 100; i++) { - testStartInterrupt(); - } - } - - public static class LibraryWaiter extends CompletableFuture - implements GdbEventsListenerAdapter { - protected final Predicate predicate; - - public LibraryWaiter(Predicate predicate) { - this.predicate = predicate; - } - - @Override - public void libraryLoaded(GdbInferior inferior, String name, GdbCause cause) { - if (predicate.test(name)) { - complete(name); - } - } - } - - public void assertResponsive(GdbManager mgr) throws Throwable { - //Msg.debug(this, "Waiting for prompt"); - //waitOn(mgr.waitForPrompt()); - Msg.debug(this, "Testing echo test"); - String out = waitOn(mgr.consoleCapture("echo test")); - assertEquals("test", out.trim()); - } - - @Test - public void testStartInterrupt() throws Throwable { - assumeFalse("I know no way to get this to pass with these conditions", - this instanceof JoinedGdbManagerTest); - try (GdbManager mgr = GdbManager.newInstance(getPtyFactory())) { - /* - * Not sure the details here, but it seems GDB will give ^running as soon as the process - * has started. I suspect there are some nuances between the time the process is started - * and the time its signal handlers are installed. It seems waiting for libc to load - * guarantees that GDB is ready to interrupt the process. - */ - LibraryWaiter libcLoaded = new LibraryWaiter(name -> name.contains("libc")); - mgr.addEventsListener(libcLoaded); - waitOn(startManager(mgr)); - waitOn(mgr.currentInferior().fileExecAndSymbols("/usr/bin/sleep")); - waitOn(mgr.currentInferior().console("set args 3")); - waitOn(mgr.currentInferior().run()); - waitOn(libcLoaded); - Thread.sleep(100); // TODO: Why? - Msg.debug(this, "Interrupting"); - mgr.sendInterruptNow(); - waitOn(mgr.waitForState(GdbState.STOPPED)); - assertResponsive(mgr); - } - } - - @Test - public void testStepSyscallInterrupt() throws Throwable { - assumeFalse("I know no way to get this to pass with these conditions", - this instanceof JoinedGdbManagerTest); - // Repeat the start-interrupt sequence, then verify we're preparing to step a syscall - try (GdbManager mgr = GdbManager.newInstance(getPtyFactory())) { - LibraryWaiter libcLoaded = new LibraryWaiter(name -> name.contains("libc")); - mgr.addEventsListener(libcLoaded); - waitOn(startManager(mgr)); - waitOn(mgr.currentInferior().fileExecAndSymbols("/usr/bin/sleep")); - waitOn(mgr.currentInferior().console("set args 5")); - waitOn(mgr.currentInferior().run()); - waitOn(libcLoaded); - Thread.sleep(100); // TODO: Why? - Msg.debug(this, "Interrupting"); - mgr.sendInterruptNow(); - Msg.debug(this, "Verifying at syscall"); - Thread.sleep(100); // TODO: Actually wait for *stopped event - String out = waitOn(mgr.consoleCapture("x/1i $pc-2")); - // TODO: This is x86-specific - assertTrue("Didn't stop at syscall", out.contains("syscall")); - - // Now the real test - waitOn(mgr.currentInferior().step(StepCmd.STEPI)); - CompletableFuture stopped = mgr.waitForState(GdbState.STOPPED); - Thread.sleep(100); // NB: Not exactly reliable, but verify we're waiting - assertFalse(stopped.isDone()); - mgr.sendInterruptNow(); - waitOn(stopped); - assertResponsive(mgr); - } - } - - @Test - public void testSetVarEvaluate() throws Throwable { - try (GdbManager mgr = GdbManager.newInstance(getPtyFactory())) { - waitOn(startManager(mgr)); - waitOn(mgr.currentInferior().fileExecAndSymbols("/usr/bin/echo")); - waitOn(mgr.insertBreakpoint("main")); - waitOn(mgr.currentInferior().run()); - waitOn(mgr.waitForState(GdbState.STOPPED)); - //waitOn(mgr.waitForPrompt()); - waitOn(mgr.currentInferior().setVar("$rax=", "0xdeadbeef")); // Corrupts it - String val = waitOn(mgr.currentInferior().evaluate("$rax+1")); - assertEquals(0xdeadbeef + 1, Integer.parseUnsignedInt(val)); - } - } - - @Test - public void testSetVarGetVar() throws Throwable { - try (GdbManager mgr = GdbManager.newInstance(getPtyFactory())) { - waitOn(startManager(mgr)); - String val = waitOn(mgr.currentInferior().getVar("args")); - assertThat(val, Matchers.emptyOrNullString()); - waitOn(mgr.currentInferior().setVar("args", "test")); - val = waitOn(mgr.currentInferior().getVar("args")); - assertEquals("test", val); - } - } - - @Test - public void testInsertListDeleteBreakpoint() throws Throwable { - try (GdbManager mgr = GdbManager.newInstance(getPtyFactory())) { - waitOn(startManager(mgr)); - waitOn(mgr.currentInferior().fileExecAndSymbols("/usr/bin/echo")); - GdbBreakpointInfo breakpoint = waitOn(mgr.insertBreakpoint("main")); - Map bl = waitOn(mgr.listBreakpoints()); - assertEquals(Map.of(1L, breakpoint), bl); - waitOn(mgr.deleteBreakpoints(breakpoint.getNumber())); - bl = waitOn(mgr.listBreakpoints()); - assertEquals(Map.of(), bl); - } - } - - @Test - public void testListReadWriteReadRegisters() throws Throwable { - try (GdbManager mgr = GdbManager.newInstance(getPtyFactory())) { - waitOn(startManager(mgr)); - waitOn(mgr.currentInferior().fileExecAndSymbols("/usr/bin/echo")); - waitOn(mgr.insertBreakpoint("main")); - GdbThread thread = waitOn(mgr.currentInferior().run()); - waitOn(mgr.waitForState(GdbState.STOPPED)); - //waitOn(mgr.waitForPrompt()); - GdbRegisterSet regs = waitOn(thread.listRegisters()); - Set toRead = new HashSet<>(); - toRead.add(regs.get("eflags")); - toRead.add(regs.get("rax")); - Map read = waitOn(thread.readRegisters(toRead)); - // Verify eflags is rendered numerically - assertNotNull(read.get(regs.get("eflags"))); - assertNotNull(read.get(regs.get("rax"))); - Map toWrite = new HashMap<>(); - // NOTE: Not all flags are mutable from user-space. - // Turns out GDB/MI does not honor this, but CLI does.... - toWrite.put(regs.get("eflags"), BigInteger.valueOf(0L)); - toWrite.put(regs.get("rax"), BigInteger.valueOf(0x1122334455667788L)); - waitOn(thread.writeRegisters(toWrite)); - toRead = new HashSet<>(); - toRead.add(regs.get("eflags")); - // Verify register structure is reflected in API - toRead.add(regs.get("eax")); - read = waitOn(thread.readRegisters(toRead)); - // IF and that other reserved bit cannot be cleared - // Verified the same behavior in vanilla GDB at the CLI. - assertEquals(0x202L, read.get(regs.get("eflags")).longValue()); - assertEquals(0x55667788L, read.get(regs.get("eax")).longValue()); - } - } - - @Test - public void testWriteReadMemory() throws Throwable { - ByteBuffer rBuf = ByteBuffer.allocate(1024); - try (GdbManager mgr = GdbManager.newInstance(getPtyFactory())) { - waitOn(startManager(mgr)); - waitOn(mgr.currentInferior().fileExecAndSymbols("/usr/bin/echo")); - waitOn(mgr.insertBreakpoint("main")); - GdbThread thread = waitOn(mgr.currentInferior().run()); - waitOn(mgr.waitForState(GdbState.STOPPED)); - //waitOn(mgr.waitForPrompt()); - String str = waitOn(mgr.currentInferior().evaluate("(long)main")); - long addr = Long.parseLong(str); - ByteBuffer buf = ByteBuffer.allocate(1024); - buf.order(ByteOrder.LITTLE_ENDIAN); - for (int i = 0; i < 10; i++) { - buf.putInt(i); - } - buf.flip(); - waitOn(thread.writeMemory(addr, buf)); - ULongSpanSet set = waitOn(thread.readMemory(addr, rBuf)); - rBuf.flip(); - rBuf.order(ByteOrder.LITTLE_ENDIAN); - ULongSpanSet exp = ULongSpanSet.of(ULongSpan.extent(addr, 1024)); - assertEquals(exp, set); - for (int i = 0; i < 10; i++) { - assertEquals(i, rBuf.getInt()); - } - } - } - - @Test - public void testContinue() throws Throwable { - try (GdbManager mgr = GdbManager.newInstance(getPtyFactory())) { - waitOn(startManager(mgr)); - waitOn(mgr.currentInferior().fileExecAndSymbols("/usr/bin/echo")); - waitOn(mgr.insertBreakpoint("main")); - GdbThread thread = waitOn(mgr.currentInferior().run()); - waitOn(mgr.waitForState(GdbState.STOPPED)); - //waitOn(mgr.waitForPrompt()); - waitOn(thread.cont()); - waitOn(mgr.waitForState(GdbState.STOPPED)); - assertEquals(0L, (long) mgr.currentInferior().getExitCode()); - } - } - - @Test - public void testStep() throws Throwable { - try (GdbManager mgr = GdbManager.newInstance(getPtyFactory())) { - waitOn(startManager(mgr)); - waitOn(mgr.currentInferior().fileExecAndSymbols("/usr/bin/echo")); - waitOn(mgr.insertBreakpoint("main")); - GdbThread thread = waitOn(mgr.currentInferior().run()); - waitOn(mgr.waitForState(GdbState.STOPPED)); - //waitOn(mgr.waitForPrompt()); - waitOn(thread.step(StepCmd.NEXTI)); - waitOn(mgr.waitForState(GdbState.STOPPED)); - assertNull(mgr.currentInferior().getExitCode()); - } - } - - @Test - public void testThreadSelect() throws Throwable { - try (GdbManager mgr = GdbManager.newInstance(getPtyFactory())) { - waitOn(startManager(mgr)); - waitOn(mgr.currentInferior().fileExecAndSymbols("/usr/bin/echo")); - waitOn(mgr.insertBreakpoint("main")); - GdbThread thread = waitOn(mgr.currentInferior().run()); - waitOn(mgr.waitForState(GdbState.STOPPED)); - //waitOn(mgr.waitForPrompt()); - waitOn(thread.setActive(false)); - } - } - - @Test - public void testListFrames() throws Throwable { - try (GdbManager mgr = GdbManager.newInstance(getPtyFactory())) { - waitOn(startManager(mgr)); - waitOn(mgr.currentInferior().fileExecAndSymbols("/usr/bin/echo")); - waitOn(mgr.insertBreakpoint("main")); - GdbThread thread = waitOn(mgr.currentInferior().run()); - waitOn(mgr.waitForState(GdbState.STOPPED)); - //waitOn(mgr.waitForPrompt()); - waitOn(mgr.insertBreakpoint("write")); - waitOn(mgr.currentInferior().cont()); - waitOn(mgr.waitForState(GdbState.STOPPED)); - List stack = waitOn(thread.listStackFrames()); - Msg.debug(this, "Got stack:"); - for (GdbStackFrame frame : stack) { - Msg.debug(this, " " + frame); - } - assertEquals("write", stack.get(0).getFunction()); - assertEquals("main", stack.get(stack.size() - 1).getFunction()); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/manager/impl/GdbCValueParserTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/manager/impl/GdbCValueParserTest.java deleted file mode 100644 index 4a274adfc3..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/manager/impl/GdbCValueParserTest.java +++ /dev/null @@ -1,240 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import org.junit.Ignore; -import org.junit.Test; - -import agent.gdb.manager.parsing.GdbCValueParser; -import agent.gdb.manager.parsing.GdbCValueParser.*; -import agent.gdb.manager.parsing.GdbParsingUtils.GdbParseError; - -@Ignore("deprecated") -public class GdbCValueParserTest { - @Test - public void testIntegerZero() throws GdbParseError { - assertEquals(GdbIntValue.valueOf(0), GdbCValueParser.parseValue("0")); - assertEquals(GdbIntValue.valueOf(0), GdbCValueParser.parseValue("00")); - assertEquals(GdbIntValue.valueOf(0), GdbCValueParser.parseValue("000")); - assertEquals(GdbIntValue.valueOf(0), GdbCValueParser.parseValue("0x0")); - assertEquals(GdbIntValue.valueOf(0), GdbCValueParser.parseValue("0x00")); - } - - @Test - public void testIntegerDec() throws GdbParseError { - assertEquals(GdbIntValue.valueOf(1), GdbCValueParser.parseValue("1")); - assertEquals(GdbIntValue.valueOf(10), GdbCValueParser.parseValue("10")); - assertEquals(GdbIntValue.valueOf(1234567890), GdbCValueParser.parseValue("1234567890")); - } - - @Test(expected = GdbParseError.class) - public void testIntegerDecErr() throws GdbParseError { - GdbCValueParser.parseValue("1f"); - } - - @Test - public void testIntegerHex() throws GdbParseError { - assertEquals(GdbIntValue.valueOf(1), GdbCValueParser.parseValue("0x1")); - assertEquals(GdbIntValue.valueOf(0x10), GdbCValueParser.parseValue("0x10")); - assertEquals(GdbIntValue.valueOf(0x123456789abcdef0L), - GdbCValueParser.parseValue("0x123456789abcdef0")); - } - - @Test(expected = GdbParseError.class) - public void testIntegerHexErr() throws GdbParseError { - GdbCValueParser.parseValue("0xfg"); - } - - @Test - public void testIntegerOct() throws GdbParseError { - assertEquals(GdbIntValue.valueOf(01), GdbCValueParser.parseValue("01")); - assertEquals(GdbIntValue.valueOf(010), GdbCValueParser.parseValue("010")); - assertEquals(GdbIntValue.valueOf(012345670), GdbCValueParser.parseValue("012345670")); - } - - @Test(expected = GdbParseError.class) - public void testIntegerOctErr() throws GdbParseError { - GdbCValueParser.parseValue("018"); - } - - @Test - public void testComposite() throws GdbParseError { - assertEquals(GdbCompositeValue.builder() - .put("a", GdbIntValue.valueOf(1)) - .put("b", GdbIntValue.valueOf(2)) - .put("c", GdbIntValue.valueOf(3)) - .build(), - GdbCValueParser.parseValue("{a=1,b=0x2,c=03}")); - } - - @Test - public void testCompositeSpaces() throws GdbParseError { - assertEquals(GdbCompositeValue.builder() - .put("a", GdbIntValue.valueOf(1)) - .put("b", GdbIntValue.valueOf(2)) - .put("c", GdbIntValue.valueOf(3)) - .build(), - GdbCValueParser.parseValue(" { a = 1 , b = 0x2 , c = 03 } ")); - } - - @Test(expected = GdbParseError.class) - public void testCompositeErrMissingClose() throws GdbParseError { - GdbCValueParser.parseValue("{a = 1, b = 0x2, c = 03"); - } - - @Test(expected = GdbParseError.class) - public void testCompositeErrMissingComma() throws GdbParseError { - GdbCValueParser.parseValue("{a = 1 b = 0x2, c = 03}"); - } - - @Test - public void testArray() throws GdbParseError { - assertEquals(GdbArrayValue.builder() - .add(GdbIntValue.valueOf(1)) - .add(GdbIntValue.valueOf(2)) - .add(GdbIntValue.valueOf(3)) - .build(), - GdbCValueParser.parseValue("{1,0x2,03}")); - } - - @Test - public void testArraySpaces() throws GdbParseError { - assertEquals(GdbArrayValue.builder() - .add(GdbIntValue.valueOf(1)) - .add(GdbIntValue.valueOf(2)) - .add(GdbIntValue.valueOf(3)) - .build(), - GdbCValueParser.parseValue(" { 1 , 0x2 , 03 } ")); - } - - @Test(expected = GdbParseError.class) - public void testArrayErrMissingClose() throws GdbParseError { - GdbCValueParser.parseValue("{1, 0x2, 03"); - } - - @Test(expected = GdbParseError.class) - public void testArrayErrMissingComma() throws GdbParseError { - GdbCValueParser.parseValue("{1 0x2, 03}"); - } - - @Test - public void testArrayWithRepeat() throws GdbParseError { - assertEquals(GdbArrayValue.builder() - .add(GdbIntValue.valueOf(1)) - .add(GdbIntValue.valueOf(2)) - .add(GdbIntValue.valueOf(2)) - .add(GdbIntValue.valueOf(2)) - .add(GdbIntValue.valueOf(2)) - .add(GdbIntValue.valueOf(2)) - .add(GdbIntValue.valueOf(3)) - .build(), - GdbCValueParser.parseValue("{1, 0x2 , 03}")); - } - - @Test - public void testNested() throws GdbParseError { - assertEquals(GdbCompositeValue.builder() - .put("a", GdbIntValue.valueOf(1)) - .put("b", GdbArrayValue.builder() - .add(GdbIntValue.valueOf(2)) - .add(GdbIntValue.valueOf(3)) - .build()) - .put("c", GdbCompositeValue.builder() - .put("d", GdbIntValue.valueOf(4)) - .put("e", GdbIntValue.valueOf(5)) - .build()) - .build(), - GdbCValueParser.parseValue("{a=1,b={2,3},c={d=4,e=5}}")); - } - - @Test(expected = GdbParseError.class) - public void testEmptyStringErr() throws GdbParseError { - GdbCValueParser.parseValue(""); - } - - @Test - public void testEmptyValue() throws GdbParseError { - assertTrue(GdbCValueParser.parseValue("{}").isEmpty()); - } - - @Test - public void testRegisterValue() throws GdbParseError { - String observed = "{" + - "v4_float = {0x0, 0x0, 0x0, 0x0}, " + - "v2_double = {0x0, 0x0}, " + - "v16_int8 = {0x0 }, " + - "v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, " + - "v4_int32 = {0x0, 0x0, 0x0, 0x0}, " + - "v2_int64 = {0x0, 0x0}, " + - "uint128 = 0x00000000000000000000000000000000" + - "}"; - assertEquals(GdbCompositeValue.builder() - .put("v4_float", GdbArrayValue.builder() - .add(GdbIntValue.valueOf(0)) - .add(GdbIntValue.valueOf(0)) - .add(GdbIntValue.valueOf(0)) - .add(GdbIntValue.valueOf(0)) - .build()) - .put("v2_double", GdbArrayValue.builder() - .add(GdbIntValue.valueOf(0)) - .add(GdbIntValue.valueOf(0)) - .build()) - .put("v16_int8", GdbArrayValue.builder() - .add(GdbIntValue.valueOf(0)) - .add(GdbIntValue.valueOf(0)) - .add(GdbIntValue.valueOf(0)) - .add(GdbIntValue.valueOf(0)) - .add(GdbIntValue.valueOf(0)) - .add(GdbIntValue.valueOf(0)) - .add(GdbIntValue.valueOf(0)) - .add(GdbIntValue.valueOf(0)) - .add(GdbIntValue.valueOf(0)) - .add(GdbIntValue.valueOf(0)) - .add(GdbIntValue.valueOf(0)) - .add(GdbIntValue.valueOf(0)) - .add(GdbIntValue.valueOf(0)) - .add(GdbIntValue.valueOf(0)) - .add(GdbIntValue.valueOf(0)) - .add(GdbIntValue.valueOf(0)) - .build()) - .put("v8_int16", GdbArrayValue.builder() - .add(GdbIntValue.valueOf(0)) - .add(GdbIntValue.valueOf(0)) - .add(GdbIntValue.valueOf(0)) - .add(GdbIntValue.valueOf(0)) - .add(GdbIntValue.valueOf(0)) - .add(GdbIntValue.valueOf(0)) - .add(GdbIntValue.valueOf(0)) - .add(GdbIntValue.valueOf(0)) - .build()) - .put("v4_int32", GdbArrayValue.builder() - .add(GdbIntValue.valueOf(0)) - .add(GdbIntValue.valueOf(0)) - .add(GdbIntValue.valueOf(0)) - .add(GdbIntValue.valueOf(0)) - .build()) - .put("v2_int64", GdbArrayValue.builder() - .add(GdbIntValue.valueOf(0)) - .add(GdbIntValue.valueOf(0)) - .build()) - .put("uint128", GdbIntValue.valueOf(0)) - .build(), - GdbCValueParser.parseValue(observed)); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/manager/impl/GdbReadRegistersCommandTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/manager/impl/GdbReadRegistersCommandTest.java deleted file mode 100644 index a3cd88541b..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/manager/impl/GdbReadRegistersCommandTest.java +++ /dev/null @@ -1,71 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl; - -import static org.junit.Assert.assertEquals; - -import java.math.BigInteger; -import java.nio.ByteOrder; - -import org.junit.Ignore; -import org.junit.Test; - -import agent.gdb.manager.impl.cmd.GdbReadRegistersCommand; - -@Ignore("deprecated") -public class GdbReadRegistersCommandTest { - @Test - public void testParseAndFindInteger_Integer() throws Exception { - String value = "0x1234"; - assertEquals(BigInteger.valueOf(0x1234), - GdbReadRegistersCommand.parseAndFindInteger(value, 8, ByteOrder.LITTLE_ENDIAN)); - } - - @Test - public void testParseAndFindInteger_CompositeWithInteger() throws Exception { - String value = "{nope = {f = 0x0}, i = 0x1234}"; - assertEquals(BigInteger.valueOf(0x1234), - GdbReadRegistersCommand.parseAndFindInteger(value, 8, ByteOrder.LITTLE_ENDIAN)); - } - - @Test - public void testParseAndFindInteger_Array() throws Exception { - String value = "{0x34, 0x12}"; - assertEquals(BigInteger.valueOf(0x1234), - GdbReadRegistersCommand.parseAndFindInteger(value, 2, ByteOrder.LITTLE_ENDIAN)); - } - - @Test - public void testParseAndFindInteger_PatternX64() throws Exception { - String value = "{v64_int8 = {0x34, 0x12, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}"; - assertEquals(BigInteger.valueOf(0x1234), - GdbReadRegistersCommand.parseAndFindInteger(value, 8, ByteOrder.LITTLE_ENDIAN)); - } - - @Test - public void testParseAndFindInteger_PatternARMv7() throws Exception { - String value = "{u8 = {0x34, 0x12, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}"; - assertEquals(BigInteger.valueOf(0x1234), - GdbReadRegistersCommand.parseAndFindInteger(value, 8, ByteOrder.LITTLE_ENDIAN)); - } - - @Test - public void testParseAndFindInteger_PatternAArch64() throws Exception { - String value = "{b = {u = {0x34, 0x12, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}}"; - assertEquals(BigInteger.valueOf(0x1234), - GdbReadRegistersCommand.parseAndFindInteger(value, 8, ByteOrder.LITTLE_ENDIAN)); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/manager/impl/JoinedGdbManagerTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/manager/impl/JoinedGdbManagerTest.java deleted file mode 100644 index e0ce81b102..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/manager/impl/JoinedGdbManagerTest.java +++ /dev/null @@ -1,82 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl; - -import java.io.*; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import org.junit.Ignore; - -import agent.gdb.manager.GdbManager; -import ghidra.pty.PtySession; -import ghidra.pty.linux.LinuxIoctls; -import ghidra.pty.unix.UnixPty; -import ghidra.util.Msg; - -@Ignore("Need compatible GDB version for CI, deprecated") -public class JoinedGdbManagerTest extends AbstractGdbManagerTest { - protected class ReaderThread extends Thread { - @Override - public void run() { - BufferedReader reader = - new BufferedReader(new InputStreamReader(ptyUserGdb.getParent().getInputStream())); - String line; - try { - while (gdb != null && null != (line = reader.readLine())) { - Msg.debug(this, "USERGDB: " + line); - } - } - catch (IOException e) { - Msg.debug(this, "Error reading USERGDB line: " + e); - } - } - } - - protected UnixPty ptyUserGdb; - protected PtySession gdb; - - @Override - protected CompletableFuture startManager(GdbManager manager) { - try { - ptyUserGdb = UnixPty.openpty(LinuxIoctls.INSTANCE); - manager.start(null); - Msg.debug(this, "Starting GDB and invoking new-ui mi2 " + manager.getMi2PtyName()); - - gdb = ptyUserGdb.getChild() - .session(new String[] { gdbBin.getAbsolutePath() }, Map.of()); - new ReaderThread().start(); - PrintWriter gdbCmd = new PrintWriter(ptyUserGdb.getParent().getOutputStream()); - gdbCmd.println("new-ui mi2 " + manager.getMi2PtyName()); - gdbCmd.flush(); - return manager.runRC(); - } - catch (IOException e) { - throw new AssertionError(e); - } - } - - @Override - protected void stopManager() throws IOException { - if (gdb != null) { - gdb.destroyForcibly(); - gdb = null; - } - if (ptyUserGdb != null) { - ptyUserGdb.close(); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/manager/impl/SpawnedCliGdbManagerTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/manager/impl/SpawnedCliGdbManagerTest.java deleted file mode 100644 index a1e0e1427b..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/manager/impl/SpawnedCliGdbManagerTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl; - -import java.io.IOException; -import java.util.concurrent.CompletableFuture; - -import org.junit.Ignore; - -import agent.gdb.manager.GdbManager; - -@Ignore("Need compatible GDB version for CI, deprecated") -public class SpawnedCliGdbManagerTest extends AbstractGdbManagerTest { - @Override - protected CompletableFuture startManager(GdbManager manager) { - try { - manager.start(gdbBin.getAbsolutePath()); - return manager.runRC(); - } - catch (IOException e) { - throw new AssertionError(e); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/manager/impl/SpawnedMi2Gdb7Dot6Dot1ManagerTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/manager/impl/SpawnedMi2Gdb7Dot6Dot1ManagerTest.java deleted file mode 100644 index 3accf3d318..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/manager/impl/SpawnedMi2Gdb7Dot6Dot1ManagerTest.java +++ /dev/null @@ -1,43 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl; - -import java.io.File; -import java.io.IOException; -import java.util.concurrent.CompletableFuture; - -import org.junit.Ignore; - -import agent.gdb.manager.GdbManager; - -@Ignore("Need to install GDB 7.6.1 to the expected directory on CI, deprecated") -public class SpawnedMi2Gdb7Dot6Dot1ManagerTest extends AbstractGdbManagerTest { - @Override - protected File findGdbBin() { - return new File("/opt/gdb-7.6.1/bin/gdb"); - } - - @Override - protected CompletableFuture startManager(GdbManager manager) { - try { - manager.start(gdbBin.getAbsolutePath(), "-i", "mi2"); - return manager.runRC(); - } - catch (IOException e) { - throw new AssertionError(e); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/manager/impl/SpawnedMi2GdbHomeLocalManagerTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/manager/impl/SpawnedMi2GdbHomeLocalManagerTest.java deleted file mode 100644 index c035f74b3d..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/manager/impl/SpawnedMi2GdbHomeLocalManagerTest.java +++ /dev/null @@ -1,44 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl; - -import java.io.File; -import java.io.IOException; -import java.util.concurrent.CompletableFuture; - -import org.junit.Ignore; - -import agent.gdb.manager.GdbManager; - -@Ignore("Does not exist on CI, deprecated") -public class SpawnedMi2GdbHomeLocalManagerTest extends AbstractGdbManagerTest { - @Override - protected File findGdbBin() { - String home = System.getProperty("user.home"); - return new File(home, "local/bin/gdb"); - } - - @Override - protected CompletableFuture startManager(GdbManager manager) { - try { - manager.start(gdbBin.getAbsolutePath(), "-i", "mi2"); - return manager.runRC(); - } - catch (IOException e) { - throw new AssertionError(e); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/manager/impl/SpawnedMi2GdbSystemManagerTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/manager/impl/SpawnedMi2GdbSystemManagerTest.java deleted file mode 100644 index 5b7130ed3a..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/manager/impl/SpawnedMi2GdbSystemManagerTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl; - -import java.io.IOException; -import java.util.concurrent.CompletableFuture; - -import org.junit.Ignore; - -import agent.gdb.manager.GdbManager; - -@Ignore("Need compatible version install on CI, deprecated") -public class SpawnedMi2GdbSystemManagerTest extends AbstractGdbManagerTest { - @Override - protected CompletableFuture startManager(GdbManager manager) { - try { - manager.start(gdbBin.getAbsolutePath(), "-i", "mi2"); - return manager.runRC(); - } - catch (IOException e) { - throw new AssertionError(e); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/manager/impl/SpawnedWindowsMi2GdbManagerTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/manager/impl/SpawnedWindowsMi2GdbManagerTest.java deleted file mode 100644 index 8664f9740d..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/manager/impl/SpawnedWindowsMi2GdbManagerTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.impl; - -import java.io.IOException; -import java.util.concurrent.CompletableFuture; - -import org.junit.Ignore; - -import agent.gdb.manager.GdbManager; - -@Ignore("Need compatible version on CI, deprecated") -public class SpawnedWindowsMi2GdbManagerTest extends AbstractGdbManagerTest { - @Override - protected CompletableFuture startManager(GdbManager manager) { - try { - manager.start("C:\\msys64\\mingw64\\bin\\gdb.exe", "-i", "mi2"); - return manager.runRC(); - } - catch (IOException e) { - throw new AssertionError(e); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/manager/parsing/GdbMiParserTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/manager/parsing/GdbMiParserTest.java deleted file mode 100644 index 58185495a5..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/manager/parsing/GdbMiParserTest.java +++ /dev/null @@ -1,117 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.manager.parsing; - -import static org.junit.Assert.assertEquals; - -import java.util.Arrays; -import java.util.List; -import java.util.function.Consumer; -import java.util.regex.Pattern; - -import org.junit.Ignore; -import org.junit.Test; - -import agent.gdb.manager.parsing.GdbMiParser.GdbMiFieldList; -import agent.gdb.manager.parsing.GdbParsingUtils.GdbParseError; - -@Ignore("deprecated") -public class GdbMiParserTest { - protected GdbMiFieldList buildFieldList(Consumer conf) { - GdbMiFieldList.Builder builder = GdbMiFieldList.builder(); - conf.accept(builder); - return builder.build(); - } - - @Test - public void testMatch() throws GdbParseError { - GdbMiParser parser = new GdbMiParser(""" - Hello, World"""); - assertEquals("Hello", parser.match(Pattern.compile("\\w+"), true)); - assertEquals(",", parser.match(GdbMiParser.COMMA, true)); - } - - @Test - public void testParseString() throws GdbParseError { - GdbMiParser parser = new GdbMiParser(""" - "Hello, World!\\n"\ - """); - assertEquals("Hello, World!\n", parser.parseString()); - parser.checkEmpty(false); - } - - @Test - public void testParseList() throws GdbParseError { - GdbMiParser parser = new GdbMiParser(""" - ["Hello","World"]"""); - assertEquals(Arrays.asList(new String[] { "Hello", "World" }), parser.parseList()); - parser.checkEmpty(false); - } - - @Test - public void testParseMap() throws GdbParseError { - GdbMiParser parser = new GdbMiParser(""" - {h="Hello",w="World"}"""); - assertEquals(buildFieldList((exp) -> { - exp.add("h", "Hello"); - exp.add("w", "World"); - }), parser.parseMap()); - parser.checkEmpty(false); - } - - @Test - public void testParseStringEscapes() throws GdbParseError { - GdbMiParser parser = new GdbMiParser(""" - "basic=\\n\\b\\t\\f\\r c=\\e[0m\\a delim=\\\\\\" octal=\\000\\177"\ - """); - assertEquals("basic=\n\b\t\f\r c=\033[0m\007 delim=\\\" octal=\000\177", - parser.parseString()); - parser.checkEmpty(false); - } - - @Test - public void testParseStringUTF8() throws GdbParseError { - GdbMiParser parser = new GdbMiParser(""" - "\\302\\244 \\342\\204\\212 \\343\\201\\251 \\351\\276\\231 \\360\\237\\230\\200"\ - """); - assertEquals("\u00a4 \u210a \u3069 \u9f99 \ud83d\ude00", parser.parseString()); - parser.checkEmpty(false); - } - - @Test - public void testParseBreakpointCommandList() throws GdbParseError { - GdbMiParser parser = new GdbMiParser(""" - BreakpointTable={nr_rows="1",nr_cols="6",hdr=[{width="7",alignment="-1",\ - col_name="number",colhdr="Num"},{width="14",alignment="-1",col_name="type",\ - colhdr="Type"},{width="4",alignment="-1",col_name="disp",colhdr="Disp"},\ - {width="3",alignment="-1",col_name="enabled",colhdr="Enb"},{width="18",\ - alignment="-1",col_name="addr",colhdr="Address"},{width="40",alignment="2",\ - col_name="what",colhdr="What"}],body=[bkpt={number="1",type="breakpoint",\ - disp="keep",enabled="y",addr="0x00007ffff779c96f",at="",\ - thread-groups=["i1"],times="0",script={"echo asdf","echo ghjk","echo asdf"},\ - original-location="*0x7ffff779c96f"}]}"""); - GdbMiFieldList result = parser.parseFields(false); - GdbMiFieldList table = result.getFieldList("BreakpointTable"); - GdbMiFieldList body = table.getFieldList("body"); - List bkpts = List.copyOf(body.get("bkpt")); - assertEquals(1, bkpts.size()); - GdbMiFieldList bkpt0 = (GdbMiFieldList) bkpts.get(0); - GdbMiFieldList script = bkpt0.getFieldList("script"); - List lines = List.copyOf(script.get(null)); - assertEquals(List.of("echo asdf", "echo ghjk", "echo asdf"), lines); - parser.checkEmpty(false); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractGdbModelHost.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractGdbModelHost.java deleted file mode 100644 index 8aaf0a17d1..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractGdbModelHost.java +++ /dev/null @@ -1,29 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model; - -import java.util.Map; - -import agent.gdb.manager.GdbManager; -import ghidra.dbg.test.AbstractModelHost; - -public abstract class AbstractGdbModelHost extends AbstractModelHost { - @Override - public Map getFactoryOptions() { - return Map.ofEntries( - Map.entry("GDB launch command", GdbManager.DEFAULT_GDB_CMD)); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbAmd64RegistersTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbAmd64RegistersTest.java deleted file mode 100644 index 46458f84fa..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbAmd64RegistersTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model; - -import java.util.List; -import java.util.Map; - -import ghidra.dbg.test.*; -import ghidra.dbg.util.PathUtils; - -public abstract class AbstractModelForGdbAmd64RegistersTest - extends AbstractDebuggerModelRegistersTest - implements ProvidesTargetViaLaunchSpecimen { - public final Map REG_VALS = Map.ofEntries( - Map.entry("rax", arr("0123456789abcdef")), - Map.entry("ymm0", arr( - "0123456789abcdef" + "fedcba9876543210" + "0011223344556677" + "8899aabbccddeeff"))); - // TODO: A more complete set of test registers - // TODO: How to reliably test other target platforms? qemu with gdbserver? - - @Override - public AbstractDebuggerModelTest getTest() { - return this; - } - - @Override - public List getExpectedRegisterBankPath(List threadPath) { - return PathUtils.extend(threadPath, PathUtils.parse("Stack[0].Registers")); - } - - @Override - public Map getRegisterWrites() { - return REG_VALS; - } - - /** - * {@inheritDoc} - * - *

- * Note, this assumes the test is run where 'echo' is an image compiled for amd64 - */ - @Override - public DebuggerTestSpecimen getLaunchSpecimen() { - return GdbLinuxSpecimen.PRINT; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbAttacherTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbAttacherTest.java deleted file mode 100644 index bdd7b7143f..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbAttacherTest.java +++ /dev/null @@ -1,84 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import java.util.List; - -import ghidra.async.AsyncUtils.TemperamentalRunnable; -import ghidra.dbg.target.TargetEnvironment; -import ghidra.dbg.target.TargetMethod.TargetParameterMap; -import ghidra.dbg.test.AbstractDebuggerModelAttacherTest; - -public abstract class AbstractModelForGdbAttacherTest extends AbstractDebuggerModelAttacherTest { - - @Override - public List getExpectedAttachableContainerPath() { - return List.of("Available"); - } - - @Override - public DebuggerTestSpecimen getAttachSpecimen() { - return GdbLinuxSpecimen.SLEEP; - } - - @Override - public TargetParameterMap getExpectedAttachParameters() { - return null; // TODO - } - - @Override - public void assertEnvironment(TargetEnvironment environment) { - // TODO: This test won't always be on amd64 Linux, no? - assertEquals("i386:x86-64", environment.getArchitecture()); - assertEquals("GNU/Linux", environment.getOperatingSystem()); - assertEquals("little", environment.getEndian()); - assertTrue(environment.getDebugger().toLowerCase().contains("gdb")); - } - - // NB. Gradle/Java hangs on process clean-up if target is still attached - protected void withDetachAndForcefulDummyDestruction(TemperamentalRunnable test) - throws Throwable { - try { - test.run(); - runTestDetach(getAttachSpecimen()); - } - finally { - if (dummy == null) { - return; - } - dummy.process.destroy(); - dummy.process.destroyForcibly(); - } - } - - @Override - public void testAttachByObj() throws Throwable { - withDetachAndForcefulDummyDestruction(() -> super.testAttachByObj()); - } - - @Override - public void testAttachByPid() throws Throwable { - withDetachAndForcefulDummyDestruction(() -> super.testAttachByPid()); - } - - @Override - public void testAttachByPidThenResumeInterrupt() throws Throwable { - withDetachAndForcefulDummyDestruction(() -> super.testAttachByPidThenResumeInterrupt()); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbBreakpointsTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbBreakpointsTest.java deleted file mode 100644 index 9834e6db24..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbBreakpointsTest.java +++ /dev/null @@ -1,177 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model; - -import static org.junit.Assert.*; - -import java.util.List; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import generic.Unique; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetBreakpointSpec.TargetBreakpointKind; -import ghidra.dbg.target.TargetBreakpointSpecContainer.TargetBreakpointKindSet; -import ghidra.dbg.test.*; -import ghidra.dbg.util.PathPattern; -import ghidra.dbg.util.PathUtils; -import ghidra.program.model.address.*; - -public abstract class AbstractModelForGdbBreakpointsTest - extends AbstractDebuggerModelBreakpointsTest implements ProvidesTargetViaLaunchSpecimen { - - private static final PathPattern BREAK_PATTERN = - new PathPattern(PathUtils.parse("Breakpoints[]")); - - @Override - public AbstractDebuggerModelTest getTest() { - return this; - } - - @Override - public DebuggerTestSpecimen getLaunchSpecimen() { - return GdbLinuxSpecimen.PRINT; - } - - @Override - public List getExpectedBreakpointContainerPath(List targetPath) { - return PathUtils.parse("Breakpoints"); - } - - @Override - public TargetBreakpointKindSet getExpectedSupportedKinds() { - return TargetBreakpointKindSet.of( - TargetBreakpointKind.SW_EXECUTE, - TargetBreakpointKind.HW_EXECUTE, - TargetBreakpointKind.READ, - TargetBreakpointKind.WRITE); - } - - @Override - public AddressRange getSuitableRangeForBreakpoint(TargetObject target, - TargetBreakpointKind kind) throws Throwable { - TargetStackFrame frame = retry(() -> { - TargetStackFrame f = findAnyStackFrame(target.getPath()); - assertNotNull(f); - return f; - }, List.of(AssertionError.class)); - waitOn(frame.fetchAttributes()); - Address pc = frame.getProgramCounter().add(16); // Avoid "main" (temporary bp) - switch (kind) { - case SW_EXECUTE: - case HW_EXECUTE: - return new AddressRangeImpl(pc, pc); - case READ: - case WRITE: - return new AddressRangeImpl(pc, 4); - default: - throw new AssertionError(); - } - } - - @Override - protected void placeBreakpointViaInterpreter(AddressRange range, TargetBreakpointKind kind, - TargetInterpreter interpreter) throws Throwable { - Address min = range.getMinAddress(); - if (range.getLength() == 4) { - switch (kind) { - case READ: - waitOn(interpreter.execute("rwatch -l *((int*) 0x" + min + ")")); - break; - case WRITE: - waitOn(interpreter.execute("watch -l *((int*) 0x" + min + ")")); - break; - default: - fail(); - } - } - else if (range.getLength() == 1) { - switch (kind) { - case SW_EXECUTE: - waitOn(interpreter.execute("break *0x" + min)); - break; - case HW_EXECUTE: - waitOn(interpreter.execute("hbreak *0x" + min)); - break; - default: - fail(); - } - } - else { - fail(); - } - } - - @Override - protected void disableViaInterpreter(TargetTogglable t, TargetInterpreter interpreter) - throws Throwable { - assert t instanceof TargetBreakpointSpec; // TODO: or Location - String index = Unique.assertOne(BREAK_PATTERN.matchKeys(t.getPath())); - waitOn(interpreter.execute("disable " + index)); - } - - @Override - protected void enableViaInterpreter(TargetTogglable t, TargetInterpreter interpreter) - throws Throwable { - assert t instanceof TargetBreakpointSpec; // TODO: or Location - String index = Unique.assertOne(BREAK_PATTERN.matchKeys(t.getPath())); - waitOn(interpreter.execute("enable " + index)); - } - - @Override - protected void deleteViaInterpreter(TargetDeletable d, TargetInterpreter interpreter) - throws Throwable { - assert d instanceof TargetBreakpointSpec; // TODO: or Location - String index = Unique.assertOne(BREAK_PATTERN.matchKeys(d.getPath())); - waitOn(interpreter.execute("delete " + index)); - } - - @Override - protected void assertLocCoversViaInterpreter(AddressRange range, TargetBreakpointKind kind, - TargetBreakpointLocation loc, TargetInterpreter interpreter) throws Throwable { - String index = - Unique.assertOne(BREAK_PATTERN.matchKeys(loc.getSpecification().getPath())); - String output = waitOn(interpreter.executeCapture("info break " + index)); - String line = Unique.assertOne(Stream.of(output.split("\n")) - .filter(l -> !l.trim().startsWith("Num")) - .collect(Collectors.toList())).trim(); - assertTrue(line.startsWith(index)); - // TODO: Do I care to parse the details? The ID is confirmed, and details via the object... - } - - @Override - protected void assertEnabledViaInterpreter(TargetTogglable t, boolean enabled, - TargetInterpreter interpreter) throws Throwable { - assert t instanceof TargetBreakpointSpec; // TODO: or Location - String index = Unique.assertOne(BREAK_PATTERN.matchKeys(t.getPath())); - String output = waitOn(interpreter.executeCapture("info break " + index)); - String line = Unique.assertOne(Stream.of(output.split("\n")) - .filter(l -> !l.trim().startsWith("Num")) - .collect(Collectors.toList())).trim(); - assertTrue(line.startsWith(index)); - String enb = line.split("keep")[1].trim().split("\\s+")[0]; - assertEquals(enabled ? "y" : "n", enb); - } - - @Override - protected void assertDeletedViaInterpreter(TargetDeletable d, TargetInterpreter interpreter) - throws Throwable { - assert d instanceof TargetBreakpointSpec; // TODO: or Location - String index = Unique.assertOne(BREAK_PATTERN.matchKeys(d.getPath())); - String output = waitOn(interpreter.executeCapture("info break " + index)); - assertTrue(output.contains("No breakpoint")); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbFactoryTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbFactoryTest.java deleted file mode 100644 index 3ab88e37b6..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbFactoryTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model; - -import java.util.Map; - -import ghidra.dbg.test.AbstractDebuggerModelFactoryTest; - -public abstract class AbstractModelForGdbFactoryTest extends AbstractDebuggerModelFactoryTest { - @Override - protected Map getFailingFactoryOptions() { - return Map.ofEntries( - Map.entry("GDB launch command", "/THIS/SHOULD/NEVER/EXIST")); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbFrameActivationTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbFrameActivationTest.java deleted file mode 100644 index 421d1f6a32..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbFrameActivationTest.java +++ /dev/null @@ -1,88 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model; - -import static org.junit.Assert.*; - -import java.util.List; -import java.util.Set; -import java.util.concurrent.CompletableFuture; - -import generic.Unique; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetBreakpointSpec.TargetBreakpointKind; -import ghidra.dbg.test.AbstractDebuggerModelActivationTest; -import ghidra.dbg.util.PathPattern; -import ghidra.dbg.util.PathUtils; - -public abstract class AbstractModelForGdbFrameActivationTest - extends AbstractDebuggerModelActivationTest { - - private static final PathPattern STACK_PATTERN = - new PathPattern(PathUtils.parse("Inferiors[1].Threads[1].Stack[]")); - - DebuggerTestSpecimen getSpecimen() { - return GdbLinuxSpecimen.STACK; - } - - @Override - protected Set getActivatableThings() throws Throwable { - CompletableFuture frame0 = - m.getAddedWaiter().wait(PathUtils.parse("Inferiors[1].Threads[1].Stack[0]")); - CompletableFuture frame1 = - m.getAddedWaiter().wait(PathUtils.parse("Inferiors[1].Threads[1].Stack[1]")); - CompletableFuture frame2 = - m.getAddedWaiter().wait(PathUtils.parse("Inferiors[1].Threads[1].Stack[2]")); - - DebuggerTestSpecimen specimen = getSpecimen(); - TargetLauncher launcher = findLauncher(); // root launcher should generate new inferiors - waitOn(launcher.launch(specimen.getLauncherArgs())); - TargetBreakpointSpecContainer breakpoints = findBreakpointSpecContainer(List.of()); - waitOn(breakpoints.placeBreakpoint("break_here", Set.of(TargetBreakpointKind.SW_EXECUTE))); - TargetResumable inf = - (TargetResumable) waitOn(m.getAddedWaiter().wait(PathUtils.parse("Inferiors[1]"))); - waitOn(inf.resume()); - - waitSettled(m.getModel(), 200); - - return Set.of( - (TargetObject) waitOn(frame0), - (TargetObject) waitOn(frame1), - (TargetObject) waitOn(frame2)); - } - - @Override - protected List getExpectedDefaultActivePath() { - return PathUtils.parse("Inferiors[1].Threads[1].Stack[0]"); - } - - @Override - protected void activateViaInterpreter(TargetObject obj, TargetInterpreter interpreter) - throws Throwable { - String index = Unique.assertOne(STACK_PATTERN.matchKeys(obj.getPath())); - waitOn(interpreter.execute("frame " + index)); - } - - @Override - protected void assertActiveViaInterpreter(TargetObject expected, TargetInterpreter interpreter) - throws Throwable { - String line = waitOn(interpreter.executeCapture("frame")).trim(); - assertFalse(line.contains("\n")); - assertTrue(line.startsWith("#")); - String frameLevel = line.substring(1).split("\\s+")[0]; - assertEquals(expected.getPath(), STACK_PATTERN.applyKeys(frameLevel).getSingletonPath()); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbInferiorActivationTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbInferiorActivationTest.java deleted file mode 100644 index a1005a9744..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbInferiorActivationTest.java +++ /dev/null @@ -1,79 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model; - -import static org.junit.Assert.assertEquals; - -import java.util.List; -import java.util.Set; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import generic.Unique; -import ghidra.dbg.target.TargetInterpreter; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.test.AbstractDebuggerModelActivationTest; -import ghidra.dbg.util.PathPattern; -import ghidra.dbg.util.PathUtils; - -public abstract class AbstractModelForGdbInferiorActivationTest - extends AbstractDebuggerModelActivationTest { - - private static final PathPattern INF_PATTERN = new PathPattern(PathUtils.parse("Inferiors[]"));; - - @Override - protected Set getActivatableThings() throws Throwable { - CompletableFuture inf1 = m.getAddedWaiter().wait(PathUtils.parse("Inferiors[1]")); - CompletableFuture inf2 = m.getAddedWaiter().wait(PathUtils.parse("Inferiors[2]")); - CompletableFuture inf3 = m.getAddedWaiter().wait(PathUtils.parse("Inferiors[3]")); - - TargetInterpreter interpreter = findInterpreter(); - // The default +2 - waitOn(interpreter.execute("add-inferior")); - waitOn(interpreter.execute("add-inferior")); - - waitSettled(m.getModel(), 200); - - return Set.of( - (TargetObject) waitOn(inf1), - (TargetObject) waitOn(inf2), - (TargetObject) waitOn(inf3)); - } - - @Override - protected List getExpectedDefaultActivePath() { - return PathUtils.parse("Inferiors[1]"); - } - - @Override - protected void activateViaInterpreter(TargetObject obj, TargetInterpreter interpreter) - throws Throwable { - String index = Unique.assertOne(INF_PATTERN.matchKeys(obj.getPath())); - waitOn(interpreter.execute("inferior " + index)); - } - - @Override - protected void assertActiveViaInterpreter(TargetObject expected, TargetInterpreter interpreter) - throws Throwable { - String output = waitOn(interpreter.executeCapture("info inferiors")); - String line = Unique.assertOne(Stream.of(output.split("\n")) - .filter(l -> l.trim().startsWith("*")) - .collect(Collectors.toList())).trim(); - String inferiorId = line.split("\\s+")[1]; - assertEquals(expected.getPath(), INF_PATTERN.applyKeys(inferiorId).getSingletonPath()); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbInferiorAttacherTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbInferiorAttacherTest.java deleted file mode 100644 index 8799975ebc..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbInferiorAttacherTest.java +++ /dev/null @@ -1,36 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model; - -import java.util.List; - -import ghidra.dbg.target.TargetAttacher; -import ghidra.dbg.util.PathUtils; - -public abstract class AbstractModelForGdbInferiorAttacherTest - extends AbstractModelForGdbAttacherTest { - protected static final List INF1_PATH = PathUtils.parse("Inferiors[1]"); - - @Override - public List getExpectedAttacherPath() { - return INF1_PATH; - } - - @Override - public TargetAttacher findAttacher() throws Throwable { - return m.find(TargetAttacher.class, INF1_PATH); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbInferiorLauncherTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbInferiorLauncherTest.java deleted file mode 100644 index 6574b36370..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbInferiorLauncherTest.java +++ /dev/null @@ -1,36 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model; - -import java.util.List; - -import ghidra.dbg.target.TargetLauncher; -import ghidra.dbg.util.PathUtils; - -public abstract class AbstractModelForGdbInferiorLauncherTest - extends AbstractModelForGdbLauncherTest { - protected static final List INF1_PATH = PathUtils.parse("Inferiors[1]"); - - @Override - public List getExpectedLauncherPath() { - return INF1_PATH; - } - - @Override - public TargetLauncher findLauncher() throws Throwable { - return m.find(TargetLauncher.class, INF1_PATH); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbInterpreterTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbInterpreterTest.java deleted file mode 100644 index eda1037391..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbInterpreterTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model; - -import java.util.List; - -import ghidra.dbg.target.TargetProcess; -import ghidra.dbg.test.AbstractDebuggerModelInterpreterTest; - -public abstract class AbstractModelForGdbInterpreterTest - extends AbstractDebuggerModelInterpreterTest { - @Override - public List getExpectedInterpreterPath() { - return List.of(); - } - - @Override - protected String getEchoCommand(String msg) { - return "echo " + msg; - } - - @Override - protected String getQuitCommand() { - return "quit"; - } - - @Override - protected String getAttachCommand() { - return "attach " + dummy.pid; - } - - @Override - protected String getDetachCommand(TargetProcess process) { - return "detach"; - } - - @Override - protected String getKillCommand(TargetProcess process) { - return "kill"; - } - - @Override - public DebuggerTestSpecimen getAttachSpecimen() { - return GdbLinuxSpecimen.SLEEP; - } - - @Override - public DebuggerTestSpecimen getLaunchSpecimen() { - return GdbLinuxSpecimen.PRINT; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbLauncherTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbLauncherTest.java deleted file mode 100644 index ce2ada1b11..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbLauncherTest.java +++ /dev/null @@ -1,95 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import org.junit.Ignore; -import org.junit.Test; - -import agent.gdb.model.impl.GdbModelTargetInferior; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetMethod.TargetParameterMap; -import ghidra.dbg.test.AbstractDebuggerModelLauncherTest; - -public abstract class AbstractModelForGdbLauncherTest extends AbstractDebuggerModelLauncherTest { - - @Override - public DebuggerTestSpecimen getLaunchSpecimen() { - return GdbLinuxSpecimen.PRINT; - } - - @Override - public TargetParameterMap getExpectedLauncherParameters() { - return GdbModelTargetInferior.PARAMETERS; - } - - @Override - public void assertEnvironment(TargetEnvironment environment) { - // TODO: This test won't always be on amd64 Linux, no? - assertEquals("i386:x86-64", environment.getArchitecture()); - assertEquals("GNU/Linux", environment.getOperatingSystem()); - assertEquals("little", environment.getEndian()); - assertTrue(environment.getDebugger().toLowerCase().contains("gdb")); - } - - protected DebuggerTestSpecimen getLaunchStrippedSpecimen() { - return GdbLinuxSpecimen.SPIN_STRIPPED; - } - - /** - * Test a target which runs indefinitely, and for which GDB cannot get the temporary breakpoint - * on main. - */ - @Test - @Ignore - public void testLaunchStrippedThenInterrupt() throws Throwable { - m.build(); - - ProcessCreatedDebugModelListener listener = new ProcessCreatedDebugModelListener(); - // NB. I've intentionally omitted the reorderer here. The model should get it right. - m.getModel().addModelListener(listener); - - DebuggerTestSpecimen specimen = getLaunchStrippedSpecimen(); - TargetLauncher launcher = findLauncher(); - waitAcc(launcher); - waitOn(launcher.launch(specimen.getLauncherArgs())); - //System.err.println("Launched"); - - /** - * For the moment, we're stuck having to wait for the initial break in GDB before we - * announce that the target is RUNNING, because we depend on the environment being correct - * *before* that announcement. For launch, we can resolve the issue, because we can refresh - * the environment between "file" and "start". However, for attach, we're still hosed. I - * don't care to try to distinguish the two cases, because that's a lot of work, and still - * only a partial fix. - * - * Thus, we will not observe state=RUNNING until after we successfully interrupt the target. - * This test still suffices to address the interrupt problem, but I don't know any way to - * fix the state reporting problem until we fix the record-depends-on-language-mapping - * issue, which is still some time away. - */ - TargetInterruptible interruptible = - m.suitable(TargetInterruptible.class, launcher.getPath()); - Thread.sleep(1000); // HACK - waitOn(interruptible.interrupt()); - //System.err.println("Interrupted"); - - waitOn(listener.observedCreated); - //System.err.println("Observed"); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbScenarioAmd64RegistersTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbScenarioAmd64RegistersTest.java deleted file mode 100644 index 37deffe6e5..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbScenarioAmd64RegistersTest.java +++ /dev/null @@ -1,55 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model; - -import static org.junit.Assert.assertEquals; - -import java.util.Map; - -import agent.gdb.model.impl.GdbModelTargetInferior; -import ghidra.dbg.target.TargetProcess; -import ghidra.dbg.test.AbstractDebuggerModelScenarioRegistersTest; - -public abstract class AbstractModelForGdbScenarioAmd64RegistersTest - extends AbstractDebuggerModelScenarioRegistersTest { - - @Override - protected GdbLinuxSpecimen getSpecimen() { - return GdbLinuxSpecimen.REGISTERS; - } - - protected String getBinModuleName() { - return getSpecimen().getCommandLine(); - } - - @Override - protected String getBreakpointExpression() { - return "*break_here"; // Don't decode prologue, GDB! - } - - @Override - protected Map getRegisterWrites() { - // RDI is first parameter `val` of break_here(int val) - return Map.of("rdi", arr("0000000000000041")); - } - - @Override - protected void verifyExpectedEffect(TargetProcess process) throws Throwable { - long status = process.getTypedAttributeNowByName( - GdbModelTargetInferior.EXIT_CODE_ATTRIBUTE_NAME, Long.class, 0L); - assertEquals(0x41, status); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbScenarioCloneExitTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbScenarioCloneExitTest.java deleted file mode 100644 index f79968de3f..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbScenarioCloneExitTest.java +++ /dev/null @@ -1,32 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model; - -import ghidra.dbg.test.AbstractDebuggerModelScenarioCloneExitTest; - -public abstract class AbstractModelForGdbScenarioCloneExitTest - extends AbstractDebuggerModelScenarioCloneExitTest { - - @Override - protected DebuggerTestSpecimen getSpecimen() { - return GdbLinuxSpecimen.CLONE_EXIT; - } - - @Override - protected String getBreakpointExpression() { - return "work"; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbScenarioForkExitTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbScenarioForkExitTest.java deleted file mode 100644 index d842ecea83..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbScenarioForkExitTest.java +++ /dev/null @@ -1,52 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import ghidra.dbg.target.*; -import ghidra.dbg.test.AbstractDebuggerModelScenarioForkExitTest; - -public abstract class AbstractModelForGdbScenarioForkExitTest - extends AbstractDebuggerModelScenarioForkExitTest { - - @Override - protected DebuggerTestSpecimen getSpecimen() { - return GdbLinuxSpecimen.FORK_EXIT; - } - - @Override - protected void preLaunch(TargetLauncher launcher) throws Throwable { - TargetInterpreter interpreter = findInterpreter(); - waitAcc(interpreter); - waitOn(interpreter.execute("set detach-on-fork off")); - } - - @Override - protected String getParentBreakpointExpression() { - return "func"; - } - - @Override - public void assertEnvironment(TargetEnvironment environment) { - // TODO: This test won't always be on amd64 Linux, no? - assertEquals("i386:x86-64", environment.getArchitecture()); - assertEquals("GNU/Linux", environment.getOperatingSystem()); - assertEquals("little", environment.getEndian()); - assertTrue(environment.getDebugger().toLowerCase().contains("gdb")); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbScenarioMemoryTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbScenarioMemoryTest.java deleted file mode 100644 index 057d6d87ff..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbScenarioMemoryTest.java +++ /dev/null @@ -1,73 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model; - -import static org.junit.Assert.assertEquals; - -import java.util.List; -import java.util.Objects; - -import agent.gdb.model.impl.GdbModelTargetInferior; -import ghidra.dbg.target.*; -import ghidra.dbg.test.AbstractDebuggerModelScenarioMemoryTest; -import ghidra.dbg.util.PathUtils; -import ghidra.program.model.address.Address; - -public abstract class AbstractModelForGdbScenarioMemoryTest - extends AbstractDebuggerModelScenarioMemoryTest { - - @Override - protected GdbLinuxSpecimen getSpecimen() { - return GdbLinuxSpecimen.PRINT; - } - - protected String getBinModuleName() { - return getSpecimen().getCommandLine(); - } - - protected String getSymbolName() { - return "overwrite"; - } - - @Override - protected Address getAddressToWrite(TargetProcess process) throws Throwable { - List modulePath = PathUtils.extend(process.getPath(), - PathUtils.parse("Modules[" + getBinModuleName() + "]")); - TargetObject container = - Objects.requireNonNull(m.findContainer(TargetSymbol.class, modulePath)); - TargetSymbol symbol = - waitOn(container.fetchElements()).get(getSymbolName()).as(TargetSymbol.class); - return symbol.getValue(); - } - - @Override - protected byte[] getBytesToWrite() { - return "Speak".getBytes(); - } - - @Override - protected byte[] getExpectedBytes() { - return "Speak, World!".getBytes(); - } - - @Override - protected void verifyExpectedEffect(TargetProcess process) throws Throwable { - // TODO: Should (optional) exitCode be standardized on all models? - long status = process.getTypedAttributeNowByName( - GdbModelTargetInferior.EXIT_CODE_ATTRIBUTE_NAME, Long.class, 0L); - assertEquals('S', status); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbScenarioStackTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbScenarioStackTest.java deleted file mode 100644 index 5de97578c1..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbScenarioStackTest.java +++ /dev/null @@ -1,66 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model; - -import static org.junit.Assert.assertEquals; - -import java.util.*; -import java.util.Map.Entry; - -import ghidra.dbg.target.*; -import ghidra.dbg.test.AbstractDebuggerModelScenarioStackTest; -import ghidra.dbg.util.PathUtils; -import ghidra.program.model.address.Address; - -public abstract class AbstractModelForGdbScenarioStackTest - extends AbstractDebuggerModelScenarioStackTest { - protected static List expectedSymbols = - List.of("break_here", "funcC", "funcB", "funcA"); - protected NavigableMap symbolsByAddress = new TreeMap<>(); - - @Override - protected GdbLinuxSpecimen getSpecimen() { - return GdbLinuxSpecimen.STACK; - } - - @Override - protected String getBreakpointExpression() { - return "break_here"; - } - - @Override - protected void postLaunch(TargetProcess process) throws Throwable { - TargetModuleContainer modules = m.find(TargetModuleContainer.class, process.getPath()); - // NB. NEVER is recommended resync mode for modules container - // It's not guaranteed to come before process is alive, though - TargetModule binMod = (TargetModule) waitOn(m.getAddedWaiter() - .wait(PathUtils.index(modules.getPath(), getSpecimen().getCommandLine()))); - - // NB. this heuristic assumes all function bodies are contiguous in memory - TargetSymbolNamespace symbols = m.find(TargetSymbolNamespace.class, binMod.getPath()); - // NB. ONCE is recommended resync mode for module symbols - for (Entry entry : waitOn(symbols.fetchElements()) - .entrySet()) { - symbolsByAddress.put(entry.getValue().as(TargetSymbol.class).getValue(), - entry.getKey()); - } - } - - @Override - protected void validateFramePC(int index, Address pc) { - assertEquals(expectedSymbols.get(index), symbolsByAddress.floorEntry(pc).getValue()); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbSessionAttacherTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbSessionAttacherTest.java deleted file mode 100644 index ed8d82b91e..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbSessionAttacherTest.java +++ /dev/null @@ -1,26 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model; - -import java.util.List; - -public abstract class AbstractModelForGdbSessionAttacherTest - extends AbstractModelForGdbAttacherTest { - @Override - public List getExpectedAttacherPath() { - return List.of(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbSessionLauncherTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbSessionLauncherTest.java deleted file mode 100644 index 729df3e316..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbSessionLauncherTest.java +++ /dev/null @@ -1,27 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model; - -import java.util.List; - -public abstract class AbstractModelForGdbSessionLauncherTest - extends AbstractModelForGdbLauncherTest { - - @Override - public List getExpectedLauncherPath() { - return List.of(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbSteppableTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbSteppableTest.java deleted file mode 100644 index b7e4f548c0..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbSteppableTest.java +++ /dev/null @@ -1,44 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model; - -import java.util.List; - -import ghidra.dbg.test.*; - -public abstract class AbstractModelForGdbSteppableTest extends AbstractDebuggerModelSteppableTest - implements ProvidesTargetViaLaunchSpecimen { - - @Override - public AbstractDebuggerModelTest getTest() { - return this; - } - - @Override - public List getExpectedSteppablePath(List threadPath) { - return threadPath; - } - - @Override - public DebuggerTestSpecimen getLaunchSpecimen() { - return GdbLinuxSpecimen.PRINT; - } - - @Override - protected long getDebounceWindowMs() { - return 500; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbThreadActivationTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbThreadActivationTest.java deleted file mode 100644 index aa7cd6459a..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/AbstractModelForGdbThreadActivationTest.java +++ /dev/null @@ -1,92 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model; - -import static org.junit.Assert.assertEquals; - -import java.util.List; -import java.util.Set; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import generic.Unique; -import ghidra.dbg.target.*; -import ghidra.dbg.test.AbstractDebuggerModelActivationTest; -import ghidra.dbg.util.PathPattern; -import ghidra.dbg.util.PathUtils; - -public abstract class AbstractModelForGdbThreadActivationTest - extends AbstractDebuggerModelActivationTest { - - private static final PathPattern THREAD_PATTERN = - new PathPattern(PathUtils.parse("Inferiors[].Threads[]")); - - protected DebuggerTestSpecimen getSpecimen() { - return GdbLinuxSpecimen.PRINT; - } - - @Override - protected Set getActivatableThings() throws Throwable { - /** - * TODO: GDB should really use the 1.1 and 2.1 numbering instead of the GId, but I don't - * know a good way via GDB/MI to obtain the thread's per-inferior Id. - * - * NB: A lot of the test takes advantage of the iid and tid being the same. Don't try to - * apply the pattern matching used here in other contexts. - */ - CompletableFuture inf1 = - m.getAddedWaiter().wait(PathUtils.parse("Inferiors[1].Threads[1]")); - CompletableFuture inf2 = - m.getAddedWaiter().wait(PathUtils.parse("Inferiors[2].Threads[2]")); - - DebuggerTestSpecimen specimen = getSpecimen(); - TargetLauncher launcher = findLauncher(); // root launcher should generate new inferiors - waitOn(launcher.launch(specimen.getLauncherArgs())); - waitOn(launcher.launch(specimen.getLauncherArgs())); - - waitSettled(m.getModel(), 200); - - return Set.of( - (TargetObject) waitOn(inf1), - (TargetObject) waitOn(inf2)); - } - - @Override - protected List getExpectedDefaultActivePath() { - return PathUtils.parse("Inferiors[2].Threads[2].Stack[0]"); - } - - @Override - protected void activateViaInterpreter(TargetObject obj, TargetInterpreter interpreter) - throws Throwable { - String index = Unique.assertOne(Set.copyOf(THREAD_PATTERN.matchKeys(obj.getPath()))); - // TODO: This test is imperfect, since inferiors are activated as well - waitOn(interpreter.execute("thread " + index + ".1")); - } - - @Override - protected void assertActiveViaInterpreter(TargetObject expected, TargetInterpreter interpreter) - throws Throwable { - String output = waitOn(interpreter.executeCapture("info threads -gid")); - String line = Unique.assertOne(Stream.of(output.split("\n")) - .filter(l -> l.trim().startsWith("*")) - .collect(Collectors.toList())); - String threadGid = line.split("\\s+")[2]; - assertEquals(expected.getPath(), - THREAD_PATTERN.applyKeys(threadGid, threadGid).getSingletonPath()); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/GdbLinuxSpecimen.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/GdbLinuxSpecimen.java deleted file mode 100644 index 3f62c29376..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/GdbLinuxSpecimen.java +++ /dev/null @@ -1,115 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model; - -import java.util.*; - -import agent.gdb.model.impl.GdbModelTargetAttachable; -import ghidra.dbg.target.TargetAttachable; -import ghidra.dbg.target.TargetLauncher.TargetCmdLineLauncher; -import ghidra.dbg.target.TargetProcess; -import ghidra.dbg.test.AbstractDebuggerModelTest; -import ghidra.dbg.test.AbstractDebuggerModelTest.DebuggerTestSpecimen; -import ghidra.dbg.testutil.DebuggerModelTestUtils; -import ghidra.dbg.testutil.DummyProc; -import ghidra.dbg.util.ShellUtils; - -public enum GdbLinuxSpecimen implements DebuggerTestSpecimen, DebuggerModelTestUtils { - SLEEP { - @Override - public String getCommandLine() { - return DummyProc.which("expTraceableSleep"); - } - }, - FORK_EXIT { - @Override - public String getCommandLine() { - return DummyProc.which("expFork"); - } - }, - - CLONE_EXIT { - @Override - public String getCommandLine() { - return DummyProc.which("expCloneExit"); - } - }, - PRINT { - @Override - public String getCommandLine() { - return DummyProc.which("expPrint"); - } - }, - REGISTERS { - @Override - public String getCommandLine() { - return DummyProc.which("expRegisters"); - } - }, - SPIN_STRIPPED { - @Override - public String getCommandLine() { - return DummyProc.which("expSpin.stripped"); - } - }, - STACK { - @Override - public String getCommandLine() { - return DummyProc.which("expStack"); - } - }; - - public abstract String getCommandLine(); - - @Override - public DummyProc runDummy() throws Throwable { - return DummyProc.run(ShellUtils.parseArgs(getCommandLine()).toArray(String[]::new)); - } - - @Override - public Map getLauncherArgs() { - return Map.ofEntries( - Map.entry(TargetCmdLineLauncher.CMDLINE_ARGS_NAME, getCommandLine())); - } - - @Override - public List getLaunchScript() { - List script = new ArrayList<>(); - List parsed = ShellUtils.parseArgs(getCommandLine()); - if (parsed.size() > 1) { - script.add("set args " + ShellUtils.generateLine(parsed.subList(1, parsed.size()))); - } - script.add("file " + ShellUtils.generateLine(parsed.subList(0, 1))); - script.add("start"); - return script; - } - - @Override - public boolean isRunningIn(TargetProcess process, AbstractDebuggerModelTest test) - throws Throwable { - waitOn(process.fetchAttributes()); - return process.getDisplay().contains(ShellUtils.parseArgs(getCommandLine()).get(0)); - } - - @Override - public boolean isAttachable(DummyProc dummy, TargetAttachable attachable, - AbstractDebuggerModelTest test) throws Throwable { - waitOn(attachable.fetchAttributes()); - long pid = attachable.getTypedAttributeNowByName( - GdbModelTargetAttachable.PID_ATTRIBUTE_NAME, Long.class, -1L); - return pid == dummy.pid; - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/gadp/GadpGdbModelHost.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/gadp/GadpGdbModelHost.java deleted file mode 100644 index 96186a740f..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/gadp/GadpGdbModelHost.java +++ /dev/null @@ -1,35 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.gadp; - -import static org.junit.Assume.assumeFalse; -import static org.junit.Assume.assumeTrue; - -import java.io.File; - -import agent.gdb.gadp.GdbGadpDebuggerModelFactory; -import agent.gdb.model.AbstractGdbModelHost; -import ghidra.dbg.DebuggerModelFactory; -import ghidra.util.SystemUtilities; - -class GadpGdbModelHost extends AbstractGdbModelHost { - @Override - public DebuggerModelFactory getModelFactory() { - assumeFalse("Not ready for CI", SystemUtilities.isInTestingBatchMode()); - assumeTrue("GDB cannot be found", new File("/usr/bin/gdb").canExecute()); - return new GdbGadpDebuggerModelFactory(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/gadp/GadpModelForGdbBreakpointsTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/gadp/GadpModelForGdbBreakpointsTest.java deleted file mode 100644 index 2e93807a0c..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/gadp/GadpModelForGdbBreakpointsTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.gadp; - -import org.junit.Ignore; - -import agent.gdb.model.AbstractModelForGdbBreakpointsTest; - -@Ignore("deprecated") -public class GadpModelForGdbBreakpointsTest extends AbstractModelForGdbBreakpointsTest { - @Override - public ModelHost modelHost() throws Throwable { - return new GadpGdbModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/gadp/GadpModelForGdbFactoryTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/gadp/GadpModelForGdbFactoryTest.java deleted file mode 100644 index e519cfdb25..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/gadp/GadpModelForGdbFactoryTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.gadp; - -import org.junit.Ignore; - -import agent.gdb.model.AbstractModelForGdbFactoryTest; - -@Ignore("deprecated") -public class GadpModelForGdbFactoryTest extends AbstractModelForGdbFactoryTest { - @Override - public ModelHost modelHost() throws Throwable { - return new GadpGdbModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/gadp/GadpModelForGdbInferiorAttacherTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/gadp/GadpModelForGdbInferiorAttacherTest.java deleted file mode 100644 index cfd0c162ab..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/gadp/GadpModelForGdbInferiorAttacherTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.gadp; - -import org.junit.Ignore; - -import agent.gdb.model.AbstractModelForGdbInferiorAttacherTest; - -@Ignore("deprecated") -public class GadpModelForGdbInferiorAttacherTest extends AbstractModelForGdbInferiorAttacherTest { - @Override - public ModelHost modelHost() throws Throwable { - return new GadpGdbModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/gadp/GadpModelForGdbInferiorLauncherTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/gadp/GadpModelForGdbInferiorLauncherTest.java deleted file mode 100644 index 75b68a2902..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/gadp/GadpModelForGdbInferiorLauncherTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.gadp; - -import org.junit.Ignore; - -import agent.gdb.model.AbstractModelForGdbInferiorLauncherTest; - -@Ignore("deprecated") -public class GadpModelForGdbInferiorLauncherTest extends AbstractModelForGdbInferiorLauncherTest { - @Override - public ModelHost modelHost() throws Throwable { - return new GadpGdbModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/gadp/GadpModelForGdbInterpreterTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/gadp/GadpModelForGdbInterpreterTest.java deleted file mode 100644 index 1d6100d9bb..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/gadp/GadpModelForGdbInterpreterTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.gadp; - -import org.junit.Ignore; - -import agent.gdb.model.AbstractModelForGdbInterpreterTest; - -@Ignore("deprecated") -public class GadpModelForGdbInterpreterTest extends AbstractModelForGdbInterpreterTest { - @Override - public ModelHost modelHost() throws Throwable { - return new GadpGdbModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/gadp/GadpModelForGdbScenarioForkExitTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/gadp/GadpModelForGdbScenarioForkExitTest.java deleted file mode 100644 index bef358121b..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/gadp/GadpModelForGdbScenarioForkExitTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.gadp; - -import org.junit.Ignore; - -import agent.gdb.model.AbstractModelForGdbScenarioForkExitTest; - -@Ignore("deprecated") -public class GadpModelForGdbScenarioForkExitTest extends AbstractModelForGdbScenarioForkExitTest { - @Override - public ModelHost modelHost() throws Throwable { - return new GadpGdbModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/gadp/GadpModelForGdbSessionAttacherTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/gadp/GadpModelForGdbSessionAttacherTest.java deleted file mode 100644 index 4626b48638..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/gadp/GadpModelForGdbSessionAttacherTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.gadp; - -import org.junit.Ignore; - -import agent.gdb.model.AbstractModelForGdbSessionAttacherTest; - -@Ignore("deprecated") -public class GadpModelForGdbSessionAttacherTest extends AbstractModelForGdbSessionAttacherTest { - @Override - public ModelHost modelHost() throws Throwable { - return new GadpGdbModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/gadp/GadpModelForGdbSessionLauncherTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/gadp/GadpModelForGdbSessionLauncherTest.java deleted file mode 100644 index c30dad5a68..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/gadp/GadpModelForGdbSessionLauncherTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.gadp; - -import org.junit.Ignore; - -import agent.gdb.model.AbstractModelForGdbSessionLauncherTest; - -@Ignore("deprecated") -public class GadpModelForGdbSessionLauncherTest extends AbstractModelForGdbSessionLauncherTest { - @Override - public ModelHost modelHost() throws Throwable { - return new GadpGdbModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmGdbModelHost.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmGdbModelHost.java deleted file mode 100644 index c943299a5a..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmGdbModelHost.java +++ /dev/null @@ -1,32 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.invm; - -import static org.junit.Assume.assumeTrue; - -import java.io.File; - -import agent.gdb.GdbInJvmDebuggerModelFactory; -import agent.gdb.model.AbstractGdbModelHost; -import ghidra.dbg.DebuggerModelFactory; - -class InVmGdbModelHost extends AbstractGdbModelHost { - @Override - public DebuggerModelFactory getModelFactory() { - assumeTrue("GDB cannot be found", new File("/usr/bin/gdb").canExecute()); - return new GdbInJvmDebuggerModelFactory(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbAmd64RegistersTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbAmd64RegistersTest.java deleted file mode 100644 index 135371146b..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbAmd64RegistersTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.invm; - -import org.junit.Ignore; -import org.junit.experimental.categories.Category; - -import agent.gdb.model.AbstractModelForGdbAmd64RegistersTest; -import generic.test.category.NightlyCategory; - -@Ignore("deprecated") -@Category(NightlyCategory.class) // this may actually be an @PortSensitive test -public class InVmModelForGdbAmd64RegistersTest extends AbstractModelForGdbAmd64RegistersTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmGdbModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbBreakpointsTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbBreakpointsTest.java deleted file mode 100644 index 3dfc41a542..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbBreakpointsTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.invm; - -import org.junit.Ignore; -import org.junit.experimental.categories.Category; - -import agent.gdb.model.AbstractModelForGdbBreakpointsTest; -import generic.test.category.NightlyCategory; - -@Ignore("deprecated") -@Category(NightlyCategory.class) // this may actually be an @PortSensitive test -public class InVmModelForGdbBreakpointsTest extends AbstractModelForGdbBreakpointsTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmGdbModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbFactoryTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbFactoryTest.java deleted file mode 100644 index 9fac61a0bc..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbFactoryTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.invm; - -import org.junit.Ignore; - -import agent.gdb.model.AbstractModelForGdbFactoryTest; - -@Ignore("deprecated") -public class InVmModelForGdbFactoryTest extends AbstractModelForGdbFactoryTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmGdbModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbFrameActivationTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbFrameActivationTest.java deleted file mode 100644 index d020f9c26c..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbFrameActivationTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.invm; - -import org.junit.Ignore; -import org.junit.experimental.categories.Category; - -import agent.gdb.model.AbstractModelForGdbFrameActivationTest; -import generic.test.category.NightlyCategory; - -@Ignore("deprecated") -@Category(NightlyCategory.class) // this may actually be an @PortSensitive test -public class InVmModelForGdbFrameActivationTest extends AbstractModelForGdbFrameActivationTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmGdbModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbInferiorActivationTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbInferiorActivationTest.java deleted file mode 100644 index 10c9c2ce57..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbInferiorActivationTest.java +++ /dev/null @@ -1,29 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.invm; - -import org.junit.Ignore; - -import agent.gdb.model.AbstractModelForGdbInferiorActivationTest; - -@Ignore("deprecated") -public class InVmModelForGdbInferiorActivationTest - extends AbstractModelForGdbInferiorActivationTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmGdbModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbInferiorAttacherTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbInferiorAttacherTest.java deleted file mode 100644 index b4c756c5aa..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbInferiorAttacherTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.invm; - -import static org.junit.Assume.assumeFalse; - -import org.junit.Ignore; -import org.junit.Test; - -import agent.gdb.model.AbstractModelForGdbInferiorAttacherTest; -import ghidra.util.Msg; -import ghidra.util.SystemUtilities; - -@Ignore("deprecated") -public class InVmModelForGdbInferiorAttacherTest extends AbstractModelForGdbInferiorAttacherTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmGdbModelHost(); - } - - @Override - @Ignore("Some hang. I don't know why") - public void testAttachableContainerIsWhereExpected() throws Throwable { - // nop - } - - /** - * Run a dummy process without a tty. It seems when GDB (I tested with 8.0.1) attaches to such a - * process, it is unable to interrupt it from the opposite interpreter that resumed it. - */ - @Test - @Ignore("Not a real test") - public void testRunADummy() throws Throwable { - assumeFalse(SystemUtilities.isInTestingBatchMode()); - - DebuggerTestSpecimen specimen = getAttachSpecimen(); - dummy = specimen.runDummy(); - - Msg.info(this, "Dummy pid: " + dummy.pid); - dummy.process.waitFor(); - Msg.info(this, "Dummy terminated"); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbInferiorLauncherTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbInferiorLauncherTest.java deleted file mode 100644 index 7cd663a470..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbInferiorLauncherTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.invm; - -import org.junit.Ignore; -import org.junit.experimental.categories.Category; - -import agent.gdb.model.AbstractModelForGdbInferiorLauncherTest; -import generic.test.category.NightlyCategory; - -@Ignore("deprecated") -@Category(NightlyCategory.class) // this may actually be an @PortSensitive test -public class InVmModelForGdbInferiorLauncherTest extends AbstractModelForGdbInferiorLauncherTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmGdbModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbInterpreterTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbInterpreterTest.java deleted file mode 100644 index 313c4c9917..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbInterpreterTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.invm; - -import org.junit.Ignore; -import org.junit.experimental.categories.Category; - -import agent.gdb.model.AbstractModelForGdbInterpreterTest; -import generic.test.category.NightlyCategory; - -@Ignore("deprecated") -@Category(NightlyCategory.class) // this may actually be an @PortSensitive test -public class InVmModelForGdbInterpreterTest extends AbstractModelForGdbInterpreterTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmGdbModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbScenarioAmd64RegistersTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbScenarioAmd64RegistersTest.java deleted file mode 100644 index ef69d27048..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbScenarioAmd64RegistersTest.java +++ /dev/null @@ -1,32 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.invm; - -import org.junit.Ignore; -import org.junit.experimental.categories.Category; - -import agent.gdb.model.AbstractModelForGdbScenarioAmd64RegistersTest; -import generic.test.category.NightlyCategory; - -@Ignore("deprecated") -@Category(NightlyCategory.class) // this may actually be an @PortSensitive test -public class InVmModelForGdbScenarioAmd64RegistersTest - extends AbstractModelForGdbScenarioAmd64RegistersTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmGdbModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbScenarioCloneExitTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbScenarioCloneExitTest.java deleted file mode 100644 index fd27ff04a0..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbScenarioCloneExitTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.invm; - -import org.junit.Ignore; -import org.junit.experimental.categories.Category; - -import agent.gdb.model.AbstractModelForGdbScenarioCloneExitTest; -import generic.test.category.NightlyCategory; - -@Ignore("deprecated") -@Category(NightlyCategory.class) // this may actually be an @PortSensitive test -public class InVmModelForGdbScenarioCloneExitTest extends AbstractModelForGdbScenarioCloneExitTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmGdbModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbScenarioForkExitTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbScenarioForkExitTest.java deleted file mode 100644 index 6fbb4b8e8f..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbScenarioForkExitTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.invm; - -import org.junit.Ignore; - -import agent.gdb.model.AbstractModelForGdbScenarioForkExitTest; - -@Ignore("deprecated") -public class InVmModelForGdbScenarioForkExitTest extends AbstractModelForGdbScenarioForkExitTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmGdbModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbScenarioMemoryTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbScenarioMemoryTest.java deleted file mode 100644 index 56433ac18d..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbScenarioMemoryTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.invm; - -import org.junit.Ignore; - -import agent.gdb.model.AbstractModelForGdbScenarioMemoryTest; - -@Ignore("deprecated") -public class InVmModelForGdbScenarioMemoryTest extends AbstractModelForGdbScenarioMemoryTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmGdbModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbScenarioStackTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbScenarioStackTest.java deleted file mode 100644 index 27a55f700a..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbScenarioStackTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.invm; - -import org.junit.Ignore; - -import agent.gdb.model.AbstractModelForGdbScenarioStackTest; - -@Ignore("deprecated") -public class InVmModelForGdbScenarioStackTest extends AbstractModelForGdbScenarioStackTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmGdbModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbSessionAttacherTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbSessionAttacherTest.java deleted file mode 100644 index fd838667de..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbSessionAttacherTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.invm; - -import org.junit.Ignore; - -import agent.gdb.model.AbstractModelForGdbSessionAttacherTest; - -@Ignore("deprecated") -public class InVmModelForGdbSessionAttacherTest extends AbstractModelForGdbSessionAttacherTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmGdbModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbSessionLauncherTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbSessionLauncherTest.java deleted file mode 100644 index 123929b1c8..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbSessionLauncherTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.invm; - -import org.junit.Ignore; -import org.junit.experimental.categories.Category; - -import agent.gdb.model.AbstractModelForGdbSessionLauncherTest; -import generic.test.category.NightlyCategory; - -@Ignore("deprecated") -@Category(NightlyCategory.class) // this may actually be an @PortSensitive test -public class InVmModelForGdbSessionLauncherTest extends AbstractModelForGdbSessionLauncherTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmGdbModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbSteppableTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbSteppableTest.java deleted file mode 100644 index 9744c7fec4..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbSteppableTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.invm; - -import org.junit.Ignore; -import org.junit.experimental.categories.Category; - -import agent.gdb.model.AbstractModelForGdbSteppableTest; -import generic.test.category.NightlyCategory; - -@Ignore("deprecated") -@Category(NightlyCategory.class) // this may actually be an @PortSensitive test -public class InVmModelForGdbSteppableTest extends AbstractModelForGdbSteppableTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmGdbModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbThreadActivationTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbThreadActivationTest.java deleted file mode 100644 index 72a8703579..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/invm/InVmModelForGdbThreadActivationTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.invm; - -import org.junit.Ignore; - -import agent.gdb.model.AbstractModelForGdbThreadActivationTest; - -@Ignore("deprecated") -public class InVmModelForGdbThreadActivationTest extends AbstractModelForGdbThreadActivationTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmGdbModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/ssh/SshGdbModelHost.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/ssh/SshGdbModelHost.java deleted file mode 100644 index 238fdf1fc6..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/ssh/SshGdbModelHost.java +++ /dev/null @@ -1,42 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.ssh; - -import java.util.Map; - -import agent.gdb.GdbOverSshDebuggerModelFactory; -import ghidra.dbg.DebuggerModelFactory; -import ghidra.dbg.test.AbstractModelHost; -import ghidra.pty.ssh.SshPtyTest; -import ghidra.util.exception.CancelledException; - -public class SshGdbModelHost extends AbstractModelHost { - - @Override - public DebuggerModelFactory getModelFactory() { - return new GdbOverSshDebuggerModelFactory(); - } - - @Override - public Map getFactoryOptions() { - try { - return Map.ofEntries(Map.entry("SSH username", SshPtyTest.promptUser())); - } - catch (CancelledException e) { - throw new AssertionError("Cancelled", e); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/ssh/SshJoinGdbModelHost.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/ssh/SshJoinGdbModelHost.java deleted file mode 100644 index f10cd6e1f1..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/ssh/SshJoinGdbModelHost.java +++ /dev/null @@ -1,44 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.ssh; - -import java.util.Map; - -import agent.gdb.GdbOverSshDebuggerModelFactory; -import ghidra.dbg.DebuggerModelFactory; -import ghidra.dbg.test.AbstractModelHost; -import ghidra.pty.ssh.SshPtyTest; -import ghidra.util.exception.CancelledException; - -public class SshJoinGdbModelHost extends AbstractModelHost { - - @Override - public DebuggerModelFactory getModelFactory() { - return new GdbOverSshDebuggerModelFactory(); - } - - @Override - public Map getFactoryOptions() { - try { - return Map.ofEntries( - Map.entry("SSH username", SshPtyTest.promptUser()), - Map.entry("Use existing session via new-ui", true)); - } - catch (CancelledException e) { - throw new AssertionError("Cancelled", e); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/ssh/SshJoinModelForGdbFactoryTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/ssh/SshJoinModelForGdbFactoryTest.java deleted file mode 100644 index d9f993dfde..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/ssh/SshJoinModelForGdbFactoryTest.java +++ /dev/null @@ -1,38 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.ssh; - -import static org.junit.Assume.assumeFalse; - -import org.junit.Before; -import org.junit.Ignore; - -import agent.gdb.model.AbstractModelForGdbFactoryTest; -import ghidra.util.SystemUtilities; - -@Ignore("deprecated") -public class SshJoinModelForGdbFactoryTest extends AbstractModelForGdbFactoryTest { - - @Before - public void checkInteractive() { - assumeFalse(SystemUtilities.isInTestingBatchMode()); - } - - @Override - public ModelHost modelHost() throws Throwable { - return new SshJoinGdbModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/ssh/SshJoinModelForGdbSessionLauncherTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/ssh/SshJoinModelForGdbSessionLauncherTest.java deleted file mode 100644 index 311edd1c47..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/ssh/SshJoinModelForGdbSessionLauncherTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.ssh; - -import static org.junit.Assume.assumeFalse; - -import org.junit.Before; -import org.junit.Ignore; -import org.junit.experimental.categories.Category; - -import agent.gdb.model.AbstractModelForGdbSessionLauncherTest; -import generic.test.category.NightlyCategory; -import ghidra.util.SystemUtilities; - -@Ignore("deprecated") -@Category(NightlyCategory.class) // this may actually be an @PortSensitive test -public class SshJoinModelForGdbSessionLauncherTest extends AbstractModelForGdbSessionLauncherTest { - - @Before - public void checkInteractive() { - assumeFalse(SystemUtilities.isInTestingBatchMode()); - } - - @Override - public ModelHost modelHost() throws Throwable { - return new SshJoinGdbModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/ssh/SshModelForGdbFactoryTest.java b/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/ssh/SshModelForGdbFactoryTest.java deleted file mode 100644 index d4fe9c3e5c..0000000000 --- a/Ghidra/Debug/Debugger-agent-gdb/src/test/java/agent/gdb/model/ssh/SshModelForGdbFactoryTest.java +++ /dev/null @@ -1,38 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.gdb.model.ssh; - -import static org.junit.Assume.assumeFalse; - -import org.junit.Before; -import org.junit.Ignore; - -import agent.gdb.model.AbstractModelForGdbFactoryTest; -import ghidra.util.SystemUtilities; - -@Ignore("deprecated") -public class SshModelForGdbFactoryTest extends AbstractModelForGdbFactoryTest { - - @Before - public void checkInteractive() { - assumeFalse(SystemUtilities.isInTestingBatchMode()); - } - - @Override - public ModelHost modelHost() throws Throwable { - return new SshGdbModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/build.gradle b/Ghidra/Debug/Debugger-agent-lldb/build.gradle index c7b695badc..e8884c1a7d 100644 --- a/Ghidra/Debug/Debugger-agent-lldb/build.gradle +++ b/Ghidra/Debug/Debugger-agent-lldb/build.gradle @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -23,33 +23,3 @@ apply from: "$rootProject.projectDir/gradle/debugger/hasExecutableJar.gradle" apply plugin: 'eclipse' eclipse.project.name = 'Debug Debugger-agent-lldb' - -dependencies { - api project(':Framework-AsyncComm') - api project(':Framework-Debugging') - api project(':Debugger-gadp') - api project(':Debugger-swig-lldb') - - testImplementation project(path: ':Framework-AsyncComm', configuration: 'testArtifacts') - testImplementation project(path: ':Framework-Debugging', configuration: 'testArtifacts') - testImplementation project(path: ':Debugger-gadp', configuration: 'testArtifacts') -} - -tasks.nodepJar { - manifest { - attributes['Main-Class'] = 'agent.lldb.gadp.LldbGadpServer' - } -} - -tasks.executableJar { - ext.outjar = file("${buildDir}/bin/gadp-agent-lldb") -} - -test { - if ("linux_x86_64".equals(getCurrentPlatformName())) { - dependsOn(":Framework-Debugging:testSpecimenLinux_x86_64") - } - if ("mac_x86_64".equals(getCurrentPlatformName())) { - dependsOn(":Framework-Debugging:testSpecimenMac_x86_64") - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/llvm-project/lldb/bindings/java/java-typemaps.swig b/Ghidra/Debug/Debugger-agent-lldb/src/llvm-project/lldb/bindings/java/java-typemaps.swig deleted file mode 100644 index e23628eb30..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/llvm-project/lldb/bindings/java/java-typemaps.swig +++ /dev/null @@ -1,18 +0,0 @@ -%include -%include -%include - -%typemap(javabase) ByteArray "SWIGTYPE_p_void" -%typemap(javabody) ByteArray %{ - private long swigCPtr; // Minor bodge to work around private variable in parent - private boolean swigCMemOwn; - public $javaclassname(long cPtr, boolean cMemoryOwn) { - super(cPtr, cMemoryOwn); - this.swigCPtr = SWIGTYPE_p_void.getCPtr(this); - swigCMemOwn = cMemoryOwn; - } -%} - -%array_class(jbyte, ByteArray); - -%apply char **STRING_ARRAY { char ** } diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/llvm-project/lldb/bindings/java/java.swig b/Ghidra/Debug/Debugger-agent-lldb/src/llvm-project/lldb/bindings/java/java.swig deleted file mode 100644 index 305ecc6b70..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/llvm-project/lldb/bindings/java/java.swig +++ /dev/null @@ -1,22 +0,0 @@ -/* - lldb.swig - - This is the input file for SWIG, to create the appropriate C++ wrappers and - functions for various scripting languages, to enable them to call the - liblldb Script Bridge functions. -*/ - -%module lldb - -%include -%include "java-typemaps.swig" -%include "macros.swig" -%include "headers.swig" - -%{ -using namespace lldb_private; -using namespace lldb; -%} - -%include "interfaces.swig" - diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/LldbInJvmDebuggerModelFactory.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/LldbInJvmDebuggerModelFactory.java deleted file mode 100644 index 199e16f295..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/LldbInJvmDebuggerModelFactory.java +++ /dev/null @@ -1,56 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb; - -import java.util.concurrent.CompletableFuture; - -import agent.lldb.model.impl.LldbModelImpl; -import ghidra.dbg.DebuggerModelFactory; -import ghidra.dbg.DebuggerObjectModel; -import ghidra.dbg.util.ConfigurableFactory.FactoryDescription; -import ghidra.program.model.listing.Program; - -@FactoryDescription( - brief = "lldb", - htmlDetails = """ - Connect to lldb. - This is best for most macOS and iOS targets, but supports many others. - This will access the native API, which may put Ghidra's JVM at risk.""") -public class LldbInJvmDebuggerModelFactory implements DebuggerModelFactory { - - @Override - public CompletableFuture build() { - LldbModelImpl model = new LldbModelImpl(); - return model.startLLDB(new String[] {}).thenApply(__ -> model); - } - - @Override - public int getPriority(Program program) { - String osname = System.getProperty("os.name").toLowerCase(); - if (!(osname.contains("mac os x") || osname.contains("linux") || - osname.contains("windows"))) { - return -1; - } - if (program != null) { - String exe = program.getExecutablePath(); - if (exe == null || exe.isBlank()) { - return -1; - } - } - return 40; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/gadp/LldbGadpDebuggerModelFactory.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/gadp/LldbGadpDebuggerModelFactory.java deleted file mode 100644 index db4099f302..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/gadp/LldbGadpDebuggerModelFactory.java +++ /dev/null @@ -1,63 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.gadp; - -import java.util.List; - -import ghidra.dbg.gadp.server.AbstractGadpLocalDebuggerModelFactory; -import ghidra.dbg.util.ConfigurableFactory.FactoryDescription; -import ghidra.program.model.listing.Program; - -@FactoryDescription( - brief = "lldb via GADP", - htmlDetails = """ - Connect to lldb. - This is best for most macOS and iOS targets, but supports many others. - This will protect Ghidra's JVM by using a subprocess to access the native API.""") -public class LldbGadpDebuggerModelFactory extends AbstractGadpLocalDebuggerModelFactory { - - @Override - public int getPriority(Program program) { - String osname = System.getProperty("os.name").toLowerCase(); - if (!(osname.contains("mac os x") || osname.contains("linux") || - osname.contains("windows"))) { - return -1; - } - if (program != null) { - String exe = program.getExecutablePath(); - if (exe == null || exe.isBlank()) { - return -1; - } - } - return 35; - } - - @Override - protected String getThreadName() { - return "Local LLDB Agent stdout"; - } - - protected Class getServerClass() { - return LldbGadpServer.class; - } - - @Override - protected void completeCommandLine(List cmd) { - cmd.add(getServerClass().getCanonicalName()); - cmd.addAll(List.of("-H", host)); - cmd.addAll(List.of("-p", Integer.toString(port))); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/gadp/LldbGadpServer.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/gadp/LldbGadpServer.java deleted file mode 100644 index 6ada783934..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/gadp/LldbGadpServer.java +++ /dev/null @@ -1,192 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.gadp; - -import java.io.IOException; -import java.net.InetSocketAddress; -import java.net.SocketAddress; -import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutionException; - -import agent.lldb.gadp.impl.LldbGadpServerImpl; -import ghidra.async.AsyncUtils; -import ghidra.dbg.agent.AgentWindow; -import ghidra.util.Msg; - -public interface LldbGadpServer extends AutoCloseable { - public static final String USAGE = - """ - This is the GADP server for Frida. Usage: - - gadp-agent-lldb [-H HOST/ADDR] [-p PORT] - - Options: - --host/-H The address of the interface on which to listen. Default is - localhost - --port/-p The TCP port on which to listen for GADP. Default is 12345 - """; - - /** - * The entry point for the LLDB server in stand-alone mode - * - * Run it to see help. - * - * @param args the command-line arguments - * @throws IOException if an I/O error occurs - * @throws ExecutionException - * @throws InterruptedException - */ - public static void main(String[] args) throws Exception { - new LldbRunner().run(args); - } - - /** - * Create a new instance of the server - * - * @param addr the address to bind the SCTL server to - * @param busId the client ID the server should use on the bus for synthesized commands - * @return the server instance - * @throws IOException - */ - public static LldbGadpServer newInstance(SocketAddress addr) throws IOException { - return new LldbGadpServerImpl(addr); - } - - /** - * Runs the server from the command line - */ - public class LldbRunner { - protected InetSocketAddress bindTo; - protected List lldbArgs = new ArrayList<>(); - protected byte busId = 1; - protected String remote = null; - - public LldbRunner() { - } - - public void run(String args[]) - throws IOException, InterruptedException, ExecutionException { - parseArguments(args); - - try (LldbGadpServer server = newInstance(bindTo)) { - //TODO: fix/test the debugConnect case when args are passed - server.startLLDB(lldbArgs.toArray(new String[] {})).exceptionally(e -> { - e = AsyncUtils.unwrapThrowable(e); - Msg.error(this, "Error starting lldb/GADP: " + e); - System.exit(-1); - return null; - }); - new AgentWindow("LLDB Agent for Ghidra", server.getLocalAddress()); - while (server.isRunning()) { - Thread.sleep(1000); - } - System.exit(0); - } - } - - protected void parseArguments(String[] args) { - String iface = "localhost"; - int port = 12345; - // NOTE: Maybe commons-cli or Argparse4j? - Iterator ait = Arrays.asList(args).iterator(); - while (ait.hasNext()) { - String a = ait.next(); - if ("-h".equals(a) || "--help".equals(a)) { - printUsage(); - System.exit(0); - } - else if ("-p".equals(a) || "--port".equals(a)) { - if (!ait.hasNext()) { - System.err.println("Expected PORT"); - printUsage(); - System.exit(-1); - } - String portStr = ait.next(); - try { - port = Integer.parseInt(portStr); - } - catch (NumberFormatException e) { - System.err.println("Integer required. Got " + portStr); - printUsage(); - System.exit(-1); - } - } - else if ("-H".equals(a) || "--host".equals(a)) { - if (!ait.hasNext()) { - System.err.println("Expected HOST/ADDR"); - printUsage(); - System.exit(-1); - } - iface = ait.next(); - } - else { - System.err.println("Unknown option: " + a); - printUsage(); - System.exit(-1); - } - } - - bindTo = new InetSocketAddress(iface, port); - } - - protected void printUsage() { - System.out.println(USAGE); - } - } - - /** - * Start the debugging server - * - * @return a future that completes when the server is ready - */ - CompletableFuture startLLDB(String[] args); - - /** - * Get the local address to which the SCTL server is bound. - * - * @return the local socket address - */ - SocketAddress getLocalAddress(); - - /** - * Close all connections and ports, GADP and Process Server, and terminate the server - * - * @throws IOException if an I/O error occurs - */ - public void terminate() throws IOException; - - /** - * Check if the server is running - * - * This will return false: 1) Before the server has been started, 2) After a call to - * {@link #terminate()}, or 3) When an error occurs causing the server to terminate - * unexpectedly. Otherwise, it returns true. - * - * @return true if the server is currently running. - */ - public boolean isRunning(); - - /** - * Calls {@link #terminate()} - * - * @throws IOException if an I/O error occurs - */ - @Override - default void close() throws IOException { - terminate(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/gadp/impl/AbstractClientThreadExecutor.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/gadp/impl/AbstractClientThreadExecutor.java deleted file mode 100644 index 95e1d0217f..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/gadp/impl/AbstractClientThreadExecutor.java +++ /dev/null @@ -1,201 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.gadp.impl; - -import java.util.*; -import java.util.concurrent.*; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.function.Consumer; - -import agent.lldb.lldb.DebugClient; -import agent.lldb.lldb.DebugClient.DebugStatus; -import agent.lldb.manager.LldbManager; -import ghidra.util.Msg; - -/** - * A single-threaded executor which creates and exclusively accesses the {@code lldb} client. - * - *

- * The executor also has a priority mechanism, so that callbacks may register follow-on handlers - * which take precedence over other tasks in the queue (which could trigger additional callbacks). - * This is required since certain operation are not allowed during normal callback processing. For - * example, changing the current process is typically not allowed, but it is necessary to retrieve a - * thread's context. - */ -public abstract class AbstractClientThreadExecutor extends AbstractExecutorService { - private static final int DEFAULT_PRIORITY = 10; - - protected DebugClient client; - protected boolean shuttingDown = false; - protected final Queue queue = new PriorityQueue<>(); - protected Thread thread = new Thread(this::run, "DebugClient"); - protected final AtomicBoolean waitRegistered = new AtomicBoolean(); - - protected abstract void init(); - - public static class Entry implements Comparable { - final int priority; - public final Runnable command; - - public Entry(int priority, Runnable command) { - this.priority = priority; - this.command = command; - } - - @Override - public int compareTo(Entry that) { - return Integer.compare(this.priority, that.priority); - } - } - - /** - * Obtain a reference to the client, only if the calling thread is this executor's thread. - * - * @return the client - */ - public DebugClient getClient() { - return client; - } - - public void cancelWait() { - waitRegistered.set(false); - } - - public void registerWait() { - waitRegistered.set(true); - } - - private Entry pollQueue() { - synchronized (queue) { - return queue.poll(); - } - } - - private void run() { - /** - * The general idea is to run indefinitely, taking every precaution to protect this thread's - * life, since only it can access the client. Granted, if it turns out to be too difficult, - * we can always create a new thread and client, using the existing client's reentrant - * methods. - */ - try { - init(); - while (!shuttingDown) { - Entry next; - while (null != (next = pollQueue())) { - if (shuttingDown) { - return; - } - try { - //System.out.println("Executing: " + next); - next.command.run(); - //System.out.println("Done"); - } - catch (Throwable t) { - Msg.error(this, "Task in executor threw: " + t); - } - } - - DebugStatus status = client.getExecutionStatus(); - if (status.shouldWait && status != DebugStatus.NO_DEBUGGEE || - waitRegistered.get()) { - waitRegistered.set(false); - getManager().waitForEventEx(); - //client.getControl().waitForEvent(); - } - - } - } - catch (Throwable t) { - Msg.error(this, "Non-respawnable executor terminated unexpectedly", t); - shuttingDown = true; - } - } - - @Override - public void shutdown() { - shuttingDown = true; - } - - @Override - public List shutdownNow() { - shuttingDown = true; - thread.interrupt(); - List left = new ArrayList<>(queue.size()); - for (Entry ent : queue) { - left.add(ent.command); - } - return left; - } - - @Override - public boolean isShutdown() { - return shuttingDown; - } - - @Override - public boolean isTerminated() { - return !thread.isAlive(); - } - - @Override - public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException { - long millis = TimeUnit.MILLISECONDS.convert(timeout, unit); - thread.join(millis); - return !thread.isAlive(); - } - - @Override - public void execute(Runnable command) { - execute(DEFAULT_PRIORITY, command); - } - - /** - * Schedule a task with a given priority. - * - * @param priority the priority - * @param command the task - */ - public void execute(int priority, Runnable command) { - if (shuttingDown) { - throw new RejectedExecutionException("Executor is shutting down"); - } - if (!thread.isAlive()) { - throw new RejectedExecutionException("Executor has terminated"); - } - synchronized (queue) { - queue.add(new Entry(priority, command)); - } - } - - public boolean isCurrentThread() { - return thread.equals(Thread.currentThread()); - } - - /** - * Schedule a task with the given priority, taking a reference to the client. - * - * @param priority the priority - * @param command the task - */ - public void execute(int priority, Consumer command) { - execute(priority, () -> command.accept(client)); - } - - public abstract LldbManager getManager(); - - public abstract void setManager(LldbManager manager); -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/gadp/impl/LldbClientThreadExecutor.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/gadp/impl/LldbClientThreadExecutor.java deleted file mode 100644 index 5422a858c9..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/gadp/impl/LldbClientThreadExecutor.java +++ /dev/null @@ -1,64 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.gadp.impl; - -import java.util.function.Supplier; - -import agent.lldb.lldb.DebugClient; -import agent.lldb.manager.LldbManager; - -/** - * A single-threaded executor which creates and exclusively accesses the {@code lldb} client. - * - * The executor also has a priority mechanism, so that callbacks may register follow-on handlers - * which take precedence over other tasks in the queue (which could trigger additional callbacks). - * This is required since certain operation are not allowed during normal callback processing. For - * example, changing the current process is typically not allowed, but it is necessary to retrieve a - * thread's context. - */ -public class LldbClientThreadExecutor extends AbstractClientThreadExecutor { - - private final Supplier makeClient; - private LldbManager manager; - - /** - * Instantiate a new executor, providing a means of creating the client - * - * @param makeClient the callback to create the client - */ - public LldbClientThreadExecutor(Supplier makeClient) { - this.makeClient = makeClient; - thread.setDaemon(true); - thread.start(); - } - - @Override - protected void init() { - this.client = makeClient.get(); - client.setManager(manager); - } - - @Override - public LldbManager getManager() { - return manager; - } - - @Override - public void setManager(LldbManager manager) { - this.manager = manager; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/gadp/impl/LldbGadpServerImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/gadp/impl/LldbGadpServerImpl.java deleted file mode 100644 index b0ffafbd31..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/gadp/impl/LldbGadpServerImpl.java +++ /dev/null @@ -1,64 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.gadp.impl; - -import java.io.IOException; -import java.net.SocketAddress; -import java.util.concurrent.CompletableFuture; - -import agent.lldb.gadp.LldbGadpServer; -import agent.lldb.model.AbstractLldbModel; -import agent.lldb.model.impl.LldbModelImpl; -import ghidra.dbg.gadp.server.AbstractGadpServer; - -public class LldbGadpServerImpl implements LldbGadpServer { - public class GadpSide extends AbstractGadpServer { - public GadpSide(AbstractLldbModel model, SocketAddress addr) - throws IOException { - super(model, addr); - } - } - - protected final AbstractLldbModel model; - protected final GadpSide server; - - public LldbGadpServerImpl(SocketAddress addr) throws IOException { - super(); - this.model = new LldbModelImpl(); - this.server = new GadpSide(model, addr); - } - - @Override - public CompletableFuture startLLDB(String[] args) { - return model.startLLDB(args).thenCompose(__ -> server.launchAsyncService()); - } - - @Override - public SocketAddress getLocalAddress() { - return server.getLocalAddress(); - } - - @Override - public boolean isRunning() { - return model.isRunning(); - } - - @Override - public void terminate() throws IOException { - model.terminate(); - server.terminate(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugBreakpoint.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugBreakpoint.java deleted file mode 100644 index b3066aebad..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugBreakpoint.java +++ /dev/null @@ -1,86 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.lldb; - -import ghidra.comm.util.BitmaskSet; -import ghidra.comm.util.BitmaskUniverse; - -/** - * A wrapper for breakpoint variations - */ -public interface DebugBreakpoint { - public static enum BreakType { - CODE, DATA, TIME, INLINE; - } - - public static class BreakFullType { - public final BreakType breakType; - - public BreakFullType(BreakType breakType) { - this.breakType = breakType; - } - } - - public static enum BreakFlags implements BitmaskUniverse { - GO_ONLY(1 << 0), // - DEFERRED(1 << 1), // - ENABLED(1 << 2), // - ADDER_ONLY(1 << 3), // - ONE_SHOT(1 << 4), // - ; - - private BreakFlags(int mask) { - this.mask = mask; - } - - private final int mask; - - @Override - public long getMask() { - return mask; - } - } - - public static enum BreakAccess implements BitmaskUniverse { - READ(1 << 0), // - WRITE(1 << 1), // - EXECUTE(1 << 2), // - READ_WRITE(1 << 3), // - ; - - private BreakAccess(int mask) { - this.mask = mask; - } - - private final int mask; - - @Override - public long getMask() { - return mask; - } - } - - public static class BreakDataParameters { - public int size; - public BitmaskSet access; - - public BreakDataParameters(int size, BitmaskSet access) { - this.size = size; - this.access = access; - } - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugBreakpointInfo.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugBreakpointInfo.java deleted file mode 100644 index 8322746e8f..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugBreakpointInfo.java +++ /dev/null @@ -1,39 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.lldb; - -import SWIG.SBEvent; - -/** - * Information about a breakpoint (or watchpoint). - */ -public class DebugBreakpointInfo { - - public SBEvent event; - public Object pt; - public String id; - - public DebugBreakpointInfo(SBEvent event, Object pt) { - this.event = event; - this.pt = pt; - this.id = DebugClient.getId(pt); - } - - @Override - public String toString() { - return id; - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugClient.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugClient.java deleted file mode 100644 index b79fb766d0..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugClient.java +++ /dev/null @@ -1,432 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.lldb; - -import java.util.List; -import java.util.Map; - -import SWIG.*; -import agent.lldb.manager.LldbEvent; -import agent.lldb.manager.LldbManager; -import ghidra.comm.util.BitmaskUniverse; -import ghidra.dbg.target.TargetExecutionStateful.TargetExecutionState; - -/** - * A wrapper for SBDebugger - */ -public interface DebugClient extends DebugClientReentrant { - - /** - * Create a debug client. - * - * @return a new client - */ - public static DebugClient debugCreate() { - return new DebugClientImpl(); - } - - public static enum ExecutionState { - RUNNING, STOPPED; - } - - public static enum DebugStatus { - NO_CHANGE(false, null, 13), // - GO(true, ExecutionState.RUNNING, 10), // - GO_HANDLED(true, ExecutionState.RUNNING, 9), // - GO_NOT_HANDLED(true, ExecutionState.RUNNING, 8), // - STEP_OVER(true, ExecutionState.RUNNING, 7), // - STEP_INTO(true, ExecutionState.RUNNING, 5), // - BREAK(false, ExecutionState.STOPPED, 0), // - NO_DEBUGGEE(true, null, 1), // shouldWait is true to handle process creation - STEP_BRANCH(true, ExecutionState.RUNNING, 6), // - IGNORE_EVENT(false, null, 11), // - RESTART_REQUESTED(true, null, 12), // - REVERSE_GO(true, null, 0xff), // - REVERSE_STEP_BRANCH(true, null, 0xff), // - REVERSE_STEP_OVER(true, null, 0xff), // - REVERSE_STEP_INTO(true, null, 0xff), // - OUT_OF_SYNC(false, null, 2), // - WAIT_INPUT(false, null, 3), // - TIMEOUT(false, null, 4), // - ; - - public static final long MASK = 0xaf; - public static final long INSIDE_WAIT = 0x100000000L; - public static final long WAIT_TIMEOUT = 0x200000000L; - - DebugStatus(boolean shouldWait, ExecutionState threadState, int precedence) { - this.shouldWait = shouldWait; - this.threadState = threadState; - this.precedence = precedence; - } - - public final boolean shouldWait; - public final ExecutionState threadState; - public final int precedence; // 0 is highest - - public static DebugStatus fromArgument(StateType state) { - if (state == null) { - return DebugStatus.NO_DEBUGGEE; - } - switch (state.swigValue()) { - case 0: // eStateInvalid - case 1: // eStateUnloaded - case 2: // eStateConnected - case 3: // eStateAttaching - case 4: // eStateLaunching - return DebugStatus.GO; - case 5: // eStateStopped - return DebugStatus.BREAK; - case 6: // eStateRunning - return DebugStatus.GO; - case 7: // eStateStepping - return DebugStatus.STEP_INTO; - case 8: // eStateCrashed - case 9: // eStateDetached - case 10: // eStateExited - case 11: // eStateSuspended - return DebugStatus.NO_DEBUGGEE; - default: - return DebugStatus.NO_CHANGE; - } - } - - /* - public static boolean isInsideWait(SBEvent event) { - return (argument & INSIDE_WAIT) != 0; - } - - public static boolean isWaitTimeout(SBEvent event) { - return (argument & WAIT_TIMEOUT) != 0; - } - */ - } - - public static enum SessionStatus { - ACTIVE, // - END_SESSION_ACTIVE_TERMINATE,// - END_SESSION_ACTIVE_DETACH, // - END_SESSION_PASSIVE, // - END, // - REBOOT, // - HIBERNATE, // - FAILURE, // - ; - } - - public static enum ChangeSessionState implements BitmaskUniverse { - SESSION_ALL(0xffffffff), // - SESSION_BREAKPOINT_CHANGED(SBTarget.eBroadcastBitBreakpointChanged), // - SESSION_MODULE_LOADED(SBTarget.eBroadcastBitModulesLoaded), // - SESSION_MODULE_UNLOADED(SBTarget.eBroadcastBitModulesUnloaded), // - SESSION_WATCHPOINT_CHANGED(SBTarget.eBroadcastBitWatchpointChanged), // - SESSION_SYMBOLS_LOADED(SBTarget.eBroadcastBitSymbolsLoaded), // - ; - - private ChangeSessionState(int mask) { - this.mask = mask; - } - - private final int mask; - - @Override - public long getMask() { - return mask; - } - } - - public static enum ChangeProcessState implements BitmaskUniverse { - PROCESS_ALL(0xffffffff), // - PROCESS_STATE_CHANGED(SBProcess.eBroadcastBitStateChanged), // - PROCESS_INTERRUPT(SBProcess.eBroadcastBitInterrupt), // - PROCESS_STDOUT(SBProcess.eBroadcastBitSTDOUT), // - PROCESS_STDERR(SBProcess.eBroadcastBitSTDERR), // - PROCESS_PROFILE_DATA(SBProcess.eBroadcastBitProfileData), // - PROCESS_STRUCTURED_DATA(SBProcess.eBroadcastBitStructuredData), // - ; - - private ChangeProcessState(int mask) { - this.mask = mask; - } - - private final int mask; - - @Override - public long getMask() { - return mask; - } - } - - public static enum ChangeThreadState implements BitmaskUniverse { - THREAD_ALL(0xffffffff), // - THREAD_STACK_CHANGED(SBThread.eBroadcastBitStackChanged), // - THREAD_SUSPENDED(SBThread.eBroadcastBitThreadSuspended), // - THREAD_RESUMED(SBThread.eBroadcastBitThreadResumed), // - THREAD_FRAME_CHANGED(SBThread.eBroadcastBitSelectedFrameChanged), // - THREAD_SELECTED(SBThread.eBroadcastBitThreadSelected), // - ; - - private ChangeThreadState(int mask) { - this.mask = mask; - } - - private final int mask; - - @Override - public long getMask() { - return mask; - } - } - - public static enum DebugAttachFlags implements BitmaskUniverse { - DEFAULT(0), // - NONINVASIVE(1 << 0), // - EXISTING(1 << 1), // - NONINVASIVE_NO_SUSPEND(1 << 2), // - INVASIVE_NO_INITIAL_BREAK(1 << 3), // - INVASIVE_RESUME_PROCESS(1 << 4), // - NONINVASIVE_ALLOW_PARTIAL(1 << 5), // - ; - - DebugAttachFlags(int mask) { - this.mask = mask; - } - - private final int mask; - - @Override - public long getMask() { - return mask; - } - } - - public static enum DebugCreateFlags implements BitmaskUniverse { - LAUNCH_DEFAULT(0), // - LAUNCH_EXEC(1 << 0), // - LAUNCH_DEBUG(1 << 1), // - LAUNCH_STOP_AT_ENTRY(1 << 2), // - LAUNCH_DISABLE_ASLR(1 << 3), // - LAUNCH_DISABLE_STDIO(1 << 4), // - LAUNCH_IN_TTY(1 << 5), // - LAUNCH_IN_SHELL(1 << 6), // - LAUNCH_IN_SEP_GROUP(1 << 7), // - LAUNCH_DONT_SET_EXIT_STATUS(1 << 8), // - LAUNCH_DETACH_ON_ERROR(1 << 9), // - LAUNCH_SHELL_EXPAND_ARGS(1 << 10), // - LAUNCH_CLOSE_TTY_ON_EXIT(1 << 11), // - LAUNCH_INHERIT_FROM_PARENT(1 << 12) // - ; - - DebugCreateFlags(int mask) { - this.mask = mask; - } - - private final int mask; - - @Override - public long getMask() { - return mask; - } - } - - public enum DebugEndSessionFlags { - DEBUG_END_PASSIVE(0x00000000), - DEBUG_END_ACTIVE_TERMINATE(0x00000001), - DEBUG_END_ACTIVE_DETACH(0x00000002), - DEBUG_END_REENTRANT(0x00000003), - DEBUG_END_DISCONNECT(0x00000004); - - DebugEndSessionFlags(int value) { - this.value = value; - } - - private final int value; - - public long getValue() { - return value; - } - } - - public enum DebugOutputFlags { - DEBUG_OUTPUT_NORMAL(0x1), // - DEBUG_OUTPUT_ERROR(0x2), // - DEBUG_OUTPUT_WARNING(0x4), // - DEBUG_OUTPUT_VERBOSE(0x8), // - DEBUG_OUTPUT_PROMPT(0x10), // - DEBUG_OUTPUT_PROMPT_REGISTERS(0x20), // - DEBUG_OUTPUT_EXTENSION_WARNING(0x40), // - DEBUG_OUTPUT_DEBUGGEE(0x80), // - DEBUG_OUTPUT_DEBUGGEE_PROMPT(0x100), // - DEBUG_OUTPUT_SYMBOLS(0x200); - - DebugOutputFlags(int value) { - this.value = value; - } - - private final int value; - - public long getValue() { - return value; - } - } - - public static String getModelKey(Object modelObject) { - if (modelObject == null) { - return null; - } - return modelObject.getClass() + ":" + getId(modelObject); - } - - public static String getId(Object modelObject) { - if (modelObject instanceof SBTarget) { - SBTarget session = (SBTarget) modelObject; - return Integer.toHexString(session.GetProcess().GetProcessID().intValue()); - } - if (modelObject instanceof SBProcess) { // global - SBProcess process = (SBProcess) modelObject; - return Integer.toHexString(process.GetProcessID().intValue()); - } - if (modelObject instanceof SBThread) { // global - SBThread thread = (SBThread) modelObject; - return Integer.toHexString(thread.GetThreadID().intValue()); - } - if (modelObject instanceof SBFrame) { - SBFrame frame = (SBFrame) modelObject; - int frameId = (int)frame.GetFrameID(); - if (frameId < 0) { - frameId = 0; - } - return Integer.toString(frameId); - } - if (modelObject instanceof SBValue) { - SBValue val = (SBValue) modelObject; - return val.GetName(); - } - if (modelObject instanceof SBModule) { - SBModule module = (SBModule) modelObject; - return module.GetFileSpec().GetFilename(); - } - if (modelObject instanceof SBSection) { - SBSection section = (SBSection) modelObject; - return section.GetName() + ":" + section.GetFileAddress(); - } - if (modelObject instanceof SBMemoryRegionInfo) { - SBMemoryRegionInfo region = (SBMemoryRegionInfo) modelObject; - return Long.toHexString(region.GetRegionBase().longValue()); - } - if (modelObject instanceof SBSymbol) { - SBSymbol sym = (SBSymbol) modelObject; - return sym.GetName(); - } - if (modelObject instanceof SBBreakpoint) { // global - SBBreakpoint spec = (SBBreakpoint) modelObject; - return "B" + Integer.toHexString(spec.GetID()); - } - if (modelObject instanceof SBWatchpoint) { // global - SBWatchpoint spec = (SBWatchpoint) modelObject; - return "W" + Integer.toHexString(spec.GetID()); - } - if (modelObject instanceof SBBreakpointLocation) { - SBBreakpointLocation loc = (SBBreakpointLocation) modelObject; - return Long.toHexString(loc.GetLoadAddress().longValue()); - } - if (modelObject instanceof SBFunction) { - SBFunction fn = (SBFunction) modelObject; - return fn.GetName(); - } - throw new RuntimeException("Unknown object " + modelObject.getClass()); - } - - public static TargetExecutionState convertState(StateType state) { - switch (state.swigValue()) { - case 0: // eStateInvalid - return TargetExecutionState.RUNNING; - case 1: // eStateUnloaded - case 2: // eStateConnected - case 3: // eStateAttaching - case 4: // eStateLaunching - return TargetExecutionState.ALIVE; - case 5: // eStateStopped - return TargetExecutionState.STOPPED; - case 6: // eStateRunning - case 7: // eStateStepping - return TargetExecutionState.RUNNING; - case 8: // eStateCrashed - case 9: // eStateDetached - case 10: // eStateExited - case 11: // eStateSuspended - return TargetExecutionState.TERMINATED; - default: - return TargetExecutionState.STOPPED; - } - } - - @Override - public SBListener getListener(); - - /** - * The ID for the local server - * - * @return the ID - */ - DebugServerId getLocalServer(); - - void setOutputCallbacks(DebugOutputCallbacks cb); - - SBProcess attachProcess(DebugServerId si, int keyType, String key, boolean wait, boolean async); - - SBProcess connectRemote(DebugServerId localServer, String key, boolean auto, boolean async, boolean kernel); - - SBProcess createProcess(DebugServerId si, String fileName); - - SBProcess createProcess(DebugServerId si, String fileName, - List args, List envp, String workingDir); - - SBProcess createProcess(DebugServerId si, SBLaunchInfo info); - - SBProcess createProcess(DebugServerId si, String fileName, List args, List envp, - List pathsIO, - String workingDir, long createFlags, boolean stopAtEntry); - - void terminateCurrentProcess(); - - void destroyCurrentProcess(); - - void detachCurrentProcess(); - - SBTarget connectSession(String commandLine); - - Map listSessions(); - - void endSession(DebugEndSessionFlags flags); - - void openDumpFileWide(String fileName); - - SBEvent waitForEvent(); - - DebugStatus getExecutionStatus(); - - void processEvent(LldbEvent lldbEvt); - - boolean getInterrupt(); - - public void setManager(LldbManager manager); - - public void addBroadcaster(Object process); - - public void execute(String command); - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugClientImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugClientImpl.java deleted file mode 100644 index 3ec9c53860..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugClientImpl.java +++ /dev/null @@ -1,544 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.lldb; - -import java.io.File; -import java.math.BigInteger; -import java.util.*; - -import SWIG.*; -import agent.lldb.manager.LldbEvent; -import agent.lldb.manager.LldbManager; -import agent.lldb.manager.evt.*; -import agent.lldb.manager.impl.LldbManagerImpl; -import ghidra.util.Msg; - -public class DebugClientImpl implements DebugClient { - - private LldbManager manager; - private SBDebugger sbd; - private SBTarget session; - private SBEvent event; - private DebugOutputCallbacks ocb; - //private DebugEventCallbacks ecb; - private SBCommandInterpreter cmd; - private boolean sessionsAreImmutable; - - public DebugClientImpl() { - } - - @Override - public DebugClient createClient() { - SBError error = SBDebugger.InitializeWithErrorHandling(); - if (!error.Success()) { - SBStream stream = new SBStream(); - error.GetDescription(stream); - Msg.error(this, stream.GetData()); - return null; - } - event = new SBEvent(); - sbd = SBDebugger.Create(); - cmd = sbd.GetCommandInterpreter(); - return this; - } - - public SBDebugger getDebugger() { - return sbd; - } - - @Override - public SBListener getListener() { - return sbd.GetListener(); - } - - @Override - public DebugServerId getLocalServer() { - return new DebugServerId(0); - } - - @Override - public SBProcess attachProcess(DebugServerId si, int keyType, String key, boolean wait, - boolean async) { - SBListener listener = new SBListener(); - SBError error = new SBError(); - session = createNullSession(); - SBProcess process; - switch (keyType) { - case 0: // pid - int radix = 10; - if (key.startsWith("0x")) { - key = key.substring(2); - radix = 16; - } - BigInteger processId = new BigInteger(key, radix); - process = session.AttachToProcessWithID(listener, processId, error); - break; - case 1: // name - process = session.AttachToProcessWithName(listener, key, wait, error); - break; - case 2: // path - SBAttachInfo info = new SBAttachInfo(key, wait, async); - process = session.Attach(info, error); - break; - default: - return null; - } - if (!error.Success()) { - Msg.error(this, error.GetType() + " while attaching to " + key); - SBStream stream = new SBStream(); - error.GetDescription(stream); - Msg.error(this, stream.GetData()); - return null; - } - if (async) { - manager.waitForEventEx(); - } - else { - manager.updateState(process); - } - return process; - } - - @Override - public SBProcess connectRemote(DebugServerId si, String key, boolean auto, boolean async, boolean kernel) { - SBListener listener = new SBListener(); - SBError error = new SBError(); - if (!auto) { - session = createNullSession(); - ((LldbManagerImpl) manager).addSessionIfAbsent(session); - return null; - } - String plugin = kernel ? "kdb-remote" : "gdb-remote"; - session = connectSession(""); - SBProcess process = session.ConnectRemote(listener, key, plugin, error); - if (!error.Success()) { - Msg.error(this, error.GetType() + " while attaching to " + key); - SBStream stream = new SBStream(); - error.GetDescription(stream); - Msg.error(this, stream.GetData()); - return null; - } - if (async) { - manager.waitForEventEx(); - } - else { - manager.updateState(process); - } - sessionsAreImmutable = true; - return process; - } - - @Override - public SBProcess createProcess(DebugServerId si, String fileName) { - return createProcess(si, fileName, new ArrayList(), new ArrayList(), ""); - } - - @Override - public SBProcess createProcess(DebugServerId si, String fileName, - List args, List envp, String workingDir) { - SBError error = new SBError(); - session = connectSession(fileName); - String[] argArr = args.toArray(new String[args.size()]); - String[] envArr = envp.isEmpty() ? null : envp.toArray(new String[envp.size()]); - SBProcess process = session.LaunchSimple(argArr, envArr, workingDir); - if (!error.Success()) { - Msg.error(this, error.GetType() + " for create process"); - SBStream stream = new SBStream(); - error.GetDescription(stream); - Msg.error(this, stream.GetData()); - return null; - } - manager.updateState(process); - return process; - } - - @Override - public SBProcess createProcess(DebugServerId si, SBLaunchInfo info) { - SBError error = new SBError(); - String cmd = info.GetExecutableFile().GetDirectory(); - cmd += "/" + info.GetExecutableFile().GetFilename(); - for (int i = 0; i < info.GetNumArguments(); i++) { - cmd += " " + info.GetArgumentAtIndex(i); - } - session = connectSession(cmd); - SBProcess process = session.Launch(info, error); - if (!error.Success()) { - Msg.error(this, error.GetType() + " for create process"); - SBStream stream = new SBStream(); - error.GetDescription(stream); - Msg.error(this, stream.GetData()); - return null; - } - return process; - } - - @Override - public SBProcess createProcess(DebugServerId si, String fileName, - List args, List envp, List pathsIO, - String workingDir, long createFlags, boolean stopAtEntry) { - File f = new File(fileName); //hack to avoid /C:/ - session = connectSession(f.getAbsolutePath()); - - String[] argArr = args.toArray(new String[args.size()]); - // null for envp means use the default environment - String[] envArr = envp.isEmpty() ? null : envp.toArray(new String[envp.size()]); - String pathSTDIN = pathsIO.get(0); - String pathSTDOUT = pathsIO.get(1); - String pathSTDERR = pathsIO.get(2); - SBListener listener = new SBListener(); - SBError error = new SBError(); - SBProcess process = session.Launch(listener, argArr, envArr, - pathSTDIN, pathSTDOUT, pathSTDERR, workingDir, createFlags, stopAtEntry, error); - //SBProcess process = session.Launch(listener, null, null, "", "", "", "", 0, true, error); - if (!error.Success()) { - Msg.error(this, error.GetType() + " while launching " + fileName); - SBStream stream = new SBStream(); - error.GetDescription(stream); - Msg.error(this, stream.GetData()); - return null; - } - if (stopAtEntry) { - manager.updateState(process); - } - else { - manager.waitForEventEx(); - } - return process; - } - - @Override - public void terminateCurrentProcess() { - SBProcess process = session.GetProcess(); - SBError error = process.Kill(); - if (!error.Success()) { - SBStream stream = new SBStream(); - error.GetDescription(stream); - Msg.error(this, stream.GetData()); - } - } - - @Override - public void destroyCurrentProcess() { - SBProcess process = session.GetProcess(); - SBError error = process.Destroy(); - if (!error.Success()) { - SBStream stream = new SBStream(); - error.GetDescription(stream); - Msg.error(this, stream.GetData()); - } - } - - @Override - public void detachCurrentProcess() { - SBProcess process = session.GetProcess(); - SBError error = process.Detach(); - if (!error.Success()) { - SBStream stream = new SBStream(); - error.GetDescription(stream); - Msg.error(this, stream.GetData()); - } - } - - public SBTarget createNullSession() { - return sbd.GetDummyTarget(); - } - - @Override - public SBTarget connectSession(String fileName) { - return sbd.CreateTarget(fileName); - } - - @Override - public Map listSessions() { - if (isSessionImmutable()) { - return manager.getKnownSessions(); - } - Map map = new HashMap<>(); - for (int i = 0; i < sbd.GetNumTargets(); i++) { - SBTarget target = sbd.GetTargetAtIndex(i); - map.put(DebugClient.getId(target), target); - } - return map; - } - - @Override - public void endSession(DebugEndSessionFlags flags) { - sbd.DeleteTarget(session); - } - - @Override - public void openDumpFileWide(String fileName) { - SBError error = new SBError(); - session.LoadCore(fileName, error); - if (!error.Success()) { - Msg.error(this, error.GetType() + " while loading " + fileName); - } - } - - @Override - public SBEvent waitForEvent() { - boolean eventFound = getListener().WaitForEvent(-1, event); - if (eventFound) { - return event; - } - return null; - } - - public void translateAndFireEvent(SBEvent evt) { - manager.setCurrentEvent(evt); - long type = evt.GetType(); - if (SBTarget.EventIsTargetEvent(evt)) { - if ((type & SBTarget.eBroadcastBitBreakpointChanged) != 0) { - Msg.info(this, "*** Breakpoint Changed: " + evt.GetType()); - SBBreakpoint bpt = SBBreakpoint.GetBreakpointFromEvent(evt); - processEvent(new LldbBreakpointModifiedEvent(new DebugBreakpointInfo(evt, bpt))); - } - if ((type & SBTarget.eBroadcastBitModulesLoaded) != 0) { - Msg.info(this, "*** Module Loaded: " + evt.GetType()); - processEvent(new LldbModuleLoadedEvent(new DebugModuleInfo(evt))); - } - if ((type & SBTarget.eBroadcastBitModulesUnloaded) != 0) { - Msg.info(this, "*** Module Unloaded: " + evt.GetType()); - processEvent(new LldbModuleUnloadedEvent(new DebugModuleInfo(evt))); - } - if ((type & SBTarget.eBroadcastBitWatchpointChanged) != 0) { - Msg.info(this, "*** Watchpoint Changed: " + evt.GetType()); - SBWatchpoint wpt = SBWatchpoint.GetWatchpointFromEvent(evt); - processEvent(new LldbBreakpointModifiedEvent(new DebugBreakpointInfo(evt, wpt))); - } - if ((type & SBTarget.eBroadcastBitSymbolsLoaded) != 0) { - Msg.info(this, "*** Symbols Loaded: " + evt.GetType()); - processEvent(new LldbSymbolsLoadedEvent(new DebugEventInfo(evt))); - } - } - - if (SBProcess.EventIsProcessEvent(evt)) { - DebugProcessInfo info = new DebugProcessInfo(evt); - if ((type & SBProcess.eBroadcastBitStateChanged) != 0) { - Msg.info(this, "*** State Changed: " + evt.GetType()); // Seen & handled - processEvent(new LldbStateChangedEvent(info)); - } - if ((type & SBProcess.eBroadcastBitInterrupt) != 0) { - Msg.info(this, "*** Interrupt: " + evt.GetType()); - processEvent(new LldbInterruptEvent(info)); - } - if ((type & SBProcess.eBroadcastBitSTDOUT) != 0) { - Msg.info(this, "*** Console STDOUT: " + evt.GetType()); - processEvent(new LldbConsoleOutputEvent(info)); - } - if ((type & SBProcess.eBroadcastBitSTDERR) != 0) { - Msg.info(this, "*** Console STDERR: " + evt.GetType()); - processEvent(new LldbConsoleOutputEvent(info)); - } - if ((type & SBProcess.eBroadcastBitProfileData) != 0) { - Msg.info(this, "*** Profile Data Added: " + evt.GetType()); - processEvent(new LldbProfileDataEvent(info)); - } - if ((type & SBProcess.eBroadcastBitStructuredData) != 0) { - Msg.info(this, "*** Structured Data Added: " + evt.GetType()); - processEvent(new LldbStructuredDataEvent(info)); - } - } - - if (SBThread.EventIsThreadEvent(evt)) { - DebugThreadInfo info = new DebugThreadInfo(evt); - if ((type & SBThread.eBroadcastBitStackChanged) != 0) { - Msg.info(this, "*** Stack Changed: " + evt.GetType()); - processEvent(new LldbThreadStackChangedEvent(info)); - } - if ((type & SBThread.eBroadcastBitThreadSuspended) != 0) { - Msg.info(this, "*** Thread Suspended: " + evt.GetType()); - processEvent(new LldbThreadSuspendedEvent(info)); - } - if ((type & SBThread.eBroadcastBitThreadResumed) != 0) { - Msg.info(this, "*** Thread Resumed: " + evt.GetType()); - processEvent(new LldbThreadResumedEvent(info)); - } - if ((type & SBThread.eBroadcastBitSelectedFrameChanged) != 0) { - Msg.info(this, "*** Frame Selected: " + evt.GetType()); - processEvent(new LldbSelectedFrameChangedEvent(info)); - } - if ((type & SBThread.eBroadcastBitThreadSelected) != 0) { - Msg.info(this, "*** Thread Selected: " + evt.GetType()); - processEvent(new LldbThreadSelectedEvent(info)); - } - } - if (SBBreakpoint.EventIsBreakpointEvent(evt)) { - BreakpointEventType btype = SBBreakpoint.GetBreakpointEventTypeFromEvent(evt); - SBBreakpoint bpt = SBBreakpoint.GetBreakpointFromEvent(evt); - DebugBreakpointInfo info = new DebugBreakpointInfo(evt, bpt); - if (btype.equals(BreakpointEventType.eBreakpointEventTypeAdded)) { - Msg.info(this, "*** Breakpoint Added: " + bpt.GetID()); // Seen & handled - processEvent(new LldbBreakpointCreatedEvent(info)); - } - if (btype.equals(BreakpointEventType.eBreakpointEventTypeAutoContinueChanged)) { - Msg.info(this, "*** Breakpoint Auto Continue: " + bpt.GetID()); - processEvent(new LldbBreakpointAutoContinueChangedEvent(info)); - } - if (btype.equals(BreakpointEventType.eBreakpointEventTypeCommandChanged)) { - Msg.info(this, "*** Breakpoint Command Changed: " + bpt.GetID()); - processEvent(new LldbBreakpointCommandChangedEvent(info)); - } - if (btype.equals(BreakpointEventType.eBreakpointEventTypeConditionChanged)) { - Msg.info(this, "*** Breakpoint Condition Changed: " + bpt.GetID()); - processEvent(new LldbBreakpointConditionChangedEvent(info)); - } - if (btype.equals(BreakpointEventType.eBreakpointEventTypeDisabled)) { - Msg.info(this, "*** Breakpoint Disabled: " + bpt.GetID()); - processEvent(new LldbBreakpointDisabledEvent(info)); - } - if (btype.equals(BreakpointEventType.eBreakpointEventTypeEnabled)) { - Msg.info(this, "*** Breakpoint Enabled: " + bpt.GetID()); - processEvent(new LldbBreakpointEnabledEvent(info)); - } - if (btype.equals(BreakpointEventType.eBreakpointEventTypeIgnoreChanged)) { - Msg.info(this, "*** Breakpoint Ignore Changed: " + bpt.GetID()); - processEvent(new LldbBreakpointIgnoreChangedEvent(info)); - } - if (btype.equals(BreakpointEventType.eBreakpointEventTypeInvalidType)) { - Msg.info(this, "*** Breakpoint Invalid Type: " + bpt.GetID()); - processEvent(new LldbBreakpointInvalidatedEvent(info)); - } - if (btype.equals(BreakpointEventType.eBreakpointEventTypeLocationsAdded)) { - Msg.info(this, "*** Breakpoint Locations Added: " + bpt.GetID()); - processEvent(new LldbBreakpointLocationsAddedEvent(info)); - } - if (btype.equals(BreakpointEventType.eBreakpointEventTypeLocationsRemoved)) { - Msg.info(this, "*** Breakpoint Locations Removed: " + bpt.GetID()); - processEvent(new LldbBreakpointLocationsRemovedEvent(info)); - } - if (btype.equals(BreakpointEventType.eBreakpointEventTypeLocationsResolved)) { - Msg.info(this, "*** Breakpoint Locations Resolved: " + bpt.GetID()); // Seen & handled? - processEvent(new LldbBreakpointLocationsResolvedEvent(info)); - } - if (btype.equals(BreakpointEventType.eBreakpointEventTypeRemoved)) { - Msg.info(this, "*** Breakpoint Removed: " + bpt.GetID()); - processEvent(new LldbBreakpointDeletedEvent(info)); - } - if (btype.equals(BreakpointEventType.eBreakpointEventTypeThreadChanged)) { - Msg.info(this, "*** Breakpoint Thread Changed: " + bpt.GetID()); - processEvent(new LldbBreakpointThreadChangedEvent(info)); - } - } - if (SBWatchpoint.EventIsWatchpointEvent(evt)) { - WatchpointEventType wtype = SBWatchpoint.GetWatchpointEventTypeFromEvent(evt); - SBWatchpoint wpt = SBWatchpoint.GetWatchpointFromEvent(evt); - DebugBreakpointInfo info = new DebugBreakpointInfo(evt, wpt); - if (wtype.equals(WatchpointEventType.eWatchpointEventTypeAdded)) { - Msg.info(this, "*** Watchpoint Added: " + wpt.GetID()); - processEvent(new LldbBreakpointCreatedEvent(info)); - } - if (wtype.equals(WatchpointEventType.eWatchpointEventTypeCommandChanged)) { - Msg.info(this, "*** Watchpoint Command Changed: " + wpt.GetID()); - processEvent(new LldbBreakpointCommandChangedEvent(info)); - } - if (wtype.equals(WatchpointEventType.eWatchpointEventTypeConditionChanged)) { - Msg.info(this, "*** Watchpoint Condition Changed: " + wpt.GetID()); - processEvent(new LldbBreakpointConditionChangedEvent(info)); - } - if (wtype.equals(WatchpointEventType.eWatchpointEventTypeDisabled)) { - Msg.info(this, "*** Watchpoint Disabled: " + wpt.GetID()); - processEvent(new LldbBreakpointDisabledEvent(info)); - } - if (wtype.equals(WatchpointEventType.eWatchpointEventTypeEnabled)) { - Msg.info(this, "*** Watchpoint Enabled: " + wpt.GetID()); - processEvent(new LldbBreakpointEnabledEvent(info)); - } - if (wtype.equals(WatchpointEventType.eWatchpointEventTypeIgnoreChanged)) { - Msg.info(this, "*** Watchpoint Ignore Changed: " + wpt.GetID()); - processEvent(new LldbBreakpointIgnoreChangedEvent(info)); - } - if (wtype.equals(WatchpointEventType.eWatchpointEventTypeInvalidType)) { - Msg.info(this, "*** Watchpoint Invalid Type: " + wpt.GetID()); - processEvent(new LldbBreakpointInvalidatedEvent(info)); - } - if (wtype.equals(WatchpointEventType.eWatchpointEventTypeRemoved)) { - Msg.info(this, "*** Watchpoint Removed: " + wpt.GetID()); - processEvent(new LldbBreakpointDeletedEvent(info)); - } - if (wtype.equals(WatchpointEventType.eWatchpointEventTypeThreadChanged)) { - Msg.info(this, "*** Watchpoint Thread Changed: " + wpt.GetID()); - processEvent(new LldbBreakpointThreadChangedEvent(info)); - } - if (wtype.equals(WatchpointEventType.eWatchpointEventTypeTypeChanged)) { - Msg.info(this, "*** Watchpoint Type Changed: " + wpt.GetID()); - processEvent(new LldbBreakpointTypeChangedEvent(info)); - } - } - } - - @Override - public void processEvent(LldbEvent lldbEvt) { - manager.processEvent(lldbEvt); - } - - @Override - public DebugStatus getExecutionStatus() { - StateType state = manager.getState(); - return DebugStatus.fromArgument(state); - } - - @Override - public void setOutputCallbacks(DebugOutputCallbacks cb) { - this.ocb = cb; - } - - @Override - public boolean getInterrupt() { - return false; - } - - @Override - public void setManager(LldbManager manager) { - this.manager = manager; - } - - @Override - public void addBroadcaster(Object object) { - if (object instanceof SBCommandInterpreter) { - SBCommandInterpreter interpreter = (SBCommandInterpreter) object; - interpreter.GetBroadcaster() - .AddListener(getListener(), ChangeSessionState.SESSION_ALL.getMask()); - } - if (object instanceof SBTarget) { - SBTarget session = (SBTarget) object; - session.GetBroadcaster() - .AddListener(getListener(), ChangeSessionState.SESSION_ALL.getMask()); - } - if (object instanceof SBProcess) { - SBProcess process = (SBProcess) object; - process.GetBroadcaster() - .AddListener(getListener(), ChangeProcessState.PROCESS_ALL.getMask()); - } - } - - @Override - public void execute(String command) { - SBCommandReturnObject res = new SBCommandReturnObject(); - cmd.HandleCommand(command, res); - if (res.GetErrorSize() > 0) { - ocb.output(DebugOutputFlags.DEBUG_OUTPUT_ERROR.ordinal(), res.GetError()); - } - if (res.GetOutputSize() > 0) { - ocb.output(DebugOutputFlags.DEBUG_OUTPUT_NORMAL.ordinal(), res.GetOutput()); - } - } - - public boolean isSessionImmutable() { - return sessionsAreImmutable; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugClientReentrant.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugClientReentrant.java deleted file mode 100644 index c5146d1213..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugClientReentrant.java +++ /dev/null @@ -1,40 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.lldb; - -import SWIG.SBListener; - -/** - * An interface containing the subset of {@link DebugClient} methods which are reentrant. - * - * All other methods should be called only by the thread which created the client. - */ -public interface DebugClientReentrant { - /** - * Create a new client for the calling thread, connected to the same session as this client. - * - * @return the new client - */ - DebugClient createClient(); - - /** - * Get the reentrant control interface to the client - * - * @return the control interface - */ - SBListener getListener(); - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugEventCallbacks.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugEventCallbacks.java deleted file mode 100644 index 661a0df400..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugEventCallbacks.java +++ /dev/null @@ -1,118 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.lldb; - -import java.lang.annotation.*; - -import agent.lldb.lldb.DebugClient.*; -import ghidra.comm.util.BitmaskSet; -import ghidra.comm.util.BitmaskUniverse; - -/** - * The interface for receiving event callbacks - */ -public interface DebugEventCallbacks { - public static enum DebugEvent implements BitmaskUniverse { - BREAKPOINT(1 << 0), // - EXCEPTION(1 << 1), // - CREATE_THREAD(1 << 2), // - EXIT_THREAD(1 << 3), // - CREATE_PROCESS(1 << 4), // - EXIT_PROCESS(1 << 5), // - LOAD_MODULE(1 << 6), // - UNLOAD_MODULE(1 << 7), // - SYSTEM_ERROR(1 << 8), // - SESSION_STATUS(1 << 9), // - CHANGE_SESSION_STATE(1 << 10), // - CHANGE_PROCESS_STATE(1 << 11), // - CHANGE_THREAD_STATE(1 << 12), // - CREATE_SESSION(1 << 13), // - EXIT_SESSION(1 << 14) // - ; - - private DebugEvent(int mask) { - this.mask = mask; - } - - private final int mask; - - @Override - public long getMask() { - return mask; - } - } - - /** - * An annotation for marking each callback with its interest flag. - */ - @Target(ElementType.METHOD) - @Retention(RetentionPolicy.RUNTIME) - static @interface ForInterest { - /** - * The flag corresponding to the annotated callback method - * - * @return the flag - */ - DebugEvent value(); - } - - BitmaskSet getInterestMask(); - - @ForInterest(DebugEvent.BREAKPOINT) - DebugStatus breakpoint(DebugBreakpoint bp); - - //@ForInterest(DebugEvent.EXCEPTION) - //DebugStatus exception(DebugExceptionRecord64 exception, boolean firstChance); - - @ForInterest(DebugEvent.CREATE_THREAD) - DebugStatus createThread(DebugThreadInfo debugThreadInfo); - - @ForInterest(DebugEvent.EXIT_THREAD) - DebugStatus exitThread(int exitCode); - - @ForInterest(DebugEvent.CREATE_PROCESS) - DebugStatus createProcess(DebugProcessInfo debugProcessInfo); - - @ForInterest(DebugEvent.EXIT_PROCESS) - DebugStatus exitProcess(int exitCode); - - @ForInterest(DebugEvent.CREATE_SESSION) - DebugStatus createSession(DebugSessionInfo debugSessionInfo); - - @ForInterest(DebugEvent.EXIT_SESSION) - DebugStatus exitSession(int exitCode); - - @ForInterest(DebugEvent.LOAD_MODULE) - DebugStatus loadModule(DebugModuleInfo debugModuleInfo); - - @ForInterest(DebugEvent.UNLOAD_MODULE) - DebugStatus unloadModule(String imageBaseName, long baseOffset); - - @ForInterest(DebugEvent.SYSTEM_ERROR) - DebugStatus systemError(int error, int level); - - @ForInterest(DebugEvent.SESSION_STATUS) - DebugStatus sessionStatus(SessionStatus status); - - @ForInterest(DebugEvent.CHANGE_SESSION_STATE) - DebugStatus changeSessionState(BitmaskSet flags); - - @ForInterest(DebugEvent.CHANGE_PROCESS_STATE) - DebugStatus changeProcessState(BitmaskSet flags); - - @ForInterest(DebugEvent.CHANGE_THREAD_STATE) - DebugStatus changeThreadState(BitmaskSet flags); -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugEventInfo.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugEventInfo.java deleted file mode 100644 index a4f45d7957..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugEventInfo.java +++ /dev/null @@ -1,58 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.lldb; - -import SWIG.*; -import ghidra.comm.util.BitmaskSet; - -/** - * Information about an event (target, process, or thread). - */ -public class DebugEventInfo { - - public SBEvent event; - public Long id; - - public DebugEventInfo(SBEvent event) { - this.event = event; - this.id = event.GetType(); - } - - @Override - public String toString() { - return Long.toHexString(id); - } - - public BitmaskSet getFlags() { - if (SBTarget.EventIsTargetEvent(event)) { - BitmaskSet flags = - new BitmaskSet<>(DebugClient.ChangeSessionState.class, event.GetType()); - return flags; - } - if (SBProcess.EventIsProcessEvent(event)) { - BitmaskSet flags = - new BitmaskSet<>(DebugClient.ChangeProcessState.class, event.GetType()); - return flags; - } - if (SBThread.EventIsThreadEvent(event)) { - BitmaskSet flags = - new BitmaskSet<>(DebugClient.ChangeThreadState.class, event.GetType()); - return flags; - } - return null; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugModuleInfo.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugModuleInfo.java deleted file mode 100644 index 8febd69e94..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugModuleInfo.java +++ /dev/null @@ -1,93 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.lldb; - -import java.util.HashMap; -import java.util.Map; - -import SWIG.*; - -/** - * Information about a module (program or library image). - * - * The fields correspond to the parameters taken by {@code LoadModule} of - * {@code IDebugEventCallbacks}. They also appear as a subset of parameters taken by - * {@code CreateProcess} of {@code IDebugEventCallbacks}. - */ -public class DebugModuleInfo { - - public SBEvent event; - private SBProcess process; - private long numModules; - private Map modules = new HashMap<>(); - - public DebugModuleInfo(SBEvent event) { - this.event = event; - numModules = SBTarget.GetNumModulesFromEvent(event); - for (int i = 0; i < numModules; i++) { - SBModule module = SBTarget.GetModuleAtIndexFromEvent(i, event); - modules.put(i, module); - } - } - - public DebugModuleInfo(SBProcess process, SBModule module) { - this.process = process; - this.event = null; - numModules = 1; - modules.put(0, module); - } - - public Long getNumberOfModules() { - return numModules; - } - - public SBModule getModule(int index) { - return modules.get(index); - } - - public String toString(int index) { - SBModule module = modules.get(index); - return module.toString(); - } - - public String getModuleName(int index) { - SBModule module = modules.get(index); - return DebugClient.getId(module); - } - - public void setModuleName(int index, String moduleName) { - SBModule module = modules.get(index); - SBFileSpec filespec = module.GetFileSpec(); - filespec.SetFilename(moduleName); - } - - public String getImageName(int index) { - SBModule module = modules.get(index); - SBFileSpec filespec = module.GetFileSpec(); - return filespec.GetDirectory() + ":" + filespec.GetFilename(); - } - - public void setImageName(int index, String dirName, String imageName) { - SBModule module = modules.get(index); - SBFileSpec filespec = module.GetFileSpec(); - filespec.SetDirectory(dirName); - filespec.SetFilename(imageName); - } - - public SBProcess getProcess() { - return event != null ? SBProcess.GetProcessFromEvent(event) : process; - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugOutputCallbacks.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugOutputCallbacks.java deleted file mode 100644 index b8cf326664..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugOutputCallbacks.java +++ /dev/null @@ -1,24 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.lldb; - -/** - * The interface for receiving output callbacks - */ -@FunctionalInterface -public interface DebugOutputCallbacks { - void output(int mask, String text); -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugProcessInfo.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugProcessInfo.java deleted file mode 100644 index 3633b1bd0c..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugProcessInfo.java +++ /dev/null @@ -1,68 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.lldb; - -import SWIG.*; -import ghidra.comm.util.BitmaskSet; - -/** - * Information about a module (program or library image). - * - * The fields correspond to the parameters taken by {@code LoadModule} of - * {@code IDebugEventCallbacks}. They also appear as a subset of parameters taken by - * {@code CreateProcess} of {@code IDebugEventCallbacks}. - */ -public class DebugProcessInfo { - - public SBEvent event; - public SBProcess process; - public StateType state; - public String id; - - public DebugProcessInfo(SBEvent event) { - this.event = event; - this.process = SBProcess.GetProcessFromEvent(event); - this.state = SBProcess.GetStateFromEvent(event); - this.id = DebugClient.getId(process); - } - - public DebugProcessInfo(SBProcess process) { - this.process = process; - this.state = process.GetState(); - this.id = DebugClient.getId(process); - } - - public String toString() { - return id; - } - - public BitmaskSet getFlags() { - return new BitmaskSet<>(DebugClient.ChangeProcessState.class, event.GetType()); - } - -// public SBFrame getFrame() { -// SBFrame frame = event == null ? null : SBThread.GetStackFrameFromEvent(event); -// if (frame != null) { -// return frame; -// } -// frame = thread.GetSelectedFrame(); -// if (frame != null) { -// return frame; -// } -// return thread.GetFrameAtIndex(0); -// } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugRegisters.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugRegisters.java deleted file mode 100644 index 3f12947c37..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugRegisters.java +++ /dev/null @@ -1,162 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.lldb; - -import java.util.Collection; -import java.util.Collections; -import java.util.LinkedHashSet; -import java.util.Map; -import java.util.Set; - -import agent.lldb.lldb.DebugValue.DebugValueType; -import ghidra.comm.util.BitmaskSet; -import ghidra.comm.util.BitmaskUniverse; - -/** - * A wrapper for {@code IDebugRegisters} and its newer variants. - */ -public interface DebugRegisters { - public static enum DebugRegisterSource { - DEBUG_REGSRC_DEBUGGEE, // - DEBUG_REGSRC_EXPLICIT, // - DEBUG_REGSRC_FRAME, // - ; - } - - public static enum DebugRegisterFlags implements BitmaskUniverse { - SUB_REGISTER(1 << 0), // - ; - - private DebugRegisterFlags(int mask) { - this.mask = mask; - } - - private final int mask; - - @Override - public long getMask() { - return mask; - } - } - - public static class DebugRegisterDescription { - public final String name; - public final int index; - public final DebugValueType type; - public final Set flags; - public final int subregMaster; - public final int subregLengthBits; - public final long subregMask; - public final int subregShift; - - public DebugRegisterDescription(String name, int index, DebugValueType type, - BitmaskSet flags, int subregMaster, int subregLengthBits, - long subregMask, int subregShift) { - this.name = name; - this.index = index; - this.type = type; - this.flags = Collections.unmodifiableSet(flags); - this.subregMaster = subregMaster; - this.subregLengthBits = subregLengthBits; - this.subregMask = subregMask; - this.subregShift = subregShift; - } - - @Override - public String toString() { - return String.format( - "<%s: name='%s' index=%d type=%s flags=%s subregMaster=%d subregLengthBits=%d" + - " subregMask=%x subregShift=%d>", - getClass().getSimpleName(), name, index, type, flags, subregMaster, - subregLengthBits, subregMask, subregShift); - } - } - - int getNumberRegisters(); - - DebugRegisterDescription getDescription(int registerNumber); - - /** - * A shortcut to get all register descriptions for the current process. - * - * Uses {@link #getNumberRegisters()} and {@link #getDescription(int)} to retrieve all - * descriptions for the current process. - * - * @return the list of register descriptions - */ - default Set getAllDescriptions() { - Set result = new LinkedHashSet<>(); - int count = getNumberRegisters(); - for (int i = 0; i < count; i++) { - result.add(getDescription(i)); - } - return result; - } - - int getIndexByName(String name); - - /** - * A shortcut to get many register indices in one call. - * - * Uses {@link #getIndexByName(String)}. - * - * @param names the names whose indices to get - * @return the indices in respective order to the given names - */ - default int[] getIndicesByNames(String... names) { - int[] indices = new int[names.length]; - for (int i = 0; i < names.length; i++) { - indices[i] = getIndexByName(names[i]); - } - return indices; - } - - DebugValue getValue(int index); - - Map getValues(DebugRegisterSource source, Collection indices); - - /** - * A shortcut to get a register value by name. - * - * Uses {@link #getIndexByName(String)} followed by {@link #getValue(int)}. - * - * @param name the name of the register - * @return the value - */ - default DebugValue getValueByName(String name) { - int indexByName = getIndexByName(name); - if (indexByName >= 0) { - return getValue(indexByName); - } - return null; - } - - void setValue(int index, DebugValue value); - - void setValues(DebugRegisterSource source, Map values); - - /** - * A shortcut to set a register value by name. - * - * Uses {@link #getIndexByName(String)} followed by {@link #setValue(int, DebugValue)}. - * - * @param name the name of the register - * @param value the desired value - */ - default void setValueByName(String name, DebugValue value) { - setValue(getIndexByName(name), value); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugServerId.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugServerId.java deleted file mode 100644 index 55bcfec418..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugServerId.java +++ /dev/null @@ -1,58 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.lldb; - -/** - * The ID of a debug server. - * - * Each server to which a client is connected is assigned a server ID. The local server, to which - * every client is connected by default, has the ID 0. This is essentially just a boxed integer, but - * having an explicit data type prevents confusion with other integral values. - */ -public class DebugServerId implements Comparable { - public final long id; - - public DebugServerId(long id) { - this.id = id; - } - - @Override - public int hashCode() { - return Long.hashCode(id); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof DebugServerId)) { - return false; - } - DebugServerId that = (DebugServerId) obj; - if (this.id != that.id) { - return false; - } - return true; - } - - @Override - public int compareTo(DebugServerId that) { - return Long.compare(this.id, that.id); - } - - @Override - public String toString() { - return ""; - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugSessionInfo.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugSessionInfo.java deleted file mode 100644 index ccdc736134..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugSessionInfo.java +++ /dev/null @@ -1,54 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.lldb; - -import SWIG.SBEvent; -import SWIG.SBTarget; -import ghidra.comm.util.BitmaskSet; - -/** - * Information about a session. - * - * The fields correspond to the parameters taken by {@code LoadModule} of - * {@code IDebugEventCallbacks}. They also appear as a subset of parameters taken by - * {@code CreateProcess} of {@code IDebugEventCallbacks}. - */ -public class DebugSessionInfo { - - public SBEvent event; - public SBTarget session; - public String id; - - public DebugSessionInfo(SBEvent event) { - this.event = event; - this.session = SBTarget.GetTargetFromEvent(event); - this.id = DebugClient.getId(session); - } - - public DebugSessionInfo(SBTarget session) { - this.event = null; - this.session = session; - this.id = DebugClient.getId(session); - } - - public String toString() { - return id; - } - - public BitmaskSet getFlags() { - return new BitmaskSet<>(DebugClient.ChangeSessionState.class, event.GetType()); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugThreadInfo.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugThreadInfo.java deleted file mode 100644 index eb5cbc1b24..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugThreadInfo.java +++ /dev/null @@ -1,55 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.lldb; - -import SWIG.*; -import ghidra.comm.util.BitmaskSet; - -/** - * Information about a module (program or library image). - * - * The fields correspond to the parameters taken by {@code LoadModule} of - * {@code IDebugEventCallbacks}. They also appear as a subset of parameters taken by - * {@code CreateProcess} of {@code IDebugEventCallbacks}. - */ -public class DebugThreadInfo { - - public SBEvent event; - public SBThread thread; - public SBFrame frame; - public String id; - - public DebugThreadInfo(SBEvent event) { - this.event = event; - this.thread = SBThread.GetThreadFromEvent(event); - this.frame = SBThread.GetStackFrameFromEvent(event); - this.id = DebugClient.getId(thread); - } - - public DebugThreadInfo(SBThread thread) { - this.thread = thread; - this.frame = thread.GetSelectedFrame(); - this.id = DebugClient.getId(thread); - } - - public String toString() { - return id; - } - - public BitmaskSet getFlags() { - return new BitmaskSet<>(DebugClient.ChangeThreadState.class, event.GetType()); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugValue.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugValue.java deleted file mode 100644 index 06f04bb8e6..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/DebugValue.java +++ /dev/null @@ -1,452 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.lldb; - -import java.lang.annotation.*; -import java.lang.reflect.InvocationTargetException; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; -import java.util.Arrays; - -import ghidra.util.NumericUtilities; - -//@ForDebugValueType(DebugValueType.INVALID) -public interface DebugValue { - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - public static @interface ForDebugValueType { - DebugValueType value(); - } - - public static enum DebugValueType { - INVALID(0), // - INT8(Byte.SIZE), // - INT16(Short.SIZE), // - INT32(Integer.SIZE), // - INT64(Long.SIZE), // - FLOAT32(Float.SIZE), // - FLOAT64(Double.SIZE), // - FLOAT80(80), // - FLOAT82(82), // - FLOAT128(128), // - VECTOR64(64), // - VECTOR128(128), // - ; - - private static final Class[] CLASSES; - - static { - @SuppressWarnings("unchecked") - Class[] supressed = new Class[DebugValueType.values().length]; - CLASSES = supressed; - for (Class cls : DebugValue.class.getDeclaredClasses()) { - if (!DebugValue.class.isAssignableFrom(cls)) { - continue; - } - Class dvCls = cls.asSubclass(DebugValue.class); - DebugValueType type = getDebugValueTypeForClass(dvCls); - CLASSES[type.ordinal()] = dvCls; - } - } - - public static DebugValueType getDebugValueTypeForClass(Class cls) { - ForDebugValueType annot = cls.getAnnotation(ForDebugValueType.class); - if (annot == null) { - throw new AssertionError( - "INTERNAL: Missing ForDebugValueType annotation on " + cls); - } - return annot.value(); - } - - public final int bitLength; - public final int byteLength; - - private DebugValueType(int bitLength) { - this.bitLength = bitLength; - this.byteLength = (bitLength + 7) / 8; - } - - public Class getDebugValueClass() { - return CLASSES[ordinal()]; - } - - public DebugValue decodeBytes(byte[] bytes) throws IllegalArgumentException { - try { - return CLASSES[ordinal()].getConstructor(byte[].class).newInstance(bytes); - } - catch (InstantiationException | IllegalAccessException | IllegalArgumentException - | NoSuchMethodException | SecurityException e) { - throw new AssertionError(e); - } - catch (InvocationTargetException e) { - if (e.getCause() instanceof IllegalArgumentException) { - throw (IllegalArgumentException) e.getCause(); - } - throw new AssertionError(e); - } - } - } - - @ForDebugValueType(DebugValueType.INT8) - public static class DebugInt8Value implements DebugValue { - private final byte value; - - public DebugInt8Value(byte value) { - this.value = value; - } - - public DebugInt8Value(byte[] bytes) { - if (bytes.length != 1) { - throw new IllegalArgumentException("Must have exactly 1 byte"); - } - this.value = bytes[0]; - } - - public byte byteValue() { - return value; - } - - @Override - public byte[] encodeAsBytes() { - return new byte[] { value }; - } - - @Override - public String toString() { - return "byte " + Integer.toHexString(value) + "h"; - } - } - - @ForDebugValueType(DebugValueType.INT16) - public static class DebugInt16Value implements DebugValue { - private final short value; - - public DebugInt16Value(short value) { - this.value = value; - } - - public DebugInt16Value(byte[] bytes) { - if (bytes.length != Short.BYTES) { - throw new IllegalArgumentException("Must have exactly " + Short.BYTES + " bytes"); - } - ByteBuffer buf = ByteBuffer.wrap(bytes).order(ByteOrder.BIG_ENDIAN); - this.value = buf.getShort(); - } - - public short shortValue() { - return value; - } - - @Override - public byte[] encodeAsBytes() { - ByteBuffer buf = ByteBuffer.allocate(Short.BYTES).order(ByteOrder.BIG_ENDIAN); - buf.putShort(value); - return buf.array(); - } - - @Override - public String toString() { - return "word " + Integer.toHexString(value) + "h"; - } - } - - @ForDebugValueType(DebugValueType.INT32) - public static class DebugInt32Value implements DebugValue { - private final int value; - - public DebugInt32Value(int value) { - this.value = value; - } - - public DebugInt32Value(byte[] bytes) { - if (bytes.length != Integer.BYTES) { - throw new IllegalArgumentException("Must have exactly " + Integer.BYTES + " bytes"); - } - ByteBuffer buf = ByteBuffer.wrap(bytes).order(ByteOrder.BIG_ENDIAN); - this.value = buf.getInt(); - } - - public int intValue() { - return value; - } - - @Override - public byte[] encodeAsBytes() { - ByteBuffer buf = ByteBuffer.allocate(Integer.BYTES).order(ByteOrder.BIG_ENDIAN); - buf.putInt(value); - return buf.array(); - } - - @Override - public String toString() { - return "dword " + Integer.toHexString(value) + "h"; - } - } - - @ForDebugValueType(DebugValueType.INT64) - public static class DebugInt64Value implements DebugValue { - private final long value; - - public DebugInt64Value(long value) { - this.value = value; - } - - public DebugInt64Value(byte[] bytes) { - if (bytes.length != Long.BYTES) { - throw new IllegalArgumentException("Must have exactly " + Long.BYTES + " bytes"); - } - ByteBuffer buf = ByteBuffer.wrap(bytes).order(ByteOrder.BIG_ENDIAN); - this.value = buf.getLong(); - } - - public long longValue() { - return value; - } - - @Override - public byte[] encodeAsBytes() { - ByteBuffer buf = ByteBuffer.allocate(Long.BYTES).order(ByteOrder.BIG_ENDIAN); - buf.putLong(value); - return buf.array(); - } - - @Override - public String toString() { - return "qword " + Long.toHexString(value) + "h"; - } - } - - @ForDebugValueType(DebugValueType.FLOAT32) - public static class DebugFloat32Value implements DebugValue { - private final float value; - - public DebugFloat32Value(float value) { - this.value = value; - } - - public DebugFloat32Value(byte[] bytes) { - if (bytes.length != Float.BYTES) { - throw new IllegalArgumentException("Must have exactly " + Float.BYTES + " bytes"); - } - ByteBuffer buf = ByteBuffer.wrap(bytes).order(ByteOrder.BIG_ENDIAN); - this.value = buf.getFloat(); - } - - public float floatValue() { - return value; - } - - @Override - public byte[] encodeAsBytes() { - ByteBuffer buf = ByteBuffer.allocate(Float.BYTES).order(ByteOrder.BIG_ENDIAN); - buf.putFloat(value); - return buf.array(); - } - - @Override - public String toString() { - return "f32 " + value; - } - } - - @ForDebugValueType(DebugValueType.FLOAT64) - public static class DebugFloat64Value implements DebugValue { - private final double value; - - public DebugFloat64Value(double value) { - this.value = value; - } - - public DebugFloat64Value(byte[] bytes) { - if (bytes.length != Double.BYTES) { - throw new IllegalArgumentException("Must have exactly " + Double.BYTES + " bytes"); - } - ByteBuffer buf = ByteBuffer.wrap(bytes).order(ByteOrder.BIG_ENDIAN); - this.value = buf.getDouble(); - } - - public double doubleValue() { - return value; - } - - @Override - public byte[] encodeAsBytes() { - ByteBuffer buf = ByteBuffer.allocate(Double.BYTES).order(ByteOrder.BIG_ENDIAN); - buf.putDouble(value); - return buf.array(); - } - - @Override - public String toString() { - return "f64 " + value; - } - } - - /** - * Extended-precision float - */ - @ForDebugValueType(DebugValueType.FLOAT80) - public static class DebugFloat80Value implements DebugValue { - private final byte[] bytes; - - public DebugFloat80Value(byte[] bytes) { - if (bytes.length != 10) { - throw new IllegalArgumentException("Must have exactly 10 bytes"); - } - this.bytes = Arrays.copyOf(bytes, 10); - } - - public byte[] bytes() { - return bytes; - } - - @Override - public byte[] encodeAsBytes() { - return bytes; - } - - @Override - public String toString() { - return "f80 " + NumericUtilities.convertBytesToString(bytes); - } - } - - /** - * Specific to IA-64 (Itanium) floating-point registers - * - * 17-bit exponent, 64-bit fraction. Not sure how it's aligned in memory, though. - */ - @ForDebugValueType(DebugValueType.FLOAT82) - public static class DebugFloat82Value implements DebugValue { - private final byte[] bytes; - - public DebugFloat82Value(byte[] bytes) { - if (bytes.length != 11) { - throw new IllegalArgumentException("Must have exactly 11 bytes"); - } - this.bytes = Arrays.copyOf(bytes, 11); - } - - public byte[] bytes() { - return bytes; - } - - @Override - public byte[] encodeAsBytes() { - return bytes; - } - - @Override - public String toString() { - return "f82 " + NumericUtilities.convertBytesToString(bytes); - } - } - - /** - * Quadruple-precision float - */ - @ForDebugValueType(DebugValueType.FLOAT128) - public static class DebugFloat128Value implements DebugValue { - private final byte[] bytes; - - public DebugFloat128Value(byte[] bytes) { - if (bytes.length != 16) { - throw new IllegalArgumentException("Must have exactly 16 bytes"); - } - this.bytes = Arrays.copyOf(bytes, 16); - } - - public byte[] bytes() { - return bytes; - } - - @Override - public byte[] encodeAsBytes() { - return bytes; - } - - @Override - public String toString() { - return "f128 " + NumericUtilities.convertBytesToString(bytes); - } - } - - @ForDebugValueType(DebugValueType.VECTOR64) - public static class DebugVector64Value implements DebugValue { - private final byte[] bytes; - - public DebugVector64Value(byte[] bytes) { - if (bytes.length != 8) { - throw new IllegalArgumentException("Must have exactly 8 bytes"); - } - this.bytes = Arrays.copyOf(bytes, 8); - } - - public byte[] vi4() { - return bytes; - } - - @Override - public byte[] encodeAsBytes() { - return bytes; - } - - @Override - public String toString() { - return "vec64 " + NumericUtilities.convertBytesToString(bytes); - } - } - - @ForDebugValueType(DebugValueType.VECTOR128) - public static class DebugVector128Value implements DebugValue { - private final byte[] bytes; - - public DebugVector128Value(byte[] bytes) { - if (bytes.length != 16) { - throw new IllegalArgumentException( - "Must have exactly 16 bytes. got " + bytes.length); - } - this.bytes = Arrays.copyOf(bytes, 16); - } - - public byte[] vi8() { - return bytes; - } - - @Override - public byte[] encodeAsBytes() { - return bytes; - } - - @Override - public String toString() { - return "vec128 " + NumericUtilities.convertBytesToString(bytes); - } - } - - default DebugValueType getValueType() { - return DebugValueType.getDebugValueTypeForClass(getClass()); - } - - /** - * TODO: Document me - * - * Encodes the value as an array of bytes in big-endian order - * - * @return the encoded value - */ - public byte[] encodeAsBytes(); -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/util/DebugEventCallbacksAdapter.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/util/DebugEventCallbacksAdapter.java deleted file mode 100644 index 0f7d241de9..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/lldb/util/DebugEventCallbacksAdapter.java +++ /dev/null @@ -1,139 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.lldb.util; - -import java.lang.reflect.Method; - -import agent.lldb.lldb.DebugBreakpoint; -import agent.lldb.lldb.DebugClient.ChangeProcessState; -import agent.lldb.lldb.DebugClient.ChangeSessionState; -import agent.lldb.lldb.DebugClient.ChangeThreadState; -import agent.lldb.lldb.DebugClient.DebugStatus; -import agent.lldb.lldb.DebugClient.SessionStatus; -import agent.lldb.lldb.DebugEventCallbacks; -import agent.lldb.lldb.DebugModuleInfo; -import agent.lldb.lldb.DebugProcessInfo; -import agent.lldb.lldb.DebugSessionInfo; -import agent.lldb.lldb.DebugThreadInfo; -import ghidra.comm.util.BitmaskSet; - -/** - * A convenient abstract implementation of {@link DebugEventCallbacks} - * - * This implementation automatically computes the value for {@link #getInterestMask()} based on the - * overridden methods. The default implementations all return {@link DebugStatus#NO_CHANGE}, should - * they happen to be called. - */ -public class DebugEventCallbacksAdapter implements DebugEventCallbacks { - - private BitmaskSet interests = new BitmaskSet<>(DebugEvent.class); - - public DebugEventCallbacksAdapter() { - try { - // Compute the interest mask based on methods that are overridden - for (Method im : DebugEventCallbacks.class.getDeclaredMethods()) { - Method m = this.getClass().getMethod(im.getName(), im.getParameterTypes()); - if (m.getDeclaringClass() == DebugEventCallbacksAdapter.class) { - continue; - } - // The interface method is overridden, grab the annotation from the interface - ForInterest fi = im.getAnnotation(ForInterest.class); - if (fi == null) { - throw new AssertionError("No ForInterest annotation present on " + m); - } - interests.add(fi.value()); - } - } - catch (NoSuchMethodException e) { - throw new AssertionError(e); - } - } - - @Override - public BitmaskSet getInterestMask() { - return interests; - } - - @Override - public DebugStatus breakpoint(DebugBreakpoint bp) { - return DebugStatus.NO_CHANGE; - } - - @Override - public DebugStatus createThread(DebugThreadInfo debugThreadInfo) { - return DebugStatus.NO_CHANGE; - } - - @Override - public DebugStatus exitThread(int exitCode) { - return DebugStatus.NO_CHANGE; - } - - @Override - public DebugStatus createProcess(DebugProcessInfo debugProcessInfo) { - return DebugStatus.NO_CHANGE; - } - - @Override - public DebugStatus exitProcess(int exitCode) { - return DebugStatus.NO_CHANGE; - } - - @Override - public DebugStatus createSession(DebugSessionInfo debugSessionInfo) { - return DebugStatus.NO_CHANGE; - } - - @Override - public DebugStatus exitSession(int exitCode) { - return DebugStatus.NO_CHANGE; - } - - @Override - public DebugStatus loadModule(DebugModuleInfo debugModuleInfo) { - return DebugStatus.NO_CHANGE; - } - - @Override - public DebugStatus unloadModule(String imageBaseName, long baseOffset) { - return DebugStatus.NO_CHANGE; - } - - @Override - public DebugStatus systemError(int error, int level) { - return DebugStatus.NO_CHANGE; - } - - @Override - public DebugStatus sessionStatus(SessionStatus status) { - return DebugStatus.NO_CHANGE; - } - - @Override - public DebugStatus changeSessionState(BitmaskSet flags) { - return DebugStatus.NO_CHANGE; - } - - @Override - public DebugStatus changeProcessState(BitmaskSet flags) { - return DebugStatus.NO_CHANGE; - } - - @Override - public DebugStatus changeThreadState(BitmaskSet flags) { - return DebugStatus.NO_CHANGE; - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/LldbCause.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/LldbCause.java deleted file mode 100644 index ddbc0ccd7e..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/LldbCause.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager; - -/** - * Identifies the cause of an event emitted by lldb - * - * This is not a concept native to lldb. Rather, it is a means to distinguish events that result - * from commands issued by the {@link LldbManager} from those issued by the user or some other means. - * For example, a call to {@link LldbManager#addProcess()} will emit a - * {@link LldbEventsListener#processAdded(LldbProcess, LldbCause)} event, identifying the - * {@link LldbPendingCommand} as the cause. - */ -public interface LldbCause { - public enum Causes implements LldbCause { - UNCLAIMED; - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/LldbCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/LldbCommand.java deleted file mode 100644 index 52a654a17b..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/LldbCommand.java +++ /dev/null @@ -1,76 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager; - -import java.util.concurrent.CompletableFuture; - -import SWIG.StateType; -import agent.lldb.manager.cmd.LldbPendingCommand; - -/** - * The interface for lldb command implementations - * - * Commands are executed by lldb in serial. In order to distinguish the likely cause of events, the - * manager will wait to issue each command until it has seen a prompt. Thus, commands are queued up, - * and the manager uses the {@link CompletableFuture} pattern to "return" results after execution - * completes. - * - * To begin executing the command, the manager invokes the command, using {@link #invoke()}. Any - * event that occurs during command execution is given to - * {@link #handle(LldbEvent, LldbPendingCommand)}. The implementor then has the option to "claim" or - * "steal" the event. When claimed, any subsequent event processor or listener is provided this - * command as the event's cause. When stolen, no subsequent event processors are called. The - * implementation ought to keep a list of claimed and stolen events. Once lldb has finished executing - * the command, the manager calls {@link #complete(LldbPendingCommand)}, allowing the implementation - * to process its claimed and stolen events and return the result of the command. - * - * @param the type of object "returned" by the command - */ -public interface LldbCommand { - - /** - * Check if this command can be executed given lldb's current state - * - * @param state lldb's state - * @return true if it can be executed, false otherwise - */ - public boolean validInState(StateType state); - - /** - * Invoke the command - */ - public void invoke(); - - /** - * Handle an event that occurred during the execution of this command - * - * @param evt the event - * @param pending a copy of the executing command instance - * @return true if the command is now ready to be completed - */ - public boolean handle(LldbEvent evt, LldbPendingCommand pending); - - /** - * Called when the manager believes this command is finished executing - * - * This is presumed when the manager receives the prompt after issuing the encoded command - * - * @param pending a copy of the now-finished-executing command instance - * @return the object "returned" by the command - */ - public T complete(LldbPendingCommand pending); - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/LldbEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/LldbEvent.java deleted file mode 100644 index 184f09e5ba..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/LldbEvent.java +++ /dev/null @@ -1,64 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager; - -import SWIG.StateType; -import agent.lldb.manager.cmd.LldbPendingCommand; - -public interface LldbEvent { - /** - * Get the information detailing the event - * - * @return the information - */ - public T getInfo(); - - /** - * Use {@link LldbPendingCommand#claim(LldbEvent)} instead - * - * @param cause the cause - */ - public void claim(LldbPendingCommand cause); - - /** - * If claimed, get the cause of this event - * - * @return the cause - */ - public LldbCause getCause(); - - /** - * Use {@link LldbPendingCommand#steal(LldbEvent)} instead - */ - public void steal(); - - /** - * Check if this event is stolen - * - * A stolen event should not be processed further, except by the thief - * - * @return true if stolen, false otherwise - */ - public boolean isStolen(); - - /** - * If this event implies a new lldb state, get that state - * - * @return the new state, or null for no change - */ - public StateType newState(); - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/LldbEventsListener.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/LldbEventsListener.java deleted file mode 100644 index f0daf077bd..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/LldbEventsListener.java +++ /dev/null @@ -1,229 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager; - -import SWIG.*; -import agent.lldb.lldb.DebugModuleInfo; - -public interface LldbEventsListener { - - /** - * A session has been added - * - * @param session a handle to the new session - * @param cause the cause of this event - */ - void sessionAdded(SBTarget session, LldbCause cause); - - /** - * A session has been replaced - * - * @param session a handle to the new session - * @param cause the cause of this event - */ - void sessionReplaced(SBTarget session, LldbCause cause); - - /** - * A session has been removed - * - * @param sessionId the ID of the now-defunct session - * @param cause the cause of this event - */ - void sessionRemoved(String sessionId, LldbCause cause); - - /** - * A different session has been selected (gained focus) - * - * @param session a handle to the selected session - * @param cause the cause of this event - */ - void sessionSelected(SBTarget session, LldbCause cause); - - /** - * An Process has been added to the session - * - * @param process a handle to the new process - * @param cause the cause of this event - */ - void processAdded(SBProcess process, LldbCause cause); - - /** - * An Process has been replaced in the session - * - * @param process a handle to the new process - * @param cause the cause of this event - */ - void processReplaced(SBProcess process, LldbCause cause); - - /** - * An process has been removed from the session - * - * @param processId the ID of the now-defunct process - * @param cause the cause of this event - */ - void processRemoved(String processId, LldbCause cause); - - /** - * A different process has been selected (gained focus) - * - * @param process a handle to the selected process - * @param cause the cause of this event - */ - void processSelected(SBProcess process, LldbCause cause); - - /** - * Execution has been started in an process - * - * @param process a handle to the now-executing process - * @param cause the cause of this event - */ - void processStarted(SBProcess process, LldbCause cause); - - /** - * Execution has terminated in an process - * - * @param process a handle to the now-stopped process - * @param cause the cause of this event - */ - void processExited(SBProcess process, LldbCause cause); - - /** - * A thread has been created - * - * Use {@link LldbThread#getProcess()} to get a handle to the process in which the thread was - * created. - * - * @param thread a handle to the new thread - * @param cause the cause of this event - */ - void threadCreated(SBThread thread, LldbCause cause); - - /** - * A thread has been replaced - * - * Use {@link LldbThread#getProcess()} to get a handle to the process in which the thread was - * created. - * - * @param thread a handle to the new thread - * @param cause the cause of this event - */ - void threadReplaced(SBThread thread, LldbCause cause); - - /** - * A thread's state has changed, e.g., {@link LldbState#RUNNING} to - * {@link LldbState#STOPPED} - * - * @param thread a handle to the thread whose state has changed - * @param state the state to which the thread changed - * @param cause the cause of this event - * @param reason the reason for the state change - */ - void threadStateChanged(SBThread thread, StateType state, LldbCause cause, LldbReason reason); - - /** - * A thread has exited - * - * @param threadId the ID of the now-defuct thread - * @param process a handle to the process to which the thread belonged - * @param cause the cause of this event - */ - void threadExited(SBThread thread, SBProcess process, LldbCause cause); - - /** - * A different thread has been selected (gained focus) - * - * @param thread a handle to the selected thread - * @param frame a handle to the current frame - * @param cause the cause of this event - */ - void threadSelected(SBThread thread, SBFrame frame, LldbCause cause); - - /** - * A module has been loaded by an process - * - * @param process a handle to the process which loaded the module - * @param name the name of the module on the target - * @param cause the cause of this event - */ - void moduleLoaded(SBProcess process, DebugModuleInfo info, int index, LldbCause cause); - - /** - * A module has been unloaded from an process - * - * @param process a handle to the process which unloaded the module - * @param name the name of the module on the target - * @param cause the cause of this event - */ - void moduleUnloaded(SBProcess process, DebugModuleInfo info, int index, LldbCause cause); - - /** - * A breakpoint has been created in the session - * - * @param info information about the new breakpoint - * @param cause the cause of this event - */ - void breakpointCreated(Object info, LldbCause cause); - - /** - * A breakpoint in the session has been modified - * - * @param newInfo new information about the modified breakpoint - * @param oldInfo old information about the modified breakpoint - * @param cause the cause of this event - */ - void breakpointModified(Object info, LldbCause cause); - - /** - * A breakpoint has been deleted from the session - * - * @param info information about the now-deleted breakpoint - * @param cause the cause of this event - */ - void breakpointDeleted(Object info, LldbCause cause); - - /** - * A breakpoint was hit in the session - * - * @param info information about the breakpoint hit - * @param cause the cause of this event - */ - void breakpointHit(Object info, LldbCause cause); - - /** - * TODO: This is not yet implemented - * - * It is not clear whether lldb detects when a target writes into its own memory, or if this - * event is emitted when lldb changes the target's memory, or both. - * - * @param process the process whose memory changed - * @param addr the address of the change - * @param len the length, with the address, bounding the region of change - * @param cause the cause of this event - */ - void memoryChanged(SBProcess process, long addr, int len, LldbCause cause); - - /** - * @param output console output - * @param mask class of output - */ - void consoleOutput(String output, int mask); - - /** - * @param prompt for console output - */ - void promptChanged(String prompt); - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/LldbEventsListenerAdapter.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/LldbEventsListenerAdapter.java deleted file mode 100644 index 458b363587..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/LldbEventsListenerAdapter.java +++ /dev/null @@ -1,147 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager; - -import SWIG.*; -import agent.lldb.lldb.DebugModuleInfo; - -public interface LldbEventsListenerAdapter extends LldbEventsListener { - - @Override - public default void sessionAdded(SBTarget session, LldbCause cause) { - // Extension point - } - - @Override - public default void sessionReplaced(SBTarget session, LldbCause cause) { - // Extension point - } - - @Override - public default void sessionRemoved(String sessionId, LldbCause cause) { - // Extension point - } - - @Override - public default void sessionSelected(SBTarget session, LldbCause cause) { - // Extension point - } - - @Override - public default void processAdded(SBProcess process, LldbCause cause) { - // Extension point - } - - @Override - public default void processReplaced(SBProcess process, LldbCause cause) { - // Extension point - } - - @Override - public default void processRemoved(String processId, LldbCause cause) { - // Extension point - } - - @Override - public default void processSelected(SBProcess process, LldbCause cause) { - // Extension point - } - - @Override - public default void processStarted(SBProcess process, LldbCause cause) { - // Extension point - } - - @Override - public default void processExited(SBProcess process, LldbCause cause) { - // Extension point - } - - @Override - public default void threadCreated(SBThread thread, LldbCause cause) { - // Extension point - } - - @Override - public default void threadReplaced(SBThread thread, LldbCause cause) { - // Extension point - } - - @Override - public default void threadStateChanged(SBThread thread, StateType state, LldbCause cause, - LldbReason reason) { - // Extension point - } - - @Override - public default void threadExited(SBThread thread, SBProcess process, LldbCause cause) { - // Extension point - - } - - @Override - public default void threadSelected(SBThread thread, SBFrame frame, LldbCause cause) { - // Extension point - } - - @Override - public default void moduleLoaded(SBProcess process, DebugModuleInfo info, int index, - LldbCause cause) { - // Extension point - } - - @Override - public default void moduleUnloaded(SBProcess process, DebugModuleInfo info, int index, - LldbCause cause) { - // Extension point - } - - @Override - public default void breakpointCreated(Object info, LldbCause cause) { - // Extension point - } - - @Override - public default void breakpointModified(Object info, LldbCause cause) { - // Extension point - } - - @Override - public default void breakpointDeleted(Object info, LldbCause cause) { - // Extension point - } - - @Override - public default void breakpointHit(Object info, LldbCause cause) { - // Extension point - } - - @Override - public default void memoryChanged(SBProcess process, long addr, int len, LldbCause cause) { - // Extension point - } - - @Override - public default void consoleOutput(String output, int mask) { - // Extension point - } - - @Override - public default void promptChanged(String prompt) { - // Extension point - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/LldbManager.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/LldbManager.java deleted file mode 100644 index 566bdc0d40..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/LldbManager.java +++ /dev/null @@ -1,436 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import org.apache.commons.lang3.tuple.Pair; - -import SWIG.*; -import agent.lldb.lldb.DebugClient.DebugStatus; -import agent.lldb.manager.LldbManager.ExecSuffix; -import agent.lldb.manager.breakpoint.LldbBreakpointInsertions; -import agent.lldb.manager.impl.LldbManagerImpl; - -public interface LldbManager extends AutoCloseable, LldbBreakpointInsertions { - - /** - * Possible values for {@link LldbThread#step(ExecSuffix)} - */ - public enum ExecSuffix { - FINISH("finish"), - NEXT("next"), - NEXT_INSTRUCTION("next-instruction"), - RETURN("return"), - STEP("step"), - STEP_INSTRUCTION("step-instruction"), - UNTIL("until"), - EXTENDED("ext"),; - - final String str; - - ExecSuffix(String str) { - this.str = str; - } - - @Override - public String toString() { - return str; - } - } - - static LldbManager newInstance() { - return new LldbManagerImpl(); - } - - /** - * Launch lldb - * - * @param args cmd plus args - * @return a future which completes when lldb is ready to accept commands - */ - CompletableFuture start(String[] args); - - /** - * Terminate lldb - */ - void terminate(); - - /** - * Check if lldb is alive - * - * Note this is not about the state of inferiors in lldb. If the lldb controlling process is - * alive, lldb is alive. - * - * @return true if lldb is alive, false otherwise - */ - boolean isRunning(); - - /** - * Add a listener for lldb's state - * - * @see #getState() - * @param listener the listener to add - */ - void addStateListener(LldbStateListener listener); - - /** - * Remove a listener for lldb's state - * - * @see #getState() - * @param listener the listener to remove - */ - void removeStateListener(LldbStateListener listener); - - /** - * Add a listener for events on processes - * - * @param listener the listener to add - */ - void addEventsListener(LldbEventsListener listener); - - /** - * Remove a listener for events on inferiors - * - * @param listener the listener to remove - */ - void removeEventsListener(LldbEventsListener listener); - - /** - * Get a thread by its lldb-assigned ID - * - * lldb numbers its threads using a global counter. These IDs are unrelated to the OS-assigned - * TID. This method can retrieve a thread by its ID no matter which inferior it belongs to. - * - * @param id the lldb-asigned thread ID - * @return a handle to the thread, if it exists - */ - SBThread getThread(SBProcess process, String id); - - /** - * Get an process by its lldb-assigned ID - * - * lldb numbers processes incrementally. All inferiors and created and destroyed by the user. - * See {@link #addProcess()}. - * - * @param id the process ID - * @return a handle to the process, if it exists - */ - SBProcess getProcess(SBTarget session, String id); - - /** - * Get an session by its lldb-assigned ID - * - * lldb numbers processes incrementally. All inferiors and created and destroyed by the user. - * See {@link #addSession()}. - * - * @param id the process ID - * @return a handle to the process, if it exists - */ - SBTarget getSession(String id); - - /** - * Get an session by its lldb-assigned ID - * - * lldb numbers processes incrementally. All inferiors and created and destroyed by the user. - * See {@link #addSession()}. - * - * @param id the process ID - * @return a handle to the process, if it exists - */ - SBModule getModule(SBTarget session, String id); - - /** - * Get all threads known to the manager - * - * This does not ask lldb to lists its known threads. Rather it returns a read-only view of the - * manager's understanding of the current threads based on its tracking of lldb events. - * - * @return a map of lldb-assigned thread IDs to corresponding thread handles - */ - Map getKnownThreads(SBProcess process); - - /** - * Get all processes known to the manager - * - * This does not ask lldb to list its processes. Rather it returns a read-only view of the - * manager's understanding of the current processes based on its tracking of lldb events. - * - * @return a map of process IDs to corresponding process handles - */ - Map getKnownProcesses(SBTarget session); - - /** - * Get all sessions known to the manager - * - * This does not ask lldb to list its processes. Rather it returns a read-only view of the - * manager's understanding of the current inferiors based on its tracking of lldb events. - * - * @return a map of session IDs to corresponding session handles - */ - Map getKnownSessions(); - - /** - * Get all sessions known to the manager - * - * This does not ask lldb to list its processes. Rather it returns a read-only view of the - * manager's understanding of the current inferiors based on its tracking of lldb events. - * - * @return a map of session IDs to corresponding session handles - */ - Map getKnownModules(SBTarget session); - - /** - * Get all breakpoints known to the manager - * - * This does not ask lldb to list its breakpoints. Rather it returns a read-only view of the - * manager's understanding of the current breakpoints based on its tracking of lldb events. - * - * @return a map of lldb-assigned breakpoint IDs to corresponding breakpoint information - */ - Map getKnownBreakpoints(SBTarget session); - - /** - * Send an interrupt to lldb regardless of other queued commands - * - * This may be useful if the manager's command queue is stalled because an inferior is running. - * - */ - void sendInterruptNow(); - - /** - * Get the state of the lldb session - * - * In all-stop mode, if any thread is running, lldb is said to be in the running state and is - * unable to process commands. Otherwise, if all threads are stopped, then lldb is said to be in - * the stopped state and can accept and process commands. This manager has not been tested in - * non-stop mode. - * - * @return the state - */ - StateType getState(); - - /** - * Add a process - * - * @return a future which completes with the handle to the new process - */ - CompletableFuture addProcess(); - - /** - * Remove a process - * - * @param process the process to remove - * @return a future which completes then lldb has executed the command - */ - CompletableFuture removeProcess(SBProcess process); - - /** - * Add a session - * - * @return a future which completes with the handle to the new process - */ - CompletableFuture addSession(); - - /** - * Execute an arbitrary CLI command, printing output to the CLI console - * - * Note: to ensure a certain thread or inferior has focus for a console command, see - * {@link LldbThread#console(String)}. - * - * @param command the command to execute - * @return a future that completes when lldb has executed the command - */ - CompletableFuture console(String command); - - /** - * Execute an arbitrary CLI command, capturing its console output - * - * The output will not be printed to the CLI console. To ensure a certain thread or inferior has - * focus for a console command, see {@link LldbThread#consoleCapture(String)} and - * {@link LldbProcess#consoleCapture(String)}. - * - * @param command the command to execute - * @return a future that completes with the captured output when lldb has executed the command - */ - CompletableFuture consoleCapture(String command); - - /** - * List lldb's threads - * - * @return a future that completes with a map of process IDs to process handles - */ - CompletableFuture> listThreads(SBProcess process); - - /** - * List lldb's processes - * - * @return a future that completes with a map of process IDs to process handles - */ - CompletableFuture> listProcesses(SBTarget session); - - /** - * List the available processes on target - * - * @return a future that completes with a list of PIDs - */ - CompletableFuture>> listAvailableProcesses(); - - /** - * List lldb's sessions - * - * @return a future that completes with a map of session IDs to session handles - */ - CompletableFuture> listSessions(); - - /** - * List lldb's stack frames - * - * @return a future that completes with a map of session IDs to session handles - */ - CompletableFuture> listStackFrames(SBThread thread); - - /** - * List lldb's stack frame register banks - * - * @return a future that completes with a map of session IDs to session handles - */ - CompletableFuture> listStackFrameRegisterBanks(SBFrame frame); - - /** - * List lldb's stack frame registers - * - * @return a future that completes with a map of session IDs to session handles - */ - CompletableFuture> listStackFrameRegisters(SBValue bank); - - /** - * List lldb's modules - * - * @return a future that completes with a map of session IDs to session handles - */ - public CompletableFuture> listModules(SBTarget session); - - /** - * List lldb's module sections - * - * @return a future that completes with a map of session IDs to session handles - */ - public CompletableFuture> listModuleSections(SBModule module); - - /** - * List lldb's module symbols - * - * @return a future that completes with a map of session IDs to session handles - */ - public CompletableFuture> listModuleSymbols(SBModule module); - - /** - * List lldb's memory - * - * @return a future that completes with a map of session IDs to session handles - */ - public CompletableFuture> listMemory(SBProcess process); - - /** - * List information for all breakpoints - * - * @return a future that completes with a list of information for all breakpoints - */ - CompletableFuture> listBreakpoints(SBTarget session); - - /** - * List information for all breakpoints - * - * @return a future that completes with a list of information for all breakpoints - */ - CompletableFuture> listBreakpointLocations(SBBreakpoint spec); - - /** - * List information for all env vars - * - * @return a future that completes with a list of information for all env vars - */ - CompletableFuture> listEnvironment(SBTarget session); - - /** - * Disable the given breakpoints - * - * This is equivalent to the CLI command {@code disable breakpoint [NUMBER]}. - * - * @param numbers the lldb-assigned breakpoint numbers - * @return a future that completes when lldb has executed the command - */ - CompletableFuture disableBreakpoints(String... ids); - - /** - * Enable the given breakpoints - * - * This is equivalent to the CLI command {@code enable breakpoint [NUMBER]}. - * - * @param numbers the lldb-assigned breakpoint numbers - * @return a future that completes when lldb has executed the command - */ - CompletableFuture enableBreakpoints(String... ids); - - /** - * Delete a breakpoint - * - * This is equivalent to the CLI command {@code delete breakpoint [NUMBER]}. - * - * @param numbers the lldb-assigned breakpoint numbers - * @return a future that completes when lldb has executed the command - */ - CompletableFuture deleteBreakpoints(String... ids); - - CompletableFuture attach(String pid); - - CompletableFuture attach(String name, boolean wait); - - CompletableFuture attach(String url, boolean wait, boolean async); - - CompletableFuture connect(String url, boolean auto, boolean async, boolean kernel); - - CompletableFuture launch(String fileName, List args); - - CompletableFuture launch(Map args); - - /********** NEEDED FOR TESTING ************/ - - /** - * Returns the current process - * - * @return the current process - */ - SBProcess currentProcess(); - - CompletableFuture waitForPrompt(); - - CompletableFuture waitForEventEx(); - - CompletableFuture execute(LldbCommand cmd); - - DebugStatus processEvent(LldbEvent evt); - - DebugStatus getStatus(); - - void setCurrentEvent(SBEvent evt); - - void updateState(SBProcess process); - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/LldbReason.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/LldbReason.java deleted file mode 100644 index 92b80341ad..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/LldbReason.java +++ /dev/null @@ -1,44 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager; - -public interface LldbReason { - - /** - * Reasons other than those given by LLDB - */ - enum Reasons implements LldbReason { - /** - * No reason was given - */ - NONE, - /** - * A reason was given, but the manager does not understand it - */ - UNKNOWN; - - @Override - public String desc() { - return "Unknown"; - } - } - - static LldbReason getReason(String info) { - return Reasons.UNKNOWN; - } - - public String desc(); -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/LldbStateListener.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/LldbStateListener.java deleted file mode 100644 index cc736e2061..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/LldbStateListener.java +++ /dev/null @@ -1,37 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager; - -import SWIG.StateType; -import ghidra.util.TriConsumer; - -/** - * A listener for changes in LLDB's state - */ -public interface LldbStateListener extends TriConsumer { - /** - * The state has changed because of the given cause - * - * @param state the new state - * @param cause the reason for the change - */ - void stateChanged(StateType state, LldbCause cause); - - @Override - default void accept(StateType oldVal, StateType newVal, LldbCause u) { - stateChanged(newVal, u); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/breakpoint/LldbBreakpointDisp.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/breakpoint/LldbBreakpointDisp.java deleted file mode 100644 index ecd141166f..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/breakpoint/LldbBreakpointDisp.java +++ /dev/null @@ -1,32 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.breakpoint; - -public enum LldbBreakpointDisp { - /** - * The breakpoint should remain until deleted by the user - */ - KEEP, - /** - * The breakpoint should be deleted once it is hit - */ - DEL, - /** - * Some disposition unknown to the manager - */ - OTHER; - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/breakpoint/LldbBreakpointInfo.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/breakpoint/LldbBreakpointInfo.java deleted file mode 100644 index 3b8ac792e3..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/breakpoint/LldbBreakpointInfo.java +++ /dev/null @@ -1,212 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.breakpoint; - -import java.util.*; - -import SWIG.*; -import agent.lldb.lldb.DebugBreakpoint.BreakAccess; -import agent.lldb.lldb.DebugClient; -import ghidra.comm.util.BitmaskSet; - -public class LldbBreakpointInfo { - - private Object info; - private SBProcess proc; - - private Long offset; - private String expression; - private final List locations; - - /** - * Construct lldb breakpoint information - * - * @param number the lldb-assigned breakpoint number - * @param type the type of breakpoint - * @param disp the breakpoint disposition - * @param loc the location of the breakpoint - * @param pending if pending, the location that is not yet resolved - * @param enabled true if the breakpoint is enabled, false otherwise - * @param times the number of times the breakpoint has been hit - * @param locations the resolved address(es) of this breakpoint - */ - public LldbBreakpointInfo(SBBreakpoint bpt, boolean enabled) { - this(bpt, bpt.GetTarget().GetProcess()); - bpt.SetEnabled(enabled); - } - - public LldbBreakpointInfo(SBBreakpoint bpt, SBProcess process) { - this.info = bpt; - this.proc = process; - locations = new ArrayList<>(); - for (int i = 0; i < bpt.GetNumLocations(); i++) { - locations.add(bpt.GetLocationAtIndex(i)); - } - } - - public LldbBreakpointInfo(SBWatchpoint wpt, SBProcess process) { - this.info = wpt; - this.proc = process; - locations = new ArrayList<>(); - } - - public String getId() { - return DebugClient.getId(info); - } - - @Override - public int hashCode() { - return Objects.hash(getId()); - } - - @Override - public String toString() { - return DebugClient.getId(info); - } - - @Override - public boolean equals(Object obj) { - if (!((obj instanceof LldbBreakpointInfo))) { - return false; - } - LldbBreakpointInfo that = (LldbBreakpointInfo) obj; - if (this.getId() != that.getId()) { - return false; - } - return true; - } - - /** - * Get the breakpoint disposition, i.e., what happens to the breakpoint once it has been hit - * - * @return the disposition - */ - public LldbBreakpointDisp getDisp() { - return LldbBreakpointDisp.KEEP; - } - - /** - * Get the offset expression of the breakpoint - * - * @return the location - */ - public String getExpression() { - return expression; - } - - /** - * Get the size of the breakpoint - * - * @return the size - */ - public int getSize() { - return 1; - } - - /** - * Get the access of the breakpoint - * - * @return the size - */ - public BitmaskSet getAccess() { - return null;//access; - } - - /** - * Get the offset of this breakpoint - * - *

- * Note if the offset was given as an expression, but it hasn't been resolved, this will return - * {@code null}. - * - * @return the offset, or {@code null} - */ - public Long getOffset() { - return offset; - } - - /** - * Check if the breakpoint is enabled - * - * @return true if enabled, false otherwise - */ - public boolean isEnabled() { - if (info instanceof SBBreakpoint) { - return ((SBBreakpoint) info).IsEnabled(); - } - else { - return ((SBWatchpoint) info).IsEnabled(); - } - } - - /** - * Get the number of times the breakpoint has been hit - * - * @return the hit count - */ - public long getTimes() { - if (info instanceof SBBreakpoint) { - return ((SBBreakpoint) info).GetHitCount(); - } - else { - return ((SBWatchpoint) info).GetHitCount(); - } - } - - /** - * Get a list of resolved addresses - * - *

- * The effective locations may change for a variety of reasons. Most notable, a new module may - * be loaded, having location(s) that match the desired location of this breakpoint. The binary - * addresses within will become new effective locations of this breakpoint. - * - * @return the list of locations at the time the breakpoint information was captured - */ - public List getLocations() { - return locations; - } - - public Object getBreakpoint() { - return info; - } - - public void setBreakpoint(Object info) { - this.info = info; - } - - public SBProcess getProc() { - return proc; - } - - public int getEventThread() { - if (info instanceof SBBreakpoint) { - return ((SBBreakpoint) info).GetThreadID().intValue(); - } - else { - return -1; - } - } - - public long getAddressAsLong() { - if (info instanceof SBBreakpoint) { - return locations.get(0).GetLoadAddress().longValue(); - } - else { - return ((SBWatchpoint) info).GetWatchAddress().longValue(); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/breakpoint/LldbBreakpointInsertions.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/breakpoint/LldbBreakpointInsertions.java deleted file mode 100644 index 3d0a5a305b..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/breakpoint/LldbBreakpointInsertions.java +++ /dev/null @@ -1,84 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.breakpoint; - -import java.util.concurrent.CompletableFuture; - -import ghidra.util.NumericUtilities; - -public interface LldbBreakpointInsertions { - /** - * Insert a breakpoint - * - * This is equivalent to the CLI command: {@code break [LOC]}, or {@code watch [LOC]}, etc. - * - * Breakpoints in lldb can get pretty complicated. Depending on the location specification, the - * actual location of the breakpoint may change during the lifetime of an inferior. Take note of - * the breakpoint number to track those changes across breakpoint modification events. - * - * @param loc the location (address, symbol, line number, etc.) to place the breakpoint at - * @param type the type of breakpoint (or watchpoint) to add - * @return a copy of the resulting breakpoint information once lldb has executed the command - */ - default CompletableFuture insertBreakpoint(String loc, - LldbBreakpointType type) { - return insertBreakpoint(NumericUtilities.parseHexLong(loc), 1, - LldbBreakpointType.BREAKPOINT); - } - - /** - * Insert a (usually software) execution breakpoint - * - * @param loc string version of address - * @return a future that completes when lldb has executed the command - * - * @see #insertBreakpoint(String location) - */ - default CompletableFuture insertBreakpoint(String loc) { - return insertBreakpoint(loc, LldbBreakpointType.BREAKPOINT); - } - - /** - * Insert a (usually software) execution breakpoint at the given address offset - * - * Note, this uses the "Address Notation" specified by lldb. - * - * @param addr breakpoint address - * @return a future that completes when lldb has executed the command - * - * @see #insertBreakpoint(long address) - */ - default CompletableFuture insertBreakpoint(long addr) { - return insertBreakpoint(addr, 1, LldbBreakpointType.BREAKPOINT); - } - - /** - * Insert a breakpoint (usually a watchpoint) at the given address range - * - * Note, this implements the length by casting the address pointer to a - * fixed-length-char-array-pointer where the array has the given length. Support for specific - * lengths may vary by platform. - * - * @param addr the starting address - * @param len the length of the range - * @param type the type of breakpoint (usually a watchpoint) - * @return a future that completes when lldb has executed the command - * @see #insertBreakpoint(String, LldbBreakpointType) - */ - CompletableFuture insertBreakpoint(long addr, int len, - LldbBreakpointType type); - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/breakpoint/LldbBreakpointType.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/breakpoint/LldbBreakpointType.java deleted file mode 100644 index 61337bfb97..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/breakpoint/LldbBreakpointType.java +++ /dev/null @@ -1,59 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.breakpoint; - -/** - * The type of lldb breakpoint - */ -public enum LldbBreakpointType { - /** - * A software execution breakpoint, usually set via {@code break} - */ - BREAKPOINT, - /** - * A hardware execution breakpoint, usually set via {@code hbreak} - */ - HW_BREAKPOINT, - /** - * A hardware (write) watchpoint, usually set via {@code watch} - */ - WRITE_WATCHPOINT, - /** - * A read watchpoint, usually set via {@code rwatch} - */ - READ_WATCHPOINT, - /** - * An access (r/w) watchpoint, usually set via {@code awatch} - */ - ACCESS_WATCHPOINT, - /** - * Some type not known to the manager - */ - OTHER; - - /** - * @param string the value of type parsed - * @return the enum constant, or {@link #OTHER} if unrecognized - */ - public static LldbBreakpointType fromStr(String string) { - try { - return valueOf(string); - } - catch (IllegalArgumentException e) { - return OTHER; - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/AbstractLldbCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/AbstractLldbCommand.java deleted file mode 100644 index f0f57f503b..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/AbstractLldbCommand.java +++ /dev/null @@ -1,65 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import SWIG.StateType; -import agent.lldb.manager.LldbCommand; -import agent.lldb.manager.LldbEvent; -import agent.lldb.manager.evt.LldbCommandDoneEvent; -import agent.lldb.manager.impl.LldbManagerImpl; - -/** - * A base class for interacting with specific Lldb commands - * - * @param the type of object "returned" by the command - */ -public abstract class AbstractLldbCommand implements LldbCommand { - protected final LldbManagerImpl manager; - - /** - * Construct a new command to be executed by the given manager - * - * @param manager the manager to execute the command - */ - protected AbstractLldbCommand(LldbManagerImpl manager) { - this.manager = manager; - } - - @Override - public boolean validInState(StateType state) { - return true; // With dual interpreters, shouldn't have to worry. - } - - @Override - public boolean handle(LldbEvent evt, LldbPendingCommand pending) { - if (evt instanceof LldbCommandDoneEvent) { - if (pending.getCommand().equals(((LldbCommandDoneEvent) evt).getCmd())) { - return true; - } - } - return false; - } - - @Override - public T complete(LldbPendingCommand pending) { - return null; - } - - @Override - public void invoke() { - // Nothing - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbAddProcessCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbAddProcessCommand.java deleted file mode 100644 index 23645bb0cb..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbAddProcessCommand.java +++ /dev/null @@ -1,36 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import SWIG.SBProcess; -import agent.lldb.manager.impl.LldbManagerImpl; - -/** - * Implementation of {@link LldbManager#addProcess()} - */ -public class LldbAddProcessCommand extends AbstractLldbCommand { - - public LldbAddProcessCommand(LldbManagerImpl manager) { - super(manager); - } - - @Override - public SBProcess complete(LldbPendingCommand pending) { - // Not apparent this is needed - return null; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbAddSessionCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbAddSessionCommand.java deleted file mode 100644 index 5967a18a1d..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbAddSessionCommand.java +++ /dev/null @@ -1,36 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import SWIG.SBTarget; -import agent.lldb.manager.impl.LldbManagerImpl; - -/** - * Implementation of {@link LldbManager#addSession()} - */ -public class LldbAddSessionCommand extends AbstractLldbCommand { - - public LldbAddSessionCommand(LldbManagerImpl manager) { - super(manager); - } - - @Override - public SBTarget complete(LldbPendingCommand pending) { - // Not apparent this is needed - return null; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbAttachCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbAttachCommand.java deleted file mode 100644 index 8e97e72321..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbAttachCommand.java +++ /dev/null @@ -1,91 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import java.util.LinkedHashSet; -import java.util.Set; - -import SWIG.SBThread; -import agent.lldb.lldb.DebugClient; -import agent.lldb.lldb.DebugThreadInfo; -import agent.lldb.manager.LldbEvent; -import agent.lldb.manager.evt.*; -import agent.lldb.manager.impl.LldbManagerImpl; - -/** - * Implementation of {@link LldbProcess#attach()} - */ -public class LldbAttachCommand extends AbstractLldbCommand> { - - private LldbProcessCreatedEvent created = null; - private boolean completed = false; - private String key; - private int keyType = 0; - private boolean wait = true; - private boolean async = false; - - public LldbAttachCommand(LldbManagerImpl manager, String key) { - this(manager, key, true, false); - this.keyType = 0; - } - - public LldbAttachCommand(LldbManagerImpl manager, String key, boolean wait) { - this(manager, key, wait, false); - this.keyType = 1; - } - - public LldbAttachCommand(LldbManagerImpl manager, String key, boolean wait, boolean async) { - super(manager); - this.key = key; - this.wait = wait; - this.async = async; - this.keyType = 2; - } - - @Override - public boolean handle(LldbEvent evt, LldbPendingCommand pending) { - if (evt instanceof AbstractLldbCompletedCommandEvent && pending.getCommand().equals(this)) { - completed = true; - } - else if (evt instanceof LldbProcessCreatedEvent) { - created = (LldbProcessCreatedEvent) evt; - } - else if (evt instanceof LldbThreadCreatedEvent) { - pending.claim(evt); - } - else if (evt instanceof LldbStoppedEvent) { - pending.claim(evt); - } - return completed && (created != null); - } - - @Override - public Set complete(LldbPendingCommand pending) { - Set threads = new LinkedHashSet<>(); - for (LldbThreadCreatedEvent adds : pending.findAllOf(LldbThreadCreatedEvent.class)) { - DebugThreadInfo info = adds.getInfo(); - threads.add(info.thread); - } - return threads; - } - - @Override - public void invoke() { - DebugClient client = manager.getClient(); - client.attachProcess(client.getLocalServer(), keyType, key, wait, async); - // NB: manager.waitForEventEx - embedded in attach - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbAttachKernelCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbAttachKernelCommand.java deleted file mode 100644 index dad688f7c1..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbAttachKernelCommand.java +++ /dev/null @@ -1,73 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import java.util.Map; - -import SWIG.SBThread; -import agent.lldb.manager.LldbEvent; -import agent.lldb.manager.evt.AbstractLldbCompletedCommandEvent; -import agent.lldb.manager.evt.LldbProcessCreatedEvent; -import agent.lldb.manager.impl.LldbManagerImpl; - -/** - * Implementation of {@link LldbProcess#attachKernel(String)} - */ -public class LldbAttachKernelCommand extends AbstractLldbCommand { - - private LldbProcessCreatedEvent created = null; - private boolean completed = false; - - public LldbAttachKernelCommand(LldbManagerImpl manager, Map args) { - super(manager); - } - - @Override - public boolean handle(LldbEvent evt, LldbPendingCommand pending) { - if (evt instanceof AbstractLldbCompletedCommandEvent && pending.getCommand().equals(this)) { - completed = true; - } - else if (evt instanceof LldbProcessCreatedEvent) { - created = (LldbProcessCreatedEvent) evt; - } - return completed && (created != null); - } - - @Override - public SBThread complete(LldbPendingCommand pending) { - //TODO - /* - DebugProcessInfo info = created.getInfo(); - DebugThreadInfo tinfo = info.initialThreadInfo; - DebugSystemObjects so = manager.getSystemObjects(); - DebugThreadId tid = so.getThreadIdByHandle(tinfo.handle); - return manager.getThread(tid); - */ - return null; - } - - @Override - public void invoke() { - //TODO - /* - DebugClient client = manager.getClient(); - long flags = (Long) args.get("Flags"); - String options = (String) args.get("Options"); - client.attachKernel(flags, options); - */ - manager.waitForEventEx(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbCommandError.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbCommandError.java deleted file mode 100644 index fbf4ba0c76..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbCommandError.java +++ /dev/null @@ -1,59 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import agent.lldb.manager.LldbCommand; - -/** - * Exception generated by the default "^error" handler - */ -public class LldbCommandError extends RuntimeException { - /** - * - */ - private static final long serialVersionUID = -812711163503400398L; - private final Object info; - - /** - * Construct an error with the given details - * - * @param info the detail information - * @param cmd source of error - */ - public LldbCommandError(Object info, LldbCommand cmd) { - super(cmd + " caused '" + info + "'"); - this.info = info; - } - - /** - * Construct an error with the given message - * - * @param message the message - */ - public LldbCommandError(String message) { - super(message); - this.info = null; - } - - /** - * Get the details, if present - * - * @return the details, or null - */ - public Object getInfo() { - return info; - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbConsoleExecCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbConsoleExecCommand.java deleted file mode 100644 index 0b5d9dc795..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbConsoleExecCommand.java +++ /dev/null @@ -1,67 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import agent.lldb.manager.LldbEvent; -import agent.lldb.manager.evt.AbstractLldbCompletedCommandEvent; -import agent.lldb.manager.evt.LldbConsoleOutputEvent; -import agent.lldb.manager.impl.LldbManagerImpl; - -/** - * Implementation of {@link LldbManager#console(String)} and similar - */ -public class LldbConsoleExecCommand extends AbstractLldbCommand { - public enum Output { - CONSOLE, CAPTURE; - } - - private String command; - private Output to; - - public LldbConsoleExecCommand(LldbManagerImpl manager, String command, Output to) { - super(manager); - this.command = command; - this.to = to; - } - - @Override - public boolean handle(LldbEvent evt, LldbPendingCommand pending) { - if (evt instanceof AbstractLldbCompletedCommandEvent && pending.getCommand().equals(this)) { - return true; - } - else if (evt instanceof LldbConsoleOutputEvent && to == Output.CAPTURE) { - pending.steal(evt); - } - return false; - } - - @Override - public String complete(LldbPendingCommand pending) { - if (to == Output.CONSOLE) { - return null; - } - StringBuilder builder = new StringBuilder(); - for (LldbConsoleOutputEvent out : pending.findAllOf(LldbConsoleOutputEvent.class)) { - builder.append(out.getOutput()); - } - return builder.toString(); - } - - @Override - public void invoke() { - manager.getClient().execute(command); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbContinueCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbContinueCommand.java deleted file mode 100644 index 575000bbbe..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbContinueCommand.java +++ /dev/null @@ -1,74 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import SWIG.*; -import agent.lldb.manager.LldbEvent; -import agent.lldb.manager.evt.*; -import agent.lldb.manager.impl.LldbManagerImpl; -import ghidra.util.Msg; - -/** - * Implementation of {@link LldbManager#continue()} - */ -public class LldbContinueCommand extends AbstractLldbCommand { - - private SBProcess process; - - public LldbContinueCommand(LldbManagerImpl manager, SBProcess process) { - super(manager); - this.process = process; - } - - @Override - public boolean handle(LldbEvent evt, LldbPendingCommand pending) { - if (evt instanceof AbstractLldbCompletedCommandEvent && pending.getCommand().equals(this)) { - pending.claim(evt); - boolean b = evt instanceof LldbCommandErrorEvent || - !pending.findAllOf(LldbRunningEvent.class).isEmpty(); - return b; - } - else if (evt instanceof LldbRunningEvent) { - // Event happens no matter which interpreter received the command - pending.claim(evt); - boolean b = !pending.findAllOf(AbstractLldbCompletedCommandEvent.class).isEmpty(); - return b; - } - return false; - } - - @Override - public Void complete(LldbPendingCommand pending) { - /* - DebugProcessInfo info = created.getInfo(); - DebugThreadInfo tinfo = info.initialThreadInfo; - DebugSystemObjects so = manager.getSystemObjects(); - DebugThreadId tid = so.getThreadIdByHandle(tinfo.handle); - return manager.getThread(tid); - */ - return null; - } - - @Override - public void invoke() { - SBError res = process.Continue(); - if (!res.Success()) { - SBStream stream = new SBStream(); - res.GetDescription(stream); - Msg.error(this, stream.GetData()); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbDeleteBreakpointsCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbDeleteBreakpointsCommand.java deleted file mode 100644 index 0a081ad85f..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbDeleteBreakpointsCommand.java +++ /dev/null @@ -1,57 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import SWIG.*; -import agent.lldb.manager.impl.LldbManagerImpl; - -/** - * Implementation of {@link LldbManager#deleteBreakpoints(long)} - */ -public class LldbDeleteBreakpointsCommand extends AbstractLldbCommand { - - private final String[] ids; - - public LldbDeleteBreakpointsCommand(LldbManagerImpl manager, String... ids) { - super(manager); - this.ids = ids; - } - - @Override - public Void complete(LldbPendingCommand pending) { - SBTarget currentSession = manager.getCurrentSession(); - for (String id : ids) { - manager.doBreakpointDeleted(currentSession, id, pending); - } - return null; - } - - @Override - public void invoke() { - SBTarget currentSession = manager.getCurrentSession(); - for (String id : ids) { - Object info = manager.getBreakpoint(currentSession, id); - if (info instanceof SBBreakpoint) { - SBBreakpoint bpt = (SBBreakpoint) info; - currentSession.BreakpointDelete(bpt.GetID()); - } - if (info instanceof SBWatchpoint) { - SBWatchpoint wpt = (SBWatchpoint) info; - currentSession.DeleteWatchpoint(wpt.GetID()); - } - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbDestroyCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbDestroyCommand.java deleted file mode 100644 index e4cd98e00c..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbDestroyCommand.java +++ /dev/null @@ -1,38 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import agent.lldb.lldb.DebugClient; -import agent.lldb.manager.evt.LldbProcessExitedEvent; -import agent.lldb.manager.impl.LldbManagerImpl; - -/** - * Implementation of {@link LldbManager#destroy()} - */ -public class LldbDestroyCommand extends AbstractLldbCommand { - public LldbDestroyCommand(LldbManagerImpl manager) { - super(manager); - } - - @Override - public void invoke() { - DebugClient client = manager.getClient(); - // NB: process the event before terminating - manager.processEvent(new LldbProcessExitedEvent(0)); - client.terminateCurrentProcess(); - //client.detachCurrentProcess(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbDetachCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbDetachCommand.java deleted file mode 100644 index 2975422896..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbDetachCommand.java +++ /dev/null @@ -1,51 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import SWIG.SBProcess; -import SWIG.SBThread; -import agent.lldb.lldb.DebugClient; -import agent.lldb.manager.LldbCause; -import agent.lldb.manager.impl.LldbManagerImpl; - -/** - * Implementation of {@link LldbProcess#detach()} - */ -public class LldbDetachCommand extends AbstractLldbCommand { - private final SBProcess process; - - public LldbDetachCommand(LldbManagerImpl manager, SBProcess process) { - super(manager); - this.process = process; - } - - @Override - public Void complete(LldbPendingCommand pending) { - String pid = DebugClient.getId(process); - for (int i = 0; i < process.GetNumThreads(); i++) { - SBThread t = process.GetThreadAtIndex(i); - manager.removeThread(pid, DebugClient.getId(t)); - } - manager.getEventListeners().invoke().processRemoved(pid, LldbCause.Causes.UNCLAIMED); - return null; - } - - @Override - public void invoke() { - DebugClient client = manager.getClient(); - client.detachCurrentProcess(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbDisableBreakpointsCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbDisableBreakpointsCommand.java deleted file mode 100644 index 4fd65bf5e4..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbDisableBreakpointsCommand.java +++ /dev/null @@ -1,60 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import java.util.Map; - -import SWIG.*; -import agent.lldb.manager.impl.LldbManagerImpl; - -/** - * Implementation of {@link LldbManager#deleteBreakpoints(long)} - */ -public class LldbDisableBreakpointsCommand extends AbstractLldbCommand { - - private final String[] ids; - - public LldbDisableBreakpointsCommand(LldbManagerImpl manager, String... ids) { - super(manager); - this.ids = ids; - } - - @Override - public Void complete(LldbPendingCommand pending) { - SBTarget currentSession = manager.getCurrentSession(); - for (String id : ids) { - manager.doBreakpointDisabled(currentSession, id, pending); - } - return null; - } - - @Override - public void invoke() { - Map knownBreakpoints = - manager.getKnownBreakpoints(manager.getCurrentSession()); - for (String id : ids) { - if (knownBreakpoints.containsKey(id)) { - Object obj = knownBreakpoints.get(id); - if (obj instanceof SBBreakpoint) { - ((SBBreakpoint) obj).SetEnabled(false); - } - if (obj instanceof SBWatchpoint) { - ((SBWatchpoint) obj).SetEnabled(false); - } - } - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbEnableBreakpointsCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbEnableBreakpointsCommand.java deleted file mode 100644 index 78d053bfc5..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbEnableBreakpointsCommand.java +++ /dev/null @@ -1,60 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import java.util.Map; - -import SWIG.*; -import agent.lldb.manager.impl.LldbManagerImpl; - -/** - * Implementation of {@link LldbManager#enableBreakpoints(long)} - */ -public class LldbEnableBreakpointsCommand extends AbstractLldbCommand { - - private final String[] ids; - - public LldbEnableBreakpointsCommand(LldbManagerImpl manager, String... ids) { - super(manager); - this.ids = ids; - } - - @Override - public Void complete(LldbPendingCommand pending) { - SBTarget currentSession = manager.getCurrentSession(); - for (String id : ids) { - manager.doBreakpointEnabled(currentSession, id, pending); - } - return null; - } - - @Override - public void invoke() { - Map knownBreakpoints = - manager.getKnownBreakpoints(manager.getCurrentSession()); - for (String id : ids) { - if (knownBreakpoints.containsKey(id)) { - Object obj = knownBreakpoints.get(id); - if (obj instanceof SBBreakpoint) { - ((SBBreakpoint) obj).SetEnabled(true); - } - if (obj instanceof SBWatchpoint) { - ((SBWatchpoint) obj).SetEnabled(true); - } - } - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbEvaluateCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbEvaluateCommand.java deleted file mode 100644 index 9b1e3784dd..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbEvaluateCommand.java +++ /dev/null @@ -1,41 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import agent.lldb.manager.impl.LldbManagerImpl; - -/** - * Implementation of {@link LldbProcess#evaluate(String)} - */ -public class LldbEvaluateCommand extends AbstractLldbCommand { - private final String expression; - private String result; - - public LldbEvaluateCommand(LldbManagerImpl manager, String expression) { - super(manager); - this.expression = expression; - } - - @Override - public String complete(LldbPendingCommand pending) { - return result; - } - - @Override - public void invoke() { - manager.getClient().execute(expression); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbInsertBreakpointCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbInsertBreakpointCommand.java deleted file mode 100644 index 448505d10f..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbInsertBreakpointCommand.java +++ /dev/null @@ -1,102 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import java.math.BigInteger; - -import SWIG.*; -import agent.lldb.manager.breakpoint.*; -import agent.lldb.manager.impl.LldbManagerImpl; -import ghidra.util.Msg; - -/** - * Implementation of {@link LldbBreakpointInsertions#insertBreakpoint(String)} - */ -public class LldbInsertBreakpointCommand extends AbstractLldbCommand { - //private List locations; - private final LldbBreakpointType type; - private LldbBreakpointInfo bkpt; - private int len; - private final String expression; - private final BigInteger loc; - - public LldbInsertBreakpointCommand(LldbManagerImpl manager, String expression, - LldbBreakpointType type) { - super(manager); - this.type = type; - this.expression = expression; - this.loc = null; - } - - public LldbInsertBreakpointCommand(LldbManagerImpl manager, long loc, int len, - LldbBreakpointType type) { - super(manager); - this.len = len; - this.type = type; - this.expression = null; - this.loc = BigInteger.valueOf(loc); - } - - @Override - public LldbBreakpointInfo complete(LldbPendingCommand pending) { - SBTarget currentSession = manager.getCurrentSession(); - manager.doBreakpointCreated(currentSession, bkpt.getBreakpoint(), pending); - return bkpt; - } - - @Override - public void invoke() { - SBTarget currentSession = manager.getCurrentSession(); - if (type.equals(LldbBreakpointType.BREAKPOINT) || - type.equals(LldbBreakpointType.HW_BREAKPOINT)) { - SBBreakpoint bpt; - // TODO: HW_BREAKPOINT not handled here! - if (loc != null) { - bpt = currentSession.BreakpointCreateByAddress(loc); - } - else { - bpt = currentSession.BreakpointCreateByRegex(expression); - } - bpt.SetEnabled(true); - bkpt = new LldbBreakpointInfo(bpt, manager.getCurrentProcess()); - } - else { - boolean read = true; - boolean write = true; - SBError error = new SBError(); - len = 8; - if (type.equals(LldbBreakpointType.READ_WATCHPOINT)) { - write = false; - } - if (type.equals(LldbBreakpointType.WRITE_WATCHPOINT)) { - read = false; - } - SBWatchpoint wpt = currentSession.WatchAddress(loc, len, read, write, error); - if (!error.Success()) { - SBStream stream = new SBStream(); - error.GetDescription(stream); - Msg.error(this, error.GetType() + ":" + stream.GetData()); - return; - } - if (!wpt.IsValid()) { - Msg.error(this, "Error creating watchpoint"); - return; - } - wpt.SetEnabled(true); - bkpt = new LldbBreakpointInfo(wpt, manager.getCurrentProcess()); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbKillCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbKillCommand.java deleted file mode 100644 index 9faa34c51e..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbKillCommand.java +++ /dev/null @@ -1,38 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import agent.lldb.lldb.DebugClient; -import agent.lldb.manager.evt.LldbProcessExitedEvent; -import agent.lldb.manager.impl.LldbManagerImpl; - -/** - * Implementation of {@link LldbProcess#kill()} - */ -public class LldbKillCommand extends AbstractLldbCommand { - public LldbKillCommand(LldbManagerImpl manager) { - super(manager); - } - - @Override - public void invoke() { - DebugClient client = manager.getClient(); - // NB: process the event before terminating - manager.processEvent(new LldbProcessExitedEvent(0)); - client.terminateCurrentProcess(); - //client.detachCurrentProcess(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbLaunchProcessCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbLaunchProcessCommand.java deleted file mode 100644 index 64317ee4dd..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbLaunchProcessCommand.java +++ /dev/null @@ -1,89 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import java.util.ArrayList; -import java.util.List; - -import SWIG.SBThread; -import agent.lldb.lldb.DebugClient; -import agent.lldb.manager.LldbEvent; -import agent.lldb.manager.evt.AbstractLldbCompletedCommandEvent; -import agent.lldb.manager.evt.LldbProcessCreatedEvent; -import agent.lldb.manager.impl.LldbManagerImpl; - -/** - * Implementation of {@link LldbProcess#launch(String)} - */ -public class LldbLaunchProcessCommand extends AbstractLldbCommand { - - private LldbProcessCreatedEvent created = null; - private boolean completed = false; - private String fileName; - private List args; - private List envp; - private List pathsIO; - private String wdir; - private long flags; - private boolean stopAtEntry; - - public LldbLaunchProcessCommand(LldbManagerImpl manager, String fileName, List args) { - this(manager, fileName, args, null, null, "", 0L, true); - } - - public LldbLaunchProcessCommand(LldbManagerImpl manager, String fileName, List args, - List envp, - List pathsIO, String workingDirectory, long flags, boolean stopAtEntry) { - super(manager); - this.fileName = fileName; - this.args = args == null ? new ArrayList<>() : args; - this.envp = envp == null ? new ArrayList<>() : envp; - this.pathsIO = pathsIO; - if (pathsIO == null) { - this.pathsIO = new ArrayList<>(); - this.pathsIO.add(""); - this.pathsIO.add(""); - this.pathsIO.add(""); - } - this.wdir = workingDirectory; - this.flags = flags; - this.stopAtEntry = stopAtEntry; - } - - @Override - public boolean handle(LldbEvent evt, LldbPendingCommand pending) { - if (evt instanceof AbstractLldbCompletedCommandEvent && pending.getCommand().equals(this)) { - completed = true; - } - else if (evt instanceof LldbProcessCreatedEvent) { - created = (LldbProcessCreatedEvent) evt; - } - return completed && (created != null); - } - - @Override - public SBThread complete(LldbPendingCommand pending) { - return manager.getEventThread(); - } - - @Override - public void invoke() { - DebugClient client = manager.getClient(); - //client.createProcess(client.getLocalServer(), fileName); - client.createProcess(client.getLocalServer(), fileName, args, envp, pathsIO, wdir, flags, - stopAtEntry); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbLaunchProcessWithOptionsCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbLaunchProcessWithOptionsCommand.java deleted file mode 100644 index 74f215a00d..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbLaunchProcessWithOptionsCommand.java +++ /dev/null @@ -1,122 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import java.util.*; - -import SWIG.SBThread; -import agent.lldb.lldb.DebugClient; -import agent.lldb.lldb.DebugClient.DebugCreateFlags; -import agent.lldb.manager.LldbEvent; -import agent.lldb.manager.evt.AbstractLldbCompletedCommandEvent; -import agent.lldb.manager.evt.LldbProcessCreatedEvent; -import agent.lldb.manager.impl.LldbManagerImpl; - -/** - * Implementation of {@link LldbProcess#launch(String)} - */ -public class LldbLaunchProcessWithOptionsCommand extends AbstractLldbCommand { - - private LldbProcessCreatedEvent created = null; - private boolean completed = false; - private String fileName; - private List args; - private List envp; - private List pathsIO; - private String wdir; - private long flags; - private boolean stopAtEntry; - - public LldbLaunchProcessWithOptionsCommand(LldbManagerImpl manager, Map args) { - super(manager); - this.fileName = (String) args.get("File"); - String argstr = (String) args.get("Args"); - this.args = argstr.equals("") ? new ArrayList() : Arrays.asList(argstr.split(" ")); - String envstr = (String) args.get("Env"); - this.envp = envstr.equals("") ? new ArrayList() : Arrays.asList(envstr.split(" ")); - this.pathsIO = new ArrayList<>(); - this.pathsIO.add((String)args.get("STDIN")); - this.pathsIO.add((String)args.get("STDOUT")); - this.pathsIO.add((String)args.get("STDERR")); - this.wdir = (String) args.get("Dir"); - this.flags = DebugCreateFlags.LAUNCH_DEFAULT.getMask(); - this.stopAtEntry = false; - if ((boolean) args.get("Exec")) { - flags |= DebugCreateFlags.LAUNCH_EXEC.getMask(); - } - if ((boolean) args.get("BreakOnLaunch")) { - flags |= DebugCreateFlags.LAUNCH_DEBUG.getMask(); - } - if ((boolean) args.get("BreakOnEntry")) { - flags |= DebugCreateFlags.LAUNCH_STOP_AT_ENTRY.getMask(); - stopAtEntry = true; - } - if ((boolean) args.get("ASLR")) { - flags |= DebugCreateFlags.LAUNCH_DISABLE_ASLR.getMask(); - } - if ((boolean) args.get("STDIO")) { - flags |= DebugCreateFlags.LAUNCH_DISABLE_STDIO.getMask(); - } - if ((boolean) args.get("NewTTY")) { - flags |= DebugCreateFlags.LAUNCH_IN_TTY.getMask(); - } - if ((boolean) args.get("Shell")) { - flags |= DebugCreateFlags.LAUNCH_IN_SHELL.getMask(); - } - if ((boolean) args.get("NewGroup")) { - flags |= DebugCreateFlags.LAUNCH_IN_SEP_GROUP.getMask(); - } - if ((boolean) args.get("ExitRace")) { - flags |= DebugCreateFlags.LAUNCH_DONT_SET_EXIT_STATUS.getMask(); - } - if ((boolean) args.get("Detach")) { - flags |= DebugCreateFlags.LAUNCH_DETACH_ON_ERROR.getMask(); - } - if ((boolean) args.get("ExpandArgs")) { - flags |= DebugCreateFlags.LAUNCH_SHELL_EXPAND_ARGS.getMask(); - } - if ((boolean) args.get("CloseTTY")) { - flags |= DebugCreateFlags.LAUNCH_CLOSE_TTY_ON_EXIT.getMask(); - } - if ((boolean) args.get("Inherit")) { - flags |= DebugCreateFlags.LAUNCH_INHERIT_FROM_PARENT.getMask(); - } - } - - - @Override - public boolean handle(LldbEvent evt, LldbPendingCommand pending) { - if (evt instanceof AbstractLldbCompletedCommandEvent && pending.getCommand().equals(this)) { - completed = true; - } - else if (evt instanceof LldbProcessCreatedEvent) { - created = (LldbProcessCreatedEvent) evt; - } - return completed && (created != null); - } - - @Override - public SBThread complete(LldbPendingCommand pending) { - return manager.getEventThread(); - } - - @Override - public void invoke() { - DebugClient client = manager.getClient(); - client.createProcess(client.getLocalServer(), fileName, args, envp, pathsIO, wdir, flags, - stopAtEntry); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListAvailableProcessesCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListAvailableProcessesCommand.java deleted file mode 100644 index 15dcbbfc0b..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListAvailableProcessesCommand.java +++ /dev/null @@ -1,66 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.lang3.tuple.ImmutablePair; -import org.apache.commons.lang3.tuple.Pair; - -import SWIG.SBCommandReturnObject; -import SWIG.SBDebugger; -import agent.lldb.lldb.DebugClientImpl; -import agent.lldb.manager.impl.LldbManagerImpl; -import ghidra.util.Msg; - -public class LldbListAvailableProcessesCommand - extends AbstractLldbCommand>> { - - private String output; - - public LldbListAvailableProcessesCommand(LldbManagerImpl manager) { - super(manager); - } - - @Override - public List> complete(LldbPendingCommand pending) { - List> result = new ArrayList<>(); - String[] lines = output.split("\n"); - // Skip count & header - for (int i = 3; i < lines.length; i++) { - String[] fields = lines[i].split("\\s+"); - try { - if (fields[0].matches("[0-9]+") && fields[1].matches("[0-9]+")) { - result.add(new ImmutablePair(fields[0], fields[fields.length-1])); - } - } catch (Exception e) { - Msg.error(this, e.getMessage()); - } - } - return result; - } - - @Override - public void invoke() { - DebugClientImpl client = (DebugClientImpl) manager.getClient(); - SBDebugger sbd = client.getDebugger(); - SBCommandReturnObject obj = new SBCommandReturnObject(); - sbd.GetCommandInterpreter().HandleCommand("platform process list", obj); - output = obj.GetOutput(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListBreakpointLocationsCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListBreakpointLocationsCommand.java deleted file mode 100644 index a0e3c589e2..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListBreakpointLocationsCommand.java +++ /dev/null @@ -1,54 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import java.util.HashMap; -import java.util.Map; - -import SWIG.SBBreakpoint; -import SWIG.SBBreakpointLocation; -import agent.lldb.lldb.DebugClient; -import agent.lldb.manager.impl.LldbManagerImpl; - -/** - * Implementation of {@link LldbProcess#listBreakpoints()} - */ -public class LldbListBreakpointLocationsCommand - extends AbstractLldbCommand> { - - private Map updatedLocations = new HashMap<>(); - protected final SBBreakpoint spec; - - public LldbListBreakpointLocationsCommand(LldbManagerImpl manager, SBBreakpoint spec) { - super(manager); - this.spec = spec; - } - - @Override - public Map complete(LldbPendingCommand pending) { - return updatedLocations; - } - - @Override - public void invoke() { - updatedLocations.clear(); - long n = spec.GetNumResolvedLocations(); - for (int i = 0; i < n; i++) { - SBBreakpointLocation loc = spec.GetLocationAtIndex(i); - updatedLocations.put(DebugClient.getId(loc), loc); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListBreakpointsCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListBreakpointsCommand.java deleted file mode 100644 index f04dc3a73a..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListBreakpointsCommand.java +++ /dev/null @@ -1,73 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; - -import SWIG.*; -import agent.lldb.lldb.DebugClient; -import agent.lldb.manager.impl.LldbManagerImpl; - -/** - * Implementation of {@link LldbProcess#listBreakpoints()} - */ -public class LldbListBreakpointsCommand extends AbstractLldbCommand> { - - protected final SBTarget session; - private Map updatedBreakpoints = new HashMap<>(); - - public LldbListBreakpointsCommand(LldbManagerImpl manager, SBTarget session) { - super(manager); - this.session = session; - } - - @Override - public Map complete(LldbPendingCommand pending) { - Map breakpoints = manager.getKnownBreakpoints(session); - Set cur = breakpoints.keySet(); - for (String id : updatedBreakpoints.keySet()) { - if (cur.contains(id)) { - continue; // Do nothing, we're in sync - } - manager.addBreakpointIfAbsent(session, updatedBreakpoints.get(id)); - } - for (String id : new ArrayList<>(cur)) { - if (updatedBreakpoints.containsKey(id)) { - continue; // Do nothing, we're in sync - } - manager.removeBreakpoint(session, id); - } - return manager.getKnownBreakpoints(session); - } - - @Override - public void invoke() { - updatedBreakpoints.clear(); - long n = session.GetNumBreakpoints(); - for (int i = 0; i < n; i++) { - SBBreakpoint bpt = session.GetBreakpointAtIndex(i); - updatedBreakpoints.put(DebugClient.getId(bpt), bpt); - } - n = session.GetNumWatchpoints(); - for (int i = 0; i < n; i++) { - SBWatchpoint bpt = session.GetWatchpointAtIndex(i); - updatedBreakpoints.put(DebugClient.getId(bpt), bpt); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListEnvironmentCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListEnvironmentCommand.java deleted file mode 100644 index 2eeadb57d5..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListEnvironmentCommand.java +++ /dev/null @@ -1,48 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import java.util.*; - -import SWIG.*; -import agent.lldb.manager.impl.LldbManagerImpl; - -public class LldbListEnvironmentCommand extends AbstractLldbCommand> { - - private SBTarget session; - private Map keyValues = new HashMap<>(); - - public LldbListEnvironmentCommand(LldbManagerImpl manager, SBTarget session) { - super(manager); - this.session = session; - } - - @Override - public Map complete(LldbPendingCommand pending) { - return keyValues; - } - - @Override - public void invoke() { - SBEnvironment env = session.GetEnvironment(); - for (int i = 0; i < env.GetNumValues(); i++) { - String key = env.GetNameAtIndex(i); - String value = env.GetValueAtIndex(i); - keyValues.put(key, value); - } - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListMemoryRegionsCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListMemoryRegionsCommand.java deleted file mode 100644 index 8d5d86710c..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListMemoryRegionsCommand.java +++ /dev/null @@ -1,51 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import java.util.ArrayList; -import java.util.List; - -import SWIG.*; -import agent.lldb.manager.impl.LldbManagerImpl; - -public class LldbListMemoryRegionsCommand extends AbstractLldbCommand> { - - private SBProcess process; - private List memoryRegions = new ArrayList<>(); - - public LldbListMemoryRegionsCommand(LldbManagerImpl manager, SBProcess process) { - super(manager); - this.process = process; - } - - @Override - public List complete(LldbPendingCommand pending) { - return memoryRegions; - } - - @Override - public void invoke() { - SBMemoryRegionInfoList regions = process.GetMemoryRegions(); - for (int i = 0; i < regions.GetSize(); i++) { - SBMemoryRegionInfo info = new SBMemoryRegionInfo(); - boolean success = regions.GetMemoryRegionAtIndex(i, info); - if (success) { - memoryRegions.add(info); - } - } - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListModuleSectionsCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListModuleSectionsCommand.java deleted file mode 100644 index 865fbaff22..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListModuleSectionsCommand.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import java.util.HashMap; -import java.util.Map; - -import SWIG.SBModule; -import SWIG.SBSection; -import agent.lldb.lldb.DebugClient; -import agent.lldb.manager.impl.LldbManagerImpl; - -public class LldbListModuleSectionsCommand extends AbstractLldbCommand> { - protected final SBModule module; - private Map result; - - public LldbListModuleSectionsCommand(LldbManagerImpl manager, SBModule module) { - super(manager); - this.module = module; - } - - @Override - public Map complete(LldbPendingCommand pending) { - return result; - } - - @Override - public void invoke() { - result = new HashMap<>(); - long n = module.GetNumSections(); - for (int i = 0; i < n; i++) { - SBSection section = module.GetSectionAtIndex(i); - result.put(DebugClient.getId(section), section); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListModuleSymbolsCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListModuleSymbolsCommand.java deleted file mode 100644 index 62576d0d80..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListModuleSymbolsCommand.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import java.util.HashMap; -import java.util.Map; - -import SWIG.SBModule; -import SWIG.SBSymbol; -import agent.lldb.lldb.DebugClient; -import agent.lldb.manager.impl.LldbManagerImpl; - -public class LldbListModuleSymbolsCommand extends AbstractLldbCommand> { - protected final SBModule module; - private Map result; - - public LldbListModuleSymbolsCommand(LldbManagerImpl manager, SBModule module) { - super(manager); - this.module = module; - } - - @Override - public Map complete(LldbPendingCommand pending) { - return result; - } - - @Override - public void invoke() { - result = new HashMap<>(); - long n = module.GetNumSymbols(); - for (int i = 0; i < n; i++) { - SBSymbol sym = module.GetSymbolAtIndex(i); - result.put(DebugClient.getId(sym), sym); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListModulesCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListModulesCommand.java deleted file mode 100644 index 82c1a35493..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListModulesCommand.java +++ /dev/null @@ -1,62 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import java.util.*; - -import SWIG.SBModule; -import SWIG.SBTarget; -import agent.lldb.lldb.DebugClient; -import agent.lldb.manager.impl.LldbManagerImpl; - -public class LldbListModulesCommand extends AbstractLldbCommand> { - protected final SBTarget session; - private Map updatedModules = new HashMap<>(); - - public LldbListModulesCommand(LldbManagerImpl manager, SBTarget session) { - super(manager); - this.session = session; - } - - @Override - public Map complete(LldbPendingCommand pending) { - Map modules = manager.getKnownModules(session); - Set cur = modules.keySet(); - for (String id : updatedModules.keySet()) { - if (cur.contains(id)) { - continue; // Do nothing, we're in sync - } - manager.addModuleIfAbsent(session, updatedModules.get(id)); - } - for (String id : new ArrayList<>(cur)) { - if (updatedModules.containsKey(id)) { - continue; // Do nothing, we're in sync - } - manager.removeModule(session, id); - } - return manager.getKnownModules(session); - } - - @Override - public void invoke() { - long n = session.GetNumModules(); - for (int i = 0; i < n; i++) { - SBModule module = session.GetModuleAtIndex(i); - updatedModules.put(DebugClient.getId(module), module); - } - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListProcessesCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListProcessesCommand.java deleted file mode 100644 index 1d057ab9b3..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListProcessesCommand.java +++ /dev/null @@ -1,65 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import java.util.*; - -import SWIG.SBProcess; -import SWIG.SBTarget; -import agent.lldb.lldb.DebugClient; -import agent.lldb.manager.LldbCause.Causes; -import agent.lldb.manager.LldbManager; -import agent.lldb.manager.impl.LldbManagerImpl; - -/** - * Implementation of {@link LldbManager#listProcesses()} - */ -public class LldbListProcessesCommand extends AbstractLldbCommand> { - private Map updatedProcesses; - private SBTarget session; - - public LldbListProcessesCommand(LldbManagerImpl manager, SBTarget session) { - super(manager); - this.session = session; - } - - @Override - public Map complete(LldbPendingCommand pending) { - Map allProcesses = manager.getKnownProcesses(session); - Set cur = allProcesses.keySet(); - for (String id : updatedProcesses.keySet()) { - if (cur.contains(id)) { - continue; // Do nothing, we're in sync - } - manager.addProcessIfAbsent(session, updatedProcesses.get(id)); - } - String sessionId = DebugClient.getId(session); - for (String id : new ArrayList<>(cur)) { - if (updatedProcesses.containsKey(id)) { - continue; // Do nothing, we're in sync - } - manager.removeProcess(sessionId, id, Causes.UNCLAIMED); - } - return allProcesses; - } - - @Override - public void invoke() { - SBProcess p = session.GetProcess(); - updatedProcesses = new HashMap<>(); - updatedProcesses.put(DebugClient.getId(p), p); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListSessionsCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListSessionsCommand.java deleted file mode 100644 index 57021069be..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListSessionsCommand.java +++ /dev/null @@ -1,62 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import java.util.ArrayList; -import java.util.Map; -import java.util.Set; - -import SWIG.SBTarget; -import agent.lldb.manager.LldbCause.Causes; -import agent.lldb.manager.LldbManager; -import agent.lldb.manager.impl.LldbManagerImpl; - -/** - * Implementation of {@link LldbManager#listSessions()} - */ -public class LldbListSessionsCommand extends AbstractLldbCommand> { - private Map updatedSessions; - - public LldbListSessionsCommand(LldbManagerImpl manager) { - super(manager); - } - - @Override - public Map complete(LldbPendingCommand pending) { - Map allSessions = manager.getKnownSessions(); - Set cur = allSessions.keySet(); - for (String id : updatedSessions.keySet()) { - if (cur.contains(id)) { - continue; // Do nothing, we're in sync - } - manager.addSessionIfAbsent(updatedSessions.get(id)); - } - for (String id : new ArrayList<>(cur)) { - if (updatedSessions.containsKey(id)) { - continue; // Do nothing, we're in sync - } - if (!id.equals("0") || !updatedSessions.isEmpty()) { - manager.removeSession(id, Causes.UNCLAIMED); - } - } - return allSessions; - } - - @Override - public void invoke() { - updatedSessions = manager.getClient().listSessions(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListStackFrameRegisterBanksCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListStackFrameRegisterBanksCommand.java deleted file mode 100644 index 7d846c25c6..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListStackFrameRegisterBanksCommand.java +++ /dev/null @@ -1,50 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import java.util.HashMap; -import java.util.Map; - -import SWIG.*; -import agent.lldb.lldb.DebugClient; -import agent.lldb.manager.impl.LldbManagerImpl; - -public class LldbListStackFrameRegisterBanksCommand - extends AbstractLldbCommand> { - protected final SBFrame frame; - private Map result; - - public LldbListStackFrameRegisterBanksCommand(LldbManagerImpl manager, SBFrame frame) { - super(manager); - this.frame = frame; - } - - @Override - public Map complete(LldbPendingCommand pending) { - return result; - } - - @Override - public void invoke() { - result = new HashMap<>(); - SBValueList registers = frame.GetRegisters(); - long n = registers.GetSize(); - for (int i = 0; i < n; i++) { - SBValue bank = registers.GetValueAtIndex(i); - result.put(DebugClient.getId(bank), bank); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListStackFrameRegistersCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListStackFrameRegistersCommand.java deleted file mode 100644 index e3f7c1341c..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListStackFrameRegistersCommand.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import java.util.HashMap; -import java.util.Map; - -import SWIG.DynamicValueType; -import SWIG.SBValue; -import agent.lldb.lldb.DebugClient; -import agent.lldb.manager.impl.LldbManagerImpl; - -public class LldbListStackFrameRegistersCommand extends AbstractLldbCommand> { - protected final SBValue bank; - private Map result; - - public LldbListStackFrameRegistersCommand(LldbManagerImpl manager, SBValue bank) { - super(manager); - this.bank = bank; - } - - @Override - public Map complete(LldbPendingCommand pending) { - return result; - } - - @Override - public void invoke() { - result = new HashMap<>(); - long n = bank.GetNumChildren(); - for (int i = 0; i < n; i++) { - SBValue child = bank.GetChildAtIndex(i, DynamicValueType.eDynamicCanRunTarget, true); - result.put(DebugClient.getId(child), child); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListStackFramesCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListStackFramesCommand.java deleted file mode 100644 index efa42300e0..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListStackFramesCommand.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import java.util.HashMap; -import java.util.Map; - -import SWIG.SBFrame; -import SWIG.SBThread; -import agent.lldb.lldb.DebugClient; -import agent.lldb.manager.impl.LldbManagerImpl; - -public class LldbListStackFramesCommand extends AbstractLldbCommand> { - protected final SBThread thread; - private Map result; - - public LldbListStackFramesCommand(LldbManagerImpl manager, SBThread thread) { - super(manager); - this.thread = thread; - } - - @Override - public Map complete(LldbPendingCommand pending) { - return result; - } - - @Override - public void invoke() { - result = new HashMap<>(); - long n = thread.GetNumFrames(); - for (int i = 0; i < n; i++) { - SBFrame frame = thread.GetFrameAtIndex(i); - result.put(DebugClient.getId(frame), frame); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListThreadsCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListThreadsCommand.java deleted file mode 100644 index aa43060743..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbListThreadsCommand.java +++ /dev/null @@ -1,64 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import java.util.*; - -import SWIG.SBProcess; -import SWIG.SBThread; -import agent.lldb.lldb.DebugClient; -import agent.lldb.manager.impl.LldbManagerImpl; - -public class LldbListThreadsCommand extends AbstractLldbCommand> { - - protected final SBProcess process; - private Map updatedThreadIds = new HashMap<>(); - - public LldbListThreadsCommand(LldbManagerImpl manager, SBProcess process) { - super(manager); - this.process = process; - } - - @Override - public Map complete(LldbPendingCommand pending) { - Map threads = manager.getKnownThreads(process); - Set cur = threads.keySet(); - for (String id : updatedThreadIds.keySet()) { - if (cur.contains(id)) { - continue; // Do nothing, we're in sync - } - manager.addThreadIfAbsent(process, updatedThreadIds.get(id)); - } - for (String id : new ArrayList<>(cur)) { - if (updatedThreadIds.containsKey(id)) { - continue; // Do nothing, we're in sync - } - manager.removeThread(DebugClient.getId(process), id); - } - return manager.getKnownThreads(process); - } - - @Override - public void invoke() { - updatedThreadIds.clear(); - long n = process.GetNumThreads(); - for (int i = 0; i < n; i++) { - SBThread thread = process.GetThreadAtIndex(i); - updatedThreadIds.put(DebugClient.getId(thread), thread); - } - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbOpenDumpCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbOpenDumpCommand.java deleted file mode 100644 index 4d07398da4..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbOpenDumpCommand.java +++ /dev/null @@ -1,70 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import java.util.Map; - -import SWIG.SBThread; -import agent.lldb.lldb.DebugClient; -import agent.lldb.manager.LldbEvent; -import agent.lldb.manager.evt.AbstractLldbCompletedCommandEvent; -import agent.lldb.manager.evt.LldbProcessCreatedEvent; -import agent.lldb.manager.impl.LldbManagerImpl; - -/** - * Implementation of {@link LldbProcess#openDump(String)} - */ -public class LldbOpenDumpCommand extends AbstractLldbCommand { - - private LldbProcessCreatedEvent created = null; - private boolean completed = false; - private Map args; - - public LldbOpenDumpCommand(LldbManagerImpl manager, Map args) { - super(manager); - this.args = args; - } - - @Override - public boolean handle(LldbEvent evt, LldbPendingCommand pending) { - if (evt instanceof AbstractLldbCompletedCommandEvent && pending.getCommand().equals(this)) { - completed = true; - } - else if (evt instanceof LldbProcessCreatedEvent) { - created = (LldbProcessCreatedEvent) evt; - } - return completed && (created != null); - } - - @Override - public SBThread complete(LldbPendingCommand pending) { - return null; - } - - @Override - public void invoke() { - - String f = (String) args.get("TraceOrDump"); - if (f.startsWith("/")) { - f = f.substring(1); - } - f = f.replace("/", "\\"); - - DebugClient client = manager.getClient(); - client.openDumpFileWide(f); - manager.waitForEventEx(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbPendingCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbPendingCommand.java deleted file mode 100644 index 98182670c1..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbPendingCommand.java +++ /dev/null @@ -1,211 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Set; -import java.util.concurrent.CompletableFuture; - -import agent.lldb.manager.LldbCause; -import agent.lldb.manager.LldbCommand; -import agent.lldb.manager.LldbEvent; -import agent.lldb.manager.evt.AbstractLldbCompletedCommandEvent; -import agent.lldb.manager.evt.LldbCommandErrorEvent; - -/** - * A command queued on the lldb manager - * - * A {@link LldbCommand} is queued by wrapping it in a {@link LldbPendingCommand} and submitting it - * to the manager implementation's executor. This object also keep track of claimed/stolen events - * and provides convenience methods for sifting through them. - * - * @param the type "returned" by the command - */ -public class LldbPendingCommand extends CompletableFuture implements LldbCause { - private final LldbCommand cmd; - private final Set> evts = new LinkedHashSet<>(); - - /** - * Wrap a command for execution - * - * @param cmd the command - */ - public LldbPendingCommand(LldbCommand cmd) { - this.cmd = cmd; - } - - /** - * Get the command being executed - * - * @return cmd - */ - public LldbCommand getCommand() { - return cmd; - } - - /** - * Finish the execution of this command - */ - public void finish() { - //Msg.trace(this, "Finishing " + cmd); - try { - T result = cmd.complete(this); - complete(result); - } - catch (Throwable e) { - completeExceptionally(e); - } - } - - /** - * Handle an event - * - * This gives the command implementation the first chance to claim or steal an event - * - * @param evt the event - * @return true if the command is ready to be completed - */ - public boolean handle(LldbEvent evt) { - return cmd.handle(evt, this); - } - - /** - * Claim an event - * - * This stores the event for later retrieval and processing. - * - * @param evt the event - */ - public void claim(LldbEvent evt) { - evt.claim(this); - evts.add(evt); - } - - /** - * Steal an event - * - * This stores the event for later retrieval and processing. - * - * @param evt the event - */ - public void steal(LldbEvent evt) { - claim(evt); - evt.steal(); - } - - /** - * Assume a single event of particular type was claimed/stolen, and get that event - * - * @param cls the type of the event - * @return the event cast to the type - * @throws IllegalStateException if more than one event was claimed/stolen - * @throws ClassCastException if the event cannot be cast to the given type - */ - public > E castSingleEvent(Class cls) { - if (evts.size() != 1) { - throw new IllegalStateException("Command did not claim exactly one event"); - } - return cls.cast(evts.iterator().next()); - } - - /** - * Find the first claimed/stolen event of a given type - * - * @param cls the type of the event - * @return the event cast to the type - * @throws IllegalStateException if no event of the given type was claimed/stolen - */ - public > E findFirstOf(Class cls) { - for (LldbEvent evt : evts) { - if (cls.isAssignableFrom(evt.getClass())) { - return cls.cast(evt); - } - } - throw new IllegalStateException("Command did not claim any " + cls); - } - - /** - * Find all events claimed/stolen of a given type - * - * @param cls the type of the events - * @return the list of events cast to the type - */ - public > List findAllOf(Class cls) { - List found = new ArrayList<>(); - for (LldbEvent evt : evts) { - if (cls.isAssignableFrom(evt.getClass())) { - found.add(cls.cast(evt)); - } - } - return found; - } - - /** - * Assume exactly one event of the given type was claimed/stolen, and get that event - * - * @param cls the type of the event - * @return the event cast to the type - * @throws IllegalStateException if more than one event matches - */ - public > E findSingleOf(Class cls) { - List found = findAllOf(cls); - if (found.size() != 1) { - throw new IllegalStateException( - "Command did not claim exactly one " + cls + ". Have " + evts); - } - return found.get(0); - } - - /** - * Check that the command completed with one of the given results - * - * {@link LldbCommandErrorEvent} need not be listed. This method will handle it as a special - * case already. To avoid the special treatment, list it explicitly. - * - * @param classes the completion type to accept - * @return the completion event, cast to the greatest common subclass - */ - @SafeVarargs - public final E checkCompletion( - Class... classes) { - AbstractLldbCompletedCommandEvent completion = - findSingleOf(AbstractLldbCompletedCommandEvent.class); - // Allow query for exact class to override error interpretation - for (Class cls : classes) { - if (cls == completion.getClass()) { - return cls.cast(completion); - } - } - if (completion instanceof LldbCommandErrorEvent) { - throw new LldbCommandError(completion.getInfo(), cmd); - } - for (Class cls : classes) { - if (cls.isAssignableFrom(completion.getClass())) { - return cls.cast(completion); - } - } - throw new IllegalStateException( - "Command completed with " + completion + ", not any of " + Arrays.asList(classes)); - } - - @Override - public String toString() { - return super.toString() + "(" + cmd + ")"; - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbReadMemoryCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbReadMemoryCommand.java deleted file mode 100644 index 3aa361ac49..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbReadMemoryCommand.java +++ /dev/null @@ -1,83 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import java.math.BigInteger; -import java.nio.ByteBuffer; - -import SWIG.*; -import agent.lldb.manager.impl.LldbManagerImpl; -import ghidra.program.model.address.*; -import ghidra.util.Msg; - -/** - * Implementation of {@link LldbProcess#readMemory(long, ByteBuffer, int)} - */ -public class LldbReadMemoryCommand extends AbstractLldbCommand { - - private final SBProcess process; - private final Address addr; - private final ByteBuffer buf; - private final int len; - - public LldbReadMemoryCommand(LldbManagerImpl manager, SBProcess process, Address addr, - ByteBuffer buf, int len) { - super(manager); - this.process = process; - this.addr = addr; - this.buf = buf; - this.len = len; - } - - @Override - public AddressSetView complete(LldbPendingCommand pending) { - return new AddressSet(addr, addr.add(len - 1)); - } - - @Override - public void invoke() { - BigInteger offset = addr.getOffsetAsBigInteger(); - SBError error = new SBError(); - ByteArray buffer = new ByteArray(len); - long read = process.ReadMemory(offset, buffer, len, error); - if (!error.Success()) { - SBStream stream = new SBStream(); - error.GetDescription(stream); - Msg.error(this, error.GetType() + ":" + stream.GetData()); - return; - } - for (int i = 0; i < read; i++) { - buf.put(i, buffer.getitem(i)); - } - buffer.delete(); - /* - for (int i = 0; i < len; i += 8) { - BigInteger increment = new BigInteger(Integer.toString(i)); - BigInteger res = process.ReadPointerFromMemory(offset.add(increment), error); - byte[] bytes = res.toByteArray(); - for (int j = 0; j < bytes.length; j++) { - buf.put(i + j, bytes[bytes.length - j - 1]); - } - if (!error.Success()) { - SBStream stream = new SBStream(); - error.GetDescription(stream); - Msg.error(this, error.GetType() + ":" + stream.GetData()); - break; - } - } - */ - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbRemoteConnectionCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbRemoteConnectionCommand.java deleted file mode 100644 index 2d95e93780..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbRemoteConnectionCommand.java +++ /dev/null @@ -1,85 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import java.util.LinkedHashSet; -import java.util.Set; - -import SWIG.SBThread; -import agent.lldb.lldb.DebugClient; -import agent.lldb.lldb.DebugThreadInfo; -import agent.lldb.manager.LldbEvent; -import agent.lldb.manager.evt.*; -import agent.lldb.manager.impl.LldbManagerImpl; - -/** - * Implementation of {@link LldbProcess#connect()} - */ -public class LldbRemoteConnectionCommand extends AbstractLldbCommand> { - - private LldbProcessCreatedEvent created = null; - private boolean completed = false; - private String key; - private boolean auto = true; - private boolean async = false; - private boolean kernel = false; - - public LldbRemoteConnectionCommand(LldbManagerImpl manager, String key) { - this(manager, key, true, false, false); - } - - public LldbRemoteConnectionCommand(LldbManagerImpl manager, String key, boolean auto, - boolean async, boolean kernel) { - super(manager); - this.key = key; - this.auto = auto; - this.async = async; - this.kernel = kernel; - } - - @Override - public boolean handle(LldbEvent evt, LldbPendingCommand pending) { - if (evt instanceof AbstractLldbCompletedCommandEvent && pending.getCommand().equals(this)) { - completed = true; - } - else if (evt instanceof LldbProcessCreatedEvent) { - created = (LldbProcessCreatedEvent) evt; - } - else if (evt instanceof LldbThreadCreatedEvent) { - pending.claim(evt); - } - else if (evt instanceof LldbStoppedEvent) { - pending.claim(evt); - } - return completed && (created != null); - } - - @Override - public Set complete(LldbPendingCommand pending) { - Set threads = new LinkedHashSet<>(); - for (LldbThreadCreatedEvent adds : pending.findAllOf(LldbThreadCreatedEvent.class)) { - DebugThreadInfo info = adds.getInfo(); - threads.add(info.thread); - } - return threads; - } - - @Override - public void invoke() { - DebugClient client = manager.getClient(); - client.connectRemote(client.getLocalServer(), key, auto, async, kernel); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbRemoveProcessCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbRemoveProcessCommand.java deleted file mode 100644 index ca55158584..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbRemoveProcessCommand.java +++ /dev/null @@ -1,38 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import SWIG.SBTarget; -import agent.lldb.manager.impl.LldbManagerImpl; - -/** - * Implementation of {@link LldbManager#removeProcess()} - */ -public class LldbRemoveProcessCommand extends AbstractLldbCommand { - private SBTarget session; - private String id; - - public LldbRemoveProcessCommand(LldbManagerImpl manager, SBTarget session, String id) { - super(manager); - this.session = session; - this.id = id; - } - - @Override - public void invoke() { - manager.removeProcess(manager.getProcess(session, id)); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbRequestActivationCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbRequestActivationCommand.java deleted file mode 100644 index fce3aaa743..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbRequestActivationCommand.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import agent.lldb.manager.impl.LldbManagerImpl; -import agent.lldb.model.iface1.LldbModelTargetActiveScope; -import ghidra.dbg.target.TargetObject; - -public class LldbRequestActivationCommand extends AbstractLldbCommand { - - private LldbModelTargetActiveScope activator; - private TargetObject obj; - - /** - * Set focus for the current ref - * - * @param manager the manager to execute the command - * @param activator in most cases the root object (must be an ancestor for the ref) - * @param obj the desired object to be made active - */ - public LldbRequestActivationCommand(LldbManagerImpl manager, - LldbModelTargetActiveScope activator, - TargetObject obj) { - super(manager); - this.activator = activator; - this.obj = obj; - } - - @Override - public void invoke() { - activator.doRequestActivation(obj); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbRequestFocusCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbRequestFocusCommand.java deleted file mode 100644 index f87bab9fb6..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbRequestFocusCommand.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import agent.lldb.manager.impl.LldbManagerImpl; -import agent.lldb.model.iface1.LldbModelTargetFocusScope; -import ghidra.dbg.target.TargetObject; - -public class LldbRequestFocusCommand extends AbstractLldbCommand { - - private LldbModelTargetFocusScope scope; - private TargetObject obj; - - /** - * Set focus for the current ref - * - * @param manager the manager to execute the command - * @param scope in most cases the root object (must be an ancestor for the ref) - * @param obj the desired focus - */ - public LldbRequestFocusCommand(LldbManagerImpl manager, LldbModelTargetFocusScope scope, - TargetObject obj) { - super(manager); - this.scope = scope; - this.obj = obj; - } - - @Override - public void invoke() { - scope.doRequestFocus(obj); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbRunToAddressCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbRunToAddressCommand.java deleted file mode 100644 index 0934ff5211..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbRunToAddressCommand.java +++ /dev/null @@ -1,64 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import java.math.BigInteger; - -import SWIG.*; -import agent.lldb.manager.LldbEvent; -import agent.lldb.manager.evt.*; -import agent.lldb.manager.impl.LldbManagerImpl; -import ghidra.util.Msg; - -public class LldbRunToAddressCommand extends AbstractLldbCommand { - - private SBThread thread; - private final BigInteger addr; - - public LldbRunToAddressCommand(LldbManagerImpl manager, SBThread thread, BigInteger addr) { - super(manager); - this.thread = thread; - this.addr = addr; - } - - @Override - public boolean handle(LldbEvent evt, LldbPendingCommand pending) { - if (evt instanceof AbstractLldbCompletedCommandEvent && pending.getCommand().equals(this)) { - return evt instanceof LldbCommandErrorEvent || - !pending.findAllOf(LldbRunningEvent.class).isEmpty(); - } - else if (evt instanceof LldbRunningEvent) { - // Event happens no matter which interpreter received the command - pending.claim(evt); - return !pending.findAllOf(AbstractLldbCompletedCommandEvent.class).isEmpty(); - } - return false; - } - - @Override - public void invoke() { - if (thread == null || !thread.IsValid()) { - thread = manager.getCurrentThread(); - } - SBError error = new SBError(); - thread.RunToAddress(addr, error); - if (!error.Success()) { - SBStream stream = new SBStream(); - error.GetDescription(stream); - Msg.error(this, error.GetType() + " while running to address: " + stream.GetData()); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbSetActiveProcessCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbSetActiveProcessCommand.java deleted file mode 100644 index 157b9af406..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbSetActiveProcessCommand.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import SWIG.SBDebugger; -import SWIG.SBProcess; -import agent.lldb.lldb.DebugClientImpl; -import agent.lldb.manager.impl.LldbManagerImpl; - -public class LldbSetActiveProcessCommand extends AbstractLldbCommand { - - private SBProcess process; - - /** - * Set the active process - * - * @param manager the manager to execute the command - * @param process the desired process - */ - public LldbSetActiveProcessCommand(LldbManagerImpl manager, SBProcess process) { - super(manager); - this.process = process; - } - - @Override - public void invoke() { - DebugClientImpl client = (DebugClientImpl) manager.getClient(); - SBDebugger debugger = client.getDebugger(); - if ((!client.isSessionImmutable())) { - debugger.SetSelectedTarget(process.GetTarget()); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbSetActiveSessionCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbSetActiveSessionCommand.java deleted file mode 100644 index b1d98f3af6..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbSetActiveSessionCommand.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import SWIG.SBDebugger; -import SWIG.SBTarget; -import agent.lldb.lldb.DebugClientImpl; -import agent.lldb.manager.impl.LldbManagerImpl; - -public class LldbSetActiveSessionCommand extends AbstractLldbCommand { - private SBTarget session; - - /** - * Set the active session - * - * @param manager the manager to execute the command - * @param process the desired process - */ - public LldbSetActiveSessionCommand(LldbManagerImpl manager, SBTarget session) { - super(manager); - this.session = session; - } - - @Override - public void invoke() { - DebugClientImpl client = (DebugClientImpl) manager.getClient(); - SBDebugger debugger = client.getDebugger(); - if (!client.isSessionImmutable()) { - debugger.SetSelectedTarget(session); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbSetActiveThreadCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbSetActiveThreadCommand.java deleted file mode 100644 index 681e01a2fd..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbSetActiveThreadCommand.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import SWIG.SBThread; -import agent.lldb.manager.impl.LldbManagerImpl; - -public class LldbSetActiveThreadCommand extends AbstractLldbCommand { - - private SBThread thread; - private long frameId; - - /** - * Set the active thread - * - * @param manager the manager to execute the command - * @param thread the desired thread - * @param frameId the desired frame level - */ - public LldbSetActiveThreadCommand(LldbManagerImpl manager, SBThread thread, long frameId) { - super(manager); - this.thread = thread; - this.frameId = frameId; - } - - @Override - public void invoke() { - manager.getCurrentProcess().SetSelectedThread(thread); - if (frameId >= 0) { - manager.getCurrentProcess().GetSelectedThread().SetSelectedFrame(frameId); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbStepCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbStepCommand.java deleted file mode 100644 index acbeefb21c..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbStepCommand.java +++ /dev/null @@ -1,110 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import java.util.Map; - -import SWIG.*; -import agent.lldb.manager.LldbEvent; -import agent.lldb.manager.evt.*; -import agent.lldb.manager.impl.LldbManagerImpl; -import ghidra.dbg.target.TargetSteppable.TargetStepKind; -import ghidra.util.Msg; - -/** - * Implementation of {@link LldbThread#stepInstruction()} - */ -public class LldbStepCommand extends AbstractLldbCommand { - - private SBThread thread; - private TargetStepKind kind; - private Map args; - private String lastCommand = ""; - - public LldbStepCommand(LldbManagerImpl manager, SBThread thread, TargetStepKind kind, - Map args) { - super(manager); - this.thread = thread; - this.kind = kind; - this.args = args; - } - - @Override - public boolean handle(LldbEvent evt, LldbPendingCommand pending) { - if (evt instanceof AbstractLldbCompletedCommandEvent && pending.getCommand().equals(this)) { - return evt instanceof LldbCommandErrorEvent || - !pending.findAllOf(LldbRunningEvent.class).isEmpty(); - } - else if (evt instanceof LldbRunningEvent) { - // Event happens no matter which interpreter received the command - pending.claim(evt); - return !pending.findAllOf(AbstractLldbCompletedCommandEvent.class).isEmpty(); - } - return false; - } - - @Override - public void invoke() { - RunMode rm = RunMode.eOnlyThisThread; - if (thread == null || !thread.IsValid()) { - thread = manager.getCurrentThread(); - rm = RunMode.eAllThreads; - } - if (kind == null) { - kind = (TargetStepKind) args.get("Kind"); - } - SBError error = new SBError(); - switch (kind) { - case INTO: - thread.StepInstruction(false, error); - break; - case OVER: - thread.StepInstruction(true, error); - break; - case LINE: - thread.StepInto(); - break; - case OVER_LINE: - thread.StepOver(rm, error); - break; - case RETURN: - thread.StepOut(error); - break; - case FINISH: - thread.StepOutOfFrame(thread.GetSelectedFrame(), error); - break; - case EXTENDED: - manager.execute(new LldbEvaluateCommand(manager, lastCommand)); - break; - case SKIP: - default: - throw new UnsupportedOperationException("Step " + kind.name() + " not supported"); - } - if (!error.Success()) { - SBStream stream = new SBStream(); - error.GetDescription(stream); - Msg.error(this, error.GetType() + " while stepping: " + stream.GetData()); - } - } - - public String getLastCommand() { - return lastCommand; - } - - public void setLastCommand(String lastCommand) { - this.lastCommand = lastCommand; - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbThreadHoldCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbThreadHoldCommand.java deleted file mode 100644 index c7ccb58d59..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbThreadHoldCommand.java +++ /dev/null @@ -1,66 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import SWIG.SBError; -import SWIG.SBThread; -import agent.lldb.manager.impl.LldbManagerImpl; -import ghidra.util.Msg; - -public class LldbThreadHoldCommand extends AbstractLldbCommand { - - static final String FREEZE_ALL_THREADS_COMMAND = "~* f"; - static final String FREEZE_CURRENT_THREAD_COMMAND = "~. f"; - static final String UNFREEZE_CURRENT_THREAD_COMMAND = "~. u"; - static final String UNFREEZE_ALL_THREADS_COMMAND = "~* u"; - - static final String SUSPEND_ALL_THREADS_COMMAND = "~* n"; - static final String SUSPEND_CURRENT_THREAD_COMMAND = "~. n"; - static final String RESUME_CURRENT_THREAD_COMMAND = "~. m"; - static final String RESUME_ALL_THREADS_COMMAND = "~* m"; - - static final Boolean preferFreeze = true; - - private SBThread thread; - private Boolean set; - - /** - * Select the given thread - * - * @param manager the manager to execute the command - * @param thread the desired thread - * @param set hold or release - */ - public LldbThreadHoldCommand(LldbManagerImpl manager, SBThread thread, Boolean set) { - super(manager); - this.thread = thread; - this.set = set; - } - - @Override - public void invoke() { - SBError error = new SBError(); - if (set) { - thread.Suspend(error); - } - else { - thread.Resume(error); - } - if (!error.Success()) { - Msg.error(this, error.GetType() + " while placing hold"); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbWriteMemoryCommand.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbWriteMemoryCommand.java deleted file mode 100644 index 7db2f26aba..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/cmd/LldbWriteMemoryCommand.java +++ /dev/null @@ -1,63 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.cmd; - -import java.math.BigInteger; -import java.nio.ByteBuffer; - -import SWIG.*; -import agent.lldb.manager.impl.LldbManagerImpl; -import ghidra.program.model.address.Address; -import ghidra.util.Msg; - -/** - * Implementation of {@link LldbProcess#writeMemory(long, ByteBuffer, int)} - */ -public class LldbWriteMemoryCommand extends AbstractLldbCommand { - - private final SBProcess process; - private final Address addr; - private final ByteBuffer buf; - private final int len; - - public LldbWriteMemoryCommand(LldbManagerImpl manager, SBProcess process, Address addr, - ByteBuffer buf, int len) { - super(manager); - this.process = process; - this.addr = addr; - this.buf = buf.duplicate(); - this.len = len; - } - - @Override - public void invoke() { - BigInteger offset = addr.getOffsetAsBigInteger(); - byte[] byteArray = buf.array(); - ByteArray buffer = new ByteArray(len); - for (int i = 0; i < len; i++) { - buffer.setitem(i, byteArray[i]); - } - SBError error = new SBError(); - process.WriteMemory(offset, buffer, len, error); - if (!error.Success()) { - SBStream stream = new SBStream(); - error.GetDescription(stream); - Msg.error(this, error.GetType() + ":" + stream.GetData()); - } - buffer.delete(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/AbstractLldbCompletedCommandEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/AbstractLldbCompletedCommandEvent.java deleted file mode 100644 index ba17740484..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/AbstractLldbCompletedCommandEvent.java +++ /dev/null @@ -1,34 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import SWIG.StateType; - -public class AbstractLldbCompletedCommandEvent extends AbstractLldbEvent { - - public AbstractLldbCompletedCommandEvent(String message) { - super(message); - } - - public AbstractLldbCompletedCommandEvent() { - super(null); - } - - public StateType newState() { - return null; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/AbstractLldbEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/AbstractLldbEvent.java deleted file mode 100644 index 01196326b9..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/AbstractLldbEvent.java +++ /dev/null @@ -1,84 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import SWIG.StateType; -import agent.lldb.manager.LldbCause; -import agent.lldb.manager.LldbCause.Causes; -import agent.lldb.manager.LldbEvent; -import agent.lldb.manager.LldbReason; -import agent.lldb.manager.cmd.LldbPendingCommand; - -/** - * A base class for lldb events - * - * @param the type of information detailing the event - */ -public abstract class AbstractLldbEvent implements LldbEvent { - private final T info; - protected LldbCause cause = Causes.UNCLAIMED; - protected boolean stolen = false; - //protected DebugStatus status = DebugStatus.NO_CHANGE; - - /** - * Construct a new event with the given information - * - * @param info the information - */ - protected AbstractLldbEvent(T info) { - this.info = info; - } - - @Override - public T getInfo() { - return info; - } - - @Override - public void claim(LldbPendingCommand cmd) { - cause = cmd; - } - - @Override - public LldbCause getCause() { - return cause; - } - - public LldbReason getReason() { - return LldbReason.getReason(null); - } - - @Override - public void steal() { - stolen = true; - } - - @Override - public boolean isStolen() { - return stolen; - } - - @Override - public String toString() { - return "<" + getClass().getSimpleName() + " " + info + " >"; - } - - @Override - public StateType newState() { - return null; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointAutoContinueChangedEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointAutoContinueChangedEvent.java deleted file mode 100644 index 99d1971d17..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointAutoContinueChangedEvent.java +++ /dev/null @@ -1,47 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import agent.lldb.lldb.DebugBreakpointInfo; - -/** - * The event corresponding with BreakpointEventType.eBreakpointEventTypeAutoContinueChanged - */ -public class LldbBreakpointAutoContinueChangedEvent extends AbstractLldbEvent { - private final Object bkptInfo; - - /** - * Construct a new event by parsing the tail for information - * - * The breakpoint information must be specified by lldb. - * - * @param info breakpoint info - * - */ - public LldbBreakpointAutoContinueChangedEvent(DebugBreakpointInfo info) { - super(info); - this.bkptInfo = info.pt; - } - - /** - * Get the breakpoint information - * - * @return the parsed, but not processed, breakpoint information - */ - public Object getBreakpointInfo() { - return bkptInfo; - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointCommandChangedEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointCommandChangedEvent.java deleted file mode 100644 index 87a058d00e..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointCommandChangedEvent.java +++ /dev/null @@ -1,47 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import agent.lldb.lldb.DebugBreakpointInfo; - -/** - * The event corresponding with BreakpointEventType.eBreakpointEventTypeCommandChanged & WatchpointEventType.eWatchpointEventTypeCommandChanged - */ -public class LldbBreakpointCommandChangedEvent extends AbstractLldbEvent { - private final Object bkptInfo; - - /** - * Construct a new event by parsing the tail for information - * - * The breakpoint information must be specified by lldb. - * - * @param info breakpoint info - * - */ - public LldbBreakpointCommandChangedEvent(DebugBreakpointInfo info) { - super(info); - this.bkptInfo = info.pt; - } - - /** - * Get the breakpoint information - * - * @return the parsed, but not processed, breakpoint information - */ - public Object getBreakpointInfo() { - return bkptInfo; - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointConditionChangedEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointConditionChangedEvent.java deleted file mode 100644 index 85a0efe352..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointConditionChangedEvent.java +++ /dev/null @@ -1,47 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import agent.lldb.lldb.DebugBreakpointInfo; - -/** - * The event corresponding with BreakpointEventType.eBreakpointEventTypeConditionChanged & WatchpointEventType.eWatchpointEventTypeConditionChanged - */ -public class LldbBreakpointConditionChangedEvent extends AbstractLldbEvent { - private final Object bkptInfo; - - /** - * Construct a new event by parsing the tail for information - * - * The breakpoint information must be specified by lldb. - * - * @param info breakpoint info - * - */ - public LldbBreakpointConditionChangedEvent(DebugBreakpointInfo info) { - super(info); - this.bkptInfo = info.pt; - } - - /** - * Get the breakpoint information - * - * @return the parsed, but not processed, breakpoint information - */ - public Object getBreakpointInfo() { - return bkptInfo; - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointCreatedEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointCreatedEvent.java deleted file mode 100644 index 00ce87629a..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointCreatedEvent.java +++ /dev/null @@ -1,47 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import agent.lldb.lldb.DebugBreakpointInfo; - -/** - * The event corresponding with BreakpointEventType.eBreakpointEventTypeAdded & WatchpointEventType.eWatchpointEventTypeAdded - */ -public class LldbBreakpointCreatedEvent extends AbstractLldbEvent { - private final Object bkptInfo; - - /** - * Construct a new event by parsing the tail for information - * - * The breakpoint information must be specified by lldb. - * - * @param info breakpoint info - * - */ - public LldbBreakpointCreatedEvent(DebugBreakpointInfo info) { - super(info); - this.bkptInfo = info.pt; - } - - /** - * Get the breakpoint information - * - * @return the parsed, but not processed, breakpoint information - */ - public Object getBreakpointInfo() { - return bkptInfo; - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointDeletedEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointDeletedEvent.java deleted file mode 100644 index 3147ee565a..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointDeletedEvent.java +++ /dev/null @@ -1,36 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import agent.lldb.lldb.DebugBreakpointInfo; - -/** - * The event corresponding with BreakpointEventType.eBreakpointEventTypeRemoved & WatchpointEventType.eWatchpointEventTypeRemoved - */ -public class LldbBreakpointDeletedEvent extends AbstractLldbEvent { - - /** - * Construct a new event by parsing the tail for information - * - * The breakpoint number must be specified by lldb. - * - * @param info breakpoint info - */ - public LldbBreakpointDeletedEvent(DebugBreakpointInfo info) { - super(info); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointDisabledEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointDisabledEvent.java deleted file mode 100644 index 9be406b305..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointDisabledEvent.java +++ /dev/null @@ -1,47 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import agent.lldb.lldb.DebugBreakpointInfo; - -/** - * The event corresponding with BreakpointEventType.eBreakpointEventTypeDisabled & WatchpointEventType.eWatchpointEventTypeDisabled - */ -public class LldbBreakpointDisabledEvent extends AbstractLldbEvent { - private final Object bkptInfo; - - /** - * Construct a new event by parsing the tail for information - * - * The breakpoint information must be specified by lldb. - * - * @param info breakpoint info - * - */ - public LldbBreakpointDisabledEvent(DebugBreakpointInfo info) { - super(info); - this.bkptInfo = info.pt; - } - - /** - * Get the breakpoint information - * - * @return the parsed, but not processed, breakpoint information - */ - public Object getBreakpointInfo() { - return bkptInfo; - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointEnabledEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointEnabledEvent.java deleted file mode 100644 index 8a16542bda..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointEnabledEvent.java +++ /dev/null @@ -1,47 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import agent.lldb.lldb.DebugBreakpointInfo; - -/** - * The event corresponding with BreakpointEventType.eBreakpointEventTypeEnabled & WatchpointEventType.eWatchpointEventTypeEnabled - */ -public class LldbBreakpointEnabledEvent extends AbstractLldbEvent { - private final Object bkptInfo; - - /** - * Construct a new event by parsing the tail for information - * - * The breakpoint information must be specified by lldb. - * - * @param info breakpoint info - * - */ - public LldbBreakpointEnabledEvent(DebugBreakpointInfo info) { - super(info); - this.bkptInfo = info.pt; - } - - /** - * Get the breakpoint information - * - * @return the parsed, but not processed, breakpoint information - */ - public Object getBreakpointInfo() { - return bkptInfo; - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointHitEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointHitEvent.java deleted file mode 100644 index d9721bdc2a..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointHitEvent.java +++ /dev/null @@ -1,25 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import agent.lldb.lldb.DebugProcessInfo; - -public class LldbBreakpointHitEvent extends AbstractLldbEvent { - - public LldbBreakpointHitEvent(DebugProcessInfo info) { - super(info); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointIgnoreChangedEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointIgnoreChangedEvent.java deleted file mode 100644 index 6396be352a..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointIgnoreChangedEvent.java +++ /dev/null @@ -1,47 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import agent.lldb.lldb.DebugBreakpointInfo; - -/** - * The event corresponding with BreakpointEventType.eBreakpointEventTypeIgnoreChanged & WatchpointEventType.eWatchpointEventTypeIgnoreChanged - */ -public class LldbBreakpointIgnoreChangedEvent extends AbstractLldbEvent { - private final Object bkptInfo; - - /** - * Construct a new event by parsing the tail for information - * - * The breakpoint information must be specified by lldb. - * - * @param info breakpoint info - * - */ - public LldbBreakpointIgnoreChangedEvent(DebugBreakpointInfo info) { - super(info); - this.bkptInfo = info.pt; - } - - /** - * Get the breakpoint information - * - * @return the parsed, but not processed, breakpoint information - */ - public Object getBreakpointInfo() { - return bkptInfo; - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointInvalidatedEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointInvalidatedEvent.java deleted file mode 100644 index 0fc9baa470..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointInvalidatedEvent.java +++ /dev/null @@ -1,47 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import agent.lldb.lldb.DebugBreakpointInfo; - -/** - * The event corresponding with BreakpointEventType.eBreakpointEventTypeInvalidType & WatchpointEventType.eWatchpointEventTypeInvalidType - */ -public class LldbBreakpointInvalidatedEvent extends AbstractLldbEvent { - private final Object bkptInfo; - - /** - * Construct a new event by parsing the tail for information - * - * The breakpoint information must be specified by lldb. - * - * @param info breakpoint info - * - */ - public LldbBreakpointInvalidatedEvent(DebugBreakpointInfo info) { - super(info); - this.bkptInfo = info.pt; - } - - /** - * Get the breakpoint information - * - * @return the parsed, but not processed, breakpoint information - */ - public Object getBreakpointInfo() { - return bkptInfo; - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointLocationsAddedEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointLocationsAddedEvent.java deleted file mode 100644 index 36133ee2c2..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointLocationsAddedEvent.java +++ /dev/null @@ -1,47 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import agent.lldb.lldb.DebugBreakpointInfo; - -/** - * The event corresponding with BreakpointEventType.eBreakpointEventTypeLocationsAdded - */ -public class LldbBreakpointLocationsAddedEvent extends AbstractLldbEvent { - private final Object bkptInfo; - - /** - * Construct a new event by parsing the tail for information - * - * The breakpoint information must be specified by lldb. - * - * @param info breakpoint info - * - */ - public LldbBreakpointLocationsAddedEvent(DebugBreakpointInfo info) { - super(info); - this.bkptInfo = info.pt; - } - - /** - * Get the breakpoint information - * - * @return the parsed, but not processed, breakpoint information - */ - public Object getBreakpointInfo() { - return bkptInfo; - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointLocationsRemovedEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointLocationsRemovedEvent.java deleted file mode 100644 index 34d220cc2b..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointLocationsRemovedEvent.java +++ /dev/null @@ -1,47 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import agent.lldb.lldb.DebugBreakpointInfo; - -/** - * The event corresponding with BreakpointEventType.eBreakpointEventTypeLocationsRemoved - */ -public class LldbBreakpointLocationsRemovedEvent extends AbstractLldbEvent { - private final Object bkptInfo; - - /** - * Construct a new event by parsing the tail for information - * - * The breakpoint information must be specified by lldb. - * - * @param info breakpoint info - * - */ - public LldbBreakpointLocationsRemovedEvent(DebugBreakpointInfo info) { - super(info); - this.bkptInfo = info.pt; - } - - /** - * Get the breakpoint information - * - * @return the parsed, but not processed, breakpoint information - */ - public Object getBreakpointInfo() { - return bkptInfo; - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointLocationsResolvedEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointLocationsResolvedEvent.java deleted file mode 100644 index 2c42dadfda..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointLocationsResolvedEvent.java +++ /dev/null @@ -1,47 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import agent.lldb.lldb.DebugBreakpointInfo; - -/** - * The event corresponding with BreakpointEventType.eBreakpointEventTypeLocationsResolved - */ -public class LldbBreakpointLocationsResolvedEvent extends AbstractLldbEvent { - private final Object bkptInfo; - - /** - * Construct a new event by parsing the tail for information - * - * The breakpoint information must be specified by lldb. - * - * @param info breakpoint info - * - */ - public LldbBreakpointLocationsResolvedEvent(DebugBreakpointInfo info) { - super(info); - this.bkptInfo = info.pt; - } - - /** - * Get the breakpoint information - * - * @return the parsed, but not processed, breakpoint information - */ - public Object getBreakpointInfo() { - return bkptInfo; - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointModifiedEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointModifiedEvent.java deleted file mode 100644 index 47b40d7f4a..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointModifiedEvent.java +++ /dev/null @@ -1,57 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import agent.lldb.lldb.DebugBreakpointInfo; -import agent.lldb.lldb.DebugClient; - -/** - * The event corresponding with SBTarget.eBroadcastBitWatchpointChanged & SBTarget.eBroadcastBitBreakpointChanged - */ -public class LldbBreakpointModifiedEvent extends AbstractLldbEvent { - - private String id; - - /** - * Construct a new event by parsing the tail for information - * - * The breakpoint information must be specified by lldb. - * - * @param info breakpoint info - */ - public LldbBreakpointModifiedEvent(DebugBreakpointInfo info) { - super(info); - this.id = DebugClient.getId(info.pt); - } - - public LldbBreakpointModifiedEvent(String id) { - super(null); - this.id = id; - } - - /** - * Get the breakpoint information - * - * @return the parsed, but not processed, breakpoint information - */ - public DebugBreakpointInfo getBreakpointInfo() { - return getInfo(); - } - - public String getId() { - return id; - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointThreadChangedEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointThreadChangedEvent.java deleted file mode 100644 index 1a23c7bf20..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointThreadChangedEvent.java +++ /dev/null @@ -1,47 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import agent.lldb.lldb.DebugBreakpointInfo; - -/** - * The event corresponding with BreakpointEventType.eBreakpointEventTypeThreadChanged & WatchpointEventType.eWatchpointEventTypeThreadChanged - */ -public class LldbBreakpointThreadChangedEvent extends AbstractLldbEvent { - private final Object bkptInfo; - - /** - * Construct a new event by parsing the tail for information - * - * The breakpoint information must be specified by lldb. - * - * @param info breakpoint info - * - */ - public LldbBreakpointThreadChangedEvent(DebugBreakpointInfo info) { - super(info); - this.bkptInfo = info.pt; - } - - /** - * Get the breakpoint information - * - * @return the parsed, but not processed, breakpoint information - */ - public Object getBreakpointInfo() { - return bkptInfo; - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointTypeChangedEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointTypeChangedEvent.java deleted file mode 100644 index 549179ed1e..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbBreakpointTypeChangedEvent.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import agent.lldb.lldb.DebugBreakpointInfo; - -/** - * The event corresponding with WatchpointEventType.eWatchpointEventTypeTypeChanged - */ -public class LldbBreakpointTypeChangedEvent extends AbstractLldbEvent { - private final Object bkptInfo; - - /** - * The breakpoint information must be specified by lldb. - * - * @param info breakpoint info - * - */ - public LldbBreakpointTypeChangedEvent(DebugBreakpointInfo info) { - super(info); - this.bkptInfo = info.pt; - } - - /** - * Get the breakpoint information - * - * @return the parsed, but not processed, breakpoint information - */ - public Object getBreakpointInfo() { - return bkptInfo; - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbCommandDoneEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbCommandDoneEvent.java deleted file mode 100644 index 18e9bd5288..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbCommandDoneEvent.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import SWIG.StateType; -import agent.lldb.manager.LldbCommand; - -public class LldbCommandDoneEvent extends AbstractLldbCompletedCommandEvent { - - private LldbCommand cmd; - - /** - * Construct a new event, parsing the tail for information - */ - public LldbCommandDoneEvent() { - super(); - } - - public LldbCommandDoneEvent(LldbCommand cmd) { - super(cmd.toString()); - this.cmd = cmd; - } - - @Override - public StateType newState() { - return StateType.eStateStopped; - } - - public LldbCommand getCmd() { - return cmd; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbCommandErrorEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbCommandErrorEvent.java deleted file mode 100644 index 795b36881e..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbCommandErrorEvent.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import SWIG.StateType; -import agent.lldb.manager.LldbEvent; - -public class LldbCommandErrorEvent extends AbstractLldbCompletedCommandEvent { - - /** - * Construct a new event using the given error message - * - * @param message the message - * @return the new event - */ - public static LldbEvent fromMessage(String message) { - return new LldbCommandErrorEvent(message); - } - - protected LldbCommandErrorEvent() { - super(); - } - - protected LldbCommandErrorEvent(String message) { - super(message); - } - - @Override - public StateType newState() { - return StateType.eStateStopped; - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbCommandRunningEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbCommandRunningEvent.java deleted file mode 100644 index d97894b155..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbCommandRunningEvent.java +++ /dev/null @@ -1,33 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import SWIG.StateType; - -public class LldbCommandRunningEvent extends AbstractLldbCompletedCommandEvent { - - /** - * Construct a new event, parsing the tail for information - */ - public LldbCommandRunningEvent() { - super(); - } - - @Override - public StateType newState() { - return StateType.eStateRunning; - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbConsoleOutputEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbConsoleOutputEvent.java deleted file mode 100644 index d3b2d3a3bc..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbConsoleOutputEvent.java +++ /dev/null @@ -1,58 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import SWIG.SBEvent; -import SWIG.SBStream; -import agent.lldb.lldb.DebugProcessInfo; -import ghidra.util.Msg; - -/** - * The event corresponding with SBProcess.eBroadcastBitSTDERR & SBProcess.eBroadcastBitSTDOUT - */ -public class LldbConsoleOutputEvent extends AbstractLldbEvent { - - private int mask; - private String text; - - public LldbConsoleOutputEvent(DebugProcessInfo info) { - super(info); - this.mask = 0; - this.text = SBEvent.GetCStringFromEvent(info.event); - SBStream stream = new SBStream(); - boolean success = info.event.GetDescription(stream); - if (success) { - Msg.info(this, stream.GetData()); - if (text == null) { - text = stream.GetData(); - } - } - } - - public LldbConsoleOutputEvent(int mask, String text) { - super(null); - this.mask = mask; - this.text = text; - } - - public String getOutput() { - return text; - } - - public int getMask() { - return mask; - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbExceptionEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbExceptionEvent.java deleted file mode 100644 index 201a3ce2ae..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbExceptionEvent.java +++ /dev/null @@ -1,25 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import agent.lldb.lldb.DebugProcessInfo; - -public class LldbExceptionEvent extends AbstractLldbEvent { - - public LldbExceptionEvent(DebugProcessInfo info) { - super(info); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbInterruptEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbInterruptEvent.java deleted file mode 100644 index a43b02b057..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbInterruptEvent.java +++ /dev/null @@ -1,34 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import agent.lldb.lldb.DebugProcessInfo; - -/** - * The event corresponding with SBProcess.eBroadcastBitInterrupt - */ -public class LldbInterruptEvent extends AbstractLldbEvent { - - /** - * The selected target ID must be specified by lldb. - * - * @param targetID lldb-provided id - */ - public LldbInterruptEvent(DebugProcessInfo info) { - super(info); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbModuleLoadedEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbModuleLoadedEvent.java deleted file mode 100644 index c258416021..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbModuleLoadedEvent.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import agent.lldb.lldb.DebugModuleInfo; - -/** - * The event corresponding with SBTarget.eBroadcastBitModulesLoaded - */ -public class LldbModuleLoadedEvent extends AbstractLldbEvent { - - public LldbModuleLoadedEvent(DebugModuleInfo info) { - super(info); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbModuleUnloadedEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbModuleUnloadedEvent.java deleted file mode 100644 index d8c3de655d..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbModuleUnloadedEvent.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import agent.lldb.lldb.DebugModuleInfo; - -/** - * The event corresponding with SBTarget.eBroadcastBitModulesUnloaded - */ -public class LldbModuleUnloadedEvent extends AbstractLldbEvent { - - public LldbModuleUnloadedEvent(DebugModuleInfo info) { - super(info); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbProcessCreatedEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbProcessCreatedEvent.java deleted file mode 100644 index debf731e73..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbProcessCreatedEvent.java +++ /dev/null @@ -1,33 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import SWIG.StateType; -import agent.lldb.lldb.DebugProcessInfo; - -public class LldbProcessCreatedEvent extends AbstractLldbEvent { - - public LldbProcessCreatedEvent(DebugProcessInfo info) { - super(info); - } - - @Override - public StateType newState() { - DebugProcessInfo pinfo = (DebugProcessInfo) getInfo(); - return pinfo.process.GetState(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbProcessExitedEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbProcessExitedEvent.java deleted file mode 100644 index 890f22dd4b..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbProcessExitedEvent.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import SWIG.StateType; - -public class LldbProcessExitedEvent extends AbstractLldbEvent { - - public LldbProcessExitedEvent(Integer exitCode) { - super(exitCode); - } - - @Override - public StateType newState() { - return StateType.eStateExited; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbProcessReplacedEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbProcessReplacedEvent.java deleted file mode 100644 index f0d9d691c5..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbProcessReplacedEvent.java +++ /dev/null @@ -1,38 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import SWIG.StateType; -import agent.lldb.lldb.DebugProcessInfo; - -public class LldbProcessReplacedEvent extends AbstractLldbEvent { - - public LldbProcessReplacedEvent(DebugProcessInfo info) { - super(info); - } - - @Override - public StateType newState() { - // NB: it's very tempting to relay the info we have, but - // doing so fouls up a lot of the tests because the stopped - // message arrives ahead of breakpointHit - - //DebugProcessInfo pinfo = (DebugProcessInfo) getInfo(); - //return pinfo.process.GetState(); - return null; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbProcessSelectedEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbProcessSelectedEvent.java deleted file mode 100644 index 291961d764..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbProcessSelectedEvent.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import SWIG.SBProcess; -import agent.lldb.lldb.DebugClient; - -public class LldbProcessSelectedEvent extends AbstractLldbEvent { - private final String id; - private SBProcess process; - - /** - * The selected process ID must be specified by lldb. - * - * @param id lldb-defined id - */ - public LldbProcessSelectedEvent(SBProcess process) { - super(DebugClient.getId(process)); - this.process = process; - this.id = DebugClient.getId(process); - } - - /** - * Get the selected process ID - * - * @return the process ID - */ - public String getProcessId() { - return id; - } - - public SBProcess getProcess() { - return process; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbProfileDataEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbProfileDataEvent.java deleted file mode 100644 index 35571daf08..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbProfileDataEvent.java +++ /dev/null @@ -1,34 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import agent.lldb.lldb.DebugProcessInfo; - -/** - * The event corresponding with SBProcess.eBroadcastBitProfileData - */ -public class LldbProfileDataEvent extends AbstractLldbEvent { - - /** - * The selected target ID must be specified by lldb. - * - * @param targetID lldb-provided id - */ - public LldbProfileDataEvent(DebugProcessInfo info) { - super(info); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbRunningEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbRunningEvent.java deleted file mode 100644 index 0d60304ab1..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbRunningEvent.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import SWIG.StateType; - -public class LldbRunningEvent extends AbstractLldbEvent { - private final String id; - - /** - * Construct a new event, parsing the tail for information - * - * A thread ID must be specified by lldb. - * - * @param id the event info - */ - public LldbRunningEvent(String id) { - super(id); - this.id = id; - } - - /** - * Get the ID of the thread causing the event - * - * @return the thread ID - */ - public String getThreadId() { - return id; - } - - @Override - public StateType newState() { - return StateType.eStateRunning; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbSelectedFrameChangedEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbSelectedFrameChangedEvent.java deleted file mode 100644 index 3a7b831282..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbSelectedFrameChangedEvent.java +++ /dev/null @@ -1,66 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import SWIG.*; -import agent.lldb.lldb.DebugClient; -import agent.lldb.lldb.DebugThreadInfo; - -/** - * The event corresponding with SBThread.eBroadcastBitSelectedFrameChanged - */ -public class LldbSelectedFrameChangedEvent extends AbstractLldbEvent { - private final String id; - private StateType state; - private SBThread thread; - private SBFrame frame; - - /** - * The selected thread ID must be specified by lldb. - * - * @param frame - * @param id lldb-provided id - */ - public LldbSelectedFrameChangedEvent(DebugThreadInfo info) { - super(DebugClient.getId(info.thread)); - this.id = DebugClient.getId(thread); - this.state = info.thread.GetProcess().GetState(); - this.thread = info.thread; - this.frame = info.frame; - } - - /** - * Get the selected thread ID - * - * @return the thread ID - */ - public String getThreadId() { - return id; - } - - public StateType getState() { - return state; - } - - public SBThread getThread() { - return thread; - } - - public SBFrame getFrame() { - return frame; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbSessionCreatedEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbSessionCreatedEvent.java deleted file mode 100644 index a5e8116894..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbSessionCreatedEvent.java +++ /dev/null @@ -1,25 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import agent.lldb.lldb.DebugSessionInfo; - -public class LldbSessionCreatedEvent extends AbstractLldbEvent { - - public LldbSessionCreatedEvent(DebugSessionInfo info) { - super(info); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbSessionExitedEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbSessionExitedEvent.java deleted file mode 100644 index 3c09fcf269..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbSessionExitedEvent.java +++ /dev/null @@ -1,36 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import SWIG.StateType; - -public class LldbSessionExitedEvent extends AbstractLldbEvent { - - public String sessionId; - public Integer exitCode; - - public LldbSessionExitedEvent(String sessionId, Integer exitCode) { - super(exitCode); - this.sessionId = sessionId; - this.exitCode = exitCode; - } - - @Override - public StateType newState() { - return StateType.eStateExited; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbSessionReplacedEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbSessionReplacedEvent.java deleted file mode 100644 index 7d99dd1d39..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbSessionReplacedEvent.java +++ /dev/null @@ -1,26 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import agent.lldb.lldb.DebugSessionInfo; - -public class LldbSessionReplacedEvent extends AbstractLldbEvent { - - public LldbSessionReplacedEvent(DebugSessionInfo next) { - super(next); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbSessionSelectedEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbSessionSelectedEvent.java deleted file mode 100644 index acca9e6b3b..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbSessionSelectedEvent.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import SWIG.SBTarget; -import agent.lldb.lldb.DebugClient; - -public class LldbSessionSelectedEvent extends AbstractLldbEvent { - private final String id; - private SBTarget session; - - /** - * The selected session ID must be specified by lldb. - * - * @param session lldb-defined session - */ - public LldbSessionSelectedEvent(SBTarget session) { - super(DebugClient.getId(session)); - this.session = session; - this.id = DebugClient.getId(session); - } - - /** - * Get the selected session ID - * - * @return the session ID - */ - public String getSessionId() { - return id; - } - - public SBTarget getSession() { - return session; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbStateChangedEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbStateChangedEvent.java deleted file mode 100644 index cf8aac614f..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbStateChangedEvent.java +++ /dev/null @@ -1,65 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import SWIG.SBFrame; -import SWIG.SBThread; -import SWIG.StateType; -import agent.lldb.lldb.DebugProcessInfo; - -/** - * The event corresponding with SBProcess.eBroadcastBitStateChanged - */ -public class LldbStateChangedEvent extends AbstractLldbEvent { - - private long argument; - private StateType state = null; - - public LldbStateChangedEvent(DebugProcessInfo info) { - super(info); - } - - public long getArgument() { - return argument; - } - - public void setArgument(long argument) { - this.argument = argument; - } - - public SBFrame getFrame(SBThread thread) { - DebugProcessInfo info = getInfo(); - SWIG.SBEvent event = info == null ? null : info.event; - SBFrame frame = event == null ? null : SBThread.GetStackFrameFromEvent(event); - if (frame != null) { - return frame; - } - frame = thread.GetSelectedFrame(); - if (frame != null) { - return frame; - } - return thread.GetFrameAtIndex(0); - } - - @Override - public StateType newState() { - return state; - } - - public void setState(StateType state) { - this.state = state; - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbStoppedEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbStoppedEvent.java deleted file mode 100644 index 4fa4bc8885..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbStoppedEvent.java +++ /dev/null @@ -1,58 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import SWIG.*; - -public class LldbStoppedEvent extends AbstractLldbEvent { - private final String id; - - /** - * Construct a new event, parsing the tail for information - * - * A thread ID must be specified by lldb. - * - * @param id the event info - */ - public LldbStoppedEvent(String id) { - super(id); - this.id = id; - } - - /** - * Get the ID of the thread causing the event - * - * @return the thread ID - */ - public String getThreadId() { - return id; - } - - /** - * Get the current frame, if applicable - * - * @param thread the current thread - * @return the frame - */ - public SBFrame getFrame(SBThread thread) { - return null; - } - - @Override - public StateType newState() { - return StateType.eStateStopped; - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbStructuredDataEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbStructuredDataEvent.java deleted file mode 100644 index 2f1d524e0c..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbStructuredDataEvent.java +++ /dev/null @@ -1,34 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import agent.lldb.lldb.DebugProcessInfo; - -/** - * The event corresponding with SBProcess.eBroadcastBitStructuredData - */ -public class LldbStructuredDataEvent extends AbstractLldbEvent { - - /** - * The selected target ID must be specified by lldb. - * - * @param targetID lldb-provided id - */ - public LldbStructuredDataEvent(DebugProcessInfo info) { - super(info); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbSymbolsLoadedEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbSymbolsLoadedEvent.java deleted file mode 100644 index decb3e0fa8..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbSymbolsLoadedEvent.java +++ /dev/null @@ -1,34 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import agent.lldb.lldb.DebugEventInfo; - -/** - * The event corresponding with SBTarget.eBroadcastBitSymbolsLoaded - */ -public class LldbSymbolsLoadedEvent extends AbstractLldbEvent { - - /** - * The selected target ID must be specified by lldb. - * - * @param targetID lldb-provided id - */ - public LldbSymbolsLoadedEvent(DebugEventInfo info) { - super(info); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbSystemsEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbSystemsEvent.java deleted file mode 100644 index 6b19656e51..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbSystemsEvent.java +++ /dev/null @@ -1,29 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -public class LldbSystemsEvent extends AbstractLldbEvent { - - /** - * The selected target ID must be specified by lldb. - * - * @param targetID lldb-provided id - */ - public LldbSystemsEvent(Long targetID) { - super(targetID); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbThreadCreatedEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbThreadCreatedEvent.java deleted file mode 100644 index 764af3d6be..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbThreadCreatedEvent.java +++ /dev/null @@ -1,26 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import agent.lldb.lldb.DebugThreadInfo; - -public class LldbThreadCreatedEvent extends AbstractLldbEvent { - - public LldbThreadCreatedEvent(DebugThreadInfo info) { - super(info); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbThreadExitedEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbThreadExitedEvent.java deleted file mode 100644 index b414f57e0e..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbThreadExitedEvent.java +++ /dev/null @@ -1,24 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -public class LldbThreadExitedEvent extends AbstractLldbEvent { - - public LldbThreadExitedEvent(Integer exitCode) { - super(exitCode); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbThreadReplacedEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbThreadReplacedEvent.java deleted file mode 100644 index bd74d8e579..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbThreadReplacedEvent.java +++ /dev/null @@ -1,26 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import agent.lldb.lldb.DebugThreadInfo; - -public class LldbThreadReplacedEvent extends AbstractLldbEvent { - - public LldbThreadReplacedEvent(DebugThreadInfo info) { - super(info); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbThreadResumedEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbThreadResumedEvent.java deleted file mode 100644 index 7134c0b949..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbThreadResumedEvent.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import agent.lldb.lldb.DebugThreadInfo; - -/** - * The event corresponding with SBThread.eBroadcastBitThreadResumed - */ -public class LldbThreadResumedEvent extends AbstractLldbEvent { - - public LldbThreadResumedEvent(DebugThreadInfo info) { - super(info); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbThreadSelectedEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbThreadSelectedEvent.java deleted file mode 100644 index 6fec5169e8..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbThreadSelectedEvent.java +++ /dev/null @@ -1,66 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import SWIG.*; -import agent.lldb.lldb.DebugClient; -import agent.lldb.lldb.DebugThreadInfo; - -/** - * The event corresponding with SBThread.eBroadcastBitThreadSelected - */ -public class LldbThreadSelectedEvent extends AbstractLldbEvent { - private final String id; - private StateType state; - private SBThread thread; - private SBFrame frame; - - /** - * The selected thread ID must be specified by lldb. - * - * @param frame - * @param id lldb-provided id - */ - public LldbThreadSelectedEvent(DebugThreadInfo info) { - super(DebugClient.getId(info.thread)); - this.id = DebugClient.getId(info.thread); - this.state = info.thread.GetProcess().GetState(); - this.thread = info.thread; - this.frame = info.frame; - } - - /** - * Get the selected thread ID - * - * @return the thread ID - */ - public String getThreadId() { - return id; - } - - public StateType getState() { - return state; - } - - public SBThread getThread() { - return thread; - } - - public SBFrame getFrame() { - return frame; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbThreadStackChangedEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbThreadStackChangedEvent.java deleted file mode 100644 index c5a6bccb68..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbThreadStackChangedEvent.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import agent.lldb.lldb.DebugThreadInfo; - -/** - * The event corresponding with SBThread.eBroadcastBitStackChanged - */ -public class LldbThreadStackChangedEvent extends AbstractLldbEvent { - - public LldbThreadStackChangedEvent(DebugThreadInfo info) { - super(info); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbThreadSuspendedEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbThreadSuspendedEvent.java deleted file mode 100644 index edd8142b37..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbThreadSuspendedEvent.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import agent.lldb.lldb.DebugThreadInfo; - -/** - * The event corresponding with SBThread.eBroadcastBitThreadSuspended - */ -public class LldbThreadSuspendedEvent extends AbstractLldbEvent { - - public LldbThreadSuspendedEvent(DebugThreadInfo info) { - super(info); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbWatchpointHitEvent.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbWatchpointHitEvent.java deleted file mode 100644 index 29cfe42427..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/evt/LldbWatchpointHitEvent.java +++ /dev/null @@ -1,25 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.evt; - -import agent.lldb.lldb.DebugProcessInfo; - -public class LldbWatchpointHitEvent extends AbstractLldbEvent { - - public LldbWatchpointHitEvent(DebugProcessInfo info) { - super(info); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/impl/LldbDebugOutputCallbacks.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/impl/LldbDebugOutputCallbacks.java deleted file mode 100644 index c5e74611c2..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/impl/LldbDebugOutputCallbacks.java +++ /dev/null @@ -1,33 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.impl; - -import agent.lldb.lldb.DebugOutputCallbacks; -import agent.lldb.manager.evt.LldbConsoleOutputEvent; - -public class LldbDebugOutputCallbacks implements DebugOutputCallbacks { - private LldbManagerImpl manager; - - public LldbDebugOutputCallbacks(LldbManagerImpl manager) { - this.manager = manager; - } - - @Override - public void output(int mask, String text) { - manager.processEvent(new LldbConsoleOutputEvent(mask, text)); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/impl/LldbManagerImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/impl/LldbManagerImpl.java deleted file mode 100644 index 0b07a4649e..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/manager/impl/LldbManagerImpl.java +++ /dev/null @@ -1,1711 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.manager.impl; - -import static ghidra.async.AsyncUtils.*; - -import java.math.BigInteger; -import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicReference; - -import org.apache.commons.lang3.tuple.Pair; - -import SWIG.*; -import agent.lldb.gadp.impl.AbstractClientThreadExecutor; -import agent.lldb.gadp.impl.LldbClientThreadExecutor; -import agent.lldb.lldb.*; -import agent.lldb.lldb.DebugClient.DebugEndSessionFlags; -import agent.lldb.lldb.DebugClient.DebugStatus; -import agent.lldb.manager.*; -import agent.lldb.manager.LldbCause.Causes; -import agent.lldb.manager.breakpoint.LldbBreakpointInfo; -import agent.lldb.manager.breakpoint.LldbBreakpointType; -import agent.lldb.manager.cmd.*; -import agent.lldb.manager.evt.*; -import agent.lldb.model.iface1.*; -import ghidra.async.*; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.util.HandlerMap; -import ghidra.framework.OperatingSystem; -import ghidra.framework.Platform; -import ghidra.lifecycle.Internal; -import ghidra.util.Msg; -import ghidra.util.datastruct.ListenerSet; - -public class LldbManagerImpl implements LldbManager { - - static { - String libPath = System.getProperty("java.library.path"); - try { - String lldb = "lldb"; - if (Platform.CURRENT_PLATFORM.getOperatingSystem() == OperatingSystem.WINDOWS) { - lldb = "lib" + lldb; // Wow, sigh - } - System.loadLibrary(lldb); - } - catch (UnsatisfiedLinkError ule) { - Msg.error(LldbManagerImpl.class, ule.getMessage()); - Msg.error(LldbManagerImpl.class, - "liblldb not found - add relevant java.library.path to support/launch.properties"); - } - try { - System.loadLibrary("lldb-java"); - } - catch (UnsatisfiedLinkError ule) { - Msg.error(LldbManagerImpl.class, ule.getMessage()); - Msg.error(LldbManagerImpl.class, - "liblldb-java not found - add relevant java.library.path to support/launch.properties"); - } - } - - public DebugStatus status; - - protected AbstractClientThreadExecutor executor; - protected DebugClientReentrant reentrantClient; - - private List> activeCmds = new ArrayList<>(); - - protected final Map sessions = new LinkedHashMap<>(); - protected SBTarget curSession = null; - private final Map unmodifiableSessions = - Collections.unmodifiableMap(sessions); - - protected final Map> processes = new LinkedHashMap<>(); - protected final Map> threads = new LinkedHashMap<>(); - protected final Map> modules = new LinkedHashMap<>(); - private final Map> breakpoints = new LinkedHashMap<>(); - - protected final AsyncReference state = new AsyncReference<>(null); - private final HandlerMap, Void, DebugStatus> handlerMap = new HandlerMap<>(); - private final Map, DebugStatus> statusMap = new LinkedHashMap<>(); - private final ListenerSet listenersEvent = - new ListenerSet<>(LldbEventsListener.class, true); - - private SBEvent currentEvent; - private SBTarget currentSession; - private SBProcess currentProcess; - private SBThread currentThread; - private SBTarget eventSession; - private SBProcess eventProcess; - private SBThread eventThread; - private volatile boolean waiting = false; - private boolean kernelMode = false; - private CompletableFuture continuation; - - /** - * Instantiate a new manager - */ - public LldbManagerImpl() { - defaultHandlers(); - } - - /** - * Use {@link SBThreadImpl#remove()} instead - * - * @param id the thread ID to remove - */ - public void removeThread(String processId, String id) { - synchronized (threads) { - if (threads.get(processId).remove(id) == null) { - throw new IllegalArgumentException("There is no thread with id " + id); - } - } - } - - @Override - public SBThread getThread(SBProcess process, String tid) { - synchronized (threads) { - return threads.get(DebugClient.getId(process)).get(tid); - } - } - - public void addThreadIfAbsent(SBProcess process, SBThread thread) { - synchronized (threads) { - if (!process.IsValid()) { - return; - } - Map map = threads.get(DebugClient.getId(process)); - if (map == null) { - map = new HashMap<>(); - threads.put(DebugClient.getId(process), map); - } - if (thread == null) { - return; - } - String id = DebugClient.getId(thread); - SBThread pred = map.get(id); - if (!map.containsKey(id) || !thread.equals(pred)) { - if (thread.IsValid()) { - DebugThreadInfo info = new DebugThreadInfo(thread); - if (!map.containsKey(id)) { - getClient().processEvent(new LldbThreadCreatedEvent(info)); - } - else { - getClient().processEvent(new LldbThreadReplacedEvent(info)); - } - map.put(id, thread); - } - } - } - } - - /** - * Use {@link SBProcessImpl#remove(LldbCause)} instead - * - * @param id the process ID to remove - * @param cause the cause of removal - */ - @Internal - public void removeProcess(String sessionId, String id, LldbCause cause) { - synchronized (processes) { - SBProcess proc = processes.get(sessionId).remove(id); - if (proc == null) { - throw new IllegalArgumentException("There is no process with id " + id); - } - Set toRemove = new HashSet<>(); - String processId = DebugClient.getId(proc); - for (String tid : threads.get(processId).keySet()) { - SBThread thread = threads.get(processId).get(tid); - String pid = DebugClient.getId(thread.GetProcess()); - if (pid.equals(id)) { - toRemove.add(tid); - } - } - for (String tid : toRemove) { - removeThread(processId, tid); - } - getEventListeners().invoke().processRemoved(id, cause); - } - } - - @Override - public SBProcess getProcess(SBTarget session, String id) { - synchronized (processes) { - String sessionId = DebugClient.getId(session); - SBProcess result = processes.get(sessionId).get(id); - if (result == null) { - throw new IllegalArgumentException("There is no process with id " + id); - } - return result; - } - } - - public void addProcessIfAbsent(SBTarget session, SBProcess process) { - synchronized (processes) { - if (!session.IsValid()) { - return; - } - String sessionId = DebugClient.getId(session); - Map map = processes.get(sessionId); - if (map == null) { - map = new HashMap<>(); - processes.put(sessionId, map); - } - String id = DebugClient.getId(process); - SBProcess pred = map.get(id); - if (!map.containsKey(id) || !process.equals(pred)) { - if (process.IsValid()) { - DebugProcessInfo info = new DebugProcessInfo(process); - if (!map.containsKey(id)) { - getClient().processEvent(new LldbProcessCreatedEvent(info)); - map.put(id, process); - } - else { - getClient().processEvent(new LldbProcessReplacedEvent(info)); - map.put(id, process); - } - } - } - } - } - - /** - * Use {@link SBTargetImpl#remove(LldbCause)} instead - * - * @param id the session ID to remove - * @param cause the cause of removal - */ - @Internal - public void removeSession(String id, LldbCause cause) { - synchronized (sessions) { - if (sessions.remove(id) == null) { - throw new IllegalArgumentException("There is no session with id " + id); - } - getEventListeners().invoke().sessionRemoved(id, cause); - } - } - - @Override - public SBTarget getSession(String id) { - synchronized (sessions) { - SBTarget result = sessions.get(id); - if (result == null) { - throw new IllegalArgumentException("There is no session with id " + id); - } - return result; - } - } - - public void addSessionIfAbsent(SBTarget session) { - synchronized (sessions) { - this.currentSession = eventSession = session; - String id = DebugClient.getId(session); - SBTarget pred = sessions.get(id); - if (!sessions.containsKey(id) || !session.equals(pred)) { - if (session.IsValid()) { - DebugSessionInfo info = new DebugSessionInfo(session); - if (sessions.containsKey(id)) { - //removeSession(sessions.get(id)); - getClient().processEvent(new LldbSessionReplacedEvent(info)); - } - else { - getClient().processEvent(new LldbSessionCreatedEvent(info)); - } - sessions.put(id, session); - } - } - } - } - - /** - * Use {@link SBModule#remove()} instead - * - * @param id the module name to remove - */ - public void removeModule(SBTarget session, String id) { - synchronized (modules) { - if (modules.get(DebugClient.getId(session)).remove(id) == null) { - throw new IllegalArgumentException("There is no module with id " + id); - } - } - } - - @Override - public SBModule getModule(SBTarget session, String id) { - synchronized (modules) { - return modules.get(DebugClient.getId(session)).get(id); - } - } - - public void addModuleIfAbsent(SBTarget session, SBModule module) { - synchronized (modules) { - if (!session.IsValid()) { - return; - } - String sessionId = DebugClient.getId(session); - Map map = modules.get(sessionId); - if (map == null) { - map = new HashMap<>(); - modules.put(sessionId, map); - } - String id = DebugClient.getId(module); - if (!map.containsKey(id)) { - map.put(id, module); - getClient().processEvent( - new LldbModuleLoadedEvent(new DebugModuleInfo(eventProcess, module))); - } - } - } - - /** - * @param id the module name to remove - */ - public void removeBreakpoint(SBTarget session, String id) { - synchronized (breakpoints) { - String sessionId = DebugClient.getId(session); - if (breakpoints.get(sessionId).remove(id) == null) { - throw new IllegalArgumentException("There is no module with id " + id); - } - } - } - - public Object getBreakpoint(SBTarget session, String id) { - synchronized (breakpoints) { - return getKnownBreakpoints(session).get(id); - } - } - - public void addBreakpointIfAbsent(SBTarget session, Object bpt) { - synchronized (breakpoints) { - if (!session.IsValid()) { - return; - } - String sessionId = DebugClient.getId(session); - Map map = breakpoints.get(sessionId); - if (map == null) { - map = new HashMap<>(); - breakpoints.put(sessionId, map); - } - String id = DebugClient.getId(bpt); - if (!map.containsKey(id)) { - map.put(id, bpt); - getClient().processEvent( - new LldbBreakpointCreatedEvent(new DebugBreakpointInfo(null, bpt))); - } - } - } - - @Override - public Map getKnownThreads(SBProcess process) { - String processId = DebugClient.getId(process); - Map map = threads.get(processId); - if (map == null) { - map = new HashMap<>(); - threads.put(DebugClient.getId(process), map); - } - return map; - } - - @Override - public Map getKnownProcesses(SBTarget session) { - String sessionId = DebugClient.getId(session); - Map map = processes.get(sessionId); - if (map == null) { - map = new HashMap<>(); - processes.put(sessionId, map); - } - return map; - } - - @Override - public Map getKnownSessions() { - return unmodifiableSessions; - } - - @Override - public Map getKnownModules(SBTarget session) { - String sessionId = DebugClient.getId(session); - Map map = modules.get(sessionId); - if (map == null) { - map = new HashMap<>(); - modules.put(sessionId, map); - } - return map; - } - - @Override - public Map getKnownBreakpoints(SBTarget session) { - String sessionId = DebugClient.getId(session); - Map map = breakpoints.get(sessionId); - if (map == null) { - map = new HashMap<>(); - breakpoints.put(sessionId, map); - } - return map; - } - - private Object addKnownBreakpoint(SBTarget session, Object info, boolean expectExisting) { - String bptId = DebugClient.getId(info); - Object old = getKnownBreakpoints(session).put(bptId, info); - if (expectExisting && old == null) { - Msg.warn(this, "Breakpoint " + bptId + " is not known"); - } - else if (!expectExisting && old != null) { - Msg.warn(this, "Breakpoint " + bptId + " is already known"); - } - return old; - } - - private Object getKnownBreakpoint(SBTarget session, String id) { - Object info = getKnownBreakpoints(session).get(id); - if (info == null) { - Msg.warn(this, "Breakpoint " + id + " is not known"); - } - return info; - } - - private Object removeKnownBreakpoint(SBTarget session, String id) { - Object del = getKnownBreakpoints(session).remove(id); - if (del == null) { - Msg.warn(this, "Breakpoint " + id + " is not known"); - } - return del; - } - - @Override - public CompletableFuture insertBreakpoint(String loc, - LldbBreakpointType type) { - return execute(new LldbInsertBreakpointCommand(this, loc, type)); - } - - @Override - public CompletableFuture insertBreakpoint(long loc, int len, - LldbBreakpointType type) { - return execute(new LldbInsertBreakpointCommand(this, loc, len, type)); - } - - @Override - public CompletableFuture disableBreakpoints(String... ids) { - return execute(new LldbDisableBreakpointsCommand(this, ids)); - } - - @Override - public CompletableFuture enableBreakpoints(String... ids) { - return execute(new LldbEnableBreakpointsCommand(this, ids)); - } - - @Override - public CompletableFuture deleteBreakpoints(String... ids) { - return execute(new LldbDeleteBreakpointsCommand(this, ids)); - } - - @Override - public CompletableFuture> listBreakpoints(SBTarget session) { - return execute(new LldbListBreakpointsCommand(this, session)); - } - - @Override - public CompletableFuture> listBreakpointLocations( - SBBreakpoint spec) { - return execute(new LldbListBreakpointLocationsCommand(this, spec)); - } - - @Override - public CompletableFuture start(String[] args) { - state.set(null, Causes.UNCLAIMED); - boolean create = true; - if (args.length == 0) { - executor = new LldbClientThreadExecutor(() -> DebugClient.debugCreate().createClient()); - } - else { - // TODO - process args - executor = new LldbClientThreadExecutor(() -> DebugClient.debugCreate().createClient()); - create = false; - } - executor.setManager(this); - AtomicReference creat = new AtomicReference<>(create); - return sequence(TypeSpec.VOID).then(executor, (seq) -> { - doExecute(creat.get()); - seq.exit(); - }).finish().exceptionally((exc) -> { - Msg.error(this, "start failed"); - return null; - }); - } - - protected void doExecute(Boolean create) { - DebugClient client = executor.getClient(); - reentrantClient = client; - - status = client.getExecutionStatus(); - client.setOutputCallbacks(new LldbDebugOutputCallbacks(this)); - } - - @Override - public boolean isRunning() { - return !executor.isShutdown() && !executor.isTerminated(); - } - - @Override - public void terminate() { - executor.execute(100, client -> { - Msg.debug(this, "Disconnecting DebugClient from session"); - client.endSession(DebugEndSessionFlags.DEBUG_END_DISCONNECT); - //client.setOutputCallbacks(null); - }); - executor.shutdown(); - try { - executor.awaitTermination(5000, TimeUnit.MILLISECONDS); - } - catch (InterruptedException e) { - // Eh, just go on - } - } - - @Override - public void close() throws Exception { - terminate(); - } - - /** - * Schedule a command for execution - * - * @param cmd the command to execute - * @return the pending command, which acts as a future for later completion - */ - //@Override - @Override - public CompletableFuture execute(LldbCommand cmd) { - assert cmd != null; - LldbPendingCommand pcmd = new LldbPendingCommand<>(cmd); - - if (executor.isCurrentThread()) { - try { - addCommand(cmd, pcmd); - } - catch (Throwable exc) { - pcmd.completeExceptionally(exc); - } - } - else { - CompletableFuture.runAsync(() -> { - addCommand(cmd, pcmd); - }, executor).exceptionally((exc) -> { - pcmd.completeExceptionally(exc); - return null; - }); - } - return pcmd; - } - - private void addCommand(LldbCommand cmd, LldbPendingCommand pcmd) { - synchronized (this) { - if (!cmd.validInState(state.get())) { - throw new LldbCommandError("Command " + cmd + " is not valid while " + state.get()); - } - activeCmds.add(pcmd); - } - cmd.invoke(); - processEvent(new LldbCommandDoneEvent(cmd)); - } - - @Override - public DebugStatus processEvent(LldbEvent evt) { - if (state == null) { - state.set(StateType.eStateStopped, Causes.UNCLAIMED); - } - StateType newState = evt.newState(); - //System.err.println(evt+":"+newState); - if (newState != null && !(evt instanceof LldbCommandDoneEvent)) { - Msg.debug(this, evt + " transitions state to " + newState); - state.set(newState, evt.getCause()); - } - - boolean cmdFinished = false; - List> toRemove = new ArrayList>(); - for (LldbPendingCommand pcmd : activeCmds) { - cmdFinished = pcmd.handle(evt); - if (cmdFinished) { - pcmd.finish(); - toRemove.add(pcmd); - } - } - for (LldbPendingCommand pcmd : toRemove) { - activeCmds.remove(pcmd); - } - - synchronized (this) { - boolean waitState = isWaiting(); - waiting = false; - DebugStatus ret = evt.isStolen() ? null : handlerMap.handle(evt, null); - if (ret == null) { - ret = DebugStatus.NO_CHANGE; - } - waiting = ret.equals(DebugStatus.NO_DEBUGGEE) ? false : waitState; - return ret; - } - } - - @Override - public void addStateListener(LldbStateListener listener) { - state.addChangeListener(listener); - } - - @Override - public void removeStateListener(LldbStateListener listener) { - state.removeChangeListener(listener); - } - - public ListenerSet getEventListeners() { - return listenersEvent; - } - - @Override - public void addEventsListener(LldbEventsListener listener) { - getEventListeners().add(listener); - } - - @Override - public void removeEventsListener(LldbEventsListener listener) { - getEventListeners().remove(listener); - } - - private void defaultHandlers() { - handlerMap.put(LldbBreakpointHitEvent.class, this::processBreakpoint); - handlerMap.put(LldbExceptionEvent.class, this::processException); - handlerMap.put(LldbInterruptEvent.class, this::processInterrupt); - handlerMap.put(LldbThreadCreatedEvent.class, this::processThreadCreated); - handlerMap.put(LldbThreadReplacedEvent.class, this::processThreadReplaced); - handlerMap.put(LldbThreadExitedEvent.class, this::processThreadExited); - handlerMap.put(LldbThreadSelectedEvent.class, this::processThreadSelected); - handlerMap.put(LldbProcessCreatedEvent.class, this::processProcessCreated); - handlerMap.put(LldbProcessReplacedEvent.class, this::processProcessReplaced); - handlerMap.put(LldbProcessExitedEvent.class, this::processProcessExited); - handlerMap.put(LldbSessionCreatedEvent.class, this::processSessionCreated); - handlerMap.put(LldbSessionReplacedEvent.class, this::processSessionReplaced); - handlerMap.put(LldbSessionExitedEvent.class, this::processSessionExited); - handlerMap.put(LldbProcessSelectedEvent.class, this::processProcessSelected); - handlerMap.put(LldbSelectedFrameChangedEvent.class, this::processFrameSelected); - handlerMap.put(LldbModuleLoadedEvent.class, this::processModuleLoaded); - handlerMap.put(LldbModuleUnloadedEvent.class, this::processModuleUnloaded); - handlerMap.put(LldbStateChangedEvent.class, this::processStateChanged); - //handlerMap.put(LldbTargetSelectedEvent.class, this::processSessionSelected); - handlerMap.put(LldbSystemsEvent.class, this::processSystemsEvent); - handlerMap.putVoid(LldbCommandDoneEvent.class, this::processDefault); - handlerMap.putVoid(LldbStoppedEvent.class, this::processDefault); - handlerMap.putVoid(LldbRunningEvent.class, this::processDefault); - handlerMap.putVoid(LldbConsoleOutputEvent.class, this::processConsoleOutput); - handlerMap.putVoid(LldbBreakpointCreatedEvent.class, this::processBreakpointCreated); - handlerMap.putVoid(LldbBreakpointModifiedEvent.class, this::processBreakpointModified); - handlerMap.putVoid(LldbBreakpointDeletedEvent.class, this::processBreakpointDeleted); - handlerMap.putVoid(LldbBreakpointEnabledEvent.class, this::processBreakpointEnabled); - handlerMap.putVoid(LldbBreakpointDisabledEvent.class, this::processBreakpointDisabled); - handlerMap.putVoid(LldbBreakpointInvalidatedEvent.class, - this::processBreakpointInvalidated); - handlerMap.putVoid(LldbBreakpointLocationsAddedEvent.class, - this::processBreakpointLocationsAdded); - handlerMap.putVoid(LldbBreakpointLocationsResolvedEvent.class, - this::processBreakpointLocationsResolved); - handlerMap.putVoid(LldbBreakpointLocationsRemovedEvent.class, - this::processBreakpointLocationsRemoved); - handlerMap.putVoid(LldbBreakpointAutoContinueChangedEvent.class, - this::processBreakpointAutoContinueChanged); - handlerMap.putVoid(LldbBreakpointCommandChangedEvent.class, - this::processBreakpointCommandChanged); - handlerMap.putVoid(LldbBreakpointConditionChangedEvent.class, - this::processBreakpointConditionChanged); - handlerMap.putVoid(LldbBreakpointConditionChangedEvent.class, - this::processBreakpointConditionChanged); - handlerMap.putVoid(LldbBreakpointIgnoreChangedEvent.class, - this::processBreakpointIgnoreChanged); - handlerMap.putVoid(LldbBreakpointThreadChangedEvent.class, - this::processBreakpointThreadChanged); - handlerMap.putVoid(LldbBreakpointTypeChangedEvent.class, - this::processBreakpointTypeChanged); - handlerMap.putVoid(LldbProfileDataEvent.class, this::processDefault); - handlerMap.putVoid(LldbStructuredDataEvent.class, this::processDefault); - handlerMap.putVoid(LldbSymbolsLoadedEvent.class, this::processDefault); - - statusMap.put(LldbBreakpointHitEvent.class, DebugStatus.BREAK); - statusMap.put(LldbExceptionEvent.class, DebugStatus.BREAK); - statusMap.put(LldbProcessCreatedEvent.class, DebugStatus.BREAK); - statusMap.put(LldbProcessExitedEvent.class, DebugStatus.NO_DEBUGGEE); - statusMap.put(LldbStateChangedEvent.class, DebugStatus.NO_CHANGE); - statusMap.put(LldbStoppedEvent.class, DebugStatus.BREAK); - statusMap.put(LldbInterruptEvent.class, DebugStatus.BREAK); - } - - public void updateState(SBEvent event) { - DebugClientImpl client = (DebugClientImpl) executor.getClient(); - currentProcess = eventProcess = SBProcess.GetProcessFromEvent(event); - SBTarget candidateSession = SBTarget.GetTargetFromEvent(event); - if (candidateSession != null && candidateSession.IsValid()) { - currentSession = eventSession = candidateSession; - } - else { - candidateSession = currentProcess.GetTarget(); - if (candidateSession != null && candidateSession.IsValid()) { - currentSession = eventSession = candidateSession; - } - } - SBThread candidateThread = SBThread.GetThreadFromEvent(event); - if (candidateThread != null && candidateThread.IsValid()) { - currentThread = eventThread = candidateThread; - } - else { - candidateThread = currentProcess.GetSelectedThread(); - if (candidateThread != null && candidateThread.IsValid()) { - currentThread = eventThread = candidateThread; - } - } - addSessionIfAbsent(eventSession); - addProcessIfAbsent(eventSession, eventProcess); - addThreadIfAbsent(eventProcess, eventThread); - //SBStream s = new SBStream(); - //event.GetDescription(s); - //System.err.println(s.GetData()); - client.translateAndFireEvent(event); - } - - @Override - public void updateState(SBProcess process) { - currentProcess = eventProcess = process; - if (currentSession == null || !currentSession.IsValid() || - !currentSession.equals(process.GetTarget())) { - SBTarget candidateSession = currentProcess.GetTarget(); - if (candidateSession != null && candidateSession.IsValid()) { - currentSession = eventSession = candidateSession; - } - } - if (currentThread == null || !currentThread.IsValid() || - !currentThread.equals(process.GetSelectedThread())) { - SBThread candidateThread = currentProcess.GetSelectedThread(); - if (candidateThread != null && candidateThread.IsValid()) { - currentThread = eventThread = candidateThread; - } - } - addSessionIfAbsent(eventSession); - addProcessIfAbsent(eventSession, eventProcess); - addThreadIfAbsent(eventProcess, eventThread); - } - - /** - * Default handler for events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processDefault(AbstractLldbEvent evt, Void v) { - return statusMap.get(evt.getClass()); - } - - /** - * Handler for breakpoint events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processBreakpoint(LldbBreakpointHitEvent evt, Void v) { - BigInteger id = eventThread.GetStopReasonDataAtIndex(0); - for (int i = 0; i < currentSession.GetNumBreakpoints(); i++) { - SBBreakpoint bpt = currentSession.GetBreakpointAtIndex(i); - if (bpt.IsValid() && (bpt.GetID() == id.intValue())) { - getEventListeners().invoke().breakpointHit(bpt, evt.getCause()); - } - } - return statusMap.get(evt.getClass()); - } - - /** - * Handler for breakpoint events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processException(LldbExceptionEvent evt, Void v) { - /* - Integer eventId = updateState(evt); - - DebugExceptionRecord64 info = evt.getInfo(); - String key = Integer.toHexString(info.code); - if (statusByNameMap.containsKey(key)) { - return statusByNameMap.get(key); - } - */ - return statusMap.get(evt.getClass()); - } - - /** - * Handler for breakpoint events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processInterrupt(LldbInterruptEvent evt, Void v) { - return statusMap.get(evt.getClass()); - } - - /** - * Handler for thread created events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processThreadCreated(LldbThreadCreatedEvent evt, Void v) { - SBThread thread = evt.getInfo().thread; - getEventListeners().invoke().threadCreated(thread, LldbCause.Causes.UNCLAIMED); - getEventListeners().invoke().threadSelected(thread, null, evt.getCause()); - return statusMap.get(evt.getClass()); - } - - /** - * Handler for thread created events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processThreadReplaced(LldbThreadReplacedEvent evt, Void v) { - SBThread thread = evt.getInfo().thread; - getEventListeners().invoke().threadSelected(thread, null, evt.getCause()); - return statusMap.get(evt.getClass()); - } - - /** - * Handler for thread exited events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processThreadExited(LldbThreadExitedEvent evt, Void v) { - getEventListeners().invoke().threadExited(eventThread, eventProcess, evt.getCause()); - return statusMap.get(evt.getClass()); - } - - /** - * Handler for thread selected events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processThreadSelected(LldbThreadSelectedEvent evt, Void v) { - currentThread = evt.getThread(); - getEventListeners().invoke().threadSelected(currentThread, evt.getFrame(), evt.getCause()); - return statusMap.get(evt.getClass()); - } - - /** - * Handler for frame selected events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processFrameSelected(LldbSelectedFrameChangedEvent evt, Void v) { - currentThread = evt.getThread(); - getEventListeners().invoke().threadSelected(currentThread, evt.getFrame(), evt.getCause()); - return statusMap.get(evt.getClass()); - } - - /** - * Handler for process created events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processProcessCreated(LldbProcessCreatedEvent evt, Void v) { - DebugProcessInfo info = evt.getInfo(); - SBProcess proc = info.process; - getEventListeners().invoke().processAdded(proc, LldbCause.Causes.UNCLAIMED); - getEventListeners().invoke().processSelected(proc, evt.getCause()); - - SBThread thread = proc.GetSelectedThread(); - getEventListeners().invoke().threadSelected(thread, null, evt.getCause()); - return statusMap.get(evt.getClass()); - } - - /** - * Handler for process replaced events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processProcessReplaced(LldbProcessReplacedEvent evt, Void v) { - DebugProcessInfo info = evt.getInfo(); - SBProcess proc = info.process; - getEventListeners().invoke().processReplaced(proc, LldbCause.Causes.UNCLAIMED); - getEventListeners().invoke().processSelected(proc, evt.getCause()); - - SBThread thread = proc.GetSelectedThread(); - getEventListeners().invoke().threadSelected(thread, null, evt.getCause()); - return statusMap.get(evt.getClass()); - } - - /** - * Handler for process exited events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processProcessExited(LldbProcessExitedEvent evt, Void v) { - SBThread thread = getCurrentThread(); - SBProcess process = getCurrentProcess(); - getEventListeners().invoke().threadExited(thread, process, evt.getCause()); - getEventListeners().invoke().processExited(process, evt.getCause()); - getEventListeners().invoke() - .processRemoved(process.GetProcessID().toString(), evt.getCause()); - return statusMap.get(evt.getClass()); - } - - /** - * Handler for process selected events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processProcessSelected(LldbProcessSelectedEvent evt, Void v) { - currentProcess = evt.getProcess(); - getEventListeners().invoke().processSelected(currentProcess, evt.getCause()); - return statusMap.get(evt.getClass()); - } - - /** - * Handler for session created events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processSessionCreated(LldbSessionCreatedEvent evt, Void v) { - DebugSessionInfo info = evt.getInfo(); - getEventListeners().invoke().sessionAdded(info.session, LldbCause.Causes.UNCLAIMED); - getEventListeners().invoke().sessionSelected(info.session, evt.getCause()); - return statusMap.get(evt.getClass()); - } - - /** - * Handler for session replaced events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processSessionReplaced(LldbSessionReplacedEvent evt, Void v) { - DebugSessionInfo info = evt.getInfo(); - getEventListeners().invoke().sessionReplaced(info.session, LldbCause.Causes.UNCLAIMED); - getEventListeners().invoke().sessionSelected(info.session, evt.getCause()); - return statusMap.get(evt.getClass()); - } - - /** - * Handler for session exited events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processSessionExited(LldbSessionExitedEvent evt, Void v) { - removeSession(evt.sessionId, LldbCause.Causes.UNCLAIMED); - getEventListeners().invoke().sessionRemoved(evt.sessionId, evt.getCause()); - getEventListeners().invoke().threadExited(eventThread, eventProcess, evt.getCause()); - getEventListeners().invoke().processExited(eventProcess, evt.getCause()); - getEventListeners().invoke() - .processRemoved(eventProcess.GetProcessID().toString(), evt.getCause()); - return statusMap.get(evt.getClass()); - } - - /** - * Handler for module loaded events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processModuleLoaded(LldbModuleLoadedEvent evt, Void v) { - DebugModuleInfo info = evt.getInfo(); - long n = info.getNumberOfModules(); - SBProcess process = info.getProcess(); - for (int i = 0; i < n; i++) { - getEventListeners().invoke().moduleLoaded(process, info, i, evt.getCause()); - } - return statusMap.get(evt.getClass()); - } - - /** - * Handler for module unloaded events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processModuleUnloaded(LldbModuleUnloadedEvent evt, Void v) { - DebugModuleInfo info = evt.getInfo(); - long n = info.getNumberOfModules(); - SBProcess process = info.getProcess(); - for (int i = 0; i < n; i++) { - getEventListeners().invoke().moduleUnloaded(process, info, i, evt.getCause()); - } - return statusMap.get(evt.getClass()); - } - - /** - * Handler for state changed events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processStateChanged(LldbStateChangedEvent evt, Void v) { - StateType state = evt.getInfo().state; - status = DebugStatus.fromArgument(state); - - if (status.equals(DebugStatus.NO_DEBUGGEE)) { - waiting = false; - if (state.equals(StateType.eStateExited)) { - if (eventThread != null) { - processEvent(new LldbRunningEvent(DebugClient.getId(eventThread))); - } - processEvent(new LldbProcessExitedEvent(0)); - processEvent(new LldbSessionExitedEvent(DebugClient.getId(currentSession), 0)); - } - return DebugStatus.NO_DEBUGGEE; - } - if (status.equals(DebugStatus.BREAK)) { - waiting = false; - SBProcess process = getCurrentProcess(); - if (process != null) { - processEvent(new LldbProcessSelectedEvent(process)); - DebugProcessInfo info = evt.getInfo(); - StopReason stopReason = eventThread.GetStopReason(); - if (stopReason.equals(StopReason.eStopReasonThreadExiting)) { - processEvent(new LldbThreadExitedEvent(0)); - } - if (stopReason.equals(StopReason.eStopReasonBreakpoint)) { - processEvent(new LldbBreakpointHitEvent(info)); - } - if (stopReason.equals(StopReason.eStopReasonWatchpoint)) { - processEvent(new LldbWatchpointHitEvent(info)); - } - if (stopReason.equals(StopReason.eStopReasonException)) { - processEvent(new LldbExceptionEvent(info)); - } - } - DebugThreadInfo info = new DebugThreadInfo(eventThread); - processEvent(new LldbThreadSelectedEvent(info)); - processEvent(new LldbStoppedEvent(DebugClient.getId(eventThread))); - return DebugStatus.BREAK; - } - if (status.equals(DebugStatus.GO)) { - waiting = true; - if (eventThread != null) { - processEvent(new LldbRunningEvent(DebugClient.getId(eventThread))); - } - return DebugStatus.GO; - } - - waiting = false; - return DebugStatus.NO_CHANGE; - } - - /** - * Handler for session selected events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processSessionSelected(LldbSessionSelectedEvent evt, Void v) { - SBTarget session = evt.getSession(); - getEventListeners().invoke().sessionSelected(session, evt.getCause()); - return statusMap.get(evt.getClass()); - } - - /** - * Handler for systems events - * - * @param evt the event - * @param v nothing - * @return retval handling/break status - */ - protected DebugStatus processSystemsEvent(LldbSystemsEvent evt, Void v) { - return statusMap.get(evt.getClass()); - } - - protected void processConsoleOutput(LldbConsoleOutputEvent evt, Void v) { - if (evt.getOutput() != null) { - getEventListeners().invoke().consoleOutput(evt.getOutput(), evt.getMask()); - } - } - - /** - * Handler for breakpoint-created event - * - * @param evt the event - * @param v nothing - */ - protected void processBreakpointCreated(LldbBreakpointCreatedEvent evt, Void v) { - SBTarget session = getCurrentSession(); - Object info = evt.getBreakpointInfo(); - doBreakpointCreated(session, info, evt.getCause()); - } - - /** - * Handler for breakpoint-modified event - * - * @param evt the event - * @param v nothing - */ - protected void processBreakpointModified(LldbBreakpointModifiedEvent evt, Void v) { - SBTarget session = getCurrentSession(); - Object info = evt.getBreakpointInfo(); - doBreakpointModified(session, info, evt.getCause()); - } - - /** - * Handler for breakpoint-deleted event - * - * @param evt the event - * @param v nothing - */ - protected void processBreakpointDeleted(LldbBreakpointDeletedEvent evt, Void v) { - SBTarget session = getCurrentSession(); - doBreakpointDeleted(session, evt.getInfo().id, evt.getCause()); - } - - /** - * Handler for breakpoint-enable event - * - * @param evt the event - * @param v nothing - */ - protected void processBreakpointEnabled(LldbBreakpointEnabledEvent evt, Void v) { - SBTarget session = getCurrentSession(); - doBreakpointEnabled(session, evt.getInfo().id, evt.getCause()); - } - - /** - * Handler for breakpoint-deleted event - * - * @param evt the event - * @param v nothing - */ - protected void processBreakpointDisabled(LldbBreakpointDisabledEvent evt, Void v) { - SBTarget session = getCurrentSession(); - doBreakpointDisabled(session, evt.getInfo().id, evt.getCause()); - } - - /** - * Handler for breakpoint-invalidated event - * - * @param evt the event - * @param v nothing - */ - protected void processBreakpointInvalidated(LldbBreakpointInvalidatedEvent evt, Void v) { - SBTarget session = getCurrentSession(); - //TODO: not sure this is the right thing to do - doBreakpointDisabled(session, evt.getInfo().id, evt.getCause()); - } - - /** - * Handler for breakpoint-modified event - * - * @param evt the event - * @param v nothing - */ - protected void processBreakpointLocationsResolved(LldbBreakpointLocationsResolvedEvent evt, - Void v) { - SBTarget session = getCurrentSession(); - Object info = evt.getBreakpointInfo(); - doBreakpointModified(session, info, evt.getCause()); - } - - /** - * Handler for breakpoint-locations added event - * - * @param evt the event - * @param v nothing - */ - protected void processBreakpointLocationsAdded(LldbBreakpointLocationsAddedEvent evt, Void v) { - SBTarget session = getCurrentSession(); - Object info = evt.getBreakpointInfo(); - doBreakpointModified(session, info, evt.getCause()); - } - - /** - * Handler for breakpoint-locations removed event - * - * @param evt the event - * @param v nothing - */ - protected void processBreakpointLocationsRemoved(LldbBreakpointLocationsRemovedEvent evt, - Void v) { - SBTarget session = getCurrentSession(); - Object info = evt.getBreakpointInfo(); - doBreakpointModified(session, info, evt.getCause()); - } - - /** - * Handler for breakpoint-modified event - * - * @param evt the event - * @param v nothing - */ - protected void processBreakpointAutoContinueChanged(LldbBreakpointAutoContinueChangedEvent evt, - Void v) { - SBTarget session = getCurrentSession(); - Object info = evt.getBreakpointInfo(); - doBreakpointModified(session, info, evt.getCause()); - } - - /** - * Handler for breakpoint-modified event - * - * @param evt the event - * @param v nothing - */ - protected void processBreakpointCommandChanged(LldbBreakpointCommandChangedEvent evt, Void v) { - SBTarget session = getCurrentSession(); - Object info = evt.getBreakpointInfo(); - doBreakpointModified(session, info, evt.getCause()); - } - - /** - * Handler for breakpoint-modified event - * - * @param evt the event - * @param v nothing - */ - protected void processBreakpointConditionChanged(LldbBreakpointConditionChangedEvent evt, - Void v) { - SBTarget session = getCurrentSession(); - Object info = evt.getBreakpointInfo(); - doBreakpointModified(session, info, evt.getCause()); - } - - /** - * Handler for breakpoint-modified event - * - * @param evt the event - * @param v nothing - */ - protected void processBreakpointIgnoreChanged(LldbBreakpointIgnoreChangedEvent evt, Void v) { - SBTarget session = getCurrentSession(); - Object info = evt.getBreakpointInfo(); - doBreakpointModified(session, info, evt.getCause()); - } - - /** - * Handler for breakpoint-modified event - * - * @param evt the event - * @param v nothing - */ - protected void processBreakpointThreadChanged(LldbBreakpointThreadChangedEvent evt, Void v) { - SBTarget session = getCurrentSession(); - Object info = evt.getBreakpointInfo(); - doBreakpointModified(session, info, evt.getCause()); - } - - /** - * Handler for breakpoint-modified event - * - * @param evt the event - * @param v nothing - */ - protected void processBreakpointTypeChanged(LldbBreakpointTypeChangedEvent evt, Void v) { - SBTarget session = getCurrentSession(); - Object info = evt.getBreakpointInfo(); - doBreakpointModified(session, info, evt.getCause()); - } - - /** - * Fire breakpoint created event - * - * @param newInfo the new information - * @param cause the cause of the creation - */ - @Internal - public void doBreakpointCreated(SBTarget session, Object info, LldbCause cause) { - addKnownBreakpoint(session, info, false); - getEventListeners().invoke().breakpointCreated(info, cause); - } - - /** - * Fire breakpoint modified event - * - * @param newInfo the new information - * @param cause the cause of the modification - */ - @Internal - public void doBreakpointModified(SBTarget session, Object info, LldbCause cause) { - addKnownBreakpoint(session, info, true); - getEventListeners().invoke().breakpointModified(info, cause); - } - - /** - * Fire breakpoint deleted event - * - * @param number the deleted breakpoint number - * @param cause the cause of the deletion - */ - @Internal - public void doBreakpointDeleted(SBTarget session, String id, LldbCause cause) { - Object oldInfo = removeKnownBreakpoint(session, id); - if (oldInfo == null) { - return; - } - getEventListeners().invoke().breakpointDeleted(oldInfo, cause); - } - - protected void doBreakpointModifiedSameLocations(SBTarget session, Object info, - LldbCause cause) { - addKnownBreakpoint(session, info, true); - getEventListeners().invoke().breakpointModified(info, cause); - } - - @Internal - public void doBreakpointDisabled(SBTarget session, String id, LldbCause cause) { - Object info = getKnownBreakpoint(session, id); - if (info == null) { - return; - } - if (info instanceof SBBreakpoint) { - ((SBBreakpoint) info).SetEnabled(false); - } - if (info instanceof SBWatchpoint) { - ((SBWatchpoint) info).SetEnabled(false); - } - doBreakpointModifiedSameLocations(session, info, cause); - } - - @Internal - public void doBreakpointEnabled(SBTarget session, String id, LldbCause cause) { - Object info = getKnownBreakpoint(session, id); - if (info == null) { - return; - } - if (info instanceof SBBreakpoint) { - ((SBBreakpoint) info).SetEnabled(true); - } - if (info instanceof SBWatchpoint) { - ((SBWatchpoint) info).SetEnabled(true); - } - doBreakpointModifiedSameLocations(session, info, cause); - } - - @Override - public CompletableFuture> listThreads(SBProcess process) { - return execute(new LldbListThreadsCommand(this, process)); - } - - @Override - public CompletableFuture> listProcesses(SBTarget session) { - return execute(new LldbListProcessesCommand(this, session)); - } - - @Override - public CompletableFuture>> listAvailableProcesses() { - return execute(new LldbListAvailableProcessesCommand(this)); - } - - @Override - public CompletableFuture> listSessions() { - return execute(new LldbListSessionsCommand(this)); - } - - @Override - public CompletableFuture> listStackFrames(SBThread thread) { - return execute(new LldbListStackFramesCommand(this, thread)); - } - - @Override - public CompletableFuture> listStackFrameRegisterBanks(SBFrame frame) { - return execute(new LldbListStackFrameRegisterBanksCommand(this, frame)); - } - - @Override - public CompletableFuture> listStackFrameRegisters(SBValue bank) { - return execute(new LldbListStackFrameRegistersCommand(this, bank)); - } - - @Override - public CompletableFuture> listModules(SBTarget session) { - return execute(new LldbListModulesCommand(this, session)); - } - - @Override - public CompletableFuture> listModuleSections(SBModule module) { - return execute(new LldbListModuleSectionsCommand(this, module)); - } - - @Override - public CompletableFuture> listModuleSymbols(SBModule module) { - return execute(new LldbListModuleSymbolsCommand(this, module)); - } - - @Override - public CompletableFuture> listMemory(SBProcess process) { - return execute(new LldbListMemoryRegionsCommand(this, process)); - } - - @Override - public CompletableFuture> listEnvironment(SBTarget session) { - return execute(new LldbListEnvironmentCommand(this, session)); - } - - @Override - public void sendInterruptNow() { - Msg.info(this, "Interrupting"); - SBProcess proc = currentSession.GetProcess(); - if (proc.IsValid()) { - proc.SendAsyncInterrupt(); - } - else { - getClient().execute("process signal SIGINT"); - } - } - - @Override - public CompletableFuture addProcess() { - return execute(new LldbAddProcessCommand(this)); - } - - @Override - public CompletableFuture removeProcess(SBProcess process) { - return execute(new LldbRemoveProcessCommand(this, process.GetTarget(), - process.GetProcessID().toString())); - } - - @Override - public CompletableFuture addSession() { - return execute(new LldbAddSessionCommand(this)); - } - - @Override - public CompletableFuture attach(String pid) { - return execute(new LldbAttachCommand(this, pid)); - } - - @Override - public CompletableFuture attach(String name, boolean wait) { - return execute(new LldbAttachCommand(this, name, wait)); - } - - @Override - public CompletableFuture attach(String url, boolean wait, boolean async) { - return execute(new LldbAttachCommand(this, url, wait)); - } - - @Override - public CompletableFuture connect(String url, boolean auto, boolean async, boolean kernel) { - return execute(new LldbRemoteConnectionCommand(this, url, auto, async, kernel)); - } - - @Override - public CompletableFuture launch(String fileName, List args) { - return execute(new LldbLaunchProcessCommand(this, fileName, args)); - } - - @Override - public CompletableFuture launch(Map args) { - return execute(new LldbLaunchProcessWithOptionsCommand(this, args)); - } - - public CompletableFuture openFile(Map args) { - return execute(new LldbOpenDumpCommand(this, args)); - } - - public CompletableFuture attachKernel(Map args) { - setKernelMode(true); - return execute(new LldbAttachKernelCommand(this, args)); - } - - static class ExitEvent { - final Integer tid; - final long exitCode; - - public ExitEvent(Integer tid, long exitCode) { - this.tid = tid; - this.exitCode = exitCode; - } - } - - static class BreakId { - final Integer tid; - final int bpid; - - public BreakId(Integer tid, int bpid) { - this.tid = tid; - this.bpid = bpid; - } - } - - static class BreakpointTag { - long offset; - - public BreakpointTag(long offset) { - this.offset = offset; - } - } - - class SavedFocus implements AutoCloseable { - Integer tid = null; - - @Override - public void close() { - // Nothing to do - } - } - - public DebugClient getClient() { - return executor.getClient(); - } - - public SBThread getCurrentThread() { - if (currentThread != null && currentThread.IsValid()) { - return currentThread; - } - if (currentEvent != null) { - eventThread = SBThread.GetThreadFromEvent(currentEvent); - if (eventThread != null && eventThread.IsValid()) { - currentThread = eventThread; - Msg.warn(this, "defaulting to event thread"); - return currentThread; - } - } - if (currentProcess == null) { - currentProcess = eventProcess = currentSession.GetProcess(); - if (currentProcess == null) { - return null; - } - } - currentThread = currentProcess.GetSelectedThread(); - if (currentThread != null && currentThread.IsValid()) { - Msg.warn(this, "defaulting to active thread"); - return currentThread; - } - - for (int i = 0; i < currentProcess.GetNumThreads(); i++) { - SBThread thread = currentProcess.GetThreadAtIndex(i); - if (thread.IsValid()) { - Msg.warn(this, "defaulting to thread " + i); - currentThread = thread; - break; - } - } - - return currentThread; - } - - public void setCurrentThread(SBThread thread) { - currentThread = thread; - } - - public SBProcess getCurrentProcess() { - return currentProcess != null ? currentProcess : eventProcess; - } - - public SBTarget getCurrentSession() { - return currentSession != null ? currentSession : eventSession; - } - - public SBThread getEventThread() { - return eventThread; - } - - public SBProcess getEventProcess() { - return eventProcess; - } - - public SBTarget getEventSession() { - return eventSession; - } - - public CompletableFuture setActiveFrame(SBThread thread, int index) { - currentThread = thread; - return execute(new LldbSetActiveThreadCommand(this, thread, index)); - } - - public CompletableFuture setActiveThread(SBThread thread) { - currentThread = thread; - return execute(new LldbSetActiveThreadCommand(this, thread, -1L)); - } - - public CompletableFuture setActiveProcess(SBProcess process) { - currentProcess = process; - return execute(new LldbSetActiveProcessCommand(this, process)); - } - - public CompletableFuture setActiveSession(SBTarget session) { - currentSession = session; - return execute(new LldbSetActiveSessionCommand(this, session)); - } - - public CompletableFuture requestFocus(LldbModelTargetFocusScope scope, TargetObject obj) { - return execute(new LldbRequestFocusCommand(this, scope, obj)); - } - - public CompletableFuture requestActivation(LldbModelTargetActiveScope activator, - TargetObject obj) { - return execute(new LldbRequestActivationCommand(this, activator, obj)); - } - - @Override - public CompletableFuture console(String command) { - if (continuation != null) { - String prompt = command.equals("") ? LldbModelTargetInterpreter.LLDB_PROMPT : ">>>"; - getEventListeners().invoke().promptChanged(prompt); - continuation.complete(command); - setContinuation(null); - return AsyncUtils.nil(); - } - return execute( - new LldbConsoleExecCommand(this, command, LldbConsoleExecCommand.Output.CONSOLE)) - .thenApply(e -> null); - } - - @Override - public CompletableFuture consoleCapture(String command) { - return execute( - new LldbConsoleExecCommand(this, command, LldbConsoleExecCommand.Output.CAPTURE)); - } - - @Override - public StateType getState() { - if (currentProcess == null) { - return null; - } - if (currentThread != null && !currentThread.IsValid()) { - return StateType.eStateRunning; - } - return currentProcess.GetState(); - } - - @Override - public SBProcess currentProcess() { - return getCurrentProcess(); - } - - @Override - public CompletableFuture waitForEventEx() { - //System.err.println("ENTER"); - waiting = true; - SBEvent event = getClient().waitForEvent(); - //System.err.println("EXIT"); - waiting = false; - updateState(event); - return CompletableFuture.completedFuture(null); - } - - @Override - public CompletableFuture waitForPrompt() { - return CompletableFuture.completedFuture(null); - } - - public CompletableFuture> getRegisterMap(List path) { - return null; - } - - public boolean isWaiting() { - return waiting; - } - - public boolean isKernelMode() { - return kernelMode; - } - - public void setKernelMode(boolean kernelMode) { - this.kernelMode = kernelMode; - } - - public void setContinuation(CompletableFuture continuation) { - this.continuation = continuation; - } - - @Override - public DebugStatus getStatus() { - return status; - } - - @Override - public void setCurrentEvent(SBEvent evt) { - this.currentEvent = evt; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/AbstractLldbModel.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/AbstractLldbModel.java deleted file mode 100644 index 6b6af9fbc9..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/AbstractLldbModel.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model; - -import java.io.IOException; -import java.util.concurrent.CompletableFuture; - -import agent.lldb.manager.LldbManager; -import agent.lldb.model.iface2.LldbModelTargetSession; -import ghidra.dbg.agent.AbstractDebuggerObjectModel; -import ghidra.dbg.target.TargetObject; -import ghidra.program.model.address.AddressFactory; - -public abstract class AbstractLldbModel extends AbstractDebuggerObjectModel { - - public abstract LldbManager getManager(); - - public abstract CompletableFuture startLLDB(String[] args); - - public abstract boolean isRunning(); - - public abstract void terminate() throws IOException; - - public abstract AddressFactory getAddressFactory(); - - public abstract LldbModelTargetSession getSession(); - - public abstract void addModelObject(Object object, TargetObject targetObject); - - public abstract TargetObject getModelObject(Object object); - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelSelectableObject.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelSelectableObject.java deleted file mode 100644 index 42d8d40ae9..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelSelectableObject.java +++ /dev/null @@ -1,35 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface1; - -import java.util.concurrent.CompletableFuture; - -import agent.lldb.model.iface2.LldbModelTargetObject; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "SelectableObject", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(type = Void.class) - }) -public interface LldbModelSelectableObject extends LldbModelTargetObject { - - public CompletableFuture setActive(); - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetAccessConditioned.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetAccessConditioned.java deleted file mode 100644 index 2729b0087e..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetAccessConditioned.java +++ /dev/null @@ -1,36 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface1; - -import agent.lldb.model.iface2.LldbModelTargetObject; -import ghidra.dbg.target.TargetAccessConditioned; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface LldbModelTargetAccessConditioned - extends LldbModelTargetObject, TargetAccessConditioned { - - @Override - public boolean isAccessible(); - - public void setAccessible(boolean accessible); - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetActiveScope.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetActiveScope.java deleted file mode 100644 index 623708cbd7..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetActiveScope.java +++ /dev/null @@ -1,68 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface1; - -import java.util.concurrent.CompletableFuture; - -import agent.lldb.model.iface2.LldbModelTargetObject; -import ghidra.async.AsyncUtils; -import ghidra.dbg.error.DebuggerIllegalArgumentException; -import ghidra.dbg.target.TargetActiveScope; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.util.PathUtils; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface LldbModelTargetActiveScope extends LldbModelTargetObject, TargetActiveScope { - - // NB: requesActivation request change in active object - propagates down to manager - // (but, of course, may then cause change in state) - @Override - public default CompletableFuture requestActivation(TargetObject obj) { - return getModel().gateFuture(getManager().requestActivation(this, obj)); - } - - public default CompletableFuture doRequestActivation(TargetObject obj) { - if (getManager().isWaiting()) { - return AsyncUtils.nil(); - } - getModel().assertMine(TargetObject.class, obj); - if (!PathUtils.isAncestor(this.getPath(), obj.getPath())) { - throw new DebuggerIllegalArgumentException("Can only focus a successor of the scope"); - } - TargetObject cur = obj; - while (cur != null) { - if (cur instanceof LldbModelSelectableObject) { - LldbModelSelectableObject sel = (LldbModelSelectableObject) cur; - //System.err.println("requestActivation " + obj); - return sel.setActive(); - } - if (cur instanceof LldbModelTargetObject) { - LldbModelTargetObject def = (LldbModelTargetObject) cur; - cur = def.getParent(); - continue; - } - throw new AssertionError(); - } - return AsyncUtils.nil(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetAttachable.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetAttachable.java deleted file mode 100644 index 05a0070523..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetAttachable.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface1; - -import agent.lldb.model.iface2.LldbModelTargetObject; -import ghidra.dbg.target.TargetAttachable; - -/** - * An interface which indicates this object is capable of launching targets. - * - *

- * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface LldbModelTargetAttachable extends LldbModelTargetObject, TargetAttachable { - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetAttacher.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetAttacher.java deleted file mode 100644 index 7678b3aa3a..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetAttacher.java +++ /dev/null @@ -1,40 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface1; - -import java.util.concurrent.CompletableFuture; - -import agent.lldb.model.iface2.LldbModelTargetObject; -import ghidra.dbg.target.TargetAttachable; -import ghidra.dbg.target.TargetAttacher; - -/** - * An interface which indicates this object is capable of launching targets. - * - *

- * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface LldbModelTargetAttacher extends LldbModelTargetObject, TargetAttacher { - - @Override - public CompletableFuture attach(TargetAttachable attachable); - - @Override - public CompletableFuture attach(long pid); - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetConfigurable.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetConfigurable.java deleted file mode 100644 index ed3b438d62..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetConfigurable.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface1; - -import agent.lldb.model.iface2.LldbModelTargetObject; -import ghidra.dbg.target.TargetConfigurable; - -/** - * An interface which indicates this object is configurable. - * - * @param type for this - */ -public interface LldbModelTargetConfigurable extends LldbModelTargetObject, TargetConfigurable { - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetDeletable.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetDeletable.java deleted file mode 100644 index 397824e506..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetDeletable.java +++ /dev/null @@ -1,35 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface1; - -import java.util.concurrent.CompletableFuture; - -import agent.lldb.model.iface2.LldbModelTargetObject; -import ghidra.dbg.target.TargetDeletable; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface LldbModelTargetDeletable extends LldbModelTargetObject, TargetDeletable { - - @Override - public CompletableFuture delete(); - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetDetachable.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetDetachable.java deleted file mode 100644 index 7210bb24cf..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetDetachable.java +++ /dev/null @@ -1,35 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface1; - -import java.util.concurrent.CompletableFuture; - -import agent.lldb.model.iface2.LldbModelTargetObject; -import ghidra.dbg.target.TargetDetachable; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface LldbModelTargetDetachable extends LldbModelTargetObject, TargetDetachable { - - @Override - public CompletableFuture detach(); - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetEnvironment.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetEnvironment.java deleted file mode 100644 index 6938c3ff94..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetEnvironment.java +++ /dev/null @@ -1,40 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface1; - -import agent.lldb.model.iface2.LldbModelTargetObject; -import ghidra.dbg.target.TargetEnvironment; - -public interface LldbModelTargetEnvironment extends LldbModelTargetObject, TargetEnvironment { - - public void refreshInternal(); - - @Override - public default String getArchitecture() { - return getTypedAttributeNowByName(ARCH_ATTRIBUTE_NAME, String.class, ""); - } - - @Override - public default String getDebugger() { - return getTypedAttributeNowByName(DEBUGGER_ATTRIBUTE_NAME, String.class, ""); - } - - @Override - public default String getOperatingSystem() { - return getTypedAttributeNowByName(OS_ATTRIBUTE_NAME, String.class, ""); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetEventScope.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetEventScope.java deleted file mode 100644 index 6c38d3411c..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetEventScope.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface1; - -import agent.lldb.model.iface2.LldbModelTargetObject; -import ghidra.dbg.target.TargetEventScope; - -/** - * The object can emit events affecting itself and its successors - * - * @param type for this - */ -public interface LldbModelTargetEventScope extends LldbModelTargetObject, TargetEventScope { - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetExecutionStateful.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetExecutionStateful.java deleted file mode 100644 index 4d38e555a4..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetExecutionStateful.java +++ /dev/null @@ -1,44 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface1; - -import java.util.List; -import java.util.Map; - -import agent.lldb.model.iface2.LldbModelTargetObject; -import ghidra.dbg.target.TargetExecutionStateful; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface LldbModelTargetExecutionStateful - extends LldbModelTargetObject, TargetExecutionStateful { - - public default void setExecutionState(TargetExecutionState state, String reason) { - changeAttributes(List.of(), Map.of( // - STATE_ATTRIBUTE_NAME, state // - ), reason); - if (this instanceof LldbModelTargetAccessConditioned) { - LldbModelTargetAccessConditioned conditioned = (LldbModelTargetAccessConditioned) this; - conditioned.setAccessible(!state.isRunning()); - } - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetFocusScope.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetFocusScope.java deleted file mode 100644 index 489c88c2ff..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetFocusScope.java +++ /dev/null @@ -1,78 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface1; - -import java.util.concurrent.CompletableFuture; - -import agent.lldb.model.iface2.LldbModelTargetObject; -import ghidra.async.AsyncUtils; -import ghidra.dbg.error.DebuggerIllegalArgumentException; -import ghidra.dbg.target.TargetFocusScope; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.util.PathUtils; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface LldbModelTargetFocusScope extends LldbModelTargetObject, TargetFocusScope { - - @Override - public LldbModelSelectableObject getFocus(); - - // NB: setFocus changes attributes - propagates up to client - public boolean setFocus(LldbModelSelectableObject sel); - - // NB: requestFocus request change in focused object - propagates down to manager - // (but, of course, may then cause change in state) - @Override - public default CompletableFuture requestFocus(TargetObject obj) { - return getModel().gateFuture(getManager().requestFocus(this, obj)); - } - - public default CompletableFuture doRequestFocus(TargetObject obj) { - if (getManager().isWaiting()) { - return AsyncUtils.nil(); - } - getModel().assertMine(TargetObject.class, obj); - if (obj.equals(getFocus())) { - return AsyncUtils.nil(); - } - if (!PathUtils.isAncestor(this.getPath(), obj.getPath())) { - throw new DebuggerIllegalArgumentException("Can only focus a successor of the scope"); - } - TargetObject cur = obj; - while (cur != null) { - if (cur instanceof LldbModelSelectableObject) { - LldbModelSelectableObject sel = (LldbModelSelectableObject) cur; - //System.err.println("requestFocus " + obj); - setFocus(sel); - return AsyncUtils.nil(); - } - if (cur instanceof LldbModelTargetObject) { - LldbModelTargetObject def = (LldbModelTargetObject) cur; - cur = def.getParent(); - continue; - } - throw new AssertionError(); - } - return AsyncUtils.nil(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetInterpreter.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetInterpreter.java deleted file mode 100644 index d8e740046c..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetInterpreter.java +++ /dev/null @@ -1,44 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface1; - -import java.util.concurrent.CompletableFuture; - -import agent.lldb.model.iface2.LldbModelTargetObject; -import ghidra.dbg.target.TargetInterpreter; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface LldbModelTargetInterpreter extends LldbModelTargetObject, TargetInterpreter { - - public static final String LLDB_PROMPT = "(lldb)"; - - @Override - public default CompletableFuture execute(String cmd) { - return getModel().gateFuture(getManager().console(cmd)); - } - - @Override - public default CompletableFuture executeCapture(String cmd) { - return getModel().gateFuture(getManager().consoleCapture(cmd)); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetInterruptible.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetInterruptible.java deleted file mode 100644 index b3fb799feb..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetInterruptible.java +++ /dev/null @@ -1,38 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface1; - -import java.util.concurrent.CompletableFuture; - -import agent.lldb.model.iface2.LldbModelTargetObject; -import ghidra.dbg.target.TargetInterruptible; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface LldbModelTargetInterruptible extends LldbModelTargetObject, TargetInterruptible { - - @Override - public default CompletableFuture interrupt() { - getManager().sendInterruptNow(); - return CompletableFuture.completedFuture(null); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetKillable.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetKillable.java deleted file mode 100644 index 127cdc4379..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetKillable.java +++ /dev/null @@ -1,37 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface1; - -import java.util.concurrent.CompletableFuture; - -import agent.lldb.model.iface2.LldbModelTargetObject; -import ghidra.dbg.target.TargetKillable; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface LldbModelTargetKillable extends LldbModelTargetObject, TargetKillable { - - public CompletableFuture destroy(); - - @Override - public CompletableFuture kill(); - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetLauncher.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetLauncher.java deleted file mode 100644 index faea786c1e..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetLauncher.java +++ /dev/null @@ -1,36 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface1; - -import java.util.List; -import java.util.concurrent.CompletableFuture; - -import agent.lldb.model.iface2.LldbModelTargetObject; -import ghidra.dbg.target.TargetLauncher.TargetCmdLineLauncher; - -/** - * An interface which indicates this object is capable of launching targets. - * - *

- * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface LldbModelTargetLauncher extends LldbModelTargetObject, TargetCmdLineLauncher { - - @Override - public CompletableFuture launch(List args); -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetMethod.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetMethod.java deleted file mode 100644 index 722a7f2d43..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetMethod.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface1; - -import agent.lldb.model.iface2.LldbModelTargetObject; -import ghidra.dbg.target.TargetMethod; - -/** - * An interface which indicates this object is a method in its parent. - * - * @param type for this - */ -public interface LldbModelTargetMethod extends LldbModelTargetObject, TargetMethod { - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetResumable.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetResumable.java deleted file mode 100644 index 495a5367b5..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetResumable.java +++ /dev/null @@ -1,35 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface1; - -import java.util.concurrent.CompletableFuture; - -import agent.lldb.model.iface2.LldbModelTargetObject; -import ghidra.dbg.target.TargetResumable; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface LldbModelTargetResumable extends LldbModelTargetObject, TargetResumable { - - @Override - public CompletableFuture resume(); - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetSteppable.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetSteppable.java deleted file mode 100644 index ecc7ad0aa4..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface1/LldbModelTargetSteppable.java +++ /dev/null @@ -1,30 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface1; - -import agent.lldb.model.iface2.LldbModelTargetObject; -import ghidra.dbg.target.TargetSteppable; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface LldbModelTargetSteppable extends LldbModelTargetObject, TargetSteppable { - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetAvailable.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetAvailable.java deleted file mode 100644 index 74d0db5200..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetAvailable.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface2; - -import ghidra.dbg.target.TargetAttachable; - -public interface LldbModelTargetAvailable extends LldbModelTargetObject, TargetAttachable { - String PID_ATTRIBUTE_NAME = PREFIX_INVISIBLE + "pid"; - // TODO: DESCRIPTION, TYPE, USER? - - public Long getPid(); - - public void setBase(Object value); - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetAvailableContainer.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetAvailableContainer.java deleted file mode 100644 index 84c9e1ca70..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetAvailableContainer.java +++ /dev/null @@ -1,22 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface2; - -public interface LldbModelTargetAvailableContainer extends LldbModelTargetObject { - - public LldbModelTargetAvailable getTargetAttachable(String pid); - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetBreakpointContainer.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetBreakpointContainer.java deleted file mode 100644 index 00213b289e..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetBreakpointContainer.java +++ /dev/null @@ -1,97 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface2; - -import java.util.Set; -import java.util.concurrent.CompletableFuture; -import java.util.function.Function; - -import SWIG.SBTarget; -import agent.lldb.manager.LldbCause; -import agent.lldb.manager.LldbEventsListenerAdapter; -import agent.lldb.manager.breakpoint.LldbBreakpointType; -import agent.lldb.manager.impl.LldbManagerImpl; -import agent.lldb.model.impl.LldbModelTargetAbstractXpointSpec; -import ghidra.async.AsyncFence; -import ghidra.dbg.target.TargetBreakpointSpec.TargetBreakpointKind; -import ghidra.dbg.target.TargetBreakpointSpecContainer; -import ghidra.dbg.target.schema.*; -import ghidra.program.model.address.AddressRange; - -@TargetObjectSchemaInfo( - name = "BreakpointContainer", - elements = { - @TargetElementType(type = LldbModelTargetAbstractXpointSpec.class) }, - attributes = { - @TargetAttributeType(type = Void.class) }, - canonicalContainer = true) -public interface LldbModelTargetBreakpointContainer extends LldbModelTargetObject, // - TargetBreakpointSpecContainer, // - LldbEventsListenerAdapter { - - @Override - public void breakpointCreated(Object info, LldbCause cause); - - @Override - public void breakpointModified(Object info, LldbCause cause); - - @Override - public void breakpointDeleted(Object info, LldbCause cause); - - @Override - public void breakpointHit(Object info, LldbCause cause); - - public default CompletableFuture doPlaceBreakpoint(Set kinds, - Function> placer) { - AsyncFence fence = new AsyncFence(); - if (kinds.contains(TargetBreakpointKind.READ) && - kinds.contains(TargetBreakpointKind.WRITE)) { - fence.include(placer.apply(LldbBreakpointType.ACCESS_WATCHPOINT)); - } - else if (kinds.contains(TargetBreakpointKind.READ)) { - fence.include(placer.apply(LldbBreakpointType.READ_WATCHPOINT)); - } - else if (kinds.contains(TargetBreakpointKind.WRITE)) { - fence.include(placer.apply(LldbBreakpointType.WRITE_WATCHPOINT)); - } - if (kinds.contains(TargetBreakpointKind.HW_EXECUTE)) { - fence.include(placer.apply(LldbBreakpointType.HW_BREAKPOINT)); - } - if (kinds.contains(TargetBreakpointKind.SW_EXECUTE)) { - fence.include(placer.apply(LldbBreakpointType.BREAKPOINT)); - } - return getModel().gateFuture(fence.ready()); - } - - @Override - public default CompletableFuture placeBreakpoint(String expression, - Set kinds) { - LldbManagerImpl manager = getManager(); - return doPlaceBreakpoint(kinds, t -> manager.insertBreakpoint(expression, t)); - } - - @Override - public default CompletableFuture placeBreakpoint(AddressRange range, - Set kinds) { - LldbManagerImpl manager = getManager(); - long offset = range.getMinAddress().getOffset(); - int len = (int) range.getLength(); - return doPlaceBreakpoint(kinds, t -> manager.insertBreakpoint(offset, len, t)); - } - - public SBTarget getSession(); - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetBreakpointLocation.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetBreakpointLocation.java deleted file mode 100644 index 9a41e4155d..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetBreakpointLocation.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface2; - -import ghidra.dbg.target.TargetBreakpointLocation; -import ghidra.program.model.address.AddressRange; - -public interface LldbModelTargetBreakpointLocation - extends LldbModelTargetObject, TargetBreakpointLocation { - - @Override - AddressRange getRange(); - - public int getLocationId(); -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetBreakpointLocationContainer.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetBreakpointLocationContainer.java deleted file mode 100644 index 5cf2b033b0..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetBreakpointLocationContainer.java +++ /dev/null @@ -1,39 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface2; - -import agent.lldb.manager.LldbEventsListenerAdapter; -import ghidra.dbg.target.TargetBreakpointLocationContainer; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetElementType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; - -@TargetObjectSchemaInfo( - name = "BreakpointContainer", - elements = { - @TargetElementType(type = LldbModelTargetBreakpointLocation.class) }, - attributes = { - @TargetAttributeType(type = Void.class) }, - canonicalContainer = true) -public interface LldbModelTargetBreakpointLocationContainer extends LldbModelTargetObject, // - TargetBreakpointLocationContainer, // - LldbEventsListenerAdapter { - - void addBreakpointLocation(LldbModelTargetBreakpointLocation loc); - - void removeBreakpointLocation(LldbModelTargetBreakpointLocation loc); - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetBreakpointSpec.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetBreakpointSpec.java deleted file mode 100644 index 51c5fee986..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetBreakpointSpec.java +++ /dev/null @@ -1,97 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface2; - -import java.util.concurrent.CompletableFuture; - -import agent.lldb.lldb.DebugClient; -import ghidra.dbg.target.TargetBreakpointSpec; -import ghidra.dbg.target.TargetBreakpointSpecContainer.TargetBreakpointKindSet; -import ghidra.dbg.target.TargetDeletable; -import ghidra.util.datastruct.ListenerSet; - -public interface LldbModelTargetBreakpointSpec extends // - LldbModelTargetObject, // - TargetBreakpointSpec, // - TargetDeletable { - - String BPT_ACCESS_ATTRIBUTE_NAME = "Access"; - String BPT_DISP_ATTRIBUTE_NAME = "Enabled"; - String BPT_VALID_ATTRIBUTE_NAME = "Valid"; - String BPT_TIMES_ATTRIBUTE_NAME = "Count"; - String BPT_TYPE_ATTRIBUTE_NAME = "Type"; - String BPT_INDEX_ATTRIBUTE_NAME = "Id"; - - @Override - public default CompletableFuture delete() { - return getModel().gateFuture(getManager().deleteBreakpoints(getId())); - } - - @Override - public default CompletableFuture disable() { - setEnabled(false, "Disabled"); - return getModel().gateFuture(getManager().disableBreakpoints(getId())); - } - - @Override - public default CompletableFuture enable() { - setEnabled(true, "Enabled"); - return getModel().gateFuture(getManager().enableBreakpoints(getId())); - } - - public default String getId() { - return DebugClient.getId(getModelObject()); - } - - @Override - public TargetBreakpointKindSet getKinds(); - - public void updateInfo(Object info, String reason); - - /** - * Update the enabled field - * - * This does not actually toggle the breakpoint. It just updates the field and calls the proper - * listeners. To actually toggle the breakpoint, use {@link #toggle(boolean)} instead, which if - * effective, should eventually cause this method to be called. - * - * @param enabled true if enabled, false if disabled - * @param reason a description of the cause (not really used, yet) - */ - public void setEnabled(boolean enabled, String reason); - - public ListenerSet getActions(); - - @Override - public default void addAction(TargetBreakpointAction action) { - getActions().add(action); - } - - @Override - public default void removeAction(TargetBreakpointAction action) { - getActions().remove(action); - } - - public default void breakpointHit() { - LldbModelTargetThread targetThread = - getParentProcess().getThreads().getTargetThread(getManager().getEventThread()); - getActions().invoke().breakpointHit((LldbModelTargetBreakpointSpec) getProxy(), targetThread, - null, findLocation(targetThread)); - } - - public LldbModelTargetBreakpointLocation findLocation(Object object); - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetConnector.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetConnector.java deleted file mode 100644 index e59d79a59e..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetConnector.java +++ /dev/null @@ -1,41 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface2; - -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import agent.lldb.model.iface1.LldbModelSelectableObject; -import ghidra.dbg.target.TargetLauncher; -import ghidra.dbg.target.TargetMethod.TargetParameterMap; - -public interface LldbModelTargetConnector - extends LldbModelSelectableObject, TargetLauncher { - - @Override - public default String getDisplay() { - return getName(); - } - - @Override - public CompletableFuture setActive(); - - @Override - public TargetParameterMap getParameters(); - - @Override - public CompletableFuture launch(Map args); -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetConnectorContainer.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetConnectorContainer.java deleted file mode 100644 index ee9381247f..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetConnectorContainer.java +++ /dev/null @@ -1,22 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface2; - -public interface LldbModelTargetConnectorContainer extends LldbModelTargetObject { - - public LldbModelTargetAvailable getTargetAttachable(int pid); - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetDebugContainer.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetDebugContainer.java deleted file mode 100644 index 53e274ff65..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetDebugContainer.java +++ /dev/null @@ -1,24 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface2; - -import ghidra.dbg.target.TargetAggregate; - -public interface LldbModelTargetDebugContainer extends LldbModelTargetObject, TargetAggregate { - - public LldbModelTargetBreakpointContainer getBreakpoints(); - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetFunction.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetFunction.java deleted file mode 100644 index 6ddbccc7ce..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetFunction.java +++ /dev/null @@ -1,20 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface2; - -public interface LldbModelTargetFunction extends LldbModelTargetObject { - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetMemoryContainer.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetMemoryContainer.java deleted file mode 100644 index 42a8232049..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetMemoryContainer.java +++ /dev/null @@ -1,34 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface2; - -import java.util.concurrent.CompletableFuture; - -import SWIG.SBMemoryRegionInfo; -import ghidra.dbg.target.TargetMemory; -import ghidra.program.model.address.Address; - -public interface LldbModelTargetMemoryContainer extends LldbModelTargetObject, TargetMemory { - - public LldbModelTargetMemoryRegion getTargetMemory(SBMemoryRegionInfo region); - - @Override - public CompletableFuture readMemory(Address address, int length); - - @Override - public CompletableFuture writeMemory(Address address, byte[] data); - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetMemoryRegion.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetMemoryRegion.java deleted file mode 100644 index 5b81e2ece8..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetMemoryRegion.java +++ /dev/null @@ -1,35 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface2; - -import ghidra.dbg.target.TargetMemoryRegion; -import ghidra.program.model.address.AddressRange; - -public interface LldbModelTargetMemoryRegion extends LldbModelTargetObject, TargetMemoryRegion { - - @Override - public AddressRange getRange(); - - @Override - public boolean isReadable(); - - @Override - public boolean isWritable(); - - @Override - public boolean isExecutable(); - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetModule.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetModule.java deleted file mode 100644 index c7b29d0b4b..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetModule.java +++ /dev/null @@ -1,73 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface2; - -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import SWIG.SBModule; -import ghidra.dbg.target.TargetModule; -import ghidra.dbg.target.TargetObject; -import ghidra.program.model.address.Address; -import ghidra.program.model.address.AddressRange; -import ghidra.program.model.address.AddressRangeImpl; -import ghidra.program.model.address.AddressSpace; - -public interface LldbModelTargetModule extends LldbModelTargetObject, TargetModule { - - SBModule getModule(); - - @Override - public default CompletableFuture init(Map map) { - AddressSpace space = getModel().getAddressSpace("ram"); - return requestNativeAttributes().thenAccept(attrs -> { - if (attrs != null) { - map.putAll(attrs); - TargetObject baseOffset2 = (TargetObject) attrs.get("BaseAddress"); - TargetObject nameAttr = (TargetObject) attrs.get("Name"); - TargetObject size = (TargetObject) attrs.get("Size"); - String basestr = baseOffset2 == null ? "0" - : baseOffset2.getCachedAttribute(VALUE_ATTRIBUTE_NAME).toString(); - String namestr = nameAttr == null ? "" - : nameAttr.getCachedAttribute(VALUE_ATTRIBUTE_NAME).toString(); - String sizestr = - size == null ? "1" : size.getCachedAttribute(VALUE_ATTRIBUTE_NAME).toString(); - String shortnamestr = namestr; - int sep = shortnamestr.lastIndexOf('\\'); - if (sep > 0 && sep < shortnamestr.length()) { - shortnamestr = shortnamestr.substring(sep + 1); - } - Long base = Long.parseUnsignedLong(basestr, 16); - Integer sz = Integer.parseInt(sizestr, 16); - Address min = space.getAddress(base); - Address max = min.add(sz - 1); - AddressRange range = new AddressRangeImpl(min, max); - if (range != null) { - map.put(RANGE_ATTRIBUTE_NAME, range); - } - - String oldval = (String) getCachedAttribute(DISPLAY_ATTRIBUTE_NAME); - map.put(MODULE_NAME_ATTRIBUTE_NAME, namestr); - map.put(SHORT_DISPLAY_ATTRIBUTE_NAME, shortnamestr); - map.put(DISPLAY_ATTRIBUTE_NAME, shortnamestr); - setModified(map, !shortnamestr.equals(oldval)); - } - }); - } - - void setRange(AddressRangeImpl addressRangeImpl); - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetModuleContainer.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetModuleContainer.java deleted file mode 100644 index 4a19dd7714..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetModuleContainer.java +++ /dev/null @@ -1,38 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface2; - -import java.util.concurrent.CompletableFuture; - -import SWIG.SBModule; -import agent.lldb.lldb.DebugModuleInfo; -import agent.lldb.model.iface1.LldbModelTargetEventScope; -import ghidra.dbg.target.TargetModule; -import ghidra.dbg.target.TargetModuleContainer; - -public interface LldbModelTargetModuleContainer - extends LldbModelTargetEventScope, TargetModuleContainer { - - @Override - public CompletableFuture addSyntheticModule(String name); - - public LldbModelTargetModule getTargetModule(SBModule module); - - public void libraryLoaded(DebugModuleInfo info, int index); - - public void libraryUnloaded(DebugModuleInfo info, int index); - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetModuleSection.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetModuleSection.java deleted file mode 100644 index e62e429545..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetModuleSection.java +++ /dev/null @@ -1,26 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface2; - -import ghidra.dbg.target.TargetSection; -import ghidra.program.model.address.AddressRange; - -public interface LldbModelTargetModuleSection extends LldbModelTargetObject, TargetSection { - - @Override - public AddressRange getRange(); - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetModuleSectionContainer.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetModuleSectionContainer.java deleted file mode 100644 index dbdb6621e2..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetModuleSectionContainer.java +++ /dev/null @@ -1,23 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface2; - -import ghidra.dbg.target.TargetSectionContainer; - -public interface LldbModelTargetModuleSectionContainer - extends LldbModelTargetObject, TargetSectionContainer { - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetObject.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetObject.java deleted file mode 100644 index 10afbbc4d3..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetObject.java +++ /dev/null @@ -1,83 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface2; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import agent.lldb.manager.impl.LldbManagerImpl; -import agent.lldb.model.AbstractLldbModel; -import ghidra.async.AsyncUtils; -import ghidra.dbg.agent.SpiTargetObject; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.util.CollectionUtils.Delta; - -public interface LldbModelTargetObject extends SpiTargetObject { - - @Override - public AbstractLldbModel getModel(); - - public default CompletableFuture init(Map map) { - return CompletableFuture.completedFuture(null); - } - - public default LldbManagerImpl getManager() { - return (LldbManagerImpl) getModel().getManager(); - } - - public default LldbManagerImpl getManagerWithCheck() { - LldbManagerImpl impl = (LldbManagerImpl) getModel().getManager(); - if (impl == null) { - return impl; - } - return impl; - } - - public Delta changeAttributes(List remove, Map add, String reason); - - public CompletableFuture> requestNativeAttributes(); - - public default CompletableFuture requestAugmentedAttributes() { - return AsyncUtils.nil(); - } - - public CompletableFuture> requestNativeElements(); - - public LldbModelTargetSession getParentSession(); - - public LldbModelTargetProcess getParentProcess(); - - public LldbModelTargetThread getParentThread(); - - public TargetObject getProxy(); - - public void setModified(Map map, boolean b); - - public void setModified(boolean modified); - - public void resetModified(); - - public Object getModelObject(); - - public void setModelObject(Object modelObject); - - public void addMapObject(Object object, TargetObject targetObject); - - public TargetObject getMapObject(Object object); - - public void deleteMapObject(Object object); -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetProcess.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetProcess.java deleted file mode 100644 index 7cb3c56d28..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetProcess.java +++ /dev/null @@ -1,52 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface2; - -import java.util.concurrent.CompletableFuture; - -import SWIG.*; -import agent.lldb.manager.LldbEventsListenerAdapter; -import agent.lldb.model.iface1.*; -import ghidra.dbg.target.TargetAggregate; -import ghidra.dbg.target.TargetProcess; - -public interface LldbModelTargetProcess extends // - TargetAggregate, // - TargetProcess, // - LldbModelTargetExecutionStateful, // - LldbModelTargetAccessConditioned, // - LldbModelTargetAttacher, // - LldbModelTargetAttachable, // - LldbModelTargetLauncher, // - LldbModelTargetDeletable, // - LldbModelTargetDetachable, // - LldbModelTargetKillable, // - LldbModelTargetResumable, // - LldbModelTargetSteppable, // - LldbModelTargetInterruptible, // - LldbEventsListenerAdapter, // - LldbModelSelectableObject { - - public void processStarted(SBProcess proc); - - public LldbModelTargetThreadContainer getThreads(); - - public SBProcess getProcess(); - - @Override - public CompletableFuture setActive(); - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetProcessContainer.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetProcessContainer.java deleted file mode 100644 index b24855b840..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetProcessContainer.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface2; - -import SWIG.SBProcess; -import agent.lldb.manager.LldbEventsListenerAdapter; -import agent.lldb.model.iface1.LldbModelTargetEventScope; - -public interface LldbModelTargetProcessContainer extends // - LldbModelTargetEventScope, // - LldbEventsListenerAdapter { - - public LldbModelTargetProcess getTargetProcess(SBProcess process); - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetRegister.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetRegister.java deleted file mode 100644 index e851678c1c..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetRegister.java +++ /dev/null @@ -1,37 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface2; - -import java.math.BigInteger; - -import SWIG.SBValue; -import ghidra.dbg.target.TargetRegister; -import ghidra.dbg.util.ConversionUtils; - -public interface LldbModelTargetRegister extends LldbModelTargetObject, TargetRegister { - - @Override - public int getBitLength(); - - public SBValue getRegister(); - - public default byte[] getBytes() { - String val = (String) getCachedAttributes().get(VALUE_ATTRIBUTE_NAME); - BigInteger value = new BigInteger(val, 16); - return ConversionUtils.bigIntegerToBytes(getBitLength() / 8, value); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetRegisterBank.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetRegisterBank.java deleted file mode 100644 index 8727a44fbc..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetRegisterBank.java +++ /dev/null @@ -1,61 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface2; - -import java.util.*; -import java.util.Map.Entry; -import java.util.concurrent.CompletableFuture; - -import SWIG.SBValue; -import SWIG.StateType; -import agent.lldb.manager.LldbReason; -import ghidra.dbg.target.TargetAggregate; -import ghidra.dbg.target.TargetRegisterBank; - -public interface LldbModelTargetRegisterBank extends LldbModelTargetObject, - TargetRegisterBank, TargetAggregate { - - public LldbModelTargetRegister getTargetRegister(SBValue register); - - public default void threadStateChangedSpecific(StateType state, LldbReason reason) { - readRegistersNamed(getCachedElements().keySet()); - } - - @Override - public CompletableFuture> readRegistersNamed( - Collection names); - - @Override - public CompletableFuture writeRegistersNamed(Map values); - - @Override - public default Map getCachedRegisters() { - return getValues(); - } - - public default Map getValues() { - Map result = new HashMap<>(); - for (Entry entry : this.getCachedAttributes().entrySet()) { - if (entry.getValue() instanceof LldbModelTargetRegister) { - LldbModelTargetRegister reg = (LldbModelTargetRegister) entry.getValue(); - byte[] bytes = reg.getBytes(); - result.put(entry.getKey(), bytes); - } - } - return result; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetRegisterContainer.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetRegisterContainer.java deleted file mode 100644 index 8ee16a6ac6..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetRegisterContainer.java +++ /dev/null @@ -1,23 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface2; - -import ghidra.dbg.target.TargetRegisterContainer; - -public interface LldbModelTargetRegisterContainer - extends LldbModelTargetObject, TargetRegisterContainer { - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetRegisterContainerAndBank.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetRegisterContainerAndBank.java deleted file mode 100644 index 4e8cfc9c01..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetRegisterContainerAndBank.java +++ /dev/null @@ -1,29 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface2; - -import SWIG.SBValue; -import ghidra.dbg.target.TargetRegisterBank; -import ghidra.dbg.target.TargetRegisterContainer; - -public interface LldbModelTargetRegisterContainerAndBank extends // - LldbModelTargetObject, // - TargetRegisterContainer, // - TargetRegisterBank { - - public LldbModelTargetRegister getTargetRegister(SBValue register); - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetRoot.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetRoot.java deleted file mode 100644 index 92773a5e85..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetRoot.java +++ /dev/null @@ -1,40 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface2; - -import agent.lldb.manager.LldbEventsListenerAdapter; -import agent.lldb.model.iface1.LldbModelTargetAccessConditioned; -import agent.lldb.model.iface1.LldbModelTargetActiveScope; -import agent.lldb.model.iface1.LldbModelTargetAttacher; -import agent.lldb.model.iface1.LldbModelTargetEventScope; -import agent.lldb.model.iface1.LldbModelTargetFocusScope; -import agent.lldb.model.iface1.LldbModelTargetLauncher; - -public interface LldbModelTargetRoot extends // - ///LldbModelTargetObject, - LldbModelTargetAccessConditioned, // - LldbModelTargetAttacher, // - LldbModelTargetActiveScope, // - LldbModelTargetEventScope, // - LldbModelTargetLauncher, // - LldbModelTargetFocusScope, // - LldbEventsListenerAdapter { - - void setDefaultConnector(LldbModelTargetConnector defaultConnector); - - // getActive & requestActivation implemented by LldbModelTargetObject & LldbModelTargetActiveScope - // getFocus & requestFocus implemented by LldbModelTargetObject & LldbModelTargetFocusScope -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetSession.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetSession.java deleted file mode 100644 index 1e234bce37..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetSession.java +++ /dev/null @@ -1,66 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface2; - -import java.util.List; -import java.util.Map; - -import agent.lldb.lldb.DebugClient.DebugOutputFlags; -import agent.lldb.manager.LldbEventsListenerAdapter; -import agent.lldb.model.iface1.*; -import ghidra.dbg.target.TargetAggregate; -import ghidra.dbg.target.TargetConsole; -import ghidra.dbg.target.TargetConsole.Channel; - -public interface LldbModelTargetSession extends // - LldbModelTargetAccessConditioned, // - //LldbModelTargetFocusScope, // - LldbModelTargetExecutionStateful, // - LldbModelTargetInterpreter, // - LldbModelTargetInterruptible, // - LldbModelTargetResumable, // - LldbEventsListenerAdapter, // - LldbModelSelectableObject, // - TargetAggregate { - - LldbModelTargetProcessContainer getProcesses(); - - LldbModelTargetModuleContainer getModules(); - - @Override - public default void consoleOutput(String output, int mask) { - - Channel chan = TargetConsole.Channel.STDOUT; - if (((mask & DebugOutputFlags.DEBUG_OUTPUT_ERROR.getValue()) // - == DebugOutputFlags.DEBUG_OUTPUT_ERROR.getValue()) || // - ((mask & DebugOutputFlags.DEBUG_OUTPUT_WARNING.getValue()) // - == DebugOutputFlags.DEBUG_OUTPUT_WARNING.getValue())) { - chan = TargetConsole.Channel.STDERR; - } - if (output.contains("loaded *kernel* extension dll for usermode")) { - return; - } - broadcast().consoleOutput(getProxy(), chan, output); - } - - @Override - public default void promptChanged(String prompt) { - changeAttributes(List.of(), Map.of( // - PROMPT_ATTRIBUTE_NAME, prompt // - ), "Refreshed"); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetSessionAttributes.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetSessionAttributes.java deleted file mode 100644 index 4f2e1e2a12..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetSessionAttributes.java +++ /dev/null @@ -1,25 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface2; - -import agent.lldb.manager.LldbEventsListenerAdapter; -import agent.lldb.model.iface1.LldbModelTargetEnvironment; - -public interface LldbModelTargetSessionAttributes extends - LldbModelTargetEnvironment, // - LldbEventsListenerAdapter { - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetSessionAttributesEnvironment.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetSessionAttributesEnvironment.java deleted file mode 100644 index 1954603d65..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetSessionAttributesEnvironment.java +++ /dev/null @@ -1,24 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface2; - -import agent.lldb.manager.LldbEventsListenerAdapter; - -public interface LldbModelTargetSessionAttributesEnvironment extends // - LldbModelTargetObject, // - LldbEventsListenerAdapter { - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetSessionAttributesPlatform.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetSessionAttributesPlatform.java deleted file mode 100644 index 4792ec5346..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetSessionAttributesPlatform.java +++ /dev/null @@ -1,24 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface2; - -import agent.lldb.manager.LldbEventsListenerAdapter; - -public interface LldbModelTargetSessionAttributesPlatform extends // - LldbModelTargetObject, // - LldbEventsListenerAdapter { - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetSessionContainer.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetSessionContainer.java deleted file mode 100644 index 874285d7da..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetSessionContainer.java +++ /dev/null @@ -1,36 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface2; - -import SWIG.SBTarget; -import agent.lldb.manager.LldbCause; -import agent.lldb.manager.LldbEventsListenerAdapter; - -public interface LldbModelTargetSessionContainer - extends LldbModelTargetObject, LldbEventsListenerAdapter { - - @Override - public void sessionAdded(SBTarget session, LldbCause cause); - - @Override - public void sessionReplaced(SBTarget session, LldbCause cause); - - @Override - public void sessionRemoved(String sessionId, LldbCause cause); - - public LldbModelTargetSession getTargetSession(SBTarget session); - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetStack.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetStack.java deleted file mode 100644 index ff7c5be23e..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetStack.java +++ /dev/null @@ -1,26 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface2; - -import SWIG.SBFrame; -import ghidra.dbg.target.TargetStack; - -public interface LldbModelTargetStack - extends LldbModelTargetObject, TargetStack { - - public LldbModelTargetStackFrame getTargetFrame(SBFrame frame); - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetStackFrame.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetStackFrame.java deleted file mode 100644 index 16ec178f1f..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetStackFrame.java +++ /dev/null @@ -1,108 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface2; - -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import SWIG.SBFrame; -import SWIG.SBThread; -import agent.lldb.manager.LldbEventsListenerAdapter; -import agent.lldb.manager.impl.LldbManagerImpl; -import agent.lldb.model.iface1.LldbModelSelectableObject; -import ghidra.dbg.target.TargetAggregate; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.TargetStackFrame; -import ghidra.program.model.address.Address; -import ghidra.program.model.address.AddressSpace; - -public interface LldbModelTargetStackFrame extends // - TargetAggregate, // - TargetStackFrame, // - LldbEventsListenerAdapter, // - LldbModelSelectableObject { - - public static final String FUNC_ATTRIBUTE_NAME = "function"; - public static final String FUNC_TABLE_ENTRY_ATTRIBUTE_NAME = "Table Entry"; - public static final String FRAME_OFFSET_ATTRIBUTE_NAME = "Frame Offset"; - public static final String INST_OFFSET_ATTRIBUTE_NAME = "Inst. Offset"; - public static final String RETURN_OFFSET_ATTRIBUTE_NAME = "Return Offset"; - public static final String CALL_FRAME_OFFSET_ATTRIBUTE_NAME = "Call Frame Offset"; - public static final String STACK_OFFSET_ATTRIBUTE_NAME = "Stack Offset"; - public static final String VIRTUAL_ATTRIBUTE_NAME = "Virtual"; - public static final String PARAM0_ATTRIBUTE_NAME = "Param[0]"; - public static final String PARAM1_ATTRIBUTE_NAME = "Param[1]"; - public static final String PARAM2_ATTRIBUTE_NAME = "Param[2]"; - public static final String PARAM3_ATTRIBUTE_NAME = "Param[3]"; - - @Override - public default CompletableFuture setActive() { - LldbManagerImpl manager = getManager(); - SBThread thread = manager.getCurrentThread(); - String name = this.getName(); - String stripped = name.substring(1, name.length() - 1); - int index = Integer.decode(stripped); - return manager.setActiveFrame(thread, index); - } - - @Override - public default CompletableFuture init(Map map) { - AddressSpace space = getModel().getAddressSpace("ram"); - return requestNativeAttributes().thenCompose(attrs -> { - if (attrs == null) { - return CompletableFuture.completedFuture(null); - } - map.putAll(attrs); - LldbModelTargetObject attributes = (LldbModelTargetObject) attrs.get("Attributes"); - if (attributes == null) { - return CompletableFuture.completedFuture(null); - } - return attributes.requestAugmentedAttributes().thenCompose(ax -> { - Map subattrs = attributes.getCachedAttributes(); - if (subattrs == null) { - return CompletableFuture.completedFuture(null); - } - LldbModelTargetObject frameNumber = - (LldbModelTargetObject) subattrs.get("FrameNumber"); - return frameNumber.requestAugmentedAttributes().thenCompose(bx -> { - Object noval = frameNumber.getCachedAttribute(VALUE_ATTRIBUTE_NAME); - String nostr = noval.toString(); - LldbModelTargetObject instructionOffset = - (LldbModelTargetObject) subattrs.get("InstructionOffset"); - return instructionOffset.requestAugmentedAttributes().thenAccept(cx -> { - String oldval = (String) getCachedAttribute(DISPLAY_ATTRIBUTE_NAME); - Object pcval = instructionOffset.getCachedAttribute(VALUE_ATTRIBUTE_NAME); - String pcstr = pcval.toString(); - long pc = Long.parseUnsignedLong(pcstr, 16); - map.put(PC_ATTRIBUTE_NAME, space.getAddress(pc)); - String display = String.format("#%s 0x%s", nostr, pcstr); - map.put(DISPLAY_ATTRIBUTE_NAME, display); - setModified(map, !display.equals(oldval)); - }); - }); - }); - }); - } - - public void setFrame(SBFrame frame); - - public TargetObject getThread(); - - public Address getPC(); - - public LldbModelTargetProcess getProcess(); - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetStackFrameRegister.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetStackFrameRegister.java deleted file mode 100644 index f14986517b..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetStackFrameRegister.java +++ /dev/null @@ -1,50 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface2; - -import java.math.BigInteger; - -import SWIG.SBValue; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetElementType; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; -import ghidra.dbg.util.ConversionUtils; - -@TargetObjectSchemaInfo( - name = "RegisterValueInterface", - elementResync = ResyncMode.ALWAYS, - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(type = Object.class) - }, - canonicalContainer = true) -public interface LldbModelTargetStackFrameRegister extends LldbModelTargetRegister { - - @Override - public int getBitLength(); - - public SBValue getRegister(); - - public default byte[] getBytes() { - String val = (String) getCachedAttributes().get(VALUE_ATTRIBUTE_NAME); - BigInteger value = new BigInteger(val, 16); - return ConversionUtils.bigIntegerToBytes(16, value); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetStackFrameRegisterBank.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetStackFrameRegisterBank.java deleted file mode 100644 index e3c63f11a8..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetStackFrameRegisterBank.java +++ /dev/null @@ -1,38 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface2; - -import SWIG.SBValue; -import agent.lldb.model.impl.LldbModelTargetStackFrameRegisterImpl; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; - -@TargetObjectSchemaInfo( - name = "RegisterValueBankInterface", - elementResync = ResyncMode.ALWAYS, - elements = { - @TargetElementType(type = LldbModelTargetStackFrameRegisterImpl.class) - }, - attributes = { - @TargetAttributeType(type = Object.class) - }, - canonicalContainer = true) -public interface LldbModelTargetStackFrameRegisterBank - extends LldbModelTargetRegisterBank { - - public LldbModelTargetRegister getTargetRegister(SBValue register); - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetStackFrameRegisterContainer.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetStackFrameRegisterContainer.java deleted file mode 100644 index 2a70edcc0c..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetStackFrameRegisterContainer.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface2; - -import SWIG.SBValue; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; - -@TargetObjectSchemaInfo( - name = "RegisterContainerInterface", - attributeResync = ResyncMode.ALWAYS, - attributes = { - @TargetAttributeType( - name = "General Purpose Registers", - type = LldbModelTargetStackFrameRegisterBank.class, - required = true), - @TargetAttributeType( - name = "Exception State Registers", - type = LldbModelTargetStackFrameRegisterBank.class, - required = true), - @TargetAttributeType( - name = "Floating Point Registers", - type = LldbModelTargetStackFrameRegisterBank.class, - required = true), - @TargetAttributeType(type = Void.class) - }) -public interface LldbModelTargetStackFrameRegisterContainer - extends LldbModelTargetRegisterContainer { - - public LldbModelTargetObject getTargetRegisterBank(SBValue val); - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetSymbol.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetSymbol.java deleted file mode 100644 index 2ed0e34f9b..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetSymbol.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface2; - -import ghidra.dbg.target.TargetSymbol; -import ghidra.program.model.address.Address; - -public interface LldbModelTargetSymbol extends LldbModelTargetObject, TargetSymbol { - - @Override - public boolean isConstant(); - - @Override - public Address getValue(); - - @Override - public long getSize(); -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetSymbolContainer.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetSymbolContainer.java deleted file mode 100644 index ca276df0d5..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetSymbolContainer.java +++ /dev/null @@ -1,27 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface2; - -import SWIG.SBSymbol; -import agent.lldb.model.impl.LldbModelTargetSymbolImpl; -import ghidra.dbg.target.TargetSymbolNamespace; - -public interface LldbModelTargetSymbolContainer - extends LldbModelTargetObject, TargetSymbolNamespace { - - public LldbModelTargetSymbolImpl getTargetSymbol(SBSymbol symbol); - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetThread.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetThread.java deleted file mode 100644 index 93ad35b254..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetThread.java +++ /dev/null @@ -1,63 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface2; - -import java.util.concurrent.CompletableFuture; - -import SWIG.SBThread; -import SWIG.StateType; -import agent.lldb.manager.*; -import agent.lldb.manager.cmd.LldbSetActiveThreadCommand; -import agent.lldb.manager.impl.LldbManagerImpl; -import agent.lldb.model.iface1.*; -import agent.lldb.model.impl.LldbModelTargetStackImpl; -import ghidra.dbg.target.*; - -public interface LldbModelTargetThread extends // - TargetAggregate, // - TargetThread, // - LldbModelTargetAccessConditioned, // - LldbModelTargetExecutionStateful, // - LldbModelTargetSteppable, // - LldbStateListener, // - LldbEventsListenerAdapter, // - LldbModelSelectableObject { - - public default SBThread getThread() { - return (SBThread) getModelObject(); - } - - public default void threadStateChangedSpecific(StateType state, LldbReason reason) { - TargetRegisterContainer container = - (TargetRegisterContainer) getCachedAttribute("Registers"); - TargetRegisterBank bank = (TargetRegisterBank) container.getCachedAttribute("User"); - if (state.equals(StateType.eStateStopped)) { - bank.readRegistersNamed(getCachedElements().keySet()); - } - } - - @Override - public default CompletableFuture setActive() { - LldbManagerImpl manager = getManager(); - SBThread thread = getThread(); - return manager.execute(new LldbSetActiveThreadCommand(manager, thread, -1)); - } - - public LldbModelTargetStackImpl getStack(); - - public String getExecutingProcessorType(); - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetThreadContainer.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetThreadContainer.java deleted file mode 100644 index 111f76fa97..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/iface2/LldbModelTargetThreadContainer.java +++ /dev/null @@ -1,34 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.iface2; - -import SWIG.SBThread; -import agent.lldb.manager.LldbEventsListenerAdapter; -import agent.lldb.model.iface1.LldbModelTargetEventScope; - -public interface LldbModelTargetThreadContainer extends // - LldbModelTargetEventScope, // - LldbEventsListenerAdapter { - - public LldbModelTargetThread getTargetThread(SBThread thread); - - public void threadCreated(SBThread thread); - - public void threadReplaced(SBThread thread); - - public void threadExited(SBThread thread); - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelDefaultTargetModelRoot.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelDefaultTargetModelRoot.java deleted file mode 100644 index dc1d9b2aae..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelDefaultTargetModelRoot.java +++ /dev/null @@ -1,33 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import ghidra.dbg.target.TargetAggregate; -import ghidra.dbg.target.schema.TargetObjectSchema; - -public class LldbModelDefaultTargetModelRoot extends LldbModelTargetObjectImpl - implements TargetAggregate { - - public LldbModelDefaultTargetModelRoot(LldbModelImpl model, String typeHint) { - super(model, null, null, null, typeHint); - } - - public LldbModelDefaultTargetModelRoot(LldbModelImpl model, String typeHint, - TargetObjectSchema schema) { - super(model, null, null, null, typeHint, schema); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelImpl.java deleted file mode 100644 index 0e845d11a7..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelImpl.java +++ /dev/null @@ -1,197 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.RejectedExecutionException; - -import org.apache.commons.lang3.exception.ExceptionUtils; - -import agent.lldb.lldb.DebugClient; -import agent.lldb.manager.LldbManager; -import agent.lldb.manager.impl.LldbManagerImpl; -import agent.lldb.model.AbstractLldbModel; -import agent.lldb.model.iface2.LldbModelTargetProcess; -import agent.lldb.model.iface2.LldbModelTargetSession; -import ghidra.async.AsyncUtils; -import ghidra.dbg.DebuggerModelClosedReason; -import ghidra.dbg.DebuggerObjectModelWithMemory; -import ghidra.dbg.error.DebuggerModelTerminatingException; -import ghidra.dbg.target.TargetMemory; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.AnnotatedSchemaContext; -import ghidra.dbg.target.schema.TargetObjectSchema; -import ghidra.program.model.address.Address; -import ghidra.program.model.address.AddressFactory; -import ghidra.program.model.address.AddressSpace; -import ghidra.program.model.address.DefaultAddressFactory; -import ghidra.program.model.address.GenericAddressSpace; - -public class LldbModelImpl extends AbstractLldbModel implements DebuggerObjectModelWithMemory { - // TODO: Need some minimal memory modeling per architecture on the model/agent side. - // The model must convert to and from Ghidra's address space names - protected static final String SPACE_NAME = "ram"; - - protected static final AnnotatedSchemaContext SCHEMA_CTX = new AnnotatedSchemaContext(); - protected static final TargetObjectSchema ROOT_SCHEMA = - SCHEMA_CTX.getSchemaForClass(LldbModelTargetRootImpl.class); - - // Don't make this static, so each model has a unique "LLDB" space - protected final AddressSpace space = - new GenericAddressSpace(SPACE_NAME, 64, AddressSpace.TYPE_RAM, 0); - protected final AddressFactory addressFactory = - new DefaultAddressFactory(new AddressSpace[] { space }); - - protected LldbManager manager; - protected final LldbModelTargetRootImpl root; - protected LldbModelTargetSession session; - - protected final CompletableFuture completedRoot; - - protected Map objectMap = new HashMap<>(); - - public LldbModelImpl() { - this.manager = LldbManager.newInstance(); - //System.out.println(XmlSchemaContext.serialize(SCHEMA_CTX)); - this.root = new LldbModelTargetRootImpl(this, ROOT_SCHEMA); - this.completedRoot = CompletableFuture.completedFuture(root); - /* - SBTarget s = manager.getSession(new DebugSessionId(0)); - LldbModelTargetSessionContainer sessions = root.sessions; - this.session = sessions.getTargetSession(s); - */ - addModelRoot(root); - } - - @Override - public String getBrief() { - return "LLDB@" + Integer.toHexString(System.identityHashCode(this)); - } - - @Override - public AddressSpace getAddressSpace(String name) { - if (!SPACE_NAME.equals(name)) { - return null; - } - return space; - } - - // TODO: Place make this a model method? - @Override - public AddressFactory getAddressFactory() { - return addressFactory; - } - - @Override - public CompletableFuture startLLDB(String[] args) { - return manager.start(args).thenApplyAsync(__ -> null, clientExecutor); - } - - @Override - public boolean isRunning() { - return manager.isRunning(); - } - - @Override - public void terminate() throws IOException { - broadcast().modelClosed(DebuggerModelClosedReason.NORMAL); - root.invalidateSubtree(root, "LLDB is terminating"); - manager.terminate(); - } - - @Override - public TargetObjectSchema getRootSchema() { - return root.getSchema(); - } - - @Override - public CompletableFuture fetchModelRoot() { - return completedRoot; - } - - @Override - public LldbManagerImpl getManager() { - return (LldbManagerImpl) manager; - } - - @Override - public CompletableFuture close() { - try { - terminate(); - return super.close(); - } - catch (RejectedExecutionException e) { - reportError(this, "Model is already closing", e); - return AsyncUtils.nil(); - } - catch (Throwable t) { - return CompletableFuture.failedFuture(t); - } - } - - @Override - public LldbModelTargetSession getSession() { - return session; - } - - @Override - public TargetMemory getMemory(TargetObject target, Address address, int length) { - if (target instanceof LldbModelTargetProcess) { - LldbModelTargetProcess process = (LldbModelTargetProcess) target; - return new LldbModelTargetMemoryContainerImpl(process); - } - return null; - } - - @Override - public void addModelObject(Object object, TargetObject targetObject) { - if (object == null) { - return; - } - objectMap.put(DebugClient.getModelKey(object), targetObject); - } - - @Override - public TargetObject getModelObject(Object object) { - if (object == null) { - return null; - } - return objectMap.get(DebugClient.getModelKey(object)); - } - - public void deleteModelObject(Object object) { - if (object == null) { - return; - } - objectMap.remove(DebugClient.getModelKey(object)); - } - - @Override - public CompletableFuture gateFuture(CompletableFuture future) { - return super.gateFuture(future).exceptionally(ex -> { - for (Throwable cause = ex; cause != null; cause = cause.getCause()) { - if (cause instanceof RejectedExecutionException) { - throw new DebuggerModelTerminatingException("LLDB is terminating", ex); - } - } - return ExceptionUtils.rethrow(ex); - }); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetAbstractXpointSpec.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetAbstractXpointSpec.java deleted file mode 100644 index 5591660396..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetAbstractXpointSpec.java +++ /dev/null @@ -1,175 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import SWIG.SBBreakpointLocation; -import SWIG.SBTarget; -import agent.lldb.lldb.DebugClient; -import agent.lldb.model.iface2.*; -import ghidra.async.AsyncUtils; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.TargetBreakpointSpecContainer.TargetBreakpointKindSet; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.util.PathUtils; -import ghidra.util.datastruct.ListenerSet; -import ghidra.util.datastruct.WeakValueHashMap; - -@TargetObjectSchemaInfo(name = "BreakpointSpec", elements = { // - @TargetElementType(type = LldbModelTargetBreakpointLocationImpl.class) }, attributes = { - @TargetAttributeType(name = "Type", type = String.class), - @TargetAttributeType(name = "Valid", type = Boolean.class), - @TargetAttributeType(name = "Enabled", type = Boolean.class), - @TargetAttributeType(name = "Count", type = Long.class), - @TargetAttributeType(type = Void.class) }, canonicalContainer = true) -public abstract class LldbModelTargetAbstractXpointSpec extends LldbModelTargetObjectImpl - implements LldbModelTargetBreakpointSpec { - - protected static String keyBreakpoint(Object bpt) { - return PathUtils.makeKey(DebugClient.getId(bpt)); - } - - protected long number; - protected boolean enabled; - protected String expression; - protected String display; - protected TargetBreakpointKindSet kinds; - - protected final Map breaksBySub = - new WeakValueHashMap<>(); - protected final ListenerSet actions = - new ListenerSet<>(TargetBreakpointAction.class, false); - - public LldbModelTargetAbstractXpointSpec(LldbModelTargetBreakpointContainer breakpoints, - Object info, String title) { - super(breakpoints.getModel(), breakpoints, keyBreakpoint(info), info, title); - - changeAttributes(List.of(), Map.of(CONTAINER_ATTRIBUTE_NAME, breakpoints), "Initialized"); - } - - @Override - public void setModelObject(Object modelObject) { - super.setModelObject(modelObject); - getModel().addModelObject(modelObject, this); - } - - protected CompletableFuture init() { - Object info = getModelObject(); - updateInfo(info, "Created"); - return AsyncUtils.nil(); - } - - @Override - public abstract String getDescription(int level); - - @Override - public abstract void updateInfo(Object info, String reason); - - protected abstract TargetBreakpointKindSet computeKinds(Object from); - - protected abstract void updateAttributesFromInfo(String reason); - - @Override - public CompletableFuture delete() { - String id = DebugClient.getId(getModelObject()); - return getModel().gateFuture(getManager().deleteBreakpoints(id)); - } - - @Override - public boolean isEnabled() { - return enabled; - } - - @Override - public String getExpression() { - return expression; - } - - @Override - public TargetBreakpointKindSet getKinds() { - return kinds; - } - - @Override - public void addAction(TargetBreakpointAction action) { - actions.add(action); - } - - @Override - public void removeAction(TargetBreakpointAction action) { - actions.remove(action); - } - - protected CompletableFuture getInfo(RefreshBehavior refresh) { - SBTarget session = getManager().getCurrentSession(); - String id = DebugClient.getId(getModelObject()); - if (!refresh.equals(RefreshBehavior.REFRESH_ALWAYS)) { - return CompletableFuture - .completedFuture(getManager().getKnownBreakpoints(session).get(id)); - } - return getManager().listBreakpoints(session) - .thenApply(__ -> getManager().getKnownBreakpoints(session).get(id)); - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - return getInfo(refresh).thenAccept(i -> { - updateInfo(i, "Refreshed"); - }); - } - - @Override - public CompletableFuture disable() { - String id = DebugClient.getId(getModelObject()); - return getModel().gateFuture(getManager().disableBreakpoints(id)); - } - - @Override - public CompletableFuture enable() { - String id = DebugClient.getId(getModelObject()); - return getModel().gateFuture(getManager().enableBreakpoints(id)); - } - - protected void breakpointHit(LldbModelTargetStackFrame frame, - LldbModelTargetBreakpointLocation eb) { - actions.invoke().breakpointHit(this, frame.getParentThread(), frame, eb); - } - - public synchronized LldbModelTargetBreakpointLocation getTargetBreakpointLocation( - SBBreakpointLocation loc) { - return breaksBySub.computeIfAbsent(loc.GetID(), - i -> new LldbModelTargetBreakpointLocationImpl(this, loc)); - } - - @Override - public String getDisplay() { - return display; - } - - @Override - public void setEnabled(boolean enabled, String reason) { - this.enabled = enabled; - } - - @Override - public ListenerSet getActions() { - return new ListenerSet(null, true); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetAvailableContainerImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetAvailableContainerImpl.java deleted file mode 100644 index 9b9dce0500..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetAvailableContainerImpl.java +++ /dev/null @@ -1,101 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import org.apache.commons.lang3.tuple.Pair; - -import agent.lldb.model.iface1.LldbModelTargetConfigurable; -import agent.lldb.model.iface2.*; -import ghidra.async.AsyncUtils; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.error.DebuggerIllegalArgumentException; -import ghidra.dbg.target.TargetConfigurable; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; -import ghidra.util.datastruct.WeakValueHashMap; - -@TargetObjectSchemaInfo( - name = "AvailableContainer", - elements = { - @TargetElementType(type = LldbModelTargetAvailableImpl.class) // - }, - elementResync = ResyncMode.ALWAYS, - attributes = { // - @TargetAttributeType(name = TargetConfigurable.BASE_ATTRIBUTE_NAME, type = Integer.class), // - @TargetAttributeType(type = Void.class) // - }, - canonicalContainer = true) -public class LldbModelTargetAvailableContainerImpl extends LldbModelTargetObjectImpl - implements LldbModelTargetAvailableContainer, LldbModelTargetConfigurable { - - protected final Map attachablesById = - new WeakValueHashMap<>(); - - public LldbModelTargetAvailableContainerImpl(LldbModelTargetRoot root) { - super(root.getModel(), root, "Available", "AvailableContainer"); - this.changeAttributes(List.of(), Map.of(BASE_ATTRIBUTE_NAME, 16), "Initialized"); - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - return getManager().listAvailableProcesses().thenAccept(list -> { - List available; - synchronized (this) { - // NOTE: If more details added to entries, should clear attachablesById - available = - list.stream().map(this::getTargetAttachableEx).collect(Collectors.toList()); - } - setElements(available, Map.of(), "Refreshed"); - }); - } - - public synchronized LldbModelTargetAvailable getTargetAttachableEx(Pair pair) { - return attachablesById.computeIfAbsent(pair.getLeft(), - i -> new LldbModelTargetAvailableImpl(this, pair.getLeft(), pair.getRight())); - } - - @Override - public synchronized LldbModelTargetAvailable getTargetAttachable(String pid) { - return attachablesById.computeIfAbsent(pid, - i -> new LldbModelTargetAvailableImpl(this, pid)); - } - - @Override - public CompletableFuture writeConfigurationOption(String key, Object value) { - switch (key) { - case BASE_ATTRIBUTE_NAME: - if (value instanceof Integer) { - this.changeAttributes(List.of(), Map.of(BASE_ATTRIBUTE_NAME, value), - "Modified"); - for (LldbModelTargetAvailable child : attachablesById.values()) { - child.setBase(value); - } - } - else { - throw new DebuggerIllegalArgumentException("Base should be numeric"); - } - default: - } - return AsyncUtils.nil(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetAvailableImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetAvailableImpl.java deleted file mode 100644 index ef6913b04a..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetAvailableImpl.java +++ /dev/null @@ -1,91 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import java.util.List; -import java.util.Map; - -import agent.lldb.model.iface2.LldbModelTargetAvailable; -import agent.lldb.model.iface2.LldbModelTargetAvailableContainer; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.util.PathUtils; - -@TargetObjectSchemaInfo( - name = "Available", - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType(type = Void.class) }) -public class LldbModelTargetAvailableImpl extends LldbModelTargetObjectImpl - implements LldbModelTargetAvailable { - - protected static String keyAttachable(String pid) { - return PathUtils.makeKey(pid); - } - - protected final String pid; - protected final String name; - private Integer base = 16; - - public LldbModelTargetAvailableImpl(LldbModelTargetAvailableContainer parent, String pid, - String name) { - super(parent.getModel(), parent, keyAttachable(pid), name); - this.name = name; - this.pid = pid; - - this.changeAttributes(List.of(), List.of(), Map.of(// - PID_ATTRIBUTE_NAME, Long.parseLong(pid, 10), // - DISPLAY_ATTRIBUTE_NAME, getDisplay() // - ), "Initialized"); - } - - public LldbModelTargetAvailableImpl(LldbModelTargetAvailableContainer parent, String pid) { - super(parent.getModel(), parent, keyAttachable(pid), "Attachable"); - this.pid = pid; - this.name = ""; - - this.changeAttributes(List.of(), List.of(), Map.of(// - PID_ATTRIBUTE_NAME, Long.parseLong(pid, 10), // - DISPLAY_ATTRIBUTE_NAME, keyAttachable(pid) // - ), "Initialized"); - } - - @TargetAttributeType(name = PID_ATTRIBUTE_NAME, hidden = true) - @Override - public Long getPid() { - return Long.parseLong(pid); - } - - @Override - public String getDisplay() { - Long p = Long.decode(pid); - String pidstr = ""; - if (base == 16) { - pidstr = "0x" + Long.toHexString(p); - } else { - pidstr = pid; - } - return "[" + pidstr + "] : " + name.trim(); - } - - public void setBase(Object value) { - this.base = (Integer) value; - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDisplay()// - ), "Started"); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetBreakpointContainerImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetBreakpointContainerImpl.java deleted file mode 100644 index ed89a524bc..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetBreakpointContainerImpl.java +++ /dev/null @@ -1,158 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import java.math.BigInteger; -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import SWIG.*; -import agent.lldb.lldb.DebugClient; -import agent.lldb.manager.LldbCause; -import agent.lldb.model.iface2.*; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.TargetBreakpointSpec.TargetBreakpointKind; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.*; -import ghidra.util.Msg; - -@TargetObjectSchemaInfo( - name = "BreakpointContainer", - elements = { // - @TargetElementType(type = LldbModelTargetAbstractXpointSpec.class) // - }, - attributes = { // - @TargetAttributeType(type = Void.class) // - }, - canonicalContainer = true) -public class LldbModelTargetBreakpointContainerImpl extends LldbModelTargetObjectImpl - implements LldbModelTargetBreakpointContainer { - - protected static final TargetBreakpointKindSet SUPPORTED_KINDS = - TargetBreakpointKindSet.of( - TargetBreakpointKind.SW_EXECUTE, - //TargetBreakpointKind.HW_EXECUTE, - TargetBreakpointKind.READ, - TargetBreakpointKind.WRITE); - - private final SBTarget session; - - public LldbModelTargetBreakpointContainerImpl(LldbModelTargetDebugContainer debug, - SBTarget session) { - super(debug.getModel(), debug, "Breakpoints", "BreakpointContainer"); - this.session = session; - - getManager().addEventsListener(this); - - changeAttributes(List.of(), List.of(), Map.of( // - // TODO: Seems terrible to duplicate this static attribute on each instance - SUPPORTED_BREAK_KINDS_ATTRIBUTE_NAME, SUPPORTED_KINDS // - ), "Initialized"); - } - - @Override - public void breakpointCreated(Object info, LldbCause cause) { - LldbModelTargetBreakpointSpec spec = getTargetBreakpointSpec(info); - spec.updateInfo(info, "Created"); - changeElements(List.of(), List.of(getTargetBreakpointSpec(info)), Map.of(), "Created"); - } - - @Override - public void breakpointModified(Object info, LldbCause cause) { - getTargetBreakpointSpec(info).updateInfo(info, "Modified"); - } - - @Override - public void breakpointDeleted(Object info, LldbCause cause) { - LldbModelImpl impl = (LldbModelImpl) model; - impl.deleteModelObject(info); - changeElements(List.of( // - DebugClient.getId(info) // - ), List.of(), Map.of(), "Deleted"); - } - - @Override - public void breakpointHit(Object obj, LldbCause cause) { - SBBreakpoint bpt = (SBBreakpoint) obj; - SBProcess eventProcess = getManager().getEventProcess(); - long nthreads = eventProcess.GetNumThreads(); - for (int i = 0; i < nthreads; i++) { - SBThread t = eventProcess.GetThreadAtIndex(i); - StopReason reason = t.GetStopReason(); - if (reason.equals(StopReason.eStopReasonBreakpoint)) { - BigInteger bptId = t.GetStopReasonDataAtIndex(0); - BigInteger locId = t.GetStopReasonDataAtIndex(1); - if (bpt.GetID() == bptId.intValue()) { - LldbModelTargetProcess targetProcess = - (LldbModelTargetProcess) getModel().getModelObject(eventProcess); - LldbModelTargetThread targetThread = - targetProcess.getThreads().getTargetThread(t); - LldbModelTargetBreakpointSpec spec = getTargetBreakpointSpec(bpt); - if (spec == null) { - Msg.error(this, - "Stopped for breakpoint unknown to the agent: " + bpt + " (pc=" + - targetThread + ")"); - return; - } - - LldbModelTargetBreakpointLocation loc = spec.findLocation(locId); - if (loc == null) { - Msg.warn(this, - "Stopped for a breakpoint whose location is unknown to the agent: " + - spec); - } - broadcast().breakpointHit(this, targetThread, null, spec, loc); - } - } - } - } - - public LldbModelTargetBreakpointSpec getTargetBreakpointSpec(Object bpt) { - TargetObject targetObject = getMapObject(bpt); - if (targetObject != null) { - LldbModelTargetBreakpointSpec spec = (LldbModelTargetBreakpointSpec) targetObject; - spec.setModelObject(bpt); - return spec; - } - if (bpt instanceof SBBreakpoint) { - return new LldbModelTargetBreakpointSpecImpl(this, bpt); - } - else { - return new LldbModelTargetWatchpointSpecImpl(this, bpt); - } - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - return getManager().listBreakpoints(getSession()).thenAccept(byNumber -> { - List specs; - synchronized (this) { - specs = byNumber.values() - .stream() - .map(this::getTargetBreakpointSpec) - .collect(Collectors.toList()); - } - setElements(specs, Map.of(), "Refreshed"); - }); - } - - @Override - public SBTarget getSession() { - return session; - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetBreakpointLocationContainerImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetBreakpointLocationContainerImpl.java deleted file mode 100644 index b0b6c0337d..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetBreakpointLocationContainerImpl.java +++ /dev/null @@ -1,91 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import java.util.List; -import java.util.Map; - -import SWIG.SBBreakpointLocation; -import SWIG.SBTarget; -import agent.lldb.model.iface2.*; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "BreakpointLocationContainer", - elements = { // - @TargetElementType(type = LldbModelTargetBreakpointLocationImpl.class) // - }, - attributes = { // - @TargetAttributeType(type = Void.class) // - }, - canonicalContainer = true) -public class LldbModelTargetBreakpointLocationContainerImpl extends LldbModelTargetObjectImpl - implements LldbModelTargetBreakpointLocationContainer { - - protected final LldbModelTargetProcessImpl targetProcess; - - public LldbModelTargetBreakpointLocationContainerImpl(LldbModelTargetProcess targetProcess) { - super(targetProcess.getModel(), targetProcess, "Breakpoints", - "BreakpointLocationContainer"); - this.targetProcess = (LldbModelTargetProcessImpl) targetProcess; - - getManager().addEventsListener(this); - requestElements(RefreshBehavior.REFRESH_NEVER); - } - - public LldbModelTargetBreakpointLocation getTargetBreakpointLocation(SBBreakpointLocation loc) { - TargetObject targetObject = getMapObject(loc); - if (targetObject != null) { - LldbModelTargetBreakpointLocation location = - (LldbModelTargetBreakpointLocation) targetObject; - location.setModelObject(loc); - return location; - } - TargetObject spec = getModel().getModelObject(loc.GetBreakpoint()); - return new LldbModelTargetBreakpointLocationImpl((LldbModelTargetAbstractXpointSpec) spec, - loc); - } - - /* - @Override - public CompletableFuture requestElements(boolean refresh) { - return getManager().listBreakpointLocations((SBBreakpoint)(targetBreakpoint).getBreakpointInfo()).thenAccept(byNumber -> { - List locs; - synchronized (this) { - locs = byNumber.values() - .stream() - .map(this::getTargetBreakpointLocation) - .collect(Collectors.toList()); - } - setElements(locs, Map.of(), "Refreshed"); - }); - } - */ - - public void addBreakpointLocation(LldbModelTargetBreakpointLocation loc) { - changeElements(List.of(), Map.of(loc.getName(), loc), "Added"); - } - - public void removeBreakpointLocation(LldbModelTargetBreakpointLocation loc) { - changeElements(List.of(loc.getName()), Map.of(), "Removed"); - } - - public SBTarget getSession() { - return (SBTarget) getModelObject(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetBreakpointLocationImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetBreakpointLocationImpl.java deleted file mode 100644 index a39e72a69c..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetBreakpointLocationImpl.java +++ /dev/null @@ -1,146 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import java.util.List; -import java.util.Map; - -import SWIG.*; -import agent.lldb.lldb.DebugClient; -import agent.lldb.model.iface2.*; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; -import ghidra.dbg.util.PathUtils; -import ghidra.program.model.address.*; - -@TargetObjectSchemaInfo( - name = "BreakpointLocation", - attributes = { - @TargetAttributeType(type = Void.class) - }) -public class LldbModelTargetBreakpointLocationImpl extends LldbModelTargetObjectImpl - implements LldbModelTargetBreakpointLocation { - - protected static String keyLocation(SBBreakpointLocation loc) { - return PathUtils.makeKey(DebugClient.getId(loc)); - } - - protected static String keyLocation(SBWatchpoint wpt) { - return PathUtils.makeKey(DebugClient.getId(wpt) + ".0"); - } - - protected LldbModelTargetAbstractXpointSpec spec; - protected SBBreakpointLocation loc; - - protected AddressRange range; - protected String display; - - public LldbModelTargetBreakpointLocationImpl(LldbModelTargetAbstractXpointSpec spec, - SBBreakpointLocation loc) { - super(spec.getModel(), spec, keyLocation(loc), loc, "BreakpointLocation"); - this.spec = spec; - this.loc = loc; - - doChangeAttributes("Initialization"); - } - - // TODO: A separate class for Impl wrapping SBWatchpoint? - public LldbModelTargetBreakpointLocationImpl(LldbModelTargetAbstractXpointSpec spec, - SBWatchpoint wpt) { - super(spec.getModel(), spec, keyLocation(wpt), wpt, "BreakpointLocation"); - this.loc = null; - - Address address = getModel().getAddress("ram", wpt.GetWatchAddress().longValue()); - long length = wpt.GetWatchSize(); - this.changeAttributes(List.of(), Map.of( - SPEC_ATTRIBUTE_NAME, parent, - RANGE_ATTRIBUTE_NAME, range = makeRange(address, length), - DISPLAY_ATTRIBUTE_NAME, display = getDescription(1)), - "Initialization"); - placeLocations(); - } - - protected static AddressRange makeRange(Address min, long length) { - Address max = min.add(length - 1); - return new AddressRangeImpl(min, max); - } - - @Override - public String getDescription(int level) { - Object modelObject = getModelObject(); - SBStream stream = new SBStream(); - DescriptionLevel detail = DescriptionLevel.swigToEnum(level); - if (modelObject instanceof SBBreakpointLocation) { - SBBreakpointLocation loc = (SBBreakpointLocation) getModelObject(); - loc.GetDescription(stream, detail); - } - if (modelObject instanceof SBWatchpoint) { - SBWatchpoint wpt = (SBWatchpoint) getModelObject(); - wpt.GetDescription(stream, detail); - } - return stream.GetData(); - } - - protected void doChangeAttributes(String reason) { - Address address = getModel().getAddress("ram", loc.GetLoadAddress().longValue()); - this.changeAttributes(List.of(), Map.of( - SPEC_ATTRIBUTE_NAME, parent, - RANGE_ATTRIBUTE_NAME, range = new AddressRangeImpl(address, address), - DISPLAY_ATTRIBUTE_NAME, display = getDescription(1)), - reason); - placeLocations(); - } - - protected void placeLocations() { - LldbModelTargetSession parentSession = getParentSession(); - Map cachedElements = - parentSession.getProcesses().getCachedElements(); - for (TargetObject obj : cachedElements.values()) { - if (obj instanceof LldbModelTargetProcess) { - LldbModelTargetProcessImpl process = (LldbModelTargetProcessImpl) obj; - process.addBreakpointLocation(this); - } - } - } - - @Override - protected void doInvalidate(TargetObject branch, String reason) { - removeLocations(); - super.doInvalidate(branch, reason); - } - - protected void removeLocations() { - TargetObject modelObject = getModel().getModelObject(getManager().getCurrentProcess()); - if (modelObject instanceof LldbModelTargetProcess) { - LldbModelTargetProcess targetProcess = (LldbModelTargetProcess) modelObject; - LldbModelTargetBreakpointLocationContainer locs = - (LldbModelTargetBreakpointLocationContainer) targetProcess - .getCachedAttribute("Breakpoints"); - locs.removeBreakpointLocation(this); - } - } - - @Override - public AddressRange getRange() { - return range; - } - - @Override - public int getLocationId() { - return loc.GetID(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetBreakpointSpecImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetBreakpointSpecImpl.java deleted file mode 100644 index f64653ce69..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetBreakpointSpecImpl.java +++ /dev/null @@ -1,139 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import java.math.BigInteger; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -import SWIG.SBBreakpoint; -import SWIG.SBStream; -import agent.lldb.model.iface2.LldbModelTargetBreakpointContainer; -import agent.lldb.model.iface2.LldbModelTargetBreakpointLocation; -import ghidra.dbg.target.TargetBreakpointLocation; -import ghidra.dbg.target.TargetBreakpointSpecContainer.TargetBreakpointKindSet; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.*; -import ghidra.util.datastruct.ListenerSet; - -@TargetObjectSchemaInfo(name = "BreakpointSpec", elements = { // - @TargetElementType(type = LldbModelTargetBreakpointLocationImpl.class) }, attributes = { - @TargetAttributeType(name = "Type", type = String.class), - @TargetAttributeType(name = "Valid", type = Boolean.class), - @TargetAttributeType(name = "Enabled", type = Boolean.class), - @TargetAttributeType(name = "Count", type = Long.class), - @TargetAttributeType(type = Void.class) }, canonicalContainer = true) -public class LldbModelTargetBreakpointSpecImpl extends LldbModelTargetAbstractXpointSpec { - - protected final ListenerSet actions = - new ListenerSet<>(TargetBreakpointAction.class, false); - - public LldbModelTargetBreakpointSpecImpl(LldbModelTargetBreakpointContainer breakpoints, - Object info) { - super(breakpoints, info, "BreakpointSpec"); - } - - @Override - public String getDescription(int level) { - SBStream stream = new SBStream(); - SBBreakpoint bpt = (SBBreakpoint) getModelObject(); - bpt.GetDescription(stream); - return stream.GetData(); - } - - @Override - protected TargetBreakpointKindSet computeKinds(Object from) { - if (from instanceof SBBreakpoint) { - SBBreakpoint bpt = (SBBreakpoint) from; - return bpt.IsHardware() ? TargetBreakpointKindSet.of(TargetBreakpointKind.HW_EXECUTE) - : TargetBreakpointKindSet.of(TargetBreakpointKind.SW_EXECUTE); - } - return TargetBreakpointKindSet.of(); - } - - @Override - public void updateInfo(Object info, String reason) { - setModelObject(info); - updateAttributesFromInfo(reason); - getManager().listBreakpointLocations((SBBreakpoint) info).thenAccept(byNumber -> { - if (!valid) { - return; - } - List locs; - synchronized (this) { - locs = byNumber.values() - .stream() - .map(this::getTargetBreakpointLocation) - .collect(Collectors.toList()); - } - setElements(locs, Map.of(), "Refreshed"); - }); - } - - @Override - public void updateAttributesFromInfo(String reason) { - SBBreakpoint bpt = (SBBreakpoint) getModelObject(); - String description = getDescription(1); - String[] split = description.split(","); - if (split[1].contains("regex")) { - expression = split[1]; - expression = expression.substring(expression.indexOf("'") + 1); - expression = expression.substring(0, expression.indexOf("'")); - } - this.changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, display = getDescription(0), // - KINDS_ATTRIBUTE_NAME, kinds = computeKinds(bpt), // - ENABLED_ATTRIBUTE_NAME, enabled = bpt.IsEnabled(), // - EXPRESSION_ATTRIBUTE_NAME, "" // - ), reason); - this.changeAttributes(List.of(), List.of(), Map.of( // - BPT_TYPE_ATTRIBUTE_NAME, bpt.IsHardware() ? "Hardware" : "Software", // - BPT_DISP_ATTRIBUTE_NAME, bpt.IsEnabled(), // - BPT_VALID_ATTRIBUTE_NAME, bpt.IsValid(), // - BPT_TIMES_ATTRIBUTE_NAME, bpt.GetHitCount() // - ), reason); - Map cachedElements = getCachedElements(); - if (!cachedElements.isEmpty()) { - Object[] elements = cachedElements.values().toArray(); - LldbModelTargetBreakpointLocationImpl loc = - (LldbModelTargetBreakpointLocationImpl) elements[0]; - this.changeAttributes(List.of(), List.of(), Map.of( // - TargetBreakpointLocation.RANGE_ATTRIBUTE_NAME, loc.range // - ), reason); - } - } - - @Override - public ListenerSet getActions() { - return actions; - } - - @Override - public LldbModelTargetBreakpointLocation findLocation(Object obj) { - if (!(obj instanceof BigInteger)) { - return null; - } - BigInteger id = (BigInteger) obj; - for (LldbModelTargetBreakpointLocation bp : breaksBySub.values()) { - if (bp.getLocationId() == id.intValue()) { - return bp; - } - } - return null; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetConnectorContainerImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetConnectorContainerImpl.java deleted file mode 100644 index 1498da977e..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetConnectorContainerImpl.java +++ /dev/null @@ -1,129 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import java.util.List; -import java.util.Map; - -import agent.lldb.model.iface2.LldbModelTargetConnector; -import agent.lldb.model.iface2.LldbModelTargetRoot; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; - -@TargetObjectSchemaInfo( - name = "ConnectorContainer", - attributes = { - @TargetAttributeType( - name = "Launch process", - type = LldbModelTargetProcessLaunchConnectorImpl.class, - required = true, - fixed = true), - @TargetAttributeType( - name = "Launch process w/ options", - type = LldbModelTargetProcessLaunchWithOptionsConnectorImpl.class, - required = false, - fixed = true), - @TargetAttributeType( - name = "Attach to process by pid", - type = LldbModelTargetProcessAttachByPidConnectorImpl.class, - required = true, - fixed = true), - @TargetAttributeType( - name = "Attach to process by name", - type = LldbModelTargetProcessAttachByNameConnectorImpl.class, - required = false, - fixed = true), - @TargetAttributeType( - name = "Attach to process by path", - type = LldbModelTargetProcessAttachByPathConnectorImpl.class, - required = false, - fixed = true), - @TargetAttributeType( - name = "Connect to server", - type = LldbModelTargetProcessRemoteConnectorImpl.class, - required = false, - fixed = true), - @TargetAttributeType( - name = "Load trace/dump", - type = LldbModelTargetTraceOrDumpConnectorImpl.class, - required = true, - fixed = true), - @TargetAttributeType( - name = "Attach to kernel", - type = LldbModelTargetKernelConnectorImpl.class, - required = false, - fixed = true), - @TargetAttributeType(type = Void.class) - }, - canonicalContainer = true) -public class LldbModelTargetConnectorContainerImpl extends LldbModelTargetObjectImpl { - - protected final LldbModelTargetRoot root; - - private LldbModelTargetConnector defaultConnector; - - protected final LldbModelTargetProcessLaunchConnectorImpl processLauncher; - protected final LldbModelTargetProcessLaunchWithOptionsConnectorImpl processLauncherEx; - protected final LldbModelTargetProcessAttachByPidConnectorImpl processAttacherByPid; - protected final LldbModelTargetProcessAttachByNameConnectorImpl processAttacherByName; - protected final LldbModelTargetProcessAttachByPathConnectorImpl processAttacherByPath; - protected final LldbModelTargetProcessRemoteConnectorImpl processRemoteConnect; - protected final LldbModelTargetTraceOrDumpConnectorImpl traceLoader; - protected final LldbModelTargetKernelConnectorImpl kernelAttacher; - - public LldbModelTargetConnectorContainerImpl(LldbModelTargetRoot root) { - super(root.getModel(), root, "Connectors", "ConnectorsContainer"); - this.root = root; - - this.processLauncher = - new LldbModelTargetProcessLaunchConnectorImpl(this, "Launch process"); - this.processLauncherEx = - new LldbModelTargetProcessLaunchWithOptionsConnectorImpl(this, "Launch process w/ options"); - this.processAttacherByPid = - new LldbModelTargetProcessAttachByPidConnectorImpl(this, "Attach to process by pid"); - this.processAttacherByName = - new LldbModelTargetProcessAttachByNameConnectorImpl(this, "Attach to process by name"); - this.processAttacherByPath = - new LldbModelTargetProcessAttachByPathConnectorImpl(this, "Attach to process by path"); - this.processRemoteConnect = - new LldbModelTargetProcessRemoteConnectorImpl(this, "Connect to server"); - this.traceLoader = new LldbModelTargetTraceOrDumpConnectorImpl(this, "Load trace/dump"); - this.kernelAttacher = new LldbModelTargetKernelConnectorImpl(this, "Attach to kernel"); - this.defaultConnector = processLauncher; - - changeAttributes(List.of(), List.of( // - processAttacherByPid, // - processAttacherByName, // - processAttacherByPath, // - processRemoteConnect, // - processLauncher, // - processLauncherEx, // - traceLoader // - ), Map.of( // - DISPLAY_ATTRIBUTE_NAME, "Connectors" // - ), "Initialized"); - } - - public LldbModelTargetConnector getDefaultConnector() { - return defaultConnector; - } - - public void setDefaultConnector(LldbModelTargetConnector defaultConnector) { - this.defaultConnector = defaultConnector; - root.setDefaultConnector(defaultConnector); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetDebugContainerImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetDebugContainerImpl.java deleted file mode 100644 index 7ef6086d33..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetDebugContainerImpl.java +++ /dev/null @@ -1,57 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import java.util.List; -import java.util.Map; - -import agent.lldb.model.iface2.LldbModelTargetBreakpointContainer; -import agent.lldb.model.iface2.LldbModelTargetDebugContainer; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; - -@TargetObjectSchemaInfo( - name = "DebugContainer", - attributes = { - @TargetAttributeType( - name = "Breakpoints", - type = LldbModelTargetBreakpointContainerImpl.class, - required = true, - fixed = true), - @TargetAttributeType(type = Void.class) - }, - canonicalContainer = true) -public class LldbModelTargetDebugContainerImpl extends LldbModelTargetObjectImpl - implements LldbModelTargetDebugContainer { - - protected final LldbModelTargetBreakpointContainerImpl breakpoints; - - public LldbModelTargetDebugContainerImpl(LldbModelTargetSessionImpl session) { - super(session.getModel(), session, "Debug", "DebugContainer"); - - this.breakpoints = new LldbModelTargetBreakpointContainerImpl(this, session.getSession()); - - changeAttributes(List.of(), List.of( // - breakpoints // - ), Map.of(), "Initialized"); - } - - @Override - public LldbModelTargetBreakpointContainer getBreakpoints() { - return breakpoints; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetFunctionImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetFunctionImpl.java deleted file mode 100644 index a02a416bf6..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetFunctionImpl.java +++ /dev/null @@ -1,96 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import java.util.List; -import java.util.Map; - -import SWIG.*; -import agent.lldb.lldb.DebugClient; -import agent.lldb.model.iface2.LldbModelTargetFunction; -import agent.lldb.model.iface2.LldbModelTargetStackFrame; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; -import ghidra.dbg.util.PathUtils; -import ghidra.program.model.address.Address; -import ghidra.program.model.address.AddressSpace; -import ghidra.util.datastruct.WeakValueHashMap; - -@TargetObjectSchemaInfo( - name = "Function", - attributes = { - @TargetAttributeType(type = Object.class) - }, - canonicalContainer = true) -public class LldbModelTargetFunctionImpl extends LldbModelTargetObjectImpl - implements LldbModelTargetFunction { - - protected static String keyFunction(SBFunction fn) { - return PathUtils.makeKey(DebugClient.getId(fn)); - } - - protected final LldbModelTargetStackFrame frame; - - protected final Map framesByLevel = - new WeakValueHashMap<>(); - - public LldbModelTargetFunctionImpl(LldbModelTargetStackFrame frame, SBFunction function) { - super(frame.getModel(), frame, "Function", function, "Function"); - this.frame = frame; - - if (function.IsValid()) { - AddressSpace space = getModel().getAddressSpace("ram"); - Address min = space.getAddress(function.GetStartAddress().GetOffset().longValue()); - Address max = space.getAddress(function.GetStartAddress().GetOffset().longValue()); - - String name = function.GetName(); - String displayName = function.GetDisplayName(); - if (displayName == null) { - displayName = name; - } - String mangledName = function.GetMangledName(); - if (mangledName == null) { - mangledName = name; - } - long prologSize = function.GetPrologueByteSize(); - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDescription(0), // - "Start", min, // - "End", max, // - "Language", function.GetLanguage().toString(), // - "Name", name, // - "Display Name", displayName, // - "Mangled Name", mangledName, // - "Prolog Size", prologSize, // - "Block", getBlockDescription(function.GetBlock()) // - ), "Initialized"); - } - } - - public String getDescription(int level) { - SBStream stream = new SBStream(); - SBFunction function = (SBFunction) getModelObject(); - function.GetDescription(stream); - return stream.GetData(); - } - - public String getBlockDescription(SBBlock block) { - SBStream stream = new SBStream(); - block.GetDescription(stream); - return stream.GetData(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetKernelConnectorImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetKernelConnectorImpl.java deleted file mode 100644 index 06c56ad900..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetKernelConnectorImpl.java +++ /dev/null @@ -1,94 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import agent.lldb.manager.impl.LldbManagerImpl; -import agent.lldb.model.iface2.LldbModelTargetConnector; -import ghidra.async.AsyncUtils; -import ghidra.async.TypeSpec; -import ghidra.dbg.error.DebuggerUserException; -import ghidra.dbg.target.TargetMethod; -import ghidra.dbg.target.TargetMethod.ParameterDescription; -import ghidra.dbg.target.TargetMethod.TargetParameterMap; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetElementType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; - -@TargetObjectSchemaInfo( - name = "KernelConnector", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(type = Void.class) - }) -public class LldbModelTargetKernelConnectorImpl extends LldbModelTargetObjectImpl - implements LldbModelTargetConnector { - - protected final LldbModelTargetConnectorContainerImpl connectors; - protected final TargetParameterMap paramDescs; - - public LldbModelTargetKernelConnectorImpl(LldbModelTargetConnectorContainerImpl connectors, - String name) { - super(connectors.getModel(), connectors, name, name); - this.connectors = connectors; - - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDisplay(), // - TargetMethod.PARAMETERS_ATTRIBUTE_NAME, - paramDescs = TargetParameterMap.copyOf(computeParameters()) // - ), "Initialized"); - } - - @Override - public CompletableFuture setActive() { - connectors.setDefaultConnector(this); - return CompletableFuture.completedFuture(null); - } - - protected Map> computeParameters() { - HashMap> map = - new HashMap>(); - ParameterDescription flags = ParameterDescription.create(Long.class, "Flags", true, - 0L, "Flags", "0=target 1=eXDI driver"); - ParameterDescription options = ParameterDescription.create(String.class, "Options", - true, "", "Options", "-k connection options"); - map.put("Flags", flags); - map.put("Options", options); - return map; - } - - @Override - public TargetParameterMap getParameters() { - return TargetMethod.getParameters(this); - } - - @Override - public CompletableFuture launch(Map args) { - return AsyncUtils.sequence(TypeSpec.VOID).then(seq -> { - LldbManagerImpl manager = getManager(); - manager.addProcess(); - manager.attachKernel(args).handle(seq::nextIgnore); - }).finish().exceptionally((exc) -> { - throw new DebuggerUserException("Launch failed for " + args); - }); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetMemoryContainerImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetMemoryContainerImpl.java deleted file mode 100644 index d3d5a9ea5a..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetMemoryContainerImpl.java +++ /dev/null @@ -1,145 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import java.nio.ByteBuffer; -import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import SWIG.SBMemoryRegionInfo; -import agent.lldb.manager.cmd.LldbReadMemoryCommand; -import agent.lldb.manager.cmd.LldbWriteMemoryCommand; -import agent.lldb.manager.impl.LldbManagerImpl; -import agent.lldb.model.iface2.*; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.error.DebuggerMemoryAccessException; -import ghidra.dbg.error.DebuggerModelAccessException; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; -import ghidra.program.model.address.*; -import ghidra.util.datastruct.WeakValueHashMap; - -@TargetObjectSchemaInfo( - name = "Memory", - elementResync = ResyncMode.ALWAYS, - elements = { - @TargetElementType(type = LldbModelTargetMemoryRegionImpl.class) - }, - attributes = { - @TargetAttributeType(type = Void.class) - }, - canonicalContainer = true) -public class LldbModelTargetMemoryContainerImpl extends LldbModelTargetObjectImpl - implements LldbModelTargetMemoryContainer { - - protected final LldbModelTargetProcess process; - - protected final Map memoryRegions = - new WeakValueHashMap<>(); - - public LldbModelTargetMemoryContainerImpl(LldbModelTargetProcess process) { - super(process.getModel(), process, "Memory", "MemoryContainer"); - this.process = process; - requestElements(RefreshBehavior.REFRESH_NEVER); - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - return getManager().listMemory(process.getProcess()).thenAccept(byName -> { - List regions; - synchronized (this) { - regions = byName.stream().map(this::getTargetMemory).collect(Collectors.toList()); - } - setElements(regions, Map.of(), "Refreshed"); - }); - } - - @Override - public synchronized LldbModelTargetMemoryRegion getTargetMemory(SBMemoryRegionInfo region) { - TargetObject targetObject = getMapObject(region); - if (targetObject != null) { - LldbModelTargetMemoryRegion targetRegion = (LldbModelTargetMemoryRegion) targetObject; - targetRegion.setModelObject(region); - return targetRegion; - } - return new LldbModelTargetMemoryRegionImpl(this, region); - } - - private byte[] readAssist(Address address, ByteBuffer buf, AddressSetView set) { - if (set == null) { - return new byte[0]; - } - AddressRange range = set.getRangeContaining(address); - if (range == null) { - throw new DebuggerMemoryAccessException("Cannot read at " + address); - } - broadcast().memoryUpdated(getProxy(), address, buf.array()); - return Arrays.copyOf(buf.array(), (int) range.getLength()); - } - - private void writeAssist(Address address, byte[] data) { - broadcast().memoryUpdated(getProxy(), address, data); - } - - @Override - public CompletableFuture readMemory(Address address, int length) { - return model.gateFuture(doReadMemory(address, length)); - } - - protected CompletableFuture doReadMemory(Address address, int length) { - LldbManagerImpl manager = getManager(); - if (manager.isWaiting()) { - throw new DebuggerModelAccessException( - "Cannot process command readMemory while engine is waiting for events"); - } - ByteBuffer buf = ByteBuffer.allocate(length); - if (!manager.isKernelMode() || address.getAddressSpace().getName().equals("ram")) { - return manager - .execute(new LldbReadMemoryCommand(manager, process.getProcess(), address, buf, - buf.remaining())) - .thenApply(set -> { - return readAssist(address, buf, set); - }); - } - return CompletableFuture.completedFuture(new byte[length]); - } - - @Override - public CompletableFuture writeMemory(Address address, byte[] data) { - return model.gateFuture(doWriteMemory(address, data)); - } - - protected CompletableFuture doWriteMemory(Address address, byte[] data) { - LldbManagerImpl manager = getManager(); - if (manager.isWaiting()) { - throw new DebuggerModelAccessException( - "Cannot process command writeMemory while engine is waiting for events"); - } - ByteBuffer buf = ByteBuffer.wrap(data); - if (!manager.isKernelMode() || address.getAddressSpace().getName().equals("ram")) { - return manager - .execute(new LldbWriteMemoryCommand(manager, process.getProcess(), address, buf, - buf.remaining())) - .thenAccept(___ -> { - writeAssist(address, data); - }); - } - return CompletableFuture.completedFuture(null); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetMemoryRegionImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetMemoryRegionImpl.java deleted file mode 100644 index acdeb1720f..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetMemoryRegionImpl.java +++ /dev/null @@ -1,118 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import java.util.List; -import java.util.Map; - -import SWIG.SBMemoryRegionInfo; -import SWIG.SBStream; -import agent.lldb.model.iface2.LldbModelTargetMemoryContainer; -import agent.lldb.model.iface2.LldbModelTargetMemoryRegion; -import ghidra.dbg.target.TargetMemoryRegion; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.util.PathUtils; -import ghidra.program.model.address.*; - -@TargetObjectSchemaInfo( - name = "MemoryRegion", - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType( - name = TargetMemoryRegion.MEMORY_ATTRIBUTE_NAME, - type = LldbModelTargetMemoryContainerImpl.class), - @TargetAttributeType(name = "RegionBase", type = Address.class), - @TargetAttributeType(name = "RegionEnd", type = Address.class), - @TargetAttributeType(name = "RegionSize", type = String.class), - @TargetAttributeType(type = Void.class) }) -public class LldbModelTargetMemoryRegionImpl extends LldbModelTargetObjectImpl - implements LldbModelTargetMemoryRegion { - - protected static String keySection(SBMemoryRegionInfo region) { - return PathUtils.makeKey(region.GetRegionBase().toString(16)); - } - - protected AddressRange range; - protected List protect; - protected List allocProtect; - private boolean isRead; - private boolean isWrite; - private boolean isExec; - - public LldbModelTargetMemoryRegionImpl(LldbModelTargetMemoryContainer memory, - SBMemoryRegionInfo region) { - super(memory.getModel(), memory, keySection(region), region, "Region"); - - this.changeAttributes(List.of(), List.of(), Map.of( // - MEMORY_ATTRIBUTE_NAME, memory, // - READABLE_ATTRIBUTE_NAME, region.IsReadable(), // - WRITABLE_ATTRIBUTE_NAME, region.IsWritable(), // - EXECUTABLE_ATTRIBUTE_NAME, region.IsExecutable() // - ), "Initialized"); - - range = doGetRange(region); - if (range != null) { - this.changeAttributes(List.of(), List.of(), Map.of( // - RANGE_ATTRIBUTE_NAME, range, // - "RegionBase", range.getMinAddress(), // - "RegionEnd", range.getMaxAddress(), // - "RegionSize", Long.toHexString(range.getMaxAddress().subtract(range.getMinAddress()) + 1) // - ), "Initialized"); - } - } - - @Override - public String getDescription(int level) { - SBStream stream = new SBStream(); - SBMemoryRegionInfo region = (SBMemoryRegionInfo) getModelObject(); - region.GetDescription(stream); - return stream.GetData(); - } - - protected AddressRange doGetRange(SBMemoryRegionInfo s) { - AddressSpace addressSpace = getModel().getAddressSpace("ram"); - Address min = addressSpace.getAddress(s.GetRegionBase().longValue()); - Address max = addressSpace.getAddress(s.GetRegionEnd().longValue() - 1); - return max.getOffset() > min.getOffset() ? new AddressRangeImpl(min, max) - : new AddressRangeImpl(min, min); - } - - @Override - public AddressRange getRange() { - return range; - } - - @Override - public boolean isReadable() { - return isRead; - } - - @Override - public boolean isWritable() { - return isWrite; - } - - @Override - public boolean isExecutable() { - return isExec; - } - - public boolean isSame(SBMemoryRegionInfo section) { - return range.equals(doGetRange(section)); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetModuleContainerImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetModuleContainerImpl.java deleted file mode 100644 index 93daeb3df0..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetModuleContainerImpl.java +++ /dev/null @@ -1,120 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import SWIG.*; -import agent.lldb.lldb.DebugModuleInfo; -import agent.lldb.model.iface2.LldbModelTargetModule; -import agent.lldb.model.iface2.LldbModelTargetModuleContainer; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.*; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; -import ghidra.lifecycle.Internal; - -@TargetObjectSchemaInfo( - name = "ModuleContainer", - elements = { // - @TargetElementType(type = LldbModelTargetModuleImpl.class) // - }, // - elementResync = ResyncMode.ONCE, // - attributes = { // - @TargetAttributeType(type = Void.class) // - }, - canonicalContainer = true) -public class LldbModelTargetModuleContainerImpl extends LldbModelTargetObjectImpl - implements LldbModelTargetModuleContainer { - - protected final LldbModelTargetSessionImpl targetSession; - protected final SBTarget session; - - public LldbModelTargetModuleContainerImpl(LldbModelTargetSessionImpl session) { - super(session.getModel(), session, "Modules", "ModuleContainer"); - this.targetSession = session; - this.session = session.getSession(); - requestElements(RefreshBehavior.REFRESH_NEVER); - } - - @Override - @Internal - public void libraryLoaded(DebugModuleInfo info, int index) { - LldbModelTargetModule targetModule; - SBModule module = info.getModule(index); - synchronized (this) { - /** - * It's not a good idea to remove "stale" entries. If the entry's already present, it's - * probably because several modules were loaded at once, at it has already had its - * sections loaded. Removing it will cause it to load all module sections again! - */ - //modulesByName.remove(name); - targetModule = getTargetModule(module); - } - if (targetModule == null) { - System.err.println("Module " + info.getModuleName(index) + " not found!"); - return; - } - changeElements(List.of(), List.of(targetModule), Map.of(), "Loaded"); - } - - @Override - @Internal - public void libraryUnloaded(DebugModuleInfo info, int index) { - LldbModelTargetModule targetModule = getTargetModule(info.getModule(index)); - if (targetModule != null) { - LldbModelImpl impl = (LldbModelImpl) model; - impl.deleteModelObject(targetModule.getModule()); - } - changeElements(List.of(info.getModuleName(index)), List.of(), Map.of(), "Unloaded"); - } - - @Override - public boolean supportsSyntheticModules() { - return false; - } - - @Override - public CompletableFuture addSyntheticModule(String name) { - throw new UnsupportedOperationException("lldb does not support synthetic modules"); - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - return getManager().listModules(session).thenAccept(byName -> { - List result = new ArrayList<>(); - synchronized (this) { - for (Map.Entry ent : byName.entrySet()) { - result.add(getTargetModule(ent.getValue())); - } - } - changeElements(List.of(), result, Map.of(), "Refreshed"); - }); - } - - @Override - public LldbModelTargetModule getTargetModule(SBModule module) { - TargetObject targetObject = getMapObject(module); - if (targetObject != null) { - LldbModelTargetModule targetModule = (LldbModelTargetModule) targetObject; - targetModule.setModelObject(module); - return targetModule; - } - return new LldbModelTargetModuleImpl(this, module); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetModuleImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetModuleImpl.java deleted file mode 100644 index 242cfd269e..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetModuleImpl.java +++ /dev/null @@ -1,124 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import java.util.List; -import java.util.Map; - -import SWIG.*; -import agent.lldb.lldb.DebugClient; -import agent.lldb.model.iface2.LldbModelTargetModule; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.util.PathUtils; -import ghidra.program.model.address.Address; -import ghidra.program.model.address.AddressRangeImpl; - -@TargetObjectSchemaInfo( - name = "Module", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType( - name = "Sections", - type = LldbModelTargetModuleSectionContainerImpl.class, - required = true, - fixed = true), - @TargetAttributeType( - name = "Symbols", - type = LldbModelTargetSymbolContainerImpl.class, - required = true, - fixed = true), - @TargetAttributeType(name = "BaseAddress", type = Address.class), - @TargetAttributeType(name = "ImageName", type = String.class), - @TargetAttributeType(name = "UUID", type = String.class), - @TargetAttributeType(name = "Len", type = String.class), - @TargetAttributeType(type = Void.class) - }) -public class LldbModelTargetModuleImpl extends LldbModelTargetObjectImpl - implements LldbModelTargetModule { - - protected static String indexModule(SBModule module) { - return DebugClient.getId(module); - } - - protected static String keyModule(SBModule module) { - return PathUtils.makeKey(indexModule(module)); - } - - protected final SBTarget session; - - protected final LldbModelTargetSymbolContainerImpl symbols; - protected final LldbModelTargetModuleSectionContainerImpl sections; - - public LldbModelTargetModuleImpl(LldbModelTargetModuleContainerImpl modules, SBModule module) { - super(modules.getModel(), modules, keyModule(module), module, "Module"); - this.session = modules.session; - - this.symbols = new LldbModelTargetSymbolContainerImpl(this); - this.sections = new LldbModelTargetModuleSectionContainerImpl(this); - - SBFileSpec fspec = module.GetFileSpec(); - changeAttributes(List.of(), List.of( // - sections, // - symbols // - ), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDescription(0), // - SHORT_DISPLAY_ATTRIBUTE_NAME, fspec.GetFilename(), // - MODULE_NAME_ATTRIBUTE_NAME, fspec.GetDirectory() + "/" + fspec.GetFilename(), // - "ImageName", fspec.GetDirectory() + "/" + fspec.GetFilename(), // - "UUID", module.GetUUIDString() // - /* - "BaseAddress", space.getAddress(module.getKnownBase()), // - "TimeStamp", module.getTimeStamp(), // - "Len", Integer.toHexString(module.getSize()) // - */ - ), "Initialized"); - - } - - public String getDescription(int level) { - SBStream stream = new SBStream(); - SBModule module = (SBModule) getModelObject(); - module.GetDescription(stream); - return stream.GetData(); - } - - protected Address doGetBase() { - return null; //getModel().getAddressSpace("ram").getAddress(module.getKnownBase()); - } - - @Override - public SBModule getModule() { - return (SBModule) getModelObject(); - } - - public SBTarget getSession() { - return session; - } - - @Override - public void setRange(AddressRangeImpl range) { - if (range != null) { - changeAttributes(List.of(), List.of(), Map.of( // - RANGE_ATTRIBUTE_NAME, range, // - "BaseAddress", range.getMinAddress(), // - "Len", Long.toHexString(range.getLength()) // - ), "Initialized"); - } - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetModuleSectionContainerImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetModuleSectionContainerImpl.java deleted file mode 100644 index 3c0f7428f6..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetModuleSectionContainerImpl.java +++ /dev/null @@ -1,104 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import SWIG.SBModule; -import SWIG.SBSection; -import agent.lldb.model.iface2.*; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.*; -import ghidra.program.model.address.Address; -import ghidra.program.model.address.AddressRangeImpl; - -@TargetObjectSchemaInfo( - name = "SectionContainer", - elements = { - @TargetElementType(type = LldbModelTargetModuleSectionImpl.class) }, - attributes = { - @TargetAttributeType(type = Void.class) }, - canonicalContainer = true) -public class LldbModelTargetModuleSectionContainerImpl extends LldbModelTargetObjectImpl - implements LldbModelTargetModuleSectionContainer { - - protected final LldbModelTargetModule module; - - public LldbModelTargetModuleSectionContainerImpl(LldbModelTargetModule module) { - super(module.getModel(), module, "Sections", "ModuleSections"); - this.module = module; - requestElements(RefreshBehavior.REFRESH_NEVER); - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - return getManager().listModuleSections(module.getModule()).thenAccept(byStart -> { - List sections; - synchronized (this) { - sections = byStart.values() - .stream() - .map(this::getModuleSection) - .collect(Collectors.toList()); - setElements(sections, "Refreshed"); - updateRange(); - } - }); - } - - protected synchronized LldbModelTargetModuleSection getModuleSection(SBSection section) { - TargetObject targetObject = getMapObject(section); - if (targetObject != null) { - LldbModelTargetModuleSection targetSection = - (LldbModelTargetModuleSection) targetObject; - targetSection.setModelObject(section); - return targetSection; - } - return new LldbModelTargetModuleSectionImpl(this, section); - } - - public void updateRange() { - Map elements = getCachedElements(); - Address min = null; - Address max = null; - for (TargetObject element : elements.values()) { - LldbModelTargetModuleSectionImpl section = (LldbModelTargetModuleSectionImpl) element; - Address start = section.getStart(); - if (start.getOffset() > 0) { - if (min == null || min.getOffset() > start.getOffset()) { - min = start; - } - } - Address stop = section.getEnd(); - if (stop.getOffset() > 0) { - if (max == null || max.getOffset() < stop.getOffset()) { - max = stop; - } - } - } - if (min != null && max != null) { - module.setRange(new AddressRangeImpl(min, max)); - } - } - - public SBModule getModule() { - return module.getModule(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetModuleSectionImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetModuleSectionImpl.java deleted file mode 100644 index f7f0c5130a..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetModuleSectionImpl.java +++ /dev/null @@ -1,87 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import java.util.List; -import java.util.Map; - -import SWIG.*; -import agent.lldb.model.iface2.LldbModelTargetModuleSection; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.util.PathUtils; -import ghidra.program.model.address.*; - -@TargetObjectSchemaInfo( - name = "Section", - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType(type = Object.class) }) -public class LldbModelTargetModuleSectionImpl extends LldbModelTargetObjectImpl - implements LldbModelTargetModuleSection { - - protected static String keySection(SBSection section) { - return PathUtils.makeKey(section.GetName()); - } - - protected static final String OBJFILE_ATTRIBUTE_NAME = PREFIX_INVISIBLE + "objfile"; - - protected AddressRange range; - - public LldbModelTargetModuleSectionImpl(LldbModelTargetModuleSectionContainerImpl sections, - SBSection section) { - super(sections.getModel(), sections, keySection(section), section, "Section"); - - AddressSpace space = getModel().getAddressSpace("ram"); - Address min = space.getAddress(0L); - SBTarget currentSession = getManager().getCurrentSession(); - long lval = section.GetLoadAddress(currentSession).longValue(); - if (lval != -1) { - min = space.getAddress(lval); - } - // Ghidra ranges are not inclusive at the end. - long sz = section.GetFileByteSize().longValue(); - Address max = min.add(sz); - range = new AddressRangeImpl(min, max); - if (range != null) { - changeAttributes(List.of(), List.of(), Map.of( // - RANGE_ATTRIBUTE_NAME, range // - ), "Initialized"); - } - - changeAttributes(List.of(), List.of(), Map.of( // - MODULE_ATTRIBUTE_NAME, sections.getParent(), // - DISPLAY_ATTRIBUTE_NAME, getDescription(0), // - "Address", min, // - "File Offset", section.GetFileOffset().toString(16), // - "Size", Long.toHexString(sz), // - "Permissions", section.GetPermissions() // - ), "Initialized"); - } - - public String getDescription(int level) { - SBStream stream = new SBStream(); - SBSection section = (SBSection) getModelObject(); - section.GetDescription(stream); - return stream.GetData(); - } - - @Override - public AddressRange getRange() { - return range; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetObjectImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetObjectImpl.java deleted file mode 100644 index b7a950889e..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetObjectImpl.java +++ /dev/null @@ -1,270 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import SWIG.StateType; -import agent.lldb.lldb.DebugClient; -import agent.lldb.manager.LldbCause; -import agent.lldb.manager.LldbStateListener; -import agent.lldb.model.AbstractLldbModel; -import agent.lldb.model.iface1.LldbModelTargetAccessConditioned; -import agent.lldb.model.iface1.LldbModelTargetExecutionStateful; -import agent.lldb.model.iface2.*; -import ghidra.dbg.agent.DefaultTargetObject; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetExecutionStateful.TargetExecutionState; -import ghidra.dbg.target.schema.TargetObjectSchema; - -public class LldbModelTargetObjectImpl extends DefaultTargetObject - implements LldbModelTargetObject { - - protected boolean accessible = true; - protected final LldbStateListener accessListener = this::checkExited; - private boolean modified; - - private Object modelObject; - protected Map objectMap = new HashMap<>(); - - public LldbModelTargetObjectImpl(AbstractLldbModel impl, TargetObject parent, String name, - String typeHint) { - super(impl, parent, name, typeHint); - inheritModelObject((LldbModelTargetObject) parent); - getManager().addStateListener(accessListener); - } - - public LldbModelTargetObjectImpl(AbstractLldbModel impl, TargetObject parent, String name, - Object modelObject, - String typeHint) { - super(impl, parent, name, typeHint); - this.setModelObject(modelObject); - getManager().addStateListener(accessListener); - } - - public LldbModelTargetObjectImpl(AbstractLldbModel impl, TargetObject parent, String name, - Object modelObject, - String typeHint, TargetObjectSchema schema) { - super(impl, parent, name, typeHint, schema); - this.setModelObject(modelObject); - getManager().addStateListener(accessListener); - } - - public void setAttribute(String key, String value) { - changeAttributes(List.of(), List.of(), Map.of( // - key, value), "Initialized"); - } - - @Override - protected void doInvalidate(TargetObject branch, String reason) { - super.doInvalidate(branch, reason); - getManager().removeStateListener(accessListener); - } - - public void setAccessible(boolean accessible) { - synchronized (attributes) { - if (this.accessible == accessible) { - return; - } - this.accessible = accessible; - } - if (this instanceof LldbModelTargetAccessConditioned) { - changeAttributes(List.of(), List.of(), Map.of( // - TargetAccessConditioned.ACCESSIBLE_ATTRIBUTE_NAME, accessible // - ), "Accessibility changed"); - } - } - - @Override - public AbstractLldbModel getModel() { - return (AbstractLldbModel) model; - } - - public void onRunning() { - setAccessible(false); - } - - public void onStopped() { - setAccessible(true); - } - - public void onExit() { - setAccessible(true); - } - - protected void checkExited(StateType state, LldbCause cause) { - TargetExecutionState exec = TargetExecutionState.INACTIVE; - switch (state.swigValue()) { - case 0: // eStateInvalid - case 9: // eStateDetached - { - exec = TargetExecutionState.INACTIVE; - break; - } - case 1: // eStateUnloaded - case 2: // eStateConnected - case 3: // eStateAttaching - case 4: // eStateLaunching - { - exec = TargetExecutionState.ALIVE; - break; - } - case 5: { // eStateStopped - exec = TargetExecutionState.STOPPED; - onStopped(); - break; - } - case 6: // eStateRunning - case 7: // eStateStepping - { - exec = TargetExecutionState.RUNNING; - resetModified(); - onRunning(); - break; - } - case 10: { // eStateExited - exec = TargetExecutionState.TERMINATED; - if (getParentProcess() != null || this instanceof TargetProcess) { - getManager().removeStateListener(accessListener); - } - onExit(); - break; - } - case 8: // eStateCrashed - { - getModel().close(); - return; - } - } - if (this instanceof LldbModelTargetExecutionStateful) { - LldbModelTargetExecutionStateful stateful = (LldbModelTargetExecutionStateful) this; - stateful.setExecutionState(exec, "Refreshed"); - } - } - - @Override - public CompletableFuture> requestNativeAttributes() { - throw new AssertionError(); // shouldn't ever be here - } - - @Override - public CompletableFuture> requestNativeElements() { - throw new AssertionError(); // shouldn't ever be here - } - - @Override - public LldbModelTargetSession getParentSession() { - LldbModelTargetObject test = (LldbModelTargetObject) parent; - while (test != null && !(test instanceof LldbModelTargetSession)) { - test = (LldbModelTargetObject) test.getParent(); - } - return test == null ? null : (LldbModelTargetSession) test; - } - - @Override - public LldbModelTargetProcess getParentProcess() { - LldbModelTargetObject test = (LldbModelTargetObject) parent; - while (test != null && !(test instanceof TargetProcess)) { - test = (LldbModelTargetObject) test.getParent(); - } - return test == null ? null : (LldbModelTargetProcess) test; - } - - @Override - public LldbModelTargetThread getParentThread() { - LldbModelTargetObject test = (LldbModelTargetObject) parent; - while (test != null && !(test instanceof TargetThread)) { - test = (LldbModelTargetObject) test.getParent(); - } - return test == null ? null : (LldbModelTargetThread) test; - } - - @Override - public void setModified(Map map, boolean b) { - if (modified) { - map.put(MODIFIED_ATTRIBUTE_NAME, modified); - } - } - - @Override - public void setModified(boolean modified) { - if (modified) { - changeAttributes(List.of(), List.of(), Map.of( // - MODIFIED_ATTRIBUTE_NAME, modified // - ), "Refreshed"); - } - } - - @Override - public void resetModified() { - changeAttributes(List.of(), List.of(), Map.of( // - MODIFIED_ATTRIBUTE_NAME, false // - ), "Refreshed"); - } - - public TargetObject searchForSuitable(Class type) { - List pathToClass = model.getRootSchema().searchForSuitable(type, path); - return model.getModelObject(pathToClass); - } - - public String getDescription(int level) { - return getName(); - } - - @Override - public Object getModelObject() { - return modelObject; - } - - public void inheritModelObject(LldbModelTargetObject parent) { - this.modelObject = parent.getModelObject(); - } - - @Override - public void setModelObject(Object modelObject) { - if (modelObject != null) { - ((LldbModelTargetObject) parent).addMapObject(modelObject, this); - } - this.modelObject = modelObject; - } - - @Override - public void addMapObject(Object object, TargetObject targetObject) { - if (object == null) { - return; - } - String modelKey = DebugClient.getModelKey(object); - objectMap.put(modelKey, targetObject); - } - - @Override - public TargetObject getMapObject(Object object) { - if (object == null) { - return null; - } - return objectMap.get(DebugClient.getModelKey(object)); - } - - @Override - public void deleteMapObject(Object object) { - if (object == null) { - return; - } - objectMap.remove(DebugClient.getModelKey(object)); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetProcessAttachByNameConnectorImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetProcessAttachByNameConnectorImpl.java deleted file mode 100644 index 8e9ab0445b..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetProcessAttachByNameConnectorImpl.java +++ /dev/null @@ -1,90 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import agent.lldb.model.iface2.LldbModelTargetConnector; -import ghidra.async.AsyncUtils; -import ghidra.async.TypeSpec; -import ghidra.dbg.error.DebuggerUserException; -import ghidra.dbg.target.TargetMethod; -import ghidra.dbg.target.TargetMethod.ParameterDescription; -import ghidra.dbg.target.TargetMethod.TargetParameterMap; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "ProcessAttachByNameConnector", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(type = Void.class) - }) -public class LldbModelTargetProcessAttachByNameConnectorImpl extends LldbModelTargetObjectImpl - implements LldbModelTargetConnector { - - protected final LldbModelTargetConnectorContainerImpl connectors; - protected final TargetParameterMap paramDescs; - - public LldbModelTargetProcessAttachByNameConnectorImpl( - LldbModelTargetConnectorContainerImpl connectors, - String name) { - super(connectors.getModel(), connectors, name, name); - this.connectors = connectors; - - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDisplay(), // - TargetMethod.PARAMETERS_ATTRIBUTE_NAME, - paramDescs = TargetParameterMap.copyOf(computeParameters()) // - ), "Initialized"); - } - - @Override - public CompletableFuture setActive() { - connectors.setDefaultConnector(this); - return CompletableFuture.completedFuture(null); - } - - protected Map> computeParameters() { - HashMap> map = - new HashMap>(); - ParameterDescription p0 = ParameterDescription.create( - String.class, "Name", true, "", "Name", "name for the target process"); - map.put("Name", p0); - ParameterDescription p1 = ParameterDescription.create( - Boolean.class, "Exists", false, true, "Exists", "target process is running"); - map.put("Exists", p1); - return map; - } - - @Override - public TargetParameterMap getParameters() { - return TargetMethod.getParameters(this); - } - - @Override - public CompletableFuture launch(Map args) { - String name = (String) args.get("Name"); - Boolean exists = (Boolean) args.get("Exists"); - return AsyncUtils.sequence(TypeSpec.VOID).then(seq -> { - getManager().attach(name, !exists).handle(seq::nextIgnore); - }).finish().exceptionally((exc) -> { - throw new DebuggerUserException("Launch failed for " + args); - }); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetProcessAttachByPathConnectorImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetProcessAttachByPathConnectorImpl.java deleted file mode 100644 index 13d4ac62e3..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetProcessAttachByPathConnectorImpl.java +++ /dev/null @@ -1,94 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import agent.lldb.model.iface2.LldbModelTargetConnector; -import ghidra.async.AsyncUtils; -import ghidra.async.TypeSpec; -import ghidra.dbg.error.DebuggerUserException; -import ghidra.dbg.target.TargetMethod; -import ghidra.dbg.target.TargetMethod.ParameterDescription; -import ghidra.dbg.target.TargetMethod.TargetParameterMap; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "ProcessAttachByPathConnector", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(type = Void.class) - }) -public class LldbModelTargetProcessAttachByPathConnectorImpl extends LldbModelTargetObjectImpl - implements LldbModelTargetConnector { - - protected final LldbModelTargetConnectorContainerImpl connectors; - protected final TargetParameterMap paramDescs; - - public LldbModelTargetProcessAttachByPathConnectorImpl( - LldbModelTargetConnectorContainerImpl connectors, - String name) { - super(connectors.getModel(), connectors, name, name); - this.connectors = connectors; - - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDisplay(), // - TargetMethod.PARAMETERS_ATTRIBUTE_NAME, - paramDescs = TargetParameterMap.copyOf(computeParameters()) // - ), "Initialized"); - } - - @Override - public CompletableFuture setActive() { - connectors.setDefaultConnector(this); - return CompletableFuture.completedFuture(null); - } - - protected Map> computeParameters() { - HashMap> map = - new LinkedHashMap>(); - ParameterDescription p0 = ParameterDescription.create( - String.class, "Path", true, "", "Path", "path for the target process"); - map.put("Path", p0); - ParameterDescription p1 = ParameterDescription.create( - Boolean.class, "Exists", false, true, "Exists", "target process is running"); - map.put("Exists", p1); - ParameterDescription p2 = ParameterDescription.create( - Boolean.class, "Async", false, true, "Async", "connect asynchronously"); - map.put("Async", p2); - return map; - } - - @Override - public TargetParameterMap getParameters() { - return TargetMethod.getParameters(this); - } - - @Override - public CompletableFuture launch(Map args) { - String path1 = (String) args.get("Path"); - Boolean exists = (Boolean) args.get("Exists"); - Boolean async = (Boolean) args.get("Async"); - return AsyncUtils.sequence(TypeSpec.VOID).then(seq -> { - getManager().attach(path1, !exists, async).handle(seq::nextIgnore); - }).finish().exceptionally((exc) -> { - throw new DebuggerUserException("Launch failed for " + args); - }); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetProcessAttachByPidConnectorImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetProcessAttachByPidConnectorImpl.java deleted file mode 100644 index 232768d145..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetProcessAttachByPidConnectorImpl.java +++ /dev/null @@ -1,86 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import agent.lldb.model.iface2.LldbModelTargetConnector; -import ghidra.async.AsyncUtils; -import ghidra.async.TypeSpec; -import ghidra.dbg.error.DebuggerUserException; -import ghidra.dbg.target.TargetMethod; -import ghidra.dbg.target.TargetMethod.ParameterDescription; -import ghidra.dbg.target.TargetMethod.TargetParameterMap; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "ProcessAttachByPidConnector", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(type = Void.class) - }) -public class LldbModelTargetProcessAttachByPidConnectorImpl extends LldbModelTargetObjectImpl - implements LldbModelTargetConnector { - - protected final LldbModelTargetConnectorContainerImpl connectors; - protected final TargetParameterMap paramDescs; - - public LldbModelTargetProcessAttachByPidConnectorImpl( - LldbModelTargetConnectorContainerImpl connectors, - String name) { - super(connectors.getModel(), connectors, name, name); - this.connectors = connectors; - - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDisplay(), // - TargetMethod.PARAMETERS_ATTRIBUTE_NAME, - paramDescs = TargetParameterMap.copyOf(computeParameters()) // - ), "Initialized"); - } - - @Override - public CompletableFuture setActive() { - connectors.setDefaultConnector(this); - return CompletableFuture.completedFuture(null); - } - - protected Map> computeParameters() { - HashMap> map = - new HashMap>(); - ParameterDescription param = ParameterDescription.create(String.class, "Pid", true, - "", "Pid", "process id for the target process"); - map.put("Pid", param); - return map; - } - - @Override - public TargetParameterMap getParameters() { - return TargetMethod.getParameters(this); - } - - @Override - public CompletableFuture launch(Map args) { - String pidstr = (String) args.get("Pid"); - return AsyncUtils.sequence(TypeSpec.VOID).then(seq -> { - getManager().attach(pidstr).handle(seq::nextIgnore); - }).finish().exceptionally((exc) -> { - throw new DebuggerUserException("Launch failed for " + args); - }); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetProcessContainerImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetProcessContainerImpl.java deleted file mode 100644 index ead16c72b0..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetProcessContainerImpl.java +++ /dev/null @@ -1,192 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import SWIG.*; -import agent.lldb.lldb.DebugClient; -import agent.lldb.lldb.DebugModuleInfo; -import agent.lldb.manager.LldbCause; -import agent.lldb.manager.LldbReason; -import agent.lldb.model.iface1.LldbModelTargetConfigurable; -import agent.lldb.model.iface2.*; -import ghidra.async.AsyncUtils; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.error.DebuggerIllegalArgumentException; -import ghidra.dbg.target.TargetConfigurable; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "ProcessContainer", - elements = { // - @TargetElementType(type = LldbModelTargetProcessImpl.class) // - }, - attributes = { // - @TargetAttributeType(name = TargetConfigurable.BASE_ATTRIBUTE_NAME, type = Integer.class), // - @TargetAttributeType(type = Void.class) // - }, - canonicalContainer = true) -public class LldbModelTargetProcessContainerImpl extends LldbModelTargetObjectImpl - implements LldbModelTargetProcessContainer, LldbModelTargetConfigurable { - - private LldbModelTargetSessionImpl session; - - public LldbModelTargetProcessContainerImpl(LldbModelTargetSessionImpl session) { - super(session.getModel(), session, "Processes", "ProcessContainer"); - this.session = session; - this.changeAttributes(List.of(), Map.of(BASE_ATTRIBUTE_NAME, 16), "Initialized"); - - getManager().addEventsListener(this); - } - - @Override - public void processAdded(SBProcess proc, LldbCause cause) { - LldbModelTargetSession session = (LldbModelTargetSession) getParent(); - SBTarget parentTarget = (SBTarget) session.getModelObject(); - SBTarget procTarget = proc.GetTarget(); - if (!DebugClient.getId(parentTarget).equals(DebugClient.getId(procTarget))) { - return; - } - session.setAccessible(true); - LldbModelTargetProcess process = getTargetProcess(proc); - changeElements(List.of(), List.of(process), Map.of(), "Added"); - process.processStarted(proc); - broadcast().event(getProxy(), null, TargetEventType.PROCESS_CREATED, - "Process " + DebugClient.getId(proc) + " started " + process.getName(), - List.of(process)); - } - - @Override - public void processReplaced(SBProcess proc, LldbCause cause) { - LldbModelTargetSession session = (LldbModelTargetSession) getParent(); - session.setAccessible(true); - LldbModelTargetProcess process = getTargetProcess(proc); - changeElements(List.of(), List.of(process), Map.of(), "Added"); - } - - @Override - public void processStarted(SBProcess proc, LldbCause cause) { - LldbModelTargetProcess process = getTargetProcess(proc); - process.processStarted(proc); - } - - @Override - public void processRemoved(String processId, LldbCause cause) { - changeElements(List.of( // - processId // - ), List.of(), Map.of(), "Removed"); - } - - @Override - public void threadCreated(SBThread thread, LldbCause cause) { - LldbModelTargetProcess process = getTargetProcess(thread.GetProcess()); - LldbModelTargetThreadContainer threads = process.getThreads(); - if (threads != null) { - threads.threadCreated(thread); - } - } - - @Override - public void threadReplaced(SBThread thread, LldbCause cause) { - LldbModelTargetProcess process = getTargetProcess(thread.GetProcess()); - process.getThreads().threadReplaced(thread); - } - - @Override - public void threadStateChanged(SBThread thread, StateType state, LldbCause cause, - LldbReason reason) { - LldbModelTargetProcess process = getTargetProcess(thread.GetProcess()); - process.threadStateChanged(thread, state, cause, reason); - } - - @Override - public void threadExited(SBThread thread, SBProcess proc, LldbCause cause) { - LldbModelTargetProcess process = getTargetProcess(proc); - if (process != null) { - process.getThreads().threadExited(thread); - } - } - - @Override - public void moduleLoaded(SBProcess proc, DebugModuleInfo info, int index, LldbCause cause) { - LldbModelTargetModuleContainer modules = session.getModules(); - if (modules != null) { - modules.libraryLoaded(info, index); - } - } - - @Override - public void moduleUnloaded(SBProcess proc, DebugModuleInfo info, int index, LldbCause cause) { - LldbModelTargetModuleContainer modules = session.getModules(); - if (modules != null) { - modules.libraryUnloaded(info, index); - } - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - return getManager().listProcesses(session.getSession()).thenAccept(byIID -> { - List processes; - synchronized (this) { - processes = byIID.values() - .stream() - .map(this::getTargetProcess) - .collect(Collectors.toList()); - } - setElements(processes, Map.of(), "Refreshed"); - }); - } - - @Override - public synchronized LldbModelTargetProcess getTargetProcess(SBProcess process) { - TargetObject targetObject = getMapObject(process); - if (targetObject != null) { - LldbModelTargetProcess targetProcess = (LldbModelTargetProcess) targetObject; - targetProcess.setModelObject(process); - return targetProcess; - } - return new LldbModelTargetProcessImpl(this, process); - } - - @Override - public CompletableFuture writeConfigurationOption(String key, Object value) { - switch (key) { - case BASE_ATTRIBUTE_NAME: - if (value instanceof Integer) { - this.changeAttributes(List.of(), Map.of(BASE_ATTRIBUTE_NAME, value), - "Modified"); - for (TargetObject child : getCachedElements().values()) { - if (child instanceof LldbModelTargetProcessImpl) { - LldbModelTargetProcessImpl targetProcess = - (LldbModelTargetProcessImpl) child; - targetProcess.setBase(value); - } - } - } - else { - throw new DebuggerIllegalArgumentException("Base should be numeric"); - } - default: - } - return AsyncUtils.nil(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetProcessImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetProcessImpl.java deleted file mode 100644 index 7b25f6a5e6..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetProcessImpl.java +++ /dev/null @@ -1,293 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import SWIG.*; -import agent.lldb.lldb.DebugClient; -import agent.lldb.manager.LldbCause; -import agent.lldb.manager.LldbReason; -import agent.lldb.manager.cmd.*; -import agent.lldb.manager.impl.LldbManagerImpl; -import agent.lldb.model.iface1.LldbModelTargetFocusScope; -import agent.lldb.model.iface2.*; -import ghidra.async.AsyncUtils; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetEventScope.TargetEventType; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; -import ghidra.dbg.util.PathUtils; - -@TargetObjectSchemaInfo( - name = "Process", - attributeResync = ResyncMode.ALWAYS, - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType( - name = "Memory", - type = LldbModelTargetMemoryContainerImpl.class, - required = true, - fixed = true), - @TargetAttributeType( - name = "Threads", - type = LldbModelTargetThreadContainerImpl.class, - required = true, - fixed = true), - @TargetAttributeType( - name = "Breakpoints", - type = LldbModelTargetBreakpointLocationContainerImpl.class, - required = true, - fixed = true), - @TargetAttributeType( - name = LldbModelTargetProcessImpl.EXIT_CODE_ATTRIBUTE_NAME, - type = String.class), - @TargetAttributeType(type = Void.class) }) -public class LldbModelTargetProcessImpl extends LldbModelTargetObjectImpl - implements LldbModelTargetProcess { - - public static final String PID_ATTRIBUTE_NAME = PREFIX_INVISIBLE + "pid"; - public static final String EXIT_CODE_ATTRIBUTE_NAME = PREFIX_INVISIBLE + "exit_code"; - - public static final TargetAttachKindSet SUPPORTED_KINDS = TargetAttachKindSet.of( // - TargetAttachKind.BY_OBJECT_REF, TargetAttachKind.BY_ID); - - protected static String indexProcess(SBProcess process) { - return DebugClient.getId(process); - } - - protected static String keyProcess(SBProcess process) { - return PathUtils.makeKey(indexProcess(process)); - } - - protected final LldbModelTargetMemoryContainerImpl memory; - protected final LldbModelTargetThreadContainerImpl threads; - protected final LldbModelTargetBreakpointLocationContainerImpl breakpoints; - // Note: not sure section info is available from the lldb - //protected final LldbModelTargetProcessSectionContainer sections; - - private Integer base = 16; - - public LldbModelTargetProcessImpl(LldbModelTargetProcessContainer processes, - SBProcess process) { - super(processes.getModel(), processes, keyProcess(process), process, "Process"); - getModel().addModelObject(process, this); - getManager().getClient().addBroadcaster(process); - - this.memory = new LldbModelTargetMemoryContainerImpl(this); - this.threads = new LldbModelTargetThreadContainerImpl(this); - this.breakpoints = new LldbModelTargetBreakpointLocationContainerImpl(this); - TargetExecutionState state = DebugClient.convertState(process.GetState()); - - changeAttributes(List.of(), List.of( // - memory, // - threads, // - breakpoints // - ), Map.of( // - ACCESSIBLE_ATTRIBUTE_NAME, accessible = false, // - DISPLAY_ATTRIBUTE_NAME, getDisplay(), // - TargetMethod.PARAMETERS_ATTRIBUTE_NAME, PARAMETERS, // - STATE_ATTRIBUTE_NAME, state, // - SUPPORTED_ATTACH_KINDS_ATTRIBUTE_NAME, SUPPORTED_KINDS, // - SUPPORTED_STEP_KINDS_ATTRIBUTE_NAME, LldbModelTargetThreadImpl.SUPPORTED_KINDS // - ), "Initialized"); - setExecutionState(state, "Initialized"); - - getManager().addEventsListener(this); - } - - @Override - public void setModelObject(Object modelObject) { - super.setModelObject(modelObject); - getModel().addModelObject(modelObject, this); - } - - @Override - public String getDescription(int level) { - SBStream stream = new SBStream(); - SBProcess process = (SBProcess) getModelObject(); - process.GetDescription(stream); - return stream.GetData(); - } - - @Override - public String getDisplay() { - String pidstr = DebugClient.getId(getProcess()); - if (base == 16) { - pidstr = "0x" + pidstr; - } - else { - pidstr = Long.toString(Long.parseLong(pidstr, 16)); - } - return "[" + pidstr + "]"; - } - - @Override - public void processSelected(SBProcess eventProcess, LldbCause cause) { - if (eventProcess.GetProcessID().equals(getProcess().GetProcessID())) { - ((LldbModelTargetFocusScope) searchForSuitable(TargetFocusScope.class)).setFocus(this); - } - } - - @Override - public void threadStateChanged(SBThread thread, StateType state, LldbCause cause, - LldbReason reason) { - TargetExecutionState targetState = DebugClient.convertState(state); - setExecutionState(targetState, "ThreadStateChanged"); - if (state.equals(StateType.eStateStopped)) { - threads.requestElements(RefreshBehavior.REFRESH_ALWAYS); - StopReason stopReason = getManager().getCurrentThread().GetStopReason(); - if (!stopReason.equals(StopReason.eStopReasonPlanComplete)) { - memory.requestElements(RefreshBehavior.REFRESH_ALWAYS); - } - } - } - - @Override - public CompletableFuture launch(List args) { - model.gateFuture(getManager().execute(new LldbLaunchProcessCommand(getManager(), - getProcess().GetProcessInfo().GetName(), args))); - return AsyncUtils.nil(); - } - - @Override - public CompletableFuture resume() { - return model.gateFuture( - getManager().execute(new LldbContinueCommand(getManager(), getProcess()))); - } - - @Override - public CompletableFuture kill() { - return model.gateFuture(getManager().execute(new LldbKillCommand(getManager()))); - } - - @Override - public CompletableFuture destroy() { - return model.gateFuture(getManager().execute(new LldbDestroyCommand(getManager()))); - } - - @Override - public CompletableFuture attach(TargetAttachable attachable) { - getModel().assertMine(TargetObject.class, attachable); - // NOTE: Get the object and type check it myself. - // The typed ref could have been unsafely cast - SBProcess proc = (SBProcess) getModelObject(); - long pid = proc.GetProcessID().longValue(); - return model.gateFuture( - getManager().execute(new LldbAttachCommand(getManager(), Long.toString(pid))) - .thenApply(__ -> null)); - } - - @Override - public CompletableFuture attach(long pid) { - return model.gateFuture( - getManager().execute(new LldbAttachCommand(getManager(), Long.toString(pid))) - .thenApply(__ -> null)); - } - - @Override - public CompletableFuture detach() { - return model.gateFuture( - getManager().execute(new LldbDetachCommand(getManager(), getProcess()))); - } - - @Override - public CompletableFuture delete() { - return AsyncUtils.nil(); - //return model.gateFuture(process.remove()); - } - - @Override - public CompletableFuture step(TargetStepKind kind) { - LldbManagerImpl manager = getManager(); - return getManager().execute(new LldbStepCommand(manager, null, kind, null)); - } - - @Override - public CompletableFuture step(Map args) { - LldbManagerImpl manager = getManager(); - return getManager().execute(new LldbStepCommand(manager, null, null, args)); - } - - @Override - public void processStarted(SBProcess proc) { - if (proc != null) { - changeAttributes(List.of(), List.of(), Map.of( // - PID_ATTRIBUTE_NAME, getProcess().GetProcessID().longValue(), // - DISPLAY_ATTRIBUTE_NAME, getDisplay(), // - STATE_ATTRIBUTE_NAME, TargetExecutionState.STOPPED // - ), "Started"); - } - setExecutionState(TargetExecutionState.STOPPED, "Started"); - } - - @Override - public void processExited(SBProcess proc, LldbCause cause) { - if (proc.GetProcessID().equals(this.getProcess().GetProcessID())) { - String exitDesc = proc.GetExitDescription(); - if (exitDesc == null) { - exitDesc = "NONE"; - } - changeAttributes(List.of(), List.of(), Map.of( // - STATE_ATTRIBUTE_NAME, TargetExecutionState.TERMINATED, // - EXIT_CODE_ATTRIBUTE_NAME, exitDesc // - ), "Exited"); - broadcast().event(getProxy(), null, TargetEventType.PROCESS_EXITED, - "Process " + DebugClient.getId(getProcess()) + " exited code=" + exitDesc, - List.of(getProxy())); - } - } - - @Override - public CompletableFuture setActive() { - return getManager().setActiveProcess(getProcess()); - } - - @Override - public LldbModelTargetThreadContainer getThreads() { - return threads; - } - - @Override - public SBProcess getProcess() { - return (SBProcess) getModelObject(); - } - - @Override - public boolean isAccessible() { - return accessible; - } - - public void setBase(Object value) { - this.base = (Integer) value; - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDisplay()// - ), "Started"); - } - - public void addBreakpointLocation(LldbModelTargetBreakpointLocation loc) { - breakpoints.addBreakpointLocation(loc); - } - - public void removeBreakpointLocation(LldbModelTargetBreakpointLocation loc) { - breakpoints.removeBreakpointLocation(loc); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetProcessLaunchConnectorImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetProcessLaunchConnectorImpl.java deleted file mode 100644 index 052f3caa98..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetProcessLaunchConnectorImpl.java +++ /dev/null @@ -1,97 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import agent.lldb.model.iface2.LldbModelTargetConnector; -import ghidra.async.AsyncUtils; -import ghidra.async.TypeSpec; -import ghidra.dbg.error.DebuggerUserException; -import ghidra.dbg.target.TargetMethod; -import ghidra.dbg.target.TargetMethod.ParameterDescription; -import ghidra.dbg.target.TargetMethod.TargetParameterMap; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetElementType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; - -@TargetObjectSchemaInfo( - name = "ProcessLaunchConnector", - elements = { // - @TargetElementType(type = Void.class) // - }, - attributes = { // - @TargetAttributeType(type = Void.class) // - }) -public class LldbModelTargetProcessLaunchConnectorImpl extends LldbModelTargetObjectImpl - implements LldbModelTargetConnector { - - protected final LldbModelTargetConnectorContainerImpl connectors; - protected final TargetParameterMap paramDescs; - - public LldbModelTargetProcessLaunchConnectorImpl( - LldbModelTargetConnectorContainerImpl connectors, - String name) { - super(connectors.getModel(), connectors, name, name); - this.connectors = connectors; - - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDisplay(), // - TargetMethod.PARAMETERS_ATTRIBUTE_NAME, - paramDescs = TargetParameterMap.copyOf(computeParameters()) // - ), "Initialized"); - } - - @Override - public CompletableFuture setActive() { - connectors.setDefaultConnector(this); - return CompletableFuture.completedFuture(null); - } - - protected Map> computeParameters() { - HashMap> map = - new HashMap>(); - ParameterDescription param = ParameterDescription.create(String.class, "args", true, - "", "Cmd", "executable to be launched"); - map.put("args", param); - return map; - } - - @Override - public TargetParameterMap getParameters() { - return TargetMethod.getParameters(this); - } - - @Override - public CompletableFuture launch(Map args) { - return launch( - CmdLineParser.tokenize(TargetCmdLineLauncher.PARAMETER_CMDLINE_ARGS.get(args))); - } - - public CompletableFuture launch(List args) { - String fileName = args.get(0); - List nargs = new ArrayList<>(); - for (int i = 1; i < args.size(); i++) { - nargs.add(args.get(i)); - } - return AsyncUtils.sequence(TypeSpec.VOID).then(seq -> { - getManager().launch(fileName, nargs).handle(seq::nextIgnore); - }).finish().exceptionally((exc) -> { - throw new DebuggerUserException("Launch failed for " + args); - }); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetProcessLaunchWithOptionsConnectorImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetProcessLaunchWithOptionsConnectorImpl.java deleted file mode 100644 index 9742aaa934..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetProcessLaunchWithOptionsConnectorImpl.java +++ /dev/null @@ -1,160 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import agent.lldb.model.iface2.LldbModelTargetConnector; -import ghidra.async.AsyncUtils; -import ghidra.async.TypeSpec; -import ghidra.dbg.error.DebuggerUserException; -import ghidra.dbg.target.TargetMethod; -import ghidra.dbg.target.TargetMethod.ParameterDescription; -import ghidra.dbg.target.TargetMethod.TargetParameterMap; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "ProcessLaunchWithOptionsConnector", - elements = { // - @TargetElementType(type = Void.class) // - }, - attributes = { // - @TargetAttributeType(type = Void.class) // - }) -public class LldbModelTargetProcessLaunchWithOptionsConnectorImpl extends LldbModelTargetObjectImpl - implements LldbModelTargetConnector { - - protected final LldbModelTargetConnectorContainerImpl connectors; - protected final TargetParameterMap paramDescs; - - public LldbModelTargetProcessLaunchWithOptionsConnectorImpl( - LldbModelTargetConnectorContainerImpl connectors, - String name) { - super(connectors.getModel(), connectors, name, name); - this.connectors = connectors; - - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDisplay(), // - TargetMethod.PARAMETERS_ATTRIBUTE_NAME, - paramDescs = TargetParameterMap.copyOf(computeParameters()) // - ), "Initialized"); - } - - @Override - public CompletableFuture setActive() { - connectors.setDefaultConnector(this); - return CompletableFuture.completedFuture(null); - } - - protected Map> computeParameters() { - HashMap> map = - new LinkedHashMap>(); - ParameterDescription p0 = ParameterDescription.create(String.class, "File", true, - "", "File", "executable to be launched"); - map.put("File", p0); - ParameterDescription p1 = ParameterDescription.create(String.class, "Args", false, - "", "Args", "command-line arguments"); - map.put("Args", p1); - ParameterDescription p2 = ParameterDescription.create(String.class, "Env", false, - "", "Env", "environment arguments"); - map.put("Env", p2); - ParameterDescription p3 = ParameterDescription.create(String.class, "STDIN", false, - "", "STDIN", "path for STDIN"); - map.put("STDIN", p3); - ParameterDescription p4 = ParameterDescription.create(String.class, "STDOUT", false, - "", "STDOUT", "path for STDOUT"); - map.put("STDOUT", p4); - ParameterDescription p5 = ParameterDescription.create(String.class, "STDERR", false, - "", "STDERR", "path for STDERR"); - map.put("STDERR", p5); - ParameterDescription p6 = ParameterDescription.create(String.class, "Dir", false, - "", "Dir", "working directory"); - map.put("Dir", p6); - - ParameterDescription pF0 = ParameterDescription.create(Boolean.class, "Exec", - false, - false, "Exec", "exec when launching and turn the calling process into a new process"); - map.put("Exec", pF0); - ParameterDescription pF1 = - ParameterDescription.create(Boolean.class, "BreakOnLaunch", false, - true, "Break on launch", - "stop as soon as the process launches to allow the process to be debugged"); - map.put("BreakOnLaunch", pF1); - ParameterDescription pF2 = ParameterDescription.create(Boolean.class, - "BreakOnEntry", false, - true, "Break on entry", "stop at the program entry point instead of auto-continuing"); - map.put("BreakOnEntry", pF2); - ParameterDescription pF3 = - ParameterDescription.create(Boolean.class, "ASLR", false, - false, "Disable ASLR", "disable Address Space Layout Randomization (ASLR)"); - map.put("ASLR", pF3); - ParameterDescription pF4 = - ParameterDescription.create(Boolean.class, "STDIO", false, - false, "Disable STDIO", "disable stdio for inferior process (e.g. for a GUI app)"); - map.put("STDIO", pF4); - ParameterDescription pF5 = - ParameterDescription.create(Boolean.class, "NewTTY", false, - false, "New TTY", "launch the process in a new TTY if supported by the host"); - map.put("NewTTY", pF5); - ParameterDescription pF6 = ParameterDescription.create(Boolean.class, "Shell", - false, - false, "Launch from shell", "launch the process inside a shell to get shell expansion"); - map.put("Shell", pF6); - ParameterDescription pF7 = ParameterDescription.create(Boolean.class, "NewGroup", - false, - false, "New group", - "launch the process in a separate process group if you are going to hand the process off (e.g. to debugserver)"); - map.put("NewGroup", pF7); - ParameterDescription pF8 = - ParameterDescription.create(Boolean.class, "ExitRace", false, - false, "Suppress race on exit", - "set this flag so lldb & the handee don't race to set its exit status"); - map.put("ExitRace", pF8); - ParameterDescription pF9 = ParameterDescription.create(Boolean.class, "Detach", - false, - false, "Detach on disconnect", - "client stub should detach rather than killing the debugee if it loses connection with lldb"); - map.put("Detach", pF9); - ParameterDescription pFA = - ParameterDescription.create(Boolean.class, "ExpandArgs", false, - false, "Shell-style expansion", "perform shell-style argument expansion"); - map.put("ExpandArgs", pFA); - ParameterDescription pFB = - ParameterDescription.create(Boolean.class, "CloseTTY", false, - false, "Close TTY on exit", "close the open TTY on exit"); - map.put("CloseTTY", pFB); - ParameterDescription pFC = - ParameterDescription.create(Boolean.class, "Inherit", false, - false, "Inherit TCC", "inherit TCC permissions from the parent"); - map.put("Inherit", pFC); - return map; - } - - @Override - public TargetParameterMap getParameters() { - return TargetMethod.getParameters(this); - } - - @Override - public CompletableFuture launch(Map args) { - return AsyncUtils.sequence(TypeSpec.VOID).then(seq -> { - getManager().launch(args).handle(seq::nextIgnore); - }).finish().exceptionally((exc) -> { - throw new DebuggerUserException("Launch failed for " + args); - }); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetProcessRemoteConnectorImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetProcessRemoteConnectorImpl.java deleted file mode 100644 index 17e9a15cbb..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetProcessRemoteConnectorImpl.java +++ /dev/null @@ -1,103 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import agent.lldb.model.iface2.LldbModelTargetConnector; -import ghidra.async.AsyncUtils; -import ghidra.async.TypeSpec; -import ghidra.dbg.error.DebuggerUserException; -import ghidra.dbg.target.TargetMethod; -import ghidra.dbg.target.TargetMethod.ParameterDescription; -import ghidra.dbg.target.TargetMethod.TargetParameterMap; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "ProcessRemoteConnector", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(type = Void.class) - }) -public class LldbModelTargetProcessRemoteConnectorImpl extends LldbModelTargetObjectImpl - implements LldbModelTargetConnector { - - protected final LldbModelTargetConnectorContainerImpl connectors; - protected final TargetParameterMap paramDescs; - - public LldbModelTargetProcessRemoteConnectorImpl( - LldbModelTargetConnectorContainerImpl connectors, - String name) { - super(connectors.getModel(), connectors, name, name); - this.connectors = connectors; - - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDisplay(), // - TargetMethod.PARAMETERS_ATTRIBUTE_NAME, - paramDescs = TargetParameterMap.copyOf(computeParameters()) // - ), "Initialized"); - } - - @Override - public CompletableFuture setActive() { - connectors.setDefaultConnector(this); - return CompletableFuture.completedFuture(null); - } - - protected Map> computeParameters() { - HashMap> map = - new LinkedHashMap>(); - ParameterDescription p0 = ParameterDescription.create( - String.class, "Host", true, "localhost", "Host", "host for connection"); - map.put("Host", p0); - ParameterDescription p1 = ParameterDescription.create( - String.class, "Port", true, "1234", "Port", "port for connection"); - map.put("Port", p1); - ParameterDescription p2 = ParameterDescription.create( - Boolean.class, "Auto", false, true, "Auto", "connect automatically"); - map.put("Auto", p2); - ParameterDescription p3 = ParameterDescription.create( - Boolean.class, "Async", false, true, "Async", "connect asynchronously"); - map.put("Async", p3); - ParameterDescription p4 = ParameterDescription.create( - Boolean.class, "Kernel", false, false, "Kernel", "use kernel plugin"); - map.put("Kernel", p4); - return map; - } - - @Override - public TargetParameterMap getParameters() { - return TargetMethod.getParameters(this); - } - - @Override - public CompletableFuture launch(Map args) { - String host = (String) args.get("Host"); - String port = (String) args.get("Port"); - String url = "connect://" + host + ":" + port; - Boolean auto = (Boolean) args.get("Auto"); - Boolean async = (Boolean) args.get("Async"); - Boolean kernel = (Boolean) args.get("Kernel"); - return AsyncUtils.sequence(TypeSpec.VOID).then(seq -> { - getManager().connect(url, auto, async, kernel).handle(seq::nextIgnore); - }).finish().exceptionally((exc) -> { - throw new DebuggerUserException("Launch failed for " + args); - }); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetRootImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetRootImpl.java deleted file mode 100644 index 2bb9aaabe7..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetRootImpl.java +++ /dev/null @@ -1,169 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import SWIG.SBThread; -import SWIG.StateType; -import agent.lldb.manager.LldbCause; -import agent.lldb.manager.LldbReason; -import agent.lldb.manager.cmd.LldbAttachCommand; -import agent.lldb.model.iface1.LldbModelSelectableObject; -import agent.lldb.model.iface2.*; -import ghidra.dbg.error.DebuggerUserException; -import ghidra.dbg.target.*; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.util.PathUtils; - -@TargetObjectSchemaInfo( - name = "Debugger", - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType( - name = "Available", - type = LldbModelTargetAvailableContainerImpl.class, - required = true, - fixed = true), - @TargetAttributeType( - name = "Connectors", - type = LldbModelTargetConnectorContainerImpl.class, - required = true, - fixed = true), - @TargetAttributeType( - name = "Sessions", - type = LldbModelTargetSessionContainerImpl.class, - required = true, - fixed = true), - @TargetAttributeType(type = Void.class) }) -public class LldbModelTargetRootImpl extends LldbModelDefaultTargetModelRoot - implements LldbModelTargetRoot { - - protected final LldbModelTargetAvailableContainerImpl available; - protected final LldbModelTargetConnectorContainerImpl connectors; - protected final LldbModelTargetSessionContainerImpl sessions; - - protected String debugger = "kd"; // Used by LldbModelTargetEnvironment - - protected LldbModelSelectableObject focus; - - public LldbModelTargetRootImpl(LldbModelImpl impl, TargetObjectSchema schema) { - super(impl, "Debugger", schema); - - this.available = new LldbModelTargetAvailableContainerImpl(this); - this.connectors = new LldbModelTargetConnectorContainerImpl(this); - this.sessions = new LldbModelTargetSessionContainerImpl(this); - - LldbModelTargetConnector defaultConnector = connectors.getDefaultConnector(); - changeAttributes(List.of(), List.of( // - available, // - connectors, // - sessions // - ), Map.of( // - ACCESSIBLE_ATTRIBUTE_NAME, accessible, // - DISPLAY_ATTRIBUTE_NAME, "Debugger", // - FOCUS_ATTRIBUTE_NAME, this, // - SUPPORTED_ATTACH_KINDS_ATTRIBUTE_NAME, LldbModelTargetProcessImpl.SUPPORTED_KINDS, // - TargetMethod.PARAMETERS_ATTRIBUTE_NAME, defaultConnector.getParameters() // - ), "Initialized"); - impl.getManager().addEventsListener(this); - } - - @Override - public LldbModelSelectableObject getFocus() { - return focus; - } - - @Override - public void setDefaultConnector(LldbModelTargetConnector defaultConnector) { - changeAttributes(List.of(), List.of(), - Map.of(TargetMethod.PARAMETERS_ATTRIBUTE_NAME, defaultConnector.getParameters()), - "Default connector changed"); - } - - @Override - public boolean setFocus(LldbModelSelectableObject sel) { - boolean doFire; - synchronized (this) { - doFire = !Objects.equals(this.focus, sel); - if (doFire && focus != null) { - List focusPath = focus.getPath(); - List selPath = sel.getPath(); - doFire = !PathUtils.isAncestor(selPath, focusPath); - } - } - if (doFire) { - this.focus = sel; - changeAttributes(List.of(), List.of(), Map.of( // - TargetFocusScope.FOCUS_ATTRIBUTE_NAME, focus // - ), "Focus changed"); - } - return doFire; - } - - @Override - public CompletableFuture launch(List args) { - LldbModelTargetProcessLaunchConnectorImpl targetConnector = connectors.processLauncher; - return model.gateFuture(targetConnector.launch(args)).exceptionally(exc -> { - throw new DebuggerUserException("Launch failed for " + args); - }); - } - - @Override - public CompletableFuture launch(Map args) { - LldbModelTargetConnector targetConnector = connectors.getDefaultConnector(); - return model.gateFuture(targetConnector.launch(args)).exceptionally(exc -> { - throw new DebuggerUserException("Launch failed for " + args); - }); - } - - @Override - public CompletableFuture attach(TargetAttachable attachable) { - LldbModelTargetProcessAttachByPidConnectorImpl targetConnector = - connectors.processAttacherByPid; - String key = attachable.getName(); - Map map = new HashMap<>(); - map.put("Pid", key.substring(1, key.length() - 1)); - return model.gateFuture(targetConnector.launch(map)).exceptionally(exc -> { - throw new DebuggerUserException("Launch failed for " + key); - }); - } - - @Override - public CompletableFuture attach(long pid) { - return model.gateFuture( - getManager().execute(new LldbAttachCommand(getManager(), Long.toString(pid))) - .thenApply(__ -> null)); - } - - @Override - public void threadStateChanged(SBThread thread, StateType state, LldbCause cause, - LldbReason reason) { - LldbModelTargetThread targetThread = - (LldbModelTargetThread) getModel().getModelObject(thread); - changeAttributes(List.of(), List.of(), Map.of( // - TargetEventScope.EVENT_OBJECT_ATTRIBUTE_NAME, targetThread // - ), reason.desc()); - } - - @Override - public boolean isAccessible() { - return accessible; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetSessionAttributesEnvironmentImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetSessionAttributesEnvironmentImpl.java deleted file mode 100644 index 20966e2ff9..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetSessionAttributesEnvironmentImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import java.util.List; - -import SWIG.SBTarget; -import agent.lldb.model.iface2.LldbModelTargetSessionAttributes; -import agent.lldb.model.iface2.LldbModelTargetSessionAttributesEnvironment; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "SessionAttributesEnvironment", - attributes = { - @TargetAttributeType(type = Object.class) - }) -public class LldbModelTargetSessionAttributesEnvironmentImpl extends LldbModelTargetObjectImpl - implements LldbModelTargetSessionAttributesEnvironment { - - SBTarget session; - - public LldbModelTargetSessionAttributesEnvironmentImpl( - LldbModelTargetSessionAttributes attributes) { - super(attributes.getModel(), attributes, "Environment", "SessionAttributesEnvironment"); - - session = (SBTarget) getModelObject(); - - getManager().addEventsListener(this); - getManager().listEnvironment(session).thenAccept(f -> { - setAttributes(List.of(), f, "Initialized"); - }); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetSessionAttributesImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetSessionAttributesImpl.java deleted file mode 100644 index 4cc1e1ad67..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetSessionAttributesImpl.java +++ /dev/null @@ -1,102 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import SWIG.ByteOrder; -import SWIG.SBTarget; -import agent.lldb.model.iface2.LldbModelTargetSession; -import agent.lldb.model.iface2.LldbModelTargetSessionAttributes; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "SessionAttributes", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType( - name = "Environment", - type = LldbModelTargetSessionAttributesEnvironmentImpl.class, - fixed = true), - @TargetAttributeType( - name = "Platform", - type = LldbModelTargetSessionAttributesPlatformImpl.class, - fixed = true), - @TargetAttributeType(type = Void.class) - }) -public class LldbModelTargetSessionAttributesImpl extends LldbModelTargetObjectImpl - implements LldbModelTargetSessionAttributes { - - protected final LldbModelTargetSessionAttributesPlatformImpl platformAttributes; - protected final LldbModelTargetSessionAttributesEnvironmentImpl environment; - - public LldbModelTargetSessionAttributesImpl(LldbModelTargetSession session) { - super(session.getModel(), session, "Attributes", "SessionAttributes"); - - this.platformAttributes = new LldbModelTargetSessionAttributesPlatformImpl(this); - this.environment = new LldbModelTargetSessionAttributesEnvironmentImpl(this); - - SBTarget target = (SBTarget) session.getModelObject(); - String[] triple = target.GetTriple().split("-"); - String arch = "x86_64"; - String manufacturer = "unknown"; - String os = System.getProperty("os.name").toLowerCase(); - if (triple.length == 3) { - arch = triple[0]; - manufacturer = triple[1]; - os = triple[2]; - } - ByteOrder order = target.GetByteOrder(); - String orderStr = "invalid"; - if (order.equals(ByteOrder.eByteOrderLittle)) { - orderStr = "little"; - } - if (order.equals(ByteOrder.eByteOrderBig)) { - orderStr = "big"; - } - if (order.equals(ByteOrder.eByteOrderPDP)) { - orderStr = "pdp"; - } - - changeAttributes(List.of(), List.of( // - platformAttributes, // - environment // - ), Map.of( // - ARCH_ATTRIBUTE_NAME, arch, // - DEBUGGER_ATTRIBUTE_NAME, "lldb", // - OS_ATTRIBUTE_NAME, os, // - ENDIAN_ATTRIBUTE_NAME, orderStr // - ), "Initialized"); - - getManager().addEventsListener(this); - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - return CompletableFuture.completedFuture(null); - } - - @Override - public void refreshInternal() { - platformAttributes.refreshInternal(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetSessionAttributesPlatformImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetSessionAttributesPlatformImpl.java deleted file mode 100644 index bc9ff133ba..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetSessionAttributesPlatformImpl.java +++ /dev/null @@ -1,127 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.atomic.AtomicReference; - -import SWIG.*; -import agent.lldb.lldb.DebugClient; -import agent.lldb.manager.LldbCause; -import agent.lldb.model.iface2.LldbModelTargetSessionAttributes; -import agent.lldb.model.iface2.LldbModelTargetSessionAttributesPlatform; -import ghidra.async.AsyncUtils; -import ghidra.async.TypeSpec; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetElementType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; - -@TargetObjectSchemaInfo( - name = "SessionAttributesPlatform", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(type = Object.class) - }) -public class LldbModelTargetSessionAttributesPlatformImpl extends LldbModelTargetObjectImpl - implements LldbModelTargetSessionAttributesPlatform { - - static String ARCH_ATTRIBUTE_NAME = "Arch"; - static String MANUFACTURER_ATTRIBUTE_NAME = "Manufacturer"; - static String OS_ATTRIBUTE_NAME = "OS"; - static String OS_MM_ATTRIBUTE_NAME = "Major:Minor"; - static String OS_DESC_ATTRIBUTE_NAME = "Description"; - static String DEBUGGER_ATTRIBUTE_NAME = "Debugger"; - static String BUILD_ATTRIBUTE_NAME = "Build"; - static String ENDIAN_ATTRIBUTE_NAME = "Endian"; - static String DIRECTORY_ATTRIBUTE_NAME = "Working Dir"; - - SBTarget session; - - public LldbModelTargetSessionAttributesPlatformImpl( - LldbModelTargetSessionAttributes attributes) { - super(attributes.getModel(), attributes, "Platform", "SessionAttributesPlatform"); - - session = (SBTarget) getModelObject(); - String[] triple = session.GetTriple().split("-"); - String arch = "x86_64"; - String manufacturer = "unknown"; - String os = System.getProperty("os.name").toLowerCase(); - if (triple.length == 3) { - arch = triple[0]; - manufacturer = triple[1]; - os = triple[2]; - } - ByteOrder order = session.GetByteOrder(); - SBPlatform platform = session.GetPlatform(); - - long major = platform.GetOSMajorVersion(); - long minor = platform.GetOSMinorVersion(); - String build = platform.GetOSBuild(); - if (build == null) { - build = "unknown"; - } - String desc = platform.GetOSDescription(); - if (desc == null) { - desc = "unknown"; - } - String wdir = platform.GetWorkingDirectory(); - if (wdir == null) { - wdir = "unknown"; - } - - changeAttributes(List.of(), List.of(), Map.of( // - ARCH_ATTRIBUTE_NAME, arch, // - MANUFACTURER_ATTRIBUTE_NAME, manufacturer, // - OS_ATTRIBUTE_NAME, os, // - OS_DESC_ATTRIBUTE_NAME, desc, // - DEBUGGER_ATTRIBUTE_NAME, "lldb", // - OS_MM_ATTRIBUTE_NAME, major + ":" + minor, // - BUILD_ATTRIBUTE_NAME, build, // - ENDIAN_ATTRIBUTE_NAME, order.toString(), // - DIRECTORY_ATTRIBUTE_NAME, wdir // - ), "Initialized"); - - getManager().addEventsListener(this); - } - - @Override - public void sessionAdded(SBTarget session, LldbCause cause) { - refreshInternal(); - } - - @Override - public void processAdded(SBProcess process, LldbCause cause) { - SBTarget procTarget = process.GetTarget(); - if (!DebugClient.getId(session).equals(DebugClient.getId(procTarget))) { - return; - } - refreshInternal(); - } - - public void refreshInternal() { - AtomicReference capture = new AtomicReference<>(); - AsyncUtils.sequence(TypeSpec.VOID).then(seq -> { - getManager().consoleCapture("version").handle(seq::next); - }, capture).then(seq -> { - changeAttributes(List.of(), List.of(), Map.of( // - DEBUGGER_ATTRIBUTE_NAME, capture.get()), "Refreshed"); - }).finish(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetSessionContainerImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetSessionContainerImpl.java deleted file mode 100644 index 77ec843f2c..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetSessionContainerImpl.java +++ /dev/null @@ -1,90 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import SWIG.SBTarget; -import agent.lldb.manager.LldbCause; -import agent.lldb.model.iface2.*; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "SessionContainer", - elements = { - @TargetElementType(type = LldbModelTargetSessionImpl.class) }, - attributes = { - @TargetAttributeType(type = Void.class) }, - canonicalContainer = true) -public class LldbModelTargetSessionContainerImpl extends LldbModelTargetObjectImpl - implements LldbModelTargetSessionContainer { - - public LldbModelTargetSessionContainerImpl(LldbModelTargetRoot root) { - super(root.getModel(), root, "Sessions", "SessionContainer"); - - getManager().addEventsListener(this); - } - - @Override - public void sessionAdded(SBTarget sess, LldbCause cause) { - LldbModelTargetSession session = getTargetSession(sess); - changeElements(List.of(), List.of(session), Map.of(), "Added"); - } - - @Override - public void sessionReplaced(SBTarget sess, LldbCause cause) { - LldbModelTargetSession session = getTargetSession(sess); - changeElements(List.of(), List.of(session), Map.of(), "Replaced"); - } - - @Override - public void sessionRemoved(String sessionId, LldbCause cause) { - changeElements(List.of( // - sessionId // - ), List.of(), Map.of(), "Removed"); - } - - @Override - public synchronized LldbModelTargetSession getTargetSession(SBTarget session) { - TargetObject targetObject = getMapObject(session); - if (targetObject != null) { - LldbModelTargetSession targetSession = (LldbModelTargetSession) targetObject; - targetSession.setModelObject(session); - return targetSession; - } - return new LldbModelTargetSessionImpl(this, session); - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - return getManager().listSessions().thenAccept(byIID -> { - List sessions; - synchronized (this) { - sessions = byIID.values() - .stream() - .map(this::getTargetSession) - .collect(Collectors.toList()); - } - setElements(sessions, "Refreshed"); - }); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetSessionImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetSessionImpl.java deleted file mode 100644 index f911befb7a..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetSessionImpl.java +++ /dev/null @@ -1,142 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import SWIG.*; -import agent.lldb.lldb.DebugClient; -import agent.lldb.manager.cmd.LldbContinueCommand; -import agent.lldb.model.iface1.LldbModelTargetInterpreter; -import agent.lldb.model.iface2.*; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.util.PathUtils; - -@TargetObjectSchemaInfo( - name = "Session", - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType( - name = "Debug", - type = LldbModelTargetDebugContainerImpl.class, - required = true, - fixed = true), - @TargetAttributeType( - name = "Attributes", - type = LldbModelTargetSessionAttributesImpl.class, - fixed = true), - @TargetAttributeType( - name = "Processes", - type = LldbModelTargetProcessContainerImpl.class, - required = true, - fixed = true), - @TargetAttributeType( - name = "Modules", - type = LldbModelTargetModuleContainerImpl.class, - required = true, - fixed = true), - @TargetAttributeType(type = Void.class) }) -public class LldbModelTargetSessionImpl extends LldbModelTargetObjectImpl - implements LldbModelTargetSession { - - protected static final String Lldb_PROMPT = "(kd)"; - //private Integer base = 16; - - // NB: This should almost certainly always be implemented by the root of the object tree - - protected static String indexSession(SBTarget session) { - return DebugClient.getId(session); - } - - protected static String keySession(SBTarget session) { - return PathUtils.makeKey(indexSession(session)); - } - - protected final LldbModelTargetDebugContainer debug; - protected final LldbModelTargetModuleContainer modules; - protected final LldbModelTargetSessionAttributesImpl attributes; - protected final LldbModelTargetProcessContainerImpl processes; - //private LldbModelSelectableObject focus; - - protected String debugger = "kd"; // Used by LldbModelTargetEnvironment - - public LldbModelTargetSessionImpl(LldbModelTargetSessionContainerImpl sessions, - SBTarget session) { - super(sessions.getModel(), sessions, keySession(session), session, "Session"); - getManager().getClient().addBroadcaster(session); - - this.debug = new LldbModelTargetDebugContainerImpl(this); - this.attributes = new LldbModelTargetSessionAttributesImpl(this); - this.processes = new LldbModelTargetProcessContainerImpl(this); - this.modules = new LldbModelTargetModuleContainerImpl(this); - - changeAttributes(List.of(), List.of( // - debug, // - attributes, // - processes, // - modules // - ), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDescription(0), // - ACCESSIBLE_ATTRIBUTE_NAME, accessible, // - PROMPT_ATTRIBUTE_NAME, LldbModelTargetInterpreter.LLDB_PROMPT, // - STATE_ATTRIBUTE_NAME, TargetExecutionState.ALIVE // - ), "Initialized"); - - getManager().addEventsListener(this); - } - - public String getDescription(int level) { - SBStream stream = new SBStream(); - SBTarget session = (SBTarget) getModelObject(); - DescriptionLevel detail = DescriptionLevel.swigToEnum(level); - session.GetDescription(stream, detail); - return stream.GetData(); - } - - @Override - public CompletableFuture setActive() { - return getManager().setActiveSession(getSession()); - } - - @Override - public boolean isAccessible() { - return accessible; - } - - @Override - public LldbModelTargetProcessContainer getProcesses() { - return processes; - } - - @Override - public LldbModelTargetModuleContainer getModules() { - return modules; - } - - public SBTarget getSession() { - return (SBTarget) getModelObject(); - } - - @Override - public CompletableFuture resume() { - SBProcess currentProcess = getManager().getCurrentProcess(); - return model.gateFuture(getManager().execute(new LldbContinueCommand(getManager(), currentProcess))); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetStackFrameImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetStackFrameImpl.java deleted file mode 100644 index 768dfa7e8c..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetStackFrameImpl.java +++ /dev/null @@ -1,205 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import java.math.BigInteger; -import java.util.List; -import java.util.Map; - -import SWIG.*; -import agent.lldb.lldb.DebugClient; -import agent.lldb.manager.LldbCause; -import agent.lldb.manager.LldbReason; -import agent.lldb.model.iface1.LldbModelTargetFocusScope; -import agent.lldb.model.iface2.*; -import ghidra.dbg.target.TargetFocusScope; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; -import ghidra.dbg.util.PathUtils; -import ghidra.program.model.address.Address; -import ghidra.program.model.address.AddressSpace; - -@TargetObjectSchemaInfo( - name = "StackFrame", - attributeResync = ResyncMode.ALWAYS, - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType( - name = "Registers", - type = LldbModelTargetStackFrameRegisterContainerImpl.class, - required = true), - @TargetAttributeType( - name = "Function", - type = LldbModelTargetFunctionImpl.class), - @TargetAttributeType( - name = LldbModelTargetStackFrame.FUNC_ATTRIBUTE_NAME, - type = String.class), - @TargetAttributeType( - name = LldbModelTargetStackFrame.INST_OFFSET_ATTRIBUTE_NAME, - type = Address.class), - @TargetAttributeType( - name = LldbModelTargetStackFrame.FRAME_OFFSET_ATTRIBUTE_NAME, - type = Address.class), - @TargetAttributeType( - name = LldbModelTargetStackFrame.RETURN_OFFSET_ATTRIBUTE_NAME, - type = Address.class), - @TargetAttributeType( - name = LldbModelTargetStackFrame.CALL_FRAME_OFFSET_ATTRIBUTE_NAME, - type = Address.class), - @TargetAttributeType( - name = LldbModelTargetStackFrame.STACK_OFFSET_ATTRIBUTE_NAME, - type = Address.class), - @TargetAttributeType(type = Void.class) }) -public class LldbModelTargetStackFrameImpl extends LldbModelTargetObjectImpl - implements LldbModelTargetStackFrame { - - protected static String indexFrame(SBFrame frame) { - return DebugClient.getId(frame); - } - - protected static String keyFrame(SBFrame frame) { - return PathUtils.makeKey(indexFrame(frame)); - } - - protected final LldbModelTargetThread thread; - - protected Address pc; - protected String func; - protected String display; - - private final LldbModelTargetStackFrameRegisterContainerImpl registers; - private final LldbModelTargetFunctionImpl function; - - private Long frameOffset = -1L; - private Long stackOffset = -1L; - private Long callFrameOffset = -1L; - //private Long returnOffset = -1L; - - public LldbModelTargetStackFrameImpl(LldbModelTargetStack stack, LldbModelTargetThread thread, - SBFrame frame) { - super(stack.getModel(), stack, keyFrame(frame), frame, "StackFrame"); - this.thread = thread; - this.pc = getModel().getAddressSpace("ram").getAddress(-1); - - if (!valid) { - registers = null; - function = null; - return; - } - - this.registers = new LldbModelTargetStackFrameRegisterContainerImpl(this); - this.function = new LldbModelTargetFunctionImpl(this, frame.GetFunction()); - - changeAttributes(List.of(), List.of( - registers, // - function // - ), Map.of( // - DISPLAY_ATTRIBUTE_NAME, display = getDescription(0), //computeDisplay(frame), // - PC_ATTRIBUTE_NAME, pc // - ), "Initialized"); - setFrame(frame); - - getManager().addEventsListener(this); - } - - @Override - public String getDescription(int level) { - SBStream stream = new SBStream(); - SBFrame frame = (SBFrame) getModelObject(); - frame.GetDescription(stream); - return stream.GetData(); - } - - protected static String computeDisplay(SBFrame frame) { - if (frame.GetFunction() == null) { - return String.format("#%d 0x%s", DebugClient.getId(frame), frame.GetPC().toString(16)); - } - return String.format("#%d 0x%s in %s ()", DebugClient.getId(frame), - frame.GetPC().toString(16), - frame.GetDisplayFunctionName()); - } - - @Override - public void threadSelected(SBThread eventThread, SBFrame eventFrame, LldbCause cause) { - if (eventFrame != null && eventFrame.equals(getFrame())) { - ((LldbModelTargetFocusScope) searchForSuitable(TargetFocusScope.class)).setFocus(this); - } - } - - @TargetAttributeType( - name = LldbModelTargetStackFrameRegisterContainerImpl.NAME, - required = true, - fixed = true) - public LldbModelTargetStackFrameRegisterContainer getRegisters() { - return registers; - } - - @Override - public void setFrame(SBFrame frame) { - if (!frame.IsValid()) { - System.err.println("Frame is not valid"); - } - setModelObject(frame); - BigInteger address = frame.GetPC(); - long lval = address == null ? -1 : address.longValue(); - this.pc = getModel().getAddressSpace("ram").getAddress(lval); - this.func = frame.GetFunctionName(); - if (func == null) { - func = "UNKNOWN"; - } - this.frameOffset = frame.GetFP().longValue(); - this.stackOffset = frame.GetSP().longValue(); - this.callFrameOffset = frame.GetCFA().longValue(); - - AddressSpace space = getModel().getAddressSpace("ram"); - changeAttributes(List.of(), List.of(), Map.of( // - PC_ATTRIBUTE_NAME, pc, // - DISPLAY_ATTRIBUTE_NAME, display = getDescription(0), //computeDisplay(frame), // - FUNC_ATTRIBUTE_NAME, func, // - INST_OFFSET_ATTRIBUTE_NAME, space.getAddress(lval), // - FRAME_OFFSET_ATTRIBUTE_NAME, space.getAddress(frameOffset), // - STACK_OFFSET_ATTRIBUTE_NAME, space.getAddress(stackOffset), // - CALL_FRAME_OFFSET_ATTRIBUTE_NAME, space.getAddress(callFrameOffset) // - ), "Refreshed"); - } - - @Override - public TargetObject getThread() { - return thread; - } - - public SBFrame getFrame() { - return (SBFrame) getModelObject(); - } - - @Override - public Address getPC() { - return pc; - } - - @Override - public LldbModelTargetProcess getProcess() { - return ((LldbModelTargetThreadImpl) thread).getProcess(); - } - - public void threadStateChangedSpecific(StateType state, LldbReason reason) { - setFrame(getFrame()); - registers.threadStateChangedSpecific(state, reason); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetStackFrameRegisterBankImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetStackFrameRegisterBankImpl.java deleted file mode 100644 index 710855b747..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetStackFrameRegisterBankImpl.java +++ /dev/null @@ -1,168 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import java.math.BigInteger; -import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import SWIG.*; -import agent.lldb.manager.LldbReason; -import agent.lldb.model.iface2.LldbModelTargetRegister; -import agent.lldb.model.iface2.LldbModelTargetStackFrameRegisterBank; -import ghidra.async.AsyncUtils; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.error.DebuggerRegisterAccessException; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; -import ghidra.dbg.util.PathUtils; - -@TargetObjectSchemaInfo( - name = "RegisterValueBank", - elementResync = ResyncMode.ALWAYS, - elements = { - @TargetElementType(type = LldbModelTargetStackFrameRegisterImpl.class) - }, - attributes = { - @TargetAttributeType(type = Object.class) - }, - canonicalContainer = true) -public class LldbModelTargetStackFrameRegisterBankImpl - extends LldbModelTargetObjectImpl - implements LldbModelTargetStackFrameRegisterBank { - public static final String NAME = "Registers"; - - protected static String keyValue(SBValue value) { - return PathUtils.makeKey(value.GetName()); - } - - protected final LldbModelTargetStackFrameRegisterContainerImpl container; - - public LldbModelTargetStackFrameRegisterBankImpl( - LldbModelTargetStackFrameRegisterContainerImpl container, SBValue val) { - super(container.getModel(), container, val.GetName(), val, "StackFrameRegisterBank"); - this.container = container; - - changeAttributes(List.of(), List.of(), Map.of( - DISPLAY_ATTRIBUTE_NAME, getName(), - DESCRIPTIONS_ATTRIBUTE_NAME, container), "Initialized"); - - requestElements(RefreshBehavior.REFRESH_ALWAYS); - } - - @Override - public String getDescription(int level) { - SBStream stream = new SBStream(); - SBValue val = (SBValue) getModelObject(); - val.GetDescription(stream); - return stream.GetData(); - } - - /** - * Does both descriptions and then populates values - */ - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - SBValue bank = (SBValue) getModelObject(); - return getManager().listStackFrameRegisters(bank).thenAccept(regs -> { - if (regs.isEmpty()) { - return; - } - List registers; - synchronized (this) { - registers = regs.values() - .stream() - .map(this::getTargetRegister) - .collect(Collectors.toList()); - } - setElements(registers, Map.of(), "Refreshed"); - if (!getCachedElements().isEmpty()) { - readRegistersNamed(getCachedElements().keySet()); - } - }); - } - - @Override - public LldbModelTargetRegister getTargetRegister(SBValue register) { - TargetObject targetObject = getMapObject(register); - if (targetObject != null) { - LldbModelTargetRegister targetRegister = (LldbModelTargetRegister) targetObject; - targetRegister.setModelObject(register); - return targetRegister; - } - return new LldbModelTargetStackFrameRegisterImpl(this, register); - } - - @Override - public void threadStateChangedSpecific(StateType state, LldbReason reason) { - if (state.equals(StateType.eStateStopped)) { - requestElements(RefreshBehavior.REFRESH_NEVER).thenAccept(__ -> { - readRegistersNamed(getCachedElements().keySet()); - }); - } - } - - @Override - public CompletableFuture> readRegistersNamed( - Collection names) { - Map result = new HashMap<>(); - Map elements = getCachedElements(); - for (String regname : names) { - if (!elements.containsKey(regname)) { - //throw new DebuggerRegisterAccessException("No such register: " + regname); - //Msg.error(this, "No such register: " + regname); - continue; - } - LldbModelTargetStackFrameRegisterImpl register = - (LldbModelTargetStackFrameRegisterImpl) elements.get(regname); - byte[] bytes = register.getBytes(); - result.put(regname, bytes); - } - //if (getName().contains("General")) { - broadcast().registersUpdated(this, result); - //} - return CompletableFuture.completedFuture(result); - } - - @Override - public CompletableFuture writeRegistersNamed(Map values) { - Map elements = getCachedElements(); - for (Map.Entry ent : values.entrySet()) { - String regname = ent.getKey(); - LldbModelTargetStackFrameRegisterImpl reg = - (LldbModelTargetStackFrameRegisterImpl) elements.get(regname); - if (reg == null) { - throw new DebuggerRegisterAccessException("No such register: " + regname); - } - BigInteger val = new BigInteger(1, ent.getValue()); - reg.getRegister().SetValueFromCString(val.toString()); - } - broadcast().registersUpdated(getProxy(), values); - return AsyncUtils.nil(); - } - - public Object getContainer() { - return container; - } - - @Override - public Map getCachedRegisters() { - return LldbModelTargetStackFrameRegisterBank.super.getCachedRegisters(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetStackFrameRegisterContainerImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetStackFrameRegisterContainerImpl.java deleted file mode 100644 index 33cf92367e..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetStackFrameRegisterContainerImpl.java +++ /dev/null @@ -1,108 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import SWIG.SBValue; -import SWIG.StateType; -import agent.lldb.manager.LldbReason; -import agent.lldb.model.iface2.LldbModelTargetObject; -import agent.lldb.model.iface2.LldbModelTargetRegisterBank; -import agent.lldb.model.iface2.LldbModelTargetStackFrameRegisterBank; -import agent.lldb.model.iface2.LldbModelTargetStackFrameRegisterContainer; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; - -@TargetObjectSchemaInfo( - name = "RegisterContainer", - attributeResync = ResyncMode.ALWAYS, - attributes = { - @TargetAttributeType( - name = "General Purpose Registers", - type = LldbModelTargetStackFrameRegisterBank.class, - required = true), - @TargetAttributeType( - name = "Floating Point Registers", - type = LldbModelTargetStackFrameRegisterBank.class, - required = false), - @TargetAttributeType(type = LldbModelTargetStackFrameRegisterBank.class) - }) -public class LldbModelTargetStackFrameRegisterContainerImpl - extends LldbModelTargetObjectImpl - implements LldbModelTargetStackFrameRegisterContainer { - public static final String NAME = "Registers"; - - protected final LldbModelTargetStackFrameImpl frame; - - public LldbModelTargetStackFrameRegisterContainerImpl(LldbModelTargetStackFrameImpl frame) { - super(frame.getModel(), frame, NAME, "StackFrameRegisterContainer"); - this.frame = frame; - requestAttributes(RefreshBehavior.REFRESH_ALWAYS); - } - - /** - * Does both descriptions and then populates values - */ - @Override - public CompletableFuture requestAttributes(RefreshBehavior refresh) { - return getManager().listStackFrameRegisterBanks(frame.getFrame()).thenAccept(banks -> { - if (banks.isEmpty()) { - return; - } - List targetBanks = new ArrayList<>(); - synchronized (this) { - targetBanks = banks.values() - .stream() - .map(this::getTargetRegisterBank) - .collect(Collectors.toList()); - } - changeAttributes(List.of(), targetBanks, Map.of(), "Refreshed"); - }); - } - - @Override - public LldbModelTargetObject getTargetRegisterBank(SBValue val) { - TargetObject targetObject = getMapObject(val); - if (targetObject != null) { - LldbModelTargetObject targetBank = (LldbModelTargetObject) targetObject; - targetBank.setModelObject(val); - return targetBank; - } - return new LldbModelTargetStackFrameRegisterBankImpl(this, val); - } - - public void threadStateChangedSpecific(StateType state, LldbReason reason) { - if (state.equals(StateType.eStateStopped)) { - requestAttributes(RefreshBehavior.REFRESH_NEVER).thenAccept(__ -> { - for (Object attribute : getCachedAttributes().values()) { - if (attribute instanceof LldbModelTargetRegisterBank) { - LldbModelTargetRegisterBank bank = (LldbModelTargetRegisterBank) attribute; - bank.threadStateChangedSpecific(state, reason); - } - } - }); - } - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetStackFrameRegisterImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetStackFrameRegisterImpl.java deleted file mode 100644 index 1c3ee8b644..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetStackFrameRegisterImpl.java +++ /dev/null @@ -1,129 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import java.math.BigInteger; -import java.util.List; -import java.util.Map; - -import SWIG.SBStream; -import SWIG.SBValue; -import agent.lldb.model.iface2.LldbModelTargetStackFrameRegister; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.util.ConversionUtils; -import ghidra.dbg.util.PathUtils; - -@TargetObjectSchemaInfo( - name = "RegisterValue", - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType(type = Object.class) }) -public class LldbModelTargetStackFrameRegisterImpl - extends LldbModelTargetObjectImpl - implements LldbModelTargetStackFrameRegister { - - protected static String indexRegister(SBValue register) { - return register.GetName(); - } - - protected static String keyRegister(SBValue register) { - return PathUtils.makeKey(indexRegister(register)); - } - - String value = ""; - - public LldbModelTargetStackFrameRegisterImpl(LldbModelTargetStackFrameRegisterBankImpl bank, - SBValue register) { - super(bank.getModel(), bank, keyRegister(register), register, "Register"); - value = getValue(); - - changeAttributes(List.of(), Map.of( // - CONTAINER_ATTRIBUTE_NAME, bank.getContainer(), // - BIT_LENGTH_ATTRIBUTE_NAME, getBitLength(), // - DISPLAY_ATTRIBUTE_NAME, getDescription(0), // - VALUE_ATTRIBUTE_NAME, value == null ? "0" : value, // - MODIFIED_ATTRIBUTE_NAME, false // - ), "Initialized"); - } - - @Override - public String getDescription(int level) { - SBStream stream = new SBStream(); - SBValue val = (SBValue) getModelObject(); - val.GetDescription(stream); - return stream.GetData(); - } - - @Override - public int getBitLength() { - return (int) (getRegister().GetByteSize() * 8); - } - - @Override - public String getValue() { - String val = getRegister().GetValue(); - if (val == null) { - return null; - } - if (!val.startsWith("0x")) { - return val; - } - return val.substring(2); - } - - @Override - public SBValue getRegister() { - return (SBValue) getModelObject(); - } - - @Override - public byte[] getBytes() { - String oldValue = value; - value = getValue(); - if (value == null) { - return new byte[0]; - } - if (value.startsWith("{")) { - String trim = value.substring(1, value.length() - 1); - String[] split = trim.split(" "); - value = split[0].substring(2) + split[1].substring(2); - } - changeAttributes(List.of(), Map.of( // - VALUE_ATTRIBUTE_NAME, value // - ), "Refreshed"); - if (!value.equals("0")) { - String newval = getDescription(0); - changeAttributes(List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, newval // - ), "Refreshed"); - setModified(!value.equals(oldValue)); - } - try { - BigInteger val = new BigInteger(value, 16); - byte[] bytes = ConversionUtils.bigIntegerToBytes((int) getRegister().GetByteSize(), val); - return bytes; - } catch (NumberFormatException nfe) { - return new byte[0]; - } - } - - @Override - public String getDisplay() { - return getValue() == null ? getName() : getName() + " : " + getValue(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetStackImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetStackImpl.java deleted file mode 100644 index 761ac35198..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetStackImpl.java +++ /dev/null @@ -1,99 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import SWIG.SBFrame; -import SWIG.StateType; -import agent.lldb.manager.LldbReason; -import agent.lldb.model.iface2.*; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; -import ghidra.util.datastruct.WeakValueHashMap; - -@TargetObjectSchemaInfo( - name = "Stack", - elementResync = ResyncMode.ALWAYS, - elements = { - @TargetElementType(type = LldbModelTargetStackFrameImpl.class) - }, - attributes = { - @TargetAttributeType(type = Void.class) - }, - canonicalContainer = true) -public class LldbModelTargetStackImpl extends LldbModelTargetObjectImpl - implements LldbModelTargetStack { - - protected final LldbModelTargetThread thread; - - public static final String NAME = "Stack"; - - protected final Map framesByLevel = - new WeakValueHashMap<>(); - - public LldbModelTargetStackImpl(LldbModelTargetThread thread, LldbModelTargetProcess process) { - super(thread.getModel(), thread, NAME, "Stack"); - this.thread = thread; - requestElements(RefreshBehavior.REFRESH_NEVER); - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - return getManager().listStackFrames(thread.getThread()).thenAccept(f -> { - if (f.isEmpty()) { - return; - } - List frames; - synchronized (this) { - frames = - f.values().stream().map(this::getTargetFrame).collect(Collectors.toList()); - } - setElements(frames, Map.of(), "Refreshed"); - }); - } - - @Override - public synchronized LldbModelTargetStackFrame getTargetFrame(SBFrame frame) { - return framesByLevel.compute((int) frame.GetFrameID(), (l, f) -> { - if (f == null) { - return new LldbModelTargetStackFrameImpl(this, thread, frame); - } - f.setFrame(frame); - return f; - }); - } - - public void threadStateChangedSpecific(StateType state, LldbReason reason) { - if (state.equals(StateType.eStateStopped)) { - requestElements(RefreshBehavior.REFRESH_ALWAYS).thenAccept(__ -> { - for (TargetObject element : getCachedElements().values()) { - if (element instanceof LldbModelTargetStackFrame) { - LldbModelTargetStackFrameImpl frame = - (LldbModelTargetStackFrameImpl) element; - frame.threadStateChangedSpecific(state, reason); - } - } - }); - } - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetSymbolContainerImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetSymbolContainerImpl.java deleted file mode 100644 index 2129105286..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetSymbolContainerImpl.java +++ /dev/null @@ -1,72 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import SWIG.SBSymbol; -import agent.lldb.model.iface2.LldbModelTargetSymbolContainer; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; - -@TargetObjectSchemaInfo( - name = "SymbolContainer", - elements = { - @TargetElementType(type = LldbModelTargetSymbolImpl.class) }, - elementResync = ResyncMode.ONCE, - attributes = { - @TargetAttributeType(type = Void.class) }, - canonicalContainer = true) -public class LldbModelTargetSymbolContainerImpl extends LldbModelTargetObjectImpl - implements LldbModelTargetSymbolContainer { - - protected final LldbModelTargetModuleImpl module; - - public LldbModelTargetSymbolContainerImpl(LldbModelTargetModuleImpl module) { - super(module.getModel(), module, "Symbols", "SymbolContainer"); - this.module = module; - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - return getManager().listModuleSymbols(module.getModule()).thenAccept(byName -> { - List symbols; - synchronized (this) { - symbols = byName.values() - .stream() - .map(this::getTargetSymbol) - .collect(Collectors.toList()); - } - setElements(symbols, Map.of(), "Refreshed"); - }); - } - - @Override - public synchronized LldbModelTargetSymbolImpl getTargetSymbol(SBSymbol symbol) { - TargetObject targetObject = getMapObject(symbol); - if (targetObject != null) { - LldbModelTargetSymbolImpl targetSymbol = (LldbModelTargetSymbolImpl) targetObject; - targetSymbol.setModelObject(symbol); - return targetSymbol; - } - return new LldbModelTargetSymbolImpl(this, symbol); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetSymbolImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetSymbolImpl.java deleted file mode 100644 index af62e7534b..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetSymbolImpl.java +++ /dev/null @@ -1,109 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import java.util.List; -import java.util.Map; - -import SWIG.*; -import agent.lldb.model.iface2.LldbModelTargetSession; -import agent.lldb.model.iface2.LldbModelTargetSymbol; -import ghidra.dbg.target.*; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.util.PathUtils; -import ghidra.program.model.address.Address; - -@TargetObjectSchemaInfo( - name = "Symbol", - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType( - name = TargetSymbol.NAMESPACE_ATTRIBUTE_NAME, - type = LldbModelTargetSymbolContainerImpl.class), - @TargetAttributeType(name = TargetObject.VALUE_ATTRIBUTE_NAME, type = Address.class), - @TargetAttributeType(name = TargetSymbol.SIZE_ATTRIBUTE_NAME, type = long.class), - @TargetAttributeType(name = TargetBreakpointSpec.AS_BPT_ATTRIBUTE_NAME, type = String.class), - @TargetAttributeType(name = "Name", type = String.class), - @TargetAttributeType(name = "Size", type = long.class), - @TargetAttributeType(name = "TypeId", type = int.class), - @TargetAttributeType(name = "Tag", type = int.class), - @TargetAttributeType(type = Void.class) }) -public class LldbModelTargetSymbolImpl extends LldbModelTargetObjectImpl - implements LldbModelTargetSymbol { - protected static String indexSymbol(SBSymbol symbol) { - return symbol.GetName(); - } - - protected static String keySymbol(SBSymbol symbol) { - return PathUtils.makeKey(indexSymbol(symbol)); - } - - protected final boolean constant; - protected Address value; - protected long size; - - public LldbModelTargetSymbolImpl(LldbModelTargetSymbolContainerImpl symbols, - SBSymbol symbol) { - super(symbols.getModel(), symbols, keySymbol(symbol), symbol, "Symbol"); - this.constant = false; - LldbModelTargetSession session = this.getParentSession(); - SBTarget target = (SBTarget) session.getModelObject(); - this.value = symbols.getModel() - .getAddressSpace("ram") - .getAddress(symbol.GetStartAddress().GetLoadAddress(target).longValue()); - this.size = symbol.GetEndAddress() - .GetOffset() - .subtract(symbol.GetStartAddress().GetOffset()) - .longValue(); - - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDescription(0), // - NAMESPACE_ATTRIBUTE_NAME, symbols, // - VALUE_ATTRIBUTE_NAME, value, // - SIZE_ATTRIBUTE_NAME, size, // - TargetBreakpointSpec.AS_BPT_ATTRIBUTE_NAME, getDescription(0) // - /* - "Name", symbol.getName(), // - "Size", size, // - "TypeId", symbol.getTypeId(), // - "Tag", symbol.getTag() // - */ - ), "Initialized"); - } - - public String getDescription(int level) { - SBStream stream = new SBStream(); - SBSymbol symbol = (SBSymbol) getModelObject(); - symbol.GetDescription(stream); - return stream.GetData(); - } - - @Override - public boolean isConstant() { - return constant; - } - - @Override - public Address getValue() { - return value; - } - - @Override - public long getSize() { - return size; - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetThreadContainerImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetThreadContainerImpl.java deleted file mode 100644 index 7b128893cb..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetThreadContainerImpl.java +++ /dev/null @@ -1,179 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import SWIG.*; -import agent.lldb.lldb.DebugClient; -import agent.lldb.manager.LldbCause; -import agent.lldb.manager.LldbReason; -import agent.lldb.model.iface1.LldbModelTargetConfigurable; -import agent.lldb.model.iface2.*; -import ghidra.async.AsyncUtils; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.error.DebuggerIllegalArgumentException; -import ghidra.dbg.target.TargetConfigurable; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; - -@TargetObjectSchemaInfo( - name = "ThreadContainer", - elementResync = ResyncMode.ALWAYS, - elements = { // - @TargetElementType(type = LldbModelTargetThreadImpl.class) // - }, - attributes = { // - @TargetAttributeType(name = TargetConfigurable.BASE_ATTRIBUTE_NAME, type = Integer.class), // - @TargetAttributeType(type = Void.class) // - }, - canonicalContainer = true) -public class LldbModelTargetThreadContainerImpl extends LldbModelTargetObjectImpl - implements LldbModelTargetThreadContainer, LldbModelTargetConfigurable { - - protected final SBProcess process; - - public LldbModelTargetThreadContainerImpl(LldbModelTargetProcessImpl process) { - super(process.getModel(), process, "Threads", "ThreadContainer"); - this.process = process.getProcess(); - this.changeAttributes(List.of(), Map.of(BASE_ATTRIBUTE_NAME, 16), "Initialized"); - - getManager().addEventsListener(this); - requestElements(RefreshBehavior.REFRESH_NEVER); - } - - @Override - public void threadCreated(SBThread thread) { - changeElements(List.of(), List.of(getTargetThread(thread)), Map.of(), "Created"); - LldbModelTargetThread targetThread = getTargetThread(thread); - changeElements(List.of(), List.of(targetThread), Map.of(), "Created"); - targetThread.threadStateChangedSpecific(StateType.eStateConnected, - LldbReason.getReason(null)); - broadcast().event(getProxy(), targetThread, TargetEventType.THREAD_CREATED, - "Thread " + DebugClient.getId(thread) + " started", List.of(targetThread)); - } - - @Override - public void threadReplaced(SBThread thread) { - changeElements(List.of(), List.of(getTargetThread(thread)), Map.of(), "Created"); - LldbModelTargetThread targetThread = getTargetThread(thread); - changeElements(List.of(), List.of(targetThread), Map.of(), "Created"); - } - - @Override - public void threadStateChanged(SBThread thread, StateType state, LldbCause cause, - LldbReason reason) { - LldbModelTargetThread targetThread = getTargetThread(thread); - TargetEventType eventType = getEventType(state, cause, reason); - broadcast().event(getProxy(), targetThread, eventType, - "Thread " + DebugClient.getId(thread) + " state changed", List.of(targetThread)); - targetThread.threadStateChangedSpecific(state, reason); - } - - @Override - public void threadExited(SBThread thread) { - if (thread == null) { - return; - } - String threadId = LldbModelTargetThreadImpl.indexThread(thread); - LldbModelTargetThread targetThread = (LldbModelTargetThread) getMapObject(thread); - if (targetThread != null) { - broadcast().event(getProxy(), targetThread, TargetEventType.THREAD_EXITED, - "Thread " + threadId + " exited", List.of(targetThread)); - } - changeElements(List.of( // - threadId // - ), List.of(), Map.of(), "Exited"); - } - - // TODO?: Serive a more complete event set from this? - private TargetEventType getEventType(StateType state, LldbCause cause, LldbReason reason) { - switch (state.swigValue()) { - case 0: // eStateInvalid - return TargetEventType.RUNNING; - case 1: // eStateUnloaded - return TargetEventType.PROCESS_EXITED; - case 2: // eStateConnected - case 3: // eStateAttaching - case 4: // eStateLaunching - return TargetEventType.PROCESS_CREATED; - case 5: // eStateStopped - return TargetEventType.STOPPED; - case 6: // eStateRunning - case 7: // eStateStepping - return TargetEventType.RUNNING; - case 8: // eStateCrashed - case 9: // eStateDetached - case 10: // eStateExited - return TargetEventType.PROCESS_EXITED; - case 11: // eStateSuspended - return TargetEventType.STOPPED; - default: - return TargetEventType.STOPPED; - } - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - return getManager().listThreads(process).thenAccept(byTID -> { - List threads; - synchronized (this) { - threads = - byTID.values().stream().map(this::getTargetThread).collect(Collectors.toList()); - } - setElements(threads, Map.of(), "Refreshed"); - }); - } - - @Override - public synchronized LldbModelTargetThread getTargetThread(SBThread thread) { - TargetObject targetObject = getMapObject(thread); - if (targetObject != null) { - LldbModelTargetThread targetThread = (LldbModelTargetThread) targetObject; - targetThread.setModelObject(thread); - return targetThread; - } - return new LldbModelTargetThreadImpl(this, (LldbModelTargetProcess) parent, thread); - } - - @Override - public CompletableFuture writeConfigurationOption(String key, Object value) { - switch (key) { - case BASE_ATTRIBUTE_NAME: - if (value instanceof Integer) { - this.changeAttributes(List.of(), Map.of(BASE_ATTRIBUTE_NAME, value), - "Modified"); - for (TargetObject child : getCachedElements().values()) { - if (child instanceof LldbModelTargetThreadImpl) { - LldbModelTargetThreadImpl targetThread = - (LldbModelTargetThreadImpl) child; - targetThread.setBase(value); - } - } - } - else { - throw new DebuggerIllegalArgumentException("Base should be numeric"); - } - default: - } - return AsyncUtils.nil(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetThreadImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetThreadImpl.java deleted file mode 100644 index 83395a130b..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetThreadImpl.java +++ /dev/null @@ -1,216 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import java.lang.invoke.MethodHandles; -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import SWIG.*; -import agent.lldb.lldb.DebugClient; -import agent.lldb.manager.LldbCause; -import agent.lldb.manager.LldbReason; -import agent.lldb.manager.LldbReason.Reasons; -import agent.lldb.manager.cmd.LldbRunToAddressCommand; -import agent.lldb.manager.cmd.LldbStepCommand; -import agent.lldb.model.iface1.LldbModelTargetFocusScope; -import agent.lldb.model.iface2.*; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetMethod.AnnotatedTargetMethod; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; -import ghidra.dbg.util.PathUtils; -import ghidra.program.model.address.Address; - -@TargetObjectSchemaInfo( - name = "Thread", - attributeResync = ResyncMode.ALWAYS, - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType( - name = "Stack", - type = LldbModelTargetStackImpl.class, - required = true, - fixed = true), - @TargetAttributeType(name = TargetEnvironment.ARCH_ATTRIBUTE_NAME, type = String.class), - @TargetAttributeType(type = Void.class) }) -public class LldbModelTargetThreadImpl extends LldbModelTargetObjectImpl - implements LldbModelTargetThread { - - public static final TargetStepKindSet SUPPORTED_KINDS = TargetStepKindSet.of( // - TargetStepKind.FINISH, // - TargetStepKind.LINE, // - TargetStepKind.OVER, // - TargetStepKind.OVER_LINE, // - TargetStepKind.RETURN, // - TargetStepKind.UNTIL, // - TargetStepKind.EXTENDED); - - protected static String indexThread(Integer id) { - return PathUtils.makeIndex(id); - } - - protected static String indexThread(SBThread thread) { - return DebugClient.getId(thread); - } - - protected static String keyThread(SBThread thread) { - return PathUtils.makeKey(indexThread(thread)); - } - - protected final LldbModelTargetStackImpl stack; - - private LldbModelTargetProcess process; - private Integer base = 16; - - public LldbModelTargetThreadImpl(LldbModelTargetThreadContainer threads, - LldbModelTargetProcess process, SBThread thread) { - super(threads.getModel(), threads, keyThread(thread), thread, "Thread"); - this.process = process; - - this.stack = new LldbModelTargetStackImpl(this, process); - - changeAttributes(List.of(), List.of(), - AnnotatedTargetMethod.collectExports(MethodHandles.lookup(), threads.getModel(), this), - "Methods"); - changeAttributes(List.of(), List.of( // - stack // - ), Map.of( // - ACCESSIBLE_ATTRIBUTE_NAME, accessible = false, // - DISPLAY_ATTRIBUTE_NAME, getDisplay(), // - STATE_ATTRIBUTE_NAME, TargetExecutionState.ALIVE, // - TID_ATTRIBUTE_NAME, thread.GetThreadID().longValue(), // - SUPPORTED_STEP_KINDS_ATTRIBUTE_NAME, SUPPORTED_KINDS // - ), "Initialized"); - - getManager().addStateListener(this); - getManager().addEventsListener(this); - } - - @Override - public void setModelObject(Object modelObject) { - super.setModelObject(modelObject); - getModel().addModelObject(modelObject, this); - } - - @Override - public String getDescription(int level) { - SBStream stream = new SBStream(); - SBThread thread = (SBThread) getModelObject(); - thread.GetDescription(stream); - return stream.GetData(); - } - - @Override - public String getDisplay() { - String tidstr = DebugClient.getId(getThread()); - if (base == 16) { - tidstr = "0x" + tidstr; - } - else { - tidstr = Long.toString(Long.parseLong(tidstr, 16)); - } - return "[" + tidstr + "]"; - } - - @Override - public void threadSelected(SBThread eventThread, SBFrame frame, LldbCause cause) { - if (eventThread.GetThreadID().equals(getThread().GetThreadID())) { - ((LldbModelTargetFocusScope) searchForSuitable(TargetFocusScope.class)).setFocus(this); - } - } - - @Override - public void threadStateChangedSpecific(StateType state, LldbReason reason) { - TargetExecutionState targetState = DebugClient.convertState(state); - changeAttributes(List.of(), List.of(), Map.of( // - STATE_ATTRIBUTE_NAME, targetState // - ), reason.desc()); - stack.threadStateChangedSpecific(state, reason); - } - - @Override - public CompletableFuture step(TargetStepKind kind) { - return getModel().gateFuture( - getManager().execute(new LldbStepCommand(getManager(), getThread(), kind, null))); - } - - @Override - public CompletableFuture step(Map args) { - return getModel().gateFuture( - getManager().execute(new LldbStepCommand(getManager(), getThread(), null, args))); - } - - @TargetMethod.Export("Run to Address") - public CompletableFuture runToAddress( - @TargetMethod.Param( - description = "The target address", - display = "Address", - name = "address") Address address) { - return getModel().gateFuture( - getManager().execute(new LldbRunToAddressCommand(getManager(), getThread(), - address.getOffsetAsBigInteger()))); - } - - @Override - public CompletableFuture setActive() { - return getModel().gateFuture(getManager().setActiveThread(getThread())); - } - - @Override - public LldbModelTargetStackImpl getStack() { - return stack; - } - - @Override - public SBThread getThread() { - return (SBThread) getModelObject(); - } - - public LldbModelTargetProcess getProcess() { - return process; - } - - @Override - public boolean isAccessible() { - return accessible; - } - - @Override - public String getExecutingProcessorType() { - return null; //thread.getExecutingProcessorType().description; - } - - public void setBase(Object value) { - this.base = (Integer) value; - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDisplay()// - ), "Started"); - } - - @Override - public void stateChanged(StateType state, LldbCause cause) { - LldbModelTargetThreadContainer container = (LldbModelTargetThreadContainer) getParent(); - LldbModelTargetProcess process = (LldbModelTargetProcess) container.getParent(); - Reasons unknown = LldbReason.Reasons.UNKNOWN; - process.threadStateChanged(getThread(), state, cause, unknown); - container.threadStateChanged(getThread(), state, cause, unknown); - threadStateChangedSpecific(state, unknown); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetTraceOrDumpConnectorImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetTraceOrDumpConnectorImpl.java deleted file mode 100644 index 58d609b65b..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetTraceOrDumpConnectorImpl.java +++ /dev/null @@ -1,84 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import agent.lldb.model.iface2.LldbModelTargetConnector; -import ghidra.async.AsyncUtils; -import ghidra.async.TypeSpec; -import ghidra.dbg.error.DebuggerUserException; -import ghidra.dbg.target.TargetMethod; -import ghidra.dbg.target.TargetMethod.ParameterDescription; -import ghidra.dbg.target.TargetMethod.TargetParameterMap; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "TraceOrDumpConnector", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(type = Void.class) - }) -public class LldbModelTargetTraceOrDumpConnectorImpl extends LldbModelTargetObjectImpl - implements LldbModelTargetConnector { - - protected final LldbModelTargetConnectorContainerImpl connectors; - protected final TargetParameterMap paramDescs; - - public LldbModelTargetTraceOrDumpConnectorImpl(LldbModelTargetConnectorContainerImpl connectors, - String name) { - super(connectors.getModel(), connectors, name, name); - this.connectors = connectors; - - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDisplay(), // - TargetMethod.PARAMETERS_ATTRIBUTE_NAME, - paramDescs = TargetParameterMap.copyOf(computeParameters()) // - ), "Initialized"); - } - - @Override - public CompletableFuture setActive() { - connectors.setDefaultConnector(this); - return CompletableFuture.completedFuture(null); - } - - protected Map> computeParameters() { - HashMap> map = - new LinkedHashMap>(); - ParameterDescription p1 = ParameterDescription.create(String.class, "TraceOrDump", - true, "", "File", "trace or dump to be loaded"); - map.put("TraceOrDump", p1); - return map; - } - - @Override - public TargetParameterMap getParameters() { - return TargetMethod.getParameters(this); - } - - @Override - public CompletableFuture launch(Map args) { - return AsyncUtils.sequence(TypeSpec.VOID).then(seq -> { - getManager().openFile(args).handle(seq::nextIgnore); - }).finish().exceptionally((exc) -> { - throw new DebuggerUserException("Launch failed for " + args); - }); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetWatchpointSpecImpl.java b/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetWatchpointSpecImpl.java deleted file mode 100644 index 03557c6f75..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/java/agent/lldb/model/impl/LldbModelTargetWatchpointSpecImpl.java +++ /dev/null @@ -1,89 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.impl; - -import java.util.*; - -import SWIG.*; -import agent.lldb.model.iface2.LldbModelTargetBreakpointContainer; -import agent.lldb.model.iface2.LldbModelTargetBreakpointLocation; -import ghidra.dbg.target.TargetBreakpointSpecContainer.TargetBreakpointKindSet; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "BreakpointSpec", - elements = { // - @TargetElementType(type = LldbModelTargetBreakpointLocationImpl.class) // - }, - attributes = { - @TargetAttributeType(type = Void.class) }, - canonicalContainer = true) -public class LldbModelTargetWatchpointSpecImpl extends LldbModelTargetAbstractXpointSpec { - - private List locs = new ArrayList<>(); - - public LldbModelTargetWatchpointSpecImpl(LldbModelTargetBreakpointContainer breakpoints, - Object info) { - super(breakpoints, info, "WatchpointSpec"); - } - - public String getDescription(int level) { - SBStream stream = new SBStream(); - SBWatchpoint wpt = (SBWatchpoint) getModelObject(); - DescriptionLevel detail = DescriptionLevel.swigToEnum(level); - wpt.GetDescription(stream, detail); - String data = stream.GetData(); - return data.equals("No value") ? getName() : data; - } - - protected TargetBreakpointKindSet computeKinds(Object from) { - return TargetBreakpointKindSet.of(TargetBreakpointKind.READ, TargetBreakpointKind.WRITE); - } - - public void updateInfo(Object info, String reason) { - if (!valid) { - return; - } - setModelObject(info); - updateAttributesFromInfo(reason); - - SBWatchpoint wpt = (SBWatchpoint) getModelObject(); - locs.add(new LldbModelTargetBreakpointLocationImpl(this, wpt)); - setElements(locs, Map.of(), "Refreshed"); - } - - public void updateAttributesFromInfo(String reason) { - SBWatchpoint wpt = (SBWatchpoint) getModelObject(); - this.changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, display = getDescription(0), // - KINDS_ATTRIBUTE_NAME, kinds = computeKinds(wpt), // - ENABLED_ATTRIBUTE_NAME, enabled = wpt.IsEnabled(), // - EXPRESSION_ATTRIBUTE_NAME, "" // - ), reason); - this.changeAttributes(List.of(), List.of(), Map.of( // - BPT_TYPE_ATTRIBUTE_NAME, "Hardware", // - BPT_DISP_ATTRIBUTE_NAME, wpt.IsEnabled(), // - BPT_VALID_ATTRIBUTE_NAME, wpt.IsValid(), // - BPT_TIMES_ATTRIBUTE_NAME, wpt.GetHitCount() // - ), reason); - } - - @Override - public LldbModelTargetBreakpointLocation findLocation(Object object) { - return locs.get(0); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/main/sh/execjar.sh b/Ghidra/Debug/Debugger-agent-lldb/src/main/sh/execjar.sh deleted file mode 100644 index 26738bd11d..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/main/sh/execjar.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/bash -## ### -# IP: GHIDRA -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -## -# This clever bit can be prepended to a JAR to make it self-executable - -set -e - -java -jar "$0" ${@:1} -exit diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/lldb/LLDBTest.java b/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/lldb/LLDBTest.java deleted file mode 100644 index 6f95aa92d7..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/lldb/LLDBTest.java +++ /dev/null @@ -1,977 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.lldb; - -import static org.junit.Assert.assertNotNull; -import static org.junit.Assume.assumeTrue; - -import java.util.Arrays; -import java.util.List; -import java.util.concurrent.CompletableFuture; - -import org.junit.*; - -import SWIG.*; -import ghidra.test.AbstractGhidraHeadlessIntegrationTest; -import ghidra.util.Msg; - -@Ignore("deprecated") -public class LLDBTest extends AbstractGhidraHeadlessIntegrationTest { - - public static void assumeLibLoadable() { - try { - System.load("/usr/lib/liblldb.so"); - return; - } - catch (UnsatisfiedLinkError ex) { - } - try { - System.load("/usr/lib/liblldb.dylib"); - return; - } - catch (UnsatisfiedLinkError ex) { - } - assumeTrue("lldb not available", false); - } - - private SBDebugger sbd; - - @Before - public void setUp() { - assumeLibLoadable(); - SBDebugger.InitializeWithErrorHandling(); - sbd = SBDebugger.Create(); - } - - @Test - public void testCanWeDoAnything() { - System.err.println(sbd); - } - - protected class ProcMaker implements AutoCloseable { - public ProcMaker(String cmdLine) { - this.cmdLine = cmdLine; - } - - final String cmdLine; - - final CompletableFuture procExit = new CompletableFuture<>(); - - StringBuilder outputCapture = null; - - private SBProcess process; - - public void start() { - /* - client.setEventCallbacks(new NoisyDebugEventCallbacksAdapter(DebugStatus.NO_CHANGE) { - @Override - public DebugStatus createProcess(DebugProcessInfo debugProcessInfo) { - super.createProcess(debugProcessInfo); - procInfo.complete(debugProcessInfo); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus createThread(DebugThreadInfo debugThreadInfo) { - super.createThread(debugThreadInfo); - threadInfo.complete(debugThreadInfo); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus exitProcess(int exitCode) { - super.exitProcess(exitCode); - procExit.complete(exitCode); - return DebugStatus.BREAK; - } - }); - client.setOutputCallbacks(new DebugOutputCallbacks() { - @Override - public void output(int mask, String text) { - System.out.print(text); - if (outputCapture != null) { - outputCapture.append(text); - } - } - }); - */ - - Msg.debug(this, "Starting " + cmdLine + " with client " + sbd); - SBTarget target = sbd.CreateTarget(cmdLine); - process = target.LaunchSimple(null, null, null); - assertNotNull(process); - System.out.println(DebugClient.getId(process) + ":" + process.GetUniqueID()); - SBProcessInfo pi = process.GetProcessInfo(); - assertNotNull(pi); - SBThread thread = process.GetThreadAtIndex(0); - assertNotNull(thread); - System.out.println(DebugClient.getId(thread) + ":" + process.GetUniqueID()); - thread.Resume(); - } - - public void kill() { - Msg.debug(this, "Killing " + cmdLine); - process.Kill(); - try { - process.wait(); - } - catch (InterruptedException e) { - e.printStackTrace(); - } - } - - public List execCapture(String command) { - try { - outputCapture = new StringBuilder(); - //control.execute(command); - return Arrays.asList(outputCapture.toString().split("\n")); - } - finally { - outputCapture = null; - } - } - - @Override - public void close() { - StateType state = process.GetState(); - if (!state.equals(StateType.eStateExited)) { - kill(); - } - } - } - - @Test - public void testStart() { - try (ProcMaker maker = new ProcMaker("/bin/echo")) { - maker.start(); - } - } - - /* - @Test - public void testPrintln() { - CompletableFuture cb = new CompletableFuture<>(); - client.setOutputCallbacks(new DebugOutputCallbacks() { - @Override - public void output(int mask, String text) { - System.out.print(text); - cb.complete(text); - } - }); - control.outln("Hello, World!"); - String back = cb.getNow(null); - // NOTE: I'd like to be precise wrt/ new lines, but it seems to vary with version. - assertEquals("Hello, World!", back.trim()); - } - - @Test - public void testGetProcessSystemIds() { - List procs = client.getRunningProcesses(client.getLocalServer()); - System.out.println("Total: " + procs.size()); - procs.sort(null); - for (DebugRunningProcess p : procs) { - System.out.println("ID: " + p.getSystemId()); - } - } - - @Test - public void testGetProcessDescriptions() { - List procs = client.getRunningProcesses(client.getLocalServer()); - System.out.println("Total: " + procs.size()); - procs.sort(null); - for (DebugRunningProcess p : procs) { - try { - System.out.println(p.getFullDescription()); - } - catch (COMException e) { - System.out.println("Error with PID " + p.getSystemId() + ": " + e.getMessage()); - } - } - } - - public static abstract class NoisyDebugEventCallbacksAdapter - extends DebugEventCallbacksAdapter { - final DebugStatus defaultStatus; - - public NoisyDebugEventCallbacksAdapter(DebugStatus defaultStatus) { - this.defaultStatus = defaultStatus; - } - - @Override - public DebugStatus createProcess(DebugProcessInfo debugProcessInfo) { - Msg.info(this, "createProcess: " + debugProcessInfo); - return defaultStatus; - } - - @Override - public DebugStatus createThread(DebugThreadInfo debugThreadInfo) { - Msg.info(this, "createThread: " + debugThreadInfo); - return defaultStatus; - } - - @Override - public DebugStatus exitProcess(int exitCode) { - Msg.info(this, "exitProcess: " + Integer.toHexString(exitCode)); - return defaultStatus; - } - - @Override - public DebugStatus breakpoint(DebugBreakpoint bp) { - Msg.info(this, "breakpoint: " + bp); - return defaultStatus; - } - - @Override - public DebugStatus changeDebuggeeState(BitmaskSet flags, - long argument) { - Msg.info(this, "changeDebuggeeState: " + flags + ", " + argument); - return defaultStatus; - } - - @Override - public DebugStatus changeEngineState(BitmaskSet flags, long argument) { - Msg.info(this, "changeEngineState: " + flags + ", " + argument); - return defaultStatus; - } - - @Override - public DebugStatus changeSymbolState(BitmaskSet flags, long argument) { - Msg.info(this, "changeSymbolState: " + flags + ", " + argument); - return defaultStatus; - } - - @Override - public DebugStatus exception(DebugExceptionRecord64 exception, boolean firstChance) { - Msg.info(this, "exception: " + exception + ", " + firstChance); - return defaultStatus; - } - - @Override - public DebugStatus exitThread(int exitCode) { - Msg.info(this, "exitThread: " + Integer.toHexString(exitCode)); - return defaultStatus; - } - - @Override - public DebugStatus loadModule(DebugModuleInfo debugModuleInfo) { - Msg.info(this, "loadModule: " + debugModuleInfo); - return defaultStatus; - } - - @Override - public DebugStatus sessionStatus(SessionStatus status) { - Msg.info(this, "sessionStatus: " + status); - return defaultStatus; - } - - @Override - public DebugStatus systemError(int error, int level) { - Msg.info(this, "systemError: " + error + ", " + level); - return defaultStatus; - } - - @Override - public DebugStatus unloadModule(String imageBaseName, long baseOffset) { - Msg.info(this, "unloadModule: " + imageBaseName + ", " + baseOffset); - return defaultStatus; - } - } - - protected class ProcMaker implements AutoCloseable { - public ProcMaker(String cmdLine) { - this.cmdLine = cmdLine; - } - - final String cmdLine; - - final CompletableFuture procInfo = new CompletableFuture<>(); - final CompletableFuture threadInfo = new CompletableFuture<>(); - final CompletableFuture procExit = new CompletableFuture<>(); - - StringBuilder outputCapture = null; - - public void start() { - client.setEventCallbacks(new NoisyDebugEventCallbacksAdapter(DebugStatus.NO_CHANGE) { - @Override - public DebugStatus createProcess(DebugProcessInfo debugProcessInfo) { - super.createProcess(debugProcessInfo); - procInfo.complete(debugProcessInfo); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus createThread(DebugThreadInfo debugThreadInfo) { - super.createThread(debugThreadInfo); - threadInfo.complete(debugThreadInfo); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus exitProcess(int exitCode) { - super.exitProcess(exitCode); - procExit.complete(exitCode); - return DebugStatus.BREAK; - } - }); - client.setOutputCallbacks(new DebugOutputCallbacks() { - @Override - public void output(int mask, String text) { - System.out.print(text); - if (outputCapture != null) { - outputCapture.append(text); - } - } - }); - - Msg.debug(this, "Starting " + cmdLine + " with client " + client); - control.execute(".create " + cmdLine); - control.waitForEvent(); - DebugProcessInfo pi = procInfo.getNow(null); - assertNotNull(pi); - control.execute("g"); - control.waitForEvent(); - DebugThreadInfo ti = threadInfo.getNow(null); - assertNotNull(ti); - } - - public void kill() { - Msg.debug(this, "Killing " + cmdLine); - control.execute(".kill"); - control.waitForEvent(); - Integer exitCode = procExit.getNow(null); - client.setOutputCallbacks(null); - assertNotNull(exitCode); - } - - public List execCapture(String command) { - try { - outputCapture = new StringBuilder(); - control.execute(command); - return Arrays.asList(outputCapture.toString().split("\n")); - } - finally { - outputCapture = null; - } - } - - @Override - public void close() { - if (procInfo.isDone() && !procExit.isDone()) { - kill(); - } - } - } - - @Test - public void testDescribeVector256Register() { - try (ProcMaker maker = new ProcMaker("notepad")) { - maker.start(); - - DebugRegisters regs = client.getRegisters(); - int index = regs.getIndexByName("ymm0"); - DebugRegisterDescription desc = regs.getDescription(index); - Msg.debug(this, "desc=" + desc); - // This seems wrong, but I'm curious about the value - assertEquals(DebugValueType.VECTOR128, desc.type); - - DebugValue value = regs.getValue(index); - Msg.debug(this, "value=" + value); - } - } - - @Test - public void testGetSingleRegister() { - try (ProcMaker maker = new ProcMaker("notepad")) { - maker.start(); - - List out = maker.execCapture("r"); - String expected = - out.stream().filter(s -> s.startsWith("rax")).findAny().get().split("\\s+")[0]; - - DebugRegisters regs = client.getRegisters(); - DebugInt64Value raxVal = (DebugInt64Value) regs.getValueByName("rax"); - - String actual = String.format("rax=%016x", raxVal.longValue()); - assertEquals(expected, actual); - } - } - - @Test - public void testGetRegisters() { - try (ProcMaker maker = new ProcMaker("notepad")) { - maker.start(); - - List out = maker.execCapture("r"); - String expected = out.stream().filter(s -> s.startsWith("rax")).findAny().get(); - - DebugRegisters regs = client.getRegisters(); - List indices = new ArrayList<>(); - int raxIdx = regs.getIndexByName("rax"); - int rbxIdx = regs.getIndexByName("rbx"); - int rcxIdx = regs.getIndexByName("rcx"); - indices.add(raxIdx); - indices.add(rbxIdx); - indices.add(rcxIdx); - Map values = - regs.getValues(DebugRegisterSource.DEBUG_REGSRC_DEBUGGEE, indices); - - String actual = String.format("rax=%016x rbx=%016x rcx=%016x", - ((DebugInt64Value) values.get(raxIdx)).longValue(), - ((DebugInt64Value) values.get(rbxIdx)).longValue(), - ((DebugInt64Value) values.get(rcxIdx)).longValue()); - assertEquals(expected, actual); - } - } - - @Test - public void testSetSingleRegister() { - try (ProcMaker maker = new ProcMaker("notepad")) { - maker.start(); - - DebugRegisters regs = client.getRegisters(); - regs.setValueByName("rax", new DebugInt64Value(0x0102030405060708L)); - - List out = maker.execCapture("r"); - String actual = - out.stream().filter(s -> s.startsWith("rax")).findAny().get().split("\\s+")[0]; - assertEquals("rax=0102030405060708", actual); - } - } - - @Test - public void testSetRegisters() { - try (ProcMaker maker = new ProcMaker("notepad")) { - maker.start(); - - DebugRegisters regs = client.getRegisters(); - // Purposefully choosing non-linked variant. - // Want to know that order does not make a difference. - Map values = new HashMap<>(); - values.put(regs.getIndexByName("rax"), new DebugInt64Value(0x0102030405060708L)); - values.put(regs.getIndexByName("rbx"), new DebugInt64Value(0x1122334455667788L)); - values.put(regs.getIndexByName("rcx"), new DebugInt64Value(0x8877665544332211L)); - regs.setValues(DebugRegisterSource.DEBUG_REGSRC_DEBUGGEE, values); - - List out = maker.execCapture("r"); - String actual = out.stream().filter(s -> s.startsWith("rax")).findAny().get(); - assertEquals("rax=0102030405060708 rbx=1122334455667788 rcx=8877665544332211", actual); - } - } - - @Test - public void testQueryVirtual() { - // Also, an experiment to figure out how it works - try (ProcMaker maker = new ProcMaker("notepad")) { - maker.start(); - - List collected1 = new ArrayList<>(); - try { - long last = 0; - long offset = 0; - do { - System.out.print(Long.toHexString(offset) + ": "); - DebugMemoryBasicInformation info = client.getDataSpaces().queryVirtual(offset); - //System.out.println(info); - System.out.println(Long.toHexString(info.baseAddress) + "-" + - Long.toHexString(info.regionSize) + ": " + info.state); - if (info.baseAddress != offset) { - System.out.println(" !!!"); - } - collected1.add(info); - last = offset; - offset += info.regionSize; - } - while (Long.compareUnsigned(last, offset) < 0); - } - catch (COMException e) { - if (!e.getMessage().contains("HRESULT: 80004002")) { - throw e; - } - } - - List collected2 = new ArrayList<>(); - for (DebugMemoryBasicInformation info : client.getDataSpaces().iterateVirtual(0)) { - collected2.add(info); - } - - assertTrue(collected1.size() > 0); - assertEquals(collected1, collected2); - - // For comparison - client.getControl().execute("!address"); - } - } - - @Test - public void testModules() { - try (ProcMaker maker = new ProcMaker("notepad")) { - maker.start(); - - for (DebugModule mod : client.getSymbols().iterateModules(0)) { - System.out.println(mod.getIndex() + ": " + Long.toHexString(mod.getBase()) + ": " + - mod.getName(DebugModuleName.MODULE)); - System.out.println(" Img: " + mod.getName(DebugModuleName.IMAGE)); - System.out.println(" Load: " + mod.getName(DebugModuleName.LOADED_IMAGE)); - } - } - } - - @Test(expected = COMException.class) - public void testModuleOutOfBounds() { - try (ProcMaker maker = new ProcMaker("notepad")) { - maker.start(); - - DebugModule umod = client.getSymbols() - .getModuleByIndex( - client.getSymbols().getNumberLoadedModules() + 1); - System.out.println(umod.getBase()); - } - } - - @Test - public void testQueryVirtualWithModule() { - try (ProcMaker maker = new ProcMaker("notepad")) { - maker.start(); - - for (DebugMemoryBasicInformation info : client.getDataSpaces().iterateVirtual(0)) { - if (info.state != PageState.FREE) { - DebugModule mod = null; - String name = "[NONE]"; - try { - mod = client.getSymbols().getModuleByOffset(info.baseAddress, 0); - name = mod.getName(DebugModuleName.IMAGE); - } - catch (COMException e) { - name = "[ERR:" + e + "]"; - } - System.out.println(String.format("%016x", info.baseAddress) + ":" + - Long.toHexString(info.regionSize) + ":" + info.state + " from " + name + - " " + info.type + info.protect); - } - } - } - } - - @Test - public void testSymbols() { - try (ProcMaker maker = new ProcMaker("notepad")) { - maker.start(); - - Set symbols = new LinkedHashSet<>(); - Set modules = new LinkedHashSet<>(); - for (DebugSymbolName sym : client.getSymbols().iterateSymbolMatches("*")) { - String[] parts = sym.name.split("!"); - symbols.add(sym); - modules.add(parts[0]); - } - System.out.println("Total Symbols: " + symbols.size()); - System.out.println("Total Modules (by symbol name): " + modules.size()); - - // These make assumptions that could be broken later. - // It used to expect at least 10 modules (devised when testing on Win7). Now it's 5! - assertTrue("Fewer than 1000 symbols: " + symbols.size(), symbols.size() > 1000); - assertTrue("Fewer than 3 modules: " + modules.size(), modules.size() > 3); - } - } - - @Test - public void testSymbolInfo() { - try (ProcMaker maker = new ProcMaker("notepad")) { - maker.start(); - - int count = 0; - for (DebugSymbolId symid : client.getSymbols().getSymbolIdsByName("ntdll!*")) { - //System.out.println(symid); - DebugSymbolEntry syment = client.getSymbols().getSymbolEntry(symid); - if (syment.typeId != 0) { - System.out.println(" " + syment); - } - count++; - } - - assertTrue(count > 10); - } - } - - @Test - public void testReadMemory() throws FileNotFoundException, IOException { - try (ProcMaker maker = new ProcMaker("notepad")) { - maker.start(); - - control.execute(".server tcp:port=54321"); - int len = 256; - - DebugModule notepadModule = client.getSymbols().getModuleByModuleName("notepad", 0); - System.out.println("Base: " + Long.toHexString(notepadModule.getBase())); - ByteBuffer data = ByteBuffer.allocate(len); - client.getDataSpaces().readVirtual(notepadModule.getBase(), data, data.remaining()); - System.out.println(NumericUtilities.convertBytesToString(data.array())); - - // TODO: Avoid hardcoding path to notepad - try (FileInputStream fis = new FileInputStream("C:\\Windows\\notepad.exe")) { - byte[] fromFile = new byte[len]; - fis.read(fromFile); - // TODO: Note sure why, but this seems to be the case after it's loaded - //ByteBuffer toWriteBase = ByteBuffer.wrap(fromFile).order(ByteOrder.LITTLE_ENDIAN); - //toWriteBase.putLong(280, notepadModule.getBase()); - System.out.println(NumericUtilities.convertBytesToString(fromFile)); - assertArrayEquals(fromFile, data.array()); - } - - data.clear(); - data.putInt(0x12345678); - client.getDataSpaces().readVirtual(notepadModule.getBase(), data, data.remaining()); - data.flip(); - - assertEquals(0x12345678, data.getInt()); - } - } - - @Test - public void testWriteMemory() { - try (ProcMaker maker = new ProcMaker("notepad")) { - maker.start(); - - // TODO: How to write to protected memory? - // Debugger should be able to modify program code. - DebugMemoryBasicInformation writable = null; - space: for (DebugMemoryBasicInformation info : client.getDataSpaces() - .iterateVirtual( - 0)) { - for (PageProtection prot : info.protect) { - if (prot.isWrite()) { - writable = info; - break space; - } - } - } - if (writable == null) { - throw new AssertionError("No writable pages?"); - } - System.out.println("writable: " + writable); - ByteBuffer toWrite = ByteBuffer.allocate(10); - toWrite.putInt(0x12345678); - toWrite.putInt(0x89abcdef); - toWrite.putShort((short) 0x5555); - toWrite.flip(); - client.getDataSpaces().writeVirtual(writable.baseAddress, toWrite, toWrite.remaining()); - - ByteBuffer toRead = ByteBuffer.allocate(10); - client.getDataSpaces().readVirtual(writable.baseAddress, toRead, toRead.remaining()); - - assertArrayEquals(toWrite.array(), toRead.array()); - } - } - - @Test - public void testBreakpoints() { - try (ProcMaker maker = new ProcMaker("notepad")) { - maker.start(); - - DebugBreakpoint bpt = control.addBreakpoint(BreakType.CODE); - System.out.println("Breakpoint id: " + bpt.getId()); - System.out.println("Flags: " + bpt.getFlags()); - DebugBreakpoint bpt2 = control.getBreakpointById(bpt.getId()); - assertEquals(bpt, bpt2); - } - } - - @Test - public void testFreezeUnfreeze() { - try (ProcMaker maker = new ProcMaker("notepad")) { - maker.start(); - - // Trying to see if any events will help me track frozen threads - System.out.println("****Freezing"); - control.execute("~0 f"); - System.out.println("****Unfreezing"); - control.execute("~0 u"); - System.out.println("****Done"); - // Well, that result stinks. - // There is no event to tell me about frozenness - } - } - - @Test - @Ignore("I can't find a reliable means to detect the last thread. " + - "There's supposed to be an initial break, but it is rarely reported. " + - "I thought about toolhelp, but that presumes local live debugging.") - public void testMultiThreadAttach() throws Exception { - // I need to see how to attach to multi-threaded processes. There must be some event - // or condition to indicate when all threads have been discovered. - String specimen = - Application.getOSFile("sctldbgeng", "expCreateThreadSpin.exe").getCanonicalPath(); - client.setOutputCallbacks(new DebugOutputCallbacks() { - @Override - public void output(int mask, String text) { - System.out.print(text); - System.out.flush(); - } - }); - client.setEventCallbacks(new DebugEventCallbacksAdapter() { - @Override - public DebugStatus breakpoint(DebugBreakpoint bp) { - control.outln("*** Breakpoint: " + bp); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus exception(DebugExceptionRecord64 exception, boolean firstChance) { - control.outln("*** Exception: " + exception + "," + firstChance); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus createThread(DebugThreadInfo debugThreadInfo) { - control.outln("*** CreateThread: " + debugThreadInfo); - System.out.println("Threads: " + client.getSystemObjects().getThreads()); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus createProcess(DebugProcessInfo debugProcessInfo) { - control.outln("*** CreateProcess: " + debugProcessInfo); - System.out.println("Threads: " + client.getSystemObjects().getThreads()); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus exitThread(int exitCode) { - control.outln("*** ExitThread: code=" + exitCode + ", " + - client.getSystemObjects().getEventThread()); - System.out.println("Threads: " + client.getSystemObjects().getThreads()); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus exitProcess(int exitCode) { - control.outln("*** ExitProcess: code=" + exitCode + ", " + - client.getSystemObjects().getEventProcess()); - System.out.println("Threads: " + client.getSystemObjects().getThreads()); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus changeEngineState(BitmaskSet flags, - long argument) { - if (flags.contains(ChangeEngineState.EXECUTION_STATUS)) { - control.outln( - "*** ExecutionStatus: " + control.getExecutionStatus()); - } - return DebugStatus.NO_CHANGE; - } - }); - try (DummyProc proc = new DummyProc(specimen)) { - System.out.println("Started " + specimen + " with PID=" + proc.pid); - Thread.sleep(1000); - System.out.println("Attaching..."); - client.attachProcess(client.getLocalServer(), proc.pid, BitmaskSet.of()); - if (true) { - for (int i = 0; i < 10; i++) { - System.out.println("WAIT " + i + "..."); - control.waitForEvent(100); - System.out.println("STATUS: " + control.getExecutionStatus()); - System.out.println("DONE " + i); - // control.execute("~*"); - } - } - } - finally { - client.setEventCallbacks(null); - } - } - - protected static class BreakAllCallbacks extends DebugEventCallbacksAdapter { - protected final DebugControl control; - protected final DebugRegisters regs; - protected final DebugSystemObjects objs; - - volatile protected long currentThread = 0; - volatile protected DebugProcessInfo createdProc = null; - volatile protected String lastReg = null; - - public BreakAllCallbacks(DebugClient client) { - this.control = client.getControl(); - this.regs = client.getRegisters(); - this.objs = client.getSystemObjects(); - } - - @Override - public DebugStatus breakpoint(DebugBreakpoint bp) { - control.outln("*** Breakpoint: " + bp); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus changeDebuggeeState(BitmaskSet flags, - long argument) { - control.outln("*** ChangeDebuggeeState: " + flags + "," + argument); - if (flags.contains(ChangeDebuggeeState.REGISTERS) && - !flags.contains(ChangeDebuggeeState.REFRESH)) { - DebugRegisterDescription description = regs.getDescription((int) argument); - control.outln(" Process: " + objs.getEventProcess()); - control.outln(" Thread: " + Long.toHexString(objs.getCurrentThreadSystemId())); - control.outln(" Reg: " + description); - control.outln(" Val: " + NumericUtilities - .convertBytesToString(regs.getValue((int) argument).encodeAsBytes(), "")); - lastReg = description.name; - } - return DebugStatus.BREAK; - } - - @Override - public DebugStatus changeEngineState(BitmaskSet flags, long argument) { - control.outln("*** ChangeEngineState: " + flags + "," + Long.toHexString(argument)); - if (flags.contains(ChangeEngineState.CURRENT_THREAD)) { - currentThread = argument; - } - return DebugStatus.BREAK; - } - - @Override - public DebugStatus changeSymbolState(BitmaskSet flags, long argument) { - control.outln("*** ChangeSymbolState: " + flags + "," + argument); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus createProcess(DebugProcessInfo debugProcessInfo) { - control.outln("*** CreateProcess: " + debugProcessInfo); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus createThread(DebugThreadInfo debugThreadInfo) { - control.outln("*** CreateThread: " + debugThreadInfo); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus exception(DebugExceptionRecord64 exception, boolean firstChance) { - control.outln("*** Exception: " + exception + "," + firstChance); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus exitProcess(int exitCode) { - control.outln("*** ExitProcess: code=" + exitCode); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus exitThread(int exitCode) { - control.outln("*** ExitThread: code=" + exitCode); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus loadModule(DebugModuleInfo debugModuleInfo) { - control.outln("*** LoadModule: " + debugModuleInfo); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus sessionStatus(SessionStatus status) { - control.outln("*** SessionStatus: " + status); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus systemError(int error, int level) { - control.outln("*** SystemError: " + error + "," + level); - return DebugStatus.BREAK; - } - - @Override - public DebugStatus unloadModule(String imageBaseName, long baseOffset) { - control.outln("*** UnloadModule: " + imageBaseName + "," + baseOffset); - return DebugStatus.BREAK; - } - } - - protected static class ConsoleOutputCallbacks implements DebugOutputCallbacks { - @Override - public void output(int mask, String text) { - System.out.print(text); - System.out.flush(); - } - } - - @Test - public void testAttachLaunch() throws Exception { - final String specimenX = "C:\\windows\\write.exe"; - final String specimenA = "C:\\windows\\notepad.exe"; - final String specimenC = "C:\\windows\\system32\\win32calc.exe"; - - try (DummyProc proc = new DummyProc(specimenX)) { - client.setOutputCallbacks(new ConsoleOutputCallbacks()); - BreakAllCallbacks cb = new BreakAllCallbacks(client); - client.setEventCallbacks(cb); - System.out.println("Started " + specimenA + " with PID=" + proc.pid); - Thread.sleep(1000); - - //System.out.println("Attaching..."); - //client.attachProcess(client.getLocalServer(), proc.pid, BitmaskSet.of()); - client.createProcess(client.getLocalServer(), specimenA, - BitmaskSet.of(DebugCreateFlags.DEBUG_PROCESS)); - - cb.lastReg = null; - //while (cb.lastReg == null) { - while (true) { - if (cb.currentThread != 0) { - client.getControl().execute("~* r rip"); - } - client.getControl().waitForEvent(); - } - /* - final Map ripValsPreLaunch = new HashMap<>(); - for (DebugThreadId tid : client.getSystemObjects().getThreads()) { - client.getSystemObjects().setCurrentThreadId(tid); - byte[] val = client.getRegisters().getValue(16).encodeAsBytes(); - ripValsPreLaunch.put(tid, new BigInteger(1, val).toString(16)); - } - - System.out.println("Creating..."); - client.createProcess(client.getLocalServer(), specimenC, - BitmaskSet.of(DebugCreateFlags.DEBUG_PROCESS)); - - cb.lastReg = null; - while (cb.lastReg == null) { - System.err.println(client.getSystemObjects().getCurrentProcessId()); - client.getControl().waitForEvent(); - client.getSystemObjects().setCurrentProcessId(new DebugProcessId(1)); - DebugEventInformation info = client.getControl().getLastEventInformation(); - System.err.println(info.getProcessId()); - } - - client.getSystemObjects().setCurrentProcessId(new DebugProcessId(0)); - final Map ripValsPostLaunch = new HashMap<>(); - for (DebugThreadId tid : client.getSystemObjects().getThreads()) { - client.getSystemObjects().setCurrentThreadId(tid); - byte[] val = client.getRegisters().getValue(16).encodeAsBytes(); - ripValsPostLaunch.put(tid, new BigInteger(1, val).toString(16)); - } - - assertEquals(ripValsPreLaunch, ripValsPostLaunch); - // - } - finally { - client.setOutputCallbacks(null); - client.setEventCallbacks(null); - } - } - */ -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractLldbModelHost.java b/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractLldbModelHost.java deleted file mode 100644 index 6c7f0901b0..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractLldbModelHost.java +++ /dev/null @@ -1,27 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model; - -import java.util.Map; - -import ghidra.dbg.test.AbstractModelHost; - -public abstract class AbstractLldbModelHost extends AbstractModelHost { - @Override - public Map getFactoryOptions() { - return Map.ofEntries(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbActivationTest.java b/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbActivationTest.java deleted file mode 100644 index 1e125477b0..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbActivationTest.java +++ /dev/null @@ -1,113 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model; - -import static org.junit.Assume.*; - -import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; - -import org.junit.Test; - -import generic.Unique; -import ghidra.dbg.target.*; -import ghidra.dbg.test.AbstractDebuggerModelActivationTest; -import ghidra.dbg.util.PathPattern; - -/** - * Test model object activation and focus - * - *

- * Activation and focus are related but separate concepts. Focus is a little looser, and is allowed - * by the model to exactly match the client's notion of focus, usually indicating the object of the - * user's interest. Activation, however, commands the model to make the given object the "current" - * object. This implies any commands issued to the CLI will affect the active object. The model - * reflects the active object back to the client via focus. This allows the model and client to - * synchronize their "active" objects, while reducing the likelihood of event feedback loops. - * Furthermore, not every object can be activated. For example, activating a register will likely - * result in the containing thread or frame becoming active instead. Or, activating a thread may - * result in its innermost frame becoming active as well. - */ -public abstract class AbstractModelForLldbActivationTest extends AbstractDebuggerModelActivationTest { - - @Test - public void testDefaultFocusIsAsExpected() throws Throwable { - List expectedDefaultFocus = getExpectedDefaultActivePath(); - assumeNotNull(expectedDefaultFocus); - m.build(); - - PathPattern pathPattern = new PathPattern(expectedDefaultFocus); - Set activatable = getActivatableThings(); - // The default must be one of the activatable objects - TargetObject obj = Unique.assertOne(activatable.stream() - .filter(f -> pathPattern.matches(f.getPath())) - .collect(Collectors.toList())); - if (m.hasInterpreter()) { - TargetInterpreter interpreter = findInterpreter(); - assertActiveViaInterpreter(obj, interpreter); - } - } - - @Test - public void testActivateEachOnce() throws Throwable { - m.build(); - - TargetActiveScope activeScope = findActiveScope(); - Set activatable = getActivatableThings(); - for (TargetObject obj : activatable) { - waitOn(activeScope.requestActivation(obj)); - if (m.hasInterpreter()) { - TargetInterpreter interpreter = findInterpreter(); - assertActiveViaInterpreter(obj, interpreter); - } - } - - } - - @Test - public void testActivateEachTwice() throws Throwable { - m.build(); - - TargetActiveScope activeScope = findActiveScope(); - Set activatable = getActivatableThings(); - for (TargetObject obj : activatable) { - waitOn(activeScope.requestActivation(obj)); - if (m.hasInterpreter()) { - TargetInterpreter interpreter = findInterpreter(); - assertActiveViaInterpreter(obj, interpreter); - } - waitOn(activeScope.requestActivation(obj)); - if (m.hasInterpreter()) { - TargetInterpreter interpreter = findInterpreter(); - assertActiveViaInterpreter(obj, interpreter); - } - } - } - - @Test - public void testActivateEachViaInterpreter() throws Throwable { - assumeTrue(m.hasInterpreter()); - m.build(); - - Set activatable = getActivatableThings(); - TargetInterpreter interpreter = findInterpreter(); - for (TargetObject obj : activatable) { - activateViaInterpreter(obj, interpreter); - assertActiveViaInterpreter(obj, interpreter); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbBreakpointsTest.java b/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbBreakpointsTest.java deleted file mode 100644 index a466e2d28f..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbBreakpointsTest.java +++ /dev/null @@ -1,200 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model; - -import static org.junit.Assert.*; - -import java.util.List; -import java.util.Map; - -import agent.lldb.model.iface2.*; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetBreakpointSpec.TargetBreakpointKind; -import ghidra.dbg.target.TargetBreakpointSpecContainer.TargetBreakpointKindSet; -import ghidra.dbg.test.*; -import ghidra.dbg.util.PathPattern; -import ghidra.dbg.util.PathUtils; -import ghidra.program.model.address.*; - -public abstract class AbstractModelForLldbBreakpointsTest - extends AbstractDebuggerModelBreakpointsTest implements ProvidesTargetViaLaunchSpecimen { - - protected abstract PathPattern getBreakPattern(); - - private static final int BREAK_ID_POS = 1; - - @Override - public AbstractDebuggerModelTest getTest() { - return this; - } - - @Override - protected List seedPath() { - return List.of(); - } - - @Override - public DebuggerTestSpecimen getLaunchSpecimen() { - return MacOSSpecimen.PRINT; - } - - @Override - public List getExpectedBreakpointContainerPath(List targetPath) { - List procsPath = PathUtils.parent(targetPath); - List sessionPath = PathUtils.parent(procsPath); - return PathUtils.extend(sessionPath, PathUtils.parse("Debug.Breakpoints")); - } - - @Override - public TargetBreakpointKindSet getExpectedSupportedKinds() { - return TargetBreakpointKindSet.of( // - TargetBreakpointKind.SW_EXECUTE, // - //TargetBreakpointKind.HW_EXECUTE, // - TargetBreakpointKind.READ, // - TargetBreakpointKind.WRITE); // - } - - @Override - public AddressRange getSuitableRangeForBreakpoint(TargetObject target, - TargetBreakpointKind kind) throws Throwable { - TargetStackFrame frame = retry(() -> { - TargetStackFrame f = findAnyStackFrame(target.getPath()); - assertNotNull(f); - return f; - }, List.of(AssertionError.class)); - waitOn(frame.fetchAttributes()); - Address pc = frame.getProgramCounter(); - switch (kind) { - case SW_EXECUTE: - case HW_EXECUTE: - return new AddressRangeImpl(pc, pc); - case READ: - case WRITE: - return new AddressRangeImpl(pc, 4); - default: - throw new AssertionError(); - } - } - - @Override - protected void placeBreakpointViaInterpreter(AddressRange range, TargetBreakpointKind kind, - TargetInterpreter interpreter) throws Throwable { - Address min = range.getMinAddress(); - if (range.getLength() == 4) { - switch (kind) { - case READ: - waitOn(interpreter.execute("watchpoint set expression -w read -s 4 -- " + min)); - break; - case WRITE: - waitOn(interpreter.execute("watchpoint set expression -w write -s 4 -- " + min)); - break; - default: - fail(); - } - } - else if (range.getLength() == 1) { - switch (kind) { - case SW_EXECUTE: - waitOn(interpreter.execute("breakpoint set -a " + min)); - break; - case HW_EXECUTE: - waitOn(interpreter.execute("breakpoint set -H -a " + min)); - break; - default: - fail(); - } - } - else { - fail(); - } - LldbModelTargetSession session = (LldbModelTargetSession) interpreter; - LldbModelTargetDebugContainer dc = (LldbModelTargetDebugContainer) session.getCachedAttribute("Debug"); - LldbModelTargetBreakpointContainer bc = (LldbModelTargetBreakpointContainer) dc.getCachedAttribute("Breakpoints"); - Map map = bc.fetchElements().get(); - for (TargetObject val : map.values()) { - val.fetchElements(); - } - } - - private String getTypeFromSpec(TargetObject t) { - boolean isExecute = t instanceof LldbModelTargetBreakpointSpec; - return isExecute ? "breakpoint" : "watchpoint"; - - } - private String getTypeFromKind(TargetBreakpointKind kind) { - boolean isExecute = kind.equals(TargetBreakpointKind.SW_EXECUTE) || kind.equals(TargetBreakpointKind.HW_EXECUTE); - return isExecute ? "breakpoint" : "watchpoint"; - } - private String getCommand(String cmd, String type, String bpId) { - return type + " " + cmd + " " + bpId.substring(1); - } - - @Override - protected void disableViaInterpreter(TargetTogglable t, TargetInterpreter interpreter) - throws Throwable { - String bpId = getBreakPattern().matchKeys(t.getPath()).get(BREAK_ID_POS); - String type = getTypeFromSpec(t); - waitOn(interpreter.execute(getCommand("disable", type, bpId))); - } - - @Override - protected void enableViaInterpreter(TargetTogglable t, TargetInterpreter interpreter) - throws Throwable { - String bpId = getBreakPattern().matchKeys(t.getPath()).get(BREAK_ID_POS); - String type = getTypeFromSpec(t); - waitOn(interpreter.execute(getCommand("enable", type, bpId))); - } - - @Override - protected void deleteViaInterpreter(TargetDeletable d, TargetInterpreter interpreter) - throws Throwable { - String bpId = getBreakPattern().matchKeys(d.getPath()).get(BREAK_ID_POS); - String type = getTypeFromSpec(d); - waitOn(interpreter.execute(getCommand("delete", type, bpId))); - } - - @Override - protected void assertLocCoversViaInterpreter(AddressRange range, TargetBreakpointKind kind, - TargetBreakpointLocation loc, TargetInterpreter interpreter) throws Throwable { - List matchIndices = getBreakPattern().matchKeys(loc.getSpecification().getPath()); - String bpId = matchIndices.get(BREAK_ID_POS); - String type = getTypeFromKind(kind); - String line = waitOn(interpreter.executeCapture(getCommand("list", type, bpId))).trim(); - if (type.equals("breakpoint")) - assertTrue(line.startsWith(bpId.substring(1))); - else - assertTrue(line.contains("Watchpoint " + bpId.substring(1))); - } - - @Override - protected void assertEnabledViaInterpreter(TargetTogglable t, boolean enabled, - TargetInterpreter interpreter) throws Throwable { - String bpId = getBreakPattern().matchKeys(t.getPath()).get(BREAK_ID_POS); - String type = getTypeFromSpec(t); - String line = waitOn(interpreter.executeCapture(getCommand("list", type, bpId))).trim(); - assertTrue(line.contains(bpId.substring(1)+":")); - assertTrue(enabled == !line.contains("disable")); - } - - @Override - protected void assertDeletedViaInterpreter(TargetDeletable d, TargetInterpreter interpreter) - throws Throwable { - String bpId = getBreakPattern().matchKeys(d.getPath()).get(BREAK_ID_POS); - String type = getTypeFromSpec(d); - String line = waitOn(interpreter.executeCapture(type + " list ")).trim(); - assertFalse(line.contains(bpId+":")); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbFactoryTest.java b/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbFactoryTest.java deleted file mode 100644 index 4b12cd8e80..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbFactoryTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model; - -import java.util.Map; - -import ghidra.dbg.test.AbstractDebuggerModelFactoryTest; - -public abstract class AbstractModelForLldbFactoryTest extends AbstractDebuggerModelFactoryTest { - @Override - protected Map getFailingFactoryOptions() { - // TODO: No options to test for IN-VM variant - return Map.ofEntries(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbFrameActivationTest.java b/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbFrameActivationTest.java deleted file mode 100644 index 2bbb51e663..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbFrameActivationTest.java +++ /dev/null @@ -1,77 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model; - -import static org.junit.Assert.*; - -import java.util.*; - -import ghidra.dbg.target.*; -import ghidra.dbg.util.PathPattern; - -public abstract class AbstractModelForLldbFrameActivationTest - extends AbstractModelForLldbActivationTest { - - protected abstract PathPattern getStackPattern(); - - protected DebuggerTestSpecimen getSpecimen() { - return MacOSSpecimen.STACK; - } - - @Override - protected Set getActivatableThings() throws Throwable { - DebuggerTestSpecimen specimen = getSpecimen(); - TargetLauncher launcher = findLauncher(); // root launcher should generate new inferiors - waitOn(launcher.launch(specimen.getLauncherArgs())); - - TargetProcess process = retry(() -> { - TargetProcess p = m.findAny(TargetProcess.class, seedPath()); - assertNotNull(p); - return p; - }, List.of(AssertionError.class)); - - trapAt("break_here", process); - - waitSettled(m.getModel(), 200); - - return retry(() -> { - Map, TargetStackFrame> frames = - m.findAll(TargetStackFrame.class, seedPath(), true); - assertTrue(frames.size() >= 3); - return Set.copyOf(frames.values()); - }, List.of(AssertionError.class)); - } - - protected void activateViaInterpreter(TargetObject obj, TargetInterpreter interpreter) - throws Throwable { - String index = getStackPattern().matchKeys(obj.getPath()).get(3); - waitOn(interpreter.execute("frame select " + index)); - } - - public abstract String getIdFromCapture(String line); - - @Override - protected void assertActiveViaInterpreter(TargetObject expected, TargetInterpreter interpreter) - throws Throwable { - String line = waitOn(interpreter.executeCapture("frame info")).trim(); - assertFalse(line.contains("\n")); - String id = getIdFromCapture(line); - int frameId = Integer.parseInt(id, 10); - int expId = Integer.decode(getStackPattern().matchKeys(expected.getPath()).get(3)); - assertEquals(expId, frameId); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbInterpreterTest.java b/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbInterpreterTest.java deleted file mode 100644 index 93b9f96c33..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbInterpreterTest.java +++ /dev/null @@ -1,84 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model; - -import java.util.List; - -import ghidra.dbg.target.TargetProcess; -import ghidra.dbg.test.*; -import ghidra.dbg.util.PathUtils; - -public abstract class AbstractModelForLldbInterpreterTest - extends AbstractDebuggerModelInterpreterTest - implements ProvidesTargetViaLaunchSpecimen { - - @Override - public AbstractDebuggerModelTest getTest() { - return this; - } - - @Override - protected void ensureInterpreterAvailable() throws Throwable { - obtainTarget(); - } - - @Override - protected List seedPath() { - return List.of(); - //return PathUtils.parse("Sessions[1]"); - } - - @Override - public List getExpectedInterpreterPath() { - return PathUtils.parse("Sessions[1]"); - } - - @Override - protected String getEchoCommand(String msg) { - return "script print(\'" + msg + "\')"; - } - - @Override - protected String getQuitCommand() { - return "quit"; - } - - @Override - protected String getAttachCommand() { - return "process attach " + Long.toHexString(dummy.pid); - } - - @Override - protected String getDetachCommand(TargetProcess process) { - return "process detach"; - } - - @Override - protected String getKillCommand(TargetProcess process) { - return "kill"; - } - - @Override - public DebuggerTestSpecimen getAttachSpecimen() { - return MacOSSpecimen.SPIN; - } - - @Override - public DebuggerTestSpecimen getLaunchSpecimen() { - return MacOSSpecimen.PRINT; - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbProcessActivationTest.java b/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbProcessActivationTest.java deleted file mode 100644 index 19cc796e2e..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbProcessActivationTest.java +++ /dev/null @@ -1,176 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model; - -import static org.junit.Assert.*; -import static org.junit.Assume.*; - -import java.math.BigInteger; -import java.util.*; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import org.junit.Test; - -import SWIG.SBTarget; -import agent.lldb.model.iface2.LldbModelTargetSession; -import generic.Unique; -import ghidra.dbg.target.*; -import ghidra.dbg.util.PathPattern; - -public abstract class AbstractModelForLldbProcessActivationTest - extends AbstractModelForLldbActivationTest { - - protected abstract PathPattern getProcessPattern(); - - protected int getCount() { - return 3; - } - - protected DebuggerTestSpecimen getSpecimen() { - return MacOSSpecimen.PRINT; - } - - public abstract List getExpectedSessionPath(); - - @Override - protected Set getActivatableThings() throws Throwable { - DebuggerTestSpecimen specimen = getSpecimen(); - TargetLauncher launcher = findLauncher(); - int count = getCount(); - for (int i = 0; i < count; i++) { - waitOn(launcher.launch(specimen.getLauncherArgs())); - } - - waitSettled(m.getModel(), 200); - - return retry(() -> { - Map, TargetProcess> found = - m.findAll(TargetProcess.class, getExpectedSessionPath(), true); - assertEquals(count, found.size()); - return Set.copyOf(found.values()); - }, List.of(AssertionError.class)); - } - - @Override - protected void activateViaInterpreter(TargetObject obj, TargetInterpreter interpreter) - throws Throwable { - LldbModelTargetSession session = (LldbModelTargetSession) obj.getParent().getParent(); - SBTarget sbt = (SBTarget) session.getModelObject(); - BigInteger procId = sbt.GetProcess().GetProcessID(); - String output = waitOn(interpreter.executeCapture("target list")); - String[] split = output.split("\n"); - String index = null; - for (String l : split) { - if (l.contains(procId.toString(10))) { - index = getIndexFromCapture(l); - } - } - assertNotEquals(index, null); - waitOn(interpreter.execute("target select " + index)); - } - - public abstract String getIdFromCapture(String line); - public abstract String getIndexFromCapture(String line); - - @Override - protected void assertActiveViaInterpreter(TargetObject expected, TargetInterpreter interpreter) - throws Throwable { - String output = waitOn(interpreter.executeCapture("target list")); - String line = Unique.assertOne(Stream.of(output.split("\n")) - .filter(l -> l.trim().startsWith("*")) - .collect(Collectors.toList())).trim(); - String procId = getIdFromCapture(line); - String expId = getProcessPattern().matchKeys(expected.getPath()).get(1); - assertEquals(Long.parseLong(expId, 16), Long.parseLong(procId)); - } - - protected TargetInterpreter findInterpreter(TargetObject obj) throws Throwable { - return (TargetInterpreter) obj.getParent().getParent(); - } - - @Override - @Test - public void testDefaultFocusIsAsExpected() throws Throwable { - List expectedDefaultFocus = getExpectedDefaultActivePath(); - assumeNotNull(expectedDefaultFocus); - m.build(); - - Set activatable = getActivatableThings(); - Map, TargetProcess> found = - m.findAll(TargetProcess.class, getExpectedSessionPath(), true); - // The default must be one of the activatable objects - Object[] keys = found.keySet().toArray(); - TargetObject obj = found.get(keys[keys.length-1]); - assertTrue(activatable.contains(obj)); - if (m.hasInterpreter()) { - TargetInterpreter interpreter = findInterpreter(obj); - assertActiveViaInterpreter(obj, interpreter); - } - } - - @Override - @Test - public void testActivateEachOnce() throws Throwable { - m.build(); - - TargetActiveScope activeScope = findActiveScope(); - Set activatable = getActivatableThings(); - for (TargetObject obj : activatable) { - waitOn(activeScope.requestActivation(obj)); - if (m.hasInterpreter()) { - TargetInterpreter interpreter = findInterpreter(obj); - assertActiveViaInterpreter(obj, interpreter); - } - } - - } - - @Override - @Test - public void testActivateEachTwice() throws Throwable { - m.build(); - - TargetActiveScope activeScope = findActiveScope(); - Set activatable = getActivatableThings(); - for (TargetObject obj : activatable) { - waitOn(activeScope.requestActivation(obj)); - if (m.hasInterpreter()) { - TargetInterpreter interpreter = findInterpreter(obj); - assertActiveViaInterpreter(obj, interpreter); - } - waitOn(activeScope.requestActivation(obj)); - if (m.hasInterpreter()) { - TargetInterpreter interpreter = findInterpreter(obj); - assertActiveViaInterpreter(obj, interpreter); - } - } - } - - @Override - @Test - public void testActivateEachViaInterpreter() throws Throwable { - assumeTrue(m.hasInterpreter()); - m.build(); - - Set activatable = getActivatableThings(); - for (TargetObject obj : activatable) { - TargetInterpreter interpreter = findInterpreter(obj); - activateViaInterpreter(obj, interpreter); - assertActiveViaInterpreter(obj, interpreter); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbRootAttacherTest.java b/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbRootAttacherTest.java deleted file mode 100644 index b97eb04096..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbRootAttacherTest.java +++ /dev/null @@ -1,94 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model; - -import static org.junit.Assert.*; - -import java.util.List; -import java.util.concurrent.TimeUnit; - -import org.junit.After; - -import agent.lldb.model.iface1.LldbModelTargetKillable; -import ghidra.dbg.DebugModelConventions; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetMethod.TargetParameterMap; -import ghidra.dbg.test.AbstractDebuggerModelAttacherTest; -import ghidra.dbg.util.PathUtils; -import ghidra.util.Msg; - -public abstract class AbstractModelForLldbRootAttacherTest - extends AbstractDebuggerModelAttacherTest { - - @Override - public List getExpectedAttachableContainerPath() { - return List.of("Available"); - } - - @Override - public List getExpectedAttacherPath() { - return PathUtils.parse(""); - } - - @Override - public DebuggerTestSpecimen getAttachSpecimen() { - return MacOSSpecimen.SPIN; - } - - @Override - public TargetParameterMap getExpectedAttachParameters() { - return null; // TODO - } - - @Override - public void assertEnvironment(TargetEnvironment environment) { - assertTrue(environment.getArchitecture().startsWith("x86_64")); - //assertTrue(environment.getOperatingSystem().startsWith("macos")); - assertEquals("little", environment.getEndian()); - assertTrue(environment.getDebugger().toLowerCase().contains("lldb")); - } - - @Override - @After - public void tearDownDebuggerModelTest() throws Throwable { - /** - * NB. Model has to be closed before dummy. If dummy is suspended by a debugger, terminating - * it, even forcibly, may fail. - */ - if (m != null) { - m.close(); - } - if (dummy != null) { - if (!dummy.process.destroyForcibly().waitFor(1000, TimeUnit.MILLISECONDS)) { - Msg.error(this, "Could not terminate process " + dummy.process.pid()); - //throw new TimeoutException("Could not terminate process " + pid); - } - //dummy.close(); - } - } - - @Override - protected void runTestKill(DebuggerTestSpecimen specimen) - throws Throwable { - TargetProcess process = retryForProcessRunning(specimen, this); - LldbModelTargetKillable killable = - (LldbModelTargetKillable) m.suitable(TargetKillable.class, process.getPath()); - waitAcc(killable); - waitOn(killable.destroy()); - retryVoid(() -> assertFalse(DebugModelConventions.isProcessAlive(process)), - List.of(AssertionError.class)); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbRootLauncherTest.java b/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbRootLauncherTest.java deleted file mode 100644 index 6c014072a9..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbRootLauncherTest.java +++ /dev/null @@ -1,72 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model; - -import static org.junit.Assert.*; - -import java.util.List; -import java.util.Map; - -import ghidra.dbg.DebugModelConventions; -import ghidra.dbg.DebugModelConventions.AsyncState; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetExecutionStateful.TargetExecutionState; -import ghidra.dbg.target.TargetMethod.ParameterDescription; -import ghidra.dbg.target.TargetMethod.TargetParameterMap; -import ghidra.dbg.test.AbstractDebuggerModelLauncherTest; -import ghidra.dbg.util.PathUtils; - -public abstract class AbstractModelForLldbRootLauncherTest - extends AbstractDebuggerModelLauncherTest { - - @Override - public List getExpectedLauncherPath() { - return PathUtils.parse(""); - } - - @Override - public DebuggerTestSpecimen getLaunchSpecimen() { - return MacOSSpecimen.PRINT; - } - - @Override - public TargetParameterMap getExpectedLauncherParameters() { - return TargetParameterMap.copyOf(Map.ofEntries( - Map.entry("args", ParameterDescription.create(String.class, "args", true, "", - "Command Line", "space-separated command-line arguments")))); - } - - @Override - public void assertEnvironment(TargetEnvironment environment) { - assertEquals("x86_64", environment.getArchitecture()); - //assertTrue(environment.getOperatingSystem().startsWith("macos")); - assertEquals("little", environment.getEndian()); - assertTrue(environment.getDebugger().toLowerCase().contains("lldb")); - } - - protected void runTestResumeTerminates(DebuggerTestSpecimen specimen) throws Throwable { - TargetProcess process = retryForProcessRunning(specimen, this); - TargetResumable resumable = m.suitable(TargetResumable.class, process.getPath()); - AsyncState state = - new AsyncState(m.suitable(TargetExecutionStateful.class, process.getPath())); - TargetExecutionState st = waitOn(state.waitUntil(s -> s == TargetExecutionState.STOPPED)); - assertTrue(st.isAlive()); - waitOn(resumable.resume()); - retryVoid(() -> assertFalse(DebugModelConventions.isProcessAlive(process)), - List.of(AssertionError.class)); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbScenarioCloneExitTest.java b/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbScenarioCloneExitTest.java deleted file mode 100644 index 7ba6f8a200..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbScenarioCloneExitTest.java +++ /dev/null @@ -1,32 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model; - -import ghidra.dbg.test.AbstractDebuggerModelScenarioCloneExitTest; - -public abstract class AbstractModelForLldbScenarioCloneExitTest - extends AbstractDebuggerModelScenarioCloneExitTest { - - @Override - protected DebuggerTestSpecimen getSpecimen() { - return MacOSSpecimen.CLONE_EXIT; - } - - @Override - protected String getBreakpointExpression() { - return "work"; - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbScenarioMemoryTest.java b/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbScenarioMemoryTest.java deleted file mode 100644 index c37ec0c817..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbScenarioMemoryTest.java +++ /dev/null @@ -1,73 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model; - -import static org.junit.Assert.*; - -import java.util.List; -import java.util.Objects; - -import agent.lldb.model.impl.LldbModelTargetProcessImpl; -import ghidra.dbg.target.*; -import ghidra.dbg.test.AbstractDebuggerModelScenarioMemoryTest; -import ghidra.dbg.util.PathUtils; -import ghidra.program.model.address.Address; - -public abstract class AbstractModelForLldbScenarioMemoryTest - extends AbstractDebuggerModelScenarioMemoryTest { - - @Override - protected MacOSSpecimen getSpecimen() { - return MacOSSpecimen.PRINT; - } - - protected String getSymbolName() { - return "overwrite"; - } - - @Override - protected Address getAddressToWrite(TargetProcess process) throws Throwable { - // It seems this is the only test case that exercises module symbols. - TargetObject session = process.getParent().getParent(); - List modulePath = PathUtils.extend(session.getPath(), - PathUtils.parse("Modules[" + getSpecimen().getBinModuleKey() + "]")); - TargetObject container = - Objects.requireNonNull(m.findContainer(TargetSymbol.class, modulePath)); - TargetSymbol symbol = - waitOn(container.fetchElements()).get(getSymbolName()).as(TargetSymbol.class); - return symbol.getValue(); - } - - @Override - protected byte[] getBytesToWrite() { - return "Speak".getBytes(); - } - - @Override - protected byte[] getExpectedBytes() { - return "Speak, World!".getBytes(); - } - - @Override - protected void verifyExpectedEffect(TargetProcess process) throws Throwable { - // TODO: Should (optional) exitCode be standardized on all models? - retryVoid(() -> { - String status = process.getTypedAttributeNowByName( - LldbModelTargetProcessImpl.EXIT_CODE_ATTRIBUTE_NAME, String.class, ""); - assertEquals("NONE", status); - }, List.of(AssertionError.class)); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbScenarioStackTest.java b/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbScenarioStackTest.java deleted file mode 100644 index 2c84db5edc..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbScenarioStackTest.java +++ /dev/null @@ -1,67 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model; - -import static org.junit.Assert.assertEquals; - -import java.util.*; -import java.util.Map.Entry; - -import ghidra.dbg.target.*; -import ghidra.dbg.test.AbstractDebuggerModelScenarioStackTest; -import ghidra.dbg.util.PathUtils; -import ghidra.program.model.address.Address; - -public abstract class AbstractModelForLldbScenarioStackTest - extends AbstractDebuggerModelScenarioStackTest { - protected static List expectedSymbols = - List.of("break_here", "funcC", "funcB", "funcA"); - protected NavigableMap symbolsByAddress = new TreeMap<>(); - - @Override - protected MacOSSpecimen getSpecimen() { - return MacOSSpecimen.STACK; - } - - @Override - protected String getBreakpointExpression() { - return "break_here"; - } - - @Override - protected void postLaunch(TargetProcess process) throws Throwable { - TargetObject session = process.getParent().getParent(); - TargetModuleContainer modules = m.find(TargetModuleContainer.class, session.getPath()); - // NB. NEVER is recommended resync mode for modules container - // It's not guaranteed to come before process is alive, though - TargetModule binMod = (TargetModule) waitOn(m.getAddedWaiter() - .wait(PathUtils.index(modules.getPath(), getSpecimen().getBinModuleKey()))); - - // NB. this heuristic assumes all function bodies are contiguous in memory - TargetSymbolNamespace symbols = m.find(TargetSymbolNamespace.class, binMod.getPath()); - // NB. ONCE is recommended resync mode for module symbols - for (Entry entry : waitOn(symbols.fetchElements()) - .entrySet()) { - symbolsByAddress.put(entry.getValue().as(TargetSymbol.class).getValue(), - entry.getKey()); - } - } - - @Override - protected void validateFramePC(int index, Address pc) { - assertEquals(expectedSymbols.get(index), symbolsByAddress.floorEntry(pc).getValue()); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbScenarioX64RegistersTest.java b/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbScenarioX64RegistersTest.java deleted file mode 100644 index 44f9c85510..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbScenarioX64RegistersTest.java +++ /dev/null @@ -1,70 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model; - -import static org.junit.Assert.assertTrue; - -import java.util.*; - -import agent.lldb.model.impl.LldbModelTargetProcessImpl; -import ghidra.dbg.target.*; -import ghidra.dbg.test.AbstractDebuggerModelScenarioRegistersTest; - -public abstract class AbstractModelForLldbScenarioX64RegistersTest - extends AbstractDebuggerModelScenarioRegistersTest { - - @Override - protected DebuggerTestSpecimen getSpecimen() { - return MacOSSpecimen.REGISTERS; - } - - @Override - protected String getBreakpointExpression() { - return "break_here"; - } - - @Override - protected Map getRegisterWrites() { - // RCX is first parameter `val` of break_here(int val) - return Map.of("rcx", arr("0000000000000041")); - } - - @Override - protected void verifyExpectedEffect(TargetProcess process) throws Throwable { - long status = process.getTypedAttributeNowByName( - LldbModelTargetProcessImpl.EXIT_CODE_ATTRIBUTE_NAME, Long.class, 0L); - // TODO: This really shouldn't return 0 - possible race? - assertTrue(status == 0x41 || status == 0); - } - - @Override - protected void performRegisterWrites(TargetObject target, Map toWrite) - throws Throwable { - TargetRegisterContainer c = Objects.requireNonNull( - m.findWithIndex(TargetRegisterContainer.class, "0", target.getPath())); - Map, TargetRegisterBank> banks = - m.findAll(TargetRegisterBank.class, c.getPath(), true); - for (String name : toWrite.keySet()) { - for (TargetRegisterBank bank : banks.values()) { - Map, TargetRegister> regs = m.findAll(TargetRegister.class, - bank.getPath(), pred -> pred.applyKeys(name), false); - for (TargetRegister reg : regs.values()) { - waitOn(bank.writeRegister(reg, toWrite.get(name))); - } - } - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbSessionActivationTest.java b/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbSessionActivationTest.java deleted file mode 100644 index 52c04d311c..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbSessionActivationTest.java +++ /dev/null @@ -1,182 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model; - -import static org.junit.Assert.*; -import static org.junit.Assume.*; - -import java.math.BigInteger; -import java.util.*; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import org.junit.Test; - -import SWIG.SBTarget; -import agent.lldb.model.iface2.LldbModelTargetSession; -import generic.Unique; -import ghidra.dbg.target.*; -import ghidra.dbg.test.AbstractDebuggerModelActivationTest; -import ghidra.dbg.util.PathPattern; - -public abstract class AbstractModelForLldbSessionActivationTest - extends AbstractDebuggerModelActivationTest { - - protected abstract PathPattern getSessionPattern(); - - protected int getCount() { - return 3; - } - - protected DebuggerTestSpecimen getSpecimen() { - return MacOSSpecimen.PRINT; - } - - public abstract List getExpectedSessionPath(); - - public abstract String getIndexFromCapture(String line); - - @Override - protected Set getActivatableThings() throws Throwable { - DebuggerTestSpecimen specimen = getSpecimen(); - TargetLauncher launcher = findLauncher(); - int count = getCount(); - for (int i = 0; i < count; i++) { - waitOn(launcher.launch(specimen.getLauncherArgs())); - } - - waitSettled(m.getModel(), 200); - - return retry(() -> { - Map, TargetInterpreter> found = - m.findAll(TargetInterpreter.class, getExpectedSessionPath(), true); - assertEquals(count, found.size()); - return Set.copyOf(found.values()); - }, List.of(AssertionError.class)); - } - - @Override - protected void activateViaInterpreter(TargetObject obj, TargetInterpreter interpreter) - throws Throwable { - LldbModelTargetSession session = (LldbModelTargetSession) obj; - SBTarget sbt = (SBTarget) session.getModelObject(); - BigInteger procId = sbt.GetProcess().GetProcessID(); - String output = waitOn(interpreter.executeCapture("target list")); - String[] split = output.split("\n"); - String index = null; - for (String l : split) { - if (l.contains(procId.toString(10))) { - index = getIndexFromCapture(l); - break; - } - } - assertNotEquals(index, null); - waitOn(interpreter.execute("target select " + index)); - } - - public abstract String getIdFromCapture(String line); - - @Override - protected void assertActiveViaInterpreter(TargetObject expected, TargetInterpreter interpreter) - throws Throwable { - String output = waitOn(interpreter.executeCapture("target list")); - String line = Unique.assertOne(Stream.of(output.split("\n")) - .filter(l -> l.trim().startsWith("*")) - .collect(Collectors.toList())).trim(); - String procId = getIdFromCapture(line); - String expId = getSessionPattern().matchKeys(expected.getPath()).get(0); - assertEquals(Long.parseLong(expId, 16), Long.parseLong(procId)); - } - - protected TargetInterpreter findInterpreter(TargetObject obj) throws Throwable { - return (TargetInterpreter) obj; - } - - // All of the original tests assertSuccessorOrExact on focusScope - // which is not true in the lldb case - - @Override - @Test - public void testDefaultFocusIsAsExpected() throws Throwable { - List expectedDefaultFocus = getExpectedDefaultActivePath(); - assumeNotNull(expectedDefaultFocus); - m.build(); - - Set activatable = getActivatableThings(); - Map, TargetInterpreter> found = - m.findAll(TargetInterpreter.class, getExpectedSessionPath(), true); - // The default must be one of the activatable objects - Object[] keys = found.keySet().toArray(); - TargetObject obj = found.get(keys[keys.length - 1]); - assertTrue(activatable.contains(obj)); - if (m.hasInterpreter()) { - TargetInterpreter interpreter = findInterpreter(obj); - assertActiveViaInterpreter(obj, interpreter); - } - } - - @Override - @Test - public void testActivateEachOnce() throws Throwable { - m.build(); - - TargetActiveScope activeScope = findActiveScope(); - Set activatable = getActivatableThings(); - for (TargetObject obj : activatable) { - waitOn(activeScope.requestActivation(obj)); - if (m.hasInterpreter()) { - TargetInterpreter interpreter = findInterpreter(obj); - assertActiveViaInterpreter(obj, interpreter); - } - } - - } - - @Override - @Test - public void testActivateEachTwice() throws Throwable { - m.build(); - - TargetActiveScope activeScope = findActiveScope(); - Set activatable = getActivatableThings(); - for (TargetObject obj : activatable) { - waitOn(activeScope.requestActivation(obj)); - if (m.hasInterpreter()) { - TargetInterpreter interpreter = findInterpreter(obj); - assertActiveViaInterpreter(obj, interpreter); - } - waitOn(activeScope.requestActivation(obj)); - if (m.hasInterpreter()) { - TargetInterpreter interpreter = findInterpreter(obj); - assertActiveViaInterpreter(obj, interpreter); - } - } - } - - @Override - @Test - public void testActivateEachViaInterpreter() throws Throwable { - assumeTrue(m.hasInterpreter()); - m.build(); - - Set activatable = getActivatableThings(); - for (TargetObject obj : activatable) { - TargetInterpreter interpreter = findInterpreter(obj); - activateViaInterpreter(obj, interpreter); - assertActiveViaInterpreter(obj, interpreter); - } - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbSteppableTest.java b/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbSteppableTest.java deleted file mode 100644 index 4bf9e5b95b..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbSteppableTest.java +++ /dev/null @@ -1,39 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model; - -import java.util.List; - -import ghidra.dbg.test.*; - -public abstract class AbstractModelForLldbSteppableTest extends AbstractDebuggerModelSteppableTest - implements ProvidesTargetViaLaunchSpecimen { - - @Override - public AbstractDebuggerModelTest getTest() { - return this; - } - - @Override - public List getExpectedSteppablePath(List threadPath) { - return threadPath; - } - - @Override - public DebuggerTestSpecimen getLaunchSpecimen() { - return MacOSSpecimen.PRINT; - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbThreadActivationTest.java b/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbThreadActivationTest.java deleted file mode 100644 index 96405e2ad0..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbThreadActivationTest.java +++ /dev/null @@ -1,87 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model; - -import static org.junit.Assert.*; - -import java.util.*; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import SWIG.SBThread; -import agent.lldb.model.iface2.LldbModelTargetThread; -import generic.Unique; -import ghidra.dbg.target.*; -import ghidra.dbg.util.PathPattern; - -public abstract class AbstractModelForLldbThreadActivationTest - extends AbstractModelForLldbActivationTest { - - protected abstract PathPattern getThreadPattern(); - - protected DebuggerTestSpecimen getSpecimen() { - return MacOSSpecimen.PRINT; - } - - protected int getCount() { - return 1; - } - - protected abstract List getExpectedSessionPath(); - - @Override - protected Set getActivatableThings() throws Throwable { - DebuggerTestSpecimen specimen = getSpecimen(); - TargetLauncher launcher = findLauncher(); - int count = getCount(); - for (int i = 0; i < count; i++) { - waitOn(launcher.launch(specimen.getLauncherArgs())); - } - - waitSettled(m.getModel(), 200); - - return retry(() -> { - Map, TargetThread> found = - m.findAll(TargetThread.class, getExpectedSessionPath(), true); - assertEquals(count, found.size()); - return Set.copyOf(found.values()); - }, List.of(AssertionError.class)); - } - - @Override - protected void activateViaInterpreter(TargetObject obj, TargetInterpreter interpreter) - throws Throwable { - LldbModelTargetThread thread = (LldbModelTargetThread) obj; - SBThread sbt = (SBThread) thread.getModelObject(); - long index = sbt.GetIndexID(); - waitOn(interpreter.execute("thread select " + index)); - } - - public abstract String getIdFromCapture(String line); - - @Override - protected void assertActiveViaInterpreter(TargetObject expected, TargetInterpreter interpreter) - throws Throwable { - String output = waitOn(interpreter.executeCapture("thread list")); - String line = Unique.assertOne(Stream.of(output.split("\n")) - .filter(l -> l.trim().startsWith("*")) - .collect(Collectors.toList())).trim(); - String threadId = getIdFromCapture(line); - String expId = getThreadPattern().matchKeys(expected.getPath()).get(2); - assertEquals(expId, threadId); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbX64RegistersTest.java b/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbX64RegistersTest.java deleted file mode 100644 index c99156d863..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForLldbX64RegistersTest.java +++ /dev/null @@ -1,167 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model; - -import static org.junit.Assert.assertArrayEquals; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.Assume.assumeNotNull; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Map.Entry; - -import org.junit.Test; - -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.TargetRegister; -import ghidra.dbg.target.TargetRegisterBank; -import ghidra.dbg.target.TargetRegisterContainer; -import ghidra.dbg.test.AbstractDebuggerModelRegistersTest; -import ghidra.dbg.test.AbstractDebuggerModelTest; -import ghidra.dbg.test.ProvidesTargetViaLaunchSpecimen; -import ghidra.dbg.util.PathUtils; - -public abstract class AbstractModelForLldbX64RegistersTest - extends AbstractDebuggerModelRegistersTest - implements ProvidesTargetViaLaunchSpecimen { - public final Map REG_VALS = Map.ofEntries( - Map.entry("rax", arr("0123456789abcdef")), - Map.entry("mm0", arr("0123456789abcdef"))); - - @Override - public AbstractDebuggerModelTest getTest() { - return this; - } - - @Override - public boolean isRegisterBankAlsoContainer() { - return false; - } - - @Override - public List getExpectedRegisterBankPath(List threadPath) { - return PathUtils.extend(threadPath, PathUtils.parse("Stack[0].Registers")); - } - - @Override - public Map getRegisterWrites() { - return REG_VALS; - } - - @Override - public DebuggerTestSpecimen getLaunchSpecimen() { - return MacOSSpecimen.PRINT; - } - - @Override - @Test - public void testRegistersHaveExpectedSizes() throws Throwable { - m.build(); - - TargetObject target = maybeSubstituteThread(obtainTarget()); - Map, TargetRegisterBank> banks = findRegisterBanks(target.getPath()); - for (TargetRegisterBank bank : banks.values()) { - List path = bank.getPath(); - for (Entry ent : getRegisterWrites().entrySet()) { - String regName = ent.getKey(); - Map, TargetRegister> regs = m.findAll(TargetRegister.class, - path, pred -> pred.applyKeys(regName), false); - for (TargetRegister reg : regs.values()) { - assertEquals(ent.getValue().length, (reg.getBitLength() + 7) / 8); - } - } - } - } - - @Override - @Test - public void testRegisterBankIsWhereExpected() throws Throwable { - m.build(); - - TargetObject target = maybeSubstituteThread(obtainTarget()); - List expectedRegisterBankPath = - getExpectedRegisterBankPath(target.getPath()); - assumeNotNull(expectedRegisterBankPath); - - Map, TargetRegisterBank> banks = findRegisterBanks(target.getPath()); - for (TargetRegisterBank bank : banks.values()) { - List path = bank.getPath(); - assertTrue(path.containsAll(expectedRegisterBankPath)); - } - } - - @Override - @Test - public void testReadRegisters() throws Throwable { - m.build(); - - TargetObject target = maybeSubstituteThread(obtainTarget()); - TargetRegisterContainer c = Objects.requireNonNull( - m.findWithIndex(TargetRegisterContainer.class, "0", target.getPath())); - Map, TargetRegisterBank> banks = - m.findAll(TargetRegisterBank.class, c.getPath(), true); - Map exp = getRegisterWrites(); - Map read = new HashMap<>(); - for (TargetRegisterBank bank : banks.values()) { - for (String name : exp.keySet()) { - Map, TargetRegister> regs = m.findAll(TargetRegister.class, - bank.getPath(), pred -> pred.applyKeys(name), false); - for (TargetRegister reg : regs.values()) { - byte[] bytes = waitOn(bank.readRegister(reg)); - read.put(name, bytes); - expectRegisterObjectValue(bank, name, bytes); - assertEquals(exp.get(name).length, bytes.length); - } - } - } - assertEquals("Not all registers were read, or extras were read", exp.keySet(), - read.keySet()); - } - - @Override - @Test - public void testWriteRegisters() throws Throwable { - m.build(); - - TargetObject target = maybeSubstituteThread(obtainTarget()); - TargetRegisterContainer c = Objects.requireNonNull( - m.findWithIndex(TargetRegisterContainer.class, "0", target.getPath())); - Map, TargetRegisterBank> banks = - m.findAll(TargetRegisterBank.class, c.getPath(), true); - Map write = getRegisterWrites(); - Map read = new HashMap<>(); - for (TargetRegisterBank bank : banks.values()) { - for (String name : write.keySet()) { - Map, TargetRegister> regs = m.findAll(TargetRegister.class, - bank.getPath(), pred -> pred.applyKeys(name), false); - for (TargetRegister reg : regs.values()) { - waitOn(bank.writeRegister(reg, write.get(name))); - - // NB. This only really tests the cache, if applicable. A scenario checks for efficacy. - byte[] bytes = waitOn(bank.readRegister(reg)); - read.put(name, bytes); - expectRegisterObjectValue(bank, name, bytes); - assertArrayEquals(write.get(name), bytes); - } - } - } - assertEquals("Not all registers were read, or extras were read", write.keySet(), - read.keySet()); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForlldbScenarioForkExitTest.java b/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForlldbScenarioForkExitTest.java deleted file mode 100644 index 8bd1071e7f..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/AbstractModelForlldbScenarioForkExitTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import ghidra.dbg.target.TargetEnvironment; -import ghidra.dbg.test.AbstractDebuggerModelScenarioForkExitTest; - -public abstract class AbstractModelForlldbScenarioForkExitTest - extends AbstractDebuggerModelScenarioForkExitTest { - - @Override - protected DebuggerTestSpecimen getSpecimen() { - return MacOSSpecimen.FORK_EXIT; - } - - @Override - protected String getParentBreakpointExpression() { - return "func"; - } - - @Override - protected String getChildBreakpointExpression() { - return "func"; - } - - @Override - public void assertEnvironment(TargetEnvironment environment) { - assertEquals("x86_64", environment.getArchitecture()); - //assertTrue(environment.getOperatingSystem().startsWith("macos")); - assertEquals("little", environment.getEndian()); - assertTrue(environment.getDebugger().toLowerCase().contains("lldb")); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/MacOSSpecimen.java b/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/MacOSSpecimen.java deleted file mode 100644 index 085bc1b25b..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/MacOSSpecimen.java +++ /dev/null @@ -1,141 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model; - -import java.io.File; -import java.util.*; - -import agent.lldb.model.iface2.LldbModelTargetAvailable; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetLauncher.TargetCmdLineLauncher; -import ghidra.dbg.test.AbstractDebuggerModelTest; -import ghidra.dbg.test.AbstractDebuggerModelTest.DebuggerTestSpecimen; -import ghidra.dbg.testutil.DebuggerModelTestUtils; -import ghidra.dbg.testutil.DummyProc; - -// codesign --entitlements debuggee-entitlement.xml -fs gdbcert ./xclock-x86_64 - -public enum MacOSSpecimen implements DebuggerTestSpecimen, DebuggerModelTestUtils { - SPIN { - @Override - public String getCommandLine() { - return DummyProc.which("expSpin"); - } - }, - READ { - @Override - public String getCommandLine() { - return DummyProc.which("expRead"); - } - }, - FORK_EXIT { - @Override - public String getCommandLine() { - return DummyProc.which("expFork"); - } - }, - CLONE_EXIT { - @Override - public String getCommandLine() { - return DummyProc.which("expCloneExit"); - } - }, - PRINT { - @Override - public String getCommandLine() { - return DummyProc.which("expPrint"); - } - }, - REGISTERS { - @Override - public String getCommandLine() { - return DummyProc.which("expRegisters"); - } - }, - STACK { - @Override - public String getCommandLine() { - return DummyProc.which("expStack"); - } - }, - CREATE_PROCESS { - @Override - public String getCommandLine() { - return DummyProc.which("expCreateProcess"); - } - }, - CREATE_THREAD_EXIT { - @Override - public String getCommandLine() { - return DummyProc.which("expCreateThreadExit"); - } - }; - - public abstract String getCommandLine(); - - @Override - public DummyProc runDummy() throws Throwable { - // This is not great, but.... - return DummyProc.run(getCommandLine().split("\\s+")); - } - - @Override - public Map getLauncherArgs() { - return Map.ofEntries(Map.entry(TargetCmdLineLauncher.CMDLINE_ARGS_NAME, getCommandLine())); - } - - @Override - public List getLaunchScript() { - // NB: this will not appear on the process list until cont - return List.of(".create " + getCommandLine() + "; g"); - } - - protected static String getShortName(String fullPath) { - if (fullPath == null) { - return null; - } - return new File(fullPath).getName(); - } - - public String getBinModuleKey() { - String moduleName = getBinModuleName(); - if (moduleName.endsWith(".exe")) { - return moduleName.substring(0, moduleName.length() - ".exe".length()); - } - return moduleName; - } - - public String getBinModuleName() { - return getShortName(getCommandLine().split("\\s+")[0]); - } - - @Override - public boolean isRunningIn(TargetProcess process, AbstractDebuggerModelTest test) throws Throwable { - // NB. ShellUtils.parseArgs removes the \s. Not good. - String expected = getBinModuleName(); - TargetObject session = process.getParent().getParent(); - Collection modules = test.m.findAll(TargetModule.class, session.getPath(), true).values(); - return modules.stream().anyMatch(m -> expected.equalsIgnoreCase(getShortName(m.getModuleName()))); - } - - @Override - public boolean isAttachable(DummyProc dummy, TargetAttachable attachable, AbstractDebuggerModelTest test) - throws Throwable { - waitOn(attachable.fetchAttributes()); - long pid = attachable.getTypedAttributeNowByName(LldbModelTargetAvailable.PID_ATTRIBUTE_NAME, Long.class, -1L); - return pid == dummy.pid; - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmLldbModelHost.java b/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmLldbModelHost.java deleted file mode 100644 index 4baeae0b9a..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmLldbModelHost.java +++ /dev/null @@ -1,29 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.invm; - -import agent.lldb.LldbInJvmDebuggerModelFactory; -import agent.lldb.lldb.LLDBTest; -import agent.lldb.model.AbstractLldbModelHost; -import ghidra.dbg.DebuggerModelFactory; - -public class InVmLldbModelHost extends AbstractLldbModelHost { - @Override - public DebuggerModelFactory getModelFactory() { - LLDBTest.assumeLibLoadable(); - return new LldbInJvmDebuggerModelFactory(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbBreakpointsTest.java b/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbBreakpointsTest.java deleted file mode 100644 index d61840a148..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbBreakpointsTest.java +++ /dev/null @@ -1,113 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.invm; - -import org.junit.Ignore; -import org.junit.Test; - -import agent.lldb.model.AbstractModelForLldbBreakpointsTest; -import ghidra.dbg.util.PathPattern; -import ghidra.dbg.util.PathUtils; - -@Ignore("deprecated") -public class InVmModelForLldbBreakpointsTest extends AbstractModelForLldbBreakpointsTest { - - @Override - protected PathPattern getBreakPattern() { - return new PathPattern(PathUtils.parse("Sessions[].Debug.Breakpoints[]")); - } - - @Override - public ModelHost modelHost() throws Throwable { - return new InVmLldbModelHost(); - } - - // The following tests are being ignored because the target doesn't generate - // breakpointAdded/Modified events on placement, only on resume - - @Override - @Ignore - @Test - public void testPlaceSoftwareExecuteBreakpointViaInterpreter() throws Throwable { - super.testPlaceSoftwareExecuteBreakpointViaInterpreter(); - } - - @Override - @Ignore - @Test - public void testPlaceHardwareExecuteBreakpointViaInterpreter() throws Throwable { - super.testPlaceHardwareExecuteBreakpointViaInterpreter(); - } - - @Override - @Ignore - @Test - public void testPlaceReadBreakpointViaInterpreter() throws Throwable { - super.testPlaceReadBreakpointViaInterpreter(); - } - - @Override - @Ignore - @Test - public void testPlaceWriteBreakpointViaInterpreter() throws Throwable { - super.testPlaceWriteBreakpointViaInterpreter(); - } - - @Override - @Ignore - @Test - public void testDeleteBreakpointsViaInterpreter() throws Throwable { - super.testDeleteBreakpointsViaInterpreter(); - } - - @Override - @Ignore - @Test - public void testDeleteBreakpointLocationsViaInterpreter() throws Throwable { - super.testDeleteBreakpointLocationsViaInterpreter(); - } - - @Override - @Ignore - @Test - public void testToggleBreakpointsViaInterpreter() throws Throwable { - super.testToggleBreakpointsViaInterpreter(); - } - - @Override - @Ignore - @Test - public void testToggleBreakpointLocationsViaInterpreter() throws Throwable { - super.testToggleBreakpointLocationsViaInterpreter(); - } - - // These have a similar problem enabled/disabled & cleared for watchpoints - // appear to occur on resume - - @Override - @Ignore - @Test - public void testDeleteBreakpoints() throws Throwable { - super.testDeleteBreakpoints(); - } - - @Override - @Ignore - @Test - public void testToggleBreakpoints() throws Throwable { - super.testToggleBreakpoints(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbFactoryTest.java b/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbFactoryTest.java deleted file mode 100644 index 51d6a2eaf9..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbFactoryTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.invm; - -import org.junit.Ignore; - -import agent.lldb.model.AbstractModelForLldbFactoryTest; - -@Ignore("deprecated") -public class InVmModelForLldbFactoryTest extends AbstractModelForLldbFactoryTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmLldbModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbFrameActivationTest.java b/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbFrameActivationTest.java deleted file mode 100644 index 7fd0bd8cdc..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbFrameActivationTest.java +++ /dev/null @@ -1,52 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.invm; - -import java.util.List; - -import org.junit.Ignore; - -import agent.lldb.model.AbstractModelForLldbFrameActivationTest; -import ghidra.dbg.util.PathPattern; -import ghidra.dbg.util.PathUtils; - -@Ignore("deprecated") -public class InVmModelForLldbFrameActivationTest - extends AbstractModelForLldbFrameActivationTest { - - @Override - protected PathPattern getStackPattern() { - return new PathPattern(PathUtils.parse("Sessions[].Processes[].Threads[].Stack[]")); - } - - @Override - protected List getExpectedDefaultActivePath() { - return PathUtils.parse("Sessions[].Processes[].Threads[].Stack[0]"); - } - - @Override - public String getIdFromCapture(String line) { - // Syntax "frame #N:..." - String[] split = line.split(":"); - split = split[0].split("#"); - return split[1]; - } - - @Override - public ModelHost modelHost() throws Throwable { - return new InVmLldbModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbInterpreterTest.java b/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbInterpreterTest.java deleted file mode 100644 index 4dfae949db..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbInterpreterTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.invm; - -import org.junit.Ignore; -import org.junit.Test; - -import agent.lldb.model.AbstractModelForLldbInterpreterTest; -import ghidra.dbg.test.ProvidesTargetViaLaunchSpecimen; - -@Ignore("deprecated") -public class InVmModelForLldbInterpreterTest extends AbstractModelForLldbInterpreterTest - implements ProvidesTargetViaLaunchSpecimen { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmLldbModelHost(); - } - - // Not sure what the behavior for these two should be... - // "file target" will change the process and this isn't handled - // also getLaunchScript in MacOSSpecimen is currently wrong - @Override - @Ignore - @Test - public void testLaunchViaInterpreterShowsInProcessContainer() throws Throwable { - super.testLaunchViaInterpreterShowsInProcessContainer(); - } - - @Override - @Ignore - @Test - public void testAttachViaInterpreterShowsInProcessContainer() throws Throwable { - super.testAttachViaInterpreterShowsInProcessContainer(); - } - - // "quit" does not have the desired behavior - @Override - @Ignore - @Test - public void testExecuteQuit() throws Throwable { - super.testExecuteQuit(); - } - - @Override - @Ignore - @Test - public void testInterpreterIsWhereExpected() throws Throwable { - super.testInterpreterIsWhereExpected(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbProcessActivationTest.java b/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbProcessActivationTest.java deleted file mode 100644 index 102656a917..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbProcessActivationTest.java +++ /dev/null @@ -1,66 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.invm; - -import java.util.List; - -import org.junit.Ignore; - -import agent.lldb.model.AbstractModelForLldbProcessActivationTest; -import ghidra.dbg.util.PathPattern; -import ghidra.dbg.util.PathUtils; - -@Ignore("deprecated") -public class InVmModelForLldbProcessActivationTest - extends AbstractModelForLldbProcessActivationTest { - - @Override - public List getExpectedSessionPath() { - return PathUtils.parse("Sessions[]"); - } - - @Override - protected PathPattern getProcessPattern() { - return new PathPattern(PathUtils.parse("Sessions[].Processes[]")); - } - - @Override - protected List getExpectedDefaultActivePath() { - return PathUtils.parse("Sessions[3].Processes[]"); - } - - @Override - public String getIdFromCapture(String line) { - // Syntax "* process #N:..." - String[] split = line.split("pid="); - split = split[1].split(","); - return split[0]; - } - - @Override - public String getIndexFromCapture(String line) { - // Syntax "* target #N:..." - String[] split = line.split("#"); - split = split[1].split(":"); - return split[0]; - } - - @Override - public ModelHost modelHost() throws Throwable { - return new InVmLldbModelHost(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbRootAttacherTest.java b/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbRootAttacherTest.java deleted file mode 100644 index bc8063a203..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbRootAttacherTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.invm; - -import org.junit.Ignore; -import org.junit.Test; - -import agent.lldb.model.AbstractModelForLldbRootAttacherTest; - -@Ignore("deprecated") -public class InVmModelForLldbRootAttacherTest extends AbstractModelForLldbRootAttacherTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmLldbModelHost(); - } - - // NB: These tests need debugger rights, which means either: - // (1) on macos, codesigning the executables - // (2) on linux, "sudo su; echo 0 > /proc/sys/kernel/yama/ptrace_scope" - - @Override - @Ignore // test requires ability to attach by object & lldb version requires pid - @Test - public void testAttachByObjBogusThrowsException() throws Throwable { - super.testAttachByObjBogusThrowsException(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbRootLauncherTest.java b/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbRootLauncherTest.java deleted file mode 100644 index 18f22f0296..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbRootLauncherTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.invm; - -import org.junit.Ignore; - -import agent.lldb.model.AbstractModelForLldbRootLauncherTest; - -@Ignore("deprecated") -public class InVmModelForLldbRootLauncherTest extends AbstractModelForLldbRootLauncherTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmLldbModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbScenarioCloneExitTest.java b/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbScenarioCloneExitTest.java deleted file mode 100644 index 2b45385337..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbScenarioCloneExitTest.java +++ /dev/null @@ -1,29 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.invm; - -import org.junit.Ignore; - -import agent.lldb.model.AbstractModelForLldbScenarioCloneExitTest; - -@Ignore("deprecated") -public class InVmModelForLldbScenarioCloneExitTest - extends AbstractModelForLldbScenarioCloneExitTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmLldbModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbScenarioForkExitTest.java b/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbScenarioForkExitTest.java deleted file mode 100644 index 458b6cd518..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbScenarioForkExitTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.invm; - -import org.junit.Ignore; -import org.junit.Test; - -import agent.lldb.model.AbstractModelForlldbScenarioForkExitTest; - -@Ignore("deprecated") -public class InVmModelForLldbScenarioForkExitTest - extends AbstractModelForlldbScenarioForkExitTest { - - @Override - @Ignore("Specimen is currently defunct - lldb does not support fork/vfork yet") - @Test - public void testScenario() throws Throwable { - } - - @Override - public ModelHost modelHost() throws Throwable { - return new InVmLldbModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbScenarioMemoryTest.java b/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbScenarioMemoryTest.java deleted file mode 100644 index 2f19a10c9e..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbScenarioMemoryTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.invm; - -import org.junit.Ignore; - -import agent.lldb.model.AbstractModelForLldbScenarioMemoryTest; - -@Ignore("deprecated") -public class InVmModelForLldbScenarioMemoryTest extends AbstractModelForLldbScenarioMemoryTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmLldbModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbScenarioStackTest.java b/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbScenarioStackTest.java deleted file mode 100644 index 5004b55028..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbScenarioStackTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.invm; - -import org.junit.Ignore; - -import agent.lldb.model.AbstractModelForLldbScenarioStackTest; - -@Ignore("deprecated") -public class InVmModelForLldbScenarioStackTest extends AbstractModelForLldbScenarioStackTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmLldbModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbScenarioX64RegistersTest.java b/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbScenarioX64RegistersTest.java deleted file mode 100644 index 0963469b53..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbScenarioX64RegistersTest.java +++ /dev/null @@ -1,29 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.invm; - -import org.junit.Ignore; - -import agent.lldb.model.AbstractModelForLldbScenarioX64RegistersTest; - -@Ignore("deprecated") -public class InVmModelForLldbScenarioX64RegistersTest - extends AbstractModelForLldbScenarioX64RegistersTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmLldbModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbSessionActivationTest.java b/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbSessionActivationTest.java deleted file mode 100644 index 749b7f72f1..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbSessionActivationTest.java +++ /dev/null @@ -1,66 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.invm; - -import java.util.List; - -import org.junit.Ignore; - -import agent.lldb.model.AbstractModelForLldbSessionActivationTest; -import ghidra.dbg.util.PathPattern; -import ghidra.dbg.util.PathUtils; - -@Ignore("deprecated") -public class InVmModelForLldbSessionActivationTest - extends AbstractModelForLldbSessionActivationTest { - - @Override - public List getExpectedSessionPath() { - return PathUtils.parse("Sessions[]"); - } - - @Override - protected PathPattern getSessionPattern() { - return new PathPattern(PathUtils.parse("Sessions[]")); - } - - @Override - protected List getExpectedDefaultActivePath() { - return PathUtils.parse("Sessions[]"); - } - - @Override - public String getIndexFromCapture(String line) { - // Syntax "* target #N:..." - String[] split = line.split("#"); - split = split[1].split(":"); - return split[0]; - } - - @Override - public String getIdFromCapture(String line) { - // Syntax "* target #N:..." - String[] split = line.split("pid="); - split = split[1].split(","); - return split[0]; - } - - @Override - public ModelHost modelHost() throws Throwable { - return new InVmLldbModelHost(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbSteppableTest.java b/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbSteppableTest.java deleted file mode 100644 index cf6fb343ae..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbSteppableTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.invm; - -import org.junit.Ignore; - -import agent.lldb.model.AbstractModelForLldbSteppableTest; - -@Ignore("deprecated") -public class InVmModelForLldbSteppableTest extends AbstractModelForLldbSteppableTest { - @Override - public ModelHost modelHost() throws Throwable { - return new InVmLldbModelHost(); - } -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbThreadActivationTest.java b/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbThreadActivationTest.java deleted file mode 100644 index 18b88eb940..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbThreadActivationTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.invm; - -import java.util.List; - -import org.junit.Ignore; - -import agent.lldb.model.AbstractModelForLldbThreadActivationTest; -import ghidra.dbg.util.PathPattern; -import ghidra.dbg.util.PathUtils; - -@Ignore("deprecated") -public class InVmModelForLldbThreadActivationTest - extends AbstractModelForLldbThreadActivationTest { - - @Override - public List getExpectedSessionPath() { - return PathUtils.parse("Sessions[]"); - } - - @Override - protected PathPattern getThreadPattern() { - return new PathPattern(PathUtils.parse("Sessions[].Processes[].Threads[]")); - } - - @Override - protected List getExpectedDefaultActivePath() { - return PathUtils.parse("Sessions[].Processes[].Threads[]"); - } - - @Override - public String getIdFromCapture(String line) { - // Syntax "* thread #N:..." - String[] split = line.split("tid = "); - split = split[1].split(","); - Integer decode = Integer.decode(split[0]); - return Integer.toHexString(decode); - } - - @Override - public ModelHost modelHost() throws Throwable { - return new InVmLldbModelHost(); - } - -} diff --git a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbX64RegistersTest.java b/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbX64RegistersTest.java deleted file mode 100644 index 15ab086790..0000000000 --- a/Ghidra/Debug/Debugger-agent-lldb/src/test/java/agent/lldb/model/invm/InVmModelForLldbX64RegistersTest.java +++ /dev/null @@ -1,30 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package agent.lldb.model.invm; - -import org.junit.Ignore; - -import agent.lldb.model.AbstractModelForLldbX64RegistersTest; - -@Ignore("deprecated") -public class InVmModelForLldbX64RegistersTest extends AbstractModelForLldbX64RegistersTest { - - @Override - public ModelHost modelHost() throws Throwable { - return new InVmLldbModelHost(); - } - -} diff --git a/Ghidra/Debug/Debugger-api/src/main/java/ghidra/app/services/DebuggerInterpreterService.java b/Ghidra/Debug/Debugger-api/src/main/java/ghidra/app/services/DebuggerInterpreterService.java deleted file mode 100644 index f181a1239e..0000000000 --- a/Ghidra/Debug/Debugger-api/src/main/java/ghidra/app/services/DebuggerInterpreterService.java +++ /dev/null @@ -1,30 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.services; - -import ghidra.dbg.target.TargetConsole; -import ghidra.dbg.target.TargetInterpreter; -import ghidra.debug.api.interpreter.DebuggerInterpreterConnection; -import ghidra.framework.plugintool.ServiceInfo; - -@ServiceInfo( - defaultProviderName = "ghidra.app.plugin.core.debug.gui.interpreters.DebuggerInterpreterPlugin", - description = "Service for managing debugger interpreter panels") -public interface DebuggerInterpreterService { - DebuggerInterpreterConnection showConsole(TargetConsole console); - - DebuggerInterpreterConnection showConsole(TargetInterpreter interpreter); -} diff --git a/Ghidra/Debug/Debugger-api/src/main/java/ghidra/app/services/DebuggerModelService.java b/Ghidra/Debug/Debugger-api/src/main/java/ghidra/app/services/DebuggerModelService.java index 6b539da7d9..30bf7f34dd 100644 --- a/Ghidra/Debug/Debugger-api/src/main/java/ghidra/app/services/DebuggerModelService.java +++ b/Ghidra/Debug/Debugger-api/src/main/java/ghidra/app/services/DebuggerModelService.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -36,6 +36,7 @@ import ghidra.util.datastruct.CollectionChangeListener; @ServiceInfo( defaultProviderName = "ghidra.app.plugin.core.debug.service.model.DebuggerModelServiceProxyPlugin", description = "Service for managing debug sessions and connections") +@Deprecated(forRemoval = true, since = "11.2") public interface DebuggerModelService { /** * Get the set of model factories found on the classpath diff --git a/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/interpreter/DebuggerInterpreterConnection.java b/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/interpreter/DebuggerInterpreterConnection.java deleted file mode 100644 index 32596bea94..0000000000 --- a/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/interpreter/DebuggerInterpreterConnection.java +++ /dev/null @@ -1,30 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.debug.api.interpreter; - -import ghidra.app.plugin.core.interpreter.InterpreterConnection; -import ghidra.app.plugin.core.interpreter.InterpreterConsole; -import ghidra.dbg.target.TargetObject; - -public interface DebuggerInterpreterConnection extends InterpreterConnection { - void setPinned(boolean pinned); - - boolean isPinned(); - - TargetObject getTargetConsole(); - - InterpreterConsole getInterpreterConsole(); -} diff --git a/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/model/DebuggerMappingOffer.java b/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/model/DebuggerMappingOffer.java index c7896098e8..79654b8719 100644 --- a/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/model/DebuggerMappingOffer.java +++ b/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/model/DebuggerMappingOffer.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -23,6 +23,7 @@ import ghidra.program.model.lang.CompilerSpecID; import ghidra.program.model.lang.LanguageID; import ghidra.util.Msg; +@Deprecated(forRemoval = true, since = "11.3") public interface DebuggerMappingOffer { /** * Get the first offer from the collection which successfully yields a mapper. diff --git a/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/model/DebuggerMappingOpinion.java b/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/model/DebuggerMappingOpinion.java index 8f3546b5e5..8c3307dab9 100644 --- a/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/model/DebuggerMappingOpinion.java +++ b/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/model/DebuggerMappingOpinion.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -39,6 +39,7 @@ import ghidra.util.classfinder.ExtensionPoint; * last-ditch effort when no opinion exists for the desired target. As such, one is never selected * automatically, and they are hidden from the manual record prompt by default. */ +@Deprecated(forRemoval = true, since = "11.3") public interface DebuggerMappingOpinion extends ExtensionPoint { /** * A comparator for sorting offers by decreasing confidence diff --git a/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/model/DebuggerMemoryMapper.java b/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/model/DebuggerMemoryMapper.java index 63126f86db..4c439214ba 100644 --- a/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/model/DebuggerMemoryMapper.java +++ b/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/model/DebuggerMemoryMapper.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -17,6 +17,7 @@ package ghidra.debug.api.model; import ghidra.program.model.address.*; +@Deprecated(forRemoval = true, since = "11.3") public interface DebuggerMemoryMapper { /** * Map the given address from the trace into the target process diff --git a/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/model/DebuggerProgramLaunchOffer.java b/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/model/DebuggerProgramLaunchOffer.java index 9e72519c55..3cd49b5f53 100644 --- a/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/model/DebuggerProgramLaunchOffer.java +++ b/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/model/DebuggerProgramLaunchOffer.java @@ -35,6 +35,7 @@ import ghidra.util.task.TaskMonitor; * specific connector and platform to obtain a target executing the program's image. The mechanisms * may vary wildly from platform to platform. */ +@Deprecated(forRemoval = true, since = "11.3") public interface DebuggerProgramLaunchOffer { /** diff --git a/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/model/DebuggerRegisterMapper.java b/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/model/DebuggerRegisterMapper.java index 2a317d71dd..9f6ca66e05 100644 --- a/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/model/DebuggerRegisterMapper.java +++ b/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/model/DebuggerRegisterMapper.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -35,6 +35,7 @@ import ghidra.program.model.lang.RegisterValue; * scheme becomes unwieldy. That said, a register mapper can map to non-base registers on target, * but the trace side of the mapping must deal exclusively in base registers. */ +@Deprecated(forRemoval = true, since = "11.3") public interface DebuggerRegisterMapper { /** * Get a target register (name) by string diff --git a/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/model/DebuggerTargetTraceMapper.java b/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/model/DebuggerTargetTraceMapper.java index b35f3e668f..0850c1b7b9 100644 --- a/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/model/DebuggerTargetTraceMapper.java +++ b/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/model/DebuggerTargetTraceMapper.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -21,6 +21,7 @@ import ghidra.program.model.lang.Language; import ghidra.trace.model.Trace; // TODO: Could probably just have Offer.take() go straight to recording.... +@Deprecated(forRemoval = true, since = "11.3") public interface DebuggerTargetTraceMapper { Language getTraceLanguage(); diff --git a/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/model/TraceRecorder.java b/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/model/TraceRecorder.java index 3b6bccc9ee..dc8a22249a 100644 --- a/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/model/TraceRecorder.java +++ b/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/model/TraceRecorder.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -72,6 +72,7 @@ import ghidra.util.task.TaskMonitor; * long as they're listening for changes to the trace. However, they MUST react to the exceptional * completion of such calls, most likely displaying an error dialog. */ +@Deprecated(forRemoval = true, since = "11.3") public interface TraceRecorder { /** diff --git a/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/model/TraceRecorderListener.java b/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/model/TraceRecorderListener.java index d23ba8458b..f45aa6819e 100644 --- a/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/model/TraceRecorderListener.java +++ b/Ghidra/Debug/Debugger-api/src/main/java/ghidra/debug/api/model/TraceRecorderListener.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -24,6 +24,7 @@ package ghidra.debug.api.model; * already keeping track of most objects of interest, it makes sense for it to implement some * conveniences for accessing and listening to those objects. */ +@Deprecated(forRemoval = true, since = "11.3") public interface TraceRecorderListener { /** diff --git a/Ghidra/Debug/Debugger-gadp/Module.manifest b/Ghidra/Debug/Debugger-gadp/Module.manifest deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/Ghidra/Debug/Debugger-gadp/README.md b/Ghidra/Debug/Debugger-gadp/README.md deleted file mode 100644 index d7a631e089..0000000000 --- a/Ghidra/Debug/Debugger-gadp/README.md +++ /dev/null @@ -1 +0,0 @@ -# Debugger-gadp diff --git a/Ghidra/Debug/Debugger-gadp/build.gradle b/Ghidra/Debug/Debugger-gadp/build.gradle deleted file mode 100644 index 5d3f5c61d6..0000000000 --- a/Ghidra/Debug/Debugger-gadp/build.gradle +++ /dev/null @@ -1,33 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -apply from: "${rootProject.projectDir}/gradle/javaProject.gradle" -apply from: "${rootProject.projectDir}/gradle/jacocoProject.gradle" -apply from: "${rootProject.projectDir}/gradle/javaTestProject.gradle" -apply from: "${rootProject.projectDir}/gradle/distributableGhidraModule.gradle" -apply from: "${rootProject.projectDir}/gradle/hasProtobuf.gradle" - -apply plugin: 'eclipse' -eclipse.project.name = 'Debug Debugger-gadp' - -dependencies { - api project(':Framework-AsyncComm') - api project(':Framework-Debugging') - api project(':ProposedUtils') - - testImplementation project(path: ':Framework-AsyncComm', configuration: 'testArtifacts') - testImplementation project(path: ':Framework-Debugging', configuration: 'testArtifacts') -} diff --git a/Ghidra/Debug/Debugger-gadp/certification.manifest b/Ghidra/Debug/Debugger-gadp/certification.manifest deleted file mode 100644 index 6841c5219a..0000000000 --- a/Ghidra/Debug/Debugger-gadp/certification.manifest +++ /dev/null @@ -1,3 +0,0 @@ -##VERSION: 2.0 -Module.manifest||GHIDRA||||END| -README.md||GHIDRA||||END| diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/GadpRegistry.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/GadpRegistry.java deleted file mode 100644 index effecc00ac..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/GadpRegistry.java +++ /dev/null @@ -1,114 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp; - -import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import com.google.protobuf.Message; - -import ghidra.dbg.DebuggerObjectModel; -import ghidra.dbg.DebuggerTargetObjectIface; -import ghidra.dbg.gadp.client.*; -import ghidra.dbg.target.*; -import utilities.util.reflection.ReflectionUtilities; - -@Deprecated(forRemoval = true, since = "11.2") -public enum GadpRegistry { - ; - - public interface InvocationBuilder { - Message.Builder buildMessage(String oid, Object[] args); - } - - public interface ServerInvoker { - CompletableFuture invoke(TargetObject object, M msg); - } - - public static final Map, Class> MIXIN_REGISTRY = - new HashMap<>(); - - public static void registerInterface(Class iface, - Class mixin) { - DebuggerObjectModel.requireIfaceName(iface); - MIXIN_REGISTRY.put(iface, mixin); - } - - static { - registerInterface(TargetAccessConditioned.class, GadpClientTargetAccessConditioned.class); - registerInterface(TargetAggregate.class, GadpClientTargetAggregate.class); - registerInterface(TargetAttachable.class, GadpClientTargetAttachable.class); - registerInterface(TargetAttacher.class, GadpClientTargetAttacher.class); - registerInterface(TargetBreakpointLocation.class, GadpClientTargetBreakpointLocation.class); - registerInterface(TargetBreakpointLocationContainer.class, - GadpClientTargetBreakpointLocationContainer.class); - registerInterface(TargetBreakpointSpecContainer.class, - GadpClientTargetBreakpointSpecContainer.class); - registerInterface(TargetBreakpointSpec.class, GadpClientTargetBreakpointSpec.class); - registerInterface(TargetConfigurable.class, GadpClientTargetConfigurable.class); - registerInterface(TargetConsole.class, GadpClientTargetConsole.class); - registerInterface(TargetDataTypeMember.class, GadpClientTargetDataTypeMember.class); - registerInterface(TargetDataTypeNamespace.class, GadpClientTargetDataTypeNamespace.class); - registerInterface(TargetDeletable.class, GadpClientTargetDeletable.class); - registerInterface(TargetDetachable.class, GadpClientTargetDetachable.class); - registerInterface(TargetEnvironment.class, GadpClientTargetEnvironment.class); - registerInterface(TargetEventScope.class, GadpClientTargetEventScope.class); - registerInterface(TargetExecutionStateful.class, GadpClientTargetExecutionStateful.class); - registerInterface(TargetActiveScope.class, GadpClientTargetActiveScope.class); - registerInterface(TargetFocusScope.class, GadpClientTargetFocusScope.class); - registerInterface(TargetInterpreter.class, GadpClientTargetInterpreter.class); - registerInterface(TargetInterruptible.class, GadpClientTargetInterruptible.class); - registerInterface(TargetKillable.class, GadpClientTargetKillable.class); - registerInterface(TargetLauncher.class, GadpClientTargetLauncher.class); - registerInterface(TargetMethod.class, GadpClientTargetMethod.class); - registerInterface(TargetMemory.class, GadpClientTargetMemory.class); - registerInterface(TargetMemoryRegion.class, GadpClientTargetMemoryRegion.class); - registerInterface(TargetModule.class, GadpClientTargetModule.class); - registerInterface(TargetModuleContainer.class, GadpClientTargetModuleContainer.class); - registerInterface(TargetNamedDataType.class, GadpClientTargetNamedDataType.class); - registerInterface(TargetProcess.class, GadpClientTargetProcess.class); - registerInterface(TargetRegister.class, GadpClientTargetRegister.class); - registerInterface(TargetRegisterBank.class, GadpClientTargetRegisterBank.class); - registerInterface(TargetRegisterContainer.class, GadpClientTargetRegisterContainer.class); - registerInterface(TargetResumable.class, GadpClientTargetResumable.class); - registerInterface(TargetSection.class, GadpClientTargetSection.class); - registerInterface(TargetSectionContainer.class, GadpClientTargetSectionContainer.class); - registerInterface(TargetStack.class, GadpClientTargetStack.class); - registerInterface(TargetStackFrame.class, GadpClientTargetStackFrame.class); - registerInterface(TargetSteppable.class, GadpClientTargetSteppable.class); - registerInterface(TargetSymbol.class, GadpClientTargetSymbol.class); - registerInterface(TargetSymbolNamespace.class, GadpClientTargetSymbolNamespace.class); - registerInterface(TargetThread.class, GadpClientTargetThread.class); - registerInterface(TargetTogglable.class, GadpClientTargetTogglable.class); - } - - public static List> getMixins( - List> ifaces) { - return ifaces.stream().map(MIXIN_REGISTRY::get).collect(Collectors.toList()); - } - - public static List getInterfaceNames(TargetObject obj) { - List result = new ArrayList<>(); - for (Class parent : ReflectionUtilities.getAllParents(obj.getClass())) { - DebuggerTargetObjectIface annot = parent.getAnnotation(DebuggerTargetObjectIface.class); - if (annot != null) { - result.add(annot.value()); - } - } - return result; - } -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/GadpVersion.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/GadpVersion.java deleted file mode 100644 index ebd6501c33..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/GadpVersion.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp; - -import java.util.NoSuchElementException; - -import ghidra.dbg.gadp.protocol.Gadp; - -@Deprecated(forRemoval = true, since = "11.2") -public enum GadpVersion { - VER1 { - @Override - public String getName() { - return "gadp1"; - } - }; - - public static Gadp.ConnectRequest.Builder makeRequest() { - Gadp.ConnectRequest.Builder req = Gadp.ConnectRequest.newBuilder(); - for (GadpVersion ver : values()) { - req.addVersion(ver.getName()); - } - return req; - } - - public static GadpVersion getByName(String name) { - for (GadpVersion ver : values()) { - if (name.equals(ver.getName())) { - return ver; - } - } - throw new NoSuchElementException("Unknown version: " + name); - } - - public abstract String getName(); -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/DelegateGadpClientTargetObject.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/DelegateGadpClientTargetObject.java deleted file mode 100644 index b7637ba8b6..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/DelegateGadpClientTargetObject.java +++ /dev/null @@ -1,293 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import java.lang.annotation.Annotation; -import java.lang.invoke.MethodHandle; -import java.lang.invoke.MethodHandles; -import java.lang.reflect.Method; -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.agent.DefaultTargetObject; -import ghidra.dbg.gadp.GadpRegistry; -import ghidra.dbg.gadp.client.annot.GadpEventHandler; -import ghidra.dbg.gadp.protocol.Gadp; -import ghidra.dbg.gadp.protocol.Gadp.EventNotification.EvtCase; -import ghidra.dbg.memory.CachedMemory; -import ghidra.dbg.target.TargetBreakpointSpec.TargetBreakpointAction; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.TargetObjectSchema; -import ghidra.program.model.address.AddressSpace; -import ghidra.util.Msg; -import ghidra.util.datastruct.ListenerSet; -import utilities.util.ProxyUtilities; - -/** - * This class is meant to be used as a delegate to a composed proxy - */ -public class DelegateGadpClientTargetObject - extends DefaultTargetObject - implements GadpClientTargetObject { - protected abstract static class GadpHandlerMap { - protected final Class annotationType; - protected final Class[] paramClasses; - protected final Map handles = new HashMap<>(); - - public GadpHandlerMap(Class annotationType, Class[] paramClasses) { - this.annotationType = annotationType; - this.paramClasses = paramClasses; - } - - protected abstract K getKey(A annot); - - protected void compose(GadpHandlerMap that) { - for (Map.Entry ent : that.handles.entrySet()) { - MethodHandle old = handles.put(ent.getKey(), ent.getValue()); - if (old != null) { - throw new AssertionError("Conflict over handler for " + ent.getKey() + ": " + - old + " and " + ent.getValue()); - } - } - } - - protected void register(K key, MethodHandle handle) { - MethodHandle old = handles.put(key, handle); - if (old != null) { - throw new AssertionError( - "Conflict over handler for " + key + ": " + old + " and " + handle); - } - } - - protected void registerInterface(Class iface) { - for (Method method : iface.getDeclaredMethods()) { - A annot = method.getDeclaredAnnotation(annotationType); - if (annot == null) { - continue; - } - if (!Arrays.equals(paramClasses, method.getParameterTypes())) { - throw new AssertionError("@" + annotationType.getSimpleName() + - " methods must have typed parameters: " + Arrays.toString(paramClasses)); - } - MethodHandle handle; - try { - handle = ProxyUtilities.getSuperMethodHandle(method, LOOKUP); - } - catch (IllegalAccessException e) { - throw new AssertionError(e); - } - register(getKey(annot), handle); - } - } - - protected void handle(GadpClientTargetObject proxy, K key, Object... params) { - MethodHandle handle = handles.get(key); - if (handle == null) { - //Msg.info(this, "Received unknown handler key: " + key); - return; - } - try { - handle.bindTo(proxy).invokeWithArguments(params); - } - catch (Throwable e) { - Msg.error(this, "Problem processing key: " + key, e); - } - } - } - - protected static class GadpEventHandlerMap extends GadpHandlerMap { - protected static final Class[] PARAMETER_CLASSES = - new Class[] { Gadp.EventNotification.class }; - - public GadpEventHandlerMap(Set> ifaces) { - super(GadpEventHandler.class, PARAMETER_CLASSES); - for (Class iface : ifaces) { - registerInterface(iface); - } - } - - @Override - protected EvtCase getKey(GadpEventHandler annot) { - return annot.value(); - } - } - - protected static final MethodHandles.Lookup LOOKUP = MethodHandles.lookup(); - protected static final Map>, GadpEventHandlerMap> EVENT_HANDLER_MAPS_BY_COMPOSITION = - new HashMap<>(); - - protected static GadpClientTargetObject makeModelProxy(GadpClient client, - GadpClientTargetObject parent, String key, String typeHint, List ifaceNames) { - List> ifaces = TargetObject.getInterfacesByName(ifaceNames); - List> mixins = GadpRegistry.getMixins(ifaces); - TargetObjectSchema schema = - parent == null ? client.getRootSchema() : parent.getSchema().getChildSchema(key); - return new DelegateGadpClientTargetObject(client, parent, key, typeHint, schema, ifaceNames, - ifaces, mixins).getProxy(); - } - - private final GadpClient client; - private final List ifaceNames; - private final List> ifaces; - private final GadpEventHandlerMap eventHandlers; - - protected Map memCache = null; // Becomes active if this is a TargetMemory - protected Map regCache = null; // Becomes active if this is a TargtRegisterBank - protected ListenerSet actions = null; // Becomes active is this is a TargetBreakpointSpec - - public DelegateGadpClientTargetObject(GadpClient client, GadpClientTargetObject parent, - String key, String typeHint, TargetObjectSchema schema, List ifaceNames, - List> ifaces, - List> mixins) { - super(client, mixins, client, parent, key, typeHint, schema); - this.client = client; - this.ifaceNames = ifaceNames; - this.ifaces = ifaces; - - Set> allMixins = new HashSet<>(mixins); - allMixins.add(GadpClientTargetObject.class); - this.eventHandlers = - EVENT_HANDLER_MAPS_BY_COMPOSITION.computeIfAbsent(allMixins, GadpEventHandlerMap::new); - } - - @Override - public GadpClient getModel() { - return client; - } - - @Override - public GadpClientTargetObject getProxy() { - return (GadpClientTargetObject) super.getProxy(); - } - - @Override - public Collection getInterfaceNames() { - return ifaceNames; - } - - @Override - public Collection> getInterfaces() { - return ifaces; - } - - @Override - public CompletableFuture resync(RefreshBehavior attributes, RefreshBehavior elements) { - return client - .sendChecked( - Gadp.ResyncRequest.newBuilder() - .setPath(GadpValueUtils.makePath(path)) - .setAttributes(attributes.equals(RefreshBehavior.REFRESH_ALWAYS)) - .setElements(elements.equals(RefreshBehavior.REFRESH_ALWAYS)), - Gadp.ResyncReply.getDefaultInstance()) - .thenApply(rep -> null); - } - - @Override - protected CompletableFuture requestAttributes(RefreshBehavior refresh) { - return resync(refresh, RefreshBehavior.REFRESH_NEVER); - } - - @Override - protected CompletableFuture requestElements(RefreshBehavior refresh) { - return resync(RefreshBehavior.REFRESH_NEVER, refresh); - } - - @Override - public DelegateGadpClientTargetObject getDelegate() { - return this; - } - - public void updateWithDeltas(Gadp.ModelObjectDelta deltaE, Gadp.ModelObjectDelta deltaA) { - Map elementsAdded = - GadpValueUtils.getElementMap(this, deltaE.getAddedList()); - Map attributesAdded = - GadpValueUtils.getAttributeMap(this, deltaA.getAddedList()); - - changeElements(deltaE.getRemovedList(), List.of(), elementsAdded, "Updated"); - changeAttributes(deltaA.getRemovedList(), attributesAdded, "Updated"); - } - - protected void handleEvent(Gadp.EventNotification notify) { - eventHandlers.handle(getProxy(), notify.getEvtCase(), notify); - } - - protected void assertValid() { - if (!valid) { - throw new IllegalStateException("Object is no longer valid: " + toString()); - } - } - - protected void doClearCaches() { - clearMemCacheEntries(); - clearRegisterCacheEntries(); - } - - @Override - public synchronized CompletableFuture invalidateCaches() { - assertValid(); - doClearCaches(); - return client - .sendChecked( - Gadp.CacheInvalidateRequest.newBuilder().setPath(GadpValueUtils.makePath(path)), - Gadp.CacheInvalidateReply.getDefaultInstance()) - .thenApply(rep -> null); - } - - protected synchronized CachedMemory getMemoryCache(AddressSpace space) { - GadpClientTargetMemory memory = (GadpClientTargetMemory) getProxy(); - if (memCache == null) { - memCache = new HashMap<>(); - } - return memCache.computeIfAbsent(space, - s -> new CachedMemory(memory.getRawReader(s), memory.getRawWriter(s))); - } - - protected synchronized void clearMemCacheEntries() { - if (memCache == null) { - return; - } - for (CachedMemory mem : memCache.values()) { - mem.clear(); - } - } - - protected synchronized Map getRegisterCache() { - if (regCache == null) { - regCache = Collections.synchronizedMap(new HashMap<>()); - } - return regCache; - } - - protected synchronized void clearRegisterCacheEntries() { - if (regCache != null) { - regCache.clear(); - } - } - - protected synchronized ListenerSet getActions(boolean createIfAbsent) { - if (actions == null && createIfAbsent) { - actions = new ListenerSet<>(TargetBreakpointAction.class, false); - } - return actions; - } - - @Override - public void doInvalidate(TargetObject branch, String reason) { - client.removeProxy(path, reason); - super.doInvalidate(branch, reason); - } -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClient.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClient.java deleted file mode 100644 index cc1ad895a9..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClient.java +++ /dev/null @@ -1,605 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import java.io.EOFException; -import java.io.IOException; -import java.nio.channels.*; -import java.util.*; -import java.util.concurrent.*; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.function.Function; - -import org.apache.commons.lang3.exception.ExceptionUtils; -import org.jdom.JDOMException; - -import com.google.protobuf.Message; -import com.google.protobuf.ProtocolStringList; - -import ghidra.async.*; -import ghidra.dbg.DebuggerModelClosedReason; -import ghidra.dbg.agent.*; -import ghidra.dbg.agent.AbstractTargetObject.ProxyFactory; -import ghidra.dbg.error.*; -import ghidra.dbg.gadp.GadpVersion; -import ghidra.dbg.gadp.error.*; -import ghidra.dbg.gadp.protocol.Gadp; -import ghidra.dbg.gadp.protocol.Gadp.ObjectCreatedEvent; -import ghidra.dbg.gadp.protocol.Gadp.RootMessage; -import ghidra.dbg.gadp.util.AsyncProtobufMessageChannel; -import ghidra.dbg.gadp.util.ProtobufOneofByTypeHelper; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.TargetObjectSchema; -import ghidra.dbg.target.schema.XmlSchemaContext; -import ghidra.dbg.util.PathUtils; -import ghidra.program.model.address.*; -import ghidra.util.*; -import ghidra.util.datastruct.FixedSizeHashMap; -import ghidra.util.exception.DuplicateNameException; -import utilities.util.ProxyUtilities; - -@Deprecated(forRemoval = true, since = "11.2") -public class GadpClient extends AbstractDebuggerObjectModel - implements ProxyFactory>> { - - protected static final int WARN_OUTSTANDING_REQUESTS = 10000; - // TODO: More sophisticated cache management - // TODO: Perhaps no cache at all, and rely totally on async notifications - protected static final int MAX_OUTSTANDING_REQUESTS = Integer.MAX_VALUE; - - protected static final ProtobufOneofByTypeHelper MSG_HELPER = - ProtobufOneofByTypeHelper.create(Gadp.RootMessage.getDefaultInstance(), - Gadp.RootMessage.newBuilder(), "msg"); - - protected enum ChannelState { - INACTIVE { - @Override - public boolean isOpen() { - return false; - } - - @Override - public boolean isTerminate() { - return false; - } - }, - NEGOTIATING { - @Override - public boolean isOpen() { - return true; - } - - @Override - public boolean isTerminate() { - return false; - } - }, - ACTIVE { - @Override - public boolean isOpen() { - return true; - } - - @Override - public boolean isTerminate() { - return false; - } - }, - CLOSED { - @Override - public boolean isOpen() { - return false; - } - - @Override - public boolean isTerminate() { - return true; - } - }; - - public abstract boolean isOpen(); - - public abstract boolean isTerminate(); - } - - /** - * For diagnostic purposes, it's useful to keep unanswered requests is an easily-reachable place - * - *

- * When not in release mode, this places the request into the future meant to complete with its - * reply. In release mode, the recorded request is left null in order to conserve memory. Thus, - * one should never access {@link #request} programmatically, except for diagnostics. The field - * is meant to be examined only from a Java debugger. - */ - protected static class RequestMemo extends CompletableFuture { - private static final boolean RECORD_REQUESTS = !SystemUtilities.isInReleaseMode(); - - @SuppressWarnings("unused") - private final RootMessage request; - - public RequestMemo(Gadp.RootMessage request) { - this.request = RECORD_REQUESTS ? request : null; - } - } - - protected static Gadp.RootMessage checkError(Gadp.RootMessage msg) { - Gadp.ErrorReply error = MSG_HELPER.expect(msg, Gadp.ErrorReply.getDefaultInstance()); - if (error != null) { - switch (error.getCode()) { - case EC_NO_INTERFACE: - throw new DebuggerModelTypeException(error.getMessage()); - case EC_NO_OBJECT: - throw new DebuggerModelNoSuchPathException(error.getMessage()); - case EC_BAD_ARGUMENT: - throw new DebuggerIllegalArgumentException(error.getMessage()); - case EC_MEMORY_ACCESS: - throw new DebuggerMemoryAccessException(error.getMessage()); - case EC_REGISTER_ACCESS: - throw new DebuggerRegisterAccessException(error.getMessage()); - case EC_BAD_ADDRESS: - throw new AssertionError( - "Client implementation sent an invalid address: " + error.getMessage()); - case EC_BAD_REQUEST: - throw new AssertionError( - "Client implementation sent an invalid request: " + error.getMessage()); - case UNRECOGNIZED: - throw new AssertionError( - "Server replied with an error code unknown to the client: " + - error.getCodeValue() + ": " + error.getMessage()); - case EC_USER_ERROR: - throw new DebuggerUserException(error.getMessage()); - case EC_MODEL_ACCESS: - throw new DebuggerModelAccessException(error.getMessage()); - case EC_UNKNOWN: - throw new RuntimeException("Unknown: " + error.getMessage()); - case EC_NO_VERSION: - default: - throw new GadpErrorException(error.getCode(), error.getMessage()); - } - } - return msg; - } - - protected static T nullForNotExist(Throwable e) { - e = AsyncUtils.unwrapThrowable(e); - if (e instanceof DebuggerModelNoSuchPathException) { - return null; - } - return ExceptionUtils.rethrow(e); - } - - protected static GadpClientTargetObject targetObjectOrNull(Object value) { - if (value instanceof GadpClientTargetObject) { - return (GadpClientTargetObject) value; - } - return null; - } - - protected static class GadpAddressFactory extends DefaultAddressFactory { - protected GadpAddressFactory() { - super(new AddressSpace[] { - new GenericAddressSpace("ram", 64, AddressSpace.TYPE_RAM, 0) }); - } - - @Override - public synchronized AddressSpace getAddressSpace(String name) { - AddressSpace space = super.getAddressSpace(name); - if (space != null) { - return space; - } - - space = new GenericAddressSpace(name, 64, AddressSpace.TYPE_RAM, getNumAddressSpaces(), - true); - try { - addAddressSpace(space); - } - catch (DuplicateNameException e) { - throw new AssertionError(e); - } - return space; - } - } - - protected class MessagePairingCache extends AsyncPairingCache { - protected final AsyncDebouncer cacheMonitor = - new AsyncDebouncer<>(AsyncTimer.DEFAULT_TIMER, 500); - - public MessagePairingCache() { - super(MAX_OUTSTANDING_REQUESTS); - cacheMonitor.addListener(this::cacheSettled); - } - - @Override - protected Map createResultCache(int max) { - return new FixedSizeHashMap<>(max) { - @Override - protected boolean removeEldestEntry(Map.Entry eldest) { - if (!super.removeEldestEntry(eldest)) { - return false; - } - Msg.error(this, "Received message with unexpected sequence number: " + eldest); - return true; - } - }; - } - - @Override - public CompletableFuture waitOn(Integer key, - Function> futureFactory) { - cacheMonitor.contact(null); - return super.waitOn(key, futureFactory); - } - - @Override - protected Map> createPromiseCache(int max) { - return new FixedSizeHashMap<>(max) { - @Override - protected boolean removeEldestEntry( - Map.Entry> eldest) { - if (!super.removeEldestEntry(eldest)) { - return false; - } - String message = "Command with sequence number " + eldest.getKey() + - " evicted"; - Msg.error(this, message); - AsyncUtils.FRAMEWORK_EXECUTOR.execute(() -> { - eldest.getValue().completeExceptionally(new TimeoutException(message)); - }); - return true; - } - }; - } - - private void cacheSettled(Void __) { - int size = getUnpairedPromises().size(); - if (size == 0) { - Msg.info(this, "Unanswered request cache size has settled to 0. All is well."); - } - else { - Msg.info(this, "Unanswered request cache size has settled to " + size + - ". Chances are something's gone wrong."); - } - } - } - - protected final String description; - protected final AsynchronousByteChannel byteChannel; - protected final AsyncProtobufMessageChannel messageChannel; - - protected AsyncReference channelState = - new AsyncReference<>(ChannelState.INACTIVE); - protected GadpVersion activeVersion = null; - protected XmlSchemaContext schemaContext; - protected TargetObjectSchema rootSchema; - - protected final TriConsumer listenerForChannelState = - this::channelStateChanged; - protected final MessagePairingCache messageMatcher = new MessagePairingCache(); - protected final AtomicInteger sequencer = new AtomicInteger(); - - protected final Map, GadpClientTargetObject> modelProxies = new HashMap<>(); - - protected final GadpAddressFactory factory = new GadpAddressFactory(); - - { - channelState.addChangeListener(listenerForChannelState); - } - - public GadpClient(String description, AsynchronousByteChannel channel) { - this.description = description; - this.byteChannel = channel; - this.messageChannel = createMessageChannel(channel); - } - - @Override - public SpiTargetObject createProxy(AbstractTargetObject delegate, - List> mixins) { - return ProxyUtilities.composeOnDelegate(GadpClientTargetObject.class, - (GadpClientTargetObject) delegate, mixins, GadpClientTargetObject.LOOKUP); - } - - protected AsyncProtobufMessageChannel createMessageChannel( - AsynchronousByteChannel channel) { - return new AsyncProtobufMessageChannel<>(channel); - } - - @Override - public String toString() { - return ""; - } - - protected void channelStateChanged(ChannelState old, ChannelState set, - DebuggerModelClosedReason reason) { - if (old == ChannelState.NEGOTIATING && set == ChannelState.ACTIVE) { - broadcast().modelOpened(); - } - else if (old == ChannelState.ACTIVE && set == ChannelState.CLOSED) { - broadcast().modelClosed(reason); - root.invalidateSubtree(root, "GADP Client disconnected"); - messageMatcher.flush(new DebuggerModelTerminatingException("GADP Client disconnected")); - } - } - - protected CompletableFuture sendCommand(Message.Builder req) { - Gadp.RootMessage.Builder root = Gadp.RootMessage.newBuilder(); - MSG_HELPER.set(root, req); - int seqno = sequencer.getAndIncrement(); - root.setSequence(seqno); - // Need to get into the matcher before we send - RootMessage built = root.build(); - CompletableFuture waitOn = - messageMatcher.waitOn(seqno, k -> new RequestMemo(built)); - if (messageMatcher.getUnpairedPromises().size() > WARN_OUTSTANDING_REQUESTS) { - Msg.warn(this, "Unanswered request count exceeds " + WARN_OUTSTANDING_REQUESTS + - "! Chances are something's gone wrong."); - } - - checkOpen(); - return messageChannel.write(built).thenCompose(__ -> { - checkOpen(); - return waitOn; - }); - } - - protected M require(M example, Gadp.RootMessage msg) { - M inner = MSG_HELPER.expect(msg, example); - if (inner == null) { - throw new GadpMessageException("Reply " + msg + " does not contain expected field " + - MSG_HELPER.getFieldForTypeOf(example)); - } - return inner; - } - - protected CompletableFuture sendChecked(Message.Builder req, - M exampleRep) { - if (channelState.get().isTerminate()) { - return CompletableFuture.failedFuture( - new DebuggerModelTerminatingException("GADP Client disconnected")); - } - return sendCommand(req) - .thenApply(msg -> require(exampleRep, checkError(msg))); - //.thenCompose(msg -> flushEvents().thenApply(__ -> msg)); - // messageMatcher.fulfill happens on clientExecutor already - } - - protected void receiveLoop() { - AsyncUtils.loop(TypeSpec.VOID, loop -> { - if (channelState.get().isTerminate()) { - loop.exit(); - return; - } - messageChannel.read(Gadp.RootMessage::parseFrom).handle(loop::consume); - }, TypeSpec.cls(Gadp.RootMessage.class), (msg, loop) -> { - CompletableFuture.runAsync(() -> { - Gadp.EventNotification notify = - MSG_HELPER.expect(msg, Gadp.EventNotification.getDefaultInstance()); - if (notify != null) { - processNotification(notify); - } - else { - messageMatcher.fulfill(msg.getSequence(), msg); - } - }, clientExecutor).exceptionally(ex -> { - Msg.error(this, "Error processing message: ", ex); - return null; - }); - loop.repeat(); // All async loop to continue while we process - }).exceptionally(exc -> { - exc = AsyncUtils.unwrapThrowable(exc); - if (exc instanceof NotYetConnectedException) { - throw new AssertionError("Connect first, please", exc); - } - else if (exc instanceof EOFException) { - Msg.error(this, "Channel has no data remaining"); - } - else if (exc instanceof ClosedChannelException) { - Msg.error(this, "Channel is already closed"); - } - else if (exc instanceof CancelledKeyException) { - Msg.error(this, "Channel key is cancelled. Probably closed"); - } - else if (exc instanceof RejectedExecutionException) { - Msg.trace(this, "Ignoring rejection", exc); - } - else { - Msg.error(this, "Receive failed for an unknown reason", exc); - } - channelState.set(ChannelState.CLOSED, DebuggerModelClosedReason.abnormal(exc)); - return null; - }); - } - - protected void processNotification(Gadp.EventNotification notify) { - if (!byteChannel.isOpen()) { - return; - } - ProtocolStringList path = notify.getPath().getEList(); - //Msg.debug(this, "Processing notification: " + path + " " + notify.getEvtCase()); - if (notify.hasObjectCreatedEvent()) { - notify.getObjectCreatedEvent(); - // AbstractTargetObject invokes created event - createProxy(path, notify.getObjectCreatedEvent()); - return; - } - if (notify.hasRootAddedEvent()) { - if (!path.isEmpty()) { - Msg.warn(this, "Server gave non-root path for root-added event: " + - PathUtils.toString(path)); - } - synchronized (lock) { - addModelRoot(getProxy(List.of(), true)); - } - return; - } - GadpClientTargetObject obj = getProxy(path, true); - if (obj == null) { - return; // Error already logged - } - obj.getDelegate().handleEvent(notify); - } - - @Override - public String getBrief() { - return "GADP@" + Integer.toHexString(System.identityHashCode(this)) + " " + description; - } - - public CompletableFuture connect() { - Gadp.ConnectRequest.Builder req = GadpVersion.makeRequest(); - if (channelState.get() != ChannelState.INACTIVE) { - throw new GadpIllegalStateException( - "Client has already connected or started connecting"); - } - Msg.trace(this, "Connecting"); - - channelState.set(ChannelState.NEGOTIATING, null); - - AsyncFence fence = new AsyncFence(); - fence.include(sendCommand(req).thenAccept(msg -> { - Gadp.ConnectReply rep = - require(Gadp.ConnectReply.getDefaultInstance(), checkError(msg)); - GadpVersion version = GadpVersion.getByName(rep.getVersion()); - synchronized (this) { - activeVersion = version; - try { - schemaContext = XmlSchemaContext.deserialize(rep.getSchemaContext()); - } - catch (JDOMException e) { - throw new GadpMessageException("Invalid schema context XML", e); - } - rootSchema = schemaContext.getSchema(schemaContext.name(rep.getRootSchema())); - } - channelState.set(ChannelState.ACTIVE, null); - // launches in background in parallel, with its own error reporting - // Thus, do not compose - receiveLoop(); - })); - /** - * receiveLoop is not yet running, so receive exactly the version reply in parallel. - * Otherwise, the above sendCommand can never complete. - */ - fence.include(messageChannel.read(Gadp.RootMessage::parseFrom).thenAccept(msg -> { - messageMatcher.fulfill(msg.getSequence(), msg); - })); - return fence.ready(); - } - - @Override - public CompletableFuture close() { - try { - messageChannel.close(); - channelState.set(ChannelState.CLOSED, DebuggerModelClosedReason.normal()); - return super.close(); - } - catch (RejectedExecutionException e) { - reportError(this, "Client already closed", e); - return AsyncUtils.nil(); - } - catch (IOException e) { - return CompletableFuture.failedFuture(e); - } - } - - protected void checkOpen() { - if (!channelState.get().isOpen()) { - throw new GadpIllegalStateException("Channel is not open"); - } - } - - @Override - public boolean isAlive() { - return channelState.get() == ChannelState.ACTIVE; - } - - @Override - public TargetObjectSchema getRootSchema() { - return rootSchema; - } - - @Override - public CompletableFuture ping(String content) { - Gadp.PingRequest.Builder req = Gadp.PingRequest.newBuilder().setContent(content); - return sendChecked(req, Gadp.PingReply.getDefaultInstance()).thenAccept(rep -> { - if (!content.equals(rep.getContent())) { - throw new GadpMessageException( - "Data in ping was corrupt: req=" + req + ",rep=" + rep); - } - }); - } - - protected GadpClientTargetObject getProxy(List path, boolean internal) { - synchronized (lock) { - GadpClientTargetObject proxy = modelProxies.get(path); - if (proxy == null && internal) { - Msg.error(this, - "Server referred to non-existent object at path: " + PathUtils.toString(path)); - } - return proxy; - } - } - - protected GadpClientTargetObject createProxy(List path, ObjectCreatedEvent evt) { - synchronized (lock) { - if (modelProxies.containsKey(path)) { - Msg.error(this, "Agent announced creation of an already-existing object: " + - PathUtils.toString(path)); - return modelProxies.get(path); - } - List parentPath = PathUtils.parent(path); - GadpClientTargetObject parent; - if (parentPath == null) { - parent = null; - } - else { - parent = getProxy(parentPath, true); - if (parent == null) { - Msg.error(this, "Got object's created event before its parent's: " + - PathUtils.toString(path)); - } - } - GadpClientTargetObject proxy = DelegateGadpClientTargetObject.makeModelProxy(this, - parent, PathUtils.getKey(path), evt.getTypeHint(), evt.getInterfaceList()); - modelProxies.put(path, proxy); - return proxy; - } - } - - protected void removeProxy(List path, String reason) { - synchronized (lock) { - modelProxies.remove(path); - } - } - - @Override - public AddressFactory getAddressFactory() { - return factory; - } - - @Override - public TargetObject getModelObject(List path) { - return getProxy(path, false); - } - - @Override - public void invalidateAllLocalCaches() { - List copy; - synchronized (lock) { - copy = List.copyOf(modelProxies.values()); - } - for (GadpClientTargetObject proxy : copy) { - proxy.getDelegate().doClearCaches(); - } - } -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetAccessConditioned.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetAccessConditioned.java deleted file mode 100644 index 4404136753..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetAccessConditioned.java +++ /dev/null @@ -1,23 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import ghidra.dbg.target.TargetAccessConditioned; - -public interface GadpClientTargetAccessConditioned - extends GadpClientTargetObject, TargetAccessConditioned { - // Nothing to add -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetActiveScope.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetActiveScope.java deleted file mode 100644 index 1b10f5b7ea..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetActiveScope.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import java.util.concurrent.CompletableFuture; - -import ghidra.dbg.error.DebuggerIllegalArgumentException; -import ghidra.dbg.gadp.protocol.Gadp; -import ghidra.dbg.target.TargetActiveScope; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.util.PathUtils; - -public interface GadpClientTargetActiveScope extends GadpClientTargetObject, TargetActiveScope { - - @Override - default CompletableFuture requestActivation(TargetObject obj) { - getDelegate().assertValid(); - getModel().assertMine(TargetObject.class, obj); - // The server should detect this error, but we can detect it here without sending a request - if (!PathUtils.isAncestor(getPath(), obj.getPath())) { - throw new DebuggerIllegalArgumentException( - "Can only activate a successor of the scope"); - } - return getModel() - .sendChecked( - Gadp.ActivationRequest.newBuilder() - .setPath(GadpValueUtils.makePath(getPath())) - .setActive(GadpValueUtils.makePath(obj.getPath())), - Gadp.ActivationReply.getDefaultInstance()) - .thenApply(__ -> null); - } -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetAggregate.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetAggregate.java deleted file mode 100644 index 6ee0f17e9a..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetAggregate.java +++ /dev/null @@ -1,22 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import ghidra.dbg.target.TargetAggregate; - -public interface GadpClientTargetAggregate extends GadpClientTargetObject, TargetAggregate { - // Nothing to add -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetAttachable.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetAttachable.java deleted file mode 100644 index 6fc7674542..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetAttachable.java +++ /dev/null @@ -1,22 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import ghidra.dbg.target.TargetAttachable; - -public interface GadpClientTargetAttachable extends GadpClientTargetObject, TargetAttachable { - // Nothing to add -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetAttacher.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetAttacher.java deleted file mode 100644 index c906cc89b4..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetAttacher.java +++ /dev/null @@ -1,42 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import java.util.concurrent.CompletableFuture; - -import ghidra.dbg.gadp.protocol.Gadp; -import ghidra.dbg.target.*; - -public interface GadpClientTargetAttacher extends GadpClientTargetObject, TargetAttacher { - @Override - default CompletableFuture attach(TargetAttachable attachable) { - getDelegate().assertValid(); - getModel().assertMine(TargetObject.class, attachable); - return getModel().sendChecked(Gadp.AttachRequest.newBuilder() - .setPath(GadpValueUtils.makePath(getPath())) - .setTarget(GadpValueUtils.makePath(attachable.getPath())), - Gadp.AttachReply.getDefaultInstance()).thenApply(rep -> null); - } - - @Override - default CompletableFuture attach(long pid) { - getDelegate().assertValid(); - return getModel().sendChecked(Gadp.AttachRequest.newBuilder() - .setPath(GadpValueUtils.makePath(getPath())) - .setPid(pid), - Gadp.AttachReply.getDefaultInstance()).thenApply(rep -> null); - } -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetBreakpointLocation.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetBreakpointLocation.java deleted file mode 100644 index 3a704a06e1..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetBreakpointLocation.java +++ /dev/null @@ -1,23 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import ghidra.dbg.target.TargetBreakpointLocation; - -public interface GadpClientTargetBreakpointLocation - extends GadpClientTargetObject, TargetBreakpointLocation { - // Nothing to add -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetBreakpointLocationContainer.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetBreakpointLocationContainer.java deleted file mode 100644 index f0479e2d32..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetBreakpointLocationContainer.java +++ /dev/null @@ -1,23 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import ghidra.dbg.target.TargetBreakpointLocationContainer; - -public interface GadpClientTargetBreakpointLocationContainer - extends GadpClientTargetObject, TargetBreakpointLocationContainer { - // Nothing to add -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetBreakpointSpec.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetBreakpointSpec.java deleted file mode 100644 index 109a4a1b8a..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetBreakpointSpec.java +++ /dev/null @@ -1,58 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import java.util.concurrent.CompletableFuture; - -import ghidra.dbg.gadp.protocol.Gadp; -import ghidra.dbg.target.TargetBreakpointSpec; -import ghidra.util.datastruct.ListenerSet; - -public interface GadpClientTargetBreakpointSpec - extends GadpClientTargetObject, TargetBreakpointSpec { - - @Override - default CompletableFuture toggle(boolean enabled) { - getDelegate().assertValid(); - return getModel().sendChecked(Gadp.BreakToggleRequest.newBuilder() - .setPath(GadpValueUtils.makePath(getPath())) - .setEnabled(enabled), - Gadp.BreakToggleReply.getDefaultInstance()).thenApply(rep -> null); - } - - @Override - default CompletableFuture disable() { - return toggle(false); - } - - @Override - default CompletableFuture enable() { - return toggle(true); - } - - @Override - default void addAction(TargetBreakpointAction action) { - getDelegate().getActions(true).add(action); - } - - @Override - default void removeAction(TargetBreakpointAction action) { - ListenerSet actions = getDelegate().getActions(false); - if (actions != null) { - actions.remove(action); - } - } -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetBreakpointSpecContainer.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetBreakpointSpecContainer.java deleted file mode 100644 index 6721f02782..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetBreakpointSpecContainer.java +++ /dev/null @@ -1,84 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import java.util.Set; -import java.util.concurrent.CompletableFuture; - -import ghidra.dbg.gadp.client.annot.GadpEventHandler; -import ghidra.dbg.gadp.protocol.Gadp; -import ghidra.dbg.gadp.protocol.Gadp.Path; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetBreakpointSpec.TargetBreakpointAction; -import ghidra.dbg.target.TargetBreakpointSpec.TargetBreakpointKind; -import ghidra.program.model.address.AddressRange; -import ghidra.util.datastruct.ListenerSet; - -public interface GadpClientTargetBreakpointSpecContainer - extends GadpClientTargetObject, TargetBreakpointSpecContainer { - - @Override - default CompletableFuture placeBreakpoint(AddressRange range, - Set kinds) { - getDelegate().assertValid(); - return getModel() - .sendChecked( - Gadp.BreakCreateRequest.newBuilder() - .setPath(GadpValueUtils.makePath(getPath())) - .setAddress(GadpValueUtils.makeRange(range)) - .setKinds(GadpValueUtils.makeBreakKindSet(kinds)), - Gadp.BreakCreateReply.getDefaultInstance()) - .thenApply(rep -> null); - } - - @Override - default CompletableFuture placeBreakpoint(String expression, - Set kinds) { - getDelegate().assertValid(); - return getModel() - .sendChecked( - Gadp.BreakCreateRequest.newBuilder() - .setPath(GadpValueUtils.makePath(getPath())) - .setExpression(expression) - .setKinds(GadpValueUtils.makeBreakKindSet(kinds)), - Gadp.BreakCreateReply.getDefaultInstance()) - .thenApply(rep -> null); - } - - @GadpEventHandler(Gadp.EventNotification.EvtCase.BREAK_HIT_EVENT) - default void handleBreakHitEvent(Gadp.EventNotification notification) { - Gadp.BreakHitEvent evt = notification.getBreakHitEvent(); - TargetObject trapped = getModel().getProxy(evt.getTrapped().getEList(), true); - Path framePath = evt.getFrame(); - TargetStackFrame frame = framePath == null || framePath.getECount() == 0 ? null - : getModel().getProxy(framePath.getEList(), true).as(TargetStackFrame.class); - Path specPath = evt.getSpec(); - TargetBreakpointSpec spec = specPath == null ? null - : getModel().getProxy(specPath.getEList(), true).as(TargetBreakpointSpec.class); - Path bptPath = evt.getEffective(); - TargetBreakpointLocation breakpoint = bptPath == null ? null - : getModel().getProxy(bptPath.getEList(), true).as(TargetBreakpointLocation.class); - broadcast().breakpointHit(this, trapped, frame, spec, breakpoint); - if (spec instanceof GadpClientTargetBreakpointSpec) { - // If I don't have a cached proxy, then I don't have any listeners - GadpClientTargetBreakpointSpec specObj = (GadpClientTargetBreakpointSpec) spec; - ListenerSet actions = specObj.getDelegate().getActions(false); - if (actions != null) { - actions.invoke().breakpointHit(specObj, trapped, frame, breakpoint); - } - } - } -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetConfigurable.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetConfigurable.java deleted file mode 100644 index 1f6a78aef6..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetConfigurable.java +++ /dev/null @@ -1,34 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import ghidra.dbg.gadp.protocol.Gadp; -import ghidra.dbg.target.TargetConfigurable; - -public interface GadpClientTargetConfigurable extends GadpClientTargetObject, TargetConfigurable { - - @Override - default CompletableFuture writeConfigurationOption(String key, Object value) { - getDelegate().assertValid(); - return getModel().sendChecked(Gadp.ConfigureRequest.newBuilder() - .setPath(GadpValueUtils.makePath(getPath())) - .setOption(GadpValueUtils.makeNamedValue(Map.entry(key, value))), - Gadp.ConfigureReply.getDefaultInstance()).thenApply(rep -> null); - } -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetConsole.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetConsole.java deleted file mode 100644 index ba52bea01e..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetConsole.java +++ /dev/null @@ -1,36 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import java.util.concurrent.CompletableFuture; - -import com.google.protobuf.ByteString; - -import ghidra.dbg.gadp.protocol.Gadp; -import ghidra.dbg.target.TargetConsole; - -public interface GadpClientTargetConsole extends GadpClientTargetObject, TargetConsole { - - @Override - default CompletableFuture write(byte[] data) { - getDelegate().assertValid(); - return getModel().sendChecked(Gadp.ConsoleWriteRequest.newBuilder() - .setPath(GadpValueUtils.makePath(getPath())) - .setData(ByteString.copyFrom(data)), - Gadp.ConsoleWriteReply.getDefaultInstance()) - .thenApply(rep -> null); - } -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetDataTypeMember.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetDataTypeMember.java deleted file mode 100644 index 6775f174b0..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetDataTypeMember.java +++ /dev/null @@ -1,23 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import ghidra.dbg.target.TargetDataTypeMember; - -public interface GadpClientTargetDataTypeMember - extends GadpClientTargetObject, TargetDataTypeMember { - // Nothing to add -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetDataTypeNamespace.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetDataTypeNamespace.java deleted file mode 100644 index 986cc7a0a3..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetDataTypeNamespace.java +++ /dev/null @@ -1,23 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import ghidra.dbg.target.TargetDataTypeNamespace; - -public interface GadpClientTargetDataTypeNamespace - extends GadpClientTargetObject, TargetDataTypeNamespace { - // Nothing to add -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetDeletable.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetDeletable.java deleted file mode 100644 index 91d2e87b5a..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetDeletable.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import java.util.concurrent.CompletableFuture; - -import ghidra.dbg.gadp.protocol.Gadp; -import ghidra.dbg.target.TargetDeletable; - -public interface GadpClientTargetDeletable extends GadpClientTargetObject, TargetDeletable { - @Override - default CompletableFuture delete() { - getDelegate().assertValid(); - return getModel().sendChecked(Gadp.DeleteRequest.newBuilder() - .setPath(GadpValueUtils.makePath(getPath())), - Gadp.DeleteReply.getDefaultInstance()).thenApply(rep -> null); - } -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetDetachable.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetDetachable.java deleted file mode 100644 index 49ce405835..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetDetachable.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import java.util.concurrent.CompletableFuture; - -import ghidra.dbg.gadp.protocol.Gadp; -import ghidra.dbg.target.TargetDetachable; - -public interface GadpClientTargetDetachable extends GadpClientTargetObject, TargetDetachable { - @Override - default CompletableFuture detach() { - getDelegate().assertValid(); - return getModel().sendChecked(Gadp.DetachRequest.newBuilder() - .setPath(GadpValueUtils.makePath(getPath())), - Gadp.DetachReply.getDefaultInstance()).thenApply(rep -> null); - } -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetEnvironment.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetEnvironment.java deleted file mode 100644 index 8f5196fdea..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetEnvironment.java +++ /dev/null @@ -1,22 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import ghidra.dbg.target.TargetEnvironment; - -public interface GadpClientTargetEnvironment extends GadpClientTargetObject, TargetEnvironment { - // Nothing to add -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetEventScope.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetEventScope.java deleted file mode 100644 index afdf51f864..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetEventScope.java +++ /dev/null @@ -1,38 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import java.util.List; - -import ghidra.dbg.gadp.client.annot.GadpEventHandler; -import ghidra.dbg.gadp.protocol.Gadp; -import ghidra.dbg.target.TargetEventScope; -import ghidra.dbg.target.TargetThread; - -public interface GadpClientTargetEventScope extends GadpClientTargetObject, TargetEventScope { - @GadpEventHandler(Gadp.EventNotification.EvtCase.TARGET_EVENT) - default void handleDebuggerEvent(Gadp.EventNotification notification) { - Gadp.TargetEvent evt = notification.getTargetEvent(); - Gadp.Path threadPath = evt.getEventThread(); - TargetThread thread = threadPath == null || threadPath.getECount() == 0 ? null - : getModel().getProxy(threadPath.getEList(), true).as(TargetThread.class); - TargetEventType type = GadpValueUtils.getTargetEventType(evt.getType()); - String description = evt.getDescription(); - List parameters = - GadpValueUtils.getValues(getModel(), evt.getParametersList()); - broadcast().event(this, thread, type, description, parameters); - } -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetExecutionStateful.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetExecutionStateful.java deleted file mode 100644 index 9ce8206927..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetExecutionStateful.java +++ /dev/null @@ -1,23 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import ghidra.dbg.target.TargetExecutionStateful; - -public interface GadpClientTargetExecutionStateful - extends GadpClientTargetObject, TargetExecutionStateful { - // Nothing to add -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetFocusScope.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetFocusScope.java deleted file mode 100644 index f52444e409..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetFocusScope.java +++ /dev/null @@ -1,42 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import java.util.concurrent.CompletableFuture; - -import ghidra.dbg.error.DebuggerIllegalArgumentException; -import ghidra.dbg.gadp.protocol.Gadp; -import ghidra.dbg.target.TargetFocusScope; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.util.PathUtils; - -public interface GadpClientTargetFocusScope extends GadpClientTargetObject, TargetFocusScope { - - @Override - default CompletableFuture requestFocus(TargetObject obj) { - getDelegate().assertValid(); - getModel().assertMine(TargetObject.class, obj); - // The server should detect this error, but we can detect it here without sending a request - if (!PathUtils.isAncestor(getPath(), obj.getPath())) { - throw new DebuggerIllegalArgumentException("Can only focus a successor of the scope"); - } - return getModel().sendChecked(Gadp.FocusRequest.newBuilder() - .setPath(GadpValueUtils.makePath(getPath())) - .setFocus(GadpValueUtils.makePath(obj.getPath())), - Gadp.FocusReply.getDefaultInstance()) - .thenApply(__ -> null); - } -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetInterpreter.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetInterpreter.java deleted file mode 100644 index 91ea2b266c..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetInterpreter.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import java.util.concurrent.CompletableFuture; - -import ghidra.dbg.gadp.protocol.Gadp; -import ghidra.dbg.target.TargetInterpreter; - -public interface GadpClientTargetInterpreter extends GadpClientTargetObject, TargetInterpreter { - - @Override - default CompletableFuture execute(String cmd) { - getDelegate().assertValid(); - return getModel().sendChecked(Gadp.ExecuteRequest.newBuilder() - .setPath(GadpValueUtils.makePath(getPath())) - .setCommand(cmd), - Gadp.ExecuteReply.getDefaultInstance()) - .thenApply(rep -> null); - } - - @Override - default CompletableFuture executeCapture(String cmd) { - getDelegate().assertValid(); - return getModel().sendChecked(Gadp.ExecuteRequest.newBuilder() - .setPath(GadpValueUtils.makePath(getPath())) - .setCommand(cmd) - .setCapture(true), - Gadp.ExecuteReply.getDefaultInstance()) - .thenApply(rep -> rep.getCaptured()); - } -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetInterruptible.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetInterruptible.java deleted file mode 100644 index 29551026a9..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetInterruptible.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import java.util.concurrent.CompletableFuture; - -import ghidra.dbg.gadp.protocol.Gadp; -import ghidra.dbg.target.TargetInterruptible; - -public interface GadpClientTargetInterruptible extends GadpClientTargetObject, TargetInterruptible { - @Override - default CompletableFuture interrupt() { - getDelegate().assertValid(); - return getModel().sendChecked(Gadp.InterruptRequest.newBuilder() - .setPath(GadpValueUtils.makePath(getPath())), - Gadp.InterruptReply.getDefaultInstance()).thenApply(rep -> null); - } -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetKillable.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetKillable.java deleted file mode 100644 index edbcf0a780..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetKillable.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import java.util.concurrent.CompletableFuture; - -import ghidra.dbg.gadp.protocol.Gadp; -import ghidra.dbg.target.TargetKillable; - -public interface GadpClientTargetKillable extends GadpClientTargetObject, TargetKillable { - @Override - default CompletableFuture kill() { - getDelegate().assertValid(); - return getModel().sendChecked(Gadp.KillRequest.newBuilder() - .setPath(GadpValueUtils.makePath(getPath())), - Gadp.KillReply.getDefaultInstance()).thenApply(rep -> null); - } -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetLauncher.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetLauncher.java deleted file mode 100644 index e8362ca87c..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetLauncher.java +++ /dev/null @@ -1,40 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import ghidra.dbg.gadp.protocol.Gadp; -import ghidra.dbg.target.TargetLauncher; -import ghidra.dbg.target.TargetMethod; -import ghidra.dbg.target.TargetMethod.TargetParameterMap; - -public interface GadpClientTargetLauncher extends GadpClientTargetObject, TargetLauncher { - @Override - default CompletableFuture launch(Map arguments) { - getDelegate().assertValid(); - return getModel().sendChecked(Gadp.LaunchRequest.newBuilder() - .setPath(GadpValueUtils.makePath(getPath())) - .addAllArgument(GadpValueUtils.makeArguments(arguments)), - Gadp.LaunchReply.getDefaultInstance()).thenApply(__ -> null); - } - - @Override - default TargetParameterMap getParameters() { - return TargetMethod.getParameters(this); - } -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetMemory.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetMemory.java deleted file mode 100644 index 872b464bf8..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetMemory.java +++ /dev/null @@ -1,103 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import java.util.concurrent.CompletableFuture; - -import com.google.protobuf.ByteString; - -import ghidra.dbg.error.DebuggerMemoryAccessException; -import ghidra.dbg.gadp.client.annot.GadpEventHandler; -import ghidra.dbg.gadp.protocol.Gadp; -import ghidra.dbg.memory.MemoryReader; -import ghidra.dbg.memory.MemoryWriter; -import ghidra.dbg.target.TargetMemory; -import ghidra.lifecycle.Internal; -import ghidra.program.model.address.*; - -public interface GadpClientTargetMemory extends GadpClientTargetObject, TargetMemory { - - @Internal - default MemoryReader getRawReader(AddressSpace space) { - return (addr, length) -> rawReadMemory(space, addr, length); - } - - @Internal - default CompletableFuture rawReadMemory(AddressSpace space, long addr, int length) { - getDelegate().assertValid(); - Address min = space.getAddress(addr); - AddressRange range; - try { - range = new AddressRangeImpl(min, length); - } - catch (AddressOverflowException e) { - throw new IllegalArgumentException("addr=" + addr + ",len=" + length); - } - return getModel().sendChecked(Gadp.MemoryReadRequest.newBuilder() - .setPath(GadpValueUtils.makePath(getPath())) - .setRange(GadpValueUtils.makeRange(range)), - Gadp.MemoryReadReply.getDefaultInstance()).thenApply(rep -> { - return rep.getContent().toByteArray(); - }); - } - - @Override - default CompletableFuture readMemory(Address address, int length) { - return getDelegate().getMemoryCache(address.getAddressSpace()) - .readMemory(address.getOffset(), length); - } - - @Internal - default MemoryWriter getRawWriter(AddressSpace space) { - return (addr, data) -> rawWriteMemory(space, addr, data); - } - - @Internal - default CompletableFuture rawWriteMemory(AddressSpace space, long addr, byte[] data) { - getDelegate().assertValid(); - Address min = space.getAddress(addr); - return getModel().sendChecked(Gadp.MemoryWriteRequest.newBuilder() - .setPath(GadpValueUtils.makePath(getPath())) - .setStart(GadpValueUtils.makeAddress(min)) - .setContent(ByteString.copyFrom(data)), - Gadp.MemoryWriteReply.getDefaultInstance()).thenApply(rep -> null); - } - - @Override - default CompletableFuture writeMemory(Address address, byte[] data) { - return getDelegate().getMemoryCache(address.getAddressSpace()) - .writeMemory(address.getOffset(), data); - } - - @GadpEventHandler(Gadp.EventNotification.EvtCase.MEMORY_UPDATE_EVENT) - default void handleMemoryUpdateEvent(Gadp.EventNotification notification) { - Gadp.MemoryUpdateEvent evt = notification.getMemoryUpdateEvent(); - Address address = GadpValueUtils.getAddress(getModel(), evt.getAddress()); - byte[] data = evt.getContent().toByteArray(); - DelegateGadpClientTargetObject delegate = getDelegate(); - delegate.getMemoryCache(address.getAddressSpace()).updateMemory(address.getOffset(), data); - broadcast().memoryUpdated(this, address, data); - } - - @GadpEventHandler(Gadp.EventNotification.EvtCase.MEMORY_ERROR_EVENT) - default void handleMemoryErrorEvent(Gadp.EventNotification notification) { - Gadp.MemoryErrorEvent evt = notification.getMemoryErrorEvent(); - AddressRange range = GadpValueUtils.getAddressRange(getModel(), evt.getRange()); - String message = evt.getMessage(); - // Errors are not cached, but recorded in trace - broadcast().memoryReadError(this, range, new DebuggerMemoryAccessException(message)); - } -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetMemoryRegion.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetMemoryRegion.java deleted file mode 100644 index c070a91f2e..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetMemoryRegion.java +++ /dev/null @@ -1,22 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import ghidra.dbg.target.TargetMemoryRegion; - -public interface GadpClientTargetMemoryRegion extends GadpClientTargetObject, TargetMemoryRegion { - // Nothing to add -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetMethod.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetMethod.java deleted file mode 100644 index 3dffabe7ed..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetMethod.java +++ /dev/null @@ -1,35 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import ghidra.dbg.gadp.protocol.Gadp; -import ghidra.dbg.target.TargetMethod; - -public interface GadpClientTargetMethod extends GadpClientTargetObject, TargetMethod { - @Override - default CompletableFuture invoke(Map arguments) { - getDelegate().assertValid(); - return getModel().sendChecked( - Gadp.InvokeRequest.newBuilder() - .setPath(GadpValueUtils.makePath(getPath())) - .addAllArgument(GadpValueUtils.makeArguments(arguments)), - Gadp.InvokeReply.getDefaultInstance()) - .thenApply(rep -> GadpValueUtils.getValue(getModel(), null, rep.getResult())); - } -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetModule.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetModule.java deleted file mode 100644 index 3b198937fd..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetModule.java +++ /dev/null @@ -1,22 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import ghidra.dbg.target.TargetModule; - -public interface GadpClientTargetModule extends GadpClientTargetObject, TargetModule { - // Nothing to add -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetModuleContainer.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetModuleContainer.java deleted file mode 100644 index de6efe483f..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetModuleContainer.java +++ /dev/null @@ -1,23 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import ghidra.dbg.target.TargetModuleContainer; - -public interface GadpClientTargetModuleContainer - extends GadpClientTargetObject, TargetModuleContainer { - // Nothing to add -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetNamedDataType.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetNamedDataType.java deleted file mode 100644 index bce58bedb6..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetNamedDataType.java +++ /dev/null @@ -1,22 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import ghidra.dbg.target.TargetNamedDataType; - -public interface GadpClientTargetNamedDataType extends GadpClientTargetObject, TargetNamedDataType { - // Nothing to add -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetObject.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetObject.java deleted file mode 100644 index dcc4b3c760..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetObject.java +++ /dev/null @@ -1,66 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import java.lang.invoke.MethodHandles; -import java.lang.invoke.MethodHandles.Lookup; - -import ghidra.dbg.agent.SpiTargetObject; -import ghidra.dbg.gadp.client.annot.GadpEventHandler; -import ghidra.dbg.gadp.protocol.Gadp; -import ghidra.dbg.target.TargetConsole.Channel; -import ghidra.util.Msg; - -public interface GadpClientTargetObject extends SpiTargetObject { - Lookup LOOKUP = MethodHandles.lookup(); - - @Override - GadpClient getModel(); - - @Override - DelegateGadpClientTargetObject getDelegate(); - - @GadpEventHandler(Gadp.EventNotification.EvtCase.MODEL_OBJECT_EVENT) - default void handleModelObjectEvent(Gadp.EventNotification notification) { - Gadp.ModelObjectEvent evt = notification.getModelObjectEvent(); - getDelegate().updateWithDeltas(evt.getElementDelta(), evt.getAttributeDelta()); - } - - @GadpEventHandler(Gadp.EventNotification.EvtCase.OBJECT_INVALIDATE_EVENT) - default void handleObjectInvalidateEvent(Gadp.EventNotification notification) { - Gadp.ObjectInvalidateEvent evt = notification.getObjectInvalidateEvent(); - getDelegate().invalidateSubtree(this, evt.getReason()); - } - - @GadpEventHandler(Gadp.EventNotification.EvtCase.CACHE_INVALIDATE_EVENT) - default void handleCacheInvalidateEvent(Gadp.EventNotification notification) { - getDelegate().doClearCaches(); - } - - @GadpEventHandler(Gadp.EventNotification.EvtCase.CONSOLE_OUTPUT_EVENT) - default void handleConsoleOutputEvent(Gadp.EventNotification notification) { - Gadp.ConsoleOutputEvent evt = notification.getConsoleOutputEvent(); - int channelIndex = evt.getChannel(); - Channel[] allChannels = Channel.values(); - if (0 <= channelIndex && channelIndex < allChannels.length) { - broadcast().consoleOutput(this, allChannels[channelIndex], evt.getData().toByteArray()); - } - else { - Msg.error(this, "Received output for unknown channel " + channelIndex + ": " + - evt.getData().toString()); - } - } -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetProcess.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetProcess.java deleted file mode 100644 index 3806c63214..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetProcess.java +++ /dev/null @@ -1,22 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import ghidra.dbg.target.TargetProcess; - -public interface GadpClientTargetProcess extends GadpClientTargetObject, TargetProcess { - // Nothing to add -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetRegister.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetRegister.java deleted file mode 100644 index 7d9574b9d7..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetRegister.java +++ /dev/null @@ -1,22 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import ghidra.dbg.target.TargetRegister; - -public interface GadpClientTargetRegister extends GadpClientTargetObject, TargetRegister { - // Nothing to add -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetRegisterBank.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetRegisterBank.java deleted file mode 100644 index e7d50b6dc8..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetRegisterBank.java +++ /dev/null @@ -1,87 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import ghidra.dbg.gadp.client.annot.GadpEventHandler; -import ghidra.dbg.gadp.protocol.Gadp; -import ghidra.dbg.target.TargetRegisterBank; - -public interface GadpClientTargetRegisterBank extends GadpClientTargetObject, TargetRegisterBank { - - @Override - default CompletableFuture> readRegistersNamed( - Collection names) { - getDelegate().assertValid(); - Map result = new LinkedHashMap<>(); - Map cache = getDelegate().getRegisterCache(); - Set needed = new HashSet<>(); - for (String name : names) { - byte[] value = cache.get(name); - if (value == null) { - needed.add(name); - } - // Allow null to reserve the position - result.put(name, value); - } - if (needed.isEmpty()) { - return CompletableFuture.completedFuture(result); - } - return getModel().sendChecked(Gadp.RegisterReadRequest.newBuilder() - .setPath(GadpValueUtils.makePath(getPath())) - .addAllName(needed), - Gadp.RegisterReadReply.getDefaultInstance()).thenApply(rep -> { - for (Gadp.RegisterValue rv : rep.getValueList()) { - result.put(rv.getName(), rv.getContent().toByteArray()); - } - return result; - }); - } - - @Override - default CompletableFuture writeRegistersNamed(Map values) { - getDelegate().assertValid(); - // User may change values before completion (how rude) - Map copy = Map.copyOf(values); - Map cache = getDelegate().getRegisterCache(); - return getModel().sendChecked(Gadp.RegisterWriteRequest.newBuilder() - .setPath(GadpValueUtils.makePath(getPath())) - .addAllValue(GadpValueUtils.makeRegisterValues(copy)), - Gadp.RegisterWriteReply.getDefaultInstance()).thenAccept(rep -> { - cache.putAll(copy); - }); - } - - @Override - default Map getCachedRegisters() { - getDelegate().assertValid(); - Map cache = getDelegate().getRegisterCache(); - synchronized (cache) { - return Map.copyOf(cache); - } - } - - @GadpEventHandler(Gadp.EventNotification.EvtCase.REGISTER_UPDATE_EVENT) - default void handleRegisterUpdateEvent(Gadp.EventNotification notification) { - Gadp.RegisterUpdateEvent evt = notification.getRegisterUpdateEvent(); - Map updates = GadpValueUtils.getRegisterValueMap(evt.getValueList()); - DelegateGadpClientTargetObject delegate = getDelegate(); - delegate.getRegisterCache().putAll(updates); - broadcast().registersUpdated(this, updates); - } -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetRegisterContainer.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetRegisterContainer.java deleted file mode 100644 index 670f245ef5..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetRegisterContainer.java +++ /dev/null @@ -1,23 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import ghidra.dbg.target.TargetRegisterContainer; - -public interface GadpClientTargetRegisterContainer - extends GadpClientTargetObject, TargetRegisterContainer { - // Nothing to add -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetResumable.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetResumable.java deleted file mode 100644 index be8c551fb0..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetResumable.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import java.util.concurrent.CompletableFuture; - -import ghidra.dbg.gadp.protocol.Gadp; -import ghidra.dbg.target.TargetResumable; - -public interface GadpClientTargetResumable extends GadpClientTargetObject, TargetResumable { - @Override - default CompletableFuture resume() { - getDelegate().assertValid(); - return getModel().sendChecked(Gadp.ResumeRequest.newBuilder() - .setPath(GadpValueUtils.makePath(getPath())), - Gadp.ResumeReply.getDefaultInstance()).thenApply(rep -> null); - } -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetSection.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetSection.java deleted file mode 100644 index 88bdd940bf..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetSection.java +++ /dev/null @@ -1,22 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import ghidra.dbg.target.TargetSection; - -public interface GadpClientTargetSection extends GadpClientTargetObject, TargetSection { - // Nothing to add -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetSectionContainer.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetSectionContainer.java deleted file mode 100644 index 9c904c9d5e..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetSectionContainer.java +++ /dev/null @@ -1,23 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import ghidra.dbg.target.TargetSectionContainer; - -public interface GadpClientTargetSectionContainer - extends GadpClientTargetObject, TargetSectionContainer { - // Nothing to add -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetStack.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetStack.java deleted file mode 100644 index 9da600ed8b..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetStack.java +++ /dev/null @@ -1,22 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import ghidra.dbg.target.TargetStack; - -public interface GadpClientTargetStack extends GadpClientTargetObject, TargetStack { - // Nothing to add -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetStackFrame.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetStackFrame.java deleted file mode 100644 index 4283d11617..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetStackFrame.java +++ /dev/null @@ -1,22 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import ghidra.dbg.target.TargetStackFrame; - -public interface GadpClientTargetStackFrame extends GadpClientTargetObject, TargetStackFrame { - // Nothing to add -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetSteppable.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetSteppable.java deleted file mode 100644 index ffd329d161..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetSteppable.java +++ /dev/null @@ -1,32 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import java.util.concurrent.CompletableFuture; - -import ghidra.dbg.gadp.protocol.Gadp; -import ghidra.dbg.target.TargetSteppable; - -public interface GadpClientTargetSteppable extends GadpClientTargetObject, TargetSteppable { - @Override - default CompletableFuture step(TargetStepKind kind) { - getDelegate().assertValid(); - return getModel().sendChecked(Gadp.StepRequest.newBuilder() - .setPath(GadpValueUtils.makePath(getPath())) - .setKind(GadpValueUtils.makeStepKind(kind)), - Gadp.StepReply.getDefaultInstance()).thenApply(rep -> null); - } -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetSymbol.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetSymbol.java deleted file mode 100644 index 3dbc610d2b..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetSymbol.java +++ /dev/null @@ -1,22 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import ghidra.dbg.target.TargetSymbol; - -public interface GadpClientTargetSymbol extends GadpClientTargetObject, TargetSymbol { - // Nothing to add -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetSymbolNamespace.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetSymbolNamespace.java deleted file mode 100644 index ba4c29ac03..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetSymbolNamespace.java +++ /dev/null @@ -1,23 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import ghidra.dbg.target.TargetSymbolNamespace; - -public interface GadpClientTargetSymbolNamespace - extends GadpClientTargetObject, TargetSymbolNamespace { - // Nothing to add -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetThread.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetThread.java deleted file mode 100644 index 62a39100de..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetThread.java +++ /dev/null @@ -1,22 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import ghidra.dbg.target.TargetThread; - -public interface GadpClientTargetThread extends GadpClientTargetObject, TargetThread { - // Nothing to add -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetTogglable.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetTogglable.java deleted file mode 100644 index a165f5e2b3..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpClientTargetTogglable.java +++ /dev/null @@ -1,22 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import ghidra.dbg.target.TargetTogglable; - -public interface GadpClientTargetTogglable extends GadpClientTargetObject, TargetTogglable { - // Nothing to add -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpTcpDebuggerModelFactory.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpTcpDebuggerModelFactory.java deleted file mode 100644 index ca0d551ac7..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpTcpDebuggerModelFactory.java +++ /dev/null @@ -1,85 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import java.io.IOException; -import java.net.InetSocketAddress; -import java.nio.channels.*; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.Executors; - -import ghidra.async.AsyncUtils; -import ghidra.async.TypeSpec; -import ghidra.dbg.DebuggerModelFactory; -import ghidra.dbg.util.ConfigurableFactory.FactoryDescription; - -@FactoryDescription( - brief = "Ghidra debug agent (GADP)", - htmlDetails = """ - Connect to a Ghidra debug agent using GADP. - This is Ghidra's debugging protocol. - Use this if launching a (usually remote) agent manually.""") -public class GadpTcpDebuggerModelFactory implements DebuggerModelFactory { - - private String host = "localhost"; - @FactoryOption("Agent network address") - public final Property agentAddressOption = - Property.fromAccessors(String.class, this::getAgentAddress, this::setAgentAddress); - - private int port = 15432; - @FactoryOption("Agent TCP port") - public final Property agentPortOption = - Property.fromAccessors(Integer.class, this::getAgentPort, this::setAgentPort); - - @Override - public CompletableFuture build() { - try { - // Note, it looks like the executor knows to shut itself down on GC - AsynchronousChannelGroup group = - AsynchronousChannelGroup.withThreadPool(Executors.newSingleThreadExecutor()); - AsynchronousSocketChannel channel = AsynchronousSocketChannel.open(group); - CompletableFuture connect = AsyncUtils.completable(TypeSpec.VOID, - channel::connect, new InetSocketAddress(host, port)); - return connect.thenCompose(__ -> { - GadpClient client = createClient(host + ":" + port, channel); - return client.connect().thenApply(___ -> client); - }); - } - catch (IOException e) { - return CompletableFuture.failedFuture(e); - } - } - - protected GadpClient createClient(String description, AsynchronousByteChannel channel) { - return new GadpClient(description, channel); - } - - public String getAgentAddress() { - return host; - } - - public void setAgentAddress(String host) { - this.host = host; - } - - public int getAgentPort() { - return port; - } - - public void setAgentPort(int port) { - this.port = port; - } -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpValueUtils.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpValueUtils.java deleted file mode 100644 index 22711e823e..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/GadpValueUtils.java +++ /dev/null @@ -1,749 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import static ghidra.lifecycle.Unfinished.TODO; - -import java.util.*; -import java.util.Map.Entry; -import java.util.stream.Collectors; - -import com.google.protobuf.ByteString; - -import ghidra.dbg.DebuggerObjectModel; -import ghidra.dbg.attributes.*; -import ghidra.dbg.attributes.TargetObjectList.DefaultTargetObjectList; -import ghidra.dbg.gadp.protocol.Gadp; -import ghidra.dbg.gadp.protocol.Gadp.ModelObjectDelta; -import ghidra.dbg.target.TargetAttacher.TargetAttachKind; -import ghidra.dbg.target.TargetAttacher.TargetAttachKindSet; -import ghidra.dbg.target.TargetBreakpointSpec.TargetBreakpointKind; -import ghidra.dbg.target.TargetBreakpointSpecContainer.TargetBreakpointKindSet; -import ghidra.dbg.target.TargetEventScope.TargetEventType; -import ghidra.dbg.target.TargetExecutionStateful.TargetExecutionState; -import ghidra.dbg.target.TargetMethod; -import ghidra.dbg.target.TargetMethod.ParameterDescription; -import ghidra.dbg.target.TargetMethod.TargetParameterMap; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.TargetSteppable.TargetStepKind; -import ghidra.dbg.target.TargetSteppable.TargetStepKindSet; -import ghidra.dbg.util.CollectionUtils.Delta; -import ghidra.dbg.util.PathUtils; -import ghidra.program.model.address.*; -import ghidra.util.Msg; - -public enum GadpValueUtils { - ; - - public static TargetObjectList getObjList(DebuggerObjectModel model, Gadp.PathList list) { - TargetObjectList result = new DefaultTargetObjectList<>(); - for (Gadp.Path path : list.getPathList()) { - result.add(model.getModelObject(path.getEList())); - } - return result; - } - - public static TargetBreakpointKindSet getBreakKindSet(Gadp.BreakKindsSet set) { - return TargetBreakpointKindSet.copyOf( - set.getKList().stream().map(k -> getBreakKind(k)).collect(Collectors.toSet())); - } - - public static TargetBreakpointKind getBreakKind(Gadp.BreakKind kind) { - switch (kind) { - case BK_READ: - return TargetBreakpointKind.READ; - case BK_WRITE: - return TargetBreakpointKind.WRITE; - case BK_EXECUTE: - return TargetBreakpointKind.HW_EXECUTE; - case BK_SOFTWARE: - return TargetBreakpointKind.SW_EXECUTE; - default: - throw new IllegalArgumentException(); - } - } - - public static Gadp.BreakKindsSet makeBreakKindSet(Set set) { - return Gadp.BreakKindsSet.newBuilder() - .addAllK(set.stream().map(k -> makeBreakKind(k)).collect(Collectors.toList())) - .build(); - } - - public static Gadp.BreakKind makeBreakKind(TargetBreakpointKind kind) { - switch (kind) { - case READ: - return Gadp.BreakKind.BK_READ; - case WRITE: - return Gadp.BreakKind.BK_WRITE; - case HW_EXECUTE: - return Gadp.BreakKind.BK_EXECUTE; - case SW_EXECUTE: - return Gadp.BreakKind.BK_SOFTWARE; - default: - throw new IllegalArgumentException(); - } - } - - public static TargetAttachKindSet getAttachKindSet(Gadp.AttachKindSet set) { - return TargetAttachKindSet.copyOf( - set.getKList().stream().map(k -> getAttachKind(k)).collect(Collectors.toSet())); - } - - public static TargetAttachKind getAttachKind(Gadp.AttachKind kind) { - switch (kind) { - case AK_BY_OBJECT_REF: - return TargetAttachKind.BY_OBJECT_REF; - case AK_BY_ID: - return TargetAttachKind.BY_ID; - default: - throw new IllegalArgumentException(); - } - } - - public static Gadp.AttachKindSet makeAttachKindSet(Set set) { - return Gadp.AttachKindSet.newBuilder() - .addAllK(set.stream().map(k -> makeAttachKind(k)).collect(Collectors.toList())) - .build(); - } - - public static Gadp.AttachKind makeAttachKind(TargetAttachKind kind) { - switch (kind) { - case BY_OBJECT_REF: - return Gadp.AttachKind.AK_BY_OBJECT_REF; - case BY_ID: - return Gadp.AttachKind.AK_BY_ID; - default: - throw new IllegalArgumentException(); - } - } - - public static TargetStepKindSet getStepKindSet(Gadp.StepKindsSet set) { - return TargetStepKindSet.copyOf( - set.getKList().stream().map(k -> getStepKind(k)).collect(Collectors.toSet())); - } - - public static TargetStepKind getStepKind(Gadp.StepKind kind) { - switch (kind) { - case SK_FINISH: - return TargetStepKind.FINISH; - case SK_INTO: - return TargetStepKind.INTO; - case SK_LINE: - return TargetStepKind.LINE; - case SK_OVER: - return TargetStepKind.OVER; - case SK_OVER_LINE: - return TargetStepKind.OVER_LINE; - case SK_RETURN: - return TargetStepKind.RETURN; - case SK_SKIP: - return TargetStepKind.SKIP; - case SK_UNTIL: - return TargetStepKind.UNTIL; - case SK_EXTENDED: - return TargetStepKind.EXTENDED; - default: - throw new IllegalArgumentException(); - } - } - - public static Gadp.StepKind makeStepKind(TargetStepKind kind) { - switch (kind) { - case FINISH: - return Gadp.StepKind.SK_FINISH; - case INTO: - return Gadp.StepKind.SK_INTO; - case LINE: - return Gadp.StepKind.SK_LINE; - case OVER: - return Gadp.StepKind.SK_OVER; - case OVER_LINE: - return Gadp.StepKind.SK_OVER_LINE; - case RETURN: - return Gadp.StepKind.SK_RETURN; - case SKIP: - return Gadp.StepKind.SK_SKIP; - case UNTIL: - return Gadp.StepKind.SK_UNTIL; - case EXTENDED: - return Gadp.StepKind.SK_EXTENDED; - default: - throw new IllegalArgumentException(); - } - } - - public static TargetExecutionState getExecutionState(Gadp.ExecutionState state) { - switch (state) { - case ES_INACTIVE: - return TargetExecutionState.INACTIVE; - case ES_ALIVE: - return TargetExecutionState.ALIVE; - case ES_STOPPED: - return TargetExecutionState.STOPPED; - case ES_RUNNING: - return TargetExecutionState.RUNNING; - case ES_TERMINATED: - return TargetExecutionState.TERMINATED; - default: - throw new IllegalArgumentException(); - } - } - - public static Gadp.ExecutionState makeExecutionState(TargetExecutionState state) { - switch (state) { - case INACTIVE: - return Gadp.ExecutionState.ES_INACTIVE; - case ALIVE: - return Gadp.ExecutionState.ES_ALIVE; - case STOPPED: - return Gadp.ExecutionState.ES_STOPPED; - case RUNNING: - return Gadp.ExecutionState.ES_RUNNING; - case TERMINATED: - return Gadp.ExecutionState.ES_TERMINATED; - default: - throw new IllegalArgumentException(); - } - } - - public static TargetEventType getTargetEventType(Gadp.TargetEventType type) { - switch (type) { - default: - case EV_STOPPED: - return TargetEventType.STOPPED; - case EV_RUNNING: - return TargetEventType.RUNNING; - case EV_PROCESS_CREATED: - return TargetEventType.PROCESS_CREATED; - case EV_PROCESS_EXITED: - return TargetEventType.PROCESS_EXITED; - case EV_THREAD_CREATED: - return TargetEventType.THREAD_CREATED; - case EV_THREAD_EXITED: - return TargetEventType.THREAD_EXITED; - case EV_BREAKPOINT_HIT: - return TargetEventType.BREAKPOINT_HIT; - case EV_STEP_COMPLETED: - return TargetEventType.STEP_COMPLETED; - case EV_EXCEPTION: - return TargetEventType.EXCEPTION; - case EV_SIGNAL: - return TargetEventType.SIGNAL; - } - } - - public static Gadp.TargetEventType makeTargetEventType(TargetEventType type) { - switch (type) { - default: - case STOPPED: - return Gadp.TargetEventType.EV_STOPPED; - case RUNNING: - return Gadp.TargetEventType.EV_RUNNING; - case PROCESS_CREATED: - return Gadp.TargetEventType.EV_PROCESS_CREATED; - case PROCESS_EXITED: - return Gadp.TargetEventType.EV_PROCESS_EXITED; - case THREAD_CREATED: - return Gadp.TargetEventType.EV_THREAD_CREATED; - case THREAD_EXITED: - return Gadp.TargetEventType.EV_THREAD_EXITED; - case BREAKPOINT_HIT: - return Gadp.TargetEventType.EV_BREAKPOINT_HIT; - case STEP_COMPLETED: - return Gadp.TargetEventType.EV_STEP_COMPLETED; - case EXCEPTION: - return Gadp.TargetEventType.EV_EXCEPTION; - case SIGNAL: - return Gadp.TargetEventType.EV_SIGNAL; - } - } - - /** - * TODO: Document me - * - * @see GadpClient#getAddress(ghidra.dbg.gadp.protocol.Gadp.Address) - * @param address - * @return - */ - public static Gadp.Address makeAddress(Address address) { - return Gadp.Address.newBuilder() - .setSpace(address.getAddressSpace().getName()) - .setOffset(address.getOffset()) - .build(); - } - - public static Gadp.AddressRange makeRange(AddressRange range) { - return Gadp.AddressRange.newBuilder() - .setSpace(range.getAddressSpace().getName()) - .setOffset(range.getMinAddress().getOffset()) - .setExtend((int) (range.getLength() - 1)) - .build(); - } - - public static Gadp.ModelObjectDelta makeElementDelta(List parentPath, - Delta delta) { - ModelObjectDelta.Builder builder = Gadp.ModelObjectDelta.newBuilder() - .addAllRemoved(delta.getKeysRemoved()); - for (Entry ent : delta.added.entrySet()) { - builder.addAdded(makeIndexedValue(parentPath, ent)); - } - return builder.build(); - } - - public static Gadp.ModelObjectDelta makeAttributeDelta(List parentPath, - Delta delta) { - ModelObjectDelta.Builder builder = Gadp.ModelObjectDelta.newBuilder() - .addAllRemoved(delta.getKeysRemoved()); - for (Entry ent : delta.added.entrySet()) { - builder.addAdded(makeNamedValue(parentPath, ent)); - } - return builder.build(); - } - - public static Gadp.Path makePath(List path) { - return Gadp.Path.newBuilder().addAllE(path).build(); - } - - public static Gadp.Path makePath(TargetObject obj) { - return makePath(obj.getPath()); - } - - public static Gadp.PathList makePathList(TargetObjectList list) { - return Gadp.PathList.newBuilder() - .addAllPath(list.stream().map(p -> makePath(p)).collect(Collectors.toList())) - .build(); - } - - public static Gadp.RegisterValue makeRegisterValue(Map.Entry e) { - return Gadp.RegisterValue.newBuilder() - .setName(e.getKey()) - .setContent(ByteString.copyFrom(e.getValue())) - .build(); - } - - public static Collection makeRegisterValues(Map map) { - return map.entrySet() - .stream() - .map(GadpValueUtils::makeRegisterValue) - .collect(Collectors.toList()); - } - - public static Map getRegisterValueMap(Collection values) { - return values.stream() - .collect(Collectors.toMap(v -> v.getName(), v -> v.getContent().toByteArray())); - } - - public static Gadp.StepKindsSet makeStepKindSet(Set set) { - return Gadp.StepKindsSet.newBuilder() - .addAllK(set.stream().map(k -> makeStepKind(k)).collect(Collectors.toList())) - .build(); - } - - // TODO: Remove type-specific collections, and just use collections of values (objects) - // NOTE: Map should probably be strictly strings for keys. - public static Gadp.StringList makeStringList(Collection col) { - return Gadp.StringList.newBuilder().addAllS(col).build(); - } - - public static TargetStringList getStringList(Gadp.StringList list) { - return TargetStringList.copyOf(list.getSList()); - } - - public static Class getValueType(Gadp.ValueType type) { - switch (type) { - case VT_VOID: - return Void.class; - case VT_BOOL: - return Boolean.class; - case VT_INT: - return Integer.class; - case VT_LONG: - return Long.class; - case VT_FLOAT: - return Float.class; - case VT_DOUBLE: - return Double.class; - case VT_BYTES: - return byte[].class; - case VT_STRING: - return String.class; - case VT_STRING_LIST: - return TargetStringList.class; - case VT_ADDRESS: - return Address.class; - case VT_RANGE: - return AddressRange.class; - case VT_BREAK_KIND_SET: - return TargetBreakpointKindSet.class; - case VT_EXECUTION_STATE: - return TargetExecutionState.class; - case VT_STEP_KIND_SET: - return TargetStepKindSet.class; - case VT_PRIMITIVE_KIND: - return TargetPrimitiveDataType.class; - case VT_DATA_TYPE: - return TargetDataType.class; - case VT_PATH: - return TargetObject.class; - case VT_PATH_LIST: - return TargetObjectList.class; - case VT_TYPE: - return Class.class; - case UNRECOGNIZED: - default: - throw new AssertionError("Unrecgonized type: " + type); - } - } - - private static ParameterDescription getParameterDescription(Class valueType, - DebuggerObjectModel model, Gadp.Parameter param) { - if (param.getChoicesCount() != 0) { - return ParameterDescription.choices(valueType, param.getName(), - getValues(model, param.getChoicesList()).stream() - .map(valueType::cast) - .collect(Collectors.toList()), - param.getDisplay(), param.getDescription()); - } - return ParameterDescription.create(valueType, param.getName(), param.getRequired(), - valueType.cast(getValue(model, null, param.getDefaultValue())), param.getDisplay(), - param.getDescription()); - } - - public static ParameterDescription getParameterDescription(DebuggerObjectModel model, - Gadp.Parameter param) { - return getParameterDescription(getValueType(param.getType()), model, param); - - } - - public static Map> getParameters(DebuggerObjectModel model, - Gadp.ParameterList params) { - return TargetMethod.makeParameters( - params.getParameterList().stream().map(p -> getParameterDescription(model, p))); - } - - public static Gadp.ValueType makeValueType(Class type) { - if (type == Void.class) { - return Gadp.ValueType.VT_VOID; - } - if (type == Boolean.class) { - return Gadp.ValueType.VT_BOOL; - } - if (type == Integer.class) { - return Gadp.ValueType.VT_INT; - } - if (type == Long.class) { - return Gadp.ValueType.VT_LONG; - } - if (type == Float.class) { - return Gadp.ValueType.VT_FLOAT; - } - if (type == Double.class) { - return Gadp.ValueType.VT_DOUBLE; - } - if (type == byte[].class) { - return Gadp.ValueType.VT_BYTES; - } - if (type == String.class) { - return Gadp.ValueType.VT_STRING; - } - if (type == TargetStringList.class) { - return Gadp.ValueType.VT_STRING_LIST; - } - if (type == Address.class) { - return Gadp.ValueType.VT_ADDRESS; - } - if (type == AddressRange.class) { - return Gadp.ValueType.VT_RANGE; - } - if (type == TargetBreakpointKindSet.class) { - return Gadp.ValueType.VT_BREAK_KIND_SET; - } - if (type == TargetExecutionState.class) { - return Gadp.ValueType.VT_EXECUTION_STATE; - } - if (type == TargetStepKindSet.class) { - return Gadp.ValueType.VT_STEP_KIND_SET; - } - if (type == TargetPrimitiveDataType.class) { - return Gadp.ValueType.VT_PRIMITIVE_KIND; - } - if (type == TargetDataType.class) { - return Gadp.ValueType.VT_DATA_TYPE; - } - if (type == TargetObject.class) { - return Gadp.ValueType.VT_PATH; - } - if (type == TargetObjectList.class) { - return Gadp.ValueType.VT_PATH_LIST; - } - if (type == Class.class) { - return Gadp.ValueType.VT_TYPE; - } - throw new IllegalArgumentException("Cannot encode type: " + type); - } - - public static Gadp.Parameter makeParameter(ParameterDescription desc) { - return Gadp.Parameter.newBuilder() - .setType(makeValueType(desc.type)) - .setName(desc.name) - .setDefaultValue(makeValue(null, desc.defaultValue)) - .setRequired(desc.required) - .setDisplay(desc.display) - .setDescription(desc.description) - .addAllChoices(makeValues(desc.choices)) - .build(); - } - - public static Gadp.ParameterList makeParameterList(TargetParameterMap map) { - return Gadp.ParameterList.newBuilder() - .addAllParameter( - map.values().stream().map(d -> makeParameter(d)).collect(Collectors.toList())) - .build(); - } - - public static TargetObject getTargetObjectNonLink(List path, Object value) { - if (!(value instanceof TargetObject)) { - return null; - } - TargetObject obj = (TargetObject) value; - if (!Objects.equals(obj.getPath(), path)) { - return null; - } - return obj; - } - - public static Gadp.Value makeValue(List path, Object value) { - Gadp.Value.Builder b = Gadp.Value.newBuilder(); - if (value == null) { - b.clearSpec(); - } - else if (value instanceof Boolean) { - b.setBoolValue((Boolean) value); - } - else if (value instanceof Integer) { - b.setIntValue((Integer) value); - } - else if (value instanceof Long) { - b.setLongValue((Long) value); - } - else if (value instanceof Float) { - b.setFloatValue((Float) value); - } - else if (value instanceof Double) { - b.setDoubleValue((Double) value); - } - else if (value instanceof byte[]) { - b.setBytesValue(ByteString.copyFrom((byte[]) value)); - } - else if (value instanceof String) { - b.setStringValue((String) value); - } - else if (value instanceof TargetStringList) { - b.setStringListValue(makeStringList((TargetStringList) value)); - } - else if (value instanceof Address) { - b.setAddressValue(makeAddress((Address) value)); - } - else if (value instanceof AddressRange) { - b.setRangeValue(makeRange((AddressRange) value)); - } - else if (value instanceof TargetAttachKindSet) { - b.setAttachKindsValue(makeAttachKindSet((TargetAttachKindSet) value)); - } - else if (value instanceof TargetBreakpointKindSet) { - b.setBreakKindsValue(makeBreakKindSet((TargetBreakpointKindSet) value)); - } - else if (value instanceof TargetExecutionState) { - b.setExecStateValue(makeExecutionState((TargetExecutionState) value)); - } - else if (value instanceof TargetStepKindSet) { - b.setStepKindsValue(makeStepKindSet((TargetStepKindSet) value)); - } - // TODO: TargetPrimitiveDataType? - // TODO: TargetDataType? - else if (value instanceof TargetParameterMap) { - b.setParametersValue(makeParameterList((TargetParameterMap) value)); - } - else if (path != null && getTargetObjectNonLink(path, value) != null) { - // This case MUST precede TargetObjectRef - b.setObjectStub(Gadp.ModelObjectStub.getDefaultInstance()); - // NOTE: Never produce info. That is a special case for object retrieval. - } - else if (value instanceof TargetObject) { - b.setPathValue(makePath((TargetObject) value)); - } - else if (value instanceof TargetObjectList) { - b.setPathListValue(makePathList((TargetObjectList) value)); - } - else if (value instanceof Class) { - b.setTypeValue(makeValueType((Class) value)); - } - else { - throw new IllegalArgumentException( - "Cannot encode value: " + value + " (of type " + value.getClass() + ")"); - } - return b.build(); - } - - public static Gadp.NamedValue makeNamedValue(Map.Entry ent) { - return makeNamedValue(null, ent); - } - - public static Gadp.NamedValue makeNamedValue(List parentPath, - Map.Entry ent) { - List path = parentPath == null ? null : PathUtils.extend(parentPath, ent.getKey()); - return Gadp.NamedValue.newBuilder() - .setName(ent.getKey()) - .setValue(makeValue(path, ent.getValue())) - .build(); - } - - public static Gadp.NamedValue makeIndexedValue(List parentPath, - Map.Entry ent) { - List path = parentPath == null ? null : PathUtils.index(parentPath, ent.getKey()); - return Gadp.NamedValue.newBuilder() - .setName(ent.getKey()) - .setValue(makeValue(path, ent.getValue())) - .build(); - } - - public static Address getAddress(DebuggerObjectModel model, Gadp.Address addr) { - return model.getAddress(addr.getSpace(), addr.getOffset()); - } - - public static AddressRange getAddressRange(DebuggerObjectModel model, Gadp.AddressRange range) { - Address min = model.getAddress(range.getSpace(), range.getOffset()); - return new AddressRangeImpl(min, min.add(Integer.toUnsignedLong(range.getExtend()))); - } - - public static Object getValue(DebuggerObjectModel model, List path, Gadp.Value value) { - switch (value.getSpecCase()) { - case BOOL_VALUE: - return value.getBoolValue(); - case INT_VALUE: - return value.getIntValue(); - case LONG_VALUE: - return value.getLongValue(); - case FLOAT_VALUE: - return value.getFloatValue(); - case DOUBLE_VALUE: - return value.getDoubleValue(); - case BYTES_VALUE: - return value.getBytesValue().toByteArray(); - case STRING_VALUE: - return value.getStringValue(); - case STRING_LIST_VALUE: - return getStringList(value.getStringListValue()); - case ADDRESS_VALUE: - return getAddress(model, value.getAddressValue()); - case RANGE_VALUE: - return getAddressRange(model, value.getRangeValue()); - case ATTACH_KINDS_VALUE: - return getAttachKindSet(value.getAttachKindsValue()); - case BREAK_KINDS_VALUE: - return getBreakKindSet(value.getBreakKindsValue()); - case EXEC_STATE_VALUE: - return getExecutionState(value.getExecStateValue()); - case STEP_KINDS_VALUE: - return getStepKindSet(value.getStepKindsValue()); - case PRIMITIVE_KIND_VALUE: - return TODO("Marhsalling types over GADP", value.getPrimitiveKindValue()); - case DATA_TYPE_VALUE: - return TODO("Marshalling types over GADP", value.getDataTypeValue()); - case PARAMETERS_VALUE: - return getParameters(model, value.getParametersValue()); - case PATH_VALUE: - return model.getModelObject(value.getPathValue().getEList()); - case PATH_LIST_VALUE: - return getObjList(model, value.getPathListValue()); - case OBJECT_STUB: - return model.getModelObject(path); - case TYPE_VALUE: - return getValueType(value.getTypeValue()); - case SPEC_NOT_SET: - return null; - default: - Msg.error(GadpValueUtils.class, "Got unknown value type: " + value); - return null; - } - } - - public static Object getAttributeValue(TargetObject object, Gadp.NamedValue attr) { - return getValue(object.getModel(), PathUtils.extend(object.getPath(), attr.getName()), - attr.getValue()); - } - - public static GadpClientTargetObject getElementValue(TargetObject object, - Gadp.NamedValue elem) { - Object value = getValue(object.getModel(), - PathUtils.index(object.getPath(), elem.getName()), elem.getValue()); - if (!(value instanceof GadpClientTargetObject)) { - Msg.error(GadpValueUtils.class, "Received non-object-valued element: " + elem); - return null; - } - return (GadpClientTargetObject) value; - } - - public static Map getAttributeMap(GadpClientTargetObject object, - List list) { - Map result = new LinkedHashMap<>(); - for (Gadp.NamedValue attr : list) { - Object val = GadpValueUtils.getAttributeValue(object, attr); - if (result.put(attr.getName(), val) != null) { - Msg.warn(GadpValueUtils.class, "Received duplicate attribute: " + attr); - } - } - return result; - } - - public static List getValues(DebuggerObjectModel model, List values) { - // Use null for path, since the list cannot refer to itself as an object - return values.stream().map(v -> getValue(model, null, v)).collect(Collectors.toList()); - } - - public static List makeValues(Collection values) { - return values.stream().map(v -> makeValue(null, v)).collect(Collectors.toList()); - } - - public static List makeArguments(Map arguments) { - return arguments.entrySet() - .stream() - .map(ent -> makeNamedValue(ent)) - .collect(Collectors.toList()); - } - - public static Map getElementMap(GadpClientTargetObject parent, - List list) { - Map result = new LinkedHashMap<>(); - for (Gadp.NamedValue elem : list) { - GadpClientTargetObject val = GadpValueUtils.getElementValue(parent, elem); - if (val == null) { - continue; - } - if (result.put(elem.getName(), val) != null) { - Msg.warn(GadpValueUtils.class, "Received duplicate element: " + elem); - } - } - return result; - } - - public static Map getArguments(DebuggerObjectModel model, - List arguments) { - return arguments.stream() - .collect( - Collectors.toMap(a -> a.getName(), a -> getValue(model, null, a.getValue()))); - } -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/annot/GadpEventHandler.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/annot/GadpEventHandler.java deleted file mode 100644 index 78e52bdd1b..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/client/annot/GadpEventHandler.java +++ /dev/null @@ -1,26 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client.annot; - -import java.lang.annotation.*; - -import ghidra.dbg.gadp.protocol.Gadp; - -@Target(ElementType.METHOD) -@Retention(RetentionPolicy.RUNTIME) -public @interface GadpEventHandler { - Gadp.EventNotification.EvtCase value(); -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/error/GadpErrorException.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/error/GadpErrorException.java deleted file mode 100644 index 674b7bcfac..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/error/GadpErrorException.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.error; - -import ghidra.dbg.gadp.protocol.Gadp.ErrorCode; - -public class GadpErrorException extends GadpRuntimeException { - private ErrorCode code; - - public GadpErrorException(ErrorCode code, String message) { - super(code + ": " + message); - this.code = code; - } - - public ErrorCode getCode() { - return code; - } -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/error/GadpException.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/error/GadpException.java deleted file mode 100644 index 5a08871c15..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/error/GadpException.java +++ /dev/null @@ -1,26 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.error; - -public class GadpException extends Exception { - public GadpException(String message) { - super(message); - } - - public GadpException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/error/GadpIllegalStateException.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/error/GadpIllegalStateException.java deleted file mode 100644 index efeac1c089..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/error/GadpIllegalStateException.java +++ /dev/null @@ -1,26 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.error; - -public class GadpIllegalStateException extends GadpRuntimeException { - public GadpIllegalStateException(String message) { - super(message); - } - - public GadpIllegalStateException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/error/GadpMessageException.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/error/GadpMessageException.java deleted file mode 100644 index 1f3c3938e2..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/error/GadpMessageException.java +++ /dev/null @@ -1,26 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.error; - -public class GadpMessageException extends GadpRuntimeException { - public GadpMessageException(String message) { - super(message); - } - - public GadpMessageException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/error/GadpRuntimeException.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/error/GadpRuntimeException.java deleted file mode 100644 index 8daa5b8ce5..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/error/GadpRuntimeException.java +++ /dev/null @@ -1,26 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.error; - -public class GadpRuntimeException extends RuntimeException { - public GadpRuntimeException(String message) { - super(message); - } - - public GadpRuntimeException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/server/AbstractGadpLocalDebuggerModelFactory.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/server/AbstractGadpLocalDebuggerModelFactory.java deleted file mode 100644 index 9034efe5ee..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/server/AbstractGadpLocalDebuggerModelFactory.java +++ /dev/null @@ -1,212 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.server; - -import java.io.*; -import java.nio.channels.AsynchronousByteChannel; -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.Future; - -import generic.concurrent.io.IOResult; -import generic.concurrent.io.ProcessConsumer; -import ghidra.dbg.DebuggerModelFactory; -import ghidra.dbg.gadp.client.GadpClient; -import ghidra.dbg.gadp.client.GadpTcpDebuggerModelFactory; -import ghidra.util.Msg; - -public abstract class AbstractGadpLocalDebuggerModelFactory implements DebuggerModelFactory { - public static final boolean LOG_AGENT_STDOUT = true; - - protected String host = "localhost"; - @FactoryOption("Agent interface address") - public final Property agentAddressOption = - Property.fromAccessors(String.class, this::getAgentAddress, this::setAgentAddress); - - protected int port = 0; // Automatic, ephemeral - @FactoryOption("Agent TCP port") - public final Property agentPortOption = - Property.fromAccessors(int.class, this::getAgentPort, this::setAgentPort); - - protected int jdwpPort = -1; - @FactoryOption("Open agent's JDWP port (-1 to disable, 0 for ephemeral)") - public final Property jdwpPortOption = - Property.fromAccessors(int.class, this::getJdwpPort, this::setJdwpPort); - - protected boolean jdwpSuspend = false; - @FactoryOption("Suspend for JDWP") - public final Property jdwpSuspendOption = - Property.fromAccessors(boolean.class, this::isJdwpSuspend, this::setJdwpSuspend); - - /** - * Get the name of the thread which processes the agent's stdout - */ - protected abstract String getThreadName(); - - /** - * Get the command line to launch the agent - * - * Note, the given list already contains the java invocation and incorporates the -debugAgent- - * option. The implementor must incorporate all other options, including -host- and -port-. - * - * @param cmd the command line - */ - protected abstract void completeCommandLine(List cmd); - - public String getAgentAddress() { - return host; - } - - public void setAgentAddress(String host) { - this.host = host; - } - - public int getAgentPort() { - return port; - } - - public void setAgentPort(int port) { - this.port = port; - } - - public int getJdwpPort() { - return jdwpPort; - } - - public void setJdwpPort(int jdwpPort) { - this.jdwpPort = jdwpPort; - } - - public boolean isJdwpSuspend() { - return jdwpSuspend; - } - - public void setJdwpSuspend(boolean jdwpSuspend) { - this.jdwpSuspend = jdwpSuspend; - } - - class AgentThread extends Thread { - int port; - Process process; - CompletableFuture ready = new CompletableFuture<>(); - - public AgentThread() { - super(getThreadName()); - } - - @Override - public void run() { - try { - ProcessBuilder builder = new ProcessBuilder(); - List cmd = new ArrayList<>(); - String javaCommand = System.getProperty("java.home") + File.separator + "bin" + - File.separator + "java"; - cmd.add(javaCommand); - cmd.add("-cp"); - cmd.add(System.getProperty("java.class.path")); - if (jdwpPort >= 0) { - cmd.add("-agentlib:jdwp=server=y,transport=dt_socket,address=" + jdwpPort + - ",suspend=" + (jdwpSuspend ? "y" : "n")); - } - completeCommandLine(cmd); - builder.command(cmd); - //builder.redirectError(Redirect.INHERIT); - - process = builder.start(); - - InputStream errorStream = process.getErrorStream(); - Future errorFuture = ProcessConsumer.consume(errorStream); - - BufferedReader reader = - new BufferedReader(new InputStreamReader(process.getInputStream())); - String line; - while (null != (line = reader.readLine())) { - if (LOG_AGENT_STDOUT) { - Msg.info(this, "AGENT: " + line); - } - if (line.startsWith(AbstractGadpServer.LISTENING_ON)) { - String[] parts = line.split(":"); // Separates address from port - port = Integer.parseInt(parts[parts.length - 1]); - } - if (AbstractGadpServer.READY.equals(line)) { - ready.complete(null); - } - } - - if (!ready.isDone()) { - IOResult errorResult = errorFuture.get(); - String errorMessage = errorResult.getOutputAsString(); - if (errorMessage != null) { - ready.completeExceptionally( - new RuntimeException("Agent terminated with error: " + errorMessage)); - } - else { - ready.completeExceptionally( - new RuntimeException("Agent terminated unexpectedly")); - } - } - } - catch (Throwable e) { - ready.completeExceptionally(e); - } - } - } - - static class AgentOwningGadpClient extends GadpClient { - private final AgentThread agentThread; - - public AgentOwningGadpClient(String description, AsynchronousByteChannel channel, - AgentThread agentThread) { - super(description, channel); - this.agentThread = agentThread; - } - - @Override - public CompletableFuture close() { - return super.close().whenComplete((v, e) -> { - agentThread.process.destroy(); - agentThread.interrupt(); - }); - } - } - - static class AgentOwningGadpTcpDebuggerModelFactory extends GadpTcpDebuggerModelFactory { - private final AgentThread agentThread; - - public AgentOwningGadpTcpDebuggerModelFactory(AgentThread agentThread) { - this.agentThread = agentThread; - } - - @Override - protected GadpClient createClient(String description, AsynchronousByteChannel channel) { - return new AgentOwningGadpClient(description, channel, agentThread); - } - } - - @Override - public CompletableFuture build() { - AgentThread thread = new AgentThread(); - thread.start(); - return thread.ready.thenCompose(__ -> { - GadpTcpDebuggerModelFactory factory = - new AgentOwningGadpTcpDebuggerModelFactory(thread); - // selectedPort may differ from port option, particularly if port == 0 - factory.setAgentPort(thread.port); - return factory.build(); - }); - } -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/server/AbstractGadpServer.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/server/AbstractGadpServer.java deleted file mode 100644 index 43f7d4bf0b..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/server/AbstractGadpServer.java +++ /dev/null @@ -1,125 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.server; - -import java.io.IOException; -import java.net.SocketAddress; -import java.nio.channels.AsynchronousSocketChannel; -import java.util.concurrent.CompletableFuture; - -import ghidra.comm.service.AbstractAsyncServer; -import ghidra.dbg.*; -import ghidra.dbg.gadp.error.GadpErrorException; -import ghidra.dbg.gadp.protocol.Gadp; -import ghidra.program.model.address.*; -import ghidra.util.Msg; - -@Deprecated(forRemoval = true, since = "11.2") -public abstract class AbstractGadpServer - extends AbstractAsyncServer - implements DebuggerModelListener { - public static final String LISTENING_ON = "GADP Server listening on "; - public static final String READY = "GADP Server model ready"; - - protected final DebuggerObjectModel model; - private boolean exitOnClosed = true; - - public AbstractGadpServer(DebuggerObjectModel model, SocketAddress addr) throws IOException { - super(addr); - this.model = model; - System.out.println(LISTENING_ON + getLocalAddress()); - - model.addModelListener(this); - } - - @Override - public CompletableFuture launchAsyncService() { - System.out.println(READY); - return super.launchAsyncService(); - } - - public DebuggerObjectModel getModel() { - return model; - } - - @Override - protected boolean checkAcceptable(AsynchronousSocketChannel sock) { - return true; - } - - @Override - protected GadpClientHandler newHandler(AsynchronousSocketChannel sock) { - try { - // Accept only the first connection - closeServerSocket(); - } - catch (IOException e) { - Msg.error(this, "Could not close server socket", e); - } - return new GadpClientHandler(this, sock); - } - - @Override - protected void removeHandler(GadpClientHandler handler) { - super.removeHandler(handler); - try { - terminate(); - } - catch (IOException e) { - Msg.error(this, "Could not terminate upon disconnect"); - } - } - - protected AddressRange getAddressRange(Gadp.AddressRange range) { - AddressSpace space = model.getAddressSpace(range.getSpace()); - if (space == null) { - throw new GadpErrorException(Gadp.ErrorCode.EC_BAD_ADDRESS, - "Unrecognized address space: " + range); - } - Address min = space.getAddress(range.getOffset()); - // TODO: Should extend be a long? - // Note, +1 accounted for in how Ghidra AddressRanges work (inclusive of end) - return new AddressRangeImpl(min, min.add(Integer.toUnsignedLong(range.getExtend()))); - } - - @Override - public void modelClosed(DebuggerModelClosedReason reason) { - if (exitOnClosed) { - System.exit(0); - } - } - - /** - * By default, the GADP server will terminate the VM when the model is closed - * - *

- * For testing purposes, it may be useful to disable this action. - * - * @param exitOnClosed true to terminate the VM on close, false to remain running - */ - public void setExitOnClosed(boolean exitOnClosed) { - this.exitOnClosed = exitOnClosed; - } - - @Override - public void terminate() throws IOException { - super.terminate(); - model.close().exceptionally(ex -> { - Msg.error(this, "Problem closing GADP-served model", ex); - return null; - }); - } -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/server/GadpClientHandler.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/server/GadpClientHandler.java deleted file mode 100644 index 718e0a33e6..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/server/GadpClientHandler.java +++ /dev/null @@ -1,816 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.server; - -import java.nio.channels.AsynchronousByteChannel; -import java.nio.channels.AsynchronousSocketChannel; -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import com.google.protobuf.ByteString; - -import ghidra.async.AsyncUtils; -import ghidra.async.TypeSpec; -import ghidra.comm.service.AbstractAsyncClientHandler; -import ghidra.dbg.DebuggerModelListener; -import ghidra.dbg.DebuggerObjectModel; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.error.*; -import ghidra.dbg.gadp.GadpVersion; -import ghidra.dbg.gadp.client.GadpValueUtils; -import ghidra.dbg.gadp.error.GadpErrorException; -import ghidra.dbg.gadp.protocol.Gadp; -import ghidra.dbg.gadp.protocol.Gadp.ErrorCode; -import ghidra.dbg.gadp.util.AsyncProtobufMessageChannel; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetBreakpointSpec.TargetBreakpointKind; -import ghidra.dbg.target.TargetConsole.Channel; -import ghidra.dbg.target.TargetEventScope.TargetEventType; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.util.CollectionUtils.Delta; -import ghidra.dbg.util.PathUtils; -import ghidra.program.model.address.Address; -import ghidra.program.model.address.AddressRange; -import ghidra.util.Msg; - -public class GadpClientHandler - extends AbstractAsyncClientHandler { - protected static final boolean LOG_ERROR_REPLY_STACKS = false; - - protected static class UpdateSuppression { - int attributesCount = 0; - int elementsCount = 0; - - boolean isEmpty() { - return attributesCount == 0 && elementsCount == 0; - } - - void incrementAttributes() { - attributesCount++; - } - - void decrementAttributes() { - assert attributesCount > 0; - attributesCount--; - } - - void incrementElements() { - elementsCount++; - } - - void decrementElements() { - assert elementsCount > 0; - elementsCount--; - } - } - - protected class ListenerForEvents implements DebuggerModelListener { - @Override - public void created(TargetObject object) { - if (!sock.isOpen()) { - return; - } - channel.write(Gadp.RootMessage.newBuilder() - .setEventNotification(Gadp.EventNotification.newBuilder() - .setPath(GadpValueUtils.makePath(object.getPath())) - .setObjectCreatedEvent(Gadp.ObjectCreatedEvent.newBuilder() - .setTypeHint(object.getTypeHint()) - .addAllInterface(object.getInterfaceNames()))) - .build()).exceptionally(GadpClientHandler::errorSendNotify); - } - - @Override - public void rootAdded(TargetObject root) { - if (!sock.isOpen()) { - return; - } - channel.write(Gadp.RootMessage.newBuilder() - .setEventNotification(Gadp.EventNotification.newBuilder() - .setRootAddedEvent(Gadp.RootAddedEvent.getDefaultInstance())) - .build()).exceptionally(GadpClientHandler::errorSendNotify); - } - - @Override - public void attributesChanged(TargetObject parent, Collection removed, - Map added) { - if (!sock.isOpen()) { - return; - } - // TODO: Can elements and attributes be combined into one message? - if (removed.isEmpty() && added.isEmpty()) { - return; - } - sendDelta(parent.getPath(), Delta.empty(), Delta.create(removed, added)) - .exceptionally(GadpClientHandler::errorSendNotify); - } - - @Override - public void elementsChanged(TargetObject parent, Collection removed, - Map added) { - if (!sock.isOpen()) { - return; - } - // TODO: Can elements and attributes be combined into one message? - if (removed.isEmpty() && added.isEmpty()) { - return; - } - sendDelta(parent.getPath(), Delta.create(removed, added), Delta.empty()) - .exceptionally(GadpClientHandler::errorSendNotify); - } - - @Override - public void invalidated(TargetObject object, TargetObject branch, String reason) { - if (!sock.isOpen()) { - return; - } - if (object != branch) { - return; - } - channel.write(Gadp.RootMessage.newBuilder() - .setEventNotification(Gadp.EventNotification.newBuilder() - .setPath(GadpValueUtils.makePath(object.getPath())) - .setObjectInvalidateEvent( - Gadp.ObjectInvalidateEvent.newBuilder().setReason(reason))) - .build()).exceptionally(GadpClientHandler::errorSendNotify); - } - - @Override - public void consoleOutput(TargetObject console, Channel c, byte[] data) { - if (!sock.isOpen()) { - return; - } - if (c == null || console == null) { - Msg.warn(this, "Why is console or channel null in consoleOutput callback?"); - return; - } - channel.write(Gadp.RootMessage.newBuilder() - .setEventNotification(Gadp.EventNotification.newBuilder() - .setPath(GadpValueUtils.makePath(console.getPath())) - .setConsoleOutputEvent(Gadp.ConsoleOutputEvent.newBuilder() - .setChannel(c.ordinal()) - .setData(ByteString.copyFrom(data)))) - .build()).exceptionally(GadpClientHandler::errorSendNotify); - } - - @Override - public void consoleOutput(TargetObject console, Channel c, String out) { - if (!sock.isOpen()) { - return; - } - consoleOutput(console, c, out.getBytes(TargetConsole.CHARSET)); - } - - @Override - public void breakpointHit(TargetObject container, TargetObject trapped, - TargetStackFrame frame, TargetBreakpointSpec spec, - TargetBreakpointLocation breakpoint) { - if (!sock.isOpen()) { - return; - } - Gadp.BreakHitEvent.Builder evt = Gadp.BreakHitEvent.newBuilder() - .setTrapped(GadpValueUtils.makePath(trapped.getPath())) - .setSpec(GadpValueUtils.makePath(spec.getPath())) - .setEffective(GadpValueUtils.makePath(breakpoint.getPath())); - if (frame != null) { - evt.setFrame(GadpValueUtils.makePath(frame.getPath())); - } - channel.write(Gadp.RootMessage.newBuilder() - .setEventNotification(Gadp.EventNotification.newBuilder() - .setPath(GadpValueUtils.makePath(container.getPath())) - .setBreakHitEvent(evt)) - .build()).exceptionally(GadpClientHandler::errorSendNotify); - } - - @Override - public void invalidateCacheRequested(TargetObject object) { - if (!sock.isOpen()) { - return; - } - channel.write(Gadp.RootMessage.newBuilder() - .setEventNotification(Gadp.EventNotification.newBuilder() - .setPath(GadpValueUtils.makePath(object.getPath())) - .setCacheInvalidateEvent( - Gadp.CacheInvalidateEvent.getDefaultInstance())) - .build()).exceptionally(GadpClientHandler::errorSendNotify); - } - - @Override - public void memoryReadError(TargetObject memory, AddressRange range, - DebuggerMemoryAccessException e) { - if (!sock.isOpen()) { - return; - } - // TODO: Ignore those generated by this client - channel.write(Gadp.RootMessage.newBuilder() - .setEventNotification(Gadp.EventNotification.newBuilder() - .setPath(GadpValueUtils.makePath(memory.getPath())) - .setMemoryErrorEvent(Gadp.MemoryErrorEvent.newBuilder() - .setRange(GadpValueUtils.makeRange(range)) - .setMessage(e.getMessage()))) - .build()).exceptionally(GadpClientHandler::errorSendNotify); - } - - @Override - public void memoryUpdated(TargetObject memory, Address address, byte[] data) { - if (!sock.isOpen()) { - return; - } - // TODO: Ignore those generated by this client - channel.write(Gadp.RootMessage.newBuilder() - .setEventNotification(Gadp.EventNotification.newBuilder() - .setPath(GadpValueUtils.makePath(memory.getPath())) - .setMemoryUpdateEvent(Gadp.MemoryUpdateEvent.newBuilder() - .setAddress(GadpValueUtils.makeAddress(address)) - .setContent(ByteString.copyFrom(data)))) - .build()).exceptionally(GadpClientHandler::errorSendNotify); - } - - @Override - public void registersUpdated(TargetObject bank, Map updates) { - if (!sock.isOpen()) { - return; - } - // TODO: Ignore those generated by this client - channel.write(Gadp.RootMessage.newBuilder() - .setEventNotification(Gadp.EventNotification.newBuilder() - .setPath(GadpValueUtils.makePath(bank.getPath())) - .setRegisterUpdateEvent(Gadp.RegisterUpdateEvent.newBuilder() - .addAllValue(GadpValueUtils.makeRegisterValues(updates)))) - .build()).exceptionally(GadpClientHandler::errorSendNotify); - } - - @Override - public void event(TargetObject object, TargetThread eventThread, TargetEventType type, - String description, List parameters) { - if (!sock.isOpen()) { - return; - } - Gadp.TargetEvent.Builder evt = Gadp.TargetEvent.newBuilder(); - if (eventThread != null) { - evt.setEventThread(GadpValueUtils.makePath(eventThread.getPath())); - } - evt.setType(GadpValueUtils.makeTargetEventType(type)); - evt.setDescription(description); - evt.addAllParameters(GadpValueUtils.makeValues(parameters)); - channel.write(Gadp.RootMessage.newBuilder() - .setEventNotification(Gadp.EventNotification.newBuilder() - .setPath(GadpValueUtils.makePath(object.getPath())) - .setTargetEvent(evt)) - .build()).exceptionally(GadpClientHandler::errorSendNotify); - } - } - - protected static T errorSendNotify(Throwable e) { - Msg.error(GadpClientHandler.class, "Could not send notification: " + e); - return null; - } - - protected final DebuggerObjectModel model; - protected final AsyncProtobufMessageChannel channel; - protected final ListenerForEvents listenerForEvents = new ListenerForEvents(); - // Keeps strong references and tells level of subscription - - public GadpClientHandler(AbstractGadpServer server, AsynchronousSocketChannel sock) { - super(server, sock); - model = server.model; - channel = createMessageChannel(sock); - } - - protected AsyncProtobufMessageChannel createMessageChannel( - AsynchronousByteChannel byteChannel) { - return new AsyncProtobufMessageChannel<>(byteChannel); - } - - @Override - protected CompletableFuture launchAsync() { - return AsyncUtils.loop(TypeSpec.VOID, loop -> { - if (sock.isOpen()) { - channel.read(Gadp.RootMessage::parseFrom).handle(loop::consume); - } - else { - loop.exit(); - } - }, TypeSpec.cls(Gadp.RootMessage.class), (msg, loop) -> { - loop.repeat(); - try { - processMessage(msg).exceptionally(e -> { - e.printStackTrace(); - replyError(msg, e).exceptionally(ee -> { - Msg.error(this, "Could not send error reply: " + ee); - return null; - }); - return null; - }); // Do not handle with loop. Loop is already repeating - } - catch (Throwable e) { - replyError(msg, e).exceptionally(ee -> { - Msg.error(this, "Could not send error reply: " + ee); - return null; - }); - } - }); - } - - protected Gadp.RootMessage buildError(Gadp.RootMessage req, ErrorCode code, String message) { - return Gadp.RootMessage.newBuilder() - .setSequence(req.getSequence()) - .setErrorReply(Gadp.ErrorReply.newBuilder().setCode(code).setMessage(message)) - .build(); - } - - protected CompletableFuture replyError(Gadp.RootMessage req, Throwable e) { - Throwable t = AsyncUtils.unwrapThrowable(e); - if (LOG_ERROR_REPLY_STACKS) { - Msg.debug(this, "Error caused by request " + req, e); - } - else { - Msg.debug(this, "Error caused by request " + req + ": " + e); - } - if (t instanceof GadpErrorException) { - GadpErrorException error = (GadpErrorException) t; - return channel.write(buildError(req, error.getCode(), error.getMessage())); - } - if (t instanceof UnsupportedOperationException) { - return channel.write(buildError(req, ErrorCode.EC_NOT_SUPPORTED, t.getMessage())); - } - if (t instanceof DebuggerModelNoSuchPathException) { - return channel.write(buildError(req, ErrorCode.EC_NO_OBJECT, t.getMessage())); - } - if (t instanceof DebuggerModelTypeException) { - return channel.write(buildError(req, ErrorCode.EC_NO_INTERFACE, t.getMessage())); - } - if (t instanceof DebuggerIllegalArgumentException) { - return channel.write(buildError(req, ErrorCode.EC_BAD_ARGUMENT, t.getMessage())); - } - if (t instanceof DebuggerMemoryAccessException) { - return channel.write(buildError(req, ErrorCode.EC_MEMORY_ACCESS, t.getMessage())); - } - if (t instanceof DebuggerRegisterAccessException) { - return channel.write(buildError(req, ErrorCode.EC_REGISTER_ACCESS, t.getMessage())); - } - if (t instanceof DebuggerUserException) { - return channel.write(buildError(req, ErrorCode.EC_USER_ERROR, t.getMessage())); - } - if (t instanceof DebuggerModelAccessException) { - return channel.write(buildError(req, ErrorCode.EC_MODEL_ACCESS, t.getMessage())); - } - return channel.write(buildError(req, ErrorCode.EC_UNKNOWN, "Unknown server-side error")); - } - - protected GadpVersion getVersion() { - return GadpVersion.VER1; - } - - protected CompletableFuture processMessage(Gadp.RootMessage msg) { - switch (msg.getMsgCase()) { - case CONNECT_REQUEST: - return processConnect(msg.getSequence(), msg.getConnectRequest()); - case PING_REQUEST: - return processPing(msg.getSequence(), msg.getPingRequest()); - case ATTACH_REQUEST: - return processAttach(msg.getSequence(), msg.getAttachRequest()); - case BREAK_CREATE_REQUEST: - return processBreakCreate(msg.getSequence(), msg.getBreakCreateRequest()); - case BREAK_TOGGLE_REQUEST: - return processBreakToggle(msg.getSequence(), msg.getBreakToggleRequest()); - case CACHE_INVALIDATE_REQUEST: - return processCacheInvalidate(msg.getSequence(), msg.getCacheInvalidateRequest()); - case CONFIGURE_REQUEST: - return processConfigure(msg.getSequence(), msg.getConfigureRequest()); - case DELETE_REQUEST: - return processDelete(msg.getSequence(), msg.getDeleteRequest()); - case DETACH_REQUEST: - return processDetach(msg.getSequence(), msg.getDetachRequest()); - case EXECUTE_REQUEST: - return processExecute(msg.getSequence(), msg.getExecuteRequest()); - case FOCUS_REQUEST: - return processFocus(msg.getSequence(), msg.getFocusRequest()); - case INTERRUPT_REQUEST: - return processInterrupt(msg.getSequence(), msg.getInterruptRequest()); - case INVOKE_REQUEST: - return processInvoke(msg.getSequence(), msg.getInvokeRequest()); - case KILL_REQUEST: - return processKill(msg.getSequence(), msg.getKillRequest()); - case LAUNCH_REQUEST: - return processLaunch(msg.getSequence(), msg.getLaunchRequest()); - case MEMORY_READ_REQUEST: - return processMemoryRead(msg.getSequence(), msg.getMemoryReadRequest()); - case MEMORY_WRITE_REQUEST: - return processMemoryWrite(msg.getSequence(), msg.getMemoryWriteRequest()); - case REGISTER_READ_REQUEST: - return processRegisterRead(msg.getSequence(), msg.getRegisterReadRequest()); - case REGISTER_WRITE_REQUEST: - return processRegisterWrite(msg.getSequence(), msg.getRegisterWriteRequest()); - case RESYNC_REQUEST: - return processResync(msg.getSequence(), msg.getResyncRequest()); - case RESUME_REQUEST: - return processResume(msg.getSequence(), msg.getResumeRequest()); - case STEP_REQUEST: - return processStep(msg.getSequence(), msg.getStepRequest()); - case ACTIVATION_REQUEST: - return processActivation(msg.getSequence(), msg.getActivationRequest()); - default: - throw new GadpErrorException(Gadp.ErrorCode.EC_BAD_REQUEST, - "Unrecognized request: " + msg.getMsgCase()); - } - } - - protected CompletableFuture processConnect(int seqno, Gadp.ConnectRequest req) { - String ver = getVersion().getName(); - if (!req.getVersionList().contains(ver)) { - throw new GadpErrorException(Gadp.ErrorCode.EC_NO_VERSION, - "No listed version is supported"); - } - TargetObjectSchema rootSchema = model.getRootSchema(); - if (rootSchema == null) { - Msg.error(this, "Served model has no schema! Using OBJECT"); - rootSchema = EnumerableTargetObjectSchema.OBJECT; - } - CompletableFuture send = channel.write(Gadp.RootMessage.newBuilder() - .setSequence(seqno) - .setConnectReply(Gadp.ConnectReply.newBuilder() - .setVersion(ver) - .setSchemaContext(XmlSchemaContext.serialize(rootSchema.getContext())) - .setRootSchema(rootSchema.getName().toString())) - .build()); - return send.thenAccept(__ -> { - model.addModelListener(listenerForEvents, true); - }); - } - - protected CompletableFuture processPing(int seqno, Gadp.PingRequest req) { - return channel.write(Gadp.RootMessage.newBuilder() - .setSequence(seqno) - .setPingReply(Gadp.PingReply.newBuilder().setContent(req.getContent())) - .build()); - } - - protected T isObjectValuedAttribute(TargetObject parent, - Map.Entry ent, Class cls) { - Object val = ent.getValue(); - if (!cls.isAssignableFrom(val.getClass())) { - return null; - } - T ref = cls.cast(val); - if (!ref.getPath().equals(PathUtils.extend(parent.getPath(), ent.getKey()))) { - return null; - } - return ref; - } - - protected CompletableFuture sendDelta(List parentPath, - Delta deltaE, Delta deltaA) { - return channel.write(Gadp.RootMessage.newBuilder() - .setEventNotification(Gadp.EventNotification.newBuilder() - .setPath(GadpValueUtils.makePath(parentPath)) - .setModelObjectEvent(Gadp.ModelObjectEvent.newBuilder() - .setElementDelta( - GadpValueUtils.makeElementDelta(parentPath, deltaE)) - .setAttributeDelta( - GadpValueUtils.makeElementDelta(parentPath, deltaA)))) - .build()); - } - - protected TargetObject getObjectChecked(List path) { - return DebuggerObjectModel.requireNonNull(model.getModelObject(path), path); - } - - protected TargetObject getObjectChecked(Gadp.Path path) { - return getObjectChecked(path.getEList()); - } - - protected CompletableFuture processInvoke(int seqno, Gadp.InvokeRequest req) { - TargetMethod method = getObjectChecked(req.getPath()).as(TargetMethod.class); - Map arguments = GadpValueUtils.getArguments(model, req.getArgumentList()); - return method.invoke(arguments).thenCompose(result -> { - return model.flushEvents().thenApply(__ -> result); - }).thenCompose(result -> { - return channel.write(Gadp.RootMessage.newBuilder() - .setSequence(seqno) - .setInvokeReply(Gadp.InvokeReply.newBuilder() - .setResult(GadpValueUtils.makeValue(null, result))) - .build()); - }); - } - - protected CompletableFuture processResync(int seqno, Gadp.ResyncRequest req) { - List path = req.getPath().getEList(); - return model.fetchModelObject(path).thenCompose(obj -> { - DebuggerObjectModel.requireNonNull(obj, path); - RefreshBehavior reqAttributes = req.getAttributes() ? - RefreshBehavior.REFRESH_ALWAYS : RefreshBehavior.REFRESH_NEVER; - RefreshBehavior reqElements = req.getElements() ? - RefreshBehavior.REFRESH_ALWAYS : RefreshBehavior.REFRESH_NEVER; - return obj.resync(reqAttributes, reqElements); - }).thenCompose(__ -> { - return model.flushEvents(); - }).thenCompose(__ -> { - return channel.write(Gadp.RootMessage.newBuilder() - .setSequence(seqno) - .setResyncReply(Gadp.ResyncReply.getDefaultInstance()) - .build()); - }); - } - - protected CompletableFuture performAttach(Gadp.AttachRequest req, - TargetAttacher attacher) { - switch (req.getSpecCase()) { - case TARGET: - TargetAttachable attachable = - getObjectChecked(req.getTarget()).as(TargetAttachable.class); - return attacher.attach(attachable); - case PID: - return attacher.attach(req.getPid()); - default: - throw new GadpErrorException(Gadp.ErrorCode.EC_BAD_REQUEST, - "Unrecognized attach specification:" + req); - } - } - - protected CompletableFuture processAttach(int seqno, Gadp.AttachRequest req) { - TargetAttacher attacher = getObjectChecked(req.getPath()).as(TargetAttacher.class); - return performAttach(req, attacher).thenCompose(__ -> { - return model.flushEvents(); - }).thenCompose(__ -> { - return channel.write(Gadp.RootMessage.newBuilder() - .setSequence(seqno) - .setAttachReply(Gadp.AttachReply.getDefaultInstance()) - .build()); - }); - } - - protected CompletableFuture performBreakCreate(Gadp.BreakCreateRequest req, - TargetBreakpointSpecContainer breaks) { - Set kinds = GadpValueUtils.getBreakKindSet(req.getKinds()); - switch (req.getSpecCase()) { - case EXPRESSION: - return breaks.placeBreakpoint(req.getExpression(), kinds); - case ADDRESS: - AddressRange range = server.getAddressRange(req.getAddress()); - return breaks.placeBreakpoint(range, kinds); - default: - throw new GadpErrorException(Gadp.ErrorCode.EC_BAD_REQUEST, - "Unrecognized breakpoint specification: " + req); - } - } - - protected CompletableFuture processBreakCreate(int seqno, Gadp.BreakCreateRequest req) { - TargetBreakpointSpecContainer breaks = - getObjectChecked(req.getPath()).as(TargetBreakpointSpecContainer.class); - return performBreakCreate(req, breaks).thenCompose(__ -> { - return model.flushEvents(); - }).thenCompose(__ -> { - return channel.write(Gadp.RootMessage.newBuilder() - .setSequence(seqno) - .setBreakCreateReply(Gadp.BreakCreateReply.getDefaultInstance()) - .build()); - }); - } - - protected CompletableFuture processBreakToggle(int seqno, Gadp.BreakToggleRequest req) { - TargetBreakpointSpec spec = getObjectChecked(req.getPath()).as(TargetBreakpointSpec.class); - return spec.toggle(req.getEnabled()).thenCompose(__ -> { - return model.flushEvents(); - }).thenCompose(__ -> { - return channel.write(Gadp.RootMessage.newBuilder() - .setSequence(seqno) - .setBreakToggleReply(Gadp.BreakToggleReply.getDefaultInstance()) - .build()); - }); - } - - protected CompletableFuture processDelete(int seqno, Gadp.DeleteRequest req) { - TargetDeletable del = getObjectChecked(req.getPath()).as(TargetDeletable.class); - return del.delete().thenCompose(__ -> { - return model.flushEvents(); - }).thenCompose(__ -> { - return channel.write(Gadp.RootMessage.newBuilder() - .setSequence(seqno) - .setDeleteReply(Gadp.DeleteReply.getDefaultInstance()) - .build()); - }); - } - - protected CompletableFuture processDetach(int seqno, Gadp.DetachRequest req) { - TargetDetachable det = getObjectChecked(req.getPath()).as(TargetDetachable.class); - return det.detach().thenCompose(__ -> { - return model.flushEvents(); - }).thenCompose(__ -> { - return channel.write(Gadp.RootMessage.newBuilder() - .setSequence(seqno) - .setDetachReply(Gadp.DetachReply.getDefaultInstance()) - .build()); - }); - } - - protected CompletableFuture performExecute(Gadp.ExecuteRequest req, - TargetInterpreter interpreter) { - if (req.getCapture()) { - return interpreter.executeCapture(req.getCommand()); - } - return interpreter.execute(req.getCommand()).thenApply(__ -> ""); - } - - protected CompletableFuture processExecute(int seqno, Gadp.ExecuteRequest req) { - TargetInterpreter interpreter = getObjectChecked(req.getPath()).as(TargetInterpreter.class); - return performExecute(req, interpreter).thenCompose(out -> { - return model.flushEvents().thenApply(__ -> out); - }).thenCompose(out -> { - return channel.write(Gadp.RootMessage.newBuilder() - .setSequence(seqno) - .setExecuteReply(Gadp.ExecuteReply.newBuilder().setCaptured(out)) - .build()); - }); - } - - protected CompletableFuture processActivation(int seqno, Gadp.ActivationRequest req) { - TargetActiveScope scope = getObjectChecked(req.getPath()).as(TargetActiveScope.class); - TargetObject active = getObjectChecked(req.getActive()); - return scope.requestActivation(active).thenCompose(__ -> { - return model.flushEvents(); - }).thenCompose(__ -> { - return channel.write(Gadp.RootMessage.newBuilder() - .setSequence(seqno) - .setActivationReply(Gadp.ActivationReply.getDefaultInstance()) - .build()); - }); - } - - protected CompletableFuture processFocus(int seqno, Gadp.FocusRequest req) { - TargetFocusScope scope = getObjectChecked(req.getPath()).as(TargetFocusScope.class); - TargetObject focus = getObjectChecked(req.getFocus()); - return scope.requestFocus(focus).thenCompose(__ -> { - return model.flushEvents(); - }).thenCompose(__ -> { - return channel.write(Gadp.RootMessage.newBuilder() - .setSequence(seqno) - .setFocusReply(Gadp.FocusReply.getDefaultInstance()) - .build()); - }); - } - - protected CompletableFuture processInterrupt(int seqno, Gadp.InterruptRequest req) { - TargetInterruptible interruptible = - getObjectChecked(req.getPath()).as(TargetInterruptible.class); - return interruptible.interrupt().thenCompose(__ -> { - return model.flushEvents(); - }).thenCompose(__ -> { - return channel.write(Gadp.RootMessage.newBuilder() - .setSequence(seqno) - .setInterruptReply(Gadp.InterruptReply.getDefaultInstance()) - .build()); - }); - } - - protected CompletableFuture processCacheInvalidate(int seqno, - Gadp.CacheInvalidateRequest req) { - List path = req.getPath().getEList(); - TargetObject obj = getObjectChecked(path); - return obj.invalidateCaches().thenCompose(__ -> { - return model.flushEvents(); - }).thenCompose(__ -> { - return channel.write(Gadp.RootMessage.newBuilder() - .setSequence(seqno) - .setCacheInvalidateReply(Gadp.CacheInvalidateReply.getDefaultInstance()) - .build()); - }); - } - - protected CompletableFuture processConfigure(int seqno, Gadp.ConfigureRequest req) { - TargetConfigurable configurable = - getObjectChecked(req.getPath()).as(TargetConfigurable.class); - String key = req.getOption().getName(); - Object value = GadpValueUtils.getAttributeValue(configurable, req.getOption()); - return configurable.writeConfigurationOption(key, value).thenCompose(__ -> { - return model.flushEvents(); - }).thenCompose(__ -> { - return channel.write(Gadp.RootMessage.newBuilder() - .setSequence(seqno) - .setConfigureReply(Gadp.ConfigureReply.getDefaultInstance()) - .build()); - }); - } - - protected CompletableFuture processKill(int seqno, Gadp.KillRequest req) { - TargetKillable killable = getObjectChecked(req.getPath()).as(TargetKillable.class); - return killable.kill().thenCompose(__ -> { - return model.flushEvents(); - }).thenCompose(__ -> { - return channel.write(Gadp.RootMessage.newBuilder() - .setSequence(seqno) - .setKillReply(Gadp.KillReply.getDefaultInstance()) - .build()); - }); - } - - protected CompletableFuture processLaunch(int seqno, Gadp.LaunchRequest req) { - TargetLauncher launcher = getObjectChecked(req.getPath()).as(TargetLauncher.class); - Map arguments = GadpValueUtils.getArguments(model, req.getArgumentList()); - return launcher.launch(arguments).thenCompose(__ -> { - Msg.debug(this, "Flushing events after launch: " + Thread.currentThread()); - return model.flushEvents(); - }).thenCompose(__ -> { - Msg.debug(this, "Responding after launch: " + Thread.currentThread()); - return channel.write(Gadp.RootMessage.newBuilder() - .setSequence(seqno) - .setLaunchReply(Gadp.LaunchReply.getDefaultInstance()) - .build()); - }); - } - - protected CompletableFuture processMemoryRead(int seqno, Gadp.MemoryReadRequest req) { - TargetMemory memory = getObjectChecked(req.getPath()).as(TargetMemory.class); - AddressRange range = GadpValueUtils.getAddressRange(memory.getModel(), req.getRange()); - CompletableFuture read = - memory.readMemory(range.getMinAddress(), (int) range.getLength()); - return read.thenCompose(data -> { - return model.flushEvents().thenApply(__ -> data); - }).thenCompose(data -> { - return channel.write(Gadp.RootMessage.newBuilder() - .setSequence(seqno) - .setMemoryReadReply( - Gadp.MemoryReadReply.newBuilder().setContent(ByteString.copyFrom(data))) - .build()); - }); - } - - protected CompletableFuture processMemoryWrite(int seqno, Gadp.MemoryWriteRequest req) { - TargetMemory memory = getObjectChecked(req.getPath()).as(TargetMemory.class); - Address start = GadpValueUtils.getAddress(memory.getModel(), req.getStart()); - // TODO: Spare a copy by specifying a ByteBuffer variant of writeMemory? - return memory.writeMemory(start, req.getContent().toByteArray()).thenCompose(__ -> { - return model.flushEvents(); - }).thenCompose(__ -> { - return channel.write(Gadp.RootMessage.newBuilder() - .setSequence(seqno) - .setMemoryWriteReply(Gadp.MemoryWriteReply.getDefaultInstance()) - .build()); - }); - } - - protected CompletableFuture processRegisterRead(int seqno, Gadp.RegisterReadRequest req) { - TargetRegisterBank bank = getObjectChecked(req.getPath()).as(TargetRegisterBank.class); - return bank.readRegistersNamed(req.getNameList()).thenCompose(data -> { - return model.flushEvents().thenApply(__ -> data); - }).thenCompose(data -> { - return channel.write(Gadp.RootMessage.newBuilder() - .setSequence(seqno) - .setRegisterReadReply(Gadp.RegisterReadReply.newBuilder() - .addAllValue(GadpValueUtils.makeRegisterValues(data))) - .build()); - }); - } - - protected CompletableFuture processRegisterWrite(int seqno, Gadp.RegisterWriteRequest req) { - TargetRegisterBank bank = getObjectChecked(req.getPath()).as(TargetRegisterBank.class); - Map values = new LinkedHashMap<>(); - for (Gadp.RegisterValue rv : req.getValueList()) { - values.put(rv.getName(), rv.getContent().toByteArray()); - } - return bank.writeRegistersNamed(values).thenCompose(__ -> { - return model.flushEvents(); - }).thenCompose(__ -> { - return channel.write(Gadp.RootMessage.newBuilder() - .setSequence(seqno) - .setRegisterWriteReply(Gadp.RegisterWriteReply.getDefaultInstance()) - .build()); - }); - } - - protected CompletableFuture processResume(int seqno, Gadp.ResumeRequest req) { - TargetResumable resumable = getObjectChecked(req.getPath()).as(TargetResumable.class); - return resumable.resume().thenCompose(__ -> { - return model.flushEvents(); - }).thenCompose(__ -> { - return channel.write(Gadp.RootMessage.newBuilder() - .setSequence(seqno) - .setResumeReply(Gadp.ResumeReply.getDefaultInstance()) - .build()); - }); - } - - protected CompletableFuture processStep(int seqno, Gadp.StepRequest req) { - TargetSteppable steppable = getObjectChecked(req.getPath()).as(TargetSteppable.class); - return steppable.step(GadpValueUtils.getStepKind(req.getKind())).thenCompose(__ -> { - return model.flushEvents(); - }).thenCompose(__ -> { - return channel.write(Gadp.RootMessage.newBuilder() - .setSequence(seqno) - .setStepReply(Gadp.StepReply.getDefaultInstance()) - .build()); - }); - } -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/util/AsyncProtobufMessageChannel.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/util/AsyncProtobufMessageChannel.java deleted file mode 100644 index c1efeafc93..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/util/AsyncProtobufMessageChannel.java +++ /dev/null @@ -1,178 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.util; - -import java.io.EOFException; -import java.io.IOException; -import java.nio.*; -import java.nio.channels.AsynchronousByteChannel; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.atomic.AtomicInteger; - -import com.google.protobuf.*; -import com.google.protobuf.CodedOutputStream.OutOfSpaceException; - -import ghidra.async.*; -import ghidra.util.ByteBufferUtils; -import ghidra.util.Msg; - -public class AsyncProtobufMessageChannel { - public static final boolean LOG_READ = false; - public static final boolean LOG_WRITE = false; - - public interface IOFunction { - R read(CodedInputStream stream) throws IOException; - } - - public static final int DEFAULT_BUFFER_SIZE = 4096; - - public static void marshall(Message msg, ByteBuffer wBuf) throws IOException { - int savedPosition = wBuf.position(); - try { - wBuf.putInt(0); // Placeholder for len - CodedOutputStream out = CodedOutputStream.newInstance(wBuf); - msg.writeTo(out); - out.flush(); - wBuf.putInt(savedPosition, out.getTotalBytesWritten()); - savedPosition = wBuf.position(); - } - finally { - wBuf.position(savedPosition); - } - } - - public static R unmarshall(IOFunction receiver, ByteBuffer rBuf) - throws IOException { - rBuf.flip(); - int savedPosition = rBuf.position(); - int savedLimit = rBuf.limit(); - try { - int len = rBuf.getInt(); - if (rBuf.remaining() < len) { - throw new BufferUnderflowException(); - } - rBuf.limit(rBuf.position() + len); - CodedInputStream in = CodedInputStream.newInstance(rBuf); - R res = receiver.read(in); - savedPosition = rBuf.position() + in.getTotalBytesRead(); - return res; - } - finally { - rBuf.position(savedPosition); - rBuf.limit(savedLimit); - rBuf.compact(); - } - } - - private final AsynchronousByteChannel channel; - - /** A lock for sharing the underlying channel's read operation */ - protected final AsyncLock rLock = new AsyncLock(); - /** A lock for sharing the underlying channel's write operation */ - protected final AsyncLock wLock = new AsyncLock(); - /** A buffer of received data */ - protected ByteBuffer rBuf; - /** A buffer of data to send */ - protected ByteBuffer wBuf; - - public AsyncProtobufMessageChannel(AsynchronousByteChannel channel) { - this(channel, DEFAULT_BUFFER_SIZE); - } - - public AsyncProtobufMessageChannel(AsynchronousByteChannel channel, int initialBufferSize) { - this.rBuf = ByteBuffer.allocate(initialBufferSize); - this.wBuf = ByteBuffer.allocate(initialBufferSize); - this.channel = channel; - } - - /** - * Write a message to the channel - * - * @param msg the message to write - * @return the length of the encoded message as a future - */ - public CompletableFuture write(S msg) { - if (LOG_WRITE) { - Msg.debug(this, "Writing: " + msg); - } - AtomicInteger len = new AtomicInteger(); - return wLock.with(TypeSpec.INT, null).then((own, seq) -> { - while (true) { - try { - wBuf.clear(); - marshall(msg, wBuf); - break; - } - catch (BufferOverflowException | OutOfSpaceException e) { - wBuf.clear(); - wBuf = ByteBufferUtils.upsize(wBuf); - } - catch (IOException e) { - seq.exit(e); - return; - } - } - wBuf.flip(); - len.set(wBuf.remaining()); - AsyncUtils.loop(TypeSpec.VOID, loop -> { - AsyncUtils.completable(TypeSpec.INT, channel::write, wBuf).handle(loop::consume); - }, TypeSpec.INT, (l, loop) -> { - loop.repeatWhile(wBuf.hasRemaining()); - }).handle(seq::next); - }).then(seq -> { - seq.exit(len.get()); - }).finish(); - } - - /** - * Read and decode a packet from the channel - * - * @param pktType the type of packet expected - * @return the read packet as a future - */ - public CompletableFuture read(IOFunction receiver) { - return rLock.with(TypeSpec.obj((R2) null), null).then((own, seq) -> { - AsyncUtils.loop(TypeSpec.obj((R2) null), (loop) -> { - try { - R2 msg = unmarshall(receiver, rBuf); - if (LOG_READ) { - Msg.debug(this, "Read: " + msg); - } - loop.exit(msg); - } - catch (BufferUnderflowException | ArrayIndexOutOfBoundsException e) { - AsyncUtils.completable(TypeSpec.INT, channel::read, rBuf).handle(loop::consume); - } - catch (Exception e) { - loop.exit(e); - } - }, TypeSpec.INT, (lenread, loop) -> { - if (lenread == -1) { - loop.exit(new EOFException("Channel is closed")); - return; - } - else if (lenread == 0) { - rBuf = ByteBufferUtils.upsize(rBuf); - } - loop.repeat(); - }).handle(seq::exit); - }).finish(); - } - - public void close() throws IOException { - channel.close(); - } -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/util/ProtobufOneofByTypeHelper.java b/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/util/ProtobufOneofByTypeHelper.java deleted file mode 100644 index bb7457608a..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/java/ghidra/dbg/gadp/util/ProtobufOneofByTypeHelper.java +++ /dev/null @@ -1,89 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.util; - -import java.util.*; - -import com.google.protobuf.*; -import com.google.protobuf.Descriptors.*; - -public class ProtobufOneofByTypeHelper { - public static OneofDescriptor findOneofByName(Descriptor descriptor, String name) { - for (OneofDescriptor desc : descriptor.getOneofs()) { - if (name.equals(desc.getName())) { - return desc; - } - } - return null; - } - - public static ProtobufOneofByTypeHelper create( - M exampleMessage, B exampleBuilder, String oneofName) { - Descriptor typeDesc = exampleMessage.getDescriptorForType(); - if (exampleBuilder.getDescriptorForType() != typeDesc) { - throw new IllegalArgumentException( - "Example message and builder must have the same message type"); - } - OneofDescriptor oneofDesc = findOneofByName(typeDesc, oneofName); - if (oneofDesc == null) { - throw new NoSuchElementException( - "oneof " + oneofName + " in " + typeDesc); - } - return new ProtobufOneofByTypeHelper<>(oneofDesc); - } - - private final OneofDescriptor descriptor; - private final Map fieldsByType; - - private ProtobufOneofByTypeHelper(OneofDescriptor descriptor) { - this.descriptor = descriptor; - Map descsByType = new HashMap<>(); - for (FieldDescriptor desc : descriptor.getFields()) { - Descriptor type = desc.getMessageType(); - if (type == null || descsByType.put(type, desc) != null) { - throw new IllegalArgumentException(this.getClass() + - " requires each fields in " + descriptor + " to be a unique message type"); - } - } - this.fieldsByType = Map.copyOf(descsByType); - } - - public FieldDescriptor getFieldForTypeOf(MessageOrBuilder value) { - FieldDescriptor field = fieldsByType.get(value.getDescriptorForType()); - if (field == null) { - throw new IllegalArgumentException( - "No field in " + descriptor + " has type of " + value); - } - return field; - } - - public void set(B builder, Message value) { - builder.setField(getFieldForTypeOf(value), value); - } - - public void set(B builder, Message.Builder value) { - builder.setField(getFieldForTypeOf(value), value.build()); - } - - @SuppressWarnings("unchecked") - public MI expect(M outer, MI exampleInner) { - FieldDescriptor field = outer.getOneofFieldDescriptor(descriptor); - if (field == null || field.getMessageType() != exampleInner.getDescriptorForType()) { - return null; - } - return (MI) outer.getField(field); - } -} diff --git a/Ghidra/Debug/Debugger-gadp/src/main/proto/gadp.proto b/Ghidra/Debug/Debugger-gadp/src/main/proto/gadp.proto deleted file mode 100644 index f6d4b0f03c..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/main/proto/gadp.proto +++ /dev/null @@ -1,602 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -syntax = "proto3"; -package ghidra.dbg.gadp.protocol; - -enum ErrorCode { - EC_UNKNOWN = 0; - EC_BAD_REQUEST = 1; - EC_NO_VERSION = 2; - EC_NO_OBJECT = 3; - EC_NO_INTERFACE = 4; - EC_BAD_ARGUMENT = 5; - EC_BAD_ADDRESS = 6; - EC_NOT_SUPPORTED = 7; - EC_MEMORY_ACCESS = 8; - EC_REGISTER_ACCESS = 9; - EC_USER_ERROR = 10; - EC_MODEL_ACCESS = 11; -} - -// For testing: cause the server to report an unrecognized request error -message ErrorRequest { -} - -message ErrorReply { - ErrorCode code = 1; - string message = 2; -} - -message ConnectRequest { - repeated string version = 1; -} - -message ConnectReply { - string version = 1; - string schema_context = 2; - string root_schema = 3; -} - -message PingRequest { - string content = 1; -} - -message PingReply { - string content = 1; -} - -message Address { - string space = 1; - uint64 offset = 2; -} - -message AddressRange { - string space = 1; - uint64 offset = 2; - uint32 extend = 3; -} - -message Path { - repeated string e = 1; -} - -message PathList { - repeated Path path = 1; -} - -enum BreakKind { - BK_READ = 0; - BK_WRITE = 1; - BK_EXECUTE = 2; - BK_SOFTWARE = 3; -} - -message BreakKindsSet { - repeated BreakKind k = 1; -} - -enum StepKind { - SK_INTO = 0; - SK_FINISH = 2; - SK_LINE = 3; - SK_OVER = 4; - SK_OVER_LINE = 5; - SK_SKIP = 6; - SK_RETURN = 7; - SK_UNTIL = 8; - SK_EXTENDED = 9; -} - -message StepKindsSet { - repeated StepKind k = 1; -} - -message StringList { - repeated string s = 1; -} - -enum AttachKind { - AK_BY_OBJECT_REF = 0; - AK_BY_ID = 1; -} - -message AttachKindSet { - repeated AttachKind k = 1; -} - -enum ExecutionState { - ES_INACTIVE = 0; - ES_ALIVE = 1; - ES_STOPPED = 2; - ES_RUNNING = 3; - ES_TERMINATED = 4; -} - -enum PrimitiveKind { - PK_UNDEFINED = 0; - PK_VOID = 1; - PK_UINT = 2; - PK_SINT = 3; - PK_FLOAT = 4; - PK_COMPLEX = 5; -} - -message DataType { - message Array { - DataType element_type = 1; - uint32 element_count = 2; - } - - message Bitfield { - DataType field_type = 1; - uint32 start_bit = 2; - uint32 length = 3; - } - - message Pointer { - DataType referent_type = 1; - } - - message Primitive { - PrimitiveKind kind = 1; - uint32 length = 2; - } - - oneof dt { - Array array_type = 1; - Bitfield bitfield_type = 2; - Path named_type = 3; - Pointer pointer_type = 4; - Primitive primitive_type = 5; - } - bool const = 6; -} - -enum ValueType { - VT_VOID = 0; - VT_BOOL = 1; - VT_INT = 2; - VT_LONG = 3; - VT_FLOAT = 4; - VT_DOUBLE = 5; - VT_BYTES = 6; - VT_STRING = 7; - VT_STRING_LIST = 8; - VT_ADDRESS = 9; - VT_RANGE = 10; - VT_BREAK_KIND_SET = 11; - VT_EXECUTION_STATE = 12; - VT_STEP_KIND_SET = 13; - VT_PRIMITIVE_KIND = 14; - VT_DATA_TYPE = 15; - VT_PATH = 17; - VT_PATH_LIST = 18; - VT_TYPE = 19; - VT_ATTACH_KIND_SET = 20; -} - -message Parameter { - ValueType type = 1; - string name = 2; - Value defaultValue = 3; - bool required = 4; - string display = 5; - string description = 6; - repeated Value choices = 7; -} - -message ParameterList { - repeated Parameter parameter = 1; -} - -message Value { - oneof spec { - bool bool_value = 1; - int32 int_value = 2; - int64 long_value = 3; - float float_value = 4; - double double_value = 5; - bytes bytes_value = 6; - string string_value = 7; - StringList string_list_value = 8; - Address address_value = 9; - AddressRange range_value = 10; - BreakKindsSet break_kinds_value = 11; - ExecutionState exec_state_value = 12; - StepKindsSet step_kinds_value = 13; - PrimitiveKind primitive_kind_value = 14; - DataType data_type_value = 15; - Path path_value = 17; - PathList path_list_value = 18; - ModelObjectStub object_stub = 20; - ParameterList parameters_value = 21; - ValueType type_value = 22; - AttachKindSet attach_kinds_value = 23; - } -} - -message NamedValue { - string name = 1; - Value value = 2; -} - -message ModelObjectStub { -} - -message ModelObjectDelta { - repeated string removed = 1; - repeated NamedValue added = 2; -} - -message ModelObjectEvent { - ModelObjectDelta element_delta = 1; - ModelObjectDelta attribute_delta = 2; -} - -message ObjectCreatedEvent { - string type_hint = 2; - repeated string interface = 3; -} - -message ObjectInvalidateEvent { - string reason = 1; -} - -message LaunchRequest { - Path path = 1; - repeated NamedValue argument = 2; -} - -message LaunchReply { -} - -message AttachRequest { - Path path = 1; - oneof spec { - Path target = 2; - sint64 pid = 3; - } -} - -message AttachReply { -} - -message KillRequest { - Path path = 1; -} - -message KillReply { -} - -message DetachRequest { - Path path = 1; -} - -message DetachReply { -} - -message ResumeRequest { - Path path = 1; -} - -message ResumeReply { -} - -message BreakCreateRequest { - Path path = 1; - oneof spec { - string expression = 2; - AddressRange address = 3; - } - BreakKindsSet kinds = 4; -} - -message BreakCreateReply { -} - -message BreakToggleRequest { - Path path = 1; - bool enabled = 2; -} - -message BreakToggleReply { -} - -message BreakHitEvent { - Path trapped = 1; - Path frame = 2; - Path spec = 3; - Path effective = 4; -} - -message DeleteRequest { - Path path = 1; -} - -message DeleteReply { -} - -message ExecuteRequest { - Path path = 1; - string command = 2; - bool capture = 3; -} - -message ConsoleWriteRequest { - Path path = 1; - bytes data = 2; -} - -message ConsoleOutputEvent { - int32 channel = 1; - bytes data = 2; -} - -message ExecuteReply { - string captured = 1; -} - -message ConsoleWriteReply { -} - -message InterruptRequest { - Path path = 1; -} - -message InterruptReply { -} - -message MemoryReadRequest { - Path path = 1; - AddressRange range = 2; -} - -message MemoryReadReply { - bytes content = 1; -} - -message MemoryWriteRequest { - Path path = 1; - Address start = 2; - bytes content = 3; -} - -message MemoryWriteReply { - // TODO: Should this include amount written? -} - -// Sent one something/someone else reads/writes memory -message MemoryUpdateEvent { - Address address = 1; - bytes content = 2; -} - -// Sent one something/someone else causes a read error -message MemoryErrorEvent { - AddressRange range = 1; - string message = 2; -} - -message RegisterValue { - string name = 1; - bytes content = 2; -} - -message RegisterReadRequest { - Path path = 1; - repeated string name = 2; -} - -message RegisterReadReply { - repeated RegisterValue value = 1; -} - -message RegisterWriteRequest { - Path path = 1; - repeated RegisterValue value = 2; -} - -message RegisterWriteReply { -} - -message RegisterUpdateEvent { - repeated RegisterValue value = 1; -} - -message StepRequest { - Path path = 1; - StepKind kind = 2; -} - -message StepReply { -} - -message CacheInvalidateRequest { - Path path = 1; -} - -message CacheInvalidateEvent { -} - -message CacheInvalidateReply { -} - -message ActivationRequest { - Path path = 1; - Path active = 2; -} - -message ActivationReply { -} - - -message FocusRequest { - Path path = 1; - Path focus = 2; -} - -message FocusReply { -} - -message InvokeRequest { - Path path = 1; - repeated NamedValue argument = 2; -} - -message InvokeReply { - Value result = 1; -} - -message ResyncRequest { - Path path = 1; - bool attributes = 2; - bool elements = 3; -} - -message ResyncReply { -} - -message ConfigureRequest { - Path path = 1; - NamedValue option = 2; -} - -message ConfigureReply { -} - -enum TargetEventType { - EV_STOPPED = 0; - EV_RUNNING = 1; - EV_PROCESS_CREATED = 2; - EV_PROCESS_EXITED = 3; - EV_THREAD_CREATED = 4; - EV_THREAD_EXITED = 5; - EV_BREAKPOINT_HIT = 8; - EV_STEP_COMPLETED = 9; - EV_EXCEPTION = 10; - EV_SIGNAL = 11; -} - -message TargetEvent { - Path eventThread = 1; - TargetEventType type = 2; - string description = 3; - repeated Value parameters = 4; -} - -message RootAddedEvent { -} - -message EventNotification { - Path path = 1; - oneof evt { - ModelObjectEvent model_object_event = 304; - - BreakHitEvent break_hit_event = 314; - CacheInvalidateEvent cache_invalidate_event = 320; - ConsoleOutputEvent console_output_event = 312; - MemoryUpdateEvent memory_update_event = 317; - MemoryErrorEvent memory_error_event = 417; - ObjectCreatedEvent object_created_event = 324; - ObjectInvalidateEvent object_invalidate_event = 323; - RegisterUpdateEvent register_update_event = 322; - TargetEvent target_event = 330; - RootAddedEvent root_added_event = 326; - } -} - -message RootMessage { - int32 sequence = 1; - - oneof msg { - EventNotification event_notification = 2; - - ErrorRequest error_request = 100; - ErrorReply error_reply = 200; - - ConnectRequest connect_request = 101; - ConnectReply connect_reply = 201; - - PingRequest ping_request = 102; - PingReply ping_reply = 202; - - AttachRequest attach_request = 108; - AttachReply attach_reply = 208; - - BreakCreateRequest break_create_request = 114; - BreakCreateReply break_create_reply = 214; - - BreakToggleRequest break_toggle_request = 115; - BreakToggleReply break_toggle_reply = 215; - - CacheInvalidateRequest cache_invalidate_request = 120; - CacheInvalidateReply cache_invalidate_reply = 220; - - DeleteRequest delete_request = 116; - DeleteReply delete_reply = 216; - - DetachRequest detach_request = 110; - DetachReply detach_reply = 210; - - ExecuteRequest execute_request = 112; - ExecuteReply execute_reply = 212; - - ConsoleWriteRequest console_write_request = 113; - ConsoleWriteReply console_write_reply = 213; - - FocusRequest focus_request = 123; - FocusReply focus_reply = 223; - - InterruptRequest interrupt_request = 124; - InterruptReply interrupt_reply = 224; - - KillRequest kill_request = 109; - KillReply kill_reply = 209; - - LaunchRequest launch_request = 107; - LaunchReply launch_reply = 207; - - MemoryReadRequest memory_read_request = 117; - MemoryReadReply memory_read_reply = 217; - - MemoryWriteRequest memory_write_request = 118; - MemoryWriteReply memory_write_reply = 218; - - RegisterReadRequest register_read_request = 121; - RegisterReadReply register_read_reply = 221; - - RegisterWriteRequest register_write_request = 122; - RegisterWriteReply register_write_reply = 222; - - ResumeRequest resume_request = 111; - ResumeReply resume_reply = 211; - - StepRequest step_request = 119; - StepReply step_reply = 219; - - InvokeRequest invoke_request = 105; - InvokeReply invoke_reply = 205; - - ResyncRequest resync_request = 125; - ResyncReply resync_reply = 225; - - ActivationRequest activation_request = 126; - ActivationReply activation_reply = 226; - - ConfigureRequest configure_request = 127; - ConfigureReply configure_reply = 227; - } -} diff --git a/Ghidra/Debug/Debugger-gadp/src/test/java/ghidra/dbg/gadp/GadpClientServerTest.java b/Ghidra/Debug/Debugger-gadp/src/test/java/ghidra/dbg/gadp/GadpClientServerTest.java deleted file mode 100644 index 2557e7629f..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/test/java/ghidra/dbg/gadp/GadpClientServerTest.java +++ /dev/null @@ -1,1589 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp; - -import static org.junit.Assert.*; - -import java.io.IOException; -import java.lang.invoke.MethodHandles; -import java.net.InetSocketAddress; -import java.net.SocketAddress; -import java.nio.ByteBuffer; -import java.nio.channels.*; -import java.util.*; -import java.util.Map.Entry; -import java.util.concurrent.*; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.stream.Collectors; - -import org.junit.Ignore; -import org.junit.Test; - -import com.google.protobuf.GeneratedMessageV3; - -import generic.ID; -import generic.Unique; -import ghidra.async.*; -import ghidra.dbg.*; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.agent.*; -import ghidra.dbg.attributes.TargetStringList; -import ghidra.dbg.error.DebuggerIllegalArgumentException; -import ghidra.dbg.gadp.GadpClientServerTest.EventListener.CallEntry; -import ghidra.dbg.gadp.client.GadpClient; -import ghidra.dbg.gadp.protocol.Gadp; -import ghidra.dbg.gadp.protocol.Gadp.RootMessage; -import ghidra.dbg.gadp.server.AbstractGadpServer; -import ghidra.dbg.gadp.server.GadpClientHandler; -import ghidra.dbg.gadp.util.AsyncProtobufMessageChannel; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetLauncher.TargetCmdLineLauncher; -import ghidra.dbg.target.TargetMethod.ParameterDescription; -import ghidra.dbg.target.TargetMethod.TargetParameterMap; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; -import ghidra.dbg.testutil.*; -import ghidra.dbg.testutil.AttributesChangedListener.AttributesChangedInvocation; -import ghidra.dbg.testutil.ElementsChangedListener.ElementsChangedInvocation; -import ghidra.dbg.util.PathUtils; -import ghidra.program.model.address.*; -import ghidra.util.Msg; -import ghidra.util.SystemUtilities; - -@Ignore("deprecated") -public class GadpClientServerTest implements AsyncTestUtils { - public static final long TIMEOUT_MILLISECONDS = - SystemUtilities.isInTestingBatchMode() ? 5000 : Long.MAX_VALUE; - - protected interface DecoratedAsyncByteChannel extends AsynchronousByteChannel { - AsynchronousByteChannel getDelegate(); - - @Override - default void close() throws IOException { - getDelegate().close(); - } - - @Override - default boolean isOpen() { - return getDelegate().isOpen(); - } - - @Override - default void read(ByteBuffer dst, A attachment, - CompletionHandler handler) { - getDelegate().read(dst, attachment, handler); - } - - @Override - default Future read(ByteBuffer dst) { - return getDelegate().read(dst); - } - - @Override - default void write(ByteBuffer src, A attachment, - CompletionHandler handler) { - getDelegate().write(src, attachment, handler); - } - - @Override - default Future write(ByteBuffer src) { - return getDelegate().write(src); - } - } - - protected static class MonitoredAsyncByteChannel implements DecoratedAsyncByteChannel { - private AsynchronousByteChannel delegate; - - private int writeCount = 0; - - public MonitoredAsyncByteChannel(AsynchronousByteChannel delegate) { - this.delegate = delegate; - } - - @Override - public AsynchronousByteChannel getDelegate() { - return delegate; - } - - @Override - public void write(ByteBuffer src, A attachment, - CompletionHandler handler) { - writeCount++; - DecoratedAsyncByteChannel.super.write(src, attachment, handler); - } - - @Override - public Future write(ByteBuffer src) { - writeCount++; - return DecoratedAsyncByteChannel.super.write(src); - } - - private void reset() { - writeCount = 0; - } - } - - public static class MonitoredAsyncProtobufMessageChannel - extends AsyncProtobufMessageChannel { - interface MessageRecord { - S assertSent(); - - R assertReceived(); - } - - public static class MessageSent implements MessageRecord { - public final S message; - - public MessageSent(S message) { - this.message = message; - } - - @Override - public S assertSent() { - return message; - } - - @Override - public R assertReceived() { - fail(); - return null; - } - } - - public static class MessageReceived implements MessageRecord { - public final R message; - - public MessageReceived(R message) { - this.message = message; - } - - @Override - public S assertSent() { - fail(); - return null; - } - - @Override - public R assertReceived() { - return message; - } - } - - List> record = new ArrayList<>(); - AsyncReference count = new AsyncReference<>(); - - public MonitoredAsyncProtobufMessageChannel(AsynchronousByteChannel channel) { - super(channel); - } - - @Override - public CompletableFuture read(IOFunction receiver) { - return super.read(receiver).thenApply(msg -> { - synchronized (this) { - record.add(new MessageReceived<>(msg)); - count.set(record.size(), null); - } - return msg; - }); - } - - @Override - public CompletableFuture write(S msg) { - return super.write(msg).thenApply(s -> { - synchronized (this) { - record.add(new MessageSent<>(msg)); - count.set(record.size(), null); - } - return s; - }); - } - - public synchronized void clear() { - record.clear(); - count.set(0, null); - } - } - - public static class MonitoredGadpClient extends GadpClient { - public MonitoredGadpClient(String description, AsynchronousByteChannel channel) { - super(description, channel); - } - - @Override - protected AsyncProtobufMessageChannel createMessageChannel( - AsynchronousByteChannel channel) { - return new MonitoredAsyncProtobufMessageChannel<>(channel); - } - - MonitoredAsyncProtobufMessageChannel getMessageChannel() { - return (MonitoredAsyncProtobufMessageChannel) messageChannel; - } - } - - public static class PrintingAsyncProtobufMessageChannel - extends AsyncProtobufMessageChannel { - private final String sendPrefix; - private final String recvPrefix; - - public PrintingAsyncProtobufMessageChannel(String local, String peer, - AsynchronousByteChannel channel) { - super(channel); - this.sendPrefix = local + "->" + peer + ": "; - this.recvPrefix = local + "<-" + peer + ": "; - } - - @Override - public CompletableFuture write(S msg) { - Msg.debug(this, sendPrefix + msg); - return super.write(msg).thenApplyAsync(c -> { - return c; - }); - } - - @Override - public CompletableFuture read(IOFunction receiver) { - return super.read(receiver).thenApplyAsync(msg -> { - Msg.debug(this, recvPrefix + msg); - return msg; - }); - } - } - - public static class PrintingGadpClient extends GadpClient { - public PrintingGadpClient(String description, AsynchronousByteChannel channel) { - super(description, channel); - } - - @Override - protected AsyncProtobufMessageChannel createMessageChannel( - AsynchronousByteChannel channel) { - return new PrintingAsyncProtobufMessageChannel<>("C", "S", channel); - } - } - - @TargetObjectSchemaInfo(name = "Session") - public class TestGadpTargetSession extends DefaultTargetModelRoot implements TargetFocusScope { - protected final TestGadpTargetAvailableContainer available = - new TestGadpTargetAvailableContainer(this); - protected final TestGadpTargetProcessContainer processes = - new TestGadpTargetProcessContainer(this); - protected final TestGadpTargetAvailableLinkContainer links = - new TestGadpTargetAvailableLinkContainer(this); - - public TestGadpTargetSession(TestGadpObjectModel model, TargetObjectSchema schema) { - super(model, "Session", schema); - - changeAttributes(List.of(), List.of(available, processes), Map.ofEntries( - Map.entry(FOCUS_ATTRIBUTE_NAME, this)), - "Initialized"); - } - - @Override - public AbstractDebuggerObjectModel getModel() { - return super.getModel(); - } - - @TargetAttributeType(name = "Available", required = true, fixed = true) - public TestGadpTargetAvailableContainer getAvailable() { - return available; - } - - @TargetAttributeType(name = "Processes", required = true, fixed = true) - public TestGadpTargetProcessContainer getProcesses() { - return processes; - } - - public void addLinks() throws Throwable { - waitOn(available.fetchElements()); - links.setElements(List.of(), Map.of("1", available.getCachedElements().get("2"), "2", - available.getCachedElements().get("1")), "Initialized"); - changeAttributes(List.of(), List.of(links), Map.of(), "Adding links"); - } - - public void setFocus(TestGadpTargetProcess process) { - changeAttributes(List.of(), List.of(), Map.of(FOCUS_ATTRIBUTE_NAME, process), - "New Process"); - } - - @Override - public CompletableFuture requestFocus(TargetObject obj) { - throw new UnsupportedOperationException(); - } - } - - public class TestTargetObject - extends DefaultTargetObject { - - public TestTargetObject(AbstractDebuggerObjectModel model, P parent, String key, - String typeHint) { - super(model, parent, key, typeHint); - } - - @Override - public AbstractDebuggerObjectModel getModel() { - return super.getModel(); - } - - @Override - protected CompletableFuture requestAttributes(RefreshBehavior refresh) { - if (refresh.equals(RefreshBehavior.REFRESH_ALWAYS)) { - List toRemove = new ArrayList<>(); - for (String name : attributes.keySet()) { - if (PathUtils.isInvocation(name)) { - toRemove.add(name); - } - } - changeAttributes(toRemove, Map.of(), "Refreshed"); - } - return super.requestAttributes(refresh); - } - } - - private static final TargetParameterMap PARAMS = TargetParameterMap.copyOf(Map.of("whom", - ParameterDescription.create(String.class, "whom", true, "World", "Whom to greet", - "The person or people to greet"), - "others", - ParameterDescription.create(TargetStringList.class, "others", false, TargetStringList.of(), - "Others to greet", "List of other people to greet individually"))); - - public class TestGadpTargetMethod extends TestTargetObject> - implements TargetMethod { - - public TestGadpTargetMethod(TestTargetObject parent, String key) { - super(parent.getModel(), parent, key, "Method"); - - setAttributes(Map.of( - PARAMETERS_ATTRIBUTE_NAME, PARAMS, - RETURN_TYPE_ATTRIBUTE_NAME, Integer.class), - "Initialized"); - } - - @Override - public CompletableFuture invoke(Map arguments) { - TestMethodInvocation invocation = new TestMethodInvocation(arguments); - invocations.offer(invocation); - return model.gateFuture(invocation.thenApply(obj -> { - parent.changeAttributes(List.of(), - Map.ofEntries(Map.entry("greet(" + arguments.get("arg") + ")", obj)), - "greet() invoked"); - return obj; - })); - } - } - - private static final TargetParameterMap ORDERED_PARAMS = TargetMethod.makeParameters( - ParameterDescription.create(String.class, "H", true, null, "H", "H"), - ParameterDescription.create(String.class, "e", true, "", "e", "e"), - ParameterDescription.create(String.class, "l", true, "", "l", "l"), - ParameterDescription.create(String.class, "m", true, "", "l", "l"), - ParameterDescription.create(String.class, "o", true, "", "o", "o"), - ParameterDescription.create(String.class, "W", true, "", "W", "W"), - ParameterDescription.create(String.class, "p", true, "", "o", "o"), - ParameterDescription.create(String.class, "r", true, "", "r", "r"), - ParameterDescription.create(String.class, "n", true, "", "l", "l"), - ParameterDescription.create(String.class, "d", true, "", "d", "d")); - - public class TestGadpTargetMethodWithManyParameters - extends TestTargetObject> implements TargetMethod { - - public TestGadpTargetMethodWithManyParameters(TestTargetObject parent, String key) { - super(parent.getModel(), parent, key, "MethodPlus"); - - setAttributes(Map.of( - PARAMETERS_ATTRIBUTE_NAME, ORDERED_PARAMS, - RETURN_TYPE_ATTRIBUTE_NAME, Integer.class), - "Initialized"); - } - - @Override - public CompletableFuture invoke(Map arguments) { - fail("I wasn't expecting that"); - return AsyncUtils.nil(); - } - } - - @TargetObjectSchemaInfo(name = "ProcessContainer") - public class TestGadpTargetProcessContainer - extends TestTargetObject - implements TargetLauncher, TargetConfigurable { - - static final String BASE_ATTRIBUTE_NAME = "base"; - - int base = 10; - - public TestGadpTargetProcessContainer(TestGadpTargetSession session) { - super(session.getModel(), session, "Processes", "ProcessContainer"); - - changeAttributes(List.of(), Map.ofEntries( - Map.entry(BASE_ATTRIBUTE_NAME, base)), - "Initialized"); - } - - @Override - public CompletableFuture launch(Map args) { - launches.offer(args); - long pid = args.containsKey("pid") ? (Long) args.get("pid") : 0; - TestGadpTargetProcess process = new TestGadpTargetProcess(this, pid, base); - changeElements(List.of(), List.of(process), Map.of(), "Launched"); - parent.setFocus(process); - return AsyncUtils.nil(); - } - - @Override - public CompletableFuture writeConfigurationOption(String key, Object value) { - if (BASE_ATTRIBUTE_NAME.equals(key)) { - if (!(value instanceof Integer)) { - throw new DebuggerIllegalArgumentException( - "base must be an Integer in [0, 36]"); - } - int base = (Integer) value; - if (base < 0 || 36 < base) { - throw new DebuggerIllegalArgumentException( - "base must be an Integer in [0, 36]"); - } - setBase(base); - } - else { - throw new DebuggerIllegalArgumentException("unrecognized option: '" + key + "'"); - } - return AsyncUtils.nil(); - } - - public void setBase(int base) { - this.base = base; - for (TestGadpTargetProcess proc : elements.values()) { - proc.setBase(base); - } - } - } - - @TargetObjectSchemaInfo(name = "Process") - public class TestGadpTargetProcess - extends TestTargetObject - implements TargetProcess { - final long pid; - int base = 10; - - public TestGadpTargetProcess(TestGadpTargetProcessContainer processes, long pid, int base) { - super(processes.getModel(), processes, PathUtils.makeKey(PathUtils.makeIndex(pid)), - "Process"); - this.pid = pid; - setBase(base); - } - - void setBase(int base) { - this.base = base; - updateDisplay("Reconfigured base"); - } - - void updateDisplay(String reason) { - changeAttributes(List.of(), - Map.ofEntries(Map.entry(DISPLAY_ATTRIBUTE_NAME, computeDisplay())), - reason); - } - - String computeDisplay() { - return Long.toString(pid, base); - } - } - - @TargetObjectSchemaInfo(name = "AvailableContainer", elementResync = ResyncMode.ALWAYS) - public class TestGadpTargetAvailableContainer - extends TestTargetObject { - - public TestGadpTargetAvailableContainer(TestGadpTargetSession session) { - super(session.getModel(), session, "Available", "AvailableContainer"); - - setAttributes(List.of( - new TestGadpTargetMethod(this, "greet"), - new TestGadpTargetMethodWithManyParameters(this, "bigGreet")), - Map.of(), "Initialized"); - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - setElements(List.of(new TestGadpTargetAvailable(this, 1, "echo"), - new TestGadpTargetAvailable(this, 2, "dd")), Map.of(), "Refreshed"); - return super.requestElements(refresh); - } - } - - @TargetObjectSchemaInfo(name = "Available") - public class TestGadpTargetAvailable - extends TestTargetObject - implements TargetAttachable { - - public TestGadpTargetAvailable(TestGadpTargetAvailableContainer available, int pid, - String cmd) { - super(available.getModel(), available, PathUtils.makeKey(PathUtils.makeIndex(pid)), - "Available"); - changeAttributes(List.of(), Map.of("pid", pid, "cmd", cmd // - ), "Initialized"); - } - } - - /** - * This is a totally contrived concept, probably not found in any actual debugger. I just need - * something to have element links for testing. - */ - public class TestGadpTargetAvailableLinkContainer - extends TestTargetObject { - public TestGadpTargetAvailableLinkContainer(TestGadpTargetSession session) { - super(session.getModel(), session, "Links", "AvailableLinkContainer"); - } - } - - public static class BlankObjectModel extends AbstractDebuggerObjectModel { - private final AddressSpace ram = - new GenericAddressSpace("RAM", 64, AddressSpace.TYPE_RAM, 0); - private final AddressFactory factory = - new DefaultAddressFactory(new AddressSpace[] { ram }); - - @Override - public AddressFactory getAddressFactory() { - return factory; - } - } - - // TODO: Refactor with other Fake and Test. Probably put in Framework-Debugging.... - public class TestGadpObjectModel extends BlankObjectModel { - private TargetObjectSchema rootSchema = EnumerableTargetObjectSchema.OBJECT; - private TestGadpTargetSession session; - - public TestGadpObjectModel(boolean createSession) { - if (createSession) { - AnnotatedSchemaContext ctx = new AnnotatedSchemaContext(); - rootSchema = ctx.getSchemaForClass(TestGadpTargetSession.class); - session = new TestGadpTargetSession(this, rootSchema); - addModelRoot(session); - } - } - - @Override // file access - protected void addModelRoot(SpiTargetObject root) { - super.addModelRoot(root); - } - - @Override - public TargetObjectSchema getRootSchema() { - return rootSchema; - } - } - - public class TestGadpServer extends AbstractGadpServer { - final TestGadpObjectModel model; - - public TestGadpServer(SocketAddress addr) throws IOException { - this(new TestGadpObjectModel(true), addr); - } - - public TestGadpServer(TestGadpObjectModel model, SocketAddress addr) throws IOException { - super(model, addr); - this.model = model; - } - } - - public class PrintingTestGadpServer extends TestGadpServer { - public PrintingTestGadpServer(SocketAddress addr) throws IOException { - super(addr); - } - - @Override - protected GadpClientHandler newHandler(AsynchronousSocketChannel sock) { - return new GadpClientHandler(this, sock) { - @Override - protected AsyncProtobufMessageChannel createMessageChannel( - AsynchronousByteChannel byteChannel) { - return new PrintingAsyncProtobufMessageChannel<>("S", "C", byteChannel); - } - }; - } - } - - public class ServerRunner implements AutoCloseable { - TestGadpServer server; - - public ServerRunner() throws IOException { - server = createServer(new InetSocketAddress("localhost", 0)); - server.launchAsyncService(); - } - - protected TestGadpServer createServer(SocketAddress addr) throws IOException { - return new TestGadpServer(addr); - } - - @Override - public void close() throws Exception { - server.terminate(); - } - } - - public class PrintingServerRunner extends ServerRunner { - public PrintingServerRunner() throws IOException { - super(); - } - - @Override - protected TestGadpServer createServer(SocketAddress addr) throws IOException { - return new PrintingTestGadpServer(addr); - } - } - - class TestMethodInvocation extends CompletableFuture { - final Map args; - - public TestMethodInvocation(Map args) { - this.args = args; - } - } - - protected Deque> launches = new LinkedList<>(); - - protected static class AsyncDeque { - private final Deque deque = new LinkedList<>(); - private final AsyncReference count = new AsyncReference<>(0); - - public boolean offer(T e) { - boolean result = deque.offer(e); - count.set(deque.size(), null); - return result; - } - - public T poll() { - T result = deque.poll(); - count.set(deque.size(), null); - return result; - } - - public void clear() { - deque.clear(); - count.set(0, null); - } - } - - protected AsyncDeque invocations = new AsyncDeque<>(); - - protected AsynchronousSocketChannel socketChannel() throws IOException { - // Note, it looks like the executor knows to shut itself down on GC - AsynchronousChannelGroup group = - AsynchronousChannelGroup.withThreadPool(Executors.newSingleThreadExecutor()); - return AsynchronousSocketChannel.open(group); - } - - @Test - public void testConnectDisconnect() throws Throwable { - AsynchronousSocketChannel socket = socketChannel(); - try (ServerRunner runner = new ServerRunner()) { - GadpClient client = new GadpClient("Test", socket); - - waitOn(AsyncUtils.completable(TypeSpec.VOID, socket::connect, - runner.server.getLocalAddress())); - waitOn(client.connect()); - waitOn(client.close()); - } - finally { - socket.close(); - } - } - - @Test - public void testFetchModelValue() throws Throwable { - AsynchronousSocketChannel socket = socketChannel(); - try (ServerRunner runner = new ServerRunner()) { - GadpClient client = new GadpClient("Test", socket); - waitOn(AsyncUtils.completable(TypeSpec.VOID, socket::connect, - runner.server.getLocalAddress())); - waitOn(client.connect()); - Object rootVal = waitOn(client.fetchModelValue(List.of())); - TargetObject root = (TargetObject) rootVal; - assertEquals(List.of(), root.getPath()); - Object cmd = waitOn(client.fetchModelValue(PathUtils.parse("Available[1].cmd"))); - assertEquals("echo", cmd); - waitOn(client.close()); - } - finally { - socket.close(); - } - } - - @Test - @Ignore("Developer's desk only") - public void stressTest() throws Throwable { - for (int i = 0; i < 1000; i++) { - try { - System.out.println("ITERATION: " + i); - testFetchModelValueCached(); - } - catch (Throwable e) { - System.err.println("Failed on iteration " + i); - throw e; - } - } - } - - @Test // Sanity check on underlying model - public void testFetchModelValueCachedNoGadp() throws Throwable { - TestGadpObjectModel model = new TestGadpObjectModel(true); - Object rootVal = waitOn(model.fetchModelValue(List.of())); - TargetObject root = (TargetObject) rootVal; - assertEquals(List.of(), root.getPath()); - // Do fetchAll to create objects and populate their caches - Map available = - waitOn(model.fetchObjectElements(PathUtils.parse("Available"))); - assertEquals(2, available.size()); - Object cmd = waitOn(model.fetchModelValue(PathUtils.parse("Available[1].cmd"))); - assertEquals("echo", cmd); - } - - @Test - public void testFetchModelValueCached() throws Throwable { - AsynchronousSocketChannel socket = socketChannel(); - MonitoredAsyncByteChannel monitored = new MonitoredAsyncByteChannel(socket); - try (ServerRunner runner = new ServerRunner()) { - GadpClient client = new GadpClient("Test", monitored); - waitOn(AsyncUtils.completable(TypeSpec.VOID, socket::connect, - runner.server.getLocalAddress())); - waitOn(client.connect()); - Object rootVal = waitOn(client.fetchModelValue(List.of())); - TargetObject root = (TargetObject) rootVal; - assertEquals(List.of(), root.getPath()); - // Do fetchAll to create objects and populate their caches - Map available = - waitOn(client.fetchObjectElements(PathUtils.parse("Available"))); - assertEquals(2, available.size()); - monitored.reset(); - Object cmd = waitOn(client.fetchModelValue(PathUtils.parse("Available[1].cmd"))); - assertEquals("echo", cmd); - // Just 1 to request .cmd, since the above will only have covered Available[] - assertEquals(1, monitored.writeCount); - waitOn(client.close()); - } - finally { - socket.close(); - } - } - - @Test - public void testInvoke() throws Throwable { - AsynchronousSocketChannel socket = socketChannel(); - try (ServerRunner runner = new ServerRunner()) { - GadpClient client = new GadpClient("Test", socket); - waitOn(AsyncUtils.completable(TypeSpec.VOID, socket::connect, - runner.server.getLocalAddress())); - waitOn(client.connect()); - TargetObject greet = - waitOn(client.fetchModelObject(PathUtils.parse("Available.greet"))); - assertTrue(greet.getInterfaceNames().contains("Method")); - TargetMethod method = greet.as(TargetMethod.class); - - assertEquals(PARAMS, method.getParameters()); - assertEquals(Integer.class, method.getReturnType()); - - CompletableFuture future = method - .invoke(Map.of("whom", "GADP", "others", TargetStringList.of("Alice", "Bob"))); - waitOn(invocations.count.waitValue(1)); - TestMethodInvocation invocation = invocations.poll(); - assertEquals(Map.of("whom", "GADP", "others", TargetStringList.of("Alice", "Bob")), - invocation.args); - invocation.complete(42); - int result = (Integer) waitOn(future); - assertEquals(42, result); - waitOn(client.close()); - } - finally { - socket.close(); - } - } - - @Test - public void testInvokeMethodCached() throws Throwable { - // TODO: Disambiguate / deconflict these two "method" cases - try (AsynchronousSocketChannel socket = socketChannel(); - ServerRunner runner = new ServerRunner()) { - MonitoredAsyncByteChannel monitored = new MonitoredAsyncByteChannel(socket); - GadpClient client = new GadpClient("Test", monitored); - waitOn(AsyncUtils.completable(TypeSpec.VOID, socket::connect, - runner.server.getLocalAddress())); - waitOn(client.connect()); - - // Ensure the proxy's cache is in play - TargetObject avail = waitOn(client.fetchModelObject(PathUtils.parse("Available"))); - /** - * TODO: Need to think about what should happen if invocation is generated before - * attributes are fetched the first time. - */ - Map attrs = waitOn(avail.fetchAttributes()); - TargetMethod method = (TargetMethod) attrs.get("greet"); - assertNotNull(method); - CompletableFuture future1 = avail.fetchAttribute("greet(World)"); - - waitOn(invocations.count.waitValue(1)); - TestMethodInvocation invocation1 = invocations.poll(); - assertEquals(Map.of("arg", "World"), invocation1.args); - invocation1.complete("Hello, World!"); - assertEquals("Hello, World!", waitOn(future1)); - // Should not have to wait - assertEquals("Hello, World!", waitOn(avail.fetchAttribute("greet(World)"))); - assertEquals(0, invocations.count.get().intValue()); - - // Flush the cache - waitOn(avail.fetchAttributes(RefreshBehavior.REFRESH_ALWAYS)); - CompletableFuture future2 = avail.fetchAttribute("greet(World)"); - waitOn(invocations.count.waitValue(1)); - TestMethodInvocation invocation2 = invocations.poll(); - invocation2.complete("Hello, World?"); - assertEquals("Hello, World?", waitOn(future2)); - - waitOn(client.close()); - } - } - - @Test - public void testMethodParametersOrderPreserved() throws Throwable { - AsynchronousSocketChannel socket = socketChannel(); - try (ServerRunner runner = new ServerRunner()) { - GadpClient client = new GadpClient("Test", socket); - waitOn(AsyncUtils.completable(TypeSpec.VOID, socket::connect, - runner.server.getLocalAddress())); - waitOn(client.connect()); - TargetObject greet = - waitOn(client.fetchModelObject(PathUtils.parse("Available.bigGreet"))); - assertTrue(greet.getInterfaceNames().contains("Method")); - TargetMethod method = greet.as(TargetMethod.class); - - TargetParameterMap params = method.getParameters(); - assertEquals(ORDERED_PARAMS, params); - - assertEquals("HelmoWprnd", - params.values().stream().map(p -> p.name).collect(Collectors.joining())); - - assertNull(params.get("H").defaultValue); - assertEquals("", params.get("e").defaultValue); - - waitOn(client.close()); - } - finally { - socket.close(); - } - } - - @Test - public void testListRoot() throws Throwable { - AsynchronousSocketChannel socket = socketChannel(); - try (ServerRunner runner = new ServerRunner()) { - GadpClient client = new GadpClient("Test", socket); - waitOn(AsyncUtils.completable(TypeSpec.VOID, socket::connect, - runner.server.getLocalAddress())); - waitOn(client.connect()); - Map elements = - waitOn(client.fetchObjectElements(List.of())); - assertEquals(0, elements.size()); - Map attributes = waitOn(client.fetchObjectAttributes(List.of())); - assertEquals(Set.of("Processes", "Available", TargetObject.DISPLAY_ATTRIBUTE_NAME, - TargetFocusScope.FOCUS_ATTRIBUTE_NAME), attributes.keySet()); - Object procContAttr = attributes.get("Processes"); - TargetObject procCont = (TargetObject) procContAttr; - assertEquals(List.of("Processes"), procCont.getPath()); - waitOn(client.close()); - } - finally { - socket.close(); - } - } - - @Test - public void testLaunch() throws Throwable { - AsynchronousSocketChannel socket = socketChannel(); - try (ServerRunner runner = new ServerRunner()) { - GadpClient client = new GadpClient("Test", socket); - waitOn(AsyncUtils.completable(TypeSpec.VOID, socket::connect, - runner.server.getLocalAddress())); - waitOn(client.connect()); - TargetObject procCont = waitOn(client.fetchModelObject(List.of("Processes"))); - assertTrue(procCont.getInterfaceNames().contains("Launcher")); - TargetLauncher launcher = procCont.as(TargetLauncher.class); - waitOn(launcher.launch( - Map.of(TargetCmdLineLauncher.CMDLINE_ARGS_NAME, "/bin/echo Hello, World!"))); - waitOn(client.close()); - } - finally { - socket.close(); - } - - assertEquals(Map.of(TargetCmdLineLauncher.CMDLINE_ARGS_NAME, "/bin/echo Hello, World!"), - launches.poll()); - assertNull(launches.poll()); - } - - @Test - public void testGetAvailableWithObjectGettingListener() throws Throwable { - var l = new Object() { - TargetObject avail; - }; - List invocations = new ArrayList<>(); - // Any listener which calls .get on a child ref would do.... - // This object-getting listener is the pattern that revealed this problem, though. - DebuggerModelListener listener = new DebuggerModelListener() { - @Override - public void elementsChanged(TargetObject parent, Collection removed, - Map added) { - if (parent != l.avail) { - return; - } - invocations.add(new ElementsChangedInvocation(parent, removed, added)); - } - }; - AsynchronousSocketChannel socket = socketChannel(); - try (ServerRunner runner = new ServerRunner()) { - GadpClient client = new GadpClient("Test", socket); - client.addModelListener(listener); - waitOn(AsyncUtils.completable(TypeSpec.VOID, socket::connect, - runner.server.getLocalAddress())); - waitOn(client.connect()); - l.avail = waitOn(client.fetchModelObject(List.of("Available"))); - Map elements = waitOn(l.avail.fetchElements()); - Msg.debug(this, "Elements: " + elements); - waitOn(client.close()); - } - finally { - socket.close(); - } - } - - @Test - public void testFocus() throws Throwable { - // Interesting because it involves a non-object-valued attribute (link) - // Need to check callback as well as getAttributes - var l = new Object() { - TargetObject session; - }; - CompletableFuture> focusPath = new CompletableFuture<>(); - AtomicBoolean failed = new AtomicBoolean(); - DebuggerModelListener focusListener = - new AnnotatedDebuggerAttributeListener(MethodHandles.lookup()) { - @AttributeCallback(TargetFocusScope.FOCUS_ATTRIBUTE_NAME) - public void focusChanged(TargetObject object, TargetObject focused) { - if (object != l.session) { - return; - } - Msg.info(this, "Focus changed to " + focused); - if (!focusPath.complete(focused.getPath())) { - failed.set(true); - } - } - }; - AsynchronousSocketChannel socket = socketChannel(); - try (ServerRunner runner = new ServerRunner()) { - GadpClient client = new GadpClient("Test", socket); - client.addModelListener(focusListener); - - waitOn(AsyncUtils.completable(TypeSpec.VOID, socket::connect, - runner.server.getLocalAddress())); - waitOn(client.connect()); - l.session = waitOn(client.fetchModelObject(List.of())); - TargetObject procCont = waitOn(client.fetchModelObject(List.of("Processes"))); - assertTrue(procCont.getInterfaceNames().contains("Launcher")); - TargetLauncher launcher = procCont.as(TargetLauncher.class); - waitOn(launcher.launch( - Map.of(TargetCmdLineLauncher.CMDLINE_ARGS_NAME, "/bin/echo Hello, World!"))); - launches.clear(); // Don't care. Just free it up. - Map attrs = waitOn(client.fetchObjectAttributes(List.of())); - assertTrue(attrs.containsKey(TargetFocusScope.FOCUS_ATTRIBUTE_NAME)); - TargetObject focus = (TargetObject) attrs.get(TargetFocusScope.FOCUS_ATTRIBUTE_NAME); - // NOTE: Could be actual object, but need not be - assertEquals(List.of("Processes", "[0]"), focus.getPath()); - waitOn(focusPath); - waitOn(client.close()); - - assertFalse(failed.get()); - } - finally { - socket.close(); - } - assertEquals(List.of("Processes", "[0]"), focusPath.getNow(null)); - } - - @Test - public void testSubscribeNoSuchPath() throws Throwable { - AsynchronousSocketChannel socket = socketChannel(); - try (ServerRunner runner = new ServerRunner()) { - GadpClient client = new GadpClient("Test", socket); - waitOn(AsyncUtils.completable(TypeSpec.VOID, socket::connect, - runner.server.getLocalAddress())); - waitOn(client.connect()); - assertNull(waitOn(client.fetchModelObject(List.of("NotHere")))); - } - finally { - socket.close(); - } - } - - @Test - public void testSubscribeLaunchForChildrenChanged() throws Throwable { - var l = new Object() { - TargetObject procContainer; - }; - ElementsChangedListener elemL = new ElementsChangedListener() { - @Override - public void elementsChanged(TargetObject parent, Collection removed, - Map added) { - if (parent != l.procContainer) { - return; - } - super.elementsChanged(parent, removed, added); - } - }; - - AsynchronousSocketChannel socket = socketChannel(); - try (ServerRunner runner = new ServerRunner()) { - GadpClient client = new GadpClient("Test", socket); - client.addModelListener(elemL); - waitOn(AsyncUtils.completable(TypeSpec.VOID, socket::connect, - runner.server.getLocalAddress())); - waitOn(client.connect()); - l.procContainer = waitOn(client.fetchModelObject(List.of("Processes"))); - assertTrue(l.procContainer.getInterfaceNames().contains("Launcher")); - TargetLauncher launcher = l.procContainer.as(TargetLauncher.class); - waitOn(launcher.launch( - Map.of(TargetCmdLineLauncher.CMDLINE_ARGS_NAME, "/bin/echo Hello, World!"))); - waitOn(elemL.count.waitValue(1)); - - waitOn(client.close()); - - assertEquals(1, elemL.invocations.size()); - ElementsChangedInvocation eci = elemL.invocations.get(0); - assertEquals(l.procContainer, eci.parent); - assertEquals(List.of(), List.copyOf(eci.removed)); - assertEquals(1, eci.added.size()); - Entry ent = eci.added.entrySet().iterator().next(); - assertEquals("0", ent.getKey()); - assertEquals(List.of("Processes", "[0]"), ent.getValue().getPath()); - } - finally { - socket.close(); - } - } - - @Test - public void testReplaceElement() throws Throwable { - ElementsChangedListener elemL = new ElementsChangedListener(); - InvalidatedListener invL = new InvalidatedListener(); - - try (AsynchronousSocketChannel socket = socketChannel(); - ServerRunner runner = new ServerRunner()) { - GadpClient client = new GadpClient("Test", socket); - waitOn(AsyncUtils.completable(TypeSpec.VOID, socket::connect, - runner.server.getLocalAddress())); - waitOn(client.connect()); - - populateAvailableAndSync(client, runner); - TargetObject availCont = client.getModelObject(PathUtils.parse("Available")); - - client.addModelListener(elemL); - client.addModelListener(invL); - - Map avail1 = availCont.getCachedElements(); - elemL.clear(); - TestGadpTargetAvailableContainer ssAvail = runner.server.model.session.available; - ssAvail.setElements(List.of(new TestGadpTargetAvailable(ssAvail, 1, "cat") // - ), "Changed"); - - waitOn(invL.count.waitUntil(c -> c >= 2)); - waitOn(elemL.count.waitUntil(c -> c >= 2)); - - for (TargetObject a : avail1.values()) { - assertFalse(a.isValid()); - } - - Map avail2 = availCont.getCachedElements(); - assertEquals(1, avail2.size()); - assertEquals("cat", avail2.get("1").getCachedAttribute("cmd")); - - ElementsChangedInvocation removed = elemL.invocations.remove(); - assertSame(availCont, removed.parent); - assertEquals(Map.of(), removed.added); - assertEquals(Set.of("1"), Set.copyOf(removed.removed)); - - ElementsChangedInvocation changed = Unique.assertOne(elemL.invocations); - assertSame(availCont, changed.parent); - assertEquals(Set.of("1"), changed.added.keySet()); - assertEquals(Set.of("2"), Set.copyOf(changed.removed)); - assertSame(avail2.get("1"), Unique.assertOne(changed.added.values())); - - Map, String> actualInv = invL.invocations.stream() - .collect(Collectors.toMap(ii -> ID.of(ii.object), ii -> ii.reason)); - Map, String> expectedInv = - Map.ofEntries(Map.entry(ID.of(avail1.get("1")), "Replaced"), - Map.entry(ID.of(avail1.get("2")), "Changed")); - assertEquals(expectedInv, actualInv); - } - } - - @Test - public void testReplaceAttribute() throws Throwable { - var l = new Object() { - TargetObject echoAvail; - }; - AttributesChangedListener attrL = new AttributesChangedListener() { - @Override - public void attributesChanged(TargetObject parent, Collection removed, - Map added) { - if (parent != l.echoAvail) { - return; - } - super.attributesChanged(parent, removed, added); - } - }; - - try (AsynchronousSocketChannel socket = socketChannel(); - ServerRunner runner = new ServerRunner()) { - GadpClient client = new GadpClient("Test", socket); - client.addModelListener(attrL); - waitOn(AsyncUtils.completable(TypeSpec.VOID, socket::connect, - runner.server.getLocalAddress())); - waitOn(client.connect()); - - l.echoAvail = waitOn(client.fetchModelObject(PathUtils.parse("Available[1]"))); - assertEquals(Map.ofEntries(Map.entry("pid", 1), Map.entry("cmd", "echo"), - Map.entry("_display", "[1]")), waitOn(l.echoAvail.fetchAttributes())); - - TestGadpTargetAvailable ssEchoAvail = - runner.server.model.session.available.getCachedElements().get("1"); - - ssEchoAvail.changeAttributes(List.of("pid"), - Map.ofEntries(Map.entry("cmd", "echo"), Map.entry("args", "Hello, World!")), - "Changed"); - - waitOn(attrL.count.waitValue(1)); - - assertEquals(Map.ofEntries(Map.entry("cmd", "echo"), Map.entry("args", "Hello, World!"), - Map.entry("_display", "[1]")), l.echoAvail.getCachedAttributes()); - - AttributesChangedInvocation changed = Unique.assertOne(attrL.invocations); - assertSame(l.echoAvail, changed.parent); - assertEquals(Set.of("pid"), Set.copyOf(changed.removed)); - assertEquals(Map.ofEntries(Map.entry("args", "Hello, World!")), changed.added); - } - } - - @Test - public void testSubtreeInvalidationDeduped() throws Throwable { - InvalidatedListener invL = new InvalidatedListener(); - - try (AsynchronousSocketChannel socket = socketChannel(); - ServerRunner runner = new ServerRunner()) { - MonitoredGadpClient client = new MonitoredGadpClient("Test", socket); - waitOn(AsyncUtils.completable(TypeSpec.VOID, socket::connect, - runner.server.getLocalAddress())); - waitOn(client.connect()); - - populateAvailableAndSync(client, runner); - - client.addModelListener(invL); - client.getMessageChannel().clear(); - runner.server.model.session.changeAttributes(List.of("Available"), Map.of(), "Clear"); - - /** - * Yes, should see all invalidations for the user side, but only one message should be - * sent, for the root of the invalidated sub tree - */ - waitOn(invL.count.waitValue(4)); // NB: Available + {[1],[2],.greet} - // NB. Expect single invalidation message, followed by invalidation message - waitOn(client.getMessageChannel().count.waitUntil(v -> v >= 1)); - - assertEquals(Gadp.RootMessage.newBuilder() - .setEventNotification(Gadp.EventNotification.newBuilder() - .setPath(Gadp.Path.newBuilder().addAllE(List.of("Available"))) - .setObjectInvalidateEvent( - Gadp.ObjectInvalidateEvent.newBuilder().setReason("Clear"))) - .build(), - client.getMessageChannel().record.get(0).assertReceived()); - } - } - - protected void populateAvailableAndSync(DebuggerObjectModel client, ServerRunner runner) - throws Throwable { - // Cause these to exist - client.fetchModelValue(PathUtils.parse("Available[1]")); - client.fetchModelValue(PathUtils.parse("Available[2]")); - Map initEntries = Map.ofEntries(Map.entry("args", "Init")); - var syncL = new DebuggerModelListener() { - CompletableFuture here = new CompletableFuture<>(); - CompletableFuture init = new CompletableFuture<>(); - - @Override - public void attributesChanged(TargetObject object, Collection removed, - Map added) { - if ("Available[1]".equals(object.getJoinedPath("."))) { - if (added.entrySet().containsAll(initEntries.entrySet())) { - init.complete(null); - } - } - } - - @Override - public void elementsChanged(TargetObject object, Collection removed, - Map added) { - for (TargetObject obj : added.values()) { - if ("Available[1]".equals(obj.getJoinedPath("."))) { - here.complete(null); - } - } - } - }; - client.addModelListener(syncL, true); - - waitOn(syncL.here); - TestGadpTargetAvailable ssAvail1 = - runner.server.model.session.available.getCachedElements().get("1"); - ssAvail1.changeAttributes(List.of(), initEntries, "Changed"); - waitOn(syncL.init); - - client.removeModelListener(syncL); - } - - @Test - public void testNoEventsAfterInvalidated() throws Throwable { - AttributesChangedListener attrL = new AttributesChangedListener(); - - try (AsynchronousSocketChannel socket = socketChannel(); - ServerRunner runner = new ServerRunner()) { - GadpClient client = new GadpClient("Test", socket); - waitOn(AsyncUtils.completable(TypeSpec.VOID, socket::connect, - runner.server.getLocalAddress())); - waitOn(client.connect()); - - client.addModelListener(attrL); - - populateAvailableAndSync(client, runner); - // NB: copy - Map ssAvail = - runner.server.model.session.available.getCachedElements(); - TestGadpTargetAvailable ssAvail1 = ssAvail.get("1"); - TestGadpTargetAvailable ssAvail2 = ssAvail.get("2"); - - // Now, begin the actual test - var invL = new DebuggerModelListener() { - CompletableFuture gone = new CompletableFuture<>(); - - @Override - public void invalidated(TargetObject object, TargetObject branch, String reason) { - if ("Available[1]".equals(object.getJoinedPath("."))) { - gone.complete(null); - } - } - }; - client.addModelListener(invL, true); - runner.server.model.session.available.changeElements(List.of("1"), List.of(), Map.of(), - "1 is Gone"); - waitOn(invL.gone); - attrL.clear(); - - // Should produce nothing - ssAvail1.changeAttributes(List.of(), - Map.ofEntries(Map.entry("args", "Hello, World!")), "Changed"); - // Produce something, so we know we didn't get the other thing - Map expectedEntries = Map.ofEntries(Map.entry("args", "if=/dev/null")); - ssAvail2.changeAttributes(List.of(), List.of(), expectedEntries, "Observe"); - - waitOn(attrL.count.waitValue(1)); - - AttributesChangedInvocation changed = Unique.assertOne(attrL.invocations); - assertEquals("Available[2]", changed.parent.getJoinedPath(".")); - assertEquals(Set.of(), Set.copyOf(changed.removed)); - assertEquals(expectedEntries, changed.added); - } - } - - @Test - public void testProxyWithLinkedElements() throws Throwable { - AsynchronousSocketChannel socket = socketChannel(); - try (ServerRunner runner = new ServerRunner()) { - GadpClient client = new GadpClient("Test", socket); - waitOn(AsyncUtils.completable(TypeSpec.VOID, socket::connect, - runner.server.getLocalAddress())); - waitOn(client.connect()); - TargetObjectAddedWaiter waiter = new TargetObjectAddedWaiter(client); - runner.server.model.session.addLinks(); - TargetObject canonical = - (TargetObject) waitOn(waiter.wait(PathUtils.parse("Available[2]"))); - TargetObject link = (TargetObject) waitOn(waiter.wait(PathUtils.parse("Links[1]"))); - assertSame(canonical, link); - assertEquals(PathUtils.parse("Available[2]"), link.getPath()); - waitOn(client.close()); - waiter.close(); - } - finally { - socket.close(); - } - } - - @Test - public void testFetchModelValueFollowsLink() throws Throwable { - AsynchronousSocketChannel socket = socketChannel(); - try (ServerRunner runner = new ServerRunner()) { - GadpClient client = new GadpClient("Test", socket); - waitOn(AsyncUtils.completable(TypeSpec.VOID, socket::connect, - runner.server.getLocalAddress())); - waitOn(client.connect()); - TargetObjectAddedWaiter waiter = new TargetObjectAddedWaiter(client); - runner.server.model.session.addLinks(); - waitOn(waiter.wait(PathUtils.parse("Links[2]"))); - assertEquals("echo", waitOn(client.fetchModelValue(PathUtils.parse("Links[2].cmd")))); - waitOn(client.close()); - waiter.close(); - } - finally { - socket.close(); - } - } - - public static class EventListener implements DebuggerModelListener { - public static class CallEntry { - public final String methodName; - public final List args; - - public CallEntry(String methodName, List args) { - this.methodName = methodName; - this.args = args; - } - - @Override - public String toString() { - return String.format("", methodName, args); - } - - @Override - public int hashCode() { - return Objects.hash(methodName, args); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (!(obj instanceof CallEntry)) { - return false; - } - CallEntry that = (CallEntry) obj; - if (!Objects.equals(this.methodName, that.methodName)) { - return false; - } - if (!Objects.equals(this.args, that.args)) { - return false; - } - return true; - } - } - - public final List record = new ArrayList<>(); - - @Override - public void created(TargetObject object) { - record.add(new CallEntry("created", List.of(object))); - } - - @Override - public void attributesChanged(TargetObject parent, Collection removed, - Map added) { - record.add(new CallEntry("attributesChanged", List.of(parent, removed, added))); - } - - @Override - public void elementsChanged(TargetObject parent, Collection removed, - Map added) { - record.add(new CallEntry("elementsChanged", List.of(parent, removed, added))); - } - - @Override - public void rootAdded(TargetObject root) { - record.add(new CallEntry("rootAdded", List.of(root))); - } - } - - @Test - public void testConnectBeforeRootCreated() throws Throwable { - AsynchronousSocketChannel socket = socketChannel(); - try (ServerRunner runner = new ServerRunner() { - @Override - protected TestGadpServer createServer(SocketAddress addr) throws IOException { - return new TestGadpServer(new TestGadpObjectModel(false), addr); - } - }) { - GadpClient client = new PrintingGadpClient("Test", socket); - EventListener listener = new EventListener(); - client.addModelListener(listener, true); - waitOn(AsyncUtils.completable(TypeSpec.VOID, socket::connect, - runner.server.getLocalAddress())); - waitOn(client.connect()); - - DefaultTargetObject root = - new DefaultTargetModelRoot(runner.server.model, "Root"); - DefaultTargetObject a = - new DefaultTargetObject<>(runner.server.model, root, "a", "A"); - a.changeAttributes(List.of(), Map.of("test", 6), "Because"); - root.changeAttributes(List.of(), List.of(a), Map.of(), "Because"); - runner.server.model.addModelRoot(root); - waitOn(client.fetchModelRoot()); - waitOn(client.flushEvents()); - - assertEquals(List.of(new CallEntry("created", List.of(client.getModelRoot())), - new CallEntry("attributesChanged", - List.of(client.getModelRoot(), Set.of(), - Map.ofEntries(Map.entry("_display", "")))), - new CallEntry("created", List.of(client.getModelObject(PathUtils.parse("a")))), - new CallEntry("attributesChanged", - List.of(client.getModelObject(PathUtils.parse("a")), Set.of(), - Map.ofEntries(Map.entry("_display", "a")))), - new CallEntry("attributesChanged", - List.of(client.getModelObject(PathUtils.parse("a")), Set.of(), - Map.ofEntries(Map.entry("test", 6)))), - new CallEntry("attributesChanged", - List.of(client.getModelRoot(), Set.of(), - Map.ofEntries( - Map.entry("a", client.getModelObject(PathUtils.parse("a")))))), - new CallEntry("rootAdded", List.of(client.getModelRoot()))), listener.record); - } - } - - @Test - public void testConnectBetweenRootCreatedAndAdded() throws Throwable { - AsynchronousSocketChannel socket = socketChannel(); - try (ServerRunner runner = new ServerRunner() { - @Override - protected TestGadpServer createServer(SocketAddress addr) throws IOException { - return new TestGadpServer(new TestGadpObjectModel(false), addr); - } - }) { - GadpClient client = new PrintingGadpClient("Test", socket); - EventListener listener = new EventListener(); - client.addModelListener(listener, true); - - DefaultTargetObject root = - new DefaultTargetModelRoot(runner.server.model, "Root"); - DefaultTargetObject a = - new DefaultTargetObject<>(runner.server.model, root, "a", "A"); - a.changeAttributes(List.of(), Map.of("test", 6), "Because"); - - waitOn(AsyncUtils.completable(TypeSpec.VOID, socket::connect, - runner.server.getLocalAddress())); - waitOn(client.connect()); - - root.changeAttributes(List.of(), List.of(a), Map.of(), "Because"); - runner.server.model.addModelRoot(root); - waitOn(client.fetchModelRoot()); - waitOn(client.flushEvents()); - - assertEquals(List.of(new CallEntry("created", List.of(client.getModelRoot())), - new CallEntry("attributesChanged", - List.of(client.getModelRoot(), Set.of(), - Map.ofEntries(Map.entry("_display", "")))), - new CallEntry("created", List.of(client.getModelObject(PathUtils.parse("a")))), - new CallEntry("attributesChanged", - List.of(client.getModelObject(PathUtils.parse("a")), Set.of(), - Map.ofEntries(Map.entry("_display", "a")))), - new CallEntry("attributesChanged", - List.of(client.getModelObject(PathUtils.parse("a")), Set.of(), - Map.ofEntries(Map.entry("test", 6)))), - new CallEntry("attributesChanged", - List.of(client.getModelRoot(), Set.of(), - Map.ofEntries( - Map.entry("a", client.getModelObject(PathUtils.parse("a")))))), - new CallEntry("rootAdded", List.of(client.getModelRoot()))), listener.record); - } - } - - @Test - public void testConnectAfterRootAdded() throws Throwable { - AsynchronousSocketChannel socket = socketChannel(); - try (ServerRunner runner = new ServerRunner() { - @Override - protected TestGadpServer createServer(SocketAddress addr) throws IOException { - return new TestGadpServer(new TestGadpObjectModel(false), addr); - } - }) { - - GadpClient client = new PrintingGadpClient("Test", socket); - EventListener listener = new EventListener(); - client.addModelListener(listener, true); - - DefaultTargetObject root = - new DefaultTargetModelRoot(runner.server.model, "Root"); - DefaultTargetObject a = - new DefaultTargetObject<>(runner.server.model, root, "a", "A"); - a.changeAttributes(List.of(), Map.of("test", 6), "Because"); - root.changeAttributes(List.of(), List.of(a), Map.of(), "Because"); - runner.server.model.addModelRoot(root); - waitOn(runner.server.model.flushEvents()); - - waitOn(AsyncUtils.completable(TypeSpec.VOID, socket::connect, - runner.server.getLocalAddress())); - waitOn(client.connect()); - waitOn(client.fetchModelRoot()); - waitOn(client.flushEvents()); - - assertEquals(List.of(new CallEntry("created", List.of(client.getModelRoot())), - new CallEntry("attributesChanged", List.of( // Defaults upon client-side construction - client.getModelRoot(), Set.of(), - Map.ofEntries(Map.entry("_display", "")))), - new CallEntry("created", List.of(client.getModelObject(PathUtils.parse("a")))), - new CallEntry("attributesChanged", List.of( // Defaults - client.getModelObject(PathUtils.parse("a")), Set.of(), - Map.ofEntries(Map.entry("_display", "a")))), - new CallEntry("attributesChanged", - List.of(client.getModelObject(PathUtils.parse("a")), Set.of(), - Map.ofEntries(Map.entry("test", 6)))), - new CallEntry("attributesChanged", - List.of(client.getModelRoot(), Set.of(), - Map.ofEntries( - Map.entry("a", client.getModelObject(PathUtils.parse("a")))))), - new CallEntry("rootAdded", List.of(client.getModelRoot()))), listener.record); - } - } - - @Test - public void testWriteConfigurationOption() throws Throwable { - AsynchronousSocketChannel socket = socketChannel(); - try (ServerRunner runner = new ServerRunner()) { - GadpClient client = new PrintingGadpClient("Test", socket); - - try (TargetObjectAddedWaiter waiter = new TargetObjectAddedWaiter(client)) { - waitOn(AsyncUtils.completable(TypeSpec.VOID, socket::connect, - runner.server.getLocalAddress())); - waitOn(client.connect()); - - TargetObject procs = - (TargetObject) waitOn(waiter.wait(PathUtils.parse("Processes"))); - waitOn(((TargetConfigurable) procs).writeConfigurationOption( - TestGadpTargetProcessContainer.BASE_ATTRIBUTE_NAME, 8)); - waitOn(((TargetLauncher) procs).launch(Map.ofEntries(Map.entry("pid", 1000L)))); - - TargetProcess p1000 = - (TargetProcess) waitOn(waiter.wait(PathUtils.parse("Processes[1000]"))); - - assertEquals("1750", p1000.getDisplay()); - - waitOn(((TargetConfigurable) procs).writeConfigurationOption( - TestGadpTargetProcessContainer.BASE_ATTRIBUTE_NAME, 10)); - - // NB. attribute change should arrive before completion of write - assertEquals("1000", p1000.getDisplay()); - } - } - } -} diff --git a/Ghidra/Debug/Debugger-gadp/src/test/java/ghidra/dbg/gadp/client/GadpClientTest.java b/Ghidra/Debug/Debugger-gadp/src/test/java/ghidra/dbg/gadp/client/GadpClientTest.java deleted file mode 100644 index 62db61b01e..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/test/java/ghidra/dbg/gadp/client/GadpClientTest.java +++ /dev/null @@ -1,412 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import static org.junit.Assert.assertEquals; - -import java.io.IOException; -import java.net.InetSocketAddress; -import java.net.SocketAddress; -import java.nio.BufferUnderflowException; -import java.nio.ByteBuffer; -import java.nio.channels.*; -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.TimeoutException; - -import org.junit.Ignore; -import org.junit.Test; - -import ghidra.async.*; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.gadp.GadpVersion; -import ghidra.dbg.gadp.protocol.Gadp; -import ghidra.dbg.gadp.util.AsyncProtobufMessageChannel; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; -import ghidra.dbg.target.schema.TargetObjectSchema.SchemaName; -import ghidra.dbg.util.PathUtils; -import ghidra.util.Msg; - -@Ignore("deprecated") -public class GadpClientTest implements AsyncTestUtils { - private static final String HELLO_WORLD = "Hello, World!"; - private static final String TEST_HOST = "localhost"; - - public static final DefaultSchemaContext SCHEMA_CONTEXT = new DefaultSchemaContext(); - public static final TargetObjectSchema ROOT_SCHEMA = - SCHEMA_CONTEXT.builder(new SchemaName("Root")) - .setAttributeResyncMode(ResyncMode.ONCE) - .buildAndAdd(); - - interface TestClientHandler { - void handle(SocketChannel cli, GadpVersion version) throws Exception; - } - - class TestServer implements AutoCloseable { - private final ServerSocketChannel srv; - private final SocketAddress addr; - private SocketChannel cli; - private int seqno = 0; - - private final ByteBuffer inbuf = ByteBuffer.allocate(1024); - private final ByteBuffer outbuf = ByteBuffer.allocate(1024); - - public TestServer() throws IOException { - this.srv = ServerSocketChannel.open(); - this.srv.bind(new InetSocketAddress(TEST_HOST, 0), 1); - this.addr = this.srv.getLocalAddress(); - } - - @Override - public void close() throws Exception { - //cli.configureBlocking(false); // Cannot wait forever - assertEquals(-1, cli.read(inbuf)); - cli.close(); - srv.close(); - } - - public void accept() throws IOException { - this.cli = srv.accept(); - cli.configureBlocking(false); // Cannot wait forever - } - - public void nextSeq() { - seqno++; - } - - public void expect(Gadp.RootMessage msg) throws Throwable { - long start = System.currentTimeMillis(); - Msg.debug(this, "Expecting: " + msg); - - while (true) { - try { - //dumpBuffer(inbuf); - Gadp.RootMessage recv = - AsyncProtobufMessageChannel.unmarshall(Gadp.RootMessage::parseFrom, inbuf); - - Msg.trace(this, "Server Received: " + recv); - assertEquals(msg, recv); - return; - } - catch (BufferUnderflowException e) { - Msg.trace(this, "Waiting for data. Currently have " + inbuf.position()); - Thread.yield(); - if (Thread.interrupted()) { - return; - } - int len = cli.read(inbuf); - Msg.trace(this, "Read " + len + " bytes"); - if (len < 0) { - throw new AssertionError("Socket is closed"); - } - else if (len == 0) { - if (Long.compareUnsigned(System.currentTimeMillis() - start, - TIMEOUT_MS) > 0) { - throw new TimeoutException("Timeout out expecting: " + msg); - } - Thread.sleep(100); - } - } - } - } - - public void send(Gadp.RootMessage msg) throws IOException { - Msg.debug(this, "Server Sending: " + msg); - outbuf.clear(); - AsyncProtobufMessageChannel.marshall(msg, outbuf); - outbuf.flip(); - while (outbuf.hasRemaining()) { - if (Thread.interrupted()) { - return; - } - cli.write(outbuf); - } - } - - public void expectRequestConnect() throws Throwable { - expect(Gadp.RootMessage.newBuilder() - .setSequence(seqno) - .setConnectRequest(GadpVersion.makeRequest()) - .build()); - } - - public void sendReplyConnect(GadpVersion version) throws IOException { - - send(Gadp.RootMessage.newBuilder() - .setSequence(seqno) - .setConnectReply(Gadp.ConnectReply.newBuilder() - .setVersion(version.getName()) - .setSchemaContext(XmlSchemaContext.serialize(SCHEMA_CONTEXT)) - .setRootSchema(ROOT_SCHEMA.getName().toString())) - .build()); - } - - public void handleConnect(GadpVersion version) throws Throwable { - expectRequestConnect(); - sendReplyConnect(version); - nextSeq(); - } - - public void sendNotifyObjectCreated(List path, List interfaces, - String typeHint) throws IOException { - send(Gadp.RootMessage.newBuilder() - .setSequence(seqno) - .setEventNotification(Gadp.EventNotification.newBuilder() - .setPath(GadpValueUtils.makePath(path)) - .setObjectCreatedEvent(Gadp.ObjectCreatedEvent.newBuilder() - .addAllInterface(interfaces) - .setTypeHint(typeHint))) - .build()); - } - - public void sendNotifyRootAdded() throws IOException { - send(Gadp.RootMessage.newBuilder() - .setSequence(seqno) - .setEventNotification(Gadp.EventNotification.newBuilder() - .setRootAddedEvent(Gadp.RootAddedEvent.getDefaultInstance())) - .build()); - } - - public void notifyAddRoot() throws IOException { - sendNotifyObjectCreated(List.of(), List.of(), "Root"); - sendNotifyRootAdded(); - } - - public void expectRequestPing(String content) throws Throwable { - expect(Gadp.RootMessage.newBuilder() - .setSequence(seqno) - .setPingRequest(Gadp.PingRequest.newBuilder() - .setContent(content)) - .build()); - } - - public void sendReplyPing(String content) throws IOException { - send(Gadp.RootMessage.newBuilder() - .setSequence(seqno) - .setPingReply(Gadp.PingReply.newBuilder() - .setContent(content)) - .build()); - } - - public void handlePing() throws Throwable { - expectRequestPing(HELLO_WORLD); - sendReplyPing(HELLO_WORLD); - nextSeq(); - } - - public Gadp.ModelObjectDelta.Builder makeAttributeDelta(List parentPath, - Map primitives, Map> objects) { - Gadp.ModelObjectDelta.Builder delta = Gadp.ModelObjectDelta.newBuilder(); - if (primitives != null) { - for (Map.Entry ent : primitives.entrySet()) { - delta.addAdded(GadpValueUtils.makeNamedValue(parentPath, ent)); - } - } - if (objects != null) { - for (Map.Entry> ent : objects.entrySet()) { - if (PathUtils.isLink(parentPath, ent.getKey(), ent.getValue())) { - delta.addAdded(Gadp.NamedValue.newBuilder() - .setName(ent.getKey()) - .setValue(Gadp.Value.newBuilder() - .setPathValue(GadpValueUtils.makePath(ent.getValue())))); - } - else { - delta.addAdded(Gadp.NamedValue.newBuilder() - .setName(ent.getKey()) - .setValue(Gadp.Value.newBuilder() - .setObjectStub(Gadp.ModelObjectStub.getDefaultInstance()))); - } - } - } - return delta; - } - - public Gadp.ModelObjectDelta.Builder makeElementDelta(List parentPath, - Map> objects) { - Gadp.ModelObjectDelta.Builder delta = Gadp.ModelObjectDelta.newBuilder(); - if (objects != null) { - for (Map.Entry> ent : objects.entrySet()) { - if (PathUtils.isElementLink(parentPath, ent.getKey(), ent.getValue())) { - delta.addAdded(Gadp.NamedValue.newBuilder() - .setName(ent.getKey()) - .setValue(Gadp.Value.newBuilder() - .setPathValue(GadpValueUtils.makePath(ent.getValue())))); - } - else { - delta.addAdded(Gadp.NamedValue.newBuilder() - .setName(ent.getKey()) - .setValue(Gadp.Value.newBuilder() - .setObjectStub(Gadp.ModelObjectStub.getDefaultInstance()))); - } - } - } - return delta; - } - - public void expectRequestResync(List path, boolean refreshAttributes, - boolean refreshElements) throws Throwable { - expect(Gadp.RootMessage.newBuilder() - .setSequence(seqno) - .setResyncRequest(Gadp.ResyncRequest.newBuilder() - .setPath(GadpValueUtils.makePath(path)) - .setAttributes(refreshAttributes) - .setElements(refreshElements)) - .build()); - } - - public void sendNotifyObjects(List parentPath, Map> elements, - Map> attrObjects, Map attrPrimitives) - throws IOException { - send(Gadp.RootMessage.newBuilder() - .setSequence(seqno) - .setEventNotification(Gadp.EventNotification.newBuilder() - .setPath(GadpValueUtils.makePath(parentPath)) - .setModelObjectEvent(Gadp.ModelObjectEvent.newBuilder() - .setAttributeDelta( - makeAttributeDelta(parentPath, attrPrimitives, - attrObjects)) - .setElementDelta(makeElementDelta(parentPath, elements)))) - .build()); - } - - public void sendReplyResync() throws IOException { - send(Gadp.RootMessage.newBuilder() - .setSequence(seqno) - .setResyncReply(Gadp.ResyncReply.getDefaultInstance()) - .build()); - } - - public void handleResyncAttributes(List path, boolean refresh, - Map> objects, Map primitives) - throws Throwable { - expectRequestResync(path, refresh, false); - if (primitives != null || objects != null) { - sendNotifyObjects(path, null, objects, primitives); - } - sendReplyResync(); - nextSeq(); - } - - public void handleResyncElements(List path, boolean refresh, - Map> objects) throws Throwable { - expectRequestResync(path, false, refresh); - if (objects != null) { - sendNotifyObjects(path, objects, null, null); - } - sendReplyResync(); - nextSeq(); - } - } - - protected void dumpBuffer(ByteBuffer buf) { - for (byte b : buf.array()) { - System.err.print(String.format("%02x", b)); - } - System.err.println(); - for (int i = 0; i < buf.position(); i++) { - System.err.print(" "); - } - System.err.print("^ "); - if (!buf.hasRemaining()) { - System.err.println("(empty)"); - } - else { - for (int i = buf.position() + 2; i < buf.limit(); i++) { - System.err.print(" "); - } - System.err.println(" |"); - } - } - - protected void seqConnectDisconnect(SocketChannel cli, GadpVersion version) { - // Nothing to add - } - - @Test - public void testConnectDisconnect() throws Throwable { - try (TestServer srv = new TestServer(); - AsynchronousSocketChannel socket = AsynchronousSocketChannel.open()) { - GadpClient client = new GadpClient("Test", socket); - - CompletableFuture sockConnect = - AsyncUtils.completable(TypeSpec.VOID, socket::connect, srv.addr); - srv.accept(); - waitOn(sockConnect); - - CompletableFuture gadpConnect = client.connect(); - srv.handleConnect(GadpVersion.VER1); - waitOn(gadpConnect); - - waitOn(client.close()); - } - } - - @Test - public void testPing() throws Throwable { - try (TestServer srv = new TestServer(); - AsynchronousSocketChannel socket = AsynchronousSocketChannel.open()) { - GadpClient client = new GadpClient("Test", socket); - - CompletableFuture sockConnect = - AsyncUtils.completable(TypeSpec.VOID, socket::connect, srv.addr); - srv.accept(); - waitOn(sockConnect); - - CompletableFuture gadpConnect = client.connect(); - srv.handleConnect(GadpVersion.VER1); - waitOn(gadpConnect); - - CompletableFuture ping = client.ping(HELLO_WORLD); - srv.handlePing(); - waitOn(ping); - - waitOn(client.close()); - } - } - - @Test - public void testResyncOnceModelValueDeduped() throws Throwable { - try (TestServer srv = new TestServer(); - AsynchronousSocketChannel socket = AsynchronousSocketChannel.open()) { - GadpClient client = new GadpClient("Test", socket); - - CompletableFuture sockConnect = - AsyncUtils.completable(TypeSpec.VOID, socket::connect, srv.addr); - srv.accept(); - waitOn(sockConnect); - - CompletableFuture gadpConnect = client.connect(); - srv.handleConnect(GadpVersion.VER1); - waitOn(gadpConnect); - CompletableFuture cfRoot = client.fetchModelRoot(); - srv.notifyAddRoot(); - waitOn(cfRoot); - - CompletableFuture fetchVal1 = client.fetchModelValue(PathUtils.parse("value")); - CompletableFuture fetchVal2 = client.fetchModelValue(PathUtils.parse("value")); - srv.handleResyncAttributes(List.of(), false, null, Map.of("value", HELLO_WORLD)); - assertEquals(HELLO_WORLD, waitOn(fetchVal1)); - assertEquals(HELLO_WORLD, waitOn(fetchVal2)); - - CompletableFuture fetchVal3 = - client.fetchModelValue(PathUtils.parse("value"), RefreshBehavior.REFRESH_ALWAYS); - srv.handleResyncAttributes(List.of(), true, null, Map.of("value", "Hi")); - assertEquals("Hi", waitOn(fetchVal3)); - } - } -} diff --git a/Ghidra/Debug/Debugger-gadp/src/test/java/ghidra/dbg/gadp/client/GadpClientTestHelper.java b/Ghidra/Debug/Debugger-gadp/src/test/java/ghidra/dbg/gadp/client/GadpClientTestHelper.java deleted file mode 100644 index 14335c1ea5..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/test/java/ghidra/dbg/gadp/client/GadpClientTestHelper.java +++ /dev/null @@ -1,31 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.client; - -import java.util.concurrent.CompletableFuture; - -import com.google.protobuf.Message; - -/** - * A means for tests to access package members of {@link GadpClient} - */ -public enum GadpClientTestHelper { - ; - public static CompletableFuture sendChecked(GadpClient client, - Message.Builder req, MI exampleRep) { - return client.sendChecked(req, exampleRep); - } -} diff --git a/Ghidra/Debug/Debugger-gadp/src/test/java/ghidra/dbg/gadp/util/AsyncProtobufMessageChannelTest.java b/Ghidra/Debug/Debugger-gadp/src/test/java/ghidra/dbg/gadp/util/AsyncProtobufMessageChannelTest.java deleted file mode 100644 index 700e7f85f1..0000000000 --- a/Ghidra/Debug/Debugger-gadp/src/test/java/ghidra/dbg/gadp/util/AsyncProtobufMessageChannelTest.java +++ /dev/null @@ -1,190 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.gadp.util; - -import static org.junit.Assert.assertEquals; - -import java.io.IOException; -import java.nio.ByteBuffer; -import java.nio.channels.AsynchronousByteChannel; -import java.nio.channels.CompletionHandler; -import java.util.Arrays; -import java.util.concurrent.*; - -import org.junit.Ignore; -import org.junit.Test; - -import ghidra.async.*; -import ghidra.dbg.gadp.protocol.Gadp; -import ghidra.dbg.gadp.protocol.Gadp.RootMessage; -import ghidra.util.NumericUtilities; -import ghidra.util.SystemUtilities; - -@Ignore("deprecated") -public class AsyncProtobufMessageChannelTest { - public final static long TIMEOUT_MILLIS = - SystemUtilities.isInTestingBatchMode() ? 1000 : Long.MAX_VALUE; - - public static T get(CompletableFuture future) throws Exception { - return future.get(TIMEOUT_MILLIS, TimeUnit.MILLISECONDS); - } - - public static class AsyncFakeByteChannel implements AsynchronousByteChannel { - AsyncPairingQueue> readReqs = new AsyncPairingQueue<>(); - AsyncPairingQueue> writeReqs = new AsyncPairingQueue<>(); - - @Override - public void close() throws IOException { - } - - @Override - public boolean isOpen() { - return true; - } - - @Override - public void read(ByteBuffer dst, A attachment, - CompletionHandler handler) { - readReqs.give( - CompletableFuture.completedFuture(new ReadReq<>(dst, attachment, handler))); - } - - @Override - public Future read(ByteBuffer dst) { - return AsyncUtils.completable(TypeSpec.INT, this::read, dst); - } - - @Override - public void write(ByteBuffer src, A attachment, - CompletionHandler handler) { - writeReqs.give( - CompletableFuture.completedFuture(new WriteReq<>(src, attachment, handler))); - } - - @Override - public Future write(ByteBuffer src) { - return AsyncUtils.completable(TypeSpec.INT, this::write, src); - } - } - - public static class ReadReq { - private final ByteBuffer dst; - private final A attachment; - private final CompletionHandler handler; - - ReadReq(ByteBuffer dst, A attachment, CompletionHandler handler) { - this.dst = dst; - this.attachment = attachment; - this.handler = handler; - } - - void complete(byte[] src) { - dst.put(src); - handler.completed(src.length, attachment); - } - - void error(Throwable exc) { - handler.failed(exc, attachment); - } - } - - public static class WriteReq { - private final ByteBuffer src; - private final A attachment; - private final CompletionHandler handler; - - WriteReq(ByteBuffer src, A attachment, CompletionHandler handler) { - this.src = src; - this.attachment = attachment; - this.handler = handler; - } - - void complete(byte[] dst) { - src.get(dst); - handler.completed(dst.length, attachment); - } - - void error(Throwable exc) { - handler.failed(exc, attachment); - } - } - - AsyncFakeByteChannel byteChannel = new AsyncFakeByteChannel(); - - AsyncProtobufMessageChannel channel = - new AsyncProtobufMessageChannel<>(byteChannel, 1); - - @Test - public void testSendBufferGrows() throws Exception { - channel.write(Gadp.RootMessage.newBuilder().setSequence(0x12345678).build()); - - WriteReq wr = get(byteChannel.writeReqs.take()); - byte[] data = new byte[wr.src.remaining()]; - wr.complete(data); - assertEquals("0000000608f8acd19101", NumericUtilities.convertBytesToString(data)); - } - - @Test - public void testRecvBufferGrows() throws Exception { - byte[] data = - NumericUtilities.convertStringToBytes("0000000608f8acd191010000000608f8acd19101"); - CompletableFuture msg = channel.read(Gadp.RootMessage::parseFrom); - - ReadReq rd = get(byteChannel.readReqs.take()); - assertEquals(1, rd.dst.remaining()); - rd.complete(Arrays.copyOfRange(data, 0, 1)); - - rd = get(byteChannel.readReqs.take()); - assertEquals(0, rd.dst.remaining()); - rd.complete(Arrays.copyOfRange(data, 1, 1)); - - rd = get(byteChannel.readReqs.take()); - assertEquals(1, rd.dst.remaining()); - rd.complete(Arrays.copyOfRange(data, 1, 2)); - - rd = get(byteChannel.readReqs.take()); - assertEquals(0, rd.dst.remaining()); - rd.complete(Arrays.copyOfRange(data, 2, 2)); - - rd = get(byteChannel.readReqs.take()); - assertEquals(2, rd.dst.remaining()); - rd.complete(Arrays.copyOfRange(data, 2, 4)); - - rd = get(byteChannel.readReqs.take()); - assertEquals(0, rd.dst.remaining()); - rd.complete(Arrays.copyOfRange(data, 4, 4)); - - rd = get(byteChannel.readReqs.take()); - assertEquals(4, rd.dst.remaining()); - rd.complete(Arrays.copyOfRange(data, 4, 8)); - - rd = get(byteChannel.readReqs.take()); - assertEquals(0, rd.dst.remaining()); - rd.complete(Arrays.copyOfRange(data, 8, 8)); - - rd = get(byteChannel.readReqs.take()); - assertEquals(8, rd.dst.remaining()); - rd.complete(Arrays.copyOfRange(data, 8, 16)); - - assertEquals(Gadp.RootMessage.newBuilder().setSequence(0x12345678).build(), get(msg)); - - msg = channel.read(Gadp.RootMessage::parseFrom); - rd = get(byteChannel.readReqs.take()); - assertEquals(10, rd.dst.remaining()); - rd.complete(Arrays.copyOfRange(data, 6, 10)); - assertEquals(Gadp.RootMessage.newBuilder().setSequence(0x12345678).build(), get(msg)); - } -} diff --git a/Ghidra/Debug/Debugger-jpda/build.gradle b/Ghidra/Debug/Debugger-jpda/build.gradle index cd1b0d0b25..b35481f97b 100644 --- a/Ghidra/Debug/Debugger-jpda/build.gradle +++ b/Ghidra/Debug/Debugger-jpda/build.gradle @@ -24,10 +24,4 @@ eclipse.project.name = 'Debug Debugger-jpda' dependencies { api project(':Debugger-api') api project(':Debugger-rmi-trace') - api project(':Framework-AsyncComm') - api project(':Framework-Debugging') - api project(':ProposedUtils') - - testImplementation project(path: ':Framework-AsyncComm', configuration: 'testArtifacts') - testImplementation project(path: ':Framework-Debugging', configuration: 'testArtifacts') } diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/JdiDebuggerModelFactory.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/JdiDebuggerModelFactory.java deleted file mode 100644 index e70195beba..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/JdiDebuggerModelFactory.java +++ /dev/null @@ -1,37 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi; - -import java.util.concurrent.CompletableFuture; - -import ghidra.dbg.DebuggerModelFactory; -import ghidra.dbg.DebuggerObjectModel; -import ghidra.dbg.jdi.model.JdiModelImpl; -import ghidra.dbg.util.ConfigurableFactory.FactoryDescription; - -@FactoryDescription( - brief = "PROTOTYPE: JDWP (Java or Dalvik)", - htmlDetails = """ - Connect to a Java or Dalvik VM via JDWP. - This is the same debugging protocol used by most Java IDEs. - Support for debugging Java and Dalvik is still experimental.""") -public class JdiDebuggerModelFactory implements DebuggerModelFactory { - - @Override - public CompletableFuture build() { - return CompletableFuture.completedFuture(new JdiModelImpl()); - } -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/manager/JdiMemoryMapping.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/manager/JdiMemoryMapping.java deleted file mode 100644 index c3ff95ed3c..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/manager/JdiMemoryMapping.java +++ /dev/null @@ -1,20 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.manager; - -public interface JdiMemoryMapping { - -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/manager/JdiVMThreadGroup.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/manager/JdiVMThreadGroup.java deleted file mode 100644 index 61e596ff69..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/manager/JdiVMThreadGroup.java +++ /dev/null @@ -1,54 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.manager; - -public class JdiVMThreadGroup { - private final int iid; - private final String type; - private final Long pid; - private final Long exitCode; - private final String executable; - // TODO: cores - - public JdiVMThreadGroup(int iid, String type, Long pid, Long exitCode, - String executable) { - this.iid = iid; - this.type = type; - this.pid = pid; - this.exitCode = exitCode; - this.executable = executable; - } - - public int getInferiorId() { - return iid; - } - - public String getType() { - return type; - } - - public Long getPid() { - return pid; - } - - public Long getExitCode() { - return exitCode; - } - - public String getExecutable() { - return executable; - } -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelImpl.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelImpl.java deleted file mode 100644 index 2ca95eea33..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelImpl.java +++ /dev/null @@ -1,245 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model; - -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import com.sun.jdi.*; - -import ghidra.dbg.agent.AbstractDebuggerObjectModel; -import ghidra.dbg.jdi.manager.JdiManager; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.AnnotatedSchemaContext; -import ghidra.dbg.target.schema.TargetObjectSchema; -import ghidra.program.model.address.*; - -public class JdiModelImpl extends AbstractDebuggerObjectModel { - - protected JdiModelTargetRoot root; - protected final CompletableFuture completedRoot; - - public static final long BLOCK_SIZE = 0x1000L; - public static final long DEFAULT_SECTION = 0x0000L; - - protected static final AnnotatedSchemaContext SCHEMA_CTX = new AnnotatedSchemaContext(); - protected static final TargetObjectSchema ROOT_SCHEMA = - SCHEMA_CTX.getSchemaForClass(JdiModelTargetRoot.class); - - protected JdiManager jdi; - protected final AddressSpace ram = new GenericAddressSpace("ram", 64, AddressSpace.TYPE_RAM, 0); - protected Long ramIndex = Long.valueOf(0x1000L); - protected final AddressSpace pool = - new GenericAddressSpace("constantPool", 64, AddressSpace.TYPE_RAM, 0); - protected Long poolIndex = Long.valueOf(0x0L); - protected final AddressFactory addressFactory = - new DefaultAddressFactory(new AddressSpace[] { ram, pool }); - public AddressRangeImpl defaultRange; - - private Map addressRangeByMethod = new HashMap<>(); - private Map methodsByKey = new HashMap<>(); - private Map addressRangeByClass = new HashMap<>(); - - public JdiModelImpl() { - this.jdi = JdiManager.newInstance(); - //System.out.println(XmlSchemaContext.serialize(SCHEMA_CTX)); - this.root = new JdiModelTargetRoot(this, ROOT_SCHEMA); - //this.root = new JdiModelTargetRoot(this, EnumerableTargetObjectSchema.OBJECT); - this.completedRoot = CompletableFuture.completedFuture(root); - - Address start = ram.getAddress(0L); - this.defaultRange = new AddressRangeImpl(start, start.add(BLOCK_SIZE)); - addModelRoot(root); - } - - @Override - public CompletableFuture fetchModelRoot() { - return completedRoot; - } - - @Override - public TargetObjectSchema getRootSchema() { - return ROOT_SCHEMA; - } - - @Override - public String getBrief() { - return "JDI@" + Integer.toHexString(System.identityHashCode(this)); - } - - @Override - public AddressSpace getAddressSpace(String name) { - switch (name) { - case "ram": - return ram; - case "constantPool": - return pool; - default: - return null; - } - } - - @Override - public CompletableFuture close() { - jdi.terminate(); - return super.close(); - } - - public JdiModelTargetRoot getRoot() { - return root; - } - - public JdiManager getManager() { - return jdi; - } - - public static String methodToKey(Method method) { - return method.toString(); - } - - public void registerMethod(Method method) { - if (method == null) { - return; - } - if (!methodsByKey.containsValue(method)) { - methodsByKey.put(methodToKey(method), method); - } - if (!addressRangeByMethod.containsKey(methodToKey(method))) { - ReferenceType declaringType = method.declaringType(); - if (declaringType instanceof ClassType) { - JdiModelTargetVM targetVM = getTargetVM(declaringType); - JdiModelTargetReferenceType classRef = - (JdiModelTargetReferenceType) targetVM.getTargetObject(declaringType); - if (classRef != null) { - JdiModelTargetSectionContainer sectionContainer = classRef.sections; - for (Method m : declaringType.methods()) { - if (m.location() != null && targetVM.vm.canGetBytecodes()) { - byte[] bytecodes = m.bytecodes(); - int length = bytecodes.length; - if (length > 0) { - synchronized (ramIndex) { - Address start = ram.getAddress(ramIndex); - AddressRangeImpl range = - new AddressRangeImpl(start, start.add(BLOCK_SIZE - 1)); - String key = methodToKey(m); - if (addressRangeByMethod.containsKey(key)) { - System.err.println("non-null location: " + m.location() + - " with " + length + " bytes"); - //throw new RuntimeException("non-null location: " + - // m.location() + " with " + length + " bytes"); - } - addressRangeByMethod.put(key, range); - if (sectionContainer != null) { - sectionContainer.addSection(m); - } - else { - System.err.println("null sectionContainer"); - } - ramIndex += 0x1000; //bytecodes.length; - } - } - else { - Address start = ram.getAddress(DEFAULT_SECTION); - AddressRangeImpl range = - new AddressRangeImpl(start, start.add(BLOCK_SIZE - 1)); - String key = methodToKey(m); - if (addressRangeByMethod.containsKey(key)) { - throw new RuntimeException("non-null location: " + - m.location() + " with " + length + " bytes"); - } - addressRangeByMethod.put(key, range); - } - } - } - } - } - } - } - - public void registerConstantPool(JdiModelTargetReferenceType classType, int size) { - if (!addressRangeByClass.containsKey(classType)) { - ReferenceType declaringType = classType.reftype; - if (declaringType instanceof ClassType) { - JdiModelTargetVM targetVM = getTargetVM(declaringType); - if (targetVM.vm.canGetConstantPool()) { - long length = size; - if (length > 0) { - synchronized (poolIndex) { - Address start = pool.getAddress(poolIndex); - length = (length % BLOCK_SIZE + 1) * BLOCK_SIZE; - AddressRangeImpl range = - new AddressRangeImpl(start, start.add(length - 1)); - if (addressRangeByClass.containsKey(classType)) { - System.err.println("non-null location: " + classType + " with " + - length + " bytes"); - } - addressRangeByClass.put(classType, range); - poolIndex += length; //bytecodes.length; - } - } - } - } - } - } - - public JdiModelTargetVM getTargetVM(Mirror mirror) { - return root.vms.getTargetVM(mirror.virtualMachine()); - } - - public AddressRange getAddressRange(Method method) { - if (method == null) { - return defaultRange; - } - AddressRange range = addressRangeByMethod.get(methodToKey(method)); - if (range == null) { - registerMethod(method); - range = addressRangeByMethod.get(methodToKey(method)); - } - return range; - } - - public Method getMethodForAddress(Address address) { - for (String methodName : addressRangeByMethod.keySet()) { - AddressRange range = addressRangeByMethod.get(methodName); - if (range.contains(address)) { - return methodsByKey.get(methodName); - } - } - return null; - } - - public Location getLocation(Address address) { - Method method = getMethodForAddress(address); - long codeIndex = address.subtract(getAddressRange(method).getMinAddress()); - return method.locationOfCodeIndex(codeIndex); - } - - public AddressRange getAddressRange(JdiModelTargetReferenceType classType, int sz) { - AddressRange range = addressRangeByClass.get(classType); - if (range == null) { - registerConstantPool(classType, sz); - range = addressRangeByClass.get(classType); - } - return range; - } - - @Override - public AddressFactory getAddressFactory() { - return addressFactory; - } - -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetAttributesContainer.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetAttributesContainer.java deleted file mode 100644 index 1f14b61c34..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetAttributesContainer.java +++ /dev/null @@ -1,45 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model; - -import java.util.List; -import java.util.Map; - -import ghidra.dbg.jdi.manager.JdiEventsListenerAdapter; -import ghidra.dbg.jdi.model.iface2.JdiModelTargetObject; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "AttributesContainer", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(type = Object.class) - }, - canonicalContainer = true) -public class JdiModelTargetAttributesContainer extends JdiModelTargetObjectImpl - implements JdiEventsListenerAdapter { - - public JdiModelTargetAttributesContainer(JdiModelTargetObject parent, String name) { - super(parent, name); - } - - public void addAttributes(Map attrs) { - setAttributes(List.of(), attrs, "Initialized"); - } - -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetBreakpointContainer.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetBreakpointContainer.java deleted file mode 100644 index 4b3da6560a..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetBreakpointContainer.java +++ /dev/null @@ -1,153 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model; - -import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import com.sun.jdi.Location; - -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.jdi.manager.JdiCause; -import ghidra.dbg.jdi.manager.JdiEventsListenerAdapter; -import ghidra.dbg.jdi.manager.breakpoint.JdiBreakpointInfo; -import ghidra.dbg.jdi.manager.impl.DebugStatus; -import ghidra.dbg.jdi.model.iface2.JdiModelTargetObject; -import ghidra.dbg.target.TargetBreakpointSpec.TargetBreakpointKind; -import ghidra.dbg.target.TargetBreakpointSpecContainer; -import ghidra.dbg.target.schema.*; -import ghidra.program.model.address.AddressRange; -import ghidra.util.datastruct.WeakValueHashMap; - -@TargetObjectSchemaInfo( - name = "BreakpointContainer", - elements = { - @TargetElementType(type = JdiModelTargetBreakpointSpec.class) - }, - attributes = { - @TargetAttributeType(type = Void.class) - }, - canonicalContainer = true) -public class JdiModelTargetBreakpointContainer extends JdiModelTargetObjectImpl implements - TargetBreakpointSpecContainer, JdiEventsListenerAdapter { - - protected static final TargetBreakpointKindSet SUPPORTED_KINDS = - TargetBreakpointKindSet.of(TargetBreakpointKind.values()); - - protected final Map specsByInfo = - new WeakValueHashMap<>(); - - public JdiModelTargetBreakpointContainer(JdiModelTargetVM vm) { - super(vm, "Breakpoints"); - - impl.getManager().addEventsListener(null, this); - - changeAttributes(List.of(), List.of(), Map.of( // - // TODO: Seems terrible to duplicate this static attribute on each instance - SUPPORTED_BREAK_KINDS_ATTRIBUTE_NAME, SUPPORTED_KINDS // - ), "Initialized"); - } - - @Override - public DebugStatus breakpointCreated(JdiBreakpointInfo info, JdiCause cause) { - changeElements(List.of(), List.of(getTargetBreakpointSpec(info)), Map.of(), "Created"); - return DebugStatus.NO_CHANGE; - } - - @Override - public DebugStatus breakpointModified(JdiBreakpointInfo newInfo, JdiBreakpointInfo oldInfo, - JdiCause cause) { - getTargetBreakpointSpec(oldInfo).updateInfo(oldInfo, newInfo, "Modified"); - return DebugStatus.NO_CHANGE; - } - - @Override - public DebugStatus breakpointDeleted(JdiBreakpointInfo info, JdiCause cause) { - synchronized (this) { - specsByInfo.remove(info); - } - changeElements(List.of(info.toString()), List.of(), Map.of(), "Deleted"); - return DebugStatus.NO_CHANGE; - } - - @Override - public CompletableFuture placeBreakpoint(AddressRange range, - Set kinds) { - if (kinds.contains(TargetBreakpointKind.SW_EXECUTE)) { - Location location = impl.getLocation(range.getMinAddress()); - JdiModelTargetLocation targetLocation = - (JdiModelTargetLocation) getTargetObject(location); - if (targetLocation == null) { - targetLocation = new JdiModelTargetLocation(this, location, true); - } - JdiBreakpointInfo info = targetLocation.addBreakpoint(); - breakpointCreated(info, JdiCause.Causes.UNCLAIMED); - } - return CompletableFuture.completedFuture(null); - } - - @Override - public CompletableFuture placeBreakpoint(String expression, - Set kinds) { - JdiModelTargetObject targetObject = getTargetObject(expression); - if (targetObject != null) { - if (kinds.contains(TargetBreakpointKind.SW_EXECUTE) && - targetObject instanceof JdiModelTargetLocation) { - JdiModelTargetLocation targetLocation = (JdiModelTargetLocation) targetObject; - JdiBreakpointInfo info = targetLocation.addBreakpoint(); - breakpointCreated(info, JdiCause.Causes.UNCLAIMED); - } - if ((kinds.contains(TargetBreakpointKind.READ) || - kinds.contains(TargetBreakpointKind.HW_EXECUTE)) && - targetObject instanceof JdiModelTargetField && targetVM.vm.canWatchFieldAccess()) { - JdiModelTargetField targetField = (JdiModelTargetField) targetObject; - JdiBreakpointInfo info = targetField.addAccessWatchpoint(); - breakpointCreated(info, JdiCause.Causes.UNCLAIMED); - } - if (kinds.contains(TargetBreakpointKind.WRITE) && - targetObject instanceof JdiModelTargetField && - targetVM.vm.canWatchFieldModification()) { - JdiModelTargetField targetField = (JdiModelTargetField) targetObject; - JdiBreakpointInfo info = targetField.addModificationWatchpoint(); - breakpointCreated(info, JdiCause.Causes.UNCLAIMED); - } - } - return CompletableFuture.completedFuture(null); - } - - public synchronized JdiModelTargetBreakpointSpec getTargetBreakpointSpec( - JdiBreakpointInfo info) { - return specsByInfo.computeIfAbsent(info, - i -> new JdiModelTargetBreakpointSpec(this, info, true)); - } - - protected void updateUsingBreakpoints(Map byNumber) { - List specs; - synchronized (this) { - specs = byNumber.values() - .stream() - .map(this::getTargetBreakpointSpec) - .collect(Collectors.toList()); - } - setElements(specs, Map.of(), "Refreshed"); - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - return CompletableFuture.completedFuture(null); - } -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetBreakpointSpec.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetBreakpointSpec.java deleted file mode 100644 index cef3341b19..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetBreakpointSpec.java +++ /dev/null @@ -1,146 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.jdi.manager.breakpoint.JdiBreakpointInfo; -import ghidra.dbg.jdi.model.iface1.JdiModelTargetDeletable; -import ghidra.dbg.target.TargetBreakpointLocation; -import ghidra.dbg.target.TargetBreakpointSpec; -import ghidra.dbg.target.TargetBreakpointSpecContainer.TargetBreakpointKindSet; -import ghidra.dbg.target.schema.TargetAttributeType; -import ghidra.dbg.target.schema.TargetObjectSchemaInfo; -import ghidra.util.datastruct.ListenerSet; - -@TargetObjectSchemaInfo( - name = "BreakpointSpec", - attributes = { - @TargetAttributeType( - name = TargetBreakpointSpec.CONTAINER_ATTRIBUTE_NAME, - type = JdiModelTargetBreakpointContainer.class), - @TargetAttributeType( - name = TargetBreakpointLocation.SPEC_ATTRIBUTE_NAME, - type = JdiModelTargetBreakpointSpec.class), - @TargetAttributeType(type = Void.class) }, - canonicalContainer = true) -public class JdiModelTargetBreakpointSpec extends JdiModelTargetObjectImpl - implements TargetBreakpointSpec, JdiModelTargetDeletable { - - protected JdiBreakpointInfo info; - protected TargetBreakpointKindSet kinds; - - protected final ListenerSet actions = - new ListenerSet<>(TargetBreakpointAction.class, false); - - public JdiModelTargetBreakpointSpec(JdiModelTargetBreakpointContainer breakpoints, - JdiBreakpointInfo info, boolean isElement) { - super(breakpoints, info.toString(), info, isElement); - } - - @Override - public CompletableFuture delete() { - info.setEnabled(false); - return CompletableFuture.completedFuture(null); - } - - @Override - public boolean isEnabled() { - return info.isEnabled(); - } - - @Override - public String getExpression() { - return ""; - } - - protected TargetBreakpointKindSet computeKinds(JdiBreakpointInfo from) { - switch (from.getType()) { - case BREAKPOINT: - return TargetBreakpointKindSet.of(TargetBreakpointKind.SW_EXECUTE); - case MODIFICATION_WATCHPOINT: - return TargetBreakpointKindSet.of(TargetBreakpointKind.WRITE); - case ACCESS_WATCHPOINT: - return TargetBreakpointKindSet.of(TargetBreakpointKind.READ, - TargetBreakpointKind.WRITE); - default: - return TargetBreakpointKindSet.of(); - } - } - - @Override - public TargetBreakpointKindSet getKinds() { - return kinds; - } - - @Override - public void addAction(TargetBreakpointAction action) { - actions.add(action); - } - - @Override - public void removeAction(TargetBreakpointAction action) { - actions.remove(action); - } - - protected CompletableFuture getInfo(RefreshBehavior refresh) { - return CompletableFuture.completedFuture(info); - } - - protected void updateAttributesFromInfo(String reason) { - boolean enabled = info.isEnabled(); - - changeAttributes(List.of(), List.of(), Map.of( // - ENABLED_ATTRIBUTE_NAME, enabled, // - KINDS_ATTRIBUTE_NAME, kinds = computeKinds(info), // - DISPLAY_ATTRIBUTE_NAME, display = getDisplay() // - ), reason); - } - - protected CompletableFuture updateInfo(JdiBreakpointInfo oldInfo, - JdiBreakpointInfo newInfo, String reason) { - this.info = newInfo; - updateAttributesFromInfo(reason); - return CompletableFuture.completedFuture(null); - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - return getInfo(refresh).thenCompose(i -> { - return updateInfo(info, i, "Refreshed"); - }); - } - - @Override - public CompletableFuture disable() { - info.setEnabled(false); - return CompletableFuture.completedFuture(null); - } - - @Override - public CompletableFuture enable() { - info.setEnabled(true); - return CompletableFuture.completedFuture(null); - } - - @Override - public String getDisplay() { - return info == null ? super.getDisplay() : info.toString(); - } -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetClassContainer.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetClassContainer.java deleted file mode 100644 index 5e292d3986..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetClassContainer.java +++ /dev/null @@ -1,102 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model; - -import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import com.sun.jdi.ReferenceType; - -import ghidra.async.AsyncFence; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.schema.*; -import ghidra.util.Msg; - -@TargetObjectSchemaInfo( - name = "ClassContainer", - elements = { - @TargetElementType(type = JdiModelTargetReferenceType.class) - }, - attributes = { - @TargetAttributeType(type = Void.class) - }, - canonicalContainer = true) -public class JdiModelTargetClassContainer extends JdiModelTargetObjectImpl { - - protected final JdiModelTargetVM vm; - - // TODO: Is it possible to load the same object twice? - private final Map classesByName = new HashMap<>(); - - public JdiModelTargetClassContainer(JdiModelTargetVM vm) { - super(vm, "Classes"); - this.vm = vm; - - requestElements(RefreshBehavior.REFRESH_ALWAYS); - } - - protected CompletableFuture updateUsingClasses(Map byName) { - List classes; - synchronized (this) { - classes = - byName.values().stream().map(this::getTargetClass).collect(Collectors.toList()); - } - AsyncFence fence = new AsyncFence(); - for (JdiModelTargetReferenceType c : classes) { - fence.include(c.init()); - } - return fence.ready().thenAccept(__ -> { - changeElements(List.of(), classes, Map.of(), "Refreshed"); - }); - } - - @Override - protected CompletableFuture requestElements(RefreshBehavior refresh) { - // Ignore 'refresh' because inferior.getKnownModules may exclude executable - return doRefresh(); - } - - protected CompletableFuture doRefresh() { - Map map = new HashMap<>(); - List allClasses = vm.vm.allClasses(); - for (ReferenceType ref : allClasses) { - map.put(ref.name(), ref); - } - getClassesByName().keySet().retainAll(map.keySet()); - return updateUsingClasses(map); - } - - protected synchronized JdiModelTargetReferenceType getTargetClass(ReferenceType reftype) { - return getClassesByName().computeIfAbsent(reftype.name(), - n -> (JdiModelTargetReferenceType) getInstance(reftype)); - } - - public synchronized JdiModelTargetReferenceType getTargetModuleIfPresent(String name) { - return getClassesByName().get(name); - } - - public CompletableFuture refreshInternal() { - return doRefresh().exceptionally(ex -> { - Msg.error(this, "Problem refreshing vm's classes", ex); - return null; - }); - } - - public Map getClassesByName() { - return classesByName; - } -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetConnector.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetConnector.java deleted file mode 100644 index c5d853d809..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetConnector.java +++ /dev/null @@ -1,113 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import com.sun.jdi.connect.Connector; -import com.sun.jdi.connect.Connector.Argument; - -import ghidra.dbg.jdi.model.iface1.JdiModelSelectableObject; -import ghidra.dbg.jdi.model.iface1.JdiModelTargetLauncher; -import ghidra.dbg.target.TargetMethod; -import ghidra.dbg.target.TargetMethod.ParameterDescription; -import ghidra.dbg.target.TargetMethod.TargetParameterMap; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "Connector", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType( - name = "Description", - type = String.class, - required = true, - fixed = true), - @TargetAttributeType( - name = "Default Arguments", - type = Object.class, - required = true, - fixed = true), - @TargetAttributeType( - name = "Transport", - type = Object.class, - required = true, - fixed = true), - @TargetAttributeType(type = Void.class) - }, - canonicalContainer = true) -public class JdiModelTargetConnector extends JdiModelTargetObjectImpl - implements JdiModelSelectableObject, - // TODO: Make a JidModelTargetLaunchingConnector and JdiModelTargetAttachingConnector - JdiModelTargetLauncher { - - protected final JdiModelTargetConnectorContainer connectors; - protected final Connector cx; - protected final TargetParameterMap paramDescs; - - public JdiModelTargetConnector(JdiModelTargetConnectorContainer connectors, Connector cx, - boolean isElement) { - super(connectors, cx.name(), cx, isElement); - this.connectors = connectors; - this.cx = cx; - - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, cx.name(), // - "Description", cx.description(), // - "Default Arguments", cx.defaultArguments(), // - "Transport", cx.transport(), // - TargetMethod.PARAMETERS_ATTRIBUTE_NAME, - paramDescs = TargetParameterMap.copyOf(computeParameters()) // - ), "Initialized"); - } - - @Override - public CompletableFuture init() { - return CompletableFuture.completedFuture(null); - } - - @Override - public String getDisplay() { - return cx == null ? super.getDisplay() : cx.name(); - } - - @Override - public CompletableFuture setActive() { - connectors.setDefaultConnector(this); - return CompletableFuture.completedFuture(null); - } - - protected Map> computeParameters() { - return JdiModelTargetLauncher.getParameters(cx.defaultArguments()); - } - - @Override - public TargetParameterMap getParameters() { - return TargetMethod.getParameters(this); - } - - @Override - public CompletableFuture launch(Map args) { - Map jdiArgs = - JdiModelTargetLauncher.getArguments(cx.defaultArguments(), paramDescs, args); - getManager().addVM(cx, jdiArgs); - return CompletableFuture.completedFuture(null); - } -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetConnectorContainer.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetConnectorContainer.java deleted file mode 100644 index aba6e07903..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetConnectorContainer.java +++ /dev/null @@ -1,113 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model; - -import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import com.sun.jdi.VirtualMachineManager; -import com.sun.jdi.connect.Connector; - -import ghidra.async.AsyncFence; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.schema.*; -import ghidra.util.Msg; - -@TargetObjectSchemaInfo( - name = "ConnectorContainer", - elements = { - @TargetElementType(type = JdiModelTargetConnector.class) - }, - attributes = { - @TargetAttributeType(type = Void.class) - }, - canonicalContainer = true) -public class JdiModelTargetConnectorContainer extends JdiModelTargetObjectImpl { - - protected final JdiModelTargetRoot root; - - // TODO: Is it possible to load the same object twice? - protected final Map connectorsByName = new HashMap<>(); - private JdiModelTargetConnector defaultConnector; - - public JdiModelTargetConnectorContainer(JdiModelTargetRoot root) { - super(root, "Connectors"); - this.root = root; - } - - protected CompletableFuture updateUsingConnectors(Map byName) { - List connectors; - synchronized (this) { - connectors = - byName.values().stream().map(this::getTargetConnector).collect(Collectors.toList()); - } - AsyncFence fence = new AsyncFence(); - for (JdiModelTargetConnector c : connectors) { - fence.include(c.init()); - } - return fence.ready().thenAccept(__ -> { - changeElements(List.of(), connectors, Map.of(), "Refreshed"); - }); - } - - @Override - protected CompletableFuture requestElements(RefreshBehavior refresh) { - // Ignore 'refresh' because inferior.getKnownModules may exclude executable - return doRefresh(); - } - - protected CompletableFuture doRefresh() { - Map map = new HashMap<>(); - VirtualMachineManager vmm = impl.getManager().getVirtualMachineManager(); - List allConnectors = vmm.allConnectors(); - for (Connector cx : allConnectors) { - map.put(cx.name(), cx); - } - connectorsByName.keySet().retainAll(map.keySet()); - return updateUsingConnectors(map); - } - - protected synchronized JdiModelTargetConnector getTargetConnector(Connector cx) { - return connectorsByName.computeIfAbsent(cx.name(), - n -> new JdiModelTargetConnector(this, cx, true)); - } - - public synchronized JdiModelTargetConnector getTargetConnectorIfPresent(String name) { - for (String key : connectorsByName.keySet()) { - if (key.contains(name)) { - return connectorsByName.get(key); - } - } - return null; - } - - public CompletableFuture refreshInternal() { - return doRefresh().exceptionally(ex -> { - Msg.error(this, "Problem refreshing inferior's modules", ex); - return null; - }); - } - - public JdiModelTargetConnector getDefaultConnector() { - return defaultConnector; - } - - public void setDefaultConnector(JdiModelTargetConnector defaultConnector) { - this.defaultConnector = defaultConnector; - } - -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetConstantPool.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetConstantPool.java deleted file mode 100644 index 3aa0ba7b58..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetConstantPool.java +++ /dev/null @@ -1,99 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.TargetMemoryRegion; -import ghidra.dbg.target.TargetSection; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; -import ghidra.program.model.address.AddressRange; - -@TargetObjectSchemaInfo( - name = "ConstantPool", - elements = { - @TargetElementType(type = Void.class) - }, - elementResync = ResyncMode.ONCE, - attributes = { - @TargetAttributeType(type = Void.class) - }, - canonicalContainer = true) -public class JdiModelTargetConstantPool extends JdiModelTargetObjectImpl implements // - //TargetMemory - TargetMemoryRegion, TargetSection { - - private AddressRange range; - private byte[] pool; - - public JdiModelTargetConstantPool(JdiModelTargetSectionContainer parent, byte[] pool, - boolean isElement) { - super(parent, "Constant Pool", pool, isElement); - this.pool = pool; - - this.range = impl.getAddressRange(getClassType(), pool.length); - - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDisplay(), // - MODULE_ATTRIBUTE_NAME, parent.getClassType(), // - READABLE_ATTRIBUTE_NAME, true, // - MEMORY_ATTRIBUTE_NAME, parent, // - TargetMemoryRegion.RANGE_ATTRIBUTE_NAME, range // - ), "Initialized"); - } - - @Override - public CompletableFuture requestAttributes(RefreshBehavior refresh) { - - this.range = impl.getAddressRange(getClassType(), pool.length); - if (range != null) { - changeAttributes(List.of(), List.of(), Map.of(), "Initialized"); - } - - return CompletableFuture.completedFuture(null); - } - - @Override - public CompletableFuture init() { - return CompletableFuture.completedFuture(null); - } - - @Override - public String getDisplay() { - JdiModelTargetReferenceType classType = getClassType(); - return classType.getName() + ": ConstPool" + range; - } - - private JdiModelTargetReferenceType getClassType() { - JdiModelTargetReferenceType classType = - ((JdiModelTargetSectionContainer) parent).getClassType(); - return classType; - } - - @Override - public AddressRange getRange() { - return range; - } - - public byte[] getPool() { - return pool; - } - -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetElementsContainer.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetElementsContainer.java deleted file mode 100644 index cd2bb4b8c0..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetElementsContainer.java +++ /dev/null @@ -1,59 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model; - -import java.util.List; -import java.util.Map; - -import com.sun.jdi.ThreadGroupReference; - -import ghidra.dbg.jdi.manager.JdiEventsListenerAdapter; -import ghidra.dbg.jdi.model.iface2.JdiModelTargetObject; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; -import ghidra.dbg.util.PathUtils; -import ghidra.util.datastruct.WeakValueHashMap; - -@TargetObjectSchemaInfo( - name = "ElementsContainer", - elements = { - @TargetElementType(type = JdiModelTargetObject.class) - }, - elementResync = ResyncMode.ONCE, - attributes = { - @TargetAttributeType(type = Void.class) - }, - canonicalContainer = true) -public class JdiModelTargetElementsContainer extends JdiModelTargetObjectImpl - implements JdiEventsListenerAdapter { - - protected static String keyGroup(ThreadGroupReference group) { - return PathUtils.makeKey(group.name()); - } - - protected final Map threadGroupsById = - new WeakValueHashMap<>(); - - public JdiModelTargetElementsContainer(JdiModelTargetObject parent, String name) { - super(parent, name); - } - - public void addElements(List els) { - setElements(els, Map.of(), "Initialized"); - } - -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetField.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetField.java deleted file mode 100644 index bb22b42972..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetField.java +++ /dev/null @@ -1,132 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import com.sun.jdi.ClassNotLoadedException; -import com.sun.jdi.Field; -import com.sun.jdi.request.*; - -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.jdi.manager.breakpoint.JdiBreakpointInfo; -import ghidra.dbg.jdi.model.iface2.JdiModelTargetObject; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "Field", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(name = "Attributes", type = JdiModelTargetAttributesContainer.class), - @TargetAttributeType(type = Void.class) - }) -public class JdiModelTargetField extends JdiModelTargetObjectImpl { - - protected final Field field; - - private JdiModelTargetType type; - private JdiModelTargetReferenceType declaringType; - private JdiModelTargetAttributesContainer addedAttributes; - - public JdiModelTargetField(JdiModelTargetObject fields, Field field, boolean isElement) { - super(fields, field.toString(), field, isElement); - this.field = field; - - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDisplay(), // - TYPE_ATTRIBUTE_NAME, field.typeName() // - ), "Initialized"); - } - - private void populateAttributes() { - this.addedAttributes = new JdiModelTargetAttributesContainer(this, "Attributes"); - Map attrs = new HashMap<>(); - attrs.put("isEnumConstant", field.isEnumConstant()); - attrs.put("isFinal", field.isFinal()); - try { - attrs.put("isPackagePrivate", field.isPackagePrivate()); - attrs.put("isPrivate", field.isPrivate()); - attrs.put("isProtected", field.isProtected()); - attrs.put("isPublic", field.isPublic()); - } - catch (Exception e) { - if (e instanceof ClassNotLoadedException) { - attrs.put("status", "Class not loaded"); - } - } - attrs.put("isStatic", field.isStatic()); - attrs.put("isSynthetic", field.isSynthetic()); - attrs.put("isTransient", field.isTransient()); - attrs.put("isVolatile", field.isVolatile()); - attrs.put("modifiers", field.modifiers()); - addedAttributes.addAttributes(attrs); - } - - @Override - public CompletableFuture requestAttributes(RefreshBehavior refresh) { - this.declaringType = (JdiModelTargetReferenceType) getInstance(field.declaringType()); - - populateAttributes(); - - changeAttributes(List.of(), List.of( // - addedAttributes // - ), Map.of( // - "Declaring Type", declaringType // - ), "Initialized"); - - try { - this.type = (JdiModelTargetType) getInstance(field.type()); - if (type != null) { - changeAttributes(List.of(), List.of(), Map.of( // - "Type", type // - ), "Initialized"); - } - } - catch (ClassNotLoadedException e) { - // Ignore - } - return CompletableFuture.completedFuture(null); - } - - @Override - public CompletableFuture init() { - return CompletableFuture.completedFuture(null); - } - - @Override - public String getDisplay() { - return field == null ? super.getDisplay() : field.name(); - } - - public JdiBreakpointInfo addAccessWatchpoint() { - EventRequestManager eventManager = field.virtualMachine().eventRequestManager(); - AccessWatchpointRequest request = eventManager.createAccessWatchpointRequest(field); - request.enable(); - return new JdiBreakpointInfo(request); - } - - public JdiBreakpointInfo addModificationWatchpoint() { - EventRequestManager eventManager = field.virtualMachine().eventRequestManager(); - ModificationWatchpointRequest request = - eventManager.createModificationWatchpointRequest(field); - request.enable(); - return new JdiBreakpointInfo(request); - } - -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetFieldContainer.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetFieldContainer.java deleted file mode 100644 index 12e622972f..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetFieldContainer.java +++ /dev/null @@ -1,88 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model; - -import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import com.sun.jdi.Field; - -import ghidra.async.AsyncFence; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; - -@TargetObjectSchemaInfo( - name = "FieldsContainer", - elements = { - @TargetElementType(type = JdiModelTargetField.class) - }, - elementResync = ResyncMode.ONCE, - attributes = { - @TargetAttributeType(type = Void.class) - }, - canonicalContainer = true) -public class JdiModelTargetFieldContainer extends JdiModelTargetObjectImpl { - // NOTE: -file-list-shared-libraries omits the main module and system-supplied DSO. - - protected final JdiModelTargetReferenceType reftype; - - // TODO: Is it possible to load the same object twice? - protected final Map fieldsByName = new HashMap<>(); - private boolean useAll; - - public JdiModelTargetFieldContainer(JdiModelTargetReferenceType reftype, boolean all) { - super(reftype, all ? "Fields (All)" : "Fields"); - this.reftype = reftype; - this.useAll = all; - } - - protected CompletableFuture updateUsingFields(Map byName) { - List fields; - synchronized (this) { - fields = - byName.values().stream().map(this::getTargetField).collect(Collectors.toList()); - } - AsyncFence fence = new AsyncFence(); - for (JdiModelTargetField m : fields) { - fence.include(m.init()); - } - return fence.ready().thenAccept(__ -> { - changeElements(List.of(), fields, Map.of(), "Refreshed"); - }); - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - Map map = new HashMap<>(); - List fields = useAll ? reftype.reftype.allFields() : reftype.reftype.fields(); - for (Field f : fields) { - map.put(f.name(), f); - } - fieldsByName.keySet().retainAll(map.keySet()); - return updateUsingFields(map); - } - - protected synchronized JdiModelTargetField getTargetField(Field var) { - return fieldsByName.computeIfAbsent(var.name(), - n -> (JdiModelTargetField) getInstance(var)); - } - - public synchronized JdiModelTargetField getTargetFieldIfPresent(String name) { - return fieldsByName.get(name); - } -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetLocalVariable.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetLocalVariable.java deleted file mode 100644 index 5a982d849e..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetLocalVariable.java +++ /dev/null @@ -1,105 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import com.sun.jdi.ClassNotLoadedException; -import com.sun.jdi.LocalVariable; - -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "LocalVariable", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(name = "Attributes", type = JdiModelTargetAttributesContainer.class), - @TargetAttributeType(name = "Generic Signature", type = String.class), - @TargetAttributeType(name = "Signature", type = String.class), - @TargetAttributeType(name = "Type", type = String.class, required = true), - @TargetAttributeType(type = Void.class) - }) -public class JdiModelTargetLocalVariable extends JdiModelTargetObjectImpl { - - String IS_ARGUMENT_ATTRIBUTE_NAME = "IsArg"; - String VISIBLE_TYPE_ATTRIBUTE_NAME = "Type"; - - protected final LocalVariable var; - private JdiModelTargetAttributesContainer addedAttributes; - - public JdiModelTargetLocalVariable(JdiModelTargetLocalVariableContainer variables, - LocalVariable var, boolean isElement) { - super(variables, var.name(), var, isElement); - this.var = var; - - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, var.name(), // - VISIBLE_TYPE_ATTRIBUTE_NAME, var.typeName() // - ), "Initialized"); - - } - - private void populateAttributes() { - this.addedAttributes = new JdiModelTargetAttributesContainer(this, "Attributes"); - Map attrs = new HashMap<>(); - attrs.put("isArgument", var.isArgument()); - addedAttributes.addAttributes(attrs); - } - - @Override - public CompletableFuture requestAttributes(RefreshBehavior refresh) { - - populateAttributes(); - - changeAttributes(List.of(), List.of( // - addedAttributes // - ), Map.of( // - "Signature", var.signature() // - ), "Initialized"); - - try { - JdiModelTargetType type = (JdiModelTargetType) getInstance(var.type()); - changeAttributes(List.of(), List.of(), Map.of( // - "Type", type // - ), "Initialized"); - } - catch (ClassNotLoadedException e) { - // Ignore - } - String genericSignature = var.genericSignature(); - if (genericSignature != null) { - changeAttributes(List.of(), List.of(), Map.of( // - "Generic Signature", genericSignature // - ), "Initialized"); - } - return CompletableFuture.completedFuture(null); - } - - @Override - public CompletableFuture init() { - return CompletableFuture.completedFuture(null); - } - - @Override - public String getDisplay() { - return var == null ? super.getDisplay() : var.name(); - } - -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetLocalVariableContainer.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetLocalVariableContainer.java deleted file mode 100644 index 25bbb4efdc..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetLocalVariableContainer.java +++ /dev/null @@ -1,89 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model; - -import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import com.sun.jdi.LocalVariable; - -import ghidra.async.AsyncFence; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.jdi.model.iface2.JdiModelTargetObject; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "LocalVariableContainer", - elements = { - @TargetElementType(type = JdiModelTargetLocalVariable.class) - }, - attributes = { - @TargetAttributeType(type = Void.class) - }, - canonicalContainer = true) -public class JdiModelTargetLocalVariableContainer extends JdiModelTargetObjectImpl { - - private List vars; - - // TODO: Is it possible to load the same object twice? - protected final Map variablesByName = new HashMap<>(); - - public JdiModelTargetLocalVariableContainer(JdiModelTargetObject parent, String name, - List vars) { - super(parent, name); - this.vars = vars; - } - - protected CompletableFuture updateUsingVariables(Map byName) { - List locations; - synchronized (this) { - locations = - byName.values().stream().map(this::getTargetVariable).collect(Collectors.toList()); - } - AsyncFence fence = new AsyncFence(); - for (JdiModelTargetLocalVariable loc : locations) { - fence.include(loc.init()); - } - return fence.ready().thenAccept(__ -> { - changeElements(List.of(), locations, Map.of(), "Refreshed"); - }); - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - Map map = new HashMap<>(); - try { - for (LocalVariable var : vars) { - map.put(var.name(), var); - } - variablesByName.keySet().retainAll(map.keySet()); - } - catch (Exception e) { - e.printStackTrace(); - } - return updateUsingVariables(map); - } - - protected synchronized JdiModelTargetLocalVariable getTargetVariable(LocalVariable var) { - return variablesByName.computeIfAbsent(var.name(), - n -> new JdiModelTargetLocalVariable(this, var, true)); - } - - public synchronized JdiModelTargetLocalVariable getTargetVariableIfPresent(String name) { - return variablesByName.get(name); - } -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetLocation.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetLocation.java deleted file mode 100644 index b0d9a05541..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetLocation.java +++ /dev/null @@ -1,133 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import com.sun.jdi.AbsentInformationException; -import com.sun.jdi.Location; -import com.sun.jdi.request.BreakpointRequest; -import com.sun.jdi.request.EventRequestManager; - -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.jdi.manager.breakpoint.JdiBreakpointInfo; -import ghidra.dbg.jdi.model.iface2.JdiModelTargetObject; -import ghidra.dbg.target.schema.*; -import ghidra.program.model.address.Address; -import ghidra.program.model.address.AddressRange; - -@TargetObjectSchemaInfo( - name = "Location", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(name = "Method", type = String.class, required = true, fixed = true), - @TargetAttributeType(name = "Line", type = Integer.class, required = true, fixed = true), - @TargetAttributeType(name = "Index", type = Long.class, required = true, fixed = true), - @TargetAttributeType(name = "Address", type = String.class, required = true, fixed = true), - @TargetAttributeType(type = Object.class) // - }) -public class JdiModelTargetLocation extends JdiModelTargetObjectImpl { - - public static String getUniqueId(Location obj) { - return obj.toString() + ":" + obj.codeIndex(); - } - - protected final Location location; - private JdiModelTargetReferenceType declaringType; - private Address address; - - public JdiModelTargetLocation(JdiModelTargetObject parent, Location location, - boolean isElement) { - super(parent, getUniqueId(location), location, isElement); - this.location = location; - - impl.registerMethod(location.method()); - - this.address = getAddress(); - - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDisplay(), // - "Method", location.method().name(), // - "Line", location.lineNumber(), // - "Index", location.codeIndex(), // - "Address", Long.toHexString(address.getOffset()) // - ), "Initialized"); - - } - - @Override - public CompletableFuture requestAttributes(RefreshBehavior refresh) { - - this.declaringType = (JdiModelTargetReferenceType) getInstance(location.declaringType()); - - changeAttributes(List.of(), List.of(), Map.of( // - "Declaring Type", declaringType // - ), "Initialized"); - - try { - String sourceName = location.sourceName(); - String sourcePath = location.sourcePath(); - changeAttributes(List.of(), List.of(), Map.of( // - "Source Name", sourceName, // - "Source Path", sourcePath // - ), "Initialized"); - } - catch (AbsentInformationException e) { - // Ignore - } - return CompletableFuture.completedFuture(null); - } - - @Override - public CompletableFuture init() { - return CompletableFuture.completedFuture(null); - } - - @Override - public String getDisplay() { - return location == null ? super.getDisplay() - : location.toString() + " [" + Long.toHexString(address.getOffset()) + "]"; - } - - public Address getAddress() { - if (address != null) { - return address; - } - return getAddressFromLocation(impl, location); - } - - public static Address getAddressFromLocation(JdiModelImpl impl, Location location) { - AddressRange addressRange = impl.getAddressRange(location.method()); - if (addressRange == null) { - return impl.getAddressSpace("ram").getAddress(-1L); - } - long codeIndex = location.codeIndex(); - return addressRange.getMinAddress().add(codeIndex < 0 ? 0 : codeIndex); - - } - - public JdiBreakpointInfo addBreakpoint() { - EventRequestManager eventManager = location.virtualMachine().eventRequestManager(); - BreakpointRequest request = eventManager.createBreakpointRequest(location); - request.enable(); - return new JdiBreakpointInfo(request); - } - -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetLocationContainer.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetLocationContainer.java deleted file mode 100644 index fb7c801da5..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetLocationContainer.java +++ /dev/null @@ -1,86 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model; - -import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import com.sun.jdi.Location; - -import ghidra.async.AsyncFence; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.jdi.model.iface2.JdiModelTargetObject; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "LocationContainer", - elements = { - @TargetElementType(type = JdiModelTargetLocation.class) - }, - attributes = { - @TargetAttributeType(type = Void.class) - }, - canonicalContainer = true) -public class JdiModelTargetLocationContainer extends JdiModelTargetObjectImpl { - - private List locations; - - // TODO: Is it possible to load the same object twice? - protected final Map locationsByName = new HashMap<>(); - - public JdiModelTargetLocationContainer(JdiModelTargetObject parent, String name, - List locations) { - super(parent, name); - this.locations = locations; - } - - protected CompletableFuture updateUsingLocations(Map byName) { - List locs; - synchronized (this) { - locs = - byName.values().stream().map(this::getTargetLocation).collect(Collectors.toList()); - } - AsyncFence fence = new AsyncFence(); - for (JdiModelTargetLocation loc : locs) { - fence.include(loc.init()); - } - return fence.ready().thenAccept(__ -> { - changeElements(List.of(), locs, Map.of(), "Refreshed"); - }); - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - Map map = new HashMap<>(); - if (locations != null) { - for (Location loc : locations) { - map.put(loc.toString(), loc); - } - } - locationsByName.keySet().retainAll(map.keySet()); - return updateUsingLocations(map); - } - - protected synchronized JdiModelTargetLocation getTargetLocation(Location loc) { - return locationsByName.computeIfAbsent(loc.toString(), - n -> new JdiModelTargetLocation(this, loc, true)); - } - - public synchronized JdiModelTargetLocation getTargetLocationsIfPresent(String name) { - return locationsByName.get(name); - } -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetMethod.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetMethod.java deleted file mode 100644 index fd75e1fa86..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetMethod.java +++ /dev/null @@ -1,178 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import com.sun.jdi.*; - -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.jdi.model.iface2.JdiModelTargetObject; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "Method", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(name = "Attributes", type = JdiModelTargetAttributesContainer.class), - @TargetAttributeType(type = Object.class) - }) -public class JdiModelTargetMethod extends JdiModelTargetObjectImpl { - - protected final Method method; - - private JdiModelTargetLocation location; - private JdiModelTargetAttributesContainer addedAttributes; - private JdiModelTargetTypeContainer argumentTypes; - private JdiModelTargetLocalVariableContainer arguments; - private JdiModelTargetLocationContainer locations; - private JdiModelTargetLocalVariableContainer variables; - private JdiModelTargetType returnType; - - public JdiModelTargetMethod(JdiModelTargetObject parent, Method method, boolean isElement) { - super(parent, method.toString(), method, isElement); - this.method = method; - - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDisplay() // - ), "Initialized"); - - } - - private void populateAttributes() { - this.addedAttributes = new JdiModelTargetAttributesContainer(this, "Attributes"); - Map attrs = new HashMap<>(); - attrs.put("isAbstract", method.isAbstract()); - attrs.put("isBridge", method.isBridge()); - attrs.put("isStatic", method.isStatic()); - attrs.put("isConstructor", method.isConstructor()); - attrs.put("isDefault", method.isDefault()); - attrs.put("isFinal", method.isFinal()); - attrs.put("isNative", method.isNative()); - attrs.put("isObsolete", method.isObsolete()); - attrs.put("isStatic", method.isStatic()); - attrs.put("isStaticInitializer", method.isStaticInitializer()); - attrs.put("isSynchronized", method.isSynchronized()); - attrs.put("isSynthetic", method.isSynthetic()); - try { - attrs.put("isPackagePrivate", method.isPackagePrivate()); - attrs.put("isPrivate", method.isPrivate()); - attrs.put("isProtected", method.isProtected()); - attrs.put("isPublic", method.isPublic()); - } - catch (Exception e) { - if (e instanceof ClassNotLoadedException) { - attrs.put("status", "Class not loaded"); - } - } - addedAttributes.addAttributes(attrs); - } - - @Override - public CompletableFuture requestAttributes(RefreshBehavior refresh) { - - populateAttributes(); - - changeAttributes(List.of(), List.of( // - addedAttributes // - ), Map.of("Argument Types", method.argumentTypeNames(), // - "Return Type", method.returnTypeName() // - ), "Initialized"); - - this.location = method.location() == null ? null - : new JdiModelTargetLocation(parent, method.location(), false); - if (location != null) { - changeAttributes(List.of(), List.of( // - location // - ), Map.of(), "Initialized"); - } - try { - this.arguments = - new JdiModelTargetLocalVariableContainer(this, "Arguments", method.arguments()); - if (arguments != null) { - changeAttributes(List.of(), List.of( // - arguments // - ), Map.of(), "Initialized"); - } - } - catch (AbsentInformationException e) { - // Ignore - } - try { - this.argumentTypes = - new JdiModelTargetTypeContainer(this, "Argument Types", method.argumentTypes()); - if (argumentTypes != null) { - changeAttributes(List.of(), List.of( // - argumentTypes // - ), Map.of(), "Initialized"); - } - } - catch (ClassNotLoadedException e) { - // Ignore - } - try { - locations = - new JdiModelTargetLocationContainer(this, "Locations", method.allLineLocations()); - if (locations != null) { - changeAttributes(List.of(), List.of( // - locations // - ), Map.of(), "Initialized"); - } - } - catch (AbsentInformationException e) { - // Ignore - } - try { - returnType = (JdiModelTargetType) getInstance(method.returnType()); - if (returnType != null) { - changeAttributes(List.of(), List.of( // - returnType // - ), Map.of(), "Initialized"); - } - } - catch (ClassNotLoadedException e) { - // Ignore - } - try { - this.variables = - new JdiModelTargetLocalVariableContainer(this, "Variables", method.variables()); - if (variables != null) { - changeAttributes(List.of(), List.of( // - variables // - ), Map.of(), "Initialized"); - } - } - catch (AbsentInformationException e) { - // Ignore - } - - return CompletableFuture.completedFuture(null); - } - - @Override - public CompletableFuture init() { - return CompletableFuture.completedFuture(null); - } - - @Override - public String getDisplay() { - return method == null ? super.getDisplay() : method.name(); - } - -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetMethodContainer.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetMethodContainer.java deleted file mode 100644 index cbf623a86e..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetMethodContainer.java +++ /dev/null @@ -1,99 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model; - -import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import com.sun.jdi.Method; - -import ghidra.async.AsyncFence; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; - -@TargetObjectSchemaInfo( - name = "TargetMethodContainer", - elements = { - @TargetElementType(type = JdiModelTargetMethod.class) - }, - elementResync = ResyncMode.ONCE, - attributes = { - @TargetAttributeType(type = Void.class) - }, - canonicalContainer = true) -public class JdiModelTargetMethodContainer extends JdiModelTargetObjectImpl { - - protected final JdiModelTargetReferenceType reftype; - - private final Map methodsByName = new HashMap<>(); - private boolean useAll; - - public JdiModelTargetMethodContainer(JdiModelTargetReferenceType reftype, boolean all) { - super(reftype, all ? "Methods (All)" : "Methods"); - this.reftype = reftype; - this.useAll = all; - } - - protected CompletableFuture updateUsingMethods(Map byName) { - List methods; - synchronized (this) { - methods = - byName.values().stream().map(this::getTargetMethod).collect(Collectors.toList()); - } - AsyncFence fence = new AsyncFence(); - for (JdiModelTargetMethod m : methods) { - fence.include(m.init()); - } - return fence.ready().thenAccept(__ -> { - changeElements(List.of(), methods, Map.of(), "Refreshed"); - }); - } - - @Override - protected CompletableFuture requestElements(RefreshBehavior refresh) { - Map map = new HashMap<>(); - List methods = useAll ? reftype.reftype.allMethods() : reftype.reftype.methods(); - for (Method var : methods) { - map.put(var.name(), var); - } - getMethodsByName().keySet().retainAll(map.keySet()); - return updateUsingMethods(map); - } - - protected synchronized JdiModelTargetMethod getTargetMethod(Method method) { - return getMethodsByName().computeIfAbsent(method.name(), - n -> (JdiModelTargetMethod) getInstance(method)); - } - - public synchronized JdiModelTargetMethod getTargetMethodIfPresent(String name) { - return getMethodsByName().get(name); - } - - @Override - public CompletableFuture init() { - AsyncFence fence = new AsyncFence(); - for (JdiModelTargetMethod method : methodsByName.values()) { - fence.include(method.init()); - } - return fence.ready(); - } - - public Map getMethodsByName() { - return methodsByName; - } -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetModule.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetModule.java deleted file mode 100644 index bf3f4b0605..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetModule.java +++ /dev/null @@ -1,65 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import com.sun.jdi.ModuleReference; - -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "Module", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(name = "UID", type = Long.class, fixed = true), - @TargetAttributeType(type = Object.class) - }) -public class JdiModelTargetModule extends JdiModelTargetObjectReference { - - public static String getUniqueId(ModuleReference module) { - return module.name() == null ? "#" + module.hashCode() : module.name(); - } - - protected final ModuleReference module; - - ///protected final JdiModelTargetSymbolContainer symbols; - - public JdiModelTargetModule(JdiModelTargetModuleContainer modules, ModuleReference module, - boolean isElement) { - super(modules, module, isElement); - this.module = module; - - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getUniqueId(module) // - ), "Initialized"); - } - - @Override - public CompletableFuture init() { - return CompletableFuture.completedFuture(null); - } - - @Override - public String getDisplay() { - return module == null ? super.getDisplay() : getUniqueId(module); - } - -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetModuleContainer.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetModuleContainer.java deleted file mode 100644 index be832bf063..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetModuleContainer.java +++ /dev/null @@ -1,144 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model; - -import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import com.sun.jdi.ModuleReference; - -import ghidra.async.AsyncFence; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.error.DebuggerUserException; -import ghidra.dbg.target.TargetModule; -import ghidra.dbg.target.TargetModuleContainer; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; -import ghidra.lifecycle.Internal; -import ghidra.util.Msg; - -@TargetObjectSchemaInfo( - name = "TargetModuleContainer", - elements = { - @TargetElementType(type = JdiModelTargetModule.class) - }, - elementResync = ResyncMode.ONCE, - attributes = { - @TargetAttributeType(type = Void.class) - }, - canonicalContainer = true) -public class JdiModelTargetModuleContainer extends JdiModelTargetObjectImpl - implements TargetModuleContainer { - - protected final JdiModelTargetVM vm; - - // TODO: Is it possible to load the same object twice? - protected final Map modulesByName = new HashMap<>(); - - public JdiModelTargetModuleContainer(JdiModelTargetVM vm) { - super(vm, "Modules"); - this.vm = vm; - } - - @Internal - public JdiModelTargetModule libraryLoaded(String name) { - List allModules = vm.vm.allModules(); - for (ModuleReference ref : allModules) { - if (JdiModelTargetModule.getUniqueId(ref).equals(name)) { - JdiModelTargetModule module = getTargetModule(ref); - changeElements(List.of(), List.of(module), Map.of(), "Loaded"); - return module; - } - } - return null; - } - - @Internal - public void libraryUnloaded(String name) { - synchronized (this) { - modulesByName.remove(name); - } - changeElements(List.of(name), List.of(), Map.of(), "Unloaded"); - } - - @Override - public boolean supportsSyntheticModules() { - return false; - } - - @Override - public CompletableFuture addSyntheticModule(String name) { - throw new DebuggerUserException("GDB Does not support synthetic modules"); - } - - protected CompletableFuture updateUsingModules(Map byName) { - List modules; - synchronized (this) { - modules = - byName.values().stream().map(this::getTargetModule).collect(Collectors.toList()); - } - AsyncFence fence = new AsyncFence(); - for (JdiModelTargetModule mod : modules) { - fence.include(mod.init()); - } - return fence.ready().thenAccept(__ -> { - changeElements(List.of(), modules, Map.of(), "Refreshed"); - }); - } - - @Override - protected CompletableFuture requestElements(RefreshBehavior refresh) { - return doRefresh(); - } - - protected CompletableFuture doRefresh() { - return CompletableFuture.supplyAsync(() -> { - Map map = new HashMap<>(); - boolean available = vm.vm.canGetModuleInfo(); - if (!available) { - return map; - } - try { - List allModules = vm.vm.allModules(); - for (ModuleReference ref : allModules) { - map.put(JdiModelTargetModule.getUniqueId(ref), ref); - } - } - catch (UnsupportedOperationException e) { - Msg.error(this, "UnsupportedOperationException: " + e.getMessage()); - } - modulesByName.keySet().retainAll(map.keySet()); - return map; - }).thenCompose(this::updateUsingModules); - } - - protected synchronized JdiModelTargetModule getTargetModule(ModuleReference module) { - return modulesByName.computeIfAbsent(JdiModelTargetModule.getUniqueId(module), - n -> new JdiModelTargetModule(this, module, true)); - } - - public synchronized JdiModelTargetModule getTargetModuleIfPresent(String name) { - return modulesByName.get(name); - } - - public CompletableFuture refreshInternal() { - return doRefresh().exceptionally(ex -> { - Msg.error(this, "Problem refreshing inferior's modules", ex); - return null; - }); - } -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetObjectImpl.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetObjectImpl.java deleted file mode 100644 index 53c4a69e72..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetObjectImpl.java +++ /dev/null @@ -1,186 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import com.sun.jdi.Mirror; -import com.sun.jdi.ThreadReference; - -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.agent.DefaultTargetObject; -import ghidra.dbg.jdi.manager.JdiCause; -import ghidra.dbg.jdi.manager.JdiStateListener; -import ghidra.dbg.jdi.model.iface2.JdiModelTargetObject; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.util.PathUtils; - -public class JdiModelTargetObjectImpl extends - DefaultTargetObject implements JdiModelTargetObject { - - public static String keyObject(String id) { - return PathUtils.makeKey(id); - } - - protected final JdiModelImpl impl; - protected final Mirror mirror; - protected final Object object; - protected String display; - - protected final JdiStateListener accessListener = this::checkExited; - protected JdiModelTargetVM targetVM; - private boolean modified; - - public JdiModelTargetObjectImpl(JdiModelTargetObject parent, String id) { - super(parent.getModelImpl(), parent, id, "Object"); - this.impl = parent.getModelImpl(); - this.mirror = (Mirror) parent.getObject(); - this.object = null; - this.display = id; - - if (mirror != null) { - targetVM = impl.getTargetVM(mirror); - targetVM.setTargetObject(parent + ":" + id, null, this); - } - - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, display = getDisplay() // - ), "Initialized"); - } - - public JdiModelTargetObjectImpl(JdiModelTargetObject parent, String id, Object object, - boolean isElement) { - super(parent.getModelImpl(), parent, isElement ? keyObject(id) : id, "Object"); - this.impl = parent.getModelImpl(); - this.mirror = object instanceof Mirror ? (Mirror) object : null; - this.object = object; - this.display = id; - - if (mirror != null) { - if (this instanceof JdiModelTargetVM) { - targetVM = (JdiModelTargetVM) this; - } - else { - targetVM = impl.getTargetVM(mirror); - } - targetVM.setTargetObject(id, object == null ? id : object, this); - } - - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, display = getDisplay() // - ), "Initialized"); - } - - public JdiModelTargetObjectImpl(JdiModelTargetSectionContainer parent) { - super(parent.getModelImpl(), parent, keyObject("NULL_SPACE"), "Object"); - this.impl = parent.getModelImpl(); - this.mirror = parent.mirror; - this.display = "NULL_SPACE"; - this.object = display; - } - - public CompletableFuture init() { - return CompletableFuture.completedFuture(null); - } - - @Override - public JdiModelImpl getModelImpl() { - return impl; - } - - @Override - public String getDisplay() { - return display; - } - - @Override - public Object getObject() { - return object; - } - - @Override - public JdiModelTargetObject getTargetObject(Object obj) { - if (targetVM != null) { - return targetVM.getTargetObject(obj); - } - //System.err.println("Attempt to getTargetObject from class without Mirror " + this); - return null; - } - - protected void checkExited(Integer state, JdiCause cause) { - switch (state) { - case ThreadReference.THREAD_STATUS_NOT_STARTED: { - break; - } - case ThreadReference.THREAD_STATUS_MONITOR: { - break; - } - case ThreadReference.THREAD_STATUS_WAIT: { - onStopped(); - break; - } - case ThreadReference.THREAD_STATUS_ZOMBIE: { - break; - } - case ThreadReference.THREAD_STATUS_SLEEPING: { - break; - } - case ThreadReference.THREAD_STATUS_RUNNING: { - resetModified(); - onRunning(); - break; - } - case ThreadReference.THREAD_STATUS_UNKNOWN: { - break; - } - } - } - - protected void onRunning() { - // Nothing to do here - } - - protected void onStopped() { - Map existingAttributes = getCachedAttributes(); - Boolean autoupdate = (Boolean) existingAttributes.get("autoupdate"); - if (autoupdate != null && autoupdate) { - requestAttributes(RefreshBehavior.REFRESH_ALWAYS); - requestElements(RefreshBehavior.REFRESH_ALWAYS); - } - } - - public void setModified(boolean modified) { - if (modified) { - changeAttributes(List.of(), List.of(), Map.of( // - MODIFIED_ATTRIBUTE_NAME, modified // - ), "Refreshed"); - } - } - - public void resetModified() { - changeAttributes(List.of(), List.of(), Map.of( // - MODIFIED_ATTRIBUTE_NAME, false // - ), "Refreshed"); - } - - public TargetObject searchForSuitable(Class type) { - List pathToClass = model.getRootSchema().searchForSuitable(type, path); - return model.getModelObject(pathToClass); - } - -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetObjectReference.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetObjectReference.java deleted file mode 100644 index a3d07840af..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetObjectReference.java +++ /dev/null @@ -1,133 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import com.sun.jdi.*; - -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.jdi.model.iface2.JdiModelTargetObject; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "ObjectReference", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(name = "UID", type = Long.class, required = true, fixed = true), - @TargetAttributeType(type = Object.class) - }) -public class JdiModelTargetObjectReference extends JdiModelTargetValue { - - private static final long MAX_REFERRERS = 100; - - protected final ObjectReference objref; - - protected JdiModelTargetThread owner; - private JdiModelTargetReferenceType referenceType; - - public JdiModelTargetObjectReference(JdiModelTargetObject object, ObjectReference objref, - boolean isElement) { - this(object, Long.toString(objref.uniqueID()), objref, isElement); - } - - public JdiModelTargetObjectReference(JdiModelTargetObject object, String id, - ObjectReference objref, boolean isElement) { - super(object, id, objref, isElement); - this.objref = objref; - - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDisplay(), // - "UID", objref.uniqueID() // - ), "Initialized"); - - } - - @Override - public CompletableFuture requestAttributes(RefreshBehavior refresh) { - - this.referenceType = (JdiModelTargetReferenceType) getInstance(objref.referenceType()); - - changeAttributes(List.of(), List.of(), Map.of( // - referenceType.getName(), referenceType // - ), "Initialized"); - - try { - ThreadReference owningThread = objref.owningThread(); - if (owningThread != null) { - owner = (JdiModelTargetThread) getInstance(owningThread); - changeAttributes(List.of(), List.of(), Map.of( // - "Owner", owner // - ), "Initialized"); - } - } - catch (IncompatibleThreadStateException e) { - // Ignore - } - try { - List waitingThreads = objref.waitingThreads(); - if (waitingThreads != null) { - JdiModelTargetThreadContainer targetWaitingThreads = - new JdiModelTargetThreadContainer(this, "Waiting Threads", waitingThreads); - changeAttributes(List.of(), List.of( // - targetWaitingThreads // - ), Map.of(), "Initialized"); - } - } - catch (IncompatibleThreadStateException e) { - // Ignore - } - try { - JdiModelTargetObjectReferenceContainer referringObjects = - new JdiModelTargetObjectReferenceContainer(this, "Referring Objects", - objref.referringObjects(MAX_REFERRERS)); - changeAttributes(List.of(), List.of( // - referringObjects // - ), Map.of(), "Initialized"); - } - catch (UnsupportedOperationException e) { - // Ignore - } - catch (IllegalArgumentException e) { - // Ignore - } - try { - int entryCount = objref.entryCount(); - changeAttributes(List.of(), List.of(), Map.of( // - "Entry Count", entryCount // - ), "Initialized"); - } - catch (IncompatibleThreadStateException e) { - // Ignore - } - return CompletableFuture.completedFuture(null); - } - - @Override - public CompletableFuture init() { - return CompletableFuture.completedFuture(null); - } - - @Override - public String getDisplay() { - return objref == null ? super.getDisplay() : objref.toString(); - } - -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetObjectReferenceContainer.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetObjectReferenceContainer.java deleted file mode 100644 index 7b75acc866..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetObjectReferenceContainer.java +++ /dev/null @@ -1,87 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model; - -import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import com.sun.jdi.ObjectReference; - -import ghidra.async.AsyncFence; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.jdi.model.iface2.JdiModelTargetObject; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; - -@TargetObjectSchemaInfo( - name = "TargetObjectReferenceContainer", - elements = { - @TargetElementType(type = JdiModelTargetObjectReference.class) - }, - elementResync = ResyncMode.ONCE, - attributes = { - @TargetAttributeType(type = Void.class) - }, - canonicalContainer = true) -public class JdiModelTargetObjectReferenceContainer extends JdiModelTargetObjectImpl { - - protected final List refs; - - // TODO: Is it possible to load the same object twice? - protected final Map objectsByName = new HashMap<>(); - - public JdiModelTargetObjectReferenceContainer(JdiModelTargetObject parent, String name, - List refs) { - super(parent, name); - this.refs = refs; - } - - protected CompletableFuture updateUsingReferences(Map byName) { - Map objects; - synchronized (this) { - objects = byName.entrySet() - .stream() - .collect(Collectors.toMap(e -> e.getKey(), e -> getTargetObject(e.getValue()))); - } - AsyncFence fence = new AsyncFence(); - for (JdiModelTargetObjectReference m : objects.values()) { - fence.include(m.init()); - } - return fence.ready().thenAccept(__ -> { - changeElements(List.of(), List.of(), objects, "Refreshed"); - }); - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - Map map = new HashMap<>(); - for (ObjectReference ref : refs) { - map.put(ref.toString(), ref); - } - objectsByName.keySet().retainAll(map.keySet()); - return updateUsingReferences(map); - } - - protected synchronized JdiModelTargetObjectReference getTargetObject(ObjectReference ref) { - return objectsByName.computeIfAbsent(ref.toString(), - n -> (JdiModelTargetObjectReference) getInstance(ref)); - } - - public synchronized JdiModelTargetObjectReference getTargetObjectIfPresent(String name) { - return objectsByName.get(name); - } -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetProcess.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetProcess.java deleted file mode 100644 index 9fa60f265d..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetProcess.java +++ /dev/null @@ -1,132 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model; - -import java.io.*; -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import ghidra.dbg.jdi.manager.JdiConsoleOutputListener; -import ghidra.dbg.jdi.model.iface1.JdiModelSelectableObject; -import ghidra.dbg.jdi.model.iface1.JdiModelTargetConsole; -import ghidra.dbg.target.TargetConsole; -import ghidra.dbg.target.TargetExecutionStateful.TargetExecutionState; -import ghidra.dbg.target.schema.*; -import ghidra.lifecycle.Internal; -import ghidra.util.Msg; - -@TargetObjectSchemaInfo( - name = "Process", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(name = "state", type = TargetExecutionState.class, hidden = true), - @TargetAttributeType(type = Void.class) - }) -public class JdiModelTargetProcess extends JdiModelTargetObjectImpl - implements JdiModelTargetConsole, JdiConsoleOutputListener, JdiModelSelectableObject { - - public static String getUniqueId(Process obj) { - return Long.toHexString(obj.pid()); - } - - static String STATE_ATTRIBUTE_NAME = PREFIX_INVISIBLE + "state"; - - protected final Process process; - - //private PrintWriter writer; - private Thread input; - private Thread error; - - public JdiModelTargetProcess(JdiModelTargetVM vm, Process process, boolean isElement) { - super(vm, getUniqueId(process), process, isElement); - this.process = process; - - //writer = new PrintWriter(process.getOutputStream()); - input = new Thread(() -> readStream(process.getInputStream(), TargetConsole.Channel.STDOUT), - "JDI process input reader"); - input.start(); - error = new Thread(() -> readStream(process.getErrorStream(), TargetConsole.Channel.STDERR), - "JDI process error reader"); - error.start(); - - changeAttributes(List.of(), List.of(), Map.of( // - STATE_ATTRIBUTE_NAME, convertState(process.isAlive()), // - DISPLAY_ATTRIBUTE_NAME, getDisplay() // - ), "Initialized"); - } - - @Override - public String getDisplay() { - if (process == null) { - return super.getDisplay(); - } - StringBuilder sb = new StringBuilder(); - sb.append("Process " + process.pid()); - sb.append(" alive="); - sb.append(process.isAlive()); - return sb.toString(); - } - - protected TargetExecutionState convertState(boolean isAlive) { - return isAlive ? TargetExecutionState.ALIVE : TargetExecutionState.TERMINATED; - } - - @Override - @Internal - public CompletableFuture setActive() { - return CompletableFuture.completedFuture(null); - ///return thread.select(); - } - - @Override - public void output(TargetConsole.Channel channel, String out) { - switch (channel) { - case STDOUT: - channel = TargetConsole.Channel.STDOUT; - break; - case STDERR: - channel = TargetConsole.Channel.STDERR; - break; - default: - throw new AssertionError(); - } - broadcast().consoleOutput(this, channel, out); - } - - private void readStream(InputStream in, TargetConsole.Channel channel) { - BufferedReader reader = new BufferedReader(new InputStreamReader(in)); - try { - String line; - while (process.isAlive() && null != (line = reader.readLine())) { - System.err.println(line); - output(channel, line); - } - } - catch (Throwable e) { - Msg.debug(this, channel + ", reader exiting because " + e); - //throw new AssertionError(e); - } - } - - @Override - public CompletableFuture write(byte[] data) { - // TODO Auto-generated method stub - return null; - } -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetReferenceType.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetReferenceType.java deleted file mode 100644 index abfdc9fdbb..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetReferenceType.java +++ /dev/null @@ -1,178 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import com.sun.jdi.*; - -import ghidra.async.AsyncFence; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.jdi.model.iface2.JdiModelTargetObject; -import ghidra.dbg.target.TargetModule; -import ghidra.dbg.target.schema.*; -import ghidra.program.model.address.Address; -import ghidra.program.model.address.AddressRangeImpl; - -@TargetObjectSchemaInfo( - name = "ReferenceType", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(name = "Attributes", type = JdiModelTargetAttributesContainer.class), - @TargetAttributeType(type = Object.class) - }) -public class JdiModelTargetReferenceType extends JdiModelTargetType implements TargetModule { - - protected final ReferenceType reftype; - private long maxInstances = 100; - - private JdiModelTargetFieldContainer allFields; - private JdiModelTargetMethodContainer allMethods; - private JdiModelTargetFieldContainer fields; - private JdiModelTargetMethodContainer methods; - private JdiModelTargetObjectReferenceContainer instances; - private JdiModelTargetObjectReference classObject; - private JdiModelTargetObjectReference classLoader; - private JdiModelTargetLocationContainer locations; - - private JdiModelTargetAttributesContainer addedAttributes; - protected JdiModelTargetSectionContainer sections; - - public JdiModelTargetReferenceType(JdiModelTargetObject parent, ReferenceType reftype, - boolean isElement) { - this(parent, reftype.name(), reftype, isElement); - } - - public JdiModelTargetReferenceType(JdiModelTargetObject parent, String id, - ReferenceType reftype, boolean isElement) { - super(parent, id, reftype, isElement); - this.reftype = reftype; - - if (reftype instanceof ClassType) { - this.sections = new JdiModelTargetSectionContainer(this); - if (sections != null) { - changeAttributes(List.of(), List.of( // - sections // - ), Map.of(), "Initialized"); - } - } - - // NB. Relevant ranges are in sections - Address zero = impl.getAddressSpace("ram").getAddress(0L); - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, reftype.name(), // - SHORT_DISPLAY_ATTRIBUTE_NAME, reftype.name(), // - RANGE_ATTRIBUTE_NAME, new AddressRangeImpl(zero, zero), // - MODULE_NAME_ATTRIBUTE_NAME, reftype.name() // - ), "Initialized"); - - } - - private void populateAttributes() { - this.addedAttributes = new JdiModelTargetAttributesContainer(this, "Attributes"); - Map attrs = new HashMap<>(); - if (reftype instanceof ArrayType) { - return; - } - try { - attrs.put("isAbstract", reftype.isAbstract()); - attrs.put("isFinal", reftype.isFinal()); - attrs.put("isInitialized", reftype.isInitialized()); - attrs.put("isPackagePrivate", reftype.isPackagePrivate()); - attrs.put("isPrepared", reftype.isPrepared()); - attrs.put("isPrivate", reftype.isPrivate()); - attrs.put("isProtected", reftype.isProtected()); - attrs.put("isPublic", reftype.isPublic()); - attrs.put("isStatic", reftype.isStatic()); - attrs.put("isVerified", reftype.isVerified()); - } - catch (Exception e) { - if (e instanceof ClassNotLoadedException) { - attrs.put("status", "Class not loaded"); - } - } - attrs.put("defaultStratum", reftype.defaultStratum()); - attrs.put("availableStata", reftype.availableStrata()); - attrs.put("failedToInitialize", reftype.failedToInitialize()); - addedAttributes.addAttributes(attrs); - } - - @Override - public CompletableFuture requestAttributes(RefreshBehavior refresh) { - - this.allFields = new JdiModelTargetFieldContainer(this, true); - this.allMethods = new JdiModelTargetMethodContainer(this, true); - this.fields = new JdiModelTargetFieldContainer(this, false); - this.methods = new JdiModelTargetMethodContainer(this, false); - this.instances = new JdiModelTargetObjectReferenceContainer(this, "Objects", - reftype.instances(maxInstances)); - this.classLoader = reftype.classLoader() == null ? null - : new JdiModelTargetObjectReference(this, reftype.classLoader(), false); - this.classObject = (JdiModelTargetObjectReference) getInstance(reftype.classObject()); - - populateAttributes(); - - changeAttributes(List.of(), List.of( // - allFields, // - allMethods, // - fields, // - methods, // - instances, // - addedAttributes // - ), Map.of( // - "Class Object", classObject // - ), "Initialized"); - - try { - this.locations = - new JdiModelTargetLocationContainer(this, "Locations", reftype.allLineLocations()); - if (locations != null) { - changeAttributes(List.of(), List.of( // - locations // - ), Map.of(), "Initialized"); - } - } - catch (AbsentInformationException e) { - // Ignore - } - if (classLoader != null) { - changeAttributes(List.of(), List.of(), Map.of( // - "Class Loader", classLoader // - ), "Initialized"); - } - return CompletableFuture.completedFuture(null); - } - - @Override - public CompletableFuture init() { - AsyncFence fence = new AsyncFence(); - //fence.include(methods.requestElements(true)); - return fence.ready(); - } - - @Override - public String getDisplay() { - return reftype == null ? super.getDisplay() : reftype.name(); - } - - public JdiModelTargetMethodContainer getAllMethods() { - return allMethods; - } - -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetRegister.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetRegister.java deleted file mode 100644 index 1afe5082ba..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetRegister.java +++ /dev/null @@ -1,96 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import com.sun.jdi.Location; - -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.jdi.model.iface2.JdiModelTargetObject; -import ghidra.dbg.target.TargetRegister; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.util.ConversionUtils; -import ghidra.program.model.address.Address; - -@TargetObjectSchemaInfo( - name = "RegisterDescriptor", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType( - name = TargetRegister.CONTAINER_ATTRIBUTE_NAME, - type = JdiModelTargetRegisterContainer.class), - @TargetAttributeType(type = Void.class) - }) -public class JdiModelTargetRegister extends JdiModelTargetObjectImpl implements TargetRegister { - - protected final String name; - protected Address addr; - - public JdiModelTargetRegister(JdiModelTargetObject parent, String name, boolean isElement) { - super(parent, name, name, isElement); - this.name = name; - - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDisplay(), // - CONTAINER_ATTRIBUTE_NAME, parent, // - BIT_LENGTH_ATTRIBUTE_NAME, Long.SIZE // - ), "Initialized"); - } - - @Override - public CompletableFuture requestAttributes(RefreshBehavior refresh) { - - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDisplay() // - ), "Initialized"); - - return CompletableFuture.completedFuture(null); - } - - @Override - public CompletableFuture init() { - return CompletableFuture.completedFuture(null); - } - - @Override - public String getDisplay() { - if (name == null) { - return super.getDisplay(); - } - return addr == null ? name : name + ":" + addr; - } - - public byte[] readRegister(Location location) { - Address oldval = (Address) getCachedAttribute(VALUE_ATTRIBUTE_NAME); - addr = JdiModelTargetLocation.getAddressFromLocation(impl, location); - - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDisplay(), // - VALUE_ATTRIBUTE_NAME, addr // - ), "Initialized"); - setModified(!addr.equals(oldval)); - - byte[] bytes = - ConversionUtils.bigIntegerToBytes(getBitLength() / 8, addr.getOffsetAsBigInteger()); - return bytes; - } - -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetRegisterContainer.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetRegisterContainer.java deleted file mode 100644 index 28cf34b231..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetRegisterContainer.java +++ /dev/null @@ -1,145 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import com.sun.jdi.Location; - -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.TargetRegisterBank; -import ghidra.dbg.target.TargetRegisterContainer; -import ghidra.dbg.target.schema.*; -import ghidra.util.Msg; - -@TargetObjectSchemaInfo( - name = "TargetRegisterContainer", - elements = { - @TargetElementType(type = JdiModelTargetRegister.class) - }, - attributes = { - @TargetAttributeType(type = Void.class) - }, - canonicalContainer = true) -public class JdiModelTargetRegisterContainer extends JdiModelTargetObjectImpl - implements TargetRegisterBank, TargetRegisterContainer { - - private final Map registersByName = new HashMap<>(); - - private JdiModelTargetThread thread; - private JdiModelTargetRegister pc; - private JdiModelTargetRegister sp; - private JdiModelTargetRegister retAddr; - - public JdiModelTargetRegisterContainer(JdiModelTargetThread thread) { - super(thread, "Registers"); - this.thread = thread; - this.pc = new JdiModelTargetRegister(this, "PC", true); - this.sp = new JdiModelTargetRegister(this, "SP", true); - this.retAddr = new JdiModelTargetRegister(this, "return_address", true); - registersByName.put(pc.getName(), pc); - registersByName.put(sp.getName(), sp); - registersByName.put(retAddr.getName(), retAddr); - changeElements(List.of(), List.of( // - pc, // - sp, // - retAddr // - ), "Initialized"); - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getName(), // - DESCRIPTIONS_ATTRIBUTE_NAME, this // - ), "Initialized"); - } - - /* - @Override - public CompletableFuture requestAttributes(boolean refresh) { - - changeAttributes(List.of(), List.of( // - pc, // - sp, // - retAddr // - ), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getName(), // - DESCRIPTIONS_ATTRIBUTE_NAME, this // - ), "Initialized"); - - return CompletableFuture.completedFuture(null); - } - */ - - protected synchronized JdiModelTargetRegister getTargetRegister(String rname) { - return registersByName.computeIfAbsent(rname, - n -> new JdiModelTargetRegister(this, rname, true)); - } - - public synchronized JdiModelTargetRegister getTargetMethodIfPresent(String rname) { - return registersByName.get(rname); - } - - @Override - - public CompletableFuture> readRegistersNamed( - Collection names) { - Map map = new HashMap<>(); - Location pcLoc = thread.getLocation(); - Location spLoc = null; - Location raLoc = null; - - JdiModelTargetStackFrame targetFrame = thread.stack.getTargetFrame(1); - if (targetFrame != null) { - JdiModelTargetLocation loc = targetFrame.location; - if (loc != null) { - raLoc = loc.location; - } - } - - if (pcLoc != null) { - byte[] bytes = pc.readRegister(pcLoc); - map.put(pc.getIndex(), bytes); - } - //if (spLoc != null) { - // byte[] bytes = sp.readRegister(spLoc); - // map.put(sp.getIndex(), bytes); - //} - if (raLoc != null) { - byte[] bytes = retAddr.readRegister(raLoc); - map.put(retAddr.getIndex(), bytes); - } - if (!map.isEmpty()) { - broadcast().registersUpdated(this, map); - } - return CompletableFuture.completedFuture(map); - } - - @Override - public CompletableFuture writeRegistersNamed(Map values) { - // TODO Auto-generated method stub - return null; - } - - public void invalidateRegisterCaches() { - broadcast().invalidateCacheRequested(this); - } - - protected CompletableFuture update() { - return fetchElements(RefreshBehavior.REFRESH_ALWAYS).exceptionally(e -> { - Msg.error(this, "Could not update registers " + this + " on STOPPED"); - return null; - }); - } -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetRoot.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetRoot.java deleted file mode 100644 index 7af4eb5295..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetRoot.java +++ /dev/null @@ -1,289 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model; - -import java.io.IOException; -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import com.sun.jdi.*; -import com.sun.jdi.connect.*; -import com.sun.jdi.connect.Connector.Argument; - -import ghidra.async.AsyncUtils; -import ghidra.dbg.DebugModelConventions; -import ghidra.dbg.agent.DefaultTargetModelRoot; -import ghidra.dbg.jdi.manager.*; -import ghidra.dbg.jdi.manager.impl.DebugStatus; -import ghidra.dbg.jdi.model.iface1.*; -import ghidra.dbg.jdi.model.iface2.JdiModelTargetObject; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetMethod.TargetParameterMap; -import ghidra.dbg.target.schema.*; -import ghidra.util.Msg; - -/** - *

- * TODO: It would probably be better to implement {@link TargetLauncher} on each connector, rather - * than using "focus" (a UI concept) to decide which to use. Additionally, for each connector, we - * can decide whether to implement {@link TargetLauncher} or {@link TargetAttacher} based on whether - * it's a {@link LaunchingConnector} or an {@link AttachingConnector}. Granted, there are some UI - * hiccups to work out when/if we take that approach, since - * {@link DebugModelConventions#findSuitable(Class, TargetObject)} requires a unique answer. That - * would mean neither attach nor launch will be enabled anywhere except on a connector.... - */ -@TargetObjectSchemaInfo( - name = "Debugger", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType( - name = "Attributes", - type = JdiModelTargetAttributesContainer.class, - required = true, - fixed = true), - @TargetAttributeType( - name = "Connectors", - type = JdiModelTargetConnectorContainer.class, - required = true, - fixed = true), - @TargetAttributeType( - name = "VMs", - type = JdiModelTargetVMContainer.class, - required = true, - fixed = true), - @TargetAttributeType(type = Void.class) - }) -public class JdiModelTargetRoot extends DefaultTargetModelRoot implements // - JdiModelTargetAccessConditioned, // - //JdiModelTargetAttacher, // - JdiModelTargetFocusScope, // - //TargetFocusScope, // - //JdiModelTargetInterpreter, // - JdiModelTargetInterruptible, // - JdiModelTargetLauncher, // - JdiModelTargetEventScope, // - JdiEventsListenerAdapter { - protected static final String JDB_PROMPT = ">"; - - protected final JdiModelImpl impl; - protected String display = "JDI"; - - protected final VirtualMachineManager vmm; - protected final JdiModelTargetVMContainer vms; - protected final JdiModelTargetConnectorContainer connectors; - protected JdiModelTargetAttributesContainer addedAttributes; - - private boolean accessible = true; - protected JdiModelSelectableObject focus; - - protected String debugger = "Jdi"; // Used by JdiModelTargetEnvironment - - public JdiModelTargetRoot(JdiModelImpl impl, TargetObjectSchema schema) { - super(impl, "VirtualMachineManager", schema); - this.impl = impl; - this.vmm = this.impl.getManager().getVirtualMachineManager(); - - this.vms = new JdiModelTargetVMContainer(this); - this.connectors = new JdiModelTargetConnectorContainer(this); - - populateAttributes(); - - changeAttributes(List.of(), List.of( // - vms, // - connectors, // - addedAttributes // - ), Map.of( // - ACCESSIBLE_ATTRIBUTE_NAME, accessible, // - DISPLAY_ATTRIBUTE_NAME, display, // - TargetMethod.PARAMETERS_ATTRIBUTE_NAME, TargetCmdLineLauncher.PARAMETERS // - ), "Initialized"); - - impl.getManager().addEventsListener(null, this); - //impl.getManager().addConsoleOutputListener(this); - } - - @Override - public JdiModelImpl getModelImpl() { - return impl; - } - - private void populateAttributes() { - this.addedAttributes = new JdiModelTargetAttributesContainer(this, "Attributes"); - Map attrs = new HashMap<>(); - attrs.put("Major Version", vmm.majorInterfaceVersion()); - attrs.put("Minor Version", vmm.minorInterfaceVersion()); - addedAttributes.addAttributes(attrs); - } - - @Override - public String getDisplay() { - return display; - } - - /*/// - @Override - public void output(JdiManager.Channel JdiChannel, String out) { - TargetInterpreter.Channel dbgChannel; - switch (JdiChannel) { - case STDOUT: - dbgChannel = TargetInterpreter.Channel.STDOUT; - break; - case STDERR: - dbgChannel = TargetInterpreter.Channel.STDERR; - break; - default: - throw new AssertionError(); - } - listeners.fire(TargetInterpreterListener.class).consoleOutput(this, dbgChannel, out); - } - */ - - @Override - public DebugStatus vmSelected(VirtualMachine vm, JdiCause cause) { - if (vm.allThreads().isEmpty()) { - JdiModelTargetVM targetVM = vms.getTargetVM(vm); - setFocus(targetVM); - } - // Otherwise, we'll presumably get the =thread-selected event - return DebugStatus.NO_CHANGE; - } - - @Override - public DebugStatus threadSelected(ThreadReference thread, StackFrame frame, JdiCause cause) { - JdiModelTargetVM vm = vms.getTargetVM(thread.threadGroup().virtualMachine()); - JdiModelTargetThread t = vm.threads.getTargetThread(thread); - if (frame == null) { - setFocus(t); - return DebugStatus.NO_CHANGE; - } - JdiModelTargetStackFrame f = t.stack.getTargetFrame(frame); - setFocus(f); - return DebugStatus.NO_CHANGE; - } - - public void setAccessible(boolean accessible) { - synchronized (attributes) { - if (this.accessible == accessible) { - return; - } - this.accessible = accessible; - changeAttributes(List.of(), List.of(), Map.of( // - ACCESSIBLE_ATTRIBUTE_NAME, accessible // - ), "Accessibility changed"); - } - } - - @Override - public boolean isAccessible() { - return accessible; - } - - @Override - public CompletableFuture launch(Map args) { - JdiManager manager = impl.getManager(); - JdiModelTargetConnector targetConnector = connectors.getDefaultConnector(); - Connector cx = (targetConnector != null) ? targetConnector.cx - : manager.getVirtualMachineManager().defaultConnector(); - Map defaultArguments = cx.defaultArguments(); - Map jdiArgs = JdiModelTargetLauncher.getArguments(defaultArguments, - JdiModelTargetLauncher.getParameters(defaultArguments), args); - getManager().addVM(cx, jdiArgs); - return CompletableFuture.completedFuture(null); - } - - /** - * {@inheritDoc} - * - *

- * TODO: Technically, this should be done by setting - * {@link TargetMethod#PARAMTERS_ATTRIBUTE_NAME} whenever the default connector changes. - * However, that's really only needed if this is to be marshalled over GADP, and that is not the - * case. Listening for parameter description changes doesn't seem like a normal thing to do - * otherwise. - */ - @Override - public TargetParameterMap getParameters() { - JdiManager manager = impl.getManager(); - JdiModelTargetConnector targetConnector = connectors.getDefaultConnector(); - Connector cx = (targetConnector != null) ? targetConnector.cx - : manager.getVirtualMachineManager().defaultConnector(); - Map defaultArguments = cx.defaultArguments(); - return TargetParameterMap.copyOf(JdiModelTargetLauncher.getParameters(defaultArguments)); - } - - public CompletableFuture attach(long pid) { - JdiManager manager = impl.getManager(); - JdiModelTargetConnector targetConnector = - connectors.getTargetConnectorIfPresent("SocketAttach"); - if (targetConnector == null) { - Msg.error(this, "No match found in connectors for SocketAttach"); - } - else { - Connector cx = targetConnector.cx; - manager.addVM(cx, List.of(Long.toString(pid))); - } - return CompletableFuture.completedFuture(null); - } - - @Override - public CompletableFuture interrupt() { - try { - impl.getManager().sendInterruptNow(); - } - catch (IOException e) { - Msg.error(this, "Could not interrupt", e); - } - return AsyncUtils.nil(); - } - - protected void invalidateMemoryAndRegisterCaches() { - vms.invalidateMemoryAndRegisterCaches(); - } - - @Override - public boolean setFocus(JdiModelSelectableObject sel) { - boolean doFire; - synchronized (this) { - doFire = !Objects.equals(this.focus, sel); - this.focus = sel; - } - if (doFire) { - changeAttributes(List.of(), List.of(), Map.of( // - FOCUS_ATTRIBUTE_NAME, focus // - ), "Focus changed"); - return true; - } - return false; - } - - @Override - public JdiModelSelectableObject getFocus() { - return focus; - } - - @Override - public Object getObject() { - return null; - } - - @Override - public JdiModelTargetObject getTargetObject(Object object) { - return null; - } - -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetSection.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetSection.java deleted file mode 100644 index 5518d138fb..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetSection.java +++ /dev/null @@ -1,103 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import com.sun.jdi.Method; - -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.TargetMemoryRegion; -import ghidra.dbg.target.TargetSection; -import ghidra.dbg.target.schema.*; -import ghidra.program.model.address.AddressRange; - -@TargetObjectSchemaInfo( - name = "Section", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(type = Void.class) - }) -public class JdiModelTargetSection extends JdiModelTargetObjectImpl implements // - //TargetMemory, - TargetMemoryRegion, TargetSection { - - protected final Method method; - private AddressRange range; - - public JdiModelTargetSection(JdiModelTargetSectionContainer parent, Method method, - boolean isElement) { - super(parent, method.toString(), method, isElement); - this.method = method; - - this.range = impl.getAddressRange(method); - - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDisplay(), // - MODULE_ATTRIBUTE_NAME, parent.getClassType(), // - READABLE_ATTRIBUTE_NAME, true, // - MEMORY_ATTRIBUTE_NAME, parent, TargetMemoryRegion.RANGE_ATTRIBUTE_NAME, range // - ), "Initialized"); - } - - public JdiModelTargetSection(JdiModelTargetSectionContainer parent) { - super(parent); - this.method = null; - - range = impl.defaultRange; - - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDisplay(), // - MODULE_ATTRIBUTE_NAME, parent.getClassType(), // - TargetMemoryRegion.RANGE_ATTRIBUTE_NAME, range // - ), "Initialized"); - } - - @Override - public CompletableFuture requestAttributes(RefreshBehavior refresh) { - - this.range = method == null ? impl.defaultRange : impl.getAddressRange(method); - if (range != null) { - changeAttributes(List.of(), List.of(), Map.of(), "Initialized"); - } - - return CompletableFuture.completedFuture(null); - } - - @Override - public CompletableFuture init() { - return CompletableFuture.completedFuture(null); - } - - @Override - public String getDisplay() { - if (method == null) - return "NULL"; - JdiModelTargetReferenceType classType = - ((JdiModelTargetSectionContainer) parent).getClassType(); - return classType.getName() + ":" + method.signature(); - } - - @Override - public AddressRange getRange() { - return range; - } - -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetSectionContainer.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetSectionContainer.java deleted file mode 100644 index 4f1435cb9d..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetSectionContainer.java +++ /dev/null @@ -1,145 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import com.sun.jdi.Method; - -import ghidra.async.AsyncFence; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.TargetMemory; -import ghidra.dbg.target.schema.*; -import ghidra.program.model.address.Address; -import ghidra.program.model.address.AddressSpace; - -@TargetObjectSchemaInfo( - name = "TargetSectionContainer", - elements = { - @TargetElementType(type = JdiModelTargetSection.class) - }, - attributes = { - @TargetAttributeType(type = Void.class) - }, - canonicalContainer = true) -public class JdiModelTargetSectionContainer extends JdiModelTargetObjectImpl - implements TargetMemory { - - protected final JdiModelTargetReferenceType reftype; - - private final Map sectionsByName = new HashMap<>(); - private JdiModelTargetConstantPool constantPool; - - //private JdiModelTargetConstantPool constantPool; - - public JdiModelTargetSectionContainer(JdiModelTargetReferenceType reftype) { - super(reftype, "Sections"); - this.reftype = reftype; - new JdiModelTargetSection(this); // default section - } - - protected void updateUsingSections(List methods) { - setElements(sectionsByName.values(), Map.of(), "Refreshed"); - } - - @Override - protected CompletableFuture requestAttributes(RefreshBehavior refresh) { - - constantPool = new JdiModelTargetConstantPool(this, reftype.reftype.constantPool(), false); - changeAttributes(List.of(), List.of( // - constantPool // - ), Map.of(), "Initialized"); - - return CompletableFuture.completedFuture(null); - } - - @Override - protected CompletableFuture requestElements(RefreshBehavior refresh) { - updateUsingSections(reftype.reftype.methods()); - return CompletableFuture.completedFuture(null); - } - - protected synchronized JdiModelTargetSection getTargetSection(Method method) { - return sectionsByName.computeIfAbsent(JdiModelImpl.methodToKey(method), - n -> new JdiModelTargetSection(this, method, true)); - } - - public synchronized JdiModelTargetSection getTargetSectionIfPresent(String name) { - return sectionsByName.get(name); - } - - @Override - public CompletableFuture init() { - AsyncFence fence = new AsyncFence(); - for (JdiModelTargetSection method : sectionsByName.values()) { - fence.include(method.init()); - } - return fence.ready(); - } - - public JdiModelTargetReferenceType getClassType() { - return reftype; - } - - public void addSection(Method method) { - if (impl.getAddressRange(method) != null) { - JdiModelTargetSection targetSection = getTargetSection(method); - sectionsByName.put(JdiModelImpl.methodToKey(method), targetSection); - changeElements(List.of(), List.of(targetSection), Map.of(), "Refreshed"); - } - else { - System.err.println("addSection returned null: " + method.location()); - } - } - - @Override - public CompletableFuture readMemory(Address address, int length) { - AddressSpace addressSpace = address.getAddressSpace(); - if (addressSpace.equals(impl.getAddressSpace("ram"))) { - byte[] bytes = new byte[length]; - Method method = impl.getMethodForAddress(address); - if (method != null && targetVM.vm.canGetBytecodes()) { - byte[] bytecodes = method.bytecodes(); - int i = 0; - for (byte b : bytecodes) { - bytes[i++] = b; - if (i >= length) - break; - } - } - else { - for (int i = 0; i < length; i++) { - bytes[i] = (byte) 0xFF; - } - } - broadcast().memoryUpdated(this, address, bytes); - return CompletableFuture.completedFuture(bytes); - } - if (addressSpace.equals(impl.getAddressSpace("constantPool"))) { - byte[] bytes = constantPool.getPool(); - broadcast().memoryUpdated(this, address, bytes); - return CompletableFuture.completedFuture(bytes); - } - throw new RuntimeException(); - } - - @Override - public CompletableFuture writeMemory(Address address, byte[] data) { - return CompletableFuture.completedFuture(null); - } - -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetStack.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetStack.java deleted file mode 100644 index f213624caf..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetStack.java +++ /dev/null @@ -1,116 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import com.sun.jdi.*; - -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.TargetStack; -import ghidra.dbg.target.schema.*; -import ghidra.util.Msg; -import ghidra.util.datastruct.WeakValueHashMap; - -@TargetObjectSchemaInfo( - name = "Stack", - elements = { - @TargetElementType(type = JdiModelTargetStackFrame.class) - }, - attributes = { - @TargetAttributeType(type = Void.class) - }, - canonicalContainer = true) -public class JdiModelTargetStack extends JdiModelTargetObjectImpl - implements TargetStack { - - protected final JdiModelTargetThread thread; - - protected final Map framesByLocation = - new WeakValueHashMap<>(); - protected final Map framesByLevel = new WeakValueHashMap<>(); - - public JdiModelTargetStack(JdiModelTargetThread thread) { - super(thread, "Stack"); - this.thread = thread; - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - List targetFrames = new ArrayList<>(); - List frames; - try { - frames = thread.thread.frames(); - int i = 0; - for (StackFrame frame : frames) { - JdiModelTargetStackFrame targetFrame = getTargetFrame(i++, frame); - targetFrames.add(targetFrame); - } - setElements(targetFrames, Map.of(), "Refreshed"); - } - catch (IncompatibleThreadStateException e) { - // Ignore e.printStackTrace(); - } - return CompletableFuture.completedFuture(null); - } - - protected synchronized JdiModelTargetStackFrame getTargetFrame(int level, StackFrame frame) { - return framesByLocation.compute(frame.location(), (l, f) -> { - if (f == null || f.getFrameLevel() != level) { - JdiModelTargetStackFrame tf = - new JdiModelTargetStackFrame(this, thread, level, frame, true); - framesByLevel.put(level, tf); - return tf; - } - framesByLevel.put(level, f); - f.setFrame(level, frame); - return f; - }); - } - - public JdiModelTargetStackFrame getTargetFrame(StackFrame frame) { - for (JdiModelTargetStackFrame f : framesByLocation.values()) { - if (f.frame.equals(frame)) { - return f; - } - } - return null; - } - - public JdiModelTargetStackFrame getTargetFrame(int level) { - return framesByLevel.get(Integer.valueOf(level)); - } - - /** - * Re-fetch the stack frames, generating events for updates - * - * JDI doesn't produce stack change events, but they should only ever happen by running a - * target. Thus, every time we're STOPPED, this method should be called. - * - * @return null - */ - protected CompletableFuture update() { - return fetchElements(RefreshBehavior.REFRESH_ALWAYS).exceptionally(e -> { - Msg.error(this, "Could not update stack " + this + " on STOPPED"); - return null; - }); - } - - public void invalidateRegisterCaches() { - broadcast().invalidateCacheRequested(this); - } -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetStackFrame.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetStackFrame.java deleted file mode 100644 index a8369377af..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetStackFrame.java +++ /dev/null @@ -1,155 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import com.sun.jdi.*; - -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.jdi.manager.JdiCause; -import ghidra.dbg.jdi.manager.JdiEventsListenerAdapter; -import ghidra.dbg.jdi.manager.impl.DebugStatus; -import ghidra.dbg.jdi.model.iface1.JdiModelSelectableObject; -import ghidra.dbg.jdi.model.iface1.JdiModelTargetFocusScope; -import ghidra.dbg.target.TargetFocusScope; -import ghidra.dbg.target.TargetStackFrame; -import ghidra.dbg.target.schema.*; -import ghidra.program.model.address.Address; -import ghidra.util.Msg; - -@TargetObjectSchemaInfo( - name = "StackFrame", - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType(type = Object.class) }) -public class JdiModelTargetStackFrame extends JdiModelTargetObjectImpl implements TargetStackFrame, // - //TargetRegisterBank, // - JdiEventsListenerAdapter, // - JdiModelSelectableObject { - - public static String getUniqueId(int level) { - return Integer.toString(level); - } - - public static final String FUNC_ATTRIBUTE_NAME = PREFIX_INVISIBLE + "function"; - public static final String FROM_ATTRIBUTE_NAME = PREFIX_INVISIBLE + "from"; // TODO - - protected final JdiModelTargetThread thread; - protected JdiModelTargetLocalVariableContainer variables; - protected JdiModelTargetValueMap values; - protected JdiModelTargetObjectReference thisObject; - protected JdiModelTargetLocation location; - protected JdiModelTargetValueContainer arguments; - - protected StackFrame frame; - protected Address pc; - protected long level; - - public JdiModelTargetStackFrame(JdiModelTargetStack stack, JdiModelTargetThread thread, - int level, StackFrame frame, boolean isElement) { - super(stack, getUniqueId(level), frame, isElement); - this.thread = thread; - this.level = level; - this.frame = frame; - - this.location = new JdiModelTargetLocation(this, frame.location(), false); - - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDisplay(), // - LOCATION_ATTRIBUTE_NAME, location, // - THREAD_ATTRIBUTE_NAME, thread.getName(), // - PC_ATTRIBUTE_NAME, location.getAddress() // - ), "Initialized"); - } - - @Override - public CompletableFuture requestAttributes(RefreshBehavior refresh) { - - //this.arguments = new JdiModelTargetValueContainer(this, "Arguments", frame.getArgumentValues()); - - ObjectReference obj = frame.thisObject(); - if (obj != null) { - this.thisObject = (JdiModelTargetObjectReference) getInstance(obj); - changeAttributes(List.of(), List.of(), Map.of( // - THIS_OBJECT_ATTRIBUTE_NAME, thisObject // - ), "Initialized"); - } - try { - this.variables = new JdiModelTargetLocalVariableContainer(this, "Visible Variables", - frame.visibleVariables()); - Map map = frame.getValues(frame.visibleVariables()); - this.values = new JdiModelTargetValueMap(this, map); - changeAttributes(List.of(), List.of( // - variables, // - values // - ), Map.of(), "Initialized"); - } - catch (AbsentInformationException e) { - // Ignore - } - - return CompletableFuture.completedFuture(null); - } - - @Override - public String getDisplay() { - if (frame == null) { - return super.getDisplay(); - } - Location loc = null; - try { - loc = frame.location(); - } - catch (InvalidStackFrameException e) { - Msg.error(this, "Invalid stack frame"); - } - return String.format("#%d %s", level, loc); - } - - @Override - public DebugStatus threadSelected(ThreadReference eventThread, StackFrame eventFrame, - JdiCause cause) { - if (eventThread.equals(thread.thread) && eventFrame.equals(frame)) { - ((JdiModelTargetFocusScope) searchForSuitable(TargetFocusScope.class)).setFocus(this); - } - return DebugStatus.NO_CHANGE; - } - - @Override - public CompletableFuture setActive() { - ///return frame.select(); - return CompletableFuture.completedFuture(null); - } - - public long getFrameLevel() { - return level; - } - - public void setFrameLevel(long level) { - this.level = level; - } - - public void setFrame(int level, StackFrame frame) { - this.frame = frame; - targetVM.setTargetObject(getUniqueId(level), frame, this); - setModified(true); - } - -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetThread.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetThread.java deleted file mode 100644 index 4e10a13ffc..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetThread.java +++ /dev/null @@ -1,415 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import com.sun.jdi.*; -import com.sun.jdi.event.*; -import com.sun.jdi.request.EventRequestManager; -import com.sun.jdi.request.StepRequest; - -import ghidra.async.AsyncFence; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.jdi.manager.*; -import ghidra.dbg.jdi.manager.impl.DebugStatus; -import ghidra.dbg.jdi.model.iface1.*; -import ghidra.dbg.jdi.model.iface2.JdiModelTargetObject; -import ghidra.dbg.target.TargetFocusScope; -import ghidra.dbg.target.TargetThread; -import ghidra.dbg.target.schema.*; -import ghidra.lifecycle.Internal; -import ghidra.util.Msg; - -@TargetObjectSchemaInfo( - name = "Thread", - elements = { // - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType(name = "Attributes", type = JdiModelTargetAttributesContainer.class), - @TargetAttributeType( - name = "Registers", - type = JdiModelTargetRegisterContainer.class, - required = true, - fixed = true), - @TargetAttributeType( - name = "Stack", - type = JdiModelTargetStack.class, - required = true, - fixed = true), - @TargetAttributeType(name = "Status", type = Integer.class), - @TargetAttributeType(name = "UID", type = Long.class, fixed = true), - @TargetAttributeType(type = Object.class) // - }, - canonicalContainer = true) -public class JdiModelTargetThread extends JdiModelTargetObjectReference implements // - TargetThread, // - JdiModelTargetAccessConditioned, // - JdiModelTargetExecutionStateful, // - JdiModelTargetInterruptible, // - JdiModelTargetKillable, // - JdiModelTargetResumable, // - JdiModelTargetSteppable, // - // TargetSuspendable, - JdiEventsListenerAdapter, // - JdiModelSelectableObject { - - protected static final TargetStepKindSet SUPPORTED_KINDS = TargetStepKindSet.of( // - TargetStepKind.FINISH, // - TargetStepKind.LINE, // - TargetStepKind.OVER, // - TargetStepKind.OVER_LINE, // - TargetStepKind.RETURN, // - TargetStepKind.UNTIL, // - TargetStepKind.EXTENDED); - - private EventRequestManager eventManager; - protected final ThreadReference thread; - - protected final JdiModelTargetStack stack; - protected final JdiModelTargetRegisterContainer registers; - protected JdiModelTargetLocation location; - - protected JdiModelTargetThreadGroupContainer threadGroup; - protected JdiModelTargetObjectReference currentContendedMonitor; - protected JdiModelTargetObjectReferenceContainer ownedMonitors; - protected JdiModelTargetAttributesContainer addedAttributes; - - public JdiModelTargetThread(JdiModelTargetObject parent, ThreadReference thread, - boolean isElement) { - super(parent, thread.name(), thread, isElement); - this.thread = thread; - this.eventManager = thread.virtualMachine().eventRequestManager(); - - this.stack = new JdiModelTargetStack(this); - this.registers = new JdiModelTargetRegisterContainer(this); - - impl.getManager().addEventsListener(targetVM.vm, this); - - TargetExecutionState targetState = convertState(thread.status()); - changeAttributes(List.of(), List.of( // - registers, // - stack // - ), Map.of( // - STATE_ATTRIBUTE_NAME, targetState, // - "Status", thread.status(), // - ACCESSIBLE_ATTRIBUTE_NAME, thread.isSuspended(), // - SUPPORTED_STEP_KINDS_ATTRIBUTE_NAME, SUPPORTED_KINDS, // - DISPLAY_ATTRIBUTE_NAME, display = getDisplay() // - ), "Initialized"); - - getManager().addStateListener(thread.virtualMachine(), accessListener); - } - - private void populateAttributes() { - this.addedAttributes = new JdiModelTargetAttributesContainer(this, "Attributes"); - Map attrs = new HashMap<>(); - attrs.put("isAtBreakpoint", thread.isAtBreakpoint()); - attrs.put("isCollected", thread.isCollected()); - attrs.put("isSuspended", thread.isSuspended()); - try { - attrs.put("entryCount", thread.entryCount()); - } - catch (IncompatibleThreadStateException e) { - // Ignore - } - try { - attrs.put("frameCount", thread.frameCount()); - } - catch (IncompatibleThreadStateException e) { - // Ignore - } - attrs.put("suspendCount", thread.suspendCount()); - addedAttributes.addAttributes(attrs); - } - - @Override - public CompletableFuture requestAttributes(RefreshBehavior refresh) { - - populateAttributes(); - - changeAttributes(List.of(), List.of( // - addedAttributes // - ), Map.of(), "Initialized"); - - if (targetVM.vm.canGetCurrentContendedMonitor()) { - try { - ObjectReference monitor = thread.currentContendedMonitor(); - if (monitor != null) { - currentContendedMonitor = (JdiModelTargetObjectReference) getInstance(monitor); - if (currentContendedMonitor != null) { - changeAttributes(List.of(), List.of(), Map.of( // - "Current Contended Monitor", currentContendedMonitor // - ), "Initialized"); - } - } - } - catch (IncompatibleThreadStateException e2) { - // Ignore - } - } - if (targetVM.vm.canGetOwnedMonitorInfo()) { - try { - this.ownedMonitors = new JdiModelTargetObjectReferenceContainer(this, - "Owned Monitors", thread.ownedMonitors()); - if (ownedMonitors != null) { - changeAttributes(List.of(), List.of( // - ownedMonitors // - ), Map.of(), "Initialized"); - } - } - catch (IncompatibleThreadStateException e1) { - // Ignore - } - } - ThreadGroupReference tg = thread.threadGroup(); - this.threadGroup = - tg == null ? null : new JdiModelTargetThreadGroupContainer(this, tg, false); - if (threadGroup != null) { - changeAttributes(List.of(), List.of(), Map.of( // - "Thread Group", thread.threadGroup() // - ), "Initialized"); - } - return CompletableFuture.completedFuture(null); - } - - @Override - public CompletableFuture init() { - AsyncFence fence = new AsyncFence(); - //fence.include(requestAttributes(true)); - return fence.ready(); - } - - @Override - public String getDisplay() { - if (thread == null) { - return super.getDisplay(); - } - StringBuilder sb = new StringBuilder(); - sb.append(thread.name()); - if (location != null) { - sb.append(" in "); - sb.append(location); - } - JdiModelTargetStackFrame top = stack.framesByLevel.get(0); - if (top != null && top.location != null) { - sb.append(" in "); - sb.append(top.location.getDisplay()); - } - return sb.toString(); - } - - protected TargetExecutionState convertState(int state) { - switch (state) { - case ThreadReference.THREAD_STATUS_RUNNING: - case ThreadReference.THREAD_STATUS_WAIT: - return thread.isSuspended() ? TargetExecutionState.STOPPED - : TargetExecutionState.RUNNING; - case ThreadReference.THREAD_STATUS_NOT_STARTED: - return TargetExecutionState.ALIVE; - default: - return TargetExecutionState.STOPPED; - } - } - - @Override - public DebugStatus stepComplete(StepEvent evt, JdiCause cause) { - if (evt.thread().equals(thread)) { - setLocation(evt.location()); - changeAttributes(List.of(), List.of(), Map.of( // - LOCATION_ATTRIBUTE_NAME, location // - ), "Refreshed"); - stateChanged(thread.status(), JdiReason.Reasons.STEP); - } - return DebugStatus.BREAK; - } - - @Override - public DebugStatus breakpointHit(BreakpointEvent evt, JdiCause cause) { - if (evt.thread().equals(thread)) { - setLocation(evt.location()); - changeAttributes(List.of(), List.of(), Map.of( // - LOCATION_ATTRIBUTE_NAME, location // - ), "Refreshed"); - stateChanged(thread.status(), JdiReason.Reasons.BREAKPOINT_HIT); - } - return DebugStatus.BREAK; - } - - // Which of these is actually going to fire, i.e. are separate events generated for subclasses? - - @Override - public DebugStatus watchpointHit(WatchpointEvent evt, JdiCause cause) { - if (evt.thread().equals(thread)) { - setLocation(evt.location()); - changeAttributes(List.of(), List.of(), Map.of( // - LOCATION_ATTRIBUTE_NAME, location // - ), "Refreshed"); - stateChanged(thread.status(), JdiReason.Reasons.WATCHPOINT_HIT); - } - return DebugStatus.BREAK; - } - - @Override - public DebugStatus accessWatchpointHit(AccessWatchpointEvent evt, JdiCause cause) { - if (evt.thread().equals(thread)) { - setLocation(evt.location()); - changeAttributes(List.of(), List.of(), Map.of( // - LOCATION_ATTRIBUTE_NAME, location // - ), "Refreshed"); - stateChanged(thread.status(), JdiReason.Reasons.ACCESS_WATCHPOINT_HIT); - } - return DebugStatus.BREAK; - } - - @Override - public DebugStatus threadSelected(ThreadReference eventThread, StackFrame frame, - JdiCause cause) { - if (eventThread.equals(thread) && frame == null) { - ((JdiModelTargetFocusScope) searchForSuitable(TargetFocusScope.class)).setFocus(this); - } - return DebugStatus.NO_CHANGE; - } - - private void stateChanged(int state, JdiReason reason) { - TargetExecutionState targetState = convertState(state); - if (targetState.equals(TargetExecutionState.STOPPED)) { - update(); - threadSelected(thread, null, JdiCause.Causes.UNCLAIMED); - } - targetVM.vmStateChanged(targetState, reason); - JdiEventHandler eventHandler = getManager().getEventHandler(targetVM.vm); - eventHandler.processThreadStateChanged(thread, state, reason); - } - - public void threadStateChanged(TargetExecutionState targetState) { - changeAttributes(List.of(), List.of(), Map.of( // - STATE_ATTRIBUTE_NAME, targetState // - ), "Refreshed"); - } - - protected CompletableFuture update() { - //Msg.debug(this, "Updating stack for " + this); - registers.update(); - return stack.update().thenAccept(__ -> { - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, getDisplay() // - ), "Refreshed"); - }).exceptionally(ex -> { - Msg.error(this, "Could not update stack for thread " + this, ex); - return null; - }); - } - - @Override - @Internal - public CompletableFuture setActive() { - return CompletableFuture.completedFuture(null); - } - - @Override - public CompletableFuture kill() { - thread.interrupt(); - return CompletableFuture.completedFuture(null); - } - - @Override - public CompletableFuture interrupt() { - thread.suspend(); - stateChanged(thread.status(), JdiReason.Reasons.INTERRUPT); - return CompletableFuture.completedFuture(null); - } - - //@Override - public CompletableFuture popFrame(StackFrame frame) { - try { - thread.popFrames(frame); - } - catch (IncompatibleThreadStateException e) { - e.printStackTrace(); - } - return CompletableFuture.completedFuture(null); - } - - @Override - public CompletableFuture resume() { - targetVM.vmStateChanged(TargetExecutionState.RUNNING, JdiReason.Reasons.RESUMED); - invalidateAndContinue(); - return CompletableFuture.completedFuture(null); - } - - @Override - public CompletableFuture step(TargetStepKind kind) { - int size = StepRequest.STEP_MIN; - int depth; - switch (kind) { - case INTO: - depth = StepRequest.STEP_INTO; - break; - case LINE: - depth = StepRequest.STEP_LINE; - break; - case FINISH: - depth = StepRequest.STEP_OUT; - break; - case SKIP: - depth = StepRequest.STEP_OVER; - break; - default: - depth = StepRequest.STEP_MIN; - break; - } - - StepRequest request = eventManager.createStepRequest(thread, size, depth); - request.enable(); - invalidateAndContinue(); - return CompletableFuture.completedFuture(null); - } - - private void invalidateAndContinue() { - targetVM.invalidateMemoryAndRegisterCaches(); - stack.invalidateRegisterCaches(); - registers.invalidateRegisterCaches(); - thread.resume(); - //EventSet.resume()? - } - - public JdiModelTargetStack getStack() { - return stack; - } - - public Location getLocation() { - return location == null ? null : location.location; - } - - public void setLocation(Location location) { - this.location = new JdiModelTargetLocation(this, location, false); - Method method = location.method(); - impl.registerMethod(method); - } - - @Override - public DebugStatus threadStarted(ThreadStartEvent evt, JdiCause cause) { - threadSelected(evt.thread(), null, JdiCause.Causes.UNCLAIMED); - return DebugStatus.NO_CHANGE; - } - - @Override - public boolean isAccessible() { - return thread.isSuspended(); - } -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetThreadContainer.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetThreadContainer.java deleted file mode 100644 index c1e1254640..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetThreadContainer.java +++ /dev/null @@ -1,137 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import com.sun.jdi.ThreadReference; - -import ghidra.async.AsyncFence; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.jdi.manager.*; -import ghidra.dbg.jdi.manager.impl.DebugStatus; -import ghidra.dbg.jdi.model.iface1.JdiModelTargetEventScope; -import ghidra.dbg.jdi.model.iface2.JdiModelTargetObject; -import ghidra.dbg.target.TargetExecutionStateful.TargetExecutionState; -import ghidra.dbg.target.schema.*; -import ghidra.util.datastruct.WeakValueHashMap; - -@TargetObjectSchemaInfo( - name = "ThreadContainer", - elements = { - @TargetElementType(type = JdiModelTargetThread.class) - }, - attributes = { - @TargetAttributeType(type = Void.class) - }, - canonicalContainer = true) -public class JdiModelTargetThreadContainer extends JdiModelTargetObjectImpl - implements JdiModelTargetEventScope, JdiEventsListenerAdapter { - - private List threads; - - protected final Map threadsById = new WeakValueHashMap<>(); - - public JdiModelTargetThreadContainer(JdiModelTargetObject object, String name, - List threads) { - super(object, name); - this.threads = threads; - - if (targetVM != null) { - impl.getManager().addEventsListener(targetVM.vm, this); - } - - } - - public JdiModelTargetThread threadCreated(ThreadReference thread) { - JdiModelTargetThread targetThread = getTargetThread(thread); - changeElements(List.of(), List.of(targetThread), Map.of(), "Created"); - return targetThread; - } - - public void threadExited(ThreadReference thread) { - synchronized (this) { - threadsById.remove(thread.name()); - } - changeElements(List.of(thread.name()), List.of(), Map.of(), "Exited"); - } - - @Override - public DebugStatus threadStateChanged(ThreadReference thread, Integer state, JdiCause cause, - JdiReason reason) { - JdiModelTargetThread targetThread = getTargetThread(thread); - TargetExecutionState targetState = targetThread.convertState(state); - targetThread.threadStateChanged(targetState); - TargetEventType eventType = getEventType(reason); - broadcast().event(this, targetThread, eventType, - "Thread " + targetThread.getName() + " state changed", List.of(targetThread)); - return DebugStatus.NO_CHANGE; - } - - private TargetEventType getEventType(JdiReason reason) { - if (reason == JdiReason.Reasons.STEP) { - return TargetEventType.STEP_COMPLETED; - } - if (reason == JdiReason.Reasons.BREAKPOINT_HIT) { - return TargetEventType.BREAKPOINT_HIT; - } - if (reason == JdiReason.Reasons.ACCESS_WATCHPOINT_HIT) { - return TargetEventType.BREAKPOINT_HIT; - } - if (reason == JdiReason.Reasons.WATCHPOINT_HIT) { - return TargetEventType.BREAKPOINT_HIT; - } - if (reason == JdiReason.Reasons.INTERRUPT) { - return TargetEventType.SIGNAL; - } - if (reason == JdiReason.Reasons.RESUMED) { - return TargetEventType.RUNNING; - } - return TargetEventType.STOPPED; - } - - protected CompletableFuture updateUsingThreads(List refs) { - List targetThreads; - synchronized (this) { - targetThreads = refs.stream().map(this::getTargetThread).collect(Collectors.toList()); - } - AsyncFence fence = new AsyncFence(); - for (JdiModelTargetThread t : targetThreads) { - fence.include(t.init()); - } - return fence.ready().thenAccept(__ -> { - setElements(targetThreads, Map.of(), "Refreshed"); - }); - } - - @Override - protected CompletableFuture requestElements(RefreshBehavior refresh) { - return updateUsingThreads(threads); - } - - public synchronized JdiModelTargetThread getTargetThread(ThreadReference thread) { - return threadsById.computeIfAbsent(thread.name(), - i -> (JdiModelTargetThread) getInstance(thread)); - } - - public synchronized JdiModelTargetThread getTargetThreadIfPresent(String name) { - return threadsById.get(name); - } - -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetThreadGroupContainer.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetThreadGroupContainer.java deleted file mode 100644 index 4ebebdf0c4..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetThreadGroupContainer.java +++ /dev/null @@ -1,100 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import com.sun.jdi.ThreadGroupReference; - -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.jdi.manager.JdiEventsListenerAdapter; -import ghidra.dbg.jdi.model.iface2.JdiModelTargetObject; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.util.PathUtils; -import ghidra.util.datastruct.WeakValueHashMap; - -@TargetObjectSchemaInfo( - name = "ThreadGroupContainer", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(type = JdiModelTargetThreadGroupContainer.class) - }, - canonicalContainer = true) -public class JdiModelTargetThreadGroupContainer extends JdiModelTargetObjectImpl - implements JdiEventsListenerAdapter { - - protected static String keyGroup(ThreadGroupReference group) { - return PathUtils.makeKey(group.name()); - } - - protected final ThreadGroupReference baseGroup; - - protected final Map threadGroupsById = - new WeakValueHashMap<>(); - - public JdiModelTargetThreadGroupContainer(JdiModelTargetVM parent) { - super(parent, "Thread Groups"); - this.baseGroup = null; - } - - public JdiModelTargetThreadGroupContainer(JdiModelTargetObject parent, - ThreadGroupReference group, boolean isElement) { - super(parent, isElement ? keyGroup(group) : group.name()); - this.baseGroup = group; - } - - @Override - protected CompletableFuture requestElements(RefreshBehavior refresh) { - List groups; - if (parent instanceof JdiModelTargetVM) { - JdiModelTargetVM vm = (JdiModelTargetVM) parent; - groups = vm.vm.topLevelThreadGroups(); - } - else { - groups = baseGroup.threadGroups(); - if (!baseGroup.threads().isEmpty()) { - JdiModelTargetThreadContainer c = - new JdiModelTargetThreadContainer(this, "Threads", baseGroup.threads()); - this.changeAttributes(List.of(), List.of( // - c // - ), Map.of(), "Refreshed"); - } - } - updateUsingThreadGroups(groups); - return CompletableFuture.completedFuture(null); - } - - protected void updateUsingThreadGroups(List refs) { - List threadGroups; - synchronized (this) { - threadGroups = - refs.stream().map(this::getTargetThreadGroup).collect(Collectors.toList()); - } - setElements(threadGroups, Map.of(), "Refreshed"); - } - - public synchronized JdiModelTargetThreadGroupContainer getTargetThreadGroup( - ThreadGroupReference group) { - return threadGroupsById.computeIfAbsent(group.name(), - i -> new JdiModelTargetThreadGroupContainer(this, group, true)); - } - -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetType.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetType.java deleted file mode 100644 index 2b03d43ce8..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetType.java +++ /dev/null @@ -1,59 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model; - -import java.util.List; -import java.util.Map; - -import com.sun.jdi.Type; - -import ghidra.dbg.jdi.model.iface2.JdiModelTargetObject; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "Type", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(name = "Signature", type = String.class), - @TargetAttributeType(type = Void.class) - }, - canonicalContainer = true) -public class JdiModelTargetType extends JdiModelTargetObjectImpl { - - protected final Type type; - - public JdiModelTargetType(JdiModelTargetObject object, Type type, boolean isElement) { - this(object, type.toString(), type, isElement); - } - - public JdiModelTargetType(JdiModelTargetObject object, String id, Type type, - boolean isElement) { - super(object, id, type, isElement); - this.type = type; - - changeAttributes(List.of(), List.of(), Map.of( // - "Signature", type.signature() // - ), "Initialized"); - } - - @Override - public String getDisplay() { - return type == null ? super.getDisplay() : type.name(); - } - -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetTypeContainer.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetTypeContainer.java deleted file mode 100644 index 3fd97eba58..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetTypeContainer.java +++ /dev/null @@ -1,90 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model; - -import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import com.sun.jdi.Type; - -import ghidra.async.AsyncFence; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.jdi.model.iface2.JdiModelTargetObject; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; - -@TargetObjectSchemaInfo( - name = "TargetTypeContainer", - elements = { - @TargetElementType(type = JdiModelTargetType.class) - }, - elementResync = ResyncMode.ONCE, - attributes = { - @TargetAttributeType(type = Void.class) - }, - canonicalContainer = true) -public class JdiModelTargetTypeContainer extends JdiModelTargetObjectImpl { - - private List types; - - // TODO: Is it possible to load the same object twice? - protected final Map typesByName = new HashMap<>(); - - public JdiModelTargetTypeContainer(JdiModelTargetObject parent, String name, - List typeList) { - super(parent, name); - this.types = typeList; - } - - protected CompletableFuture updateUsingTypes(Map byName) { - List vals; - synchronized (this) { - vals = byName.values().stream().map(this::getTargetType).collect(Collectors.toList()); - } - AsyncFence fence = new AsyncFence(); - for (JdiModelTargetType val : vals) { - fence.include(val.init()); - } - return fence.ready().thenAccept(__ -> { - changeElements(List.of(), vals, Map.of(), "Refreshed"); - }); - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - Map map = new HashMap<>(); - try { - for (Type type : types) { - map.put(type.name(), type); - } - typesByName.keySet().retainAll(map.keySet()); - } - catch (Exception e) { - e.printStackTrace(); - } - return updateUsingTypes(map); - } - - protected synchronized JdiModelTargetType getTargetType(Type type) { - return typesByName.computeIfAbsent(type.name(), - n -> (JdiModelTargetType) getInstance(type)); - } - - public synchronized JdiModelTargetType getTargetTypeIfPresent(String name) { - return typesByName.get(name); - } -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetVM.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetVM.java deleted file mode 100644 index 4b78f581b7..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetVM.java +++ /dev/null @@ -1,454 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model; - -import java.lang.ProcessHandle.Info; -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import com.sun.jdi.PathSearchingVirtualMachine; -import com.sun.jdi.VirtualMachine; -import com.sun.jdi.connect.Connector; -import com.sun.jdi.connect.Connector.Argument; -import com.sun.jdi.event.*; -import com.sun.jdi.request.*; - -import ghidra.async.AsyncFence; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.jdi.manager.*; -import ghidra.dbg.jdi.manager.impl.DebugStatus; -import ghidra.dbg.jdi.manager.impl.JdiManagerImpl; -import ghidra.dbg.jdi.model.iface1.*; -import ghidra.dbg.jdi.model.iface2.JdiModelTargetObject; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetMethod.TargetParameterMap; -import ghidra.dbg.target.schema.*; -import ghidra.lifecycle.Internal; - -/** - * - *

- * TODO: Implementing {@link TargetLauncher} here doesn't seem right. While it's convenient from a - * UI perspective, it doesn't make sense semantically. - */ -@TargetObjectSchemaInfo( - name = "VM", - elements = { - @TargetElementType(type = Void.class) }, - attributes = { - @TargetAttributeType(name = "Attributes", type = JdiModelTargetAttributesContainer.class), - @TargetAttributeType( - name = "Breakpoints", - type = JdiModelTargetBreakpointContainer.class, - fixed = true), - @TargetAttributeType( - name = "Classes", - type = JdiModelTargetClassContainer.class, - fixed = true), - @TargetAttributeType( - name = "Modules", - type = JdiModelTargetModuleContainer.class, - fixed = true), - @TargetAttributeType( - name = "Threads", - type = JdiModelTargetThreadContainer.class, - required = true, - fixed = true), - @TargetAttributeType( - name = "ThreadGroups", - type = JdiModelTargetThreadGroupContainer.class, - fixed = true), - @TargetAttributeType(type = Object.class) }, - canonicalContainer = true) -public class JdiModelTargetVM extends JdiModelTargetObjectImpl implements // - TargetProcess, // - TargetAggregate, // - JdiModelTargetEnvironment, // - JdiModelTargetAccessConditioned, // - JdiModelTargetExecutionStateful, // - JdiModelTargetLauncher, // - JdiModelTargetDeletable, // - JdiModelTargetKillable, // - JdiModelTargetResumable, // - JdiModelTargetInterruptible, // - JdiEventsListenerAdapter, // - JdiModelSelectableObject { - - public static final String ID_ATTRIBUTE_NAME = PREFIX_INVISIBLE + "id"; - public static final String EXIT_CODE_ATTRIBUTE_NAME = PREFIX_INVISIBLE + "exit_code"; - - protected final VirtualMachine vm; - protected boolean trackMonitor = false; - - private Map objectMap; - private Map object2key; - - protected final JdiModelTargetThreadContainer threads; - protected JdiModelTargetThreadGroupContainer threadGroups; - protected JdiModelTargetModuleContainer modules; - protected JdiModelTargetClassContainer classes; - protected final JdiModelTargetProcess process; - protected JdiModelTargetBreakpointContainer breakpoints; - protected JdiModelTargetAttributesContainer addedAttributes; - - private final EventRequestManager eventManager; - private final ThreadStartRequest threadStartRequest; - private final ThreadDeathRequest threadStopRequest; - private final MonitorWaitRequest monitorWaitRequest; - private final MonitorWaitedRequest monitorWaitedRequest; - private final MonitorContendedEnterRequest monitorEnterRequest; - private final MonitorContendedEnteredRequest monitorEnteredRequest; - - public JdiModelTargetVM(JdiModelTargetVMContainer vms, VirtualMachine vm, boolean isElement) { - super(vms, vm.name(), vm, isElement); - vms.vmsById.put(vm.name(), this); - this.vm = vm; - this.eventManager = vm.eventRequestManager(); - - threadStartRequest = eventManager.createThreadStartRequest(); - threadStopRequest = eventManager.createThreadDeathRequest(); - if (vm.canRequestMonitorEvents() && trackMonitor) { - monitorWaitRequest = eventManager.createMonitorWaitRequest(); - monitorWaitedRequest = eventManager.createMonitorWaitedRequest(); - monitorEnterRequest = eventManager.createMonitorContendedEnterRequest(); - monitorEnteredRequest = eventManager.createMonitorContendedEnteredRequest(); - } - else { - trackMonitor = false; - monitorWaitRequest = null; - monitorWaitedRequest = null; - monitorEnterRequest = null; - monitorEnteredRequest = null; - } - - threadStartRequest.enable(); - threadStopRequest.enable(); - if (vm.canRequestMonitorEvents() && trackMonitor) { - monitorWaitRequest.enable(); - monitorWaitedRequest.enable(); - monitorEnterRequest.enable(); - monitorEnteredRequest.enable(); - } - - Process proc = vm.process(); - if (proc != null) { - this.process = new JdiModelTargetProcess(this, proc, false); - } - else { - this.process = null; - } - this.threads = new JdiModelTargetThreadContainer(this, "Threads", vm.allThreads()); - - changeAttributes(List.of(), List.of( // - threads // - ), Map.of( // - STATE_ATTRIBUTE_NAME, TargetExecutionState.ALIVE, // - ACCESSIBLE_ATTRIBUTE_NAME, isAccessible(), // - DISPLAY_ATTRIBUTE_NAME, updateDisplay(), // - ARCH_ATTRIBUTE_NAME, vm.name(), // - DEBUGGER_ATTRIBUTE_NAME, vm.description(), // - OS_ATTRIBUTE_NAME, "JRE " + vm.version(), // - TargetMethod.PARAMETERS_ATTRIBUTE_NAME, TargetCmdLineLauncher.PARAMETERS // - ), "Initialized"); - - if (process != null) { - changeAttributes(List.of(), List.of( // - process // - ), Map.of(), "Initialized"); - } - - } - - private void populateAttributes() { - this.addedAttributes = new JdiModelTargetAttributesContainer(this, "Attributes"); - Map attrs = new HashMap<>(); - attrs.put("version", vm.version()); - attrs.put("description", vm.description()); - attrs.put("canBeModified", Boolean.valueOf(vm.canBeModified())); - attrs.put("canForceEarlyReturn", Boolean.valueOf(vm.canForceEarlyReturn())); - attrs.put("canGetBytecodes", Boolean.valueOf(vm.canGetBytecodes())); - attrs.put("canGetClassFileVersion", Boolean.valueOf(vm.canGetClassFileVersion())); - attrs.put("canGetConstantPool", Boolean.valueOf(vm.canGetConstantPool())); - attrs.put("canGetCurrentContendedMonitor", - Boolean.valueOf(vm.canGetCurrentContendedMonitor())); - attrs.put("canGetInstanceInfo", Boolean.valueOf(vm.canGetInstanceInfo())); - attrs.put("canGetMethodReturnValues", Boolean.valueOf(vm.canGetMethodReturnValues())); - attrs.put("canGetModuleInfo", Boolean.valueOf(vm.canGetModuleInfo())); - attrs.put("canGetMonitorFrameInfo", Boolean.valueOf(vm.canGetMonitorFrameInfo())); - attrs.put("canGetMonitorInfo", Boolean.valueOf(vm.canGetMonitorInfo())); - attrs.put("canGetOwnedMonitorInfo", Boolean.valueOf(vm.canGetOwnedMonitorInfo())); - attrs.put("canGetSourceDebugExtension", Boolean.valueOf(vm.canGetSourceDebugExtension())); - attrs.put("canGetSyntheticAttribute", Boolean.valueOf(vm.canGetSyntheticAttribute())); - attrs.put("canPopFrames", Boolean.valueOf(vm.canPopFrames())); - attrs.put("canRedefineClasses", Boolean.valueOf(vm.canRedefineClasses())); - attrs.put("canRequestMonitorEvents", Boolean.valueOf(vm.canRequestMonitorEvents())); - attrs.put("canRequestVMDeathEvent", Boolean.valueOf(vm.canRequestVMDeathEvent())); - attrs.put("canUseInstanceFilters", Boolean.valueOf(vm.canUseInstanceFilters())); - attrs.put("canUseSourceNameFilters", Boolean.valueOf(vm.canUseSourceNameFilters())); - attrs.put("canWatchFieldAccess", Boolean.valueOf(vm.canWatchFieldAccess())); - attrs.put("canWatchFieldModification", Boolean.valueOf(vm.canWatchFieldModification())); - if (vm instanceof PathSearchingVirtualMachine) { - PathSearchingVirtualMachine psvm = (PathSearchingVirtualMachine) vm; - attrs.put("classPath", psvm.classPath()); - attrs.put("baseDirectory", psvm.baseDirectory()); - attrs.put("baseDirectory", psvm.baseDirectory()); - } - addedAttributes.addAttributes(attrs); - } - - @Override - public CompletableFuture requestAttributes(RefreshBehavior refresh) { - - this.threadGroups = new JdiModelTargetThreadGroupContainer(this); - this.modules = new JdiModelTargetModuleContainer(this); - this.classes = new JdiModelTargetClassContainer(this); - this.breakpoints = new JdiModelTargetBreakpointContainer(this); - - populateAttributes(); - - changeAttributes(List.of(), List.of( // - modules, // - threadGroups, // - classes, // - breakpoints, // - addedAttributes // - ), Map.of(), "Initialized"); - - return CompletableFuture.completedFuture(null); - } - - @Override - public CompletableFuture launch(Map args) { - JdiManagerImpl manager = (JdiManagerImpl) impl.getManager(); - Connector cx = manager.getConnector(vm); - Map defaultArguments = cx.defaultArguments(); - Map jdiArgs = JdiModelTargetLauncher.getArguments(defaultArguments, - JdiModelTargetLauncher.getParameters(defaultArguments), args); - getManager().addVM(cx, jdiArgs); - return CompletableFuture.completedFuture(null); - } - - @Override - public TargetParameterMap getParameters() { - JdiManagerImpl manager = (JdiManagerImpl) impl.getManager(); - Connector cx = manager.getConnector(vm); - Map defaultArguments = cx.defaultArguments(); - return TargetParameterMap.copyOf(JdiModelTargetLauncher.getParameters(defaultArguments)); - } - - @Override - public CompletableFuture interrupt() { - vm.suspend(); - return CompletableFuture.completedFuture(null); - } - - @Override - public CompletableFuture resume() { - vmStateChanged(TargetExecutionState.RUNNING, JdiReason.Reasons.RESUMED); - invalidateMemoryAndRegisterCaches(); - vm.resume(); - return CompletableFuture.completedFuture(null); - } - - @Override - public CompletableFuture kill() { - vm.exit(0); - return CompletableFuture.completedFuture(null); - } - - @Override - public CompletableFuture delete() { - vm.dispose(); - return CompletableFuture.completedFuture(null); - } - - public CompletableFuture started(String id) { - AsyncFence fence = new AsyncFence(); - return fence.ready().thenAccept(__ -> { - if (id != null) { - changeAttributes(List.of(), List.of(), Map.of( // - STATE_ATTRIBUTE_NAME, TargetExecutionState.ALIVE, // - ID_ATTRIBUTE_NAME, id, // - DISPLAY_ATTRIBUTE_NAME, updateDisplay() // - ), "Started"); - } - else { - changeAttributes(List.of(), List.of(), Map.of( // - STATE_ATTRIBUTE_NAME, TargetExecutionState.ALIVE, // - DISPLAY_ATTRIBUTE_NAME, updateDisplay() // - ), "Started"); - } - vmSelected(vm, JdiCause.Causes.UNCLAIMED); - }); - } - - protected void exited(VirtualMachine vm2) { - if (vm2 != null) { - changeAttributes(List.of(), List.of(), Map.of( // - STATE_ATTRIBUTE_NAME, TargetExecutionState.TERMINATED, // - EXIT_CODE_ATTRIBUTE_NAME, vm2, // - DISPLAY_ATTRIBUTE_NAME, updateDisplay() // - ), "Exited"); - } - else { - changeAttributes(List.of(), List.of(), Map.of( // - STATE_ATTRIBUTE_NAME, TargetExecutionState.TERMINATED, // - DISPLAY_ATTRIBUTE_NAME, updateDisplay() // - ), "Exited"); - } - } - - @Override - public DebugStatus vmSelected(VirtualMachine eventVM, JdiCause cause) { - if (eventVM.equals(vm)) { - ((JdiModelTargetFocusScope) searchForSuitable(TargetFocusScope.class)).setFocus(this); - } - return DebugStatus.NO_CHANGE; - } - - public DebugStatus vmStateChanged(TargetExecutionState targetState, JdiReason reason) { - changeAttributes(List.of(), List.of(), Map.of( // - STATE_ATTRIBUTE_NAME, targetState // - ), reason.desc()); - return DebugStatus.NO_CHANGE; - } - - @Override - public DebugStatus monitorContendedEntered(MonitorContendedEnteredEvent evt, JdiCause cause) { - System.err.println(this + ":" + evt); - return DebugStatus.NO_CHANGE; - } - - @Override - public DebugStatus monitorContendedEnter(MonitorContendedEnterEvent evt, JdiCause cause) { - System.err.println(this + ":" + evt); - return DebugStatus.NO_CHANGE; - } - - @Override - public DebugStatus monitorWaited(MonitorWaitedEvent evt, JdiCause cause) { - System.err.println(this + ":" + evt); - return DebugStatus.NO_CHANGE; - } - - @Override - public DebugStatus monitorWait(MonitorWaitEvent evt, JdiCause cause) { - System.err.println(this + ":" + evt); - return DebugStatus.NO_CHANGE; - } - - protected void updateDisplayAttribute() { - changeAttributes(List.of(), List.of(), Map.of( // - DISPLAY_ATTRIBUTE_NAME, updateDisplay() // - ), "Display changed"); - } - - protected String updateDisplay() { - if (vm.process() == null) { - return vm.toString(); - } - String name = "VM(" + JdiModelTargetProcess.getUniqueId(vm.process()) + ") "; - Info info = vm.process().info(); - Optional arguments = info.arguments(); - if (!arguments.isEmpty()) { - String[] args = arguments.get(); - for (String arg : args) { - if (!arg.startsWith("-")) { - String[] split = arg.split("/"); - name += split.length == 0 ? arg : split[split.length - 1]; - } - } - } - return String.format("%s", name); - } - - @Override - public String getDisplay() { - return vm == null ? super.getDisplay() : updateDisplay(); - } - - protected void invalidateMemoryAndRegisterCaches() { - ///memory.invalidateMemoryCaches(); - } - - protected void updateMemory() { - // This is a little ew. Wish I didn't have to list regions every STOP - /* - memory.update().exceptionally(ex -> { - Msg.error(this, "Could not update process memory mappings", ex); - return null; - }); - */ - } - - @Override - @Internal - public CompletableFuture setActive() { - return CompletableFuture.completedFuture(null); - } - - public JdiModelTargetClassContainer getClasses() { - return classes; - } - - @Override - public void refreshInternal() { - // TODO Auto-generated method stub - - } - - // OBJECT MAP METHODS - - public synchronized JdiModelTargetObject getTargetObject(String key) { - return objectMap.get(key); - } - - @Override - public synchronized JdiModelTargetObject getTargetObject(Object obj) { - return objectMap.get(object2key.get(obj)); - } - - public synchronized void setTargetObject(String id, Object key, JdiModelTargetObject object) { - if (objectMap == null) { - objectMap = new HashMap<>(); - object2key = new HashMap<>(); - } - if (objectMap.containsKey(id) && key != null) { - if (!(object instanceof JdiModelTargetValue) && - !(object instanceof JdiModelTargetLocation) && - !(object instanceof JdiModelTargetRegister) && - !(object instanceof JdiModelTargetStackFrame)) { - // new RuntimeException(this+":"+key); - System.err.println("setTargetObject: " + key); - } - } - if (key != null) { - object2key.put(key, id); - } - objectMap.put(id, object); - } - - @Override - public boolean isAccessible() { - for (JdiModelTargetThread thread : threads.threadsById.values()) { - if (thread.isAccessible()) { - return true; - } - } - return false; - } - -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetVMContainer.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetVMContainer.java deleted file mode 100644 index 94e03f3ebd..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetVMContainer.java +++ /dev/null @@ -1,189 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model; - -import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import com.sun.jdi.ThreadReference; -import com.sun.jdi.VirtualMachine; -import com.sun.jdi.event.*; - -import ghidra.async.AsyncUtils; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.jdi.manager.JdiCause; -import ghidra.dbg.jdi.manager.JdiEventsListenerAdapter; -import ghidra.dbg.jdi.manager.impl.DebugStatus; -import ghidra.dbg.target.TargetEventScope.TargetEventType; -import ghidra.dbg.target.schema.*; -import ghidra.util.Msg; -import ghidra.util.datastruct.WeakValueHashMap; - -@TargetObjectSchemaInfo( - name = "VMContainer", - elements = { // - @TargetElementType(type = JdiModelTargetVM.class) // - }, - attributes = { // - @TargetAttributeType(type = Void.class) // - }, - canonicalContainer = true) -public class JdiModelTargetVMContainer extends JdiModelTargetObjectImpl - implements JdiEventsListenerAdapter { - - private JdiModelTargetRoot session; - protected final Map vmsById = new WeakValueHashMap<>(); - - public JdiModelTargetVMContainer(JdiModelTargetRoot session) { - super(session, "VMs"); - this.session = session; - - impl.getManager().addEventsListener(null, this); - } - - @Override - public DebugStatus vmStarted(VMStartEvent event, JdiCause cause) { - VirtualMachine vm = event.virtualMachine(); - JdiModelTargetVM target = getTargetVM(vm); - // TODO: Move PROCESS_CREATED here to restore proper order of event reporting - // Pending some client-side changes to handle architecture selection, though. - target.started(vm.name()).thenAccept(__ -> { - broadcast().event(session, null, TargetEventType.PROCESS_CREATED, - "VM " + vm.name() + " started " + vm.process() + " pid=" + vm.name(), List.of(vm)); - }).exceptionally(ex -> { - Msg.error(this, "Could not notify vm started", ex); - return null; - }); - - changeElements(List.of(), List.of(target), Map.of(), "Added"); - return DebugStatus.NO_CHANGE; - } - - @Override - public DebugStatus vmDied(VMDeathEvent event, JdiCause cause) { - VirtualMachine vm = event.virtualMachine(); - JdiModelTargetVM tgtVM = vmsById.get(vm.name()); - broadcast().event(session, null, TargetEventType.PROCESS_EXITED, "VM " + vm.name(), - List.of(tgtVM)); - tgtVM.exited(vm); - synchronized (this) { - vmsById.remove(vm.name()); - getManager().removeVM(vm); - } - changeElements(List.of(vm.name()), List.of(), Map.of(), "Removed"); - return DebugStatus.NO_CHANGE; - } - - protected void gatherThreads(List into, JdiModelTargetVM vm, - Collection from) { - for (ThreadReference t : from) { - JdiModelTargetThread p = vm.threads.getTargetThread(t); - if (p != null) { - into.add(p); - } - } - } - - @Override - public DebugStatus threadStarted(ThreadStartEvent event, JdiCause cause) { - ThreadReference thread = event.thread(); - JdiModelTargetVM vm = getTargetVM(thread.threadGroup().virtualMachine()); - if (!vmsById.containsValue(vm)) { - Msg.info(this, event + " ignored as vm may have exited"); - return DebugStatus.NO_CHANGE; - } - JdiModelTargetThread targetThread = vm.threads.threadCreated(thread); - broadcast().event(session, targetThread, TargetEventType.THREAD_CREATED, - "Thread " + thread.name() + " started", List.of(targetThread)); - return DebugStatus.NO_CHANGE; - } - - @Override - public DebugStatus threadExited(ThreadDeathEvent event, JdiCause cause) { - ThreadReference thread = event.thread(); - JdiModelTargetVM tgtVM = vmsById.get(thread.virtualMachine().name()); - JdiModelTargetThread targetThread = tgtVM.threads.threadsById.get(thread.name()); - broadcast().event(session, targetThread, TargetEventType.THREAD_EXITED, - "Thread " + thread.name() + " exited", List.of(targetThread)); - tgtVM.threads.threadExited(thread); - return DebugStatus.NO_CHANGE; - } - - @Override - public DebugStatus classLoaded(VirtualMachine vm, String name, JdiCause cause) { - /* - JdiModelTargetVM vm = getTargetInferior(inf); - JdiModelTargetModule module = vm.modules.libraryLoaded(name); - parent.getListeners() - .fire(TargetEventScopeListener.class) - .event(parent, null, TargetEventType.MODULE_LOADED, - "Library " + name + " loaded", List.of(module)); - */ - return DebugStatus.NO_CHANGE; - } - - @Override - public DebugStatus classUnloaded(VirtualMachine vm, String name, JdiCause cause) { - /* - JdiModelTargetVM vm = getTargetInferior(inf); - JdiModelTargetModule module = vm.modules.getTargetModuleIfPresent(name); - parent.getListeners() - .fire(TargetEventScopeListener.class) - .event(parent, null, TargetEventType.MODULE_UNLOADED, - "Library " + name + " unloaded", List.of(module)); - vm.modules.libraryUnloaded(name); - */ - return DebugStatus.NO_CHANGE; - } - - private void updateUsingVMs(Map byName) { - List vms; - synchronized (this) { - vms = byName.values().stream().map(this::getTargetVM).collect(Collectors.toList()); - } - setElements(vms, Map.of(), "Refreshed"); - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - if (!refresh.equals(RefreshBehavior.REFRESH_ALWAYS)) { - updateUsingVMs(impl.getManager().getKnownVMs()); - return AsyncUtils.nil(); - } - return impl.getManager().listVMs().thenAccept(this::updateUsingVMs); - } - - // NOTE: Does no good to override fetchElement - // Cache should be kept in sync all the time, anyway - - public synchronized JdiModelTargetVM getTargetVM(VirtualMachine vm) { - return vmsById.computeIfAbsent(vm.name(), - i -> new JdiModelTargetVM(this, impl.getManager().getKnownVMs().get(i), true)); - } - - public synchronized JdiModelTargetVM getTargetVMByName(String name) { - return vmsById.computeIfAbsent(name, - i -> new JdiModelTargetVM(this, impl.getManager().getKnownVMs().get(i), true)); - } - - protected void invalidateMemoryAndRegisterCaches() { - for (JdiModelTargetVM inf : vmsById.values()) { - inf.invalidateMemoryAndRegisterCaches(); - } - } - -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetValue.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetValue.java deleted file mode 100644 index 84ca356af8..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetValue.java +++ /dev/null @@ -1,49 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model; - -import com.sun.jdi.Type; -import com.sun.jdi.Value; - -import ghidra.dbg.jdi.model.iface2.JdiModelTargetObject; -import ghidra.dbg.target.schema.*; - -@TargetObjectSchemaInfo( - name = "Value", - elements = { - @TargetElementType(type = Void.class) - }, - attributes = { - @TargetAttributeType(type = Void.class) - }, - canonicalContainer = true) -public class JdiModelTargetValue extends JdiModelTargetObjectImpl { - - protected final Value value; - protected final Type type; - - public JdiModelTargetValue(JdiModelTargetObject object, Value value, boolean isElement) { - this(object, value.toString(), value, isElement); - } - - public JdiModelTargetValue(JdiModelTargetObject object, String id, Value value, - boolean isElement) { - super(object, id, value, isElement); - this.value = value; - this.type = value.type(); - } - -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetValueContainer.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetValueContainer.java deleted file mode 100644 index a43183dcf4..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetValueContainer.java +++ /dev/null @@ -1,90 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model; - -import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import com.sun.jdi.Value; - -import ghidra.async.AsyncFence; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.jdi.model.iface2.JdiModelTargetObject; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; - -@TargetObjectSchemaInfo( - name = "TargetValueContainer", - elements = { - @TargetElementType(type = JdiModelTargetValue.class) - }, - elementResync = ResyncMode.ONCE, - attributes = { - @TargetAttributeType(type = Void.class) - }, - canonicalContainer = true) -public class JdiModelTargetValueContainer extends JdiModelTargetObjectImpl { - - private List values; - - // TODO: Is it possible to load the same object twice? - protected final Map valuesByName = new HashMap<>(); - - public JdiModelTargetValueContainer(JdiModelTargetObject parent, String name, - List vals) { - super(parent, name); - this.values = vals; - } - - protected CompletableFuture updateUsingValues(Map byName) { - List vals; - synchronized (this) { - vals = byName.values().stream().map(this::getTargetValue).collect(Collectors.toList()); - } - AsyncFence fence = new AsyncFence(); - for (JdiModelTargetValue val : vals) { - fence.include(val.init()); - } - return fence.ready().thenAccept(__ -> { - changeElements(List.of(), vals, Map.of(), "Refreshed"); - }); - } - - @Override - public CompletableFuture requestElements(RefreshBehavior refresh) { - Map map = new HashMap<>(); - try { - for (Value val : values) { - map.put(val.toString(), val); - } - valuesByName.keySet().retainAll(map.keySet()); - } - catch (Exception e) { - e.printStackTrace(); - } - return updateUsingValues(map); - } - - protected synchronized JdiModelTargetValue getTargetValue(Value val) { - return valuesByName.computeIfAbsent(val.toString(), - n -> new JdiModelTargetValue(this, val, true)); - } - - public synchronized JdiModelTargetValue getTargetValueIfPresent(String name) { - return valuesByName.get(name); - } -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetValueMap.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetValueMap.java deleted file mode 100644 index 69bb88c148..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/JdiModelTargetValueMap.java +++ /dev/null @@ -1,85 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import com.sun.jdi.LocalVariable; -import com.sun.jdi.Value; - -import ghidra.async.AsyncFence; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.jdi.model.iface2.JdiModelTargetObject; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.target.schema.TargetObjectSchema.ResyncMode; - -@TargetObjectSchemaInfo( - name = "TargetValueMap", - elements = { - @TargetElementType(type = Void.class) - }, - elementResync = ResyncMode.ONCE, - attributes = { - @TargetAttributeType(type = JdiModelTargetValue.class) - }, - canonicalContainer = true) -public class JdiModelTargetValueMap extends JdiModelTargetObjectImpl { - - private Map values; - - // TODO: Is it possible to load the same object twice? - protected final Map valuesByVariable = new HashMap<>(); - - public JdiModelTargetValueMap(JdiModelTargetObject parent, Map vals) { - super(parent, "Value Map"); - this.values = vals; - } - - protected CompletableFuture updateUsingValues(Map byName) { - Map vals = new HashMap<>(); - synchronized (this) { - for (LocalVariable key : byName.keySet()) { - Value val = byName.get(key); - if (val != null) { - JdiModelTargetValue targetValue = getTargetValue(key, val); - vals.put(key.name(), targetValue); - } - } - } - AsyncFence fence = new AsyncFence(); - for (JdiModelTargetValue var : vals.values()) { - fence.include(var.init()); - } - return fence.ready().thenAccept(__ -> { - setAttributes(List.of(), vals, "Refreshed"); - }); - } - - @Override - public CompletableFuture requestAttributes(RefreshBehavior refresh) { - return updateUsingValues(values); - } - - protected synchronized JdiModelTargetValue getTargetValue(LocalVariable var, Value val) { - return valuesByVariable.computeIfAbsent(var, - n -> new JdiModelTargetValue(this, val, false)); - } - - public synchronized JdiModelTargetValue getTargetValueIfPresent(LocalVariable var) { - return valuesByVariable.get(var); - } -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelSelectableObject.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelSelectableObject.java deleted file mode 100644 index 824954fd18..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelSelectableObject.java +++ /dev/null @@ -1,26 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model.iface1; - -import java.util.concurrent.CompletableFuture; - -import ghidra.dbg.jdi.model.iface2.JdiModelTargetObject; - -public interface JdiModelSelectableObject extends JdiModelTargetObject { - - public CompletableFuture setActive(); - -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetAccessConditioned.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetAccessConditioned.java deleted file mode 100644 index 6bb204bd30..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetAccessConditioned.java +++ /dev/null @@ -1,34 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model.iface1; - -import ghidra.dbg.jdi.model.iface2.JdiModelTargetObject; -import ghidra.dbg.target.TargetAccessConditioned; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface JdiModelTargetAccessConditioned - extends JdiModelTargetObject, TargetAccessConditioned { - - @Override - public boolean isAccessible(); - -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetAttacher.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetAttacher.java deleted file mode 100644 index 7cade62ff5..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetAttacher.java +++ /dev/null @@ -1,39 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model.iface1; - -import java.util.concurrent.CompletableFuture; - -import ghidra.dbg.jdi.model.iface2.JdiModelTargetObject; -import ghidra.dbg.target.TargetAttachable; -import ghidra.dbg.target.TargetAttacher; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface JdiModelTargetAttacher extends JdiModelTargetObject, TargetAttacher { - - @Override - public CompletableFuture attach(TargetAttachable attachable); - - @Override - public CompletableFuture attach(long pid); - -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetConsole.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetConsole.java deleted file mode 100644 index 5df15c7508..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetConsole.java +++ /dev/null @@ -1,30 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model.iface1; - -import ghidra.dbg.jdi.model.iface2.JdiModelTargetObject; -import ghidra.dbg.target.TargetConsole; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface JdiModelTargetConsole extends JdiModelTargetObject, TargetConsole { - -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetDeletable.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetDeletable.java deleted file mode 100644 index 1c62584c52..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetDeletable.java +++ /dev/null @@ -1,35 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model.iface1; - -import java.util.concurrent.CompletableFuture; - -import ghidra.dbg.jdi.model.iface2.JdiModelTargetObject; -import ghidra.dbg.target.TargetDeletable; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface JdiModelTargetDeletable extends JdiModelTargetObject, TargetDeletable { - - @Override - public CompletableFuture delete(); - -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetDetachable.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetDetachable.java deleted file mode 100644 index 1466de4e26..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetDetachable.java +++ /dev/null @@ -1,35 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model.iface1; - -import java.util.concurrent.CompletableFuture; - -import ghidra.dbg.jdi.model.iface2.JdiModelTargetObject; -import ghidra.dbg.target.TargetDetachable; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface JdiModelTargetDetachable extends JdiModelTargetObject, TargetDetachable { - - @Override - public CompletableFuture detach(); - -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetEnvironment.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetEnvironment.java deleted file mode 100644 index fffdf5a938..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetEnvironment.java +++ /dev/null @@ -1,40 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model.iface1; - -import ghidra.dbg.jdi.model.iface2.JdiModelTargetObject; -import ghidra.dbg.target.TargetEnvironment; - -public interface JdiModelTargetEnvironment extends JdiModelTargetObject, TargetEnvironment { - - public void refreshInternal(); - - @Override - public default String getArchitecture() { - return getTypedAttributeNowByName(ARCH_ATTRIBUTE_NAME, String.class, ""); - } - - @Override - public default String getDebugger() { - return getTypedAttributeNowByName(DEBUGGER_ATTRIBUTE_NAME, String.class, ""); - } - - @Override - public default String getOperatingSystem() { - return getTypedAttributeNowByName(OS_ATTRIBUTE_NAME, String.class, ""); - } - -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetEventScope.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetEventScope.java deleted file mode 100644 index 68dafed1cb..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetEventScope.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model.iface1; - -import ghidra.dbg.jdi.model.iface2.JdiModelTargetObject; -import ghidra.dbg.target.TargetEventScope; - -/** - * The object can emit events affecting itself and its successors - * - * @param type for this - */ -public interface JdiModelTargetEventScope extends JdiModelTargetObject, TargetEventScope { - -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetExecutionStateful.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetExecutionStateful.java deleted file mode 100644 index 15f6a8b19c..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetExecutionStateful.java +++ /dev/null @@ -1,40 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model.iface1; - -import java.util.List; -import java.util.Map; - -import ghidra.dbg.jdi.model.iface2.JdiModelTargetObject; -import ghidra.dbg.target.TargetExecutionStateful; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface JdiModelTargetExecutionStateful - extends JdiModelTargetObject, TargetExecutionStateful { - - public default void setExecutionState(TargetExecutionState state, String reason) { - changeAttributes(List.of(), Map.of( // - STATE_ATTRIBUTE_NAME, state // - ), reason); - } - -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetFocusScope.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetFocusScope.java deleted file mode 100644 index 55e377f545..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetFocusScope.java +++ /dev/null @@ -1,64 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model.iface1; - -import java.util.concurrent.CompletableFuture; - -import ghidra.async.AsyncUtils; -import ghidra.dbg.error.DebuggerIllegalArgumentException; -import ghidra.dbg.jdi.model.iface2.JdiModelTargetObject; -import ghidra.dbg.target.TargetFocusScope; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.util.PathUtils; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface JdiModelTargetFocusScope extends JdiModelTargetObject, TargetFocusScope { - - @Override - public JdiModelSelectableObject getFocus(); - - // NB: setFocus changes attributes - propagates up to client - public boolean setFocus(JdiModelSelectableObject sel); - - // NB: requestFocus request change in active object - propagates down to manager - // (but, of course, may then cause change in state) - @Override - public default CompletableFuture requestFocus(TargetObject obj) { - getModel().assertMine(TargetObject.class, obj); - if (obj.equals(getFocus())) { - return CompletableFuture.completedFuture(null); - } - if (!PathUtils.isAncestor(this.getPath(), obj.getPath())) { - throw new DebuggerIllegalArgumentException("Can only focus a successor of the scope"); - } - TargetObject cur = obj; - while (cur != null) { - if (cur instanceof JdiModelSelectableObject) { - JdiModelSelectableObject sel = (JdiModelSelectableObject) cur; - setFocus(sel); - return sel.setActive(); - } - cur = cur.getParent(); - } - return AsyncUtils.nil(); - } -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetInterruptible.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetInterruptible.java deleted file mode 100644 index 755bb70b73..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetInterruptible.java +++ /dev/null @@ -1,35 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model.iface1; - -import java.util.concurrent.CompletableFuture; - -import ghidra.dbg.jdi.model.iface2.JdiModelTargetObject; -import ghidra.dbg.target.TargetInterruptible; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface JdiModelTargetInterruptible extends JdiModelTargetObject, TargetInterruptible { - - @Override - public CompletableFuture interrupt(); - -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetKillable.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetKillable.java deleted file mode 100644 index 15f27efa70..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetKillable.java +++ /dev/null @@ -1,35 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model.iface1; - -import java.util.concurrent.CompletableFuture; - -import ghidra.dbg.jdi.model.iface2.JdiModelTargetObject; -import ghidra.dbg.target.TargetKillable; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface JdiModelTargetKillable extends JdiModelTargetObject, TargetKillable { - - @Override - public CompletableFuture kill(); - -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetLauncher.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetLauncher.java deleted file mode 100644 index d6b87e10f7..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetLauncher.java +++ /dev/null @@ -1,94 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model.iface1; - -import java.util.Map; -import java.util.stream.Collectors; - -import com.sun.jdi.connect.Connector.*; - -import ghidra.dbg.jdi.model.iface2.JdiModelTargetObject; -import ghidra.dbg.target.TargetLauncher; -import ghidra.dbg.target.TargetMethod; -import ghidra.dbg.target.TargetMethod.ParameterDescription; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface JdiModelTargetLauncher extends JdiModelTargetObject, TargetLauncher { - - static ParameterDescription createBooleanParameter(BooleanArgument arg) { - return ParameterDescription.create(Boolean.class, arg.name(), arg.mustSpecify(), - arg.booleanValue(), arg.label(), arg.description()); - } - - static ParameterDescription createIntegerParameter(IntegerArgument arg) { - return ParameterDescription.create(Integer.class, arg.name(), arg.mustSpecify(), - arg.intValue(), arg.label(), arg.description()); - } - - static ParameterDescription createStringParameter(StringArgument arg) { - return createGenericParameter(arg); - } - - static ParameterDescription createSelectedParameter(SelectedArgument arg) { - return ParameterDescription.choices(String.class, arg.name(), arg.choices(), - arg.label(), arg.description()); - } - - static ParameterDescription createGenericParameter(Argument arg) { - return ParameterDescription.create(String.class, arg.name(), arg.mustSpecify(), - arg.value(), arg.label(), arg.description()); - } - - static ParameterDescription createParameter(Argument arg) { - if (arg instanceof BooleanArgument) { - return createBooleanParameter((BooleanArgument) arg); - } - if (arg instanceof IntegerArgument) { - return createIntegerParameter((IntegerArgument) arg); - } - if (arg instanceof StringArgument) { - return createStringParameter((StringArgument) arg); - } - if (arg instanceof SelectedArgument) { - return createSelectedParameter((SelectedArgument) arg); - } - return createGenericParameter(arg); - } - - static Map> getParameters( - Map defaultArguments) { - return defaultArguments.entrySet() - .stream() - .collect(Collectors.toMap(Map.Entry::getKey, e -> createParameter(e.getValue()))); - } - - static Map getArguments(Map defaultArguments, - Map> parameters, Map arguments) { - Map validated = TargetMethod.validateArguments(parameters, arguments, false); - for (Argument arg : defaultArguments.values()) { - Object val = parameters.get(arg.name()).get(validated); - // Eh, we could probably avoid the round-trip string conversion. Is it needed? No. - arg.setValue(val == null ? null : val.toString()); - } - return defaultArguments; - } -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetMethod.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetMethod.java deleted file mode 100644 index 84cd629670..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetMethod.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model.iface1; - -import ghidra.dbg.jdi.model.iface2.JdiModelTargetObject; -import ghidra.dbg.target.TargetMethod; - -/** - * An interface which indicates this object is a method in its parent. - * - * @param type for this - */ -public interface JdiModelTargetMethod extends JdiModelTargetObject, TargetMethod { - -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetResumable.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetResumable.java deleted file mode 100644 index e48412c3a0..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetResumable.java +++ /dev/null @@ -1,35 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model.iface1; - -import java.util.concurrent.CompletableFuture; - -import ghidra.dbg.jdi.model.iface2.JdiModelTargetObject; -import ghidra.dbg.target.TargetResumable; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface JdiModelTargetResumable extends JdiModelTargetObject, TargetResumable { - - @Override - public CompletableFuture resume(); - -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetSteppable.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetSteppable.java deleted file mode 100644 index 574630bd30..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface1/JdiModelTargetSteppable.java +++ /dev/null @@ -1,35 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model.iface1; - -import java.util.concurrent.CompletableFuture; - -import ghidra.dbg.jdi.model.iface2.JdiModelTargetObject; -import ghidra.dbg.target.TargetSteppable; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - * @param type for this - */ -public interface JdiModelTargetSteppable extends JdiModelTargetObject, TargetSteppable { - - @Override - CompletableFuture step(TargetStepKind kind); - -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface2/JdiModelTargetAttachable.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface2/JdiModelTargetAttachable.java deleted file mode 100644 index 23303dcffc..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface2/JdiModelTargetAttachable.java +++ /dev/null @@ -1,30 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model.iface2; - -import ghidra.dbg.target.TargetAttachable; - -/** - * An interface which indicates this object is capable of launching targets. - * - * The targets this launcher creates ought to appear in its successors. - * - */ -public interface JdiModelTargetAttachable extends JdiModelTargetObject, TargetAttachable { - - public long getId(); - -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface2/JdiModelTargetObject.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface2/JdiModelTargetObject.java deleted file mode 100644 index 2db1e5ecbe..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/model/iface2/JdiModelTargetObject.java +++ /dev/null @@ -1,106 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model.iface2; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import com.sun.jdi.*; - -import ghidra.dbg.agent.InvalidatableTargetObjectIf; -import ghidra.dbg.jdi.manager.JdiManager; -import ghidra.dbg.jdi.model.*; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.EnumerableTargetObjectSchema; -import ghidra.dbg.target.schema.TargetObjectSchema; -import ghidra.dbg.target.schema.TargetObjectSchema.SchemaName; -import ghidra.dbg.util.CollectionUtils.Delta; - -public interface JdiModelTargetObject extends TargetObject, InvalidatableTargetObjectIf { - - String THREAD_ATTRIBUTE_NAME = "Thread"; - String THIS_OBJECT_ATTRIBUTE_NAME = "This"; - String LOCATION_ATTRIBUTE_NAME = "Location"; - - public JdiModelImpl getModelImpl(); - - public default JdiManager getManager() { - return getModelImpl().getManager(); - } - - public default CompletableFuture init(Map map) { - return CompletableFuture.completedFuture(null); - } - - @Override - public CompletableFuture> fetchElements(); - - @Override - public CompletableFuture> fetchAttributes(); - - public Delta changeAttributes(List remove, Map add, String reason); - - public default JdiModelTargetObject getInstance(Mirror object) { - JdiModelTargetObject targetObject = getTargetObject(object); - if (targetObject == null) { - if (object instanceof ThreadReference) { - ThreadReference thread = (ThreadReference) object; - targetObject = new JdiModelTargetThread(this, thread, acceptsElement("Thread")); - } - else if (object instanceof ObjectReference) { - ObjectReference ref = (ObjectReference) object; - targetObject = - new JdiModelTargetObjectReference(this, ref, acceptsElement("ObjectReference")); - } - else if (object instanceof ReferenceType) { - ReferenceType reftype = (ReferenceType) object; - targetObject = - new JdiModelTargetReferenceType(this, reftype, acceptsElement("ReferenceType")); - } - else if (object instanceof Field) { - Field field = (Field) object; - targetObject = new JdiModelTargetField(this, field, acceptsElement("Field")); - } - else if (object instanceof Method) { - Method method = (Method) object; - targetObject = new JdiModelTargetMethod(this, method, acceptsElement("Method")); - } - else if (object instanceof Type) { - Type type = (Type) object; - targetObject = new JdiModelTargetType(this, type, acceptsElement("Type")); - } - else { - throw new RuntimeException(); - } - } - return targetObject; - } - - public default boolean acceptsElement(String schemaName) { - TargetObjectSchema schema = this.getSchema(); - if (schema.equals(EnumerableTargetObjectSchema.ANY)) { - return true; - } - SchemaName s = schema.getElementSchema(schemaName); - return s.toString().equals(schemaName); - } - - public JdiModelTargetObject getTargetObject(Object object); - - public Object getObject(); - -} diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/rmi/jpda/JdiArch.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/rmi/jpda/JdiArch.java index c69e2f2d65..25c850a979 100644 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/rmi/jpda/JdiArch.java +++ b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/rmi/jpda/JdiArch.java @@ -25,18 +25,18 @@ import ghidra.program.util.DefaultLanguageService; public class JdiArch { - private JdiManager manager; + private JdiConnector connector; private LanguageID langID; private Language language; private final LanguageService languageService = DefaultLanguageService.getLanguageService(); - public JdiArch(JdiManager manager) { - this.manager = manager; + public JdiArch(JdiConnector connector) { + this.connector = connector; } public String getArch() { - Map env = new HashMap<>(manager.getEnv()); + Map env = new HashMap<>(connector.getEnv()); String arch = "JVM"; if (env.containsKey("OPT_ARCH")) { arch = env.get("OPT_ARCH"); @@ -49,7 +49,7 @@ public class JdiArch { } public String getOSABI() { - Map env = new HashMap<>(manager.getEnv()); + Map env = new HashMap<>(connector.getEnv()); String arch = "JVM"; if (env.containsKey("OPT_ARCH")) { arch = env.get("OPT_ARCH"); diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/rmi/jpda/JdiClientThread.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/rmi/jpda/JdiClientThread.java index ae0c79d45a..083be56dec 100644 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/rmi/jpda/JdiClientThread.java +++ b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/rmi/jpda/JdiClientThread.java @@ -30,7 +30,7 @@ public class JdiClientThread extends Thread { private final JdiArguments arguments; private JdiManagerImpl manager; - private JdiManager jdiManager; + private JdiConnector connector; public JdiClientThread(Map env) { this.env = env; @@ -41,15 +41,15 @@ public class JdiClientThread extends Thread { public void run() { try { manager = new JdiManagerImpl(); - jdiManager = new JdiManager(manager, env); + connector = new JdiConnector(manager, env); Connector cx = arguments.getConnector(manager.getVirtualMachineManager()); Map args = cx.defaultArguments(); arguments.putArguments(args); if (manager.addVM(cx, args) != null) { - jdiManager.getCommands().ghidraTraceSyncEnable(); - jdiManager.getHooks().vmStarted(null, Causes.UNCLAIMED); + connector.getCommands().ghidraTraceSyncEnable(); + connector.getHooks().vmStarted(null, Causes.UNCLAIMED); } else { // Nothing. addVM should already have reported the error. @@ -60,11 +60,11 @@ public class JdiClientThread extends Thread { } } - public JdiManager mgr() { - return jdiManager; + public JdiConnector connector() { + return connector; } public JdiCommands cmds() { - return jdiManager.getCommands(); + return connector.getCommands(); } } diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/rmi/jpda/JdiCommands.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/rmi/jpda/JdiCommands.java index e635a76a3d..552ecd1a6f 100644 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/rmi/jpda/JdiCommands.java +++ b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/rmi/jpda/JdiCommands.java @@ -15,7 +15,7 @@ */ package ghidra.dbg.jdi.rmi.jpda; -import static ghidra.dbg.jdi.rmi.jpda.JdiManager.*; +import static ghidra.dbg.jdi.rmi.jpda.JdiConnector.*; import java.io.IOException; import java.io.PrintStream; @@ -118,16 +118,16 @@ class State { public class JdiCommands { - private JdiManager manager; + private JdiConnector connector; private JdiManagerImpl jdi; public State state; private String[] regNames = { "PC", "return_address" }; public long MAX_REFS = 100; - public JdiCommands(JdiManager manager) { - this.manager = manager; - this.jdi = manager.getJdi(); + public JdiCommands(JdiConnector connector) { + this.connector = connector; + this.jdi = connector.getJdi(); state = new State(); } @@ -141,7 +141,7 @@ public class JdiCommands { SocketChannel channel = SocketChannel.open(new InetSocketAddress(addr[0], Integer.parseInt(addr[1]))); state.client = new RmiClient(channel, "jdi"); - state.client.setRegistry(manager.remoteMethodRegistry); + state.client.setRegistry(connector.remoteMethodRegistry); state.client.negotiate("Connect"); Msg.out("Connected to " + state.client.getDescription()); } @@ -183,7 +183,7 @@ public class JdiCommands { if (key.isAcceptable()) { SocketChannel client = channel.accept(); state.client = new RmiClient(client, "jdi"); - state.client.setRegistry(manager.remoteMethodRegistry); + state.client.setRegistry(connector.remoteMethodRegistry); client.configureBlocking(false); Msg.out("Connected from " + state.client.getDescription()); } @@ -205,7 +205,7 @@ public class JdiCommands { } private String computeName() { - VirtualMachine currentVM = manager.getJdi().getCurrentVM(); + VirtualMachine currentVM = connector.getJdi().getCurrentVM(); if (currentVM != null) { Optional command = currentVM.process().info().command(); if (command.isPresent()) { @@ -216,7 +216,7 @@ public class JdiCommands { } public void startTrace(String name) { - JdiArch arch = manager.getArch(); + JdiArch arch = connector.getArch(); LanguageID language = arch.computeGhidraLanguage(); CompilerSpecID compiler = arch.computeGhidraCompiler(language); state.trace = state.client.createTrace(name, language, compiler); @@ -225,12 +225,12 @@ public class JdiCommands { state.trace.registerMapper = arch.computeRegisterMapper(); try (RmiTransaction tx = state.trace.startTx("Create snapshots", false)) { - state.trace.createRootObject(manager.rootSchema.getContext(), - manager.rootSchema.getName().toString()); + state.trace.createRootObject(connector.rootSchema.getContext(), + connector.rootSchema.getName().toString()); //activate(null); // add the DEFAULT_SECTION - AddressRange range = manager.defaultRange; + AddressRange range = connector.defaultRange; byte[] bytes = new byte[(int) range.getLength()]; Arrays.fill(bytes, (byte) 0xFF); state.trace.putBytes(range.getMinAddress(), bytes, state.trace.getSnap()); @@ -267,7 +267,7 @@ public class JdiCommands { } public VirtualMachine ghidraTraceCreate(Map env) { - return manager.getJdi().createVM(env); + return connector.getJdi().createVM(env); } public void ghidraTraceInfo() { @@ -285,7 +285,7 @@ public class JdiCommands { } public void ghidraTraceInfoLcsp() { - JdiArch arch = manager.getArch(); + JdiArch arch = connector.getArch(); LanguageID language = arch.computeGhidraLanguage(); CompilerSpecID compiler = arch.computeGhidraCompiler(language); Msg.info(this, "Selected Ghidra language: " + language); @@ -521,14 +521,14 @@ public class JdiCommands { public void activate(String path) { state.requireTrace(); if (path == null) { - VirtualMachine currentVM = manager.getJdi().getCurrentVM(); + VirtualMachine currentVM = connector.getJdi().getCurrentVM(); path = getPath(currentVM); try { - ThreadReference currentThread = manager.getJdi().getCurrentThread(); + ThreadReference currentThread = connector.getJdi().getCurrentThread(); if (currentThread != null) { path = getPath(currentThread); } - StackFrame currentFrame = manager.getJdi().getCurrentFrame(); + StackFrame currentFrame = connector.getJdi().getCurrentFrame(); if (currentFrame != null) { path = getPath(currentFrame); } @@ -580,7 +580,7 @@ public class JdiCommands { } public RegisterValue[] putRegisters(StackFrame frame, String ppath) { - JdiArch arch = manager.getArch(); + JdiArch arch = connector.getArch(); Language lang = arch.getLanguage(); Set keys = new HashSet<>(); RegisterValue[] rvs = new RegisterValue[regNames.length]; @@ -591,7 +591,7 @@ public class JdiCommands { if (register == null) { register = fabricatePcRegister(lang, r); } - keys.add(manager.key(r)); + keys.add(connector.key(r)); Location loc = frame.location(); Address addr = putRegister(ppath, r, loc); RegisterValue rv = new RegisterValue(register, BigInteger.valueOf(addr.getOffset())); @@ -602,7 +602,7 @@ public class JdiCommands { if (register == null) { register = fabricatePcRegister(lang, r); } - keys.add(manager.key(r)); + keys.add(connector.key(r)); ThreadReference thread = frame.thread(); Location ploc = null; int frameCount; @@ -633,13 +633,13 @@ public class JdiCommands { } public void putCurrentLocation() { - Location loc = manager.getJdi().getCurrentLocation(); + Location loc = connector.getJdi().getCurrentLocation(); if (loc == null) { return; } Method m = loc.method(); - VirtualMachine vm = manager.getJdi().getCurrentVM(); - if (manager.getAddressRange(m.declaringType()) == null) { + VirtualMachine vm = connector.getJdi().getCurrentVM(); + if (connector.getAddressRange(m.declaringType()) == null) { putReferenceType(getPath(vm) + ".Classes", m.declaringType(), true); } else { @@ -648,10 +648,10 @@ public class JdiCommands { } public Address putRegister(String ppath, String name, Location loc) { - Address addr = manager.getAddressFromLocation(loc); + Address addr = connector.getAddressFromLocation(loc); RegisterMapper mapper = state.trace.registerMapper; String regName = mapper.mapName(name); - JdiArch arch = manager.getArch(); + JdiArch arch = connector.getArch(); Language lang = arch.getLanguage(); Register register = lang.getRegister(name); if (register == null) { @@ -660,7 +660,7 @@ public class JdiCommands { RegisterValue rv = new RegisterValue(register, addr.getOffsetAsBigInteger()); RegisterValue mapped = mapper.mapValue(name, rv); Address regAddr = addr.getNewAddress(mapped.getUnsignedValue().longValue()); - setValue(ppath, manager.key(regName), Long.toHexString(regAddr.getOffset())); + setValue(ppath, connector.key(regName), Long.toHexString(regAddr.getOffset())); int codeIndex = (int) loc.codeIndex(); regAddr = regAddr.subtract(codeIndex); @@ -688,7 +688,7 @@ public class JdiCommands { byte[] bytes = new byte[ilen]; Arrays.fill(bytes, (byte) 0xFF); if (addressSpace.getName().equals("ram")) { - Method method = manager.getMethodForAddress(address); + Method method = connector.getMethodForAddress(address); if (method != null) { byte[] bytecodes = method.bytecodes(); if (bytecodes != null) { @@ -704,7 +704,7 @@ public class JdiCommands { return; } if (addressSpace.getName().equals("constantPool")) { - ReferenceType reftype = manager.getReferenceTypeForPoolAddress(address); + ReferenceType reftype = connector.getReferenceTypeForPoolAddress(address); if (reftype != null) { byte[] bytecodes = reftype.constantPool(); if (bytecodes != null) { @@ -733,7 +733,7 @@ public class JdiCommands { public void putReferenceTypeContainer(String ppath, List reftypes) { Set keys = new HashSet<>(); for (ReferenceType ref : reftypes) { - keys.add(manager.key(ref.name())); + keys.add(connector.key(ref.name())); putReferenceType(ppath, ref, false); } retainKeys(ppath, keys); @@ -741,8 +741,8 @@ public class JdiCommands { public void putReferenceType(String ppath, ReferenceType reftype, boolean load) { String path = createObject(reftype, reftype.name(), ppath); - if (manager.getAddressRange(reftype) == null) { - manager.bumpRamIndex(); + if (connector.getAddressRange(reftype) == null) { + connector.bumpRamIndex(); } if (load) { registerMemory(path, reftype); @@ -824,28 +824,28 @@ public class JdiCommands { } private void registerMemory(String path, ReferenceType reftype) { - VirtualMachine vm = manager.getJdi().getCurrentVM(); + VirtualMachine vm = connector.getJdi().getCurrentVM(); String mempath = getPath(vm) + ".Memory"; AddressSet bounds = new AddressSet(); for (Method m : reftype.methods()) { if (m.location() != null) { - AddressRange range = manager.registerAddressesForMethod(m); + AddressRange range = connector.registerAddressesForMethod(m); if (range != null && range.getMinAddress().getOffset() != 0) { putMem(range.getMinAddress(), range.getLength(), true); bounds.add(range); - String mpath = createObject(mempath + manager.key(m.toString())); + String mpath = createObject(mempath + connector.key(m.toString())); setValue(mpath, ATTR_RANGE, range); insertObject(mpath); } } } - AddressRange range = manager.putAddressRange(reftype, bounds); + AddressRange range = connector.putAddressRange(reftype, bounds); setValue(path, ATTR_RANGE, range); try { setValue(path, ATTR_COUNT, reftype.constantPoolCount()); - range = manager.getPoolAddressRange(reftype, getSize(reftype) - 1); + range = connector.getPoolAddressRange(reftype, getSize(reftype) - 1); setValue(path, ATTR_RANGE_CP, range); } catch (UnsupportedOperationException e) { @@ -861,7 +861,7 @@ public class JdiCommands { private void updateMemoryForMethod(Method m) { if (m.location() != null) { - AddressRange range = manager.registerAddressesForMethod(m); + AddressRange range = connector.registerAddressesForMethod(m); if (range != null && range.getMinAddress().getOffset() != 0) { putMem(range.getMinAddress(), range.getLength(), true); } @@ -891,7 +891,7 @@ public class JdiCommands { public void putClassTypes(String ppath, List reftypes) { Set keys = new HashSet<>(); for (ClassType ref : reftypes) { - keys.add(manager.key(ref.name())); + keys.add(connector.key(ref.name())); putReferenceType(ppath, ref, true); } retainKeys(ppath, keys); @@ -912,7 +912,7 @@ public class JdiCommands { public void putInterfaceTypes(String ppath, List reftypes) { Set keys = new HashSet<>(); for (ReferenceType ref : reftypes) { - keys.add(manager.key(ref.name())); + keys.add(connector.key(ref.name())); putReferenceType(ppath, ref, true); } retainKeys(ppath, keys); @@ -1007,7 +1007,7 @@ public class JdiCommands { } private Value getPrimitiveValue(Value value, String newVal) { - VirtualMachine vm = manager.getJdi().getCurrentVM(); + VirtualMachine vm = connector.getJdi().getCurrentVM(); if (value instanceof BooleanValue) { return vm.mirrorOf(Boolean.valueOf(newVal)); } @@ -1041,7 +1041,7 @@ public class JdiCommands { public void modifyValue(LocalVariable lvar, String valstr) { String path = getPath(lvar); String ppath = getParentPath(path); - Object parent = manager.objForPath(ppath); + Object parent = connector.objForPath(ppath); if (parent instanceof StackFrame frame) { Value orig = frame.getValue(lvar); Value repl = getPrimitiveValue(orig, valstr); @@ -1065,7 +1065,7 @@ public class JdiCommands { public void modifyValue(Field field, String valstr) { String path = getPath(field); String ppath = getParentPath(path); - Object parent = manager.objForPath(ppath); + Object parent = connector.objForPath(ppath); if (parent instanceof ObjectReference ref) { Value orig = ref.getValue(field); Value repl = getPrimitiveValue(orig, valstr); @@ -1179,13 +1179,13 @@ public class JdiCommands { } public void putModuleReferenceContainer() { - VirtualMachine vm = manager.getJdi().getCurrentVM(); + VirtualMachine vm = connector.getJdi().getCurrentVM(); String ppath = getPath(vm) + ".ModuleRefs"; Set keys = new HashSet<>(); try { List modules = vm.allModules(); for (ModuleReference ref : modules) { - keys.add(manager.key(ref.name())); + keys.add(connector.key(ref.name())); String mpath = createObject(ref, ref.name(), ppath); insertObject(mpath); } @@ -1223,7 +1223,7 @@ public class JdiCommands { String ppath = refpath + ".ThreadGroups"; Set keys = new HashSet<>(); for (ThreadGroupReference subref : refs) { - keys.add(manager.key(subref.name())); + keys.add(connector.key(subref.name())); putThreadGroupReference(ppath, subref); } retainKeys(ppath, keys); @@ -1251,7 +1251,7 @@ public class JdiCommands { String ppath = refpath + ".Threads"; Set keys = new HashSet<>(); for (ThreadReference subref : refs) { - keys.add(manager.key(subref.name())); + keys.add(connector.key(subref.name())); if (asLink) { createLink(ppath, subref.name(), subref); } @@ -1325,7 +1325,7 @@ public class JdiCommands { // TYPE COMPONENTS public void putFieldContainer(String path, ReferenceType reftype) { - boolean scope = manager.getScope(reftype); + boolean scope = connector.getScope(reftype); List fields = scope ? reftype.allFields() : reftype.fields(); Set keys = new HashSet<>(); for (Field f : fields) { @@ -1333,32 +1333,32 @@ public class JdiCommands { try { value = reftype.getValue(f); if (value != null) { - keys.add(manager.key(value.toString())); + keys.add(connector.key(value.toString())); } } catch (IllegalArgumentException iae) { // IGNORE } - keys.add(manager.key(f.name())); + keys.add(connector.key(f.name())); putField(path, f, value); } retainKeys(path, keys); } public void putVariableContainer(String path, ObjectReference ref) { - boolean scope = manager.getScope(ref); + boolean scope = connector.getScope(ref); List fields = scope ? ref.referenceType().allFields() : ref.referenceType().fields(); Set keys = new HashSet<>(); for (Field f : fields) { Value value = null; try { value = ref.getValue(f); - keys.add(manager.key(value.toString())); + keys.add(connector.key(value.toString())); } catch (IllegalArgumentException iae) { // IGNORE } - keys.add(manager.key(f.name())); + keys.add(connector.key(f.name())); putField(path, f, value); } retainKeys(path, keys); @@ -1409,12 +1409,12 @@ public class JdiCommands { } public void putMethodContainer(String path, ReferenceType reftype) { - boolean scope = manager.getScope(reftype); + boolean scope = connector.getScope(reftype); Set keys = new HashSet<>(); try { List methods = scope ? reftype.allMethods() : reftype.methods(); for (Method m : methods) { - keys.add(manager.key(m.name())); + keys.add(connector.key(m.name())); putMethod(path, m); } } @@ -1450,8 +1450,8 @@ public class JdiCommands { insertObject(vpath); } if (m.location() != null) { - AddressRange range = manager.getAddressRange(m); - if (!range.equals(manager.defaultRange)) { + AddressRange range = connector.getAddressRange(m); + if (!range.equals(connector.defaultRange)) { setValue(path, ATTR_RANGE, range); } } @@ -1490,7 +1490,7 @@ public class JdiCommands { Set keys = new HashSet<>(); for (Entry entry : jdi.listVMs().get().entrySet()) { VirtualMachine vm = entry.getValue(); - keys.add(manager.key(vm.name())); + keys.add(connector.key(vm.name())); putVM("VMs", vm); } retainKeys("VMs", keys); @@ -1545,7 +1545,7 @@ public class JdiCommands { Process proc = vm.process(); if (proc != null) { String key = Long.toString(proc.pid()); - keys.add(manager.key(key)); + keys.add(connector.key(key)); putProcess(ppath, proc); } retainKeys(ppath, keys); @@ -1573,7 +1573,7 @@ public class JdiCommands { } public void putFrames() { - ThreadReference thread = manager.getJdi().getCurrentThread(); + ThreadReference thread = connector.getJdi().getCurrentThread(); String ppath = createObject(getPath(thread) + ".Stack"); Set keys = new HashSet<>(); try { @@ -1581,7 +1581,7 @@ public class JdiCommands { for (int i = 0; i < frameCount; i++) { StackFrame frame = thread.frame(i); String key = Integer.toString(i); - keys.add(manager.key(key)); + keys.add(connector.key(key)); putFrame(ppath, frame, key); } } @@ -1603,7 +1603,7 @@ public class JdiCommands { setValue(path, ATTR_DISPLAY, "[" + key + "] " + location + ":" + location.method().name() + ":" + location.codeIndex()); putLocation(path, ATTR_LOCATION, location); - Address addr = manager.getAddressFromLocation(location); + Address addr = connector.getAddressFromLocation(location); setValue(path, ATTR_PC, addr); String rpath = createObject(path + ".Registers"); @@ -1651,9 +1651,9 @@ public class JdiCommands { } public void putLocationDetails(String path, Location location) { - Address addr = manager.getAddressFromLocation(location); + Address addr = connector.getAddressFromLocation(location); if (isLoaded(location)) { - setValue(path, ATTR_DISPLAY, manager.key(location.toString()) + ": " + addr); + setValue(path, ATTR_DISPLAY, connector.key(location.toString()) + ": " + addr); setValue(path, ATTR_ADDRESS, addr); } setValue(path, ATTR_INDEX, location.codeIndex()); @@ -1687,8 +1687,8 @@ public class JdiCommands { } private boolean isLoaded(Location location) { - AddressRange range = manager.getAddressRange(location.method()); - return !range.equals(manager.defaultRange); + AddressRange range = connector.getAddressRange(location.method()); + return !range.equals(connector.defaultRange); } public void putLocalVariableContainer(String path, Map variables) { @@ -1747,7 +1747,7 @@ public class JdiCommands { } public void putBreakpoints() { - VirtualMachine vm = manager.getJdi().getCurrentVM(); + VirtualMachine vm = connector.getJdi().getCurrentVM(); EventRequestManager requestManager = vm.eventRequestManager(); String ppath = getPath(vm) + ".Breakpoints"; String path = createObject(ppath); @@ -1755,14 +1755,14 @@ public class JdiCommands { List brkReqs = requestManager.breakpointRequests(); for (BreakpointRequest req : brkReqs) { - String key = manager.key(req.toString()); + String key = connector.key(req.toString()); keys.add(key); putReqBreakpoint(ppath, req, key); } List watchReqs = requestManager.accessWatchpointRequests(); for (AccessWatchpointRequest req : watchReqs) { - String key = manager.key(req.toString()); + String key = connector.key(req.toString()); keys.add(key); putReqAccessWatchpoint(ppath, req, key); } @@ -1770,7 +1770,7 @@ public class JdiCommands { List modReqs = requestManager.modificationWatchpointRequests(); for (ModificationWatchpointRequest req : modReqs) { - String key = manager.key(req.toString()); + String key = connector.key(req.toString()); keys.add(key); putReqModificationWatchpoint(ppath, req, key); } @@ -1780,7 +1780,7 @@ public class JdiCommands { } public void putEvents() { - VirtualMachine vm = manager.getJdi().getCurrentVM(); + VirtualMachine vm = connector.getJdi().getCurrentVM(); EventRequestManager requestManager = vm.eventRequestManager(); String ppath = getPath(vm) + ".Events"; String path = createObject(ppath); @@ -1788,81 +1788,81 @@ public class JdiCommands { List deathReqs = requestManager.vmDeathRequests(); for (VMDeathRequest req : deathReqs) { - keys.add(manager.key(req.toString())); + keys.add(connector.key(req.toString())); putReqVMDeath(ppath, req, req.toString()); } List threadStartReqs = requestManager.threadStartRequests(); for (ThreadStartRequest req : threadStartReqs) { - keys.add(manager.key(req.toString())); + keys.add(connector.key(req.toString())); putReqThreadStarted(ppath, req, req.toString()); } List threadDeathReqs = requestManager.threadDeathRequests(); for (ThreadDeathRequest req : threadDeathReqs) { - keys.add(manager.key(req.toString())); + keys.add(connector.key(req.toString())); putReqThreadExited(ppath, req, req.toString()); } List excReqs = requestManager.exceptionRequests(); for (ExceptionRequest req : excReqs) { - keys.add(manager.key(req.toString())); + keys.add(connector.key(req.toString())); putReqException(ppath, req, req.toString()); } List loadReqs = requestManager.classPrepareRequests(); for (ClassPrepareRequest req : loadReqs) { - keys.add(manager.key(req.toString())); + keys.add(connector.key(req.toString())); putReqClassLoad(ppath, req, req.toString()); } List unloadReqs = requestManager.classUnloadRequests(); for (ClassUnloadRequest req : unloadReqs) { - keys.add(manager.key(req.toString())); + keys.add(connector.key(req.toString())); putReqClassUnload(ppath, req, req.toString()); } List entryReqs = requestManager.methodEntryRequests(); for (MethodEntryRequest req : entryReqs) { - keys.add(manager.key(req.toString())); + keys.add(connector.key(req.toString())); putReqMethodEntry(ppath, req, req.toString()); } List exitReqs = requestManager.methodExitRequests(); for (MethodExitRequest req : exitReqs) { - keys.add(manager.key(req.toString())); + keys.add(connector.key(req.toString())); putReqMethodExit(ppath, req, req.toString()); } List stepReqs = requestManager.stepRequests(); for (StepRequest req : stepReqs) { - keys.add(manager.key(req.toString())); + keys.add(connector.key(req.toString())); putReqStep(ppath, req, req.toString()); } List monEnterReqs = requestManager.monitorContendedEnterRequests(); for (MonitorContendedEnterRequest req : monEnterReqs) { - keys.add(manager.key(req.toString())); + keys.add(connector.key(req.toString())); putReqMonContendedEnter(ppath, req, req.toString()); } List monEnteredReqs = requestManager.monitorContendedEnteredRequests(); for (MonitorContendedEnteredRequest req : monEnteredReqs) { - keys.add(manager.key(req.toString())); + keys.add(connector.key(req.toString())); putReqMonContendedEntered(ppath, req, req.toString()); } List monWaitReqs = requestManager.monitorWaitRequests(); for (MonitorWaitRequest req : monWaitReqs) { - keys.add(manager.key(req.toString())); + keys.add(connector.key(req.toString())); putReqMonWait(ppath, req, req.toString()); } List monWaitedReqs = requestManager.monitorWaitedRequests(); for (MonitorWaitedRequest req : monWaitedReqs) { - keys.add(manager.key(req.toString())); + keys.add(connector.key(req.toString())); putReqMonWaited(ppath, req, req.toString()); } @@ -1912,7 +1912,7 @@ public class JdiCommands { Location location = req.location(); setValue(path, ATTR_DISPLAY, "[" + key + "] " + location + ":" + location.method().name() + ":" + location.codeIndex()); - Address addr = manager.getAddressFromLocation(location); + Address addr = connector.getAddressFromLocation(location); AddressRangeImpl range = new AddressRangeImpl(addr, addr); setValue(path, ATTR_RANGE, range); String lpath = createObject(location, location.toString(), path + ".Location"); @@ -1933,7 +1933,7 @@ public class JdiCommands { setValue(path, ATTR_DISPLAY, "[" + key + "] " + field + ":" + field.declaringType()); // NB: This isn't correct, but we need a range (any range) AddressRange range = - manager.getPoolAddressRange(field.declaringType(), getSize(field.declaringType())); + connector.getPoolAddressRange(field.declaringType(), getSize(field.declaringType())); setValue(path, ATTR_RANGE, range); String fpath = createObject(field, field.toString(), path + ".Field"); insertObject(fpath); @@ -1954,7 +1954,7 @@ public class JdiCommands { setValue(path, ATTR_DISPLAY, "[" + key + "] " + field + ":" + field.declaringType()); // NB: This isn't correct, but we need a range (any range) AddressRange range = - manager.getPoolAddressRange(field.declaringType(), getSize(field.declaringType())); + connector.getPoolAddressRange(field.declaringType(), getSize(field.declaringType())); setValue(path, ATTR_RANGE, range); String fpath = createObject(field, field.toString(), path + ".Field"); insertObject(fpath); @@ -2102,7 +2102,7 @@ public class JdiCommands { public void ghidraTracePutClasses() { state.requireTrace(); try (RmiTransaction tx = state.trace.startTx("ghidraTracePutClasses", false)) { - VirtualMachine vm = manager.getJdi().getCurrentVM(); + VirtualMachine vm = connector.getJdi().getCurrentVM(); putReferenceTypeContainer(getPath(vm) + ".Classes", vm.allClasses()); } } @@ -2110,7 +2110,7 @@ public class JdiCommands { public void ghidraTracePutThreads() { state.requireTrace(); try (RmiTransaction tx = state.trace.startTx("ghidraTracePutThreads", false)) { - VirtualMachine vm = manager.getJdi().getCurrentVM(); + VirtualMachine vm = connector.getJdi().getCurrentVM(); putThreadContainer(getPath(vm), vm.allThreads(), false); // Do this first putThreadGroupContainer(getPath(vm), vm.topLevelThreadGroups()); } @@ -2127,7 +2127,7 @@ public class JdiCommands { state.requireTrace(); try (RmiTransaction tx = state.trace.startTx("ghidraTracePutAll", false)) { putVMs(); - VirtualMachine vm = manager.getJdi().getCurrentVM(); + VirtualMachine vm = connector.getJdi().getCurrentVM(); putProcesses(); putThreadContainer(getPath(vm), vm.allThreads(), false); putThreadGroupContainer(getPath(vm), vm.topLevelThreadGroups()); @@ -2139,37 +2139,37 @@ public class JdiCommands { } public void ghidraTraceInstallHooks() { - manager.getHooks().installHooks(); + connector.getHooks().installHooks(); } public void ghidraTraceRemoveHooks() { - manager.getHooks().removeHooks(); + connector.getHooks().removeHooks(); } public void ghidraTraceSyncEnable() { try (RmiTransaction tx = state.trace.startTx("ghidraTraceSyncEnable", false)) { - JdiHooks hooks = manager.getHooks(); + JdiHooks hooks = connector.getHooks(); hooks.installHooks(); hooks.enableCurrentVM(); } } public void ghidraTraceSyncDisable() { - manager.getHooks().disableCurrentVM(); + connector.getHooks().disableCurrentVM(); } public void ghidraTraceSyncSynthStopped() { - manager.getHooks().onStop(null, state.trace); + connector.getHooks().onStop(null, state.trace); } public void ghidraTraceWaitStopped(int timeout) { - ThreadReference currentThread = manager.getJdi().getCurrentThread(); + ThreadReference currentThread = connector.getJdi().getCurrentThread(); if (currentThread == null) { return; } long start = System.currentTimeMillis(); while (!currentThread.isSuspended()) { - currentThread = manager.getJdi().getCurrentThread(); + currentThread = connector.getJdi().getCurrentThread(); try { Thread.sleep(100); long elapsed = System.currentTimeMillis() - start; @@ -2219,7 +2219,7 @@ public class JdiCommands { } String getPath(Object obj) { - return manager.pathForObj(obj); + return connector.pathForObj(obj); } public RmiTraceObject proxyObject(Object obj) { @@ -2236,7 +2236,7 @@ public class JdiCommands { if (obj == null) { return null; } - String path = manager.recordPath(obj, ppath, key); + String path = connector.recordPath(obj, ppath, key); state.trace.createObject(path); return path; } @@ -2268,7 +2268,7 @@ public class JdiCommands { } public String getVmPath(VirtualMachine vm) { - return manager.recordPath(vm, "VMs", vm.name()); + return connector.recordPath(vm, "VMs", vm.name()); } public String getParentPath(String path) { diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/rmi/jpda/JdiManager.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/rmi/jpda/JdiConnector.java similarity index 98% rename from Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/rmi/jpda/JdiManager.java rename to Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/rmi/jpda/JdiConnector.java index 76dfcd958f..3870d47e28 100644 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/rmi/jpda/JdiManager.java +++ b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/rmi/jpda/JdiConnector.java @@ -29,7 +29,7 @@ import ghidra.dbg.target.schema.TargetObjectSchema; import ghidra.program.model.address.*; import ghidra.util.Msg; -public class JdiManager { +public class JdiConnector { private static final int STATIC_METHOD_SEPARATION = 3; public static final long BLOCK_SIZE = 0x1000L; @@ -95,14 +95,14 @@ public class JdiManager { final TargetObjectSchema rootSchema; private Map env; - public JdiManager(JdiManagerImpl manager, Map env) { + public JdiConnector(JdiManagerImpl manager, Map env) { this(manager); this.env = env; commands.ghidraTraceConnect(env.get("GHIDRA_TRACE_RMI_ADDR")); commands.ghidraTraceStart(env.get("OPT_TARGET_CLASS")); } - public JdiManager(JdiManagerImpl manager) { + public JdiConnector(JdiManagerImpl manager) { this.manager = manager; Address start = ram.getAddress(DEFAULT_SECTION); defaultRange = new AddressRangeImpl(start, start.add(BLOCK_SIZE - 1)); diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/rmi/jpda/JdiHooks.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/rmi/jpda/JdiHooks.java index e5e5a8484f..766ae9716d 100644 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/rmi/jpda/JdiHooks.java +++ b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/rmi/jpda/JdiHooks.java @@ -15,7 +15,7 @@ */ package ghidra.dbg.jdi.rmi.jpda; -import static ghidra.dbg.jdi.rmi.jpda.JdiManager.*; +import static ghidra.dbg.jdi.rmi.jpda.JdiConnector.*; import java.util.*; @@ -42,7 +42,7 @@ class HookState { class VmState { - private JdiManager manager; + private JdiConnector connector; private JdiCommands cmds; private boolean firstPass; boolean classes; @@ -53,9 +53,9 @@ class VmState { boolean events; Set visited; - public VmState(JdiManager manager) { - this.manager = manager; - this.cmds = manager.getCommands(); + public VmState(JdiConnector connector) { + this.connector = connector; + this.cmds = connector.getCommands(); this.firstPass = true; this.classes = false; this.modules = false; @@ -76,7 +76,7 @@ class VmState { cmds.putProcesses(); } - VirtualMachine vm = manager.getJdi().getCurrentVM(); + VirtualMachine vm = connector.getJdi().getCurrentVM(); cmds.putVM("VMs", vm); setState(vm); @@ -88,14 +88,14 @@ class VmState { } cmds.putCurrentLocation(); - ThreadReference thread = manager.getJdi().getCurrentThread(); + ThreadReference thread = connector.getJdi().getCurrentThread(); if (thread != null) { cmds.createLink(vm, "_event_thread", thread); if (first || !visited.contains(thread)) { cmds.putFrames(); visited.add(thread); } - StackFrame frame = manager.getJdi().getCurrentFrame(); + StackFrame frame = connector.getJdi().getCurrentFrame(); if (frame != null) { try { if (first || !visited.contains(frame)) { @@ -104,7 +104,7 @@ class VmState { } } catch (InvalidStackFrameException e) { - manager.getJdi().setCurrentFrame(null); + connector.getJdi().setCurrentFrame(null); } } } @@ -153,7 +153,7 @@ class VmState { } public void recordStateExited(VirtualMachine eventVM, String description) { - VirtualMachine vm = manager.getJdi().getCurrentVM(); + VirtualMachine vm = connector.getJdi().getCurrentVM(); String path = cmds.getPath(vm); int exitCode = -1; try { @@ -179,13 +179,13 @@ class VmState { public class JdiHooks implements JdiEventsListenerAdapter { - private JdiManager manager; + private JdiConnector connector; private JdiCommands cmds; private HookState hookState; private Map vmStates = new HashMap<>(); - public JdiHooks(JdiManager manager, JdiCommands cmds) { - this.manager = manager; + public JdiHooks(JdiConnector connector, JdiCommands cmds) { + this.connector = connector; this.cmds = cmds; } @@ -196,8 +196,8 @@ public class JdiHooks implements JdiEventsListenerAdapter { @Override public DebugStatus vmStarted(VMStartEvent event, JdiCause cause) { - setCommands(manager.getCommands()); - JdiManagerImpl jdi = manager.getJdi(); + setCommands(connector.getCommands()); + JdiManagerImpl jdi = connector.getJdi(); VirtualMachine vm = event == null ? jdi.getCurrentVM() : event.virtualMachine(); jdi.setCurrentVM(vm); jdi.addVM(vm); @@ -220,7 +220,7 @@ public class JdiHooks implements JdiEventsListenerAdapter { return DebugStatus.NO_CHANGE; } onStop(evt, trace); - return manager.getReturnStatus("VMDeathEvent"); + return connector.getReturnStatus("VMDeathEvent"); } @Override @@ -245,7 +245,7 @@ public class JdiHooks implements JdiEventsListenerAdapter { return DebugStatus.NO_CHANGE; } onStop(evt, trace); - return manager.getReturnStatus("ThreadStartEvent"); + return connector.getReturnStatus("ThreadStartEvent"); } @Override @@ -255,7 +255,7 @@ public class JdiHooks implements JdiEventsListenerAdapter { return DebugStatus.NO_CHANGE; } onStop(evt, trace); - return manager.getReturnStatus("ThreadDeathEvent"); + return connector.getReturnStatus("ThreadDeathEvent"); } @Override @@ -315,7 +315,7 @@ public class JdiHooks implements JdiEventsListenerAdapter { return DebugStatus.NO_CHANGE; } onStop(evt, trace); - return manager.getReturnStatus("ExceptionEvent"); + return connector.getReturnStatus("ExceptionEvent"); } @Override @@ -325,7 +325,7 @@ public class JdiHooks implements JdiEventsListenerAdapter { return DebugStatus.NO_CHANGE; } onStop(evt, trace); - return manager.getReturnStatus("MethodEntryEvent"); + return connector.getReturnStatus("MethodEntryEvent"); } @Override @@ -335,7 +335,7 @@ public class JdiHooks implements JdiEventsListenerAdapter { return DebugStatus.NO_CHANGE; } onStop(evt, trace); - return manager.getReturnStatus("MethodExitEvent"); + return connector.getReturnStatus("MethodExitEvent"); } @Override @@ -345,7 +345,7 @@ public class JdiHooks implements JdiEventsListenerAdapter { return DebugStatus.NO_CHANGE; } onStop(evt, trace); - return manager.getReturnStatus("ClassPrepareEvent"); + return connector.getReturnStatus("ClassPrepareEvent"); } @Override @@ -355,7 +355,7 @@ public class JdiHooks implements JdiEventsListenerAdapter { return DebugStatus.NO_CHANGE; } onStop(evt, trace); - return manager.getReturnStatus("ClassUnloadEvent"); + return connector.getReturnStatus("ClassUnloadEvent"); } @Override @@ -365,7 +365,7 @@ public class JdiHooks implements JdiEventsListenerAdapter { return DebugStatus.NO_CHANGE; } onStop(evt, trace); - return manager.getReturnStatus("MonitorContendedEnterEvent"); + return connector.getReturnStatus("MonitorContendedEnterEvent"); } @Override @@ -375,7 +375,7 @@ public class JdiHooks implements JdiEventsListenerAdapter { return DebugStatus.NO_CHANGE; } onStop(evt, trace); - return manager.getReturnStatus("MonitorContendedEnteredEvent"); + return connector.getReturnStatus("MonitorContendedEnteredEvent"); } @Override @@ -385,7 +385,7 @@ public class JdiHooks implements JdiEventsListenerAdapter { return DebugStatus.NO_CHANGE; } onStop(evt, trace); - return manager.getReturnStatus("MonitorWaitEvent"); + return connector.getReturnStatus("MonitorWaitEvent"); } @Override @@ -395,7 +395,7 @@ public class JdiHooks implements JdiEventsListenerAdapter { return DebugStatus.NO_CHANGE; } onStop(evt, trace); - return manager.getReturnStatus("MonitorWaitedEvent"); + return connector.getReturnStatus("MonitorWaitedEvent"); } @Override @@ -405,7 +405,7 @@ public class JdiHooks implements JdiEventsListenerAdapter { } void onStop(Event evt, RmiTrace trace) { - VirtualMachine vm = manager.getJdi().getCurrentVM(); + VirtualMachine vm = connector.getJdi().getCurrentVM(); if (evt != null) { setCurrent(evt); vm = evt.virtualMachine(); @@ -421,7 +421,7 @@ public class JdiHooks implements JdiEventsListenerAdapter { private void setCurrent(Event event) { VirtualMachine eventVM = event.virtualMachine(); - JdiManagerImpl jdi = manager.getJdi(); + JdiManagerImpl jdi = connector.getJdi(); jdi.setCurrentEvent(event); jdi.setCurrentVM(eventVM); if (event instanceof LocatableEvent locEvt) { @@ -438,7 +438,7 @@ public class JdiHooks implements JdiEventsListenerAdapter { } void onContinue() { - VirtualMachine currentVM = manager.getJdi().getCurrentVM(); + VirtualMachine currentVM = connector.getJdi().getCurrentVM(); VmState state = vmStates.get(currentVM); try (RmiBatch batch = hookState.batch(); RmiTransaction tx = cmds.state.trace.openTx("Continue")) { @@ -448,23 +448,23 @@ public class JdiHooks implements JdiEventsListenerAdapter { } public void installHooks() { - manager.getJdi().addEventsListener(null, this); + connector.getJdi().addEventsListener(null, this); } public void removeHooks() { - manager.getJdi().removeEventsListener(null, this); + connector.getJdi().removeEventsListener(null, this); } public void enableCurrentVM() { - VirtualMachine vm = manager.getJdi().getCurrentVM(); - VmState state = new VmState(manager); + VirtualMachine vm = connector.getJdi().getCurrentVM(); + VmState state = new VmState(connector); vmStates.put(vm, state); state.recordState("VM started"); cmds.activate(null); } public void disableCurrentVM() { - VirtualMachine vm = manager.getJdi().getCurrentVM(); + VirtualMachine vm = connector.getJdi().getCurrentVM(); VmState state = vmStates.get(vm); state.visited.clear(); vmStates.remove(vm); diff --git a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/rmi/jpda/JdiMethods.java b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/rmi/jpda/JdiMethods.java index e226cd61bd..5986604c6b 100644 --- a/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/rmi/jpda/JdiMethods.java +++ b/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/rmi/jpda/JdiMethods.java @@ -15,7 +15,7 @@ */ package ghidra.dbg.jdi.rmi.jpda; -import static ghidra.dbg.jdi.rmi.jpda.JdiManager.*; +import static ghidra.dbg.jdi.rmi.jpda.JdiConnector.*; import java.io.IOException; import java.util.*; @@ -33,11 +33,11 @@ import ghidra.util.Msg; public class JdiMethods implements RmiMethods { - private JdiManager manager; + private JdiConnector connector; private JdiCommands cmds; - public JdiMethods(JdiManager manager, JdiCommands cmds) { - this.manager = manager; + public JdiMethods(JdiConnector connector, JdiCommands cmds) { + this.connector = connector; this.cmds = cmds; registerMethods(); } @@ -47,7 +47,7 @@ public class JdiMethods implements RmiMethods { for (java.lang.reflect.Method m : cls.getMethods()) { TraceMethod annot = m.getAnnotation(TraceMethod.class); if (annot != null) { - manager.registerRemoteMethod(this, m, m.getName()); + connector.registerRemoteMethod(this, m, m.getName()); } } } @@ -470,7 +470,7 @@ public class JdiMethods implements RmiMethods { public void load_reftype( @Param(schema = "ReferenceType", name = "reference_type") RmiTraceObject obj) { try (RmiTransaction tx = cmds.state.trace.openTx("RefreshReferenceType")) { - VirtualMachine vm = manager.getJdi().getCurrentVM(); + VirtualMachine vm = connector.getJdi().getCurrentVM(); String path = obj.getPath(); String mempath = cmds.getPath(vm) + ".Classes"; ReferenceType refType = (ReferenceType) getObjectFromPath(path); @@ -638,7 +638,7 @@ public class JdiMethods implements RmiMethods { VirtualMachine vm = (VirtualMachine) getObjectFromPath(obj.getPath()); vm.exit(143); try { - manager.getJdi().sendInterruptNow(); + connector.getJdi().sendInterruptNow(); } catch (IOException e) { e.printStackTrace(); @@ -649,28 +649,28 @@ public class JdiMethods implements RmiMethods { public void resume_vm(@Param(schema = "VirtualMachine", name = "vm") RmiTraceObject obj) { VirtualMachine vm = (VirtualMachine) getObjectFromPath(obj.getPath()); vm.resume(); - manager.getHooks().setState(vm); + connector.getHooks().setState(vm); } @TraceMethod(action = "resume", display = "Resume") public void resume_thread(@Param(schema = "Thread", name = "thread") RmiTraceObject obj) { ThreadReference thread = (ThreadReference) getObjectFromPath(obj.getPath()); thread.resume(); - manager.getHooks().setState(thread.virtualMachine()); + connector.getHooks().setState(thread.virtualMachine()); } @TraceMethod(action = "interrupt", display = "Suspend") public void suspend_vm(@Param(schema = "VirtualMachine", name = "vm") RmiTraceObject obj) { VirtualMachine vm = (VirtualMachine) getObjectFromPath(obj.getPath()); vm.suspend(); - manager.getHooks().setState(vm); + connector.getHooks().setState(vm); } @TraceMethod(action = "interrupt", display = "Suspend") public void suspend_thread(@Param(schema = "Thread", name = "thread") RmiTraceObject obj) { ThreadReference thread = (ThreadReference) getObjectFromPath(obj.getPath()); thread.suspend(); - manager.getHooks().setState(thread.virtualMachine()); + connector.getHooks().setState(thread.virtualMachine()); } /** @@ -679,7 +679,7 @@ public class JdiMethods implements RmiMethods { */ @TraceMethod(action = "step_into", display = "Step into") public void step_vm_into(@Param(schema = "VirtualMachine", name = "vm") RmiTraceObject obj) { - VirtualMachine vm = manager.getJdi().getCurrentVM(); + VirtualMachine vm = connector.getJdi().getCurrentVM(); List threads = getThreadsFromValue(obj); for (ThreadReference thread : threads) { try { @@ -697,7 +697,7 @@ public class JdiMethods implements RmiMethods { @TraceMethod(action = "step_over", display = "Step over") public void step_vm_over(@Param(schema = "VirtualMachine", name = "vm") RmiTraceObject obj) { - VirtualMachine vm = manager.getJdi().getCurrentVM(); + VirtualMachine vm = connector.getJdi().getCurrentVM(); List threads = getThreadsFromValue(obj); for (ThreadReference thread : threads) { try { @@ -715,7 +715,7 @@ public class JdiMethods implements RmiMethods { @TraceMethod(action = "step_out", display = "Step out") public void step_vm_out(@Param(schema = "VirtualMachine", name = "vm") RmiTraceObject obj) { - VirtualMachine vm = manager.getJdi().getCurrentVM(); + VirtualMachine vm = connector.getJdi().getCurrentVM(); List threads = getThreadsFromValue(obj); for (ThreadReference thread : threads) { try { @@ -733,7 +733,7 @@ public class JdiMethods implements RmiMethods { @TraceMethod(action = "step_into", display = "Step into") public void step_into(@Param(schema = "Thread", name = "thread") RmiTraceObject obj) { - VirtualMachine vm = manager.getJdi().getCurrentVM(); + VirtualMachine vm = connector.getJdi().getCurrentVM(); ThreadReference thread = (ThreadReference) getObjectFromPath(obj.getPath()); StepRequest stepReq = vm.eventRequestManager() .createStepRequest(thread, StepRequest.STEP_MIN, @@ -744,7 +744,7 @@ public class JdiMethods implements RmiMethods { @TraceMethod(action = "step_over", display = "Step over") public void step_over(@Param(schema = "Thread", name = "thread") RmiTraceObject obj) { - VirtualMachine vm = manager.getJdi().getCurrentVM(); + VirtualMachine vm = connector.getJdi().getCurrentVM(); ThreadReference thread = (ThreadReference) getObjectFromPath(obj.getPath()); StepRequest stepReq = vm.eventRequestManager() .createStepRequest(thread, StepRequest.STEP_MIN, @@ -755,7 +755,7 @@ public class JdiMethods implements RmiMethods { @TraceMethod(action = "step_out", display = "Step out") public void step_out(@Param(schema = "Thread", name = "thread") RmiTraceObject obj) { - VirtualMachine vm = manager.getJdi().getCurrentVM(); + VirtualMachine vm = connector.getJdi().getCurrentVM(); ThreadReference thread = (ThreadReference) getObjectFromPath(obj.getPath()); StepRequest stepReq = vm.eventRequestManager() .createStepRequest(thread, StepRequest.STEP_MIN, @@ -769,7 +769,7 @@ public class JdiMethods implements RmiMethods { Object object = getObjectFromPath(obj.getPath()); if (object instanceof ThreadReference thread) { thread.interrupt(); - manager.getHooks().setState(thread.virtualMachine()); + connector.getHooks().setState(thread.virtualMachine()); } } @@ -787,7 +787,7 @@ public class JdiMethods implements RmiMethods { @TraceMethod(display = "Break on execute") public void break_location(@Param(schema = "Location", name = "location") RmiTraceObject obj) { - VirtualMachine vm = manager.getJdi().getCurrentVM(); + VirtualMachine vm = connector.getJdi().getCurrentVM(); Object ctxt = getObjectFromPath(obj.getPath()); if (ctxt instanceof Location loc) { BreakpointRequest brkReq = vm.eventRequestManager() @@ -799,7 +799,7 @@ public class JdiMethods implements RmiMethods { @TraceMethod(display = "Break on access") public void break_access(@Param(schema = "Field", name = "field") RmiTraceObject obj) { - VirtualMachine vm = manager.getJdi().getCurrentVM(); + VirtualMachine vm = connector.getJdi().getCurrentVM(); Object ctxt = getObjectFromPath(obj.getPath()); if (ctxt instanceof Field field) { AccessWatchpointRequest brkReq = vm.eventRequestManager() @@ -811,7 +811,7 @@ public class JdiMethods implements RmiMethods { @TraceMethod(display = "Break on modify") public void break_modify(@Param(schema = "Field", name = "field") RmiTraceObject obj) { - VirtualMachine vm = manager.getJdi().getCurrentVM(); + VirtualMachine vm = connector.getJdi().getCurrentVM(); Object ctxt = getObjectFromPath(obj.getPath()); if (ctxt instanceof Field field) { ModificationWatchpointRequest brkReq = vm.eventRequestManager() @@ -836,7 +836,7 @@ public class JdiMethods implements RmiMethods { description = "Uncaught exceptions will be notified", display = "NotifyUncaught", name = "notify_uncaught") boolean notifyUncaught) { - VirtualMachine vm = manager.getJdi().getCurrentVM(); + VirtualMachine vm = connector.getJdi().getCurrentVM(); Object ctxt = getObjectFromPath(obj.getPath()); if (ctxt instanceof ReferenceType reftype) { ExceptionRequest excReq = vm.eventRequestManager() @@ -847,7 +847,7 @@ public class JdiMethods implements RmiMethods { } private void break_started(RmiTraceObject obj) { - VirtualMachine vm = manager.getJdi().getCurrentVM(); + VirtualMachine vm = connector.getJdi().getCurrentVM(); ThreadStartRequest brkReq = vm.eventRequestManager() .createThreadStartRequest(); Object ctxt = getObjectFromPath(obj.getPath()); @@ -872,7 +872,7 @@ public class JdiMethods implements RmiMethods { } private void break_death(RmiTraceObject obj) { - VirtualMachine vm = manager.getJdi().getCurrentVM(); + VirtualMachine vm = connector.getJdi().getCurrentVM(); ThreadDeathRequest brkReq = vm.eventRequestManager() .createThreadDeathRequest(); Object ctxt = getObjectFromPath(obj.getPath()); @@ -897,7 +897,7 @@ public class JdiMethods implements RmiMethods { @TraceMethod(display = "Break on VM death") public void break_vm_death(@Param(schema = "VirtualMachine", name = "vm") RmiTraceObject obj) { - VirtualMachine vm = manager.getJdi().getCurrentVM(); + VirtualMachine vm = connector.getJdi().getCurrentVM(); VMDeathRequest brkReq = vm.eventRequestManager() .createVMDeathRequest(); brkReq.enable(); @@ -905,7 +905,7 @@ public class JdiMethods implements RmiMethods { } private void break_enter(RmiTraceObject obj) { - VirtualMachine vm = manager.getJdi().getCurrentVM(); + VirtualMachine vm = connector.getJdi().getCurrentVM(); MethodEntryRequest brkReq = vm.eventRequestManager() .createMethodEntryRequest(); Object ctxt = getObjectFromPath(obj.getPath()); @@ -949,7 +949,7 @@ public class JdiMethods implements RmiMethods { } private void break_exit(RmiTraceObject obj) { - VirtualMachine vm = manager.getJdi().getCurrentVM(); + VirtualMachine vm = connector.getJdi().getCurrentVM(); MethodExitRequest brkReq = vm.eventRequestManager() .createMethodExitRequest(); Object ctxt = getObjectFromPath(obj.getPath()); @@ -993,7 +993,7 @@ public class JdiMethods implements RmiMethods { } private void break_load(RmiTraceObject obj) { - VirtualMachine vm = manager.getJdi().getCurrentVM(); + VirtualMachine vm = connector.getJdi().getCurrentVM(); ClassPrepareRequest brkReq = vm.eventRequestManager() .createClassPrepareRequest(); Object ctxt = getObjectFromPath(obj.getPath()); @@ -1018,7 +1018,7 @@ public class JdiMethods implements RmiMethods { } private void break_unload(RmiTraceObject obj) { - VirtualMachine vm = manager.getJdi().getCurrentVM(); + VirtualMachine vm = connector.getJdi().getCurrentVM(); ClassUnloadRequest brkReq = vm.eventRequestManager() .createClassUnloadRequest(); brkReq.enable(); @@ -1032,7 +1032,7 @@ public class JdiMethods implements RmiMethods { } private void break_mon_enter_contention(RmiTraceObject obj) { - VirtualMachine vm = manager.getJdi().getCurrentVM(); + VirtualMachine vm = connector.getJdi().getCurrentVM(); MonitorContendedEnterRequest brkReq = vm.eventRequestManager() .createMonitorContendedEnterRequest(); Object ctxt = getObjectFromPath(obj.getPath()); @@ -1077,7 +1077,7 @@ public class JdiMethods implements RmiMethods { } private void break_mon_entered_contention(RmiTraceObject obj) { - VirtualMachine vm = manager.getJdi().getCurrentVM(); + VirtualMachine vm = connector.getJdi().getCurrentVM(); MonitorContendedEnteredRequest brkReq = vm.eventRequestManager() .createMonitorContendedEnteredRequest(); Object ctxt = getObjectFromPath(obj.getPath()); @@ -1122,7 +1122,7 @@ public class JdiMethods implements RmiMethods { } private void break_mon_wait(RmiTraceObject obj) { - VirtualMachine vm = manager.getJdi().getCurrentVM(); + VirtualMachine vm = connector.getJdi().getCurrentVM(); MonitorWaitRequest brkReq = vm.eventRequestManager() .createMonitorWaitRequest(); Object ctxt = getObjectFromPath(obj.getPath()); @@ -1167,7 +1167,7 @@ public class JdiMethods implements RmiMethods { } private void break_mon_waited(RmiTraceObject obj) { - VirtualMachine vm = manager.getJdi().getCurrentVM(); + VirtualMachine vm = connector.getJdi().getCurrentVM(); MonitorWaitedRequest brkReq = vm.eventRequestManager() .createMonitorWaitedRequest(); Object ctxt = getObjectFromPath(obj.getPath()); @@ -1389,7 +1389,7 @@ public class JdiMethods implements RmiMethods { @TraceMethod(action = "toggle", display = "Toggle breakpoint") public void toggle_breakpoint( @Param(schema = "BreakpointSpec", name = "breakpoint") RmiTraceObject obj) { - VirtualMachine vm = manager.getJdi().getCurrentVM(); + VirtualMachine vm = connector.getJdi().getCurrentVM(); Object ctxt = getObjectFromPath(obj.getPath()); if (ctxt instanceof Field field) { ModificationWatchpointRequest brkReq = vm.eventRequestManager() @@ -1410,7 +1410,7 @@ public class JdiMethods implements RmiMethods { @TraceMethod(action = "delete", display = "Delete breakpoint") public void delete_breakpoint( @Param(schema = "BreakpointSpec", name = "breakpoint") RmiTraceObject obj) { - VirtualMachine vm = manager.getJdi().getCurrentVM(); + VirtualMachine vm = connector.getJdi().getCurrentVM(); Object ctxt = getObjectFromPath(obj.getPath()); if (ctxt instanceof EventRequest req) { vm.eventRequestManager().deleteEventRequest(req); @@ -1434,7 +1434,7 @@ public class JdiMethods implements RmiMethods { @TraceMethod(action = "delete", display = "Delete Event") public void delete_event(@Param(schema = "Event", name = "event") RmiTraceObject obj) { - VirtualMachine vm = manager.getJdi().getCurrentVM(); + VirtualMachine vm = connector.getJdi().getCurrentVM(); Object ctxt = getObjectFromPath(obj.getPath()); if (ctxt instanceof EventRequest req) { vm.eventRequestManager().deleteEventRequest(req); @@ -1453,7 +1453,7 @@ public class JdiMethods implements RmiMethods { @Param(schema = "MethodContainer", name = "container") RmiTraceObject obj) { String ppath = cmds.getParentPath(obj.getPath()); Object parent = getObjectFromPath(ppath); - manager.toggleScope(parent); + connector.toggleScope(parent); refresh_methods(obj); } @@ -1468,7 +1468,7 @@ public class JdiMethods implements RmiMethods { @Param(schema = "FieldContainer", name = "container") RmiTraceObject obj) { String ppath = cmds.getParentPath(obj.getPath()); Object parent = getObjectFromPath(ppath); - manager.toggleScope(parent); + connector.toggleScope(parent); if (obj.getPath().endsWith("Fields")) { refresh_fields(obj); } @@ -1488,7 +1488,7 @@ public class JdiMethods implements RmiMethods { description = "Range", display = "Range", name = "range") AddressRange range) { - VirtualMachine vm = manager.getJdi().getCurrentVM(); + VirtualMachine vm = connector.getJdi().getCurrentVM(); MemoryMapper mapper = cmds.state.trace.memoryMapper; Address start = mapper.mapBack(range.getMinAddress()); try (RmiTransaction tx = cmds.state.trace.openTx("ReadMemory")) { @@ -1516,7 +1516,7 @@ public class JdiMethods implements RmiMethods { description = "Method Name", display = "MethodName", name = "method_name") String methodName) { - VirtualMachine vm = manager.getJdi().getCurrentVM(); + VirtualMachine vm = connector.getJdi().getCurrentVM(); ObjectReference ref = (ObjectReference) getObjectFromPath(obj.getPath()); List methods = ref.referenceType().methodsByName(methodName); if (methods.size() > 1) { @@ -1544,7 +1544,7 @@ public class JdiMethods implements RmiMethods { description = "Method Name", display = "MethodName", name = "method_name") String methodName) { - VirtualMachine vm = manager.getJdi().getCurrentVM(); + VirtualMachine vm = connector.getJdi().getCurrentVM(); ReferenceType reftype = (ReferenceType) getObjectFromPath(obj.getPath()); if (reftype instanceof ClassType cls) { List methods = cls.methodsByName(methodName); @@ -1578,7 +1578,7 @@ public class JdiMethods implements RmiMethods { description = "Thread Name", display = "ThreadName", name = "thread_name") String threadName) { - VirtualMachine vm = manager.getJdi().getCurrentVM(); + VirtualMachine vm = connector.getJdi().getCurrentVM(); String path = obj.getPath(); Method method = (Method) getObjectFromPath(path); ReferenceType declaringType = method.declaringType(); @@ -1605,7 +1605,7 @@ public class JdiMethods implements RmiMethods { description = "Thread Name", display = "ThreadName", name = "thread_name") String threadName) { - VirtualMachine vm = manager.getJdi().getCurrentVM(); + VirtualMachine vm = connector.getJdi().getCurrentVM(); String path = obj.getPath(); Method method = (Method) getObjectFromPath(path); if (!method.isStatic()) { @@ -1632,13 +1632,13 @@ public class JdiMethods implements RmiMethods { threads.add(thread); } else { - threads.add(manager.getJdi().getCurrentThread()); + threads.add(connector.getJdi().getCurrentThread()); } return threads; } private Object getObjectFromPath(String path) { - return manager.objForPath(path); + return connector.objForPath(path); } } diff --git a/Ghidra/Debug/Debugger-jpda/src/test/java/ghidra/dbg/jdi/model/JdiModelTest.java b/Ghidra/Debug/Debugger-jpda/src/test/java/ghidra/dbg/jdi/model/JdiModelTest.java deleted file mode 100644 index 3b9e6ffe91..0000000000 --- a/Ghidra/Debug/Debugger-jpda/src/test/java/ghidra/dbg/jdi/model/JdiModelTest.java +++ /dev/null @@ -1,72 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.jdi.model; - -import java.util.HashMap; -import java.util.Map; - -import org.junit.*; - -import generic.Unique; -import ghidra.dbg.DebuggerObjectModel; -import ghidra.dbg.jdi.JdiExperimentsTest; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetMethod.ParameterDescription; -import ghidra.dbg.testutil.DebuggerModelTestUtils; -import ghidra.dbg.util.PathUtils; -import ghidra.util.Msg; - -@Ignore("deprecated") -public class JdiModelTest implements DebuggerModelTestUtils { - DebuggerObjectModel model; - - @Before - public void setUp() { - model = new JdiModelImpl(); - } - - @After - public void tearDown() { - model.close(); - } - - @Test - public void testConnectorParameterReflection() throws Throwable { - for (TargetObject conn : waitOn(model.fetchObjectElements("Connectors")).values()) { - TargetLauncher launcher = conn.as(TargetLauncher.class); - Msg.info(this, "Launcher: " + launcher); - for (ParameterDescription desc : launcher.getParameters().values()) { - Msg.info(this, " " + desc); - } - } - } - - @Test - @Ignore("TODO") // Not important - public void testCommandLineLauncher() throws Throwable { - TargetLauncher launcher = (TargetLauncher) waitOn( - model.fetchModelObject(PathUtils.parse("Connectors[com.sun.jdi.CommandLineLaunch]"))); - Map parameters = new HashMap<>(); - parameters.put("main", JdiExperimentsTest.HelloWorld.class.getName()); - parameters.put("quote", "\""); - parameters.put("vmexec", "java"); - waitOn(launcher.launch(parameters)); - - TargetObject vm = - Unique.assertOne(waitOn(model.fetchObjectElements("VMs")).values()); - waitOn(vm.as(TargetKillable.class).kill()); - } -} diff --git a/Ghidra/Debug/Debugger-rmi-trace/src/main/help/help/topics/TraceRmiLauncherServicePlugin/images/GdbLauncher.png b/Ghidra/Debug/Debugger-rmi-trace/src/main/help/help/topics/TraceRmiLauncherServicePlugin/images/GdbLauncher.png index e463e809aa4d745ea97a31da0999b2012db82bbd..3e05daf55b05152ec77d991b0f8080fca4f13f14 100644 GIT binary patch literal 16405 zcmb_@2RK~ayYGmE5JN-@LL!0?B^aHE9)##6S`fWO?=51~Ai5E~cR}{`Y_GIrltgp64r!z4zK{z3Y8{-lI%{56zuLD*%X0d{d3>Lj0blaBRWu-ZVNw{^4qCl{YofhJKPCr zYsc_Z{3Im{%WD-}mp|CqF5q z0RQiwUk`r_K9$!Y-NowNh#6gK8EeUbUYDtZrhj!K0`RYDz2zUW z>h63Rd{a9+ey)z!A}TZ+HPrczlBv8zvxW)4P;~renH^p(Rd#)Gb~P@?Mz zBg~r?3}~nwVWih#SHHWpoo%c3(7xHF^tfspPd}SS?8|(Sb*EOv&b57H?EEt8c)t%_ z09w$`0J}i)0!`(|g%lDIL{U?kmv~>$&61A?E_7RQCin-Gm~&bLGe1 z$v16WOx32eNR8DVwgue}!X`IAD-rz?XZ16U#lH0dRjjByLC~9KUn?W?*J$PD^*WDe zJ1uJ_d}OSbGLpfI9TObB@Zt?buMIC=VVndU%Vh4+UWqSl3mfmF`IhxAiuy3#; zl{jKL%B9b%JavyL4$}+mBWB+;OV7c*ZlW1!;c{0%#;E(kgHgOK-k*kXf zUrm<`l`=5dj*}C=9TDD0Bf-Cz`Jv8#?&GD$&oP0&eJ+jnjAQS-XAv%j7X0*rI#`EC z2(ojC6|P_sMV-&bAfmNl)ud%n7QN$ycsE1DIlH&E{PlM^vtvCpx5Peg$Ewaq2# z=JxdKTg8HSiX*7(!e3s-Fmt?V2(K_dhxa|&4*RIq4)?t8mMkqKkoC^ee)lzt;lM%f zTyQna6I1a$S}@BzS`5+1?dCga1+824!OuqTd}Z3Hir!DKh-K;MNmJ&MmdD4xg+Frp z#*G^y%5Q|OHjaiTR8~et#s&ndfPg?R2+Chy+OVIYK_I5lp`oF2q>&Jahg7n5qYea8 z$oEDF0{M-}zG|3n3mp zosz!08$(-tn2BrO*WyqiFOwd!=PE^+5UdAk^JP&+G;J+FAcPQhSdbIm$_px4JHvx+ z6iE6TH&RBe+Ru?g`5NO>Q*M2!;>rb@dY1dIkvDTJMvKxcrfa2Q+0BM>M+>zZL&L%x zcedwRTZ70XT`w*U>n=OAE_U{ZwPMSYL$S%YWp+MMie+jlDD3U^zbZ2w4W%34bvb&< zU}a~gALBBu;+>*yJS$qDUNJi})0-&Z#jM-%n5P|yT$!x0Z-hgq9p<36i}2huK4J?hX=&C zvZ|^$4ITSlrdC~TSXlqYWL1GimFR-ga$3|&Rap-^cw}fn!2Q+WL`*g>FR!d;x-D3d z?SxsYNMAqFG?b(?$tXrB7M6k?o5>J;w)@sMbje71*%npT(IUMPUpkALeI+9;hzDKc z8T-$PYR9m?7uvbv``orGkMRaDef|8jrR2!jj7ZuLu(D+81ROeCrAHjJ%J{zi{>f=V zKGt0D=%DI9Gqz_||8;-!m;~1-PwttNPpXlh!wQSwiAbROA3BAvQ^7}IL z!R}|ezn|I3{!&~#=~SRHA&o~bQk0;yt@}FZ!s22v^<)iQR9{ob%IN55ZdTKl|Fw#W ziv5*AlYva!7(}|&M^X-Ru&S3A=UL*mW0+KhFZF0vusgoWR?g_PJ32ZdVRkYroH@Ik zlR8lcHz1iTou-XMnhu_XdFmCR`9HzcH;K47C*iM40TZI(k>JhdG}*rukY zN?_dFCv_LAbuCLt$ap^I$DD@WAH=7x2~Q@`;s$j(6>;V)t|lSnU-2o95kV4>Pm7^O z4}}6ouvV9PQ;;u1v9*NHK&&9sR-Q$CLP157;bUQui>ZHFos0+xx&3-&VL|i~?(JrUs>0%e zg4ZM;wCd^W>+9(;kK*!Qp0U1?x9h94HOX#mZZ=|!5aHZi=qm1a54eMmpZYSESr;CM zF`e8Q!$eq0gdCmr5FS)+E*u(FBafXa|(hi3S;S-@kvQY|?s8overN&Fmz>@Pi zZ2joZcoh(U0vUw-uOu;_QPan#dGfo-XW|1zlBoj4@}7ALZz4#<^;(ixR;SqOU zY4|wY?sZ{#^y?d2d4}fF;DVQ<{vo%*J7(uW1wP zKclyWImjAQa*1I)>88zrUh*-vQW^fGa%QdHs%wbrbx5<7?$%1@Ff5d4J2*HD=WDDE z7i_MqIGr6?QkWfXO!7JHC8lXq+KiSM$uA?ExNVkhlah9jb>e(w4V(c4p(+N;A3Qu__z*`1pF3mZ$43 zt2S#pW{bS!-jNk7f>ZpJB#s3Z_HZjWwr^Lxyn3&1C-&`K(yx>ppA_2SWygHlF+ z4k*~U`NF%2cN>z@($jZD_71uiSzyZx;MEP^JQ*NJDD5}g63atkONc85di{zHDzxtF zbTiQ;nMpM;XlTN17wKXusp06guOH`@Igp0il5Ze17{!}iL<*HS3 zIJ%5!k;v6K%;lL>@)wn5gy_#+6 zxR;2{12hEI#Z5=JX@qnfcP})+>Jv%QlhGuM*pQl@j?%}bB7UZf)I5)=^zWg^)BlRM zrkOr0B%WnNy5&sftrv}y^SAr=iq?7QbZf%pC=bwWLBdXPvGHsf$B z4aCPjGFK<3%6EDn?{S5qeQ@o5k+Yi*J9RGtD};-S+w<&{UMj+QZwZ%-OapNeO(_<1 zwqak#W5024&?q;{ZEs1o^u=WCg3Qhv1qJ+?uS0oiQLY{hb9+PUD=V+HE;ZB~9LmA_ zR)akB{>H7g4jYL)&6?LL*`sf-qoZ>e^)(q@dV719ILGnWr)yYQT7n&^kk0%e|E&+T z>HGW-?O`4AQ0E<@Erf#$My-H)}WY5DUE=8+LLpNfw5Tc>IJ*N3 z?YTGYVrK_a-M#zw-Ix2){P1YxYRg9uo=_8d3JMCFVNv_XVboHy313m)K;*lLE2#j` zcLhaB(|Mik!2TN>+P|&(g(9R%W&AeT=BKD0W^%ZsV-X_i>TIC0vUHZC>aS%ZC_mF- zb*1@7Kpa>UzQc7gR~#RbD(bY5J=IknyeI$CKmr>=SZ~T6evX!*F{(wOn0y=?j^MXy zXS_SFN4e(3LQX<5R_l5S;L)pCb_RZat(X>T2a#O^ra_+c3RL7==z8!8(Q~#c9RgHc z!&x_ydTADx22aBv_b+eN5CT-l#&GR__lTnV75MCQCUV|(bGhW%k1wM*#bR=gi=z-c z=~Kx&lYgYPl~&~iakJTS*(Fm55; z4BGS83PR|5&!i+qgViyK0&~R)YDsCNKmVvo68<;$MM#0cp12`HJ_f#fP_#Wf5vecZ z7e|QT61)xRkQX5Jr#QBFHx_YDAV-C$6Ia#Rp^Rz})sxCL+<@QFE7DiDZXIYx&dD+9 zMOd9*%k*S^OOTXRk-+knlJcIf=^0yD8nHqHH*Sg^GZi}I)*E(GlIY=ZY9op>>a;a6 zM(8HK{v%p%mtY6}K1| z2TA`4d4tlaFEncL&X}4N<{l<@0LHZmN4hPB(gEnd*3Znu#B|Xc`^OluF5hK=TH=nP zFcjgZYv{lqfgu5g_^6{r%lc|xe3fKT( z>6_DaO!`sYcOHKX^&b3Kd5gW|cKXP7yPt+UVwiOBbf{6E{pJ)Ov*Im@l(*WpS0iS) zZkpL-7lf~XB}E$Q(!|SUET2VrZQ%<=yt+9)>J|C4w6j}~l5F765NSIpJNtBP^%{F_ z``yBsmBAc?&ggHkksmB7{X_OGjwx>piAWVvC@ST>9;|UbJlS8h{|juwcruj>;&XCV zK^|3oEhzZDpuhs8IubxRegouU2TjeXa9a7tQy>j||1L9S1|aJ5=g$Ez0Wt))cEg9y zpYIWtJ;WLTn9ShxU_H0OaaW(D1`SG5UQt0sLsMMhe7MmS$1@C&>C{v_-B}7AQmfAG zoVABnDCInZ|9p9Crt$J@k)OwQML0z&CxOcvp2p{LwB?2KERiD3Gmh7B2NZmj>eRJ# zN14%yI`_JOfLqRNln)=O$P7{B?T;EH0H8UTtr#HUaCx{noxo*n!CKQ(cQO19~>0a-PKj&a=cSw)K4w_ zxoy_X&CLr9D$zeTKi^yh#l}9^+IqnA*1#b6KEGS{XD)hkkv7w#AKy@&B+DIlsZD~& z`4Cg2FED{3;+(j5WDX>kSUuYnGr}t&S z0|ixuq^7{Z**Ss7K0h(hV@h(NC!uGyAzd}(TP%3-Ab=%IHDas`i$0+YNkhMA17w>MwwBpmx0p^{(^Fh|r_$jb z8JTL_!cCWpyMPx}txr@~ySVV?^b_=@OMw#d@GU#s#rC;fjVThITD03Q6f9Z_2aC`3O1m`uC`X z`v(abUVqnE0X$z7#Kqu!KBuM?D!o%8Y|lfB#3xG36X923VA=*JxHjI2qx$E3x_uIlkM*8 zuy7~gAxwsHlLo~_fATm56SEoP-vE3lJa%KeY_l&-(qgjGc4LA|;>T)VPFP6D^M1x6 z?bV??sEvx89r}k0R8&;31*}wY@=P42C4RO(gy~VD=8};XX#;2`b+|H=xBByEiB2;n zc}CUT6|f?+`2$#C&}*uwyfC`LV5Cooh@#rsUVuISmi^u{m-3=46_v3^#5MavY6ni4 z4VzHCW5Hbz?Iy$dAUsUK9*TFrI0jWjHbnElDsc!*=nj$kjTxQyWd(*!8#z<>e{PVi{4K|nwrVGQ)RRg+Nk*iTJS zX7Jn#@i850wxLWaC@2Uv2he=DjQUb1Ce$sz3_dJQx{U$}e_`sYwUhYgStzm>J(Cg>?=sFRDsTmY1b-bea{a$mfjF;23h7r& zWPESd!wF|)9NpYdAu{3v>2hM%-w53Tvh|z)`452k>vcp9X2~x$;_%}WDe$i$pA|M= z123d<=WEsgE=uueA^5nS9z0RbPj$~?WX#tGUk;f5dVHsT;}tzz>h+@Ib3O?4_n)=g z>CQ-STUlCC$x&i3Uic+^q^TC`Kk5RN!JJCq74j%sF{jdgQxhb3^U2DqL`YBHIXYUQ zS>u$SpMN&f@pIb4!vg?icC#^?h7TAZbGz(sZEfXiRQ0Wd_mJPy&G1NDpQ?%FBhCkz z6qFbpf!%9=O#&Da5DxOR>f-6%=1>U1x60!#C}NC^jB=M37h4me*XHN-{GnN8O-;gg z)PYF=L~K_V7hnmf^iNL4rQJYBcXn`iL_=fnR~mQO|E-P4)YjG20UGw5zwz5Q?T$!> z;Q}q1njlgR>54Y>zb9;WBxLVOOb?Ut-|rDl=l1hsDC*}Y3^M2o4|%nuqpK_RJNp8q zL@taUGXMdL)!hf$XKQO~u@lfCzzeBpL^7EM@eLgVj)F{d^n{`mKKi4$&x~8tnJGsC z<)BDJLHSv=|Hivz{g}b_*a?aE@qsPg)JD=@EUUn#x{|GY?>}>iP7mpd<;ZZ}0yF)D zDCQPGPm;;(5!?^opph1}KbZWu<7<`u*g=e)!(|Ira_?79=Mp zCeF^!t*xw<2*+DnGpgCKFfg|F_5uR}DAUL}-+4IQzVm^)9TDmX%J>Y7?~!X5lO(W7 z(t>VAe}fY&fKv8TnEAEP-}C*d9uA-m667)|DG-Cve9ooip}CEKRUz9-7_0m{%saaKbCng6zy%{)e7YDfVaQMW|sH`oln_0`zl-=Bq* z70g=qMv9)ywKUrM&l@;XS7fe6=W}&|*K0OnV&eApc7T(JI}jo9H@_z}f+P~oo(hvNpQ=6vaO`njNkJ=c{^(zq00p)k zpvX|w5O$dL!b|^O0_&N;{s6`P^uJ=;-$JUjt?m4)ckIjz6cpcvhokJOfY1O$3SRdM zUM;}Rt3jD6;hx{cp?>R=C43+_Rb_9{5=acgCgZVFFEb~Lnmj)}H0VM!lRJQ%=9C7d z{TQlNV#w@#V49Nf81+qBrXppPFRb_KeWP3905qP_wrgr?s-pv!>|k$?*ZE)#NWmwE zn*}8l0eA{YC4IHzc>f}shTUin4tE#Du|3+T+AQL<<$T+ATcW$Y9pe{JO$rWvB`0^s z1lVa&Pu61$;{E=_sx0kJvrT^glEO#>Ih0KPlI~LMU4s%ohg=|wkPGr zBM`_uF?m7bA}643^}%_iHPc~A=!x(oC1{=R+TPuKlYBz%qnmHj_C@<85Q3FW7*BleRQBf8p*zar{ijD}9Wx7DDWYo0zL09$6q~1;Z*Q z|I!d+;^NF~Y)7@}K8=2_pV$IfI#=5IIe7+Vu>7+Hcw&08(#N%jeZtnZ6c68!lQRAV zyF+ZudZqPJl<)I?M73LrPWMaBO@W zK(+||suEi*Ev=NC-wWrmS#x-_2p585%?tq+kxG5(B4Z>(exKLj=|?%>J`Ow>$o`}u zj4=Fj+W0>6I z{-sePc#bR!1A@ys-On9?<1v`@ALfOQ%Wmzik#yh~Z+dlzpPyeU7c(ZXZcYxCnvPll z=M>nfvpTV@9?;=jRiUzD8Y<~j15JeEGAViY^6pPR>R|BP3;YN`G#IR-X3Tt+n3e5uL08lUG z)(ENW4?aGC=0&go`*yI$ns(^2g2iv}SMI$^);9nd(eM5&{s~A5vflir!QAR!jTM0n zm(}>MsBeJZeW=*a2m=EH*rPy4GMOmfZu>;plfd5ttg>|=P=gWgEKWsqz)uf1?JX^} zPw{YZWp|D+MzJEpA|u)D)>IJoKnH%?8O>}nKrfAv;Ces|mCbwob--jB6T$|Oo0@G7 zSblwb7C)){weK$^rC&M&{DAYbvv}tXE(%6i7K=`kZ+Lh(kSg5W-8nco^hhY5J}m?? z1c*%JB5m0HoVrJV5(Cn+Qbrn#NY{4dDIZ_lV3v^TC3QM2#V{xEBrE9??1Uz*Er%5P~5~+e*0IOv8=Z7b+dkX&@@J66eG++U;RqwZB~W zDFK7sI^mh?QqU`6qCTvqi0_k6+#Ra*Lx7EG+en5e*O5fw?pYci~F?o5-IzNGCiqv#@XnzNbzN^-;gDky3O2+t;$QYisKH71~Cj)wBV(q*m862zzCN#dR%+9(*cb0vx9L9An>VM zzu)}u^+OtD;4W4VCh>2$T}B}g76*DuWSYCWx~8Z3X=rG;xJCg|&r}M(e&Yt%3QV-L z;>Q&;z#=?egu`5ScXxFyf6u|ASdh5cn3#e~H&$0oZ1#ck>Ifv9L7}P)M@|+}xl0i6 zAOfgJOU)+{H?A5AEa-TB=mE0t28aqMKOf0>B2A>X;tC@R@jVb9PE7DnuJ*Dg-Ip2r zY1iQtv0$C^y{^H*ub_SaUmF7lha;PS3P$j{@Qr6m3T4F`Fjw?14wFDvfJK@Q-Py&! zJ0EKEC=QUpmukO)T?ou1(4O(MlH1W58BS|MBPp*urg$|~?*My-DZzvp85xPej>N#DDR|%ZdYmU}*y#_Fwbszk=h}HxJB+AoV(#1p*Wx|GoAV zI;wjNQTd(ye#75C2}fPI5Rs166VnYN7r?Xj%PK1KB7>oRjb%h{$Y>GR4dW7ZLt=Tk_c z)|y{Ta3=@*1N7I-udSU8Dr;?*Ytv09d6raHSA&f4eEWxA%C8A!CnY2#EVY<+19sCM z(_nKm8Z#Yz3I(6|Cf&f>?UEAM z4t9HHV&V^w{|c&iB#gAsvflc@`vIsXxOWeW^gT_`FQskNv>fp5gU{8VA4pV0WSdjt zZi3rMR!WL4*em|~{H9+4Z~?*Z?0hBg#^aHbPXUJ*$i!8Zl{>AESwD@^zOgJa`z`t! z*|BOjTt|q0DX+BNudIFuTSsnWnBozL>I?BOSb|N*1SNsJvCaOzk_-CIn&wiI+|TCj z=Q7rxdh3o$ z^eYBXKzlA}>#vY2M1|Jp;^Ok~;X{cMY)r_l->XSZN=-$@ch!!u+yYj!ozfIn<8D?~ z7H=`|2whfMlkV*h4gbJQVMtR%nUO! z6myhd59qA`lmqJL7f!_`B}DV;K$cM0kUF3H`KlI;6hdLFLw9NNs*7#2_LT9wgWosz zr4Q9k$$j^;FQ8v=t+mG6>stNJZ}!^?x2QX3ud3t(kJSsvlrGcdEe0Uq?9|8yyCqdsbV@re?9JQ@r#h(`rjm^O{wRtKH1U-?Z0lSw-)B?3a%yb~ zbES2X?H?!+B^o_2(*ZHeD>sFG{NS#%GwA=jfB-(lz2sqdu2DAE#^dyy(cXoUDdAPXNN50HmdF%(7cN8oTUmr1@T7MHEg(;b#Z<;eYiHd3s3;Ts*E44kqm{y?4JS! z$i@J}61^WF&~R&}>j06d3;I=pf`YKIu>q3T7f4~p!o~)jgBTVdapbFfNd~J4`cd-4 zL`93r^%ol|VU9MowrK=aHp_R&$@8ZOg-ZP}bqC;8_M7@VL!bk1xj&=-OW{@5OU)>( zm(_Hnu(R`JE#qi{`ZVZ*8`g3^PhU|B=a_Qv!VW=K&U@Y5spyG)BQX6N{Lh?)MtV&? zWb`&fhTzwzfnIs-FFE9Y_`~dNNPW>CY5l)2>;9`E@#p0XUB|nN?ng5|acD``CGdu? zLll4qSQG*Un#bna8vR*qiJ4%!q@<)X=#25Z{#qC#oH`!^k_qHmJqpr;<$jun4+R5B zQq!};(%sM$+7kc12}>~aBO(V_H=s{br^L9BH3o3eT+o+UP!3dc92^{xSBlq+q{9;k zK}lN>>DQ2;e=C%Nq3F3F8u2YUIvP{}AY;hHU8He~NXX{^Pv3*)eR@@R^e9{bRQOE* z)Icj2z}%z#A0zs|=$y|jUAuN|49KM*sxa`VfByWrWy^oQCod)@c5wae6pa*}LHB1P z3yW#cjhMZ~l^#+cO8ZRp%83I|N#UwR7?^7j0ogbIdeStUQZ(>|xHv`Y@#$$*MFj>% z^NE;KAJhnRzuDOx9Bt1ncE&VXw}}B!wSf*GxgDTkq-3~XUVu!KuU|_dZ~CGZ@a$8- zHb!OG^B&nCi}UatdlCGzn)FubbYi#}fck*J&Y?Vkwsz_a4m3?&qsEqZZ{X<$@`I z%T(j&27Y27UDz7B+uj2RkN;9a;?6%V180mY1WWqfG1YF7I1JJ3UZzth+xJ7ik`~eSi6sPelYk23}m)WZF-R z5uld8YxXC&GD6h!e;XmTK}F*Bt$*UM{L##Y-_PRN9v+79Vu0(Kc-gO~dtJt$*W-P= za-Su=w9Fts{H`46|87wKw}`2-$W;^jkS}n-K@%nfB0~wp&i~!kb}-=oX~VqmRR?~T zoN?nF(3Ed>p(|uL3r5S1_TOr}&!k|de@uUJcGTskwHP#J1N9~%xlKYya?i5bKOo>w z+0*Uj<3yAs?WAwGt+yztzt#JylCd?xZMt$aJQ^^eL7bY+&40_Em*mr>N&oj>hwT+N zuvXwS4I}^hHm5v#s&8|$iY6Z-ApzXScTL+3zU`krMi0sgnYK|2%;sE|kQiz6ol{hQ zdB~|l=YVzfth>x!hC$JTD5OL0=ygHo<9$Dh8_K&D1d~PSq%XTn#;Yln8o%FT&Ov3* zol%H`GA-aUT+-R8e?L555I%_iV*8`oY;HREg7YE!LFZR3cjvZ#bNorN^}2u$nJQl^ zQyk5d-I|P_A}IB3>)~vlvkPZZ#HhZhNjuaOn{8j-JDr^-mTfJvzgLIvxHOUOYP4w) zL|O-Psvn;=9Sd_gohm5Xc;-O6bh?<~X1k7NsuI@wYb^BhyPILkE(Br`4bI+no8x`~ zd12t*KC!{CPL5jd&lb4Y^PUErFOLUnoKak?1ZU)5@NAFOxz`?SHhqq}w72{QZ=BjK zt*L%A#&kCF_)??dMp?6FHZx+_PERzqC51~z3Efl$`R#+G{IfB!2%li2T&TJc|j-EJ6YmPcC zHRO+UsJS7Nvu0=dhg}KRtKD{kMr7GUcgOO#d=-W0tVNBIe?2iX<>=u2RaqR#*LRDo z1#ZlHaqGJL&OWAX{?R9oGCM0w>`2{8j*rTzrmK1`z$A^MF^$aJcZ+^6Qns1#xdZ1c zAw?6s)#YHj1`T80CBugPpGVO)>!c!HE|k?8mtN`cI>{$y`Q7ZKT>AXk@acQ z&HhBN*2?I$-8XliHB!>@(^XVeo>%Ixw|eBaRd1j!npMfVD95xEI==+T8GvHo9W&}H zyhmao7QSlC;IaZdZJ_D0-3(f`IE)7}K^qxRpmABVJ&;&I)K}3mk`G1YAm@v>+K)Xq zxI7z+k{~EzF`crr^lptlf5{@DS88ZSimg%TYWikxV=fB&(L$#tnf3Aslc3;Qj0sp< zk%YF3)~UVYOWp{C#?tmd8HaoCQI(#X`tk9xr>7_IVri?Yn+vZoIR$mXwy(-v$sSqWXKOnHoB} z4*>bZ((E^i$KU;|;<3MntkiVa9GaZ=H=n%BThk)ZSFc@WK8(#nFOp7OY&DpC(azXe zeGqWE_M)qfLjfCmT@Dmt)pKBD-*?#(0BtR?Y$oiEJ3rORE_Pk_F3wLi)YTt@?hJF# z0*My7&)R)i--q=6y#n>1l%34@-1nE|L+gIr6(+FT*?aHa5Jpb)tuEYRZqqS%f(u^H zz8GuMH|rD!>yl}EbUa4a3K~UqF)Qlx;~w`QKR+N8NNa1)eCD#Aa@mz4Bnov5qXU}2 zGvHdpB?4nKP3;k3hDjr6vSwwy>eyg4=!ShZ#ndmOSl*nWT(A4u{iK@JbOw9aNDCT$ zYIa#xyUejjddT%DRdCn{x48^Dx&_WX0N`5Vw6AmJ-db2}0zgTCkN-0IsrJR$G5r)c z+mo4@3E*SjqL$=>a}Zs4=$ZYgb))rcpr)81oB z%ErmbUnh;El{ra8MXwka@3Uv|=^_lTOO^(*`a$Oklx94_ApH6t8waZs+Tko}6wjr| z%!#Y#h&$@IwvHY z4DLl-DlyLAL}xLdChLAbQ&__fb`nrAuLvafdU6#>p04ZSqf0=?ZBI`Ky}VIAr$1 zbR^~l`JTqnWX3f0#M%7RC6$(|?lO)}=rtY!{E1=%oEjWpa+d+Y4OozR0`I5tfvrvg zGyD#I33B%?XTi-b&;fLGdJ2ec?;trLAvOJ=DM`y3`x+bHtkuQ(NZ=V+YcWo`W>57& z2f9|=y{&_?%MnZC%k}`;#T~rj{L91EQ{E}R6^_MN&)pO_(~0@;%*!uCd<~x96jp&j zPdwF$g`g1@*jEyB2WPuIfPVx~eb2K2uEo+uPjfRBH8mW}K~ho@IKjX$tYY~)F124M z>b3+XX_yUUeyXbCxxD_|PPAPbt&3HRos)o+5cN0eiBzw1T=dRTb7Xydw$u{m=RZFr zr8u&M{K$hInjc@I5bjX>V_bI>UC!!~z@3Woq1#lYkh?}@#`M~Y;Ica6I-8!*F3W_C zXY2djrKdPHz$o0N((>A@{^xV9;u-c}zCi7Xjd? zh?vnVV#otjx^~>0(W|Qf2KJ@#HGWUys{|R{eafr@8lm-V2X2$jF7KdW#xq)Qqs2!A z;r2KE0mpB6i`aC%8tAz#>+mQ1&M7a?%zVts8aCC3gK`7*07ehvoORG{dUW?Lb508U uswbEZgWI@&w2IA>ty^AmhAw|9=1_RiBOk literal 14838 zcmch81yoht+U^!C&BtwrkC`)|~Tw-sgRuclpUmi$alcks%NWR9s9*9s;>j2!0eEB7kr1 zs9~@`ARP7LLIR5KwYK7sR24-l+T_~U*6rAkd2I>D#D5YYg$gNRsl4s~+9JLXcotae zHy{@nsKerilA6V+FS{Qn&Vq|>3;kyMQ*@fp%Vhj5gl(Gt$w!kG(seGWAYr-6oZ62W z>1)?JxqXG}!`aIT4ac6jHM?5T=3@oU4KE=`NJt$qLu*5snl(IAc;GiABs1SnpFSB# z$O@8zKMG#B#6(0yF;9n|+#DK_1QQbzQzAM%*wg5@UOk#839jSzAFR+NncKn^6G_da z7l4L_gy8cA?c=;Zi5v?KzNn9A7gG}PGz0@Fr5v~we%QKZmoV-BEvGpBHbdRcps3pA9{UB>DxMXV zO|f>u9sB7y!ECZhEtwkW)EThSl}qP|9B8bQh-ZmMTf1C%P&^5T-6ZdY)7!n*{-oCa z*54K9Af4T7%%4;&@m>v%E8pB3vdr_D%PZqW>A~`t9|3hPD5@vX59yuj*0(rz9Cju= zb;qewaSNuZa-%(e^+*4-n6Z05#U^?NEpbyP;gI3Hc;`1`Ym-RS{hU;6em5miA<#1Y zE~`+^Zx**D_6*xT=i|(U56OkL9e7u@Y*(6xulW>4LR5mx*e&61qp0~$ve}KVo-RHS zla6gk3|kbr@+jGPVdR;5{9RQJstp5E?ZslWKq%hYaOT2C<8lt24>QilnId7uXVxXp zH4Nw!?&4!a`M6YOdj31~?Ow)dOxnw`o&Nq5x_!ktfjVR^!!(J|lga*4(K#zsJmLwK z`YDDGNi7+M#?OebVs68%_T1O!^C}o=5+Nti-b3F04fwRD_474B+SZi|uFc;)J+0qY z&FOTpIg_r4FKCai4kky79!FL;cYr;Xenc z`*Nd|Rw$o_wHllyItO2ks;gtFQ+=KRTlGjhJfjbf)v89N?@pQ6g-s8+d~?V#A4?4p zQ6z`6>uJvpm;FXjsE_t@VLztiOPG48037UpgW%z2W7+lxgjT-Owa%gkZJtw1RuUm? zcIoU=p&^?gw?QD50oLpF>(@-+fu25n8g{eWLPA2`{4;*YSudVKAaP%PPzkYe=LI1U z8wm_ERS@;P4~CyWAaD4gcOc*I{{Q;OUWZ$QL8Q?YbZXTz7ImjsFxCkLQUoi>(oL^< zOJl+WU+yrWqJaA#LdNf8B^w3`KBHR}+U$qNBSP|i9GO+U-_^^>*Q&3{&E5FQs9&I2 z`*ZWBa?0mrHjDB8RMB7<6z`SUu*t9QAH~JRr#Z;Ujaq!shF2IoPrK%>jw-d?c0Wf# zg(oX4C40eqWVm^FT%pTw50sfIbjt4bCkrZ$G`PFMJ63)&;TMl~3KVM9uP-htWJ<@+ zH~R#{$8k9oxE^miY>Zwu6JF_T#sw-aFE2aHH+^1cfIu)|TO&5x)78br#cWp7s^w;w z)ly$yew?7v&R1t07^1u*!*hrsj)}Bd=e(b_y0z6~cDysEUF&G+!{i25g)O! z9IaiEk$hJQW+qGR5fnKIym-uj;xvxVSXz^&c3Pm2y`OVb%WgLT>Y)v9rw92Gi}y=IWdk zYTB!rp4yj7mdhumd`4EPvH!pqTO1r3>Wk-UYx#1rUAt2iJ1)Kt z@1Y{Z#?H(eQDbK|>b9Xe!z5#2QM8X`F%1jAY)p9*`zrr-`s5s0BXpEValm9;FEe@Ws@>E(Y_Q5WMkRha@|vK|+qc=iZyJEKgjsIl~P z%i6QczmI$WF=hwlnQwgm(-O5(qm)+mPXkRI?d`vhjxyYBb##&femA?QtK&kY@aE^P zua1BAiU#2dEA{c7)2=z#YC}FCr_!1|?ED!?qap?uQ(Z=e@RLEzOi+z_QFZY)Qv+lBpmvRsV;;9mlK6bOQ8p+)Z9Y%?Tvm8l`FI(v=0VF}vw&l_72z%Qh0JJ;g>C z9c|ypIXj0&U8qeWB=8hpH~IT-JLCbwmNrk6-| znQf7!wNcR&ec4qxm#e zYC=;LmiqeoY95E{Bea6?H^I!0`PML^dbh<7{o}`vn?Z_#u*cOl^Il6YFdf4CdV1oS zjla~^*5>A#zkgrlZ2TnvQb`%Rw7lFC%T}nAs|>IfpVds!$jHc+LHJoMlbs2n`+-~l z7Tvf;R!M1TTM(Y8mE~kva?C!w6D=s!S5_sQLMG!Oi}`3ElcIqmc8`E<;LQ3rN@KDg zTmwC#r@Apn*j>IMwi6|W01wmG9M%R6cV_F+(9pJ~D!~P@dX7$Z7rUj#GT$N82v%6W zNlV#NFJ({JjzjC{=t%y`W;uD_N0FezuxNOM$7b~gfbXW%Hx{)rlTh|iA3_f?ksRU& z?`XDj_jDy$@wwmIynDywZt>&C4-mXzv9YmJAbU{a+bh=}3`(}r1w7;P;Ewl=;BY^) zpQ&*u)T|Y8J`iH&I zoPwBHfq4J%lQv>kGc#%>IisV^iB@+dUW;s){dZa!3gj8bs(8cIgldD1r!yJ?udHXe z^;#Zw(yA7Hu;MD~PQD0WXb@ANraTppz(Gsj1^8E{r{}yF=PbhEtR6!h%`IV!w#eT} zPQc|D7#wWu%vrBqVbQTi-07_+<`Web)|9(?)H}vhwhE756=7jUc4&>>!hl}oD9s4? zDGK4+@5_0p5*zj2wMyHFS~hj5neg{@r>02S_$0%>BAfG7OnAB6$W~~EgXHxA2JZ+;*$|L^UxiR?}ZAo`bAN=Sa73cDQkX zCJ!HLygH1c)2MOU(ULt#4y)%MiQP+G_z95kV0$LE;u*a#07SueA^x0PmZ5>>uJNTf zsRd#b#IZ!FE{E$Wc!Fl;@czC1{c60PIBTM{C+{h0(5k)B7#~I?6L(2UMeuw*E@r1e z+s=y(-fLz;F9`dBoLZ2zp}=uRlj3KfBCXQD>}51}O8sIwLm|&)g7iHdK30Q%Oi8_! z^>u1ooU*QygCUtjXLyWP3R{EqWSQTQKwjtg&Ap1$c;~B?!UxkOLDZ)N!A@cZdP0`h zjrJ(xwaex@kRKjz0sf|>8x$&PZO zbDX3>Jw8@^7LzA4C94eri6ODE8pRtVCczil*N56=O_>+kS9{o#A7}wVQNnRm@KBr< zGluw4%>+C}M@K|Nte)xWqG4xeXJ%%mqM~~7f`1H;0S1GGi6~GEvI(>nz=*wHo!i>l z)@7N4d<);$kW8?b-kEDm%pk2{Oe?VWA%`-$9$8!wgfuobwxXrW31!h-@et(ud3kw# z)pU|2eiex5GN8V(Dg;A)zQ&sPV?$UX}@G~84JOCmar z?N(qY1k@GjBa~aK3JMD8H0JFgL>Nzwct}`RG^x%#>&9iEfajeIE65DUSA*>&Cnwih z5X|m&@|(e9Hvpt^g#a0##826DQ3$+C~{;ZD>{0qAzVJRF;tyQhMa1cN|y5X>GzAmsn@F-{IjGeyX$RB;OV6&E24)s!Gs zQF-i$C*}jC&}lB9<`~Rwk{v}3g1qOBkb@d3wC=0k$1I+|YcZ}w)`pv2`tt#VOXnut zdk>{ADToP2^rb2CE`@2nTrec*5h(NV@u@T&%CKGhiBA5ey`uwdrV6!>lF-#O?&~{* z1=}^az8gYT2~89ux**Mp>3wV|gEU0BpN;&?QG=Ak&ofZW-5^DXuM`AlnAtTYct0x& zoxYKn5u{HSa1ie7XX(Wdz}fZmvlB92)@O)BXZ}L@Ji0i_&|U^Y=ZNWVq-S!;?XXHr zLf}h()ma=Nf)-6|U@o4wd*?d}coyNWa>sFG(P1(~m~y<~^2Z^PYhDAGRLz;To8yeU zP_zNH({ah=mOv8!Hp4taoEdcfNMUBiGLHmK`_NDnA#BfORf$yJ0Oa&wgS+3aZYC%E z3MY=9Eb%pUiW|A1WzRoulQNTtn3HC!(+?-Ub&+YbKb#y8X#b+- zgr-d%S6G#zq?~m01fui6A_HbL%GxSTon|b*{`?)4`&O1~FPY&9;-LvI))-8JOYqy* z(+AP(@Ki8+1vE7JCV%eAWvDeV8DG-W;H!P_Ad*fHD#Y=-ky)1O{mj9bWH<8kZKCKw zJ3)uO>a@VdM!s{$?!LZY&qMM*w-@7SlWoP@N%3L5ri2LwU!mgk1#`!-u}}y`#IU7$ zT@fX;re6k;9TVF}Va*yv*JEt!(of#N7T>baDY>=qt`>K+$Bj})ZrobX`-U`>d z91bFdTOdFl@9e&s+<`sHwc0+ezeA9Q~|i1Kf$A`Q z77^q-RZ*5EAif_IbmVGpf+X{MilYE1?xjBpZ+YQP`V|p$0L?62Voyntm(~n>xL>+o zw3dc(=OmpAe2;~$Nh{k-{m8xS0Eh1`MD@E&BwL})4OKtT}gT;T zY+p73ZAC&wU73OZpJbQ3lFKwcnpDk=oJ7~bd{-wO6p3jj*Jopmy!Na8Hzg2A!m?%Ar$F$GnYuhbo^##dL8iLr zxH(>2X+39jGfZ&VTV% zazK&+7#pD?BdI%fleC9r|SKWMohDj5wsh~=-6 zI~}eoDPx=`@_F(SAh=I&K6!s_R8s=)w-3GZMH*ACd3abcilR7`_&Pq;-#*dU8Lj5M zdYQ?Oy)uzs8*Ss`sEVgy++3^+~YCUo$2cR7-nPett3dYM$V=tQK9}A>wxnQN{Qu-fIFnu zs%xKVxialtAo_jPV{h1#yheI{ci4}~Ut{#E&(;Ms z-&mfS-P$18q{u*x_mqRVU=2oi_;Nox7ALFQcJ<2Y?Dqh9x~^4aeooKq@oWW(N%sJy z$F?SeXzF&w-1$vu1!9XSDJj#_)2eb~$-@$xiEy{|VXCOi;K7Ay`!-_C+bcP1utpp0@Y%#Z{g2EX9swUR{N6;x_f#seYOWu+q~{Q zvYKmfzq)XK_seo^h{JZ_E?un{G?vZUDx=wljN-*1;nSysjh@#u!m=9scCJ}`SlL+t zk8SMZ#GoW3B&O9WrAAUfb|aIFvfV} z!C)nrYj3uUfcJer;pCDkF}(wzuhn1);54uepGvl#AMX^ttuC=!>2+8ic0QUg2HQzo za_KnLWI+}C>m;*OMZwJT zL}!JJH{z0#lH%gKySp)*4moePidKh1Jhu#uTdb$4z5KTc6)hvoR_$dhA3l0yK9C|j zlp)m?h!Y+eNv6U@%gGu+3;E!K%i4lopYsspk37+A*mBEF>e%`u57LK35=<%PWgYfC zq>lAZ$0>@2O^qe4x)l;NS6-F>Kp#TYO9Q}5O$qI6TiK2!KqvR1rfXqdhptOk2~{ z%&ZiiM+?ue@4zd}$LNoYs(_RQFy;%6<)gozy~)UI9ApH5ykD8plmTk3I7X*L8vunN z3e(%m>jW?S^5P;-PH>%$i0I>8dKMN?`_|mKbH~rmFYiWUp2nh6U-}o}p&by~T{yrC zX=!Ql>tDZg7#J9`Jz;;u50GXA_Ra<+8T^zg0NMV)!$=)DK&*?$O6u&g;71`Qh3r4; z_s01tx$?67fjaxPxa8}Gq=2BHauFz~kkoi-Xaf8%lvEYdM)13wZipyv!ZKhC8aD+$ zr>80Vk@^Zyqx?js5dK;~kmVZ=M>XilVtCy-b5rV0_NXW42aRHu#o2D=*ITr{h zkuf15VN+!W?5ikc=>Fbb6s_7|vA*c~M|i38zEOw3jVF)=@Tjf|07qtmi~pqK#wZ;% zbxzgCt-ph4oFCfN4Rk4SbVGB@dw;Fx?z3T=&Il?~Q&UiB^YZe7C5g<P=MteSHwbEdr1a?u=UA zVIYVfLTr$4c;^$yFO2^yY;4^<4}ApD;khNMjt_5OWA_*aiMSst8PtlB408ly@n;uR z536oI`2!6R$f?6iD=V3qnQbjCMeb!N?_RL&-Xjh4hM|xp!5kM}3_tlWs1xz6tgI|8 zEe%*W9R*}W58f>n`Yb-F*6VH10j`M637LV&Dx4G1oGEFFU8;4jKRhAFEOB{&xXJiJ)y_ z`IMW90M7+9%nP~>4-b#GC_qNp*w}Cd+-@jS=6HQXQc=)|f>O|`)t!eJD5J)G3Bbh% zJJ7mr_datNZ`k!3aaQxK%9-7Kb$K3c2SnvR#1#<%0VqUj15;DAidO%d<|>va8vMK` z7WFwdI|oP1g}1kNeO(>UdcG3ZpuPiC5{P$o>Oz29RIT?U@-@mN^0IvFie^w)Nx@~} z5{Pk{bFTzONX`?H>;X+7iHIJufKQggAC$`;Ci4{W9af0{$uvahL&PSfoyHV@q!C8$g$Jc z@twXiT5P9VI8Au2sdPks(EWExSS{}=UKXl6B?D=t7zJ%6>`lJ zrN;X^(96rqYW(gPW*`5Ha{)Q!s+pU@{F34+F79NhaUT$+cU=W>eLbzkx+;^BUKow7 zMJNtWq^AG}H$y7cq+Bxf!TtN{76sr*W*(eo@?H9QT8}q+dKS2Veha0PISr$N^j|q4om;EZg=sYmOfYu$*K2D^p$wijSO`J$C3*L%WWfWQoB6I9o@Y zg@a4p=?nCyPsQK{G!SV&IWv5?C;Y~*ttk5!;EjLIY<6-qWev=%OOOD{W)c|nVQ--y z6!ao+eVok%RaKvDnE{;OH0u7Emq%MYxdtj?8s)qsI*zT&wqQcfm0p5sTu5dMCF}bX z70mf0Ex_4CEa+LWxIX2!6a7i5sWAFrlj$nk>#Iwd1a2xd2L~uBs`1aw&CQN*itu#cc1FxIOr@gyp@AyvMSxj?{1W8rYXS-s z;8JFJUKJSA%mBLs2NOOeOC!%ssg0Q~a)&sHGL~T7iK?hz_WNZoZ)@8&4^XB5A zz~{sn3k33vUr>;tb545svn~an?Cfk>8G`k*%0a15Wf{T&ShR)vnWny_VPC$1x((F) z1#hdFNJs=(YF0nf^6@2NdDF^RVKZngDaq3?$3uQ4`R*BuAQSRxvC>kyq>g~haD1`f zH}plOOw!6|leo-vnITvO7Zl-9Y;(zxi+c+n5g)i5Z_gCz3PuwH0f`7OQ&Z*6=7DTo zH@6GG^S`l}4kiow@VFkmOqCQT3J3@Q+F5Emdm^e6`n6}kumm-NEUON26|kF_Xn?jk}X?&o^KhTqKf9tdKB(*#?k)6Ti;mCO~yO{*;6l9 zvyi?bRi*U=M0CW7eD6L5}Nr=2id zU>U~YfMX@tFt-J%tAWkg)YJs3<)CMbUVq(H&Zk{tbfnwx$4r57Id0yR;{pSFJwrpK zV9kNRrVc2Muo_x&dVii;Dd468>P2p+?~KyiSAl&UiwUZ6KGxgS(E~oqmIgrko0f)K zBo}A9@uIoZ)N2M6BYjd8ngP#}%cB$mTpYAlbU%Cky!U7=uL`7A> z2T(;j{_f=l7&sgA00M#kUxnL$$KU^wM!VX9;@7(2)Tmai{bOSV21Ey))+{=H*aiR* z&`(u(F(xNoq;r8q1=R|nSrRoM$<<_#Bz!=|xw4Z_hEpd7^Ir#k0iF978m2n8~q`nppUBpRLibJ zB~|#TdRkh5z5QFsT=9?Af*hq>@+0wpPJq6E3%|N)C2$L(I>kf#EMxrm;X~C@BdDQr zp%#xx|BK=rFHnp8R+Tl2_640;AR7T8InDMTem`Qd$pG>evSKa|`9Wh9?CRDW9ka z^4OH0Ozn=1LAX)C?dajL-W~P6j(PB1|HrM81WlNP{NwXK4T=Bfef?iK8h-{*!n*1B z5fzFm4U13*)F(*-hztM27NGy8IrE=SBg!R$K-lS8%}zkKWn8RhZgQOsxIqfUe|Iy% zTK)%*GshPf4qv{egO9EhzQDjj{(@iVg;0|Y^vO=>_hz5lZy1E$1k>xGh+@hKRy+*j zBm4cEC?N3WxXH!#f?sHVF0U2=E)O(A{PV2&%X3tN@bBeuQ>T>#rrz0g6_$9#)G#JJ zln28_{tC8c@2QwQcUOuTK6}jAO~SXsUmeC28!pw#dCoq=b3Hqg;hS5rV%y(Ac{D5T zMah!CNm;nHCz^+x8u+yt7(fe(pKy8K|F#)`>3djP$DH$t@?EN^FAW4*GDfozayMG- zOgN3T1-*STa-PpHwk2Joa5A)2%h!N^c38T|*XV(6rWz?H(mnqH7i+(=Fg(ibxoAvX z6L++e=8{=k8u9S&%R@%}tBXGCg~Dy$juU(B_0iPm2EWFmzVNZDNSjOTIn8U8*YKn3 zS{Cy|qH7!ttr$YgvZK}hU-4?yPD@(UjGgAS+-SLblq7H)erN!P&B9(4>XAIWl|h@7 zH4cMS{OJ9gs;UUhZy&y>C^!pQ*GjtbS|@YsZbF zdpaEN=EkCEP2;#4Hdn5gWWQe>4*I|`Wj%c+u$}cZwXUKIzgR-dxtEfx)0YEZRuKK3 z)3$rr@>2iARHEC~&>d@Qg58d(G#G71L9q8;T!cCW8ieCGn`c04@XR*Jg_J;RT5hbOWYRrKZU&iW?5g`=|O2}P^~%BO(! zn6EQCnMjBb*S+3LJi<(0nHv}4Y#%DrzMhgytmARpx0z(>>Y@JirbNtHq^uej1v)#= zakW1-J5{UG+(ERn$?m`?n#U6xdOoM?D*9>jOz*mStBt<*@(pr9ZnT{>M!WKh$l??h)= zF4u(n#(cDb06GVXftySTx{Lv1JUiZD;8KDtBYk;l*n*F;q9jPnc3p7%i6Ky4Y%P0? zkKp*nY!S5h9bQk2J!ry0BN6E*XaFK#vkz)tZ?BPKM-1r80A3|XmZRAUZ9tBsqVk*Y zJX@m}{H&a>UR_-c%8kytQr7XeP@lR|_o*LtY~NA-!4SLwQwks7>1jnie< z)5XJaCw6S%%zJ}{o;y4arF%Qj)?fV*W@80Cd!Q@X6Lb`Vd^iNkm16z2*@nxVxzyvW zsg?P80W08UOjOyX;;f`#t~BaerN4HzjONfYdcRdZHtTuqKB4|8hFQXyiLwvh&_2d!U4;2h&ZUBvT6G1uP~xgCCbluEgWzw@daOOr2?#EmQTaf3A&}>{ zg4kwtZXcN0V!Y@PHhn)*jm{5*Nn%DWO*}w3*4Ea>3bjG6SBbN+c~LcP*u{)z(v`-> zW*y=E-dQ-u{Qm4vw%_5z*tZB zR{%c&4XLc4G0w>PFAvhx>2y7}@SBse#~bC8+fByY-}D=}m?h;8nT;d%3}h2HFwyXD zBTYIVwrPwm(HA)JrFA&0X{Axiz)Nh77H&KnDGZe4 zi@#l{^WH$xkKyu-F`?Pfb~~5$iHdz+t>D*5!!p=+`}Y@~m;y z3scxXug{~y6VMw^?46j9h@+c8h^D>mdKqCX|MqPhXgk~z9WU2R6@eN>$2rRxgMQ1X z-MxMe4ey?je)GYM;oMW~(uT&b4(EeGQ^ti$^%XY9319b9`T$5@U-=Mvo}K2I2ie}ES$^V@DeMnRkd~2)Ta_W^)CQaPuP`P>+2czKN;7mg~(9zCmzglG6_k6#X zKHV?u)7~V#T}!u)k)`S+*g$Yap?^efHtyBdMp|4Qp|bV4)vv((G7@qDjLL5JIYsUI z$ICIpK|${{p1>eMD7-E z@@bfvn%X~3O>X5a=;)s?VExC$n-|ts05S=7{&wJC{Nqk$QS3PR_}8OJH?Wvy*51+6 zDCyOn9%8VY>u!9R;X!teMA=7L!w!5MEmc*q$}PTPS7XhMbe$F-momNjv9E8(6Q*VcMQXXReeb3xx4_NKaH$*yucPR*S! zuc{o@RKyt?YgZF%(CU5VT7&)R(y&nsw%>7N-Cu6ui-pf+ucaLE9R{0lFX( z*loR(`O{!!rA8w0cEBI(Xx~d0{u9_@Qc~&6#-JxRnn62b>m`&?=Q~6>oh#M;W{(Zr z%T&w^VZBAzTHL3(l@uW;AOd#>R4A<6wNE_7$F7Qg;Z2BtZ-w9hfl}&t9u%+@W+P_H zosr#Q{ace=UAe&Z`iDbWxgV$qbY?;zQOwNDteFM-`i7WAg2#RfO^mJDmFSHhFN?Ee z#CafZm8N}tRo@qU?6HyCXvI|xnpl?hIgnPYE{+qA&*}&!>?Wh#jYLqsmFlk~+gC>u zry)*&VsuD`@3Lq$TGn3|h&xnPVB2hhuIU&=%XH9hFH*|~?B3N?6Qf}c(E0`5C@E4b zUI3JXNwk}rR0+UvX7*^VO5fB}tS4g9-xFY=%jkVeX@1WKY4Fv(^gw5T74Vc8xq8X& zj01|IRe#!i)naZ;ze4f0{c_#p=haf4XN$IG8KcL~9PdVrqS}?=9$ssAj(0z{Pd65M zCmlL>w&;#MF4VTu-`(bPMq_>)Mju486PuYaab~`028~=~kh%e1dM@6v$wg8ElCcIvHM*U$jTMH*EV=e1+K(!E1FtrE(=6k56la?tY13fJg{5EylW7*6^xqk=i->&_6#YE2mid=0;e zrW?{Xt_&sQeqY3}?ItbVd-KM?6B(cm04;WWd>k}e%K8kPqi&zIU0I_(4+;*Jk&pmX z0VLr;;HQWQ5>j4Y)Rf%7ITj;@!0n`}wif5(zBB21gDZMDUFQrGvhbGBPr*?ifjE^; zjFX*HR1`A36!ql;z$fFDoL4u@N=XR1dtZ+1y|)QYe?2NX+E8-9*Je54;V0J7Y~jBh zoi`Zw3+#p7_{ID=)^2}q?Hi$H*=wN%KZMu1$-mlnsVUq0`ebBeGBwTwUhw}PbR6_} vEd!73e{XlZEf5ywZr_Xi^lvYHUGm`s31=EN^{aq4yCCAi(n1BVb-ex;4Uc~W diff --git a/Ghidra/Debug/Debugger-rmi-trace/src/main/java/ghidra/app/plugin/core/debug/gui/tracermi/connection/TraceRmiConnectionManagerProvider.java b/Ghidra/Debug/Debugger-rmi-trace/src/main/java/ghidra/app/plugin/core/debug/gui/tracermi/connection/TraceRmiConnectionManagerProvider.java index 9ab1fdedaa..f821e59bf8 100644 --- a/Ghidra/Debug/Debugger-rmi-trace/src/main/java/ghidra/app/plugin/core/debug/gui/tracermi/connection/TraceRmiConnectionManagerProvider.java +++ b/Ghidra/Debug/Debugger-rmi-trace/src/main/java/ghidra/app/plugin/core/debug/gui/tracermi/connection/TraceRmiConnectionManagerProvider.java @@ -52,6 +52,7 @@ import ghidra.util.exception.CancelledException; public class TraceRmiConnectionManagerProvider extends ComponentProviderAdapter { public static final String TITLE = "Connections"; + public static final Icon ICON = DebuggerResources.ICON_CONNECTION; public static final HelpLocation HELP = new HelpLocation(PluginUtils.getPluginNameFromClass(TraceRmiConnectionManagerPlugin.class), DebuggerResources.HELP_ANCHOR_PLUGIN); @@ -208,7 +209,7 @@ public class TraceRmiConnectionManagerProvider extends ComponentProviderAdapter this.autoServiceWiring = AutoService.wireServicesConsumed(plugin, this); setTitle(TITLE); - setIcon(DebuggerResources.ICON_PROVIDER_TARGETS); + setIcon(ICON); setHelpLocation(HELP); setWindowMenuGroup(DebuggerPluginPackage.NAME); diff --git a/Ghidra/Debug/Debugger-rmi-trace/src/screen/java/ghidra/app/plugin/core/debug/gui/tracermi/connection/TraceRmiConnectionManagerPluginScreenShots.java b/Ghidra/Debug/Debugger-rmi-trace/src/screen/java/ghidra/app/plugin/core/debug/gui/tracermi/connection/TraceRmiConnectionManagerPluginScreenShots.java index c740d85948..ea28498dbf 100644 --- a/Ghidra/Debug/Debugger-rmi-trace/src/screen/java/ghidra/app/plugin/core/debug/gui/tracermi/connection/TraceRmiConnectionManagerPluginScreenShots.java +++ b/Ghidra/Debug/Debugger-rmi-trace/src/screen/java/ghidra/app/plugin/core/debug/gui/tracermi/connection/TraceRmiConnectionManagerPluginScreenShots.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -19,7 +19,6 @@ import java.net.InetSocketAddress; import org.junit.Test; -import ghidra.app.plugin.core.debug.gui.objects.components.DebuggerMethodInvocationDialog; import ghidra.app.plugin.core.debug.gui.tracermi.connection.TraceRmiConnectionManagerProviderTest.Cx; import ghidra.app.plugin.core.debug.gui.tracermi.connection.tree.TraceRmiConnectionNode; import ghidra.app.plugin.core.debug.gui.tracermi.connection.tree.TraceRmiConnectionTreeHelper; @@ -70,6 +69,6 @@ public class TraceRmiConnectionManagerPluginScreenShots extends GhidraScreenShot performAction(provider.actionConnectOutbound, provider, false); - captureDialog(DebuggerMethodInvocationDialog.class); + captureDialog(TraceRmiConnectDialog.class); } } diff --git a/Ghidra/Debug/Debugger-swig-lldb/InstructionsForBuildingLLDBInterface.txt b/Ghidra/Debug/Debugger-swig-lldb/InstructionsForBuildingLLDBInterface.txt deleted file mode 100644 index 3ad0fc85ae..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/InstructionsForBuildingLLDBInterface.txt +++ /dev/null @@ -1,78 +0,0 @@ -###################################################################################### -## PLEASE NOTE: This version of the lldb-based debugger is being deprecated. ## -## Please try the Python-based traceRMI versions documented in the Debugger help. ## -###################################################################################### - -To use the LLDB agent in Ghidra, you will need to build the JNI interface to the LLDB Scripting Bridge. - -If you are using the distribution (vs. source) and wish to use the default swig files included (LLDB v17), you can use the -macos_debugger_lldb_build_from_brew script in this same directory, kindly provide by @cyberkaida. Make sure a 7.x version -of gradle is in your path, and you've defined GHIDRA_INSTALL_DIR. - -To do this: -(1) check the version for your copy of lldb: - lldb --version - -If you have a version other than the most current (release/17.x), you will need to generate the JNI interface for the version you have. - -(2a) To install LLVM/lldb version 17: - - git clone https://github.com/llvm/llvm-project.git - - cd llvm-project - - git checkout release/17.x - -IF YOU WISH TO BUILD LLDB: - - cd llvm-project - - mkdir build && cd build - - cmake -G Ninja -DLLVM_ENABLE_PROJECTS="clang;lldb" -DCMAKE_BUILD_TYPE=Release -DLLDB_INCLUDE_TESTS=off ../llvm - (on macos, you may also want to include -DLLDB_CODESIGN_IDENTIY="lldb_codesign") - - ninja lldb - - ninja lldb-server - - ninja install - -(2b) To generate the JNI for your version - - cd Ghidra/Debug/Debugger-swig-lldb - - gradle generateSwig - - cp -r build/generated/src/main src - - If you are using the source (vs. a distribution), delete build/generated/src/main afterwards. - -If you have the most current version or have completed step (2), you can: - -(3) Compile the JNI interface by: - - export JAVA_HOME=/path_to_java - - export LLVM_HOME=/path_to_llvm-project - - export LLVM_BUILD=/path_to_llvm_build_directory_or_whatever_contains_lib/liblldb.(so/dylib/dll) - (for Windows, these vars should have the drive: prefix and probably not have spaces) - NB: If you have built lldb from source, you may need to "ln -s liblldb.x.x.x.so/.dylb liblldb.so/.dylib". - - cd Ghidra/Debug/Debugger-swig-lldb - - gradle build - -(4) To run: - - add -Djava.library.path=/path_to_liblldb:/path_to_liblldb-java:etc (not including the actual library name) - in support/launch.properties or, if you're running out of Eclipse, to the arguments in the Run/Debug Configuration - -TROUBLESHOOTING: -(1) If you are trying to execute "gradle buildGhidra" with LLVM_HOME already set, you are likely - to run into difficulties. Unset LLVM_HOME (or on Windows set LLVM_HOME=) before running. -(2) If you are running "gradle generateSwig" and encounter errors, make sure LLVM_HOME is set. -(3) If you are running "gradle build" and it succeeds but there is no library in Ghidra/ - Debug/Debugger-swig/lldb/build/os, again check LLVM_HOME, LLVM_BUILD, and JAVA_HOME. Keep - in mind that different generators for LLVM, esp. for Window, may put liblldb.xxx in unusual - places. Check "build/lib", "build/bin", and subdirs like "build/Release/bin". -(4) If you get an "Unsatisfied Link Error" when you start the debugger, make sure both liblldb - and liblldb-java are in the path described by java.library.path. -(5) Link errors can also be caused by different architectures or platforms for the libraries. -(6) You may need to set up the development environment before running gradle: - gradle -I gradle/support/fetchDependencies.gradle init -(7) If you are using the homebrew installation of lldb, you may need to modify build.gradle or - buildNatives.gradle to reflect the homebrew directory structure, - e.g. $llvm_dir/lldb/include -> $llvm_dir/include. -(8) If you are compiling on macos, make sure you are compiling only the versions supported by your - platform (by editing build.gradle or buildNatives.gradle). -(9) If you are running with a very current version of swig, e.g. 4.1 or later, you may have to: - - edit llvm-project/lldb/bindings/interface/SBValueList.i and remove the two references to nothreadallow. - - edit the build.gradle or buildNatives.gradle and remove -D__STDC_LIMIT_MACROS - - - - - diff --git a/Ghidra/Debug/Debugger-swig-lldb/Module.manifest b/Ghidra/Debug/Debugger-swig-lldb/Module.manifest deleted file mode 100644 index cde98571eb..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/Module.manifest +++ /dev/null @@ -1 +0,0 @@ -MODULE FILE LICENSE: src/llvm-project Apache License 2.0 with LLVM Exceptions diff --git a/Ghidra/Debug/Debugger-swig-lldb/README.md b/Ghidra/Debug/Debugger-swig-lldb/README.md deleted file mode 100644 index 0618277385..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/README.md +++ /dev/null @@ -1 +0,0 @@ -# Debugger-swig-lldb diff --git a/Ghidra/Debug/Debugger-swig-lldb/build.gradle b/Ghidra/Debug/Debugger-swig-lldb/build.gradle deleted file mode 100644 index f9e971c3bc..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/build.gradle +++ /dev/null @@ -1,52 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -apply from: "$rootProject.projectDir/gradle/javaProject.gradle" -apply from: "$rootProject.projectDir/gradle/jacocoProject.gradle" -apply from: "$rootProject.projectDir/gradle/javaTestProject.gradle" -apply from: "$rootProject.projectDir/gradle/nativeProject.gradle" -apply from: "$rootProject.projectDir/gradle/distributableGhidraModule.gradle" -apply from: "buildNatives.gradle" - -apply plugin: 'eclipse' -eclipse.project.name = 'Debug Debugger-swig-lldb' - -dependencies { - api project(':Framework-AsyncComm') - api project(':Framework-Debugging') - api project(':Debugger-gadp') - - testImplementation project(path: ':Framework-AsyncComm', configuration: 'testArtifacts') - testImplementation project(path: ':Framework-Debugging', configuration: 'testArtifacts') - testImplementation project(path: ':Debugger-gadp', configuration: 'testArtifacts') -} - -sourceSets { - main { - java { - srcDir tasks.generateSwig.outdir_java - } - } -} - -// Include buildable native source in distribution -rootProject.assembleDistribution { - from (this.project.projectDir.toString()) { - include "src/**" - include "*.sh" - include "*.txt" - into { getZipPath(this.project) } - } -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/buildNatives.gradle b/Ghidra/Debug/Debugger-swig-lldb/buildNatives.gradle deleted file mode 100644 index 47fb48ff61..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/buildNatives.gradle +++ /dev/null @@ -1,146 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -def llvmRequired = false; // tasks will be skipped if LLVM_HOME not defined in env - -// Native build files are already applied in development mode (indicated by presence of the -// Generic project). Only need to apply them if we are in a distribution. -if (findProject(':Generic') == null) { - // running from within Ghidra install - apply from: "../../../GPL/utils.gradle" - apply from: "../../../GPL/nativePlatforms.gradle" - apply from: "../../../GPL/nativeBuildProperties.gradle" - llvmRequired = true; -} - -task generateSwig { - ext.srcdir = file("src/llvm-project/lldb/bindings/java") - ext.outdir_java = file("build/generated/src/main/java") - ext.outdir_cpp = file("build/generated/src/main/cpp") - ext.llvm_dir = System.env.LLVM_HOME; - outputs.dir(outdir_java) - outputs.dir(outdir_cpp) - doLast { - if (System.env.LLVM_HOME) { - println "Debugger-swig-lldb: using LLVM_HOME=" + System.env.LLVM_HOME - new File(ext.outdir_java, "/SWIG").mkdirs() - def exe = "swig" - exec { - commandLine exe, "-c++", "-features", "autodoc", "-D__STDC_LIMIT_MACROS", "-D__STDC_CONSTANT_MACROS", - "-I$llvm_dir/lldb/include", "-I$llvm_dir/lldb/bindings", "-java", "-package", "SWIG", "-c++", - "-outdir", "$outdir_java/SWIG", "-o", "$outdir_cpp/LLDBWrapJava.cpp" - args "$srcdir/java.swig" - } - } else { - //throw new GradleException("Debugger-swig-lldb:generateSwig requires LLVM_HOME to be defined") - println "OPTIONAL dependency Debugger-swig-lldb:generateSwig skipped - LLVM_HOME not defined" - println "NOTE: The JNI/swig interface for recorder-style lldb debugging is being deprecated." - println " Please try the new traceRMI python-based versions of the debugger." - } - } -} - -/** - * Define the "native build model" for building the SWIG executables. - */ -if (System.env.LLVM_HOME) { - model { - components { - main(NativeLibrarySpec) { - baseName "lldb-java" - targetPlatform "win_x86_64" - targetPlatform "linux_x86_64" - targetPlatform "linux_arm_64" - targetPlatform "mac_x86_64" - targetPlatform "mac_arm_64" - } - } - - binaries { - ext.llvm_dir = System.env.LLVM_HOME; - ext.llvm_build_dir = System.env.LLVM_BUILD; - if (System.env.JAVA_HOME) { - // Allow Gradle's default JAVA_HOME to be overridden by an environment variable we set - project.ext.JAVA_HOME = System.env.JAVA_HOME; - } - else { - project.ext.JAVA_HOME = "${System.properties.'java.home'}" - } - all{ b -> - if (b.targetPlatform.operatingSystem.linux) { - b.cppCompiler.args "-I${JAVA_HOME}/include/linux" - } else if (b.targetPlatform.operatingSystem.windows) { - b.cppCompiler.args "-I${JAVA_HOME}/include/win32" - } else { - b.cppCompiler.args "-I${JAVA_HOME}/include/darwin" - } - if (b.toolChain in Gcc) { - b.cppCompiler.args "-I$llvm_dir/lldb/include" - b.cppCompiler.args "-I${JAVA_HOME}/include" - b.linker.args "-L$llvm_build_dir/lib" - b.linker.args "-llldb" - b.cppCompiler.args "-std=c++14" - b.cppCompiler.args "-O3" - // b.cppCompiler.args "-g" // for DEBUG, uncomment this line - } - else if (b.toolChain in Clang) { - b.cppCompiler.args "-I$llvm_dir/lldb/include" - b.cppCompiler.args "-I${JAVA_HOME}/include" - b.linker.args "-L$llvm_build_dir/lib" - b.linker.args "-llldb" - b.cppCompiler.args "-std=c++14" - b.cppCompiler.args "-O3" - // b.cppCompiler.args "-g" // for DEBUG, uncomment this line - } - else if (b.toolChain in VisualCpp) { - b.cppCompiler.args "/I$llvm_dir/lldb/include" - b.cppCompiler.args "-I${JAVA_HOME}/include" - b.linker.args "/LIBPATH:$llvm_build_dir/lib" - b.linker.args "liblldb.lib" - // b.cppCompiler.args "/Zi" // for DEBUG, uncomment this line - // b.cppCompiler.args "/FS" // for DEBUG, uncomment this line - // b.linker.args "/DEBUG" // for DEBUG, uncomment this line - if (b.targetPlatform.operatingSystem.windows) { - b.cppCompiler.define "WINDOWS" - b.cppCompiler.define "_WINDOWS" - b.cppCompiler.define "WIN32" - b.cppCompiler.define "_WIN32" - if (b.targetPlatform.name == "win_x86_64") { - b.cppCompiler.define "WIN64" - b.cppCompiler.define "_WIN64" - } - } - } - } - } - } -} else { - logger.debug('Debugger-swig-lldb:buildNatives skipped - LLVM_HOME not defined') -} - -task checkLLVM { - doFirst { - if (System.env.LLVM_HOME) { - println "Debugger-swig-lldb: using LLVM_HOME=" + System.env.LLVM_HOME - } - else if (llvmRequired) { - throw new GradleException("Debugger-swig-lldb:build requires LLVM_HOME to be defined") - } - } -} - -// Module build within Ghidra install requires LLVM_HOME -tasks.build.dependsOn checkLLVM diff --git a/Ghidra/Debug/Debugger-swig-lldb/certification.manifest b/Ghidra/Debug/Debugger-swig-lldb/certification.manifest deleted file mode 100644 index 20f2bf68e7..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/certification.manifest +++ /dev/null @@ -1,9 +0,0 @@ -##VERSION: 2.0 -##MODULE IP: Apache License 2.0 -##MODULE IP: Apache License 2.0 with LLVM Exceptions -InstructionsForBuildingLLDBInterface.txt||GHIDRA||||END| -Module.manifest||GHIDRA||||END| -README.md||GHIDRA||||END| -build.gradle||GHIDRA||||END| -src/llvm-project/lldb/bindings/java/java-typemaps.swig||Apache License 2.0 with LLVM Exceptions||||END| -src/llvm-project/lldb/bindings/java/java.swig||Apache License 2.0 with LLVM Exceptions||||END| diff --git a/Ghidra/Debug/Debugger-swig-lldb/macos_debugger_lldb_build_from_brew.sh b/Ghidra/Debug/Debugger-swig-lldb/macos_debugger_lldb_build_from_brew.sh deleted file mode 100755 index 1061f780c2..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/macos_debugger_lldb_build_from_brew.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/env bash -## ### -# IP: GHIDRA -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -## - -###################################################################################### -## PLEASE NOTE: This version of the lldb-based debugger is being deprecated. ## -## Please try the Python-based traceRMI versions documented in the Debugger help. ## -###################################################################################### - - -## -# This script will download lldb from homebrew and -# build the Ghidra JNI bindings for this version of -# lldb. It will then patch your Ghidra distribution -# to use these built libraries. - -set -ex - -if [ -z "${GHIDRA_INSTALL_DIR}" ]; then - echo "Please set the GHIDRA_INSTALL_DIR environment variable to your Ghidra install location" - exit 1 -fi - -if [ ! -z "${GHIDRA_INSTALL_DIR}" ]; then - pushd "${GHIDRA_INSTALL_DIR}/Ghidra/Debug/Debugger-swig-lldb" -fi - -# Pin to 16, as this is what Ghidra's built in bindings are built against -LLVM_VERSION="16" - -# Install llvm and unpack the source code for this version, patched -# with the brew patches -brew install llvm@${LLVM_VERSION} - -LLVM_TEMP_DIR=$(mktemp -d) - -# Download the source code brew used to build llvm, including -# brew specific patches. -brew unpack --patch --destdir ${LLVM_TEMP_DIR} llvm@${LLVM_VERSION} -export LLVM_HOME="$(echo ${LLVM_TEMP_DIR}/llvm@${LLVM_VERSION}-*)" -if [ ! -d "${LLVM_HOME}" ]; then - export LLVM_HOME="$(echo ${LLVM_TEMP_DIR}/llvm-${LLVM_VERSION}.*)" -fi - -# Set the appropriate build variables to link and compile the -# liblldb-java library below. -BREW_LLVM="$(brew --prefix llvm@${LLVM_VERSION})" -export LDFLAGS="-L${BREW_LLVM}/lib/c++ -Wl,-rpath,${BREW_LLVM}/lib/c++,-L${BREW_LLVM}/lib" -export PATH="${BREW_LLVM}/bin:$PATH" -export CPPFLAGS="-I${BREW_LLVM}/include" - -export LLVM_BUILD="$(echo ${BREW_LLVM})" - -# Build native components -gradle buildNatives - -# Build only the library required for our architecture. -# The brew llvm package installs a thinned binary containing -# only the native architecture of your machine. -if [ $(arch) == "arm64" ]; then - gradle :Debugger-swig-lldb:linkMainMac_arm_64SharedLibrary - export LIBLLDB_JAVA_DIR=Ghidra/Debug/Debugger-swig-lldb/build/os/mac_arm_64/ -else - gradle :Debugger-swig-lldb:linkMainMac_x86_64SharedLibrary - export LIBLLDB_JAVA_DIR=Ghidra/Debug/Debugger-swig-lldb/build/os/mac_x86_64/ -fi - -# Patch the launch.properties with our library location -LAUNCH_PROPERTIES=${GHIDRA_INSTALL_DIR}/support/launch.properties -sed -i '' /llvm/d ${LAUNCH_PROPERTIES} -echo "VMARGS=-Djava.library.path=${GHIDRA_INSTALL_DIR}/${LIBLLDB_JAVA_DIR}:${BREW_LLVM}/lib" >> ${LAUNCH_PROPERTIES} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/llvm-project/lldb/bindings/java/java-typemaps.swig b/Ghidra/Debug/Debugger-swig-lldb/src/llvm-project/lldb/bindings/java/java-typemaps.swig deleted file mode 100644 index e23628eb30..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/llvm-project/lldb/bindings/java/java-typemaps.swig +++ /dev/null @@ -1,18 +0,0 @@ -%include -%include -%include - -%typemap(javabase) ByteArray "SWIGTYPE_p_void" -%typemap(javabody) ByteArray %{ - private long swigCPtr; // Minor bodge to work around private variable in parent - private boolean swigCMemOwn; - public $javaclassname(long cPtr, boolean cMemoryOwn) { - super(cPtr, cMemoryOwn); - this.swigCPtr = SWIGTYPE_p_void.getCPtr(this); - swigCMemOwn = cMemoryOwn; - } -%} - -%array_class(jbyte, ByteArray); - -%apply char **STRING_ARRAY { char ** } diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/llvm-project/lldb/bindings/java/java.swig b/Ghidra/Debug/Debugger-swig-lldb/src/llvm-project/lldb/bindings/java/java.swig deleted file mode 100644 index 305ecc6b70..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/llvm-project/lldb/bindings/java/java.swig +++ /dev/null @@ -1,22 +0,0 @@ -/* - lldb.swig - - This is the input file for SWIG, to create the appropriate C++ wrappers and - functions for various scripting languages, to enable them to call the - liblldb Script Bridge functions. -*/ - -%module lldb - -%include -%include "java-typemaps.swig" -%include "macros.swig" -%include "headers.swig" - -%{ -using namespace lldb_private; -using namespace lldb; -%} - -%include "interfaces.swig" - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/cpp/LLDBWrapJava.cpp b/Ghidra/Debug/Debugger-swig-lldb/src/main/cpp/LLDBWrapJava.cpp deleted file mode 100644 index 15671c1294..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/cpp/LLDBWrapJava.cpp +++ /dev/null @@ -1,44704 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - - -#define SWIG_VERSION 0x040101 -#define SWIGJAVA - -/* ----------------------------------------------------------------------------- - * This section contains generic SWIG labels for method/variable - * declarations/attributes, and other compiler dependent labels. - * ----------------------------------------------------------------------------- */ - -/* template workaround for compilers that cannot correctly implement the C++ standard */ -#ifndef SWIGTEMPLATEDISAMBIGUATOR -# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) -# define SWIGTEMPLATEDISAMBIGUATOR template -# elif defined(__HP_aCC) -/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ -/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ -# define SWIGTEMPLATEDISAMBIGUATOR template -# else -# define SWIGTEMPLATEDISAMBIGUATOR -# endif -#endif - -/* inline attribute */ -#ifndef SWIGINLINE -# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) -# define SWIGINLINE inline -# else -# define SWIGINLINE -# endif -#endif - -/* attribute recognised by some compilers to avoid 'unused' warnings */ -#ifndef SWIGUNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define SWIGUNUSED __attribute__ ((__unused__)) -# else -# define SWIGUNUSED -# endif -# elif defined(__ICC) -# define SWIGUNUSED __attribute__ ((__unused__)) -# else -# define SWIGUNUSED -# endif -#endif - -#ifndef SWIG_MSC_UNSUPPRESS_4505 -# if defined(_MSC_VER) -# pragma warning(disable : 4505) /* unreferenced local function has been removed */ -# endif -#endif - -#ifndef SWIGUNUSEDPARM -# ifdef __cplusplus -# define SWIGUNUSEDPARM(p) -# else -# define SWIGUNUSEDPARM(p) p SWIGUNUSED -# endif -#endif - -/* internal SWIG method */ -#ifndef SWIGINTERN -# define SWIGINTERN static SWIGUNUSED -#endif - -/* internal inline SWIG method */ -#ifndef SWIGINTERNINLINE -# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE -#endif - -/* exporting methods */ -#if defined(__GNUC__) -# if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) -# ifndef GCC_HASCLASSVISIBILITY -# define GCC_HASCLASSVISIBILITY -# endif -# endif -#endif - -#ifndef SWIGEXPORT -# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) -# if defined(STATIC_LINKED) -# define SWIGEXPORT -# else -# define SWIGEXPORT __declspec(dllexport) -# endif -# else -# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) -# define SWIGEXPORT __attribute__ ((visibility("default"))) -# else -# define SWIGEXPORT -# endif -# endif -#endif - -/* calling conventions for Windows */ -#ifndef SWIGSTDCALL -# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) -# define SWIGSTDCALL __stdcall -# else -# define SWIGSTDCALL -# endif -#endif - -/* Deal with Microsoft's attempt at deprecating C standard runtime functions */ -#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) -# define _CRT_SECURE_NO_DEPRECATE -#endif - -/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ -#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) -# define _SCL_SECURE_NO_DEPRECATE -#endif - -/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */ -#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES) -# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0 -#endif - -/* Intel's compiler complains if a variable which was never initialised is - * cast to void, which is a common idiom which we use to indicate that we - * are aware a variable isn't used. So we just silence that warning. - * See: https://github.com/swig/swig/issues/192 for more discussion. - */ -#ifdef __INTEL_COMPILER -# pragma warning disable 592 -#endif - - -#include -#include -#include - - -/* Support for throwing Java exceptions */ -typedef enum { - SWIG_JavaOutOfMemoryError = 1, - SWIG_JavaIOException, - SWIG_JavaRuntimeException, - SWIG_JavaIndexOutOfBoundsException, - SWIG_JavaArithmeticException, - SWIG_JavaIllegalArgumentException, - SWIG_JavaNullPointerException, - SWIG_JavaDirectorPureVirtual, - SWIG_JavaUnknownError, - SWIG_JavaIllegalStateException, -} SWIG_JavaExceptionCodes; - -typedef struct { - SWIG_JavaExceptionCodes code; - const char *java_exception; -} SWIG_JavaExceptions_t; - - -static void SWIGUNUSED SWIG_JavaThrowException(JNIEnv *jenv, SWIG_JavaExceptionCodes code, const char *msg) { - jclass excep; - static const SWIG_JavaExceptions_t java_exceptions[] = { - { SWIG_JavaOutOfMemoryError, "java/lang/OutOfMemoryError" }, - { SWIG_JavaIOException, "java/io/IOException" }, - { SWIG_JavaRuntimeException, "java/lang/RuntimeException" }, - { SWIG_JavaIndexOutOfBoundsException, "java/lang/IndexOutOfBoundsException" }, - { SWIG_JavaArithmeticException, "java/lang/ArithmeticException" }, - { SWIG_JavaIllegalArgumentException, "java/lang/IllegalArgumentException" }, - { SWIG_JavaNullPointerException, "java/lang/NullPointerException" }, - { SWIG_JavaDirectorPureVirtual, "java/lang/RuntimeException" }, - { SWIG_JavaUnknownError, "java/lang/UnknownError" }, - { SWIG_JavaIllegalStateException, "java/lang/IllegalStateException" }, - { (SWIG_JavaExceptionCodes)0, "java/lang/UnknownError" } - }; - const SWIG_JavaExceptions_t *except_ptr = java_exceptions; - - while (except_ptr->code != code && except_ptr->code) - except_ptr++; - - jenv->ExceptionClear(); - excep = jenv->FindClass(except_ptr->java_exception); - if (excep) - jenv->ThrowNew(excep, msg); -} - - -/* Contract support */ - -#define SWIG_contract_assert(nullreturn, expr, msg) do { if (!(expr)) {SWIG_JavaThrowException(jenv, SWIG_JavaIllegalArgumentException, msg); return nullreturn; } } while (0) - - -#ifdef __cplusplus -#include -/* SwigValueWrapper is described in swig.swg */ -template class SwigValueWrapper { - struct SwigSmartPointer { - T *ptr; - SwigSmartPointer(T *p) : ptr(p) { } - ~SwigSmartPointer() { delete ptr; } - SwigSmartPointer& operator=(SwigSmartPointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } - void reset(T *p) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = p; } - } pointer; - SwigValueWrapper& operator=(const SwigValueWrapper& rhs); - SwigValueWrapper(const SwigValueWrapper& rhs); -public: - SwigValueWrapper() : pointer(0) { } - SwigValueWrapper& operator=(const T& t) { SwigSmartPointer tmp(new T(t)); pointer = tmp; return *this; } -#if __cplusplus >=201103L - SwigValueWrapper& operator=(T&& t) { SwigSmartPointer tmp(new T(std::move(t))); pointer = tmp; return *this; } - operator T&&() const { return std::move(*pointer.ptr); } -#else - operator T&() const { return *pointer.ptr; } -#endif - T *operator&() const { return pointer.ptr; } - static void reset(SwigValueWrapper& t, T *p) { t.pointer.reset(p); } -}; - -/* - * SwigValueInit() is a generic initialisation solution as the following approach: - * - * T c_result = T(); - * - * doesn't compile for all types for example: - * - * unsigned int c_result = unsigned int(); - */ -template T SwigValueInit() { - return T(); -} - -#if __cplusplus >=201103L -# define SWIG_STD_MOVE(OBJ) std::move(OBJ) -#else -# define SWIG_STD_MOVE(OBJ) OBJ -#endif - -#endif - - -#include - - -typedef jbyte ByteArray; - -SWIGINTERN ByteArray *new_ByteArray(int nelements){ - return new jbyte[nelements](); -} -SWIGINTERN void delete_ByteArray(ByteArray *self){ - delete [] self; -} -SWIGINTERN jbyte ByteArray_getitem(ByteArray *self,int index){ - return self[index]; -} -SWIGINTERN void ByteArray_setitem(ByteArray *self,int index,jbyte value){ - self[index] = value; -} -SWIGINTERN jbyte *ByteArray_cast(ByteArray *self){ - return self; -} -SWIGINTERN ByteArray *ByteArray_frompointer(jbyte *t){ - return (ByteArray *) t; -} - -#include -#include - - -#include "lldb/lldb-public.h" -#include "lldb/API/SBAddress.h" -#include "lldb/API/SBAttachInfo.h" -#include "lldb/API/SBBlock.h" -#include "lldb/API/SBBreakpoint.h" -#include "lldb/API/SBBreakpointLocation.h" -#include "lldb/API/SBBreakpointName.h" -#include "lldb/API/SBBroadcaster.h" -#include "lldb/API/SBCommandInterpreter.h" -#include "lldb/API/SBCommandInterpreterRunOptions.h" -#include "lldb/API/SBCommandReturnObject.h" -#include "lldb/API/SBCommunication.h" -#include "lldb/API/SBCompileUnit.h" -#include "lldb/API/SBData.h" -#include "lldb/API/SBDebugger.h" -#include "lldb/API/SBDeclaration.h" -#include "lldb/API/SBEnvironment.h" -#include "lldb/API/SBError.h" -#include "lldb/API/SBEvent.h" -#include "lldb/API/SBExecutionContext.h" -#include "lldb/API/SBExpressionOptions.h" -#include "lldb/API/SBFile.h" -#include "lldb/API/SBFileSpec.h" -#include "lldb/API/SBFileSpecList.h" -#include "lldb/API/SBFrame.h" -#include "lldb/API/SBFunction.h" -#include "lldb/API/SBHostOS.h" -#include "lldb/API/SBInstruction.h" -#include "lldb/API/SBInstructionList.h" -#include "lldb/API/SBLanguageRuntime.h" -#include "lldb/API/SBLaunchInfo.h" -#include "lldb/API/SBLineEntry.h" -#include "lldb/API/SBListener.h" -#include "lldb/API/SBMemoryRegionInfo.h" -#include "lldb/API/SBMemoryRegionInfoList.h" -#include "lldb/API/SBModule.h" -#include "lldb/API/SBModuleSpec.h" -#include "lldb/API/SBPlatform.h" -#include "lldb/API/SBProcess.h" -#include "lldb/API/SBProcessInfo.h" -#include "lldb/API/SBQueue.h" -#include "lldb/API/SBQueueItem.h" -#include "lldb/API/SBReproducer.h" -#include "lldb/API/SBScriptObject.h" -#include "lldb/API/SBSection.h" -#include "lldb/API/SBSourceManager.h" -#include "lldb/API/SBStream.h" -#include "lldb/API/SBStringList.h" -#include "lldb/API/SBStructuredData.h" -#include "lldb/API/SBSymbol.h" -#include "lldb/API/SBSymbolContext.h" -#include "lldb/API/SBSymbolContextList.h" -#include "lldb/API/SBTarget.h" -#include "lldb/API/SBThread.h" -#include "lldb/API/SBThreadCollection.h" -#include "lldb/API/SBThreadPlan.h" -#include "lldb/API/SBTrace.h" -#include "lldb/API/SBType.h" -#include "lldb/API/SBTypeCategory.h" -#include "lldb/API/SBTypeEnumMember.h" -#include "lldb/API/SBTypeFilter.h" -#include "lldb/API/SBTypeFormat.h" -#include "lldb/API/SBTypeNameSpecifier.h" -#include "lldb/API/SBTypeSummary.h" -#include "lldb/API/SBTypeSynthetic.h" -#include "lldb/API/SBUnixSignals.h" -#include "lldb/API/SBValue.h" -#include "lldb/API/SBValueList.h" -#include "lldb/API/SBVariablesOptions.h" -#include "lldb/API/SBWatchpoint.h" - - -using namespace lldb_private; -using namespace lldb; - - -#include // Use the C99 official header - -SWIGINTERN std::string lldb_SBAddress___repr__(lldb::SBAddress *self){ - lldb::SBStream stream; - self->GetDescription (stream); - const char *desc = stream.GetData(); - size_t desc_len = stream.GetSize(); - if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) { - --desc_len; - } - return std::string(desc, desc_len); - } -SWIGINTERN std::string lldb_SBBlock___repr__(lldb::SBBlock *self){ - lldb::SBStream stream; - self->GetDescription (stream); - const char *desc = stream.GetData(); - size_t desc_len = stream.GetSize(); - if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) { - --desc_len; - } - return std::string(desc, desc_len); - } -SWIGINTERN std::string lldb_SBBreakpoint___repr__(lldb::SBBreakpoint *self){ - lldb::SBStream stream; - self->GetDescription (stream); - const char *desc = stream.GetData(); - size_t desc_len = stream.GetSize(); - if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) { - --desc_len; - } - return std::string(desc, desc_len); - } -SWIGINTERN std::string lldb_SBBreakpointLocation___repr__(lldb::SBBreakpointLocation *self){ - lldb::SBStream stream; - self->GetDescription (stream, lldb::eDescriptionLevelFull); - const char *desc = stream.GetData(); - size_t desc_len = stream.GetSize(); - if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) { - --desc_len; - } - return std::string(desc, desc_len); - } -SWIGINTERN std::string lldb_SBBreakpointName___repr__(lldb::SBBreakpointName *self){ - lldb::SBStream stream; - self->GetDescription (stream); - const char *desc = stream.GetData(); - size_t desc_len = stream.GetSize(); - if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) { - --desc_len; - } - return std::string(desc, desc_len); - } -SWIGINTERN std::string lldb_SBCommandReturnObject___repr__(lldb::SBCommandReturnObject *self){ - lldb::SBStream stream; - self->GetDescription (stream); - const char *desc = stream.GetData(); - size_t desc_len = stream.GetSize(); - if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) { - --desc_len; - } - return std::string(desc, desc_len); - } -SWIGINTERN void lldb_SBCommandReturnObject_SetImmediateOutputFile__SWIG_2(lldb::SBCommandReturnObject *self,lldb::FileSP BORROWED,bool transfer_ownership){ - self->SetImmediateOutputFile(BORROWED); - } -SWIGINTERN void lldb_SBCommandReturnObject_SetImmediateErrorFile__SWIG_2(lldb::SBCommandReturnObject *self,lldb::FileSP BORROWED,bool transfer_ownership){ - self->SetImmediateErrorFile(BORROWED); - } -SWIGINTERN void lldb_SBCommandReturnObject_Print(lldb::SBCommandReturnObject *self,char const *str){ - self->Printf("%s", str); - } -SWIGINTERN std::string lldb_SBCompileUnit___repr__(lldb::SBCompileUnit *self){ - lldb::SBStream stream; - self->GetDescription (stream); - const char *desc = stream.GetData(); - size_t desc_len = stream.GetSize(); - if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) { - --desc_len; - } - return std::string(desc, desc_len); - } -SWIGINTERN std::string lldb_SBData___repr__(lldb::SBData *self){ - lldb::SBStream stream; - self->GetDescription (stream); - const char *desc = stream.GetData(); - size_t desc_len = stream.GetSize(); - if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) { - --desc_len; - } - return std::string(desc, desc_len); - } -SWIGINTERN std::string lldb_SBDebugger___repr__(lldb::SBDebugger *self){ - lldb::SBStream stream; - self->GetDescription (stream); - const char *desc = stream.GetData(); - size_t desc_len = stream.GetSize(); - if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) { - --desc_len; - } - return std::string(desc, desc_len); - } -SWIGINTERN lldb::FileSP lldb_SBDebugger_GetInputFileHandle(lldb::SBDebugger *self){ - return self->GetInputFile().GetFile(); - } -SWIGINTERN lldb::FileSP lldb_SBDebugger_GetOutputFileHandle(lldb::SBDebugger *self){ - return self->GetOutputFile().GetFile(); - } -SWIGINTERN lldb::FileSP lldb_SBDebugger_GetErrorFileHandle(lldb::SBDebugger *self){ - return self->GetErrorFile().GetFile(); - } -SWIGINTERN std::string lldb_SBDeclaration___repr__(lldb::SBDeclaration *self){ - lldb::SBStream stream; - self->GetDescription (stream); - const char *desc = stream.GetData(); - size_t desc_len = stream.GetSize(); - if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) { - --desc_len; - } - return std::string(desc, desc_len); - } -SWIGINTERN std::string lldb_SBError___repr__(lldb::SBError *self){ - lldb::SBStream stream; - self->GetDescription (stream); - const char *desc = stream.GetData(); - size_t desc_len = stream.GetSize(); - if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) { - --desc_len; - } - return std::string(desc, desc_len); - } -SWIGINTERN lldb::SBFile lldb_SBFile_MakeBorrowed(lldb::FileSP BORROWED){ - return lldb::SBFile(BORROWED); - } -SWIGINTERN lldb::SBFile lldb_SBFile_MakeForcingIOMethods(lldb::FileSP FORCE_IO_METHODS){ - return lldb::SBFile(FORCE_IO_METHODS); - } -SWIGINTERN lldb::SBFile lldb_SBFile_MakeBorrowedForcingIOMethods(lldb::FileSP BORROWED_FORCE_IO_METHODS){ - return lldb::SBFile(BORROWED_FORCE_IO_METHODS); - } -SWIGINTERN std::string lldb_SBFileSpec___repr__(lldb::SBFileSpec *self){ - lldb::SBStream stream; - self->GetDescription (stream); - const char *desc = stream.GetData(); - size_t desc_len = stream.GetSize(); - if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) { - --desc_len; - } - return std::string(desc, desc_len); - } -SWIGINTERN std::string lldb_SBFrame___repr__(lldb::SBFrame *self){ - lldb::SBStream stream; - self->GetDescription (stream); - const char *desc = stream.GetData(); - size_t desc_len = stream.GetSize(); - if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) { - --desc_len; - } - return std::string(desc, desc_len); - } -SWIGINTERN std::string lldb_SBFunction___repr__(lldb::SBFunction *self){ - lldb::SBStream stream; - self->GetDescription (stream); - const char *desc = stream.GetData(); - size_t desc_len = stream.GetSize(); - if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) { - --desc_len; - } - return std::string(desc, desc_len); - } -SWIGINTERN std::string lldb_SBInstruction___repr__(lldb::SBInstruction *self){ - lldb::SBStream stream; - self->GetDescription (stream); - const char *desc = stream.GetData(); - size_t desc_len = stream.GetSize(); - if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) { - --desc_len; - } - return std::string(desc, desc_len); - } -SWIGINTERN std::string lldb_SBInstructionList___repr__(lldb::SBInstructionList *self){ - lldb::SBStream stream; - self->GetDescription (stream); - const char *desc = stream.GetData(); - size_t desc_len = stream.GetSize(); - if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) { - --desc_len; - } - return std::string(desc, desc_len); - } -SWIGINTERN std::string lldb_SBLineEntry___repr__(lldb::SBLineEntry *self){ - lldb::SBStream stream; - self->GetDescription (stream); - const char *desc = stream.GetData(); - size_t desc_len = stream.GetSize(); - if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) { - --desc_len; - } - return std::string(desc, desc_len); - } -SWIGINTERN std::string lldb_SBMemoryRegionInfo___repr__(lldb::SBMemoryRegionInfo *self){ - lldb::SBStream stream; - self->GetDescription (stream); - const char *desc = stream.GetData(); - size_t desc_len = stream.GetSize(); - if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) { - --desc_len; - } - return std::string(desc, desc_len); - } -SWIGINTERN std::string lldb_SBModule___repr__(lldb::SBModule *self){ - lldb::SBStream stream; - self->GetDescription (stream); - const char *desc = stream.GetData(); - size_t desc_len = stream.GetSize(); - if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) { - --desc_len; - } - return std::string(desc, desc_len); - } -SWIGINTERN std::string lldb_SBModuleSpec___repr__(lldb::SBModuleSpec *self){ - lldb::SBStream stream; - self->GetDescription (stream); - const char *desc = stream.GetData(); - size_t desc_len = stream.GetSize(); - if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) { - --desc_len; - } - return std::string(desc, desc_len); - } -SWIGINTERN std::string lldb_SBModuleSpecList___repr__(lldb::SBModuleSpecList *self){ - lldb::SBStream stream; - self->GetDescription (stream); - const char *desc = stream.GetData(); - size_t desc_len = stream.GetSize(); - if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) { - --desc_len; - } - return std::string(desc, desc_len); - } -SWIGINTERN std::string lldb_SBProcess___repr__(lldb::SBProcess *self){ - lldb::SBStream stream; - self->GetDescription (stream); - const char *desc = stream.GetData(); - size_t desc_len = stream.GetSize(); - if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) { - --desc_len; - } - return std::string(desc, desc_len); - } -SWIGINTERN std::string lldb_SBSection___repr__(lldb::SBSection *self){ - lldb::SBStream stream; - self->GetDescription (stream); - const char *desc = stream.GetData(); - size_t desc_len = stream.GetSize(); - if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) { - --desc_len; - } - return std::string(desc, desc_len); - } -SWIGINTERN void lldb_SBStream_RedirectToFileHandle(lldb::SBStream *self,lldb::FileSP file,bool transfer_fh_ownership){ - self->RedirectToFile(file); - } -SWIGINTERN std::string lldb_SBSymbol___repr__(lldb::SBSymbol *self){ - lldb::SBStream stream; - self->GetDescription (stream); - const char *desc = stream.GetData(); - size_t desc_len = stream.GetSize(); - if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) { - --desc_len; - } - return std::string(desc, desc_len); - } -SWIGINTERN std::string lldb_SBSymbolContext___repr__(lldb::SBSymbolContext *self){ - lldb::SBStream stream; - self->GetDescription (stream); - const char *desc = stream.GetData(); - size_t desc_len = stream.GetSize(); - if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) { - --desc_len; - } - return std::string(desc, desc_len); - } -SWIGINTERN std::string lldb_SBSymbolContextList___repr__(lldb::SBSymbolContextList *self){ - lldb::SBStream stream; - self->GetDescription (stream); - const char *desc = stream.GetData(); - size_t desc_len = stream.GetSize(); - if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) { - --desc_len; - } - return std::string(desc, desc_len); - } -SWIGINTERN std::string lldb_SBTarget___repr__(lldb::SBTarget *self){ - lldb::SBStream stream; - self->GetDescription (stream, lldb::eDescriptionLevelBrief); - const char *desc = stream.GetData(); - size_t desc_len = stream.GetSize(); - if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) { - --desc_len; - } - return std::string(desc, desc_len); - } -SWIGINTERN std::string lldb_SBThread___repr__(lldb::SBThread *self){ - lldb::SBStream stream; - self->GetDescription (stream); - const char *desc = stream.GetData(); - size_t desc_len = stream.GetSize(); - if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) { - --desc_len; - } - return std::string(desc, desc_len); - } -SWIGINTERN std::string lldb_SBTypeMember___repr__(lldb::SBTypeMember *self){ - lldb::SBStream stream; - self->GetDescription (stream, lldb::eDescriptionLevelBrief); - const char *desc = stream.GetData(); - size_t desc_len = stream.GetSize(); - if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) { - --desc_len; - } - return std::string(desc, desc_len); - } -SWIGINTERN std::string lldb_SBTypeMemberFunction___repr__(lldb::SBTypeMemberFunction *self){ - lldb::SBStream stream; - self->GetDescription (stream, lldb::eDescriptionLevelBrief); - const char *desc = stream.GetData(); - size_t desc_len = stream.GetSize(); - if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) { - --desc_len; - } - return std::string(desc, desc_len); - } -SWIGINTERN std::string lldb_SBType___repr__(lldb::SBType *self){ - lldb::SBStream stream; - self->GetDescription (stream, lldb::eDescriptionLevelBrief); - const char *desc = stream.GetData(); - size_t desc_len = stream.GetSize(); - if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) { - --desc_len; - } - return std::string(desc, desc_len); - } -SWIGINTERN std::string lldb_SBTypeCategory___repr__(lldb::SBTypeCategory *self){ - lldb::SBStream stream; - self->GetDescription (stream, lldb::eDescriptionLevelBrief); - const char *desc = stream.GetData(); - size_t desc_len = stream.GetSize(); - if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) { - --desc_len; - } - return std::string(desc, desc_len); - } -SWIGINTERN std::string lldb_SBTypeEnumMember___repr__(lldb::SBTypeEnumMember *self){ - lldb::SBStream stream; - self->GetDescription (stream, lldb::eDescriptionLevelBrief); - const char *desc = stream.GetData(); - size_t desc_len = stream.GetSize(); - if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) { - --desc_len; - } - return std::string(desc, desc_len); - } -SWIGINTERN std::string lldb_SBTypeFilter___repr__(lldb::SBTypeFilter *self){ - lldb::SBStream stream; - self->GetDescription (stream, lldb::eDescriptionLevelBrief); - const char *desc = stream.GetData(); - size_t desc_len = stream.GetSize(); - if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) { - --desc_len; - } - return std::string(desc, desc_len); - } -SWIGINTERN std::string lldb_SBTypeFormat___repr__(lldb::SBTypeFormat *self){ - lldb::SBStream stream; - self->GetDescription (stream, lldb::eDescriptionLevelBrief); - const char *desc = stream.GetData(); - size_t desc_len = stream.GetSize(); - if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) { - --desc_len; - } - return std::string(desc, desc_len); - } -SWIGINTERN std::string lldb_SBTypeNameSpecifier___repr__(lldb::SBTypeNameSpecifier *self){ - lldb::SBStream stream; - self->GetDescription (stream, lldb::eDescriptionLevelBrief); - const char *desc = stream.GetData(); - size_t desc_len = stream.GetSize(); - if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) { - --desc_len; - } - return std::string(desc, desc_len); - } -SWIGINTERN std::string lldb_SBTypeSummary___repr__(lldb::SBTypeSummary *self){ - lldb::SBStream stream; - self->GetDescription (stream, lldb::eDescriptionLevelBrief); - const char *desc = stream.GetData(); - size_t desc_len = stream.GetSize(); - if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) { - --desc_len; - } - return std::string(desc, desc_len); - } -SWIGINTERN std::string lldb_SBTypeSynthetic___repr__(lldb::SBTypeSynthetic *self){ - lldb::SBStream stream; - self->GetDescription (stream, lldb::eDescriptionLevelBrief); - const char *desc = stream.GetData(); - size_t desc_len = stream.GetSize(); - if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) { - --desc_len; - } - return std::string(desc, desc_len); - } -SWIGINTERN std::string lldb_SBValue___repr__(lldb::SBValue *self){ - lldb::SBStream stream; - self->GetDescription (stream); - const char *desc = stream.GetData(); - size_t desc_len = stream.GetSize(); - if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) { - --desc_len; - } - return std::string(desc, desc_len); - } -SWIGINTERN std::string lldb_SBValueList___str__(lldb::SBValueList *self){ - lldb::SBStream description; - const size_t n = self->GetSize(); - if (n) - { - for (size_t i=0; iGetValueAtIndex(i).GetDescription(description); - } - else - { - description.Printf(" lldb.SBValueList()"); - } - const char *desc = description.GetData(); - size_t desc_len = description.GetSize(); - if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) - --desc_len; - return std::string(desc, desc_len); - } -SWIGINTERN std::string lldb_SBWatchpoint___repr__(lldb::SBWatchpoint *self){ - lldb::SBStream stream; - self->GetDescription (stream, lldb::eDescriptionLevelVerbose); - const char *desc = stream.GetData(); - size_t desc_len = stream.GetSize(); - if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) { - --desc_len; - } - return std::string(desc, desc_len); - } - -#ifdef __cplusplus -extern "C" { -#endif - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1ByteArray(JNIEnv *jenv, jclass jcls, jint jarg1) { - jlong jresult = 0 ; - int arg1 ; - ByteArray *result = 0 ; - - (void)jenv; - (void)jcls; - arg1 = (int)jarg1; - result = (ByteArray *)new_ByteArray(arg1); - *(ByteArray **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1ByteArray(JNIEnv *jenv, jclass jcls, jlong jarg1) { - ByteArray *arg1 = (ByteArray *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(ByteArray **)&jarg1; - delete_ByteArray(arg1); -} - - -SWIGEXPORT jbyte JNICALL Java_SWIG_lldbJNI_ByteArray_1getitem(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - jbyte jresult = 0 ; - ByteArray *arg1 = (ByteArray *) 0 ; - int arg2 ; - jbyte result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(ByteArray **)&jarg1; - arg2 = (int)jarg2; - result = ByteArray_getitem(arg1,arg2); - jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_ByteArray_1setitem(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jbyte jarg3) { - ByteArray *arg1 = (ByteArray *) 0 ; - int arg2 ; - jbyte arg3 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(ByteArray **)&jarg1; - arg2 = (int)jarg2; - arg3 = jarg3; - ByteArray_setitem(arg1,arg2,SWIG_STD_MOVE(arg3)); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_ByteArray_1cast(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - ByteArray *arg1 = (ByteArray *) 0 ; - jbyte *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(ByteArray **)&jarg1; - result = (jbyte *)ByteArray_cast(arg1); - *(jbyte **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_ByteArray_1frompointer(JNIEnv *jenv, jclass jcls, jlong jarg1) { - jlong jresult = 0 ; - jbyte *arg1 = (jbyte *) 0 ; - ByteArray *result = 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(jbyte **)&jarg1; - result = (ByteArray *)ByteArray_frompointer(arg1); - *(ByteArray **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_INT32_1MAX_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)(2147483647); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_UINT32_1MAX_1get(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - unsigned int result; - - (void)jenv; - (void)jcls; - result = (unsigned int)(4294967295U); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_UINT64_1MAX_1get(JNIEnv *jenv, jclass jcls) { - jobject jresult = 0 ; - unsigned long long result; - - (void)jenv; - (void)jcls; - result = (unsigned long long)(18446744073709551615ULL); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_LLDB_1GENERIC_1ERROR_1get(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - unsigned int result; - - (void)jenv; - (void)jcls; - result = (unsigned int)(4294967295U); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_LLDB_1INVALID_1BREAK_1ID_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)(0); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_LLDB_1DEFAULT_1BREAK_1SIZE_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)(0); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_LLDB_1INVALID_1WATCH_1ID_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)(0); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_LLDB_1WATCH_1TYPE_1READ_1get(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - unsigned int result; - - (void)jenv; - (void)jcls; - result = (unsigned int)((1u << 0)); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_LLDB_1WATCH_1TYPE_1WRITE_1get(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - unsigned int result; - - (void)jenv; - (void)jcls; - result = (unsigned int)((1u << 1)); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_LLDB_1REGNUM_1GENERIC_1PC_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)(0); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_LLDB_1REGNUM_1GENERIC_1SP_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)(1); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_LLDB_1REGNUM_1GENERIC_1FP_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)(2); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_LLDB_1REGNUM_1GENERIC_1RA_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)(3); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_LLDB_1REGNUM_1GENERIC_1FLAGS_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)(4); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_LLDB_1REGNUM_1GENERIC_1ARG1_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)(5); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_LLDB_1REGNUM_1GENERIC_1ARG2_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)(6); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_LLDB_1REGNUM_1GENERIC_1ARG3_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)(7); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_LLDB_1REGNUM_1GENERIC_1ARG4_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)(8); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_LLDB_1REGNUM_1GENERIC_1ARG5_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)(9); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_LLDB_1REGNUM_1GENERIC_1ARG6_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)(10); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_LLDB_1REGNUM_1GENERIC_1ARG7_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)(11); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_LLDB_1REGNUM_1GENERIC_1ARG8_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)(12); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_LLDB_1INVALID_1STOP_1ID_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)(0); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_LLDB_1INVALID_1ADDRESS_1get(JNIEnv *jenv, jclass jcls) { - jobject jresult = 0 ; - unsigned long long result; - - (void)jenv; - (void)jcls; - result = (unsigned long long)(18446744073709551615ULL); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_LLDB_1INVALID_1INDEX32_1get(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - unsigned int result; - - (void)jenv; - (void)jcls; - result = (unsigned int)(4294967295U); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_LLDB_1INVALID_1IVAR_1OFFSET_1get(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - unsigned int result; - - (void)jenv; - (void)jcls; - result = (unsigned int)(4294967295U); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_LLDB_1INVALID_1IMAGE_1TOKEN_1get(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - unsigned int result; - - (void)jenv; - (void)jcls; - result = (unsigned int)(4294967295U); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_LLDB_1INVALID_1MODULE_1VERSION_1get(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - unsigned int result; - - (void)jenv; - (void)jcls; - result = (unsigned int)(4294967295U); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_LLDB_1INVALID_1REGNUM_1get(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - unsigned int result; - - (void)jenv; - (void)jcls; - result = (unsigned int)(4294967295U); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_LLDB_1INVALID_1UID_1get(JNIEnv *jenv, jclass jcls) { - jobject jresult = 0 ; - unsigned long long result; - - (void)jenv; - (void)jcls; - result = (unsigned long long)(18446744073709551615ULL); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_LLDB_1INVALID_1PROCESS_1ID_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)(0); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_LLDB_1INVALID_1THREAD_1ID_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)(0); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_LLDB_1INVALID_1FRAME_1ID_1get(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - unsigned int result; - - (void)jenv; - (void)jcls; - result = (unsigned int)(4294967295U); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_LLDB_1INVALID_1SIGNAL_1NUMBER_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)(2147483647); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_LLDB_1INVALID_1OFFSET_1get(JNIEnv *jenv, jclass jcls) { - jobject jresult = 0 ; - unsigned long long result; - - (void)jenv; - (void)jcls; - result = (unsigned long long)(18446744073709551615ULL); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_LLDB_1INVALID_1LINE_1NUMBER_1get(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - unsigned int result; - - (void)jenv; - (void)jcls; - result = (unsigned int)(4294967295U); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_LLDB_1INVALID_1COLUMN_1NUMBER_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)(0); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_LLDB_1INVALID_1QUEUE_1ID_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)(0); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_LLDB_1INVALID_1CPU_1ID_1get(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - unsigned int result; - - (void)jenv; - (void)jcls; - result = (unsigned int)(4294967295U); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_LLDB_1ARCH_1DEFAULT_1get(JNIEnv *jenv, jclass jcls) { - jstring jresult = 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - result = (char *)("systemArch"); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_LLDB_1ARCH_1DEFAULT_132BIT_1get(JNIEnv *jenv, jclass jcls) { - jstring jresult = 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - result = (char *)("systemArch32"); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_LLDB_1ARCH_1DEFAULT_164BIT_1get(JNIEnv *jenv, jclass jcls) { - jstring jresult = 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - result = (char *)("systemArch64"); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_LLDB_1INVALID_1CPUTYPE_1get(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - unsigned int result; - - (void)jenv; - (void)jcls; - result = (unsigned int)((0xFFFFFFFEu)); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_LLDB_1MAX_1NUM_1OPTION_1SETS_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)(32); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_LLDB_1OPT_1SET_1ALL_1get(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - unsigned int result; - - (void)jenv; - (void)jcls; - result = (unsigned int)(0xFFFFFFFFU); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_LLDB_1OPT_1SET_11_1get(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - unsigned int result; - - (void)jenv; - (void)jcls; - result = (unsigned int)((1U << 0)); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_LLDB_1OPT_1SET_12_1get(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - unsigned int result; - - (void)jenv; - (void)jcls; - result = (unsigned int)((1U << 1)); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_LLDB_1OPT_1SET_13_1get(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - unsigned int result; - - (void)jenv; - (void)jcls; - result = (unsigned int)((1U << 2)); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_LLDB_1OPT_1SET_14_1get(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - unsigned int result; - - (void)jenv; - (void)jcls; - result = (unsigned int)((1U << 3)); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_LLDB_1OPT_1SET_15_1get(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - unsigned int result; - - (void)jenv; - (void)jcls; - result = (unsigned int)((1U << 4)); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_LLDB_1OPT_1SET_16_1get(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - unsigned int result; - - (void)jenv; - (void)jcls; - result = (unsigned int)((1U << 5)); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_LLDB_1OPT_1SET_17_1get(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - unsigned int result; - - (void)jenv; - (void)jcls; - result = (unsigned int)((1U << 6)); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_LLDB_1OPT_1SET_18_1get(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - unsigned int result; - - (void)jenv; - (void)jcls; - result = (unsigned int)((1U << 7)); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_LLDB_1OPT_1SET_19_1get(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - unsigned int result; - - (void)jenv; - (void)jcls; - result = (unsigned int)((1U << 8)); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_LLDB_1OPT_1SET_110_1get(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - unsigned int result; - - (void)jenv; - (void)jcls; - result = (unsigned int)((1U << 9)); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_LLDB_1OPT_1SET_111_1get(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - unsigned int result; - - (void)jenv; - (void)jcls; - result = (unsigned int)((1U << 10)); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_LLDB_1OPT_1SET_112_1get(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - unsigned int result; - - (void)jenv; - (void)jcls; - result = (unsigned int)((1U << 11)); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eStateInvalid_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::StateType result; - - (void)jenv; - (void)jcls; - result = (lldb::StateType)lldb::eStateInvalid; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_kLastStateType_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::StateType result; - - (void)jenv; - (void)jcls; - result = (lldb::StateType)lldb::kLastStateType; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLaunchFlagNone_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LaunchFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::LaunchFlags)lldb::eLaunchFlagNone; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLaunchFlagExec_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LaunchFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::LaunchFlags)lldb::eLaunchFlagExec; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLaunchFlagDebug_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LaunchFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::LaunchFlags)lldb::eLaunchFlagDebug; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLaunchFlagStopAtEntry_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LaunchFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::LaunchFlags)lldb::eLaunchFlagStopAtEntry; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLaunchFlagDisableASLR_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LaunchFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::LaunchFlags)lldb::eLaunchFlagDisableASLR; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLaunchFlagDisableSTDIO_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LaunchFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::LaunchFlags)lldb::eLaunchFlagDisableSTDIO; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLaunchFlagLaunchInTTY_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LaunchFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::LaunchFlags)lldb::eLaunchFlagLaunchInTTY; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLaunchFlagLaunchInShell_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LaunchFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::LaunchFlags)lldb::eLaunchFlagLaunchInShell; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLaunchFlagLaunchInSeparateProcessGroup_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LaunchFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::LaunchFlags)lldb::eLaunchFlagLaunchInSeparateProcessGroup; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLaunchFlagDontSetExitStatus_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LaunchFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::LaunchFlags)lldb::eLaunchFlagDontSetExitStatus; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLaunchFlagDetachOnError_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LaunchFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::LaunchFlags)lldb::eLaunchFlagDetachOnError; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLaunchFlagShellExpandArguments_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LaunchFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::LaunchFlags)lldb::eLaunchFlagShellExpandArguments; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLaunchFlagCloseTTYOnExit_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LaunchFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::LaunchFlags)lldb::eLaunchFlagCloseTTYOnExit; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLaunchFlagInheritTCCFromParent_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LaunchFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::LaunchFlags)lldb::eLaunchFlagInheritTCCFromParent; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eByteOrderInvalid_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::ByteOrder result; - - (void)jenv; - (void)jcls; - result = (lldb::ByteOrder)lldb::eByteOrderInvalid; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eByteOrderBig_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::ByteOrder result; - - (void)jenv; - (void)jcls; - result = (lldb::ByteOrder)lldb::eByteOrderBig; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eByteOrderPDP_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::ByteOrder result; - - (void)jenv; - (void)jcls; - result = (lldb::ByteOrder)lldb::eByteOrderPDP; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eByteOrderLittle_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::ByteOrder result; - - (void)jenv; - (void)jcls; - result = (lldb::ByteOrder)lldb::eByteOrderLittle; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eEncodingInvalid_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::Encoding result; - - (void)jenv; - (void)jcls; - result = (lldb::Encoding)lldb::eEncodingInvalid; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eFormatDefault_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::Format result; - - (void)jenv; - (void)jcls; - result = (lldb::Format)lldb::eFormatDefault; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eFormatInvalid_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::Format result; - - (void)jenv; - (void)jcls; - result = (lldb::Format)lldb::eFormatInvalid; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eFormatComplexFloat_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::Format result; - - (void)jenv; - (void)jcls; - result = (lldb::Format)lldb::eFormatComplexFloat; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eDescriptionLevelBrief_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::DescriptionLevel result; - - (void)jenv; - (void)jcls; - result = (lldb::DescriptionLevel)lldb::eDescriptionLevelBrief; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eScriptLanguageNone_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::ScriptLanguage result; - - (void)jenv; - (void)jcls; - result = (lldb::ScriptLanguage)lldb::eScriptLanguageNone; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eScriptLanguageDefault_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::ScriptLanguage result; - - (void)jenv; - (void)jcls; - result = (lldb::ScriptLanguage)lldb::eScriptLanguageDefault; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eRegisterKindEHFrame_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::RegisterKind result; - - (void)jenv; - (void)jcls; - result = (lldb::RegisterKind)lldb::eRegisterKindEHFrame; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eStopReasonInvalid_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::StopReason result; - - (void)jenv; - (void)jcls; - result = (lldb::StopReason)lldb::eStopReasonInvalid; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eExpressionCompleted_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::ExpressionResults result; - - (void)jenv; - (void)jcls; - result = (lldb::ExpressionResults)lldb::eExpressionCompleted; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eSearchDepthInvalid_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::SearchDepth result; - - (void)jenv; - (void)jcls; - result = (lldb::SearchDepth)lldb::eSearchDepthInvalid; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_kLastSearchDepthKind_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::SearchDepth result; - - (void)jenv; - (void)jcls; - result = (lldb::SearchDepth)lldb::kLastSearchDepthKind; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eValueTypeInvalid_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::ValueType result; - - (void)jenv; - (void)jcls; - result = (lldb::ValueType)lldb::eValueTypeInvalid; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eValueTypeVariableGlobal_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::ValueType result; - - (void)jenv; - (void)jcls; - result = (lldb::ValueType)lldb::eValueTypeVariableGlobal; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eValueTypeVariableStatic_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::ValueType result; - - (void)jenv; - (void)jcls; - result = (lldb::ValueType)lldb::eValueTypeVariableStatic; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eValueTypeVariableArgument_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::ValueType result; - - (void)jenv; - (void)jcls; - result = (lldb::ValueType)lldb::eValueTypeVariableArgument; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eValueTypeVariableLocal_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::ValueType result; - - (void)jenv; - (void)jcls; - result = (lldb::ValueType)lldb::eValueTypeVariableLocal; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eValueTypeRegister_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::ValueType result; - - (void)jenv; - (void)jcls; - result = (lldb::ValueType)lldb::eValueTypeRegister; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eValueTypeRegisterSet_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::ValueType result; - - (void)jenv; - (void)jcls; - result = (lldb::ValueType)lldb::eValueTypeRegisterSet; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eValueTypeConstResult_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::ValueType result; - - (void)jenv; - (void)jcls; - result = (lldb::ValueType)lldb::eValueTypeConstResult; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eValueTypeVariableThreadLocal_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::ValueType result; - - (void)jenv; - (void)jcls; - result = (lldb::ValueType)lldb::eValueTypeVariableThreadLocal; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eInputReaderGranularityInvalid_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::InputReaderGranularity result; - - (void)jenv; - (void)jcls; - result = (lldb::InputReaderGranularity)lldb::eInputReaderGranularityInvalid; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eSymbolContextTarget_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::SymbolContextItem result; - - (void)jenv; - (void)jcls; - result = (lldb::SymbolContextItem)lldb::eSymbolContextTarget; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eSymbolContextModule_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::SymbolContextItem result; - - (void)jenv; - (void)jcls; - result = (lldb::SymbolContextItem)lldb::eSymbolContextModule; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eSymbolContextCompUnit_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::SymbolContextItem result; - - (void)jenv; - (void)jcls; - result = (lldb::SymbolContextItem)lldb::eSymbolContextCompUnit; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eSymbolContextFunction_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::SymbolContextItem result; - - (void)jenv; - (void)jcls; - result = (lldb::SymbolContextItem)lldb::eSymbolContextFunction; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eSymbolContextBlock_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::SymbolContextItem result; - - (void)jenv; - (void)jcls; - result = (lldb::SymbolContextItem)lldb::eSymbolContextBlock; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eSymbolContextLineEntry_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::SymbolContextItem result; - - (void)jenv; - (void)jcls; - result = (lldb::SymbolContextItem)lldb::eSymbolContextLineEntry; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eSymbolContextSymbol_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::SymbolContextItem result; - - (void)jenv; - (void)jcls; - result = (lldb::SymbolContextItem)lldb::eSymbolContextSymbol; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eSymbolContextEverything_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::SymbolContextItem result; - - (void)jenv; - (void)jcls; - result = (lldb::SymbolContextItem)lldb::eSymbolContextEverything; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eSymbolContextVariable_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::SymbolContextItem result; - - (void)jenv; - (void)jcls; - result = (lldb::SymbolContextItem)lldb::eSymbolContextVariable; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eSymbolContextLastItem_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::SymbolContextItem result; - - (void)jenv; - (void)jcls; - result = (lldb::SymbolContextItem)lldb::eSymbolContextLastItem; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_ePermissionsWritable_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::Permissions result; - - (void)jenv; - (void)jcls; - result = (lldb::Permissions)lldb::ePermissionsWritable; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_ePermissionsReadable_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::Permissions result; - - (void)jenv; - (void)jcls; - result = (lldb::Permissions)lldb::ePermissionsReadable; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_ePermissionsExecutable_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::Permissions result; - - (void)jenv; - (void)jcls; - result = (lldb::Permissions)lldb::ePermissionsExecutable; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eBreakpointEventTypeInvalidType_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::BreakpointEventType result; - - (void)jenv; - (void)jcls; - result = (lldb::BreakpointEventType)lldb::eBreakpointEventTypeInvalidType; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eBreakpointEventTypeAdded_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::BreakpointEventType result; - - (void)jenv; - (void)jcls; - result = (lldb::BreakpointEventType)lldb::eBreakpointEventTypeAdded; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eBreakpointEventTypeRemoved_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::BreakpointEventType result; - - (void)jenv; - (void)jcls; - result = (lldb::BreakpointEventType)lldb::eBreakpointEventTypeRemoved; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eBreakpointEventTypeLocationsAdded_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::BreakpointEventType result; - - (void)jenv; - (void)jcls; - result = (lldb::BreakpointEventType)lldb::eBreakpointEventTypeLocationsAdded; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eBreakpointEventTypeLocationsRemoved_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::BreakpointEventType result; - - (void)jenv; - (void)jcls; - result = (lldb::BreakpointEventType)lldb::eBreakpointEventTypeLocationsRemoved; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eBreakpointEventTypeLocationsResolved_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::BreakpointEventType result; - - (void)jenv; - (void)jcls; - result = (lldb::BreakpointEventType)lldb::eBreakpointEventTypeLocationsResolved; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eBreakpointEventTypeEnabled_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::BreakpointEventType result; - - (void)jenv; - (void)jcls; - result = (lldb::BreakpointEventType)lldb::eBreakpointEventTypeEnabled; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eBreakpointEventTypeDisabled_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::BreakpointEventType result; - - (void)jenv; - (void)jcls; - result = (lldb::BreakpointEventType)lldb::eBreakpointEventTypeDisabled; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eBreakpointEventTypeCommandChanged_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::BreakpointEventType result; - - (void)jenv; - (void)jcls; - result = (lldb::BreakpointEventType)lldb::eBreakpointEventTypeCommandChanged; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eBreakpointEventTypeConditionChanged_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::BreakpointEventType result; - - (void)jenv; - (void)jcls; - result = (lldb::BreakpointEventType)lldb::eBreakpointEventTypeConditionChanged; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eBreakpointEventTypeIgnoreChanged_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::BreakpointEventType result; - - (void)jenv; - (void)jcls; - result = (lldb::BreakpointEventType)lldb::eBreakpointEventTypeIgnoreChanged; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eBreakpointEventTypeThreadChanged_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::BreakpointEventType result; - - (void)jenv; - (void)jcls; - result = (lldb::BreakpointEventType)lldb::eBreakpointEventTypeThreadChanged; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eBreakpointEventTypeAutoContinueChanged_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::BreakpointEventType result; - - (void)jenv; - (void)jcls; - result = (lldb::BreakpointEventType)lldb::eBreakpointEventTypeAutoContinueChanged; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eWatchpointEventTypeInvalidType_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::WatchpointEventType result; - - (void)jenv; - (void)jcls; - result = (lldb::WatchpointEventType)lldb::eWatchpointEventTypeInvalidType; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eWatchpointEventTypeAdded_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::WatchpointEventType result; - - (void)jenv; - (void)jcls; - result = (lldb::WatchpointEventType)lldb::eWatchpointEventTypeAdded; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eWatchpointEventTypeRemoved_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::WatchpointEventType result; - - (void)jenv; - (void)jcls; - result = (lldb::WatchpointEventType)lldb::eWatchpointEventTypeRemoved; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eWatchpointEventTypeEnabled_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::WatchpointEventType result; - - (void)jenv; - (void)jcls; - result = (lldb::WatchpointEventType)lldb::eWatchpointEventTypeEnabled; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eWatchpointEventTypeDisabled_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::WatchpointEventType result; - - (void)jenv; - (void)jcls; - result = (lldb::WatchpointEventType)lldb::eWatchpointEventTypeDisabled; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eWatchpointEventTypeCommandChanged_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::WatchpointEventType result; - - (void)jenv; - (void)jcls; - result = (lldb::WatchpointEventType)lldb::eWatchpointEventTypeCommandChanged; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eWatchpointEventTypeConditionChanged_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::WatchpointEventType result; - - (void)jenv; - (void)jcls; - result = (lldb::WatchpointEventType)lldb::eWatchpointEventTypeConditionChanged; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eWatchpointEventTypeIgnoreChanged_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::WatchpointEventType result; - - (void)jenv; - (void)jcls; - result = (lldb::WatchpointEventType)lldb::eWatchpointEventTypeIgnoreChanged; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eWatchpointEventTypeThreadChanged_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::WatchpointEventType result; - - (void)jenv; - (void)jcls; - result = (lldb::WatchpointEventType)lldb::eWatchpointEventTypeThreadChanged; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eWatchpointEventTypeTypeChanged_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::WatchpointEventType result; - - (void)jenv; - (void)jcls; - result = (lldb::WatchpointEventType)lldb::eWatchpointEventTypeTypeChanged; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeUnknown_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeUnknown; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeC89_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeC89; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeC_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeC; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeAda83_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeAda83; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeC_1plus_1plus_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeC_plus_plus; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeCobol74_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeCobol74; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeCobol85_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeCobol85; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeFortran77_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeFortran77; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeFortran90_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeFortran90; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypePascal83_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypePascal83; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeModula2_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeModula2; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeJava_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeJava; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeC99_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeC99; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeAda95_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeAda95; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeFortran95_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeFortran95; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypePLI_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypePLI; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeObjC_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeObjC; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeObjC_1plus_1plus_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeObjC_plus_plus; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeUPC_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeUPC; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeD_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeD; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypePython_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypePython; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeOpenCL_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeOpenCL; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeGo_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeGo; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeModula3_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeModula3; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeHaskell_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeHaskell; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeC_1plus_1plus_103_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeC_plus_plus_03; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeC_1plus_1plus_111_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeC_plus_plus_11; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeOCaml_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeOCaml; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeRust_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeRust; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeC11_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeC11; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeSwift_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeSwift; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeJulia_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeJulia; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeDylan_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeDylan; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeC_1plus_1plus_114_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeC_plus_plus_14; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeFortran03_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeFortran03; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeFortran08_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeFortran08; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeRenderScript_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeRenderScript; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeBLISS_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeBLISS; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeKotlin_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeKotlin; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeZig_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeZig; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeCrystal_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeCrystal; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeC_1plus_1plus_117_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeC_plus_plus_17; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeC_1plus_1plus_120_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeC_plus_plus_20; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeC17_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeC17; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeFortran18_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeFortran18; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeAda2005_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeAda2005; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeAda2012_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeAda2012; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeHIP_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeHIP; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeAssembly_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeAssembly; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeC_1sharp_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeC_sharp; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLanguageTypeMojo_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - result = (lldb::LanguageType)lldb::eLanguageTypeMojo; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eInstrumentationRuntimeTypeAddressSanitizer_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::InstrumentationRuntimeType result; - - (void)jenv; - (void)jcls; - result = (lldb::InstrumentationRuntimeType)lldb::eInstrumentationRuntimeTypeAddressSanitizer; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eInstrumentationRuntimeTypeThreadSanitizer_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::InstrumentationRuntimeType result; - - (void)jenv; - (void)jcls; - result = (lldb::InstrumentationRuntimeType)lldb::eInstrumentationRuntimeTypeThreadSanitizer; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eInstrumentationRuntimeTypeUndefinedBehaviorSanitizer_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::InstrumentationRuntimeType result; - - (void)jenv; - (void)jcls; - result = (lldb::InstrumentationRuntimeType)lldb::eInstrumentationRuntimeTypeUndefinedBehaviorSanitizer; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eInstrumentationRuntimeTypeMainThreadChecker_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::InstrumentationRuntimeType result; - - (void)jenv; - (void)jcls; - result = (lldb::InstrumentationRuntimeType)lldb::eInstrumentationRuntimeTypeMainThreadChecker; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eInstrumentationRuntimeTypeSwiftRuntimeReporting_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::InstrumentationRuntimeType result; - - (void)jenv; - (void)jcls; - result = (lldb::InstrumentationRuntimeType)lldb::eInstrumentationRuntimeTypeSwiftRuntimeReporting; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eNoDynamicValues_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::DynamicValueType result; - - (void)jenv; - (void)jcls; - result = (lldb::DynamicValueType)lldb::eNoDynamicValues; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eDynamicCanRunTarget_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::DynamicValueType result; - - (void)jenv; - (void)jcls; - result = (lldb::DynamicValueType)lldb::eDynamicCanRunTarget; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eDynamicDontRunTarget_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::DynamicValueType result; - - (void)jenv; - (void)jcls; - result = (lldb::DynamicValueType)lldb::eDynamicDontRunTarget; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eStopShowColumnAnsiOrCaret_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::StopShowColumn result; - - (void)jenv; - (void)jcls; - result = (lldb::StopShowColumn)lldb::eStopShowColumnAnsiOrCaret; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eStopShowColumnAnsi_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::StopShowColumn result; - - (void)jenv; - (void)jcls; - result = (lldb::StopShowColumn)lldb::eStopShowColumnAnsi; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eStopShowColumnCaret_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::StopShowColumn result; - - (void)jenv; - (void)jcls; - result = (lldb::StopShowColumn)lldb::eStopShowColumnCaret; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eStopShowColumnNone_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::StopShowColumn result; - - (void)jenv; - (void)jcls; - result = (lldb::StopShowColumn)lldb::eStopShowColumnNone; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eArgTypeAddress_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::CommandArgumentType result; - - (void)jenv; - (void)jcls; - result = (lldb::CommandArgumentType)lldb::eArgTypeAddress; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eSymbolTypeAny_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::SymbolType result; - - (void)jenv; - (void)jcls; - result = (lldb::SymbolType)lldb::eSymbolTypeAny; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eSymbolTypeInvalid_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::SymbolType result; - - (void)jenv; - (void)jcls; - result = (lldb::SymbolType)lldb::eSymbolTypeInvalid; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eEmulateInstructionOptionNone_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::EmulateInstructionOptions result; - - (void)jenv; - (void)jcls; - result = (lldb::EmulateInstructionOptions)lldb::eEmulateInstructionOptionNone; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eEmulateInstructionOptionAutoAdvancePC_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::EmulateInstructionOptions result; - - (void)jenv; - (void)jcls; - result = (lldb::EmulateInstructionOptions)lldb::eEmulateInstructionOptionAutoAdvancePC; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eEmulateInstructionOptionIgnoreConditions_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::EmulateInstructionOptions result; - - (void)jenv; - (void)jcls; - result = (lldb::EmulateInstructionOptions)lldb::eEmulateInstructionOptionIgnoreConditions; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eFunctionNameTypeNone_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::FunctionNameType result; - - (void)jenv; - (void)jcls; - result = (lldb::FunctionNameType)lldb::eFunctionNameTypeNone; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eFunctionNameTypeAuto_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::FunctionNameType result; - - (void)jenv; - (void)jcls; - result = (lldb::FunctionNameType)lldb::eFunctionNameTypeAuto; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eFunctionNameTypeFull_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::FunctionNameType result; - - (void)jenv; - (void)jcls; - result = (lldb::FunctionNameType)lldb::eFunctionNameTypeFull; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eFunctionNameTypeBase_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::FunctionNameType result; - - (void)jenv; - (void)jcls; - result = (lldb::FunctionNameType)lldb::eFunctionNameTypeBase; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eFunctionNameTypeMethod_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::FunctionNameType result; - - (void)jenv; - (void)jcls; - result = (lldb::FunctionNameType)lldb::eFunctionNameTypeMethod; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eFunctionNameTypeSelector_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::FunctionNameType result; - - (void)jenv; - (void)jcls; - result = (lldb::FunctionNameType)lldb::eFunctionNameTypeSelector; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eFunctionNameTypeAny_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::FunctionNameType result; - - (void)jenv; - (void)jcls; - result = (lldb::FunctionNameType)lldb::eFunctionNameTypeAny; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eBasicTypeInvalid_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::BasicType result; - - (void)jenv; - (void)jcls; - result = (lldb::BasicType)lldb::eBasicTypeInvalid; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eBasicTypeVoid_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::BasicType result; - - (void)jenv; - (void)jcls; - result = (lldb::BasicType)lldb::eBasicTypeVoid; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTraceTypeNone_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TraceType result; - - (void)jenv; - (void)jcls; - result = (lldb::TraceType)lldb::eTraceTypeNone; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eStructuredDataTypeInvalid_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::StructuredDataType result; - - (void)jenv; - (void)jcls; - result = (lldb::StructuredDataType)lldb::eStructuredDataTypeInvalid; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eStructuredDataTypeNull_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::StructuredDataType result; - - (void)jenv; - (void)jcls; - result = (lldb::StructuredDataType)lldb::eStructuredDataTypeNull; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eStructuredDataTypeUnsignedInteger_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::StructuredDataType result; - - (void)jenv; - (void)jcls; - result = (lldb::StructuredDataType)lldb::eStructuredDataTypeUnsignedInteger; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeClassInvalid_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeClass result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeClass)lldb::eTypeClassInvalid; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeClassArray_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeClass result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeClass)lldb::eTypeClassArray; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeClassBlockPointer_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeClass result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeClass)lldb::eTypeClassBlockPointer; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeClassBuiltin_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeClass result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeClass)lldb::eTypeClassBuiltin; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeClassClass_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeClass result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeClass)lldb::eTypeClassClass; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeClassComplexFloat_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeClass result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeClass)lldb::eTypeClassComplexFloat; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeClassComplexInteger_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeClass result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeClass)lldb::eTypeClassComplexInteger; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeClassEnumeration_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeClass result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeClass)lldb::eTypeClassEnumeration; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeClassFunction_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeClass result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeClass)lldb::eTypeClassFunction; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeClassMemberPointer_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeClass result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeClass)lldb::eTypeClassMemberPointer; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeClassObjCObject_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeClass result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeClass)lldb::eTypeClassObjCObject; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeClassObjCInterface_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeClass result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeClass)lldb::eTypeClassObjCInterface; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeClassObjCObjectPointer_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeClass result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeClass)lldb::eTypeClassObjCObjectPointer; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeClassPointer_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeClass result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeClass)lldb::eTypeClassPointer; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeClassReference_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeClass result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeClass)lldb::eTypeClassReference; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeClassStruct_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeClass result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeClass)lldb::eTypeClassStruct; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeClassTypedef_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeClass result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeClass)lldb::eTypeClassTypedef; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeClassUnion_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeClass result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeClass)lldb::eTypeClassUnion; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeClassVector_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeClass result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeClass)lldb::eTypeClassVector; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeClassOther_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeClass result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeClass)lldb::eTypeClassOther; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeClassAny_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeClass result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeClass)lldb::eTypeClassAny; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTemplateArgumentKindNull_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TemplateArgumentKind result; - - (void)jenv; - (void)jcls; - result = (lldb::TemplateArgumentKind)lldb::eTemplateArgumentKindNull; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eLastFormatterMatchType_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::FormatterMatchType result; - - (void)jenv; - (void)jcls; - result = (lldb::FormatterMatchType)lldb::eLastFormatterMatchType; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeOptionNone_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeOptions result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeOptions)lldb::eTypeOptionNone; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeOptionCascade_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeOptions result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeOptions)lldb::eTypeOptionCascade; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeOptionSkipPointers_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeOptions result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeOptions)lldb::eTypeOptionSkipPointers; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeOptionSkipReferences_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeOptions result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeOptions)lldb::eTypeOptionSkipReferences; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeOptionHideChildren_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeOptions result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeOptions)lldb::eTypeOptionHideChildren; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeOptionHideValue_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeOptions result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeOptions)lldb::eTypeOptionHideValue; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeOptionShowOneLiner_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeOptions result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeOptions)lldb::eTypeOptionShowOneLiner; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeOptionHideNames_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeOptions result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeOptions)lldb::eTypeOptionHideNames; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeOptionNonCacheable_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeOptions result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeOptions)lldb::eTypeOptionNonCacheable; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeOptionHideEmptyAggregates_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeOptions result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeOptions)lldb::eTypeOptionHideEmptyAggregates; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeOptionFrontEndWantsDereference_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeOptions result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeOptions)lldb::eTypeOptionFrontEndWantsDereference; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eFilePermissionsUserRead_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::FilePermissions result; - - (void)jenv; - (void)jcls; - result = (lldb::FilePermissions)lldb::eFilePermissionsUserRead; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eFilePermissionsUserWrite_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::FilePermissions result; - - (void)jenv; - (void)jcls; - result = (lldb::FilePermissions)lldb::eFilePermissionsUserWrite; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eFilePermissionsUserExecute_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::FilePermissions result; - - (void)jenv; - (void)jcls; - result = (lldb::FilePermissions)lldb::eFilePermissionsUserExecute; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eFilePermissionsGroupRead_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::FilePermissions result; - - (void)jenv; - (void)jcls; - result = (lldb::FilePermissions)lldb::eFilePermissionsGroupRead; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eFilePermissionsGroupWrite_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::FilePermissions result; - - (void)jenv; - (void)jcls; - result = (lldb::FilePermissions)lldb::eFilePermissionsGroupWrite; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eFilePermissionsGroupExecute_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::FilePermissions result; - - (void)jenv; - (void)jcls; - result = (lldb::FilePermissions)lldb::eFilePermissionsGroupExecute; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eFilePermissionsWorldRead_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::FilePermissions result; - - (void)jenv; - (void)jcls; - result = (lldb::FilePermissions)lldb::eFilePermissionsWorldRead; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eFilePermissionsWorldWrite_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::FilePermissions result; - - (void)jenv; - (void)jcls; - result = (lldb::FilePermissions)lldb::eFilePermissionsWorldWrite; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eFilePermissionsWorldExecute_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::FilePermissions result; - - (void)jenv; - (void)jcls; - result = (lldb::FilePermissions)lldb::eFilePermissionsWorldExecute; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eFilePermissionsUserRW_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::FilePermissions result; - - (void)jenv; - (void)jcls; - result = (lldb::FilePermissions)lldb::eFilePermissionsUserRW; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eFileFilePermissionsUserRX_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::FilePermissions result; - - (void)jenv; - (void)jcls; - result = (lldb::FilePermissions)lldb::eFileFilePermissionsUserRX; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eFilePermissionsUserRWX_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::FilePermissions result; - - (void)jenv; - (void)jcls; - result = (lldb::FilePermissions)lldb::eFilePermissionsUserRWX; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eFilePermissionsGroupRW_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::FilePermissions result; - - (void)jenv; - (void)jcls; - result = (lldb::FilePermissions)lldb::eFilePermissionsGroupRW; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eFilePermissionsGroupRX_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::FilePermissions result; - - (void)jenv; - (void)jcls; - result = (lldb::FilePermissions)lldb::eFilePermissionsGroupRX; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eFilePermissionsGroupRWX_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::FilePermissions result; - - (void)jenv; - (void)jcls; - result = (lldb::FilePermissions)lldb::eFilePermissionsGroupRWX; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eFilePermissionsWorldRW_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::FilePermissions result; - - (void)jenv; - (void)jcls; - result = (lldb::FilePermissions)lldb::eFilePermissionsWorldRW; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eFilePermissionsWorldRX_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::FilePermissions result; - - (void)jenv; - (void)jcls; - result = (lldb::FilePermissions)lldb::eFilePermissionsWorldRX; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eFilePermissionsWorldRWX_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::FilePermissions result; - - (void)jenv; - (void)jcls; - result = (lldb::FilePermissions)lldb::eFilePermissionsWorldRWX; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eFilePermissionsEveryoneR_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::FilePermissions result; - - (void)jenv; - (void)jcls; - result = (lldb::FilePermissions)lldb::eFilePermissionsEveryoneR; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eFilePermissionsEveryoneW_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::FilePermissions result; - - (void)jenv; - (void)jcls; - result = (lldb::FilePermissions)lldb::eFilePermissionsEveryoneW; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eFilePermissionsEveryoneX_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::FilePermissions result; - - (void)jenv; - (void)jcls; - result = (lldb::FilePermissions)lldb::eFilePermissionsEveryoneX; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eFilePermissionsEveryoneRW_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::FilePermissions result; - - (void)jenv; - (void)jcls; - result = (lldb::FilePermissions)lldb::eFilePermissionsEveryoneRW; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eFilePermissionsEveryoneRX_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::FilePermissions result; - - (void)jenv; - (void)jcls; - result = (lldb::FilePermissions)lldb::eFilePermissionsEveryoneRX; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eFilePermissionsEveryoneRWX_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::FilePermissions result; - - (void)jenv; - (void)jcls; - result = (lldb::FilePermissions)lldb::eFilePermissionsEveryoneRWX; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eFilePermissionsFileDefault_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::FilePermissions result; - - (void)jenv; - (void)jcls; - result = (lldb::FilePermissions)lldb::eFilePermissionsFileDefault; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eFilePermissionsDirectoryDefault_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::FilePermissions result; - - (void)jenv; - (void)jcls; - result = (lldb::FilePermissions)lldb::eFilePermissionsDirectoryDefault; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eQueueItemKindUnknown_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::QueueItemKind result; - - (void)jenv; - (void)jcls; - result = (lldb::QueueItemKind)lldb::eQueueItemKindUnknown; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eQueueKindUnknown_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::QueueKind result; - - (void)jenv; - (void)jcls; - result = (lldb::QueueKind)lldb::eQueueKindUnknown; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eExpressionEvaluationParse_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::ExpressionEvaluationPhase result; - - (void)jenv; - (void)jcls; - result = (lldb::ExpressionEvaluationPhase)lldb::eExpressionEvaluationParse; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eInstructionControlFlowKindUnknown_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::InstructionControlFlowKind result; - - (void)jenv; - (void)jcls; - result = (lldb::InstructionControlFlowKind)lldb::eInstructionControlFlowKindUnknown; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eWatchpointKindWrite_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::WatchpointKind result; - - (void)jenv; - (void)jcls; - result = (lldb::WatchpointKind)lldb::eWatchpointKindWrite; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eWatchpointKindRead_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::WatchpointKind result; - - (void)jenv; - (void)jcls; - result = (lldb::WatchpointKind)lldb::eWatchpointKindRead; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eGdbSignalBadAccess_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::GdbSignal result; - - (void)jenv; - (void)jcls; - result = (lldb::GdbSignal)lldb::eGdbSignalBadAccess; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eGdbSignalBadInstruction_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::GdbSignal result; - - (void)jenv; - (void)jcls; - result = (lldb::GdbSignal)lldb::eGdbSignalBadInstruction; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eGdbSignalArithmetic_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::GdbSignal result; - - (void)jenv; - (void)jcls; - result = (lldb::GdbSignal)lldb::eGdbSignalArithmetic; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eGdbSignalEmulation_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::GdbSignal result; - - (void)jenv; - (void)jcls; - result = (lldb::GdbSignal)lldb::eGdbSignalEmulation; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eGdbSignalSoftware_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::GdbSignal result; - - (void)jenv; - (void)jcls; - result = (lldb::GdbSignal)lldb::eGdbSignalSoftware; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eGdbSignalBreakpoint_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::GdbSignal result; - - (void)jenv; - (void)jcls; - result = (lldb::GdbSignal)lldb::eGdbSignalBreakpoint; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eMemberFunctionKindUnknown_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::MemberFunctionKind result; - - (void)jenv; - (void)jcls; - result = (lldb::MemberFunctionKind)lldb::eMemberFunctionKindUnknown; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeHasChildren_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeFlags)lldb::eTypeHasChildren; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeHasValue_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeFlags)lldb::eTypeHasValue; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeIsArray_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeFlags)lldb::eTypeIsArray; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeIsBlock_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeFlags)lldb::eTypeIsBlock; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeIsBuiltIn_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeFlags)lldb::eTypeIsBuiltIn; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeIsClass_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeFlags)lldb::eTypeIsClass; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeIsCPlusPlus_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeFlags)lldb::eTypeIsCPlusPlus; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeIsEnumeration_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeFlags)lldb::eTypeIsEnumeration; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeIsFuncPrototype_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeFlags)lldb::eTypeIsFuncPrototype; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeIsMember_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeFlags)lldb::eTypeIsMember; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeIsObjC_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeFlags)lldb::eTypeIsObjC; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeIsPointer_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeFlags)lldb::eTypeIsPointer; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeIsReference_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeFlags)lldb::eTypeIsReference; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeIsStructUnion_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeFlags)lldb::eTypeIsStructUnion; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeIsTemplate_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeFlags)lldb::eTypeIsTemplate; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeIsTypedef_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeFlags)lldb::eTypeIsTypedef; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeIsVector_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeFlags)lldb::eTypeIsVector; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeIsScalar_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeFlags)lldb::eTypeIsScalar; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeIsInteger_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeFlags)lldb::eTypeIsInteger; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeIsFloat_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeFlags)lldb::eTypeIsFloat; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeIsComplex_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeFlags)lldb::eTypeIsComplex; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeIsSigned_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeFlags)lldb::eTypeIsSigned; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeInstanceIsPointer_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeFlags)lldb::eTypeInstanceIsPointer; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eCommandRequiresTarget_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::CommandFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::CommandFlags)lldb::eCommandRequiresTarget; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eCommandRequiresProcess_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::CommandFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::CommandFlags)lldb::eCommandRequiresProcess; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eCommandRequiresThread_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::CommandFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::CommandFlags)lldb::eCommandRequiresThread; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eCommandRequiresFrame_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::CommandFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::CommandFlags)lldb::eCommandRequiresFrame; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eCommandRequiresRegContext_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::CommandFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::CommandFlags)lldb::eCommandRequiresRegContext; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eCommandTryTargetAPILock_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::CommandFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::CommandFlags)lldb::eCommandTryTargetAPILock; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eCommandProcessMustBeLaunched_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::CommandFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::CommandFlags)lldb::eCommandProcessMustBeLaunched; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eCommandProcessMustBePaused_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::CommandFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::CommandFlags)lldb::eCommandProcessMustBePaused; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eCommandProcessMustBeTraced_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::CommandFlags result; - - (void)jenv; - (void)jcls; - result = (lldb::CommandFlags)lldb::eCommandProcessMustBeTraced; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeSummaryCapped_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeSummaryCapping result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeSummaryCapping)lldb::eTypeSummaryCapped; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeSummaryUncapped_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TypeSummaryCapping result; - - (void)jenv; - (void)jcls; - result = (lldb::TypeSummaryCapping)lldb::eTypeSummaryUncapped; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eSaveCoreUnspecified_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::SaveCoreStyle result; - - (void)jenv; - (void)jcls; - result = (lldb::SaveCoreStyle)lldb::eSaveCoreUnspecified; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eSaveCoreFull_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::SaveCoreStyle result; - - (void)jenv; - (void)jcls; - result = (lldb::SaveCoreStyle)lldb::eSaveCoreFull; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eSaveCoreDirtyOnly_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::SaveCoreStyle result; - - (void)jenv; - (void)jcls; - result = (lldb::SaveCoreStyle)lldb::eSaveCoreDirtyOnly; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eSaveCoreStackOnly_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::SaveCoreStyle result; - - (void)jenv; - (void)jcls; - result = (lldb::SaveCoreStyle)lldb::eSaveCoreStackOnly; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTraceItemKindError_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TraceItemKind result; - - (void)jenv; - (void)jcls; - result = (lldb::TraceItemKind)lldb::eTraceItemKindError; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTraceCursorSeekTypeBeginning_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::TraceCursorSeekType result; - - (void)jenv; - (void)jcls; - result = (lldb::TraceCursorSeekType)lldb::eTraceCursorSeekTypeBeginning; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eWatchPointValueKindInvalid_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::WatchpointValueKind result; - - (void)jenv; - (void)jcls; - result = (lldb::WatchpointValueKind)lldb::eWatchPointValueKindInvalid; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eWatchPointValueKindVariable_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::WatchpointValueKind result; - - (void)jenv; - (void)jcls; - result = (lldb::WatchpointValueKind)lldb::eWatchPointValueKindVariable; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eWatchPointValueKindExpression_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::WatchpointValueKind result; - - (void)jenv; - (void)jcls; - result = (lldb::WatchpointValueKind)lldb::eWatchPointValueKindExpression; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eNoCompletion_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::CompletionType result; - - (void)jenv; - (void)jcls; - result = (lldb::CompletionType)lldb::eNoCompletion; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eSourceFileCompletion_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::CompletionType result; - - (void)jenv; - (void)jcls; - result = (lldb::CompletionType)lldb::eSourceFileCompletion; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eDiskFileCompletion_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::CompletionType result; - - (void)jenv; - (void)jcls; - result = (lldb::CompletionType)lldb::eDiskFileCompletion; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eDiskDirectoryCompletion_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::CompletionType result; - - (void)jenv; - (void)jcls; - result = (lldb::CompletionType)lldb::eDiskDirectoryCompletion; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eSymbolCompletion_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::CompletionType result; - - (void)jenv; - (void)jcls; - result = (lldb::CompletionType)lldb::eSymbolCompletion; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eModuleCompletion_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::CompletionType result; - - (void)jenv; - (void)jcls; - result = (lldb::CompletionType)lldb::eModuleCompletion; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eSettingsNameCompletion_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::CompletionType result; - - (void)jenv; - (void)jcls; - result = (lldb::CompletionType)lldb::eSettingsNameCompletion; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_ePlatformPluginCompletion_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::CompletionType result; - - (void)jenv; - (void)jcls; - result = (lldb::CompletionType)lldb::ePlatformPluginCompletion; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eArchitectureCompletion_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::CompletionType result; - - (void)jenv; - (void)jcls; - result = (lldb::CompletionType)lldb::eArchitectureCompletion; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eVariablePathCompletion_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::CompletionType result; - - (void)jenv; - (void)jcls; - result = (lldb::CompletionType)lldb::eVariablePathCompletion; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eRegisterCompletion_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::CompletionType result; - - (void)jenv; - (void)jcls; - result = (lldb::CompletionType)lldb::eRegisterCompletion; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eBreakpointCompletion_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::CompletionType result; - - (void)jenv; - (void)jcls; - result = (lldb::CompletionType)lldb::eBreakpointCompletion; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eProcessPluginCompletion_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::CompletionType result; - - (void)jenv; - (void)jcls; - result = (lldb::CompletionType)lldb::eProcessPluginCompletion; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eDisassemblyFlavorCompletion_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::CompletionType result; - - (void)jenv; - (void)jcls; - result = (lldb::CompletionType)lldb::eDisassemblyFlavorCompletion; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeLanguageCompletion_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::CompletionType result; - - (void)jenv; - (void)jcls; - result = (lldb::CompletionType)lldb::eTypeLanguageCompletion; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eFrameIndexCompletion_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::CompletionType result; - - (void)jenv; - (void)jcls; - result = (lldb::CompletionType)lldb::eFrameIndexCompletion; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eModuleUUIDCompletion_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::CompletionType result; - - (void)jenv; - (void)jcls; - result = (lldb::CompletionType)lldb::eModuleUUIDCompletion; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eStopHookIDCompletion_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::CompletionType result; - - (void)jenv; - (void)jcls; - result = (lldb::CompletionType)lldb::eStopHookIDCompletion; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eThreadIndexCompletion_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::CompletionType result; - - (void)jenv; - (void)jcls; - result = (lldb::CompletionType)lldb::eThreadIndexCompletion; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eWatchpointIDCompletion_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::CompletionType result; - - (void)jenv; - (void)jcls; - result = (lldb::CompletionType)lldb::eWatchpointIDCompletion; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eBreakpointNameCompletion_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::CompletionType result; - - (void)jenv; - (void)jcls; - result = (lldb::CompletionType)lldb::eBreakpointNameCompletion; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eProcessIDCompletion_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::CompletionType result; - - (void)jenv; - (void)jcls; - result = (lldb::CompletionType)lldb::eProcessIDCompletion; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eProcessNameCompletion_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::CompletionType result; - - (void)jenv; - (void)jcls; - result = (lldb::CompletionType)lldb::eProcessNameCompletion; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eRemoteDiskFileCompletion_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::CompletionType result; - - (void)jenv; - (void)jcls; - result = (lldb::CompletionType)lldb::eRemoteDiskFileCompletion; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eRemoteDiskDirectoryCompletion_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::CompletionType result; - - (void)jenv; - (void)jcls; - result = (lldb::CompletionType)lldb::eRemoteDiskDirectoryCompletion; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eTypeCategoryNameCompletion_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::CompletionType result; - - (void)jenv; - (void)jcls; - result = (lldb::CompletionType)lldb::eTypeCategoryNameCompletion; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_eCustomCompletion_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - lldb::CompletionType result; - - (void)jenv; - (void)jcls; - result = (lldb::CompletionType)lldb::eCustomCompletion; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBAddress_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBAddress *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBAddress *)new lldb::SBAddress(); - *(lldb::SBAddress **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBAddress_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBAddress *arg1 = 0 ; - lldb::SBAddress *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAddress **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBAddress const & is null"); - return 0; - } - result = (lldb::SBAddress *)new lldb::SBAddress((lldb::SBAddress const &)*arg1); - *(lldb::SBAddress **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBAddress_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2) { - jlong jresult = 0 ; - lldb::SBSection arg1 ; - lldb::addr_t arg2 ; - lldb::SBSection *argp1 ; - lldb::SBAddress *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - argp1 = *(lldb::SBSection **)&jarg1; - if (!argp1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBSection"); - return 0; - } - arg1 = *argp1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (lldb::addr_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (lldb::SBAddress *)new lldb::SBAddress(arg1,arg2); - *(lldb::SBAddress **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBAddress_1_1SWIG_13(JNIEnv *jenv, jclass jcls, jobject jarg1, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::addr_t arg1 ; - lldb::SBTarget *arg2 = 0 ; - lldb::SBAddress *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg2_; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg1); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg1, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg1 = 0; - if (sz > 0) { - arg1 = (lldb::addr_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - arg2 = *(lldb::SBTarget **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBTarget & is null"); - return 0; - } - result = (lldb::SBAddress *)new lldb::SBAddress(arg1,*arg2); - *(lldb::SBAddress **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBAddress(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBAddress *arg1 = (lldb::SBAddress *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBAddress **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBAddress_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBAddress *arg1 = (lldb::SBAddress *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAddress **)&jarg1; - result = (bool)((lldb::SBAddress const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBAddress_1Clear(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBAddress *arg1 = (lldb::SBAddress *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAddress **)&jarg1; - (arg1)->Clear(); -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBAddress_1GetFileAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBAddress *arg1 = (lldb::SBAddress *) 0 ; - lldb::addr_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAddress **)&jarg1; - result = (lldb::addr_t)((lldb::SBAddress const *)arg1)->GetFileAddress(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBAddress_1GetLoadAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jobject jresult = 0 ; - lldb::SBAddress *arg1 = (lldb::SBAddress *) 0 ; - lldb::SBTarget *arg2 = 0 ; - lldb::addr_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBAddress **)&jarg1; - arg2 = *(lldb::SBTarget **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBTarget const & is null"); - return 0; - } - result = (lldb::addr_t)((lldb::SBAddress const *)arg1)->GetLoadAddress((lldb::SBTarget const &)*arg2); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBAddress_1SetAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jobject jarg3) { - lldb::SBAddress *arg1 = (lldb::SBAddress *) 0 ; - lldb::SBSection arg2 ; - lldb::addr_t arg3 ; - lldb::SBSection *argp2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBAddress **)&jarg1; - argp2 = *(lldb::SBSection **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBSection"); - return ; - } - arg2 = *argp2; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return ; - } - clazz = jenv->GetObjectClass(jarg3); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg3, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg3 = 0; - if (sz > 0) { - arg3 = (lldb::addr_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - (arg1)->SetAddress(arg2,arg3); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBAddress_1SetLoadAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2, jlong jarg3, jobject jarg3_) { - lldb::SBAddress *arg1 = (lldb::SBAddress *) 0 ; - lldb::addr_t arg2 ; - lldb::SBTarget *arg3 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - arg1 = *(lldb::SBAddress **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return ; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (lldb::addr_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - arg3 = *(lldb::SBTarget **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBTarget & is null"); - return ; - } - (arg1)->SetLoadAddress(arg2,*arg3); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBAddress_1OffsetAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2) { - jboolean jresult = 0 ; - lldb::SBAddress *arg1 = (lldb::SBAddress *) 0 ; - lldb::addr_t arg2 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAddress **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (lldb::addr_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (bool)(arg1)->OffsetAddress(arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBAddress_1GetDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBAddress *arg1 = (lldb::SBAddress *) 0 ; - lldb::SBStream *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBAddress **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - result = (bool)(arg1)->GetDescription(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBAddress_1GetSymbolContext(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBAddress *arg1 = (lldb::SBAddress *) 0 ; - uint32_t arg2 ; - lldb::SBSymbolContext result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAddress **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (arg1)->GetSymbolContext(arg2); - *(lldb::SBSymbolContext **)&jresult = new lldb::SBSymbolContext(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBAddress_1GetSection(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBAddress *arg1 = (lldb::SBAddress *) 0 ; - lldb::SBSection result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAddress **)&jarg1; - result = (arg1)->GetSection(); - *(lldb::SBSection **)&jresult = new lldb::SBSection(result); - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBAddress_1GetOffset(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBAddress *arg1 = (lldb::SBAddress *) 0 ; - lldb::addr_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAddress **)&jarg1; - result = (lldb::addr_t)(arg1)->GetOffset(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBAddress_1GetModule(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBAddress *arg1 = (lldb::SBAddress *) 0 ; - lldb::SBModule result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAddress **)&jarg1; - result = (arg1)->GetModule(); - *(lldb::SBModule **)&jresult = new lldb::SBModule(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBAddress_1GetCompileUnit(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBAddress *arg1 = (lldb::SBAddress *) 0 ; - lldb::SBCompileUnit result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAddress **)&jarg1; - result = (arg1)->GetCompileUnit(); - *(lldb::SBCompileUnit **)&jresult = new lldb::SBCompileUnit(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBAddress_1GetFunction(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBAddress *arg1 = (lldb::SBAddress *) 0 ; - lldb::SBFunction result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAddress **)&jarg1; - result = (arg1)->GetFunction(); - *(lldb::SBFunction **)&jresult = new lldb::SBFunction(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBAddress_1GetBlock(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBAddress *arg1 = (lldb::SBAddress *) 0 ; - lldb::SBBlock result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAddress **)&jarg1; - result = (arg1)->GetBlock(); - *(lldb::SBBlock **)&jresult = new lldb::SBBlock(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBAddress_1GetSymbol(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBAddress *arg1 = (lldb::SBAddress *) 0 ; - lldb::SBSymbol result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAddress **)&jarg1; - result = (arg1)->GetSymbol(); - *(lldb::SBSymbol **)&jresult = new lldb::SBSymbol(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBAddress_1GetLineEntry(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBAddress *arg1 = (lldb::SBAddress *) 0 ; - lldb::SBLineEntry result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAddress **)&jarg1; - result = (arg1)->GetLineEntry(); - *(lldb::SBLineEntry **)&jresult = new lldb::SBLineEntry(result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBAddress_1_1_1repr_1_1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBAddress *arg1 = (lldb::SBAddress *) 0 ; - std::string result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAddress **)&jarg1; - result = lldb_SBAddress___repr__(arg1); - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBAttachInfo_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBAttachInfo *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBAttachInfo *)new lldb::SBAttachInfo(); - *(lldb::SBAttachInfo **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBAttachInfo_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jobject jarg1) { - jlong jresult = 0 ; - lldb::pid_t arg1 ; - lldb::SBAttachInfo *result = 0 ; - - (void)jenv; - (void)jcls; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg1); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg1, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg1 = 0; - if (sz > 0) { - arg1 = (lldb::pid_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (lldb::SBAttachInfo *)new lldb::SBAttachInfo(arg1); - *(lldb::SBAttachInfo **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBAttachInfo_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jstring jarg1, jboolean jarg2) { - jlong jresult = 0 ; - char *arg1 = (char *) 0 ; - bool arg2 ; - lldb::SBAttachInfo *result = 0 ; - - (void)jenv; - (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - arg2 = jarg2 ? true : false; - result = (lldb::SBAttachInfo *)new lldb::SBAttachInfo((char const *)arg1,arg2); - *(lldb::SBAttachInfo **)&jresult = result; - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBAttachInfo_1_1SWIG_13(JNIEnv *jenv, jclass jcls, jstring jarg1, jboolean jarg2, jboolean jarg3) { - jlong jresult = 0 ; - char *arg1 = (char *) 0 ; - bool arg2 ; - bool arg3 ; - lldb::SBAttachInfo *result = 0 ; - - (void)jenv; - (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - arg2 = jarg2 ? true : false; - arg3 = jarg3 ? true : false; - result = (lldb::SBAttachInfo *)new lldb::SBAttachInfo((char const *)arg1,arg2,arg3); - *(lldb::SBAttachInfo **)&jresult = result; - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBAttachInfo_1_1SWIG_14(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBAttachInfo *arg1 = 0 ; - lldb::SBAttachInfo *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAttachInfo **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBAttachInfo const & is null"); - return 0; - } - result = (lldb::SBAttachInfo *)new lldb::SBAttachInfo((lldb::SBAttachInfo const &)*arg1); - *(lldb::SBAttachInfo **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBAttachInfo(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBAttachInfo *arg1 = (lldb::SBAttachInfo *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBAttachInfo **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBAttachInfo_1GetProcessID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBAttachInfo *arg1 = (lldb::SBAttachInfo *) 0 ; - lldb::pid_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAttachInfo **)&jarg1; - result = (lldb::pid_t)(arg1)->GetProcessID(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBAttachInfo_1SetProcessID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2) { - lldb::SBAttachInfo *arg1 = (lldb::SBAttachInfo *) 0 ; - lldb::pid_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAttachInfo **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return ; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (lldb::pid_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - (arg1)->SetProcessID(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBAttachInfo_1SetExecutable_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBAttachInfo *arg1 = (lldb::SBAttachInfo *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAttachInfo **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->SetExecutable((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBAttachInfo_1SetExecutable_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBAttachInfo *arg1 = (lldb::SBAttachInfo *) 0 ; - lldb::SBFileSpec arg2 ; - lldb::SBFileSpec *argp2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBAttachInfo **)&jarg1; - argp2 = *(lldb::SBFileSpec **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBFileSpec"); - return ; - } - arg2 = *argp2; - (arg1)->SetExecutable(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBAttachInfo_1GetWaitForLaunch(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBAttachInfo *arg1 = (lldb::SBAttachInfo *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAttachInfo **)&jarg1; - result = (bool)(arg1)->GetWaitForLaunch(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBAttachInfo_1SetWaitForLaunch_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBAttachInfo *arg1 = (lldb::SBAttachInfo *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAttachInfo **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetWaitForLaunch(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBAttachInfo_1SetWaitForLaunch_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2, jboolean jarg3) { - lldb::SBAttachInfo *arg1 = (lldb::SBAttachInfo *) 0 ; - bool arg2 ; - bool arg3 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAttachInfo **)&jarg1; - arg2 = jarg2 ? true : false; - arg3 = jarg3 ? true : false; - (arg1)->SetWaitForLaunch(arg2,arg3); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBAttachInfo_1GetIgnoreExisting(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBAttachInfo *arg1 = (lldb::SBAttachInfo *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAttachInfo **)&jarg1; - result = (bool)(arg1)->GetIgnoreExisting(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBAttachInfo_1SetIgnoreExisting(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBAttachInfo *arg1 = (lldb::SBAttachInfo *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAttachInfo **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetIgnoreExisting(arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBAttachInfo_1GetResumeCount(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBAttachInfo *arg1 = (lldb::SBAttachInfo *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAttachInfo **)&jarg1; - result = (uint32_t)(arg1)->GetResumeCount(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBAttachInfo_1SetResumeCount(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - lldb::SBAttachInfo *arg1 = (lldb::SBAttachInfo *) 0 ; - uint32_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAttachInfo **)&jarg1; - arg2 = (uint32_t)jarg2; - (arg1)->SetResumeCount(arg2); -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBAttachInfo_1GetProcessPluginName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBAttachInfo *arg1 = (lldb::SBAttachInfo *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAttachInfo **)&jarg1; - result = (char *)(arg1)->GetProcessPluginName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBAttachInfo_1SetProcessPluginName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBAttachInfo *arg1 = (lldb::SBAttachInfo *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAttachInfo **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->SetProcessPluginName((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBAttachInfo_1GetUserID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBAttachInfo *arg1 = (lldb::SBAttachInfo *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAttachInfo **)&jarg1; - result = (uint32_t)(arg1)->GetUserID(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBAttachInfo_1GetGroupID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBAttachInfo *arg1 = (lldb::SBAttachInfo *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAttachInfo **)&jarg1; - result = (uint32_t)(arg1)->GetGroupID(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBAttachInfo_1UserIDIsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBAttachInfo *arg1 = (lldb::SBAttachInfo *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAttachInfo **)&jarg1; - result = (bool)(arg1)->UserIDIsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBAttachInfo_1GroupIDIsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBAttachInfo *arg1 = (lldb::SBAttachInfo *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAttachInfo **)&jarg1; - result = (bool)(arg1)->GroupIDIsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBAttachInfo_1SetUserID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - lldb::SBAttachInfo *arg1 = (lldb::SBAttachInfo *) 0 ; - uint32_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAttachInfo **)&jarg1; - arg2 = (uint32_t)jarg2; - (arg1)->SetUserID(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBAttachInfo_1SetGroupID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - lldb::SBAttachInfo *arg1 = (lldb::SBAttachInfo *) 0 ; - uint32_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAttachInfo **)&jarg1; - arg2 = (uint32_t)jarg2; - (arg1)->SetGroupID(arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBAttachInfo_1GetEffectiveUserID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBAttachInfo *arg1 = (lldb::SBAttachInfo *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAttachInfo **)&jarg1; - result = (uint32_t)(arg1)->GetEffectiveUserID(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBAttachInfo_1GetEffectiveGroupID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBAttachInfo *arg1 = (lldb::SBAttachInfo *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAttachInfo **)&jarg1; - result = (uint32_t)(arg1)->GetEffectiveGroupID(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBAttachInfo_1EffectiveUserIDIsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBAttachInfo *arg1 = (lldb::SBAttachInfo *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAttachInfo **)&jarg1; - result = (bool)(arg1)->EffectiveUserIDIsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBAttachInfo_1EffectiveGroupIDIsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBAttachInfo *arg1 = (lldb::SBAttachInfo *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAttachInfo **)&jarg1; - result = (bool)(arg1)->EffectiveGroupIDIsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBAttachInfo_1SetEffectiveUserID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - lldb::SBAttachInfo *arg1 = (lldb::SBAttachInfo *) 0 ; - uint32_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAttachInfo **)&jarg1; - arg2 = (uint32_t)jarg2; - (arg1)->SetEffectiveUserID(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBAttachInfo_1SetEffectiveGroupID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - lldb::SBAttachInfo *arg1 = (lldb::SBAttachInfo *) 0 ; - uint32_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAttachInfo **)&jarg1; - arg2 = (uint32_t)jarg2; - (arg1)->SetEffectiveGroupID(arg2); -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBAttachInfo_1GetParentProcessID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBAttachInfo *arg1 = (lldb::SBAttachInfo *) 0 ; - lldb::pid_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAttachInfo **)&jarg1; - result = (lldb::pid_t)(arg1)->GetParentProcessID(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBAttachInfo_1SetParentProcessID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2) { - lldb::SBAttachInfo *arg1 = (lldb::SBAttachInfo *) 0 ; - lldb::pid_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAttachInfo **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return ; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (lldb::pid_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - (arg1)->SetParentProcessID(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBAttachInfo_1ParentProcessIDIsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBAttachInfo *arg1 = (lldb::SBAttachInfo *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAttachInfo **)&jarg1; - result = (bool)(arg1)->ParentProcessIDIsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBAttachInfo_1GetListener(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBAttachInfo *arg1 = (lldb::SBAttachInfo *) 0 ; - lldb::SBListener result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAttachInfo **)&jarg1; - result = (arg1)->GetListener(); - *(lldb::SBListener **)&jresult = new lldb::SBListener(result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBAttachInfo_1SetListener(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBAttachInfo *arg1 = (lldb::SBAttachInfo *) 0 ; - lldb::SBListener *arg2 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBAttachInfo **)&jarg1; - arg2 = *(lldb::SBListener **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBListener & is null"); - return ; - } - (arg1)->SetListener(*arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBAttachInfo_1GetShadowListener(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBAttachInfo *arg1 = (lldb::SBAttachInfo *) 0 ; - lldb::SBListener result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAttachInfo **)&jarg1; - result = (arg1)->GetShadowListener(); - *(lldb::SBListener **)&jresult = new lldb::SBListener(result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBAttachInfo_1SetShadowListener(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBAttachInfo *arg1 = (lldb::SBAttachInfo *) 0 ; - lldb::SBListener *arg2 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBAttachInfo **)&jarg1; - arg2 = *(lldb::SBListener **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBListener & is null"); - return ; - } - (arg1)->SetShadowListener(*arg2); -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBAttachInfo_1GetScriptedProcessClassName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBAttachInfo *arg1 = (lldb::SBAttachInfo *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAttachInfo **)&jarg1; - result = (char *)((lldb::SBAttachInfo const *)arg1)->GetScriptedProcessClassName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBAttachInfo_1SetScriptedProcessClassName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBAttachInfo *arg1 = (lldb::SBAttachInfo *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAttachInfo **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->SetScriptedProcessClassName((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBAttachInfo_1GetScriptedProcessDictionary(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBAttachInfo *arg1 = (lldb::SBAttachInfo *) 0 ; - lldb::SBStructuredData result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBAttachInfo **)&jarg1; - result = ((lldb::SBAttachInfo const *)arg1)->GetScriptedProcessDictionary(); - *(lldb::SBStructuredData **)&jresult = new lldb::SBStructuredData(result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBAttachInfo_1SetScriptedProcessDictionary(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBAttachInfo *arg1 = (lldb::SBAttachInfo *) 0 ; - lldb::SBStructuredData arg2 ; - lldb::SBStructuredData *argp2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBAttachInfo **)&jarg1; - argp2 = *(lldb::SBStructuredData **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBStructuredData"); - return ; - } - arg2 = *argp2; - (arg1)->SetScriptedProcessDictionary(arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBBlock_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBBlock *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBBlock *)new lldb::SBBlock(); - *(lldb::SBBlock **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBBlock_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBBlock *arg1 = 0 ; - lldb::SBBlock *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBlock **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBBlock const & is null"); - return 0; - } - result = (lldb::SBBlock *)new lldb::SBBlock((lldb::SBBlock const &)*arg1); - *(lldb::SBBlock **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBBlock(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBBlock *arg1 = (lldb::SBBlock *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBBlock **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBBlock_1IsInlined(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBBlock *arg1 = (lldb::SBBlock *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBlock **)&jarg1; - result = (bool)((lldb::SBBlock const *)arg1)->IsInlined(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBBlock_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBBlock *arg1 = (lldb::SBBlock *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBlock **)&jarg1; - result = (bool)((lldb::SBBlock const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBBlock_1GetInlinedName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBBlock *arg1 = (lldb::SBBlock *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBlock **)&jarg1; - result = (char *)((lldb::SBBlock const *)arg1)->GetInlinedName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBlock_1GetInlinedCallSiteFile(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBBlock *arg1 = (lldb::SBBlock *) 0 ; - lldb::SBFileSpec result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBlock **)&jarg1; - result = ((lldb::SBBlock const *)arg1)->GetInlinedCallSiteFile(); - *(lldb::SBFileSpec **)&jresult = new lldb::SBFileSpec(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBlock_1GetInlinedCallSiteLine(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBBlock *arg1 = (lldb::SBBlock *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBlock **)&jarg1; - result = (uint32_t)((lldb::SBBlock const *)arg1)->GetInlinedCallSiteLine(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBlock_1GetInlinedCallSiteColumn(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBBlock *arg1 = (lldb::SBBlock *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBlock **)&jarg1; - result = (uint32_t)((lldb::SBBlock const *)arg1)->GetInlinedCallSiteColumn(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBlock_1GetParent(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBBlock *arg1 = (lldb::SBBlock *) 0 ; - lldb::SBBlock result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBlock **)&jarg1; - result = (arg1)->GetParent(); - *(lldb::SBBlock **)&jresult = new lldb::SBBlock(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBlock_1GetSibling(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBBlock *arg1 = (lldb::SBBlock *) 0 ; - lldb::SBBlock result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBlock **)&jarg1; - result = (arg1)->GetSibling(); - *(lldb::SBBlock **)&jresult = new lldb::SBBlock(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBlock_1GetFirstChild(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBBlock *arg1 = (lldb::SBBlock *) 0 ; - lldb::SBBlock result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBlock **)&jarg1; - result = (arg1)->GetFirstChild(); - *(lldb::SBBlock **)&jresult = new lldb::SBBlock(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBlock_1GetNumRanges(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBBlock *arg1 = (lldb::SBBlock *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBlock **)&jarg1; - result = (uint32_t)(arg1)->GetNumRanges(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBlock_1GetRangeStartAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBBlock *arg1 = (lldb::SBBlock *) 0 ; - uint32_t arg2 ; - lldb::SBAddress result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBlock **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (arg1)->GetRangeStartAddress(arg2); - *(lldb::SBAddress **)&jresult = new lldb::SBAddress(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBlock_1GetRangeEndAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBBlock *arg1 = (lldb::SBBlock *) 0 ; - uint32_t arg2 ; - lldb::SBAddress result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBlock **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (arg1)->GetRangeEndAddress(arg2); - *(lldb::SBAddress **)&jresult = new lldb::SBAddress(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBlock_1GetRangeIndexForBlockAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBBlock *arg1 = (lldb::SBBlock *) 0 ; - lldb::SBAddress arg2 ; - lldb::SBAddress *argp2 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBBlock **)&jarg1; - argp2 = *(lldb::SBAddress **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBAddress"); - return 0; - } - arg2 = *argp2; - result = (uint32_t)(arg1)->GetRangeIndexForBlockAddress(arg2); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBlock_1GetVariables_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jboolean jarg3, jboolean jarg4, jboolean jarg5, jint jarg6) { - jlong jresult = 0 ; - lldb::SBBlock *arg1 = (lldb::SBBlock *) 0 ; - lldb::SBFrame *arg2 = 0 ; - bool arg3 ; - bool arg4 ; - bool arg5 ; - lldb::DynamicValueType arg6 ; - lldb::SBValueList result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBBlock **)&jarg1; - arg2 = *(lldb::SBFrame **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFrame & is null"); - return 0; - } - arg3 = jarg3 ? true : false; - arg4 = jarg4 ? true : false; - arg5 = jarg5 ? true : false; - arg6 = (lldb::DynamicValueType)jarg6; - result = (arg1)->GetVariables(*arg2,arg3,arg4,arg5,arg6); - *(lldb::SBValueList **)&jresult = new lldb::SBValueList(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBlock_1GetVariables_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jboolean jarg3, jboolean jarg4, jboolean jarg5) { - jlong jresult = 0 ; - lldb::SBBlock *arg1 = (lldb::SBBlock *) 0 ; - lldb::SBTarget *arg2 = 0 ; - bool arg3 ; - bool arg4 ; - bool arg5 ; - lldb::SBValueList result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBBlock **)&jarg1; - arg2 = *(lldb::SBTarget **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBTarget & is null"); - return 0; - } - arg3 = jarg3 ? true : false; - arg4 = jarg4 ? true : false; - arg5 = jarg5 ? true : false; - result = (arg1)->GetVariables(*arg2,arg3,arg4,arg5); - *(lldb::SBValueList **)&jresult = new lldb::SBValueList(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBlock_1GetContainingInlinedBlock(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBBlock *arg1 = (lldb::SBBlock *) 0 ; - lldb::SBBlock result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBlock **)&jarg1; - result = (arg1)->GetContainingInlinedBlock(); - *(lldb::SBBlock **)&jresult = new lldb::SBBlock(result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBBlock_1GetDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBBlock *arg1 = (lldb::SBBlock *) 0 ; - lldb::SBStream *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBBlock **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - result = (bool)(arg1)->GetDescription(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBBlock_1_1_1repr_1_1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBBlock *arg1 = (lldb::SBBlock *) 0 ; - std::string result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBlock **)&jarg1; - result = lldb_SBBlock___repr__(arg1); - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBBreakpoint_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBBreakpoint *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBBreakpoint *)new lldb::SBBreakpoint(); - *(lldb::SBBreakpoint **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBBreakpoint_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBBreakpoint *arg1 = 0 ; - lldb::SBBreakpoint *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBBreakpoint const & is null"); - return 0; - } - result = (lldb::SBBreakpoint *)new lldb::SBBreakpoint((lldb::SBBreakpoint const &)*arg1); - *(lldb::SBBreakpoint **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBBreakpoint(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1GetID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - lldb::break_id_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - result = (lldb::break_id_t)((lldb::SBBreakpoint const *)arg1)->GetID(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - result = (bool)((lldb::SBBreakpoint const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1ClearAllBreakpointSites(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - (arg1)->ClearAllBreakpointSites(); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1GetTarget(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - lldb::SBTarget result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - result = ((lldb::SBBreakpoint const *)arg1)->GetTarget(); - *(lldb::SBTarget **)&jresult = new lldb::SBTarget(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1FindLocationByAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2) { - jlong jresult = 0 ; - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - lldb::addr_t arg2 ; - lldb::SBBreakpointLocation result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (lldb::addr_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (arg1)->FindLocationByAddress(arg2); - *(lldb::SBBreakpointLocation **)&jresult = new lldb::SBBreakpointLocation(result); - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1FindLocationIDByAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2) { - jint jresult = 0 ; - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - lldb::addr_t arg2 ; - lldb::break_id_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (lldb::addr_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (lldb::break_id_t)(arg1)->FindLocationIDByAddress(arg2); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1FindLocationByID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - jlong jresult = 0 ; - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - lldb::break_id_t arg2 ; - lldb::SBBreakpointLocation result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - arg2 = (lldb::break_id_t)jarg2; - result = (arg1)->FindLocationByID(arg2); - *(lldb::SBBreakpointLocation **)&jresult = new lldb::SBBreakpointLocation(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1GetLocationAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - uint32_t arg2 ; - lldb::SBBreakpointLocation result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (arg1)->GetLocationAtIndex(arg2); - *(lldb::SBBreakpointLocation **)&jresult = new lldb::SBBreakpointLocation(result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1SetEnabled(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetEnabled(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1IsEnabled(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - result = (bool)(arg1)->IsEnabled(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1SetOneShot(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetOneShot(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1IsOneShot(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - result = (bool)((lldb::SBBreakpoint const *)arg1)->IsOneShot(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1IsInternal(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - result = (bool)(arg1)->IsInternal(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1GetHitCount(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - result = (uint32_t)((lldb::SBBreakpoint const *)arg1)->GetHitCount(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1SetIgnoreCount(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - uint32_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - arg2 = (uint32_t)jarg2; - (arg1)->SetIgnoreCount(arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1GetIgnoreCount(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - result = (uint32_t)((lldb::SBBreakpoint const *)arg1)->GetIgnoreCount(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1SetCondition(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->SetCondition((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1GetCondition(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - result = (char *)(arg1)->GetCondition(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1SetAutoContinue(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetAutoContinue(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1GetAutoContinue(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - result = (bool)(arg1)->GetAutoContinue(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1SetThreadID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2) { - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - lldb::tid_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return ; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (lldb::tid_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - (arg1)->SetThreadID(arg2); -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1GetThreadID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - lldb::tid_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - result = (lldb::tid_t)(arg1)->GetThreadID(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1SetThreadIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - uint32_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - arg2 = (uint32_t)jarg2; - (arg1)->SetThreadIndex(arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1GetThreadIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - result = (uint32_t)((lldb::SBBreakpoint const *)arg1)->GetThreadIndex(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1SetThreadName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->SetThreadName((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1GetThreadName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - result = (char *)((lldb::SBBreakpoint const *)arg1)->GetThreadName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1SetQueueName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->SetQueueName((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1GetQueueName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - result = (char *)((lldb::SBBreakpoint const *)arg1)->GetQueueName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1SetScriptCallbackFunction_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->SetScriptCallbackFunction((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1SetScriptCallbackFunction_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jobject jarg3_) { - jlong jresult = 0 ; - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBStructuredData *arg3 = 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = *(lldb::SBStructuredData **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStructuredData & is null"); - return 0; - } - result = (arg1)->SetScriptCallbackFunction((char const *)arg2,*arg3); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1SetCommandLineCommands(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - lldb::SBStringList *arg2 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - arg2 = *(lldb::SBStringList **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStringList & is null"); - return ; - } - (arg1)->SetCommandLineCommands(*arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1GetCommandLineCommands(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - lldb::SBStringList *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - arg2 = *(lldb::SBStringList **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStringList & is null"); - return 0; - } - result = (bool)(arg1)->GetCommandLineCommands(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1SetScriptCallbackBody(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (arg1)->SetScriptCallbackBody((char const *)arg2); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1AddName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jboolean jresult = 0 ; - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - char *arg2 = (char *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (bool)(arg1)->AddName((char const *)arg2); - jresult = (jboolean)result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1AddNameWithErrorHandling(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (arg1)->AddNameWithErrorHandling((char const *)arg2); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1RemoveName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->RemoveName((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1MatchesName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jboolean jresult = 0 ; - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - char *arg2 = (char *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (bool)(arg1)->MatchesName((char const *)arg2); - jresult = (jboolean)result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1GetNames(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - lldb::SBStringList *arg2 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - arg2 = *(lldb::SBStringList **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStringList & is null"); - return ; - } - (arg1)->GetNames(*arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1GetNumResolvedLocations(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - size_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - result = ((lldb::SBBreakpoint const *)arg1)->GetNumResolvedLocations(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1GetNumLocations(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - size_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - result = ((lldb::SBBreakpoint const *)arg1)->GetNumLocations(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1GetDescription_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - lldb::SBStream *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - result = (bool)(arg1)->GetDescription(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1GetDescription_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jboolean jarg3) { - jboolean jresult = 0 ; - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - lldb::SBStream *arg2 = 0 ; - bool arg3 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - arg3 = jarg3 ? true : false; - result = (bool)(arg1)->GetDescription(*arg2,arg3); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1EventIsBreakpointEvent(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBEvent *arg1 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEvent **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent const & is null"); - return 0; - } - result = (bool)lldb::SBBreakpoint::EventIsBreakpointEvent((lldb::SBEvent const &)*arg1); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1GetBreakpointEventTypeFromEvent(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBEvent *arg1 = 0 ; - lldb::BreakpointEventType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEvent **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent const & is null"); - return 0; - } - result = (lldb::BreakpointEventType)lldb::SBBreakpoint::GetBreakpointEventTypeFromEvent((lldb::SBEvent const &)*arg1); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1GetBreakpointFromEvent(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBEvent *arg1 = 0 ; - lldb::SBBreakpoint result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEvent **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent const & is null"); - return 0; - } - result = lldb::SBBreakpoint::GetBreakpointFromEvent((lldb::SBEvent const &)*arg1); - *(lldb::SBBreakpoint **)&jresult = new lldb::SBBreakpoint(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1GetBreakpointLocationAtIndexFromEvent(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBEvent *arg1 = 0 ; - uint32_t arg2 ; - lldb::SBBreakpointLocation result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEvent **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent const & is null"); - return 0; - } - arg2 = (uint32_t)jarg2; - result = lldb::SBBreakpoint::GetBreakpointLocationAtIndexFromEvent((lldb::SBEvent const &)*arg1,arg2); - *(lldb::SBBreakpointLocation **)&jresult = new lldb::SBBreakpointLocation(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1GetNumBreakpointLocationsFromEvent(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBEvent *arg1 = 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEvent **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent const & is null"); - return 0; - } - result = (uint32_t)lldb::SBBreakpoint::GetNumBreakpointLocationsFromEvent((lldb::SBEvent const &)*arg1); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1IsHardware(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - result = (bool)((lldb::SBBreakpoint const *)arg1)->IsHardware(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1AddLocation(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - lldb::SBAddress *arg2 = 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - arg2 = *(lldb::SBAddress **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBAddress & is null"); - return 0; - } - result = (arg1)->AddLocation(*arg2); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1SerializeToStructuredData(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - lldb::SBStructuredData result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - result = (arg1)->SerializeToStructuredData(); - *(lldb::SBStructuredData **)&jresult = new lldb::SBStructuredData(result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBBreakpoint_1_1_1repr_1_1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBBreakpoint *arg1 = (lldb::SBBreakpoint *) 0 ; - std::string result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - result = lldb_SBBreakpoint___repr__(arg1); - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBBreakpointList(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = 0 ; - lldb::SBBreakpointList *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBTarget & is null"); - return 0; - } - result = (lldb::SBBreakpointList *)new lldb::SBBreakpointList(*arg1); - *(lldb::SBBreakpointList **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBBreakpointList(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBBreakpointList *arg1 = (lldb::SBBreakpointList *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBBreakpointList **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBreakpointList_1GetSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBBreakpointList *arg1 = (lldb::SBBreakpointList *) 0 ; - size_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointList **)&jarg1; - result = ((lldb::SBBreakpointList const *)arg1)->GetSize(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBreakpointList_1GetBreakpointAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBBreakpointList *arg1 = (lldb::SBBreakpointList *) 0 ; - size_t arg2 ; - lldb::SBBreakpoint result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointList **)&jarg1; - arg2 = (size_t)jarg2; - result = (arg1)->GetBreakpointAtIndex(arg2); - *(lldb::SBBreakpoint **)&jresult = new lldb::SBBreakpoint(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBreakpointList_1FindBreakpointByID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - jlong jresult = 0 ; - lldb::SBBreakpointList *arg1 = (lldb::SBBreakpointList *) 0 ; - lldb::break_id_t arg2 ; - lldb::SBBreakpoint result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointList **)&jarg1; - arg2 = (lldb::break_id_t)jarg2; - result = (arg1)->FindBreakpointByID(arg2); - *(lldb::SBBreakpoint **)&jresult = new lldb::SBBreakpoint(result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBreakpointList_1Append(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBBreakpointList *arg1 = (lldb::SBBreakpointList *) 0 ; - lldb::SBBreakpoint *arg2 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBBreakpointList **)&jarg1; - arg2 = *(lldb::SBBreakpoint **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBBreakpoint const & is null"); - return ; - } - (arg1)->Append((lldb::SBBreakpoint const &)*arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBBreakpointList_1AppendIfUnique(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBBreakpointList *arg1 = (lldb::SBBreakpointList *) 0 ; - lldb::SBBreakpoint *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBBreakpointList **)&jarg1; - arg2 = *(lldb::SBBreakpoint **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBBreakpoint const & is null"); - return 0; - } - result = (bool)(arg1)->AppendIfUnique((lldb::SBBreakpoint const &)*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBreakpointList_1AppendByID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - lldb::SBBreakpointList *arg1 = (lldb::SBBreakpointList *) 0 ; - lldb::break_id_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointList **)&jarg1; - arg2 = (lldb::break_id_t)jarg2; - (arg1)->AppendByID(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBreakpointList_1Clear(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBBreakpointList *arg1 = (lldb::SBBreakpointList *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointList **)&jarg1; - (arg1)->Clear(); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBBreakpointLocation_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBBreakpointLocation *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBBreakpointLocation *)new lldb::SBBreakpointLocation(); - *(lldb::SBBreakpointLocation **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBBreakpointLocation_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBBreakpointLocation *arg1 = 0 ; - lldb::SBBreakpointLocation *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointLocation **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBBreakpointLocation const & is null"); - return 0; - } - result = (lldb::SBBreakpointLocation *)new lldb::SBBreakpointLocation((lldb::SBBreakpointLocation const &)*arg1); - *(lldb::SBBreakpointLocation **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBBreakpointLocation(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBBreakpointLocation *arg1 = (lldb::SBBreakpointLocation *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBBreakpointLocation **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBBreakpointLocation_1GetID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBBreakpointLocation *arg1 = (lldb::SBBreakpointLocation *) 0 ; - lldb::break_id_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointLocation **)&jarg1; - result = (lldb::break_id_t)(arg1)->GetID(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBBreakpointLocation_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBBreakpointLocation *arg1 = (lldb::SBBreakpointLocation *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointLocation **)&jarg1; - result = (bool)((lldb::SBBreakpointLocation const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBreakpointLocation_1GetAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBBreakpointLocation *arg1 = (lldb::SBBreakpointLocation *) 0 ; - lldb::SBAddress result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointLocation **)&jarg1; - result = (arg1)->GetAddress(); - *(lldb::SBAddress **)&jresult = new lldb::SBAddress(result); - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBBreakpointLocation_1GetLoadAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBBreakpointLocation *arg1 = (lldb::SBBreakpointLocation *) 0 ; - lldb::addr_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointLocation **)&jarg1; - result = (lldb::addr_t)(arg1)->GetLoadAddress(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBreakpointLocation_1SetEnabled(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBBreakpointLocation *arg1 = (lldb::SBBreakpointLocation *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointLocation **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetEnabled(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBBreakpointLocation_1IsEnabled(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBBreakpointLocation *arg1 = (lldb::SBBreakpointLocation *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointLocation **)&jarg1; - result = (bool)(arg1)->IsEnabled(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBreakpointLocation_1GetHitCount(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBBreakpointLocation *arg1 = (lldb::SBBreakpointLocation *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointLocation **)&jarg1; - result = (uint32_t)(arg1)->GetHitCount(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBreakpointLocation_1GetIgnoreCount(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBBreakpointLocation *arg1 = (lldb::SBBreakpointLocation *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointLocation **)&jarg1; - result = (uint32_t)(arg1)->GetIgnoreCount(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBreakpointLocation_1SetIgnoreCount(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - lldb::SBBreakpointLocation *arg1 = (lldb::SBBreakpointLocation *) 0 ; - uint32_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointLocation **)&jarg1; - arg2 = (uint32_t)jarg2; - (arg1)->SetIgnoreCount(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBreakpointLocation_1SetCondition(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBBreakpointLocation *arg1 = (lldb::SBBreakpointLocation *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointLocation **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->SetCondition((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBBreakpointLocation_1GetCondition(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBBreakpointLocation *arg1 = (lldb::SBBreakpointLocation *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointLocation **)&jarg1; - result = (char *)(arg1)->GetCondition(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBreakpointLocation_1SetAutoContinue(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBBreakpointLocation *arg1 = (lldb::SBBreakpointLocation *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointLocation **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetAutoContinue(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBBreakpointLocation_1GetAutoContinue(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBBreakpointLocation *arg1 = (lldb::SBBreakpointLocation *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointLocation **)&jarg1; - result = (bool)(arg1)->GetAutoContinue(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBreakpointLocation_1SetScriptCallbackFunction_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBBreakpointLocation *arg1 = (lldb::SBBreakpointLocation *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointLocation **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->SetScriptCallbackFunction((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBreakpointLocation_1SetScriptCallbackFunction_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jobject jarg3_) { - jlong jresult = 0 ; - lldb::SBBreakpointLocation *arg1 = (lldb::SBBreakpointLocation *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBStructuredData *arg3 = 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - arg1 = *(lldb::SBBreakpointLocation **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = *(lldb::SBStructuredData **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStructuredData & is null"); - return 0; - } - result = (arg1)->SetScriptCallbackFunction((char const *)arg2,*arg3); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBreakpointLocation_1SetScriptCallbackBody(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBBreakpointLocation *arg1 = (lldb::SBBreakpointLocation *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointLocation **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (arg1)->SetScriptCallbackBody((char const *)arg2); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBreakpointLocation_1SetCommandLineCommands(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBBreakpointLocation *arg1 = (lldb::SBBreakpointLocation *) 0 ; - lldb::SBStringList *arg2 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBBreakpointLocation **)&jarg1; - arg2 = *(lldb::SBStringList **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStringList & is null"); - return ; - } - (arg1)->SetCommandLineCommands(*arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBBreakpointLocation_1GetCommandLineCommands(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBBreakpointLocation *arg1 = (lldb::SBBreakpointLocation *) 0 ; - lldb::SBStringList *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBBreakpointLocation **)&jarg1; - arg2 = *(lldb::SBStringList **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStringList & is null"); - return 0; - } - result = (bool)(arg1)->GetCommandLineCommands(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBreakpointLocation_1SetThreadID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2) { - lldb::SBBreakpointLocation *arg1 = (lldb::SBBreakpointLocation *) 0 ; - lldb::tid_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointLocation **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return ; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (lldb::tid_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - (arg1)->SetThreadID(arg2); -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBBreakpointLocation_1GetThreadID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBBreakpointLocation *arg1 = (lldb::SBBreakpointLocation *) 0 ; - lldb::tid_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointLocation **)&jarg1; - result = (lldb::tid_t)(arg1)->GetThreadID(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBreakpointLocation_1SetThreadIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - lldb::SBBreakpointLocation *arg1 = (lldb::SBBreakpointLocation *) 0 ; - uint32_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointLocation **)&jarg1; - arg2 = (uint32_t)jarg2; - (arg1)->SetThreadIndex(arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBreakpointLocation_1GetThreadIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBBreakpointLocation *arg1 = (lldb::SBBreakpointLocation *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointLocation **)&jarg1; - result = (uint32_t)((lldb::SBBreakpointLocation const *)arg1)->GetThreadIndex(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBreakpointLocation_1SetThreadName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBBreakpointLocation *arg1 = (lldb::SBBreakpointLocation *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointLocation **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->SetThreadName((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBBreakpointLocation_1GetThreadName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBBreakpointLocation *arg1 = (lldb::SBBreakpointLocation *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointLocation **)&jarg1; - result = (char *)((lldb::SBBreakpointLocation const *)arg1)->GetThreadName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBreakpointLocation_1SetQueueName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBBreakpointLocation *arg1 = (lldb::SBBreakpointLocation *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointLocation **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->SetQueueName((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBBreakpointLocation_1GetQueueName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBBreakpointLocation *arg1 = (lldb::SBBreakpointLocation *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointLocation **)&jarg1; - result = (char *)((lldb::SBBreakpointLocation const *)arg1)->GetQueueName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBBreakpointLocation_1IsResolved(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBBreakpointLocation *arg1 = (lldb::SBBreakpointLocation *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointLocation **)&jarg1; - result = (bool)(arg1)->IsResolved(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBBreakpointLocation_1GetDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3) { - jboolean jresult = 0 ; - lldb::SBBreakpointLocation *arg1 = (lldb::SBBreakpointLocation *) 0 ; - lldb::SBStream *arg2 = 0 ; - lldb::DescriptionLevel arg3 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBBreakpointLocation **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - arg3 = (lldb::DescriptionLevel)jarg3; - result = (bool)(arg1)->GetDescription(*arg2,arg3); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBreakpointLocation_1GetBreakpoint(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBBreakpointLocation *arg1 = (lldb::SBBreakpointLocation *) 0 ; - lldb::SBBreakpoint result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointLocation **)&jarg1; - result = (arg1)->GetBreakpoint(); - *(lldb::SBBreakpoint **)&jresult = new lldb::SBBreakpoint(result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBBreakpointLocation_1_1_1repr_1_1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBBreakpointLocation *arg1 = (lldb::SBBreakpointLocation *) 0 ; - std::string result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointLocation **)&jarg1; - result = lldb_SBBreakpointLocation___repr__(arg1); - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBBreakpointName_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBBreakpointName *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBBreakpointName *)new lldb::SBBreakpointName(); - *(lldb::SBBreakpointName **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBBreakpointName_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = 0 ; - char *arg2 = (char *) 0 ; - lldb::SBBreakpointName *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBTarget & is null"); - return 0; - } - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (lldb::SBBreakpointName *)new lldb::SBBreakpointName(*arg1,(char const *)arg2); - *(lldb::SBBreakpointName **)&jresult = result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBBreakpointName_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBBreakpoint *arg1 = 0 ; - char *arg2 = (char *) 0 ; - lldb::SBBreakpointName *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpoint **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBBreakpoint & is null"); - return 0; - } - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (lldb::SBBreakpointName *)new lldb::SBBreakpointName(*arg1,(char const *)arg2); - *(lldb::SBBreakpointName **)&jresult = result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBBreakpointName_1_1SWIG_13(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBBreakpointName *arg1 = 0 ; - lldb::SBBreakpointName *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointName **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBBreakpointName const & is null"); - return 0; - } - result = (lldb::SBBreakpointName *)new lldb::SBBreakpointName((lldb::SBBreakpointName const &)*arg1); - *(lldb::SBBreakpointName **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBBreakpointName(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBBreakpointName *arg1 = (lldb::SBBreakpointName *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBBreakpointName **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBBreakpointName_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBBreakpointName *arg1 = (lldb::SBBreakpointName *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointName **)&jarg1; - result = (bool)((lldb::SBBreakpointName const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBBreakpointName_1GetName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBBreakpointName *arg1 = (lldb::SBBreakpointName *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointName **)&jarg1; - result = (char *)((lldb::SBBreakpointName const *)arg1)->GetName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBreakpointName_1SetEnabled(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBBreakpointName *arg1 = (lldb::SBBreakpointName *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointName **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetEnabled(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBBreakpointName_1IsEnabled(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBBreakpointName *arg1 = (lldb::SBBreakpointName *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointName **)&jarg1; - result = (bool)(arg1)->IsEnabled(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBreakpointName_1SetOneShot(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBBreakpointName *arg1 = (lldb::SBBreakpointName *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointName **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetOneShot(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBBreakpointName_1IsOneShot(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBBreakpointName *arg1 = (lldb::SBBreakpointName *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointName **)&jarg1; - result = (bool)((lldb::SBBreakpointName const *)arg1)->IsOneShot(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBreakpointName_1SetIgnoreCount(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - lldb::SBBreakpointName *arg1 = (lldb::SBBreakpointName *) 0 ; - uint32_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointName **)&jarg1; - arg2 = (uint32_t)jarg2; - (arg1)->SetIgnoreCount(arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBreakpointName_1GetIgnoreCount(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBBreakpointName *arg1 = (lldb::SBBreakpointName *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointName **)&jarg1; - result = (uint32_t)((lldb::SBBreakpointName const *)arg1)->GetIgnoreCount(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBreakpointName_1SetCondition(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBBreakpointName *arg1 = (lldb::SBBreakpointName *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointName **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->SetCondition((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBBreakpointName_1GetCondition(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBBreakpointName *arg1 = (lldb::SBBreakpointName *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointName **)&jarg1; - result = (char *)(arg1)->GetCondition(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBreakpointName_1SetAutoContinue(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBBreakpointName *arg1 = (lldb::SBBreakpointName *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointName **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetAutoContinue(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBBreakpointName_1GetAutoContinue(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBBreakpointName *arg1 = (lldb::SBBreakpointName *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointName **)&jarg1; - result = (bool)(arg1)->GetAutoContinue(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBreakpointName_1SetThreadID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2) { - lldb::SBBreakpointName *arg1 = (lldb::SBBreakpointName *) 0 ; - lldb::tid_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointName **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return ; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (lldb::tid_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - (arg1)->SetThreadID(arg2); -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBBreakpointName_1GetThreadID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBBreakpointName *arg1 = (lldb::SBBreakpointName *) 0 ; - lldb::tid_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointName **)&jarg1; - result = (lldb::tid_t)(arg1)->GetThreadID(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBreakpointName_1SetThreadIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - lldb::SBBreakpointName *arg1 = (lldb::SBBreakpointName *) 0 ; - uint32_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointName **)&jarg1; - arg2 = (uint32_t)jarg2; - (arg1)->SetThreadIndex(arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBreakpointName_1GetThreadIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBBreakpointName *arg1 = (lldb::SBBreakpointName *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointName **)&jarg1; - result = (uint32_t)((lldb::SBBreakpointName const *)arg1)->GetThreadIndex(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBreakpointName_1SetThreadName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBBreakpointName *arg1 = (lldb::SBBreakpointName *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointName **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->SetThreadName((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBBreakpointName_1GetThreadName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBBreakpointName *arg1 = (lldb::SBBreakpointName *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointName **)&jarg1; - result = (char *)((lldb::SBBreakpointName const *)arg1)->GetThreadName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBreakpointName_1SetQueueName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBBreakpointName *arg1 = (lldb::SBBreakpointName *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointName **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->SetQueueName((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBBreakpointName_1GetQueueName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBBreakpointName *arg1 = (lldb::SBBreakpointName *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointName **)&jarg1; - result = (char *)((lldb::SBBreakpointName const *)arg1)->GetQueueName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBreakpointName_1SetScriptCallbackFunction_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBBreakpointName *arg1 = (lldb::SBBreakpointName *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointName **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->SetScriptCallbackFunction((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBreakpointName_1SetScriptCallbackFunction_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jobject jarg3_) { - jlong jresult = 0 ; - lldb::SBBreakpointName *arg1 = (lldb::SBBreakpointName *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBStructuredData *arg3 = 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - arg1 = *(lldb::SBBreakpointName **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = *(lldb::SBStructuredData **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStructuredData & is null"); - return 0; - } - result = (arg1)->SetScriptCallbackFunction((char const *)arg2,*arg3); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBreakpointName_1SetCommandLineCommands(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBBreakpointName *arg1 = (lldb::SBBreakpointName *) 0 ; - lldb::SBStringList *arg2 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBBreakpointName **)&jarg1; - arg2 = *(lldb::SBStringList **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStringList & is null"); - return ; - } - (arg1)->SetCommandLineCommands(*arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBBreakpointName_1GetCommandLineCommands(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBBreakpointName *arg1 = (lldb::SBBreakpointName *) 0 ; - lldb::SBStringList *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBBreakpointName **)&jarg1; - arg2 = *(lldb::SBStringList **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStringList & is null"); - return 0; - } - result = (bool)(arg1)->GetCommandLineCommands(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBreakpointName_1SetScriptCallbackBody(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBBreakpointName *arg1 = (lldb::SBBreakpointName *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointName **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (arg1)->SetScriptCallbackBody((char const *)arg2); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBBreakpointName_1GetHelpString(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBBreakpointName *arg1 = (lldb::SBBreakpointName *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointName **)&jarg1; - result = (char *)((lldb::SBBreakpointName const *)arg1)->GetHelpString(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBreakpointName_1SetHelpString(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBBreakpointName *arg1 = (lldb::SBBreakpointName *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointName **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->SetHelpString((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBBreakpointName_1GetAllowList(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBBreakpointName *arg1 = (lldb::SBBreakpointName *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointName **)&jarg1; - result = (bool)((lldb::SBBreakpointName const *)arg1)->GetAllowList(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBreakpointName_1SetAllowList(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBBreakpointName *arg1 = (lldb::SBBreakpointName *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointName **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetAllowList(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBBreakpointName_1GetAllowDelete(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBBreakpointName *arg1 = (lldb::SBBreakpointName *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointName **)&jarg1; - result = (bool)(arg1)->GetAllowDelete(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBreakpointName_1SetAllowDelete(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBBreakpointName *arg1 = (lldb::SBBreakpointName *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointName **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetAllowDelete(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBBreakpointName_1GetAllowDisable(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBBreakpointName *arg1 = (lldb::SBBreakpointName *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointName **)&jarg1; - result = (bool)(arg1)->GetAllowDisable(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBreakpointName_1SetAllowDisable(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBBreakpointName *arg1 = (lldb::SBBreakpointName *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointName **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetAllowDisable(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBBreakpointName_1GetDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBBreakpointName *arg1 = (lldb::SBBreakpointName *) 0 ; - lldb::SBStream *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBBreakpointName **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - result = (bool)(arg1)->GetDescription(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBBreakpointName_1_1_1repr_1_1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBBreakpointName *arg1 = (lldb::SBBreakpointName *) 0 ; - std::string result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBreakpointName **)&jarg1; - result = lldb_SBBreakpointName___repr__(arg1); - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBBroadcaster_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBBroadcaster *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBBroadcaster *)new lldb::SBBroadcaster(); - *(lldb::SBBroadcaster **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBBroadcaster_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jstring jarg1) { - jlong jresult = 0 ; - char *arg1 = (char *) 0 ; - lldb::SBBroadcaster *result = 0 ; - - (void)jenv; - (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - result = (lldb::SBBroadcaster *)new lldb::SBBroadcaster((char const *)arg1); - *(lldb::SBBroadcaster **)&jresult = result; - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBBroadcaster_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBBroadcaster *arg1 = 0 ; - lldb::SBBroadcaster *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBroadcaster **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBBroadcaster const & is null"); - return 0; - } - result = (lldb::SBBroadcaster *)new lldb::SBBroadcaster((lldb::SBBroadcaster const &)*arg1); - *(lldb::SBBroadcaster **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBBroadcaster(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBBroadcaster *arg1 = (lldb::SBBroadcaster *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBBroadcaster **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBBroadcaster_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBBroadcaster *arg1 = (lldb::SBBroadcaster *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBroadcaster **)&jarg1; - result = (bool)((lldb::SBBroadcaster const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBroadcaster_1Clear(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBBroadcaster *arg1 = (lldb::SBBroadcaster *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBroadcaster **)&jarg1; - (arg1)->Clear(); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBroadcaster_1BroadcastEventByType_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jboolean jarg3) { - lldb::SBBroadcaster *arg1 = (lldb::SBBroadcaster *) 0 ; - uint32_t arg2 ; - bool arg3 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBroadcaster **)&jarg1; - arg2 = (uint32_t)jarg2; - arg3 = jarg3 ? true : false; - (arg1)->BroadcastEventByType(arg2,arg3); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBroadcaster_1BroadcastEventByType_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - lldb::SBBroadcaster *arg1 = (lldb::SBBroadcaster *) 0 ; - uint32_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBroadcaster **)&jarg1; - arg2 = (uint32_t)jarg2; - (arg1)->BroadcastEventByType(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBroadcaster_1BroadcastEvent_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jboolean jarg3) { - lldb::SBBroadcaster *arg1 = (lldb::SBBroadcaster *) 0 ; - lldb::SBEvent *arg2 = 0 ; - bool arg3 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBBroadcaster **)&jarg1; - arg2 = *(lldb::SBEvent **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent const & is null"); - return ; - } - arg3 = jarg3 ? true : false; - (arg1)->BroadcastEvent((lldb::SBEvent const &)*arg2,arg3); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBroadcaster_1BroadcastEvent_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBBroadcaster *arg1 = (lldb::SBBroadcaster *) 0 ; - lldb::SBEvent *arg2 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBBroadcaster **)&jarg1; - arg2 = *(lldb::SBEvent **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent const & is null"); - return ; - } - (arg1)->BroadcastEvent((lldb::SBEvent const &)*arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBBroadcaster_1AddInitialEventsToListener(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3) { - lldb::SBBroadcaster *arg1 = (lldb::SBBroadcaster *) 0 ; - lldb::SBListener *arg2 = 0 ; - uint32_t arg3 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBBroadcaster **)&jarg1; - arg2 = *(lldb::SBListener **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBListener const & is null"); - return ; - } - arg3 = (uint32_t)jarg3; - (arg1)->AddInitialEventsToListener((lldb::SBListener const &)*arg2,arg3); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBBroadcaster_1AddListener(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3) { - jlong jresult = 0 ; - lldb::SBBroadcaster *arg1 = (lldb::SBBroadcaster *) 0 ; - lldb::SBListener *arg2 = 0 ; - uint32_t arg3 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBBroadcaster **)&jarg1; - arg2 = *(lldb::SBListener **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBListener const & is null"); - return 0; - } - arg3 = (uint32_t)jarg3; - result = (uint32_t)(arg1)->AddListener((lldb::SBListener const &)*arg2,arg3); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBBroadcaster_1GetName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBBroadcaster *arg1 = (lldb::SBBroadcaster *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBroadcaster **)&jarg1; - result = (char *)((lldb::SBBroadcaster const *)arg1)->GetName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBBroadcaster_1EventTypeHasListeners(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jboolean jresult = 0 ; - lldb::SBBroadcaster *arg1 = (lldb::SBBroadcaster *) 0 ; - uint32_t arg2 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBBroadcaster **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (bool)(arg1)->EventTypeHasListeners(arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBBroadcaster_1RemoveListener_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3) { - jboolean jresult = 0 ; - lldb::SBBroadcaster *arg1 = (lldb::SBBroadcaster *) 0 ; - lldb::SBListener *arg2 = 0 ; - uint32_t arg3 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBBroadcaster **)&jarg1; - arg2 = *(lldb::SBListener **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBListener const & is null"); - return 0; - } - arg3 = (uint32_t)jarg3; - result = (bool)(arg1)->RemoveListener((lldb::SBListener const &)*arg2,arg3); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBBroadcaster_1RemoveListener_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBBroadcaster *arg1 = (lldb::SBBroadcaster *) 0 ; - lldb::SBListener *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBBroadcaster **)&jarg1; - arg2 = *(lldb::SBListener **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBListener const & is null"); - return 0; - } - result = (bool)(arg1)->RemoveListener((lldb::SBListener const &)*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBCommandInterpreter_1eBroadcastBitThreadShouldExit_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)lldb::SBCommandInterpreter::eBroadcastBitThreadShouldExit; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBCommandInterpreter_1eBroadcastBitResetPrompt_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)lldb::SBCommandInterpreter::eBroadcastBitResetPrompt; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBCommandInterpreter_1eBroadcastBitQuitCommandReceived_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)lldb::SBCommandInterpreter::eBroadcastBitQuitCommandReceived; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBCommandInterpreter_1eBroadcastBitAsynchronousOutputData_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)lldb::SBCommandInterpreter::eBroadcastBitAsynchronousOutputData; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBCommandInterpreter_1eBroadcastBitAsynchronousErrorData_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)lldb::SBCommandInterpreter::eBroadcastBitAsynchronousErrorData; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBCommandInterpreter(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBCommandInterpreter *arg1 = 0 ; - lldb::SBCommandInterpreter *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandInterpreter **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBCommandInterpreter const & is null"); - return 0; - } - result = (lldb::SBCommandInterpreter *)new lldb::SBCommandInterpreter((lldb::SBCommandInterpreter const &)*arg1); - *(lldb::SBCommandInterpreter **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBCommandInterpreter(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBCommandInterpreter *arg1 = (lldb::SBCommandInterpreter *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBCommandInterpreter **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBCommandInterpreter_1GetArgumentTypeAsCString(JNIEnv *jenv, jclass jcls, jint jarg1) { - jstring jresult = 0 ; - lldb::CommandArgumentType arg1 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - arg1 = (lldb::CommandArgumentType)jarg1; - result = (char *)lldb::SBCommandInterpreter::GetArgumentTypeAsCString(arg1); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBCommandInterpreter_1GetArgumentDescriptionAsCString(JNIEnv *jenv, jclass jcls, jint jarg1) { - jstring jresult = 0 ; - lldb::CommandArgumentType arg1 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - arg1 = (lldb::CommandArgumentType)jarg1; - result = (char *)lldb::SBCommandInterpreter::GetArgumentDescriptionAsCString(arg1); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBCommandInterpreter_1EventIsCommandInterpreterEvent(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBEvent *arg1 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEvent **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent const & is null"); - return 0; - } - result = (bool)lldb::SBCommandInterpreter::EventIsCommandInterpreterEvent((lldb::SBEvent const &)*arg1); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBCommandInterpreter_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBCommandInterpreter *arg1 = (lldb::SBCommandInterpreter *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandInterpreter **)&jarg1; - result = (bool)((lldb::SBCommandInterpreter const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBCommandInterpreter_1CommandExists(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jboolean jresult = 0 ; - lldb::SBCommandInterpreter *arg1 = (lldb::SBCommandInterpreter *) 0 ; - char *arg2 = (char *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandInterpreter **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (bool)(arg1)->CommandExists((char const *)arg2); - jresult = (jboolean)result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBCommandInterpreter_1UserCommandExists(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jboolean jresult = 0 ; - lldb::SBCommandInterpreter *arg1 = (lldb::SBCommandInterpreter *) 0 ; - char *arg2 = (char *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandInterpreter **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (bool)(arg1)->UserCommandExists((char const *)arg2); - jresult = (jboolean)result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBCommandInterpreter_1AliasExists(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jboolean jresult = 0 ; - lldb::SBCommandInterpreter *arg1 = (lldb::SBCommandInterpreter *) 0 ; - char *arg2 = (char *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandInterpreter **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (bool)(arg1)->AliasExists((char const *)arg2); - jresult = (jboolean)result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBCommandInterpreter_1GetBroadcaster(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBCommandInterpreter *arg1 = (lldb::SBCommandInterpreter *) 0 ; - lldb::SBBroadcaster result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandInterpreter **)&jarg1; - result = (arg1)->GetBroadcaster(); - *(lldb::SBBroadcaster **)&jresult = new lldb::SBBroadcaster(result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBCommandInterpreter_1GetBroadcasterClass(JNIEnv *jenv, jclass jcls) { - jstring jresult = 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - result = (char *)lldb::SBCommandInterpreter::GetBroadcasterClass(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBCommandInterpreter_1HasCommands(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBCommandInterpreter *arg1 = (lldb::SBCommandInterpreter *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandInterpreter **)&jarg1; - result = (bool)(arg1)->HasCommands(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBCommandInterpreter_1HasAliases(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBCommandInterpreter *arg1 = (lldb::SBCommandInterpreter *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandInterpreter **)&jarg1; - result = (bool)(arg1)->HasAliases(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBCommandInterpreter_1HasAliasOptions(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBCommandInterpreter *arg1 = (lldb::SBCommandInterpreter *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandInterpreter **)&jarg1; - result = (bool)(arg1)->HasAliasOptions(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBCommandInterpreter_1IsInteractive(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBCommandInterpreter *arg1 = (lldb::SBCommandInterpreter *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandInterpreter **)&jarg1; - result = (bool)(arg1)->IsInteractive(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBCommandInterpreter_1GetProcess(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBCommandInterpreter *arg1 = (lldb::SBCommandInterpreter *) 0 ; - lldb::SBProcess result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandInterpreter **)&jarg1; - result = (arg1)->GetProcess(); - *(lldb::SBProcess **)&jresult = new lldb::SBProcess(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBCommandInterpreter_1GetDebugger(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBCommandInterpreter *arg1 = (lldb::SBCommandInterpreter *) 0 ; - lldb::SBDebugger result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandInterpreter **)&jarg1; - result = (arg1)->GetDebugger(); - *(lldb::SBDebugger **)&jresult = new lldb::SBDebugger(result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBCommandInterpreter_1SourceInitFileInHomeDirectory_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBCommandInterpreter *arg1 = (lldb::SBCommandInterpreter *) 0 ; - lldb::SBCommandReturnObject *arg2 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBCommandInterpreter **)&jarg1; - arg2 = *(lldb::SBCommandReturnObject **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBCommandReturnObject & is null"); - return ; - } - (arg1)->SourceInitFileInHomeDirectory(*arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBCommandInterpreter_1SourceInitFileInHomeDirectory_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jboolean jarg3) { - lldb::SBCommandInterpreter *arg1 = (lldb::SBCommandInterpreter *) 0 ; - lldb::SBCommandReturnObject *arg2 = 0 ; - bool arg3 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBCommandInterpreter **)&jarg1; - arg2 = *(lldb::SBCommandReturnObject **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBCommandReturnObject & is null"); - return ; - } - arg3 = jarg3 ? true : false; - (arg1)->SourceInitFileInHomeDirectory(*arg2,arg3); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBCommandInterpreter_1SourceInitFileInCurrentWorkingDirectory(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBCommandInterpreter *arg1 = (lldb::SBCommandInterpreter *) 0 ; - lldb::SBCommandReturnObject *arg2 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBCommandInterpreter **)&jarg1; - arg2 = *(lldb::SBCommandReturnObject **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBCommandReturnObject & is null"); - return ; - } - (arg1)->SourceInitFileInCurrentWorkingDirectory(*arg2); -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBCommandInterpreter_1HandleCommand_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jobject jarg3_, jboolean jarg4) { - jint jresult = 0 ; - lldb::SBCommandInterpreter *arg1 = (lldb::SBCommandInterpreter *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBCommandReturnObject *arg3 = 0 ; - bool arg4 ; - lldb::ReturnStatus result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - arg1 = *(lldb::SBCommandInterpreter **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = *(lldb::SBCommandReturnObject **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBCommandReturnObject & is null"); - return 0; - } - arg4 = jarg4 ? true : false; - result = (lldb::ReturnStatus)(arg1)->HandleCommand((char const *)arg2,*arg3,arg4); - jresult = (jint)result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBCommandInterpreter_1HandleCommand_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jobject jarg3_) { - jint jresult = 0 ; - lldb::SBCommandInterpreter *arg1 = (lldb::SBCommandInterpreter *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBCommandReturnObject *arg3 = 0 ; - lldb::ReturnStatus result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - arg1 = *(lldb::SBCommandInterpreter **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = *(lldb::SBCommandReturnObject **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBCommandReturnObject & is null"); - return 0; - } - result = (lldb::ReturnStatus)(arg1)->HandleCommand((char const *)arg2,*arg3); - jresult = (jint)result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBCommandInterpreter_1HandleCommand_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jobject jarg3_, jlong jarg4, jobject jarg4_, jboolean jarg5) { - jint jresult = 0 ; - lldb::SBCommandInterpreter *arg1 = (lldb::SBCommandInterpreter *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBExecutionContext *arg3 = 0 ; - lldb::SBCommandReturnObject *arg4 = 0 ; - bool arg5 ; - lldb::ReturnStatus result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - (void)jarg4_; - arg1 = *(lldb::SBCommandInterpreter **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = *(lldb::SBExecutionContext **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBExecutionContext & is null"); - return 0; - } - arg4 = *(lldb::SBCommandReturnObject **)&jarg4; - if (!arg4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBCommandReturnObject & is null"); - return 0; - } - arg5 = jarg5 ? true : false; - result = (lldb::ReturnStatus)(arg1)->HandleCommand((char const *)arg2,*arg3,*arg4,arg5); - jresult = (jint)result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBCommandInterpreter_1HandleCommand_1_1SWIG_13(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jobject jarg3_, jlong jarg4, jobject jarg4_) { - jint jresult = 0 ; - lldb::SBCommandInterpreter *arg1 = (lldb::SBCommandInterpreter *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBExecutionContext *arg3 = 0 ; - lldb::SBCommandReturnObject *arg4 = 0 ; - lldb::ReturnStatus result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - (void)jarg4_; - arg1 = *(lldb::SBCommandInterpreter **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = *(lldb::SBExecutionContext **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBExecutionContext & is null"); - return 0; - } - arg4 = *(lldb::SBCommandReturnObject **)&jarg4; - if (!arg4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBCommandReturnObject & is null"); - return 0; - } - result = (lldb::ReturnStatus)(arg1)->HandleCommand((char const *)arg2,*arg3,*arg4); - jresult = (jint)result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBCommandInterpreter_1HandleCommandsFromFile(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_, jlong jarg4, jobject jarg4_, jlong jarg5, jobject jarg5_) { - lldb::SBCommandInterpreter *arg1 = (lldb::SBCommandInterpreter *) 0 ; - lldb::SBFileSpec *arg2 = 0 ; - lldb::SBExecutionContext *arg3 = 0 ; - lldb::SBCommandInterpreterRunOptions *arg4 = 0 ; - lldb::SBCommandReturnObject arg5 ; - lldb::SBCommandReturnObject *argp5 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - (void)jarg4_; - (void)jarg5_; - arg1 = *(lldb::SBCommandInterpreter **)&jarg1; - arg2 = *(lldb::SBFileSpec **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec & is null"); - return ; - } - arg3 = *(lldb::SBExecutionContext **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBExecutionContext & is null"); - return ; - } - arg4 = *(lldb::SBCommandInterpreterRunOptions **)&jarg4; - if (!arg4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBCommandInterpreterRunOptions & is null"); - return ; - } - argp5 = *(lldb::SBCommandReturnObject **)&jarg5; - if (!argp5) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBCommandReturnObject"); - return ; - } - arg5 = *argp5; - (arg1)->HandleCommandsFromFile(*arg2,*arg3,*arg4,arg5); -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBCommandInterpreter_1HandleCompletion(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jint jarg4, jint jarg5, jlong jarg6, jobject jarg6_) { - jint jresult = 0 ; - lldb::SBCommandInterpreter *arg1 = (lldb::SBCommandInterpreter *) 0 ; - char *arg2 = (char *) 0 ; - uint32_t arg3 ; - int arg4 ; - int arg5 ; - lldb::SBStringList *arg6 = 0 ; - int result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg6_; - arg1 = *(lldb::SBCommandInterpreter **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = (uint32_t)jarg3; - arg4 = (int)jarg4; - arg5 = (int)jarg5; - arg6 = *(lldb::SBStringList **)&jarg6; - if (!arg6) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStringList & is null"); - return 0; - } - result = (int)(arg1)->HandleCompletion((char const *)arg2,arg3,arg4,arg5,*arg6); - jresult = (jint)result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBCommandInterpreter_1HandleCompletionWithDescriptions(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jint jarg4, jint jarg5, jlong jarg6, jobject jarg6_, jlong jarg7, jobject jarg7_) { - jint jresult = 0 ; - lldb::SBCommandInterpreter *arg1 = (lldb::SBCommandInterpreter *) 0 ; - char *arg2 = (char *) 0 ; - uint32_t arg3 ; - int arg4 ; - int arg5 ; - lldb::SBStringList *arg6 = 0 ; - lldb::SBStringList *arg7 = 0 ; - int result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg6_; - (void)jarg7_; - arg1 = *(lldb::SBCommandInterpreter **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = (uint32_t)jarg3; - arg4 = (int)jarg4; - arg5 = (int)jarg5; - arg6 = *(lldb::SBStringList **)&jarg6; - if (!arg6) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStringList & is null"); - return 0; - } - arg7 = *(lldb::SBStringList **)&jarg7; - if (!arg7) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStringList & is null"); - return 0; - } - result = (int)(arg1)->HandleCompletionWithDescriptions((char const *)arg2,arg3,arg4,arg5,*arg6,*arg7); - jresult = (jint)result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBCommandInterpreter_1WasInterrupted(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBCommandInterpreter *arg1 = (lldb::SBCommandInterpreter *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandInterpreter **)&jarg1; - result = (bool)((lldb::SBCommandInterpreter const *)arg1)->WasInterrupted(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBCommandInterpreter_1InterruptCommand(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBCommandInterpreter *arg1 = (lldb::SBCommandInterpreter *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandInterpreter **)&jarg1; - result = (bool)(arg1)->InterruptCommand(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBCommandInterpreter_1IsActive(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBCommandInterpreter *arg1 = (lldb::SBCommandInterpreter *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandInterpreter **)&jarg1; - result = (bool)(arg1)->IsActive(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBCommandInterpreter_1GetIOHandlerControlSequence(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jchar jarg2) { - jstring jresult = 0 ; - lldb::SBCommandInterpreter *arg1 = (lldb::SBCommandInterpreter *) 0 ; - char arg2 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandInterpreter **)&jarg1; - arg2 = (char)jarg2; - result = (char *)(arg1)->GetIOHandlerControlSequence(arg2); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBCommandInterpreter_1GetPromptOnQuit(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBCommandInterpreter *arg1 = (lldb::SBCommandInterpreter *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandInterpreter **)&jarg1; - result = (bool)(arg1)->GetPromptOnQuit(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBCommandInterpreter_1SetPromptOnQuit(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBCommandInterpreter *arg1 = (lldb::SBCommandInterpreter *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandInterpreter **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetPromptOnQuit(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBCommandInterpreter_1AllowExitCodeOnQuit(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBCommandInterpreter *arg1 = (lldb::SBCommandInterpreter *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandInterpreter **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->AllowExitCodeOnQuit(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBCommandInterpreter_1HasCustomQuitExitCode(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBCommandInterpreter *arg1 = (lldb::SBCommandInterpreter *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandInterpreter **)&jarg1; - result = (bool)(arg1)->HasCustomQuitExitCode(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBCommandInterpreter_1GetQuitStatus(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBCommandInterpreter *arg1 = (lldb::SBCommandInterpreter *) 0 ; - int result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandInterpreter **)&jarg1; - result = (int)(arg1)->GetQuitStatus(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBCommandInterpreter_1ResolveCommand(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jobject jarg3_) { - lldb::SBCommandInterpreter *arg1 = (lldb::SBCommandInterpreter *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBCommandReturnObject *arg3 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - arg1 = *(lldb::SBCommandInterpreter **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - arg3 = *(lldb::SBCommandReturnObject **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBCommandReturnObject & is null"); - return ; - } - (arg1)->ResolveCommand((char const *)arg2,*arg3); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBCommandInterpreterRunOptions_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBCommandInterpreterRunOptions *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBCommandInterpreterRunOptions *)new lldb::SBCommandInterpreterRunOptions(); - *(lldb::SBCommandInterpreterRunOptions **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBCommandInterpreterRunOptions_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBCommandInterpreterRunOptions *arg1 = 0 ; - lldb::SBCommandInterpreterRunOptions *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandInterpreterRunOptions **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBCommandInterpreterRunOptions const & is null"); - return 0; - } - result = (lldb::SBCommandInterpreterRunOptions *)new lldb::SBCommandInterpreterRunOptions((lldb::SBCommandInterpreterRunOptions const &)*arg1); - *(lldb::SBCommandInterpreterRunOptions **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBCommandInterpreterRunOptions(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBCommandInterpreterRunOptions *arg1 = (lldb::SBCommandInterpreterRunOptions *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBCommandInterpreterRunOptions **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBCommandInterpreterRunOptions_1GetStopOnContinue(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBCommandInterpreterRunOptions *arg1 = (lldb::SBCommandInterpreterRunOptions *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandInterpreterRunOptions **)&jarg1; - result = (bool)((lldb::SBCommandInterpreterRunOptions const *)arg1)->GetStopOnContinue(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBCommandInterpreterRunOptions_1SetStopOnContinue(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBCommandInterpreterRunOptions *arg1 = (lldb::SBCommandInterpreterRunOptions *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandInterpreterRunOptions **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetStopOnContinue(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBCommandInterpreterRunOptions_1GetStopOnError(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBCommandInterpreterRunOptions *arg1 = (lldb::SBCommandInterpreterRunOptions *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandInterpreterRunOptions **)&jarg1; - result = (bool)((lldb::SBCommandInterpreterRunOptions const *)arg1)->GetStopOnError(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBCommandInterpreterRunOptions_1SetStopOnError(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBCommandInterpreterRunOptions *arg1 = (lldb::SBCommandInterpreterRunOptions *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandInterpreterRunOptions **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetStopOnError(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBCommandInterpreterRunOptions_1GetStopOnCrash(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBCommandInterpreterRunOptions *arg1 = (lldb::SBCommandInterpreterRunOptions *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandInterpreterRunOptions **)&jarg1; - result = (bool)((lldb::SBCommandInterpreterRunOptions const *)arg1)->GetStopOnCrash(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBCommandInterpreterRunOptions_1SetStopOnCrash(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBCommandInterpreterRunOptions *arg1 = (lldb::SBCommandInterpreterRunOptions *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandInterpreterRunOptions **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetStopOnCrash(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBCommandInterpreterRunOptions_1GetEchoCommands(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBCommandInterpreterRunOptions *arg1 = (lldb::SBCommandInterpreterRunOptions *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandInterpreterRunOptions **)&jarg1; - result = (bool)((lldb::SBCommandInterpreterRunOptions const *)arg1)->GetEchoCommands(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBCommandInterpreterRunOptions_1SetEchoCommands(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBCommandInterpreterRunOptions *arg1 = (lldb::SBCommandInterpreterRunOptions *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandInterpreterRunOptions **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetEchoCommands(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBCommandInterpreterRunOptions_1GetEchoCommentCommands(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBCommandInterpreterRunOptions *arg1 = (lldb::SBCommandInterpreterRunOptions *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandInterpreterRunOptions **)&jarg1; - result = (bool)((lldb::SBCommandInterpreterRunOptions const *)arg1)->GetEchoCommentCommands(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBCommandInterpreterRunOptions_1SetEchoCommentCommands(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBCommandInterpreterRunOptions *arg1 = (lldb::SBCommandInterpreterRunOptions *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandInterpreterRunOptions **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetEchoCommentCommands(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBCommandInterpreterRunOptions_1GetPrintResults(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBCommandInterpreterRunOptions *arg1 = (lldb::SBCommandInterpreterRunOptions *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandInterpreterRunOptions **)&jarg1; - result = (bool)((lldb::SBCommandInterpreterRunOptions const *)arg1)->GetPrintResults(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBCommandInterpreterRunOptions_1SetPrintResults(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBCommandInterpreterRunOptions *arg1 = (lldb::SBCommandInterpreterRunOptions *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandInterpreterRunOptions **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetPrintResults(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBCommandInterpreterRunOptions_1GetPrintErrors(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBCommandInterpreterRunOptions *arg1 = (lldb::SBCommandInterpreterRunOptions *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandInterpreterRunOptions **)&jarg1; - result = (bool)((lldb::SBCommandInterpreterRunOptions const *)arg1)->GetPrintErrors(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBCommandInterpreterRunOptions_1SetPrintErrors(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBCommandInterpreterRunOptions *arg1 = (lldb::SBCommandInterpreterRunOptions *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandInterpreterRunOptions **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetPrintErrors(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBCommandInterpreterRunOptions_1GetAddToHistory(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBCommandInterpreterRunOptions *arg1 = (lldb::SBCommandInterpreterRunOptions *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandInterpreterRunOptions **)&jarg1; - result = (bool)((lldb::SBCommandInterpreterRunOptions const *)arg1)->GetAddToHistory(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBCommandInterpreterRunOptions_1SetAddToHistory(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBCommandInterpreterRunOptions *arg1 = (lldb::SBCommandInterpreterRunOptions *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandInterpreterRunOptions **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetAddToHistory(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBCommandInterpreterRunOptions_1GetAutoHandleEvents(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBCommandInterpreterRunOptions *arg1 = (lldb::SBCommandInterpreterRunOptions *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandInterpreterRunOptions **)&jarg1; - result = (bool)((lldb::SBCommandInterpreterRunOptions const *)arg1)->GetAutoHandleEvents(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBCommandInterpreterRunOptions_1SetAutoHandleEvents(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBCommandInterpreterRunOptions *arg1 = (lldb::SBCommandInterpreterRunOptions *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandInterpreterRunOptions **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetAutoHandleEvents(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBCommandInterpreterRunOptions_1GetSpawnThread(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBCommandInterpreterRunOptions *arg1 = (lldb::SBCommandInterpreterRunOptions *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandInterpreterRunOptions **)&jarg1; - result = (bool)((lldb::SBCommandInterpreterRunOptions const *)arg1)->GetSpawnThread(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBCommandInterpreterRunOptions_1SetSpawnThread(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBCommandInterpreterRunOptions *arg1 = (lldb::SBCommandInterpreterRunOptions *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandInterpreterRunOptions **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetSpawnThread(arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBCommandReturnObject_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBCommandReturnObject *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBCommandReturnObject *)new lldb::SBCommandReturnObject(); - *(lldb::SBCommandReturnObject **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBCommandReturnObject_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBCommandReturnObject *arg1 = 0 ; - lldb::SBCommandReturnObject *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandReturnObject **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBCommandReturnObject const & is null"); - return 0; - } - result = (lldb::SBCommandReturnObject *)new lldb::SBCommandReturnObject((lldb::SBCommandReturnObject const &)*arg1); - *(lldb::SBCommandReturnObject **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBCommandReturnObject(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBCommandReturnObject *arg1 = (lldb::SBCommandReturnObject *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBCommandReturnObject **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBCommandReturnObject_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBCommandReturnObject *arg1 = (lldb::SBCommandReturnObject *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandReturnObject **)&jarg1; - result = (bool)((lldb::SBCommandReturnObject const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBCommandReturnObject_1GetOutput_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBCommandReturnObject *arg1 = (lldb::SBCommandReturnObject *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandReturnObject **)&jarg1; - result = (char *)(arg1)->GetOutput(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBCommandReturnObject_1GetError_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBCommandReturnObject *arg1 = (lldb::SBCommandReturnObject *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandReturnObject **)&jarg1; - result = (char *)(arg1)->GetError(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBCommandReturnObject_1PutOutput_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBCommandReturnObject *arg1 = (lldb::SBCommandReturnObject *) 0 ; - lldb::SBFile arg2 ; - lldb::SBFile *argp2 ; - size_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBCommandReturnObject **)&jarg1; - argp2 = *(lldb::SBFile **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBFile"); - return 0; - } - arg2 = *argp2; - result = (arg1)->PutOutput(arg2); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBCommandReturnObject_1PutOutput_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBCommandReturnObject *arg1 = (lldb::SBCommandReturnObject *) 0 ; - SwigValueWrapper< std::shared_ptr< lldb_private::File > > arg2 ; - lldb::FileSP *argp2 ; - size_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandReturnObject **)&jarg1; - argp2 = *(lldb::FileSP **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::FileSP"); - return 0; - } - arg2 = *argp2; - result = (arg1)->PutOutput(arg2); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBCommandReturnObject_1GetOutputSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBCommandReturnObject *arg1 = (lldb::SBCommandReturnObject *) 0 ; - size_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandReturnObject **)&jarg1; - result = (arg1)->GetOutputSize(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBCommandReturnObject_1GetErrorSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBCommandReturnObject *arg1 = (lldb::SBCommandReturnObject *) 0 ; - size_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandReturnObject **)&jarg1; - result = (arg1)->GetErrorSize(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBCommandReturnObject_1PutError_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBCommandReturnObject *arg1 = (lldb::SBCommandReturnObject *) 0 ; - lldb::SBFile arg2 ; - lldb::SBFile *argp2 ; - size_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBCommandReturnObject **)&jarg1; - argp2 = *(lldb::SBFile **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBFile"); - return 0; - } - arg2 = *argp2; - result = (arg1)->PutError(arg2); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBCommandReturnObject_1PutError_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBCommandReturnObject *arg1 = (lldb::SBCommandReturnObject *) 0 ; - SwigValueWrapper< std::shared_ptr< lldb_private::File > > arg2 ; - lldb::FileSP *argp2 ; - size_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandReturnObject **)&jarg1; - argp2 = *(lldb::FileSP **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::FileSP"); - return 0; - } - arg2 = *argp2; - result = (arg1)->PutError(arg2); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBCommandReturnObject_1Clear(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBCommandReturnObject *arg1 = (lldb::SBCommandReturnObject *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandReturnObject **)&jarg1; - (arg1)->Clear(); -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBCommandReturnObject_1GetStatus(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBCommandReturnObject *arg1 = (lldb::SBCommandReturnObject *) 0 ; - lldb::ReturnStatus result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandReturnObject **)&jarg1; - result = (lldb::ReturnStatus)(arg1)->GetStatus(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBCommandReturnObject_1SetStatus(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - lldb::SBCommandReturnObject *arg1 = (lldb::SBCommandReturnObject *) 0 ; - lldb::ReturnStatus arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandReturnObject **)&jarg1; - arg2 = (lldb::ReturnStatus)jarg2; - (arg1)->SetStatus(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBCommandReturnObject_1Succeeded(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBCommandReturnObject *arg1 = (lldb::SBCommandReturnObject *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandReturnObject **)&jarg1; - result = (bool)(arg1)->Succeeded(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBCommandReturnObject_1HasResult(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBCommandReturnObject *arg1 = (lldb::SBCommandReturnObject *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandReturnObject **)&jarg1; - result = (bool)(arg1)->HasResult(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBCommandReturnObject_1AppendMessage(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBCommandReturnObject *arg1 = (lldb::SBCommandReturnObject *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandReturnObject **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->AppendMessage((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBCommandReturnObject_1AppendWarning(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBCommandReturnObject *arg1 = (lldb::SBCommandReturnObject *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandReturnObject **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->AppendWarning((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBCommandReturnObject_1GetDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBCommandReturnObject *arg1 = (lldb::SBCommandReturnObject *) 0 ; - lldb::SBStream *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBCommandReturnObject **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - result = (bool)(arg1)->GetDescription(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBCommandReturnObject_1SetImmediateOutputFile_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBCommandReturnObject *arg1 = (lldb::SBCommandReturnObject *) 0 ; - lldb::SBFile arg2 ; - lldb::SBFile *argp2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBCommandReturnObject **)&jarg1; - argp2 = *(lldb::SBFile **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBFile"); - return ; - } - arg2 = *argp2; - (arg1)->SetImmediateOutputFile(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBCommandReturnObject_1SetImmediateErrorFile_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBCommandReturnObject *arg1 = (lldb::SBCommandReturnObject *) 0 ; - lldb::SBFile arg2 ; - lldb::SBFile *argp2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBCommandReturnObject **)&jarg1; - argp2 = *(lldb::SBFile **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBFile"); - return ; - } - arg2 = *argp2; - (arg1)->SetImmediateErrorFile(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBCommandReturnObject_1SetImmediateOutputFile_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - lldb::SBCommandReturnObject *arg1 = (lldb::SBCommandReturnObject *) 0 ; - SwigValueWrapper< std::shared_ptr< lldb_private::File > > arg2 ; - lldb::FileSP *argp2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandReturnObject **)&jarg1; - argp2 = *(lldb::FileSP **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::FileSP"); - return ; - } - arg2 = *argp2; - (arg1)->SetImmediateOutputFile(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBCommandReturnObject_1SetImmediateErrorFile_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - lldb::SBCommandReturnObject *arg1 = (lldb::SBCommandReturnObject *) 0 ; - SwigValueWrapper< std::shared_ptr< lldb_private::File > > arg2 ; - lldb::FileSP *argp2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandReturnObject **)&jarg1; - argp2 = *(lldb::FileSP **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::FileSP"); - return ; - } - arg2 = *argp2; - (arg1)->SetImmediateErrorFile(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBCommandReturnObject_1PutCString_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jint jarg3) { - lldb::SBCommandReturnObject *arg1 = (lldb::SBCommandReturnObject *) 0 ; - char *arg2 = (char *) 0 ; - int arg3 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandReturnObject **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - arg3 = (int)jarg3; - (arg1)->PutCString((char const *)arg2,arg3); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBCommandReturnObject_1PutCString_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBCommandReturnObject *arg1 = (lldb::SBCommandReturnObject *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandReturnObject **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->PutCString((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBCommandReturnObject_1GetOutput_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - jstring jresult = 0 ; - lldb::SBCommandReturnObject *arg1 = (lldb::SBCommandReturnObject *) 0 ; - bool arg2 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandReturnObject **)&jarg1; - arg2 = jarg2 ? true : false; - result = (char *)(arg1)->GetOutput(arg2); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBCommandReturnObject_1GetError_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - jstring jresult = 0 ; - lldb::SBCommandReturnObject *arg1 = (lldb::SBCommandReturnObject *) 0 ; - bool arg2 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandReturnObject **)&jarg1; - arg2 = jarg2 ? true : false; - result = (char *)(arg1)->GetError(arg2); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBCommandReturnObject_1SetError_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jstring jarg3) { - lldb::SBCommandReturnObject *arg1 = (lldb::SBCommandReturnObject *) 0 ; - lldb::SBError *arg2 = 0 ; - char *arg3 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBCommandReturnObject **)&jarg1; - arg2 = *(lldb::SBError **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return ; - } - arg3 = 0; - if (jarg3) { - arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); - if (!arg3) return ; - } - (arg1)->SetError(*arg2,(char const *)arg3); - if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBCommandReturnObject_1SetError_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBCommandReturnObject *arg1 = (lldb::SBCommandReturnObject *) 0 ; - lldb::SBError *arg2 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBCommandReturnObject **)&jarg1; - arg2 = *(lldb::SBError **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return ; - } - (arg1)->SetError(*arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBCommandReturnObject_1SetError_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBCommandReturnObject *arg1 = (lldb::SBCommandReturnObject *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandReturnObject **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->SetError((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBCommandReturnObject_1_1_1repr_1_1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBCommandReturnObject *arg1 = (lldb::SBCommandReturnObject *) 0 ; - std::string result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandReturnObject **)&jarg1; - result = lldb_SBCommandReturnObject___repr__(arg1); - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBCommandReturnObject_1SetImmediateOutputFile_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jboolean jarg3) { - lldb::SBCommandReturnObject *arg1 = (lldb::SBCommandReturnObject *) 0 ; - SwigValueWrapper< std::shared_ptr< lldb_private::File > > arg2 ; - bool arg3 ; - lldb::FileSP *argp2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandReturnObject **)&jarg1; - argp2 = *(lldb::FileSP **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::FileSP"); - return ; - } - arg2 = *argp2; - arg3 = jarg3 ? true : false; - lldb_SBCommandReturnObject_SetImmediateOutputFile__SWIG_2(arg1,SWIG_STD_MOVE(arg2),arg3); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBCommandReturnObject_1SetImmediateErrorFile_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jboolean jarg3) { - lldb::SBCommandReturnObject *arg1 = (lldb::SBCommandReturnObject *) 0 ; - SwigValueWrapper< std::shared_ptr< lldb_private::File > > arg2 ; - bool arg3 ; - lldb::FileSP *argp2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandReturnObject **)&jarg1; - argp2 = *(lldb::FileSP **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::FileSP"); - return ; - } - arg2 = *argp2; - arg3 = jarg3 ? true : false; - lldb_SBCommandReturnObject_SetImmediateErrorFile__SWIG_2(arg1,SWIG_STD_MOVE(arg2),arg3); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBCommandReturnObject_1Print(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBCommandReturnObject *arg1 = (lldb::SBCommandReturnObject *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommandReturnObject **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - lldb_SBCommandReturnObject_Print(arg1,(char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBCommunication_1eBroadcastBitDisconnected_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)lldb::SBCommunication::eBroadcastBitDisconnected; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBCommunication_1eBroadcastBitReadThreadGotBytes_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)lldb::SBCommunication::eBroadcastBitReadThreadGotBytes; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBCommunication_1eBroadcastBitReadThreadDidExit_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)lldb::SBCommunication::eBroadcastBitReadThreadDidExit; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBCommunication_1eBroadcastBitReadThreadShouldExit_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)lldb::SBCommunication::eBroadcastBitReadThreadShouldExit; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBCommunication_1eBroadcastBitPacketAvailable_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)lldb::SBCommunication::eBroadcastBitPacketAvailable; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBCommunication_1eAllEventBits_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)lldb::SBCommunication::eAllEventBits; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBCommunication_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBCommunication *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBCommunication *)new lldb::SBCommunication(); - *(lldb::SBCommunication **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBCommunication_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jstring jarg1) { - jlong jresult = 0 ; - char *arg1 = (char *) 0 ; - lldb::SBCommunication *result = 0 ; - - (void)jenv; - (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - result = (lldb::SBCommunication *)new lldb::SBCommunication((char const *)arg1); - *(lldb::SBCommunication **)&jresult = result; - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBCommunication(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBCommunication *arg1 = (lldb::SBCommunication *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBCommunication **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBCommunication_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBCommunication *arg1 = (lldb::SBCommunication *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommunication **)&jarg1; - result = (bool)((lldb::SBCommunication const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBCommunication_1GetBroadcaster(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBCommunication *arg1 = (lldb::SBCommunication *) 0 ; - lldb::SBBroadcaster result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommunication **)&jarg1; - result = (arg1)->GetBroadcaster(); - *(lldb::SBBroadcaster **)&jresult = new lldb::SBBroadcaster(result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBCommunication_1GetBroadcasterClass(JNIEnv *jenv, jclass jcls) { - jstring jresult = 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - result = (char *)lldb::SBCommunication::GetBroadcasterClass(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBCommunication_1AdoptFileDesriptor(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jboolean jarg3) { - jint jresult = 0 ; - lldb::SBCommunication *arg1 = (lldb::SBCommunication *) 0 ; - int arg2 ; - bool arg3 ; - lldb::ConnectionStatus result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommunication **)&jarg1; - arg2 = (int)jarg2; - arg3 = jarg3 ? true : false; - result = (lldb::ConnectionStatus)(arg1)->AdoptFileDesriptor(arg2,arg3); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBCommunication_1Connect(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jint jresult = 0 ; - lldb::SBCommunication *arg1 = (lldb::SBCommunication *) 0 ; - char *arg2 = (char *) 0 ; - lldb::ConnectionStatus result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommunication **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (lldb::ConnectionStatus)(arg1)->Connect((char const *)arg2); - jresult = (jint)result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBCommunication_1Disconnect(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBCommunication *arg1 = (lldb::SBCommunication *) 0 ; - lldb::ConnectionStatus result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommunication **)&jarg1; - result = (lldb::ConnectionStatus)(arg1)->Disconnect(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBCommunication_1IsConnected(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBCommunication *arg1 = (lldb::SBCommunication *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommunication **)&jarg1; - result = (bool)((lldb::SBCommunication const *)arg1)->IsConnected(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBCommunication_1GetCloseOnEOF(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBCommunication *arg1 = (lldb::SBCommunication *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommunication **)&jarg1; - result = (bool)(arg1)->GetCloseOnEOF(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBCommunication_1SetCloseOnEOF(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBCommunication *arg1 = (lldb::SBCommunication *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommunication **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetCloseOnEOF(arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBCommunication_1Read(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jlong jarg3, jlong jarg4, jlong jarg5) { - jlong jresult = 0 ; - lldb::SBCommunication *arg1 = (lldb::SBCommunication *) 0 ; - void *arg2 = (void *) 0 ; - size_t arg3 ; - uint32_t arg4 ; - lldb::ConnectionStatus *arg5 = 0 ; - size_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommunication **)&jarg1; - arg2 = *(void **)&jarg2; - arg3 = (size_t)jarg3; - arg4 = (uint32_t)jarg4; - arg5 = *(lldb::ConnectionStatus **)&jarg5; - if (!arg5) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::ConnectionStatus & is null"); - return 0; - } - result = (arg1)->Read(arg2,arg3,arg4,*arg5); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBCommunication_1Write(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jlong jarg3, jlong jarg4) { - jlong jresult = 0 ; - lldb::SBCommunication *arg1 = (lldb::SBCommunication *) 0 ; - void *arg2 = (void *) 0 ; - size_t arg3 ; - lldb::ConnectionStatus *arg4 = 0 ; - size_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommunication **)&jarg1; - arg2 = *(void **)&jarg2; - arg3 = (size_t)jarg3; - arg4 = *(lldb::ConnectionStatus **)&jarg4; - if (!arg4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::ConnectionStatus & is null"); - return 0; - } - result = (arg1)->Write((void const *)arg2,arg3,*arg4); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBCommunication_1ReadThreadStart(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBCommunication *arg1 = (lldb::SBCommunication *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommunication **)&jarg1; - result = (bool)(arg1)->ReadThreadStart(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBCommunication_1ReadThreadStop(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBCommunication *arg1 = (lldb::SBCommunication *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommunication **)&jarg1; - result = (bool)(arg1)->ReadThreadStop(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBCommunication_1ReadThreadIsRunning(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBCommunication *arg1 = (lldb::SBCommunication *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommunication **)&jarg1; - result = (bool)(arg1)->ReadThreadIsRunning(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBCommunication_1SetReadThreadBytesReceivedCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jlong jarg3) { - jboolean jresult = 0 ; - lldb::SBCommunication *arg1 = (lldb::SBCommunication *) 0 ; - lldb::SBCommunication::ReadThreadBytesReceived arg2 = (lldb::SBCommunication::ReadThreadBytesReceived) 0 ; - void *arg3 = (void *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCommunication **)&jarg1; - arg2 = *(lldb::SBCommunication::ReadThreadBytesReceived *)&jarg2; - arg3 = *(void **)&jarg3; - result = (bool)(arg1)->SetReadThreadBytesReceivedCallback(arg2,arg3); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBCompileUnit_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBCompileUnit *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBCompileUnit *)new lldb::SBCompileUnit(); - *(lldb::SBCompileUnit **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBCompileUnit_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBCompileUnit *arg1 = 0 ; - lldb::SBCompileUnit *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCompileUnit **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBCompileUnit const & is null"); - return 0; - } - result = (lldb::SBCompileUnit *)new lldb::SBCompileUnit((lldb::SBCompileUnit const &)*arg1); - *(lldb::SBCompileUnit **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBCompileUnit(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBCompileUnit *arg1 = (lldb::SBCompileUnit *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBCompileUnit **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBCompileUnit_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBCompileUnit *arg1 = (lldb::SBCompileUnit *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCompileUnit **)&jarg1; - result = (bool)((lldb::SBCompileUnit const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBCompileUnit_1GetFileSpec(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBCompileUnit *arg1 = (lldb::SBCompileUnit *) 0 ; - lldb::SBFileSpec result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCompileUnit **)&jarg1; - result = ((lldb::SBCompileUnit const *)arg1)->GetFileSpec(); - *(lldb::SBFileSpec **)&jresult = new lldb::SBFileSpec(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBCompileUnit_1GetNumLineEntries(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBCompileUnit *arg1 = (lldb::SBCompileUnit *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCompileUnit **)&jarg1; - result = (uint32_t)((lldb::SBCompileUnit const *)arg1)->GetNumLineEntries(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBCompileUnit_1GetLineEntryAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBCompileUnit *arg1 = (lldb::SBCompileUnit *) 0 ; - uint32_t arg2 ; - lldb::SBLineEntry result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCompileUnit **)&jarg1; - arg2 = (uint32_t)jarg2; - result = ((lldb::SBCompileUnit const *)arg1)->GetLineEntryAtIndex(arg2); - *(lldb::SBLineEntry **)&jresult = new lldb::SBLineEntry(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBCompileUnit_1FindLineEntryIndex_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jboolean jarg3) { - jlong jresult = 0 ; - lldb::SBCompileUnit *arg1 = (lldb::SBCompileUnit *) 0 ; - lldb::SBLineEntry *arg2 = 0 ; - bool arg3 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBCompileUnit **)&jarg1; - arg2 = *(lldb::SBLineEntry **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBLineEntry & is null"); - return 0; - } - arg3 = jarg3 ? true : false; - result = (uint32_t)((lldb::SBCompileUnit const *)arg1)->FindLineEntryIndex(*arg2,arg3); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBCompileUnit_1FindLineEntryIndex_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBCompileUnit *arg1 = (lldb::SBCompileUnit *) 0 ; - lldb::SBLineEntry *arg2 = 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBCompileUnit **)&jarg1; - arg2 = *(lldb::SBLineEntry **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBLineEntry & is null"); - return 0; - } - result = (uint32_t)((lldb::SBCompileUnit const *)arg1)->FindLineEntryIndex(*arg2); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBCompileUnit_1FindLineEntryIndex_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jlong jarg3, jlong jarg4, jobject jarg4_) { - jlong jresult = 0 ; - lldb::SBCompileUnit *arg1 = (lldb::SBCompileUnit *) 0 ; - uint32_t arg2 ; - uint32_t arg3 ; - lldb::SBFileSpec *arg4 = (lldb::SBFileSpec *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg4_; - arg1 = *(lldb::SBCompileUnit **)&jarg1; - arg2 = (uint32_t)jarg2; - arg3 = (uint32_t)jarg3; - arg4 = *(lldb::SBFileSpec **)&jarg4; - result = (uint32_t)((lldb::SBCompileUnit const *)arg1)->FindLineEntryIndex(arg2,arg3,arg4); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBCompileUnit_1FindLineEntryIndex_1_1SWIG_13(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jlong jarg3, jlong jarg4, jobject jarg4_, jboolean jarg5) { - jlong jresult = 0 ; - lldb::SBCompileUnit *arg1 = (lldb::SBCompileUnit *) 0 ; - uint32_t arg2 ; - uint32_t arg3 ; - lldb::SBFileSpec *arg4 = (lldb::SBFileSpec *) 0 ; - bool arg5 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg4_; - arg1 = *(lldb::SBCompileUnit **)&jarg1; - arg2 = (uint32_t)jarg2; - arg3 = (uint32_t)jarg3; - arg4 = *(lldb::SBFileSpec **)&jarg4; - arg5 = jarg5 ? true : false; - result = (uint32_t)((lldb::SBCompileUnit const *)arg1)->FindLineEntryIndex(arg2,arg3,arg4,arg5); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBCompileUnit_1GetSupportFileAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBCompileUnit *arg1 = (lldb::SBCompileUnit *) 0 ; - uint32_t arg2 ; - lldb::SBFileSpec result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCompileUnit **)&jarg1; - arg2 = (uint32_t)jarg2; - result = ((lldb::SBCompileUnit const *)arg1)->GetSupportFileAtIndex(arg2); - *(lldb::SBFileSpec **)&jresult = new lldb::SBFileSpec(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBCompileUnit_1GetNumSupportFiles(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBCompileUnit *arg1 = (lldb::SBCompileUnit *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCompileUnit **)&jarg1; - result = (uint32_t)((lldb::SBCompileUnit const *)arg1)->GetNumSupportFiles(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBCompileUnit_1FindSupportFileIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jlong jarg3, jobject jarg3_, jboolean jarg4) { - jlong jresult = 0 ; - lldb::SBCompileUnit *arg1 = (lldb::SBCompileUnit *) 0 ; - uint32_t arg2 ; - lldb::SBFileSpec *arg3 = 0 ; - bool arg4 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - arg1 = *(lldb::SBCompileUnit **)&jarg1; - arg2 = (uint32_t)jarg2; - arg3 = *(lldb::SBFileSpec **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec const & is null"); - return 0; - } - arg4 = jarg4 ? true : false; - result = (uint32_t)(arg1)->FindSupportFileIndex(arg2,(lldb::SBFileSpec const &)*arg3,arg4); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBCompileUnit_1GetTypes_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBCompileUnit *arg1 = (lldb::SBCompileUnit *) 0 ; - uint32_t arg2 ; - lldb::SBTypeList result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCompileUnit **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (arg1)->GetTypes(arg2); - *(lldb::SBTypeList **)&jresult = new lldb::SBTypeList(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBCompileUnit_1GetTypes_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBCompileUnit *arg1 = (lldb::SBCompileUnit *) 0 ; - lldb::SBTypeList result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCompileUnit **)&jarg1; - result = (arg1)->GetTypes(); - *(lldb::SBTypeList **)&jresult = new lldb::SBTypeList(result); - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBCompileUnit_1GetLanguage(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBCompileUnit *arg1 = (lldb::SBCompileUnit *) 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCompileUnit **)&jarg1; - result = (lldb::LanguageType)(arg1)->GetLanguage(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBCompileUnit_1GetDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBCompileUnit *arg1 = (lldb::SBCompileUnit *) 0 ; - lldb::SBStream *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBCompileUnit **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - result = (bool)(arg1)->GetDescription(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBCompileUnit_1_1_1repr_1_1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBCompileUnit *arg1 = (lldb::SBCompileUnit *) 0 ; - std::string result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBCompileUnit **)&jarg1; - result = lldb_SBCompileUnit___repr__(arg1); - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBData_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBData *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBData *)new lldb::SBData(); - *(lldb::SBData **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBData_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBData *arg1 = 0 ; - lldb::SBData *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBData **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBData const & is null"); - return 0; - } - result = (lldb::SBData *)new lldb::SBData((lldb::SBData const &)*arg1); - *(lldb::SBData **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBData(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBData *arg1 = (lldb::SBData *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBData **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jshort JNICALL Java_SWIG_lldbJNI_SBData_1GetAddressByteSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jshort jresult = 0 ; - lldb::SBData *arg1 = (lldb::SBData *) 0 ; - uint8_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBData **)&jarg1; - result = (uint8_t)(arg1)->GetAddressByteSize(); - jresult = (jshort)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBData_1SetAddressByteSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jshort jarg2) { - lldb::SBData *arg1 = (lldb::SBData *) 0 ; - uint8_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBData **)&jarg1; - arg2 = (uint8_t)jarg2; - (arg1)->SetAddressByteSize(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBData_1Clear(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBData *arg1 = (lldb::SBData *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBData **)&jarg1; - (arg1)->Clear(); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBData_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBData *arg1 = (lldb::SBData *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBData **)&jarg1; - result = (bool)(arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBData_1GetByteSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBData *arg1 = (lldb::SBData *) 0 ; - size_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBData **)&jarg1; - result = (arg1)->GetByteSize(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBData_1GetByteOrder(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBData *arg1 = (lldb::SBData *) 0 ; - lldb::ByteOrder result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBData **)&jarg1; - result = (lldb::ByteOrder)(arg1)->GetByteOrder(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBData_1SetByteOrder(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - lldb::SBData *arg1 = (lldb::SBData *) 0 ; - lldb::ByteOrder arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBData **)&jarg1; - arg2 = (lldb::ByteOrder)jarg2; - (arg1)->SetByteOrder(arg2); -} - - -SWIGEXPORT jfloat JNICALL Java_SWIG_lldbJNI_SBData_1GetFloat(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jobject jarg3) { - jfloat jresult = 0 ; - lldb::SBData *arg1 = (lldb::SBData *) 0 ; - lldb::SBError *arg2 = 0 ; - lldb::offset_t arg3 ; - float result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBData **)&jarg1; - arg2 = *(lldb::SBError **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg3); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg3, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg3 = 0; - if (sz > 0) { - arg3 = (lldb::offset_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (float)(arg1)->GetFloat(*arg2,arg3); - jresult = (jfloat)result; - return jresult; -} - - -SWIGEXPORT jdouble JNICALL Java_SWIG_lldbJNI_SBData_1GetDouble(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jobject jarg3) { - jdouble jresult = 0 ; - lldb::SBData *arg1 = (lldb::SBData *) 0 ; - lldb::SBError *arg2 = 0 ; - lldb::offset_t arg3 ; - double result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBData **)&jarg1; - arg2 = *(lldb::SBError **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg3); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg3, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg3 = 0; - if (sz > 0) { - arg3 = (lldb::offset_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (double)(arg1)->GetDouble(*arg2,arg3); - jresult = (jdouble)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBData_1GetLongDouble(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jobject jarg3) { - jlong jresult = 0 ; - lldb::SBData *arg1 = (lldb::SBData *) 0 ; - lldb::SBError *arg2 = 0 ; - lldb::offset_t arg3 ; - long double result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBData **)&jarg1; - arg2 = *(lldb::SBError **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg3); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg3, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg3 = 0; - if (sz > 0) { - arg3 = (lldb::offset_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (long double)(arg1)->GetLongDouble(*arg2,arg3); - *(long double **)&jresult = new long double(result); - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBData_1GetAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jobject jarg3) { - jobject jresult = 0 ; - lldb::SBData *arg1 = (lldb::SBData *) 0 ; - lldb::SBError *arg2 = 0 ; - lldb::offset_t arg3 ; - lldb::addr_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBData **)&jarg1; - arg2 = *(lldb::SBError **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg3); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg3, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg3 = 0; - if (sz > 0) { - arg3 = (lldb::offset_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (lldb::addr_t)(arg1)->GetAddress(*arg2,arg3); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jshort JNICALL Java_SWIG_lldbJNI_SBData_1GetUnsignedInt8(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jobject jarg3) { - jshort jresult = 0 ; - lldb::SBData *arg1 = (lldb::SBData *) 0 ; - lldb::SBError *arg2 = 0 ; - lldb::offset_t arg3 ; - uint8_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBData **)&jarg1; - arg2 = *(lldb::SBError **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg3); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg3, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg3 = 0; - if (sz > 0) { - arg3 = (lldb::offset_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (uint8_t)(arg1)->GetUnsignedInt8(*arg2,arg3); - jresult = (jshort)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBData_1GetUnsignedInt16(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jobject jarg3) { - jint jresult = 0 ; - lldb::SBData *arg1 = (lldb::SBData *) 0 ; - lldb::SBError *arg2 = 0 ; - lldb::offset_t arg3 ; - uint16_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBData **)&jarg1; - arg2 = *(lldb::SBError **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg3); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg3, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg3 = 0; - if (sz > 0) { - arg3 = (lldb::offset_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (uint16_t)(arg1)->GetUnsignedInt16(*arg2,arg3); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBData_1GetUnsignedInt32(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jobject jarg3) { - jlong jresult = 0 ; - lldb::SBData *arg1 = (lldb::SBData *) 0 ; - lldb::SBError *arg2 = 0 ; - lldb::offset_t arg3 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBData **)&jarg1; - arg2 = *(lldb::SBError **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg3); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg3, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg3 = 0; - if (sz > 0) { - arg3 = (lldb::offset_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (uint32_t)(arg1)->GetUnsignedInt32(*arg2,arg3); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBData_1GetUnsignedInt64(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jobject jarg3) { - jobject jresult = 0 ; - lldb::SBData *arg1 = (lldb::SBData *) 0 ; - lldb::SBError *arg2 = 0 ; - lldb::offset_t arg3 ; - uint64_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBData **)&jarg1; - arg2 = *(lldb::SBError **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg3); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg3, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg3 = 0; - if (sz > 0) { - arg3 = (lldb::offset_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (uint64_t)(arg1)->GetUnsignedInt64(*arg2,arg3); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jbyte JNICALL Java_SWIG_lldbJNI_SBData_1GetSignedInt8(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jobject jarg3) { - jbyte jresult = 0 ; - lldb::SBData *arg1 = (lldb::SBData *) 0 ; - lldb::SBError *arg2 = 0 ; - lldb::offset_t arg3 ; - int8_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBData **)&jarg1; - arg2 = *(lldb::SBError **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg3); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg3, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg3 = 0; - if (sz > 0) { - arg3 = (lldb::offset_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (int8_t)(arg1)->GetSignedInt8(*arg2,arg3); - jresult = (jbyte)result; - return jresult; -} - - -SWIGEXPORT jshort JNICALL Java_SWIG_lldbJNI_SBData_1GetSignedInt16(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jobject jarg3) { - jshort jresult = 0 ; - lldb::SBData *arg1 = (lldb::SBData *) 0 ; - lldb::SBError *arg2 = 0 ; - lldb::offset_t arg3 ; - int16_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBData **)&jarg1; - arg2 = *(lldb::SBError **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg3); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg3, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg3 = 0; - if (sz > 0) { - arg3 = (lldb::offset_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (int16_t)(arg1)->GetSignedInt16(*arg2,arg3); - jresult = (jshort)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBData_1GetSignedInt32(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jobject jarg3) { - jint jresult = 0 ; - lldb::SBData *arg1 = (lldb::SBData *) 0 ; - lldb::SBError *arg2 = 0 ; - lldb::offset_t arg3 ; - int32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBData **)&jarg1; - arg2 = *(lldb::SBError **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg3); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg3, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg3 = 0; - if (sz > 0) { - arg3 = (lldb::offset_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (int32_t)(arg1)->GetSignedInt32(*arg2,arg3); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBData_1GetSignedInt64(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jobject jarg3) { - jlong jresult = 0 ; - lldb::SBData *arg1 = (lldb::SBData *) 0 ; - lldb::SBError *arg2 = 0 ; - lldb::offset_t arg3 ; - int64_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBData **)&jarg1; - arg2 = *(lldb::SBError **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg3); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg3, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg3 = 0; - if (sz > 0) { - arg3 = (lldb::offset_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (int64_t)(arg1)->GetSignedInt64(*arg2,arg3); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBData_1GetString(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jobject jarg3) { - jstring jresult = 0 ; - lldb::SBData *arg1 = (lldb::SBData *) 0 ; - lldb::SBError *arg2 = 0 ; - lldb::offset_t arg3 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBData **)&jarg1; - arg2 = *(lldb::SBError **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg3); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg3, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg3 = 0; - if (sz > 0) { - arg3 = (lldb::offset_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (char *)(arg1)->GetString(*arg2,arg3); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBData_1ReadRawData(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jobject jarg3, jlong jarg4, jlong jarg5) { - jlong jresult = 0 ; - lldb::SBData *arg1 = (lldb::SBData *) 0 ; - lldb::SBError *arg2 = 0 ; - lldb::offset_t arg3 ; - void *arg4 = (void *) 0 ; - size_t arg5 ; - size_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBData **)&jarg1; - arg2 = *(lldb::SBError **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg3); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg3, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg3 = 0; - if (sz > 0) { - arg3 = (lldb::offset_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - arg4 = *(void **)&jarg4; - arg5 = (size_t)jarg5; - result = (arg1)->ReadRawData(*arg2,arg3,arg4,arg5); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBData_1GetDescription_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jobject jarg3) { - jboolean jresult = 0 ; - lldb::SBData *arg1 = (lldb::SBData *) 0 ; - lldb::SBStream *arg2 = 0 ; - lldb::addr_t arg3 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBData **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg3); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg3, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg3 = 0; - if (sz > 0) { - arg3 = (lldb::addr_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (bool)(arg1)->GetDescription(*arg2,arg3); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBData_1GetDescription_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBData *arg1 = (lldb::SBData *) 0 ; - lldb::SBStream *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBData **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - result = (bool)(arg1)->GetDescription(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBData_1SetData(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jlong jarg4, jint jarg5, jshort jarg6) { - lldb::SBData *arg1 = (lldb::SBData *) 0 ; - lldb::SBError *arg2 = 0 ; - void *arg3 = (void *) 0 ; - size_t arg4 ; - lldb::ByteOrder arg5 ; - uint8_t arg6 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBData **)&jarg1; - arg2 = *(lldb::SBError **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return ; - } - arg3 = *(void **)&jarg3; - arg4 = (size_t)jarg4; - arg5 = (lldb::ByteOrder)jarg5; - arg6 = (uint8_t)jarg6; - (arg1)->SetData(*arg2,(void const *)arg3,arg4,arg5,arg6); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBData_1SetDataWithOwnership(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jlong jarg4, jint jarg5, jshort jarg6) { - lldb::SBData *arg1 = (lldb::SBData *) 0 ; - lldb::SBError *arg2 = 0 ; - void *arg3 = (void *) 0 ; - size_t arg4 ; - lldb::ByteOrder arg5 ; - uint8_t arg6 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBData **)&jarg1; - arg2 = *(lldb::SBError **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return ; - } - arg3 = *(void **)&jarg3; - arg4 = (size_t)jarg4; - arg5 = (lldb::ByteOrder)jarg5; - arg6 = (uint8_t)jarg6; - (arg1)->SetDataWithOwnership(*arg2,(void const *)arg3,arg4,arg5,arg6); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBData_1Append(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBData *arg1 = (lldb::SBData *) 0 ; - lldb::SBData *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBData **)&jarg1; - arg2 = *(lldb::SBData **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBData const & is null"); - return 0; - } - result = (bool)(arg1)->Append((lldb::SBData const &)*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBData_1CreateDataFromCString(JNIEnv *jenv, jclass jcls, jint jarg1, jlong jarg2, jstring jarg3) { - jlong jresult = 0 ; - lldb::ByteOrder arg1 ; - uint32_t arg2 ; - char *arg3 = (char *) 0 ; - lldb::SBData result; - - (void)jenv; - (void)jcls; - arg1 = (lldb::ByteOrder)jarg1; - arg2 = (uint32_t)jarg2; - arg3 = 0; - if (jarg3) { - arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); - if (!arg3) return 0; - } - result = lldb::SBData::CreateDataFromCString(arg1,arg2,(char const *)arg3); - *(lldb::SBData **)&jresult = new lldb::SBData(result); - if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBData_1CreateDataFromUInt64Array(JNIEnv *jenv, jclass jcls, jint jarg1, jlong jarg2, jlong jarg3, jlong jarg4) { - jlong jresult = 0 ; - lldb::ByteOrder arg1 ; - uint32_t arg2 ; - uint64_t *arg3 = (uint64_t *) 0 ; - size_t arg4 ; - lldb::SBData result; - - (void)jenv; - (void)jcls; - arg1 = (lldb::ByteOrder)jarg1; - arg2 = (uint32_t)jarg2; - arg3 = *(uint64_t **)&jarg3; - arg4 = (size_t)jarg4; - result = lldb::SBData::CreateDataFromUInt64Array(arg1,arg2,arg3,SWIG_STD_MOVE(arg4)); - *(lldb::SBData **)&jresult = new lldb::SBData(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBData_1CreateDataFromUInt32Array(JNIEnv *jenv, jclass jcls, jint jarg1, jlong jarg2, jlong jarg3, jlong jarg4) { - jlong jresult = 0 ; - lldb::ByteOrder arg1 ; - uint32_t arg2 ; - uint32_t *arg3 = (uint32_t *) 0 ; - size_t arg4 ; - lldb::SBData result; - - (void)jenv; - (void)jcls; - arg1 = (lldb::ByteOrder)jarg1; - arg2 = (uint32_t)jarg2; - arg3 = *(uint32_t **)&jarg3; - arg4 = (size_t)jarg4; - result = lldb::SBData::CreateDataFromUInt32Array(arg1,arg2,arg3,SWIG_STD_MOVE(arg4)); - *(lldb::SBData **)&jresult = new lldb::SBData(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBData_1CreateDataFromSInt64Array(JNIEnv *jenv, jclass jcls, jint jarg1, jlong jarg2, jlong jarg3, jlong jarg4) { - jlong jresult = 0 ; - lldb::ByteOrder arg1 ; - uint32_t arg2 ; - int64_t *arg3 = (int64_t *) 0 ; - size_t arg4 ; - lldb::SBData result; - - (void)jenv; - (void)jcls; - arg1 = (lldb::ByteOrder)jarg1; - arg2 = (uint32_t)jarg2; - arg3 = *(int64_t **)&jarg3; - arg4 = (size_t)jarg4; - result = lldb::SBData::CreateDataFromSInt64Array(arg1,arg2,arg3,SWIG_STD_MOVE(arg4)); - *(lldb::SBData **)&jresult = new lldb::SBData(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBData_1CreateDataFromSInt32Array(JNIEnv *jenv, jclass jcls, jint jarg1, jlong jarg2, jlong jarg3, jlong jarg4) { - jlong jresult = 0 ; - lldb::ByteOrder arg1 ; - uint32_t arg2 ; - int32_t *arg3 = (int32_t *) 0 ; - size_t arg4 ; - lldb::SBData result; - - (void)jenv; - (void)jcls; - arg1 = (lldb::ByteOrder)jarg1; - arg2 = (uint32_t)jarg2; - arg3 = *(int32_t **)&jarg3; - arg4 = (size_t)jarg4; - result = lldb::SBData::CreateDataFromSInt32Array(arg1,arg2,arg3,SWIG_STD_MOVE(arg4)); - *(lldb::SBData **)&jresult = new lldb::SBData(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBData_1CreateDataFromDoubleArray(JNIEnv *jenv, jclass jcls, jint jarg1, jlong jarg2, jlong jarg3, jlong jarg4) { - jlong jresult = 0 ; - lldb::ByteOrder arg1 ; - uint32_t arg2 ; - double *arg3 = (double *) 0 ; - size_t arg4 ; - lldb::SBData result; - - (void)jenv; - (void)jcls; - arg1 = (lldb::ByteOrder)jarg1; - arg2 = (uint32_t)jarg2; - arg3 = *(double **)&jarg3; - arg4 = (size_t)jarg4; - result = lldb::SBData::CreateDataFromDoubleArray(arg1,arg2,arg3,SWIG_STD_MOVE(arg4)); - *(lldb::SBData **)&jresult = new lldb::SBData(result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBData_1SetDataFromCString(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jboolean jresult = 0 ; - lldb::SBData *arg1 = (lldb::SBData *) 0 ; - char *arg2 = (char *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBData **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (bool)(arg1)->SetDataFromCString((char const *)arg2); - jresult = (jboolean)result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBData_1SetDataFromUInt64Array(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jlong jarg3) { - jboolean jresult = 0 ; - lldb::SBData *arg1 = (lldb::SBData *) 0 ; - uint64_t *arg2 = (uint64_t *) 0 ; - size_t arg3 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBData **)&jarg1; - arg2 = *(uint64_t **)&jarg2; - arg3 = (size_t)jarg3; - result = (bool)(arg1)->SetDataFromUInt64Array(arg2,arg3); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBData_1SetDataFromUInt32Array(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jlong jarg3) { - jboolean jresult = 0 ; - lldb::SBData *arg1 = (lldb::SBData *) 0 ; - uint32_t *arg2 = (uint32_t *) 0 ; - size_t arg3 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBData **)&jarg1; - arg2 = *(uint32_t **)&jarg2; - arg3 = (size_t)jarg3; - result = (bool)(arg1)->SetDataFromUInt32Array(arg2,arg3); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBData_1SetDataFromSInt64Array(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jlong jarg3) { - jboolean jresult = 0 ; - lldb::SBData *arg1 = (lldb::SBData *) 0 ; - int64_t *arg2 = (int64_t *) 0 ; - size_t arg3 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBData **)&jarg1; - arg2 = *(int64_t **)&jarg2; - arg3 = (size_t)jarg3; - result = (bool)(arg1)->SetDataFromSInt64Array(arg2,arg3); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBData_1SetDataFromSInt32Array(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jlong jarg3) { - jboolean jresult = 0 ; - lldb::SBData *arg1 = (lldb::SBData *) 0 ; - int32_t *arg2 = (int32_t *) 0 ; - size_t arg3 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBData **)&jarg1; - arg2 = *(int32_t **)&jarg2; - arg3 = (size_t)jarg3; - result = (bool)(arg1)->SetDataFromSInt32Array(arg2,arg3); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBData_1SetDataFromDoubleArray(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jlong jarg3) { - jboolean jresult = 0 ; - lldb::SBData *arg1 = (lldb::SBData *) 0 ; - double *arg2 = (double *) 0 ; - size_t arg3 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBData **)&jarg1; - arg2 = *(double **)&jarg2; - arg3 = (size_t)jarg3; - result = (bool)(arg1)->SetDataFromDoubleArray(arg2,arg3); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBData_1_1_1repr_1_1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBData *arg1 = (lldb::SBData *) 0 ; - std::string result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBData **)&jarg1; - result = lldb_SBData___repr__(arg1); - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBDebugger_1eBroadcastBitProgress_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)lldb::SBDebugger::eBroadcastBitProgress; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBDebugger_1eBroadcastBitWarning_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)lldb::SBDebugger::eBroadcastBitWarning; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBDebugger_1eBroadcastBitError_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)lldb::SBDebugger::eBroadcastBitError; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBDebugger_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBDebugger *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBDebugger *)new lldb::SBDebugger(); - *(lldb::SBDebugger **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBDebugger_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = 0 ; - lldb::SBDebugger *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBDebugger const & is null"); - return 0; - } - result = (lldb::SBDebugger *)new lldb::SBDebugger((lldb::SBDebugger const &)*arg1); - *(lldb::SBDebugger **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBDebugger(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBDebugger **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetBroadcasterClass(JNIEnv *jenv, jclass jcls) { - jstring jresult = 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - result = (char *)lldb::SBDebugger::GetBroadcasterClass(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetBroadcaster(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - lldb::SBBroadcaster result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - result = (arg1)->GetBroadcaster(); - *(lldb::SBBroadcaster **)&jresult = new lldb::SBBroadcaster(result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetProgressFromEvent(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobjectArray jarg2, jobjectArray jarg3, jobjectArray jarg4, jbooleanArray jarg5) { - jstring jresult = 0 ; - lldb::SBEvent *arg1 = 0 ; - uint64_t *arg2 = 0 ; - uint64_t *arg3 = 0 ; - uint64_t *arg4 = 0 ; - bool *arg5 = 0 ; - uint64_t temp2 ; - uint64_t temp3 ; - uint64_t temp4 ; - bool temp5 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEvent **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent const & is null"); - return 0; - } - { - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); - return 0; - } - if (jenv->GetArrayLength(jarg2) == 0) { - SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "Array must contain at least 1 element"); - return 0; - } - temp2 = (uint64_t)0; - arg2 = &temp2; - } - { - if (!jarg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); - return 0; - } - if (jenv->GetArrayLength(jarg3) == 0) { - SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "Array must contain at least 1 element"); - return 0; - } - temp3 = (uint64_t)0; - arg3 = &temp3; - } - { - if (!jarg4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); - return 0; - } - if (jenv->GetArrayLength(jarg4) == 0) { - SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "Array must contain at least 1 element"); - return 0; - } - temp4 = (uint64_t)0; - arg4 = &temp4; - } - { - if (!jarg5) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); - return 0; - } - if (jenv->GetArrayLength(jarg5) == 0) { - SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "Array must contain at least 1 element"); - return 0; - } - temp5 = false; - arg5 = &temp5; - } - result = (char *)lldb::SBDebugger::GetProgressFromEvent((lldb::SBEvent const &)*arg1,*arg2,*arg3,*arg4,*arg5); - if (result) jresult = jenv->NewStringUTF((const char *)result); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(temp2>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jenv->SetObjectArrayElement(jarg2, 0, bigint); - } - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(temp3>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jenv->SetObjectArrayElement(jarg3, 0, bigint); - } - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(temp4>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jenv->SetObjectArrayElement(jarg4, 0, bigint); - } - { - jboolean jvalue = (jboolean)temp5; - jenv->SetBooleanArrayRegion(jarg5, 0, 1, &jvalue); - } - - - - - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetProgressDataFromEvent(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBEvent *arg1 = 0 ; - lldb::SBStructuredData result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEvent **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent const & is null"); - return 0; - } - result = lldb::SBDebugger::GetProgressDataFromEvent((lldb::SBEvent const &)*arg1); - *(lldb::SBStructuredData **)&jresult = new lldb::SBStructuredData(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetDiagnosticFromEvent(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBEvent *arg1 = 0 ; - lldb::SBStructuredData result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEvent **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent const & is null"); - return 0; - } - result = lldb::SBDebugger::GetDiagnosticFromEvent((lldb::SBEvent const &)*arg1); - *(lldb::SBStructuredData **)&jresult = new lldb::SBStructuredData(result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBDebugger_1Initialize(JNIEnv *jenv, jclass jcls) { - (void)jenv; - (void)jcls; - lldb::SBDebugger::Initialize(); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1InitializeWithErrorHandling(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - result = lldb::SBDebugger::InitializeWithErrorHandling(); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBDebugger_1PrintStackTraceOnError(JNIEnv *jenv, jclass jcls) { - (void)jenv; - (void)jcls; - lldb::SBDebugger::PrintStackTraceOnError(); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBDebugger_1PrintDiagnosticsOnError(JNIEnv *jenv, jclass jcls) { - (void)jenv; - (void)jcls; - lldb::SBDebugger::PrintDiagnosticsOnError(); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBDebugger_1Terminate(JNIEnv *jenv, jclass jcls) { - (void)jenv; - (void)jcls; - lldb::SBDebugger::Terminate(); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1Create_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBDebugger result; - - (void)jenv; - (void)jcls; - result = lldb::SBDebugger::Create(); - *(lldb::SBDebugger **)&jresult = new lldb::SBDebugger(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1Create_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jboolean jarg1) { - jlong jresult = 0 ; - bool arg1 ; - lldb::SBDebugger result; - - (void)jenv; - (void)jcls; - arg1 = jarg1 ? true : false; - result = lldb::SBDebugger::Create(arg1); - *(lldb::SBDebugger **)&jresult = new lldb::SBDebugger(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1Create_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jboolean jarg1, jlong jarg2, jlong jarg3) { - jlong jresult = 0 ; - bool arg1 ; - lldb::LogOutputCallback arg2 = (lldb::LogOutputCallback) 0 ; - void *arg3 = (void *) 0 ; - lldb::SBDebugger result; - - (void)jenv; - (void)jcls; - arg1 = jarg1 ? true : false; - arg2 = *(lldb::LogOutputCallback *)&jarg2; - arg3 = *(void **)&jarg3; - result = lldb::SBDebugger::Create(arg1,arg2,arg3); - *(lldb::SBDebugger **)&jresult = new lldb::SBDebugger(result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBDebugger_1Destroy(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBDebugger *arg1 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBDebugger & is null"); - return ; - } - lldb::SBDebugger::Destroy(*arg1); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBDebugger_1MemoryPressureDetected(JNIEnv *jenv, jclass jcls) { - (void)jenv; - (void)jcls; - lldb::SBDebugger::MemoryPressureDetected(); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBDebugger_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - result = (bool)((lldb::SBDebugger const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBDebugger_1Clear(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - (arg1)->Clear(); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetSetting_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBStructuredData result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (arg1)->GetSetting((char const *)arg2); - *(lldb::SBStructuredData **)&jresult = new lldb::SBStructuredData(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetSetting_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - lldb::SBStructuredData result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - result = (arg1)->GetSetting(); - *(lldb::SBStructuredData **)&jresult = new lldb::SBStructuredData(result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBDebugger_1SetAsync(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetAsync(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetAsync(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - result = (bool)(arg1)->GetAsync(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBDebugger_1SkipLLDBInitFiles(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SkipLLDBInitFiles(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBDebugger_1SkipAppInitFiles(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SkipAppInitFiles(arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1SetInputString(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (arg1)->SetInputString((char const *)arg2); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1SetInputFile_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - lldb::SBFile arg2 ; - lldb::SBFile *argp2 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBDebugger **)&jarg1; - argp2 = *(lldb::SBFile **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBFile"); - return 0; - } - arg2 = *argp2; - result = (arg1)->SetInputFile(arg2); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1SetOutputFile_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - lldb::SBFile arg2 ; - lldb::SBFile *argp2 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBDebugger **)&jarg1; - argp2 = *(lldb::SBFile **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBFile"); - return 0; - } - arg2 = *argp2; - result = (arg1)->SetOutputFile(arg2); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1SetErrorFile_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - lldb::SBFile arg2 ; - lldb::SBFile *argp2 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBDebugger **)&jarg1; - argp2 = *(lldb::SBFile **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBFile"); - return 0; - } - arg2 = *argp2; - result = (arg1)->SetErrorFile(arg2); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1SetInputFile_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - SwigValueWrapper< std::shared_ptr< lldb_private::File > > arg2 ; - lldb::FileSP *argp2 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - argp2 = *(lldb::FileSP **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::FileSP"); - return 0; - } - arg2 = *argp2; - result = (arg1)->SetInputFile(arg2); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1SetOutputFile_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - SwigValueWrapper< std::shared_ptr< lldb_private::File > > arg2 ; - lldb::FileSP *argp2 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - argp2 = *(lldb::FileSP **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::FileSP"); - return 0; - } - arg2 = *argp2; - result = (arg1)->SetOutputFile(arg2); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1SetErrorFile_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - SwigValueWrapper< std::shared_ptr< lldb_private::File > > arg2 ; - lldb::FileSP *argp2 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - argp2 = *(lldb::FileSP **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::FileSP"); - return 0; - } - arg2 = *argp2; - result = (arg1)->SetErrorFile(arg2); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetInputFile(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - lldb::SBFile result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - result = (arg1)->GetInputFile(); - *(lldb::SBFile **)&jresult = new lldb::SBFile(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetOutputFile(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - lldb::SBFile result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - result = (arg1)->GetOutputFile(); - *(lldb::SBFile **)&jresult = new lldb::SBFile(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetErrorFile(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - lldb::SBFile result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - result = (arg1)->GetErrorFile(); - *(lldb::SBFile **)&jresult = new lldb::SBFile(result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBDebugger_1SaveInputTerminalState(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - (arg1)->SaveInputTerminalState(); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBDebugger_1RestoreInputTerminalState(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - (arg1)->RestoreInputTerminalState(); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetCommandInterpreter(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - SwigValueWrapper< lldb::SBCommandInterpreter > result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - result = (arg1)->GetCommandInterpreter(); - *(lldb::SBCommandInterpreter **)&jresult = new lldb::SBCommandInterpreter(result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBDebugger_1HandleCommand(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->HandleCommand((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBDebugger_1RequestInterrupt(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - (arg1)->RequestInterrupt(); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBDebugger_1CancelInterruptRequest(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - (arg1)->CancelInterruptRequest(); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBDebugger_1InterruptRequested(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - result = (bool)(arg1)->InterruptRequested(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetListener(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - lldb::SBListener result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - result = (arg1)->GetListener(); - *(lldb::SBListener **)&jresult = new lldb::SBListener(result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBDebugger_1HandleProcessEvent_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_, jlong jarg4, jobject jarg4_, jlong jarg5, jobject jarg5_) { - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - lldb::SBProcess *arg2 = 0 ; - lldb::SBEvent *arg3 = 0 ; - lldb::SBFile arg4 ; - lldb::SBFile arg5 ; - lldb::SBFile *argp4 ; - lldb::SBFile *argp5 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - (void)jarg4_; - (void)jarg5_; - arg1 = *(lldb::SBDebugger **)&jarg1; - arg2 = *(lldb::SBProcess **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBProcess const & is null"); - return ; - } - arg3 = *(lldb::SBEvent **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent const & is null"); - return ; - } - argp4 = *(lldb::SBFile **)&jarg4; - if (!argp4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBFile"); - return ; - } - arg4 = *argp4; - argp5 = *(lldb::SBFile **)&jarg5; - if (!argp5) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBFile"); - return ; - } - arg5 = *argp5; - (arg1)->HandleProcessEvent((lldb::SBProcess const &)*arg2,(lldb::SBEvent const &)*arg3,arg4,arg5); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBDebugger_1HandleProcessEvent_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_, jlong jarg4, jlong jarg5) { - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - lldb::SBProcess *arg2 = 0 ; - lldb::SBEvent *arg3 = 0 ; - SwigValueWrapper< std::shared_ptr< lldb_private::File > > arg4 ; - SwigValueWrapper< std::shared_ptr< lldb_private::File > > arg5 ; - lldb::FileSP *argp4 ; - lldb::FileSP *argp5 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - arg1 = *(lldb::SBDebugger **)&jarg1; - arg2 = *(lldb::SBProcess **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBProcess const & is null"); - return ; - } - arg3 = *(lldb::SBEvent **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent const & is null"); - return ; - } - argp4 = *(lldb::FileSP **)&jarg4; - if (!argp4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::FileSP"); - return ; - } - arg4 = *argp4; - argp5 = *(lldb::FileSP **)&jarg5; - if (!argp5) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::FileSP"); - return ; - } - arg5 = *argp5; - (arg1)->HandleProcessEvent((lldb::SBProcess const &)*arg2,(lldb::SBEvent const &)*arg3,arg4,arg5); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1CreateTarget_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jstring jarg3, jstring jarg4, jboolean jarg5, jlong jarg6, jobject jarg6_) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - char *arg2 = (char *) 0 ; - char *arg3 = (char *) 0 ; - char *arg4 = (char *) 0 ; - bool arg5 ; - lldb::SBError *arg6 = 0 ; - lldb::SBTarget result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg6_; - arg1 = *(lldb::SBDebugger **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = 0; - if (jarg3) { - arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); - if (!arg3) return 0; - } - arg4 = 0; - if (jarg4) { - arg4 = (char *)jenv->GetStringUTFChars(jarg4, 0); - if (!arg4) return 0; - } - arg5 = jarg5 ? true : false; - arg6 = *(lldb::SBError **)&jarg6; - if (!arg6) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - result = (arg1)->CreateTarget((char const *)arg2,(char const *)arg3,(char const *)arg4,arg5,*arg6); - *(lldb::SBTarget **)&jresult = new lldb::SBTarget(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); - if (arg4) jenv->ReleaseStringUTFChars(jarg4, (const char *)arg4); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1CreateTargetWithFileAndTargetTriple(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jstring jarg3) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - char *arg2 = (char *) 0 ; - char *arg3 = (char *) 0 ; - lldb::SBTarget result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = 0; - if (jarg3) { - arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); - if (!arg3) return 0; - } - result = (arg1)->CreateTargetWithFileAndTargetTriple((char const *)arg2,(char const *)arg3); - *(lldb::SBTarget **)&jresult = new lldb::SBTarget(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1CreateTargetWithFileAndArch(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jstring jarg3) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - char *arg2 = (char *) 0 ; - char *arg3 = (char *) 0 ; - lldb::SBTarget result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = 0; - if (jarg3) { - arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); - if (!arg3) return 0; - } - result = (arg1)->CreateTargetWithFileAndArch((char const *)arg2,(char const *)arg3); - *(lldb::SBTarget **)&jresult = new lldb::SBTarget(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1CreateTarget_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBTarget result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (arg1)->CreateTarget((char const *)arg2); - *(lldb::SBTarget **)&jresult = new lldb::SBTarget(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetDummyTarget(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - lldb::SBTarget result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - result = (arg1)->GetDummyTarget(); - *(lldb::SBTarget **)&jresult = new lldb::SBTarget(result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBDebugger_1DeleteTarget(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - lldb::SBTarget *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBDebugger **)&jarg1; - arg2 = *(lldb::SBTarget **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBTarget & is null"); - return 0; - } - result = (bool)(arg1)->DeleteTarget(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetTargetAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - uint32_t arg2 ; - lldb::SBTarget result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (arg1)->GetTargetAtIndex(arg2); - *(lldb::SBTarget **)&jresult = new lldb::SBTarget(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetIndexOfTarget(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - lldb::SBTarget arg2 ; - lldb::SBTarget *argp2 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBDebugger **)&jarg1; - argp2 = *(lldb::SBTarget **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBTarget"); - return 0; - } - arg2 = *argp2; - result = (uint32_t)(arg1)->GetIndexOfTarget(arg2); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1FindTargetWithProcessID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - lldb::pid_t arg2 ; - lldb::SBTarget result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (lldb::pid_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (arg1)->FindTargetWithProcessID(arg2); - *(lldb::SBTarget **)&jresult = new lldb::SBTarget(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1FindTargetWithFileAndArch(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jstring jarg3) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - char *arg2 = (char *) 0 ; - char *arg3 = (char *) 0 ; - lldb::SBTarget result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = 0; - if (jarg3) { - arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); - if (!arg3) return 0; - } - result = (arg1)->FindTargetWithFileAndArch((char const *)arg2,(char const *)arg3); - *(lldb::SBTarget **)&jresult = new lldb::SBTarget(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetNumTargets(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - result = (uint32_t)(arg1)->GetNumTargets(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetSelectedTarget(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - lldb::SBTarget result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - result = (arg1)->GetSelectedTarget(); - *(lldb::SBTarget **)&jresult = new lldb::SBTarget(result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBDebugger_1SetSelectedTarget(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - lldb::SBTarget *arg2 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBDebugger **)&jarg1; - arg2 = *(lldb::SBTarget **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBTarget & is null"); - return ; - } - (arg1)->SetSelectedTarget(*arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetSelectedPlatform(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - lldb::SBPlatform result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - result = (arg1)->GetSelectedPlatform(); - *(lldb::SBPlatform **)&jresult = new lldb::SBPlatform(result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBDebugger_1SetSelectedPlatform(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - lldb::SBPlatform *arg2 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBDebugger **)&jarg1; - arg2 = *(lldb::SBPlatform **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBPlatform & is null"); - return ; - } - (arg1)->SetSelectedPlatform(*arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetNumPlatforms(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - result = (uint32_t)(arg1)->GetNumPlatforms(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetPlatformAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - uint32_t arg2 ; - lldb::SBPlatform result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (arg1)->GetPlatformAtIndex(arg2); - *(lldb::SBPlatform **)&jresult = new lldb::SBPlatform(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetNumAvailablePlatforms(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - result = (uint32_t)(arg1)->GetNumAvailablePlatforms(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetAvailablePlatformInfoAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - uint32_t arg2 ; - lldb::SBStructuredData result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (arg1)->GetAvailablePlatformInfoAtIndex(arg2); - *(lldb::SBStructuredData **)&jresult = new lldb::SBStructuredData(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetSourceManager(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - SwigValueWrapper< lldb::SBSourceManager > result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - result = (arg1)->GetSourceManager(); - *(lldb::SBSourceManager **)&jresult = new lldb::SBSourceManager(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1SetCurrentPlatform(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (arg1)->SetCurrentPlatform((char const *)arg2); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBDebugger_1SetCurrentPlatformSDKRoot(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jboolean jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - char *arg2 = (char *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (bool)(arg1)->SetCurrentPlatformSDKRoot((char const *)arg2); - jresult = (jboolean)result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBDebugger_1SetUseExternalEditor(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - jboolean jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - bool arg2 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - arg2 = jarg2 ? true : false; - result = (bool)(arg1)->SetUseExternalEditor(arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetUseExternalEditor(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - result = (bool)(arg1)->GetUseExternalEditor(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBDebugger_1SetUseColor(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - jboolean jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - bool arg2 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - arg2 = jarg2 ? true : false; - result = (bool)(arg1)->SetUseColor(arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetUseColor(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - result = (bool)((lldb::SBDebugger const *)arg1)->GetUseColor(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBDebugger_1SetUseSourceCache(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - jboolean jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - bool arg2 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - arg2 = jarg2 ? true : false; - result = (bool)(arg1)->SetUseSourceCache(arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetUseSourceCache(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - result = (bool)((lldb::SBDebugger const *)arg1)->GetUseSourceCache(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetDefaultArchitecture(JNIEnv *jenv, jclass jcls, jstring jarg1, jlong jarg2) { - jboolean jresult = 0 ; - char *arg1 = (char *) 0 ; - size_t arg2 ; - bool result; - - (void)jenv; - (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - arg2 = (size_t)jarg2; - result = (bool)lldb::SBDebugger::GetDefaultArchitecture(arg1,SWIG_STD_MOVE(arg2)); - jresult = (jboolean)result; - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBDebugger_1SetDefaultArchitecture(JNIEnv *jenv, jclass jcls, jstring jarg1) { - jboolean jresult = 0 ; - char *arg1 = (char *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - result = (bool)lldb::SBDebugger::SetDefaultArchitecture((char const *)arg1); - jresult = (jboolean)result; - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetScriptingLanguage(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jint jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - char *arg2 = (char *) 0 ; - lldb::ScriptLanguage result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (lldb::ScriptLanguage)(arg1)->GetScriptingLanguage((char const *)arg2); - jresult = (jint)result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetScriptInterpreterInfo(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - lldb::ScriptLanguage arg2 ; - lldb::SBStructuredData result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - arg2 = (lldb::ScriptLanguage)jarg2; - result = (arg1)->GetScriptInterpreterInfo(arg2); - *(lldb::SBStructuredData **)&jresult = new lldb::SBStructuredData(result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetVersionString(JNIEnv *jenv, jclass jcls) { - jstring jresult = 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - result = (char *)lldb::SBDebugger::GetVersionString(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBDebugger_1StateAsCString(JNIEnv *jenv, jclass jcls, jint jarg1) { - jstring jresult = 0 ; - lldb::StateType arg1 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - arg1 = (lldb::StateType)jarg1; - result = (char *)lldb::SBDebugger::StateAsCString(arg1); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetBuildConfiguration(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBStructuredData result; - - (void)jenv; - (void)jcls; - result = lldb::SBDebugger::GetBuildConfiguration(); - *(lldb::SBStructuredData **)&jresult = new lldb::SBStructuredData(result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBDebugger_1StateIsRunningState(JNIEnv *jenv, jclass jcls, jint jarg1) { - jboolean jresult = 0 ; - lldb::StateType arg1 ; - bool result; - - (void)jenv; - (void)jcls; - arg1 = (lldb::StateType)jarg1; - result = (bool)lldb::SBDebugger::StateIsRunningState(arg1); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBDebugger_1StateIsStoppedState(JNIEnv *jenv, jclass jcls, jint jarg1) { - jboolean jresult = 0 ; - lldb::StateType arg1 ; - bool result; - - (void)jenv; - (void)jcls; - arg1 = (lldb::StateType)jarg1; - result = (bool)lldb::SBDebugger::StateIsStoppedState(arg1); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBDebugger_1EnableLog(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jobjectArray jarg3) { - jboolean jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - char *arg2 = (char *) 0 ; - char **arg3 = (char **) 0 ; - jint size3 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - { - int i = 0; - if (jarg3) { - size3 = jenv->GetArrayLength(jarg3); - - arg3 = new char*[size3+1]; - - - - for (i = 0; iGetObjectArrayElement(jarg3, i); - const char *c_string = jenv->GetStringUTFChars(j_string, 0); - - arg3[i] = new char [strlen(c_string)+1]; - - - - strcpy(arg3[i], c_string); - jenv->ReleaseStringUTFChars(j_string, c_string); - jenv->DeleteLocalRef(j_string); - } - arg3[i] = 0; - } else { - arg3 = 0; - size3 = 0; - } - } - result = (bool)(arg1)->EnableLog((char const *)arg2,(char const **)arg3); - jresult = (jboolean)result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - { - int i; - for (i=0; iSetLoggingCallback(arg2,arg3); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBDebugger_1SetDestroyCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jlong jarg3) { - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - lldb::SBDebuggerDestroyCallback arg2 = (lldb::SBDebuggerDestroyCallback) 0 ; - void *arg3 = (void *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - arg2 = *(lldb::SBDebuggerDestroyCallback *)&jarg2; - arg3 = *(void **)&jarg3; - (arg1)->SetDestroyCallback(arg2,arg3); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBDebugger_1DispatchInput(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jlong jarg3) { - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - void *arg2 = (void *) 0 ; - size_t arg3 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - arg2 = *(void **)&jarg2; - arg3 = (size_t)jarg3; - (arg1)->DispatchInput((void const *)arg2,arg3); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBDebugger_1DispatchInputInterrupt(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - (arg1)->DispatchInputInterrupt(); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBDebugger_1DispatchInputEndOfFile(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - (arg1)->DispatchInputEndOfFile(); -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetInstanceName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - result = (char *)(arg1)->GetInstanceName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1FindDebuggerWithID(JNIEnv *jenv, jclass jcls, jint jarg1) { - jlong jresult = 0 ; - int arg1 ; - lldb::SBDebugger result; - - (void)jenv; - (void)jcls; - arg1 = (int)jarg1; - result = lldb::SBDebugger::FindDebuggerWithID(arg1); - *(lldb::SBDebugger **)&jresult = new lldb::SBDebugger(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1SetInternalVariable(JNIEnv *jenv, jclass jcls, jstring jarg1, jstring jarg2, jstring jarg3) { - jlong jresult = 0 ; - char *arg1 = (char *) 0 ; - char *arg2 = (char *) 0 ; - char *arg3 = (char *) 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = 0; - if (jarg3) { - arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); - if (!arg3) return 0; - } - result = lldb::SBDebugger::SetInternalVariable((char const *)arg1,(char const *)arg2,(char const *)arg3); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetInternalVariableValue(JNIEnv *jenv, jclass jcls, jstring jarg1, jstring jarg2) { - jlong jresult = 0 ; - char *arg1 = (char *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBStringList result; - - (void)jenv; - (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = lldb::SBDebugger::GetInternalVariableValue((char const *)arg1,(char const *)arg2); - *(lldb::SBStringList **)&jresult = new lldb::SBStringList(result); - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - lldb::SBStream *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBDebugger **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - result = (bool)(arg1)->GetDescription(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetTerminalWidth(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - result = (uint32_t)((lldb::SBDebugger const *)arg1)->GetTerminalWidth(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBDebugger_1SetTerminalWidth(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - uint32_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - arg2 = (uint32_t)jarg2; - (arg1)->SetTerminalWidth(arg2); -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - lldb::user_id_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - result = (lldb::user_id_t)(arg1)->GetID(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetPrompt(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - result = (char *)((lldb::SBDebugger const *)arg1)->GetPrompt(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBDebugger_1SetPrompt(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->SetPrompt((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetReproducerPath(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - result = (char *)((lldb::SBDebugger const *)arg1)->GetReproducerPath(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetScriptLanguage(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - lldb::ScriptLanguage result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - result = (lldb::ScriptLanguage)((lldb::SBDebugger const *)arg1)->GetScriptLanguage(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBDebugger_1SetScriptLanguage(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - lldb::ScriptLanguage arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - arg2 = (lldb::ScriptLanguage)jarg2; - (arg1)->SetScriptLanguage(arg2); -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetREPLLanguage(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - result = (lldb::LanguageType)((lldb::SBDebugger const *)arg1)->GetREPLLanguage(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBDebugger_1SetREPLLanguage(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - lldb::LanguageType arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - arg2 = (lldb::LanguageType)jarg2; - (arg1)->SetREPLLanguage(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetCloseInputOnEOF(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - result = (bool)((lldb::SBDebugger const *)arg1)->GetCloseInputOnEOF(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBDebugger_1SetCloseInputOnEOF(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetCloseInputOnEOF(arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetCategory_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBTypeCategory result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (arg1)->GetCategory((char const *)arg2); - *(lldb::SBTypeCategory **)&jresult = new lldb::SBTypeCategory(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetCategory_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - lldb::LanguageType arg2 ; - lldb::SBTypeCategory result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - arg2 = (lldb::LanguageType)jarg2; - result = (arg1)->GetCategory(arg2); - *(lldb::SBTypeCategory **)&jresult = new lldb::SBTypeCategory(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1CreateCategory(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBTypeCategory result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (arg1)->CreateCategory((char const *)arg2); - *(lldb::SBTypeCategory **)&jresult = new lldb::SBTypeCategory(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBDebugger_1DeleteCategory(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jboolean jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - char *arg2 = (char *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (bool)(arg1)->DeleteCategory((char const *)arg2); - jresult = (jboolean)result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetNumCategories(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - result = (uint32_t)(arg1)->GetNumCategories(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetCategoryAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - uint32_t arg2 ; - lldb::SBTypeCategory result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (arg1)->GetCategoryAtIndex(arg2); - *(lldb::SBTypeCategory **)&jresult = new lldb::SBTypeCategory(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetDefaultCategory(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - lldb::SBTypeCategory result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - result = (arg1)->GetDefaultCategory(); - *(lldb::SBTypeCategory **)&jresult = new lldb::SBTypeCategory(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetFormatForType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - lldb::SBTypeNameSpecifier arg2 ; - lldb::SBTypeNameSpecifier *argp2 ; - lldb::SBTypeFormat result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBDebugger **)&jarg1; - argp2 = *(lldb::SBTypeNameSpecifier **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBTypeNameSpecifier"); - return 0; - } - arg2 = *argp2; - result = (arg1)->GetFormatForType(arg2); - *(lldb::SBTypeFormat **)&jresult = new lldb::SBTypeFormat(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetSummaryForType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - lldb::SBTypeNameSpecifier arg2 ; - lldb::SBTypeNameSpecifier *argp2 ; - lldb::SBTypeSummary result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBDebugger **)&jarg1; - argp2 = *(lldb::SBTypeNameSpecifier **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBTypeNameSpecifier"); - return 0; - } - arg2 = *argp2; - result = (arg1)->GetSummaryForType(arg2); - *(lldb::SBTypeSummary **)&jresult = new lldb::SBTypeSummary(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetFilterForType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - lldb::SBTypeNameSpecifier arg2 ; - lldb::SBTypeNameSpecifier *argp2 ; - lldb::SBTypeFilter result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBDebugger **)&jarg1; - argp2 = *(lldb::SBTypeNameSpecifier **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBTypeNameSpecifier"); - return 0; - } - arg2 = *argp2; - result = (arg1)->GetFilterForType(arg2); - *(lldb::SBTypeFilter **)&jresult = new lldb::SBTypeFilter(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetSyntheticForType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - lldb::SBTypeNameSpecifier arg2 ; - lldb::SBTypeNameSpecifier *argp2 ; - lldb::SBTypeSynthetic result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBDebugger **)&jarg1; - argp2 = *(lldb::SBTypeNameSpecifier **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBTypeNameSpecifier"); - return 0; - } - arg2 = *argp2; - result = (arg1)->GetSyntheticForType(arg2); - *(lldb::SBTypeSynthetic **)&jresult = new lldb::SBTypeSynthetic(result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBDebugger_1RunCommandInterpreter(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2, jboolean jarg3, jlong jarg4, jobject jarg4_, jintArray jarg5, jbooleanArray jarg6, jbooleanArray jarg7) { - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - bool arg2 ; - bool arg3 ; - lldb::SBCommandInterpreterRunOptions *arg4 = 0 ; - int *arg5 = 0 ; - bool *arg6 = 0 ; - bool *arg7 = 0 ; - bool btemp6 ; - jboolean *jbtemp6 ; - bool btemp7 ; - jboolean *jbtemp7 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg4_; - arg1 = *(lldb::SBDebugger **)&jarg1; - arg2 = jarg2 ? true : false; - arg3 = jarg3 ? true : false; - arg4 = *(lldb::SBCommandInterpreterRunOptions **)&jarg4; - if (!arg4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBCommandInterpreterRunOptions & is null"); - return ; - } - { - if (!jarg5) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); - return ; - } - if (jenv->GetArrayLength(jarg5) == 0) { - SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "Array must contain at least 1 element"); - return ; - } - arg5 = (int *) jenv->GetIntArrayElements(jarg5, 0); - } - { - if (!jarg6) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); - return ; - } - if (jenv->GetArrayLength(jarg6) == 0) { - SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "Array must contain at least 1 element"); - return ; - } - jbtemp6 = jenv->GetBooleanArrayElements(jarg6, 0); - btemp6 = (*jbtemp6) ? true : false; - arg6 = &btemp6; - } - { - if (!jarg7) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null"); - return ; - } - if (jenv->GetArrayLength(jarg7) == 0) { - SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "Array must contain at least 1 element"); - return ; - } - jbtemp7 = jenv->GetBooleanArrayElements(jarg7, 0); - btemp7 = (*jbtemp7) ? true : false; - arg7 = &btemp7; - } - (arg1)->RunCommandInterpreter(arg2,arg3,*arg4,*arg5,*arg6,*arg7); - { - jenv->ReleaseIntArrayElements(jarg5, (jint *)arg5, 0); - } - { - *jbtemp6 = btemp6 ? (jboolean)1 : (jboolean)0; - jenv->ReleaseBooleanArrayElements(jarg6, (jboolean *)jbtemp6, 0); - } - { - *jbtemp7 = btemp7 ? (jboolean)1 : (jboolean)0; - jenv->ReleaseBooleanArrayElements(jarg7, (jboolean *)jbtemp7, 0); - } - - - -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1RunREPL(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jstring jarg3) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - lldb::LanguageType arg2 ; - char *arg3 = (char *) 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - arg2 = (lldb::LanguageType)jarg2; - arg3 = 0; - if (jarg3) { - arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); - if (!arg3) return 0; - } - result = (arg1)->RunREPL(arg2,(char const *)arg3); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1LoadTraceFromFile(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - lldb::SBError *arg2 = 0 ; - lldb::SBFileSpec *arg3 = 0 ; - lldb::SBTrace result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - arg1 = *(lldb::SBDebugger **)&jarg1; - arg2 = *(lldb::SBError **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - arg3 = *(lldb::SBFileSpec **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec const & is null"); - return 0; - } - result = (arg1)->LoadTraceFromFile(*arg2,(lldb::SBFileSpec const &)*arg3); - *(lldb::SBTrace **)&jresult = new lldb::SBTrace(result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBDebugger_1_1_1repr_1_1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - std::string result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - result = lldb_SBDebugger___repr__(arg1); - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetInputFileHandle(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - SwigValueWrapper< std::shared_ptr< lldb_private::File > > result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - result = lldb_SBDebugger_GetInputFileHandle(arg1); - *(lldb::FileSP **)&jresult = new lldb::FileSP(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetOutputFileHandle(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - SwigValueWrapper< std::shared_ptr< lldb_private::File > > result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - result = lldb_SBDebugger_GetOutputFileHandle(arg1); - *(lldb::FileSP **)&jresult = new lldb::FileSP(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDebugger_1GetErrorFileHandle(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = (lldb::SBDebugger *) 0 ; - SwigValueWrapper< std::shared_ptr< lldb_private::File > > result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - result = lldb_SBDebugger_GetErrorFileHandle(arg1); - *(lldb::FileSP **)&jresult = new lldb::FileSP(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBDeclaration_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBDeclaration *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBDeclaration *)new lldb::SBDeclaration(); - *(lldb::SBDeclaration **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBDeclaration_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBDeclaration *arg1 = 0 ; - lldb::SBDeclaration *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDeclaration **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBDeclaration const & is null"); - return 0; - } - result = (lldb::SBDeclaration *)new lldb::SBDeclaration((lldb::SBDeclaration const &)*arg1); - *(lldb::SBDeclaration **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBDeclaration(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBDeclaration *arg1 = (lldb::SBDeclaration *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBDeclaration **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBDeclaration_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBDeclaration *arg1 = (lldb::SBDeclaration *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDeclaration **)&jarg1; - result = (bool)((lldb::SBDeclaration const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDeclaration_1GetFileSpec(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBDeclaration *arg1 = (lldb::SBDeclaration *) 0 ; - lldb::SBFileSpec result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDeclaration **)&jarg1; - result = ((lldb::SBDeclaration const *)arg1)->GetFileSpec(); - *(lldb::SBFileSpec **)&jresult = new lldb::SBFileSpec(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDeclaration_1GetLine(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBDeclaration *arg1 = (lldb::SBDeclaration *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDeclaration **)&jarg1; - result = (uint32_t)((lldb::SBDeclaration const *)arg1)->GetLine(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBDeclaration_1GetColumn(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBDeclaration *arg1 = (lldb::SBDeclaration *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDeclaration **)&jarg1; - result = (uint32_t)((lldb::SBDeclaration const *)arg1)->GetColumn(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBDeclaration_1SetFileSpec(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBDeclaration *arg1 = (lldb::SBDeclaration *) 0 ; - lldb::SBFileSpec arg2 ; - lldb::SBFileSpec *argp2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBDeclaration **)&jarg1; - argp2 = *(lldb::SBFileSpec **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBFileSpec"); - return ; - } - arg2 = *argp2; - (arg1)->SetFileSpec(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBDeclaration_1SetLine(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - lldb::SBDeclaration *arg1 = (lldb::SBDeclaration *) 0 ; - uint32_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDeclaration **)&jarg1; - arg2 = (uint32_t)jarg2; - (arg1)->SetLine(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBDeclaration_1SetColumn(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - lldb::SBDeclaration *arg1 = (lldb::SBDeclaration *) 0 ; - uint32_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDeclaration **)&jarg1; - arg2 = (uint32_t)jarg2; - (arg1)->SetColumn(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBDeclaration_1GetDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBDeclaration *arg1 = (lldb::SBDeclaration *) 0 ; - lldb::SBStream *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBDeclaration **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - result = (bool)(arg1)->GetDescription(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBDeclaration_1_1_1repr_1_1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBDeclaration *arg1 = (lldb::SBDeclaration *) 0 ; - std::string result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDeclaration **)&jarg1; - result = lldb_SBDeclaration___repr__(arg1); - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBError_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBError *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBError *)new lldb::SBError(); - *(lldb::SBError **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBError_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBError *arg1 = 0 ; - lldb::SBError *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBError **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError const & is null"); - return 0; - } - result = (lldb::SBError *)new lldb::SBError((lldb::SBError const &)*arg1); - *(lldb::SBError **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBError_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jstring jarg1) { - jlong jresult = 0 ; - char *arg1 = (char *) 0 ; - lldb::SBError *result = 0 ; - - (void)jenv; - (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - result = (lldb::SBError *)new lldb::SBError((char const *)arg1); - *(lldb::SBError **)&jresult = result; - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBError(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBError *arg1 = (lldb::SBError *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBError **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBError_1GetCString(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBError *arg1 = (lldb::SBError *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBError **)&jarg1; - result = (char *)((lldb::SBError const *)arg1)->GetCString(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBError_1Clear(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBError *arg1 = (lldb::SBError *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBError **)&jarg1; - (arg1)->Clear(); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBError_1Fail(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBError *arg1 = (lldb::SBError *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBError **)&jarg1; - result = (bool)((lldb::SBError const *)arg1)->Fail(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBError_1Success(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBError *arg1 = (lldb::SBError *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBError **)&jarg1; - result = (bool)((lldb::SBError const *)arg1)->Success(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBError_1GetError(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBError *arg1 = (lldb::SBError *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBError **)&jarg1; - result = (uint32_t)((lldb::SBError const *)arg1)->GetError(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBError_1GetType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBError *arg1 = (lldb::SBError *) 0 ; - lldb::ErrorType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBError **)&jarg1; - result = (lldb::ErrorType)((lldb::SBError const *)arg1)->GetType(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBError_1SetError(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jint jarg3) { - lldb::SBError *arg1 = (lldb::SBError *) 0 ; - uint32_t arg2 ; - lldb::ErrorType arg3 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBError **)&jarg1; - arg2 = (uint32_t)jarg2; - arg3 = (lldb::ErrorType)jarg3; - (arg1)->SetError(arg2,arg3); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBError_1SetErrorToErrno(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBError *arg1 = (lldb::SBError *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBError **)&jarg1; - (arg1)->SetErrorToErrno(); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBError_1SetErrorToGenericError(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBError *arg1 = (lldb::SBError *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBError **)&jarg1; - (arg1)->SetErrorToGenericError(); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBError_1SetErrorString(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBError *arg1 = (lldb::SBError *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBError **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->SetErrorString((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBError_1SetErrorStringWithFormat_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jstring jarg3, jstring jarg4, jstring jarg5) { - jint jresult = 0 ; - lldb::SBError *arg1 = (lldb::SBError *) 0 ; - char *arg2 = (char *) 0 ; - char *arg3 = (char *) 0 ; - char *arg4 = (char *) 0 ; - char *arg5 = (char *) 0 ; - int result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBError **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = 0; - if (jarg3) { - arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); - if (!arg3) return 0; - } - arg4 = 0; - if (jarg4) { - arg4 = (char *)jenv->GetStringUTFChars(jarg4, 0); - if (!arg4) return 0; - } - arg5 = 0; - if (jarg5) { - arg5 = (char *)jenv->GetStringUTFChars(jarg5, 0); - if (!arg5) return 0; - } - result = (int)(arg1)->SetErrorStringWithFormat((char const *)arg2,arg3,arg4,arg5); - jresult = (jint)result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); - if (arg4) jenv->ReleaseStringUTFChars(jarg4, (const char *)arg4); - if (arg5) jenv->ReleaseStringUTFChars(jarg5, (const char *)arg5); - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBError_1SetErrorStringWithFormat_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jstring jarg3, jstring jarg4) { - jint jresult = 0 ; - lldb::SBError *arg1 = (lldb::SBError *) 0 ; - char *arg2 = (char *) 0 ; - char *arg3 = (char *) 0 ; - char *arg4 = (char *) 0 ; - int result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBError **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = 0; - if (jarg3) { - arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); - if (!arg3) return 0; - } - arg4 = 0; - if (jarg4) { - arg4 = (char *)jenv->GetStringUTFChars(jarg4, 0); - if (!arg4) return 0; - } - result = (int)(arg1)->SetErrorStringWithFormat((char const *)arg2,arg3,arg4); - jresult = (jint)result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); - if (arg4) jenv->ReleaseStringUTFChars(jarg4, (const char *)arg4); - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBError_1SetErrorStringWithFormat_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jstring jarg3) { - jint jresult = 0 ; - lldb::SBError *arg1 = (lldb::SBError *) 0 ; - char *arg2 = (char *) 0 ; - char *arg3 = (char *) 0 ; - int result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBError **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = 0; - if (jarg3) { - arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); - if (!arg3) return 0; - } - result = (int)(arg1)->SetErrorStringWithFormat((char const *)arg2,arg3); - jresult = (jint)result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBError_1SetErrorStringWithFormat_1_1SWIG_13(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jint jresult = 0 ; - lldb::SBError *arg1 = (lldb::SBError *) 0 ; - char *arg2 = (char *) 0 ; - int result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBError **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (int)(arg1)->SetErrorStringWithFormat((char const *)arg2); - jresult = (jint)result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBError_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBError *arg1 = (lldb::SBError *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBError **)&jarg1; - result = (bool)((lldb::SBError const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBError_1GetDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBError *arg1 = (lldb::SBError *) 0 ; - lldb::SBStream *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBError **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - result = (bool)(arg1)->GetDescription(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBError_1_1_1repr_1_1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBError *arg1 = (lldb::SBError *) 0 ; - std::string result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBError **)&jarg1; - result = lldb_SBError___repr__(arg1); - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBEnvironment_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBEnvironment *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBEnvironment *)new lldb::SBEnvironment(); - *(lldb::SBEnvironment **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBEnvironment_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBEnvironment *arg1 = 0 ; - lldb::SBEnvironment *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEnvironment **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEnvironment const & is null"); - return 0; - } - result = (lldb::SBEnvironment *)new lldb::SBEnvironment((lldb::SBEnvironment const &)*arg1); - *(lldb::SBEnvironment **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBEnvironment(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBEnvironment *arg1 = (lldb::SBEnvironment *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBEnvironment **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBEnvironment_1Get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jstring jresult = 0 ; - lldb::SBEnvironment *arg1 = (lldb::SBEnvironment *) 0 ; - char *arg2 = (char *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEnvironment **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (char *)(arg1)->Get((char const *)arg2); - if (result) jresult = jenv->NewStringUTF((const char *)result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBEnvironment_1GetNumValues(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBEnvironment *arg1 = (lldb::SBEnvironment *) 0 ; - size_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEnvironment **)&jarg1; - result = (arg1)->GetNumValues(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBEnvironment_1GetNameAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jstring jresult = 0 ; - lldb::SBEnvironment *arg1 = (lldb::SBEnvironment *) 0 ; - size_t arg2 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEnvironment **)&jarg1; - arg2 = (size_t)jarg2; - result = (char *)(arg1)->GetNameAtIndex(arg2); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBEnvironment_1GetValueAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jstring jresult = 0 ; - lldb::SBEnvironment *arg1 = (lldb::SBEnvironment *) 0 ; - size_t arg2 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEnvironment **)&jarg1; - arg2 = (size_t)jarg2; - result = (char *)(arg1)->GetValueAtIndex(arg2); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBEnvironment_1GetEntries(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBEnvironment *arg1 = (lldb::SBEnvironment *) 0 ; - lldb::SBStringList result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEnvironment **)&jarg1; - result = (arg1)->GetEntries(); - *(lldb::SBStringList **)&jresult = new lldb::SBStringList(result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBEnvironment_1PutEntry(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBEnvironment *arg1 = (lldb::SBEnvironment *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEnvironment **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->PutEntry((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBEnvironment_1SetEntries(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jboolean jarg3) { - lldb::SBEnvironment *arg1 = (lldb::SBEnvironment *) 0 ; - lldb::SBStringList *arg2 = 0 ; - bool arg3 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBEnvironment **)&jarg1; - arg2 = *(lldb::SBStringList **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStringList const & is null"); - return ; - } - arg3 = jarg3 ? true : false; - (arg1)->SetEntries((lldb::SBStringList const &)*arg2,arg3); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBEnvironment_1Set(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jstring jarg3, jboolean jarg4) { - jboolean jresult = 0 ; - lldb::SBEnvironment *arg1 = (lldb::SBEnvironment *) 0 ; - char *arg2 = (char *) 0 ; - char *arg3 = (char *) 0 ; - bool arg4 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEnvironment **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = 0; - if (jarg3) { - arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); - if (!arg3) return 0; - } - arg4 = jarg4 ? true : false; - result = (bool)(arg1)->Set((char const *)arg2,(char const *)arg3,arg4); - jresult = (jboolean)result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBEnvironment_1Unset(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jboolean jresult = 0 ; - lldb::SBEnvironment *arg1 = (lldb::SBEnvironment *) 0 ; - char *arg2 = (char *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEnvironment **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (bool)(arg1)->Unset((char const *)arg2); - jresult = (jboolean)result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBEnvironment_1Clear(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBEnvironment *arg1 = (lldb::SBEnvironment *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEnvironment **)&jarg1; - (arg1)->Clear(); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBEvent_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBEvent *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBEvent *)new lldb::SBEvent(); - *(lldb::SBEvent **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBEvent_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBEvent *arg1 = 0 ; - lldb::SBEvent *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEvent **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent const & is null"); - return 0; - } - result = (lldb::SBEvent *)new lldb::SBEvent((lldb::SBEvent const &)*arg1); - *(lldb::SBEvent **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBEvent_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jlong jarg1, jstring jarg2, jlong jarg3) { - jlong jresult = 0 ; - uint32_t arg1 ; - char *arg2 = (char *) 0 ; - uint32_t arg3 ; - lldb::SBEvent *result = 0 ; - - (void)jenv; - (void)jcls; - arg1 = (uint32_t)jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = (uint32_t)jarg3; - result = (lldb::SBEvent *)new lldb::SBEvent(arg1,(char const *)arg2,arg3); - *(lldb::SBEvent **)&jresult = result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBEvent(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBEvent *arg1 = (lldb::SBEvent *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBEvent **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBEvent_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBEvent *arg1 = (lldb::SBEvent *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEvent **)&jarg1; - result = (bool)((lldb::SBEvent const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBEvent_1GetDataFlavor(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBEvent *arg1 = (lldb::SBEvent *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEvent **)&jarg1; - result = (char *)(arg1)->GetDataFlavor(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBEvent_1GetType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBEvent *arg1 = (lldb::SBEvent *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEvent **)&jarg1; - result = (uint32_t)((lldb::SBEvent const *)arg1)->GetType(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBEvent_1GetBroadcaster(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBEvent *arg1 = (lldb::SBEvent *) 0 ; - lldb::SBBroadcaster result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEvent **)&jarg1; - result = ((lldb::SBEvent const *)arg1)->GetBroadcaster(); - *(lldb::SBBroadcaster **)&jresult = new lldb::SBBroadcaster(result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBEvent_1GetBroadcasterClass(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBEvent *arg1 = (lldb::SBEvent *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEvent **)&jarg1; - result = (char *)((lldb::SBEvent const *)arg1)->GetBroadcasterClass(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBEvent_1BroadcasterMatchesRef(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBEvent *arg1 = (lldb::SBEvent *) 0 ; - lldb::SBBroadcaster *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBEvent **)&jarg1; - arg2 = *(lldb::SBBroadcaster **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBBroadcaster const & is null"); - return 0; - } - result = (bool)(arg1)->BroadcasterMatchesRef((lldb::SBBroadcaster const &)*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBEvent_1Clear(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBEvent *arg1 = (lldb::SBEvent *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEvent **)&jarg1; - (arg1)->Clear(); -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBEvent_1GetCStringFromEvent(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBEvent *arg1 = 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEvent **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent const & is null"); - return 0; - } - result = (char *)lldb::SBEvent::GetCStringFromEvent((lldb::SBEvent const &)*arg1); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBEvent_1GetDescription_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBEvent *arg1 = (lldb::SBEvent *) 0 ; - lldb::SBStream *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBEvent **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - result = (bool)(arg1)->GetDescription(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBExecutionContext_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBExecutionContext *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBExecutionContext *)new lldb::SBExecutionContext(); - *(lldb::SBExecutionContext **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBExecutionContext_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBExecutionContext *arg1 = 0 ; - lldb::SBExecutionContext *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExecutionContext **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBExecutionContext const & is null"); - return 0; - } - result = (lldb::SBExecutionContext *)new lldb::SBExecutionContext((lldb::SBExecutionContext const &)*arg1); - *(lldb::SBExecutionContext **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBExecutionContext_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = 0 ; - lldb::SBExecutionContext *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBTarget const & is null"); - return 0; - } - result = (lldb::SBExecutionContext *)new lldb::SBExecutionContext((lldb::SBTarget const &)*arg1); - *(lldb::SBExecutionContext **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBExecutionContext_1_1SWIG_13(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = 0 ; - lldb::SBExecutionContext *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBProcess const & is null"); - return 0; - } - result = (lldb::SBExecutionContext *)new lldb::SBExecutionContext((lldb::SBProcess const &)*arg1); - *(lldb::SBExecutionContext **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBExecutionContext_1_1SWIG_14(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBThread arg1 ; - lldb::SBThread *argp1 ; - lldb::SBExecutionContext *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - argp1 = *(lldb::SBThread **)&jarg1; - if (!argp1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBThread"); - return 0; - } - arg1 = *argp1; - result = (lldb::SBExecutionContext *)new lldb::SBExecutionContext(arg1); - *(lldb::SBExecutionContext **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBExecutionContext_1_1SWIG_15(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBFrame *arg1 = 0 ; - lldb::SBExecutionContext *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFrame **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFrame const & is null"); - return 0; - } - result = (lldb::SBExecutionContext *)new lldb::SBExecutionContext((lldb::SBFrame const &)*arg1); - *(lldb::SBExecutionContext **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBExecutionContext(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBExecutionContext *arg1 = (lldb::SBExecutionContext *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBExecutionContext **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBExecutionContext_1GetTarget(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBExecutionContext *arg1 = (lldb::SBExecutionContext *) 0 ; - lldb::SBTarget result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExecutionContext **)&jarg1; - result = ((lldb::SBExecutionContext const *)arg1)->GetTarget(); - *(lldb::SBTarget **)&jresult = new lldb::SBTarget(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBExecutionContext_1GetProcess(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBExecutionContext *arg1 = (lldb::SBExecutionContext *) 0 ; - lldb::SBProcess result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExecutionContext **)&jarg1; - result = ((lldb::SBExecutionContext const *)arg1)->GetProcess(); - *(lldb::SBProcess **)&jresult = new lldb::SBProcess(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBExecutionContext_1GetThread(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBExecutionContext *arg1 = (lldb::SBExecutionContext *) 0 ; - lldb::SBThread result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExecutionContext **)&jarg1; - result = ((lldb::SBExecutionContext const *)arg1)->GetThread(); - *(lldb::SBThread **)&jresult = new lldb::SBThread(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBExecutionContext_1GetFrame(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBExecutionContext *arg1 = (lldb::SBExecutionContext *) 0 ; - lldb::SBFrame result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExecutionContext **)&jarg1; - result = ((lldb::SBExecutionContext const *)arg1)->GetFrame(); - *(lldb::SBFrame **)&jresult = new lldb::SBFrame(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBExpressionOptions_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBExpressionOptions *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBExpressionOptions *)new lldb::SBExpressionOptions(); - *(lldb::SBExpressionOptions **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBExpressionOptions_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBExpressionOptions *arg1 = 0 ; - lldb::SBExpressionOptions *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBExpressionOptions const & is null"); - return 0; - } - result = (lldb::SBExpressionOptions *)new lldb::SBExpressionOptions((lldb::SBExpressionOptions const &)*arg1); - *(lldb::SBExpressionOptions **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBExpressionOptions(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1GetCoerceResultToId(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - result = (bool)((lldb::SBExpressionOptions const *)arg1)->GetCoerceResultToId(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1SetCoerceResultToId_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetCoerceResultToId(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1SetCoerceResultToId_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - (arg1)->SetCoerceResultToId(); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1GetUnwindOnError(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - result = (bool)((lldb::SBExpressionOptions const *)arg1)->GetUnwindOnError(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1SetUnwindOnError_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetUnwindOnError(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1SetUnwindOnError_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - (arg1)->SetUnwindOnError(); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1GetIgnoreBreakpoints(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - result = (bool)((lldb::SBExpressionOptions const *)arg1)->GetIgnoreBreakpoints(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1SetIgnoreBreakpoints_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetIgnoreBreakpoints(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1SetIgnoreBreakpoints_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - (arg1)->SetIgnoreBreakpoints(); -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1GetFetchDynamicValue(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - lldb::DynamicValueType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - result = (lldb::DynamicValueType)((lldb::SBExpressionOptions const *)arg1)->GetFetchDynamicValue(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1SetFetchDynamicValue_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - lldb::DynamicValueType arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - arg2 = (lldb::DynamicValueType)jarg2; - (arg1)->SetFetchDynamicValue(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1SetFetchDynamicValue_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - (arg1)->SetFetchDynamicValue(); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1GetTimeoutInMicroSeconds(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - result = (uint32_t)((lldb::SBExpressionOptions const *)arg1)->GetTimeoutInMicroSeconds(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1SetTimeoutInMicroSeconds_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - uint32_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - arg2 = (uint32_t)jarg2; - (arg1)->SetTimeoutInMicroSeconds(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1SetTimeoutInMicroSeconds_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - (arg1)->SetTimeoutInMicroSeconds(); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1GetOneThreadTimeoutInMicroSeconds(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - result = (uint32_t)((lldb::SBExpressionOptions const *)arg1)->GetOneThreadTimeoutInMicroSeconds(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1SetOneThreadTimeoutInMicroSeconds_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - uint32_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - arg2 = (uint32_t)jarg2; - (arg1)->SetOneThreadTimeoutInMicroSeconds(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1SetOneThreadTimeoutInMicroSeconds_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - (arg1)->SetOneThreadTimeoutInMicroSeconds(); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1GetTryAllThreads(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - result = (bool)((lldb::SBExpressionOptions const *)arg1)->GetTryAllThreads(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1SetTryAllThreads_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetTryAllThreads(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1SetTryAllThreads_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - (arg1)->SetTryAllThreads(); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1GetStopOthers(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - result = (bool)((lldb::SBExpressionOptions const *)arg1)->GetStopOthers(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1SetStopOthers_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetStopOthers(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1SetStopOthers_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - (arg1)->SetStopOthers(); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1GetTrapExceptions(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - result = (bool)((lldb::SBExpressionOptions const *)arg1)->GetTrapExceptions(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1SetTrapExceptions_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetTrapExceptions(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1SetTrapExceptions_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - (arg1)->SetTrapExceptions(); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1SetLanguage(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - lldb::LanguageType arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - arg2 = (lldb::LanguageType)jarg2; - (arg1)->SetLanguage(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1GetGenerateDebugInfo(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - result = (bool)(arg1)->GetGenerateDebugInfo(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1SetGenerateDebugInfo_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetGenerateDebugInfo(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1SetGenerateDebugInfo_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - (arg1)->SetGenerateDebugInfo(); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1GetSuppressPersistentResult(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - result = (bool)(arg1)->GetSuppressPersistentResult(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1SetSuppressPersistentResult_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetSuppressPersistentResult(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1SetSuppressPersistentResult_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - (arg1)->SetSuppressPersistentResult(); -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1GetPrefix(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - result = (char *)((lldb::SBExpressionOptions const *)arg1)->GetPrefix(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1SetPrefix(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->SetPrefix((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1SetAutoApplyFixIts_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetAutoApplyFixIts(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1SetAutoApplyFixIts_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - (arg1)->SetAutoApplyFixIts(); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1GetAutoApplyFixIts(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - result = (bool)(arg1)->GetAutoApplyFixIts(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1SetRetriesWithFixIts(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2) { - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - uint64_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return ; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (uint64_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - (arg1)->SetRetriesWithFixIts(arg2); -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1GetRetriesWithFixIts(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - uint64_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - result = (uint64_t)(arg1)->GetRetriesWithFixIts(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1GetTopLevel(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - result = (bool)(arg1)->GetTopLevel(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1SetTopLevel_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetTopLevel(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1SetTopLevel_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - (arg1)->SetTopLevel(); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1GetAllowJIT(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - result = (bool)(arg1)->GetAllowJIT(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBExpressionOptions_1SetAllowJIT(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBExpressionOptions *arg1 = (lldb::SBExpressionOptions *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBExpressionOptions **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetAllowJIT(arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBFile_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBFile *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBFile *)new lldb::SBFile(); - *(lldb::SBFile **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBFile_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1) { - jlong jresult = 0 ; - SwigValueWrapper< std::shared_ptr< lldb_private::File > > arg1 ; - lldb::FileSP *argp1 ; - lldb::SBFile *result = 0 ; - - (void)jenv; - (void)jcls; - argp1 = *(lldb::FileSP **)&jarg1; - if (!argp1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::FileSP"); - return 0; - } - arg1 = *argp1; - result = (lldb::SBFile *)new lldb::SBFile(arg1); - *(lldb::SBFile **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBFile_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jint jarg1, jstring jarg2, jboolean jarg3) { - jlong jresult = 0 ; - int arg1 ; - char *arg2 = (char *) 0 ; - bool arg3 ; - lldb::SBFile *result = 0 ; - - (void)jenv; - (void)jcls; - arg1 = (int)jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = jarg3 ? true : false; - result = (lldb::SBFile *)new lldb::SBFile(arg1,(char const *)arg2,arg3); - *(lldb::SBFile **)&jresult = result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBFile(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBFile *arg1 = (lldb::SBFile *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBFile **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFile_1Read(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jlong jarg3, jlong jarg4) { - jlong jresult = 0 ; - lldb::SBFile *arg1 = (lldb::SBFile *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - size_t arg3 ; - size_t *arg4 = (size_t *) 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFile **)&jarg1; - arg2 = *(uint8_t **)&jarg2; - arg3 = (size_t)jarg3; - arg4 = *(size_t **)&jarg4; - result = (arg1)->Read(arg2,arg3,arg4); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFile_1Write(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jlong jarg3, jlong jarg4) { - jlong jresult = 0 ; - lldb::SBFile *arg1 = (lldb::SBFile *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - size_t arg3 ; - size_t *arg4 = (size_t *) 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFile **)&jarg1; - arg2 = *(uint8_t **)&jarg2; - arg3 = (size_t)jarg3; - arg4 = *(size_t **)&jarg4; - result = (arg1)->Write((uint8_t const *)arg2,arg3,arg4); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFile_1Flush(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBFile *arg1 = (lldb::SBFile *) 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFile **)&jarg1; - result = (arg1)->Flush(); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBFile_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBFile *arg1 = (lldb::SBFile *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFile **)&jarg1; - result = (bool)((lldb::SBFile const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFile_1Close(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBFile *arg1 = (lldb::SBFile *) 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFile **)&jarg1; - result = (arg1)->Close(); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFile_1GetFile(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBFile *arg1 = (lldb::SBFile *) 0 ; - SwigValueWrapper< std::shared_ptr< lldb_private::File > > result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFile **)&jarg1; - result = ((lldb::SBFile const *)arg1)->GetFile(); - *(lldb::FileSP **)&jresult = new lldb::FileSP(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFile_1MakeBorrowed(JNIEnv *jenv, jclass jcls, jlong jarg1) { - jlong jresult = 0 ; - SwigValueWrapper< std::shared_ptr< lldb_private::File > > arg1 ; - lldb::FileSP *argp1 ; - lldb::SBFile result; - - (void)jenv; - (void)jcls; - argp1 = *(lldb::FileSP **)&jarg1; - if (!argp1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::FileSP"); - return 0; - } - arg1 = *argp1; - result = lldb_SBFile_MakeBorrowed(SWIG_STD_MOVE(arg1)); - *(lldb::SBFile **)&jresult = new lldb::SBFile(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFile_1MakeForcingIOMethods(JNIEnv *jenv, jclass jcls, jlong jarg1) { - jlong jresult = 0 ; - SwigValueWrapper< std::shared_ptr< lldb_private::File > > arg1 ; - lldb::FileSP *argp1 ; - lldb::SBFile result; - - (void)jenv; - (void)jcls; - argp1 = *(lldb::FileSP **)&jarg1; - if (!argp1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::FileSP"); - return 0; - } - arg1 = *argp1; - result = lldb_SBFile_MakeForcingIOMethods(SWIG_STD_MOVE(arg1)); - *(lldb::SBFile **)&jresult = new lldb::SBFile(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFile_1MakeBorrowedForcingIOMethods(JNIEnv *jenv, jclass jcls, jlong jarg1) { - jlong jresult = 0 ; - SwigValueWrapper< std::shared_ptr< lldb_private::File > > arg1 ; - lldb::FileSP *argp1 ; - lldb::SBFile result; - - (void)jenv; - (void)jcls; - argp1 = *(lldb::FileSP **)&jarg1; - if (!argp1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::FileSP"); - return 0; - } - arg1 = *argp1; - result = lldb_SBFile_MakeBorrowedForcingIOMethods(SWIG_STD_MOVE(arg1)); - *(lldb::SBFile **)&jresult = new lldb::SBFile(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBFileSpec_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBFileSpec *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBFileSpec *)new lldb::SBFileSpec(); - *(lldb::SBFileSpec **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBFileSpec_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBFileSpec *arg1 = 0 ; - lldb::SBFileSpec *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFileSpec **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec const & is null"); - return 0; - } - result = (lldb::SBFileSpec *)new lldb::SBFileSpec((lldb::SBFileSpec const &)*arg1); - *(lldb::SBFileSpec **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBFileSpec_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jstring jarg1) { - jlong jresult = 0 ; - char *arg1 = (char *) 0 ; - lldb::SBFileSpec *result = 0 ; - - (void)jenv; - (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - result = (lldb::SBFileSpec *)new lldb::SBFileSpec((char const *)arg1); - *(lldb::SBFileSpec **)&jresult = result; - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBFileSpec_1_1SWIG_13(JNIEnv *jenv, jclass jcls, jstring jarg1, jboolean jarg2) { - jlong jresult = 0 ; - char *arg1 = (char *) 0 ; - bool arg2 ; - lldb::SBFileSpec *result = 0 ; - - (void)jenv; - (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - arg2 = jarg2 ? true : false; - result = (lldb::SBFileSpec *)new lldb::SBFileSpec((char const *)arg1,arg2); - *(lldb::SBFileSpec **)&jresult = result; - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBFileSpec(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBFileSpec *arg1 = (lldb::SBFileSpec *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBFileSpec **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBFileSpec_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBFileSpec *arg1 = (lldb::SBFileSpec *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFileSpec **)&jarg1; - result = (bool)((lldb::SBFileSpec const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBFileSpec_1Exists(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBFileSpec *arg1 = (lldb::SBFileSpec *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFileSpec **)&jarg1; - result = (bool)((lldb::SBFileSpec const *)arg1)->Exists(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBFileSpec_1ResolveExecutableLocation(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBFileSpec *arg1 = (lldb::SBFileSpec *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFileSpec **)&jarg1; - result = (bool)(arg1)->ResolveExecutableLocation(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBFileSpec_1GetFilename(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBFileSpec *arg1 = (lldb::SBFileSpec *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFileSpec **)&jarg1; - result = (char *)((lldb::SBFileSpec const *)arg1)->GetFilename(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBFileSpec_1GetDirectory(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBFileSpec *arg1 = (lldb::SBFileSpec *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFileSpec **)&jarg1; - result = (char *)((lldb::SBFileSpec const *)arg1)->GetDirectory(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBFileSpec_1SetFilename(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBFileSpec *arg1 = (lldb::SBFileSpec *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFileSpec **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->SetFilename((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBFileSpec_1SetDirectory(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBFileSpec *arg1 = (lldb::SBFileSpec *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFileSpec **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->SetDirectory((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFileSpec_1GetPath(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3) { - jlong jresult = 0 ; - lldb::SBFileSpec *arg1 = (lldb::SBFileSpec *) 0 ; - char *arg2 = (char *) 0 ; - size_t arg3 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFileSpec **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = (size_t)jarg3; - result = (uint32_t)((lldb::SBFileSpec const *)arg1)->GetPath(arg2,arg3); - jresult = (jlong)result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBFileSpec_1ResolvePath(JNIEnv *jenv, jclass jcls, jstring jarg1, jstring jarg2, jlong jarg3) { - jint jresult = 0 ; - char *arg1 = (char *) 0 ; - char *arg2 = (char *) 0 ; - size_t arg3 ; - int result; - - (void)jenv; - (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = (size_t)jarg3; - result = (int)lldb::SBFileSpec::ResolvePath((char const *)arg1,arg2,SWIG_STD_MOVE(arg3)); - jresult = (jint)result; - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBFileSpec_1GetDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBFileSpec *arg1 = (lldb::SBFileSpec *) 0 ; - lldb::SBStream *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBFileSpec **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - result = (bool)((lldb::SBFileSpec const *)arg1)->GetDescription(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBFileSpec_1AppendPathComponent(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBFileSpec *arg1 = (lldb::SBFileSpec *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFileSpec **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->AppendPathComponent((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBFileSpec_1_1_1repr_1_1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBFileSpec *arg1 = (lldb::SBFileSpec *) 0 ; - std::string result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFileSpec **)&jarg1; - result = lldb_SBFileSpec___repr__(arg1); - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBFileSpecList_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBFileSpecList *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBFileSpecList *)new lldb::SBFileSpecList(); - *(lldb::SBFileSpecList **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBFileSpecList_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBFileSpecList *arg1 = 0 ; - lldb::SBFileSpecList *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFileSpecList **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpecList const & is null"); - return 0; - } - result = (lldb::SBFileSpecList *)new lldb::SBFileSpecList((lldb::SBFileSpecList const &)*arg1); - *(lldb::SBFileSpecList **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBFileSpecList(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBFileSpecList *arg1 = (lldb::SBFileSpecList *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBFileSpecList **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFileSpecList_1GetSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBFileSpecList *arg1 = (lldb::SBFileSpecList *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFileSpecList **)&jarg1; - result = (uint32_t)((lldb::SBFileSpecList const *)arg1)->GetSize(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBFileSpecList_1GetDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBFileSpecList *arg1 = (lldb::SBFileSpecList *) 0 ; - lldb::SBStream *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBFileSpecList **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - result = (bool)((lldb::SBFileSpecList const *)arg1)->GetDescription(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBFileSpecList_1Append(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBFileSpecList *arg1 = (lldb::SBFileSpecList *) 0 ; - lldb::SBFileSpec *arg2 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBFileSpecList **)&jarg1; - arg2 = *(lldb::SBFileSpec **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec const & is null"); - return ; - } - (arg1)->Append((lldb::SBFileSpec const &)*arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBFileSpecList_1AppendIfUnique(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBFileSpecList *arg1 = (lldb::SBFileSpecList *) 0 ; - lldb::SBFileSpec *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBFileSpecList **)&jarg1; - arg2 = *(lldb::SBFileSpec **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec const & is null"); - return 0; - } - result = (bool)(arg1)->AppendIfUnique((lldb::SBFileSpec const &)*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBFileSpecList_1Clear(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBFileSpecList *arg1 = (lldb::SBFileSpecList *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFileSpecList **)&jarg1; - (arg1)->Clear(); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFileSpecList_1FindFileIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jlong jarg3, jobject jarg3_, jboolean jarg4) { - jlong jresult = 0 ; - lldb::SBFileSpecList *arg1 = (lldb::SBFileSpecList *) 0 ; - uint32_t arg2 ; - lldb::SBFileSpec *arg3 = 0 ; - bool arg4 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - arg1 = *(lldb::SBFileSpecList **)&jarg1; - arg2 = (uint32_t)jarg2; - arg3 = *(lldb::SBFileSpec **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec const & is null"); - return 0; - } - arg4 = jarg4 ? true : false; - result = (uint32_t)(arg1)->FindFileIndex(arg2,(lldb::SBFileSpec const &)*arg3,arg4); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFileSpecList_1GetFileSpecAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBFileSpecList *arg1 = (lldb::SBFileSpecList *) 0 ; - uint32_t arg2 ; - lldb::SBFileSpec result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFileSpecList **)&jarg1; - arg2 = (uint32_t)jarg2; - result = ((lldb::SBFileSpecList const *)arg1)->GetFileSpecAtIndex(arg2); - *(lldb::SBFileSpec **)&jresult = new lldb::SBFileSpec(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBFrame_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBFrame *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBFrame *)new lldb::SBFrame(); - *(lldb::SBFrame **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBFrame_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBFrame *arg1 = 0 ; - lldb::SBFrame *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFrame **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFrame const & is null"); - return 0; - } - result = (lldb::SBFrame *)new lldb::SBFrame((lldb::SBFrame const &)*arg1); - *(lldb::SBFrame **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBFrame(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBFrame *arg1 = (lldb::SBFrame *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBFrame **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBFrame_1IsEqual(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBFrame *arg1 = (lldb::SBFrame *) 0 ; - lldb::SBFrame *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBFrame **)&jarg1; - arg2 = *(lldb::SBFrame **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFrame const & is null"); - return 0; - } - result = (bool)((lldb::SBFrame const *)arg1)->IsEqual((lldb::SBFrame const &)*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBFrame_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBFrame *arg1 = (lldb::SBFrame *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFrame **)&jarg1; - result = (bool)((lldb::SBFrame const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFrame_1GetFrameID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBFrame *arg1 = (lldb::SBFrame *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFrame **)&jarg1; - result = (uint32_t)((lldb::SBFrame const *)arg1)->GetFrameID(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBFrame_1GetCFA(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBFrame *arg1 = (lldb::SBFrame *) 0 ; - lldb::addr_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFrame **)&jarg1; - result = (lldb::addr_t)((lldb::SBFrame const *)arg1)->GetCFA(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBFrame_1GetPC(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBFrame *arg1 = (lldb::SBFrame *) 0 ; - lldb::addr_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFrame **)&jarg1; - result = (lldb::addr_t)((lldb::SBFrame const *)arg1)->GetPC(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBFrame_1SetPC(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2) { - jboolean jresult = 0 ; - lldb::SBFrame *arg1 = (lldb::SBFrame *) 0 ; - lldb::addr_t arg2 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFrame **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (lldb::addr_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (bool)(arg1)->SetPC(arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBFrame_1GetSP(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBFrame *arg1 = (lldb::SBFrame *) 0 ; - lldb::addr_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFrame **)&jarg1; - result = (lldb::addr_t)((lldb::SBFrame const *)arg1)->GetSP(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBFrame_1GetFP(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBFrame *arg1 = (lldb::SBFrame *) 0 ; - lldb::addr_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFrame **)&jarg1; - result = (lldb::addr_t)((lldb::SBFrame const *)arg1)->GetFP(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFrame_1GetPCAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBFrame *arg1 = (lldb::SBFrame *) 0 ; - lldb::SBAddress result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFrame **)&jarg1; - result = ((lldb::SBFrame const *)arg1)->GetPCAddress(); - *(lldb::SBAddress **)&jresult = new lldb::SBAddress(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFrame_1GetSymbolContext(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBFrame *arg1 = (lldb::SBFrame *) 0 ; - uint32_t arg2 ; - lldb::SBSymbolContext result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFrame **)&jarg1; - arg2 = (uint32_t)jarg2; - result = ((lldb::SBFrame const *)arg1)->GetSymbolContext(arg2); - *(lldb::SBSymbolContext **)&jresult = new lldb::SBSymbolContext(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFrame_1GetModule(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBFrame *arg1 = (lldb::SBFrame *) 0 ; - lldb::SBModule result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFrame **)&jarg1; - result = ((lldb::SBFrame const *)arg1)->GetModule(); - *(lldb::SBModule **)&jresult = new lldb::SBModule(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFrame_1GetCompileUnit(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBFrame *arg1 = (lldb::SBFrame *) 0 ; - lldb::SBCompileUnit result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFrame **)&jarg1; - result = ((lldb::SBFrame const *)arg1)->GetCompileUnit(); - *(lldb::SBCompileUnit **)&jresult = new lldb::SBCompileUnit(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFrame_1GetFunction(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBFrame *arg1 = (lldb::SBFrame *) 0 ; - lldb::SBFunction result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFrame **)&jarg1; - result = ((lldb::SBFrame const *)arg1)->GetFunction(); - *(lldb::SBFunction **)&jresult = new lldb::SBFunction(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFrame_1GetSymbol(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBFrame *arg1 = (lldb::SBFrame *) 0 ; - lldb::SBSymbol result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFrame **)&jarg1; - result = ((lldb::SBFrame const *)arg1)->GetSymbol(); - *(lldb::SBSymbol **)&jresult = new lldb::SBSymbol(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFrame_1GetBlock(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBFrame *arg1 = (lldb::SBFrame *) 0 ; - lldb::SBBlock result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFrame **)&jarg1; - result = ((lldb::SBFrame const *)arg1)->GetBlock(); - *(lldb::SBBlock **)&jresult = new lldb::SBBlock(result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBFrame_1GetFunctionName_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBFrame *arg1 = (lldb::SBFrame *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFrame **)&jarg1; - result = (char *)(arg1)->GetFunctionName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBFrame_1GetDisplayFunctionName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBFrame *arg1 = (lldb::SBFrame *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFrame **)&jarg1; - result = (char *)(arg1)->GetDisplayFunctionName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBFrame_1GuessLanguage(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBFrame *arg1 = (lldb::SBFrame *) 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFrame **)&jarg1; - result = (lldb::LanguageType)((lldb::SBFrame const *)arg1)->GuessLanguage(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBFrame_1IsInlined_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBFrame *arg1 = (lldb::SBFrame *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFrame **)&jarg1; - result = (bool)(arg1)->IsInlined(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBFrame_1IsArtificial_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBFrame *arg1 = (lldb::SBFrame *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFrame **)&jarg1; - result = (bool)(arg1)->IsArtificial(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFrame_1EvaluateExpression_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBFrame *arg1 = (lldb::SBFrame *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFrame **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (arg1)->EvaluateExpression((char const *)arg2); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFrame_1EvaluateExpression_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jint jarg3) { - jlong jresult = 0 ; - lldb::SBFrame *arg1 = (lldb::SBFrame *) 0 ; - char *arg2 = (char *) 0 ; - lldb::DynamicValueType arg3 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFrame **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = (lldb::DynamicValueType)jarg3; - result = (arg1)->EvaluateExpression((char const *)arg2,arg3); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFrame_1EvaluateExpression_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jint jarg3, jboolean jarg4) { - jlong jresult = 0 ; - lldb::SBFrame *arg1 = (lldb::SBFrame *) 0 ; - char *arg2 = (char *) 0 ; - lldb::DynamicValueType arg3 ; - bool arg4 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFrame **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = (lldb::DynamicValueType)jarg3; - arg4 = jarg4 ? true : false; - result = (arg1)->EvaluateExpression((char const *)arg2,arg3,arg4); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFrame_1EvaluateExpression_1_1SWIG_13(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jobject jarg3_) { - jlong jresult = 0 ; - lldb::SBFrame *arg1 = (lldb::SBFrame *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBExpressionOptions *arg3 = 0 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - arg1 = *(lldb::SBFrame **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = *(lldb::SBExpressionOptions **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBExpressionOptions const & is null"); - return 0; - } - result = (arg1)->EvaluateExpression((char const *)arg2,(lldb::SBExpressionOptions const &)*arg3); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFrame_1GetFrameBlock(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBFrame *arg1 = (lldb::SBFrame *) 0 ; - lldb::SBBlock result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFrame **)&jarg1; - result = ((lldb::SBFrame const *)arg1)->GetFrameBlock(); - *(lldb::SBBlock **)&jresult = new lldb::SBBlock(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFrame_1GetLineEntry(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBFrame *arg1 = (lldb::SBFrame *) 0 ; - lldb::SBLineEntry result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFrame **)&jarg1; - result = ((lldb::SBFrame const *)arg1)->GetLineEntry(); - *(lldb::SBLineEntry **)&jresult = new lldb::SBLineEntry(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFrame_1GetThread(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBFrame *arg1 = (lldb::SBFrame *) 0 ; - lldb::SBThread result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFrame **)&jarg1; - result = ((lldb::SBFrame const *)arg1)->GetThread(); - *(lldb::SBThread **)&jresult = new lldb::SBThread(result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBFrame_1Disassemble(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBFrame *arg1 = (lldb::SBFrame *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFrame **)&jarg1; - result = (char *)((lldb::SBFrame const *)arg1)->Disassemble(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBFrame_1Clear(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBFrame *arg1 = (lldb::SBFrame *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFrame **)&jarg1; - (arg1)->Clear(); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFrame_1GetVariables_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2, jboolean jarg3, jboolean jarg4, jboolean jarg5) { - jlong jresult = 0 ; - lldb::SBFrame *arg1 = (lldb::SBFrame *) 0 ; - bool arg2 ; - bool arg3 ; - bool arg4 ; - bool arg5 ; - lldb::SBValueList result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFrame **)&jarg1; - arg2 = jarg2 ? true : false; - arg3 = jarg3 ? true : false; - arg4 = jarg4 ? true : false; - arg5 = jarg5 ? true : false; - result = (arg1)->GetVariables(arg2,arg3,arg4,arg5); - *(lldb::SBValueList **)&jresult = new lldb::SBValueList(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFrame_1GetVariables_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2, jboolean jarg3, jboolean jarg4, jboolean jarg5, jint jarg6) { - jlong jresult = 0 ; - lldb::SBFrame *arg1 = (lldb::SBFrame *) 0 ; - bool arg2 ; - bool arg3 ; - bool arg4 ; - bool arg5 ; - lldb::DynamicValueType arg6 ; - lldb::SBValueList result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFrame **)&jarg1; - arg2 = jarg2 ? true : false; - arg3 = jarg3 ? true : false; - arg4 = jarg4 ? true : false; - arg5 = jarg5 ? true : false; - arg6 = (lldb::DynamicValueType)jarg6; - result = (arg1)->GetVariables(arg2,arg3,arg4,arg5,arg6); - *(lldb::SBValueList **)&jresult = new lldb::SBValueList(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFrame_1GetVariables_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBFrame *arg1 = (lldb::SBFrame *) 0 ; - lldb::SBVariablesOptions *arg2 = 0 ; - lldb::SBValueList result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBFrame **)&jarg1; - arg2 = *(lldb::SBVariablesOptions **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBVariablesOptions const & is null"); - return 0; - } - result = (arg1)->GetVariables((lldb::SBVariablesOptions const &)*arg2); - *(lldb::SBValueList **)&jresult = new lldb::SBValueList(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFrame_1GetRegisters(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBFrame *arg1 = (lldb::SBFrame *) 0 ; - lldb::SBValueList result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFrame **)&jarg1; - result = (arg1)->GetRegisters(); - *(lldb::SBValueList **)&jresult = new lldb::SBValueList(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFrame_1FindRegister(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBFrame *arg1 = (lldb::SBFrame *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFrame **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (arg1)->FindRegister((char const *)arg2); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFrame_1FindVariable_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBFrame *arg1 = (lldb::SBFrame *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFrame **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (arg1)->FindVariable((char const *)arg2); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFrame_1FindVariable_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jint jarg3) { - jlong jresult = 0 ; - lldb::SBFrame *arg1 = (lldb::SBFrame *) 0 ; - char *arg2 = (char *) 0 ; - lldb::DynamicValueType arg3 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFrame **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = (lldb::DynamicValueType)jarg3; - result = (arg1)->FindVariable((char const *)arg2,arg3); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFrame_1GetValueForVariablePath_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jint jarg3) { - jlong jresult = 0 ; - lldb::SBFrame *arg1 = (lldb::SBFrame *) 0 ; - char *arg2 = (char *) 0 ; - lldb::DynamicValueType arg3 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFrame **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = (lldb::DynamicValueType)jarg3; - result = (arg1)->GetValueForVariablePath((char const *)arg2,arg3); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFrame_1GetValueForVariablePath_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBFrame *arg1 = (lldb::SBFrame *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFrame **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (arg1)->GetValueForVariablePath((char const *)arg2); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFrame_1FindValue_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jint jarg3) { - jlong jresult = 0 ; - lldb::SBFrame *arg1 = (lldb::SBFrame *) 0 ; - char *arg2 = (char *) 0 ; - lldb::ValueType arg3 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFrame **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = (lldb::ValueType)jarg3; - result = (arg1)->FindValue((char const *)arg2,arg3); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFrame_1FindValue_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jint jarg3, jint jarg4) { - jlong jresult = 0 ; - lldb::SBFrame *arg1 = (lldb::SBFrame *) 0 ; - char *arg2 = (char *) 0 ; - lldb::ValueType arg3 ; - lldb::DynamicValueType arg4 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFrame **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = (lldb::ValueType)jarg3; - arg4 = (lldb::DynamicValueType)jarg4; - result = (arg1)->FindValue((char const *)arg2,arg3,arg4); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBFrame_1GetDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBFrame *arg1 = (lldb::SBFrame *) 0 ; - lldb::SBStream *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBFrame **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - result = (bool)(arg1)->GetDescription(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBFrame_1_1_1repr_1_1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBFrame *arg1 = (lldb::SBFrame *) 0 ; - std::string result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFrame **)&jarg1; - result = lldb_SBFrame___repr__(arg1); - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBFunction_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBFunction *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBFunction *)new lldb::SBFunction(); - *(lldb::SBFunction **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBFunction_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBFunction *arg1 = 0 ; - lldb::SBFunction *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFunction **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFunction const & is null"); - return 0; - } - result = (lldb::SBFunction *)new lldb::SBFunction((lldb::SBFunction const &)*arg1); - *(lldb::SBFunction **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBFunction(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBFunction *arg1 = (lldb::SBFunction *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBFunction **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBFunction_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBFunction *arg1 = (lldb::SBFunction *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFunction **)&jarg1; - result = (bool)((lldb::SBFunction const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBFunction_1GetName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBFunction *arg1 = (lldb::SBFunction *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFunction **)&jarg1; - result = (char *)((lldb::SBFunction const *)arg1)->GetName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBFunction_1GetDisplayName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBFunction *arg1 = (lldb::SBFunction *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFunction **)&jarg1; - result = (char *)((lldb::SBFunction const *)arg1)->GetDisplayName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBFunction_1GetMangledName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBFunction *arg1 = (lldb::SBFunction *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFunction **)&jarg1; - result = (char *)((lldb::SBFunction const *)arg1)->GetMangledName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFunction_1GetInstructions_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBFunction *arg1 = (lldb::SBFunction *) 0 ; - lldb::SBTarget arg2 ; - lldb::SBTarget *argp2 ; - lldb::SBInstructionList result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBFunction **)&jarg1; - argp2 = *(lldb::SBTarget **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBTarget"); - return 0; - } - arg2 = *argp2; - result = (arg1)->GetInstructions(arg2); - *(lldb::SBInstructionList **)&jresult = new lldb::SBInstructionList(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFunction_1GetInstructions_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jstring jarg3) { - jlong jresult = 0 ; - lldb::SBFunction *arg1 = (lldb::SBFunction *) 0 ; - lldb::SBTarget arg2 ; - char *arg3 = (char *) 0 ; - lldb::SBTarget *argp2 ; - lldb::SBInstructionList result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBFunction **)&jarg1; - argp2 = *(lldb::SBTarget **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBTarget"); - return 0; - } - arg2 = *argp2; - arg3 = 0; - if (jarg3) { - arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); - if (!arg3) return 0; - } - result = (arg1)->GetInstructions(arg2,(char const *)arg3); - *(lldb::SBInstructionList **)&jresult = new lldb::SBInstructionList(result); - if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFunction_1GetStartAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBFunction *arg1 = (lldb::SBFunction *) 0 ; - lldb::SBAddress result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFunction **)&jarg1; - result = (arg1)->GetStartAddress(); - *(lldb::SBAddress **)&jresult = new lldb::SBAddress(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFunction_1GetEndAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBFunction *arg1 = (lldb::SBFunction *) 0 ; - lldb::SBAddress result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFunction **)&jarg1; - result = (arg1)->GetEndAddress(); - *(lldb::SBAddress **)&jresult = new lldb::SBAddress(result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBFunction_1GetArgumentName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jstring jresult = 0 ; - lldb::SBFunction *arg1 = (lldb::SBFunction *) 0 ; - uint32_t arg2 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFunction **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (char *)(arg1)->GetArgumentName(arg2); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFunction_1GetPrologueByteSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBFunction *arg1 = (lldb::SBFunction *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFunction **)&jarg1; - result = (uint32_t)(arg1)->GetPrologueByteSize(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFunction_1GetType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBFunction *arg1 = (lldb::SBFunction *) 0 ; - lldb::SBType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFunction **)&jarg1; - result = (arg1)->GetType(); - *(lldb::SBType **)&jresult = new lldb::SBType(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBFunction_1GetBlock(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBFunction *arg1 = (lldb::SBFunction *) 0 ; - lldb::SBBlock result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFunction **)&jarg1; - result = (arg1)->GetBlock(); - *(lldb::SBBlock **)&jresult = new lldb::SBBlock(result); - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBFunction_1GetLanguage(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBFunction *arg1 = (lldb::SBFunction *) 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFunction **)&jarg1; - result = (lldb::LanguageType)(arg1)->GetLanguage(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBFunction_1GetIsOptimized(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBFunction *arg1 = (lldb::SBFunction *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFunction **)&jarg1; - result = (bool)(arg1)->GetIsOptimized(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBFunction_1GetDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBFunction *arg1 = (lldb::SBFunction *) 0 ; - lldb::SBStream *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBFunction **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - result = (bool)(arg1)->GetDescription(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBFunction_1_1_1repr_1_1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBFunction *arg1 = (lldb::SBFunction *) 0 ; - std::string result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBFunction **)&jarg1; - result = lldb_SBFunction___repr__(arg1); - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBHostOS_1GetProgramFileSpec(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBFileSpec result; - - (void)jenv; - (void)jcls; - result = lldb::SBHostOS::GetProgramFileSpec(); - *(lldb::SBFileSpec **)&jresult = new lldb::SBFileSpec(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBHostOS_1GetLLDBPythonPath(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBFileSpec result; - - (void)jenv; - (void)jcls; - result = lldb::SBHostOS::GetLLDBPythonPath(); - *(lldb::SBFileSpec **)&jresult = new lldb::SBFileSpec(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBHostOS_1GetLLDBPath(JNIEnv *jenv, jclass jcls, jint jarg1) { - jlong jresult = 0 ; - lldb::PathType arg1 ; - lldb::SBFileSpec result; - - (void)jenv; - (void)jcls; - arg1 = (lldb::PathType)jarg1; - result = lldb::SBHostOS::GetLLDBPath(arg1); - *(lldb::SBFileSpec **)&jresult = new lldb::SBFileSpec(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBHostOS_1GetUserHomeDirectory(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBFileSpec result; - - (void)jenv; - (void)jcls; - result = lldb::SBHostOS::GetUserHomeDirectory(); - *(lldb::SBFileSpec **)&jresult = new lldb::SBFileSpec(result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBHostOS_1ThreadCreated(JNIEnv *jenv, jclass jcls, jstring jarg1) { - char *arg1 = (char *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return ; - } - lldb::SBHostOS::ThreadCreated((char const *)arg1); - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBHostOS_1ThreadCreate(JNIEnv *jenv, jclass jcls, jstring jarg1, jlong jarg2, jlong jarg3, jlong jarg4, jobject jarg4_) { - jlong jresult = 0 ; - char *arg1 = (char *) 0 ; - lldb::thread_func_t arg2 = (lldb::thread_func_t) 0 ; - void *arg3 = (void *) 0 ; - lldb::SBError *arg4 = (lldb::SBError *) 0 ; - lldb::thread_t result; - - (void)jenv; - (void)jcls; - (void)jarg4_; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - arg2 = *(lldb::thread_func_t *)&jarg2; - arg3 = *(void **)&jarg3; - arg4 = *(lldb::SBError **)&jarg4; - result = lldb::SBHostOS::ThreadCreate((char const *)arg1,arg2,arg3,arg4); - *(lldb::thread_t **)&jresult = new lldb::thread_t(result); - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBHostOS_1ThreadCancel(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::thread_t arg1 ; - lldb::SBError *arg2 = (lldb::SBError *) 0 ; - lldb::thread_t *argp1 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg2_; - argp1 = *(lldb::thread_t **)&jarg1; - if (!argp1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::thread_t"); - return 0; - } - arg1 = *argp1; - arg2 = *(lldb::SBError **)&jarg2; - result = (bool)lldb::SBHostOS::ThreadCancel(SWIG_STD_MOVE(arg1),arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBHostOS_1ThreadDetach(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::thread_t arg1 ; - lldb::SBError *arg2 = (lldb::SBError *) 0 ; - lldb::thread_t *argp1 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg2_; - argp1 = *(lldb::thread_t **)&jarg1; - if (!argp1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::thread_t"); - return 0; - } - arg1 = *argp1; - arg2 = *(lldb::SBError **)&jarg2; - result = (bool)lldb::SBHostOS::ThreadDetach(SWIG_STD_MOVE(arg1),arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBHostOS_1ThreadJoin(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jlong jarg3, jobject jarg3_) { - jboolean jresult = 0 ; - lldb::thread_t arg1 ; - lldb::thread_result_t *arg2 = (lldb::thread_result_t *) 0 ; - lldb::SBError *arg3 = (lldb::SBError *) 0 ; - lldb::thread_t *argp1 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg3_; - argp1 = *(lldb::thread_t **)&jarg1; - if (!argp1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::thread_t"); - return 0; - } - arg1 = *argp1; - arg2 = *(lldb::thread_result_t **)&jarg2; - arg3 = *(lldb::SBError **)&jarg3; - result = (bool)lldb::SBHostOS::ThreadJoin(SWIG_STD_MOVE(arg1),arg2,arg3); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBHostOS(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBHostOS *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBHostOS *)new lldb::SBHostOS(); - *(lldb::SBHostOS **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBHostOS(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBHostOS *arg1 = (lldb::SBHostOS *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBHostOS **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBInstruction_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBInstruction *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBInstruction *)new lldb::SBInstruction(); - *(lldb::SBInstruction **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBInstruction_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBInstruction *arg1 = 0 ; - lldb::SBInstruction *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBInstruction **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBInstruction const & is null"); - return 0; - } - result = (lldb::SBInstruction *)new lldb::SBInstruction((lldb::SBInstruction const &)*arg1); - *(lldb::SBInstruction **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBInstruction(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBInstruction *arg1 = (lldb::SBInstruction *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBInstruction **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBInstruction_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBInstruction *arg1 = (lldb::SBInstruction *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBInstruction **)&jarg1; - result = (bool)(arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBInstruction_1GetAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBInstruction *arg1 = (lldb::SBInstruction *) 0 ; - lldb::SBAddress result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBInstruction **)&jarg1; - result = (arg1)->GetAddress(); - *(lldb::SBAddress **)&jresult = new lldb::SBAddress(result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBInstruction_1GetMnemonic(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jstring jresult = 0 ; - lldb::SBInstruction *arg1 = (lldb::SBInstruction *) 0 ; - lldb::SBTarget arg2 ; - lldb::SBTarget *argp2 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBInstruction **)&jarg1; - argp2 = *(lldb::SBTarget **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBTarget"); - return 0; - } - arg2 = *argp2; - result = (char *)(arg1)->GetMnemonic(arg2); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBInstruction_1GetOperands(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jstring jresult = 0 ; - lldb::SBInstruction *arg1 = (lldb::SBInstruction *) 0 ; - lldb::SBTarget arg2 ; - lldb::SBTarget *argp2 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBInstruction **)&jarg1; - argp2 = *(lldb::SBTarget **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBTarget"); - return 0; - } - arg2 = *argp2; - result = (char *)(arg1)->GetOperands(arg2); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBInstruction_1GetComment(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jstring jresult = 0 ; - lldb::SBInstruction *arg1 = (lldb::SBInstruction *) 0 ; - lldb::SBTarget arg2 ; - lldb::SBTarget *argp2 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBInstruction **)&jarg1; - argp2 = *(lldb::SBTarget **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBTarget"); - return 0; - } - arg2 = *argp2; - result = (char *)(arg1)->GetComment(arg2); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBInstruction_1GetControlFlowKind(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jint jresult = 0 ; - lldb::SBInstruction *arg1 = (lldb::SBInstruction *) 0 ; - lldb::SBTarget arg2 ; - lldb::SBTarget *argp2 ; - lldb::InstructionControlFlowKind result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBInstruction **)&jarg1; - argp2 = *(lldb::SBTarget **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBTarget"); - return 0; - } - arg2 = *argp2; - result = (lldb::InstructionControlFlowKind)(arg1)->GetControlFlowKind(arg2); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBInstruction_1GetData(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBInstruction *arg1 = (lldb::SBInstruction *) 0 ; - lldb::SBTarget arg2 ; - lldb::SBTarget *argp2 ; - lldb::SBData result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBInstruction **)&jarg1; - argp2 = *(lldb::SBTarget **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBTarget"); - return 0; - } - arg2 = *argp2; - result = (arg1)->GetData(arg2); - *(lldb::SBData **)&jresult = new lldb::SBData(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBInstruction_1GetByteSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBInstruction *arg1 = (lldb::SBInstruction *) 0 ; - size_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBInstruction **)&jarg1; - result = (arg1)->GetByteSize(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBInstruction_1DoesBranch(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBInstruction *arg1 = (lldb::SBInstruction *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBInstruction **)&jarg1; - result = (bool)(arg1)->DoesBranch(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBInstruction_1HasDelaySlot(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBInstruction *arg1 = (lldb::SBInstruction *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBInstruction **)&jarg1; - result = (bool)(arg1)->HasDelaySlot(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBInstruction_1CanSetBreakpoint(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBInstruction *arg1 = (lldb::SBInstruction *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBInstruction **)&jarg1; - result = (bool)(arg1)->CanSetBreakpoint(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBInstruction_1Print_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBInstruction *arg1 = (lldb::SBInstruction *) 0 ; - lldb::SBFile arg2 ; - lldb::SBFile *argp2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBInstruction **)&jarg1; - argp2 = *(lldb::SBFile **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBFile"); - return ; - } - arg2 = *argp2; - (arg1)->Print(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBInstruction_1Print_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - lldb::SBInstruction *arg1 = (lldb::SBInstruction *) 0 ; - SwigValueWrapper< std::shared_ptr< lldb_private::File > > arg2 ; - lldb::FileSP *argp2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBInstruction **)&jarg1; - argp2 = *(lldb::FileSP **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::FileSP"); - return ; - } - arg2 = *argp2; - (arg1)->Print(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBInstruction_1GetDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBInstruction *arg1 = (lldb::SBInstruction *) 0 ; - lldb::SBStream *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBInstruction **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - result = (bool)(arg1)->GetDescription(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBInstruction_1EmulateWithFrame(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3) { - jboolean jresult = 0 ; - lldb::SBInstruction *arg1 = (lldb::SBInstruction *) 0 ; - lldb::SBFrame *arg2 = 0 ; - uint32_t arg3 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBInstruction **)&jarg1; - arg2 = *(lldb::SBFrame **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFrame & is null"); - return 0; - } - arg3 = (uint32_t)jarg3; - result = (bool)(arg1)->EmulateWithFrame(*arg2,arg3); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBInstruction_1DumpEmulation(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jboolean jresult = 0 ; - lldb::SBInstruction *arg1 = (lldb::SBInstruction *) 0 ; - char *arg2 = (char *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBInstruction **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (bool)(arg1)->DumpEmulation((char const *)arg2); - jresult = (jboolean)result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBInstruction_1TestEmulation(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jstring jarg3) { - jboolean jresult = 0 ; - lldb::SBInstruction *arg1 = (lldb::SBInstruction *) 0 ; - lldb::SBStream *arg2 = 0 ; - char *arg3 = (char *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBInstruction **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - arg3 = 0; - if (jarg3) { - arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); - if (!arg3) return 0; - } - result = (bool)(arg1)->TestEmulation(*arg2,(char const *)arg3); - jresult = (jboolean)result; - if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBInstruction_1_1_1repr_1_1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBInstruction *arg1 = (lldb::SBInstruction *) 0 ; - std::string result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBInstruction **)&jarg1; - result = lldb_SBInstruction___repr__(arg1); - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBInstructionList_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBInstructionList *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBInstructionList *)new lldb::SBInstructionList(); - *(lldb::SBInstructionList **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBInstructionList_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBInstructionList *arg1 = 0 ; - lldb::SBInstructionList *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBInstructionList **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBInstructionList const & is null"); - return 0; - } - result = (lldb::SBInstructionList *)new lldb::SBInstructionList((lldb::SBInstructionList const &)*arg1); - *(lldb::SBInstructionList **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBInstructionList(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBInstructionList *arg1 = (lldb::SBInstructionList *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBInstructionList **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBInstructionList_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBInstructionList *arg1 = (lldb::SBInstructionList *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBInstructionList **)&jarg1; - result = (bool)((lldb::SBInstructionList const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBInstructionList_1GetSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBInstructionList *arg1 = (lldb::SBInstructionList *) 0 ; - size_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBInstructionList **)&jarg1; - result = (arg1)->GetSize(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBInstructionList_1GetInstructionAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBInstructionList *arg1 = (lldb::SBInstructionList *) 0 ; - uint32_t arg2 ; - lldb::SBInstruction result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBInstructionList **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (arg1)->GetInstructionAtIndex(arg2); - *(lldb::SBInstruction **)&jresult = new lldb::SBInstruction(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBInstructionList_1GetInstructionsCount_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_, jboolean jarg4) { - jlong jresult = 0 ; - lldb::SBInstructionList *arg1 = (lldb::SBInstructionList *) 0 ; - lldb::SBAddress *arg2 = 0 ; - lldb::SBAddress *arg3 = 0 ; - bool arg4 ; - size_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - arg1 = *(lldb::SBInstructionList **)&jarg1; - arg2 = *(lldb::SBAddress **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBAddress const & is null"); - return 0; - } - arg3 = *(lldb::SBAddress **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBAddress const & is null"); - return 0; - } - arg4 = jarg4 ? true : false; - result = (arg1)->GetInstructionsCount((lldb::SBAddress const &)*arg2,(lldb::SBAddress const &)*arg3,arg4); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBInstructionList_1GetInstructionsCount_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_) { - jlong jresult = 0 ; - lldb::SBInstructionList *arg1 = (lldb::SBInstructionList *) 0 ; - lldb::SBAddress *arg2 = 0 ; - lldb::SBAddress *arg3 = 0 ; - size_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - arg1 = *(lldb::SBInstructionList **)&jarg1; - arg2 = *(lldb::SBAddress **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBAddress const & is null"); - return 0; - } - arg3 = *(lldb::SBAddress **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBAddress const & is null"); - return 0; - } - result = (arg1)->GetInstructionsCount((lldb::SBAddress const &)*arg2,(lldb::SBAddress const &)*arg3); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBInstructionList_1Clear(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBInstructionList *arg1 = (lldb::SBInstructionList *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBInstructionList **)&jarg1; - (arg1)->Clear(); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBInstructionList_1AppendInstruction(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBInstructionList *arg1 = (lldb::SBInstructionList *) 0 ; - lldb::SBInstruction arg2 ; - lldb::SBInstruction *argp2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBInstructionList **)&jarg1; - argp2 = *(lldb::SBInstruction **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBInstruction"); - return ; - } - arg2 = *argp2; - (arg1)->AppendInstruction(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBInstructionList_1Print_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBInstructionList *arg1 = (lldb::SBInstructionList *) 0 ; - lldb::SBFile arg2 ; - lldb::SBFile *argp2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBInstructionList **)&jarg1; - argp2 = *(lldb::SBFile **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBFile"); - return ; - } - arg2 = *argp2; - (arg1)->Print(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBInstructionList_1Print_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - lldb::SBInstructionList *arg1 = (lldb::SBInstructionList *) 0 ; - SwigValueWrapper< std::shared_ptr< lldb_private::File > > arg2 ; - lldb::FileSP *argp2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBInstructionList **)&jarg1; - argp2 = *(lldb::FileSP **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::FileSP"); - return ; - } - arg2 = *argp2; - (arg1)->Print(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBInstructionList_1GetDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBInstructionList *arg1 = (lldb::SBInstructionList *) 0 ; - lldb::SBStream *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBInstructionList **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - result = (bool)(arg1)->GetDescription(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBInstructionList_1DumpEmulationForAllInstructions(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jboolean jresult = 0 ; - lldb::SBInstructionList *arg1 = (lldb::SBInstructionList *) 0 ; - char *arg2 = (char *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBInstructionList **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (bool)(arg1)->DumpEmulationForAllInstructions((char const *)arg2); - jresult = (jboolean)result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBInstructionList_1_1_1repr_1_1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBInstructionList *arg1 = (lldb::SBInstructionList *) 0 ; - std::string result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBInstructionList **)&jarg1; - result = lldb_SBInstructionList___repr__(arg1); - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBLanguageRuntime_1GetLanguageTypeFromString(JNIEnv *jenv, jclass jcls, jstring jarg1) { - jint jresult = 0 ; - char *arg1 = (char *) 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - result = (lldb::LanguageType)lldb::SBLanguageRuntime::GetLanguageTypeFromString((char const *)arg1); - jresult = (jint)result; - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBLanguageRuntime_1GetNameForLanguageType(JNIEnv *jenv, jclass jcls, jint jarg1) { - jstring jresult = 0 ; - lldb::LanguageType arg1 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - arg1 = (lldb::LanguageType)jarg1; - result = (char *)lldb::SBLanguageRuntime::GetNameForLanguageType(arg1); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBLanguageRuntime(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBLanguageRuntime *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBLanguageRuntime *)new lldb::SBLanguageRuntime(); - *(lldb::SBLanguageRuntime **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBLanguageRuntime(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBLanguageRuntime *arg1 = (lldb::SBLanguageRuntime *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBLanguageRuntime **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBLaunchInfo(JNIEnv *jenv, jclass jcls, jobjectArray jarg1) { - jlong jresult = 0 ; - char **arg1 = (char **) 0 ; - jint size1 ; - lldb::SBLaunchInfo *result = 0 ; - - (void)jenv; - (void)jcls; - { - int i = 0; - if (jarg1) { - size1 = jenv->GetArrayLength(jarg1); - - arg1 = new char*[size1+1]; - - - - for (i = 0; iGetObjectArrayElement(jarg1, i); - const char *c_string = jenv->GetStringUTFChars(j_string, 0); - - arg1[i] = new char [strlen(c_string)+1]; - - - - strcpy(arg1[i], c_string); - jenv->ReleaseStringUTFChars(j_string, c_string); - jenv->DeleteLocalRef(j_string); - } - arg1[i] = 0; - } else { - arg1 = 0; - size1 = 0; - } - } - result = (lldb::SBLaunchInfo *)new lldb::SBLaunchInfo((char const **)arg1); - *(lldb::SBLaunchInfo **)&jresult = result; - { - int i; - for (i=0; iGetProcessID(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBLaunchInfo_1GetUserID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLaunchInfo **)&jarg1; - result = (uint32_t)(arg1)->GetUserID(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBLaunchInfo_1GetGroupID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLaunchInfo **)&jarg1; - result = (uint32_t)(arg1)->GetGroupID(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBLaunchInfo_1UserIDIsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLaunchInfo **)&jarg1; - result = (bool)(arg1)->UserIDIsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBLaunchInfo_1GroupIDIsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLaunchInfo **)&jarg1; - result = (bool)(arg1)->GroupIDIsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBLaunchInfo_1SetUserID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ; - uint32_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLaunchInfo **)&jarg1; - arg2 = (uint32_t)jarg2; - (arg1)->SetUserID(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBLaunchInfo_1SetGroupID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ; - uint32_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLaunchInfo **)&jarg1; - arg2 = (uint32_t)jarg2; - (arg1)->SetGroupID(arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBLaunchInfo_1GetExecutableFile(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ; - lldb::SBFileSpec result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLaunchInfo **)&jarg1; - result = (arg1)->GetExecutableFile(); - *(lldb::SBFileSpec **)&jresult = new lldb::SBFileSpec(result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBLaunchInfo_1SetExecutableFile(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jboolean jarg3) { - lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ; - lldb::SBFileSpec arg2 ; - bool arg3 ; - lldb::SBFileSpec *argp2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBLaunchInfo **)&jarg1; - argp2 = *(lldb::SBFileSpec **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBFileSpec"); - return ; - } - arg2 = *argp2; - arg3 = jarg3 ? true : false; - (arg1)->SetExecutableFile(arg2,arg3); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBLaunchInfo_1GetListener(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ; - lldb::SBListener result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLaunchInfo **)&jarg1; - result = (arg1)->GetListener(); - *(lldb::SBListener **)&jresult = new lldb::SBListener(result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBLaunchInfo_1SetListener(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ; - lldb::SBListener *arg2 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBLaunchInfo **)&jarg1; - arg2 = *(lldb::SBListener **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBListener & is null"); - return ; - } - (arg1)->SetListener(*arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBLaunchInfo_1GetShadowListener(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ; - lldb::SBListener result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLaunchInfo **)&jarg1; - result = (arg1)->GetShadowListener(); - *(lldb::SBListener **)&jresult = new lldb::SBListener(result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBLaunchInfo_1SetShadowListener(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ; - lldb::SBListener *arg2 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBLaunchInfo **)&jarg1; - arg2 = *(lldb::SBListener **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBListener & is null"); - return ; - } - (arg1)->SetShadowListener(*arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBLaunchInfo_1GetNumArguments(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLaunchInfo **)&jarg1; - result = (uint32_t)(arg1)->GetNumArguments(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBLaunchInfo_1GetArgumentAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jstring jresult = 0 ; - lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ; - uint32_t arg2 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLaunchInfo **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (char *)(arg1)->GetArgumentAtIndex(arg2); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBLaunchInfo_1SetArguments(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobjectArray jarg2, jboolean jarg3) { - lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ; - char **arg2 = (char **) 0 ; - bool arg3 ; - jint size2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLaunchInfo **)&jarg1; - { - int i = 0; - if (jarg2) { - size2 = jenv->GetArrayLength(jarg2); - - arg2 = new char*[size2+1]; - - - - for (i = 0; iGetObjectArrayElement(jarg2, i); - const char *c_string = jenv->GetStringUTFChars(j_string, 0); - - arg2[i] = new char [strlen(c_string)+1]; - - - - strcpy(arg2[i], c_string); - jenv->ReleaseStringUTFChars(j_string, c_string); - jenv->DeleteLocalRef(j_string); - } - arg2[i] = 0; - } else { - arg2 = 0; - size2 = 0; - } - } - arg3 = jarg3 ? true : false; - (arg1)->SetArguments((char const **)arg2,arg3); - { - int i; - for (i=0; iGetNumEnvironmentEntries(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBLaunchInfo_1GetEnvironmentEntryAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jstring jresult = 0 ; - lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ; - uint32_t arg2 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLaunchInfo **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (char *)(arg1)->GetEnvironmentEntryAtIndex(arg2); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBLaunchInfo_1SetEnvironmentEntries(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobjectArray jarg2, jboolean jarg3) { - lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ; - char **arg2 = (char **) 0 ; - bool arg3 ; - jint size2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLaunchInfo **)&jarg1; - { - int i = 0; - if (jarg2) { - size2 = jenv->GetArrayLength(jarg2); - - arg2 = new char*[size2+1]; - - - - for (i = 0; iGetObjectArrayElement(jarg2, i); - const char *c_string = jenv->GetStringUTFChars(j_string, 0); - - arg2[i] = new char [strlen(c_string)+1]; - - - - strcpy(arg2[i], c_string); - jenv->ReleaseStringUTFChars(j_string, c_string); - jenv->DeleteLocalRef(j_string); - } - arg2[i] = 0; - } else { - arg2 = 0; - size2 = 0; - } - } - arg3 = jarg3 ? true : false; - (arg1)->SetEnvironmentEntries((char const **)arg2,arg3); - { - int i; - for (i=0; iSetEnvironment((lldb::SBEnvironment const &)*arg2,arg3); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBLaunchInfo_1GetEnvironment(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ; - lldb::SBEnvironment result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLaunchInfo **)&jarg1; - result = (arg1)->GetEnvironment(); - *(lldb::SBEnvironment **)&jresult = new lldb::SBEnvironment(result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBLaunchInfo_1Clear(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLaunchInfo **)&jarg1; - (arg1)->Clear(); -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBLaunchInfo_1GetWorkingDirectory(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLaunchInfo **)&jarg1; - result = (char *)((lldb::SBLaunchInfo const *)arg1)->GetWorkingDirectory(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBLaunchInfo_1SetWorkingDirectory(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLaunchInfo **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->SetWorkingDirectory((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBLaunchInfo_1GetLaunchFlags(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLaunchInfo **)&jarg1; - result = (uint32_t)(arg1)->GetLaunchFlags(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBLaunchInfo_1SetLaunchFlags(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ; - uint32_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLaunchInfo **)&jarg1; - arg2 = (uint32_t)jarg2; - (arg1)->SetLaunchFlags(arg2); -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBLaunchInfo_1GetProcessPluginName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLaunchInfo **)&jarg1; - result = (char *)(arg1)->GetProcessPluginName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBLaunchInfo_1SetProcessPluginName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLaunchInfo **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->SetProcessPluginName((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBLaunchInfo_1GetShell(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLaunchInfo **)&jarg1; - result = (char *)(arg1)->GetShell(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBLaunchInfo_1SetShell(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLaunchInfo **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->SetShell((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBLaunchInfo_1GetShellExpandArguments(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLaunchInfo **)&jarg1; - result = (bool)(arg1)->GetShellExpandArguments(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBLaunchInfo_1SetShellExpandArguments(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLaunchInfo **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetShellExpandArguments(arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBLaunchInfo_1GetResumeCount(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLaunchInfo **)&jarg1; - result = (uint32_t)(arg1)->GetResumeCount(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBLaunchInfo_1SetResumeCount(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ; - uint32_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLaunchInfo **)&jarg1; - arg2 = (uint32_t)jarg2; - (arg1)->SetResumeCount(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBLaunchInfo_1AddCloseFileAction(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - jboolean jresult = 0 ; - lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ; - int arg2 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLaunchInfo **)&jarg1; - arg2 = (int)jarg2; - result = (bool)(arg1)->AddCloseFileAction(arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBLaunchInfo_1AddDuplicateFileAction(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jint jarg3) { - jboolean jresult = 0 ; - lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ; - int arg2 ; - int arg3 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLaunchInfo **)&jarg1; - arg2 = (int)jarg2; - arg3 = (int)jarg3; - result = (bool)(arg1)->AddDuplicateFileAction(arg2,arg3); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBLaunchInfo_1AddOpenFileAction(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jstring jarg3, jboolean jarg4, jboolean jarg5) { - jboolean jresult = 0 ; - lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ; - int arg2 ; - char *arg3 = (char *) 0 ; - bool arg4 ; - bool arg5 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLaunchInfo **)&jarg1; - arg2 = (int)jarg2; - arg3 = 0; - if (jarg3) { - arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); - if (!arg3) return 0; - } - arg4 = jarg4 ? true : false; - arg5 = jarg5 ? true : false; - result = (bool)(arg1)->AddOpenFileAction(arg2,(char const *)arg3,arg4,arg5); - jresult = (jboolean)result; - if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBLaunchInfo_1AddSuppressFileAction(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jboolean jarg3, jboolean jarg4) { - jboolean jresult = 0 ; - lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ; - int arg2 ; - bool arg3 ; - bool arg4 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLaunchInfo **)&jarg1; - arg2 = (int)jarg2; - arg3 = jarg3 ? true : false; - arg4 = jarg4 ? true : false; - result = (bool)(arg1)->AddSuppressFileAction(arg2,arg3,arg4); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBLaunchInfo_1SetLaunchEventData(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLaunchInfo **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->SetLaunchEventData((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBLaunchInfo_1GetLaunchEventData(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLaunchInfo **)&jarg1; - result = (char *)((lldb::SBLaunchInfo const *)arg1)->GetLaunchEventData(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBLaunchInfo_1GetDetachOnError(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLaunchInfo **)&jarg1; - result = (bool)((lldb::SBLaunchInfo const *)arg1)->GetDetachOnError(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBLaunchInfo_1SetDetachOnError(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLaunchInfo **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetDetachOnError(arg2); -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBLaunchInfo_1GetScriptedProcessClassName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLaunchInfo **)&jarg1; - result = (char *)((lldb::SBLaunchInfo const *)arg1)->GetScriptedProcessClassName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBLaunchInfo_1SetScriptedProcessClassName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLaunchInfo **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->SetScriptedProcessClassName((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBLaunchInfo_1GetScriptedProcessDictionary(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ; - lldb::SBStructuredData result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLaunchInfo **)&jarg1; - result = ((lldb::SBLaunchInfo const *)arg1)->GetScriptedProcessDictionary(); - *(lldb::SBStructuredData **)&jresult = new lldb::SBStructuredData(result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBLaunchInfo_1SetScriptedProcessDictionary(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBLaunchInfo *arg1 = (lldb::SBLaunchInfo *) 0 ; - lldb::SBStructuredData arg2 ; - lldb::SBStructuredData *argp2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBLaunchInfo **)&jarg1; - argp2 = *(lldb::SBStructuredData **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBStructuredData"); - return ; - } - arg2 = *argp2; - (arg1)->SetScriptedProcessDictionary(arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBLineEntry_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBLineEntry *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBLineEntry *)new lldb::SBLineEntry(); - *(lldb::SBLineEntry **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBLineEntry_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBLineEntry *arg1 = 0 ; - lldb::SBLineEntry *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLineEntry **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBLineEntry const & is null"); - return 0; - } - result = (lldb::SBLineEntry *)new lldb::SBLineEntry((lldb::SBLineEntry const &)*arg1); - *(lldb::SBLineEntry **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBLineEntry(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBLineEntry *arg1 = (lldb::SBLineEntry *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBLineEntry **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBLineEntry_1GetStartAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBLineEntry *arg1 = (lldb::SBLineEntry *) 0 ; - lldb::SBAddress result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLineEntry **)&jarg1; - result = ((lldb::SBLineEntry const *)arg1)->GetStartAddress(); - *(lldb::SBAddress **)&jresult = new lldb::SBAddress(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBLineEntry_1GetEndAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBLineEntry *arg1 = (lldb::SBLineEntry *) 0 ; - lldb::SBAddress result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLineEntry **)&jarg1; - result = ((lldb::SBLineEntry const *)arg1)->GetEndAddress(); - *(lldb::SBAddress **)&jresult = new lldb::SBAddress(result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBLineEntry_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBLineEntry *arg1 = (lldb::SBLineEntry *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLineEntry **)&jarg1; - result = (bool)((lldb::SBLineEntry const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBLineEntry_1GetFileSpec(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBLineEntry *arg1 = (lldb::SBLineEntry *) 0 ; - lldb::SBFileSpec result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLineEntry **)&jarg1; - result = ((lldb::SBLineEntry const *)arg1)->GetFileSpec(); - *(lldb::SBFileSpec **)&jresult = new lldb::SBFileSpec(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBLineEntry_1GetLine(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBLineEntry *arg1 = (lldb::SBLineEntry *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLineEntry **)&jarg1; - result = (uint32_t)((lldb::SBLineEntry const *)arg1)->GetLine(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBLineEntry_1GetColumn(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBLineEntry *arg1 = (lldb::SBLineEntry *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLineEntry **)&jarg1; - result = (uint32_t)((lldb::SBLineEntry const *)arg1)->GetColumn(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBLineEntry_1SetFileSpec(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBLineEntry *arg1 = (lldb::SBLineEntry *) 0 ; - lldb::SBFileSpec arg2 ; - lldb::SBFileSpec *argp2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBLineEntry **)&jarg1; - argp2 = *(lldb::SBFileSpec **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBFileSpec"); - return ; - } - arg2 = *argp2; - (arg1)->SetFileSpec(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBLineEntry_1SetLine(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - lldb::SBLineEntry *arg1 = (lldb::SBLineEntry *) 0 ; - uint32_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLineEntry **)&jarg1; - arg2 = (uint32_t)jarg2; - (arg1)->SetLine(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBLineEntry_1SetColumn(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - lldb::SBLineEntry *arg1 = (lldb::SBLineEntry *) 0 ; - uint32_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLineEntry **)&jarg1; - arg2 = (uint32_t)jarg2; - (arg1)->SetColumn(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBLineEntry_1GetDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBLineEntry *arg1 = (lldb::SBLineEntry *) 0 ; - lldb::SBStream *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBLineEntry **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - result = (bool)(arg1)->GetDescription(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBLineEntry_1_1_1repr_1_1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBLineEntry *arg1 = (lldb::SBLineEntry *) 0 ; - std::string result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBLineEntry **)&jarg1; - result = lldb_SBLineEntry___repr__(arg1); - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBListener_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBListener *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBListener *)new lldb::SBListener(); - *(lldb::SBListener **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBListener_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jstring jarg1) { - jlong jresult = 0 ; - char *arg1 = (char *) 0 ; - lldb::SBListener *result = 0 ; - - (void)jenv; - (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - result = (lldb::SBListener *)new lldb::SBListener((char const *)arg1); - *(lldb::SBListener **)&jresult = result; - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBListener_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBListener *arg1 = 0 ; - lldb::SBListener *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBListener **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBListener const & is null"); - return 0; - } - result = (lldb::SBListener *)new lldb::SBListener((lldb::SBListener const &)*arg1); - *(lldb::SBListener **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBListener(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBListener *arg1 = (lldb::SBListener *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBListener **)&jarg1; - delete arg1; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBListener_1AddEvent(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBListener *arg1 = (lldb::SBListener *) 0 ; - lldb::SBEvent *arg2 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBListener **)&jarg1; - arg2 = *(lldb::SBEvent **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent const & is null"); - return ; - } - (arg1)->AddEvent((lldb::SBEvent const &)*arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBListener_1Clear(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBListener *arg1 = (lldb::SBListener *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBListener **)&jarg1; - (arg1)->Clear(); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBListener_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBListener *arg1 = (lldb::SBListener *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBListener **)&jarg1; - result = (bool)((lldb::SBListener const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBListener_1StartListeningForEventClass(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jstring jarg3, jlong jarg4) { - jlong jresult = 0 ; - lldb::SBListener *arg1 = (lldb::SBListener *) 0 ; - lldb::SBDebugger *arg2 = 0 ; - char *arg3 = (char *) 0 ; - uint32_t arg4 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBListener **)&jarg1; - arg2 = *(lldb::SBDebugger **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBDebugger & is null"); - return 0; - } - arg3 = 0; - if (jarg3) { - arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); - if (!arg3) return 0; - } - arg4 = (uint32_t)jarg4; - result = (uint32_t)(arg1)->StartListeningForEventClass(*arg2,(char const *)arg3,arg4); - jresult = (jlong)result; - if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBListener_1StopListeningForEventClass(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jstring jarg3, jlong jarg4) { - jboolean jresult = 0 ; - lldb::SBListener *arg1 = (lldb::SBListener *) 0 ; - lldb::SBDebugger *arg2 = 0 ; - char *arg3 = (char *) 0 ; - uint32_t arg4 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBListener **)&jarg1; - arg2 = *(lldb::SBDebugger **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBDebugger & is null"); - return 0; - } - arg3 = 0; - if (jarg3) { - arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); - if (!arg3) return 0; - } - arg4 = (uint32_t)jarg4; - result = (bool)(arg1)->StopListeningForEventClass(*arg2,(char const *)arg3,arg4); - jresult = (jboolean)result; - if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBListener_1StartListeningForEvents(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3) { - jlong jresult = 0 ; - lldb::SBListener *arg1 = (lldb::SBListener *) 0 ; - lldb::SBBroadcaster *arg2 = 0 ; - uint32_t arg3 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBListener **)&jarg1; - arg2 = *(lldb::SBBroadcaster **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBBroadcaster const & is null"); - return 0; - } - arg3 = (uint32_t)jarg3; - result = (uint32_t)(arg1)->StartListeningForEvents((lldb::SBBroadcaster const &)*arg2,arg3); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBListener_1StopListeningForEvents(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3) { - jboolean jresult = 0 ; - lldb::SBListener *arg1 = (lldb::SBListener *) 0 ; - lldb::SBBroadcaster *arg2 = 0 ; - uint32_t arg3 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBListener **)&jarg1; - arg2 = *(lldb::SBBroadcaster **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBBroadcaster const & is null"); - return 0; - } - arg3 = (uint32_t)jarg3; - result = (bool)(arg1)->StopListeningForEvents((lldb::SBBroadcaster const &)*arg2,arg3); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBListener_1WaitForEvent(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jlong jarg3, jobject jarg3_) { - jboolean jresult = 0 ; - lldb::SBListener *arg1 = (lldb::SBListener *) 0 ; - uint32_t arg2 ; - lldb::SBEvent *arg3 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - arg1 = *(lldb::SBListener **)&jarg1; - arg2 = (uint32_t)jarg2; - arg3 = *(lldb::SBEvent **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent & is null"); - return 0; - } - result = (bool)(arg1)->WaitForEvent(arg2,*arg3); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBListener_1WaitForEventForBroadcaster(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jlong jarg3, jobject jarg3_, jlong jarg4, jobject jarg4_) { - jboolean jresult = 0 ; - lldb::SBListener *arg1 = (lldb::SBListener *) 0 ; - uint32_t arg2 ; - lldb::SBBroadcaster *arg3 = 0 ; - lldb::SBEvent *arg4 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - (void)jarg4_; - arg1 = *(lldb::SBListener **)&jarg1; - arg2 = (uint32_t)jarg2; - arg3 = *(lldb::SBBroadcaster **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBBroadcaster const & is null"); - return 0; - } - arg4 = *(lldb::SBEvent **)&jarg4; - if (!arg4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent & is null"); - return 0; - } - result = (bool)(arg1)->WaitForEventForBroadcaster(arg2,(lldb::SBBroadcaster const &)*arg3,*arg4); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBListener_1WaitForEventForBroadcasterWithType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jlong jarg3, jobject jarg3_, jlong jarg4, jlong jarg5, jobject jarg5_) { - jboolean jresult = 0 ; - lldb::SBListener *arg1 = (lldb::SBListener *) 0 ; - uint32_t arg2 ; - lldb::SBBroadcaster *arg3 = 0 ; - uint32_t arg4 ; - lldb::SBEvent *arg5 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - (void)jarg5_; - arg1 = *(lldb::SBListener **)&jarg1; - arg2 = (uint32_t)jarg2; - arg3 = *(lldb::SBBroadcaster **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBBroadcaster const & is null"); - return 0; - } - arg4 = (uint32_t)jarg4; - arg5 = *(lldb::SBEvent **)&jarg5; - if (!arg5) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent & is null"); - return 0; - } - result = (bool)(arg1)->WaitForEventForBroadcasterWithType(arg2,(lldb::SBBroadcaster const &)*arg3,arg4,*arg5); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBListener_1PeekAtNextEvent(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBListener *arg1 = (lldb::SBListener *) 0 ; - lldb::SBEvent *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBListener **)&jarg1; - arg2 = *(lldb::SBEvent **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent & is null"); - return 0; - } - result = (bool)(arg1)->PeekAtNextEvent(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBListener_1PeekAtNextEventForBroadcaster(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_) { - jboolean jresult = 0 ; - lldb::SBListener *arg1 = (lldb::SBListener *) 0 ; - lldb::SBBroadcaster *arg2 = 0 ; - lldb::SBEvent *arg3 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - arg1 = *(lldb::SBListener **)&jarg1; - arg2 = *(lldb::SBBroadcaster **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBBroadcaster const & is null"); - return 0; - } - arg3 = *(lldb::SBEvent **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent & is null"); - return 0; - } - result = (bool)(arg1)->PeekAtNextEventForBroadcaster((lldb::SBBroadcaster const &)*arg2,*arg3); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBListener_1PeekAtNextEventForBroadcasterWithType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jlong jarg4, jobject jarg4_) { - jboolean jresult = 0 ; - lldb::SBListener *arg1 = (lldb::SBListener *) 0 ; - lldb::SBBroadcaster *arg2 = 0 ; - uint32_t arg3 ; - lldb::SBEvent *arg4 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg4_; - arg1 = *(lldb::SBListener **)&jarg1; - arg2 = *(lldb::SBBroadcaster **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBBroadcaster const & is null"); - return 0; - } - arg3 = (uint32_t)jarg3; - arg4 = *(lldb::SBEvent **)&jarg4; - if (!arg4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent & is null"); - return 0; - } - result = (bool)(arg1)->PeekAtNextEventForBroadcasterWithType((lldb::SBBroadcaster const &)*arg2,arg3,*arg4); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBListener_1GetNextEvent(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBListener *arg1 = (lldb::SBListener *) 0 ; - lldb::SBEvent *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBListener **)&jarg1; - arg2 = *(lldb::SBEvent **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent & is null"); - return 0; - } - result = (bool)(arg1)->GetNextEvent(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBListener_1GetNextEventForBroadcaster(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_) { - jboolean jresult = 0 ; - lldb::SBListener *arg1 = (lldb::SBListener *) 0 ; - lldb::SBBroadcaster *arg2 = 0 ; - lldb::SBEvent *arg3 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - arg1 = *(lldb::SBListener **)&jarg1; - arg2 = *(lldb::SBBroadcaster **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBBroadcaster const & is null"); - return 0; - } - arg3 = *(lldb::SBEvent **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent & is null"); - return 0; - } - result = (bool)(arg1)->GetNextEventForBroadcaster((lldb::SBBroadcaster const &)*arg2,*arg3); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBListener_1GetNextEventForBroadcasterWithType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jlong jarg4, jobject jarg4_) { - jboolean jresult = 0 ; - lldb::SBListener *arg1 = (lldb::SBListener *) 0 ; - lldb::SBBroadcaster *arg2 = 0 ; - uint32_t arg3 ; - lldb::SBEvent *arg4 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg4_; - arg1 = *(lldb::SBListener **)&jarg1; - arg2 = *(lldb::SBBroadcaster **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBBroadcaster const & is null"); - return 0; - } - arg3 = (uint32_t)jarg3; - arg4 = *(lldb::SBEvent **)&jarg4; - if (!arg4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent & is null"); - return 0; - } - result = (bool)(arg1)->GetNextEventForBroadcasterWithType((lldb::SBBroadcaster const &)*arg2,arg3,*arg4); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBListener_1HandleBroadcastEvent(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBListener *arg1 = (lldb::SBListener *) 0 ; - lldb::SBEvent *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBListener **)&jarg1; - arg2 = *(lldb::SBEvent **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent const & is null"); - return 0; - } - result = (bool)(arg1)->HandleBroadcastEvent((lldb::SBEvent const &)*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBMemoryRegionInfo_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBMemoryRegionInfo *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBMemoryRegionInfo *)new lldb::SBMemoryRegionInfo(); - *(lldb::SBMemoryRegionInfo **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBMemoryRegionInfo_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBMemoryRegionInfo *arg1 = 0 ; - lldb::SBMemoryRegionInfo *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBMemoryRegionInfo **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBMemoryRegionInfo const & is null"); - return 0; - } - result = (lldb::SBMemoryRegionInfo *)new lldb::SBMemoryRegionInfo((lldb::SBMemoryRegionInfo const &)*arg1); - *(lldb::SBMemoryRegionInfo **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBMemoryRegionInfo_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jstring jarg1, jobject jarg2, jobject jarg3, jlong jarg4, jboolean jarg5, jboolean jarg6) { - jlong jresult = 0 ; - char *arg1 = (char *) 0 ; - lldb::addr_t arg2 ; - lldb::addr_t arg3 ; - uint32_t arg4 ; - bool arg5 ; - bool arg6 ; - lldb::SBMemoryRegionInfo *result = 0 ; - - (void)jenv; - (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (lldb::addr_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg3); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg3, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg3 = 0; - if (sz > 0) { - arg3 = (lldb::addr_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - arg4 = (uint32_t)jarg4; - arg5 = jarg5 ? true : false; - arg6 = jarg6 ? true : false; - result = (lldb::SBMemoryRegionInfo *)new lldb::SBMemoryRegionInfo((char const *)arg1,arg2,arg3,arg4,arg5,arg6); - *(lldb::SBMemoryRegionInfo **)&jresult = result; - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBMemoryRegionInfo_1_1SWIG_13(JNIEnv *jenv, jclass jcls, jstring jarg1, jobject jarg2, jobject jarg3, jlong jarg4, jboolean jarg5) { - jlong jresult = 0 ; - char *arg1 = (char *) 0 ; - lldb::addr_t arg2 ; - lldb::addr_t arg3 ; - uint32_t arg4 ; - bool arg5 ; - lldb::SBMemoryRegionInfo *result = 0 ; - - (void)jenv; - (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (lldb::addr_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg3); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg3, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg3 = 0; - if (sz > 0) { - arg3 = (lldb::addr_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - arg4 = (uint32_t)jarg4; - arg5 = jarg5 ? true : false; - result = (lldb::SBMemoryRegionInfo *)new lldb::SBMemoryRegionInfo((char const *)arg1,arg2,arg3,arg4,arg5); - *(lldb::SBMemoryRegionInfo **)&jresult = result; - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBMemoryRegionInfo(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBMemoryRegionInfo *arg1 = (lldb::SBMemoryRegionInfo *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBMemoryRegionInfo **)&jarg1; - delete arg1; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBMemoryRegionInfo_1Clear(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBMemoryRegionInfo *arg1 = (lldb::SBMemoryRegionInfo *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBMemoryRegionInfo **)&jarg1; - (arg1)->Clear(); -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBMemoryRegionInfo_1GetRegionBase(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBMemoryRegionInfo *arg1 = (lldb::SBMemoryRegionInfo *) 0 ; - lldb::addr_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBMemoryRegionInfo **)&jarg1; - result = (lldb::addr_t)(arg1)->GetRegionBase(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBMemoryRegionInfo_1GetRegionEnd(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBMemoryRegionInfo *arg1 = (lldb::SBMemoryRegionInfo *) 0 ; - lldb::addr_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBMemoryRegionInfo **)&jarg1; - result = (lldb::addr_t)(arg1)->GetRegionEnd(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBMemoryRegionInfo_1IsReadable(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBMemoryRegionInfo *arg1 = (lldb::SBMemoryRegionInfo *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBMemoryRegionInfo **)&jarg1; - result = (bool)(arg1)->IsReadable(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBMemoryRegionInfo_1IsWritable(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBMemoryRegionInfo *arg1 = (lldb::SBMemoryRegionInfo *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBMemoryRegionInfo **)&jarg1; - result = (bool)(arg1)->IsWritable(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBMemoryRegionInfo_1IsExecutable(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBMemoryRegionInfo *arg1 = (lldb::SBMemoryRegionInfo *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBMemoryRegionInfo **)&jarg1; - result = (bool)(arg1)->IsExecutable(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBMemoryRegionInfo_1IsMapped(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBMemoryRegionInfo *arg1 = (lldb::SBMemoryRegionInfo *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBMemoryRegionInfo **)&jarg1; - result = (bool)(arg1)->IsMapped(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBMemoryRegionInfo_1GetName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBMemoryRegionInfo *arg1 = (lldb::SBMemoryRegionInfo *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBMemoryRegionInfo **)&jarg1; - result = (char *)(arg1)->GetName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBMemoryRegionInfo_1HasDirtyMemoryPageList(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBMemoryRegionInfo *arg1 = (lldb::SBMemoryRegionInfo *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBMemoryRegionInfo **)&jarg1; - result = (bool)(arg1)->HasDirtyMemoryPageList(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBMemoryRegionInfo_1GetNumDirtyPages(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBMemoryRegionInfo *arg1 = (lldb::SBMemoryRegionInfo *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBMemoryRegionInfo **)&jarg1; - result = (uint32_t)(arg1)->GetNumDirtyPages(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBMemoryRegionInfo_1GetDirtyPageAddressAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jobject jresult = 0 ; - lldb::SBMemoryRegionInfo *arg1 = (lldb::SBMemoryRegionInfo *) 0 ; - uint32_t arg2 ; - lldb::addr_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBMemoryRegionInfo **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (lldb::addr_t)(arg1)->GetDirtyPageAddressAtIndex(arg2); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBMemoryRegionInfo_1GetPageSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBMemoryRegionInfo *arg1 = (lldb::SBMemoryRegionInfo *) 0 ; - int result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBMemoryRegionInfo **)&jarg1; - result = (int)(arg1)->GetPageSize(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBMemoryRegionInfo_1GetDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBMemoryRegionInfo *arg1 = (lldb::SBMemoryRegionInfo *) 0 ; - lldb::SBStream *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBMemoryRegionInfo **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - result = (bool)(arg1)->GetDescription(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBMemoryRegionInfo_1_1_1repr_1_1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBMemoryRegionInfo *arg1 = (lldb::SBMemoryRegionInfo *) 0 ; - std::string result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBMemoryRegionInfo **)&jarg1; - result = lldb_SBMemoryRegionInfo___repr__(arg1); - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBMemoryRegionInfoList_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBMemoryRegionInfoList *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBMemoryRegionInfoList *)new lldb::SBMemoryRegionInfoList(); - *(lldb::SBMemoryRegionInfoList **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBMemoryRegionInfoList_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBMemoryRegionInfoList *arg1 = 0 ; - lldb::SBMemoryRegionInfoList *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBMemoryRegionInfoList **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBMemoryRegionInfoList const & is null"); - return 0; - } - result = (lldb::SBMemoryRegionInfoList *)new lldb::SBMemoryRegionInfoList((lldb::SBMemoryRegionInfoList const &)*arg1); - *(lldb::SBMemoryRegionInfoList **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBMemoryRegionInfoList(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBMemoryRegionInfoList *arg1 = (lldb::SBMemoryRegionInfoList *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBMemoryRegionInfoList **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBMemoryRegionInfoList_1GetSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBMemoryRegionInfoList *arg1 = (lldb::SBMemoryRegionInfoList *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBMemoryRegionInfoList **)&jarg1; - result = (uint32_t)((lldb::SBMemoryRegionInfoList const *)arg1)->GetSize(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBMemoryRegionInfoList_1GetMemoryRegionContainingAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2, jlong jarg3, jobject jarg3_) { - jboolean jresult = 0 ; - lldb::SBMemoryRegionInfoList *arg1 = (lldb::SBMemoryRegionInfoList *) 0 ; - lldb::addr_t arg2 ; - lldb::SBMemoryRegionInfo *arg3 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - arg1 = *(lldb::SBMemoryRegionInfoList **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (lldb::addr_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - arg3 = *(lldb::SBMemoryRegionInfo **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBMemoryRegionInfo & is null"); - return 0; - } - result = (bool)(arg1)->GetMemoryRegionContainingAddress(arg2,*arg3); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBMemoryRegionInfoList_1GetMemoryRegionAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jlong jarg3, jobject jarg3_) { - jboolean jresult = 0 ; - lldb::SBMemoryRegionInfoList *arg1 = (lldb::SBMemoryRegionInfoList *) 0 ; - uint32_t arg2 ; - lldb::SBMemoryRegionInfo *arg3 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - arg1 = *(lldb::SBMemoryRegionInfoList **)&jarg1; - arg2 = (uint32_t)jarg2; - arg3 = *(lldb::SBMemoryRegionInfo **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBMemoryRegionInfo & is null"); - return 0; - } - result = (bool)(arg1)->GetMemoryRegionAtIndex(arg2,*arg3); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBMemoryRegionInfoList_1Append_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBMemoryRegionInfoList *arg1 = (lldb::SBMemoryRegionInfoList *) 0 ; - lldb::SBMemoryRegionInfo *arg2 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBMemoryRegionInfoList **)&jarg1; - arg2 = *(lldb::SBMemoryRegionInfo **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBMemoryRegionInfo & is null"); - return ; - } - (arg1)->Append(*arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBMemoryRegionInfoList_1Append_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBMemoryRegionInfoList *arg1 = (lldb::SBMemoryRegionInfoList *) 0 ; - lldb::SBMemoryRegionInfoList *arg2 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBMemoryRegionInfoList **)&jarg1; - arg2 = *(lldb::SBMemoryRegionInfoList **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBMemoryRegionInfoList & is null"); - return ; - } - (arg1)->Append(*arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBMemoryRegionInfoList_1Clear(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBMemoryRegionInfoList *arg1 = (lldb::SBMemoryRegionInfoList *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBMemoryRegionInfoList **)&jarg1; - (arg1)->Clear(); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBModule_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBModule *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBModule *)new lldb::SBModule(); - *(lldb::SBModule **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBModule_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBModule *arg1 = 0 ; - lldb::SBModule *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModule **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBModule const & is null"); - return 0; - } - result = (lldb::SBModule *)new lldb::SBModule((lldb::SBModule const &)*arg1); - *(lldb::SBModule **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBModule_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBModuleSpec *arg1 = 0 ; - lldb::SBModule *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModuleSpec **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBModuleSpec const & is null"); - return 0; - } - result = (lldb::SBModule *)new lldb::SBModule((lldb::SBModuleSpec const &)*arg1); - *(lldb::SBModule **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBModule_1_1SWIG_13(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = 0 ; - lldb::addr_t arg2 ; - lldb::SBModule *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBProcess & is null"); - return 0; - } - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (lldb::addr_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (lldb::SBModule *)new lldb::SBModule(*arg1,arg2); - *(lldb::SBModule **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBModule(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBModule *arg1 = (lldb::SBModule *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBModule **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBModule_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBModule *arg1 = (lldb::SBModule *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModule **)&jarg1; - result = (bool)((lldb::SBModule const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBModule_1Clear(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBModule *arg1 = (lldb::SBModule *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModule **)&jarg1; - (arg1)->Clear(); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBModule_1IsFileBacked(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBModule *arg1 = (lldb::SBModule *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModule **)&jarg1; - result = (bool)((lldb::SBModule const *)arg1)->IsFileBacked(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBModule_1GetFileSpec(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBModule *arg1 = (lldb::SBModule *) 0 ; - lldb::SBFileSpec result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModule **)&jarg1; - result = ((lldb::SBModule const *)arg1)->GetFileSpec(); - *(lldb::SBFileSpec **)&jresult = new lldb::SBFileSpec(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBModule_1GetPlatformFileSpec(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBModule *arg1 = (lldb::SBModule *) 0 ; - lldb::SBFileSpec result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModule **)&jarg1; - result = ((lldb::SBModule const *)arg1)->GetPlatformFileSpec(); - *(lldb::SBFileSpec **)&jresult = new lldb::SBFileSpec(result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBModule_1SetPlatformFileSpec(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBModule *arg1 = (lldb::SBModule *) 0 ; - lldb::SBFileSpec *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBModule **)&jarg1; - arg2 = *(lldb::SBFileSpec **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec const & is null"); - return 0; - } - result = (bool)(arg1)->SetPlatformFileSpec((lldb::SBFileSpec const &)*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBModule_1GetRemoteInstallFileSpec(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBModule *arg1 = (lldb::SBModule *) 0 ; - lldb::SBFileSpec result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModule **)&jarg1; - result = (arg1)->GetRemoteInstallFileSpec(); - *(lldb::SBFileSpec **)&jresult = new lldb::SBFileSpec(result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBModule_1SetRemoteInstallFileSpec(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBModule *arg1 = (lldb::SBModule *) 0 ; - lldb::SBFileSpec *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBModule **)&jarg1; - arg2 = *(lldb::SBFileSpec **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec & is null"); - return 0; - } - result = (bool)(arg1)->SetRemoteInstallFileSpec(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBModule_1GetByteOrder(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBModule *arg1 = (lldb::SBModule *) 0 ; - lldb::ByteOrder result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModule **)&jarg1; - result = (lldb::ByteOrder)(arg1)->GetByteOrder(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBModule_1GetAddressByteSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBModule *arg1 = (lldb::SBModule *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModule **)&jarg1; - result = (uint32_t)(arg1)->GetAddressByteSize(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBModule_1GetTriple(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBModule *arg1 = (lldb::SBModule *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModule **)&jarg1; - result = (char *)(arg1)->GetTriple(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBModule_1GetUUIDBytes(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBModule *arg1 = (lldb::SBModule *) 0 ; - uint8_t *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModule **)&jarg1; - result = (uint8_t *)((lldb::SBModule const *)arg1)->GetUUIDBytes(); - *(uint8_t **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBModule_1GetUUIDString(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBModule *arg1 = (lldb::SBModule *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModule **)&jarg1; - result = (char *)((lldb::SBModule const *)arg1)->GetUUIDString(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBModule_1FindSection(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBModule *arg1 = (lldb::SBModule *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBSection result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModule **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (arg1)->FindSection((char const *)arg2); - *(lldb::SBSection **)&jresult = new lldb::SBSection(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBModule_1ResolveFileAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2) { - jlong jresult = 0 ; - lldb::SBModule *arg1 = (lldb::SBModule *) 0 ; - lldb::addr_t arg2 ; - lldb::SBAddress result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModule **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (lldb::addr_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (arg1)->ResolveFileAddress(arg2); - *(lldb::SBAddress **)&jresult = new lldb::SBAddress(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBModule_1ResolveSymbolContextForAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3) { - jlong jresult = 0 ; - lldb::SBModule *arg1 = (lldb::SBModule *) 0 ; - lldb::SBAddress *arg2 = 0 ; - uint32_t arg3 ; - lldb::SBSymbolContext result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBModule **)&jarg1; - arg2 = *(lldb::SBAddress **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBAddress const & is null"); - return 0; - } - arg3 = (uint32_t)jarg3; - result = (arg1)->ResolveSymbolContextForAddress((lldb::SBAddress const &)*arg2,arg3); - *(lldb::SBSymbolContext **)&jresult = new lldb::SBSymbolContext(result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBModule_1GetDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBModule *arg1 = (lldb::SBModule *) 0 ; - lldb::SBStream *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBModule **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - result = (bool)(arg1)->GetDescription(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBModule_1GetNumCompileUnits(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBModule *arg1 = (lldb::SBModule *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModule **)&jarg1; - result = (uint32_t)(arg1)->GetNumCompileUnits(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBModule_1GetCompileUnitAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBModule *arg1 = (lldb::SBModule *) 0 ; - uint32_t arg2 ; - lldb::SBCompileUnit result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModule **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (arg1)->GetCompileUnitAtIndex(arg2); - *(lldb::SBCompileUnit **)&jresult = new lldb::SBCompileUnit(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBModule_1FindCompileUnits(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBModule *arg1 = (lldb::SBModule *) 0 ; - lldb::SBFileSpec *arg2 = 0 ; - lldb::SBSymbolContextList result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBModule **)&jarg1; - arg2 = *(lldb::SBFileSpec **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec const & is null"); - return 0; - } - result = (arg1)->FindCompileUnits((lldb::SBFileSpec const &)*arg2); - *(lldb::SBSymbolContextList **)&jresult = new lldb::SBSymbolContextList(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBModule_1GetNumSymbols(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBModule *arg1 = (lldb::SBModule *) 0 ; - size_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModule **)&jarg1; - result = (arg1)->GetNumSymbols(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBModule_1GetSymbolAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBModule *arg1 = (lldb::SBModule *) 0 ; - size_t arg2 ; - lldb::SBSymbol result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModule **)&jarg1; - arg2 = (size_t)jarg2; - result = (arg1)->GetSymbolAtIndex(arg2); - *(lldb::SBSymbol **)&jresult = new lldb::SBSymbol(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBModule_1FindSymbol_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jint jarg3) { - jlong jresult = 0 ; - lldb::SBModule *arg1 = (lldb::SBModule *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SymbolType arg3 ; - lldb::SBSymbol result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModule **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = (lldb::SymbolType)jarg3; - result = (arg1)->FindSymbol((char const *)arg2,arg3); - *(lldb::SBSymbol **)&jresult = new lldb::SBSymbol(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBModule_1FindSymbol_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBModule *arg1 = (lldb::SBModule *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBSymbol result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModule **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (arg1)->FindSymbol((char const *)arg2); - *(lldb::SBSymbol **)&jresult = new lldb::SBSymbol(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBModule_1FindSymbols_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jint jarg3) { - jlong jresult = 0 ; - lldb::SBModule *arg1 = (lldb::SBModule *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SymbolType arg3 ; - lldb::SBSymbolContextList result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModule **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = (lldb::SymbolType)jarg3; - result = (arg1)->FindSymbols((char const *)arg2,arg3); - *(lldb::SBSymbolContextList **)&jresult = new lldb::SBSymbolContextList(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBModule_1FindSymbols_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBModule *arg1 = (lldb::SBModule *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBSymbolContextList result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModule **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (arg1)->FindSymbols((char const *)arg2); - *(lldb::SBSymbolContextList **)&jresult = new lldb::SBSymbolContextList(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBModule_1GetNumSections(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBModule *arg1 = (lldb::SBModule *) 0 ; - size_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModule **)&jarg1; - result = (arg1)->GetNumSections(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBModule_1GetSectionAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBModule *arg1 = (lldb::SBModule *) 0 ; - size_t arg2 ; - lldb::SBSection result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModule **)&jarg1; - arg2 = (size_t)jarg2; - result = (arg1)->GetSectionAtIndex(arg2); - *(lldb::SBSection **)&jresult = new lldb::SBSection(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBModule_1FindFunctions_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3) { - jlong jresult = 0 ; - lldb::SBModule *arg1 = (lldb::SBModule *) 0 ; - char *arg2 = (char *) 0 ; - uint32_t arg3 ; - lldb::SBSymbolContextList result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModule **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = (uint32_t)jarg3; - result = (arg1)->FindFunctions((char const *)arg2,arg3); - *(lldb::SBSymbolContextList **)&jresult = new lldb::SBSymbolContextList(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBModule_1FindFunctions_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBModule *arg1 = (lldb::SBModule *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBSymbolContextList result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModule **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (arg1)->FindFunctions((char const *)arg2); - *(lldb::SBSymbolContextList **)&jresult = new lldb::SBSymbolContextList(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBModule_1FindGlobalVariables(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jstring jarg3, jlong jarg4) { - jlong jresult = 0 ; - lldb::SBModule *arg1 = (lldb::SBModule *) 0 ; - lldb::SBTarget *arg2 = 0 ; - char *arg3 = (char *) 0 ; - uint32_t arg4 ; - lldb::SBValueList result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBModule **)&jarg1; - arg2 = *(lldb::SBTarget **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBTarget & is null"); - return 0; - } - arg3 = 0; - if (jarg3) { - arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); - if (!arg3) return 0; - } - arg4 = (uint32_t)jarg4; - result = (arg1)->FindGlobalVariables(*arg2,(char const *)arg3,arg4); - *(lldb::SBValueList **)&jresult = new lldb::SBValueList(result); - if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBModule_1FindFirstGlobalVariable(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jstring jarg3) { - jlong jresult = 0 ; - lldb::SBModule *arg1 = (lldb::SBModule *) 0 ; - lldb::SBTarget *arg2 = 0 ; - char *arg3 = (char *) 0 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBModule **)&jarg1; - arg2 = *(lldb::SBTarget **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBTarget & is null"); - return 0; - } - arg3 = 0; - if (jarg3) { - arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); - if (!arg3) return 0; - } - result = (arg1)->FindFirstGlobalVariable(*arg2,(char const *)arg3); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBModule_1FindFirstType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBModule *arg1 = (lldb::SBModule *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModule **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (arg1)->FindFirstType((char const *)arg2); - *(lldb::SBType **)&jresult = new lldb::SBType(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBModule_1FindTypes(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBModule *arg1 = (lldb::SBModule *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBTypeList result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModule **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (arg1)->FindTypes((char const *)arg2); - *(lldb::SBTypeList **)&jresult = new lldb::SBTypeList(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBModule_1GetTypeByID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2) { - jlong jresult = 0 ; - lldb::SBModule *arg1 = (lldb::SBModule *) 0 ; - lldb::user_id_t arg2 ; - lldb::SBType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModule **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (lldb::user_id_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (arg1)->GetTypeByID(arg2); - *(lldb::SBType **)&jresult = new lldb::SBType(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBModule_1GetBasicType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - jlong jresult = 0 ; - lldb::SBModule *arg1 = (lldb::SBModule *) 0 ; - lldb::BasicType arg2 ; - lldb::SBType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModule **)&jarg1; - arg2 = (lldb::BasicType)jarg2; - result = (arg1)->GetBasicType(arg2); - *(lldb::SBType **)&jresult = new lldb::SBType(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBModule_1GetTypes_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBModule *arg1 = (lldb::SBModule *) 0 ; - uint32_t arg2 ; - lldb::SBTypeList result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModule **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (arg1)->GetTypes(arg2); - *(lldb::SBTypeList **)&jresult = new lldb::SBTypeList(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBModule_1GetTypes_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBModule *arg1 = (lldb::SBModule *) 0 ; - lldb::SBTypeList result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModule **)&jarg1; - result = (arg1)->GetTypes(); - *(lldb::SBTypeList **)&jresult = new lldb::SBTypeList(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBModule_1GetVersion(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jlong jarg3) { - jlong jresult = 0 ; - lldb::SBModule *arg1 = (lldb::SBModule *) 0 ; - uint32_t *arg2 = (uint32_t *) 0 ; - uint32_t arg3 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModule **)&jarg1; - arg2 = *(uint32_t **)&jarg2; - arg3 = (uint32_t)jarg3; - result = (uint32_t)(arg1)->GetVersion(arg2,arg3); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBModule_1GetSymbolFileSpec(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBModule *arg1 = (lldb::SBModule *) 0 ; - lldb::SBFileSpec result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModule **)&jarg1; - result = ((lldb::SBModule const *)arg1)->GetSymbolFileSpec(); - *(lldb::SBFileSpec **)&jresult = new lldb::SBFileSpec(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBModule_1GetObjectFileHeaderAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBModule *arg1 = (lldb::SBModule *) 0 ; - lldb::SBAddress result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModule **)&jarg1; - result = ((lldb::SBModule const *)arg1)->GetObjectFileHeaderAddress(); - *(lldb::SBAddress **)&jresult = new lldb::SBAddress(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBModule_1GetObjectFileEntryPointAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBModule *arg1 = (lldb::SBModule *) 0 ; - lldb::SBAddress result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModule **)&jarg1; - result = ((lldb::SBModule const *)arg1)->GetObjectFileEntryPointAddress(); - *(lldb::SBAddress **)&jresult = new lldb::SBAddress(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBModule_1GetNumberAllocatedModules(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - result = (uint32_t)lldb::SBModule::GetNumberAllocatedModules(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBModule_1GarbageCollectAllocatedModules(JNIEnv *jenv, jclass jcls) { - (void)jenv; - (void)jcls; - lldb::SBModule::GarbageCollectAllocatedModules(); -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBModule_1_1_1repr_1_1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBModule *arg1 = (lldb::SBModule *) 0 ; - std::string result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModule **)&jarg1; - result = lldb_SBModule___repr__(arg1); - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBModuleSpec_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBModuleSpec *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBModuleSpec *)new lldb::SBModuleSpec(); - *(lldb::SBModuleSpec **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBModuleSpec_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBModuleSpec *arg1 = 0 ; - lldb::SBModuleSpec *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModuleSpec **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBModuleSpec const & is null"); - return 0; - } - result = (lldb::SBModuleSpec *)new lldb::SBModuleSpec((lldb::SBModuleSpec const &)*arg1); - *(lldb::SBModuleSpec **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBModuleSpec(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBModuleSpec *arg1 = (lldb::SBModuleSpec *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBModuleSpec **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBModuleSpec_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBModuleSpec *arg1 = (lldb::SBModuleSpec *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModuleSpec **)&jarg1; - result = (bool)((lldb::SBModuleSpec const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBModuleSpec_1Clear(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBModuleSpec *arg1 = (lldb::SBModuleSpec *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModuleSpec **)&jarg1; - (arg1)->Clear(); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBModuleSpec_1GetFileSpec(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBModuleSpec *arg1 = (lldb::SBModuleSpec *) 0 ; - lldb::SBFileSpec result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModuleSpec **)&jarg1; - result = (arg1)->GetFileSpec(); - *(lldb::SBFileSpec **)&jresult = new lldb::SBFileSpec(result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBModuleSpec_1SetFileSpec(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBModuleSpec *arg1 = (lldb::SBModuleSpec *) 0 ; - lldb::SBFileSpec *arg2 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBModuleSpec **)&jarg1; - arg2 = *(lldb::SBFileSpec **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec const & is null"); - return ; - } - (arg1)->SetFileSpec((lldb::SBFileSpec const &)*arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBModuleSpec_1GetPlatformFileSpec(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBModuleSpec *arg1 = (lldb::SBModuleSpec *) 0 ; - lldb::SBFileSpec result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModuleSpec **)&jarg1; - result = (arg1)->GetPlatformFileSpec(); - *(lldb::SBFileSpec **)&jresult = new lldb::SBFileSpec(result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBModuleSpec_1SetPlatformFileSpec(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBModuleSpec *arg1 = (lldb::SBModuleSpec *) 0 ; - lldb::SBFileSpec *arg2 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBModuleSpec **)&jarg1; - arg2 = *(lldb::SBFileSpec **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec const & is null"); - return ; - } - (arg1)->SetPlatformFileSpec((lldb::SBFileSpec const &)*arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBModuleSpec_1GetSymbolFileSpec(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBModuleSpec *arg1 = (lldb::SBModuleSpec *) 0 ; - lldb::SBFileSpec result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModuleSpec **)&jarg1; - result = (arg1)->GetSymbolFileSpec(); - *(lldb::SBFileSpec **)&jresult = new lldb::SBFileSpec(result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBModuleSpec_1SetSymbolFileSpec(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBModuleSpec *arg1 = (lldb::SBModuleSpec *) 0 ; - lldb::SBFileSpec *arg2 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBModuleSpec **)&jarg1; - arg2 = *(lldb::SBFileSpec **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec const & is null"); - return ; - } - (arg1)->SetSymbolFileSpec((lldb::SBFileSpec const &)*arg2); -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBModuleSpec_1GetObjectName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBModuleSpec *arg1 = (lldb::SBModuleSpec *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModuleSpec **)&jarg1; - result = (char *)(arg1)->GetObjectName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBModuleSpec_1SetObjectName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBModuleSpec *arg1 = (lldb::SBModuleSpec *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModuleSpec **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->SetObjectName((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBModuleSpec_1GetTriple(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBModuleSpec *arg1 = (lldb::SBModuleSpec *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModuleSpec **)&jarg1; - result = (char *)(arg1)->GetTriple(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBModuleSpec_1SetTriple(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBModuleSpec *arg1 = (lldb::SBModuleSpec *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModuleSpec **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->SetTriple((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBModuleSpec_1GetUUIDBytes(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBModuleSpec *arg1 = (lldb::SBModuleSpec *) 0 ; - uint8_t *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModuleSpec **)&jarg1; - result = (uint8_t *)(arg1)->GetUUIDBytes(); - *(uint8_t **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBModuleSpec_1GetUUIDLength(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBModuleSpec *arg1 = (lldb::SBModuleSpec *) 0 ; - size_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModuleSpec **)&jarg1; - result = (arg1)->GetUUIDLength(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBModuleSpec_1SetUUIDBytes(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jlong jarg3) { - jboolean jresult = 0 ; - lldb::SBModuleSpec *arg1 = (lldb::SBModuleSpec *) 0 ; - uint8_t *arg2 = (uint8_t *) 0 ; - size_t arg3 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModuleSpec **)&jarg1; - arg2 = *(uint8_t **)&jarg2; - arg3 = (size_t)jarg3; - result = (bool)(arg1)->SetUUIDBytes((uint8_t const *)arg2,arg3); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBModuleSpec_1GetObjectOffset(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBModuleSpec *arg1 = (lldb::SBModuleSpec *) 0 ; - uint64_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModuleSpec **)&jarg1; - result = (uint64_t)(arg1)->GetObjectOffset(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBModuleSpec_1SetObjectOffset(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2) { - lldb::SBModuleSpec *arg1 = (lldb::SBModuleSpec *) 0 ; - uint64_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModuleSpec **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return ; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (uint64_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - (arg1)->SetObjectOffset(arg2); -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBModuleSpec_1GetObjectSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBModuleSpec *arg1 = (lldb::SBModuleSpec *) 0 ; - uint64_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModuleSpec **)&jarg1; - result = (uint64_t)(arg1)->GetObjectSize(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBModuleSpec_1SetObjectSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2) { - lldb::SBModuleSpec *arg1 = (lldb::SBModuleSpec *) 0 ; - uint64_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModuleSpec **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return ; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (uint64_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - (arg1)->SetObjectSize(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBModuleSpec_1GetDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBModuleSpec *arg1 = (lldb::SBModuleSpec *) 0 ; - lldb::SBStream *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBModuleSpec **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - result = (bool)(arg1)->GetDescription(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBModuleSpec_1_1_1repr_1_1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBModuleSpec *arg1 = (lldb::SBModuleSpec *) 0 ; - std::string result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModuleSpec **)&jarg1; - result = lldb_SBModuleSpec___repr__(arg1); - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBModuleSpecList_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBModuleSpecList *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBModuleSpecList *)new lldb::SBModuleSpecList(); - *(lldb::SBModuleSpecList **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBModuleSpecList_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBModuleSpecList *arg1 = 0 ; - lldb::SBModuleSpecList *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModuleSpecList **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBModuleSpecList const & is null"); - return 0; - } - result = (lldb::SBModuleSpecList *)new lldb::SBModuleSpecList((lldb::SBModuleSpecList const &)*arg1); - *(lldb::SBModuleSpecList **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBModuleSpecList(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBModuleSpecList *arg1 = (lldb::SBModuleSpecList *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBModuleSpecList **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBModuleSpecList_1GetModuleSpecifications(JNIEnv *jenv, jclass jcls, jstring jarg1) { - jlong jresult = 0 ; - char *arg1 = (char *) 0 ; - lldb::SBModuleSpecList result; - - (void)jenv; - (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - result = lldb::SBModuleSpecList::GetModuleSpecifications((char const *)arg1); - *(lldb::SBModuleSpecList **)&jresult = new lldb::SBModuleSpecList(result); - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBModuleSpecList_1Append_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBModuleSpecList *arg1 = (lldb::SBModuleSpecList *) 0 ; - lldb::SBModuleSpec *arg2 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBModuleSpecList **)&jarg1; - arg2 = *(lldb::SBModuleSpec **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBModuleSpec const & is null"); - return ; - } - (arg1)->Append((lldb::SBModuleSpec const &)*arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBModuleSpecList_1Append_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBModuleSpecList *arg1 = (lldb::SBModuleSpecList *) 0 ; - lldb::SBModuleSpecList *arg2 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBModuleSpecList **)&jarg1; - arg2 = *(lldb::SBModuleSpecList **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBModuleSpecList const & is null"); - return ; - } - (arg1)->Append((lldb::SBModuleSpecList const &)*arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBModuleSpecList_1FindFirstMatchingSpec(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBModuleSpecList *arg1 = (lldb::SBModuleSpecList *) 0 ; - lldb::SBModuleSpec *arg2 = 0 ; - lldb::SBModuleSpec result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBModuleSpecList **)&jarg1; - arg2 = *(lldb::SBModuleSpec **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBModuleSpec const & is null"); - return 0; - } - result = (arg1)->FindFirstMatchingSpec((lldb::SBModuleSpec const &)*arg2); - *(lldb::SBModuleSpec **)&jresult = new lldb::SBModuleSpec(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBModuleSpecList_1FindMatchingSpecs(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBModuleSpecList *arg1 = (lldb::SBModuleSpecList *) 0 ; - lldb::SBModuleSpec *arg2 = 0 ; - lldb::SBModuleSpecList result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBModuleSpecList **)&jarg1; - arg2 = *(lldb::SBModuleSpec **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBModuleSpec const & is null"); - return 0; - } - result = (arg1)->FindMatchingSpecs((lldb::SBModuleSpec const &)*arg2); - *(lldb::SBModuleSpecList **)&jresult = new lldb::SBModuleSpecList(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBModuleSpecList_1GetSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBModuleSpecList *arg1 = (lldb::SBModuleSpecList *) 0 ; - size_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModuleSpecList **)&jarg1; - result = (arg1)->GetSize(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBModuleSpecList_1GetSpecAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBModuleSpecList *arg1 = (lldb::SBModuleSpecList *) 0 ; - size_t arg2 ; - lldb::SBModuleSpec result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModuleSpecList **)&jarg1; - arg2 = (size_t)jarg2; - result = (arg1)->GetSpecAtIndex(arg2); - *(lldb::SBModuleSpec **)&jresult = new lldb::SBModuleSpec(result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBModuleSpecList_1GetDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBModuleSpecList *arg1 = (lldb::SBModuleSpecList *) 0 ; - lldb::SBStream *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBModuleSpecList **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - result = (bool)(arg1)->GetDescription(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBModuleSpecList_1_1_1repr_1_1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBModuleSpecList *arg1 = (lldb::SBModuleSpecList *) 0 ; - std::string result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBModuleSpecList **)&jarg1; - result = lldb_SBModuleSpecList___repr__(arg1); - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBPlatformConnectOptions_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jstring jarg1) { - jlong jresult = 0 ; - char *arg1 = (char *) 0 ; - lldb::SBPlatformConnectOptions *result = 0 ; - - (void)jenv; - (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - result = (lldb::SBPlatformConnectOptions *)new lldb::SBPlatformConnectOptions((char const *)arg1); - *(lldb::SBPlatformConnectOptions **)&jresult = result; - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBPlatformConnectOptions_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBPlatformConnectOptions *arg1 = 0 ; - lldb::SBPlatformConnectOptions *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatformConnectOptions **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBPlatformConnectOptions const & is null"); - return 0; - } - result = (lldb::SBPlatformConnectOptions *)new lldb::SBPlatformConnectOptions((lldb::SBPlatformConnectOptions const &)*arg1); - *(lldb::SBPlatformConnectOptions **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBPlatformConnectOptions(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBPlatformConnectOptions *arg1 = (lldb::SBPlatformConnectOptions *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBPlatformConnectOptions **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBPlatformConnectOptions_1GetURL(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBPlatformConnectOptions *arg1 = (lldb::SBPlatformConnectOptions *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatformConnectOptions **)&jarg1; - result = (char *)(arg1)->GetURL(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBPlatformConnectOptions_1SetURL(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBPlatformConnectOptions *arg1 = (lldb::SBPlatformConnectOptions *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatformConnectOptions **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->SetURL((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBPlatformConnectOptions_1GetRsyncEnabled(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBPlatformConnectOptions *arg1 = (lldb::SBPlatformConnectOptions *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatformConnectOptions **)&jarg1; - result = (bool)(arg1)->GetRsyncEnabled(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBPlatformConnectOptions_1EnableRsync(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jstring jarg3, jboolean jarg4) { - lldb::SBPlatformConnectOptions *arg1 = (lldb::SBPlatformConnectOptions *) 0 ; - char *arg2 = (char *) 0 ; - char *arg3 = (char *) 0 ; - bool arg4 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatformConnectOptions **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - arg3 = 0; - if (jarg3) { - arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); - if (!arg3) return ; - } - arg4 = jarg4 ? true : false; - (arg1)->EnableRsync((char const *)arg2,(char const *)arg3,arg4); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBPlatformConnectOptions_1DisableRsync(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBPlatformConnectOptions *arg1 = (lldb::SBPlatformConnectOptions *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatformConnectOptions **)&jarg1; - (arg1)->DisableRsync(); -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBPlatformConnectOptions_1GetLocalCacheDirectory(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBPlatformConnectOptions *arg1 = (lldb::SBPlatformConnectOptions *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatformConnectOptions **)&jarg1; - result = (char *)(arg1)->GetLocalCacheDirectory(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBPlatformConnectOptions_1SetLocalCacheDirectory(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBPlatformConnectOptions *arg1 = (lldb::SBPlatformConnectOptions *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatformConnectOptions **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->SetLocalCacheDirectory((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBPlatformShellCommand_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jstring jarg1, jstring jarg2) { - jlong jresult = 0 ; - char *arg1 = (char *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBPlatformShellCommand *result = 0 ; - - (void)jenv; - (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (lldb::SBPlatformShellCommand *)new lldb::SBPlatformShellCommand((char const *)arg1,(char const *)arg2); - *(lldb::SBPlatformShellCommand **)&jresult = result; - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBPlatformShellCommand_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jstring jarg1) { - jlong jresult = 0 ; - char *arg1 = (char *) 0 ; - lldb::SBPlatformShellCommand *result = 0 ; - - (void)jenv; - (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - result = (lldb::SBPlatformShellCommand *)new lldb::SBPlatformShellCommand((char const *)arg1); - *(lldb::SBPlatformShellCommand **)&jresult = result; - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBPlatformShellCommand_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBPlatformShellCommand *arg1 = 0 ; - lldb::SBPlatformShellCommand *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatformShellCommand **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBPlatformShellCommand const & is null"); - return 0; - } - result = (lldb::SBPlatformShellCommand *)new lldb::SBPlatformShellCommand((lldb::SBPlatformShellCommand const &)*arg1); - *(lldb::SBPlatformShellCommand **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBPlatformShellCommand(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBPlatformShellCommand *arg1 = (lldb::SBPlatformShellCommand *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBPlatformShellCommand **)&jarg1; - delete arg1; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBPlatformShellCommand_1Clear(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBPlatformShellCommand *arg1 = (lldb::SBPlatformShellCommand *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatformShellCommand **)&jarg1; - (arg1)->Clear(); -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBPlatformShellCommand_1GetShell(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBPlatformShellCommand *arg1 = (lldb::SBPlatformShellCommand *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatformShellCommand **)&jarg1; - result = (char *)(arg1)->GetShell(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBPlatformShellCommand_1SetShell(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBPlatformShellCommand *arg1 = (lldb::SBPlatformShellCommand *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatformShellCommand **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->SetShell((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBPlatformShellCommand_1GetCommand(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBPlatformShellCommand *arg1 = (lldb::SBPlatformShellCommand *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatformShellCommand **)&jarg1; - result = (char *)(arg1)->GetCommand(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBPlatformShellCommand_1SetCommand(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBPlatformShellCommand *arg1 = (lldb::SBPlatformShellCommand *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatformShellCommand **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->SetCommand((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBPlatformShellCommand_1GetWorkingDirectory(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBPlatformShellCommand *arg1 = (lldb::SBPlatformShellCommand *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatformShellCommand **)&jarg1; - result = (char *)(arg1)->GetWorkingDirectory(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBPlatformShellCommand_1SetWorkingDirectory(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBPlatformShellCommand *arg1 = (lldb::SBPlatformShellCommand *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatformShellCommand **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->SetWorkingDirectory((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBPlatformShellCommand_1GetTimeoutSeconds(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBPlatformShellCommand *arg1 = (lldb::SBPlatformShellCommand *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatformShellCommand **)&jarg1; - result = (uint32_t)(arg1)->GetTimeoutSeconds(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBPlatformShellCommand_1SetTimeoutSeconds(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - lldb::SBPlatformShellCommand *arg1 = (lldb::SBPlatformShellCommand *) 0 ; - uint32_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatformShellCommand **)&jarg1; - arg2 = (uint32_t)jarg2; - (arg1)->SetTimeoutSeconds(arg2); -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBPlatformShellCommand_1GetSignal(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBPlatformShellCommand *arg1 = (lldb::SBPlatformShellCommand *) 0 ; - int result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatformShellCommand **)&jarg1; - result = (int)(arg1)->GetSignal(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBPlatformShellCommand_1GetStatus(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBPlatformShellCommand *arg1 = (lldb::SBPlatformShellCommand *) 0 ; - int result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatformShellCommand **)&jarg1; - result = (int)(arg1)->GetStatus(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBPlatformShellCommand_1GetOutput(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBPlatformShellCommand *arg1 = (lldb::SBPlatformShellCommand *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatformShellCommand **)&jarg1; - result = (char *)(arg1)->GetOutput(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBPlatform_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBPlatform *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBPlatform *)new lldb::SBPlatform(); - *(lldb::SBPlatform **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBPlatform_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jstring jarg1) { - jlong jresult = 0 ; - char *arg1 = (char *) 0 ; - lldb::SBPlatform *result = 0 ; - - (void)jenv; - (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - result = (lldb::SBPlatform *)new lldb::SBPlatform((char const *)arg1); - *(lldb::SBPlatform **)&jresult = result; - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBPlatform_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBPlatform *arg1 = 0 ; - lldb::SBPlatform *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatform **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBPlatform const & is null"); - return 0; - } - result = (lldb::SBPlatform *)new lldb::SBPlatform((lldb::SBPlatform const &)*arg1); - *(lldb::SBPlatform **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBPlatform(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBPlatform *arg1 = (lldb::SBPlatform *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBPlatform **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBPlatform_1GetHostPlatform(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBPlatform result; - - (void)jenv; - (void)jcls; - result = lldb::SBPlatform::GetHostPlatform(); - *(lldb::SBPlatform **)&jresult = new lldb::SBPlatform(result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBPlatform_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBPlatform *arg1 = (lldb::SBPlatform *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatform **)&jarg1; - result = (bool)((lldb::SBPlatform const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBPlatform_1Clear(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBPlatform *arg1 = (lldb::SBPlatform *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatform **)&jarg1; - (arg1)->Clear(); -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBPlatform_1GetWorkingDirectory(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBPlatform *arg1 = (lldb::SBPlatform *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatform **)&jarg1; - result = (char *)(arg1)->GetWorkingDirectory(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBPlatform_1SetWorkingDirectory(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jboolean jresult = 0 ; - lldb::SBPlatform *arg1 = (lldb::SBPlatform *) 0 ; - char *arg2 = (char *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatform **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (bool)(arg1)->SetWorkingDirectory((char const *)arg2); - jresult = (jboolean)result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBPlatform_1GetName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBPlatform *arg1 = (lldb::SBPlatform *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatform **)&jarg1; - result = (char *)(arg1)->GetName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBPlatform_1ConnectRemote(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBPlatform *arg1 = (lldb::SBPlatform *) 0 ; - lldb::SBPlatformConnectOptions *arg2 = 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBPlatform **)&jarg1; - arg2 = *(lldb::SBPlatformConnectOptions **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBPlatformConnectOptions & is null"); - return 0; - } - result = (arg1)->ConnectRemote(*arg2); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBPlatform_1DisconnectRemote(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBPlatform *arg1 = (lldb::SBPlatform *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatform **)&jarg1; - (arg1)->DisconnectRemote(); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBPlatform_1IsConnected(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBPlatform *arg1 = (lldb::SBPlatform *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatform **)&jarg1; - result = (bool)(arg1)->IsConnected(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBPlatform_1GetTriple(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBPlatform *arg1 = (lldb::SBPlatform *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatform **)&jarg1; - result = (char *)(arg1)->GetTriple(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBPlatform_1GetHostname(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBPlatform *arg1 = (lldb::SBPlatform *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatform **)&jarg1; - result = (char *)(arg1)->GetHostname(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBPlatform_1GetOSBuild(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBPlatform *arg1 = (lldb::SBPlatform *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatform **)&jarg1; - result = (char *)(arg1)->GetOSBuild(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBPlatform_1GetOSDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBPlatform *arg1 = (lldb::SBPlatform *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatform **)&jarg1; - result = (char *)(arg1)->GetOSDescription(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBPlatform_1GetOSMajorVersion(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBPlatform *arg1 = (lldb::SBPlatform *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatform **)&jarg1; - result = (uint32_t)(arg1)->GetOSMajorVersion(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBPlatform_1GetOSMinorVersion(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBPlatform *arg1 = (lldb::SBPlatform *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatform **)&jarg1; - result = (uint32_t)(arg1)->GetOSMinorVersion(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBPlatform_1GetOSUpdateVersion(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBPlatform *arg1 = (lldb::SBPlatform *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatform **)&jarg1; - result = (uint32_t)(arg1)->GetOSUpdateVersion(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBPlatform_1SetSDKRoot(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBPlatform *arg1 = (lldb::SBPlatform *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatform **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->SetSDKRoot((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBPlatform_1Put(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_) { - jlong jresult = 0 ; - lldb::SBPlatform *arg1 = (lldb::SBPlatform *) 0 ; - lldb::SBFileSpec *arg2 = 0 ; - lldb::SBFileSpec *arg3 = 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - arg1 = *(lldb::SBPlatform **)&jarg1; - arg2 = *(lldb::SBFileSpec **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec & is null"); - return 0; - } - arg3 = *(lldb::SBFileSpec **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec & is null"); - return 0; - } - result = (arg1)->Put(*arg2,*arg3); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBPlatform_1Get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_) { - jlong jresult = 0 ; - lldb::SBPlatform *arg1 = (lldb::SBPlatform *) 0 ; - lldb::SBFileSpec *arg2 = 0 ; - lldb::SBFileSpec *arg3 = 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - arg1 = *(lldb::SBPlatform **)&jarg1; - arg2 = *(lldb::SBFileSpec **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec & is null"); - return 0; - } - arg3 = *(lldb::SBFileSpec **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec & is null"); - return 0; - } - result = (arg1)->Get(*arg2,*arg3); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBPlatform_1Install(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_) { - jlong jresult = 0 ; - lldb::SBPlatform *arg1 = (lldb::SBPlatform *) 0 ; - lldb::SBFileSpec *arg2 = 0 ; - lldb::SBFileSpec *arg3 = 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - arg1 = *(lldb::SBPlatform **)&jarg1; - arg2 = *(lldb::SBFileSpec **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec & is null"); - return 0; - } - arg3 = *(lldb::SBFileSpec **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec & is null"); - return 0; - } - result = (arg1)->Install(*arg2,*arg3); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBPlatform_1Run(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBPlatform *arg1 = (lldb::SBPlatform *) 0 ; - lldb::SBPlatformShellCommand *arg2 = 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBPlatform **)&jarg1; - arg2 = *(lldb::SBPlatformShellCommand **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBPlatformShellCommand & is null"); - return 0; - } - result = (arg1)->Run(*arg2); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBPlatform_1Launch(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBPlatform *arg1 = (lldb::SBPlatform *) 0 ; - lldb::SBLaunchInfo *arg2 = 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBPlatform **)&jarg1; - arg2 = *(lldb::SBLaunchInfo **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBLaunchInfo & is null"); - return 0; - } - result = (arg1)->Launch(*arg2); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBPlatform_1Kill(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2) { - jlong jresult = 0 ; - lldb::SBPlatform *arg1 = (lldb::SBPlatform *) 0 ; - lldb::pid_t arg2 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatform **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (lldb::pid_t const)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (arg1)->Kill(arg2); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBPlatform_1MakeDirectory_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3) { - jlong jresult = 0 ; - lldb::SBPlatform *arg1 = (lldb::SBPlatform *) 0 ; - char *arg2 = (char *) 0 ; - uint32_t arg3 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatform **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = (uint32_t)jarg3; - result = (arg1)->MakeDirectory((char const *)arg2,arg3); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBPlatform_1MakeDirectory_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBPlatform *arg1 = (lldb::SBPlatform *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatform **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (arg1)->MakeDirectory((char const *)arg2); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBPlatform_1GetFilePermissions(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBPlatform *arg1 = (lldb::SBPlatform *) 0 ; - char *arg2 = (char *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatform **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (uint32_t)(arg1)->GetFilePermissions((char const *)arg2); - jresult = (jlong)result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBPlatform_1SetFilePermissions(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3) { - jlong jresult = 0 ; - lldb::SBPlatform *arg1 = (lldb::SBPlatform *) 0 ; - char *arg2 = (char *) 0 ; - uint32_t arg3 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatform **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = (uint32_t)jarg3; - result = (arg1)->SetFilePermissions((char const *)arg2,arg3); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBPlatform_1GetUnixSignals(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBPlatform *arg1 = (lldb::SBPlatform *) 0 ; - lldb::SBUnixSignals result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatform **)&jarg1; - result = ((lldb::SBPlatform const *)arg1)->GetUnixSignals(); - *(lldb::SBUnixSignals **)&jresult = new lldb::SBUnixSignals(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBPlatform_1GetEnvironment(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBPlatform *arg1 = (lldb::SBPlatform *) 0 ; - lldb::SBEnvironment result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatform **)&jarg1; - result = (arg1)->GetEnvironment(); - *(lldb::SBEnvironment **)&jresult = new lldb::SBEnvironment(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBPlatform_1SetLocateModuleCallback(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jlong jarg3) { - jlong jresult = 0 ; - lldb::SBPlatform *arg1 = (lldb::SBPlatform *) 0 ; - lldb::SBPlatformLocateModuleCallback arg2 = (lldb::SBPlatformLocateModuleCallback) 0 ; - void *arg3 = (void *) 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBPlatform **)&jarg1; - arg2 = *(lldb::SBPlatformLocateModuleCallback *)&jarg2; - arg3 = *(void **)&jarg3; - result = (arg1)->SetLocateModuleCallback(arg2,arg3); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBProcess_1eBroadcastBitStateChanged_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)lldb::SBProcess::eBroadcastBitStateChanged; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBProcess_1eBroadcastBitInterrupt_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)lldb::SBProcess::eBroadcastBitInterrupt; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBProcess_1eBroadcastBitSTDOUT_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)lldb::SBProcess::eBroadcastBitSTDOUT; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBProcess_1eBroadcastBitSTDERR_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)lldb::SBProcess::eBroadcastBitSTDERR; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBProcess_1eBroadcastBitProfileData_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)lldb::SBProcess::eBroadcastBitProfileData; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBProcess_1eBroadcastBitStructuredData_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)lldb::SBProcess::eBroadcastBitStructuredData; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBProcess_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBProcess *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBProcess *)new lldb::SBProcess(); - *(lldb::SBProcess **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBProcess_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = 0 ; - lldb::SBProcess *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBProcess const & is null"); - return 0; - } - result = (lldb::SBProcess *)new lldb::SBProcess((lldb::SBProcess const &)*arg1); - *(lldb::SBProcess **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBProcess(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBProcess **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBProcess_1GetBroadcasterClassName(JNIEnv *jenv, jclass jcls) { - jstring jresult = 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - result = (char *)lldb::SBProcess::GetBroadcasterClassName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBProcess_1GetPluginName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - result = (char *)(arg1)->GetPluginName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBProcess_1GetShortPluginName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - result = (char *)(arg1)->GetShortPluginName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBProcess_1Clear(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - (arg1)->Clear(); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBProcess_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - result = (bool)((lldb::SBProcess const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1GetTarget(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - lldb::SBTarget result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - result = ((lldb::SBProcess const *)arg1)->GetTarget(); - *(lldb::SBTarget **)&jresult = new lldb::SBTarget(result); - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBProcess_1GetByteOrder(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - lldb::ByteOrder result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - result = (lldb::ByteOrder)((lldb::SBProcess const *)arg1)->GetByteOrder(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1PutSTDIN(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - char *arg2 = (char *) 0 ; - size_t arg3 ; - size_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = (size_t)jarg3; - result = (arg1)->PutSTDIN((char const *)arg2,arg3); - jresult = (jlong)result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1GetSTDOUT(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - char *arg2 = (char *) 0 ; - size_t arg3 ; - size_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = (size_t)jarg3; - result = ((lldb::SBProcess const *)arg1)->GetSTDOUT(arg2,arg3); - jresult = (jlong)result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1GetSTDERR(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - char *arg2 = (char *) 0 ; - size_t arg3 ; - size_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = (size_t)jarg3; - result = ((lldb::SBProcess const *)arg1)->GetSTDERR(arg2,arg3); - jresult = (jlong)result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1GetAsyncProfileData(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - char *arg2 = (char *) 0 ; - size_t arg3 ; - size_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = (size_t)jarg3; - result = ((lldb::SBProcess const *)arg1)->GetAsyncProfileData(arg2,arg3); - jresult = (jlong)result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBProcess_1ReportEventState_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_) { - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - lldb::SBEvent *arg2 = 0 ; - lldb::SBFile arg3 ; - lldb::SBFile *argp3 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - arg1 = *(lldb::SBProcess **)&jarg1; - arg2 = *(lldb::SBEvent **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent const & is null"); - return ; - } - argp3 = *(lldb::SBFile **)&jarg3; - if (!argp3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBFile"); - return ; - } - arg3 = *argp3; - ((lldb::SBProcess const *)arg1)->ReportEventState((lldb::SBEvent const &)*arg2,arg3); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBProcess_1ReportEventState_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3) { - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - lldb::SBEvent *arg2 = 0 ; - SwigValueWrapper< std::shared_ptr< lldb_private::File > > arg3 ; - lldb::FileSP *argp3 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBProcess **)&jarg1; - arg2 = *(lldb::SBEvent **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent const & is null"); - return ; - } - argp3 = *(lldb::FileSP **)&jarg3; - if (!argp3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::FileSP"); - return ; - } - arg3 = *argp3; - ((lldb::SBProcess const *)arg1)->ReportEventState((lldb::SBEvent const &)*arg2,arg3); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBProcess_1AppendEventStateReport(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_) { - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - lldb::SBEvent *arg2 = 0 ; - lldb::SBCommandReturnObject *arg3 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - arg1 = *(lldb::SBProcess **)&jarg1; - arg2 = *(lldb::SBEvent **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent const & is null"); - return ; - } - arg3 = *(lldb::SBCommandReturnObject **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBCommandReturnObject & is null"); - return ; - } - (arg1)->AppendEventStateReport((lldb::SBEvent const &)*arg2,*arg3); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBProcess_1RemoteAttachToProcessWithID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2, jlong jarg3, jobject jarg3_) { - jboolean jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - lldb::pid_t arg2 ; - lldb::SBError *arg3 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - arg1 = *(lldb::SBProcess **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (lldb::pid_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - arg3 = *(lldb::SBError **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - result = (bool)(arg1)->RemoteAttachToProcessWithID(arg2,*arg3); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBProcess_1RemoteLaunch(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobjectArray jarg2, jobjectArray jarg3, jstring jarg4, jstring jarg5, jstring jarg6, jstring jarg7, jlong jarg8, jboolean jarg9, jlong jarg10, jobject jarg10_) { - jboolean jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - char **arg2 = (char **) 0 ; - char **arg3 = (char **) 0 ; - char *arg4 = (char *) 0 ; - char *arg5 = (char *) 0 ; - char *arg6 = (char *) 0 ; - char *arg7 = (char *) 0 ; - uint32_t arg8 ; - bool arg9 ; - lldb::SBError *arg10 = 0 ; - jint size2 ; - jint size3 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg10_; - arg1 = *(lldb::SBProcess **)&jarg1; - { - int i = 0; - if (jarg2) { - size2 = jenv->GetArrayLength(jarg2); - - arg2 = new char*[size2+1]; - - - - for (i = 0; iGetObjectArrayElement(jarg2, i); - const char *c_string = jenv->GetStringUTFChars(j_string, 0); - - arg2[i] = new char [strlen(c_string)+1]; - - - - strcpy(arg2[i], c_string); - jenv->ReleaseStringUTFChars(j_string, c_string); - jenv->DeleteLocalRef(j_string); - } - arg2[i] = 0; - } else { - arg2 = 0; - size2 = 0; - } - } - { - int i = 0; - if (jarg3) { - size3 = jenv->GetArrayLength(jarg3); - - arg3 = new char*[size3+1]; - - - - for (i = 0; iGetObjectArrayElement(jarg3, i); - const char *c_string = jenv->GetStringUTFChars(j_string, 0); - - arg3[i] = new char [strlen(c_string)+1]; - - - - strcpy(arg3[i], c_string); - jenv->ReleaseStringUTFChars(j_string, c_string); - jenv->DeleteLocalRef(j_string); - } - arg3[i] = 0; - } else { - arg3 = 0; - size3 = 0; - } - } - arg4 = 0; - if (jarg4) { - arg4 = (char *)jenv->GetStringUTFChars(jarg4, 0); - if (!arg4) return 0; - } - arg5 = 0; - if (jarg5) { - arg5 = (char *)jenv->GetStringUTFChars(jarg5, 0); - if (!arg5) return 0; - } - arg6 = 0; - if (jarg6) { - arg6 = (char *)jenv->GetStringUTFChars(jarg6, 0); - if (!arg6) return 0; - } - arg7 = 0; - if (jarg7) { - arg7 = (char *)jenv->GetStringUTFChars(jarg7, 0); - if (!arg7) return 0; - } - arg8 = (uint32_t)jarg8; - arg9 = jarg9 ? true : false; - arg10 = *(lldb::SBError **)&jarg10; - if (!arg10) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - result = (bool)(arg1)->RemoteLaunch((char const **)arg2,(char const **)arg3,(char const *)arg4,(char const *)arg5,(char const *)arg6,(char const *)arg7,arg8,arg9,*arg10); - jresult = (jboolean)result; - { - int i; - for (i=0; iReleaseStringUTFChars(jarg4, (const char *)arg4); - if (arg5) jenv->ReleaseStringUTFChars(jarg5, (const char *)arg5); - if (arg6) jenv->ReleaseStringUTFChars(jarg6, (const char *)arg6); - if (arg7) jenv->ReleaseStringUTFChars(jarg7, (const char *)arg7); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1GetNumThreads(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - result = (uint32_t)(arg1)->GetNumThreads(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1GetThreadAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - size_t arg2 ; - lldb::SBThread result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - arg2 = (size_t)jarg2; - result = (arg1)->GetThreadAtIndex(arg2); - *(lldb::SBThread **)&jresult = new lldb::SBThread(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1GetThreadByID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - lldb::tid_t arg2 ; - lldb::SBThread result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (lldb::tid_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (arg1)->GetThreadByID(arg2); - *(lldb::SBThread **)&jresult = new lldb::SBThread(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1GetThreadByIndexID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - uint32_t arg2 ; - lldb::SBThread result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (arg1)->GetThreadByIndexID(arg2); - *(lldb::SBThread **)&jresult = new lldb::SBThread(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1GetSelectedThread(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - lldb::SBThread result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - result = ((lldb::SBProcess const *)arg1)->GetSelectedThread(); - *(lldb::SBThread **)&jresult = new lldb::SBThread(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1CreateOSPluginThread(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2, jobject jarg3) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - lldb::tid_t arg2 ; - lldb::addr_t arg3 ; - lldb::SBThread result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (lldb::tid_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg3); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg3, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg3 = 0; - if (sz > 0) { - arg3 = (lldb::addr_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (arg1)->CreateOSPluginThread(arg2,arg3); - *(lldb::SBThread **)&jresult = new lldb::SBThread(result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBProcess_1SetSelectedThread(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - lldb::SBThread *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBProcess **)&jarg1; - arg2 = *(lldb::SBThread **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBThread const & is null"); - return 0; - } - result = (bool)(arg1)->SetSelectedThread((lldb::SBThread const &)*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBProcess_1SetSelectedThreadByID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2) { - jboolean jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - lldb::tid_t arg2 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (lldb::tid_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (bool)(arg1)->SetSelectedThreadByID(arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBProcess_1SetSelectedThreadByIndexID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jboolean jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - uint32_t arg2 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (bool)(arg1)->SetSelectedThreadByIndexID(arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1GetNumQueues(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - result = (uint32_t)(arg1)->GetNumQueues(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1GetQueueAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - size_t arg2 ; - lldb::SBQueue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - arg2 = (size_t)jarg2; - result = (arg1)->GetQueueAtIndex(arg2); - *(lldb::SBQueue **)&jresult = new lldb::SBQueue(result); - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBProcess_1GetState(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - lldb::StateType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - result = (lldb::StateType)(arg1)->GetState(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBProcess_1GetExitStatus(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - int result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - result = (int)(arg1)->GetExitStatus(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBProcess_1GetExitDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - result = (char *)(arg1)->GetExitDescription(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBProcess_1GetProcessID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - lldb::pid_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - result = (lldb::pid_t)(arg1)->GetProcessID(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1GetUniqueID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - result = (uint32_t)(arg1)->GetUniqueID(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1GetAddressByteSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - result = (uint32_t)((lldb::SBProcess const *)arg1)->GetAddressByteSize(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1Destroy(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - result = (arg1)->Destroy(); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1Continue(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - result = (arg1)->Continue(); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1Stop(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - result = (arg1)->Stop(); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1Kill(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - result = (arg1)->Kill(); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1Detach_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - result = (arg1)->Detach(); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1Detach_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - bool arg2 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - arg2 = jarg2 ? true : false; - result = (arg1)->Detach(arg2); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1Signal(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - int arg2 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - arg2 = (int)jarg2; - result = (arg1)->Signal(arg2); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1GetUnixSignals(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - lldb::SBUnixSignals result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - result = (arg1)->GetUnixSignals(); - *(lldb::SBUnixSignals **)&jresult = new lldb::SBUnixSignals(result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBProcess_1SendAsyncInterrupt(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - (arg1)->SendAsyncInterrupt(); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1GetStopID_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - bool arg2 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - arg2 = jarg2 ? true : false; - result = (uint32_t)(arg1)->GetStopID(arg2); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1GetStopID_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - result = (uint32_t)(arg1)->GetStopID(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1GetStopEventForStopID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - uint32_t arg2 ; - lldb::SBEvent result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (arg1)->GetStopEventForStopID(arg2); - *(lldb::SBEvent **)&jresult = new lldb::SBEvent(result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBProcess_1ForceScriptedState(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - lldb::StateType arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - arg2 = (lldb::StateType)jarg2; - (arg1)->ForceScriptedState(arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1ReadMemory(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2, jlong jarg3, jlong jarg4, jlong jarg5, jobject jarg5_) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - lldb::addr_t arg2 ; - void *arg3 = (void *) 0 ; - size_t arg4 ; - lldb::SBError *arg5 = 0 ; - size_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg5_; - arg1 = *(lldb::SBProcess **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (lldb::addr_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - arg3 = *(void **)&jarg3; - arg4 = (size_t)jarg4; - arg5 = *(lldb::SBError **)&jarg5; - if (!arg5) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - result = (arg1)->ReadMemory(arg2,arg3,arg4,*arg5); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1WriteMemory(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2, jlong jarg3, jlong jarg4, jlong jarg5, jobject jarg5_) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - lldb::addr_t arg2 ; - void *arg3 = (void *) 0 ; - size_t arg4 ; - lldb::SBError *arg5 = 0 ; - size_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg5_; - arg1 = *(lldb::SBProcess **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (lldb::addr_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - arg3 = *(void **)&jarg3; - arg4 = (size_t)jarg4; - arg5 = *(lldb::SBError **)&jarg5; - if (!arg5) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - result = (arg1)->WriteMemory(arg2,(void const *)arg3,arg4,*arg5); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1ReadCStringFromMemory(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2, jlong jarg3, jlong jarg4, jlong jarg5, jobject jarg5_) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - lldb::addr_t arg2 ; - void *arg3 = (void *) 0 ; - size_t arg4 ; - lldb::SBError *arg5 = 0 ; - size_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg5_; - arg1 = *(lldb::SBProcess **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (lldb::addr_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - arg3 = *(void **)&jarg3; - arg4 = (size_t)jarg4; - arg5 = *(lldb::SBError **)&jarg5; - if (!arg5) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - result = (arg1)->ReadCStringFromMemory(arg2,arg3,arg4,*arg5); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBProcess_1ReadUnsignedFromMemory(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2, jlong jarg3, jlong jarg4, jobject jarg4_) { - jobject jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - lldb::addr_t arg2 ; - uint32_t arg3 ; - lldb::SBError *arg4 = 0 ; - uint64_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg4_; - arg1 = *(lldb::SBProcess **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (lldb::addr_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - arg3 = (uint32_t)jarg3; - arg4 = *(lldb::SBError **)&jarg4; - if (!arg4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - result = (uint64_t)(arg1)->ReadUnsignedFromMemory(arg2,arg3,*arg4); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBProcess_1ReadPointerFromMemory(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2, jlong jarg3, jobject jarg3_) { - jobject jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - lldb::addr_t arg2 ; - lldb::SBError *arg3 = 0 ; - lldb::addr_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - arg1 = *(lldb::SBProcess **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (lldb::addr_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - arg3 = *(lldb::SBError **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - result = (lldb::addr_t)(arg1)->ReadPointerFromMemory(arg2,*arg3); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBProcess_1GetStateFromEvent(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBEvent *arg1 = 0 ; - lldb::StateType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEvent **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent const & is null"); - return 0; - } - result = (lldb::StateType)lldb::SBProcess::GetStateFromEvent((lldb::SBEvent const &)*arg1); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBProcess_1GetRestartedFromEvent(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBEvent *arg1 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEvent **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent const & is null"); - return 0; - } - result = (bool)lldb::SBProcess::GetRestartedFromEvent((lldb::SBEvent const &)*arg1); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1GetNumRestartedReasonsFromEvent(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBEvent *arg1 = 0 ; - size_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEvent **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent const & is null"); - return 0; - } - result = lldb::SBProcess::GetNumRestartedReasonsFromEvent((lldb::SBEvent const &)*arg1); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBProcess_1GetRestartedReasonAtIndexFromEvent(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jstring jresult = 0 ; - lldb::SBEvent *arg1 = 0 ; - size_t arg2 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEvent **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent const & is null"); - return 0; - } - arg2 = (size_t)jarg2; - result = (char *)lldb::SBProcess::GetRestartedReasonAtIndexFromEvent((lldb::SBEvent const &)*arg1,SWIG_STD_MOVE(arg2)); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1GetProcessFromEvent(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBEvent *arg1 = 0 ; - lldb::SBProcess result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEvent **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent const & is null"); - return 0; - } - result = lldb::SBProcess::GetProcessFromEvent((lldb::SBEvent const &)*arg1); - *(lldb::SBProcess **)&jresult = new lldb::SBProcess(result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBProcess_1GetInterruptedFromEvent(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBEvent *arg1 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEvent **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent const & is null"); - return 0; - } - result = (bool)lldb::SBProcess::GetInterruptedFromEvent((lldb::SBEvent const &)*arg1); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1GetStructuredDataFromEvent(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBEvent *arg1 = 0 ; - lldb::SBStructuredData result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEvent **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent const & is null"); - return 0; - } - result = lldb::SBProcess::GetStructuredDataFromEvent((lldb::SBEvent const &)*arg1); - *(lldb::SBStructuredData **)&jresult = new lldb::SBStructuredData(result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBProcess_1EventIsProcessEvent(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBEvent *arg1 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEvent **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent const & is null"); - return 0; - } - result = (bool)lldb::SBProcess::EventIsProcessEvent((lldb::SBEvent const &)*arg1); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBProcess_1EventIsStructuredDataEvent(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBEvent *arg1 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEvent **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent const & is null"); - return 0; - } - result = (bool)lldb::SBProcess::EventIsStructuredDataEvent((lldb::SBEvent const &)*arg1); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1GetBroadcaster(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - lldb::SBBroadcaster result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - result = ((lldb::SBProcess const *)arg1)->GetBroadcaster(); - *(lldb::SBBroadcaster **)&jresult = new lldb::SBBroadcaster(result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBProcess_1GetBroadcasterClass(JNIEnv *jenv, jclass jcls) { - jstring jresult = 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - result = (char *)lldb::SBProcess::GetBroadcasterClass(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBProcess_1GetDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - lldb::SBStream *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBProcess **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - result = (bool)(arg1)->GetDescription(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1GetExtendedCrashInformation(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - lldb::SBStructuredData result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - result = (arg1)->GetExtendedCrashInformation(); - *(lldb::SBStructuredData **)&jresult = new lldb::SBStructuredData(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1GetNumSupportedHardwareWatchpoints(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - lldb::SBError *arg2 = 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBProcess **)&jarg1; - arg2 = *(lldb::SBError **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - result = (uint32_t)((lldb::SBProcess const *)arg1)->GetNumSupportedHardwareWatchpoints(*arg2); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1LoadImage_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - lldb::SBFileSpec *arg2 = 0 ; - lldb::SBError *arg3 = 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - arg1 = *(lldb::SBProcess **)&jarg1; - arg2 = *(lldb::SBFileSpec **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec & is null"); - return 0; - } - arg3 = *(lldb::SBError **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - result = (uint32_t)(arg1)->LoadImage(*arg2,*arg3); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1LoadImage_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_, jlong jarg4, jobject jarg4_) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - lldb::SBFileSpec *arg2 = 0 ; - lldb::SBFileSpec *arg3 = 0 ; - lldb::SBError *arg4 = 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - (void)jarg4_; - arg1 = *(lldb::SBProcess **)&jarg1; - arg2 = *(lldb::SBFileSpec **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec const & is null"); - return 0; - } - arg3 = *(lldb::SBFileSpec **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec const & is null"); - return 0; - } - arg4 = *(lldb::SBError **)&jarg4; - if (!arg4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - result = (uint32_t)(arg1)->LoadImage((lldb::SBFileSpec const &)*arg2,(lldb::SBFileSpec const &)*arg3,*arg4); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1LoadImageUsingPaths(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_, jlong jarg4, jobject jarg4_, jlong jarg5, jobject jarg5_) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - lldb::SBFileSpec *arg2 = 0 ; - lldb::SBStringList *arg3 = 0 ; - lldb::SBFileSpec *arg4 = 0 ; - lldb::SBError *arg5 = 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - (void)jarg4_; - (void)jarg5_; - arg1 = *(lldb::SBProcess **)&jarg1; - arg2 = *(lldb::SBFileSpec **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec const & is null"); - return 0; - } - arg3 = *(lldb::SBStringList **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStringList & is null"); - return 0; - } - arg4 = *(lldb::SBFileSpec **)&jarg4; - if (!arg4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec & is null"); - return 0; - } - arg5 = *(lldb::SBError **)&jarg5; - if (!arg5) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - result = (uint32_t)(arg1)->LoadImageUsingPaths((lldb::SBFileSpec const &)*arg2,*arg3,*arg4,*arg5); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1UnloadImage(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - uint32_t arg2 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (arg1)->UnloadImage(arg2); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1SendEventData(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (arg1)->SendEventData((char const *)arg2); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1GetNumExtendedBacktraceTypes(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - result = (uint32_t)(arg1)->GetNumExtendedBacktraceTypes(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBProcess_1GetExtendedBacktraceTypeAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jstring jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - uint32_t arg2 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (char *)(arg1)->GetExtendedBacktraceTypeAtIndex(arg2); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1GetHistoryThreads(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - lldb::addr_t arg2 ; - lldb::SBThreadCollection result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (lldb::addr_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (arg1)->GetHistoryThreads(arg2); - *(lldb::SBThreadCollection **)&jresult = new lldb::SBThreadCollection(result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBProcess_1IsInstrumentationRuntimePresent(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - jboolean jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - lldb::InstrumentationRuntimeType arg2 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - arg2 = (lldb::InstrumentationRuntimeType)jarg2; - result = (bool)(arg1)->IsInstrumentationRuntimePresent(arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1SaveCore_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jstring jarg3, jint jarg4) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - char *arg2 = (char *) 0 ; - char *arg3 = (char *) 0 ; - lldb::SaveCoreStyle arg4 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = 0; - if (jarg3) { - arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); - if (!arg3) return 0; - } - arg4 = (lldb::SaveCoreStyle)jarg4; - result = (arg1)->SaveCore((char const *)arg2,(char const *)arg3,arg4); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1SaveCore_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (arg1)->SaveCore((char const *)arg2); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1GetMemoryRegionInfo(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2, jlong jarg3, jobject jarg3_) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - lldb::addr_t arg2 ; - lldb::SBMemoryRegionInfo *arg3 = 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - arg1 = *(lldb::SBProcess **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (lldb::addr_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - arg3 = *(lldb::SBMemoryRegionInfo **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBMemoryRegionInfo & is null"); - return 0; - } - result = (arg1)->GetMemoryRegionInfo(arg2,*arg3); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1GetMemoryRegions(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - lldb::SBMemoryRegionInfoList result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - result = (arg1)->GetMemoryRegions(); - *(lldb::SBMemoryRegionInfoList **)&jresult = new lldb::SBMemoryRegionInfoList(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1GetProcessInfo(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - lldb::SBProcessInfo result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - result = (arg1)->GetProcessInfo(); - *(lldb::SBProcessInfo **)&jresult = new lldb::SBProcessInfo(result); - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBProcess_1AllocateMemory(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jlong jarg3, jlong jarg4, jobject jarg4_) { - jobject jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - size_t arg2 ; - uint32_t arg3 ; - lldb::SBError *arg4 = 0 ; - lldb::addr_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg4_; - arg1 = *(lldb::SBProcess **)&jarg1; - arg2 = (size_t)jarg2; - arg3 = (uint32_t)jarg3; - arg4 = *(lldb::SBError **)&jarg4; - if (!arg4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - result = (lldb::addr_t)(arg1)->AllocateMemory(arg2,arg3,*arg4); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1DeallocateMemory(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - lldb::addr_t arg2 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (lldb::addr_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (arg1)->DeallocateMemory(arg2); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcess_1GetScriptedImplementation(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - SwigValueWrapper< lldb::SBScriptObject > result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - result = (arg1)->GetScriptedImplementation(); - *(lldb::SBScriptObject **)&jresult = new lldb::SBScriptObject(result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBProcess_1_1_1repr_1_1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBProcess *arg1 = (lldb::SBProcess *) 0 ; - std::string result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcess **)&jarg1; - result = lldb_SBProcess___repr__(arg1); - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBProcessInfo_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBProcessInfo *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBProcessInfo *)new lldb::SBProcessInfo(); - *(lldb::SBProcessInfo **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBProcessInfo_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBProcessInfo *arg1 = 0 ; - lldb::SBProcessInfo *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcessInfo **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBProcessInfo const & is null"); - return 0; - } - result = (lldb::SBProcessInfo *)new lldb::SBProcessInfo((lldb::SBProcessInfo const &)*arg1); - *(lldb::SBProcessInfo **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBProcessInfo(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBProcessInfo *arg1 = (lldb::SBProcessInfo *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBProcessInfo **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBProcessInfo_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBProcessInfo *arg1 = (lldb::SBProcessInfo *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcessInfo **)&jarg1; - result = (bool)((lldb::SBProcessInfo const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBProcessInfo_1GetName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBProcessInfo *arg1 = (lldb::SBProcessInfo *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcessInfo **)&jarg1; - result = (char *)(arg1)->GetName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcessInfo_1GetExecutableFile(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBProcessInfo *arg1 = (lldb::SBProcessInfo *) 0 ; - lldb::SBFileSpec result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcessInfo **)&jarg1; - result = (arg1)->GetExecutableFile(); - *(lldb::SBFileSpec **)&jresult = new lldb::SBFileSpec(result); - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBProcessInfo_1GetProcessID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBProcessInfo *arg1 = (lldb::SBProcessInfo *) 0 ; - lldb::pid_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcessInfo **)&jarg1; - result = (lldb::pid_t)(arg1)->GetProcessID(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcessInfo_1GetUserID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBProcessInfo *arg1 = (lldb::SBProcessInfo *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcessInfo **)&jarg1; - result = (uint32_t)(arg1)->GetUserID(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcessInfo_1GetGroupID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBProcessInfo *arg1 = (lldb::SBProcessInfo *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcessInfo **)&jarg1; - result = (uint32_t)(arg1)->GetGroupID(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBProcessInfo_1UserIDIsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBProcessInfo *arg1 = (lldb::SBProcessInfo *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcessInfo **)&jarg1; - result = (bool)(arg1)->UserIDIsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBProcessInfo_1GroupIDIsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBProcessInfo *arg1 = (lldb::SBProcessInfo *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcessInfo **)&jarg1; - result = (bool)(arg1)->GroupIDIsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcessInfo_1GetEffectiveUserID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBProcessInfo *arg1 = (lldb::SBProcessInfo *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcessInfo **)&jarg1; - result = (uint32_t)(arg1)->GetEffectiveUserID(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBProcessInfo_1GetEffectiveGroupID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBProcessInfo *arg1 = (lldb::SBProcessInfo *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcessInfo **)&jarg1; - result = (uint32_t)(arg1)->GetEffectiveGroupID(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBProcessInfo_1EffectiveUserIDIsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBProcessInfo *arg1 = (lldb::SBProcessInfo *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcessInfo **)&jarg1; - result = (bool)(arg1)->EffectiveUserIDIsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBProcessInfo_1EffectiveGroupIDIsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBProcessInfo *arg1 = (lldb::SBProcessInfo *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcessInfo **)&jarg1; - result = (bool)(arg1)->EffectiveGroupIDIsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBProcessInfo_1GetParentProcessID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBProcessInfo *arg1 = (lldb::SBProcessInfo *) 0 ; - lldb::pid_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcessInfo **)&jarg1; - result = (lldb::pid_t)(arg1)->GetParentProcessID(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBProcessInfo_1GetTriple(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBProcessInfo *arg1 = (lldb::SBProcessInfo *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBProcessInfo **)&jarg1; - result = (char *)(arg1)->GetTriple(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBQueue_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBQueue *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBQueue *)new lldb::SBQueue(); - *(lldb::SBQueue **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBQueue_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBQueue *arg1 = 0 ; - lldb::SBQueue *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBQueue **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBQueue const & is null"); - return 0; - } - result = (lldb::SBQueue *)new lldb::SBQueue((lldb::SBQueue const &)*arg1); - *(lldb::SBQueue **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBQueue(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBQueue *arg1 = (lldb::SBQueue *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBQueue **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBQueue_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBQueue *arg1 = (lldb::SBQueue *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBQueue **)&jarg1; - result = (bool)((lldb::SBQueue const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBQueue_1Clear(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBQueue *arg1 = (lldb::SBQueue *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBQueue **)&jarg1; - (arg1)->Clear(); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBQueue_1GetProcess(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBQueue *arg1 = (lldb::SBQueue *) 0 ; - lldb::SBProcess result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBQueue **)&jarg1; - result = (arg1)->GetProcess(); - *(lldb::SBProcess **)&jresult = new lldb::SBProcess(result); - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBQueue_1GetQueueID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBQueue *arg1 = (lldb::SBQueue *) 0 ; - lldb::queue_id_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBQueue **)&jarg1; - result = (lldb::queue_id_t)((lldb::SBQueue const *)arg1)->GetQueueID(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBQueue_1GetName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBQueue *arg1 = (lldb::SBQueue *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBQueue **)&jarg1; - result = (char *)((lldb::SBQueue const *)arg1)->GetName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBQueue_1GetIndexID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBQueue *arg1 = (lldb::SBQueue *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBQueue **)&jarg1; - result = (uint32_t)((lldb::SBQueue const *)arg1)->GetIndexID(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBQueue_1GetNumThreads(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBQueue *arg1 = (lldb::SBQueue *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBQueue **)&jarg1; - result = (uint32_t)(arg1)->GetNumThreads(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBQueue_1GetThreadAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBQueue *arg1 = (lldb::SBQueue *) 0 ; - uint32_t arg2 ; - lldb::SBThread result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBQueue **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (arg1)->GetThreadAtIndex(arg2); - *(lldb::SBThread **)&jresult = new lldb::SBThread(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBQueue_1GetNumPendingItems(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBQueue *arg1 = (lldb::SBQueue *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBQueue **)&jarg1; - result = (uint32_t)(arg1)->GetNumPendingItems(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBQueue_1GetPendingItemAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBQueue *arg1 = (lldb::SBQueue *) 0 ; - uint32_t arg2 ; - lldb::SBQueueItem result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBQueue **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (arg1)->GetPendingItemAtIndex(arg2); - *(lldb::SBQueueItem **)&jresult = new lldb::SBQueueItem(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBQueue_1GetNumRunningItems(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBQueue *arg1 = (lldb::SBQueue *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBQueue **)&jarg1; - result = (uint32_t)(arg1)->GetNumRunningItems(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBQueue_1GetKind(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBQueue *arg1 = (lldb::SBQueue *) 0 ; - lldb::QueueKind result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBQueue **)&jarg1; - result = (lldb::QueueKind)(arg1)->GetKind(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBQueueItem(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBQueueItem *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBQueueItem *)new lldb::SBQueueItem(); - *(lldb::SBQueueItem **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBQueueItem(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBQueueItem *arg1 = (lldb::SBQueueItem *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBQueueItem **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBQueueItem_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBQueueItem *arg1 = (lldb::SBQueueItem *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBQueueItem **)&jarg1; - result = (bool)((lldb::SBQueueItem const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBQueueItem_1Clear(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBQueueItem *arg1 = (lldb::SBQueueItem *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBQueueItem **)&jarg1; - (arg1)->Clear(); -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBQueueItem_1GetKind(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBQueueItem *arg1 = (lldb::SBQueueItem *) 0 ; - lldb::QueueItemKind result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBQueueItem **)&jarg1; - result = (lldb::QueueItemKind)((lldb::SBQueueItem const *)arg1)->GetKind(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBQueueItem_1SetKind(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - lldb::SBQueueItem *arg1 = (lldb::SBQueueItem *) 0 ; - lldb::QueueItemKind arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBQueueItem **)&jarg1; - arg2 = (lldb::QueueItemKind)jarg2; - (arg1)->SetKind(arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBQueueItem_1GetAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBQueueItem *arg1 = (lldb::SBQueueItem *) 0 ; - lldb::SBAddress result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBQueueItem **)&jarg1; - result = ((lldb::SBQueueItem const *)arg1)->GetAddress(); - *(lldb::SBAddress **)&jresult = new lldb::SBAddress(result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBQueueItem_1SetAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBQueueItem *arg1 = (lldb::SBQueueItem *) 0 ; - lldb::SBAddress arg2 ; - lldb::SBAddress *argp2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBQueueItem **)&jarg1; - argp2 = *(lldb::SBAddress **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBAddress"); - return ; - } - arg2 = *argp2; - (arg1)->SetAddress(arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBQueueItem_1GetExtendedBacktraceThread(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBQueueItem *arg1 = (lldb::SBQueueItem *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBThread result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBQueueItem **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (arg1)->GetExtendedBacktraceThread((char const *)arg2); - *(lldb::SBThread **)&jresult = new lldb::SBThread(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBReproducer_1Capture(JNIEnv *jenv, jclass jcls, jstring jarg1) { - jstring jresult = 0 ; - char *arg1 = (char *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - result = (char *)lldb::SBReproducer::Capture((char const *)arg1); - if (result) jresult = jenv->NewStringUTF((const char *)result); - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBReproducer_1PassiveReplay(JNIEnv *jenv, jclass jcls, jstring jarg1) { - jstring jresult = 0 ; - char *arg1 = (char *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - result = (char *)lldb::SBReproducer::PassiveReplay((char const *)arg1); - if (result) jresult = jenv->NewStringUTF((const char *)result); - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBReproducer_1SetAutoGenerate(JNIEnv *jenv, jclass jcls, jboolean jarg1) { - jboolean jresult = 0 ; - bool arg1 ; - bool result; - - (void)jenv; - (void)jcls; - arg1 = jarg1 ? true : false; - result = (bool)lldb::SBReproducer::SetAutoGenerate(arg1); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBReproducer_1SetWorkingDirectory(JNIEnv *jenv, jclass jcls, jstring jarg1) { - char *arg1 = (char *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return ; - } - lldb::SBReproducer::SetWorkingDirectory((char const *)arg1); - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBReproducer(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBReproducer *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBReproducer *)new lldb::SBReproducer(); - *(lldb::SBReproducer **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBReproducer(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBReproducer *arg1 = (lldb::SBReproducer *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBReproducer **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBScriptObject_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jint jarg2) { - jlong jresult = 0 ; - lldb::ScriptObjectPtr arg1 = (lldb::ScriptObjectPtr) (lldb::ScriptObjectPtr)0 ; - lldb::ScriptLanguage arg2 ; - lldb::SBScriptObject *result = 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::ScriptObjectPtr *)&jarg1; - arg2 = (lldb::ScriptLanguage)jarg2; - result = (lldb::SBScriptObject *)new lldb::SBScriptObject(arg1,arg2); - *(lldb::SBScriptObject **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBScriptObject_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBScriptObject *arg1 = 0 ; - lldb::SBScriptObject *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBScriptObject **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBScriptObject const & is null"); - return 0; - } - result = (lldb::SBScriptObject *)new lldb::SBScriptObject((lldb::SBScriptObject const &)*arg1); - *(lldb::SBScriptObject **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBScriptObject(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBScriptObject *arg1 = (lldb::SBScriptObject *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBScriptObject **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBScriptObject_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBScriptObject *arg1 = (lldb::SBScriptObject *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBScriptObject **)&jarg1; - result = (bool)((lldb::SBScriptObject const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBScriptObject_1GetPointer(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBScriptObject *arg1 = (lldb::SBScriptObject *) 0 ; - lldb::ScriptObjectPtr result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBScriptObject **)&jarg1; - result = (lldb::ScriptObjectPtr)((lldb::SBScriptObject const *)arg1)->GetPointer(); - *(lldb::ScriptObjectPtr *)&jresult = result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBScriptObject_1GetLanguage(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBScriptObject *arg1 = (lldb::SBScriptObject *) 0 ; - lldb::ScriptLanguage result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBScriptObject **)&jarg1; - result = (lldb::ScriptLanguage)((lldb::SBScriptObject const *)arg1)->GetLanguage(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBSection_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBSection *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBSection *)new lldb::SBSection(); - *(lldb::SBSection **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBSection_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBSection *arg1 = 0 ; - lldb::SBSection *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSection **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBSection const & is null"); - return 0; - } - result = (lldb::SBSection *)new lldb::SBSection((lldb::SBSection const &)*arg1); - *(lldb::SBSection **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBSection(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBSection *arg1 = (lldb::SBSection *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBSection **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBSection_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBSection *arg1 = (lldb::SBSection *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSection **)&jarg1; - result = (bool)((lldb::SBSection const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBSection_1GetName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBSection *arg1 = (lldb::SBSection *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSection **)&jarg1; - result = (char *)(arg1)->GetName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBSection_1GetParent(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBSection *arg1 = (lldb::SBSection *) 0 ; - lldb::SBSection result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSection **)&jarg1; - result = (arg1)->GetParent(); - *(lldb::SBSection **)&jresult = new lldb::SBSection(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBSection_1FindSubSection(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBSection *arg1 = (lldb::SBSection *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBSection result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSection **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (arg1)->FindSubSection((char const *)arg2); - *(lldb::SBSection **)&jresult = new lldb::SBSection(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBSection_1GetNumSubSections(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBSection *arg1 = (lldb::SBSection *) 0 ; - size_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSection **)&jarg1; - result = (arg1)->GetNumSubSections(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBSection_1GetSubSectionAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBSection *arg1 = (lldb::SBSection *) 0 ; - size_t arg2 ; - lldb::SBSection result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSection **)&jarg1; - arg2 = (size_t)jarg2; - result = (arg1)->GetSubSectionAtIndex(arg2); - *(lldb::SBSection **)&jresult = new lldb::SBSection(result); - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBSection_1GetFileAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBSection *arg1 = (lldb::SBSection *) 0 ; - lldb::addr_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSection **)&jarg1; - result = (lldb::addr_t)(arg1)->GetFileAddress(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBSection_1GetLoadAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jobject jresult = 0 ; - lldb::SBSection *arg1 = (lldb::SBSection *) 0 ; - lldb::SBTarget *arg2 = 0 ; - lldb::addr_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBSection **)&jarg1; - arg2 = *(lldb::SBTarget **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBTarget & is null"); - return 0; - } - result = (lldb::addr_t)(arg1)->GetLoadAddress(*arg2); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBSection_1GetByteSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBSection *arg1 = (lldb::SBSection *) 0 ; - lldb::addr_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSection **)&jarg1; - result = (lldb::addr_t)(arg1)->GetByteSize(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBSection_1GetFileOffset(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBSection *arg1 = (lldb::SBSection *) 0 ; - uint64_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSection **)&jarg1; - result = (uint64_t)(arg1)->GetFileOffset(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBSection_1GetFileByteSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBSection *arg1 = (lldb::SBSection *) 0 ; - uint64_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSection **)&jarg1; - result = (uint64_t)(arg1)->GetFileByteSize(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBSection_1GetSectionData_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBSection *arg1 = (lldb::SBSection *) 0 ; - lldb::SBData result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSection **)&jarg1; - result = (arg1)->GetSectionData(); - *(lldb::SBData **)&jresult = new lldb::SBData(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBSection_1GetSectionData_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2, jobject jarg3) { - jlong jresult = 0 ; - lldb::SBSection *arg1 = (lldb::SBSection *) 0 ; - uint64_t arg2 ; - uint64_t arg3 ; - lldb::SBData result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSection **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (uint64_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg3); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg3, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg3 = 0; - if (sz > 0) { - arg3 = (uint64_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (arg1)->GetSectionData(arg2,arg3); - *(lldb::SBData **)&jresult = new lldb::SBData(result); - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBSection_1GetSectionType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBSection *arg1 = (lldb::SBSection *) 0 ; - lldb::SectionType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSection **)&jarg1; - result = (lldb::SectionType)(arg1)->GetSectionType(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBSection_1GetPermissions(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBSection *arg1 = (lldb::SBSection *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSection **)&jarg1; - result = (uint32_t)((lldb::SBSection const *)arg1)->GetPermissions(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBSection_1GetTargetByteSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBSection *arg1 = (lldb::SBSection *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSection **)&jarg1; - result = (uint32_t)(arg1)->GetTargetByteSize(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBSection_1GetAlignment(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBSection *arg1 = (lldb::SBSection *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSection **)&jarg1; - result = (uint32_t)(arg1)->GetAlignment(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBSection_1GetDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBSection *arg1 = (lldb::SBSection *) 0 ; - lldb::SBStream *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBSection **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - result = (bool)(arg1)->GetDescription(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBSection_1_1_1repr_1_1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBSection *arg1 = (lldb::SBSection *) 0 ; - std::string result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSection **)&jarg1; - result = lldb_SBSection___repr__(arg1); - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBSourceManager_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBDebugger *arg1 = 0 ; - lldb::SBSourceManager *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBDebugger **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBDebugger const & is null"); - return 0; - } - result = (lldb::SBSourceManager *)new lldb::SBSourceManager((lldb::SBDebugger const &)*arg1); - *(lldb::SBSourceManager **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBSourceManager_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = 0 ; - lldb::SBSourceManager *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBTarget const & is null"); - return 0; - } - result = (lldb::SBSourceManager *)new lldb::SBSourceManager((lldb::SBTarget const &)*arg1); - *(lldb::SBSourceManager **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBSourceManager_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBSourceManager *arg1 = 0 ; - lldb::SBSourceManager *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSourceManager **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBSourceManager const & is null"); - return 0; - } - result = (lldb::SBSourceManager *)new lldb::SBSourceManager((lldb::SBSourceManager const &)*arg1); - *(lldb::SBSourceManager **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBSourceManager(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBSourceManager *arg1 = (lldb::SBSourceManager *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBSourceManager **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBSourceManager_1DisplaySourceLinesWithLineNumbers(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jlong jarg4, jlong jarg5, jstring jarg6, jlong jarg7, jobject jarg7_) { - jlong jresult = 0 ; - lldb::SBSourceManager *arg1 = (lldb::SBSourceManager *) 0 ; - lldb::SBFileSpec *arg2 = 0 ; - uint32_t arg3 ; - uint32_t arg4 ; - uint32_t arg5 ; - char *arg6 = (char *) 0 ; - lldb::SBStream *arg7 = 0 ; - size_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg7_; - arg1 = *(lldb::SBSourceManager **)&jarg1; - arg2 = *(lldb::SBFileSpec **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec const & is null"); - return 0; - } - arg3 = (uint32_t)jarg3; - arg4 = (uint32_t)jarg4; - arg5 = (uint32_t)jarg5; - arg6 = 0; - if (jarg6) { - arg6 = (char *)jenv->GetStringUTFChars(jarg6, 0); - if (!arg6) return 0; - } - arg7 = *(lldb::SBStream **)&jarg7; - if (!arg7) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - result = (arg1)->DisplaySourceLinesWithLineNumbers((lldb::SBFileSpec const &)*arg2,arg3,arg4,arg5,(char const *)arg6,*arg7); - jresult = (jlong)result; - if (arg6) jenv->ReleaseStringUTFChars(jarg6, (const char *)arg6); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBSourceManager_1DisplaySourceLinesWithLineNumbersAndColumn(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jlong jarg4, jlong jarg5, jlong jarg6, jstring jarg7, jlong jarg8, jobject jarg8_) { - jlong jresult = 0 ; - lldb::SBSourceManager *arg1 = (lldb::SBSourceManager *) 0 ; - lldb::SBFileSpec *arg2 = 0 ; - uint32_t arg3 ; - uint32_t arg4 ; - uint32_t arg5 ; - uint32_t arg6 ; - char *arg7 = (char *) 0 ; - lldb::SBStream *arg8 = 0 ; - size_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg8_; - arg1 = *(lldb::SBSourceManager **)&jarg1; - arg2 = *(lldb::SBFileSpec **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec const & is null"); - return 0; - } - arg3 = (uint32_t)jarg3; - arg4 = (uint32_t)jarg4; - arg5 = (uint32_t)jarg5; - arg6 = (uint32_t)jarg6; - arg7 = 0; - if (jarg7) { - arg7 = (char *)jenv->GetStringUTFChars(jarg7, 0); - if (!arg7) return 0; - } - arg8 = *(lldb::SBStream **)&jarg8; - if (!arg8) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - result = (arg1)->DisplaySourceLinesWithLineNumbersAndColumn((lldb::SBFileSpec const &)*arg2,arg3,arg4,arg5,arg6,(char const *)arg7,*arg8); - jresult = (jlong)result; - if (arg7) jenv->ReleaseStringUTFChars(jarg7, (const char *)arg7); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBStream(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBStream *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBStream *)new lldb::SBStream(); - *(lldb::SBStream **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBStream(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBStream *arg1 = (lldb::SBStream *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBStream **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBStream_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBStream *arg1 = (lldb::SBStream *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBStream **)&jarg1; - result = (bool)((lldb::SBStream const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBStream_1GetData(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBStream *arg1 = (lldb::SBStream *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBStream **)&jarg1; - result = (char *)(arg1)->GetData(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBStream_1GetSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBStream *arg1 = (lldb::SBStream *) 0 ; - size_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBStream **)&jarg1; - result = (arg1)->GetSize(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBStream_1Print(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBStream *arg1 = (lldb::SBStream *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBStream **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->Print((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBStream_1RedirectToFile_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jboolean jarg3) { - lldb::SBStream *arg1 = (lldb::SBStream *) 0 ; - char *arg2 = (char *) 0 ; - bool arg3 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBStream **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - arg3 = jarg3 ? true : false; - (arg1)->RedirectToFile((char const *)arg2,arg3); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBStream_1RedirectToFile_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBStream *arg1 = (lldb::SBStream *) 0 ; - lldb::SBFile arg2 ; - lldb::SBFile *argp2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBStream **)&jarg1; - argp2 = *(lldb::SBFile **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBFile"); - return ; - } - arg2 = *argp2; - (arg1)->RedirectToFile(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBStream_1RedirectToFile_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - lldb::SBStream *arg1 = (lldb::SBStream *) 0 ; - SwigValueWrapper< std::shared_ptr< lldb_private::File > > arg2 ; - lldb::FileSP *argp2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBStream **)&jarg1; - argp2 = *(lldb::FileSP **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::FileSP"); - return ; - } - arg2 = *argp2; - (arg1)->RedirectToFile(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBStream_1RedirectToFileDescriptor(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jboolean jarg3) { - lldb::SBStream *arg1 = (lldb::SBStream *) 0 ; - int arg2 ; - bool arg3 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBStream **)&jarg1; - arg2 = (int)jarg2; - arg3 = jarg3 ? true : false; - (arg1)->RedirectToFileDescriptor(arg2,arg3); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBStream_1Clear(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBStream *arg1 = (lldb::SBStream *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBStream **)&jarg1; - (arg1)->Clear(); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBStream_1RedirectToFileHandle(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jboolean jarg3) { - lldb::SBStream *arg1 = (lldb::SBStream *) 0 ; - SwigValueWrapper< std::shared_ptr< lldb_private::File > > arg2 ; - bool arg3 ; - lldb::FileSP *argp2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBStream **)&jarg1; - argp2 = *(lldb::FileSP **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::FileSP"); - return ; - } - arg2 = *argp2; - arg3 = jarg3 ? true : false; - lldb_SBStream_RedirectToFileHandle(arg1,SWIG_STD_MOVE(arg2),arg3); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBStringList_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBStringList *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBStringList *)new lldb::SBStringList(); - *(lldb::SBStringList **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBStringList_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBStringList *arg1 = 0 ; - lldb::SBStringList *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBStringList **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStringList const & is null"); - return 0; - } - result = (lldb::SBStringList *)new lldb::SBStringList((lldb::SBStringList const &)*arg1); - *(lldb::SBStringList **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBStringList(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBStringList *arg1 = (lldb::SBStringList *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBStringList **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBStringList_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBStringList *arg1 = (lldb::SBStringList *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBStringList **)&jarg1; - result = (bool)((lldb::SBStringList const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBStringList_1AppendString(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBStringList *arg1 = (lldb::SBStringList *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBStringList **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->AppendString((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBStringList_1AppendList_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobjectArray jarg2, jint jarg3) { - lldb::SBStringList *arg1 = (lldb::SBStringList *) 0 ; - char **arg2 = (char **) 0 ; - int arg3 ; - jint size2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBStringList **)&jarg1; - { - int i = 0; - if (jarg2) { - size2 = jenv->GetArrayLength(jarg2); - - arg2 = new char*[size2+1]; - - - - for (i = 0; iGetObjectArrayElement(jarg2, i); - const char *c_string = jenv->GetStringUTFChars(j_string, 0); - - arg2[i] = new char [strlen(c_string)+1]; - - - - strcpy(arg2[i], c_string); - jenv->ReleaseStringUTFChars(j_string, c_string); - jenv->DeleteLocalRef(j_string); - } - arg2[i] = 0; - } else { - arg2 = 0; - size2 = 0; - } - } - arg3 = (int)jarg3; - (arg1)->AppendList((char const **)arg2,arg3); - { - int i; - for (i=0; iAppendList((lldb::SBStringList const &)*arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBStringList_1GetSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBStringList *arg1 = (lldb::SBStringList *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBStringList **)&jarg1; - result = (uint32_t)((lldb::SBStringList const *)arg1)->GetSize(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBStringList_1GetStringAtIndex_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jstring jresult = 0 ; - lldb::SBStringList *arg1 = (lldb::SBStringList *) 0 ; - size_t arg2 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBStringList **)&jarg1; - arg2 = (size_t)jarg2; - result = (char *)(arg1)->GetStringAtIndex(arg2); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBStringList_1Clear(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBStringList *arg1 = (lldb::SBStringList *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBStringList **)&jarg1; - (arg1)->Clear(); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBStructuredData_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBStructuredData *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBStructuredData *)new lldb::SBStructuredData(); - *(lldb::SBStructuredData **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBStructuredData_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBStructuredData *arg1 = 0 ; - lldb::SBStructuredData *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBStructuredData **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStructuredData const & is null"); - return 0; - } - result = (lldb::SBStructuredData *)new lldb::SBStructuredData((lldb::SBStructuredData const &)*arg1); - *(lldb::SBStructuredData **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBStructuredData_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - SwigValueWrapper< lldb::SBScriptObject > arg1 ; - lldb::SBDebugger *arg2 = 0 ; - lldb::SBScriptObject const *argp1 ; - lldb::SBStructuredData *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - argp1 = *(lldb::SBScriptObject **)&jarg1; - if (!argp1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBScriptObject const"); - return 0; - } - arg1 = *argp1; - arg2 = *(lldb::SBDebugger **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBDebugger const & is null"); - return 0; - } - result = (lldb::SBStructuredData *)new lldb::SBStructuredData(arg1,(lldb::SBDebugger const &)*arg2); - *(lldb::SBStructuredData **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBStructuredData(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBStructuredData *arg1 = (lldb::SBStructuredData *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBStructuredData **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBStructuredData_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBStructuredData *arg1 = (lldb::SBStructuredData *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBStructuredData **)&jarg1; - result = (bool)((lldb::SBStructuredData const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBStructuredData_1SetFromJSON_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBStructuredData *arg1 = (lldb::SBStructuredData *) 0 ; - lldb::SBStream *arg2 = 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBStructuredData **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - result = (arg1)->SetFromJSON(*arg2); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBStructuredData_1SetFromJSON_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBStructuredData *arg1 = (lldb::SBStructuredData *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBStructuredData **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (arg1)->SetFromJSON((char const *)arg2); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBStructuredData_1Clear(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBStructuredData *arg1 = (lldb::SBStructuredData *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBStructuredData **)&jarg1; - (arg1)->Clear(); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBStructuredData_1GetAsJSON(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBStructuredData *arg1 = (lldb::SBStructuredData *) 0 ; - lldb::SBStream *arg2 = 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBStructuredData **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - result = ((lldb::SBStructuredData const *)arg1)->GetAsJSON(*arg2); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBStructuredData_1GetDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBStructuredData *arg1 = (lldb::SBStructuredData *) 0 ; - lldb::SBStream *arg2 = 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBStructuredData **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - result = ((lldb::SBStructuredData const *)arg1)->GetDescription(*arg2); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBStructuredData_1GetType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBStructuredData *arg1 = (lldb::SBStructuredData *) 0 ; - lldb::StructuredDataType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBStructuredData **)&jarg1; - result = (lldb::StructuredDataType)((lldb::SBStructuredData const *)arg1)->GetType(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBStructuredData_1GetSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBStructuredData *arg1 = (lldb::SBStructuredData *) 0 ; - size_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBStructuredData **)&jarg1; - result = ((lldb::SBStructuredData const *)arg1)->GetSize(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBStructuredData_1GetKeys(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBStructuredData *arg1 = (lldb::SBStructuredData *) 0 ; - lldb::SBStringList *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBStructuredData **)&jarg1; - arg2 = *(lldb::SBStringList **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStringList & is null"); - return 0; - } - result = (bool)((lldb::SBStructuredData const *)arg1)->GetKeys(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBStructuredData_1GetValueForKey(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBStructuredData *arg1 = (lldb::SBStructuredData *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBStructuredData result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBStructuredData **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = ((lldb::SBStructuredData const *)arg1)->GetValueForKey((char const *)arg2); - *(lldb::SBStructuredData **)&jresult = new lldb::SBStructuredData(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBStructuredData_1GetItemAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBStructuredData *arg1 = (lldb::SBStructuredData *) 0 ; - size_t arg2 ; - lldb::SBStructuredData result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBStructuredData **)&jarg1; - arg2 = (size_t)jarg2; - result = ((lldb::SBStructuredData const *)arg1)->GetItemAtIndex(arg2); - *(lldb::SBStructuredData **)&jresult = new lldb::SBStructuredData(result); - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBStructuredData_1GetUnsignedIntegerValue_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2) { - jobject jresult = 0 ; - lldb::SBStructuredData *arg1 = (lldb::SBStructuredData *) 0 ; - uint64_t arg2 ; - uint64_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBStructuredData **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (uint64_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (uint64_t)((lldb::SBStructuredData const *)arg1)->GetUnsignedIntegerValue(arg2); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBStructuredData_1GetUnsignedIntegerValue_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBStructuredData *arg1 = (lldb::SBStructuredData *) 0 ; - uint64_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBStructuredData **)&jarg1; - result = (uint64_t)((lldb::SBStructuredData const *)arg1)->GetUnsignedIntegerValue(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBStructuredData_1GetSignedIntegerValue_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBStructuredData *arg1 = (lldb::SBStructuredData *) 0 ; - int64_t arg2 ; - int64_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBStructuredData **)&jarg1; - arg2 = (int64_t)jarg2; - result = (int64_t)((lldb::SBStructuredData const *)arg1)->GetSignedIntegerValue(arg2); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBStructuredData_1GetSignedIntegerValue_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBStructuredData *arg1 = (lldb::SBStructuredData *) 0 ; - int64_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBStructuredData **)&jarg1; - result = (int64_t)((lldb::SBStructuredData const *)arg1)->GetSignedIntegerValue(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBStructuredData_1GetIntegerValue_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2) { - jobject jresult = 0 ; - lldb::SBStructuredData *arg1 = (lldb::SBStructuredData *) 0 ; - uint64_t arg2 ; - uint64_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBStructuredData **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (uint64_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (uint64_t)((lldb::SBStructuredData const *)arg1)->GetIntegerValue(arg2); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBStructuredData_1GetIntegerValue_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBStructuredData *arg1 = (lldb::SBStructuredData *) 0 ; - uint64_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBStructuredData **)&jarg1; - result = (uint64_t)((lldb::SBStructuredData const *)arg1)->GetIntegerValue(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jdouble JNICALL Java_SWIG_lldbJNI_SBStructuredData_1GetFloatValue_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jdouble jarg2) { - jdouble jresult = 0 ; - lldb::SBStructuredData *arg1 = (lldb::SBStructuredData *) 0 ; - double arg2 ; - double result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBStructuredData **)&jarg1; - arg2 = (double)jarg2; - result = (double)((lldb::SBStructuredData const *)arg1)->GetFloatValue(arg2); - jresult = (jdouble)result; - return jresult; -} - - -SWIGEXPORT jdouble JNICALL Java_SWIG_lldbJNI_SBStructuredData_1GetFloatValue_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jdouble jresult = 0 ; - lldb::SBStructuredData *arg1 = (lldb::SBStructuredData *) 0 ; - double result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBStructuredData **)&jarg1; - result = (double)((lldb::SBStructuredData const *)arg1)->GetFloatValue(); - jresult = (jdouble)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBStructuredData_1GetBooleanValue_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - jboolean jresult = 0 ; - lldb::SBStructuredData *arg1 = (lldb::SBStructuredData *) 0 ; - bool arg2 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBStructuredData **)&jarg1; - arg2 = jarg2 ? true : false; - result = (bool)((lldb::SBStructuredData const *)arg1)->GetBooleanValue(arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBStructuredData_1GetBooleanValue_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBStructuredData *arg1 = (lldb::SBStructuredData *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBStructuredData **)&jarg1; - result = (bool)((lldb::SBStructuredData const *)arg1)->GetBooleanValue(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBStructuredData_1GetStringValue(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3) { - jlong jresult = 0 ; - lldb::SBStructuredData *arg1 = (lldb::SBStructuredData *) 0 ; - char *arg2 = (char *) 0 ; - size_t arg3 ; - size_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBStructuredData **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = (size_t)jarg3; - result = ((lldb::SBStructuredData const *)arg1)->GetStringValue(arg2,arg3); - jresult = (jlong)result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBStructuredData_1GetGenericValue(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBStructuredData *arg1 = (lldb::SBStructuredData *) 0 ; - SwigValueWrapper< lldb::SBScriptObject > result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBStructuredData **)&jarg1; - result = ((lldb::SBStructuredData const *)arg1)->GetGenericValue(); - *(lldb::SBScriptObject **)&jresult = new lldb::SBScriptObject(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBSymbol_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBSymbol *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBSymbol *)new lldb::SBSymbol(); - *(lldb::SBSymbol **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBSymbol(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBSymbol *arg1 = (lldb::SBSymbol *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBSymbol **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBSymbol_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBSymbol *arg1 = 0 ; - lldb::SBSymbol *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSymbol **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBSymbol const & is null"); - return 0; - } - result = (lldb::SBSymbol *)new lldb::SBSymbol((lldb::SBSymbol const &)*arg1); - *(lldb::SBSymbol **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBSymbol_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBSymbol *arg1 = (lldb::SBSymbol *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSymbol **)&jarg1; - result = (bool)((lldb::SBSymbol const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBSymbol_1GetName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBSymbol *arg1 = (lldb::SBSymbol *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSymbol **)&jarg1; - result = (char *)((lldb::SBSymbol const *)arg1)->GetName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBSymbol_1GetDisplayName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBSymbol *arg1 = (lldb::SBSymbol *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSymbol **)&jarg1; - result = (char *)((lldb::SBSymbol const *)arg1)->GetDisplayName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBSymbol_1GetMangledName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBSymbol *arg1 = (lldb::SBSymbol *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSymbol **)&jarg1; - result = (char *)((lldb::SBSymbol const *)arg1)->GetMangledName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBSymbol_1GetInstructions_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBSymbol *arg1 = (lldb::SBSymbol *) 0 ; - lldb::SBTarget arg2 ; - lldb::SBTarget *argp2 ; - lldb::SBInstructionList result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBSymbol **)&jarg1; - argp2 = *(lldb::SBTarget **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBTarget"); - return 0; - } - arg2 = *argp2; - result = (arg1)->GetInstructions(arg2); - *(lldb::SBInstructionList **)&jresult = new lldb::SBInstructionList(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBSymbol_1GetInstructions_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jstring jarg3) { - jlong jresult = 0 ; - lldb::SBSymbol *arg1 = (lldb::SBSymbol *) 0 ; - lldb::SBTarget arg2 ; - char *arg3 = (char *) 0 ; - lldb::SBTarget *argp2 ; - lldb::SBInstructionList result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBSymbol **)&jarg1; - argp2 = *(lldb::SBTarget **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBTarget"); - return 0; - } - arg2 = *argp2; - arg3 = 0; - if (jarg3) { - arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); - if (!arg3) return 0; - } - result = (arg1)->GetInstructions(arg2,(char const *)arg3); - *(lldb::SBInstructionList **)&jresult = new lldb::SBInstructionList(result); - if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBSymbol_1GetStartAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBSymbol *arg1 = (lldb::SBSymbol *) 0 ; - lldb::SBAddress result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSymbol **)&jarg1; - result = (arg1)->GetStartAddress(); - *(lldb::SBAddress **)&jresult = new lldb::SBAddress(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBSymbol_1GetEndAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBSymbol *arg1 = (lldb::SBSymbol *) 0 ; - lldb::SBAddress result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSymbol **)&jarg1; - result = (arg1)->GetEndAddress(); - *(lldb::SBAddress **)&jresult = new lldb::SBAddress(result); - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBSymbol_1GetValue(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBSymbol *arg1 = (lldb::SBSymbol *) 0 ; - uint64_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSymbol **)&jarg1; - result = (uint64_t)(arg1)->GetValue(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBSymbol_1GetSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBSymbol *arg1 = (lldb::SBSymbol *) 0 ; - uint64_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSymbol **)&jarg1; - result = (uint64_t)(arg1)->GetSize(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBSymbol_1GetPrologueByteSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBSymbol *arg1 = (lldb::SBSymbol *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSymbol **)&jarg1; - result = (uint32_t)(arg1)->GetPrologueByteSize(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBSymbol_1GetType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBSymbol *arg1 = (lldb::SBSymbol *) 0 ; - lldb::SymbolType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSymbol **)&jarg1; - result = (lldb::SymbolType)(arg1)->GetType(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBSymbol_1GetDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBSymbol *arg1 = (lldb::SBSymbol *) 0 ; - lldb::SBStream *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBSymbol **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - result = (bool)(arg1)->GetDescription(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBSymbol_1IsExternal(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBSymbol *arg1 = (lldb::SBSymbol *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSymbol **)&jarg1; - result = (bool)(arg1)->IsExternal(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBSymbol_1IsSynthetic(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBSymbol *arg1 = (lldb::SBSymbol *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSymbol **)&jarg1; - result = (bool)(arg1)->IsSynthetic(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBSymbol_1_1_1repr_1_1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBSymbol *arg1 = (lldb::SBSymbol *) 0 ; - std::string result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSymbol **)&jarg1; - result = lldb_SBSymbol___repr__(arg1); - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBSymbolContext_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBSymbolContext *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBSymbolContext *)new lldb::SBSymbolContext(); - *(lldb::SBSymbolContext **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBSymbolContext_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBSymbolContext *arg1 = 0 ; - lldb::SBSymbolContext *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSymbolContext **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBSymbolContext const & is null"); - return 0; - } - result = (lldb::SBSymbolContext *)new lldb::SBSymbolContext((lldb::SBSymbolContext const &)*arg1); - *(lldb::SBSymbolContext **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBSymbolContext(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBSymbolContext *arg1 = (lldb::SBSymbolContext *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBSymbolContext **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBSymbolContext_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBSymbolContext *arg1 = (lldb::SBSymbolContext *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSymbolContext **)&jarg1; - result = (bool)((lldb::SBSymbolContext const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBSymbolContext_1GetModule(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBSymbolContext *arg1 = (lldb::SBSymbolContext *) 0 ; - lldb::SBModule result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSymbolContext **)&jarg1; - result = (arg1)->GetModule(); - *(lldb::SBModule **)&jresult = new lldb::SBModule(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBSymbolContext_1GetCompileUnit(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBSymbolContext *arg1 = (lldb::SBSymbolContext *) 0 ; - lldb::SBCompileUnit result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSymbolContext **)&jarg1; - result = (arg1)->GetCompileUnit(); - *(lldb::SBCompileUnit **)&jresult = new lldb::SBCompileUnit(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBSymbolContext_1GetFunction(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBSymbolContext *arg1 = (lldb::SBSymbolContext *) 0 ; - lldb::SBFunction result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSymbolContext **)&jarg1; - result = (arg1)->GetFunction(); - *(lldb::SBFunction **)&jresult = new lldb::SBFunction(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBSymbolContext_1GetBlock(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBSymbolContext *arg1 = (lldb::SBSymbolContext *) 0 ; - lldb::SBBlock result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSymbolContext **)&jarg1; - result = (arg1)->GetBlock(); - *(lldb::SBBlock **)&jresult = new lldb::SBBlock(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBSymbolContext_1GetLineEntry(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBSymbolContext *arg1 = (lldb::SBSymbolContext *) 0 ; - lldb::SBLineEntry result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSymbolContext **)&jarg1; - result = (arg1)->GetLineEntry(); - *(lldb::SBLineEntry **)&jresult = new lldb::SBLineEntry(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBSymbolContext_1GetSymbol(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBSymbolContext *arg1 = (lldb::SBSymbolContext *) 0 ; - lldb::SBSymbol result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSymbolContext **)&jarg1; - result = (arg1)->GetSymbol(); - *(lldb::SBSymbol **)&jresult = new lldb::SBSymbol(result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBSymbolContext_1SetModule(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBSymbolContext *arg1 = (lldb::SBSymbolContext *) 0 ; - lldb::SBModule arg2 ; - lldb::SBModule *argp2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBSymbolContext **)&jarg1; - argp2 = *(lldb::SBModule **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBModule"); - return ; - } - arg2 = *argp2; - (arg1)->SetModule(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBSymbolContext_1SetCompileUnit(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBSymbolContext *arg1 = (lldb::SBSymbolContext *) 0 ; - lldb::SBCompileUnit arg2 ; - lldb::SBCompileUnit *argp2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBSymbolContext **)&jarg1; - argp2 = *(lldb::SBCompileUnit **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBCompileUnit"); - return ; - } - arg2 = *argp2; - (arg1)->SetCompileUnit(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBSymbolContext_1SetFunction(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBSymbolContext *arg1 = (lldb::SBSymbolContext *) 0 ; - lldb::SBFunction arg2 ; - lldb::SBFunction *argp2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBSymbolContext **)&jarg1; - argp2 = *(lldb::SBFunction **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBFunction"); - return ; - } - arg2 = *argp2; - (arg1)->SetFunction(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBSymbolContext_1SetBlock(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBSymbolContext *arg1 = (lldb::SBSymbolContext *) 0 ; - lldb::SBBlock arg2 ; - lldb::SBBlock *argp2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBSymbolContext **)&jarg1; - argp2 = *(lldb::SBBlock **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBBlock"); - return ; - } - arg2 = *argp2; - (arg1)->SetBlock(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBSymbolContext_1SetLineEntry(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBSymbolContext *arg1 = (lldb::SBSymbolContext *) 0 ; - lldb::SBLineEntry arg2 ; - lldb::SBLineEntry *argp2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBSymbolContext **)&jarg1; - argp2 = *(lldb::SBLineEntry **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBLineEntry"); - return ; - } - arg2 = *argp2; - (arg1)->SetLineEntry(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBSymbolContext_1SetSymbol(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBSymbolContext *arg1 = (lldb::SBSymbolContext *) 0 ; - lldb::SBSymbol arg2 ; - lldb::SBSymbol *argp2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBSymbolContext **)&jarg1; - argp2 = *(lldb::SBSymbol **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBSymbol"); - return ; - } - arg2 = *argp2; - (arg1)->SetSymbol(arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBSymbolContext_1GetParentOfInlinedScope(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_) { - jlong jresult = 0 ; - lldb::SBSymbolContext *arg1 = (lldb::SBSymbolContext *) 0 ; - lldb::SBAddress *arg2 = 0 ; - lldb::SBAddress *arg3 = 0 ; - lldb::SBSymbolContext result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - arg1 = *(lldb::SBSymbolContext **)&jarg1; - arg2 = *(lldb::SBAddress **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBAddress const & is null"); - return 0; - } - arg3 = *(lldb::SBAddress **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBAddress & is null"); - return 0; - } - result = ((lldb::SBSymbolContext const *)arg1)->GetParentOfInlinedScope((lldb::SBAddress const &)*arg2,*arg3); - *(lldb::SBSymbolContext **)&jresult = new lldb::SBSymbolContext(result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBSymbolContext_1GetDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBSymbolContext *arg1 = (lldb::SBSymbolContext *) 0 ; - lldb::SBStream *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBSymbolContext **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - result = (bool)(arg1)->GetDescription(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBSymbolContext_1_1_1repr_1_1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBSymbolContext *arg1 = (lldb::SBSymbolContext *) 0 ; - std::string result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSymbolContext **)&jarg1; - result = lldb_SBSymbolContext___repr__(arg1); - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBSymbolContextList_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBSymbolContextList *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBSymbolContextList *)new lldb::SBSymbolContextList(); - *(lldb::SBSymbolContextList **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBSymbolContextList_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBSymbolContextList *arg1 = 0 ; - lldb::SBSymbolContextList *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSymbolContextList **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBSymbolContextList const & is null"); - return 0; - } - result = (lldb::SBSymbolContextList *)new lldb::SBSymbolContextList((lldb::SBSymbolContextList const &)*arg1); - *(lldb::SBSymbolContextList **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBSymbolContextList(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBSymbolContextList *arg1 = (lldb::SBSymbolContextList *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBSymbolContextList **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBSymbolContextList_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBSymbolContextList *arg1 = (lldb::SBSymbolContextList *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSymbolContextList **)&jarg1; - result = (bool)((lldb::SBSymbolContextList const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBSymbolContextList_1GetSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBSymbolContextList *arg1 = (lldb::SBSymbolContextList *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSymbolContextList **)&jarg1; - result = (uint32_t)((lldb::SBSymbolContextList const *)arg1)->GetSize(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBSymbolContextList_1GetContextAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBSymbolContextList *arg1 = (lldb::SBSymbolContextList *) 0 ; - uint32_t arg2 ; - lldb::SBSymbolContext result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSymbolContextList **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (arg1)->GetContextAtIndex(arg2); - *(lldb::SBSymbolContext **)&jresult = new lldb::SBSymbolContext(result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBSymbolContextList_1GetDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBSymbolContextList *arg1 = (lldb::SBSymbolContextList *) 0 ; - lldb::SBStream *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBSymbolContextList **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - result = (bool)(arg1)->GetDescription(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBSymbolContextList_1Append_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBSymbolContextList *arg1 = (lldb::SBSymbolContextList *) 0 ; - lldb::SBSymbolContext *arg2 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBSymbolContextList **)&jarg1; - arg2 = *(lldb::SBSymbolContext **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBSymbolContext & is null"); - return ; - } - (arg1)->Append(*arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBSymbolContextList_1Append_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBSymbolContextList *arg1 = (lldb::SBSymbolContextList *) 0 ; - lldb::SBSymbolContextList *arg2 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBSymbolContextList **)&jarg1; - arg2 = *(lldb::SBSymbolContextList **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBSymbolContextList & is null"); - return ; - } - (arg1)->Append(*arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBSymbolContextList_1Clear(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBSymbolContextList *arg1 = (lldb::SBSymbolContextList *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSymbolContextList **)&jarg1; - (arg1)->Clear(); -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBSymbolContextList_1_1_1repr_1_1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBSymbolContextList *arg1 = (lldb::SBSymbolContextList *) 0 ; - std::string result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBSymbolContextList **)&jarg1; - result = lldb_SBSymbolContextList___repr__(arg1); - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBTarget_1eBroadcastBitBreakpointChanged_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)lldb::SBTarget::eBroadcastBitBreakpointChanged; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBTarget_1eBroadcastBitModulesLoaded_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)lldb::SBTarget::eBroadcastBitModulesLoaded; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBTarget_1eBroadcastBitModulesUnloaded_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)lldb::SBTarget::eBroadcastBitModulesUnloaded; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBTarget_1eBroadcastBitWatchpointChanged_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)lldb::SBTarget::eBroadcastBitWatchpointChanged; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBTarget_1eBroadcastBitSymbolsLoaded_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)lldb::SBTarget::eBroadcastBitSymbolsLoaded; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBTarget_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBTarget *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBTarget *)new lldb::SBTarget(); - *(lldb::SBTarget **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBTarget_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = 0 ; - lldb::SBTarget *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBTarget const & is null"); - return 0; - } - result = (lldb::SBTarget *)new lldb::SBTarget((lldb::SBTarget const &)*arg1); - *(lldb::SBTarget **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBTarget(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBTarget **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTarget_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - result = (bool)((lldb::SBTarget const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTarget_1EventIsTargetEvent(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBEvent *arg1 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEvent **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent const & is null"); - return 0; - } - result = (bool)lldb::SBTarget::EventIsTargetEvent((lldb::SBEvent const &)*arg1); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1GetTargetFromEvent(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBEvent *arg1 = 0 ; - lldb::SBTarget result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEvent **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent const & is null"); - return 0; - } - result = lldb::SBTarget::GetTargetFromEvent((lldb::SBEvent const &)*arg1); - *(lldb::SBTarget **)&jresult = new lldb::SBTarget(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1GetNumModulesFromEvent(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBEvent *arg1 = 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEvent **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent const & is null"); - return 0; - } - result = (uint32_t)lldb::SBTarget::GetNumModulesFromEvent((lldb::SBEvent const &)*arg1); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1GetModuleAtIndexFromEvent(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - uint32_t arg1 ; - lldb::SBEvent *arg2 = 0 ; - lldb::SBModule result; - - (void)jenv; - (void)jcls; - (void)jarg2_; - arg1 = (uint32_t)jarg1; - arg2 = *(lldb::SBEvent **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent const & is null"); - return 0; - } - result = lldb::SBTarget::GetModuleAtIndexFromEvent(arg1,(lldb::SBEvent const &)*arg2); - *(lldb::SBModule **)&jresult = new lldb::SBModule(result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBTarget_1GetBroadcasterClassName(JNIEnv *jenv, jclass jcls) { - jstring jresult = 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - result = (char *)lldb::SBTarget::GetBroadcasterClassName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1GetProcess(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBProcess result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - result = (arg1)->GetProcess(); - *(lldb::SBProcess **)&jresult = new lldb::SBProcess(result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBTarget_1SetCollectingStats(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetCollectingStats(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTarget_1GetCollectingStats(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - result = (bool)(arg1)->GetCollectingStats(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1GetStatistics(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBStructuredData result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - result = (arg1)->GetStatistics(); - *(lldb::SBStructuredData **)&jresult = new lldb::SBStructuredData(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1GetPlatform(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBPlatform result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - result = (arg1)->GetPlatform(); - *(lldb::SBPlatform **)&jresult = new lldb::SBPlatform(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1GetEnvironment(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBEnvironment result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - result = (arg1)->GetEnvironment(); - *(lldb::SBEnvironment **)&jresult = new lldb::SBEnvironment(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1Install(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - result = (arg1)->Install(); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1Launch_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jobjectArray jarg3, jobjectArray jarg4, jstring jarg5, jstring jarg6, jstring jarg7, jstring jarg8, jlong jarg9, jboolean jarg10, jlong jarg11, jobject jarg11_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBListener *arg2 = 0 ; - char **arg3 = (char **) 0 ; - char **arg4 = (char **) 0 ; - char *arg5 = (char *) 0 ; - char *arg6 = (char *) 0 ; - char *arg7 = (char *) 0 ; - char *arg8 = (char *) 0 ; - uint32_t arg9 ; - bool arg10 ; - lldb::SBError *arg11 = 0 ; - jint size3 ; - jint size4 ; - lldb::SBProcess result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg11_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = *(lldb::SBListener **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBListener & is null"); - return 0; - } - { - int i = 0; - if (jarg3) { - size3 = jenv->GetArrayLength(jarg3); - - arg3 = new char*[size3+1]; - - - - for (i = 0; iGetObjectArrayElement(jarg3, i); - const char *c_string = jenv->GetStringUTFChars(j_string, 0); - - arg3[i] = new char [strlen(c_string)+1]; - - - - strcpy(arg3[i], c_string); - jenv->ReleaseStringUTFChars(j_string, c_string); - jenv->DeleteLocalRef(j_string); - } - arg3[i] = 0; - } else { - arg3 = 0; - size3 = 0; - } - } - { - int i = 0; - if (jarg4) { - size4 = jenv->GetArrayLength(jarg4); - - arg4 = new char*[size4+1]; - - - - for (i = 0; iGetObjectArrayElement(jarg4, i); - const char *c_string = jenv->GetStringUTFChars(j_string, 0); - - arg4[i] = new char [strlen(c_string)+1]; - - - - strcpy(arg4[i], c_string); - jenv->ReleaseStringUTFChars(j_string, c_string); - jenv->DeleteLocalRef(j_string); - } - arg4[i] = 0; - } else { - arg4 = 0; - size4 = 0; - } - } - arg5 = 0; - if (jarg5) { - arg5 = (char *)jenv->GetStringUTFChars(jarg5, 0); - if (!arg5) return 0; - } - arg6 = 0; - if (jarg6) { - arg6 = (char *)jenv->GetStringUTFChars(jarg6, 0); - if (!arg6) return 0; - } - arg7 = 0; - if (jarg7) { - arg7 = (char *)jenv->GetStringUTFChars(jarg7, 0); - if (!arg7) return 0; - } - arg8 = 0; - if (jarg8) { - arg8 = (char *)jenv->GetStringUTFChars(jarg8, 0); - if (!arg8) return 0; - } - arg9 = (uint32_t)jarg9; - arg10 = jarg10 ? true : false; - arg11 = *(lldb::SBError **)&jarg11; - if (!arg11) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - result = (arg1)->Launch(*arg2,(char const **)arg3,(char const **)arg4,(char const *)arg5,(char const *)arg6,(char const *)arg7,(char const *)arg8,arg9,arg10,*arg11); - *(lldb::SBProcess **)&jresult = new lldb::SBProcess(result); - { - int i; - for (i=0; iReleaseStringUTFChars(jarg5, (const char *)arg5); - if (arg6) jenv->ReleaseStringUTFChars(jarg6, (const char *)arg6); - if (arg7) jenv->ReleaseStringUTFChars(jarg7, (const char *)arg7); - if (arg8) jenv->ReleaseStringUTFChars(jarg8, (const char *)arg8); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1LoadCore_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBProcess result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (arg1)->LoadCore((char const *)arg2); - *(lldb::SBProcess **)&jresult = new lldb::SBProcess(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1LoadCore_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jobject jarg3_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBError *arg3 = 0 ; - lldb::SBProcess result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = *(lldb::SBError **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - result = (arg1)->LoadCore((char const *)arg2,*arg3); - *(lldb::SBProcess **)&jresult = new lldb::SBProcess(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1LaunchSimple(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobjectArray jarg2, jobjectArray jarg3, jstring jarg4) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - char **arg2 = (char **) 0 ; - char **arg3 = (char **) 0 ; - char *arg4 = (char *) 0 ; - jint size2 ; - jint size3 ; - lldb::SBProcess result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - { - int i = 0; - if (jarg2) { - size2 = jenv->GetArrayLength(jarg2); - - arg2 = new char*[size2+1]; - - - - for (i = 0; iGetObjectArrayElement(jarg2, i); - const char *c_string = jenv->GetStringUTFChars(j_string, 0); - - arg2[i] = new char [strlen(c_string)+1]; - - - - strcpy(arg2[i], c_string); - jenv->ReleaseStringUTFChars(j_string, c_string); - jenv->DeleteLocalRef(j_string); - } - arg2[i] = 0; - } else { - arg2 = 0; - size2 = 0; - } - } - { - int i = 0; - if (jarg3) { - size3 = jenv->GetArrayLength(jarg3); - - arg3 = new char*[size3+1]; - - - - for (i = 0; iGetObjectArrayElement(jarg3, i); - const char *c_string = jenv->GetStringUTFChars(j_string, 0); - - arg3[i] = new char [strlen(c_string)+1]; - - - - strcpy(arg3[i], c_string); - jenv->ReleaseStringUTFChars(j_string, c_string); - jenv->DeleteLocalRef(j_string); - } - arg3[i] = 0; - } else { - arg3 = 0; - size3 = 0; - } - } - arg4 = 0; - if (jarg4) { - arg4 = (char *)jenv->GetStringUTFChars(jarg4, 0); - if (!arg4) return 0; - } - result = (arg1)->LaunchSimple((char const **)arg2,(char const **)arg3,(char const *)arg4); - *(lldb::SBProcess **)&jresult = new lldb::SBProcess(result); - { - int i; - for (i=0; iReleaseStringUTFChars(jarg4, (const char *)arg4); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1Launch_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBLaunchInfo *arg2 = 0 ; - lldb::SBError *arg3 = 0 ; - lldb::SBProcess result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = *(lldb::SBLaunchInfo **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBLaunchInfo & is null"); - return 0; - } - arg3 = *(lldb::SBError **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - result = (arg1)->Launch(*arg2,*arg3); - *(lldb::SBProcess **)&jresult = new lldb::SBProcess(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1Attach(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBAttachInfo *arg2 = 0 ; - lldb::SBError *arg3 = 0 ; - lldb::SBProcess result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = *(lldb::SBAttachInfo **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBAttachInfo & is null"); - return 0; - } - arg3 = *(lldb::SBError **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - result = (arg1)->Attach(*arg2,*arg3); - *(lldb::SBProcess **)&jresult = new lldb::SBProcess(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1AttachToProcessWithID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jobject jarg3, jlong jarg4, jobject jarg4_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBListener *arg2 = 0 ; - lldb::pid_t arg3 ; - lldb::SBError *arg4 = 0 ; - lldb::SBProcess result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg4_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = *(lldb::SBListener **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBListener & is null"); - return 0; - } - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg3); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg3, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg3 = 0; - if (sz > 0) { - arg3 = (lldb::pid_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - arg4 = *(lldb::SBError **)&jarg4; - if (!arg4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - result = (arg1)->AttachToProcessWithID(*arg2,arg3,*arg4); - *(lldb::SBProcess **)&jresult = new lldb::SBProcess(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1AttachToProcessWithName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jstring jarg3, jboolean jarg4, jlong jarg5, jobject jarg5_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBListener *arg2 = 0 ; - char *arg3 = (char *) 0 ; - bool arg4 ; - lldb::SBError *arg5 = 0 ; - lldb::SBProcess result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg5_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = *(lldb::SBListener **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBListener & is null"); - return 0; - } - arg3 = 0; - if (jarg3) { - arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); - if (!arg3) return 0; - } - arg4 = jarg4 ? true : false; - arg5 = *(lldb::SBError **)&jarg5; - if (!arg5) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - result = (arg1)->AttachToProcessWithName(*arg2,(char const *)arg3,arg4,*arg5); - *(lldb::SBProcess **)&jresult = new lldb::SBProcess(result); - if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1ConnectRemote(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jstring jarg3, jstring jarg4, jlong jarg5, jobject jarg5_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBListener *arg2 = 0 ; - char *arg3 = (char *) 0 ; - char *arg4 = (char *) 0 ; - lldb::SBError *arg5 = 0 ; - lldb::SBProcess result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg5_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = *(lldb::SBListener **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBListener & is null"); - return 0; - } - arg3 = 0; - if (jarg3) { - arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); - if (!arg3) return 0; - } - arg4 = 0; - if (jarg4) { - arg4 = (char *)jenv->GetStringUTFChars(jarg4, 0); - if (!arg4) return 0; - } - arg5 = *(lldb::SBError **)&jarg5; - if (!arg5) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - result = (arg1)->ConnectRemote(*arg2,(char const *)arg3,(char const *)arg4,*arg5); - *(lldb::SBProcess **)&jresult = new lldb::SBProcess(result); - if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); - if (arg4) jenv->ReleaseStringUTFChars(jarg4, (const char *)arg4); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1GetExecutable(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBFileSpec result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - result = (arg1)->GetExecutable(); - *(lldb::SBFileSpec **)&jresult = new lldb::SBFileSpec(result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBTarget_1AppendImageSearchPath(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jstring jarg3, jlong jarg4, jobject jarg4_) { - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - char *arg2 = (char *) 0 ; - char *arg3 = (char *) 0 ; - lldb::SBError *arg4 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg4_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - arg3 = 0; - if (jarg3) { - arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); - if (!arg3) return ; - } - arg4 = *(lldb::SBError **)&jarg4; - if (!arg4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return ; - } - (arg1)->AppendImageSearchPath((char const *)arg2,(char const *)arg3,*arg4); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTarget_1AddModule_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBModule *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = *(lldb::SBModule **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBModule & is null"); - return 0; - } - result = (bool)(arg1)->AddModule(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1AddModule_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jstring jarg3, jstring jarg4) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - char *arg2 = (char *) 0 ; - char *arg3 = (char *) 0 ; - char *arg4 = (char *) 0 ; - lldb::SBModule result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = 0; - if (jarg3) { - arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); - if (!arg3) return 0; - } - arg4 = 0; - if (jarg4) { - arg4 = (char *)jenv->GetStringUTFChars(jarg4, 0); - if (!arg4) return 0; - } - result = (arg1)->AddModule((char const *)arg2,(char const *)arg3,(char const *)arg4); - *(lldb::SBModule **)&jresult = new lldb::SBModule(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); - if (arg4) jenv->ReleaseStringUTFChars(jarg4, (const char *)arg4); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1AddModule_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jstring jarg3, jstring jarg4, jstring jarg5) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - char *arg2 = (char *) 0 ; - char *arg3 = (char *) 0 ; - char *arg4 = (char *) 0 ; - char *arg5 = (char *) 0 ; - lldb::SBModule result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = 0; - if (jarg3) { - arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); - if (!arg3) return 0; - } - arg4 = 0; - if (jarg4) { - arg4 = (char *)jenv->GetStringUTFChars(jarg4, 0); - if (!arg4) return 0; - } - arg5 = 0; - if (jarg5) { - arg5 = (char *)jenv->GetStringUTFChars(jarg5, 0); - if (!arg5) return 0; - } - result = (arg1)->AddModule((char const *)arg2,(char const *)arg3,(char const *)arg4,(char const *)arg5); - *(lldb::SBModule **)&jresult = new lldb::SBModule(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); - if (arg4) jenv->ReleaseStringUTFChars(jarg4, (const char *)arg4); - if (arg5) jenv->ReleaseStringUTFChars(jarg5, (const char *)arg5); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1AddModule_1_1SWIG_13(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBModuleSpec *arg2 = 0 ; - lldb::SBModule result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = *(lldb::SBModuleSpec **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBModuleSpec const & is null"); - return 0; - } - result = (arg1)->AddModule((lldb::SBModuleSpec const &)*arg2); - *(lldb::SBModule **)&jresult = new lldb::SBModule(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1GetNumModules(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - result = (uint32_t)((lldb::SBTarget const *)arg1)->GetNumModules(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1GetModuleAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - uint32_t arg2 ; - lldb::SBModule result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (arg1)->GetModuleAtIndex(arg2); - *(lldb::SBModule **)&jresult = new lldb::SBModule(result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTarget_1RemoveModule(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBModule arg2 ; - lldb::SBModule *argp2 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTarget **)&jarg1; - argp2 = *(lldb::SBModule **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBModule"); - return 0; - } - arg2 = *argp2; - result = (bool)(arg1)->RemoveModule(arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1GetDebugger(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBDebugger result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - result = ((lldb::SBTarget const *)arg1)->GetDebugger(); - *(lldb::SBDebugger **)&jresult = new lldb::SBDebugger(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1FindModule(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBFileSpec *arg2 = 0 ; - lldb::SBModule result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = *(lldb::SBFileSpec **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec const & is null"); - return 0; - } - result = (arg1)->FindModule((lldb::SBFileSpec const &)*arg2); - *(lldb::SBModule **)&jresult = new lldb::SBModule(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1FindCompileUnits(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBFileSpec *arg2 = 0 ; - lldb::SBSymbolContextList result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = *(lldb::SBFileSpec **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec const & is null"); - return 0; - } - result = (arg1)->FindCompileUnits((lldb::SBFileSpec const &)*arg2); - *(lldb::SBSymbolContextList **)&jresult = new lldb::SBSymbolContextList(result); - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBTarget_1GetByteOrder(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::ByteOrder result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - result = (lldb::ByteOrder)(arg1)->GetByteOrder(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1GetAddressByteSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - result = (uint32_t)(arg1)->GetAddressByteSize(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBTarget_1GetTriple(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - result = (char *)(arg1)->GetTriple(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBTarget_1GetABIName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - result = (char *)(arg1)->GetABIName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBTarget_1GetLabel(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - result = (char *)((lldb::SBTarget const *)arg1)->GetLabel(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1SetLabel(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (arg1)->SetLabel((char const *)arg2); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1GetDataByteSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - result = (uint32_t)(arg1)->GetDataByteSize(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1GetCodeByteSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - result = (uint32_t)(arg1)->GetCodeByteSize(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1GetMaximumNumberOfChildrenToDisplay(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - result = (uint32_t)((lldb::SBTarget const *)arg1)->GetMaximumNumberOfChildrenToDisplay(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1SetSectionLoadAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jobject jarg3) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBSection arg2 ; - lldb::addr_t arg3 ; - lldb::SBSection *argp2 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTarget **)&jarg1; - argp2 = *(lldb::SBSection **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBSection"); - return 0; - } - arg2 = *argp2; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg3); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg3, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg3 = 0; - if (sz > 0) { - arg3 = (lldb::addr_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (arg1)->SetSectionLoadAddress(arg2,arg3); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1ClearSectionLoadAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBSection arg2 ; - lldb::SBSection *argp2 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTarget **)&jarg1; - argp2 = *(lldb::SBSection **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBSection"); - return 0; - } - arg2 = *argp2; - result = (arg1)->ClearSectionLoadAddress(arg2); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1SetModuleLoadAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jobject jarg3) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBModule arg2 ; - uint64_t arg3 ; - lldb::SBModule *argp2 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTarget **)&jarg1; - argp2 = *(lldb::SBModule **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBModule"); - return 0; - } - arg2 = *argp2; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg3); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg3, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg3 = 0; - if (sz > 0) { - arg3 = (uint64_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (arg1)->SetModuleLoadAddress(arg2,arg3); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1ClearModuleLoadAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBModule arg2 ; - lldb::SBModule *argp2 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTarget **)&jarg1; - argp2 = *(lldb::SBModule **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBModule"); - return 0; - } - arg2 = *argp2; - result = (arg1)->ClearModuleLoadAddress(arg2); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1FindFunctions_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - char *arg2 = (char *) 0 ; - uint32_t arg3 ; - lldb::SBSymbolContextList result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = (uint32_t)jarg3; - result = (arg1)->FindFunctions((char const *)arg2,arg3); - *(lldb::SBSymbolContextList **)&jresult = new lldb::SBSymbolContextList(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1FindFunctions_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBSymbolContextList result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (arg1)->FindFunctions((char const *)arg2); - *(lldb::SBSymbolContextList **)&jresult = new lldb::SBSymbolContextList(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1FindGlobalVariables_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - char *arg2 = (char *) 0 ; - uint32_t arg3 ; - lldb::SBValueList result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = (uint32_t)jarg3; - result = (arg1)->FindGlobalVariables((char const *)arg2,arg3); - *(lldb::SBValueList **)&jresult = new lldb::SBValueList(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1FindFirstGlobalVariable(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (arg1)->FindFirstGlobalVariable((char const *)arg2); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1FindGlobalVariables_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jint jarg4) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - char *arg2 = (char *) 0 ; - uint32_t arg3 ; - lldb::MatchType arg4 ; - lldb::SBValueList result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = (uint32_t)jarg3; - arg4 = (lldb::MatchType)jarg4; - result = (arg1)->FindGlobalVariables((char const *)arg2,arg3,arg4); - *(lldb::SBValueList **)&jresult = new lldb::SBValueList(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1FindGlobalFunctions(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jint jarg4) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - char *arg2 = (char *) 0 ; - uint32_t arg3 ; - lldb::MatchType arg4 ; - lldb::SBSymbolContextList result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = (uint32_t)jarg3; - arg4 = (lldb::MatchType)jarg4; - result = (arg1)->FindGlobalFunctions((char const *)arg2,arg3,arg4); - *(lldb::SBSymbolContextList **)&jresult = new lldb::SBSymbolContextList(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBTarget_1Clear(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - (arg1)->Clear(); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1ResolveFileAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::addr_t arg2 ; - lldb::SBAddress result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (lldb::addr_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (arg1)->ResolveFileAddress(arg2); - *(lldb::SBAddress **)&jresult = new lldb::SBAddress(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1ResolveLoadAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::addr_t arg2 ; - lldb::SBAddress result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (lldb::addr_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (arg1)->ResolveLoadAddress(arg2); - *(lldb::SBAddress **)&jresult = new lldb::SBAddress(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1ResolvePastLoadAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg3) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - uint32_t arg2 ; - lldb::addr_t arg3 ; - lldb::SBAddress result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = (uint32_t)jarg2; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg3); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg3, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg3 = 0; - if (sz > 0) { - arg3 = (lldb::addr_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (arg1)->ResolvePastLoadAddress(arg2,arg3); - *(lldb::SBAddress **)&jresult = new lldb::SBAddress(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1ResolveSymbolContextForAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBAddress *arg2 = 0 ; - uint32_t arg3 ; - lldb::SBSymbolContext result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = *(lldb::SBAddress **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBAddress const & is null"); - return 0; - } - arg3 = (uint32_t)jarg3; - result = (arg1)->ResolveSymbolContextForAddress((lldb::SBAddress const &)*arg2,arg3); - *(lldb::SBSymbolContext **)&jresult = new lldb::SBSymbolContext(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1ReadMemory(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jlong jarg4, jlong jarg5, jobject jarg5_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBAddress arg2 ; - void *arg3 = (void *) 0 ; - size_t arg4 ; - lldb::SBError *arg5 = 0 ; - lldb::SBAddress const *argp2 ; - size_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg5_; - arg1 = *(lldb::SBTarget **)&jarg1; - argp2 = *(lldb::SBAddress **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBAddress const"); - return 0; - } - arg2 = *argp2; - arg3 = *(void **)&jarg3; - arg4 = (size_t)jarg4; - arg5 = *(lldb::SBError **)&jarg5; - if (!arg5) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - result = (arg1)->ReadMemory(arg2,arg3,arg4,*arg5); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1BreakpointCreateByLocation_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - char *arg2 = (char *) 0 ; - uint32_t arg3 ; - lldb::SBBreakpoint result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = (uint32_t)jarg3; - result = (arg1)->BreakpointCreateByLocation((char const *)arg2,arg3); - *(lldb::SBBreakpoint **)&jresult = new lldb::SBBreakpoint(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1BreakpointCreateByLocation_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBFileSpec *arg2 = 0 ; - uint32_t arg3 ; - lldb::SBBreakpoint result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = *(lldb::SBFileSpec **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec const & is null"); - return 0; - } - arg3 = (uint32_t)jarg3; - result = (arg1)->BreakpointCreateByLocation((lldb::SBFileSpec const &)*arg2,arg3); - *(lldb::SBBreakpoint **)&jresult = new lldb::SBBreakpoint(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1BreakpointCreateByLocation_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg4) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBFileSpec *arg2 = 0 ; - uint32_t arg3 ; - lldb::addr_t arg4 ; - lldb::SBBreakpoint result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = *(lldb::SBFileSpec **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec const & is null"); - return 0; - } - arg3 = (uint32_t)jarg3; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg4); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg4, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg4 = 0; - if (sz > 0) { - arg4 = (lldb::addr_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (arg1)->BreakpointCreateByLocation((lldb::SBFileSpec const &)*arg2,arg3,arg4); - *(lldb::SBBreakpoint **)&jresult = new lldb::SBBreakpoint(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1BreakpointCreateByLocation_1_1SWIG_13(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg4, jlong jarg5, jobject jarg5_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBFileSpec *arg2 = 0 ; - uint32_t arg3 ; - lldb::addr_t arg4 ; - lldb::SBFileSpecList *arg5 = 0 ; - lldb::SBBreakpoint result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg5_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = *(lldb::SBFileSpec **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec const & is null"); - return 0; - } - arg3 = (uint32_t)jarg3; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg4); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg4, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg4 = 0; - if (sz > 0) { - arg4 = (lldb::addr_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - arg5 = *(lldb::SBFileSpecList **)&jarg5; - if (!arg5) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpecList & is null"); - return 0; - } - result = (arg1)->BreakpointCreateByLocation((lldb::SBFileSpec const &)*arg2,arg3,arg4,*arg5); - *(lldb::SBBreakpoint **)&jresult = new lldb::SBBreakpoint(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1BreakpointCreateByLocation_1_1SWIG_14(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jlong jarg4, jobject jarg5, jlong jarg6, jobject jarg6_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBFileSpec *arg2 = 0 ; - uint32_t arg3 ; - uint32_t arg4 ; - lldb::addr_t arg5 ; - lldb::SBFileSpecList *arg6 = 0 ; - lldb::SBBreakpoint result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg6_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = *(lldb::SBFileSpec **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec const & is null"); - return 0; - } - arg3 = (uint32_t)jarg3; - arg4 = (uint32_t)jarg4; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg5) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg5); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg5, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg5 = 0; - if (sz > 0) { - arg5 = (lldb::addr_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - arg6 = *(lldb::SBFileSpecList **)&jarg6; - if (!arg6) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpecList & is null"); - return 0; - } - result = (arg1)->BreakpointCreateByLocation((lldb::SBFileSpec const &)*arg2,arg3,arg4,arg5,*arg6); - *(lldb::SBBreakpoint **)&jresult = new lldb::SBBreakpoint(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1BreakpointCreateByLocation_1_1SWIG_15(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jlong jarg4, jobject jarg5, jlong jarg6, jobject jarg6_, jboolean jarg7) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBFileSpec *arg2 = 0 ; - uint32_t arg3 ; - uint32_t arg4 ; - lldb::addr_t arg5 ; - lldb::SBFileSpecList *arg6 = 0 ; - bool arg7 ; - lldb::SBBreakpoint result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg6_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = *(lldb::SBFileSpec **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec const & is null"); - return 0; - } - arg3 = (uint32_t)jarg3; - arg4 = (uint32_t)jarg4; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg5) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg5); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg5, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg5 = 0; - if (sz > 0) { - arg5 = (lldb::addr_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - arg6 = *(lldb::SBFileSpecList **)&jarg6; - if (!arg6) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpecList & is null"); - return 0; - } - arg7 = jarg7 ? true : false; - result = (arg1)->BreakpointCreateByLocation((lldb::SBFileSpec const &)*arg2,arg3,arg4,arg5,*arg6,arg7); - *(lldb::SBBreakpoint **)&jresult = new lldb::SBBreakpoint(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1BreakpointCreateByName_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jstring jarg3) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - char *arg2 = (char *) 0 ; - char *arg3 = (char *) 0 ; - lldb::SBBreakpoint result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = 0; - if (jarg3) { - arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); - if (!arg3) return 0; - } - result = (arg1)->BreakpointCreateByName((char const *)arg2,(char const *)arg3); - *(lldb::SBBreakpoint **)&jresult = new lldb::SBBreakpoint(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1BreakpointCreateByName_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBBreakpoint result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (arg1)->BreakpointCreateByName((char const *)arg2); - *(lldb::SBBreakpoint **)&jresult = new lldb::SBBreakpoint(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1BreakpointCreateByName_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jobject jarg3_, jlong jarg4, jobject jarg4_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBFileSpecList *arg3 = 0 ; - lldb::SBFileSpecList *arg4 = 0 ; - lldb::SBBreakpoint result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - (void)jarg4_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = *(lldb::SBFileSpecList **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpecList const & is null"); - return 0; - } - arg4 = *(lldb::SBFileSpecList **)&jarg4; - if (!arg4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpecList const & is null"); - return 0; - } - result = (arg1)->BreakpointCreateByName((char const *)arg2,(lldb::SBFileSpecList const &)*arg3,(lldb::SBFileSpecList const &)*arg4); - *(lldb::SBBreakpoint **)&jresult = new lldb::SBBreakpoint(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1BreakpointCreateByName_1_1SWIG_13(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jlong jarg4, jobject jarg4_, jlong jarg5, jobject jarg5_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - char *arg2 = (char *) 0 ; - uint32_t arg3 ; - lldb::SBFileSpecList *arg4 = 0 ; - lldb::SBFileSpecList *arg5 = 0 ; - lldb::SBBreakpoint result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg4_; - (void)jarg5_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = (uint32_t)jarg3; - arg4 = *(lldb::SBFileSpecList **)&jarg4; - if (!arg4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpecList const & is null"); - return 0; - } - arg5 = *(lldb::SBFileSpecList **)&jarg5; - if (!arg5) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpecList const & is null"); - return 0; - } - result = (arg1)->BreakpointCreateByName((char const *)arg2,arg3,(lldb::SBFileSpecList const &)*arg4,(lldb::SBFileSpecList const &)*arg5); - *(lldb::SBBreakpoint **)&jresult = new lldb::SBBreakpoint(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1BreakpointCreateByName_1_1SWIG_14(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jint jarg4, jlong jarg5, jobject jarg5_, jlong jarg6, jobject jarg6_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - char *arg2 = (char *) 0 ; - uint32_t arg3 ; - lldb::LanguageType arg4 ; - lldb::SBFileSpecList *arg5 = 0 ; - lldb::SBFileSpecList *arg6 = 0 ; - lldb::SBBreakpoint result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg5_; - (void)jarg6_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = (uint32_t)jarg3; - arg4 = (lldb::LanguageType)jarg4; - arg5 = *(lldb::SBFileSpecList **)&jarg5; - if (!arg5) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpecList const & is null"); - return 0; - } - arg6 = *(lldb::SBFileSpecList **)&jarg6; - if (!arg6) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpecList const & is null"); - return 0; - } - result = (arg1)->BreakpointCreateByName((char const *)arg2,arg3,arg4,(lldb::SBFileSpecList const &)*arg5,(lldb::SBFileSpecList const &)*arg6); - *(lldb::SBBreakpoint **)&jresult = new lldb::SBBreakpoint(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1BreakpointCreateByNames_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobjectArray jarg2, jlong jarg3, jlong jarg4, jlong jarg5, jobject jarg5_, jlong jarg6, jobject jarg6_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - char **arg2 = (char **) 0 ; - uint32_t arg3 ; - uint32_t arg4 ; - lldb::SBFileSpecList *arg5 = 0 ; - lldb::SBFileSpecList *arg6 = 0 ; - jint size2 ; - lldb::SBBreakpoint result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg5_; - (void)jarg6_; - arg1 = *(lldb::SBTarget **)&jarg1; - { - int i = 0; - if (jarg2) { - size2 = jenv->GetArrayLength(jarg2); - - arg2 = new char*[size2+1]; - - - - for (i = 0; iGetObjectArrayElement(jarg2, i); - const char *c_string = jenv->GetStringUTFChars(j_string, 0); - - arg2[i] = new char [strlen(c_string)+1]; - - - - strcpy(arg2[i], c_string); - jenv->ReleaseStringUTFChars(j_string, c_string); - jenv->DeleteLocalRef(j_string); - } - arg2[i] = 0; - } else { - arg2 = 0; - size2 = 0; - } - } - arg3 = (uint32_t)jarg3; - arg4 = (uint32_t)jarg4; - arg5 = *(lldb::SBFileSpecList **)&jarg5; - if (!arg5) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpecList const & is null"); - return 0; - } - arg6 = *(lldb::SBFileSpecList **)&jarg6; - if (!arg6) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpecList const & is null"); - return 0; - } - result = (arg1)->BreakpointCreateByNames((char const **)arg2,arg3,arg4,(lldb::SBFileSpecList const &)*arg5,(lldb::SBFileSpecList const &)*arg6); - *(lldb::SBBreakpoint **)&jresult = new lldb::SBBreakpoint(result); - { - int i; - for (i=0; iGetArrayLength(jarg2); - - arg2 = new char*[size2+1]; - - - - for (i = 0; iGetObjectArrayElement(jarg2, i); - const char *c_string = jenv->GetStringUTFChars(j_string, 0); - - arg2[i] = new char [strlen(c_string)+1]; - - - - strcpy(arg2[i], c_string); - jenv->ReleaseStringUTFChars(j_string, c_string); - jenv->DeleteLocalRef(j_string); - } - arg2[i] = 0; - } else { - arg2 = 0; - size2 = 0; - } - } - arg3 = (uint32_t)jarg3; - arg4 = (uint32_t)jarg4; - arg5 = (lldb::LanguageType)jarg5; - arg6 = *(lldb::SBFileSpecList **)&jarg6; - if (!arg6) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpecList const & is null"); - return 0; - } - arg7 = *(lldb::SBFileSpecList **)&jarg7; - if (!arg7) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpecList const & is null"); - return 0; - } - result = (arg1)->BreakpointCreateByNames((char const **)arg2,arg3,arg4,arg5,(lldb::SBFileSpecList const &)*arg6,(lldb::SBFileSpecList const &)*arg7); - *(lldb::SBBreakpoint **)&jresult = new lldb::SBBreakpoint(result); - { - int i; - for (i=0; iGetArrayLength(jarg2); - - arg2 = new char*[size2+1]; - - - - for (i = 0; iGetObjectArrayElement(jarg2, i); - const char *c_string = jenv->GetStringUTFChars(j_string, 0); - - arg2[i] = new char [strlen(c_string)+1]; - - - - strcpy(arg2[i], c_string); - jenv->ReleaseStringUTFChars(j_string, c_string); - jenv->DeleteLocalRef(j_string); - } - arg2[i] = 0; - } else { - arg2 = 0; - size2 = 0; - } - } - arg3 = (uint32_t)jarg3; - arg4 = (uint32_t)jarg4; - arg5 = (lldb::LanguageType)jarg5; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg6) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg6); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg6, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg6 = 0; - if (sz > 0) { - arg6 = (lldb::addr_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - arg7 = *(lldb::SBFileSpecList **)&jarg7; - if (!arg7) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpecList const & is null"); - return 0; - } - arg8 = *(lldb::SBFileSpecList **)&jarg8; - if (!arg8) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpecList const & is null"); - return 0; - } - result = (arg1)->BreakpointCreateByNames((char const **)arg2,arg3,arg4,arg5,arg6,(lldb::SBFileSpecList const &)*arg7,(lldb::SBFileSpecList const &)*arg8); - *(lldb::SBBreakpoint **)&jresult = new lldb::SBBreakpoint(result); - { - int i; - for (i=0; iGetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = 0; - if (jarg3) { - arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); - if (!arg3) return 0; - } - result = (arg1)->BreakpointCreateByRegex((char const *)arg2,(char const *)arg3); - *(lldb::SBBreakpoint **)&jresult = new lldb::SBBreakpoint(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1BreakpointCreateByRegex_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBBreakpoint result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (arg1)->BreakpointCreateByRegex((char const *)arg2); - *(lldb::SBBreakpoint **)&jresult = new lldb::SBBreakpoint(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1BreakpointCreateByRegex_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jobject jarg3_, jlong jarg4, jobject jarg4_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBFileSpecList *arg3 = 0 ; - lldb::SBFileSpecList *arg4 = 0 ; - lldb::SBBreakpoint result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - (void)jarg4_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = *(lldb::SBFileSpecList **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpecList const & is null"); - return 0; - } - arg4 = *(lldb::SBFileSpecList **)&jarg4; - if (!arg4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpecList const & is null"); - return 0; - } - result = (arg1)->BreakpointCreateByRegex((char const *)arg2,(lldb::SBFileSpecList const &)*arg3,(lldb::SBFileSpecList const &)*arg4); - *(lldb::SBBreakpoint **)&jresult = new lldb::SBBreakpoint(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1BreakpointCreateByRegex_1_1SWIG_13(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jint jarg3, jlong jarg4, jobject jarg4_, jlong jarg5, jobject jarg5_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - char *arg2 = (char *) 0 ; - lldb::LanguageType arg3 ; - lldb::SBFileSpecList *arg4 = 0 ; - lldb::SBFileSpecList *arg5 = 0 ; - lldb::SBBreakpoint result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg4_; - (void)jarg5_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = (lldb::LanguageType)jarg3; - arg4 = *(lldb::SBFileSpecList **)&jarg4; - if (!arg4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpecList const & is null"); - return 0; - } - arg5 = *(lldb::SBFileSpecList **)&jarg5; - if (!arg5) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpecList const & is null"); - return 0; - } - result = (arg1)->BreakpointCreateByRegex((char const *)arg2,arg3,(lldb::SBFileSpecList const &)*arg4,(lldb::SBFileSpecList const &)*arg5); - *(lldb::SBBreakpoint **)&jresult = new lldb::SBBreakpoint(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1BreakpointCreateBySourceRegex_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jobject jarg3_, jstring jarg4) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBFileSpec *arg3 = 0 ; - char *arg4 = (char *) 0 ; - lldb::SBBreakpoint result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = *(lldb::SBFileSpec **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec const & is null"); - return 0; - } - arg4 = 0; - if (jarg4) { - arg4 = (char *)jenv->GetStringUTFChars(jarg4, 0); - if (!arg4) return 0; - } - result = (arg1)->BreakpointCreateBySourceRegex((char const *)arg2,(lldb::SBFileSpec const &)*arg3,(char const *)arg4); - *(lldb::SBBreakpoint **)&jresult = new lldb::SBBreakpoint(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - if (arg4) jenv->ReleaseStringUTFChars(jarg4, (const char *)arg4); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1BreakpointCreateBySourceRegex_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jobject jarg3_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBFileSpec *arg3 = 0 ; - lldb::SBBreakpoint result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = *(lldb::SBFileSpec **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec const & is null"); - return 0; - } - result = (arg1)->BreakpointCreateBySourceRegex((char const *)arg2,(lldb::SBFileSpec const &)*arg3); - *(lldb::SBBreakpoint **)&jresult = new lldb::SBBreakpoint(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1BreakpointCreateBySourceRegex_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jobject jarg3_, jlong jarg4, jobject jarg4_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBFileSpecList *arg3 = 0 ; - lldb::SBFileSpecList *arg4 = 0 ; - lldb::SBBreakpoint result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - (void)jarg4_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = *(lldb::SBFileSpecList **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpecList const & is null"); - return 0; - } - arg4 = *(lldb::SBFileSpecList **)&jarg4; - if (!arg4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpecList const & is null"); - return 0; - } - result = (arg1)->BreakpointCreateBySourceRegex((char const *)arg2,(lldb::SBFileSpecList const &)*arg3,(lldb::SBFileSpecList const &)*arg4); - *(lldb::SBBreakpoint **)&jresult = new lldb::SBBreakpoint(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1BreakpointCreateBySourceRegex_1_1SWIG_13(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jobject jarg3_, jlong jarg4, jobject jarg4_, jlong jarg5, jobject jarg5_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBFileSpecList *arg3 = 0 ; - lldb::SBFileSpecList *arg4 = 0 ; - lldb::SBStringList *arg5 = 0 ; - lldb::SBBreakpoint result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - (void)jarg4_; - (void)jarg5_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = *(lldb::SBFileSpecList **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpecList const & is null"); - return 0; - } - arg4 = *(lldb::SBFileSpecList **)&jarg4; - if (!arg4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpecList const & is null"); - return 0; - } - arg5 = *(lldb::SBStringList **)&jarg5; - if (!arg5) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStringList const & is null"); - return 0; - } - result = (arg1)->BreakpointCreateBySourceRegex((char const *)arg2,(lldb::SBFileSpecList const &)*arg3,(lldb::SBFileSpecList const &)*arg4,(lldb::SBStringList const &)*arg5); - *(lldb::SBBreakpoint **)&jresult = new lldb::SBBreakpoint(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1BreakpointCreateForException(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jboolean jarg3, jboolean jarg4) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::LanguageType arg2 ; - bool arg3 ; - bool arg4 ; - lldb::SBBreakpoint result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = (lldb::LanguageType)jarg2; - arg3 = jarg3 ? true : false; - arg4 = jarg4 ? true : false; - result = (arg1)->BreakpointCreateForException(arg2,arg3,arg4); - *(lldb::SBBreakpoint **)&jresult = new lldb::SBBreakpoint(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1BreakpointCreateByAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::addr_t arg2 ; - lldb::SBBreakpoint result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (lldb::addr_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (arg1)->BreakpointCreateByAddress(arg2); - *(lldb::SBBreakpoint **)&jresult = new lldb::SBBreakpoint(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1BreakpointCreateBySBAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBAddress *arg2 = 0 ; - lldb::SBBreakpoint result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = *(lldb::SBAddress **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBAddress & is null"); - return 0; - } - result = (arg1)->BreakpointCreateBySBAddress(*arg2); - *(lldb::SBBreakpoint **)&jresult = new lldb::SBBreakpoint(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1BreakpointCreateFromScript_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jobject jarg3_, jlong jarg4, jobject jarg4_, jlong jarg5, jobject jarg5_, jboolean jarg6) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBStructuredData *arg3 = 0 ; - lldb::SBFileSpecList *arg4 = 0 ; - lldb::SBFileSpecList *arg5 = 0 ; - bool arg6 ; - lldb::SBBreakpoint result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - (void)jarg4_; - (void)jarg5_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = *(lldb::SBStructuredData **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStructuredData & is null"); - return 0; - } - arg4 = *(lldb::SBFileSpecList **)&jarg4; - if (!arg4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpecList const & is null"); - return 0; - } - arg5 = *(lldb::SBFileSpecList **)&jarg5; - if (!arg5) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpecList const & is null"); - return 0; - } - arg6 = jarg6 ? true : false; - result = (arg1)->BreakpointCreateFromScript((char const *)arg2,*arg3,(lldb::SBFileSpecList const &)*arg4,(lldb::SBFileSpecList const &)*arg5,arg6); - *(lldb::SBBreakpoint **)&jresult = new lldb::SBBreakpoint(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1BreakpointCreateFromScript_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jobject jarg3_, jlong jarg4, jobject jarg4_, jlong jarg5, jobject jarg5_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBStructuredData *arg3 = 0 ; - lldb::SBFileSpecList *arg4 = 0 ; - lldb::SBFileSpecList *arg5 = 0 ; - lldb::SBBreakpoint result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - (void)jarg4_; - (void)jarg5_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = *(lldb::SBStructuredData **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStructuredData & is null"); - return 0; - } - arg4 = *(lldb::SBFileSpecList **)&jarg4; - if (!arg4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpecList const & is null"); - return 0; - } - arg5 = *(lldb::SBFileSpecList **)&jarg5; - if (!arg5) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpecList const & is null"); - return 0; - } - result = (arg1)->BreakpointCreateFromScript((char const *)arg2,*arg3,(lldb::SBFileSpecList const &)*arg4,(lldb::SBFileSpecList const &)*arg5); - *(lldb::SBBreakpoint **)&jresult = new lldb::SBBreakpoint(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1BreakpointsCreateFromFile_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBFileSpec *arg2 = 0 ; - lldb::SBBreakpointList *arg3 = 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = *(lldb::SBFileSpec **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec & is null"); - return 0; - } - arg3 = *(lldb::SBBreakpointList **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBBreakpointList & is null"); - return 0; - } - result = (arg1)->BreakpointsCreateFromFile(*arg2,*arg3); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1BreakpointsCreateFromFile_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_, jlong jarg4, jobject jarg4_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBFileSpec *arg2 = 0 ; - lldb::SBStringList *arg3 = 0 ; - lldb::SBBreakpointList *arg4 = 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - (void)jarg4_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = *(lldb::SBFileSpec **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec & is null"); - return 0; - } - arg3 = *(lldb::SBStringList **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStringList & is null"); - return 0; - } - arg4 = *(lldb::SBBreakpointList **)&jarg4; - if (!arg4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBBreakpointList & is null"); - return 0; - } - result = (arg1)->BreakpointsCreateFromFile(*arg2,*arg3,*arg4); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1BreakpointsWriteToFile_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBFileSpec *arg2 = 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = *(lldb::SBFileSpec **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec & is null"); - return 0; - } - result = (arg1)->BreakpointsWriteToFile(*arg2); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1BreakpointsWriteToFile_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_, jboolean jarg4) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBFileSpec *arg2 = 0 ; - lldb::SBBreakpointList *arg3 = 0 ; - bool arg4 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = *(lldb::SBFileSpec **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec & is null"); - return 0; - } - arg3 = *(lldb::SBBreakpointList **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBBreakpointList & is null"); - return 0; - } - arg4 = jarg4 ? true : false; - result = (arg1)->BreakpointsWriteToFile(*arg2,*arg3,arg4); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1BreakpointsWriteToFile_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBFileSpec *arg2 = 0 ; - lldb::SBBreakpointList *arg3 = 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = *(lldb::SBFileSpec **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec & is null"); - return 0; - } - arg3 = *(lldb::SBBreakpointList **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBBreakpointList & is null"); - return 0; - } - result = (arg1)->BreakpointsWriteToFile(*arg2,*arg3); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1GetNumBreakpoints(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - result = (uint32_t)((lldb::SBTarget const *)arg1)->GetNumBreakpoints(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1GetBreakpointAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - uint32_t arg2 ; - lldb::SBBreakpoint result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = (uint32_t)jarg2; - result = ((lldb::SBTarget const *)arg1)->GetBreakpointAtIndex(arg2); - *(lldb::SBBreakpoint **)&jresult = new lldb::SBBreakpoint(result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTarget_1BreakpointDelete(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - jboolean jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::break_id_t arg2 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = (lldb::break_id_t)jarg2; - result = (bool)(arg1)->BreakpointDelete(arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1FindBreakpointByID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::break_id_t arg2 ; - lldb::SBBreakpoint result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = (lldb::break_id_t)jarg2; - result = (arg1)->FindBreakpointByID(arg2); - *(lldb::SBBreakpoint **)&jresult = new lldb::SBBreakpoint(result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTarget_1FindBreakpointsByName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jobject jarg3_) { - jboolean jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBBreakpointList *arg3 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = *(lldb::SBBreakpointList **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBBreakpointList & is null"); - return 0; - } - result = (bool)(arg1)->FindBreakpointsByName((char const *)arg2,*arg3); - jresult = (jboolean)result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBTarget_1GetBreakpointNames(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBStringList *arg2 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = *(lldb::SBStringList **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStringList & is null"); - return ; - } - (arg1)->GetBreakpointNames(*arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBTarget_1DeleteBreakpointName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->DeleteBreakpointName((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTarget_1EnableAllBreakpoints(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - result = (bool)(arg1)->EnableAllBreakpoints(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTarget_1DisableAllBreakpoints(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - result = (bool)(arg1)->DisableAllBreakpoints(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTarget_1DeleteAllBreakpoints(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - result = (bool)(arg1)->DeleteAllBreakpoints(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1GetNumWatchpoints(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - result = (uint32_t)((lldb::SBTarget const *)arg1)->GetNumWatchpoints(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1GetWatchpointAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - uint32_t arg2 ; - lldb::SBWatchpoint result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = (uint32_t)jarg2; - result = ((lldb::SBTarget const *)arg1)->GetWatchpointAtIndex(arg2); - *(lldb::SBWatchpoint **)&jresult = new lldb::SBWatchpoint(result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTarget_1DeleteWatchpoint(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - jboolean jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::watch_id_t arg2 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = (lldb::watch_id_t)jarg2; - result = (bool)(arg1)->DeleteWatchpoint(arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1FindWatchpointByID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::watch_id_t arg2 ; - lldb::SBWatchpoint result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = (lldb::watch_id_t)jarg2; - result = (arg1)->FindWatchpointByID(arg2); - *(lldb::SBWatchpoint **)&jresult = new lldb::SBWatchpoint(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1WatchAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2, jlong jarg3, jboolean jarg4, jboolean jarg5, jlong jarg6, jobject jarg6_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::addr_t arg2 ; - size_t arg3 ; - bool arg4 ; - bool arg5 ; - lldb::SBError *arg6 = 0 ; - lldb::SBWatchpoint result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg6_; - arg1 = *(lldb::SBTarget **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (lldb::addr_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - arg3 = (size_t)jarg3; - arg4 = jarg4 ? true : false; - arg5 = jarg5 ? true : false; - arg6 = *(lldb::SBError **)&jarg6; - if (!arg6) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - result = (arg1)->WatchAddress(arg2,arg3,arg4,arg5,*arg6); - *(lldb::SBWatchpoint **)&jresult = new lldb::SBWatchpoint(result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTarget_1EnableAllWatchpoints(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - result = (bool)(arg1)->EnableAllWatchpoints(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTarget_1DisableAllWatchpoints(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - result = (bool)(arg1)->DisableAllWatchpoints(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTarget_1DeleteAllWatchpoints(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - result = (bool)(arg1)->DeleteAllWatchpoints(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1GetBroadcaster(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBBroadcaster result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - result = ((lldb::SBTarget const *)arg1)->GetBroadcaster(); - *(lldb::SBBroadcaster **)&jresult = new lldb::SBBroadcaster(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1FindFirstType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (arg1)->FindFirstType((char const *)arg2); - *(lldb::SBType **)&jresult = new lldb::SBType(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1FindTypes(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBTypeList result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (arg1)->FindTypes((char const *)arg2); - *(lldb::SBTypeList **)&jresult = new lldb::SBTypeList(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1GetBasicType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::BasicType arg2 ; - lldb::SBType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = (lldb::BasicType)jarg2; - result = (arg1)->GetBasicType(arg2); - *(lldb::SBType **)&jresult = new lldb::SBType(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1CreateValueFromAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jobject jarg3_, jlong jarg4, jobject jarg4_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBAddress arg3 ; - lldb::SBType arg4 ; - lldb::SBAddress *argp3 ; - lldb::SBType *argp4 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - (void)jarg4_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - argp3 = *(lldb::SBAddress **)&jarg3; - if (!argp3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBAddress"); - return 0; - } - arg3 = *argp3; - argp4 = *(lldb::SBType **)&jarg4; - if (!argp4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBType"); - return 0; - } - arg4 = *argp4; - result = (arg1)->CreateValueFromAddress((char const *)arg2,arg3,arg4); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1CreateValueFromData(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jobject jarg3_, jlong jarg4, jobject jarg4_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBData arg3 ; - lldb::SBType arg4 ; - lldb::SBData *argp3 ; - lldb::SBType *argp4 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - (void)jarg4_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - argp3 = *(lldb::SBData **)&jarg3; - if (!argp3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBData"); - return 0; - } - arg3 = *argp3; - argp4 = *(lldb::SBType **)&jarg4; - if (!argp4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBType"); - return 0; - } - arg4 = *argp4; - result = (arg1)->CreateValueFromData((char const *)arg2,arg3,arg4); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1CreateValueFromExpression(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jstring jarg3) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - char *arg2 = (char *) 0 ; - char *arg3 = (char *) 0 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = 0; - if (jarg3) { - arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); - if (!arg3) return 0; - } - result = (arg1)->CreateValueFromExpression((char const *)arg2,(char const *)arg3); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1GetSourceManager(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - SwigValueWrapper< lldb::SBSourceManager > result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - result = (arg1)->GetSourceManager(); - *(lldb::SBSourceManager **)&jresult = new lldb::SBSourceManager(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1ReadInstructions_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBAddress arg2 ; - uint32_t arg3 ; - lldb::SBAddress *argp2 ; - lldb::SBInstructionList result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTarget **)&jarg1; - argp2 = *(lldb::SBAddress **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBAddress"); - return 0; - } - arg2 = *argp2; - arg3 = (uint32_t)jarg3; - result = (arg1)->ReadInstructions(arg2,arg3); - *(lldb::SBInstructionList **)&jresult = new lldb::SBInstructionList(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1ReadInstructions_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jstring jarg4) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBAddress arg2 ; - uint32_t arg3 ; - char *arg4 = (char *) 0 ; - lldb::SBAddress *argp2 ; - lldb::SBInstructionList result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTarget **)&jarg1; - argp2 = *(lldb::SBAddress **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBAddress"); - return 0; - } - arg2 = *argp2; - arg3 = (uint32_t)jarg3; - arg4 = 0; - if (jarg4) { - arg4 = (char *)jenv->GetStringUTFChars(jarg4, 0); - if (!arg4) return 0; - } - result = (arg1)->ReadInstructions(arg2,arg3,(char const *)arg4); - *(lldb::SBInstructionList **)&jresult = new lldb::SBInstructionList(result); - if (arg4) jenv->ReleaseStringUTFChars(jarg4, (const char *)arg4); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1GetInstructions(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jlong jarg4) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBAddress arg2 ; - void *arg3 = (void *) 0 ; - size_t arg4 ; - lldb::SBAddress *argp2 ; - lldb::SBInstructionList result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTarget **)&jarg1; - argp2 = *(lldb::SBAddress **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBAddress"); - return 0; - } - arg2 = *argp2; - arg3 = *(void **)&jarg3; - arg4 = (size_t)jarg4; - result = (arg1)->GetInstructions(arg2,(void const *)arg3,arg4); - *(lldb::SBInstructionList **)&jresult = new lldb::SBInstructionList(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1GetInstructionsWithFlavor(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jstring jarg3, jlong jarg4, jlong jarg5) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBAddress arg2 ; - char *arg3 = (char *) 0 ; - void *arg4 = (void *) 0 ; - size_t arg5 ; - lldb::SBAddress *argp2 ; - lldb::SBInstructionList result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTarget **)&jarg1; - argp2 = *(lldb::SBAddress **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBAddress"); - return 0; - } - arg2 = *argp2; - arg3 = 0; - if (jarg3) { - arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); - if (!arg3) return 0; - } - arg4 = *(void **)&jarg4; - arg5 = (size_t)jarg5; - result = (arg1)->GetInstructionsWithFlavor(arg2,(char const *)arg3,(void const *)arg4,arg5); - *(lldb::SBInstructionList **)&jresult = new lldb::SBInstructionList(result); - if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1FindSymbols_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jint jarg3) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SymbolType arg3 ; - lldb::SBSymbolContextList result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = (lldb::SymbolType)jarg3; - result = (arg1)->FindSymbols((char const *)arg2,arg3); - *(lldb::SBSymbolContextList **)&jresult = new lldb::SBSymbolContextList(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1FindSymbols_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBSymbolContextList result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (arg1)->FindSymbols((char const *)arg2); - *(lldb::SBSymbolContextList **)&jresult = new lldb::SBSymbolContextList(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTarget_1GetDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3) { - jboolean jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBStream *arg2 = 0 ; - lldb::DescriptionLevel arg3 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - arg3 = (lldb::DescriptionLevel)jarg3; - result = (bool)(arg1)->GetDescription(*arg2,arg3); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1EvaluateExpression_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (arg1)->EvaluateExpression((char const *)arg2); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1EvaluateExpression_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jobject jarg3_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBExpressionOptions *arg3 = 0 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = *(lldb::SBExpressionOptions **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBExpressionOptions const & is null"); - return 0; - } - result = (arg1)->EvaluateExpression((char const *)arg2,(lldb::SBExpressionOptions const &)*arg3); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBTarget_1GetStackRedZoneSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::addr_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - result = (lldb::addr_t)(arg1)->GetStackRedZoneSize(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTarget_1IsLoaded(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBModule *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = *(lldb::SBModule **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBModule const & is null"); - return 0; - } - result = (bool)((lldb::SBTarget const *)arg1)->IsLoaded((lldb::SBModule const &)*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1GetLaunchInfo(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - SwigValueWrapper< lldb::SBLaunchInfo > result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - result = ((lldb::SBTarget const *)arg1)->GetLaunchInfo(); - *(lldb::SBLaunchInfo **)&jresult = new lldb::SBLaunchInfo(result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBTarget_1SetLaunchInfo(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBLaunchInfo *arg2 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = *(lldb::SBLaunchInfo **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBLaunchInfo const & is null"); - return ; - } - (arg1)->SetLaunchInfo((lldb::SBLaunchInfo const &)*arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1GetTrace(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBTrace result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - result = (arg1)->GetTrace(); - *(lldb::SBTrace **)&jresult = new lldb::SBTrace(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTarget_1CreateTrace(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - lldb::SBError *arg2 = 0 ; - lldb::SBTrace result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTarget **)&jarg1; - arg2 = *(lldb::SBError **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - result = (arg1)->CreateTrace(*arg2); - *(lldb::SBTrace **)&jresult = new lldb::SBTrace(result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBTarget_1_1_1repr_1_1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBTarget *arg1 = (lldb::SBTarget *) 0 ; - std::string result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTarget **)&jarg1; - result = lldb_SBTarget___repr__(arg1); - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBThread_1eBroadcastBitStackChanged_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)lldb::SBThread::eBroadcastBitStackChanged; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBThread_1eBroadcastBitThreadSuspended_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)lldb::SBThread::eBroadcastBitThreadSuspended; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBThread_1eBroadcastBitThreadResumed_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)lldb::SBThread::eBroadcastBitThreadResumed; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBThread_1eBroadcastBitSelectedFrameChanged_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)lldb::SBThread::eBroadcastBitSelectedFrameChanged; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBThread_1eBroadcastBitThreadSelected_1get(JNIEnv *jenv, jclass jcls) { - jint jresult = 0 ; - int result; - - (void)jenv; - (void)jcls; - result = (int)lldb::SBThread::eBroadcastBitThreadSelected; - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBThread_1GetBroadcasterClassName(JNIEnv *jenv, jclass jcls) { - jstring jresult = 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - result = (char *)lldb::SBThread::GetBroadcasterClassName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBThread_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBThread *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBThread *)new lldb::SBThread(); - *(lldb::SBThread **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBThread_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBThread *arg1 = 0 ; - lldb::SBThread *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThread **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBThread const & is null"); - return 0; - } - result = (lldb::SBThread *)new lldb::SBThread((lldb::SBThread const &)*arg1); - *(lldb::SBThread **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBThread(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBThread **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBThread_1GetQueue(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - lldb::SBQueue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThread **)&jarg1; - result = ((lldb::SBThread const *)arg1)->GetQueue(); - *(lldb::SBQueue **)&jresult = new lldb::SBQueue(result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBThread_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThread **)&jarg1; - result = (bool)((lldb::SBThread const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBThread_1Clear(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThread **)&jarg1; - (arg1)->Clear(); -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBThread_1GetStopReason(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - lldb::StopReason result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThread **)&jarg1; - result = (lldb::StopReason)(arg1)->GetStopReason(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBThread_1GetStopReasonDataCount(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - size_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThread **)&jarg1; - result = (arg1)->GetStopReasonDataCount(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBThread_1GetStopReasonDataAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jobject jresult = 0 ; - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - uint32_t arg2 ; - uint64_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThread **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (uint64_t)(arg1)->GetStopReasonDataAtIndex(arg2); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBThread_1GetStopReasonExtendedInfoAsJSON(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - lldb::SBStream *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBThread **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - result = (bool)(arg1)->GetStopReasonExtendedInfoAsJSON(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBThread_1GetStopReasonExtendedBacktraces(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - jlong jresult = 0 ; - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - lldb::InstrumentationRuntimeType arg2 ; - lldb::SBThreadCollection result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThread **)&jarg1; - arg2 = (lldb::InstrumentationRuntimeType)jarg2; - result = (arg1)->GetStopReasonExtendedBacktraces(arg2); - *(lldb::SBThreadCollection **)&jresult = new lldb::SBThreadCollection(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBThread_1GetStopDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3) { - jlong jresult = 0 ; - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - char *arg2 = (char *) 0 ; - size_t arg3 ; - size_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThread **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = (size_t)jarg3; - result = (arg1)->GetStopDescription(arg2,arg3); - jresult = (jlong)result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBThread_1GetStopReturnValue(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThread **)&jarg1; - result = (arg1)->GetStopReturnValue(); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBThread_1GetThreadID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - lldb::tid_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThread **)&jarg1; - result = (lldb::tid_t)((lldb::SBThread const *)arg1)->GetThreadID(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBThread_1GetIndexID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThread **)&jarg1; - result = (uint32_t)((lldb::SBThread const *)arg1)->GetIndexID(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBThread_1GetName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThread **)&jarg1; - result = (char *)((lldb::SBThread const *)arg1)->GetName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBThread_1GetQueueName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThread **)&jarg1; - result = (char *)((lldb::SBThread const *)arg1)->GetQueueName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBThread_1GetQueueID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - lldb::queue_id_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThread **)&jarg1; - result = (lldb::queue_id_t)((lldb::SBThread const *)arg1)->GetQueueID(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBThread_1GetInfoItemByPathAsString(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jobject jarg3_) { - jboolean jresult = 0 ; - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBStream *arg3 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - arg1 = *(lldb::SBThread **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = *(lldb::SBStream **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - result = (bool)(arg1)->GetInfoItemByPathAsString((char const *)arg2,*arg3); - jresult = (jboolean)result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBThread_1StepOver_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - lldb::RunMode arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThread **)&jarg1; - arg2 = (lldb::RunMode)jarg2; - (arg1)->StepOver(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBThread_1StepOver_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThread **)&jarg1; - (arg1)->StepOver(); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBThread_1StepOver_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jlong jarg3, jobject jarg3_) { - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - lldb::RunMode arg2 ; - lldb::SBError *arg3 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - arg1 = *(lldb::SBThread **)&jarg1; - arg2 = (lldb::RunMode)jarg2; - arg3 = *(lldb::SBError **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return ; - } - (arg1)->StepOver(arg2,*arg3); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBThread_1StepInto_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - lldb::RunMode arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThread **)&jarg1; - arg2 = (lldb::RunMode)jarg2; - (arg1)->StepInto(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBThread_1StepInto_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThread **)&jarg1; - (arg1)->StepInto(); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBThread_1StepInto_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jint jarg3) { - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - char *arg2 = (char *) 0 ; - lldb::RunMode arg3 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThread **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - arg3 = (lldb::RunMode)jarg3; - (arg1)->StepInto((char const *)arg2,arg3); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBThread_1StepInto_1_1SWIG_13(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThread **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->StepInto((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBThread_1StepInto_1_1SWIG_14(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jlong jarg4, jobject jarg4_, jint jarg5) { - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - char *arg2 = (char *) 0 ; - uint32_t arg3 ; - lldb::SBError *arg4 = 0 ; - lldb::RunMode arg5 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg4_; - arg1 = *(lldb::SBThread **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - arg3 = (uint32_t)jarg3; - arg4 = *(lldb::SBError **)&jarg4; - if (!arg4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return ; - } - arg5 = (lldb::RunMode)jarg5; - (arg1)->StepInto((char const *)arg2,arg3,*arg4,arg5); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBThread_1StepInto_1_1SWIG_15(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jlong jarg4, jobject jarg4_) { - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - char *arg2 = (char *) 0 ; - uint32_t arg3 ; - lldb::SBError *arg4 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg4_; - arg1 = *(lldb::SBThread **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - arg3 = (uint32_t)jarg3; - arg4 = *(lldb::SBError **)&jarg4; - if (!arg4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return ; - } - (arg1)->StepInto((char const *)arg2,arg3,*arg4); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBThread_1StepOut_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThread **)&jarg1; - (arg1)->StepOut(); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBThread_1StepOut_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - lldb::SBError *arg2 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBThread **)&jarg1; - arg2 = *(lldb::SBError **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return ; - } - (arg1)->StepOut(*arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBThread_1StepOutOfFrame_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - lldb::SBFrame *arg2 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBThread **)&jarg1; - arg2 = *(lldb::SBFrame **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFrame & is null"); - return ; - } - (arg1)->StepOutOfFrame(*arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBThread_1StepOutOfFrame_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_) { - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - lldb::SBFrame *arg2 = 0 ; - lldb::SBError *arg3 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - arg1 = *(lldb::SBThread **)&jarg1; - arg2 = *(lldb::SBFrame **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFrame & is null"); - return ; - } - arg3 = *(lldb::SBError **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return ; - } - (arg1)->StepOutOfFrame(*arg2,*arg3); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBThread_1StepInstruction_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThread **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->StepInstruction(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBThread_1StepInstruction_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2, jlong jarg3, jobject jarg3_) { - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - bool arg2 ; - lldb::SBError *arg3 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - arg1 = *(lldb::SBThread **)&jarg1; - arg2 = jarg2 ? true : false; - arg3 = *(lldb::SBError **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return ; - } - (arg1)->StepInstruction(arg2,*arg3); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBThread_1StepOverUntil(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_, jlong jarg4) { - jlong jresult = 0 ; - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - lldb::SBFrame *arg2 = 0 ; - lldb::SBFileSpec *arg3 = 0 ; - uint32_t arg4 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - arg1 = *(lldb::SBThread **)&jarg1; - arg2 = *(lldb::SBFrame **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFrame & is null"); - return 0; - } - arg3 = *(lldb::SBFileSpec **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec & is null"); - return 0; - } - arg4 = (uint32_t)jarg4; - result = (arg1)->StepOverUntil(*arg2,*arg3,arg4); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBThread_1StepUsingScriptedThreadPlan_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThread **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (arg1)->StepUsingScriptedThreadPlan((char const *)arg2); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBThread_1StepUsingScriptedThreadPlan_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jboolean jarg3) { - jlong jresult = 0 ; - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - char *arg2 = (char *) 0 ; - bool arg3 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThread **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = jarg3 ? true : false; - result = (arg1)->StepUsingScriptedThreadPlan((char const *)arg2,arg3); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBThread_1StepUsingScriptedThreadPlan_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jobject jarg3_, jboolean jarg4) { - jlong jresult = 0 ; - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBStructuredData *arg3 = 0 ; - bool arg4 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - arg1 = *(lldb::SBThread **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = *(lldb::SBStructuredData **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStructuredData & is null"); - return 0; - } - arg4 = jarg4 ? true : false; - result = (arg1)->StepUsingScriptedThreadPlan((char const *)arg2,*arg3,arg4); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBThread_1JumpToLine(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3) { - jlong jresult = 0 ; - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - lldb::SBFileSpec *arg2 = 0 ; - uint32_t arg3 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBThread **)&jarg1; - arg2 = *(lldb::SBFileSpec **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec & is null"); - return 0; - } - arg3 = (uint32_t)jarg3; - result = (arg1)->JumpToLine(*arg2,arg3); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBThread_1RunToAddress_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2) { - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - lldb::addr_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThread **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return ; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (lldb::addr_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - (arg1)->RunToAddress(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBThread_1RunToAddress_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2, jlong jarg3, jobject jarg3_) { - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - lldb::addr_t arg2 ; - lldb::SBError *arg3 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - arg1 = *(lldb::SBThread **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return ; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (lldb::addr_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - arg3 = *(lldb::SBError **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return ; - } - (arg1)->RunToAddress(arg2,*arg3); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBThread_1ReturnFromFrame(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_) { - jlong jresult = 0 ; - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - lldb::SBFrame *arg2 = 0 ; - lldb::SBValue *arg3 = 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - arg1 = *(lldb::SBThread **)&jarg1; - arg2 = *(lldb::SBFrame **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFrame & is null"); - return 0; - } - arg3 = *(lldb::SBValue **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBValue & is null"); - return 0; - } - result = (arg1)->ReturnFromFrame(*arg2,*arg3); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBThread_1UnwindInnermostExpression(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThread **)&jarg1; - result = (arg1)->UnwindInnermostExpression(); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBThread_1Suspend_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThread **)&jarg1; - result = (bool)(arg1)->Suspend(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBThread_1Suspend_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - lldb::SBError *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBThread **)&jarg1; - arg2 = *(lldb::SBError **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - result = (bool)(arg1)->Suspend(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBThread_1Resume_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThread **)&jarg1; - result = (bool)(arg1)->Resume(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBThread_1Resume_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - lldb::SBError *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBThread **)&jarg1; - arg2 = *(lldb::SBError **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - result = (bool)(arg1)->Resume(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBThread_1IsSuspended(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThread **)&jarg1; - result = (bool)(arg1)->IsSuspended(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBThread_1IsStopped(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThread **)&jarg1; - result = (bool)(arg1)->IsStopped(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBThread_1GetNumFrames(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThread **)&jarg1; - result = (uint32_t)(arg1)->GetNumFrames(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBThread_1GetFrameAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - uint32_t arg2 ; - lldb::SBFrame result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThread **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (arg1)->GetFrameAtIndex(arg2); - *(lldb::SBFrame **)&jresult = new lldb::SBFrame(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBThread_1GetSelectedFrame(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - lldb::SBFrame result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThread **)&jarg1; - result = (arg1)->GetSelectedFrame(); - *(lldb::SBFrame **)&jresult = new lldb::SBFrame(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBThread_1SetSelectedFrame(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - uint32_t arg2 ; - lldb::SBFrame result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThread **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (arg1)->SetSelectedFrame(arg2); - *(lldb::SBFrame **)&jresult = new lldb::SBFrame(result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBThread_1EventIsThreadEvent(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBEvent *arg1 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEvent **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent const & is null"); - return 0; - } - result = (bool)lldb::SBThread::EventIsThreadEvent((lldb::SBEvent const &)*arg1); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBThread_1GetStackFrameFromEvent(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBEvent *arg1 = 0 ; - lldb::SBFrame result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEvent **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent const & is null"); - return 0; - } - result = lldb::SBThread::GetStackFrameFromEvent((lldb::SBEvent const &)*arg1); - *(lldb::SBFrame **)&jresult = new lldb::SBFrame(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBThread_1GetThreadFromEvent(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBEvent *arg1 = 0 ; - lldb::SBThread result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEvent **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent const & is null"); - return 0; - } - result = lldb::SBThread::GetThreadFromEvent((lldb::SBEvent const &)*arg1); - *(lldb::SBThread **)&jresult = new lldb::SBThread(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBThread_1GetProcess(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - lldb::SBProcess result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThread **)&jarg1; - result = (arg1)->GetProcess(); - *(lldb::SBProcess **)&jresult = new lldb::SBProcess(result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBThread_1GetDescription_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - lldb::SBStream *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBThread **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - result = (bool)((lldb::SBThread const *)arg1)->GetDescription(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBThread_1GetDescription_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jboolean jarg3) { - jboolean jresult = 0 ; - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - lldb::SBStream *arg2 = 0 ; - bool arg3 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBThread **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - arg3 = jarg3 ? true : false; - result = (bool)((lldb::SBThread const *)arg1)->GetDescription(*arg2,arg3); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBThread_1GetStatus(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - lldb::SBStream *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBThread **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - result = (bool)((lldb::SBThread const *)arg1)->GetStatus(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBThread_1GetExtendedBacktraceThread(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBThread result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThread **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (arg1)->GetExtendedBacktraceThread((char const *)arg2); - *(lldb::SBThread **)&jresult = new lldb::SBThread(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBThread_1GetExtendedBacktraceOriginatingIndexID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThread **)&jarg1; - result = (uint32_t)(arg1)->GetExtendedBacktraceOriginatingIndexID(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBThread_1GetCurrentException(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThread **)&jarg1; - result = (arg1)->GetCurrentException(); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBThread_1GetCurrentExceptionBacktrace(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - lldb::SBThread result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThread **)&jarg1; - result = (arg1)->GetCurrentExceptionBacktrace(); - *(lldb::SBThread **)&jresult = new lldb::SBThread(result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBThread_1SafeToCallFunctions(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThread **)&jarg1; - result = (bool)(arg1)->SafeToCallFunctions(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBThread_1GetSiginfo(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThread **)&jarg1; - result = (arg1)->GetSiginfo(); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBThread_1_1_1repr_1_1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBThread *arg1 = (lldb::SBThread *) 0 ; - std::string result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThread **)&jarg1; - result = lldb_SBThread___repr__(arg1); - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBThreadCollection_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBThreadCollection *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBThreadCollection *)new lldb::SBThreadCollection(); - *(lldb::SBThreadCollection **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBThreadCollection_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBThreadCollection *arg1 = 0 ; - lldb::SBThreadCollection *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThreadCollection **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBThreadCollection const & is null"); - return 0; - } - result = (lldb::SBThreadCollection *)new lldb::SBThreadCollection((lldb::SBThreadCollection const &)*arg1); - *(lldb::SBThreadCollection **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBThreadCollection(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBThreadCollection *arg1 = (lldb::SBThreadCollection *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBThreadCollection **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBThreadCollection_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBThreadCollection *arg1 = (lldb::SBThreadCollection *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThreadCollection **)&jarg1; - result = (bool)((lldb::SBThreadCollection const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBThreadCollection_1GetSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBThreadCollection *arg1 = (lldb::SBThreadCollection *) 0 ; - size_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThreadCollection **)&jarg1; - result = (arg1)->GetSize(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBThreadCollection_1GetThreadAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBThreadCollection *arg1 = (lldb::SBThreadCollection *) 0 ; - size_t arg2 ; - lldb::SBThread result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThreadCollection **)&jarg1; - arg2 = (size_t)jarg2; - result = (arg1)->GetThreadAtIndex(arg2); - *(lldb::SBThread **)&jresult = new lldb::SBThread(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBThreadPlan_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBThreadPlan *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBThreadPlan *)new lldb::SBThreadPlan(); - *(lldb::SBThreadPlan **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBThreadPlan_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBThreadPlan *arg1 = 0 ; - lldb::SBThreadPlan *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThreadPlan **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBThreadPlan const & is null"); - return 0; - } - result = (lldb::SBThreadPlan *)new lldb::SBThreadPlan((lldb::SBThreadPlan const &)*arg1); - *(lldb::SBThreadPlan **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBThreadPlan_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBThread *arg1 = 0 ; - char *arg2 = (char *) 0 ; - lldb::SBThreadPlan *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThread **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBThread & is null"); - return 0; - } - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (lldb::SBThreadPlan *)new lldb::SBThreadPlan(*arg1,(char const *)arg2); - *(lldb::SBThreadPlan **)&jresult = result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBThreadPlan_1_1SWIG_13(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jobject jarg3_) { - jlong jresult = 0 ; - lldb::SBThread *arg1 = 0 ; - char *arg2 = (char *) 0 ; - lldb::SBStructuredData *arg3 = 0 ; - lldb::SBThreadPlan *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - arg1 = *(lldb::SBThread **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBThread & is null"); - return 0; - } - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = *(lldb::SBStructuredData **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStructuredData & is null"); - return 0; - } - result = (lldb::SBThreadPlan *)new lldb::SBThreadPlan(*arg1,(char const *)arg2,*arg3); - *(lldb::SBThreadPlan **)&jresult = result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBThreadPlan(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBThreadPlan *arg1 = (lldb::SBThreadPlan *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBThreadPlan **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBThreadPlan_1IsValid_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBThreadPlan *arg1 = (lldb::SBThreadPlan *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThreadPlan **)&jarg1; - result = (bool)((lldb::SBThreadPlan const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBThreadPlan_1Clear(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBThreadPlan *arg1 = (lldb::SBThreadPlan *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThreadPlan **)&jarg1; - (arg1)->Clear(); -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBThreadPlan_1GetStopReason(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBThreadPlan *arg1 = (lldb::SBThreadPlan *) 0 ; - lldb::StopReason result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThreadPlan **)&jarg1; - result = (lldb::StopReason)(arg1)->GetStopReason(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBThreadPlan_1GetStopReasonDataCount(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBThreadPlan *arg1 = (lldb::SBThreadPlan *) 0 ; - size_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThreadPlan **)&jarg1; - result = (arg1)->GetStopReasonDataCount(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBThreadPlan_1GetStopReasonDataAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jobject jresult = 0 ; - lldb::SBThreadPlan *arg1 = (lldb::SBThreadPlan *) 0 ; - uint32_t arg2 ; - uint64_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThreadPlan **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (uint64_t)(arg1)->GetStopReasonDataAtIndex(arg2); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBThreadPlan_1GetThread(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBThreadPlan *arg1 = (lldb::SBThreadPlan *) 0 ; - lldb::SBThread result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThreadPlan **)&jarg1; - result = ((lldb::SBThreadPlan const *)arg1)->GetThread(); - *(lldb::SBThread **)&jresult = new lldb::SBThread(result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBThreadPlan_1GetDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBThreadPlan *arg1 = (lldb::SBThreadPlan *) 0 ; - lldb::SBStream *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBThreadPlan **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - result = (bool)((lldb::SBThreadPlan const *)arg1)->GetDescription(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBThreadPlan_1SetPlanComplete(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBThreadPlan *arg1 = (lldb::SBThreadPlan *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThreadPlan **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetPlanComplete(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBThreadPlan_1IsPlanComplete(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBThreadPlan *arg1 = (lldb::SBThreadPlan *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThreadPlan **)&jarg1; - result = (bool)(arg1)->IsPlanComplete(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBThreadPlan_1IsPlanStale(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBThreadPlan *arg1 = (lldb::SBThreadPlan *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThreadPlan **)&jarg1; - result = (bool)(arg1)->IsPlanStale(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBThreadPlan_1GetStopOthers(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBThreadPlan *arg1 = (lldb::SBThreadPlan *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThreadPlan **)&jarg1; - result = (bool)(arg1)->GetStopOthers(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBThreadPlan_1SetStopOthers(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBThreadPlan *arg1 = (lldb::SBThreadPlan *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThreadPlan **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetStopOthers(arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBThreadPlan_1QueueThreadPlanForStepOverRange_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jobject jarg3) { - jlong jresult = 0 ; - lldb::SBThreadPlan *arg1 = (lldb::SBThreadPlan *) 0 ; - lldb::SBAddress *arg2 = 0 ; - lldb::addr_t arg3 ; - lldb::SBThreadPlan result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBThreadPlan **)&jarg1; - arg2 = *(lldb::SBAddress **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBAddress & is null"); - return 0; - } - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg3); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg3, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg3 = 0; - if (sz > 0) { - arg3 = (lldb::addr_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (arg1)->QueueThreadPlanForStepOverRange(*arg2,arg3); - *(lldb::SBThreadPlan **)&jresult = new lldb::SBThreadPlan(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBThreadPlan_1QueueThreadPlanForStepOverRange_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jobject jarg3, jlong jarg4, jobject jarg4_) { - jlong jresult = 0 ; - lldb::SBThreadPlan *arg1 = (lldb::SBThreadPlan *) 0 ; - lldb::SBAddress *arg2 = 0 ; - lldb::addr_t arg3 ; - lldb::SBError *arg4 = 0 ; - lldb::SBThreadPlan result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg4_; - arg1 = *(lldb::SBThreadPlan **)&jarg1; - arg2 = *(lldb::SBAddress **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBAddress & is null"); - return 0; - } - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg3); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg3, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg3 = 0; - if (sz > 0) { - arg3 = (lldb::addr_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - arg4 = *(lldb::SBError **)&jarg4; - if (!arg4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - result = (arg1)->QueueThreadPlanForStepOverRange(*arg2,arg3,*arg4); - *(lldb::SBThreadPlan **)&jresult = new lldb::SBThreadPlan(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBThreadPlan_1QueueThreadPlanForStepInRange_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jobject jarg3) { - jlong jresult = 0 ; - lldb::SBThreadPlan *arg1 = (lldb::SBThreadPlan *) 0 ; - lldb::SBAddress *arg2 = 0 ; - lldb::addr_t arg3 ; - lldb::SBThreadPlan result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBThreadPlan **)&jarg1; - arg2 = *(lldb::SBAddress **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBAddress & is null"); - return 0; - } - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg3); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg3, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg3 = 0; - if (sz > 0) { - arg3 = (lldb::addr_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (arg1)->QueueThreadPlanForStepInRange(*arg2,arg3); - *(lldb::SBThreadPlan **)&jresult = new lldb::SBThreadPlan(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBThreadPlan_1QueueThreadPlanForStepInRange_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jobject jarg3, jlong jarg4, jobject jarg4_) { - jlong jresult = 0 ; - lldb::SBThreadPlan *arg1 = (lldb::SBThreadPlan *) 0 ; - lldb::SBAddress *arg2 = 0 ; - lldb::addr_t arg3 ; - lldb::SBError *arg4 = 0 ; - lldb::SBThreadPlan result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg4_; - arg1 = *(lldb::SBThreadPlan **)&jarg1; - arg2 = *(lldb::SBAddress **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBAddress & is null"); - return 0; - } - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg3); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg3, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg3 = 0; - if (sz > 0) { - arg3 = (lldb::addr_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - arg4 = *(lldb::SBError **)&jarg4; - if (!arg4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - result = (arg1)->QueueThreadPlanForStepInRange(*arg2,arg3,*arg4); - *(lldb::SBThreadPlan **)&jresult = new lldb::SBThreadPlan(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBThreadPlan_1QueueThreadPlanForStepOut_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jboolean jarg3) { - jlong jresult = 0 ; - lldb::SBThreadPlan *arg1 = (lldb::SBThreadPlan *) 0 ; - uint32_t arg2 ; - bool arg3 ; - lldb::SBThreadPlan result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThreadPlan **)&jarg1; - arg2 = (uint32_t)jarg2; - arg3 = jarg3 ? true : false; - result = (arg1)->QueueThreadPlanForStepOut(arg2,arg3); - *(lldb::SBThreadPlan **)&jresult = new lldb::SBThreadPlan(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBThreadPlan_1QueueThreadPlanForStepOut_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBThreadPlan *arg1 = (lldb::SBThreadPlan *) 0 ; - uint32_t arg2 ; - lldb::SBThreadPlan result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThreadPlan **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (arg1)->QueueThreadPlanForStepOut(arg2); - *(lldb::SBThreadPlan **)&jresult = new lldb::SBThreadPlan(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBThreadPlan_1QueueThreadPlanForStepOut_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jboolean jarg3, jlong jarg4, jobject jarg4_) { - jlong jresult = 0 ; - lldb::SBThreadPlan *arg1 = (lldb::SBThreadPlan *) 0 ; - uint32_t arg2 ; - bool arg3 ; - lldb::SBError *arg4 = 0 ; - lldb::SBThreadPlan result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg4_; - arg1 = *(lldb::SBThreadPlan **)&jarg1; - arg2 = (uint32_t)jarg2; - arg3 = jarg3 ? true : false; - arg4 = *(lldb::SBError **)&jarg4; - if (!arg4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - result = (arg1)->QueueThreadPlanForStepOut(arg2,arg3,*arg4); - *(lldb::SBThreadPlan **)&jresult = new lldb::SBThreadPlan(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBThreadPlan_1QueueThreadPlanForRunToAddress_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBThreadPlan *arg1 = (lldb::SBThreadPlan *) 0 ; - lldb::SBAddress arg2 ; - lldb::SBAddress *argp2 ; - lldb::SBThreadPlan result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBThreadPlan **)&jarg1; - argp2 = *(lldb::SBAddress **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBAddress"); - return 0; - } - arg2 = *argp2; - result = (arg1)->QueueThreadPlanForRunToAddress(arg2); - *(lldb::SBThreadPlan **)&jresult = new lldb::SBThreadPlan(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBThreadPlan_1QueueThreadPlanForRunToAddress_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_) { - jlong jresult = 0 ; - lldb::SBThreadPlan *arg1 = (lldb::SBThreadPlan *) 0 ; - lldb::SBAddress arg2 ; - lldb::SBError *arg3 = 0 ; - lldb::SBAddress *argp2 ; - lldb::SBThreadPlan result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - arg1 = *(lldb::SBThreadPlan **)&jarg1; - argp2 = *(lldb::SBAddress **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBAddress"); - return 0; - } - arg2 = *argp2; - arg3 = *(lldb::SBError **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - result = (arg1)->QueueThreadPlanForRunToAddress(arg2,*arg3); - *(lldb::SBThreadPlan **)&jresult = new lldb::SBThreadPlan(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBThreadPlan_1QueueThreadPlanForStepScripted_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBThreadPlan *arg1 = (lldb::SBThreadPlan *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBThreadPlan result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBThreadPlan **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (arg1)->QueueThreadPlanForStepScripted((char const *)arg2); - *(lldb::SBThreadPlan **)&jresult = new lldb::SBThreadPlan(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBThreadPlan_1QueueThreadPlanForStepScripted_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jobject jarg3_) { - jlong jresult = 0 ; - lldb::SBThreadPlan *arg1 = (lldb::SBThreadPlan *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBError *arg3 = 0 ; - lldb::SBThreadPlan result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - arg1 = *(lldb::SBThreadPlan **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = *(lldb::SBError **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - result = (arg1)->QueueThreadPlanForStepScripted((char const *)arg2,*arg3); - *(lldb::SBThreadPlan **)&jresult = new lldb::SBThreadPlan(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBThreadPlan_1QueueThreadPlanForStepScripted_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jobject jarg3_, jlong jarg4, jobject jarg4_) { - jlong jresult = 0 ; - lldb::SBThreadPlan *arg1 = (lldb::SBThreadPlan *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBStructuredData *arg3 = 0 ; - lldb::SBError *arg4 = 0 ; - lldb::SBThreadPlan result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - (void)jarg4_; - arg1 = *(lldb::SBThreadPlan **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = *(lldb::SBStructuredData **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStructuredData & is null"); - return 0; - } - arg4 = *(lldb::SBError **)&jarg4; - if (!arg4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - result = (arg1)->QueueThreadPlanForStepScripted((char const *)arg2,*arg3,*arg4); - *(lldb::SBThreadPlan **)&jresult = new lldb::SBThreadPlan(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBTrace(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBTrace *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBTrace *)new lldb::SBTrace(); - *(lldb::SBTrace **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTrace_1LoadTraceFromFile(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_) { - jlong jresult = 0 ; - lldb::SBError *arg1 = 0 ; - lldb::SBDebugger *arg2 = 0 ; - lldb::SBFileSpec *arg3 = 0 ; - lldb::SBTrace result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - arg1 = *(lldb::SBError **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - arg2 = *(lldb::SBDebugger **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBDebugger & is null"); - return 0; - } - arg3 = *(lldb::SBFileSpec **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec const & is null"); - return 0; - } - result = lldb::SBTrace::LoadTraceFromFile(*arg1,*arg2,(lldb::SBFileSpec const &)*arg3); - *(lldb::SBTrace **)&jresult = new lldb::SBTrace(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTrace_1CreateNewCursor(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_) { - jlong jresult = 0 ; - lldb::SBTrace *arg1 = (lldb::SBTrace *) 0 ; - lldb::SBError *arg2 = 0 ; - lldb::SBThread *arg3 = 0 ; - lldb::SBTraceCursor result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - arg1 = *(lldb::SBTrace **)&jarg1; - arg2 = *(lldb::SBError **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - arg3 = *(lldb::SBThread **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBThread & is null"); - return 0; - } - result = (arg1)->CreateNewCursor(*arg2,*arg3); - *(lldb::SBTraceCursor **)&jresult = new lldb::SBTraceCursor(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTrace_1SaveToDisk_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_, jboolean jarg4) { - jlong jresult = 0 ; - lldb::SBTrace *arg1 = (lldb::SBTrace *) 0 ; - lldb::SBError *arg2 = 0 ; - lldb::SBFileSpec *arg3 = 0 ; - bool arg4 ; - lldb::SBFileSpec result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - arg1 = *(lldb::SBTrace **)&jarg1; - arg2 = *(lldb::SBError **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - arg3 = *(lldb::SBFileSpec **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec const & is null"); - return 0; - } - arg4 = jarg4 ? true : false; - result = (arg1)->SaveToDisk(*arg2,(lldb::SBFileSpec const &)*arg3,arg4); - *(lldb::SBFileSpec **)&jresult = new lldb::SBFileSpec(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTrace_1SaveToDisk_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_) { - jlong jresult = 0 ; - lldb::SBTrace *arg1 = (lldb::SBTrace *) 0 ; - lldb::SBError *arg2 = 0 ; - lldb::SBFileSpec *arg3 = 0 ; - lldb::SBFileSpec result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - arg1 = *(lldb::SBTrace **)&jarg1; - arg2 = *(lldb::SBError **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - arg3 = *(lldb::SBFileSpec **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBFileSpec const & is null"); - return 0; - } - result = (arg1)->SaveToDisk(*arg2,(lldb::SBFileSpec const &)*arg3); - *(lldb::SBFileSpec **)&jresult = new lldb::SBFileSpec(result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBTrace_1GetStartConfigurationHelp(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBTrace *arg1 = (lldb::SBTrace *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTrace **)&jarg1; - result = (char *)(arg1)->GetStartConfigurationHelp(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTrace_1Start_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBTrace *arg1 = (lldb::SBTrace *) 0 ; - lldb::SBStructuredData *arg2 = 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTrace **)&jarg1; - arg2 = *(lldb::SBStructuredData **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStructuredData const & is null"); - return 0; - } - result = (arg1)->Start((lldb::SBStructuredData const &)*arg2); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTrace_1Start_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_) { - jlong jresult = 0 ; - lldb::SBTrace *arg1 = (lldb::SBTrace *) 0 ; - lldb::SBThread *arg2 = 0 ; - lldb::SBStructuredData *arg3 = 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - arg1 = *(lldb::SBTrace **)&jarg1; - arg2 = *(lldb::SBThread **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBThread const & is null"); - return 0; - } - arg3 = *(lldb::SBStructuredData **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStructuredData const & is null"); - return 0; - } - result = (arg1)->Start((lldb::SBThread const &)*arg2,(lldb::SBStructuredData const &)*arg3); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTrace_1Stop_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTrace *arg1 = (lldb::SBTrace *) 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTrace **)&jarg1; - result = (arg1)->Stop(); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTrace_1Stop_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBTrace *arg1 = (lldb::SBTrace *) 0 ; - lldb::SBThread *arg2 = 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTrace **)&jarg1; - arg2 = *(lldb::SBThread **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBThread const & is null"); - return 0; - } - result = (arg1)->Stop((lldb::SBThread const &)*arg2); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTrace_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBTrace *arg1 = (lldb::SBTrace *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTrace **)&jarg1; - result = (bool)(arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBTrace(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBTrace *arg1 = (lldb::SBTrace *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBTrace **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBTraceCursor(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBTraceCursor *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBTraceCursor *)new lldb::SBTraceCursor(); - *(lldb::SBTraceCursor **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBTraceCursor_1SetForwards(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBTraceCursor *arg1 = (lldb::SBTraceCursor *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTraceCursor **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetForwards(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTraceCursor_1IsForwards(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBTraceCursor *arg1 = (lldb::SBTraceCursor *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTraceCursor **)&jarg1; - result = (bool)((lldb::SBTraceCursor const *)arg1)->IsForwards(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBTraceCursor_1Next(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBTraceCursor *arg1 = (lldb::SBTraceCursor *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTraceCursor **)&jarg1; - (arg1)->Next(); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTraceCursor_1HasValue(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBTraceCursor *arg1 = (lldb::SBTraceCursor *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTraceCursor **)&jarg1; - result = (bool)((lldb::SBTraceCursor const *)arg1)->HasValue(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTraceCursor_1GoToId(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2) { - jboolean jresult = 0 ; - lldb::SBTraceCursor *arg1 = (lldb::SBTraceCursor *) 0 ; - lldb::user_id_t arg2 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTraceCursor **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (lldb::user_id_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (bool)(arg1)->GoToId(arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTraceCursor_1HasId(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2) { - jboolean jresult = 0 ; - lldb::SBTraceCursor *arg1 = (lldb::SBTraceCursor *) 0 ; - lldb::user_id_t arg2 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTraceCursor **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (lldb::user_id_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (bool)((lldb::SBTraceCursor const *)arg1)->HasId(arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBTraceCursor_1GetId(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBTraceCursor *arg1 = (lldb::SBTraceCursor *) 0 ; - lldb::user_id_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTraceCursor **)&jarg1; - result = (lldb::user_id_t)((lldb::SBTraceCursor const *)arg1)->GetId(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTraceCursor_1Seek(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jint jarg3) { - jboolean jresult = 0 ; - lldb::SBTraceCursor *arg1 = (lldb::SBTraceCursor *) 0 ; - int64_t arg2 ; - lldb::TraceCursorSeekType arg3 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTraceCursor **)&jarg1; - arg2 = (int64_t)jarg2; - arg3 = (lldb::TraceCursorSeekType)jarg3; - result = (bool)(arg1)->Seek(arg2,arg3); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBTraceCursor_1GetItemKind(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBTraceCursor *arg1 = (lldb::SBTraceCursor *) 0 ; - lldb::TraceItemKind result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTraceCursor **)&jarg1; - result = (lldb::TraceItemKind)((lldb::SBTraceCursor const *)arg1)->GetItemKind(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTraceCursor_1IsError(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBTraceCursor *arg1 = (lldb::SBTraceCursor *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTraceCursor **)&jarg1; - result = (bool)((lldb::SBTraceCursor const *)arg1)->IsError(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBTraceCursor_1GetError(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBTraceCursor *arg1 = (lldb::SBTraceCursor *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTraceCursor **)&jarg1; - result = (char *)((lldb::SBTraceCursor const *)arg1)->GetError(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTraceCursor_1IsEvent(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBTraceCursor *arg1 = (lldb::SBTraceCursor *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTraceCursor **)&jarg1; - result = (bool)((lldb::SBTraceCursor const *)arg1)->IsEvent(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBTraceCursor_1GetEventType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBTraceCursor *arg1 = (lldb::SBTraceCursor *) 0 ; - lldb::TraceEvent result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTraceCursor **)&jarg1; - result = (lldb::TraceEvent)((lldb::SBTraceCursor const *)arg1)->GetEventType(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBTraceCursor_1GetEventTypeAsString(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBTraceCursor *arg1 = (lldb::SBTraceCursor *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTraceCursor **)&jarg1; - result = (char *)((lldb::SBTraceCursor const *)arg1)->GetEventTypeAsString(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTraceCursor_1IsInstruction(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBTraceCursor *arg1 = (lldb::SBTraceCursor *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTraceCursor **)&jarg1; - result = (bool)((lldb::SBTraceCursor const *)arg1)->IsInstruction(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBTraceCursor_1GetLoadAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBTraceCursor *arg1 = (lldb::SBTraceCursor *) 0 ; - lldb::addr_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTraceCursor **)&jarg1; - result = (lldb::addr_t)((lldb::SBTraceCursor const *)arg1)->GetLoadAddress(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTraceCursor_1GetCPU(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTraceCursor *arg1 = (lldb::SBTraceCursor *) 0 ; - lldb::cpu_id_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTraceCursor **)&jarg1; - result = (lldb::cpu_id_t)((lldb::SBTraceCursor const *)arg1)->GetCPU(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTraceCursor_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBTraceCursor *arg1 = (lldb::SBTraceCursor *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTraceCursor **)&jarg1; - result = (bool)((lldb::SBTraceCursor const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBTraceCursor(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBTraceCursor *arg1 = (lldb::SBTraceCursor *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBTraceCursor **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBTypeMember_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBTypeMember *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBTypeMember *)new lldb::SBTypeMember(); - *(lldb::SBTypeMember **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBTypeMember_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTypeMember *arg1 = 0 ; - lldb::SBTypeMember *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeMember **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBTypeMember const & is null"); - return 0; - } - result = (lldb::SBTypeMember *)new lldb::SBTypeMember((lldb::SBTypeMember const &)*arg1); - *(lldb::SBTypeMember **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBTypeMember(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBTypeMember *arg1 = (lldb::SBTypeMember *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBTypeMember **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTypeMember_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBTypeMember *arg1 = (lldb::SBTypeMember *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeMember **)&jarg1; - result = (bool)((lldb::SBTypeMember const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBTypeMember_1GetName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBTypeMember *arg1 = (lldb::SBTypeMember *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeMember **)&jarg1; - result = (char *)(arg1)->GetName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeMember_1GetType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTypeMember *arg1 = (lldb::SBTypeMember *) 0 ; - lldb::SBType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeMember **)&jarg1; - result = (arg1)->GetType(); - *(lldb::SBType **)&jresult = new lldb::SBType(result); - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBTypeMember_1GetOffsetInBytes(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBTypeMember *arg1 = (lldb::SBTypeMember *) 0 ; - uint64_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeMember **)&jarg1; - result = (uint64_t)(arg1)->GetOffsetInBytes(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBTypeMember_1GetOffsetInBits(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBTypeMember *arg1 = (lldb::SBTypeMember *) 0 ; - uint64_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeMember **)&jarg1; - result = (uint64_t)(arg1)->GetOffsetInBits(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTypeMember_1IsBitfield(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBTypeMember *arg1 = (lldb::SBTypeMember *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeMember **)&jarg1; - result = (bool)(arg1)->IsBitfield(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeMember_1GetBitfieldSizeInBits(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTypeMember *arg1 = (lldb::SBTypeMember *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeMember **)&jarg1; - result = (uint32_t)(arg1)->GetBitfieldSizeInBits(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTypeMember_1GetDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3) { - jboolean jresult = 0 ; - lldb::SBTypeMember *arg1 = (lldb::SBTypeMember *) 0 ; - lldb::SBStream *arg2 = 0 ; - lldb::DescriptionLevel arg3 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTypeMember **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - arg3 = (lldb::DescriptionLevel)jarg3; - result = (bool)(arg1)->GetDescription(*arg2,arg3); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBTypeMember_1_1_1repr_1_1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBTypeMember *arg1 = (lldb::SBTypeMember *) 0 ; - std::string result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeMember **)&jarg1; - result = lldb_SBTypeMember___repr__(arg1); - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBTypeMemberFunction_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBTypeMemberFunction *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBTypeMemberFunction *)new lldb::SBTypeMemberFunction(); - *(lldb::SBTypeMemberFunction **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBTypeMemberFunction_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTypeMemberFunction *arg1 = 0 ; - lldb::SBTypeMemberFunction *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeMemberFunction **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBTypeMemberFunction const & is null"); - return 0; - } - result = (lldb::SBTypeMemberFunction *)new lldb::SBTypeMemberFunction((lldb::SBTypeMemberFunction const &)*arg1); - *(lldb::SBTypeMemberFunction **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBTypeMemberFunction(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBTypeMemberFunction *arg1 = (lldb::SBTypeMemberFunction *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBTypeMemberFunction **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTypeMemberFunction_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBTypeMemberFunction *arg1 = (lldb::SBTypeMemberFunction *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeMemberFunction **)&jarg1; - result = (bool)((lldb::SBTypeMemberFunction const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBTypeMemberFunction_1GetName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBTypeMemberFunction *arg1 = (lldb::SBTypeMemberFunction *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeMemberFunction **)&jarg1; - result = (char *)(arg1)->GetName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBTypeMemberFunction_1GetDemangledName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBTypeMemberFunction *arg1 = (lldb::SBTypeMemberFunction *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeMemberFunction **)&jarg1; - result = (char *)(arg1)->GetDemangledName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBTypeMemberFunction_1GetMangledName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBTypeMemberFunction *arg1 = (lldb::SBTypeMemberFunction *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeMemberFunction **)&jarg1; - result = (char *)(arg1)->GetMangledName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeMemberFunction_1GetType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTypeMemberFunction *arg1 = (lldb::SBTypeMemberFunction *) 0 ; - lldb::SBType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeMemberFunction **)&jarg1; - result = (arg1)->GetType(); - *(lldb::SBType **)&jresult = new lldb::SBType(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeMemberFunction_1GetReturnType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTypeMemberFunction *arg1 = (lldb::SBTypeMemberFunction *) 0 ; - lldb::SBType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeMemberFunction **)&jarg1; - result = (arg1)->GetReturnType(); - *(lldb::SBType **)&jresult = new lldb::SBType(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeMemberFunction_1GetNumberOfArguments(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTypeMemberFunction *arg1 = (lldb::SBTypeMemberFunction *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeMemberFunction **)&jarg1; - result = (uint32_t)(arg1)->GetNumberOfArguments(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeMemberFunction_1GetArgumentTypeAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBTypeMemberFunction *arg1 = (lldb::SBTypeMemberFunction *) 0 ; - uint32_t arg2 ; - lldb::SBType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeMemberFunction **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (arg1)->GetArgumentTypeAtIndex(arg2); - *(lldb::SBType **)&jresult = new lldb::SBType(result); - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBTypeMemberFunction_1GetKind(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBTypeMemberFunction *arg1 = (lldb::SBTypeMemberFunction *) 0 ; - lldb::MemberFunctionKind result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeMemberFunction **)&jarg1; - result = (lldb::MemberFunctionKind)(arg1)->GetKind(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTypeMemberFunction_1GetDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3) { - jboolean jresult = 0 ; - lldb::SBTypeMemberFunction *arg1 = (lldb::SBTypeMemberFunction *) 0 ; - lldb::SBStream *arg2 = 0 ; - lldb::DescriptionLevel arg3 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTypeMemberFunction **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - arg3 = (lldb::DescriptionLevel)jarg3; - result = (bool)(arg1)->GetDescription(*arg2,arg3); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBTypeMemberFunction_1_1_1repr_1_1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBTypeMemberFunction *arg1 = (lldb::SBTypeMemberFunction *) 0 ; - std::string result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeMemberFunction **)&jarg1; - result = lldb_SBTypeMemberFunction___repr__(arg1); - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBType_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBType *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBType *)new lldb::SBType(); - *(lldb::SBType **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBType_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBType *arg1 = 0 ; - lldb::SBType *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBType const & is null"); - return 0; - } - result = (lldb::SBType *)new lldb::SBType((lldb::SBType const &)*arg1); - *(lldb::SBType **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBType(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBType **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBType_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - result = (bool)((lldb::SBType const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBType_1GetByteSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - uint64_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - result = (uint64_t)(arg1)->GetByteSize(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBType_1IsPointerType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - result = (bool)(arg1)->IsPointerType(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBType_1IsReferenceType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - result = (bool)(arg1)->IsReferenceType(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBType_1IsFunctionType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - result = (bool)(arg1)->IsFunctionType(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBType_1IsPolymorphicClass(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - result = (bool)(arg1)->IsPolymorphicClass(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBType_1IsArrayType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - result = (bool)(arg1)->IsArrayType(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBType_1IsVectorType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - result = (bool)(arg1)->IsVectorType(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBType_1IsTypedefType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - result = (bool)(arg1)->IsTypedefType(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBType_1IsAnonymousType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - result = (bool)(arg1)->IsAnonymousType(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBType_1IsScopedEnumerationType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - result = (bool)(arg1)->IsScopedEnumerationType(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBType_1IsAggregateType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - result = (bool)(arg1)->IsAggregateType(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBType_1GetPointerType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - lldb::SBType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - result = (arg1)->GetPointerType(); - *(lldb::SBType **)&jresult = new lldb::SBType(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBType_1GetPointeeType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - lldb::SBType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - result = (arg1)->GetPointeeType(); - *(lldb::SBType **)&jresult = new lldb::SBType(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBType_1GetReferenceType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - lldb::SBType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - result = (arg1)->GetReferenceType(); - *(lldb::SBType **)&jresult = new lldb::SBType(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBType_1GetTypedefedType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - lldb::SBType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - result = (arg1)->GetTypedefedType(); - *(lldb::SBType **)&jresult = new lldb::SBType(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBType_1GetDereferencedType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - lldb::SBType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - result = (arg1)->GetDereferencedType(); - *(lldb::SBType **)&jresult = new lldb::SBType(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBType_1GetUnqualifiedType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - lldb::SBType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - result = (arg1)->GetUnqualifiedType(); - *(lldb::SBType **)&jresult = new lldb::SBType(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBType_1GetArrayElementType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - lldb::SBType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - result = (arg1)->GetArrayElementType(); - *(lldb::SBType **)&jresult = new lldb::SBType(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBType_1GetArrayType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2) { - jlong jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - uint64_t arg2 ; - lldb::SBType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (uint64_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (arg1)->GetArrayType(arg2); - *(lldb::SBType **)&jresult = new lldb::SBType(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBType_1GetVectorElementType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - lldb::SBType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - result = (arg1)->GetVectorElementType(); - *(lldb::SBType **)&jresult = new lldb::SBType(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBType_1GetCanonicalType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - lldb::SBType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - result = (arg1)->GetCanonicalType(); - *(lldb::SBType **)&jresult = new lldb::SBType(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBType_1GetEnumerationIntegerType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - lldb::SBType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - result = (arg1)->GetEnumerationIntegerType(); - *(lldb::SBType **)&jresult = new lldb::SBType(result); - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBType_1GetBasicType_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - lldb::BasicType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - result = (lldb::BasicType)(arg1)->GetBasicType(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBType_1GetBasicType_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - jlong jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - lldb::BasicType arg2 ; - lldb::SBType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - arg2 = (lldb::BasicType)jarg2; - result = (arg1)->GetBasicType(arg2); - *(lldb::SBType **)&jresult = new lldb::SBType(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBType_1GetNumberOfFields(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - result = (uint32_t)(arg1)->GetNumberOfFields(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBType_1GetNumberOfDirectBaseClasses(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - result = (uint32_t)(arg1)->GetNumberOfDirectBaseClasses(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBType_1GetNumberOfVirtualBaseClasses(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - result = (uint32_t)(arg1)->GetNumberOfVirtualBaseClasses(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBType_1GetFieldAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - uint32_t arg2 ; - lldb::SBTypeMember result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (arg1)->GetFieldAtIndex(arg2); - *(lldb::SBTypeMember **)&jresult = new lldb::SBTypeMember(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBType_1GetDirectBaseClassAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - uint32_t arg2 ; - lldb::SBTypeMember result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (arg1)->GetDirectBaseClassAtIndex(arg2); - *(lldb::SBTypeMember **)&jresult = new lldb::SBTypeMember(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBType_1GetVirtualBaseClassAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - uint32_t arg2 ; - lldb::SBTypeMember result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (arg1)->GetVirtualBaseClassAtIndex(arg2); - *(lldb::SBTypeMember **)&jresult = new lldb::SBTypeMember(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBType_1GetEnumMembers(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - lldb::SBTypeEnumMemberList result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - result = (arg1)->GetEnumMembers(); - *(lldb::SBTypeEnumMemberList **)&jresult = new lldb::SBTypeEnumMemberList(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBType_1GetNumberOfTemplateArguments(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - result = (uint32_t)(arg1)->GetNumberOfTemplateArguments(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBType_1GetTemplateArgumentType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - uint32_t arg2 ; - lldb::SBType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (arg1)->GetTemplateArgumentType(arg2); - *(lldb::SBType **)&jresult = new lldb::SBType(result); - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBType_1GetTemplateArgumentKind(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jint jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - uint32_t arg2 ; - lldb::TemplateArgumentKind result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (lldb::TemplateArgumentKind)(arg1)->GetTemplateArgumentKind(arg2); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBType_1GetFunctionReturnType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - lldb::SBType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - result = (arg1)->GetFunctionReturnType(); - *(lldb::SBType **)&jresult = new lldb::SBType(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBType_1GetFunctionArgumentTypes(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - lldb::SBTypeList result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - result = (arg1)->GetFunctionArgumentTypes(); - *(lldb::SBTypeList **)&jresult = new lldb::SBTypeList(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBType_1GetNumberOfMemberFunctions(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - result = (uint32_t)(arg1)->GetNumberOfMemberFunctions(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBType_1GetMemberFunctionAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - uint32_t arg2 ; - lldb::SBTypeMemberFunction result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (arg1)->GetMemberFunctionAtIndex(arg2); - *(lldb::SBTypeMemberFunction **)&jresult = new lldb::SBTypeMemberFunction(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBType_1GetModule(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - lldb::SBModule result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - result = (arg1)->GetModule(); - *(lldb::SBModule **)&jresult = new lldb::SBModule(result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBType_1GetName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - result = (char *)(arg1)->GetName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBType_1GetDisplayTypeName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - result = (char *)(arg1)->GetDisplayTypeName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBType_1GetTypeClass(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - lldb::TypeClass result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - result = (lldb::TypeClass)(arg1)->GetTypeClass(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBType_1IsTypeComplete(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - result = (bool)(arg1)->IsTypeComplete(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBType_1GetTypeFlags(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - result = (uint32_t)(arg1)->GetTypeFlags(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBType_1GetDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3) { - jboolean jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - lldb::SBStream *arg2 = 0 ; - lldb::DescriptionLevel arg3 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBType **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - arg3 = (lldb::DescriptionLevel)jarg3; - result = (bool)(arg1)->GetDescription(*arg2,arg3); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBType_1_1_1repr_1_1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBType *arg1 = (lldb::SBType *) 0 ; - std::string result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBType **)&jarg1; - result = lldb_SBType___repr__(arg1); - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBTypeList_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBTypeList *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBTypeList *)new lldb::SBTypeList(); - *(lldb::SBTypeList **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBTypeList_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTypeList *arg1 = 0 ; - lldb::SBTypeList *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeList **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBTypeList const & is null"); - return 0; - } - result = (lldb::SBTypeList *)new lldb::SBTypeList((lldb::SBTypeList const &)*arg1); - *(lldb::SBTypeList **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBTypeList(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBTypeList *arg1 = (lldb::SBTypeList *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBTypeList **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTypeList_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBTypeList *arg1 = (lldb::SBTypeList *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeList **)&jarg1; - result = (bool)(arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBTypeList_1Append(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBTypeList *arg1 = (lldb::SBTypeList *) 0 ; - lldb::SBType arg2 ; - lldb::SBType *argp2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTypeList **)&jarg1; - argp2 = *(lldb::SBType **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBType"); - return ; - } - arg2 = *argp2; - (arg1)->Append(arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeList_1GetTypeAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBTypeList *arg1 = (lldb::SBTypeList *) 0 ; - uint32_t arg2 ; - lldb::SBType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeList **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (arg1)->GetTypeAtIndex(arg2); - *(lldb::SBType **)&jresult = new lldb::SBType(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeList_1GetSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTypeList *arg1 = (lldb::SBTypeList *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeList **)&jarg1; - result = (uint32_t)(arg1)->GetSize(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBTypeCategory_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBTypeCategory *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBTypeCategory *)new lldb::SBTypeCategory(); - *(lldb::SBTypeCategory **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBTypeCategory_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTypeCategory *arg1 = 0 ; - lldb::SBTypeCategory *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeCategory **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBTypeCategory const & is null"); - return 0; - } - result = (lldb::SBTypeCategory *)new lldb::SBTypeCategory((lldb::SBTypeCategory const &)*arg1); - *(lldb::SBTypeCategory **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBTypeCategory(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBTypeCategory *arg1 = (lldb::SBTypeCategory *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBTypeCategory **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTypeCategory_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBTypeCategory *arg1 = (lldb::SBTypeCategory *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeCategory **)&jarg1; - result = (bool)((lldb::SBTypeCategory const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTypeCategory_1GetEnabled(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBTypeCategory *arg1 = (lldb::SBTypeCategory *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeCategory **)&jarg1; - result = (bool)(arg1)->GetEnabled(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBTypeCategory_1SetEnabled(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBTypeCategory *arg1 = (lldb::SBTypeCategory *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeCategory **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetEnabled(arg2); -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBTypeCategory_1GetName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBTypeCategory *arg1 = (lldb::SBTypeCategory *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeCategory **)&jarg1; - result = (char *)(arg1)->GetName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBTypeCategory_1GetLanguageAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jint jresult = 0 ; - lldb::SBTypeCategory *arg1 = (lldb::SBTypeCategory *) 0 ; - uint32_t arg2 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeCategory **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (lldb::LanguageType)(arg1)->GetLanguageAtIndex(arg2); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeCategory_1GetNumLanguages(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTypeCategory *arg1 = (lldb::SBTypeCategory *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeCategory **)&jarg1; - result = (uint32_t)(arg1)->GetNumLanguages(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBTypeCategory_1AddLanguage(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - lldb::SBTypeCategory *arg1 = (lldb::SBTypeCategory *) 0 ; - lldb::LanguageType arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeCategory **)&jarg1; - arg2 = (lldb::LanguageType)jarg2; - (arg1)->AddLanguage(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTypeCategory_1GetDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3) { - jboolean jresult = 0 ; - lldb::SBTypeCategory *arg1 = (lldb::SBTypeCategory *) 0 ; - lldb::SBStream *arg2 = 0 ; - lldb::DescriptionLevel arg3 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTypeCategory **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - arg3 = (lldb::DescriptionLevel)jarg3; - result = (bool)(arg1)->GetDescription(*arg2,arg3); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeCategory_1GetNumFormats(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTypeCategory *arg1 = (lldb::SBTypeCategory *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeCategory **)&jarg1; - result = (uint32_t)(arg1)->GetNumFormats(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeCategory_1GetNumSummaries(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTypeCategory *arg1 = (lldb::SBTypeCategory *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeCategory **)&jarg1; - result = (uint32_t)(arg1)->GetNumSummaries(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeCategory_1GetNumFilters(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTypeCategory *arg1 = (lldb::SBTypeCategory *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeCategory **)&jarg1; - result = (uint32_t)(arg1)->GetNumFilters(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeCategory_1GetNumSynthetics(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTypeCategory *arg1 = (lldb::SBTypeCategory *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeCategory **)&jarg1; - result = (uint32_t)(arg1)->GetNumSynthetics(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeCategory_1GetTypeNameSpecifierForFilterAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBTypeCategory *arg1 = (lldb::SBTypeCategory *) 0 ; - uint32_t arg2 ; - lldb::SBTypeNameSpecifier result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeCategory **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (arg1)->GetTypeNameSpecifierForFilterAtIndex(arg2); - *(lldb::SBTypeNameSpecifier **)&jresult = new lldb::SBTypeNameSpecifier(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeCategory_1GetTypeNameSpecifierForFormatAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBTypeCategory *arg1 = (lldb::SBTypeCategory *) 0 ; - uint32_t arg2 ; - lldb::SBTypeNameSpecifier result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeCategory **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (arg1)->GetTypeNameSpecifierForFormatAtIndex(arg2); - *(lldb::SBTypeNameSpecifier **)&jresult = new lldb::SBTypeNameSpecifier(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeCategory_1GetTypeNameSpecifierForSummaryAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBTypeCategory *arg1 = (lldb::SBTypeCategory *) 0 ; - uint32_t arg2 ; - lldb::SBTypeNameSpecifier result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeCategory **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (arg1)->GetTypeNameSpecifierForSummaryAtIndex(arg2); - *(lldb::SBTypeNameSpecifier **)&jresult = new lldb::SBTypeNameSpecifier(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeCategory_1GetTypeNameSpecifierForSyntheticAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBTypeCategory *arg1 = (lldb::SBTypeCategory *) 0 ; - uint32_t arg2 ; - lldb::SBTypeNameSpecifier result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeCategory **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (arg1)->GetTypeNameSpecifierForSyntheticAtIndex(arg2); - *(lldb::SBTypeNameSpecifier **)&jresult = new lldb::SBTypeNameSpecifier(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeCategory_1GetFilterForType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBTypeCategory *arg1 = (lldb::SBTypeCategory *) 0 ; - lldb::SBTypeNameSpecifier arg2 ; - lldb::SBTypeNameSpecifier *argp2 ; - lldb::SBTypeFilter result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTypeCategory **)&jarg1; - argp2 = *(lldb::SBTypeNameSpecifier **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBTypeNameSpecifier"); - return 0; - } - arg2 = *argp2; - result = (arg1)->GetFilterForType(arg2); - *(lldb::SBTypeFilter **)&jresult = new lldb::SBTypeFilter(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeCategory_1GetFormatForType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBTypeCategory *arg1 = (lldb::SBTypeCategory *) 0 ; - lldb::SBTypeNameSpecifier arg2 ; - lldb::SBTypeNameSpecifier *argp2 ; - lldb::SBTypeFormat result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTypeCategory **)&jarg1; - argp2 = *(lldb::SBTypeNameSpecifier **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBTypeNameSpecifier"); - return 0; - } - arg2 = *argp2; - result = (arg1)->GetFormatForType(arg2); - *(lldb::SBTypeFormat **)&jresult = new lldb::SBTypeFormat(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeCategory_1GetSummaryForType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBTypeCategory *arg1 = (lldb::SBTypeCategory *) 0 ; - lldb::SBTypeNameSpecifier arg2 ; - lldb::SBTypeNameSpecifier *argp2 ; - lldb::SBTypeSummary result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTypeCategory **)&jarg1; - argp2 = *(lldb::SBTypeNameSpecifier **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBTypeNameSpecifier"); - return 0; - } - arg2 = *argp2; - result = (arg1)->GetSummaryForType(arg2); - *(lldb::SBTypeSummary **)&jresult = new lldb::SBTypeSummary(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeCategory_1GetSyntheticForType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBTypeCategory *arg1 = (lldb::SBTypeCategory *) 0 ; - lldb::SBTypeNameSpecifier arg2 ; - lldb::SBTypeNameSpecifier *argp2 ; - lldb::SBTypeSynthetic result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTypeCategory **)&jarg1; - argp2 = *(lldb::SBTypeNameSpecifier **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBTypeNameSpecifier"); - return 0; - } - arg2 = *argp2; - result = (arg1)->GetSyntheticForType(arg2); - *(lldb::SBTypeSynthetic **)&jresult = new lldb::SBTypeSynthetic(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeCategory_1GetFilterAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBTypeCategory *arg1 = (lldb::SBTypeCategory *) 0 ; - uint32_t arg2 ; - lldb::SBTypeFilter result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeCategory **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (arg1)->GetFilterAtIndex(arg2); - *(lldb::SBTypeFilter **)&jresult = new lldb::SBTypeFilter(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeCategory_1GetFormatAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBTypeCategory *arg1 = (lldb::SBTypeCategory *) 0 ; - uint32_t arg2 ; - lldb::SBTypeFormat result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeCategory **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (arg1)->GetFormatAtIndex(arg2); - *(lldb::SBTypeFormat **)&jresult = new lldb::SBTypeFormat(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeCategory_1GetSummaryAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBTypeCategory *arg1 = (lldb::SBTypeCategory *) 0 ; - uint32_t arg2 ; - lldb::SBTypeSummary result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeCategory **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (arg1)->GetSummaryAtIndex(arg2); - *(lldb::SBTypeSummary **)&jresult = new lldb::SBTypeSummary(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeCategory_1GetSyntheticAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBTypeCategory *arg1 = (lldb::SBTypeCategory *) 0 ; - uint32_t arg2 ; - lldb::SBTypeSynthetic result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeCategory **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (arg1)->GetSyntheticAtIndex(arg2); - *(lldb::SBTypeSynthetic **)&jresult = new lldb::SBTypeSynthetic(result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTypeCategory_1AddTypeFormat(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_) { - jboolean jresult = 0 ; - lldb::SBTypeCategory *arg1 = (lldb::SBTypeCategory *) 0 ; - lldb::SBTypeNameSpecifier arg2 ; - lldb::SBTypeFormat arg3 ; - lldb::SBTypeNameSpecifier *argp2 ; - lldb::SBTypeFormat *argp3 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - arg1 = *(lldb::SBTypeCategory **)&jarg1; - argp2 = *(lldb::SBTypeNameSpecifier **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBTypeNameSpecifier"); - return 0; - } - arg2 = *argp2; - argp3 = *(lldb::SBTypeFormat **)&jarg3; - if (!argp3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBTypeFormat"); - return 0; - } - arg3 = *argp3; - result = (bool)(arg1)->AddTypeFormat(arg2,arg3); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTypeCategory_1DeleteTypeFormat(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBTypeCategory *arg1 = (lldb::SBTypeCategory *) 0 ; - lldb::SBTypeNameSpecifier arg2 ; - lldb::SBTypeNameSpecifier *argp2 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTypeCategory **)&jarg1; - argp2 = *(lldb::SBTypeNameSpecifier **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBTypeNameSpecifier"); - return 0; - } - arg2 = *argp2; - result = (bool)(arg1)->DeleteTypeFormat(arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTypeCategory_1AddTypeSummary(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_) { - jboolean jresult = 0 ; - lldb::SBTypeCategory *arg1 = (lldb::SBTypeCategory *) 0 ; - lldb::SBTypeNameSpecifier arg2 ; - lldb::SBTypeSummary arg3 ; - lldb::SBTypeNameSpecifier *argp2 ; - lldb::SBTypeSummary *argp3 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - arg1 = *(lldb::SBTypeCategory **)&jarg1; - argp2 = *(lldb::SBTypeNameSpecifier **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBTypeNameSpecifier"); - return 0; - } - arg2 = *argp2; - argp3 = *(lldb::SBTypeSummary **)&jarg3; - if (!argp3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBTypeSummary"); - return 0; - } - arg3 = *argp3; - result = (bool)(arg1)->AddTypeSummary(arg2,arg3); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTypeCategory_1DeleteTypeSummary(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBTypeCategory *arg1 = (lldb::SBTypeCategory *) 0 ; - lldb::SBTypeNameSpecifier arg2 ; - lldb::SBTypeNameSpecifier *argp2 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTypeCategory **)&jarg1; - argp2 = *(lldb::SBTypeNameSpecifier **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBTypeNameSpecifier"); - return 0; - } - arg2 = *argp2; - result = (bool)(arg1)->DeleteTypeSummary(arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTypeCategory_1AddTypeFilter(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_) { - jboolean jresult = 0 ; - lldb::SBTypeCategory *arg1 = (lldb::SBTypeCategory *) 0 ; - lldb::SBTypeNameSpecifier arg2 ; - lldb::SBTypeFilter arg3 ; - lldb::SBTypeNameSpecifier *argp2 ; - lldb::SBTypeFilter *argp3 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - arg1 = *(lldb::SBTypeCategory **)&jarg1; - argp2 = *(lldb::SBTypeNameSpecifier **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBTypeNameSpecifier"); - return 0; - } - arg2 = *argp2; - argp3 = *(lldb::SBTypeFilter **)&jarg3; - if (!argp3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBTypeFilter"); - return 0; - } - arg3 = *argp3; - result = (bool)(arg1)->AddTypeFilter(arg2,arg3); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTypeCategory_1DeleteTypeFilter(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBTypeCategory *arg1 = (lldb::SBTypeCategory *) 0 ; - lldb::SBTypeNameSpecifier arg2 ; - lldb::SBTypeNameSpecifier *argp2 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTypeCategory **)&jarg1; - argp2 = *(lldb::SBTypeNameSpecifier **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBTypeNameSpecifier"); - return 0; - } - arg2 = *argp2; - result = (bool)(arg1)->DeleteTypeFilter(arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTypeCategory_1AddTypeSynthetic(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_) { - jboolean jresult = 0 ; - lldb::SBTypeCategory *arg1 = (lldb::SBTypeCategory *) 0 ; - lldb::SBTypeNameSpecifier arg2 ; - lldb::SBTypeSynthetic arg3 ; - lldb::SBTypeNameSpecifier *argp2 ; - lldb::SBTypeSynthetic *argp3 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - arg1 = *(lldb::SBTypeCategory **)&jarg1; - argp2 = *(lldb::SBTypeNameSpecifier **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBTypeNameSpecifier"); - return 0; - } - arg2 = *argp2; - argp3 = *(lldb::SBTypeSynthetic **)&jarg3; - if (!argp3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBTypeSynthetic"); - return 0; - } - arg3 = *argp3; - result = (bool)(arg1)->AddTypeSynthetic(arg2,arg3); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTypeCategory_1DeleteTypeSynthetic(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBTypeCategory *arg1 = (lldb::SBTypeCategory *) 0 ; - lldb::SBTypeNameSpecifier arg2 ; - lldb::SBTypeNameSpecifier *argp2 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTypeCategory **)&jarg1; - argp2 = *(lldb::SBTypeNameSpecifier **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBTypeNameSpecifier"); - return 0; - } - arg2 = *argp2; - result = (bool)(arg1)->DeleteTypeSynthetic(arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBTypeCategory_1_1_1repr_1_1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBTypeCategory *arg1 = (lldb::SBTypeCategory *) 0 ; - std::string result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeCategory **)&jarg1; - result = lldb_SBTypeCategory___repr__(arg1); - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBTypeEnumMember_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBTypeEnumMember *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBTypeEnumMember *)new lldb::SBTypeEnumMember(); - *(lldb::SBTypeEnumMember **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBTypeEnumMember_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTypeEnumMember *arg1 = 0 ; - lldb::SBTypeEnumMember *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeEnumMember **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBTypeEnumMember const & is null"); - return 0; - } - result = (lldb::SBTypeEnumMember *)new lldb::SBTypeEnumMember((lldb::SBTypeEnumMember const &)*arg1); - *(lldb::SBTypeEnumMember **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBTypeEnumMember(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBTypeEnumMember *arg1 = (lldb::SBTypeEnumMember *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBTypeEnumMember **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTypeEnumMember_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBTypeEnumMember *arg1 = (lldb::SBTypeEnumMember *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeEnumMember **)&jarg1; - result = (bool)((lldb::SBTypeEnumMember const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeEnumMember_1GetValueAsSigned(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTypeEnumMember *arg1 = (lldb::SBTypeEnumMember *) 0 ; - int64_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeEnumMember **)&jarg1; - result = (int64_t)(arg1)->GetValueAsSigned(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBTypeEnumMember_1GetValueAsUnsigned(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBTypeEnumMember *arg1 = (lldb::SBTypeEnumMember *) 0 ; - uint64_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeEnumMember **)&jarg1; - result = (uint64_t)(arg1)->GetValueAsUnsigned(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBTypeEnumMember_1GetName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBTypeEnumMember *arg1 = (lldb::SBTypeEnumMember *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeEnumMember **)&jarg1; - result = (char *)(arg1)->GetName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeEnumMember_1GetType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTypeEnumMember *arg1 = (lldb::SBTypeEnumMember *) 0 ; - lldb::SBType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeEnumMember **)&jarg1; - result = (arg1)->GetType(); - *(lldb::SBType **)&jresult = new lldb::SBType(result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTypeEnumMember_1GetDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3) { - jboolean jresult = 0 ; - lldb::SBTypeEnumMember *arg1 = (lldb::SBTypeEnumMember *) 0 ; - lldb::SBStream *arg2 = 0 ; - lldb::DescriptionLevel arg3 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTypeEnumMember **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - arg3 = (lldb::DescriptionLevel)jarg3; - result = (bool)(arg1)->GetDescription(*arg2,arg3); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBTypeEnumMember_1_1_1repr_1_1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBTypeEnumMember *arg1 = (lldb::SBTypeEnumMember *) 0 ; - std::string result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeEnumMember **)&jarg1; - result = lldb_SBTypeEnumMember___repr__(arg1); - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBTypeEnumMemberList_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBTypeEnumMemberList *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBTypeEnumMemberList *)new lldb::SBTypeEnumMemberList(); - *(lldb::SBTypeEnumMemberList **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBTypeEnumMemberList_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTypeEnumMemberList *arg1 = 0 ; - lldb::SBTypeEnumMemberList *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeEnumMemberList **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBTypeEnumMemberList const & is null"); - return 0; - } - result = (lldb::SBTypeEnumMemberList *)new lldb::SBTypeEnumMemberList((lldb::SBTypeEnumMemberList const &)*arg1); - *(lldb::SBTypeEnumMemberList **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBTypeEnumMemberList(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBTypeEnumMemberList *arg1 = (lldb::SBTypeEnumMemberList *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBTypeEnumMemberList **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTypeEnumMemberList_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBTypeEnumMemberList *arg1 = (lldb::SBTypeEnumMemberList *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeEnumMemberList **)&jarg1; - result = (bool)(arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBTypeEnumMemberList_1Append(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBTypeEnumMemberList *arg1 = (lldb::SBTypeEnumMemberList *) 0 ; - lldb::SBTypeEnumMember arg2 ; - lldb::SBTypeEnumMember *argp2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTypeEnumMemberList **)&jarg1; - argp2 = *(lldb::SBTypeEnumMember **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBTypeEnumMember"); - return ; - } - arg2 = *argp2; - (arg1)->Append(arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeEnumMemberList_1GetTypeEnumMemberAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBTypeEnumMemberList *arg1 = (lldb::SBTypeEnumMemberList *) 0 ; - uint32_t arg2 ; - lldb::SBTypeEnumMember result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeEnumMemberList **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (arg1)->GetTypeEnumMemberAtIndex(arg2); - *(lldb::SBTypeEnumMember **)&jresult = new lldb::SBTypeEnumMember(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeEnumMemberList_1GetSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTypeEnumMemberList *arg1 = (lldb::SBTypeEnumMemberList *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeEnumMemberList **)&jarg1; - result = (uint32_t)(arg1)->GetSize(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBTypeFilter_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBTypeFilter *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBTypeFilter *)new lldb::SBTypeFilter(); - *(lldb::SBTypeFilter **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBTypeFilter_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1) { - jlong jresult = 0 ; - uint32_t arg1 ; - lldb::SBTypeFilter *result = 0 ; - - (void)jenv; - (void)jcls; - arg1 = (uint32_t)jarg1; - result = (lldb::SBTypeFilter *)new lldb::SBTypeFilter(arg1); - *(lldb::SBTypeFilter **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBTypeFilter_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTypeFilter *arg1 = 0 ; - lldb::SBTypeFilter *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeFilter **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBTypeFilter const & is null"); - return 0; - } - result = (lldb::SBTypeFilter *)new lldb::SBTypeFilter((lldb::SBTypeFilter const &)*arg1); - *(lldb::SBTypeFilter **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBTypeFilter(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBTypeFilter *arg1 = (lldb::SBTypeFilter *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBTypeFilter **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTypeFilter_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBTypeFilter *arg1 = (lldb::SBTypeFilter *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeFilter **)&jarg1; - result = (bool)((lldb::SBTypeFilter const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeFilter_1GetNumberOfExpressionPaths(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTypeFilter *arg1 = (lldb::SBTypeFilter *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeFilter **)&jarg1; - result = (uint32_t)(arg1)->GetNumberOfExpressionPaths(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBTypeFilter_1GetExpressionPathAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jstring jresult = 0 ; - lldb::SBTypeFilter *arg1 = (lldb::SBTypeFilter *) 0 ; - uint32_t arg2 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeFilter **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (char *)(arg1)->GetExpressionPathAtIndex(arg2); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTypeFilter_1ReplaceExpressionPathAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jstring jarg3) { - jboolean jresult = 0 ; - lldb::SBTypeFilter *arg1 = (lldb::SBTypeFilter *) 0 ; - uint32_t arg2 ; - char *arg3 = (char *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeFilter **)&jarg1; - arg2 = (uint32_t)jarg2; - arg3 = 0; - if (jarg3) { - arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); - if (!arg3) return 0; - } - result = (bool)(arg1)->ReplaceExpressionPathAtIndex(arg2,(char const *)arg3); - jresult = (jboolean)result; - if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBTypeFilter_1AppendExpressionPath(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBTypeFilter *arg1 = (lldb::SBTypeFilter *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeFilter **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->AppendExpressionPath((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBTypeFilter_1Clear(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBTypeFilter *arg1 = (lldb::SBTypeFilter *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeFilter **)&jarg1; - (arg1)->Clear(); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeFilter_1GetOptions(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTypeFilter *arg1 = (lldb::SBTypeFilter *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeFilter **)&jarg1; - result = (uint32_t)(arg1)->GetOptions(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBTypeFilter_1SetOptions(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - lldb::SBTypeFilter *arg1 = (lldb::SBTypeFilter *) 0 ; - uint32_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeFilter **)&jarg1; - arg2 = (uint32_t)jarg2; - (arg1)->SetOptions(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTypeFilter_1GetDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3) { - jboolean jresult = 0 ; - lldb::SBTypeFilter *arg1 = (lldb::SBTypeFilter *) 0 ; - lldb::SBStream *arg2 = 0 ; - lldb::DescriptionLevel arg3 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTypeFilter **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - arg3 = (lldb::DescriptionLevel)jarg3; - result = (bool)(arg1)->GetDescription(*arg2,arg3); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTypeFilter_1IsEqualTo(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBTypeFilter *arg1 = (lldb::SBTypeFilter *) 0 ; - lldb::SBTypeFilter *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTypeFilter **)&jarg1; - arg2 = *(lldb::SBTypeFilter **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBTypeFilter & is null"); - return 0; - } - result = (bool)(arg1)->IsEqualTo(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBTypeFilter_1_1_1repr_1_1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBTypeFilter *arg1 = (lldb::SBTypeFilter *) 0 ; - std::string result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeFilter **)&jarg1; - result = lldb_SBTypeFilter___repr__(arg1); - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBTypeFormat_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBTypeFormat *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBTypeFormat *)new lldb::SBTypeFormat(); - *(lldb::SBTypeFormat **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBTypeFormat_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jint jarg1, jlong jarg2) { - jlong jresult = 0 ; - lldb::Format arg1 ; - uint32_t arg2 ; - lldb::SBTypeFormat *result = 0 ; - - (void)jenv; - (void)jcls; - arg1 = (lldb::Format)jarg1; - arg2 = (uint32_t)jarg2; - result = (lldb::SBTypeFormat *)new lldb::SBTypeFormat(arg1,arg2); - *(lldb::SBTypeFormat **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBTypeFormat_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jint jarg1) { - jlong jresult = 0 ; - lldb::Format arg1 ; - lldb::SBTypeFormat *result = 0 ; - - (void)jenv; - (void)jcls; - arg1 = (lldb::Format)jarg1; - result = (lldb::SBTypeFormat *)new lldb::SBTypeFormat(arg1); - *(lldb::SBTypeFormat **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBTypeFormat_1_1SWIG_13(JNIEnv *jenv, jclass jcls, jstring jarg1, jlong jarg2) { - jlong jresult = 0 ; - char *arg1 = (char *) 0 ; - uint32_t arg2 ; - lldb::SBTypeFormat *result = 0 ; - - (void)jenv; - (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - arg2 = (uint32_t)jarg2; - result = (lldb::SBTypeFormat *)new lldb::SBTypeFormat((char const *)arg1,arg2); - *(lldb::SBTypeFormat **)&jresult = result; - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBTypeFormat_1_1SWIG_14(JNIEnv *jenv, jclass jcls, jstring jarg1) { - jlong jresult = 0 ; - char *arg1 = (char *) 0 ; - lldb::SBTypeFormat *result = 0 ; - - (void)jenv; - (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - result = (lldb::SBTypeFormat *)new lldb::SBTypeFormat((char const *)arg1); - *(lldb::SBTypeFormat **)&jresult = result; - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBTypeFormat_1_1SWIG_15(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTypeFormat *arg1 = 0 ; - lldb::SBTypeFormat *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeFormat **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBTypeFormat const & is null"); - return 0; - } - result = (lldb::SBTypeFormat *)new lldb::SBTypeFormat((lldb::SBTypeFormat const &)*arg1); - *(lldb::SBTypeFormat **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBTypeFormat(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBTypeFormat *arg1 = (lldb::SBTypeFormat *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBTypeFormat **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTypeFormat_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBTypeFormat *arg1 = (lldb::SBTypeFormat *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeFormat **)&jarg1; - result = (bool)((lldb::SBTypeFormat const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBTypeFormat_1GetFormat(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBTypeFormat *arg1 = (lldb::SBTypeFormat *) 0 ; - lldb::Format result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeFormat **)&jarg1; - result = (lldb::Format)(arg1)->GetFormat(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBTypeFormat_1GetTypeName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBTypeFormat *arg1 = (lldb::SBTypeFormat *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeFormat **)&jarg1; - result = (char *)(arg1)->GetTypeName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeFormat_1GetOptions(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTypeFormat *arg1 = (lldb::SBTypeFormat *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeFormat **)&jarg1; - result = (uint32_t)(arg1)->GetOptions(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBTypeFormat_1SetFormat(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - lldb::SBTypeFormat *arg1 = (lldb::SBTypeFormat *) 0 ; - lldb::Format arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeFormat **)&jarg1; - arg2 = (lldb::Format)jarg2; - (arg1)->SetFormat(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBTypeFormat_1SetTypeName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBTypeFormat *arg1 = (lldb::SBTypeFormat *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeFormat **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->SetTypeName((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBTypeFormat_1SetOptions(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - lldb::SBTypeFormat *arg1 = (lldb::SBTypeFormat *) 0 ; - uint32_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeFormat **)&jarg1; - arg2 = (uint32_t)jarg2; - (arg1)->SetOptions(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTypeFormat_1GetDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3) { - jboolean jresult = 0 ; - lldb::SBTypeFormat *arg1 = (lldb::SBTypeFormat *) 0 ; - lldb::SBStream *arg2 = 0 ; - lldb::DescriptionLevel arg3 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTypeFormat **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - arg3 = (lldb::DescriptionLevel)jarg3; - result = (bool)(arg1)->GetDescription(*arg2,arg3); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTypeFormat_1IsEqualTo(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBTypeFormat *arg1 = (lldb::SBTypeFormat *) 0 ; - lldb::SBTypeFormat *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTypeFormat **)&jarg1; - arg2 = *(lldb::SBTypeFormat **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBTypeFormat & is null"); - return 0; - } - result = (bool)(arg1)->IsEqualTo(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBTypeFormat_1_1_1repr_1_1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBTypeFormat *arg1 = (lldb::SBTypeFormat *) 0 ; - std::string result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeFormat **)&jarg1; - result = lldb_SBTypeFormat___repr__(arg1); - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBTypeNameSpecifier_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBTypeNameSpecifier *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBTypeNameSpecifier *)new lldb::SBTypeNameSpecifier(); - *(lldb::SBTypeNameSpecifier **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBTypeNameSpecifier_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jstring jarg1, jboolean jarg2) { - jlong jresult = 0 ; - char *arg1 = (char *) 0 ; - bool arg2 ; - lldb::SBTypeNameSpecifier *result = 0 ; - - (void)jenv; - (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - arg2 = jarg2 ? true : false; - result = (lldb::SBTypeNameSpecifier *)new lldb::SBTypeNameSpecifier((char const *)arg1,arg2); - *(lldb::SBTypeNameSpecifier **)&jresult = result; - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBTypeNameSpecifier_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jstring jarg1) { - jlong jresult = 0 ; - char *arg1 = (char *) 0 ; - lldb::SBTypeNameSpecifier *result = 0 ; - - (void)jenv; - (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - result = (lldb::SBTypeNameSpecifier *)new lldb::SBTypeNameSpecifier((char const *)arg1); - *(lldb::SBTypeNameSpecifier **)&jresult = result; - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBTypeNameSpecifier_1_1SWIG_13(JNIEnv *jenv, jclass jcls, jstring jarg1, jint jarg2) { - jlong jresult = 0 ; - char *arg1 = (char *) 0 ; - lldb::FormatterMatchType arg2 ; - lldb::SBTypeNameSpecifier *result = 0 ; - - (void)jenv; - (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - arg2 = (lldb::FormatterMatchType)jarg2; - result = (lldb::SBTypeNameSpecifier *)new lldb::SBTypeNameSpecifier((char const *)arg1,arg2); - *(lldb::SBTypeNameSpecifier **)&jresult = result; - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBTypeNameSpecifier_1_1SWIG_14(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBType arg1 ; - lldb::SBType *argp1 ; - lldb::SBTypeNameSpecifier *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - argp1 = *(lldb::SBType **)&jarg1; - if (!argp1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBType"); - return 0; - } - arg1 = *argp1; - result = (lldb::SBTypeNameSpecifier *)new lldb::SBTypeNameSpecifier(arg1); - *(lldb::SBTypeNameSpecifier **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBTypeNameSpecifier_1_1SWIG_15(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTypeNameSpecifier *arg1 = 0 ; - lldb::SBTypeNameSpecifier *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeNameSpecifier **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBTypeNameSpecifier const & is null"); - return 0; - } - result = (lldb::SBTypeNameSpecifier *)new lldb::SBTypeNameSpecifier((lldb::SBTypeNameSpecifier const &)*arg1); - *(lldb::SBTypeNameSpecifier **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBTypeNameSpecifier(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBTypeNameSpecifier *arg1 = (lldb::SBTypeNameSpecifier *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBTypeNameSpecifier **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTypeNameSpecifier_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBTypeNameSpecifier *arg1 = (lldb::SBTypeNameSpecifier *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeNameSpecifier **)&jarg1; - result = (bool)((lldb::SBTypeNameSpecifier const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBTypeNameSpecifier_1GetName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBTypeNameSpecifier *arg1 = (lldb::SBTypeNameSpecifier *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeNameSpecifier **)&jarg1; - result = (char *)(arg1)->GetName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeNameSpecifier_1GetType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTypeNameSpecifier *arg1 = (lldb::SBTypeNameSpecifier *) 0 ; - lldb::SBType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeNameSpecifier **)&jarg1; - result = (arg1)->GetType(); - *(lldb::SBType **)&jresult = new lldb::SBType(result); - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBTypeNameSpecifier_1GetMatchType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBTypeNameSpecifier *arg1 = (lldb::SBTypeNameSpecifier *) 0 ; - lldb::FormatterMatchType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeNameSpecifier **)&jarg1; - result = (lldb::FormatterMatchType)(arg1)->GetMatchType(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTypeNameSpecifier_1IsRegex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBTypeNameSpecifier *arg1 = (lldb::SBTypeNameSpecifier *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeNameSpecifier **)&jarg1; - result = (bool)(arg1)->IsRegex(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTypeNameSpecifier_1GetDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3) { - jboolean jresult = 0 ; - lldb::SBTypeNameSpecifier *arg1 = (lldb::SBTypeNameSpecifier *) 0 ; - lldb::SBStream *arg2 = 0 ; - lldb::DescriptionLevel arg3 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTypeNameSpecifier **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - arg3 = (lldb::DescriptionLevel)jarg3; - result = (bool)(arg1)->GetDescription(*arg2,arg3); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTypeNameSpecifier_1IsEqualTo(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBTypeNameSpecifier *arg1 = (lldb::SBTypeNameSpecifier *) 0 ; - lldb::SBTypeNameSpecifier *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTypeNameSpecifier **)&jarg1; - arg2 = *(lldb::SBTypeNameSpecifier **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBTypeNameSpecifier & is null"); - return 0; - } - result = (bool)(arg1)->IsEqualTo(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBTypeNameSpecifier_1_1_1repr_1_1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBTypeNameSpecifier *arg1 = (lldb::SBTypeNameSpecifier *) 0 ; - std::string result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeNameSpecifier **)&jarg1; - result = lldb_SBTypeNameSpecifier___repr__(arg1); - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBTypeSummaryOptions_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBTypeSummaryOptions *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBTypeSummaryOptions *)new lldb::SBTypeSummaryOptions(); - *(lldb::SBTypeSummaryOptions **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBTypeSummaryOptions_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTypeSummaryOptions *arg1 = 0 ; - lldb::SBTypeSummaryOptions *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeSummaryOptions **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBTypeSummaryOptions const & is null"); - return 0; - } - result = (lldb::SBTypeSummaryOptions *)new lldb::SBTypeSummaryOptions((lldb::SBTypeSummaryOptions const &)*arg1); - *(lldb::SBTypeSummaryOptions **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBTypeSummaryOptions(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBTypeSummaryOptions *arg1 = (lldb::SBTypeSummaryOptions *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBTypeSummaryOptions **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTypeSummaryOptions_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBTypeSummaryOptions *arg1 = (lldb::SBTypeSummaryOptions *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeSummaryOptions **)&jarg1; - result = (bool)(arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBTypeSummaryOptions_1GetLanguage(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBTypeSummaryOptions *arg1 = (lldb::SBTypeSummaryOptions *) 0 ; - lldb::LanguageType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeSummaryOptions **)&jarg1; - result = (lldb::LanguageType)(arg1)->GetLanguage(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBTypeSummaryOptions_1GetCapping(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBTypeSummaryOptions *arg1 = (lldb::SBTypeSummaryOptions *) 0 ; - lldb::TypeSummaryCapping result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeSummaryOptions **)&jarg1; - result = (lldb::TypeSummaryCapping)(arg1)->GetCapping(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBTypeSummaryOptions_1SetLanguage(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - lldb::SBTypeSummaryOptions *arg1 = (lldb::SBTypeSummaryOptions *) 0 ; - lldb::LanguageType arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeSummaryOptions **)&jarg1; - arg2 = (lldb::LanguageType)jarg2; - (arg1)->SetLanguage(arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBTypeSummaryOptions_1SetCapping(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - lldb::SBTypeSummaryOptions *arg1 = (lldb::SBTypeSummaryOptions *) 0 ; - lldb::TypeSummaryCapping arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeSummaryOptions **)&jarg1; - arg2 = (lldb::TypeSummaryCapping)jarg2; - (arg1)->SetCapping(arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBTypeSummary_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBTypeSummary *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBTypeSummary *)new lldb::SBTypeSummary(); - *(lldb::SBTypeSummary **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeSummary_1CreateWithSummaryString_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jstring jarg1, jlong jarg2) { - jlong jresult = 0 ; - char *arg1 = (char *) 0 ; - uint32_t arg2 ; - lldb::SBTypeSummary result; - - (void)jenv; - (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - arg2 = (uint32_t)jarg2; - result = lldb::SBTypeSummary::CreateWithSummaryString((char const *)arg1,arg2); - *(lldb::SBTypeSummary **)&jresult = new lldb::SBTypeSummary(result); - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeSummary_1CreateWithSummaryString_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jstring jarg1) { - jlong jresult = 0 ; - char *arg1 = (char *) 0 ; - lldb::SBTypeSummary result; - - (void)jenv; - (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - result = lldb::SBTypeSummary::CreateWithSummaryString((char const *)arg1); - *(lldb::SBTypeSummary **)&jresult = new lldb::SBTypeSummary(result); - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeSummary_1CreateWithFunctionName_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jstring jarg1, jlong jarg2) { - jlong jresult = 0 ; - char *arg1 = (char *) 0 ; - uint32_t arg2 ; - lldb::SBTypeSummary result; - - (void)jenv; - (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - arg2 = (uint32_t)jarg2; - result = lldb::SBTypeSummary::CreateWithFunctionName((char const *)arg1,arg2); - *(lldb::SBTypeSummary **)&jresult = new lldb::SBTypeSummary(result); - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeSummary_1CreateWithFunctionName_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jstring jarg1) { - jlong jresult = 0 ; - char *arg1 = (char *) 0 ; - lldb::SBTypeSummary result; - - (void)jenv; - (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - result = lldb::SBTypeSummary::CreateWithFunctionName((char const *)arg1); - *(lldb::SBTypeSummary **)&jresult = new lldb::SBTypeSummary(result); - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeSummary_1CreateWithScriptCode_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jstring jarg1, jlong jarg2) { - jlong jresult = 0 ; - char *arg1 = (char *) 0 ; - uint32_t arg2 ; - lldb::SBTypeSummary result; - - (void)jenv; - (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - arg2 = (uint32_t)jarg2; - result = lldb::SBTypeSummary::CreateWithScriptCode((char const *)arg1,arg2); - *(lldb::SBTypeSummary **)&jresult = new lldb::SBTypeSummary(result); - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeSummary_1CreateWithScriptCode_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jstring jarg1) { - jlong jresult = 0 ; - char *arg1 = (char *) 0 ; - lldb::SBTypeSummary result; - - (void)jenv; - (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - result = lldb::SBTypeSummary::CreateWithScriptCode((char const *)arg1); - *(lldb::SBTypeSummary **)&jresult = new lldb::SBTypeSummary(result); - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBTypeSummary_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTypeSummary *arg1 = 0 ; - lldb::SBTypeSummary *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeSummary **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBTypeSummary const & is null"); - return 0; - } - result = (lldb::SBTypeSummary *)new lldb::SBTypeSummary((lldb::SBTypeSummary const &)*arg1); - *(lldb::SBTypeSummary **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBTypeSummary(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBTypeSummary *arg1 = (lldb::SBTypeSummary *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBTypeSummary **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTypeSummary_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBTypeSummary *arg1 = (lldb::SBTypeSummary *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeSummary **)&jarg1; - result = (bool)((lldb::SBTypeSummary const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTypeSummary_1IsFunctionCode(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBTypeSummary *arg1 = (lldb::SBTypeSummary *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeSummary **)&jarg1; - result = (bool)(arg1)->IsFunctionCode(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTypeSummary_1IsFunctionName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBTypeSummary *arg1 = (lldb::SBTypeSummary *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeSummary **)&jarg1; - result = (bool)(arg1)->IsFunctionName(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTypeSummary_1IsSummaryString(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBTypeSummary *arg1 = (lldb::SBTypeSummary *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeSummary **)&jarg1; - result = (bool)(arg1)->IsSummaryString(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBTypeSummary_1GetData(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBTypeSummary *arg1 = (lldb::SBTypeSummary *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeSummary **)&jarg1; - result = (char *)(arg1)->GetData(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBTypeSummary_1SetSummaryString(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBTypeSummary *arg1 = (lldb::SBTypeSummary *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeSummary **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->SetSummaryString((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBTypeSummary_1SetFunctionName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBTypeSummary *arg1 = (lldb::SBTypeSummary *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeSummary **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->SetFunctionName((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBTypeSummary_1SetFunctionCode(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBTypeSummary *arg1 = (lldb::SBTypeSummary *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeSummary **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->SetFunctionCode((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeSummary_1GetOptions(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTypeSummary *arg1 = (lldb::SBTypeSummary *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeSummary **)&jarg1; - result = (uint32_t)(arg1)->GetOptions(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBTypeSummary_1SetOptions(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - lldb::SBTypeSummary *arg1 = (lldb::SBTypeSummary *) 0 ; - uint32_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeSummary **)&jarg1; - arg2 = (uint32_t)jarg2; - (arg1)->SetOptions(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTypeSummary_1GetDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3) { - jboolean jresult = 0 ; - lldb::SBTypeSummary *arg1 = (lldb::SBTypeSummary *) 0 ; - lldb::SBStream *arg2 = 0 ; - lldb::DescriptionLevel arg3 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTypeSummary **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - arg3 = (lldb::DescriptionLevel)jarg3; - result = (bool)(arg1)->GetDescription(*arg2,arg3); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTypeSummary_1DoesPrintValue(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBTypeSummary *arg1 = (lldb::SBTypeSummary *) 0 ; - lldb::SBValue arg2 ; - lldb::SBValue *argp2 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTypeSummary **)&jarg1; - argp2 = *(lldb::SBValue **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBValue"); - return 0; - } - arg2 = *argp2; - result = (bool)(arg1)->DoesPrintValue(arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTypeSummary_1IsEqualTo(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBTypeSummary *arg1 = (lldb::SBTypeSummary *) 0 ; - lldb::SBTypeSummary *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTypeSummary **)&jarg1; - arg2 = *(lldb::SBTypeSummary **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBTypeSummary & is null"); - return 0; - } - result = (bool)(arg1)->IsEqualTo(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBTypeSummary_1_1_1repr_1_1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBTypeSummary *arg1 = (lldb::SBTypeSummary *) 0 ; - std::string result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeSummary **)&jarg1; - result = lldb_SBTypeSummary___repr__(arg1); - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBTypeSynthetic_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBTypeSynthetic *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBTypeSynthetic *)new lldb::SBTypeSynthetic(); - *(lldb::SBTypeSynthetic **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeSynthetic_1CreateWithClassName_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jstring jarg1, jlong jarg2) { - jlong jresult = 0 ; - char *arg1 = (char *) 0 ; - uint32_t arg2 ; - lldb::SBTypeSynthetic result; - - (void)jenv; - (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - arg2 = (uint32_t)jarg2; - result = lldb::SBTypeSynthetic::CreateWithClassName((char const *)arg1,arg2); - *(lldb::SBTypeSynthetic **)&jresult = new lldb::SBTypeSynthetic(result); - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeSynthetic_1CreateWithClassName_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jstring jarg1) { - jlong jresult = 0 ; - char *arg1 = (char *) 0 ; - lldb::SBTypeSynthetic result; - - (void)jenv; - (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - result = lldb::SBTypeSynthetic::CreateWithClassName((char const *)arg1); - *(lldb::SBTypeSynthetic **)&jresult = new lldb::SBTypeSynthetic(result); - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeSynthetic_1CreateWithScriptCode_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jstring jarg1, jlong jarg2) { - jlong jresult = 0 ; - char *arg1 = (char *) 0 ; - uint32_t arg2 ; - lldb::SBTypeSynthetic result; - - (void)jenv; - (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - arg2 = (uint32_t)jarg2; - result = lldb::SBTypeSynthetic::CreateWithScriptCode((char const *)arg1,arg2); - *(lldb::SBTypeSynthetic **)&jresult = new lldb::SBTypeSynthetic(result); - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeSynthetic_1CreateWithScriptCode_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jstring jarg1) { - jlong jresult = 0 ; - char *arg1 = (char *) 0 ; - lldb::SBTypeSynthetic result; - - (void)jenv; - (void)jcls; - arg1 = 0; - if (jarg1) { - arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); - if (!arg1) return 0; - } - result = lldb::SBTypeSynthetic::CreateWithScriptCode((char const *)arg1); - *(lldb::SBTypeSynthetic **)&jresult = new lldb::SBTypeSynthetic(result); - if (arg1) jenv->ReleaseStringUTFChars(jarg1, (const char *)arg1); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBTypeSynthetic_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTypeSynthetic *arg1 = 0 ; - lldb::SBTypeSynthetic *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeSynthetic **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBTypeSynthetic const & is null"); - return 0; - } - result = (lldb::SBTypeSynthetic *)new lldb::SBTypeSynthetic((lldb::SBTypeSynthetic const &)*arg1); - *(lldb::SBTypeSynthetic **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBTypeSynthetic(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBTypeSynthetic *arg1 = (lldb::SBTypeSynthetic *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBTypeSynthetic **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTypeSynthetic_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBTypeSynthetic *arg1 = (lldb::SBTypeSynthetic *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeSynthetic **)&jarg1; - result = (bool)((lldb::SBTypeSynthetic const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTypeSynthetic_1IsClassCode(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBTypeSynthetic *arg1 = (lldb::SBTypeSynthetic *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeSynthetic **)&jarg1; - result = (bool)(arg1)->IsClassCode(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTypeSynthetic_1IsClassName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBTypeSynthetic *arg1 = (lldb::SBTypeSynthetic *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeSynthetic **)&jarg1; - result = (bool)(arg1)->IsClassName(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBTypeSynthetic_1GetData(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBTypeSynthetic *arg1 = (lldb::SBTypeSynthetic *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeSynthetic **)&jarg1; - result = (char *)(arg1)->GetData(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBTypeSynthetic_1SetClassName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBTypeSynthetic *arg1 = (lldb::SBTypeSynthetic *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeSynthetic **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->SetClassName((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBTypeSynthetic_1SetClassCode(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBTypeSynthetic *arg1 = (lldb::SBTypeSynthetic *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeSynthetic **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->SetClassCode((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBTypeSynthetic_1GetOptions(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBTypeSynthetic *arg1 = (lldb::SBTypeSynthetic *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeSynthetic **)&jarg1; - result = (uint32_t)(arg1)->GetOptions(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBTypeSynthetic_1SetOptions(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - lldb::SBTypeSynthetic *arg1 = (lldb::SBTypeSynthetic *) 0 ; - uint32_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeSynthetic **)&jarg1; - arg2 = (uint32_t)jarg2; - (arg1)->SetOptions(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTypeSynthetic_1GetDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3) { - jboolean jresult = 0 ; - lldb::SBTypeSynthetic *arg1 = (lldb::SBTypeSynthetic *) 0 ; - lldb::SBStream *arg2 = 0 ; - lldb::DescriptionLevel arg3 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTypeSynthetic **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - arg3 = (lldb::DescriptionLevel)jarg3; - result = (bool)(arg1)->GetDescription(*arg2,arg3); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBTypeSynthetic_1IsEqualTo(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBTypeSynthetic *arg1 = (lldb::SBTypeSynthetic *) 0 ; - lldb::SBTypeSynthetic *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBTypeSynthetic **)&jarg1; - arg2 = *(lldb::SBTypeSynthetic **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBTypeSynthetic & is null"); - return 0; - } - result = (bool)(arg1)->IsEqualTo(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBTypeSynthetic_1_1_1repr_1_1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBTypeSynthetic *arg1 = (lldb::SBTypeSynthetic *) 0 ; - std::string result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBTypeSynthetic **)&jarg1; - result = lldb_SBTypeSynthetic___repr__(arg1); - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBUnixSignals_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBUnixSignals *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBUnixSignals *)new lldb::SBUnixSignals(); - *(lldb::SBUnixSignals **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBUnixSignals_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBUnixSignals *arg1 = 0 ; - lldb::SBUnixSignals *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBUnixSignals **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBUnixSignals const & is null"); - return 0; - } - result = (lldb::SBUnixSignals *)new lldb::SBUnixSignals((lldb::SBUnixSignals const &)*arg1); - *(lldb::SBUnixSignals **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBUnixSignals(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBUnixSignals *arg1 = (lldb::SBUnixSignals *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBUnixSignals **)&jarg1; - delete arg1; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBUnixSignals_1Clear(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBUnixSignals *arg1 = (lldb::SBUnixSignals *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBUnixSignals **)&jarg1; - (arg1)->Clear(); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBUnixSignals_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBUnixSignals *arg1 = (lldb::SBUnixSignals *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBUnixSignals **)&jarg1; - result = (bool)((lldb::SBUnixSignals const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBUnixSignals_1GetSignalAsCString(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - jstring jresult = 0 ; - lldb::SBUnixSignals *arg1 = (lldb::SBUnixSignals *) 0 ; - int32_t arg2 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBUnixSignals **)&jarg1; - arg2 = (int32_t)jarg2; - result = (char *)((lldb::SBUnixSignals const *)arg1)->GetSignalAsCString(arg2); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBUnixSignals_1GetSignalNumberFromName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jint jresult = 0 ; - lldb::SBUnixSignals *arg1 = (lldb::SBUnixSignals *) 0 ; - char *arg2 = (char *) 0 ; - int32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBUnixSignals **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (int32_t)((lldb::SBUnixSignals const *)arg1)->GetSignalNumberFromName((char const *)arg2); - jresult = (jint)result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBUnixSignals_1GetShouldSuppress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - jboolean jresult = 0 ; - lldb::SBUnixSignals *arg1 = (lldb::SBUnixSignals *) 0 ; - int32_t arg2 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBUnixSignals **)&jarg1; - arg2 = (int32_t)jarg2; - result = (bool)((lldb::SBUnixSignals const *)arg1)->GetShouldSuppress(arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBUnixSignals_1SetShouldSuppress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jboolean jarg3) { - jboolean jresult = 0 ; - lldb::SBUnixSignals *arg1 = (lldb::SBUnixSignals *) 0 ; - int32_t arg2 ; - bool arg3 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBUnixSignals **)&jarg1; - arg2 = (int32_t)jarg2; - arg3 = jarg3 ? true : false; - result = (bool)(arg1)->SetShouldSuppress(arg2,arg3); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBUnixSignals_1GetShouldStop(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - jboolean jresult = 0 ; - lldb::SBUnixSignals *arg1 = (lldb::SBUnixSignals *) 0 ; - int32_t arg2 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBUnixSignals **)&jarg1; - arg2 = (int32_t)jarg2; - result = (bool)((lldb::SBUnixSignals const *)arg1)->GetShouldStop(arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBUnixSignals_1SetShouldStop(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jboolean jarg3) { - jboolean jresult = 0 ; - lldb::SBUnixSignals *arg1 = (lldb::SBUnixSignals *) 0 ; - int32_t arg2 ; - bool arg3 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBUnixSignals **)&jarg1; - arg2 = (int32_t)jarg2; - arg3 = jarg3 ? true : false; - result = (bool)(arg1)->SetShouldStop(arg2,arg3); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBUnixSignals_1GetShouldNotify(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - jboolean jresult = 0 ; - lldb::SBUnixSignals *arg1 = (lldb::SBUnixSignals *) 0 ; - int32_t arg2 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBUnixSignals **)&jarg1; - arg2 = (int32_t)jarg2; - result = (bool)((lldb::SBUnixSignals const *)arg1)->GetShouldNotify(arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBUnixSignals_1SetShouldNotify(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jboolean jarg3) { - jboolean jresult = 0 ; - lldb::SBUnixSignals *arg1 = (lldb::SBUnixSignals *) 0 ; - int32_t arg2 ; - bool arg3 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBUnixSignals **)&jarg1; - arg2 = (int32_t)jarg2; - arg3 = jarg3 ? true : false; - result = (bool)(arg1)->SetShouldNotify(arg2,arg3); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBUnixSignals_1GetNumSignals(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBUnixSignals *arg1 = (lldb::SBUnixSignals *) 0 ; - int32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBUnixSignals **)&jarg1; - result = (int32_t)((lldb::SBUnixSignals const *)arg1)->GetNumSignals(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBUnixSignals_1GetSignalAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - jint jresult = 0 ; - lldb::SBUnixSignals *arg1 = (lldb::SBUnixSignals *) 0 ; - int32_t arg2 ; - int32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBUnixSignals **)&jarg1; - arg2 = (int32_t)jarg2; - result = (int32_t)((lldb::SBUnixSignals const *)arg1)->GetSignalAtIndex(arg2); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBValue_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBValue *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBValue *)new lldb::SBValue(); - *(lldb::SBValue **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBValue_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = 0 ; - lldb::SBValue *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBValue const & is null"); - return 0; - } - result = (lldb::SBValue *)new lldb::SBValue((lldb::SBValue const &)*arg1); - *(lldb::SBValue **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBValue(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBValue **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBValue_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (bool)(arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBValue_1Clear(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - (arg1)->Clear(); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1GetError(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (arg1)->GetError(); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBValue_1GetID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - lldb::user_id_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (lldb::user_id_t)(arg1)->GetID(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBValue_1GetName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (char *)(arg1)->GetName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBValue_1GetTypeName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (char *)(arg1)->GetTypeName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBValue_1GetDisplayTypeName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (char *)(arg1)->GetDisplayTypeName(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1GetByteSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - size_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (arg1)->GetByteSize(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBValue_1IsInScope(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (bool)(arg1)->IsInScope(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBValue_1GetFormat(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - lldb::Format result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (lldb::Format)(arg1)->GetFormat(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBValue_1SetFormat(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - lldb::Format arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - arg2 = (lldb::Format)jarg2; - (arg1)->SetFormat(arg2); -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBValue_1GetValue(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (char *)(arg1)->GetValue(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1GetValueAsSigned_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - lldb::SBError *arg2 = 0 ; - int64_t arg3 ; - int64_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBValue **)&jarg1; - arg2 = *(lldb::SBError **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - arg3 = (int64_t)jarg3; - result = (int64_t)(arg1)->GetValueAsSigned(*arg2,arg3); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1GetValueAsSigned_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - lldb::SBError *arg2 = 0 ; - int64_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBValue **)&jarg1; - arg2 = *(lldb::SBError **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - result = (int64_t)(arg1)->GetValueAsSigned(*arg2); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBValue_1GetValueAsUnsigned_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jobject jarg3) { - jobject jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - lldb::SBError *arg2 = 0 ; - uint64_t arg3 ; - uint64_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBValue **)&jarg1; - arg2 = *(lldb::SBError **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg3); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg3, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg3 = 0; - if (sz > 0) { - arg3 = (uint64_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (uint64_t)(arg1)->GetValueAsUnsigned(*arg2,arg3); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBValue_1GetValueAsUnsigned_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jobject jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - lldb::SBError *arg2 = 0 ; - uint64_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBValue **)&jarg1; - arg2 = *(lldb::SBError **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - result = (uint64_t)(arg1)->GetValueAsUnsigned(*arg2); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1GetValueAsSigned_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - int64_t arg2 ; - int64_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - arg2 = (int64_t)jarg2; - result = (int64_t)(arg1)->GetValueAsSigned(arg2); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1GetValueAsSigned_1_1SWIG_13(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - int64_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (int64_t)(arg1)->GetValueAsSigned(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBValue_1GetValueAsUnsigned_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2) { - jobject jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - uint64_t arg2 ; - uint64_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (uint64_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (uint64_t)(arg1)->GetValueAsUnsigned(arg2); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBValue_1GetValueAsUnsigned_1_1SWIG_13(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - uint64_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (uint64_t)(arg1)->GetValueAsUnsigned(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBValue_1GetValueType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - lldb::ValueType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (lldb::ValueType)(arg1)->GetValueType(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBValue_1GetValueDidChange(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (bool)(arg1)->GetValueDidChange(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBValue_1GetSummary_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (char *)(arg1)->GetSummary(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBValue_1GetSummary_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_) { - jstring jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - lldb::SBStream *arg2 = 0 ; - lldb::SBTypeSummaryOptions *arg3 = 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - arg1 = *(lldb::SBValue **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - arg3 = *(lldb::SBTypeSummaryOptions **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBTypeSummaryOptions & is null"); - return 0; - } - result = (char *)(arg1)->GetSummary(*arg2,*arg3); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBValue_1GetObjectDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (char *)(arg1)->GetObjectDescription(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1GetDynamicValue(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - lldb::DynamicValueType arg2 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - arg2 = (lldb::DynamicValueType)jarg2; - result = (arg1)->GetDynamicValue(arg2); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1GetStaticValue(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (arg1)->GetStaticValue(); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1GetNonSyntheticValue(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (arg1)->GetNonSyntheticValue(); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBValue_1GetPreferDynamicValue(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - lldb::DynamicValueType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (lldb::DynamicValueType)(arg1)->GetPreferDynamicValue(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBValue_1SetPreferDynamicValue(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - lldb::DynamicValueType arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - arg2 = (lldb::DynamicValueType)jarg2; - (arg1)->SetPreferDynamicValue(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBValue_1GetPreferSyntheticValue(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (bool)(arg1)->GetPreferSyntheticValue(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBValue_1SetPreferSyntheticValue(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetPreferSyntheticValue(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBValue_1IsDynamic(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (bool)(arg1)->IsDynamic(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBValue_1IsSynthetic(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (bool)(arg1)->IsSynthetic(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBValue_1IsSyntheticChildrenGenerated(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (bool)(arg1)->IsSyntheticChildrenGenerated(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBValue_1SetSyntheticChildrenGenerated(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetSyntheticChildrenGenerated(arg2); -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBValue_1GetLocation(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (char *)(arg1)->GetLocation(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBValue_1SetValueFromCString_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jboolean jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - char *arg2 = (char *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (bool)(arg1)->SetValueFromCString((char const *)arg2); - jresult = (jboolean)result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBValue_1SetValueFromCString_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jobject jarg3_) { - jboolean jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBError *arg3 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - arg1 = *(lldb::SBValue **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = *(lldb::SBError **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - result = (bool)(arg1)->SetValueFromCString((char const *)arg2,*arg3); - jresult = (jboolean)result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1GetTypeFormat(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - lldb::SBTypeFormat result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (arg1)->GetTypeFormat(); - *(lldb::SBTypeFormat **)&jresult = new lldb::SBTypeFormat(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1GetTypeSummary(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - lldb::SBTypeSummary result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (arg1)->GetTypeSummary(); - *(lldb::SBTypeSummary **)&jresult = new lldb::SBTypeSummary(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1GetTypeFilter(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - lldb::SBTypeFilter result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (arg1)->GetTypeFilter(); - *(lldb::SBTypeFilter **)&jresult = new lldb::SBTypeFilter(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1GetTypeSynthetic(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - lldb::SBTypeSynthetic result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (arg1)->GetTypeSynthetic(); - *(lldb::SBTypeSynthetic **)&jresult = new lldb::SBTypeSynthetic(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1GetChildAtIndex_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - uint32_t arg2 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (arg1)->GetChildAtIndex(arg2); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1CreateChildAtOffset(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jlong jarg4, jobject jarg4_) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - char *arg2 = (char *) 0 ; - uint32_t arg3 ; - lldb::SBType arg4 ; - lldb::SBType *argp4 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg4_; - arg1 = *(lldb::SBValue **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = (uint32_t)jarg3; - argp4 = *(lldb::SBType **)&jarg4; - if (!argp4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBType"); - return 0; - } - arg4 = *argp4; - result = (arg1)->CreateChildAtOffset((char const *)arg2,arg3,arg4); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1Cast(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - lldb::SBType arg2 ; - lldb::SBType *argp2 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBValue **)&jarg1; - argp2 = *(lldb::SBType **)&jarg2; - if (!argp2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBType"); - return 0; - } - arg2 = *argp2; - result = (arg1)->Cast(arg2); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1CreateValueFromExpression_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jstring jarg3) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - char *arg2 = (char *) 0 ; - char *arg3 = (char *) 0 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = 0; - if (jarg3) { - arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); - if (!arg3) return 0; - } - result = (arg1)->CreateValueFromExpression((char const *)arg2,(char const *)arg3); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1CreateValueFromExpression_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jstring jarg3, jlong jarg4, jobject jarg4_) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - char *arg2 = (char *) 0 ; - char *arg3 = (char *) 0 ; - lldb::SBExpressionOptions *arg4 = 0 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg4_; - arg1 = *(lldb::SBValue **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = 0; - if (jarg3) { - arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); - if (!arg3) return 0; - } - arg4 = *(lldb::SBExpressionOptions **)&jarg4; - if (!arg4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBExpressionOptions & is null"); - return 0; - } - result = (arg1)->CreateValueFromExpression((char const *)arg2,(char const *)arg3,*arg4); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1CreateValueFromAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jobject jarg3, jlong jarg4, jobject jarg4_) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - char *arg2 = (char *) 0 ; - lldb::addr_t arg3 ; - lldb::SBType arg4 ; - lldb::SBType *argp4 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg4_; - arg1 = *(lldb::SBValue **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg3); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg3, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg3 = 0; - if (sz > 0) { - arg3 = (lldb::addr_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - argp4 = *(lldb::SBType **)&jarg4; - if (!argp4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBType"); - return 0; - } - arg4 = *argp4; - result = (arg1)->CreateValueFromAddress((char const *)arg2,arg3,arg4); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1CreateValueFromData(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jobject jarg3_, jlong jarg4, jobject jarg4_) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBData arg3 ; - lldb::SBType arg4 ; - lldb::SBData *argp3 ; - lldb::SBType *argp4 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - (void)jarg4_; - arg1 = *(lldb::SBValue **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - argp3 = *(lldb::SBData **)&jarg3; - if (!argp3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBData"); - return 0; - } - arg3 = *argp3; - argp4 = *(lldb::SBType **)&jarg4; - if (!argp4) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null lldb::SBType"); - return 0; - } - arg4 = *argp4; - result = (arg1)->CreateValueFromData((char const *)arg2,arg3,arg4); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1GetChildAtIndex_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jint jarg3, jboolean jarg4) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - uint32_t arg2 ; - lldb::DynamicValueType arg3 ; - bool arg4 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - arg2 = (uint32_t)jarg2; - arg3 = (lldb::DynamicValueType)jarg3; - arg4 = jarg4 ? true : false; - result = (arg1)->GetChildAtIndex(arg2,arg3,arg4); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1GetIndexOfChildWithName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - char *arg2 = (char *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (uint32_t)(arg1)->GetIndexOfChildWithName((char const *)arg2); - jresult = (jlong)result; - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1GetChildMemberWithName_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (arg1)->GetChildMemberWithName((char const *)arg2); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1GetChildMemberWithName_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jint jarg3) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - char *arg2 = (char *) 0 ; - lldb::DynamicValueType arg3 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = (lldb::DynamicValueType)jarg3; - result = (arg1)->GetChildMemberWithName((char const *)arg2,arg3); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1GetValueForExpressionPath(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (arg1)->GetValueForExpressionPath((char const *)arg2); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1AddressOf(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (arg1)->AddressOf(); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBValue_1GetLoadAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - lldb::addr_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (lldb::addr_t)(arg1)->GetLoadAddress(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1GetAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - lldb::SBAddress result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (arg1)->GetAddress(); - *(lldb::SBAddress **)&jresult = new lldb::SBAddress(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1GetPointeeData_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jlong jarg3) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - uint32_t arg2 ; - uint32_t arg3 ; - lldb::SBData result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - arg2 = (uint32_t)jarg2; - arg3 = (uint32_t)jarg3; - result = (arg1)->GetPointeeData(arg2,arg3); - *(lldb::SBData **)&jresult = new lldb::SBData(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1GetPointeeData_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - uint32_t arg2 ; - lldb::SBData result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (arg1)->GetPointeeData(arg2); - *(lldb::SBData **)&jresult = new lldb::SBData(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1GetPointeeData_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - lldb::SBData result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (arg1)->GetPointeeData(); - *(lldb::SBData **)&jresult = new lldb::SBData(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1GetData(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - lldb::SBData result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (arg1)->GetData(); - *(lldb::SBData **)&jresult = new lldb::SBData(result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBValue_1SetData(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_) { - jboolean jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - lldb::SBData *arg2 = 0 ; - lldb::SBError *arg3 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - (void)jarg3_; - arg1 = *(lldb::SBValue **)&jarg1; - arg2 = *(lldb::SBData **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBData & is null"); - return 0; - } - arg3 = *(lldb::SBError **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - result = (bool)(arg1)->SetData(*arg2,*arg3); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1Clone(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = (arg1)->Clone((char const *)arg2); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1GetDeclaration(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - lldb::SBDeclaration result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (arg1)->GetDeclaration(); - *(lldb::SBDeclaration **)&jresult = new lldb::SBDeclaration(result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBValue_1MightHaveChildren(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (bool)(arg1)->MightHaveChildren(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBValue_1IsRuntimeSupportValue(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (bool)(arg1)->IsRuntimeSupportValue(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1GetNumChildren_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (uint32_t)(arg1)->GetNumChildren(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1GetNumChildren_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - uint32_t arg2 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - arg2 = (uint32_t)jarg2; - result = (uint32_t)(arg1)->GetNumChildren(arg2); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1GetOpaqueType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - void *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (void *)(arg1)->GetOpaqueType(); - *(void **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1GetTarget(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - lldb::SBTarget result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (arg1)->GetTarget(); - *(lldb::SBTarget **)&jresult = new lldb::SBTarget(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1GetProcess(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - lldb::SBProcess result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (arg1)->GetProcess(); - *(lldb::SBProcess **)&jresult = new lldb::SBProcess(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1GetThread(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - lldb::SBThread result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (arg1)->GetThread(); - *(lldb::SBThread **)&jresult = new lldb::SBThread(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1GetFrame(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - lldb::SBFrame result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (arg1)->GetFrame(); - *(lldb::SBFrame **)&jresult = new lldb::SBFrame(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1Dereference(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (arg1)->Dereference(); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBValue_1TypeIsPointerType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (bool)(arg1)->TypeIsPointerType(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1GetType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - lldb::SBType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (arg1)->GetType(); - *(lldb::SBType **)&jresult = new lldb::SBType(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1Persist(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = (arg1)->Persist(); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBValue_1GetDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - lldb::SBStream *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBValue **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - result = (bool)(arg1)->GetDescription(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBValue_1GetExpressionPath_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - lldb::SBStream *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBValue **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - result = (bool)(arg1)->GetExpressionPath(*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBValue_1GetExpressionPath_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jboolean jarg3) { - jboolean jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - lldb::SBStream *arg2 = 0 ; - bool arg3 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBValue **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - arg3 = jarg3 ? true : false; - result = (bool)(arg1)->GetExpressionPath(*arg2,arg3); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1EvaluateExpression_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = ((lldb::SBValue const *)arg1)->EvaluateExpression((char const *)arg2); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1EvaluateExpression_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jobject jarg3_) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBExpressionOptions *arg3 = 0 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - arg1 = *(lldb::SBValue **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = *(lldb::SBExpressionOptions **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBExpressionOptions const & is null"); - return 0; - } - result = ((lldb::SBValue const *)arg1)->EvaluateExpression((char const *)arg2,(lldb::SBExpressionOptions const &)*arg3); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1EvaluateExpression_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jlong jarg3, jobject jarg3_, jstring jarg4) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBExpressionOptions *arg3 = 0 ; - char *arg4 = (char *) 0 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg3_; - arg1 = *(lldb::SBValue **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - arg3 = *(lldb::SBExpressionOptions **)&jarg3; - if (!arg3) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBExpressionOptions const & is null"); - return 0; - } - arg4 = 0; - if (jarg4) { - arg4 = (char *)jenv->GetStringUTFChars(jarg4, 0); - if (!arg4) return 0; - } - result = ((lldb::SBValue const *)arg1)->EvaluateExpression((char const *)arg2,(lldb::SBExpressionOptions const &)*arg3,(char const *)arg4); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - if (arg4) jenv->ReleaseStringUTFChars(jarg4, (const char *)arg4); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1Watch_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2, jboolean jarg3, jboolean jarg4, jlong jarg5, jobject jarg5_) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - bool arg2 ; - bool arg3 ; - bool arg4 ; - lldb::SBError *arg5 = 0 ; - lldb::SBWatchpoint result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg5_; - arg1 = *(lldb::SBValue **)&jarg1; - arg2 = jarg2 ? true : false; - arg3 = jarg3 ? true : false; - arg4 = jarg4 ? true : false; - arg5 = *(lldb::SBError **)&jarg5; - if (!arg5) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - result = (arg1)->Watch(arg2,arg3,arg4,*arg5); - *(lldb::SBWatchpoint **)&jresult = new lldb::SBWatchpoint(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1Watch_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2, jboolean jarg3, jboolean jarg4) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - bool arg2 ; - bool arg3 ; - bool arg4 ; - lldb::SBWatchpoint result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - arg2 = jarg2 ? true : false; - arg3 = jarg3 ? true : false; - arg4 = jarg4 ? true : false; - result = (arg1)->Watch(arg2,arg3,arg4); - *(lldb::SBWatchpoint **)&jresult = new lldb::SBWatchpoint(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValue_1WatchPointee(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2, jboolean jarg3, jboolean jarg4, jlong jarg5, jobject jarg5_) { - jlong jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - bool arg2 ; - bool arg3 ; - bool arg4 ; - lldb::SBError *arg5 = 0 ; - lldb::SBWatchpoint result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg5_; - arg1 = *(lldb::SBValue **)&jarg1; - arg2 = jarg2 ? true : false; - arg3 = jarg3 ? true : false; - arg4 = jarg4 ? true : false; - arg5 = *(lldb::SBError **)&jarg5; - if (!arg5) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBError & is null"); - return 0; - } - result = (arg1)->WatchPointee(arg2,arg3,arg4,*arg5); - *(lldb::SBWatchpoint **)&jresult = new lldb::SBWatchpoint(result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBValue_1_1_1repr_1_1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBValue *arg1 = (lldb::SBValue *) 0 ; - std::string result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValue **)&jarg1; - result = lldb_SBValue___repr__(arg1); - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBValueList_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBValueList *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBValueList *)new lldb::SBValueList(); - *(lldb::SBValueList **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBValueList_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBValueList *arg1 = 0 ; - lldb::SBValueList *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValueList **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBValueList const & is null"); - return 0; - } - result = (lldb::SBValueList *)new lldb::SBValueList((lldb::SBValueList const &)*arg1); - *(lldb::SBValueList **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBValueList(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBValueList *arg1 = (lldb::SBValueList *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBValueList **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBValueList_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBValueList *arg1 = (lldb::SBValueList *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValueList **)&jarg1; - result = (bool)((lldb::SBValueList const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBValueList_1Clear(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBValueList *arg1 = (lldb::SBValueList *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValueList **)&jarg1; - (arg1)->Clear(); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBValueList_1Append_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBValueList *arg1 = (lldb::SBValueList *) 0 ; - lldb::SBValue *arg2 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBValueList **)&jarg1; - arg2 = *(lldb::SBValue **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBValue const & is null"); - return ; - } - (arg1)->Append((lldb::SBValue const &)*arg2); -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBValueList_1Append_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - lldb::SBValueList *arg1 = (lldb::SBValueList *) 0 ; - lldb::SBValueList *arg2 = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBValueList **)&jarg1; - arg2 = *(lldb::SBValueList **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBValueList const & is null"); - return ; - } - (arg1)->Append((lldb::SBValueList const &)*arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValueList_1GetSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBValueList *arg1 = (lldb::SBValueList *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValueList **)&jarg1; - result = (uint32_t)((lldb::SBValueList const *)arg1)->GetSize(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValueList_1GetValueAtIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - jlong jresult = 0 ; - lldb::SBValueList *arg1 = (lldb::SBValueList *) 0 ; - uint32_t arg2 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValueList **)&jarg1; - arg2 = (uint32_t)jarg2; - result = ((lldb::SBValueList const *)arg1)->GetValueAtIndex(arg2); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValueList_1GetFirstValueByName(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - jlong jresult = 0 ; - lldb::SBValueList *arg1 = (lldb::SBValueList *) 0 ; - char *arg2 = (char *) 0 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValueList **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return 0; - } - result = ((lldb::SBValueList const *)arg1)->GetFirstValueByName((char const *)arg2); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValueList_1FindValueObjectByUID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jobject jarg2) { - jlong jresult = 0 ; - lldb::SBValueList *arg1 = (lldb::SBValueList *) 0 ; - lldb::user_id_t arg2 ; - lldb::SBValue result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValueList **)&jarg1; - { - jclass clazz; - jmethodID mid; - jbyteArray ba; - jbyte* bae; - jsize sz; - int i; - - if (!jarg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "BigInteger null"); - return 0; - } - clazz = jenv->GetObjectClass(jarg2); - mid = jenv->GetMethodID(clazz, "toByteArray", "()[B"); - ba = (jbyteArray)jenv->CallObjectMethod(jarg2, mid); - bae = jenv->GetByteArrayElements(ba, 0); - sz = jenv->GetArrayLength(ba); - arg2 = 0; - if (sz > 0) { - arg2 = (lldb::user_id_t)(signed char)bae[0]; - for(i=1; iReleaseByteArrayElements(ba, bae, 0); - } - result = (arg1)->FindValueObjectByUID(arg2); - *(lldb::SBValue **)&jresult = new lldb::SBValue(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBValueList_1GetError(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBValueList *arg1 = (lldb::SBValueList *) 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValueList **)&jarg1; - result = (arg1)->GetError(); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBValueList_1_1_1str_1_1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBValueList *arg1 = (lldb::SBValueList *) 0 ; - std::string result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBValueList **)&jarg1; - result = lldb_SBValueList___str__(arg1); - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBVariablesOptions_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBVariablesOptions *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBVariablesOptions *)new lldb::SBVariablesOptions(); - *(lldb::SBVariablesOptions **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBVariablesOptions_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBVariablesOptions *arg1 = 0 ; - lldb::SBVariablesOptions *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBVariablesOptions **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBVariablesOptions const & is null"); - return 0; - } - result = (lldb::SBVariablesOptions *)new lldb::SBVariablesOptions((lldb::SBVariablesOptions const &)*arg1); - *(lldb::SBVariablesOptions **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBVariablesOptions(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBVariablesOptions *arg1 = (lldb::SBVariablesOptions *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBVariablesOptions **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBVariablesOptions_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBVariablesOptions *arg1 = (lldb::SBVariablesOptions *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBVariablesOptions **)&jarg1; - result = (bool)((lldb::SBVariablesOptions const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBVariablesOptions_1GetIncludeArguments(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBVariablesOptions *arg1 = (lldb::SBVariablesOptions *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBVariablesOptions **)&jarg1; - result = (bool)((lldb::SBVariablesOptions const *)arg1)->GetIncludeArguments(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBVariablesOptions_1SetIncludeArguments(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBVariablesOptions *arg1 = (lldb::SBVariablesOptions *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBVariablesOptions **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetIncludeArguments(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBVariablesOptions_1GetIncludeRecognizedArguments(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { - jboolean jresult = 0 ; - lldb::SBVariablesOptions *arg1 = (lldb::SBVariablesOptions *) 0 ; - lldb::SBTarget *arg2 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBVariablesOptions **)&jarg1; - arg2 = *(lldb::SBTarget **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBTarget const & is null"); - return 0; - } - result = (bool)((lldb::SBVariablesOptions const *)arg1)->GetIncludeRecognizedArguments((lldb::SBTarget const &)*arg2); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBVariablesOptions_1SetIncludeRecognizedArguments(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBVariablesOptions *arg1 = (lldb::SBVariablesOptions *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBVariablesOptions **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetIncludeRecognizedArguments(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBVariablesOptions_1GetIncludeLocals(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBVariablesOptions *arg1 = (lldb::SBVariablesOptions *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBVariablesOptions **)&jarg1; - result = (bool)((lldb::SBVariablesOptions const *)arg1)->GetIncludeLocals(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBVariablesOptions_1SetIncludeLocals(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBVariablesOptions *arg1 = (lldb::SBVariablesOptions *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBVariablesOptions **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetIncludeLocals(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBVariablesOptions_1GetIncludeStatics(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBVariablesOptions *arg1 = (lldb::SBVariablesOptions *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBVariablesOptions **)&jarg1; - result = (bool)((lldb::SBVariablesOptions const *)arg1)->GetIncludeStatics(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBVariablesOptions_1SetIncludeStatics(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBVariablesOptions *arg1 = (lldb::SBVariablesOptions *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBVariablesOptions **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetIncludeStatics(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBVariablesOptions_1GetInScopeOnly(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBVariablesOptions *arg1 = (lldb::SBVariablesOptions *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBVariablesOptions **)&jarg1; - result = (bool)((lldb::SBVariablesOptions const *)arg1)->GetInScopeOnly(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBVariablesOptions_1SetInScopeOnly(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBVariablesOptions *arg1 = (lldb::SBVariablesOptions *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBVariablesOptions **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetInScopeOnly(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBVariablesOptions_1GetIncludeRuntimeSupportValues(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBVariablesOptions *arg1 = (lldb::SBVariablesOptions *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBVariablesOptions **)&jarg1; - result = (bool)((lldb::SBVariablesOptions const *)arg1)->GetIncludeRuntimeSupportValues(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBVariablesOptions_1SetIncludeRuntimeSupportValues(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBVariablesOptions *arg1 = (lldb::SBVariablesOptions *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBVariablesOptions **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetIncludeRuntimeSupportValues(arg2); -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBVariablesOptions_1GetUseDynamic(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBVariablesOptions *arg1 = (lldb::SBVariablesOptions *) 0 ; - lldb::DynamicValueType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBVariablesOptions **)&jarg1; - result = (lldb::DynamicValueType)((lldb::SBVariablesOptions const *)arg1)->GetUseDynamic(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBVariablesOptions_1SetUseDynamic(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) { - lldb::SBVariablesOptions *arg1 = (lldb::SBVariablesOptions *) 0 ; - lldb::DynamicValueType arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBVariablesOptions **)&jarg1; - arg2 = (lldb::DynamicValueType)jarg2; - (arg1)->SetUseDynamic(arg2); -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBWatchpoint_1_1SWIG_10(JNIEnv *jenv, jclass jcls) { - jlong jresult = 0 ; - lldb::SBWatchpoint *result = 0 ; - - (void)jenv; - (void)jcls; - result = (lldb::SBWatchpoint *)new lldb::SBWatchpoint(); - *(lldb::SBWatchpoint **)&jresult = result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_new_1SBWatchpoint_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBWatchpoint *arg1 = 0 ; - lldb::SBWatchpoint *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBWatchpoint **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBWatchpoint const & is null"); - return 0; - } - result = (lldb::SBWatchpoint *)new lldb::SBWatchpoint((lldb::SBWatchpoint const &)*arg1); - *(lldb::SBWatchpoint **)&jresult = result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_delete_1SBWatchpoint(JNIEnv *jenv, jclass jcls, jlong jarg1) { - lldb::SBWatchpoint *arg1 = (lldb::SBWatchpoint *) 0 ; - - (void)jenv; - (void)jcls; - arg1 = *(lldb::SBWatchpoint **)&jarg1; - delete arg1; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBWatchpoint_1IsValid(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBWatchpoint *arg1 = (lldb::SBWatchpoint *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBWatchpoint **)&jarg1; - result = (bool)((lldb::SBWatchpoint const *)arg1)->IsValid(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBWatchpoint_1GetError(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBWatchpoint *arg1 = (lldb::SBWatchpoint *) 0 ; - lldb::SBError result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBWatchpoint **)&jarg1; - result = (arg1)->GetError(); - *(lldb::SBError **)&jresult = new lldb::SBError(result); - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBWatchpoint_1GetID(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBWatchpoint *arg1 = (lldb::SBWatchpoint *) 0 ; - lldb::watch_id_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBWatchpoint **)&jarg1; - result = (lldb::watch_id_t)(arg1)->GetID(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBWatchpoint_1GetHardwareIndex(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBWatchpoint *arg1 = (lldb::SBWatchpoint *) 0 ; - int32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBWatchpoint **)&jarg1; - result = (int32_t)(arg1)->GetHardwareIndex(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jobject JNICALL Java_SWIG_lldbJNI_SBWatchpoint_1GetWatchAddress(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jobject jresult = 0 ; - lldb::SBWatchpoint *arg1 = (lldb::SBWatchpoint *) 0 ; - lldb::addr_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBWatchpoint **)&jarg1; - result = (lldb::addr_t)(arg1)->GetWatchAddress(); - { - jbyteArray ba = jenv->NewByteArray(9); - jbyte* bae = jenv->GetByteArrayElements(ba, 0); - jclass clazz = jenv->FindClass("java/math/BigInteger"); - jmethodID mid = jenv->GetMethodID(clazz, "", "([B)V"); - jobject bigint; - int i; - - bae[0] = 0; - for(i=1; i<9; i++ ) { - bae[i] = (jbyte)(result>>8*(8-i)); - } - - jenv->ReleaseByteArrayElements(ba, bae, 0); - bigint = jenv->NewObject(clazz, mid, ba); - jenv->DeleteLocalRef(ba); - jresult = bigint; - } - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBWatchpoint_1GetWatchSize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBWatchpoint *arg1 = (lldb::SBWatchpoint *) 0 ; - size_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBWatchpoint **)&jarg1; - result = (arg1)->GetWatchSize(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBWatchpoint_1SetEnabled(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) { - lldb::SBWatchpoint *arg1 = (lldb::SBWatchpoint *) 0 ; - bool arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBWatchpoint **)&jarg1; - arg2 = jarg2 ? true : false; - (arg1)->SetEnabled(arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBWatchpoint_1IsEnabled(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBWatchpoint *arg1 = (lldb::SBWatchpoint *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBWatchpoint **)&jarg1; - result = (bool)(arg1)->IsEnabled(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBWatchpoint_1GetHitCount(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBWatchpoint *arg1 = (lldb::SBWatchpoint *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBWatchpoint **)&jarg1; - result = (uint32_t)(arg1)->GetHitCount(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBWatchpoint_1GetIgnoreCount(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBWatchpoint *arg1 = (lldb::SBWatchpoint *) 0 ; - uint32_t result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBWatchpoint **)&jarg1; - result = (uint32_t)(arg1)->GetIgnoreCount(); - jresult = (jlong)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBWatchpoint_1SetIgnoreCount(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { - lldb::SBWatchpoint *arg1 = (lldb::SBWatchpoint *) 0 ; - uint32_t arg2 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBWatchpoint **)&jarg1; - arg2 = (uint32_t)jarg2; - (arg1)->SetIgnoreCount(arg2); -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBWatchpoint_1GetCondition(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBWatchpoint *arg1 = (lldb::SBWatchpoint *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBWatchpoint **)&jarg1; - result = (char *)(arg1)->GetCondition(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBWatchpoint_1SetCondition(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { - lldb::SBWatchpoint *arg1 = (lldb::SBWatchpoint *) 0 ; - char *arg2 = (char *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBWatchpoint **)&jarg1; - arg2 = 0; - if (jarg2) { - arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); - if (!arg2) return ; - } - (arg1)->SetCondition((char const *)arg2); - if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBWatchpoint_1GetDescription(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jint jarg3) { - jboolean jresult = 0 ; - lldb::SBWatchpoint *arg1 = (lldb::SBWatchpoint *) 0 ; - lldb::SBStream *arg2 = 0 ; - lldb::DescriptionLevel arg3 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - (void)jarg2_; - arg1 = *(lldb::SBWatchpoint **)&jarg1; - arg2 = *(lldb::SBStream **)&jarg2; - if (!arg2) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBStream & is null"); - return 0; - } - arg3 = (lldb::DescriptionLevel)jarg3; - result = (bool)(arg1)->GetDescription(*arg2,arg3); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT void JNICALL Java_SWIG_lldbJNI_SBWatchpoint_1Clear(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - lldb::SBWatchpoint *arg1 = (lldb::SBWatchpoint *) 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBWatchpoint **)&jarg1; - (arg1)->Clear(); -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBWatchpoint_1EventIsWatchpointEvent(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBEvent *arg1 = 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEvent **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent const & is null"); - return 0; - } - result = (bool)lldb::SBWatchpoint::EventIsWatchpointEvent((lldb::SBEvent const &)*arg1); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBWatchpoint_1GetWatchpointEventTypeFromEvent(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBEvent *arg1 = 0 ; - lldb::WatchpointEventType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEvent **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent const & is null"); - return 0; - } - result = (lldb::WatchpointEventType)lldb::SBWatchpoint::GetWatchpointEventTypeFromEvent((lldb::SBEvent const &)*arg1); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBWatchpoint_1GetWatchpointFromEvent(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBEvent *arg1 = 0 ; - lldb::SBWatchpoint result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBEvent **)&jarg1; - if (!arg1) { - SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "lldb::SBEvent const & is null"); - return 0; - } - result = lldb::SBWatchpoint::GetWatchpointFromEvent((lldb::SBEvent const &)*arg1); - *(lldb::SBWatchpoint **)&jresult = new lldb::SBWatchpoint(result); - return jresult; -} - - -SWIGEXPORT jlong JNICALL Java_SWIG_lldbJNI_SBWatchpoint_1GetType(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jlong jresult = 0 ; - lldb::SBWatchpoint *arg1 = (lldb::SBWatchpoint *) 0 ; - lldb::SBType result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBWatchpoint **)&jarg1; - result = (arg1)->GetType(); - *(lldb::SBType **)&jresult = new lldb::SBType(result); - return jresult; -} - - -SWIGEXPORT jint JNICALL Java_SWIG_lldbJNI_SBWatchpoint_1GetWatchValueKind(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jint jresult = 0 ; - lldb::SBWatchpoint *arg1 = (lldb::SBWatchpoint *) 0 ; - lldb::WatchpointValueKind result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBWatchpoint **)&jarg1; - result = (lldb::WatchpointValueKind)(arg1)->GetWatchValueKind(); - jresult = (jint)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBWatchpoint_1GetWatchSpec(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBWatchpoint *arg1 = (lldb::SBWatchpoint *) 0 ; - char *result = 0 ; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBWatchpoint **)&jarg1; - result = (char *)(arg1)->GetWatchSpec(); - if (result) jresult = jenv->NewStringUTF((const char *)result); - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBWatchpoint_1IsWatchingReads(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBWatchpoint *arg1 = (lldb::SBWatchpoint *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBWatchpoint **)&jarg1; - result = (bool)(arg1)->IsWatchingReads(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jboolean JNICALL Java_SWIG_lldbJNI_SBWatchpoint_1IsWatchingWrites(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jboolean jresult = 0 ; - lldb::SBWatchpoint *arg1 = (lldb::SBWatchpoint *) 0 ; - bool result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBWatchpoint **)&jarg1; - result = (bool)(arg1)->IsWatchingWrites(); - jresult = (jboolean)result; - return jresult; -} - - -SWIGEXPORT jstring JNICALL Java_SWIG_lldbJNI_SBWatchpoint_1_1_1repr_1_1(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { - jstring jresult = 0 ; - lldb::SBWatchpoint *arg1 = (lldb::SBWatchpoint *) 0 ; - std::string result; - - (void)jenv; - (void)jcls; - (void)jarg1_; - arg1 = *(lldb::SBWatchpoint **)&jarg1; - result = lldb_SBWatchpoint___repr__(arg1); - jresult = jenv->NewStringUTF((&result)->c_str()); - return jresult; -} - - -#ifdef __cplusplus -} -#endif - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/AccessType.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/AccessType.java deleted file mode 100644 index 2505d523b8..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/AccessType.java +++ /dev/null @@ -1,60 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class AccessType { - public final static AccessType eAccessNone = new AccessType("eAccessNone"); - public final static AccessType eAccessPublic = new AccessType("eAccessPublic"); - public final static AccessType eAccessPrivate = new AccessType("eAccessPrivate"); - public final static AccessType eAccessProtected = new AccessType("eAccessProtected"); - public final static AccessType eAccessPackage = new AccessType("eAccessPackage"); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static AccessType swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + AccessType.class + " with value " + swigValue); - } - - private AccessType(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private AccessType(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private AccessType(String swigName, AccessType swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static AccessType[] swigValues = { eAccessNone, eAccessPublic, eAccessPrivate, eAccessProtected, eAccessPackage }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/BasicType.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/BasicType.java deleted file mode 100644 index db2fe47381..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/BasicType.java +++ /dev/null @@ -1,89 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class BasicType { - public final static BasicType eBasicTypeInvalid = new BasicType("eBasicTypeInvalid", lldbJNI.eBasicTypeInvalid_get()); - public final static BasicType eBasicTypeVoid = new BasicType("eBasicTypeVoid", lldbJNI.eBasicTypeVoid_get()); - public final static BasicType eBasicTypeChar = new BasicType("eBasicTypeChar"); - public final static BasicType eBasicTypeSignedChar = new BasicType("eBasicTypeSignedChar"); - public final static BasicType eBasicTypeUnsignedChar = new BasicType("eBasicTypeUnsignedChar"); - public final static BasicType eBasicTypeWChar = new BasicType("eBasicTypeWChar"); - public final static BasicType eBasicTypeSignedWChar = new BasicType("eBasicTypeSignedWChar"); - public final static BasicType eBasicTypeUnsignedWChar = new BasicType("eBasicTypeUnsignedWChar"); - public final static BasicType eBasicTypeChar16 = new BasicType("eBasicTypeChar16"); - public final static BasicType eBasicTypeChar32 = new BasicType("eBasicTypeChar32"); - public final static BasicType eBasicTypeChar8 = new BasicType("eBasicTypeChar8"); - public final static BasicType eBasicTypeShort = new BasicType("eBasicTypeShort"); - public final static BasicType eBasicTypeUnsignedShort = new BasicType("eBasicTypeUnsignedShort"); - public final static BasicType eBasicTypeInt = new BasicType("eBasicTypeInt"); - public final static BasicType eBasicTypeUnsignedInt = new BasicType("eBasicTypeUnsignedInt"); - public final static BasicType eBasicTypeLong = new BasicType("eBasicTypeLong"); - public final static BasicType eBasicTypeUnsignedLong = new BasicType("eBasicTypeUnsignedLong"); - public final static BasicType eBasicTypeLongLong = new BasicType("eBasicTypeLongLong"); - public final static BasicType eBasicTypeUnsignedLongLong = new BasicType("eBasicTypeUnsignedLongLong"); - public final static BasicType eBasicTypeInt128 = new BasicType("eBasicTypeInt128"); - public final static BasicType eBasicTypeUnsignedInt128 = new BasicType("eBasicTypeUnsignedInt128"); - public final static BasicType eBasicTypeBool = new BasicType("eBasicTypeBool"); - public final static BasicType eBasicTypeHalf = new BasicType("eBasicTypeHalf"); - public final static BasicType eBasicTypeFloat = new BasicType("eBasicTypeFloat"); - public final static BasicType eBasicTypeDouble = new BasicType("eBasicTypeDouble"); - public final static BasicType eBasicTypeLongDouble = new BasicType("eBasicTypeLongDouble"); - public final static BasicType eBasicTypeFloatComplex = new BasicType("eBasicTypeFloatComplex"); - public final static BasicType eBasicTypeDoubleComplex = new BasicType("eBasicTypeDoubleComplex"); - public final static BasicType eBasicTypeLongDoubleComplex = new BasicType("eBasicTypeLongDoubleComplex"); - public final static BasicType eBasicTypeObjCID = new BasicType("eBasicTypeObjCID"); - public final static BasicType eBasicTypeObjCClass = new BasicType("eBasicTypeObjCClass"); - public final static BasicType eBasicTypeObjCSel = new BasicType("eBasicTypeObjCSel"); - public final static BasicType eBasicTypeNullPtr = new BasicType("eBasicTypeNullPtr"); - public final static BasicType eBasicTypeOther = new BasicType("eBasicTypeOther"); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static BasicType swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + BasicType.class + " with value " + swigValue); - } - - private BasicType(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private BasicType(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private BasicType(String swigName, BasicType swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static BasicType[] swigValues = { eBasicTypeInvalid, eBasicTypeVoid, eBasicTypeChar, eBasicTypeSignedChar, eBasicTypeUnsignedChar, eBasicTypeWChar, eBasicTypeSignedWChar, eBasicTypeUnsignedWChar, eBasicTypeChar16, eBasicTypeChar32, eBasicTypeChar8, eBasicTypeShort, eBasicTypeUnsignedShort, eBasicTypeInt, eBasicTypeUnsignedInt, eBasicTypeLong, eBasicTypeUnsignedLong, eBasicTypeLongLong, eBasicTypeUnsignedLongLong, eBasicTypeInt128, eBasicTypeUnsignedInt128, eBasicTypeBool, eBasicTypeHalf, eBasicTypeFloat, eBasicTypeDouble, eBasicTypeLongDouble, eBasicTypeFloatComplex, eBasicTypeDoubleComplex, eBasicTypeLongDoubleComplex, eBasicTypeObjCID, eBasicTypeObjCClass, eBasicTypeObjCSel, eBasicTypeNullPtr, eBasicTypeOther }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/BreakpointEventType.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/BreakpointEventType.java deleted file mode 100644 index c4234e7dbe..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/BreakpointEventType.java +++ /dev/null @@ -1,68 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class BreakpointEventType { - public final static BreakpointEventType eBreakpointEventTypeInvalidType = new BreakpointEventType("eBreakpointEventTypeInvalidType", lldbJNI.eBreakpointEventTypeInvalidType_get()); - public final static BreakpointEventType eBreakpointEventTypeAdded = new BreakpointEventType("eBreakpointEventTypeAdded", lldbJNI.eBreakpointEventTypeAdded_get()); - public final static BreakpointEventType eBreakpointEventTypeRemoved = new BreakpointEventType("eBreakpointEventTypeRemoved", lldbJNI.eBreakpointEventTypeRemoved_get()); - public final static BreakpointEventType eBreakpointEventTypeLocationsAdded = new BreakpointEventType("eBreakpointEventTypeLocationsAdded", lldbJNI.eBreakpointEventTypeLocationsAdded_get()); - public final static BreakpointEventType eBreakpointEventTypeLocationsRemoved = new BreakpointEventType("eBreakpointEventTypeLocationsRemoved", lldbJNI.eBreakpointEventTypeLocationsRemoved_get()); - public final static BreakpointEventType eBreakpointEventTypeLocationsResolved = new BreakpointEventType("eBreakpointEventTypeLocationsResolved", lldbJNI.eBreakpointEventTypeLocationsResolved_get()); - public final static BreakpointEventType eBreakpointEventTypeEnabled = new BreakpointEventType("eBreakpointEventTypeEnabled", lldbJNI.eBreakpointEventTypeEnabled_get()); - public final static BreakpointEventType eBreakpointEventTypeDisabled = new BreakpointEventType("eBreakpointEventTypeDisabled", lldbJNI.eBreakpointEventTypeDisabled_get()); - public final static BreakpointEventType eBreakpointEventTypeCommandChanged = new BreakpointEventType("eBreakpointEventTypeCommandChanged", lldbJNI.eBreakpointEventTypeCommandChanged_get()); - public final static BreakpointEventType eBreakpointEventTypeConditionChanged = new BreakpointEventType("eBreakpointEventTypeConditionChanged", lldbJNI.eBreakpointEventTypeConditionChanged_get()); - public final static BreakpointEventType eBreakpointEventTypeIgnoreChanged = new BreakpointEventType("eBreakpointEventTypeIgnoreChanged", lldbJNI.eBreakpointEventTypeIgnoreChanged_get()); - public final static BreakpointEventType eBreakpointEventTypeThreadChanged = new BreakpointEventType("eBreakpointEventTypeThreadChanged", lldbJNI.eBreakpointEventTypeThreadChanged_get()); - public final static BreakpointEventType eBreakpointEventTypeAutoContinueChanged = new BreakpointEventType("eBreakpointEventTypeAutoContinueChanged", lldbJNI.eBreakpointEventTypeAutoContinueChanged_get()); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static BreakpointEventType swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + BreakpointEventType.class + " with value " + swigValue); - } - - private BreakpointEventType(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private BreakpointEventType(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private BreakpointEventType(String swigName, BreakpointEventType swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static BreakpointEventType[] swigValues = { eBreakpointEventTypeInvalidType, eBreakpointEventTypeAdded, eBreakpointEventTypeRemoved, eBreakpointEventTypeLocationsAdded, eBreakpointEventTypeLocationsRemoved, eBreakpointEventTypeLocationsResolved, eBreakpointEventTypeEnabled, eBreakpointEventTypeDisabled, eBreakpointEventTypeCommandChanged, eBreakpointEventTypeConditionChanged, eBreakpointEventTypeIgnoreChanged, eBreakpointEventTypeThreadChanged, eBreakpointEventTypeAutoContinueChanged }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ByteArray.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ByteArray.java deleted file mode 100644 index 1e7241d383..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ByteArray.java +++ /dev/null @@ -1,60 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class ByteArray extends SWIGTYPE_p_void { - private long swigCPtr; // Minor bodge to work around private variable in parent - private boolean swigCMemOwn; - public ByteArray(long cPtr, boolean cMemoryOwn) { - super(cPtr, cMemoryOwn); - this.swigCPtr = SWIGTYPE_p_void.getCPtr(this); - swigCMemOwn = cMemoryOwn; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_ByteArray(swigCPtr); - } - swigCPtr = 0; - } - } - - public ByteArray(int nelements) { - this(lldbJNI.new_ByteArray(nelements), true); - } - - public byte getitem(int index) { - return lldbJNI.ByteArray_getitem(swigCPtr, this, index); - } - - public void setitem(int index, byte value) { - lldbJNI.ByteArray_setitem(swigCPtr, this, index, value); - } - - public SWIGTYPE_p_jbyte cast() { - long cPtr = lldbJNI.ByteArray_cast(swigCPtr, this); - return (cPtr == 0) ? null : new SWIGTYPE_p_jbyte(cPtr, false); - } - - public static ByteArray frompointer(SWIGTYPE_p_jbyte t) { - long cPtr = lldbJNI.ByteArray_frompointer(SWIGTYPE_p_jbyte.getCPtr(t)); - return (cPtr == 0) ? null : new ByteArray(cPtr, false); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ByteOrder.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ByteOrder.java deleted file mode 100644 index 7786469e74..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ByteOrder.java +++ /dev/null @@ -1,59 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class ByteOrder { - public final static ByteOrder eByteOrderInvalid = new ByteOrder("eByteOrderInvalid", lldbJNI.eByteOrderInvalid_get()); - public final static ByteOrder eByteOrderBig = new ByteOrder("eByteOrderBig", lldbJNI.eByteOrderBig_get()); - public final static ByteOrder eByteOrderPDP = new ByteOrder("eByteOrderPDP", lldbJNI.eByteOrderPDP_get()); - public final static ByteOrder eByteOrderLittle = new ByteOrder("eByteOrderLittle", lldbJNI.eByteOrderLittle_get()); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static ByteOrder swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + ByteOrder.class + " with value " + swigValue); - } - - private ByteOrder(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private ByteOrder(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private ByteOrder(String swigName, ByteOrder swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static ByteOrder[] swigValues = { eByteOrderInvalid, eByteOrderBig, eByteOrderPDP, eByteOrderLittle }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/CommandArgumentType.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/CommandArgumentType.java deleted file mode 100644 index ab54939514..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/CommandArgumentType.java +++ /dev/null @@ -1,152 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class CommandArgumentType { - public final static CommandArgumentType eArgTypeAddress = new CommandArgumentType("eArgTypeAddress", lldbJNI.eArgTypeAddress_get()); - public final static CommandArgumentType eArgTypeAddressOrExpression = new CommandArgumentType("eArgTypeAddressOrExpression"); - public final static CommandArgumentType eArgTypeAliasName = new CommandArgumentType("eArgTypeAliasName"); - public final static CommandArgumentType eArgTypeAliasOptions = new CommandArgumentType("eArgTypeAliasOptions"); - public final static CommandArgumentType eArgTypeArchitecture = new CommandArgumentType("eArgTypeArchitecture"); - public final static CommandArgumentType eArgTypeBoolean = new CommandArgumentType("eArgTypeBoolean"); - public final static CommandArgumentType eArgTypeBreakpointID = new CommandArgumentType("eArgTypeBreakpointID"); - public final static CommandArgumentType eArgTypeBreakpointIDRange = new CommandArgumentType("eArgTypeBreakpointIDRange"); - public final static CommandArgumentType eArgTypeBreakpointName = new CommandArgumentType("eArgTypeBreakpointName"); - public final static CommandArgumentType eArgTypeByteSize = new CommandArgumentType("eArgTypeByteSize"); - public final static CommandArgumentType eArgTypeClassName = new CommandArgumentType("eArgTypeClassName"); - public final static CommandArgumentType eArgTypeCommandName = new CommandArgumentType("eArgTypeCommandName"); - public final static CommandArgumentType eArgTypeCount = new CommandArgumentType("eArgTypeCount"); - public final static CommandArgumentType eArgTypeDescriptionVerbosity = new CommandArgumentType("eArgTypeDescriptionVerbosity"); - public final static CommandArgumentType eArgTypeDirectoryName = new CommandArgumentType("eArgTypeDirectoryName"); - public final static CommandArgumentType eArgTypeDisassemblyFlavor = new CommandArgumentType("eArgTypeDisassemblyFlavor"); - public final static CommandArgumentType eArgTypeEndAddress = new CommandArgumentType("eArgTypeEndAddress"); - public final static CommandArgumentType eArgTypeExpression = new CommandArgumentType("eArgTypeExpression"); - public final static CommandArgumentType eArgTypeExpressionPath = new CommandArgumentType("eArgTypeExpressionPath"); - public final static CommandArgumentType eArgTypeExprFormat = new CommandArgumentType("eArgTypeExprFormat"); - public final static CommandArgumentType eArgTypeFileLineColumn = new CommandArgumentType("eArgTypeFileLineColumn"); - public final static CommandArgumentType eArgTypeFilename = new CommandArgumentType("eArgTypeFilename"); - public final static CommandArgumentType eArgTypeFormat = new CommandArgumentType("eArgTypeFormat"); - public final static CommandArgumentType eArgTypeFrameIndex = new CommandArgumentType("eArgTypeFrameIndex"); - public final static CommandArgumentType eArgTypeFullName = new CommandArgumentType("eArgTypeFullName"); - public final static CommandArgumentType eArgTypeFunctionName = new CommandArgumentType("eArgTypeFunctionName"); - public final static CommandArgumentType eArgTypeFunctionOrSymbol = new CommandArgumentType("eArgTypeFunctionOrSymbol"); - public final static CommandArgumentType eArgTypeGDBFormat = new CommandArgumentType("eArgTypeGDBFormat"); - public final static CommandArgumentType eArgTypeHelpText = new CommandArgumentType("eArgTypeHelpText"); - public final static CommandArgumentType eArgTypeIndex = new CommandArgumentType("eArgTypeIndex"); - public final static CommandArgumentType eArgTypeLanguage = new CommandArgumentType("eArgTypeLanguage"); - public final static CommandArgumentType eArgTypeLineNum = new CommandArgumentType("eArgTypeLineNum"); - public final static CommandArgumentType eArgTypeLogCategory = new CommandArgumentType("eArgTypeLogCategory"); - public final static CommandArgumentType eArgTypeLogChannel = new CommandArgumentType("eArgTypeLogChannel"); - public final static CommandArgumentType eArgTypeMethod = new CommandArgumentType("eArgTypeMethod"); - public final static CommandArgumentType eArgTypeName = new CommandArgumentType("eArgTypeName"); - public final static CommandArgumentType eArgTypeNewPathPrefix = new CommandArgumentType("eArgTypeNewPathPrefix"); - public final static CommandArgumentType eArgTypeNumLines = new CommandArgumentType("eArgTypeNumLines"); - public final static CommandArgumentType eArgTypeNumberPerLine = new CommandArgumentType("eArgTypeNumberPerLine"); - public final static CommandArgumentType eArgTypeOffset = new CommandArgumentType("eArgTypeOffset"); - public final static CommandArgumentType eArgTypeOldPathPrefix = new CommandArgumentType("eArgTypeOldPathPrefix"); - public final static CommandArgumentType eArgTypeOneLiner = new CommandArgumentType("eArgTypeOneLiner"); - public final static CommandArgumentType eArgTypePath = new CommandArgumentType("eArgTypePath"); - public final static CommandArgumentType eArgTypePermissionsNumber = new CommandArgumentType("eArgTypePermissionsNumber"); - public final static CommandArgumentType eArgTypePermissionsString = new CommandArgumentType("eArgTypePermissionsString"); - public final static CommandArgumentType eArgTypePid = new CommandArgumentType("eArgTypePid"); - public final static CommandArgumentType eArgTypePlugin = new CommandArgumentType("eArgTypePlugin"); - public final static CommandArgumentType eArgTypeProcessName = new CommandArgumentType("eArgTypeProcessName"); - public final static CommandArgumentType eArgTypePythonClass = new CommandArgumentType("eArgTypePythonClass"); - public final static CommandArgumentType eArgTypePythonFunction = new CommandArgumentType("eArgTypePythonFunction"); - public final static CommandArgumentType eArgTypePythonScript = new CommandArgumentType("eArgTypePythonScript"); - public final static CommandArgumentType eArgTypeQueueName = new CommandArgumentType("eArgTypeQueueName"); - public final static CommandArgumentType eArgTypeRegisterName = new CommandArgumentType("eArgTypeRegisterName"); - public final static CommandArgumentType eArgTypeRegularExpression = new CommandArgumentType("eArgTypeRegularExpression"); - public final static CommandArgumentType eArgTypeRunArgs = new CommandArgumentType("eArgTypeRunArgs"); - public final static CommandArgumentType eArgTypeRunMode = new CommandArgumentType("eArgTypeRunMode"); - public final static CommandArgumentType eArgTypeScriptedCommandSynchronicity = new CommandArgumentType("eArgTypeScriptedCommandSynchronicity"); - public final static CommandArgumentType eArgTypeScriptLang = new CommandArgumentType("eArgTypeScriptLang"); - public final static CommandArgumentType eArgTypeSearchWord = new CommandArgumentType("eArgTypeSearchWord"); - public final static CommandArgumentType eArgTypeSelector = new CommandArgumentType("eArgTypeSelector"); - public final static CommandArgumentType eArgTypeSettingIndex = new CommandArgumentType("eArgTypeSettingIndex"); - public final static CommandArgumentType eArgTypeSettingKey = new CommandArgumentType("eArgTypeSettingKey"); - public final static CommandArgumentType eArgTypeSettingPrefix = new CommandArgumentType("eArgTypeSettingPrefix"); - public final static CommandArgumentType eArgTypeSettingVariableName = new CommandArgumentType("eArgTypeSettingVariableName"); - public final static CommandArgumentType eArgTypeShlibName = new CommandArgumentType("eArgTypeShlibName"); - public final static CommandArgumentType eArgTypeSourceFile = new CommandArgumentType("eArgTypeSourceFile"); - public final static CommandArgumentType eArgTypeSortOrder = new CommandArgumentType("eArgTypeSortOrder"); - public final static CommandArgumentType eArgTypeStartAddress = new CommandArgumentType("eArgTypeStartAddress"); - public final static CommandArgumentType eArgTypeSummaryString = new CommandArgumentType("eArgTypeSummaryString"); - public final static CommandArgumentType eArgTypeSymbol = new CommandArgumentType("eArgTypeSymbol"); - public final static CommandArgumentType eArgTypeThreadID = new CommandArgumentType("eArgTypeThreadID"); - public final static CommandArgumentType eArgTypeThreadIndex = new CommandArgumentType("eArgTypeThreadIndex"); - public final static CommandArgumentType eArgTypeThreadName = new CommandArgumentType("eArgTypeThreadName"); - public final static CommandArgumentType eArgTypeTypeName = new CommandArgumentType("eArgTypeTypeName"); - public final static CommandArgumentType eArgTypeUnsignedInteger = new CommandArgumentType("eArgTypeUnsignedInteger"); - public final static CommandArgumentType eArgTypeUnixSignal = new CommandArgumentType("eArgTypeUnixSignal"); - public final static CommandArgumentType eArgTypeVarName = new CommandArgumentType("eArgTypeVarName"); - public final static CommandArgumentType eArgTypeValue = new CommandArgumentType("eArgTypeValue"); - public final static CommandArgumentType eArgTypeWidth = new CommandArgumentType("eArgTypeWidth"); - public final static CommandArgumentType eArgTypeNone = new CommandArgumentType("eArgTypeNone"); - public final static CommandArgumentType eArgTypePlatform = new CommandArgumentType("eArgTypePlatform"); - public final static CommandArgumentType eArgTypeWatchpointID = new CommandArgumentType("eArgTypeWatchpointID"); - public final static CommandArgumentType eArgTypeWatchpointIDRange = new CommandArgumentType("eArgTypeWatchpointIDRange"); - public final static CommandArgumentType eArgTypeWatchType = new CommandArgumentType("eArgTypeWatchType"); - public final static CommandArgumentType eArgRawInput = new CommandArgumentType("eArgRawInput"); - public final static CommandArgumentType eArgTypeCommand = new CommandArgumentType("eArgTypeCommand"); - public final static CommandArgumentType eArgTypeColumnNum = new CommandArgumentType("eArgTypeColumnNum"); - public final static CommandArgumentType eArgTypeModuleUUID = new CommandArgumentType("eArgTypeModuleUUID"); - public final static CommandArgumentType eArgTypeSaveCoreStyle = new CommandArgumentType("eArgTypeSaveCoreStyle"); - public final static CommandArgumentType eArgTypeLogHandler = new CommandArgumentType("eArgTypeLogHandler"); - public final static CommandArgumentType eArgTypeSEDStylePair = new CommandArgumentType("eArgTypeSEDStylePair"); - public final static CommandArgumentType eArgTypeRecognizerID = new CommandArgumentType("eArgTypeRecognizerID"); - public final static CommandArgumentType eArgTypeConnectURL = new CommandArgumentType("eArgTypeConnectURL"); - public final static CommandArgumentType eArgTypeTargetID = new CommandArgumentType("eArgTypeTargetID"); - public final static CommandArgumentType eArgTypeStopHookID = new CommandArgumentType("eArgTypeStopHookID"); - public final static CommandArgumentType eArgTypeCompletionType = new CommandArgumentType("eArgTypeCompletionType"); - public final static CommandArgumentType eArgTypeLastArg = new CommandArgumentType("eArgTypeLastArg"); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static CommandArgumentType swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + CommandArgumentType.class + " with value " + swigValue); - } - - private CommandArgumentType(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private CommandArgumentType(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private CommandArgumentType(String swigName, CommandArgumentType swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static CommandArgumentType[] swigValues = { eArgTypeAddress, eArgTypeAddressOrExpression, eArgTypeAliasName, eArgTypeAliasOptions, eArgTypeArchitecture, eArgTypeBoolean, eArgTypeBreakpointID, eArgTypeBreakpointIDRange, eArgTypeBreakpointName, eArgTypeByteSize, eArgTypeClassName, eArgTypeCommandName, eArgTypeCount, eArgTypeDescriptionVerbosity, eArgTypeDirectoryName, eArgTypeDisassemblyFlavor, eArgTypeEndAddress, eArgTypeExpression, eArgTypeExpressionPath, eArgTypeExprFormat, eArgTypeFileLineColumn, eArgTypeFilename, eArgTypeFormat, eArgTypeFrameIndex, eArgTypeFullName, eArgTypeFunctionName, eArgTypeFunctionOrSymbol, eArgTypeGDBFormat, eArgTypeHelpText, eArgTypeIndex, eArgTypeLanguage, eArgTypeLineNum, eArgTypeLogCategory, eArgTypeLogChannel, eArgTypeMethod, eArgTypeName, eArgTypeNewPathPrefix, eArgTypeNumLines, eArgTypeNumberPerLine, eArgTypeOffset, eArgTypeOldPathPrefix, eArgTypeOneLiner, eArgTypePath, eArgTypePermissionsNumber, eArgTypePermissionsString, eArgTypePid, eArgTypePlugin, eArgTypeProcessName, eArgTypePythonClass, eArgTypePythonFunction, eArgTypePythonScript, eArgTypeQueueName, eArgTypeRegisterName, eArgTypeRegularExpression, eArgTypeRunArgs, eArgTypeRunMode, eArgTypeScriptedCommandSynchronicity, eArgTypeScriptLang, eArgTypeSearchWord, eArgTypeSelector, eArgTypeSettingIndex, eArgTypeSettingKey, eArgTypeSettingPrefix, eArgTypeSettingVariableName, eArgTypeShlibName, eArgTypeSourceFile, eArgTypeSortOrder, eArgTypeStartAddress, eArgTypeSummaryString, eArgTypeSymbol, eArgTypeThreadID, eArgTypeThreadIndex, eArgTypeThreadName, eArgTypeTypeName, eArgTypeUnsignedInteger, eArgTypeUnixSignal, eArgTypeVarName, eArgTypeValue, eArgTypeWidth, eArgTypeNone, eArgTypePlatform, eArgTypeWatchpointID, eArgTypeWatchpointIDRange, eArgTypeWatchType, eArgRawInput, eArgTypeCommand, eArgTypeColumnNum, eArgTypeModuleUUID, eArgTypeSaveCoreStyle, eArgTypeLogHandler, eArgTypeSEDStylePair, eArgTypeRecognizerID, eArgTypeConnectURL, eArgTypeTargetID, eArgTypeStopHookID, eArgTypeCompletionType, eArgTypeLastArg }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/CommandFlags.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/CommandFlags.java deleted file mode 100644 index a74d15b9e6..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/CommandFlags.java +++ /dev/null @@ -1,64 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class CommandFlags { - public final static CommandFlags eCommandRequiresTarget = new CommandFlags("eCommandRequiresTarget", lldbJNI.eCommandRequiresTarget_get()); - public final static CommandFlags eCommandRequiresProcess = new CommandFlags("eCommandRequiresProcess", lldbJNI.eCommandRequiresProcess_get()); - public final static CommandFlags eCommandRequiresThread = new CommandFlags("eCommandRequiresThread", lldbJNI.eCommandRequiresThread_get()); - public final static CommandFlags eCommandRequiresFrame = new CommandFlags("eCommandRequiresFrame", lldbJNI.eCommandRequiresFrame_get()); - public final static CommandFlags eCommandRequiresRegContext = new CommandFlags("eCommandRequiresRegContext", lldbJNI.eCommandRequiresRegContext_get()); - public final static CommandFlags eCommandTryTargetAPILock = new CommandFlags("eCommandTryTargetAPILock", lldbJNI.eCommandTryTargetAPILock_get()); - public final static CommandFlags eCommandProcessMustBeLaunched = new CommandFlags("eCommandProcessMustBeLaunched", lldbJNI.eCommandProcessMustBeLaunched_get()); - public final static CommandFlags eCommandProcessMustBePaused = new CommandFlags("eCommandProcessMustBePaused", lldbJNI.eCommandProcessMustBePaused_get()); - public final static CommandFlags eCommandProcessMustBeTraced = new CommandFlags("eCommandProcessMustBeTraced", lldbJNI.eCommandProcessMustBeTraced_get()); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static CommandFlags swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + CommandFlags.class + " with value " + swigValue); - } - - private CommandFlags(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private CommandFlags(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private CommandFlags(String swigName, CommandFlags swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static CommandFlags[] swigValues = { eCommandRequiresTarget, eCommandRequiresProcess, eCommandRequiresThread, eCommandRequiresFrame, eCommandRequiresRegContext, eCommandTryTargetAPILock, eCommandProcessMustBeLaunched, eCommandProcessMustBePaused, eCommandProcessMustBeTraced }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/CommandInterpreterResult.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/CommandInterpreterResult.java deleted file mode 100644 index f3b9ff04c7..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/CommandInterpreterResult.java +++ /dev/null @@ -1,59 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class CommandInterpreterResult { - public final static CommandInterpreterResult eCommandInterpreterResultSuccess = new CommandInterpreterResult("eCommandInterpreterResultSuccess"); - public final static CommandInterpreterResult eCommandInterpreterResultInferiorCrash = new CommandInterpreterResult("eCommandInterpreterResultInferiorCrash"); - public final static CommandInterpreterResult eCommandInterpreterResultCommandError = new CommandInterpreterResult("eCommandInterpreterResultCommandError"); - public final static CommandInterpreterResult eCommandInterpreterResultQuitRequested = new CommandInterpreterResult("eCommandInterpreterResultQuitRequested"); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static CommandInterpreterResult swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + CommandInterpreterResult.class + " with value " + swigValue); - } - - private CommandInterpreterResult(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private CommandInterpreterResult(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private CommandInterpreterResult(String swigName, CommandInterpreterResult swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static CommandInterpreterResult[] swigValues = { eCommandInterpreterResultSuccess, eCommandInterpreterResultInferiorCrash, eCommandInterpreterResultCommandError, eCommandInterpreterResultQuitRequested }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/CompletionType.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/CompletionType.java deleted file mode 100644 index 87ebcf6b4d..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/CompletionType.java +++ /dev/null @@ -1,82 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class CompletionType { - public final static CompletionType eNoCompletion = new CompletionType("eNoCompletion", lldbJNI.eNoCompletion_get()); - public final static CompletionType eSourceFileCompletion = new CompletionType("eSourceFileCompletion", lldbJNI.eSourceFileCompletion_get()); - public final static CompletionType eDiskFileCompletion = new CompletionType("eDiskFileCompletion", lldbJNI.eDiskFileCompletion_get()); - public final static CompletionType eDiskDirectoryCompletion = new CompletionType("eDiskDirectoryCompletion", lldbJNI.eDiskDirectoryCompletion_get()); - public final static CompletionType eSymbolCompletion = new CompletionType("eSymbolCompletion", lldbJNI.eSymbolCompletion_get()); - public final static CompletionType eModuleCompletion = new CompletionType("eModuleCompletion", lldbJNI.eModuleCompletion_get()); - public final static CompletionType eSettingsNameCompletion = new CompletionType("eSettingsNameCompletion", lldbJNI.eSettingsNameCompletion_get()); - public final static CompletionType ePlatformPluginCompletion = new CompletionType("ePlatformPluginCompletion", lldbJNI.ePlatformPluginCompletion_get()); - public final static CompletionType eArchitectureCompletion = new CompletionType("eArchitectureCompletion", lldbJNI.eArchitectureCompletion_get()); - public final static CompletionType eVariablePathCompletion = new CompletionType("eVariablePathCompletion", lldbJNI.eVariablePathCompletion_get()); - public final static CompletionType eRegisterCompletion = new CompletionType("eRegisterCompletion", lldbJNI.eRegisterCompletion_get()); - public final static CompletionType eBreakpointCompletion = new CompletionType("eBreakpointCompletion", lldbJNI.eBreakpointCompletion_get()); - public final static CompletionType eProcessPluginCompletion = new CompletionType("eProcessPluginCompletion", lldbJNI.eProcessPluginCompletion_get()); - public final static CompletionType eDisassemblyFlavorCompletion = new CompletionType("eDisassemblyFlavorCompletion", lldbJNI.eDisassemblyFlavorCompletion_get()); - public final static CompletionType eTypeLanguageCompletion = new CompletionType("eTypeLanguageCompletion", lldbJNI.eTypeLanguageCompletion_get()); - public final static CompletionType eFrameIndexCompletion = new CompletionType("eFrameIndexCompletion", lldbJNI.eFrameIndexCompletion_get()); - public final static CompletionType eModuleUUIDCompletion = new CompletionType("eModuleUUIDCompletion", lldbJNI.eModuleUUIDCompletion_get()); - public final static CompletionType eStopHookIDCompletion = new CompletionType("eStopHookIDCompletion", lldbJNI.eStopHookIDCompletion_get()); - public final static CompletionType eThreadIndexCompletion = new CompletionType("eThreadIndexCompletion", lldbJNI.eThreadIndexCompletion_get()); - public final static CompletionType eWatchpointIDCompletion = new CompletionType("eWatchpointIDCompletion", lldbJNI.eWatchpointIDCompletion_get()); - public final static CompletionType eBreakpointNameCompletion = new CompletionType("eBreakpointNameCompletion", lldbJNI.eBreakpointNameCompletion_get()); - public final static CompletionType eProcessIDCompletion = new CompletionType("eProcessIDCompletion", lldbJNI.eProcessIDCompletion_get()); - public final static CompletionType eProcessNameCompletion = new CompletionType("eProcessNameCompletion", lldbJNI.eProcessNameCompletion_get()); - public final static CompletionType eRemoteDiskFileCompletion = new CompletionType("eRemoteDiskFileCompletion", lldbJNI.eRemoteDiskFileCompletion_get()); - public final static CompletionType eRemoteDiskDirectoryCompletion = new CompletionType("eRemoteDiskDirectoryCompletion", lldbJNI.eRemoteDiskDirectoryCompletion_get()); - public final static CompletionType eTypeCategoryNameCompletion = new CompletionType("eTypeCategoryNameCompletion", lldbJNI.eTypeCategoryNameCompletion_get()); - public final static CompletionType eCustomCompletion = new CompletionType("eCustomCompletion", lldbJNI.eCustomCompletion_get()); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static CompletionType swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + CompletionType.class + " with value " + swigValue); - } - - private CompletionType(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private CompletionType(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private CompletionType(String swigName, CompletionType swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static CompletionType[] swigValues = { eNoCompletion, eSourceFileCompletion, eDiskFileCompletion, eDiskDirectoryCompletion, eSymbolCompletion, eModuleCompletion, eSettingsNameCompletion, ePlatformPluginCompletion, eArchitectureCompletion, eVariablePathCompletion, eRegisterCompletion, eBreakpointCompletion, eProcessPluginCompletion, eDisassemblyFlavorCompletion, eTypeLanguageCompletion, eFrameIndexCompletion, eModuleUUIDCompletion, eStopHookIDCompletion, eThreadIndexCompletion, eWatchpointIDCompletion, eBreakpointNameCompletion, eProcessIDCompletion, eProcessNameCompletion, eRemoteDiskFileCompletion, eRemoteDiskDirectoryCompletion, eTypeCategoryNameCompletion, eCustomCompletion }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ConnectionStatus.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ConnectionStatus.java deleted file mode 100644 index ac6e4380b0..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ConnectionStatus.java +++ /dev/null @@ -1,62 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class ConnectionStatus { - public final static ConnectionStatus eConnectionStatusSuccess = new ConnectionStatus("eConnectionStatusSuccess"); - public final static ConnectionStatus eConnectionStatusEndOfFile = new ConnectionStatus("eConnectionStatusEndOfFile"); - public final static ConnectionStatus eConnectionStatusError = new ConnectionStatus("eConnectionStatusError"); - public final static ConnectionStatus eConnectionStatusTimedOut = new ConnectionStatus("eConnectionStatusTimedOut"); - public final static ConnectionStatus eConnectionStatusNoConnection = new ConnectionStatus("eConnectionStatusNoConnection"); - public final static ConnectionStatus eConnectionStatusLostConnection = new ConnectionStatus("eConnectionStatusLostConnection"); - public final static ConnectionStatus eConnectionStatusInterrupted = new ConnectionStatus("eConnectionStatusInterrupted"); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static ConnectionStatus swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + ConnectionStatus.class + " with value " + swigValue); - } - - private ConnectionStatus(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private ConnectionStatus(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private ConnectionStatus(String swigName, ConnectionStatus swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static ConnectionStatus[] swigValues = { eConnectionStatusSuccess, eConnectionStatusEndOfFile, eConnectionStatusError, eConnectionStatusTimedOut, eConnectionStatusNoConnection, eConnectionStatusLostConnection, eConnectionStatusInterrupted }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/DWIMPrintVerbosity.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/DWIMPrintVerbosity.java deleted file mode 100644 index 8911599125..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/DWIMPrintVerbosity.java +++ /dev/null @@ -1,58 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class DWIMPrintVerbosity { - public final static DWIMPrintVerbosity eDWIMPrintVerbosityNone = new DWIMPrintVerbosity("eDWIMPrintVerbosityNone"); - public final static DWIMPrintVerbosity eDWIMPrintVerbosityExpression = new DWIMPrintVerbosity("eDWIMPrintVerbosityExpression"); - public final static DWIMPrintVerbosity eDWIMPrintVerbosityFull = new DWIMPrintVerbosity("eDWIMPrintVerbosityFull"); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static DWIMPrintVerbosity swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + DWIMPrintVerbosity.class + " with value " + swigValue); - } - - private DWIMPrintVerbosity(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private DWIMPrintVerbosity(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private DWIMPrintVerbosity(String swigName, DWIMPrintVerbosity swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static DWIMPrintVerbosity[] swigValues = { eDWIMPrintVerbosityNone, eDWIMPrintVerbosityExpression, eDWIMPrintVerbosityFull }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/DescriptionLevel.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/DescriptionLevel.java deleted file mode 100644 index 735c52c19c..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/DescriptionLevel.java +++ /dev/null @@ -1,60 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class DescriptionLevel { - public final static DescriptionLevel eDescriptionLevelBrief = new DescriptionLevel("eDescriptionLevelBrief", lldbJNI.eDescriptionLevelBrief_get()); - public final static DescriptionLevel eDescriptionLevelFull = new DescriptionLevel("eDescriptionLevelFull"); - public final static DescriptionLevel eDescriptionLevelVerbose = new DescriptionLevel("eDescriptionLevelVerbose"); - public final static DescriptionLevel eDescriptionLevelInitial = new DescriptionLevel("eDescriptionLevelInitial"); - public final static DescriptionLevel kNumDescriptionLevels = new DescriptionLevel("kNumDescriptionLevels"); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static DescriptionLevel swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + DescriptionLevel.class + " with value " + swigValue); - } - - private DescriptionLevel(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private DescriptionLevel(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private DescriptionLevel(String swigName, DescriptionLevel swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static DescriptionLevel[] swigValues = { eDescriptionLevelBrief, eDescriptionLevelFull, eDescriptionLevelVerbose, eDescriptionLevelInitial, kNumDescriptionLevels }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/DynamicValueType.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/DynamicValueType.java deleted file mode 100644 index 88bfcc3163..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/DynamicValueType.java +++ /dev/null @@ -1,58 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class DynamicValueType { - public final static DynamicValueType eNoDynamicValues = new DynamicValueType("eNoDynamicValues", lldbJNI.eNoDynamicValues_get()); - public final static DynamicValueType eDynamicCanRunTarget = new DynamicValueType("eDynamicCanRunTarget", lldbJNI.eDynamicCanRunTarget_get()); - public final static DynamicValueType eDynamicDontRunTarget = new DynamicValueType("eDynamicDontRunTarget", lldbJNI.eDynamicDontRunTarget_get()); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static DynamicValueType swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + DynamicValueType.class + " with value " + swigValue); - } - - private DynamicValueType(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private DynamicValueType(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private DynamicValueType(String swigName, DynamicValueType swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static DynamicValueType[] swigValues = { eNoDynamicValues, eDynamicCanRunTarget, eDynamicDontRunTarget }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/EmulateInstructionOptions.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/EmulateInstructionOptions.java deleted file mode 100644 index d6993c2ee5..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/EmulateInstructionOptions.java +++ /dev/null @@ -1,58 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class EmulateInstructionOptions { - public final static EmulateInstructionOptions eEmulateInstructionOptionNone = new EmulateInstructionOptions("eEmulateInstructionOptionNone", lldbJNI.eEmulateInstructionOptionNone_get()); - public final static EmulateInstructionOptions eEmulateInstructionOptionAutoAdvancePC = new EmulateInstructionOptions("eEmulateInstructionOptionAutoAdvancePC", lldbJNI.eEmulateInstructionOptionAutoAdvancePC_get()); - public final static EmulateInstructionOptions eEmulateInstructionOptionIgnoreConditions = new EmulateInstructionOptions("eEmulateInstructionOptionIgnoreConditions", lldbJNI.eEmulateInstructionOptionIgnoreConditions_get()); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static EmulateInstructionOptions swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + EmulateInstructionOptions.class + " with value " + swigValue); - } - - private EmulateInstructionOptions(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private EmulateInstructionOptions(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private EmulateInstructionOptions(String swigName, EmulateInstructionOptions swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static EmulateInstructionOptions[] swigValues = { eEmulateInstructionOptionNone, eEmulateInstructionOptionAutoAdvancePC, eEmulateInstructionOptionIgnoreConditions }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/Encoding.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/Encoding.java deleted file mode 100644 index 272d896cb2..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/Encoding.java +++ /dev/null @@ -1,60 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class Encoding { - public final static Encoding eEncodingInvalid = new Encoding("eEncodingInvalid", lldbJNI.eEncodingInvalid_get()); - public final static Encoding eEncodingUint = new Encoding("eEncodingUint"); - public final static Encoding eEncodingSint = new Encoding("eEncodingSint"); - public final static Encoding eEncodingIEEE754 = new Encoding("eEncodingIEEE754"); - public final static Encoding eEncodingVector = new Encoding("eEncodingVector"); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static Encoding swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + Encoding.class + " with value " + swigValue); - } - - private Encoding(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private Encoding(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private Encoding(String swigName, Encoding swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static Encoding[] swigValues = { eEncodingInvalid, eEncodingUint, eEncodingSint, eEncodingIEEE754, eEncodingVector }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ErrorType.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ErrorType.java deleted file mode 100644 index 0a06d4d9fb..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ErrorType.java +++ /dev/null @@ -1,61 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class ErrorType { - public final static ErrorType eErrorTypeInvalid = new ErrorType("eErrorTypeInvalid"); - public final static ErrorType eErrorTypeGeneric = new ErrorType("eErrorTypeGeneric"); - public final static ErrorType eErrorTypeMachKernel = new ErrorType("eErrorTypeMachKernel"); - public final static ErrorType eErrorTypePOSIX = new ErrorType("eErrorTypePOSIX"); - public final static ErrorType eErrorTypeExpression = new ErrorType("eErrorTypeExpression"); - public final static ErrorType eErrorTypeWin32 = new ErrorType("eErrorTypeWin32"); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static ErrorType swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + ErrorType.class + " with value " + swigValue); - } - - private ErrorType(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private ErrorType(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private ErrorType(String swigName, ErrorType swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static ErrorType[] swigValues = { eErrorTypeInvalid, eErrorTypeGeneric, eErrorTypeMachKernel, eErrorTypePOSIX, eErrorTypeExpression, eErrorTypeWin32 }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ExpressionEvaluationPhase.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ExpressionEvaluationPhase.java deleted file mode 100644 index 287a9194f2..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ExpressionEvaluationPhase.java +++ /dev/null @@ -1,59 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class ExpressionEvaluationPhase { - public final static ExpressionEvaluationPhase eExpressionEvaluationParse = new ExpressionEvaluationPhase("eExpressionEvaluationParse", lldbJNI.eExpressionEvaluationParse_get()); - public final static ExpressionEvaluationPhase eExpressionEvaluationIRGen = new ExpressionEvaluationPhase("eExpressionEvaluationIRGen"); - public final static ExpressionEvaluationPhase eExpressionEvaluationExecution = new ExpressionEvaluationPhase("eExpressionEvaluationExecution"); - public final static ExpressionEvaluationPhase eExpressionEvaluationComplete = new ExpressionEvaluationPhase("eExpressionEvaluationComplete"); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static ExpressionEvaluationPhase swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + ExpressionEvaluationPhase.class + " with value " + swigValue); - } - - private ExpressionEvaluationPhase(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private ExpressionEvaluationPhase(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private ExpressionEvaluationPhase(String swigName, ExpressionEvaluationPhase swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static ExpressionEvaluationPhase[] swigValues = { eExpressionEvaluationParse, eExpressionEvaluationIRGen, eExpressionEvaluationExecution, eExpressionEvaluationComplete }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ExpressionResults.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ExpressionResults.java deleted file mode 100644 index 582c522015..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ExpressionResults.java +++ /dev/null @@ -1,65 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class ExpressionResults { - public final static ExpressionResults eExpressionCompleted = new ExpressionResults("eExpressionCompleted", lldbJNI.eExpressionCompleted_get()); - public final static ExpressionResults eExpressionSetupError = new ExpressionResults("eExpressionSetupError"); - public final static ExpressionResults eExpressionParseError = new ExpressionResults("eExpressionParseError"); - public final static ExpressionResults eExpressionDiscarded = new ExpressionResults("eExpressionDiscarded"); - public final static ExpressionResults eExpressionInterrupted = new ExpressionResults("eExpressionInterrupted"); - public final static ExpressionResults eExpressionHitBreakpoint = new ExpressionResults("eExpressionHitBreakpoint"); - public final static ExpressionResults eExpressionTimedOut = new ExpressionResults("eExpressionTimedOut"); - public final static ExpressionResults eExpressionResultUnavailable = new ExpressionResults("eExpressionResultUnavailable"); - public final static ExpressionResults eExpressionStoppedForDebug = new ExpressionResults("eExpressionStoppedForDebug"); - public final static ExpressionResults eExpressionThreadVanished = new ExpressionResults("eExpressionThreadVanished"); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static ExpressionResults swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + ExpressionResults.class + " with value " + swigValue); - } - - private ExpressionResults(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private ExpressionResults(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private ExpressionResults(String swigName, ExpressionResults swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static ExpressionResults[] swigValues = { eExpressionCompleted, eExpressionSetupError, eExpressionParseError, eExpressionDiscarded, eExpressionInterrupted, eExpressionHitBreakpoint, eExpressionTimedOut, eExpressionResultUnavailable, eExpressionStoppedForDebug, eExpressionThreadVanished }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/FilePermissions.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/FilePermissions.java deleted file mode 100644 index 3ee23016b4..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/FilePermissions.java +++ /dev/null @@ -1,81 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class FilePermissions { - public final static FilePermissions eFilePermissionsUserRead = new FilePermissions("eFilePermissionsUserRead", lldbJNI.eFilePermissionsUserRead_get()); - public final static FilePermissions eFilePermissionsUserWrite = new FilePermissions("eFilePermissionsUserWrite", lldbJNI.eFilePermissionsUserWrite_get()); - public final static FilePermissions eFilePermissionsUserExecute = new FilePermissions("eFilePermissionsUserExecute", lldbJNI.eFilePermissionsUserExecute_get()); - public final static FilePermissions eFilePermissionsGroupRead = new FilePermissions("eFilePermissionsGroupRead", lldbJNI.eFilePermissionsGroupRead_get()); - public final static FilePermissions eFilePermissionsGroupWrite = new FilePermissions("eFilePermissionsGroupWrite", lldbJNI.eFilePermissionsGroupWrite_get()); - public final static FilePermissions eFilePermissionsGroupExecute = new FilePermissions("eFilePermissionsGroupExecute", lldbJNI.eFilePermissionsGroupExecute_get()); - public final static FilePermissions eFilePermissionsWorldRead = new FilePermissions("eFilePermissionsWorldRead", lldbJNI.eFilePermissionsWorldRead_get()); - public final static FilePermissions eFilePermissionsWorldWrite = new FilePermissions("eFilePermissionsWorldWrite", lldbJNI.eFilePermissionsWorldWrite_get()); - public final static FilePermissions eFilePermissionsWorldExecute = new FilePermissions("eFilePermissionsWorldExecute", lldbJNI.eFilePermissionsWorldExecute_get()); - public final static FilePermissions eFilePermissionsUserRW = new FilePermissions("eFilePermissionsUserRW", lldbJNI.eFilePermissionsUserRW_get()); - public final static FilePermissions eFileFilePermissionsUserRX = new FilePermissions("eFileFilePermissionsUserRX", lldbJNI.eFileFilePermissionsUserRX_get()); - public final static FilePermissions eFilePermissionsUserRWX = new FilePermissions("eFilePermissionsUserRWX", lldbJNI.eFilePermissionsUserRWX_get()); - public final static FilePermissions eFilePermissionsGroupRW = new FilePermissions("eFilePermissionsGroupRW", lldbJNI.eFilePermissionsGroupRW_get()); - public final static FilePermissions eFilePermissionsGroupRX = new FilePermissions("eFilePermissionsGroupRX", lldbJNI.eFilePermissionsGroupRX_get()); - public final static FilePermissions eFilePermissionsGroupRWX = new FilePermissions("eFilePermissionsGroupRWX", lldbJNI.eFilePermissionsGroupRWX_get()); - public final static FilePermissions eFilePermissionsWorldRW = new FilePermissions("eFilePermissionsWorldRW", lldbJNI.eFilePermissionsWorldRW_get()); - public final static FilePermissions eFilePermissionsWorldRX = new FilePermissions("eFilePermissionsWorldRX", lldbJNI.eFilePermissionsWorldRX_get()); - public final static FilePermissions eFilePermissionsWorldRWX = new FilePermissions("eFilePermissionsWorldRWX", lldbJNI.eFilePermissionsWorldRWX_get()); - public final static FilePermissions eFilePermissionsEveryoneR = new FilePermissions("eFilePermissionsEveryoneR", lldbJNI.eFilePermissionsEveryoneR_get()); - public final static FilePermissions eFilePermissionsEveryoneW = new FilePermissions("eFilePermissionsEveryoneW", lldbJNI.eFilePermissionsEveryoneW_get()); - public final static FilePermissions eFilePermissionsEveryoneX = new FilePermissions("eFilePermissionsEveryoneX", lldbJNI.eFilePermissionsEveryoneX_get()); - public final static FilePermissions eFilePermissionsEveryoneRW = new FilePermissions("eFilePermissionsEveryoneRW", lldbJNI.eFilePermissionsEveryoneRW_get()); - public final static FilePermissions eFilePermissionsEveryoneRX = new FilePermissions("eFilePermissionsEveryoneRX", lldbJNI.eFilePermissionsEveryoneRX_get()); - public final static FilePermissions eFilePermissionsEveryoneRWX = new FilePermissions("eFilePermissionsEveryoneRWX", lldbJNI.eFilePermissionsEveryoneRWX_get()); - public final static FilePermissions eFilePermissionsFileDefault = new FilePermissions("eFilePermissionsFileDefault", lldbJNI.eFilePermissionsFileDefault_get()); - public final static FilePermissions eFilePermissionsDirectoryDefault = new FilePermissions("eFilePermissionsDirectoryDefault", lldbJNI.eFilePermissionsDirectoryDefault_get()); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static FilePermissions swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + FilePermissions.class + " with value " + swigValue); - } - - private FilePermissions(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private FilePermissions(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private FilePermissions(String swigName, FilePermissions swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static FilePermissions[] swigValues = { eFilePermissionsUserRead, eFilePermissionsUserWrite, eFilePermissionsUserExecute, eFilePermissionsGroupRead, eFilePermissionsGroupWrite, eFilePermissionsGroupExecute, eFilePermissionsWorldRead, eFilePermissionsWorldWrite, eFilePermissionsWorldExecute, eFilePermissionsUserRW, eFileFilePermissionsUserRX, eFilePermissionsUserRWX, eFilePermissionsGroupRW, eFilePermissionsGroupRX, eFilePermissionsGroupRWX, eFilePermissionsWorldRW, eFilePermissionsWorldRX, eFilePermissionsWorldRWX, eFilePermissionsEveryoneR, eFilePermissionsEveryoneW, eFilePermissionsEveryoneX, eFilePermissionsEveryoneRW, eFilePermissionsEveryoneRX, eFilePermissionsEveryoneRWX, eFilePermissionsFileDefault, eFilePermissionsDirectoryDefault }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/Format.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/Format.java deleted file mode 100644 index 07235362fb..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/Format.java +++ /dev/null @@ -1,98 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class Format { - public final static Format eFormatDefault = new Format("eFormatDefault", lldbJNI.eFormatDefault_get()); - public final static Format eFormatInvalid = new Format("eFormatInvalid", lldbJNI.eFormatInvalid_get()); - public final static Format eFormatBoolean = new Format("eFormatBoolean"); - public final static Format eFormatBinary = new Format("eFormatBinary"); - public final static Format eFormatBytes = new Format("eFormatBytes"); - public final static Format eFormatBytesWithASCII = new Format("eFormatBytesWithASCII"); - public final static Format eFormatChar = new Format("eFormatChar"); - public final static Format eFormatCharPrintable = new Format("eFormatCharPrintable"); - public final static Format eFormatComplex = new Format("eFormatComplex"); - public final static Format eFormatComplexFloat = new Format("eFormatComplexFloat", lldbJNI.eFormatComplexFloat_get()); - public final static Format eFormatCString = new Format("eFormatCString"); - public final static Format eFormatDecimal = new Format("eFormatDecimal"); - public final static Format eFormatEnum = new Format("eFormatEnum"); - public final static Format eFormatHex = new Format("eFormatHex"); - public final static Format eFormatHexUppercase = new Format("eFormatHexUppercase"); - public final static Format eFormatFloat = new Format("eFormatFloat"); - public final static Format eFormatOctal = new Format("eFormatOctal"); - public final static Format eFormatOSType = new Format("eFormatOSType"); - public final static Format eFormatUnicode16 = new Format("eFormatUnicode16"); - public final static Format eFormatUnicode32 = new Format("eFormatUnicode32"); - public final static Format eFormatUnsigned = new Format("eFormatUnsigned"); - public final static Format eFormatPointer = new Format("eFormatPointer"); - public final static Format eFormatVectorOfChar = new Format("eFormatVectorOfChar"); - public final static Format eFormatVectorOfSInt8 = new Format("eFormatVectorOfSInt8"); - public final static Format eFormatVectorOfUInt8 = new Format("eFormatVectorOfUInt8"); - public final static Format eFormatVectorOfSInt16 = new Format("eFormatVectorOfSInt16"); - public final static Format eFormatVectorOfUInt16 = new Format("eFormatVectorOfUInt16"); - public final static Format eFormatVectorOfSInt32 = new Format("eFormatVectorOfSInt32"); - public final static Format eFormatVectorOfUInt32 = new Format("eFormatVectorOfUInt32"); - public final static Format eFormatVectorOfSInt64 = new Format("eFormatVectorOfSInt64"); - public final static Format eFormatVectorOfUInt64 = new Format("eFormatVectorOfUInt64"); - public final static Format eFormatVectorOfFloat16 = new Format("eFormatVectorOfFloat16"); - public final static Format eFormatVectorOfFloat32 = new Format("eFormatVectorOfFloat32"); - public final static Format eFormatVectorOfFloat64 = new Format("eFormatVectorOfFloat64"); - public final static Format eFormatVectorOfUInt128 = new Format("eFormatVectorOfUInt128"); - public final static Format eFormatComplexInteger = new Format("eFormatComplexInteger"); - public final static Format eFormatCharArray = new Format("eFormatCharArray"); - public final static Format eFormatAddressInfo = new Format("eFormatAddressInfo"); - public final static Format eFormatHexFloat = new Format("eFormatHexFloat"); - public final static Format eFormatInstruction = new Format("eFormatInstruction"); - public final static Format eFormatVoid = new Format("eFormatVoid"); - public final static Format eFormatUnicode8 = new Format("eFormatUnicode8"); - public final static Format kNumFormats = new Format("kNumFormats"); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static Format swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + Format.class + " with value " + swigValue); - } - - private Format(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private Format(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private Format(String swigName, Format swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static Format[] swigValues = { eFormatDefault, eFormatInvalid, eFormatBoolean, eFormatBinary, eFormatBytes, eFormatBytesWithASCII, eFormatChar, eFormatCharPrintable, eFormatComplex, eFormatComplexFloat, eFormatCString, eFormatDecimal, eFormatEnum, eFormatHex, eFormatHexUppercase, eFormatFloat, eFormatOctal, eFormatOSType, eFormatUnicode16, eFormatUnicode32, eFormatUnsigned, eFormatPointer, eFormatVectorOfChar, eFormatVectorOfSInt8, eFormatVectorOfUInt8, eFormatVectorOfSInt16, eFormatVectorOfUInt16, eFormatVectorOfSInt32, eFormatVectorOfUInt32, eFormatVectorOfSInt64, eFormatVectorOfUInt64, eFormatVectorOfFloat16, eFormatVectorOfFloat32, eFormatVectorOfFloat64, eFormatVectorOfUInt128, eFormatComplexInteger, eFormatCharArray, eFormatAddressInfo, eFormatHexFloat, eFormatInstruction, eFormatVoid, eFormatUnicode8, kNumFormats }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/FormatterMatchType.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/FormatterMatchType.java deleted file mode 100644 index 2c36e07fc5..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/FormatterMatchType.java +++ /dev/null @@ -1,59 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class FormatterMatchType { - public final static FormatterMatchType eFormatterMatchExact = new FormatterMatchType("eFormatterMatchExact"); - public final static FormatterMatchType eFormatterMatchRegex = new FormatterMatchType("eFormatterMatchRegex"); - public final static FormatterMatchType eFormatterMatchCallback = new FormatterMatchType("eFormatterMatchCallback"); - public final static FormatterMatchType eLastFormatterMatchType = new FormatterMatchType("eLastFormatterMatchType", lldbJNI.eLastFormatterMatchType_get()); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static FormatterMatchType swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + FormatterMatchType.class + " with value " + swigValue); - } - - private FormatterMatchType(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private FormatterMatchType(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private FormatterMatchType(String swigName, FormatterMatchType swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static FormatterMatchType[] swigValues = { eFormatterMatchExact, eFormatterMatchRegex, eFormatterMatchCallback, eLastFormatterMatchType }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/FrameComparison.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/FrameComparison.java deleted file mode 100644 index ec952b35ab..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/FrameComparison.java +++ /dev/null @@ -1,61 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class FrameComparison { - public final static FrameComparison eFrameCompareInvalid = new FrameComparison("eFrameCompareInvalid"); - public final static FrameComparison eFrameCompareUnknown = new FrameComparison("eFrameCompareUnknown"); - public final static FrameComparison eFrameCompareEqual = new FrameComparison("eFrameCompareEqual"); - public final static FrameComparison eFrameCompareSameParent = new FrameComparison("eFrameCompareSameParent"); - public final static FrameComparison eFrameCompareYounger = new FrameComparison("eFrameCompareYounger"); - public final static FrameComparison eFrameCompareOlder = new FrameComparison("eFrameCompareOlder"); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static FrameComparison swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + FrameComparison.class + " with value " + swigValue); - } - - private FrameComparison(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private FrameComparison(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private FrameComparison(String swigName, FrameComparison swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static FrameComparison[] swigValues = { eFrameCompareInvalid, eFrameCompareUnknown, eFrameCompareEqual, eFrameCompareSameParent, eFrameCompareYounger, eFrameCompareOlder }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/FunctionNameType.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/FunctionNameType.java deleted file mode 100644 index 2d488463ff..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/FunctionNameType.java +++ /dev/null @@ -1,62 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class FunctionNameType { - public final static FunctionNameType eFunctionNameTypeNone = new FunctionNameType("eFunctionNameTypeNone", lldbJNI.eFunctionNameTypeNone_get()); - public final static FunctionNameType eFunctionNameTypeAuto = new FunctionNameType("eFunctionNameTypeAuto", lldbJNI.eFunctionNameTypeAuto_get()); - public final static FunctionNameType eFunctionNameTypeFull = new FunctionNameType("eFunctionNameTypeFull", lldbJNI.eFunctionNameTypeFull_get()); - public final static FunctionNameType eFunctionNameTypeBase = new FunctionNameType("eFunctionNameTypeBase", lldbJNI.eFunctionNameTypeBase_get()); - public final static FunctionNameType eFunctionNameTypeMethod = new FunctionNameType("eFunctionNameTypeMethod", lldbJNI.eFunctionNameTypeMethod_get()); - public final static FunctionNameType eFunctionNameTypeSelector = new FunctionNameType("eFunctionNameTypeSelector", lldbJNI.eFunctionNameTypeSelector_get()); - public final static FunctionNameType eFunctionNameTypeAny = new FunctionNameType("eFunctionNameTypeAny", lldbJNI.eFunctionNameTypeAny_get()); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static FunctionNameType swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + FunctionNameType.class + " with value " + swigValue); - } - - private FunctionNameType(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private FunctionNameType(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private FunctionNameType(String swigName, FunctionNameType swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static FunctionNameType[] swigValues = { eFunctionNameTypeNone, eFunctionNameTypeAuto, eFunctionNameTypeFull, eFunctionNameTypeBase, eFunctionNameTypeMethod, eFunctionNameTypeSelector, eFunctionNameTypeAny }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/GdbSignal.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/GdbSignal.java deleted file mode 100644 index fdb07af365..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/GdbSignal.java +++ /dev/null @@ -1,61 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class GdbSignal { - public final static GdbSignal eGdbSignalBadAccess = new GdbSignal("eGdbSignalBadAccess", lldbJNI.eGdbSignalBadAccess_get()); - public final static GdbSignal eGdbSignalBadInstruction = new GdbSignal("eGdbSignalBadInstruction", lldbJNI.eGdbSignalBadInstruction_get()); - public final static GdbSignal eGdbSignalArithmetic = new GdbSignal("eGdbSignalArithmetic", lldbJNI.eGdbSignalArithmetic_get()); - public final static GdbSignal eGdbSignalEmulation = new GdbSignal("eGdbSignalEmulation", lldbJNI.eGdbSignalEmulation_get()); - public final static GdbSignal eGdbSignalSoftware = new GdbSignal("eGdbSignalSoftware", lldbJNI.eGdbSignalSoftware_get()); - public final static GdbSignal eGdbSignalBreakpoint = new GdbSignal("eGdbSignalBreakpoint", lldbJNI.eGdbSignalBreakpoint_get()); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static GdbSignal swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + GdbSignal.class + " with value " + swigValue); - } - - private GdbSignal(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private GdbSignal(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private GdbSignal(String swigName, GdbSignal swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static GdbSignal[] swigValues = { eGdbSignalBadAccess, eGdbSignalBadInstruction, eGdbSignalArithmetic, eGdbSignalEmulation, eGdbSignalSoftware, eGdbSignalBreakpoint }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/InputReaderAction.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/InputReaderAction.java deleted file mode 100644 index a168bb8d77..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/InputReaderAction.java +++ /dev/null @@ -1,63 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class InputReaderAction { - public final static InputReaderAction eInputReaderActivate = new InputReaderAction("eInputReaderActivate"); - public final static InputReaderAction eInputReaderAsynchronousOutputWritten = new InputReaderAction("eInputReaderAsynchronousOutputWritten"); - public final static InputReaderAction eInputReaderReactivate = new InputReaderAction("eInputReaderReactivate"); - public final static InputReaderAction eInputReaderDeactivate = new InputReaderAction("eInputReaderDeactivate"); - public final static InputReaderAction eInputReaderGotToken = new InputReaderAction("eInputReaderGotToken"); - public final static InputReaderAction eInputReaderInterrupt = new InputReaderAction("eInputReaderInterrupt"); - public final static InputReaderAction eInputReaderEndOfFile = new InputReaderAction("eInputReaderEndOfFile"); - public final static InputReaderAction eInputReaderDone = new InputReaderAction("eInputReaderDone"); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static InputReaderAction swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + InputReaderAction.class + " with value " + swigValue); - } - - private InputReaderAction(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private InputReaderAction(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private InputReaderAction(String swigName, InputReaderAction swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static InputReaderAction[] swigValues = { eInputReaderActivate, eInputReaderAsynchronousOutputWritten, eInputReaderReactivate, eInputReaderDeactivate, eInputReaderGotToken, eInputReaderInterrupt, eInputReaderEndOfFile, eInputReaderDone }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/InputReaderGranularity.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/InputReaderGranularity.java deleted file mode 100644 index 385089f5c4..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/InputReaderGranularity.java +++ /dev/null @@ -1,60 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class InputReaderGranularity { - public final static InputReaderGranularity eInputReaderGranularityInvalid = new InputReaderGranularity("eInputReaderGranularityInvalid", lldbJNI.eInputReaderGranularityInvalid_get()); - public final static InputReaderGranularity eInputReaderGranularityByte = new InputReaderGranularity("eInputReaderGranularityByte"); - public final static InputReaderGranularity eInputReaderGranularityWord = new InputReaderGranularity("eInputReaderGranularityWord"); - public final static InputReaderGranularity eInputReaderGranularityLine = new InputReaderGranularity("eInputReaderGranularityLine"); - public final static InputReaderGranularity eInputReaderGranularityAll = new InputReaderGranularity("eInputReaderGranularityAll"); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static InputReaderGranularity swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + InputReaderGranularity.class + " with value " + swigValue); - } - - private InputReaderGranularity(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private InputReaderGranularity(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private InputReaderGranularity(String swigName, InputReaderGranularity swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static InputReaderGranularity[] swigValues = { eInputReaderGranularityInvalid, eInputReaderGranularityByte, eInputReaderGranularityWord, eInputReaderGranularityLine, eInputReaderGranularityAll }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/InstructionControlFlowKind.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/InstructionControlFlowKind.java deleted file mode 100644 index 89f96c3002..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/InstructionControlFlowKind.java +++ /dev/null @@ -1,64 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class InstructionControlFlowKind { - public final static InstructionControlFlowKind eInstructionControlFlowKindUnknown = new InstructionControlFlowKind("eInstructionControlFlowKindUnknown", lldbJNI.eInstructionControlFlowKindUnknown_get()); - public final static InstructionControlFlowKind eInstructionControlFlowKindOther = new InstructionControlFlowKind("eInstructionControlFlowKindOther"); - public final static InstructionControlFlowKind eInstructionControlFlowKindCall = new InstructionControlFlowKind("eInstructionControlFlowKindCall"); - public final static InstructionControlFlowKind eInstructionControlFlowKindReturn = new InstructionControlFlowKind("eInstructionControlFlowKindReturn"); - public final static InstructionControlFlowKind eInstructionControlFlowKindJump = new InstructionControlFlowKind("eInstructionControlFlowKindJump"); - public final static InstructionControlFlowKind eInstructionControlFlowKindCondJump = new InstructionControlFlowKind("eInstructionControlFlowKindCondJump"); - public final static InstructionControlFlowKind eInstructionControlFlowKindFarCall = new InstructionControlFlowKind("eInstructionControlFlowKindFarCall"); - public final static InstructionControlFlowKind eInstructionControlFlowKindFarReturn = new InstructionControlFlowKind("eInstructionControlFlowKindFarReturn"); - public final static InstructionControlFlowKind eInstructionControlFlowKindFarJump = new InstructionControlFlowKind("eInstructionControlFlowKindFarJump"); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static InstructionControlFlowKind swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + InstructionControlFlowKind.class + " with value " + swigValue); - } - - private InstructionControlFlowKind(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private InstructionControlFlowKind(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private InstructionControlFlowKind(String swigName, InstructionControlFlowKind swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static InstructionControlFlowKind[] swigValues = { eInstructionControlFlowKindUnknown, eInstructionControlFlowKindOther, eInstructionControlFlowKindCall, eInstructionControlFlowKindReturn, eInstructionControlFlowKindJump, eInstructionControlFlowKindCondJump, eInstructionControlFlowKindFarCall, eInstructionControlFlowKindFarReturn, eInstructionControlFlowKindFarJump }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/InstrumentationRuntimeType.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/InstrumentationRuntimeType.java deleted file mode 100644 index 0322b01411..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/InstrumentationRuntimeType.java +++ /dev/null @@ -1,61 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class InstrumentationRuntimeType { - public final static InstrumentationRuntimeType eInstrumentationRuntimeTypeAddressSanitizer = new InstrumentationRuntimeType("eInstrumentationRuntimeTypeAddressSanitizer", lldbJNI.eInstrumentationRuntimeTypeAddressSanitizer_get()); - public final static InstrumentationRuntimeType eInstrumentationRuntimeTypeThreadSanitizer = new InstrumentationRuntimeType("eInstrumentationRuntimeTypeThreadSanitizer", lldbJNI.eInstrumentationRuntimeTypeThreadSanitizer_get()); - public final static InstrumentationRuntimeType eInstrumentationRuntimeTypeUndefinedBehaviorSanitizer = new InstrumentationRuntimeType("eInstrumentationRuntimeTypeUndefinedBehaviorSanitizer", lldbJNI.eInstrumentationRuntimeTypeUndefinedBehaviorSanitizer_get()); - public final static InstrumentationRuntimeType eInstrumentationRuntimeTypeMainThreadChecker = new InstrumentationRuntimeType("eInstrumentationRuntimeTypeMainThreadChecker", lldbJNI.eInstrumentationRuntimeTypeMainThreadChecker_get()); - public final static InstrumentationRuntimeType eInstrumentationRuntimeTypeSwiftRuntimeReporting = new InstrumentationRuntimeType("eInstrumentationRuntimeTypeSwiftRuntimeReporting", lldbJNI.eInstrumentationRuntimeTypeSwiftRuntimeReporting_get()); - public final static InstrumentationRuntimeType eNumInstrumentationRuntimeTypes = new InstrumentationRuntimeType("eNumInstrumentationRuntimeTypes"); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static InstrumentationRuntimeType swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + InstrumentationRuntimeType.class + " with value " + swigValue); - } - - private InstrumentationRuntimeType(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private InstrumentationRuntimeType(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private InstrumentationRuntimeType(String swigName, InstrumentationRuntimeType swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static InstrumentationRuntimeType[] swigValues = { eInstrumentationRuntimeTypeAddressSanitizer, eInstrumentationRuntimeTypeThreadSanitizer, eInstrumentationRuntimeTypeUndefinedBehaviorSanitizer, eInstrumentationRuntimeTypeMainThreadChecker, eInstrumentationRuntimeTypeSwiftRuntimeReporting, eNumInstrumentationRuntimeTypes }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/LanguageType.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/LanguageType.java deleted file mode 100644 index 44ad01a1d4..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/LanguageType.java +++ /dev/null @@ -1,108 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class LanguageType { - public final static LanguageType eLanguageTypeUnknown = new LanguageType("eLanguageTypeUnknown", lldbJNI.eLanguageTypeUnknown_get()); - public final static LanguageType eLanguageTypeC89 = new LanguageType("eLanguageTypeC89", lldbJNI.eLanguageTypeC89_get()); - public final static LanguageType eLanguageTypeC = new LanguageType("eLanguageTypeC", lldbJNI.eLanguageTypeC_get()); - public final static LanguageType eLanguageTypeAda83 = new LanguageType("eLanguageTypeAda83", lldbJNI.eLanguageTypeAda83_get()); - public final static LanguageType eLanguageTypeC_plus_plus = new LanguageType("eLanguageTypeC_plus_plus", lldbJNI.eLanguageTypeC_plus_plus_get()); - public final static LanguageType eLanguageTypeCobol74 = new LanguageType("eLanguageTypeCobol74", lldbJNI.eLanguageTypeCobol74_get()); - public final static LanguageType eLanguageTypeCobol85 = new LanguageType("eLanguageTypeCobol85", lldbJNI.eLanguageTypeCobol85_get()); - public final static LanguageType eLanguageTypeFortran77 = new LanguageType("eLanguageTypeFortran77", lldbJNI.eLanguageTypeFortran77_get()); - public final static LanguageType eLanguageTypeFortran90 = new LanguageType("eLanguageTypeFortran90", lldbJNI.eLanguageTypeFortran90_get()); - public final static LanguageType eLanguageTypePascal83 = new LanguageType("eLanguageTypePascal83", lldbJNI.eLanguageTypePascal83_get()); - public final static LanguageType eLanguageTypeModula2 = new LanguageType("eLanguageTypeModula2", lldbJNI.eLanguageTypeModula2_get()); - public final static LanguageType eLanguageTypeJava = new LanguageType("eLanguageTypeJava", lldbJNI.eLanguageTypeJava_get()); - public final static LanguageType eLanguageTypeC99 = new LanguageType("eLanguageTypeC99", lldbJNI.eLanguageTypeC99_get()); - public final static LanguageType eLanguageTypeAda95 = new LanguageType("eLanguageTypeAda95", lldbJNI.eLanguageTypeAda95_get()); - public final static LanguageType eLanguageTypeFortran95 = new LanguageType("eLanguageTypeFortran95", lldbJNI.eLanguageTypeFortran95_get()); - public final static LanguageType eLanguageTypePLI = new LanguageType("eLanguageTypePLI", lldbJNI.eLanguageTypePLI_get()); - public final static LanguageType eLanguageTypeObjC = new LanguageType("eLanguageTypeObjC", lldbJNI.eLanguageTypeObjC_get()); - public final static LanguageType eLanguageTypeObjC_plus_plus = new LanguageType("eLanguageTypeObjC_plus_plus", lldbJNI.eLanguageTypeObjC_plus_plus_get()); - public final static LanguageType eLanguageTypeUPC = new LanguageType("eLanguageTypeUPC", lldbJNI.eLanguageTypeUPC_get()); - public final static LanguageType eLanguageTypeD = new LanguageType("eLanguageTypeD", lldbJNI.eLanguageTypeD_get()); - public final static LanguageType eLanguageTypePython = new LanguageType("eLanguageTypePython", lldbJNI.eLanguageTypePython_get()); - public final static LanguageType eLanguageTypeOpenCL = new LanguageType("eLanguageTypeOpenCL", lldbJNI.eLanguageTypeOpenCL_get()); - public final static LanguageType eLanguageTypeGo = new LanguageType("eLanguageTypeGo", lldbJNI.eLanguageTypeGo_get()); - public final static LanguageType eLanguageTypeModula3 = new LanguageType("eLanguageTypeModula3", lldbJNI.eLanguageTypeModula3_get()); - public final static LanguageType eLanguageTypeHaskell = new LanguageType("eLanguageTypeHaskell", lldbJNI.eLanguageTypeHaskell_get()); - public final static LanguageType eLanguageTypeC_plus_plus_03 = new LanguageType("eLanguageTypeC_plus_plus_03", lldbJNI.eLanguageTypeC_plus_plus_03_get()); - public final static LanguageType eLanguageTypeC_plus_plus_11 = new LanguageType("eLanguageTypeC_plus_plus_11", lldbJNI.eLanguageTypeC_plus_plus_11_get()); - public final static LanguageType eLanguageTypeOCaml = new LanguageType("eLanguageTypeOCaml", lldbJNI.eLanguageTypeOCaml_get()); - public final static LanguageType eLanguageTypeRust = new LanguageType("eLanguageTypeRust", lldbJNI.eLanguageTypeRust_get()); - public final static LanguageType eLanguageTypeC11 = new LanguageType("eLanguageTypeC11", lldbJNI.eLanguageTypeC11_get()); - public final static LanguageType eLanguageTypeSwift = new LanguageType("eLanguageTypeSwift", lldbJNI.eLanguageTypeSwift_get()); - public final static LanguageType eLanguageTypeJulia = new LanguageType("eLanguageTypeJulia", lldbJNI.eLanguageTypeJulia_get()); - public final static LanguageType eLanguageTypeDylan = new LanguageType("eLanguageTypeDylan", lldbJNI.eLanguageTypeDylan_get()); - public final static LanguageType eLanguageTypeC_plus_plus_14 = new LanguageType("eLanguageTypeC_plus_plus_14", lldbJNI.eLanguageTypeC_plus_plus_14_get()); - public final static LanguageType eLanguageTypeFortran03 = new LanguageType("eLanguageTypeFortran03", lldbJNI.eLanguageTypeFortran03_get()); - public final static LanguageType eLanguageTypeFortran08 = new LanguageType("eLanguageTypeFortran08", lldbJNI.eLanguageTypeFortran08_get()); - public final static LanguageType eLanguageTypeRenderScript = new LanguageType("eLanguageTypeRenderScript", lldbJNI.eLanguageTypeRenderScript_get()); - public final static LanguageType eLanguageTypeBLISS = new LanguageType("eLanguageTypeBLISS", lldbJNI.eLanguageTypeBLISS_get()); - public final static LanguageType eLanguageTypeKotlin = new LanguageType("eLanguageTypeKotlin", lldbJNI.eLanguageTypeKotlin_get()); - public final static LanguageType eLanguageTypeZig = new LanguageType("eLanguageTypeZig", lldbJNI.eLanguageTypeZig_get()); - public final static LanguageType eLanguageTypeCrystal = new LanguageType("eLanguageTypeCrystal", lldbJNI.eLanguageTypeCrystal_get()); - public final static LanguageType eLanguageTypeC_plus_plus_17 = new LanguageType("eLanguageTypeC_plus_plus_17", lldbJNI.eLanguageTypeC_plus_plus_17_get()); - public final static LanguageType eLanguageTypeC_plus_plus_20 = new LanguageType("eLanguageTypeC_plus_plus_20", lldbJNI.eLanguageTypeC_plus_plus_20_get()); - public final static LanguageType eLanguageTypeC17 = new LanguageType("eLanguageTypeC17", lldbJNI.eLanguageTypeC17_get()); - public final static LanguageType eLanguageTypeFortran18 = new LanguageType("eLanguageTypeFortran18", lldbJNI.eLanguageTypeFortran18_get()); - public final static LanguageType eLanguageTypeAda2005 = new LanguageType("eLanguageTypeAda2005", lldbJNI.eLanguageTypeAda2005_get()); - public final static LanguageType eLanguageTypeAda2012 = new LanguageType("eLanguageTypeAda2012", lldbJNI.eLanguageTypeAda2012_get()); - public final static LanguageType eLanguageTypeHIP = new LanguageType("eLanguageTypeHIP", lldbJNI.eLanguageTypeHIP_get()); - public final static LanguageType eLanguageTypeAssembly = new LanguageType("eLanguageTypeAssembly", lldbJNI.eLanguageTypeAssembly_get()); - public final static LanguageType eLanguageTypeC_sharp = new LanguageType("eLanguageTypeC_sharp", lldbJNI.eLanguageTypeC_sharp_get()); - public final static LanguageType eLanguageTypeMojo = new LanguageType("eLanguageTypeMojo", lldbJNI.eLanguageTypeMojo_get()); - public final static LanguageType eLanguageTypeMipsAssembler = new LanguageType("eLanguageTypeMipsAssembler"); - public final static LanguageType eNumLanguageTypes = new LanguageType("eNumLanguageTypes"); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static LanguageType swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + LanguageType.class + " with value " + swigValue); - } - - private LanguageType(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private LanguageType(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private LanguageType(String swigName, LanguageType swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static LanguageType[] swigValues = { eLanguageTypeUnknown, eLanguageTypeC89, eLanguageTypeC, eLanguageTypeAda83, eLanguageTypeC_plus_plus, eLanguageTypeCobol74, eLanguageTypeCobol85, eLanguageTypeFortran77, eLanguageTypeFortran90, eLanguageTypePascal83, eLanguageTypeModula2, eLanguageTypeJava, eLanguageTypeC99, eLanguageTypeAda95, eLanguageTypeFortran95, eLanguageTypePLI, eLanguageTypeObjC, eLanguageTypeObjC_plus_plus, eLanguageTypeUPC, eLanguageTypeD, eLanguageTypePython, eLanguageTypeOpenCL, eLanguageTypeGo, eLanguageTypeModula3, eLanguageTypeHaskell, eLanguageTypeC_plus_plus_03, eLanguageTypeC_plus_plus_11, eLanguageTypeOCaml, eLanguageTypeRust, eLanguageTypeC11, eLanguageTypeSwift, eLanguageTypeJulia, eLanguageTypeDylan, eLanguageTypeC_plus_plus_14, eLanguageTypeFortran03, eLanguageTypeFortran08, eLanguageTypeRenderScript, eLanguageTypeBLISS, eLanguageTypeKotlin, eLanguageTypeZig, eLanguageTypeCrystal, eLanguageTypeC_plus_plus_17, eLanguageTypeC_plus_plus_20, eLanguageTypeC17, eLanguageTypeFortran18, eLanguageTypeAda2005, eLanguageTypeAda2012, eLanguageTypeHIP, eLanguageTypeAssembly, eLanguageTypeC_sharp, eLanguageTypeMojo, eLanguageTypeMipsAssembler, eNumLanguageTypes }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/LaunchFlags.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/LaunchFlags.java deleted file mode 100644 index 93659560e1..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/LaunchFlags.java +++ /dev/null @@ -1,69 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class LaunchFlags { - public final static LaunchFlags eLaunchFlagNone = new LaunchFlags("eLaunchFlagNone", lldbJNI.eLaunchFlagNone_get()); - public final static LaunchFlags eLaunchFlagExec = new LaunchFlags("eLaunchFlagExec", lldbJNI.eLaunchFlagExec_get()); - public final static LaunchFlags eLaunchFlagDebug = new LaunchFlags("eLaunchFlagDebug", lldbJNI.eLaunchFlagDebug_get()); - public final static LaunchFlags eLaunchFlagStopAtEntry = new LaunchFlags("eLaunchFlagStopAtEntry", lldbJNI.eLaunchFlagStopAtEntry_get()); - public final static LaunchFlags eLaunchFlagDisableASLR = new LaunchFlags("eLaunchFlagDisableASLR", lldbJNI.eLaunchFlagDisableASLR_get()); - public final static LaunchFlags eLaunchFlagDisableSTDIO = new LaunchFlags("eLaunchFlagDisableSTDIO", lldbJNI.eLaunchFlagDisableSTDIO_get()); - public final static LaunchFlags eLaunchFlagLaunchInTTY = new LaunchFlags("eLaunchFlagLaunchInTTY", lldbJNI.eLaunchFlagLaunchInTTY_get()); - public final static LaunchFlags eLaunchFlagLaunchInShell = new LaunchFlags("eLaunchFlagLaunchInShell", lldbJNI.eLaunchFlagLaunchInShell_get()); - public final static LaunchFlags eLaunchFlagLaunchInSeparateProcessGroup = new LaunchFlags("eLaunchFlagLaunchInSeparateProcessGroup", lldbJNI.eLaunchFlagLaunchInSeparateProcessGroup_get()); - public final static LaunchFlags eLaunchFlagDontSetExitStatus = new LaunchFlags("eLaunchFlagDontSetExitStatus", lldbJNI.eLaunchFlagDontSetExitStatus_get()); - public final static LaunchFlags eLaunchFlagDetachOnError = new LaunchFlags("eLaunchFlagDetachOnError", lldbJNI.eLaunchFlagDetachOnError_get()); - public final static LaunchFlags eLaunchFlagShellExpandArguments = new LaunchFlags("eLaunchFlagShellExpandArguments", lldbJNI.eLaunchFlagShellExpandArguments_get()); - public final static LaunchFlags eLaunchFlagCloseTTYOnExit = new LaunchFlags("eLaunchFlagCloseTTYOnExit", lldbJNI.eLaunchFlagCloseTTYOnExit_get()); - public final static LaunchFlags eLaunchFlagInheritTCCFromParent = new LaunchFlags("eLaunchFlagInheritTCCFromParent", lldbJNI.eLaunchFlagInheritTCCFromParent_get()); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static LaunchFlags swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + LaunchFlags.class + " with value " + swigValue); - } - - private LaunchFlags(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private LaunchFlags(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private LaunchFlags(String swigName, LaunchFlags swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static LaunchFlags[] swigValues = { eLaunchFlagNone, eLaunchFlagExec, eLaunchFlagDebug, eLaunchFlagStopAtEntry, eLaunchFlagDisableASLR, eLaunchFlagDisableSTDIO, eLaunchFlagLaunchInTTY, eLaunchFlagLaunchInShell, eLaunchFlagLaunchInSeparateProcessGroup, eLaunchFlagDontSetExitStatus, eLaunchFlagDetachOnError, eLaunchFlagShellExpandArguments, eLaunchFlagCloseTTYOnExit, eLaunchFlagInheritTCCFromParent }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/MatchType.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/MatchType.java deleted file mode 100644 index 344ff3a72f..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/MatchType.java +++ /dev/null @@ -1,58 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class MatchType { - public final static MatchType eMatchTypeNormal = new MatchType("eMatchTypeNormal"); - public final static MatchType eMatchTypeRegex = new MatchType("eMatchTypeRegex"); - public final static MatchType eMatchTypeStartsWith = new MatchType("eMatchTypeStartsWith"); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static MatchType swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + MatchType.class + " with value " + swigValue); - } - - private MatchType(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private MatchType(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private MatchType(String swigName, MatchType swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static MatchType[] swigValues = { eMatchTypeNormal, eMatchTypeRegex, eMatchTypeStartsWith }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/MemberFunctionKind.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/MemberFunctionKind.java deleted file mode 100644 index 3d5646ce53..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/MemberFunctionKind.java +++ /dev/null @@ -1,60 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class MemberFunctionKind { - public final static MemberFunctionKind eMemberFunctionKindUnknown = new MemberFunctionKind("eMemberFunctionKindUnknown", lldbJNI.eMemberFunctionKindUnknown_get()); - public final static MemberFunctionKind eMemberFunctionKindConstructor = new MemberFunctionKind("eMemberFunctionKindConstructor"); - public final static MemberFunctionKind eMemberFunctionKindDestructor = new MemberFunctionKind("eMemberFunctionKindDestructor"); - public final static MemberFunctionKind eMemberFunctionKindInstanceMethod = new MemberFunctionKind("eMemberFunctionKindInstanceMethod"); - public final static MemberFunctionKind eMemberFunctionKindStaticMethod = new MemberFunctionKind("eMemberFunctionKindStaticMethod"); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static MemberFunctionKind swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + MemberFunctionKind.class + " with value " + swigValue); - } - - private MemberFunctionKind(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private MemberFunctionKind(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private MemberFunctionKind(String swigName, MemberFunctionKind swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static MemberFunctionKind[] swigValues = { eMemberFunctionKindUnknown, eMemberFunctionKindConstructor, eMemberFunctionKindDestructor, eMemberFunctionKindInstanceMethod, eMemberFunctionKindStaticMethod }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/PathType.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/PathType.java deleted file mode 100644 index 0ac61f3e1d..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/PathType.java +++ /dev/null @@ -1,64 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class PathType { - public final static PathType ePathTypeLLDBShlibDir = new PathType("ePathTypeLLDBShlibDir"); - public final static PathType ePathTypeSupportExecutableDir = new PathType("ePathTypeSupportExecutableDir"); - public final static PathType ePathTypeHeaderDir = new PathType("ePathTypeHeaderDir"); - public final static PathType ePathTypePythonDir = new PathType("ePathTypePythonDir"); - public final static PathType ePathTypeLLDBSystemPlugins = new PathType("ePathTypeLLDBSystemPlugins"); - public final static PathType ePathTypeLLDBUserPlugins = new PathType("ePathTypeLLDBUserPlugins"); - public final static PathType ePathTypeLLDBTempSystemDir = new PathType("ePathTypeLLDBTempSystemDir"); - public final static PathType ePathTypeGlobalLLDBTempSystemDir = new PathType("ePathTypeGlobalLLDBTempSystemDir"); - public final static PathType ePathTypeClangDir = new PathType("ePathTypeClangDir"); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static PathType swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + PathType.class + " with value " + swigValue); - } - - private PathType(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private PathType(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private PathType(String swigName, PathType swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static PathType[] swigValues = { ePathTypeLLDBShlibDir, ePathTypeSupportExecutableDir, ePathTypeHeaderDir, ePathTypePythonDir, ePathTypeLLDBSystemPlugins, ePathTypeLLDBUserPlugins, ePathTypeLLDBTempSystemDir, ePathTypeGlobalLLDBTempSystemDir, ePathTypeClangDir }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/Permissions.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/Permissions.java deleted file mode 100644 index d480115abe..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/Permissions.java +++ /dev/null @@ -1,58 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class Permissions { - public final static Permissions ePermissionsWritable = new Permissions("ePermissionsWritable", lldbJNI.ePermissionsWritable_get()); - public final static Permissions ePermissionsReadable = new Permissions("ePermissionsReadable", lldbJNI.ePermissionsReadable_get()); - public final static Permissions ePermissionsExecutable = new Permissions("ePermissionsExecutable", lldbJNI.ePermissionsExecutable_get()); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static Permissions swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + Permissions.class + " with value " + swigValue); - } - - private Permissions(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private Permissions(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private Permissions(String swigName, Permissions swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static Permissions[] swigValues = { ePermissionsWritable, ePermissionsReadable, ePermissionsExecutable }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/QueueItemKind.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/QueueItemKind.java deleted file mode 100644 index 3c347231c6..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/QueueItemKind.java +++ /dev/null @@ -1,58 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class QueueItemKind { - public final static QueueItemKind eQueueItemKindUnknown = new QueueItemKind("eQueueItemKindUnknown", lldbJNI.eQueueItemKindUnknown_get()); - public final static QueueItemKind eQueueItemKindFunction = new QueueItemKind("eQueueItemKindFunction"); - public final static QueueItemKind eQueueItemKindBlock = new QueueItemKind("eQueueItemKindBlock"); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static QueueItemKind swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + QueueItemKind.class + " with value " + swigValue); - } - - private QueueItemKind(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private QueueItemKind(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private QueueItemKind(String swigName, QueueItemKind swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static QueueItemKind[] swigValues = { eQueueItemKindUnknown, eQueueItemKindFunction, eQueueItemKindBlock }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/QueueKind.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/QueueKind.java deleted file mode 100644 index 481e356a83..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/QueueKind.java +++ /dev/null @@ -1,58 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class QueueKind { - public final static QueueKind eQueueKindUnknown = new QueueKind("eQueueKindUnknown", lldbJNI.eQueueKindUnknown_get()); - public final static QueueKind eQueueKindSerial = new QueueKind("eQueueKindSerial"); - public final static QueueKind eQueueKindConcurrent = new QueueKind("eQueueKindConcurrent"); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static QueueKind swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + QueueKind.class + " with value " + swigValue); - } - - private QueueKind(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private QueueKind(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private QueueKind(String swigName, QueueKind swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static QueueKind[] swigValues = { eQueueKindUnknown, eQueueKindSerial, eQueueKindConcurrent }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/RegisterKind.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/RegisterKind.java deleted file mode 100644 index df091de74e..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/RegisterKind.java +++ /dev/null @@ -1,61 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class RegisterKind { - public final static RegisterKind eRegisterKindEHFrame = new RegisterKind("eRegisterKindEHFrame", lldbJNI.eRegisterKindEHFrame_get()); - public final static RegisterKind eRegisterKindDWARF = new RegisterKind("eRegisterKindDWARF"); - public final static RegisterKind eRegisterKindGeneric = new RegisterKind("eRegisterKindGeneric"); - public final static RegisterKind eRegisterKindProcessPlugin = new RegisterKind("eRegisterKindProcessPlugin"); - public final static RegisterKind eRegisterKindLLDB = new RegisterKind("eRegisterKindLLDB"); - public final static RegisterKind kNumRegisterKinds = new RegisterKind("kNumRegisterKinds"); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static RegisterKind swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + RegisterKind.class + " with value " + swigValue); - } - - private RegisterKind(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private RegisterKind(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private RegisterKind(String swigName, RegisterKind swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static RegisterKind[] swigValues = { eRegisterKindEHFrame, eRegisterKindDWARF, eRegisterKindGeneric, eRegisterKindProcessPlugin, eRegisterKindLLDB, kNumRegisterKinds }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ReturnStatus.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ReturnStatus.java deleted file mode 100644 index 50097a732c..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ReturnStatus.java +++ /dev/null @@ -1,63 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class ReturnStatus { - public final static ReturnStatus eReturnStatusInvalid = new ReturnStatus("eReturnStatusInvalid"); - public final static ReturnStatus eReturnStatusSuccessFinishNoResult = new ReturnStatus("eReturnStatusSuccessFinishNoResult"); - public final static ReturnStatus eReturnStatusSuccessFinishResult = new ReturnStatus("eReturnStatusSuccessFinishResult"); - public final static ReturnStatus eReturnStatusSuccessContinuingNoResult = new ReturnStatus("eReturnStatusSuccessContinuingNoResult"); - public final static ReturnStatus eReturnStatusSuccessContinuingResult = new ReturnStatus("eReturnStatusSuccessContinuingResult"); - public final static ReturnStatus eReturnStatusStarted = new ReturnStatus("eReturnStatusStarted"); - public final static ReturnStatus eReturnStatusFailed = new ReturnStatus("eReturnStatusFailed"); - public final static ReturnStatus eReturnStatusQuit = new ReturnStatus("eReturnStatusQuit"); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static ReturnStatus swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + ReturnStatus.class + " with value " + swigValue); - } - - private ReturnStatus(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private ReturnStatus(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private ReturnStatus(String swigName, ReturnStatus swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static ReturnStatus[] swigValues = { eReturnStatusInvalid, eReturnStatusSuccessFinishNoResult, eReturnStatusSuccessFinishResult, eReturnStatusSuccessContinuingNoResult, eReturnStatusSuccessContinuingResult, eReturnStatusStarted, eReturnStatusFailed, eReturnStatusQuit }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/RunMode.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/RunMode.java deleted file mode 100644 index 29b4a1aaa4..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/RunMode.java +++ /dev/null @@ -1,58 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class RunMode { - public final static RunMode eOnlyThisThread = new RunMode("eOnlyThisThread"); - public final static RunMode eAllThreads = new RunMode("eAllThreads"); - public final static RunMode eOnlyDuringStepping = new RunMode("eOnlyDuringStepping"); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static RunMode swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + RunMode.class + " with value " + swigValue); - } - - private RunMode(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private RunMode(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private RunMode(String swigName, RunMode swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static RunMode[] swigValues = { eOnlyThisThread, eAllThreads, eOnlyDuringStepping }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBAddress.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBAddress.java deleted file mode 100644 index 8abe98d98c..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBAddress.java +++ /dev/null @@ -1,142 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBAddress { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBAddress(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBAddress obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBAddress obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBAddress(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBAddress() { - this(lldbJNI.new_SBAddress__SWIG_0(), true); - } - - public SBAddress(SBAddress rhs) { - this(lldbJNI.new_SBAddress__SWIG_1(SBAddress.getCPtr(rhs), rhs), true); - } - - public SBAddress(SBSection section, java.math.BigInteger offset) { - this(lldbJNI.new_SBAddress__SWIG_2(SBSection.getCPtr(section), section, offset), true); - } - - public SBAddress(java.math.BigInteger load_addr, SBTarget target) { - this(lldbJNI.new_SBAddress__SWIG_3(load_addr, SBTarget.getCPtr(target), target), true); - } - - public boolean IsValid() { - return lldbJNI.SBAddress_IsValid(swigCPtr, this); - } - - public void Clear() { - lldbJNI.SBAddress_Clear(swigCPtr, this); - } - - public java.math.BigInteger GetFileAddress() { - return lldbJNI.SBAddress_GetFileAddress(swigCPtr, this); - } - - public java.math.BigInteger GetLoadAddress(SBTarget target) { - return lldbJNI.SBAddress_GetLoadAddress(swigCPtr, this, SBTarget.getCPtr(target), target); - } - - public void SetAddress(SBSection section, java.math.BigInteger offset) { - lldbJNI.SBAddress_SetAddress(swigCPtr, this, SBSection.getCPtr(section), section, offset); - } - - public void SetLoadAddress(java.math.BigInteger load_addr, SBTarget target) { - lldbJNI.SBAddress_SetLoadAddress(swigCPtr, this, load_addr, SBTarget.getCPtr(target), target); - } - - public boolean OffsetAddress(java.math.BigInteger offset) { - return lldbJNI.SBAddress_OffsetAddress(swigCPtr, this, offset); - } - - public boolean GetDescription(SBStream description) { - return lldbJNI.SBAddress_GetDescription(swigCPtr, this, SBStream.getCPtr(description), description); - } - - public SBSymbolContext GetSymbolContext(long resolve_scope) { - return new SBSymbolContext(lldbJNI.SBAddress_GetSymbolContext(swigCPtr, this, resolve_scope), true); - } - - public SBSection GetSection() { - return new SBSection(lldbJNI.SBAddress_GetSection(swigCPtr, this), true); - } - - public java.math.BigInteger GetOffset() { - return lldbJNI.SBAddress_GetOffset(swigCPtr, this); - } - - public SBModule GetModule() { - return new SBModule(lldbJNI.SBAddress_GetModule(swigCPtr, this), true); - } - - public SBCompileUnit GetCompileUnit() { - return new SBCompileUnit(lldbJNI.SBAddress_GetCompileUnit(swigCPtr, this), true); - } - - public SBFunction GetFunction() { - return new SBFunction(lldbJNI.SBAddress_GetFunction(swigCPtr, this), true); - } - - public SBBlock GetBlock() { - return new SBBlock(lldbJNI.SBAddress_GetBlock(swigCPtr, this), true); - } - - public SBSymbol GetSymbol() { - return new SBSymbol(lldbJNI.SBAddress_GetSymbol(swigCPtr, this), true); - } - - public SBLineEntry GetLineEntry() { - return new SBLineEntry(lldbJNI.SBAddress_GetLineEntry(swigCPtr, this), true); - } - - public String __repr__() { - return lldbJNI.SBAddress___repr__(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBAttachInfo.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBAttachInfo.java deleted file mode 100644 index 2eba4b7d6b..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBAttachInfo.java +++ /dev/null @@ -1,218 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBAttachInfo { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBAttachInfo(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBAttachInfo obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBAttachInfo obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBAttachInfo(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBAttachInfo() { - this(lldbJNI.new_SBAttachInfo__SWIG_0(), true); - } - - public SBAttachInfo(java.math.BigInteger pid) { - this(lldbJNI.new_SBAttachInfo__SWIG_1(pid), true); - } - - public SBAttachInfo(String path, boolean wait_for) { - this(lldbJNI.new_SBAttachInfo__SWIG_2(path, wait_for), true); - } - - public SBAttachInfo(String path, boolean wait_for, boolean async) { - this(lldbJNI.new_SBAttachInfo__SWIG_3(path, wait_for, async), true); - } - - public SBAttachInfo(SBAttachInfo rhs) { - this(lldbJNI.new_SBAttachInfo__SWIG_4(SBAttachInfo.getCPtr(rhs), rhs), true); - } - - public java.math.BigInteger GetProcessID() { - return lldbJNI.SBAttachInfo_GetProcessID(swigCPtr, this); - } - - public void SetProcessID(java.math.BigInteger pid) { - lldbJNI.SBAttachInfo_SetProcessID(swigCPtr, this, pid); - } - - public void SetExecutable(String path) { - lldbJNI.SBAttachInfo_SetExecutable__SWIG_0(swigCPtr, this, path); - } - - public void SetExecutable(SBFileSpec exe_file) { - lldbJNI.SBAttachInfo_SetExecutable__SWIG_1(swigCPtr, this, SBFileSpec.getCPtr(exe_file), exe_file); - } - - public boolean GetWaitForLaunch() { - return lldbJNI.SBAttachInfo_GetWaitForLaunch(swigCPtr, this); - } - - public void SetWaitForLaunch(boolean b) { - lldbJNI.SBAttachInfo_SetWaitForLaunch__SWIG_0(swigCPtr, this, b); - } - - public void SetWaitForLaunch(boolean b, boolean async) { - lldbJNI.SBAttachInfo_SetWaitForLaunch__SWIG_1(swigCPtr, this, b, async); - } - - public boolean GetIgnoreExisting() { - return lldbJNI.SBAttachInfo_GetIgnoreExisting(swigCPtr, this); - } - - public void SetIgnoreExisting(boolean b) { - lldbJNI.SBAttachInfo_SetIgnoreExisting(swigCPtr, this, b); - } - - public long GetResumeCount() { - return lldbJNI.SBAttachInfo_GetResumeCount(swigCPtr, this); - } - - public void SetResumeCount(long c) { - lldbJNI.SBAttachInfo_SetResumeCount(swigCPtr, this, c); - } - - public String GetProcessPluginName() { - return lldbJNI.SBAttachInfo_GetProcessPluginName(swigCPtr, this); - } - - public void SetProcessPluginName(String plugin_name) { - lldbJNI.SBAttachInfo_SetProcessPluginName(swigCPtr, this, plugin_name); - } - - public long GetUserID() { - return lldbJNI.SBAttachInfo_GetUserID(swigCPtr, this); - } - - public long GetGroupID() { - return lldbJNI.SBAttachInfo_GetGroupID(swigCPtr, this); - } - - public boolean UserIDIsValid() { - return lldbJNI.SBAttachInfo_UserIDIsValid(swigCPtr, this); - } - - public boolean GroupIDIsValid() { - return lldbJNI.SBAttachInfo_GroupIDIsValid(swigCPtr, this); - } - - public void SetUserID(long uid) { - lldbJNI.SBAttachInfo_SetUserID(swigCPtr, this, uid); - } - - public void SetGroupID(long gid) { - lldbJNI.SBAttachInfo_SetGroupID(swigCPtr, this, gid); - } - - public long GetEffectiveUserID() { - return lldbJNI.SBAttachInfo_GetEffectiveUserID(swigCPtr, this); - } - - public long GetEffectiveGroupID() { - return lldbJNI.SBAttachInfo_GetEffectiveGroupID(swigCPtr, this); - } - - public boolean EffectiveUserIDIsValid() { - return lldbJNI.SBAttachInfo_EffectiveUserIDIsValid(swigCPtr, this); - } - - public boolean EffectiveGroupIDIsValid() { - return lldbJNI.SBAttachInfo_EffectiveGroupIDIsValid(swigCPtr, this); - } - - public void SetEffectiveUserID(long uid) { - lldbJNI.SBAttachInfo_SetEffectiveUserID(swigCPtr, this, uid); - } - - public void SetEffectiveGroupID(long gid) { - lldbJNI.SBAttachInfo_SetEffectiveGroupID(swigCPtr, this, gid); - } - - public java.math.BigInteger GetParentProcessID() { - return lldbJNI.SBAttachInfo_GetParentProcessID(swigCPtr, this); - } - - public void SetParentProcessID(java.math.BigInteger pid) { - lldbJNI.SBAttachInfo_SetParentProcessID(swigCPtr, this, pid); - } - - public boolean ParentProcessIDIsValid() { - return lldbJNI.SBAttachInfo_ParentProcessIDIsValid(swigCPtr, this); - } - - public SBListener GetListener() { - return new SBListener(lldbJNI.SBAttachInfo_GetListener(swigCPtr, this), true); - } - - public void SetListener(SBListener listener) { - lldbJNI.SBAttachInfo_SetListener(swigCPtr, this, SBListener.getCPtr(listener), listener); - } - - public SBListener GetShadowListener() { - return new SBListener(lldbJNI.SBAttachInfo_GetShadowListener(swigCPtr, this), true); - } - - public void SetShadowListener(SBListener listener) { - lldbJNI.SBAttachInfo_SetShadowListener(swigCPtr, this, SBListener.getCPtr(listener), listener); - } - - public String GetScriptedProcessClassName() { - return lldbJNI.SBAttachInfo_GetScriptedProcessClassName(swigCPtr, this); - } - - public void SetScriptedProcessClassName(String class_name) { - lldbJNI.SBAttachInfo_SetScriptedProcessClassName(swigCPtr, this, class_name); - } - - public SBStructuredData GetScriptedProcessDictionary() { - return new SBStructuredData(lldbJNI.SBAttachInfo_GetScriptedProcessDictionary(swigCPtr, this), true); - } - - public void SetScriptedProcessDictionary(SBStructuredData dict) { - lldbJNI.SBAttachInfo_SetScriptedProcessDictionary(swigCPtr, this, SBStructuredData.getCPtr(dict), dict); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBBlock.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBBlock.java deleted file mode 100644 index 962529d4f6..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBBlock.java +++ /dev/null @@ -1,134 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBBlock { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBBlock(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBBlock obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBBlock obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBBlock(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBBlock() { - this(lldbJNI.new_SBBlock__SWIG_0(), true); - } - - public SBBlock(SBBlock rhs) { - this(lldbJNI.new_SBBlock__SWIG_1(SBBlock.getCPtr(rhs), rhs), true); - } - - public boolean IsInlined() { - return lldbJNI.SBBlock_IsInlined(swigCPtr, this); - } - - public boolean IsValid() { - return lldbJNI.SBBlock_IsValid(swigCPtr, this); - } - - public String GetInlinedName() { - return lldbJNI.SBBlock_GetInlinedName(swigCPtr, this); - } - - public SBFileSpec GetInlinedCallSiteFile() { - return new SBFileSpec(lldbJNI.SBBlock_GetInlinedCallSiteFile(swigCPtr, this), true); - } - - public long GetInlinedCallSiteLine() { - return lldbJNI.SBBlock_GetInlinedCallSiteLine(swigCPtr, this); - } - - public long GetInlinedCallSiteColumn() { - return lldbJNI.SBBlock_GetInlinedCallSiteColumn(swigCPtr, this); - } - - public SBBlock GetParent() { - return new SBBlock(lldbJNI.SBBlock_GetParent(swigCPtr, this), true); - } - - public SBBlock GetSibling() { - return new SBBlock(lldbJNI.SBBlock_GetSibling(swigCPtr, this), true); - } - - public SBBlock GetFirstChild() { - return new SBBlock(lldbJNI.SBBlock_GetFirstChild(swigCPtr, this), true); - } - - public long GetNumRanges() { - return lldbJNI.SBBlock_GetNumRanges(swigCPtr, this); - } - - public SBAddress GetRangeStartAddress(long idx) { - return new SBAddress(lldbJNI.SBBlock_GetRangeStartAddress(swigCPtr, this, idx), true); - } - - public SBAddress GetRangeEndAddress(long idx) { - return new SBAddress(lldbJNI.SBBlock_GetRangeEndAddress(swigCPtr, this, idx), true); - } - - public long GetRangeIndexForBlockAddress(SBAddress block_addr) { - return lldbJNI.SBBlock_GetRangeIndexForBlockAddress(swigCPtr, this, SBAddress.getCPtr(block_addr), block_addr); - } - - public SBValueList GetVariables(SBFrame frame, boolean arguments, boolean locals, boolean statics, DynamicValueType use_dynamic) { - return new SBValueList(lldbJNI.SBBlock_GetVariables__SWIG_0(swigCPtr, this, SBFrame.getCPtr(frame), frame, arguments, locals, statics, use_dynamic.swigValue()), true); - } - - public SBValueList GetVariables(SBTarget target, boolean arguments, boolean locals, boolean statics) { - return new SBValueList(lldbJNI.SBBlock_GetVariables__SWIG_1(swigCPtr, this, SBTarget.getCPtr(target), target, arguments, locals, statics), true); - } - - public SBBlock GetContainingInlinedBlock() { - return new SBBlock(lldbJNI.SBBlock_GetContainingInlinedBlock(swigCPtr, this), true); - } - - public boolean GetDescription(SBStream description) { - return lldbJNI.SBBlock_GetDescription(swigCPtr, this, SBStream.getCPtr(description), description); - } - - public String __repr__() { - return lldbJNI.SBBlock___repr__(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBBreakpoint.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBBreakpoint.java deleted file mode 100644 index a7546a510e..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBBreakpoint.java +++ /dev/null @@ -1,266 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBBreakpoint { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBBreakpoint(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBBreakpoint obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBBreakpoint obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBBreakpoint(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBBreakpoint() { - this(lldbJNI.new_SBBreakpoint__SWIG_0(), true); - } - - public SBBreakpoint(SBBreakpoint rhs) { - this(lldbJNI.new_SBBreakpoint__SWIG_1(SBBreakpoint.getCPtr(rhs), rhs), true); - } - - public int GetID() { - return lldbJNI.SBBreakpoint_GetID(swigCPtr, this); - } - - public boolean IsValid() { - return lldbJNI.SBBreakpoint_IsValid(swigCPtr, this); - } - - public void ClearAllBreakpointSites() { - lldbJNI.SBBreakpoint_ClearAllBreakpointSites(swigCPtr, this); - } - - public SBTarget GetTarget() { - return new SBTarget(lldbJNI.SBBreakpoint_GetTarget(swigCPtr, this), true); - } - - public SBBreakpointLocation FindLocationByAddress(java.math.BigInteger vm_addr) { - return new SBBreakpointLocation(lldbJNI.SBBreakpoint_FindLocationByAddress(swigCPtr, this, vm_addr), true); - } - - public int FindLocationIDByAddress(java.math.BigInteger vm_addr) { - return lldbJNI.SBBreakpoint_FindLocationIDByAddress(swigCPtr, this, vm_addr); - } - - public SBBreakpointLocation FindLocationByID(int bp_loc_id) { - return new SBBreakpointLocation(lldbJNI.SBBreakpoint_FindLocationByID(swigCPtr, this, bp_loc_id), true); - } - - public SBBreakpointLocation GetLocationAtIndex(long index) { - return new SBBreakpointLocation(lldbJNI.SBBreakpoint_GetLocationAtIndex(swigCPtr, this, index), true); - } - - public void SetEnabled(boolean enable) { - lldbJNI.SBBreakpoint_SetEnabled(swigCPtr, this, enable); - } - - public boolean IsEnabled() { - return lldbJNI.SBBreakpoint_IsEnabled(swigCPtr, this); - } - - public void SetOneShot(boolean one_shot) { - lldbJNI.SBBreakpoint_SetOneShot(swigCPtr, this, one_shot); - } - - public boolean IsOneShot() { - return lldbJNI.SBBreakpoint_IsOneShot(swigCPtr, this); - } - - public boolean IsInternal() { - return lldbJNI.SBBreakpoint_IsInternal(swigCPtr, this); - } - - public long GetHitCount() { - return lldbJNI.SBBreakpoint_GetHitCount(swigCPtr, this); - } - - public void SetIgnoreCount(long count) { - lldbJNI.SBBreakpoint_SetIgnoreCount(swigCPtr, this, count); - } - - public long GetIgnoreCount() { - return lldbJNI.SBBreakpoint_GetIgnoreCount(swigCPtr, this); - } - - public void SetCondition(String condition) { - lldbJNI.SBBreakpoint_SetCondition(swigCPtr, this, condition); - } - - public String GetCondition() { - return lldbJNI.SBBreakpoint_GetCondition(swigCPtr, this); - } - - public void SetAutoContinue(boolean auto_continue) { - lldbJNI.SBBreakpoint_SetAutoContinue(swigCPtr, this, auto_continue); - } - - public boolean GetAutoContinue() { - return lldbJNI.SBBreakpoint_GetAutoContinue(swigCPtr, this); - } - - public void SetThreadID(java.math.BigInteger sb_thread_id) { - lldbJNI.SBBreakpoint_SetThreadID(swigCPtr, this, sb_thread_id); - } - - public java.math.BigInteger GetThreadID() { - return lldbJNI.SBBreakpoint_GetThreadID(swigCPtr, this); - } - - public void SetThreadIndex(long index) { - lldbJNI.SBBreakpoint_SetThreadIndex(swigCPtr, this, index); - } - - public long GetThreadIndex() { - return lldbJNI.SBBreakpoint_GetThreadIndex(swigCPtr, this); - } - - public void SetThreadName(String thread_name) { - lldbJNI.SBBreakpoint_SetThreadName(swigCPtr, this, thread_name); - } - - public String GetThreadName() { - return lldbJNI.SBBreakpoint_GetThreadName(swigCPtr, this); - } - - public void SetQueueName(String queue_name) { - lldbJNI.SBBreakpoint_SetQueueName(swigCPtr, this, queue_name); - } - - public String GetQueueName() { - return lldbJNI.SBBreakpoint_GetQueueName(swigCPtr, this); - } - - public void SetScriptCallbackFunction(String callback_function_name) { - lldbJNI.SBBreakpoint_SetScriptCallbackFunction__SWIG_0(swigCPtr, this, callback_function_name); - } - - public SBError SetScriptCallbackFunction(String callback_function_name, SBStructuredData extra_args) { - return new SBError(lldbJNI.SBBreakpoint_SetScriptCallbackFunction__SWIG_1(swigCPtr, this, callback_function_name, SBStructuredData.getCPtr(extra_args), extra_args), true); - } - - public void SetCommandLineCommands(SBStringList commands) { - lldbJNI.SBBreakpoint_SetCommandLineCommands(swigCPtr, this, SBStringList.getCPtr(commands), commands); - } - - public boolean GetCommandLineCommands(SBStringList commands) { - return lldbJNI.SBBreakpoint_GetCommandLineCommands(swigCPtr, this, SBStringList.getCPtr(commands), commands); - } - - public SBError SetScriptCallbackBody(String script_body_text) { - return new SBError(lldbJNI.SBBreakpoint_SetScriptCallbackBody(swigCPtr, this, script_body_text), true); - } - - public boolean AddName(String new_name) { - return lldbJNI.SBBreakpoint_AddName(swigCPtr, this, new_name); - } - - public SBError AddNameWithErrorHandling(String new_name) { - return new SBError(lldbJNI.SBBreakpoint_AddNameWithErrorHandling(swigCPtr, this, new_name), true); - } - - public void RemoveName(String name_to_remove) { - lldbJNI.SBBreakpoint_RemoveName(swigCPtr, this, name_to_remove); - } - - public boolean MatchesName(String name) { - return lldbJNI.SBBreakpoint_MatchesName(swigCPtr, this, name); - } - - public void GetNames(SBStringList names) { - lldbJNI.SBBreakpoint_GetNames(swigCPtr, this, SBStringList.getCPtr(names), names); - } - - public long GetNumResolvedLocations() { - return lldbJNI.SBBreakpoint_GetNumResolvedLocations(swigCPtr, this); - } - - public long GetNumLocations() { - return lldbJNI.SBBreakpoint_GetNumLocations(swigCPtr, this); - } - - public boolean GetDescription(SBStream description) { - return lldbJNI.SBBreakpoint_GetDescription__SWIG_0(swigCPtr, this, SBStream.getCPtr(description), description); - } - - public boolean GetDescription(SBStream description, boolean include_locations) { - return lldbJNI.SBBreakpoint_GetDescription__SWIG_1(swigCPtr, this, SBStream.getCPtr(description), description, include_locations); - } - - public static boolean EventIsBreakpointEvent(SBEvent event) { - return lldbJNI.SBBreakpoint_EventIsBreakpointEvent(SBEvent.getCPtr(event), event); - } - - public static BreakpointEventType GetBreakpointEventTypeFromEvent(SBEvent event) { - return BreakpointEventType.swigToEnum(lldbJNI.SBBreakpoint_GetBreakpointEventTypeFromEvent(SBEvent.getCPtr(event), event)); - } - - public static SBBreakpoint GetBreakpointFromEvent(SBEvent event) { - return new SBBreakpoint(lldbJNI.SBBreakpoint_GetBreakpointFromEvent(SBEvent.getCPtr(event), event), true); - } - - public static SBBreakpointLocation GetBreakpointLocationAtIndexFromEvent(SBEvent event, long loc_idx) { - return new SBBreakpointLocation(lldbJNI.SBBreakpoint_GetBreakpointLocationAtIndexFromEvent(SBEvent.getCPtr(event), event, loc_idx), true); - } - - public static long GetNumBreakpointLocationsFromEvent(SBEvent event_sp) { - return lldbJNI.SBBreakpoint_GetNumBreakpointLocationsFromEvent(SBEvent.getCPtr(event_sp), event_sp); - } - - public boolean IsHardware() { - return lldbJNI.SBBreakpoint_IsHardware(swigCPtr, this); - } - - public SBError AddLocation(SBAddress address) { - return new SBError(lldbJNI.SBBreakpoint_AddLocation(swigCPtr, this, SBAddress.getCPtr(address), address), true); - } - - public SBStructuredData SerializeToStructuredData() { - return new SBStructuredData(lldbJNI.SBBreakpoint_SerializeToStructuredData(swigCPtr, this), true); - } - - public String __repr__() { - return lldbJNI.SBBreakpoint___repr__(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBBreakpointList.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBBreakpointList.java deleted file mode 100644 index ee41373d29..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBBreakpointList.java +++ /dev/null @@ -1,86 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBBreakpointList { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBBreakpointList(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBBreakpointList obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBBreakpointList obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBBreakpointList(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBBreakpointList(SBTarget target) { - this(lldbJNI.new_SBBreakpointList(SBTarget.getCPtr(target), target), true); - } - - public long GetSize() { - return lldbJNI.SBBreakpointList_GetSize(swigCPtr, this); - } - - public SBBreakpoint GetBreakpointAtIndex(long idx) { - return new SBBreakpoint(lldbJNI.SBBreakpointList_GetBreakpointAtIndex(swigCPtr, this, idx), true); - } - - public SBBreakpoint FindBreakpointByID(int arg0) { - return new SBBreakpoint(lldbJNI.SBBreakpointList_FindBreakpointByID(swigCPtr, this, arg0), true); - } - - public void Append(SBBreakpoint sb_bkpt) { - lldbJNI.SBBreakpointList_Append(swigCPtr, this, SBBreakpoint.getCPtr(sb_bkpt), sb_bkpt); - } - - public boolean AppendIfUnique(SBBreakpoint sb_bkpt) { - return lldbJNI.SBBreakpointList_AppendIfUnique(swigCPtr, this, SBBreakpoint.getCPtr(sb_bkpt), sb_bkpt); - } - - public void AppendByID(int id) { - lldbJNI.SBBreakpointList_AppendByID(swigCPtr, this, id); - } - - public void Clear() { - lldbJNI.SBBreakpointList_Clear(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBBreakpointLocation.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBBreakpointLocation.java deleted file mode 100644 index 56a28acfe9..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBBreakpointLocation.java +++ /dev/null @@ -1,182 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBBreakpointLocation { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBBreakpointLocation(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBBreakpointLocation obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBBreakpointLocation obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBBreakpointLocation(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBBreakpointLocation() { - this(lldbJNI.new_SBBreakpointLocation__SWIG_0(), true); - } - - public SBBreakpointLocation(SBBreakpointLocation rhs) { - this(lldbJNI.new_SBBreakpointLocation__SWIG_1(SBBreakpointLocation.getCPtr(rhs), rhs), true); - } - - public int GetID() { - return lldbJNI.SBBreakpointLocation_GetID(swigCPtr, this); - } - - public boolean IsValid() { - return lldbJNI.SBBreakpointLocation_IsValid(swigCPtr, this); - } - - public SBAddress GetAddress() { - return new SBAddress(lldbJNI.SBBreakpointLocation_GetAddress(swigCPtr, this), true); - } - - public java.math.BigInteger GetLoadAddress() { - return lldbJNI.SBBreakpointLocation_GetLoadAddress(swigCPtr, this); - } - - public void SetEnabled(boolean enabled) { - lldbJNI.SBBreakpointLocation_SetEnabled(swigCPtr, this, enabled); - } - - public boolean IsEnabled() { - return lldbJNI.SBBreakpointLocation_IsEnabled(swigCPtr, this); - } - - public long GetHitCount() { - return lldbJNI.SBBreakpointLocation_GetHitCount(swigCPtr, this); - } - - public long GetIgnoreCount() { - return lldbJNI.SBBreakpointLocation_GetIgnoreCount(swigCPtr, this); - } - - public void SetIgnoreCount(long n) { - lldbJNI.SBBreakpointLocation_SetIgnoreCount(swigCPtr, this, n); - } - - public void SetCondition(String condition) { - lldbJNI.SBBreakpointLocation_SetCondition(swigCPtr, this, condition); - } - - public String GetCondition() { - return lldbJNI.SBBreakpointLocation_GetCondition(swigCPtr, this); - } - - public void SetAutoContinue(boolean auto_continue) { - lldbJNI.SBBreakpointLocation_SetAutoContinue(swigCPtr, this, auto_continue); - } - - public boolean GetAutoContinue() { - return lldbJNI.SBBreakpointLocation_GetAutoContinue(swigCPtr, this); - } - - public void SetScriptCallbackFunction(String callback_function_name) { - lldbJNI.SBBreakpointLocation_SetScriptCallbackFunction__SWIG_0(swigCPtr, this, callback_function_name); - } - - public SBError SetScriptCallbackFunction(String callback_function_name, SBStructuredData extra_args) { - return new SBError(lldbJNI.SBBreakpointLocation_SetScriptCallbackFunction__SWIG_1(swigCPtr, this, callback_function_name, SBStructuredData.getCPtr(extra_args), extra_args), true); - } - - public SBError SetScriptCallbackBody(String script_body_text) { - return new SBError(lldbJNI.SBBreakpointLocation_SetScriptCallbackBody(swigCPtr, this, script_body_text), true); - } - - public void SetCommandLineCommands(SBStringList commands) { - lldbJNI.SBBreakpointLocation_SetCommandLineCommands(swigCPtr, this, SBStringList.getCPtr(commands), commands); - } - - public boolean GetCommandLineCommands(SBStringList commands) { - return lldbJNI.SBBreakpointLocation_GetCommandLineCommands(swigCPtr, this, SBStringList.getCPtr(commands), commands); - } - - public void SetThreadID(java.math.BigInteger sb_thread_id) { - lldbJNI.SBBreakpointLocation_SetThreadID(swigCPtr, this, sb_thread_id); - } - - public java.math.BigInteger GetThreadID() { - return lldbJNI.SBBreakpointLocation_GetThreadID(swigCPtr, this); - } - - public void SetThreadIndex(long index) { - lldbJNI.SBBreakpointLocation_SetThreadIndex(swigCPtr, this, index); - } - - public long GetThreadIndex() { - return lldbJNI.SBBreakpointLocation_GetThreadIndex(swigCPtr, this); - } - - public void SetThreadName(String thread_name) { - lldbJNI.SBBreakpointLocation_SetThreadName(swigCPtr, this, thread_name); - } - - public String GetThreadName() { - return lldbJNI.SBBreakpointLocation_GetThreadName(swigCPtr, this); - } - - public void SetQueueName(String queue_name) { - lldbJNI.SBBreakpointLocation_SetQueueName(swigCPtr, this, queue_name); - } - - public String GetQueueName() { - return lldbJNI.SBBreakpointLocation_GetQueueName(swigCPtr, this); - } - - public boolean IsResolved() { - return lldbJNI.SBBreakpointLocation_IsResolved(swigCPtr, this); - } - - public boolean GetDescription(SBStream description, DescriptionLevel level) { - return lldbJNI.SBBreakpointLocation_GetDescription(swigCPtr, this, SBStream.getCPtr(description), description, level.swigValue()); - } - - public SBBreakpoint GetBreakpoint() { - return new SBBreakpoint(lldbJNI.SBBreakpointLocation_GetBreakpoint(swigCPtr, this), true); - } - - public String __repr__() { - return lldbJNI.SBBreakpointLocation___repr__(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBBreakpointName.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBBreakpointName.java deleted file mode 100644 index b0965b6f7b..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBBreakpointName.java +++ /dev/null @@ -1,210 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBBreakpointName { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBBreakpointName(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBBreakpointName obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBBreakpointName obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBBreakpointName(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBBreakpointName() { - this(lldbJNI.new_SBBreakpointName__SWIG_0(), true); - } - - public SBBreakpointName(SBTarget target, String name) { - this(lldbJNI.new_SBBreakpointName__SWIG_1(SBTarget.getCPtr(target), target, name), true); - } - - public SBBreakpointName(SBBreakpoint bkpt, String name) { - this(lldbJNI.new_SBBreakpointName__SWIG_2(SBBreakpoint.getCPtr(bkpt), bkpt, name), true); - } - - public SBBreakpointName(SBBreakpointName rhs) { - this(lldbJNI.new_SBBreakpointName__SWIG_3(SBBreakpointName.getCPtr(rhs), rhs), true); - } - - public boolean IsValid() { - return lldbJNI.SBBreakpointName_IsValid(swigCPtr, this); - } - - public String GetName() { - return lldbJNI.SBBreakpointName_GetName(swigCPtr, this); - } - - public void SetEnabled(boolean enable) { - lldbJNI.SBBreakpointName_SetEnabled(swigCPtr, this, enable); - } - - public boolean IsEnabled() { - return lldbJNI.SBBreakpointName_IsEnabled(swigCPtr, this); - } - - public void SetOneShot(boolean one_shot) { - lldbJNI.SBBreakpointName_SetOneShot(swigCPtr, this, one_shot); - } - - public boolean IsOneShot() { - return lldbJNI.SBBreakpointName_IsOneShot(swigCPtr, this); - } - - public void SetIgnoreCount(long count) { - lldbJNI.SBBreakpointName_SetIgnoreCount(swigCPtr, this, count); - } - - public long GetIgnoreCount() { - return lldbJNI.SBBreakpointName_GetIgnoreCount(swigCPtr, this); - } - - public void SetCondition(String condition) { - lldbJNI.SBBreakpointName_SetCondition(swigCPtr, this, condition); - } - - public String GetCondition() { - return lldbJNI.SBBreakpointName_GetCondition(swigCPtr, this); - } - - public void SetAutoContinue(boolean auto_continue) { - lldbJNI.SBBreakpointName_SetAutoContinue(swigCPtr, this, auto_continue); - } - - public boolean GetAutoContinue() { - return lldbJNI.SBBreakpointName_GetAutoContinue(swigCPtr, this); - } - - public void SetThreadID(java.math.BigInteger sb_thread_id) { - lldbJNI.SBBreakpointName_SetThreadID(swigCPtr, this, sb_thread_id); - } - - public java.math.BigInteger GetThreadID() { - return lldbJNI.SBBreakpointName_GetThreadID(swigCPtr, this); - } - - public void SetThreadIndex(long index) { - lldbJNI.SBBreakpointName_SetThreadIndex(swigCPtr, this, index); - } - - public long GetThreadIndex() { - return lldbJNI.SBBreakpointName_GetThreadIndex(swigCPtr, this); - } - - public void SetThreadName(String thread_name) { - lldbJNI.SBBreakpointName_SetThreadName(swigCPtr, this, thread_name); - } - - public String GetThreadName() { - return lldbJNI.SBBreakpointName_GetThreadName(swigCPtr, this); - } - - public void SetQueueName(String queue_name) { - lldbJNI.SBBreakpointName_SetQueueName(swigCPtr, this, queue_name); - } - - public String GetQueueName() { - return lldbJNI.SBBreakpointName_GetQueueName(swigCPtr, this); - } - - public void SetScriptCallbackFunction(String callback_function_name) { - lldbJNI.SBBreakpointName_SetScriptCallbackFunction__SWIG_0(swigCPtr, this, callback_function_name); - } - - public SBError SetScriptCallbackFunction(String callback_function_name, SBStructuredData extra_args) { - return new SBError(lldbJNI.SBBreakpointName_SetScriptCallbackFunction__SWIG_1(swigCPtr, this, callback_function_name, SBStructuredData.getCPtr(extra_args), extra_args), true); - } - - public void SetCommandLineCommands(SBStringList commands) { - lldbJNI.SBBreakpointName_SetCommandLineCommands(swigCPtr, this, SBStringList.getCPtr(commands), commands); - } - - public boolean GetCommandLineCommands(SBStringList commands) { - return lldbJNI.SBBreakpointName_GetCommandLineCommands(swigCPtr, this, SBStringList.getCPtr(commands), commands); - } - - public SBError SetScriptCallbackBody(String script_body_text) { - return new SBError(lldbJNI.SBBreakpointName_SetScriptCallbackBody(swigCPtr, this, script_body_text), true); - } - - public String GetHelpString() { - return lldbJNI.SBBreakpointName_GetHelpString(swigCPtr, this); - } - - public void SetHelpString(String help_string) { - lldbJNI.SBBreakpointName_SetHelpString(swigCPtr, this, help_string); - } - - public boolean GetAllowList() { - return lldbJNI.SBBreakpointName_GetAllowList(swigCPtr, this); - } - - public void SetAllowList(boolean value) { - lldbJNI.SBBreakpointName_SetAllowList(swigCPtr, this, value); - } - - public boolean GetAllowDelete() { - return lldbJNI.SBBreakpointName_GetAllowDelete(swigCPtr, this); - } - - public void SetAllowDelete(boolean value) { - lldbJNI.SBBreakpointName_SetAllowDelete(swigCPtr, this, value); - } - - public boolean GetAllowDisable() { - return lldbJNI.SBBreakpointName_GetAllowDisable(swigCPtr, this); - } - - public void SetAllowDisable(boolean value) { - lldbJNI.SBBreakpointName_SetAllowDisable(swigCPtr, this, value); - } - - public boolean GetDescription(SBStream description) { - return lldbJNI.SBBreakpointName_GetDescription(swigCPtr, this, SBStream.getCPtr(description), description); - } - - public String __repr__() { - return lldbJNI.SBBreakpointName___repr__(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBBroadcaster.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBBroadcaster.java deleted file mode 100644 index 1004ec0136..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBBroadcaster.java +++ /dev/null @@ -1,114 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBBroadcaster { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBBroadcaster(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBBroadcaster obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBBroadcaster obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBBroadcaster(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBBroadcaster() { - this(lldbJNI.new_SBBroadcaster__SWIG_0(), true); - } - - public SBBroadcaster(String name) { - this(lldbJNI.new_SBBroadcaster__SWIG_1(name), true); - } - - public SBBroadcaster(SBBroadcaster rhs) { - this(lldbJNI.new_SBBroadcaster__SWIG_2(SBBroadcaster.getCPtr(rhs), rhs), true); - } - - public boolean IsValid() { - return lldbJNI.SBBroadcaster_IsValid(swigCPtr, this); - } - - public void Clear() { - lldbJNI.SBBroadcaster_Clear(swigCPtr, this); - } - - public void BroadcastEventByType(long event_type, boolean unique) { - lldbJNI.SBBroadcaster_BroadcastEventByType__SWIG_0(swigCPtr, this, event_type, unique); - } - - public void BroadcastEventByType(long event_type) { - lldbJNI.SBBroadcaster_BroadcastEventByType__SWIG_1(swigCPtr, this, event_type); - } - - public void BroadcastEvent(SBEvent event, boolean unique) { - lldbJNI.SBBroadcaster_BroadcastEvent__SWIG_0(swigCPtr, this, SBEvent.getCPtr(event), event, unique); - } - - public void BroadcastEvent(SBEvent event) { - lldbJNI.SBBroadcaster_BroadcastEvent__SWIG_1(swigCPtr, this, SBEvent.getCPtr(event), event); - } - - public void AddInitialEventsToListener(SBListener listener, long requested_events) { - lldbJNI.SBBroadcaster_AddInitialEventsToListener(swigCPtr, this, SBListener.getCPtr(listener), listener, requested_events); - } - - public long AddListener(SBListener listener, long event_mask) { - return lldbJNI.SBBroadcaster_AddListener(swigCPtr, this, SBListener.getCPtr(listener), listener, event_mask); - } - - public String GetName() { - return lldbJNI.SBBroadcaster_GetName(swigCPtr, this); - } - - public boolean EventTypeHasListeners(long event_type) { - return lldbJNI.SBBroadcaster_EventTypeHasListeners(swigCPtr, this, event_type); - } - - public boolean RemoveListener(SBListener listener, long event_mask) { - return lldbJNI.SBBroadcaster_RemoveListener__SWIG_0(swigCPtr, this, SBListener.getCPtr(listener), listener, event_mask); - } - - public boolean RemoveListener(SBListener listener) { - return lldbJNI.SBBroadcaster_RemoveListener__SWIG_1(swigCPtr, this, SBListener.getCPtr(listener), listener); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBCommandInterpreter.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBCommandInterpreter.java deleted file mode 100644 index 472eebb40a..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBCommandInterpreter.java +++ /dev/null @@ -1,204 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBCommandInterpreter { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBCommandInterpreter(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBCommandInterpreter obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBCommandInterpreter obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBCommandInterpreter(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBCommandInterpreter(SBCommandInterpreter rhs) { - this(lldbJNI.new_SBCommandInterpreter(SBCommandInterpreter.getCPtr(rhs), rhs), true); - } - - public static String GetArgumentTypeAsCString(CommandArgumentType arg_type) { - return lldbJNI.SBCommandInterpreter_GetArgumentTypeAsCString(arg_type.swigValue()); - } - - public static String GetArgumentDescriptionAsCString(CommandArgumentType arg_type) { - return lldbJNI.SBCommandInterpreter_GetArgumentDescriptionAsCString(arg_type.swigValue()); - } - - public static boolean EventIsCommandInterpreterEvent(SBEvent event) { - return lldbJNI.SBCommandInterpreter_EventIsCommandInterpreterEvent(SBEvent.getCPtr(event), event); - } - - public boolean IsValid() { - return lldbJNI.SBCommandInterpreter_IsValid(swigCPtr, this); - } - - public boolean CommandExists(String cmd) { - return lldbJNI.SBCommandInterpreter_CommandExists(swigCPtr, this, cmd); - } - - public boolean UserCommandExists(String cmd) { - return lldbJNI.SBCommandInterpreter_UserCommandExists(swigCPtr, this, cmd); - } - - public boolean AliasExists(String cmd) { - return lldbJNI.SBCommandInterpreter_AliasExists(swigCPtr, this, cmd); - } - - public SBBroadcaster GetBroadcaster() { - return new SBBroadcaster(lldbJNI.SBCommandInterpreter_GetBroadcaster(swigCPtr, this), true); - } - - public static String GetBroadcasterClass() { - return lldbJNI.SBCommandInterpreter_GetBroadcasterClass(); - } - - public boolean HasCommands() { - return lldbJNI.SBCommandInterpreter_HasCommands(swigCPtr, this); - } - - public boolean HasAliases() { - return lldbJNI.SBCommandInterpreter_HasAliases(swigCPtr, this); - } - - public boolean HasAliasOptions() { - return lldbJNI.SBCommandInterpreter_HasAliasOptions(swigCPtr, this); - } - - public boolean IsInteractive() { - return lldbJNI.SBCommandInterpreter_IsInteractive(swigCPtr, this); - } - - public SBProcess GetProcess() { - return new SBProcess(lldbJNI.SBCommandInterpreter_GetProcess(swigCPtr, this), true); - } - - public SBDebugger GetDebugger() { - return new SBDebugger(lldbJNI.SBCommandInterpreter_GetDebugger(swigCPtr, this), true); - } - - public void SourceInitFileInHomeDirectory(SBCommandReturnObject result) { - lldbJNI.SBCommandInterpreter_SourceInitFileInHomeDirectory__SWIG_0(swigCPtr, this, SBCommandReturnObject.getCPtr(result), result); - } - - public void SourceInitFileInHomeDirectory(SBCommandReturnObject result, boolean is_repl) { - lldbJNI.SBCommandInterpreter_SourceInitFileInHomeDirectory__SWIG_1(swigCPtr, this, SBCommandReturnObject.getCPtr(result), result, is_repl); - } - - public void SourceInitFileInCurrentWorkingDirectory(SBCommandReturnObject result) { - lldbJNI.SBCommandInterpreter_SourceInitFileInCurrentWorkingDirectory(swigCPtr, this, SBCommandReturnObject.getCPtr(result), result); - } - - public ReturnStatus HandleCommand(String command_line, SBCommandReturnObject result, boolean add_to_history) { - return ReturnStatus.swigToEnum(lldbJNI.SBCommandInterpreter_HandleCommand__SWIG_0(swigCPtr, this, command_line, SBCommandReturnObject.getCPtr(result), result, add_to_history)); - } - - public ReturnStatus HandleCommand(String command_line, SBCommandReturnObject result) { - return ReturnStatus.swigToEnum(lldbJNI.SBCommandInterpreter_HandleCommand__SWIG_1(swigCPtr, this, command_line, SBCommandReturnObject.getCPtr(result), result)); - } - - public ReturnStatus HandleCommand(String command_line, SBExecutionContext exe_ctx, SBCommandReturnObject result, boolean add_to_history) { - return ReturnStatus.swigToEnum(lldbJNI.SBCommandInterpreter_HandleCommand__SWIG_2(swigCPtr, this, command_line, SBExecutionContext.getCPtr(exe_ctx), exe_ctx, SBCommandReturnObject.getCPtr(result), result, add_to_history)); - } - - public ReturnStatus HandleCommand(String command_line, SBExecutionContext exe_ctx, SBCommandReturnObject result) { - return ReturnStatus.swigToEnum(lldbJNI.SBCommandInterpreter_HandleCommand__SWIG_3(swigCPtr, this, command_line, SBExecutionContext.getCPtr(exe_ctx), exe_ctx, SBCommandReturnObject.getCPtr(result), result)); - } - - public void HandleCommandsFromFile(SBFileSpec file, SBExecutionContext override_context, SBCommandInterpreterRunOptions options, SBCommandReturnObject result) { - lldbJNI.SBCommandInterpreter_HandleCommandsFromFile(swigCPtr, this, SBFileSpec.getCPtr(file), file, SBExecutionContext.getCPtr(override_context), override_context, SBCommandInterpreterRunOptions.getCPtr(options), options, SBCommandReturnObject.getCPtr(result), result); - } - - public int HandleCompletion(String current_line, long cursor_pos, int match_start_point, int max_return_elements, SBStringList matches) { - return lldbJNI.SBCommandInterpreter_HandleCompletion(swigCPtr, this, current_line, cursor_pos, match_start_point, max_return_elements, SBStringList.getCPtr(matches), matches); - } - - public int HandleCompletionWithDescriptions(String current_line, long cursor_pos, int match_start_point, int max_return_elements, SBStringList matches, SBStringList descriptions) { - return lldbJNI.SBCommandInterpreter_HandleCompletionWithDescriptions(swigCPtr, this, current_line, cursor_pos, match_start_point, max_return_elements, SBStringList.getCPtr(matches), matches, SBStringList.getCPtr(descriptions), descriptions); - } - - public boolean WasInterrupted() { - return lldbJNI.SBCommandInterpreter_WasInterrupted(swigCPtr, this); - } - - public boolean InterruptCommand() { - return lldbJNI.SBCommandInterpreter_InterruptCommand(swigCPtr, this); - } - - public boolean IsActive() { - return lldbJNI.SBCommandInterpreter_IsActive(swigCPtr, this); - } - - public String GetIOHandlerControlSequence(char ch) { - return lldbJNI.SBCommandInterpreter_GetIOHandlerControlSequence(swigCPtr, this, ch); - } - - public boolean GetPromptOnQuit() { - return lldbJNI.SBCommandInterpreter_GetPromptOnQuit(swigCPtr, this); - } - - public void SetPromptOnQuit(boolean b) { - lldbJNI.SBCommandInterpreter_SetPromptOnQuit(swigCPtr, this, b); - } - - public void AllowExitCodeOnQuit(boolean allow) { - lldbJNI.SBCommandInterpreter_AllowExitCodeOnQuit(swigCPtr, this, allow); - } - - public boolean HasCustomQuitExitCode() { - return lldbJNI.SBCommandInterpreter_HasCustomQuitExitCode(swigCPtr, this); - } - - public int GetQuitStatus() { - return lldbJNI.SBCommandInterpreter_GetQuitStatus(swigCPtr, this); - } - - public void ResolveCommand(String command_line, SBCommandReturnObject result) { - lldbJNI.SBCommandInterpreter_ResolveCommand(swigCPtr, this, command_line, SBCommandReturnObject.getCPtr(result), result); - } - - public final static int eBroadcastBitThreadShouldExit = lldbJNI.SBCommandInterpreter_eBroadcastBitThreadShouldExit_get(); - public final static int eBroadcastBitResetPrompt = lldbJNI.SBCommandInterpreter_eBroadcastBitResetPrompt_get(); - public final static int eBroadcastBitQuitCommandReceived = lldbJNI.SBCommandInterpreter_eBroadcastBitQuitCommandReceived_get(); - public final static int eBroadcastBitAsynchronousOutputData = lldbJNI.SBCommandInterpreter_eBroadcastBitAsynchronousOutputData_get(); - public final static int eBroadcastBitAsynchronousErrorData = lldbJNI.SBCommandInterpreter_eBroadcastBitAsynchronousErrorData_get(); - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBCommandInterpreterRunOptions.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBCommandInterpreterRunOptions.java deleted file mode 100644 index 5491ffe402..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBCommandInterpreterRunOptions.java +++ /dev/null @@ -1,142 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBCommandInterpreterRunOptions { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBCommandInterpreterRunOptions(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBCommandInterpreterRunOptions obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBCommandInterpreterRunOptions obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBCommandInterpreterRunOptions(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBCommandInterpreterRunOptions() { - this(lldbJNI.new_SBCommandInterpreterRunOptions__SWIG_0(), true); - } - - public SBCommandInterpreterRunOptions(SBCommandInterpreterRunOptions rhs) { - this(lldbJNI.new_SBCommandInterpreterRunOptions__SWIG_1(SBCommandInterpreterRunOptions.getCPtr(rhs), rhs), true); - } - - public boolean GetStopOnContinue() { - return lldbJNI.SBCommandInterpreterRunOptions_GetStopOnContinue(swigCPtr, this); - } - - public void SetStopOnContinue(boolean arg0) { - lldbJNI.SBCommandInterpreterRunOptions_SetStopOnContinue(swigCPtr, this, arg0); - } - - public boolean GetStopOnError() { - return lldbJNI.SBCommandInterpreterRunOptions_GetStopOnError(swigCPtr, this); - } - - public void SetStopOnError(boolean arg0) { - lldbJNI.SBCommandInterpreterRunOptions_SetStopOnError(swigCPtr, this, arg0); - } - - public boolean GetStopOnCrash() { - return lldbJNI.SBCommandInterpreterRunOptions_GetStopOnCrash(swigCPtr, this); - } - - public void SetStopOnCrash(boolean arg0) { - lldbJNI.SBCommandInterpreterRunOptions_SetStopOnCrash(swigCPtr, this, arg0); - } - - public boolean GetEchoCommands() { - return lldbJNI.SBCommandInterpreterRunOptions_GetEchoCommands(swigCPtr, this); - } - - public void SetEchoCommands(boolean arg0) { - lldbJNI.SBCommandInterpreterRunOptions_SetEchoCommands(swigCPtr, this, arg0); - } - - public boolean GetEchoCommentCommands() { - return lldbJNI.SBCommandInterpreterRunOptions_GetEchoCommentCommands(swigCPtr, this); - } - - public void SetEchoCommentCommands(boolean echo) { - lldbJNI.SBCommandInterpreterRunOptions_SetEchoCommentCommands(swigCPtr, this, echo); - } - - public boolean GetPrintResults() { - return lldbJNI.SBCommandInterpreterRunOptions_GetPrintResults(swigCPtr, this); - } - - public void SetPrintResults(boolean arg0) { - lldbJNI.SBCommandInterpreterRunOptions_SetPrintResults(swigCPtr, this, arg0); - } - - public boolean GetPrintErrors() { - return lldbJNI.SBCommandInterpreterRunOptions_GetPrintErrors(swigCPtr, this); - } - - public void SetPrintErrors(boolean arg0) { - lldbJNI.SBCommandInterpreterRunOptions_SetPrintErrors(swigCPtr, this, arg0); - } - - public boolean GetAddToHistory() { - return lldbJNI.SBCommandInterpreterRunOptions_GetAddToHistory(swigCPtr, this); - } - - public void SetAddToHistory(boolean arg0) { - lldbJNI.SBCommandInterpreterRunOptions_SetAddToHistory(swigCPtr, this, arg0); - } - - public boolean GetAutoHandleEvents() { - return lldbJNI.SBCommandInterpreterRunOptions_GetAutoHandleEvents(swigCPtr, this); - } - - public void SetAutoHandleEvents(boolean arg0) { - lldbJNI.SBCommandInterpreterRunOptions_SetAutoHandleEvents(swigCPtr, this, arg0); - } - - public boolean GetSpawnThread() { - return lldbJNI.SBCommandInterpreterRunOptions_GetSpawnThread(swigCPtr, this); - } - - public void SetSpawnThread(boolean arg0) { - lldbJNI.SBCommandInterpreterRunOptions_SetSpawnThread(swigCPtr, this, arg0); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBCommandReturnObject.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBCommandReturnObject.java deleted file mode 100644 index b2294c0977..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBCommandReturnObject.java +++ /dev/null @@ -1,190 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBCommandReturnObject { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBCommandReturnObject(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBCommandReturnObject obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBCommandReturnObject obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBCommandReturnObject(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBCommandReturnObject() { - this(lldbJNI.new_SBCommandReturnObject__SWIG_0(), true); - } - - public SBCommandReturnObject(SBCommandReturnObject rhs) { - this(lldbJNI.new_SBCommandReturnObject__SWIG_1(SBCommandReturnObject.getCPtr(rhs), rhs), true); - } - - public boolean IsValid() { - return lldbJNI.SBCommandReturnObject_IsValid(swigCPtr, this); - } - - public String GetOutput() { - return lldbJNI.SBCommandReturnObject_GetOutput__SWIG_0(swigCPtr, this); - } - - public String GetError() { - return lldbJNI.SBCommandReturnObject_GetError__SWIG_0(swigCPtr, this); - } - - public long PutOutput(SBFile file) { - return lldbJNI.SBCommandReturnObject_PutOutput__SWIG_0(swigCPtr, this, SBFile.getCPtr(file), file); - } - - public long PutOutput(SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t BORROWED) { - return lldbJNI.SBCommandReturnObject_PutOutput__SWIG_1(swigCPtr, this, SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t.getCPtr(BORROWED)); - } - - public long GetOutputSize() { - return lldbJNI.SBCommandReturnObject_GetOutputSize(swigCPtr, this); - } - - public long GetErrorSize() { - return lldbJNI.SBCommandReturnObject_GetErrorSize(swigCPtr, this); - } - - public long PutError(SBFile file) { - return lldbJNI.SBCommandReturnObject_PutError__SWIG_0(swigCPtr, this, SBFile.getCPtr(file), file); - } - - public long PutError(SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t BORROWED) { - return lldbJNI.SBCommandReturnObject_PutError__SWIG_1(swigCPtr, this, SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t.getCPtr(BORROWED)); - } - - public void Clear() { - lldbJNI.SBCommandReturnObject_Clear(swigCPtr, this); - } - - public ReturnStatus GetStatus() { - return ReturnStatus.swigToEnum(lldbJNI.SBCommandReturnObject_GetStatus(swigCPtr, this)); - } - - public void SetStatus(ReturnStatus status) { - lldbJNI.SBCommandReturnObject_SetStatus(swigCPtr, this, status.swigValue()); - } - - public boolean Succeeded() { - return lldbJNI.SBCommandReturnObject_Succeeded(swigCPtr, this); - } - - public boolean HasResult() { - return lldbJNI.SBCommandReturnObject_HasResult(swigCPtr, this); - } - - public void AppendMessage(String message) { - lldbJNI.SBCommandReturnObject_AppendMessage(swigCPtr, this, message); - } - - public void AppendWarning(String message) { - lldbJNI.SBCommandReturnObject_AppendWarning(swigCPtr, this, message); - } - - public boolean GetDescription(SBStream description) { - return lldbJNI.SBCommandReturnObject_GetDescription(swigCPtr, this, SBStream.getCPtr(description), description); - } - - public void SetImmediateOutputFile(SBFile file) { - lldbJNI.SBCommandReturnObject_SetImmediateOutputFile__SWIG_0(swigCPtr, this, SBFile.getCPtr(file), file); - } - - public void SetImmediateErrorFile(SBFile file) { - lldbJNI.SBCommandReturnObject_SetImmediateErrorFile__SWIG_0(swigCPtr, this, SBFile.getCPtr(file), file); - } - - public void SetImmediateOutputFile(SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t BORROWED) { - lldbJNI.SBCommandReturnObject_SetImmediateOutputFile__SWIG_1(swigCPtr, this, SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t.getCPtr(BORROWED)); - } - - public void SetImmediateErrorFile(SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t BORROWED) { - lldbJNI.SBCommandReturnObject_SetImmediateErrorFile__SWIG_1(swigCPtr, this, SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t.getCPtr(BORROWED)); - } - - public void PutCString(String string, int len) { - lldbJNI.SBCommandReturnObject_PutCString__SWIG_0(swigCPtr, this, string, len); - } - - public void PutCString(String string) { - lldbJNI.SBCommandReturnObject_PutCString__SWIG_1(swigCPtr, this, string); - } - - public String GetOutput(boolean only_if_no_immediate) { - return lldbJNI.SBCommandReturnObject_GetOutput__SWIG_1(swigCPtr, this, only_if_no_immediate); - } - - public String GetError(boolean only_if_no_immediate) { - return lldbJNI.SBCommandReturnObject_GetError__SWIG_1(swigCPtr, this, only_if_no_immediate); - } - - public void SetError(SBError error, String fallback_error_cstr) { - lldbJNI.SBCommandReturnObject_SetError__SWIG_0(swigCPtr, this, SBError.getCPtr(error), error, fallback_error_cstr); - } - - public void SetError(SBError error) { - lldbJNI.SBCommandReturnObject_SetError__SWIG_1(swigCPtr, this, SBError.getCPtr(error), error); - } - - public void SetError(String error_cstr) { - lldbJNI.SBCommandReturnObject_SetError__SWIG_2(swigCPtr, this, error_cstr); - } - - public String __repr__() { - return lldbJNI.SBCommandReturnObject___repr__(swigCPtr, this); - } - - public void SetImmediateOutputFile(SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t BORROWED, boolean transfer_ownership) { - lldbJNI.SBCommandReturnObject_SetImmediateOutputFile__SWIG_2(swigCPtr, this, SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t.getCPtr(BORROWED), transfer_ownership); - } - - public void SetImmediateErrorFile(SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t BORROWED, boolean transfer_ownership) { - lldbJNI.SBCommandReturnObject_SetImmediateErrorFile__SWIG_2(swigCPtr, this, SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t.getCPtr(BORROWED), transfer_ownership); - } - - public void Print(String str) { - lldbJNI.SBCommandReturnObject_Print(swigCPtr, this, str); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBCommunication.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBCommunication.java deleted file mode 100644 index a0fd82a57f..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBCommunication.java +++ /dev/null @@ -1,129 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBCommunication { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBCommunication(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBCommunication obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBCommunication obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBCommunication(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBCommunication() { - this(lldbJNI.new_SBCommunication__SWIG_0(), true); - } - - public SBCommunication(String broadcaster_name) { - this(lldbJNI.new_SBCommunication__SWIG_1(broadcaster_name), true); - } - - public boolean IsValid() { - return lldbJNI.SBCommunication_IsValid(swigCPtr, this); - } - - public SBBroadcaster GetBroadcaster() { - return new SBBroadcaster(lldbJNI.SBCommunication_GetBroadcaster(swigCPtr, this), true); - } - - public static String GetBroadcasterClass() { - return lldbJNI.SBCommunication_GetBroadcasterClass(); - } - - public ConnectionStatus AdoptFileDesriptor(int fd, boolean owns_fd) { - return ConnectionStatus.swigToEnum(lldbJNI.SBCommunication_AdoptFileDesriptor(swigCPtr, this, fd, owns_fd)); - } - - public ConnectionStatus Connect(String url) { - return ConnectionStatus.swigToEnum(lldbJNI.SBCommunication_Connect(swigCPtr, this, url)); - } - - public ConnectionStatus Disconnect() { - return ConnectionStatus.swigToEnum(lldbJNI.SBCommunication_Disconnect(swigCPtr, this)); - } - - public boolean IsConnected() { - return lldbJNI.SBCommunication_IsConnected(swigCPtr, this); - } - - public boolean GetCloseOnEOF() { - return lldbJNI.SBCommunication_GetCloseOnEOF(swigCPtr, this); - } - - public void SetCloseOnEOF(boolean b) { - lldbJNI.SBCommunication_SetCloseOnEOF(swigCPtr, this, b); - } - - public long Read(SWIGTYPE_p_void dst, long dst_len, long timeout_usec, SWIGTYPE_p_lldb__ConnectionStatus status) { - return lldbJNI.SBCommunication_Read(swigCPtr, this, SWIGTYPE_p_void.getCPtr(dst), dst_len, timeout_usec, SWIGTYPE_p_lldb__ConnectionStatus.getCPtr(status)); - } - - public long Write(SWIGTYPE_p_void src, long src_len, SWIGTYPE_p_lldb__ConnectionStatus status) { - return lldbJNI.SBCommunication_Write(swigCPtr, this, SWIGTYPE_p_void.getCPtr(src), src_len, SWIGTYPE_p_lldb__ConnectionStatus.getCPtr(status)); - } - - public boolean ReadThreadStart() { - return lldbJNI.SBCommunication_ReadThreadStart(swigCPtr, this); - } - - public boolean ReadThreadStop() { - return lldbJNI.SBCommunication_ReadThreadStop(swigCPtr, this); - } - - public boolean ReadThreadIsRunning() { - return lldbJNI.SBCommunication_ReadThreadIsRunning(swigCPtr, this); - } - - public boolean SetReadThreadBytesReceivedCallback(SWIGTYPE_p_f_p_void_p_q_const__void_size_t__void callback, SWIGTYPE_p_void callback_baton) { - return lldbJNI.SBCommunication_SetReadThreadBytesReceivedCallback(swigCPtr, this, SWIGTYPE_p_f_p_void_p_q_const__void_size_t__void.getCPtr(callback), SWIGTYPE_p_void.getCPtr(callback_baton)); - } - - public final static int eBroadcastBitDisconnected = lldbJNI.SBCommunication_eBroadcastBitDisconnected_get(); - public final static int eBroadcastBitReadThreadGotBytes = lldbJNI.SBCommunication_eBroadcastBitReadThreadGotBytes_get(); - public final static int eBroadcastBitReadThreadDidExit = lldbJNI.SBCommunication_eBroadcastBitReadThreadDidExit_get(); - public final static int eBroadcastBitReadThreadShouldExit = lldbJNI.SBCommunication_eBroadcastBitReadThreadShouldExit_get(); - public final static int eBroadcastBitPacketAvailable = lldbJNI.SBCommunication_eBroadcastBitPacketAvailable_get(); - public final static int eAllEventBits = lldbJNI.SBCommunication_eAllEventBits_get(); - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBCompileUnit.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBCompileUnit.java deleted file mode 100644 index a70f14f95b..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBCompileUnit.java +++ /dev/null @@ -1,126 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBCompileUnit { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBCompileUnit(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBCompileUnit obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBCompileUnit obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBCompileUnit(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBCompileUnit() { - this(lldbJNI.new_SBCompileUnit__SWIG_0(), true); - } - - public SBCompileUnit(SBCompileUnit rhs) { - this(lldbJNI.new_SBCompileUnit__SWIG_1(SBCompileUnit.getCPtr(rhs), rhs), true); - } - - public boolean IsValid() { - return lldbJNI.SBCompileUnit_IsValid(swigCPtr, this); - } - - public SBFileSpec GetFileSpec() { - return new SBFileSpec(lldbJNI.SBCompileUnit_GetFileSpec(swigCPtr, this), true); - } - - public long GetNumLineEntries() { - return lldbJNI.SBCompileUnit_GetNumLineEntries(swigCPtr, this); - } - - public SBLineEntry GetLineEntryAtIndex(long idx) { - return new SBLineEntry(lldbJNI.SBCompileUnit_GetLineEntryAtIndex(swigCPtr, this, idx), true); - } - - public long FindLineEntryIndex(SBLineEntry line_entry, boolean exact) { - return lldbJNI.SBCompileUnit_FindLineEntryIndex__SWIG_0(swigCPtr, this, SBLineEntry.getCPtr(line_entry), line_entry, exact); - } - - public long FindLineEntryIndex(SBLineEntry line_entry) { - return lldbJNI.SBCompileUnit_FindLineEntryIndex__SWIG_1(swigCPtr, this, SBLineEntry.getCPtr(line_entry), line_entry); - } - - public long FindLineEntryIndex(long start_idx, long line, SBFileSpec inline_file_spec) { - return lldbJNI.SBCompileUnit_FindLineEntryIndex__SWIG_2(swigCPtr, this, start_idx, line, SBFileSpec.getCPtr(inline_file_spec), inline_file_spec); - } - - public long FindLineEntryIndex(long start_idx, long line, SBFileSpec inline_file_spec, boolean exact) { - return lldbJNI.SBCompileUnit_FindLineEntryIndex__SWIG_3(swigCPtr, this, start_idx, line, SBFileSpec.getCPtr(inline_file_spec), inline_file_spec, exact); - } - - public SBFileSpec GetSupportFileAtIndex(long idx) { - return new SBFileSpec(lldbJNI.SBCompileUnit_GetSupportFileAtIndex(swigCPtr, this, idx), true); - } - - public long GetNumSupportFiles() { - return lldbJNI.SBCompileUnit_GetNumSupportFiles(swigCPtr, this); - } - - public long FindSupportFileIndex(long start_idx, SBFileSpec sb_file, boolean full) { - return lldbJNI.SBCompileUnit_FindSupportFileIndex(swigCPtr, this, start_idx, SBFileSpec.getCPtr(sb_file), sb_file, full); - } - - public SBTypeList GetTypes(long type_mask) { - return new SBTypeList(lldbJNI.SBCompileUnit_GetTypes__SWIG_0(swigCPtr, this, type_mask), true); - } - - public SBTypeList GetTypes() { - return new SBTypeList(lldbJNI.SBCompileUnit_GetTypes__SWIG_1(swigCPtr, this), true); - } - - public LanguageType GetLanguage() { - return LanguageType.swigToEnum(lldbJNI.SBCompileUnit_GetLanguage(swigCPtr, this)); - } - - public boolean GetDescription(SBStream description) { - return lldbJNI.SBCompileUnit_GetDescription(swigCPtr, this, SBStream.getCPtr(description), description); - } - - public String __repr__() { - return lldbJNI.SBCompileUnit___repr__(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBData.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBData.java deleted file mode 100644 index db894b11dc..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBData.java +++ /dev/null @@ -1,218 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBData { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBData(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBData obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBData obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBData(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBData() { - this(lldbJNI.new_SBData__SWIG_0(), true); - } - - public SBData(SBData rhs) { - this(lldbJNI.new_SBData__SWIG_1(SBData.getCPtr(rhs), rhs), true); - } - - public short GetAddressByteSize() { - return lldbJNI.SBData_GetAddressByteSize(swigCPtr, this); - } - - public void SetAddressByteSize(short addr_byte_size) { - lldbJNI.SBData_SetAddressByteSize(swigCPtr, this, addr_byte_size); - } - - public void Clear() { - lldbJNI.SBData_Clear(swigCPtr, this); - } - - public boolean IsValid() { - return lldbJNI.SBData_IsValid(swigCPtr, this); - } - - public long GetByteSize() { - return lldbJNI.SBData_GetByteSize(swigCPtr, this); - } - - public ByteOrder GetByteOrder() { - return ByteOrder.swigToEnum(lldbJNI.SBData_GetByteOrder(swigCPtr, this)); - } - - public void SetByteOrder(ByteOrder endian) { - lldbJNI.SBData_SetByteOrder(swigCPtr, this, endian.swigValue()); - } - - public float GetFloat(SBError error, java.math.BigInteger offset) { - return lldbJNI.SBData_GetFloat(swigCPtr, this, SBError.getCPtr(error), error, offset); - } - - public double GetDouble(SBError error, java.math.BigInteger offset) { - return lldbJNI.SBData_GetDouble(swigCPtr, this, SBError.getCPtr(error), error, offset); - } - - public SWIGTYPE_p_long_double GetLongDouble(SBError error, java.math.BigInteger offset) { - return new SWIGTYPE_p_long_double(lldbJNI.SBData_GetLongDouble(swigCPtr, this, SBError.getCPtr(error), error, offset), true); - } - - public java.math.BigInteger GetAddress(SBError error, java.math.BigInteger offset) { - return lldbJNI.SBData_GetAddress(swigCPtr, this, SBError.getCPtr(error), error, offset); - } - - public short GetUnsignedInt8(SBError error, java.math.BigInteger offset) { - return lldbJNI.SBData_GetUnsignedInt8(swigCPtr, this, SBError.getCPtr(error), error, offset); - } - - public int GetUnsignedInt16(SBError error, java.math.BigInteger offset) { - return lldbJNI.SBData_GetUnsignedInt16(swigCPtr, this, SBError.getCPtr(error), error, offset); - } - - public long GetUnsignedInt32(SBError error, java.math.BigInteger offset) { - return lldbJNI.SBData_GetUnsignedInt32(swigCPtr, this, SBError.getCPtr(error), error, offset); - } - - public java.math.BigInteger GetUnsignedInt64(SBError error, java.math.BigInteger offset) { - return lldbJNI.SBData_GetUnsignedInt64(swigCPtr, this, SBError.getCPtr(error), error, offset); - } - - public byte GetSignedInt8(SBError error, java.math.BigInteger offset) { - return lldbJNI.SBData_GetSignedInt8(swigCPtr, this, SBError.getCPtr(error), error, offset); - } - - public short GetSignedInt16(SBError error, java.math.BigInteger offset) { - return lldbJNI.SBData_GetSignedInt16(swigCPtr, this, SBError.getCPtr(error), error, offset); - } - - public int GetSignedInt32(SBError error, java.math.BigInteger offset) { - return lldbJNI.SBData_GetSignedInt32(swigCPtr, this, SBError.getCPtr(error), error, offset); - } - - public long GetSignedInt64(SBError error, java.math.BigInteger offset) { - return lldbJNI.SBData_GetSignedInt64(swigCPtr, this, SBError.getCPtr(error), error, offset); - } - - public String GetString(SBError error, java.math.BigInteger offset) { - return lldbJNI.SBData_GetString(swigCPtr, this, SBError.getCPtr(error), error, offset); - } - - public long ReadRawData(SBError error, java.math.BigInteger offset, SWIGTYPE_p_void buf, long size) { - return lldbJNI.SBData_ReadRawData(swigCPtr, this, SBError.getCPtr(error), error, offset, SWIGTYPE_p_void.getCPtr(buf), size); - } - - public boolean GetDescription(SBStream description, java.math.BigInteger base_addr) { - return lldbJNI.SBData_GetDescription__SWIG_0(swigCPtr, this, SBStream.getCPtr(description), description, base_addr); - } - - public boolean GetDescription(SBStream description) { - return lldbJNI.SBData_GetDescription__SWIG_1(swigCPtr, this, SBStream.getCPtr(description), description); - } - - public void SetData(SBError error, SWIGTYPE_p_void buf, long size, ByteOrder endian, short addr_size) { - lldbJNI.SBData_SetData(swigCPtr, this, SBError.getCPtr(error), error, SWIGTYPE_p_void.getCPtr(buf), size, endian.swigValue(), addr_size); - } - - public void SetDataWithOwnership(SBError error, SWIGTYPE_p_void buf, long size, ByteOrder endian, short addr_size) { - lldbJNI.SBData_SetDataWithOwnership(swigCPtr, this, SBError.getCPtr(error), error, SWIGTYPE_p_void.getCPtr(buf), size, endian.swigValue(), addr_size); - } - - public boolean Append(SBData rhs) { - return lldbJNI.SBData_Append(swigCPtr, this, SBData.getCPtr(rhs), rhs); - } - - public static SBData CreateDataFromCString(ByteOrder endian, long addr_byte_size, String data) { - return new SBData(lldbJNI.SBData_CreateDataFromCString(endian.swigValue(), addr_byte_size, data), true); - } - - public static SBData CreateDataFromUInt64Array(ByteOrder endian, long addr_byte_size, SWIGTYPE_p_unsigned_long_long array, long array_len) { - return new SBData(lldbJNI.SBData_CreateDataFromUInt64Array(endian.swigValue(), addr_byte_size, SWIGTYPE_p_unsigned_long_long.getCPtr(array), array_len), true); - } - - public static SBData CreateDataFromUInt32Array(ByteOrder endian, long addr_byte_size, SWIGTYPE_p_unsigned_int array, long array_len) { - return new SBData(lldbJNI.SBData_CreateDataFromUInt32Array(endian.swigValue(), addr_byte_size, SWIGTYPE_p_unsigned_int.getCPtr(array), array_len), true); - } - - public static SBData CreateDataFromSInt64Array(ByteOrder endian, long addr_byte_size, SWIGTYPE_p_long_long array, long array_len) { - return new SBData(lldbJNI.SBData_CreateDataFromSInt64Array(endian.swigValue(), addr_byte_size, SWIGTYPE_p_long_long.getCPtr(array), array_len), true); - } - - public static SBData CreateDataFromSInt32Array(ByteOrder endian, long addr_byte_size, SWIGTYPE_p_int array, long array_len) { - return new SBData(lldbJNI.SBData_CreateDataFromSInt32Array(endian.swigValue(), addr_byte_size, SWIGTYPE_p_int.getCPtr(array), array_len), true); - } - - public static SBData CreateDataFromDoubleArray(ByteOrder endian, long addr_byte_size, SWIGTYPE_p_double array, long array_len) { - return new SBData(lldbJNI.SBData_CreateDataFromDoubleArray(endian.swigValue(), addr_byte_size, SWIGTYPE_p_double.getCPtr(array), array_len), true); - } - - public boolean SetDataFromCString(String data) { - return lldbJNI.SBData_SetDataFromCString(swigCPtr, this, data); - } - - public boolean SetDataFromUInt64Array(SWIGTYPE_p_unsigned_long_long array, long array_len) { - return lldbJNI.SBData_SetDataFromUInt64Array(swigCPtr, this, SWIGTYPE_p_unsigned_long_long.getCPtr(array), array_len); - } - - public boolean SetDataFromUInt32Array(SWIGTYPE_p_unsigned_int array, long array_len) { - return lldbJNI.SBData_SetDataFromUInt32Array(swigCPtr, this, SWIGTYPE_p_unsigned_int.getCPtr(array), array_len); - } - - public boolean SetDataFromSInt64Array(SWIGTYPE_p_long_long array, long array_len) { - return lldbJNI.SBData_SetDataFromSInt64Array(swigCPtr, this, SWIGTYPE_p_long_long.getCPtr(array), array_len); - } - - public boolean SetDataFromSInt32Array(SWIGTYPE_p_int array, long array_len) { - return lldbJNI.SBData_SetDataFromSInt32Array(swigCPtr, this, SWIGTYPE_p_int.getCPtr(array), array_len); - } - - public boolean SetDataFromDoubleArray(SWIGTYPE_p_double array, long array_len) { - return lldbJNI.SBData_SetDataFromDoubleArray(swigCPtr, this, SWIGTYPE_p_double.getCPtr(array), array_len); - } - - public String __repr__() { - return lldbJNI.SBData___repr__(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBDebugger.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBDebugger.java deleted file mode 100644 index 5629a6777b..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBDebugger.java +++ /dev/null @@ -1,550 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBDebugger { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBDebugger(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBDebugger obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBDebugger obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBDebugger(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBDebugger() { - this(lldbJNI.new_SBDebugger__SWIG_0(), true); - } - - public SBDebugger(SBDebugger rhs) { - this(lldbJNI.new_SBDebugger__SWIG_1(SBDebugger.getCPtr(rhs), rhs), true); - } - - public static String GetBroadcasterClass() { - return lldbJNI.SBDebugger_GetBroadcasterClass(); - } - - public SBBroadcaster GetBroadcaster() { - return new SBBroadcaster(lldbJNI.SBDebugger_GetBroadcaster(swigCPtr, this), true); - } - - public static String GetProgressFromEvent(SBEvent event, java.math.BigInteger[] arg1, java.math.BigInteger[] arg2, java.math.BigInteger[] arg3, boolean[] arg4) { - return lldbJNI.SBDebugger_GetProgressFromEvent(SBEvent.getCPtr(event), event, arg1, arg2, arg3, arg4); - } - - public static SBStructuredData GetProgressDataFromEvent(SBEvent event) { - return new SBStructuredData(lldbJNI.SBDebugger_GetProgressDataFromEvent(SBEvent.getCPtr(event), event), true); - } - - public static SBStructuredData GetDiagnosticFromEvent(SBEvent event) { - return new SBStructuredData(lldbJNI.SBDebugger_GetDiagnosticFromEvent(SBEvent.getCPtr(event), event), true); - } - - public static void Initialize() { - lldbJNI.SBDebugger_Initialize(); - } - - public static SBError InitializeWithErrorHandling() { - return new SBError(lldbJNI.SBDebugger_InitializeWithErrorHandling(), true); - } - - public static void PrintStackTraceOnError() { - lldbJNI.SBDebugger_PrintStackTraceOnError(); - } - - public static void PrintDiagnosticsOnError() { - lldbJNI.SBDebugger_PrintDiagnosticsOnError(); - } - - public static void Terminate() { - lldbJNI.SBDebugger_Terminate(); - } - - public static SBDebugger Create() { - return new SBDebugger(lldbJNI.SBDebugger_Create__SWIG_0(), true); - } - - public static SBDebugger Create(boolean source_init_files) { - return new SBDebugger(lldbJNI.SBDebugger_Create__SWIG_1(source_init_files), true); - } - - public static SBDebugger Create(boolean source_init_files, SWIGTYPE_p_f_p_q_const__char_p_void__void log_callback, SWIGTYPE_p_void baton) { - return new SBDebugger(lldbJNI.SBDebugger_Create__SWIG_2(source_init_files, SWIGTYPE_p_f_p_q_const__char_p_void__void.getCPtr(log_callback), SWIGTYPE_p_void.getCPtr(baton)), true); - } - - public static void Destroy(SBDebugger debugger) { - lldbJNI.SBDebugger_Destroy(SBDebugger.getCPtr(debugger), debugger); - } - - public static void MemoryPressureDetected() { - lldbJNI.SBDebugger_MemoryPressureDetected(); - } - - public boolean IsValid() { - return lldbJNI.SBDebugger_IsValid(swigCPtr, this); - } - - public void Clear() { - lldbJNI.SBDebugger_Clear(swigCPtr, this); - } - - public SBStructuredData GetSetting(String setting) { - return new SBStructuredData(lldbJNI.SBDebugger_GetSetting__SWIG_0(swigCPtr, this, setting), true); - } - - public SBStructuredData GetSetting() { - return new SBStructuredData(lldbJNI.SBDebugger_GetSetting__SWIG_1(swigCPtr, this), true); - } - - public void SetAsync(boolean b) { - lldbJNI.SBDebugger_SetAsync(swigCPtr, this, b); - } - - public boolean GetAsync() { - return lldbJNI.SBDebugger_GetAsync(swigCPtr, this); - } - - public void SkipLLDBInitFiles(boolean b) { - lldbJNI.SBDebugger_SkipLLDBInitFiles(swigCPtr, this, b); - } - - public void SkipAppInitFiles(boolean b) { - lldbJNI.SBDebugger_SkipAppInitFiles(swigCPtr, this, b); - } - - public SBError SetInputString(String data) { - return new SBError(lldbJNI.SBDebugger_SetInputString(swigCPtr, this, data), true); - } - - public SBError SetInputFile(SBFile file) { - return new SBError(lldbJNI.SBDebugger_SetInputFile__SWIG_0(swigCPtr, this, SBFile.getCPtr(file), file), true); - } - - public SBError SetOutputFile(SBFile file) { - return new SBError(lldbJNI.SBDebugger_SetOutputFile__SWIG_0(swigCPtr, this, SBFile.getCPtr(file), file), true); - } - - public SBError SetErrorFile(SBFile file) { - return new SBError(lldbJNI.SBDebugger_SetErrorFile__SWIG_0(swigCPtr, this, SBFile.getCPtr(file), file), true); - } - - public SBError SetInputFile(SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t file) { - return new SBError(lldbJNI.SBDebugger_SetInputFile__SWIG_1(swigCPtr, this, SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t.getCPtr(file)), true); - } - - public SBError SetOutputFile(SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t file) { - return new SBError(lldbJNI.SBDebugger_SetOutputFile__SWIG_1(swigCPtr, this, SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t.getCPtr(file)), true); - } - - public SBError SetErrorFile(SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t file) { - return new SBError(lldbJNI.SBDebugger_SetErrorFile__SWIG_1(swigCPtr, this, SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t.getCPtr(file)), true); - } - - public SBFile GetInputFile() { - return new SBFile(lldbJNI.SBDebugger_GetInputFile(swigCPtr, this), true); - } - - public SBFile GetOutputFile() { - return new SBFile(lldbJNI.SBDebugger_GetOutputFile(swigCPtr, this), true); - } - - public SBFile GetErrorFile() { - return new SBFile(lldbJNI.SBDebugger_GetErrorFile(swigCPtr, this), true); - } - - public void SaveInputTerminalState() { - lldbJNI.SBDebugger_SaveInputTerminalState(swigCPtr, this); - } - - public void RestoreInputTerminalState() { - lldbJNI.SBDebugger_RestoreInputTerminalState(swigCPtr, this); - } - - public SBCommandInterpreter GetCommandInterpreter() { - return new SBCommandInterpreter(lldbJNI.SBDebugger_GetCommandInterpreter(swigCPtr, this), true); - } - - public void HandleCommand(String command) { - lldbJNI.SBDebugger_HandleCommand(swigCPtr, this, command); - } - - public void RequestInterrupt() { - lldbJNI.SBDebugger_RequestInterrupt(swigCPtr, this); - } - - public void CancelInterruptRequest() { - lldbJNI.SBDebugger_CancelInterruptRequest(swigCPtr, this); - } - - public boolean InterruptRequested() { - return lldbJNI.SBDebugger_InterruptRequested(swigCPtr, this); - } - - public SBListener GetListener() { - return new SBListener(lldbJNI.SBDebugger_GetListener(swigCPtr, this), true); - } - - public void HandleProcessEvent(SBProcess process, SBEvent event, SBFile out, SBFile err) { - lldbJNI.SBDebugger_HandleProcessEvent__SWIG_0(swigCPtr, this, SBProcess.getCPtr(process), process, SBEvent.getCPtr(event), event, SBFile.getCPtr(out), out, SBFile.getCPtr(err), err); - } - - public void HandleProcessEvent(SBProcess process, SBEvent event, SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t arg2, SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t arg3) { - lldbJNI.SBDebugger_HandleProcessEvent__SWIG_1(swigCPtr, this, SBProcess.getCPtr(process), process, SBEvent.getCPtr(event), event, SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t.getCPtr(arg2), SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t.getCPtr(arg3)); - } - - public SBTarget CreateTarget(String filename, String target_triple, String platform_name, boolean add_dependent_modules, SBError error) { - return new SBTarget(lldbJNI.SBDebugger_CreateTarget__SWIG_0(swigCPtr, this, filename, target_triple, platform_name, add_dependent_modules, SBError.getCPtr(error), error), true); - } - - public SBTarget CreateTargetWithFileAndTargetTriple(String filename, String target_triple) { - return new SBTarget(lldbJNI.SBDebugger_CreateTargetWithFileAndTargetTriple(swigCPtr, this, filename, target_triple), true); - } - - public SBTarget CreateTargetWithFileAndArch(String filename, String archname) { - return new SBTarget(lldbJNI.SBDebugger_CreateTargetWithFileAndArch(swigCPtr, this, filename, archname), true); - } - - public SBTarget CreateTarget(String filename) { - return new SBTarget(lldbJNI.SBDebugger_CreateTarget__SWIG_1(swigCPtr, this, filename), true); - } - - public SBTarget GetDummyTarget() { - return new SBTarget(lldbJNI.SBDebugger_GetDummyTarget(swigCPtr, this), true); - } - - public boolean DeleteTarget(SBTarget target) { - return lldbJNI.SBDebugger_DeleteTarget(swigCPtr, this, SBTarget.getCPtr(target), target); - } - - public SBTarget GetTargetAtIndex(long idx) { - return new SBTarget(lldbJNI.SBDebugger_GetTargetAtIndex(swigCPtr, this, idx), true); - } - - public long GetIndexOfTarget(SBTarget target) { - return lldbJNI.SBDebugger_GetIndexOfTarget(swigCPtr, this, SBTarget.getCPtr(target), target); - } - - public SBTarget FindTargetWithProcessID(java.math.BigInteger pid) { - return new SBTarget(lldbJNI.SBDebugger_FindTargetWithProcessID(swigCPtr, this, pid), true); - } - - public SBTarget FindTargetWithFileAndArch(String filename, String arch) { - return new SBTarget(lldbJNI.SBDebugger_FindTargetWithFileAndArch(swigCPtr, this, filename, arch), true); - } - - public long GetNumTargets() { - return lldbJNI.SBDebugger_GetNumTargets(swigCPtr, this); - } - - public SBTarget GetSelectedTarget() { - return new SBTarget(lldbJNI.SBDebugger_GetSelectedTarget(swigCPtr, this), true); - } - - public void SetSelectedTarget(SBTarget target) { - lldbJNI.SBDebugger_SetSelectedTarget(swigCPtr, this, SBTarget.getCPtr(target), target); - } - - public SBPlatform GetSelectedPlatform() { - return new SBPlatform(lldbJNI.SBDebugger_GetSelectedPlatform(swigCPtr, this), true); - } - - public void SetSelectedPlatform(SBPlatform platform) { - lldbJNI.SBDebugger_SetSelectedPlatform(swigCPtr, this, SBPlatform.getCPtr(platform), platform); - } - - public long GetNumPlatforms() { - return lldbJNI.SBDebugger_GetNumPlatforms(swigCPtr, this); - } - - public SBPlatform GetPlatformAtIndex(long idx) { - return new SBPlatform(lldbJNI.SBDebugger_GetPlatformAtIndex(swigCPtr, this, idx), true); - } - - public long GetNumAvailablePlatforms() { - return lldbJNI.SBDebugger_GetNumAvailablePlatforms(swigCPtr, this); - } - - public SBStructuredData GetAvailablePlatformInfoAtIndex(long idx) { - return new SBStructuredData(lldbJNI.SBDebugger_GetAvailablePlatformInfoAtIndex(swigCPtr, this, idx), true); - } - - public SBSourceManager GetSourceManager() { - return new SBSourceManager(lldbJNI.SBDebugger_GetSourceManager(swigCPtr, this), true); - } - - public SBError SetCurrentPlatform(String platform_name) { - return new SBError(lldbJNI.SBDebugger_SetCurrentPlatform(swigCPtr, this, platform_name), true); - } - - public boolean SetCurrentPlatformSDKRoot(String sysroot) { - return lldbJNI.SBDebugger_SetCurrentPlatformSDKRoot(swigCPtr, this, sysroot); - } - - public boolean SetUseExternalEditor(boolean input) { - return lldbJNI.SBDebugger_SetUseExternalEditor(swigCPtr, this, input); - } - - public boolean GetUseExternalEditor() { - return lldbJNI.SBDebugger_GetUseExternalEditor(swigCPtr, this); - } - - public boolean SetUseColor(boolean use_color) { - return lldbJNI.SBDebugger_SetUseColor(swigCPtr, this, use_color); - } - - public boolean GetUseColor() { - return lldbJNI.SBDebugger_GetUseColor(swigCPtr, this); - } - - public boolean SetUseSourceCache(boolean use_source_cache) { - return lldbJNI.SBDebugger_SetUseSourceCache(swigCPtr, this, use_source_cache); - } - - public boolean GetUseSourceCache() { - return lldbJNI.SBDebugger_GetUseSourceCache(swigCPtr, this); - } - - public static boolean GetDefaultArchitecture(String arch_name, long arch_name_len) { - return lldbJNI.SBDebugger_GetDefaultArchitecture(arch_name, arch_name_len); - } - - public static boolean SetDefaultArchitecture(String arch_name) { - return lldbJNI.SBDebugger_SetDefaultArchitecture(arch_name); - } - - public ScriptLanguage GetScriptingLanguage(String script_language_name) { - return ScriptLanguage.swigToEnum(lldbJNI.SBDebugger_GetScriptingLanguage(swigCPtr, this, script_language_name)); - } - - public SBStructuredData GetScriptInterpreterInfo(ScriptLanguage arg0) { - return new SBStructuredData(lldbJNI.SBDebugger_GetScriptInterpreterInfo(swigCPtr, this, arg0.swigValue()), true); - } - - public static String GetVersionString() { - return lldbJNI.SBDebugger_GetVersionString(); - } - - public static String StateAsCString(StateType state) { - return lldbJNI.SBDebugger_StateAsCString(state.swigValue()); - } - - public static SBStructuredData GetBuildConfiguration() { - return new SBStructuredData(lldbJNI.SBDebugger_GetBuildConfiguration(), true); - } - - public static boolean StateIsRunningState(StateType state) { - return lldbJNI.SBDebugger_StateIsRunningState(state.swigValue()); - } - - public static boolean StateIsStoppedState(StateType state) { - return lldbJNI.SBDebugger_StateIsStoppedState(state.swigValue()); - } - - public boolean EnableLog(String channel, String[] categories) { - return lldbJNI.SBDebugger_EnableLog(swigCPtr, this, channel, categories); - } - - public void SetLoggingCallback(SWIGTYPE_p_f_p_q_const__char_p_void__void log_callback, SWIGTYPE_p_void baton) { - lldbJNI.SBDebugger_SetLoggingCallback(swigCPtr, this, SWIGTYPE_p_f_p_q_const__char_p_void__void.getCPtr(log_callback), SWIGTYPE_p_void.getCPtr(baton)); - } - - public void SetDestroyCallback(SWIGTYPE_p_f_unsigned_long_long_p_void__void destroy_callback, SWIGTYPE_p_void baton) { - lldbJNI.SBDebugger_SetDestroyCallback(swigCPtr, this, SWIGTYPE_p_f_unsigned_long_long_p_void__void.getCPtr(destroy_callback), SWIGTYPE_p_void.getCPtr(baton)); - } - - public void DispatchInput(SWIGTYPE_p_void data, long data_len) { - lldbJNI.SBDebugger_DispatchInput(swigCPtr, this, SWIGTYPE_p_void.getCPtr(data), data_len); - } - - public void DispatchInputInterrupt() { - lldbJNI.SBDebugger_DispatchInputInterrupt(swigCPtr, this); - } - - public void DispatchInputEndOfFile() { - lldbJNI.SBDebugger_DispatchInputEndOfFile(swigCPtr, this); - } - - public String GetInstanceName() { - return lldbJNI.SBDebugger_GetInstanceName(swigCPtr, this); - } - - public static SBDebugger FindDebuggerWithID(int id) { - return new SBDebugger(lldbJNI.SBDebugger_FindDebuggerWithID(id), true); - } - - public static SBError SetInternalVariable(String var_name, String value, String debugger_instance_name) { - return new SBError(lldbJNI.SBDebugger_SetInternalVariable(var_name, value, debugger_instance_name), true); - } - - public static SBStringList GetInternalVariableValue(String var_name, String debugger_instance_name) { - return new SBStringList(lldbJNI.SBDebugger_GetInternalVariableValue(var_name, debugger_instance_name), true); - } - - public boolean GetDescription(SBStream description) { - return lldbJNI.SBDebugger_GetDescription(swigCPtr, this, SBStream.getCPtr(description), description); - } - - public long GetTerminalWidth() { - return lldbJNI.SBDebugger_GetTerminalWidth(swigCPtr, this); - } - - public void SetTerminalWidth(long term_width) { - lldbJNI.SBDebugger_SetTerminalWidth(swigCPtr, this, term_width); - } - - public java.math.BigInteger GetID() { - return lldbJNI.SBDebugger_GetID(swigCPtr, this); - } - - public String GetPrompt() { - return lldbJNI.SBDebugger_GetPrompt(swigCPtr, this); - } - - public void SetPrompt(String prompt) { - lldbJNI.SBDebugger_SetPrompt(swigCPtr, this, prompt); - } - - public String GetReproducerPath() { - return lldbJNI.SBDebugger_GetReproducerPath(swigCPtr, this); - } - - public ScriptLanguage GetScriptLanguage() { - return ScriptLanguage.swigToEnum(lldbJNI.SBDebugger_GetScriptLanguage(swigCPtr, this)); - } - - public void SetScriptLanguage(ScriptLanguage script_lang) { - lldbJNI.SBDebugger_SetScriptLanguage(swigCPtr, this, script_lang.swigValue()); - } - - public LanguageType GetREPLLanguage() { - return LanguageType.swigToEnum(lldbJNI.SBDebugger_GetREPLLanguage(swigCPtr, this)); - } - - public void SetREPLLanguage(LanguageType repl_lang) { - lldbJNI.SBDebugger_SetREPLLanguage(swigCPtr, this, repl_lang.swigValue()); - } - - public boolean GetCloseInputOnEOF() { - return lldbJNI.SBDebugger_GetCloseInputOnEOF(swigCPtr, this); - } - - public void SetCloseInputOnEOF(boolean b) { - lldbJNI.SBDebugger_SetCloseInputOnEOF(swigCPtr, this, b); - } - - public SBTypeCategory GetCategory(String category_name) { - return new SBTypeCategory(lldbJNI.SBDebugger_GetCategory__SWIG_0(swigCPtr, this, category_name), true); - } - - public SBTypeCategory GetCategory(LanguageType lang_type) { - return new SBTypeCategory(lldbJNI.SBDebugger_GetCategory__SWIG_1(swigCPtr, this, lang_type.swigValue()), true); - } - - public SBTypeCategory CreateCategory(String category_name) { - return new SBTypeCategory(lldbJNI.SBDebugger_CreateCategory(swigCPtr, this, category_name), true); - } - - public boolean DeleteCategory(String category_name) { - return lldbJNI.SBDebugger_DeleteCategory(swigCPtr, this, category_name); - } - - public long GetNumCategories() { - return lldbJNI.SBDebugger_GetNumCategories(swigCPtr, this); - } - - public SBTypeCategory GetCategoryAtIndex(long arg0) { - return new SBTypeCategory(lldbJNI.SBDebugger_GetCategoryAtIndex(swigCPtr, this, arg0), true); - } - - public SBTypeCategory GetDefaultCategory() { - return new SBTypeCategory(lldbJNI.SBDebugger_GetDefaultCategory(swigCPtr, this), true); - } - - public SBTypeFormat GetFormatForType(SBTypeNameSpecifier arg0) { - return new SBTypeFormat(lldbJNI.SBDebugger_GetFormatForType(swigCPtr, this, SBTypeNameSpecifier.getCPtr(arg0), arg0), true); - } - - public SBTypeSummary GetSummaryForType(SBTypeNameSpecifier arg0) { - return new SBTypeSummary(lldbJNI.SBDebugger_GetSummaryForType(swigCPtr, this, SBTypeNameSpecifier.getCPtr(arg0), arg0), true); - } - - public SBTypeFilter GetFilterForType(SBTypeNameSpecifier arg0) { - return new SBTypeFilter(lldbJNI.SBDebugger_GetFilterForType(swigCPtr, this, SBTypeNameSpecifier.getCPtr(arg0), arg0), true); - } - - public SBTypeSynthetic GetSyntheticForType(SBTypeNameSpecifier arg0) { - return new SBTypeSynthetic(lldbJNI.SBDebugger_GetSyntheticForType(swigCPtr, this, SBTypeNameSpecifier.getCPtr(arg0), arg0), true); - } - - public void RunCommandInterpreter(boolean auto_handle_events, boolean spawn_thread, SBCommandInterpreterRunOptions options, int[] num_errors, boolean[] quit_requested, boolean[] stopped_for_crash) { - lldbJNI.SBDebugger_RunCommandInterpreter(swigCPtr, this, auto_handle_events, spawn_thread, SBCommandInterpreterRunOptions.getCPtr(options), options, num_errors, quit_requested, stopped_for_crash); - } - - public SBError RunREPL(LanguageType language, String repl_options) { - return new SBError(lldbJNI.SBDebugger_RunREPL(swigCPtr, this, language.swigValue(), repl_options), true); - } - - public SBTrace LoadTraceFromFile(SBError error, SBFileSpec trace_description_file) { - return new SBTrace(lldbJNI.SBDebugger_LoadTraceFromFile(swigCPtr, this, SBError.getCPtr(error), error, SBFileSpec.getCPtr(trace_description_file), trace_description_file), true); - } - - public String __repr__() { - return lldbJNI.SBDebugger___repr__(swigCPtr, this); - } - - public SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t GetInputFileHandle() { - return new SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t(lldbJNI.SBDebugger_GetInputFileHandle(swigCPtr, this), true); - } - - public SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t GetOutputFileHandle() { - return new SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t(lldbJNI.SBDebugger_GetOutputFileHandle(swigCPtr, this), true); - } - - public SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t GetErrorFileHandle() { - return new SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t(lldbJNI.SBDebugger_GetErrorFileHandle(swigCPtr, this), true); - } - - public final static int eBroadcastBitProgress = lldbJNI.SBDebugger_eBroadcastBitProgress_get(); - public final static int eBroadcastBitWarning = lldbJNI.SBDebugger_eBroadcastBitWarning_get(); - public final static int eBroadcastBitError = lldbJNI.SBDebugger_eBroadcastBitError_get(); - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBDeclaration.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBDeclaration.java deleted file mode 100644 index cdaa01e5af..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBDeclaration.java +++ /dev/null @@ -1,98 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBDeclaration { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBDeclaration(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBDeclaration obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBDeclaration obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBDeclaration(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBDeclaration() { - this(lldbJNI.new_SBDeclaration__SWIG_0(), true); - } - - public SBDeclaration(SBDeclaration rhs) { - this(lldbJNI.new_SBDeclaration__SWIG_1(SBDeclaration.getCPtr(rhs), rhs), true); - } - - public boolean IsValid() { - return lldbJNI.SBDeclaration_IsValid(swigCPtr, this); - } - - public SBFileSpec GetFileSpec() { - return new SBFileSpec(lldbJNI.SBDeclaration_GetFileSpec(swigCPtr, this), true); - } - - public long GetLine() { - return lldbJNI.SBDeclaration_GetLine(swigCPtr, this); - } - - public long GetColumn() { - return lldbJNI.SBDeclaration_GetColumn(swigCPtr, this); - } - - public void SetFileSpec(SBFileSpec filespec) { - lldbJNI.SBDeclaration_SetFileSpec(swigCPtr, this, SBFileSpec.getCPtr(filespec), filespec); - } - - public void SetLine(long line) { - lldbJNI.SBDeclaration_SetLine(swigCPtr, this, line); - } - - public void SetColumn(long column) { - lldbJNI.SBDeclaration_SetColumn(swigCPtr, this, column); - } - - public boolean GetDescription(SBStream description) { - return lldbJNI.SBDeclaration_GetDescription(swigCPtr, this, SBStream.getCPtr(description), description); - } - - public String __repr__() { - return lldbJNI.SBDeclaration___repr__(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBEnvironment.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBEnvironment.java deleted file mode 100644 index fb373059e1..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBEnvironment.java +++ /dev/null @@ -1,102 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBEnvironment { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBEnvironment(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBEnvironment obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBEnvironment obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBEnvironment(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBEnvironment() { - this(lldbJNI.new_SBEnvironment__SWIG_0(), true); - } - - public SBEnvironment(SBEnvironment rhs) { - this(lldbJNI.new_SBEnvironment__SWIG_1(SBEnvironment.getCPtr(rhs), rhs), true); - } - - public String Get(String name) { - return lldbJNI.SBEnvironment_Get(swigCPtr, this, name); - } - - public long GetNumValues() { - return lldbJNI.SBEnvironment_GetNumValues(swigCPtr, this); - } - - public String GetNameAtIndex(long index) { - return lldbJNI.SBEnvironment_GetNameAtIndex(swigCPtr, this, index); - } - - public String GetValueAtIndex(long index) { - return lldbJNI.SBEnvironment_GetValueAtIndex(swigCPtr, this, index); - } - - public SBStringList GetEntries() { - return new SBStringList(lldbJNI.SBEnvironment_GetEntries(swigCPtr, this), true); - } - - public void PutEntry(String name_and_value) { - lldbJNI.SBEnvironment_PutEntry(swigCPtr, this, name_and_value); - } - - public void SetEntries(SBStringList entries, boolean append) { - lldbJNI.SBEnvironment_SetEntries(swigCPtr, this, SBStringList.getCPtr(entries), entries, append); - } - - public boolean Set(String name, String value, boolean overwrite) { - return lldbJNI.SBEnvironment_Set(swigCPtr, this, name, value, overwrite); - } - - public boolean Unset(String name) { - return lldbJNI.SBEnvironment_Unset(swigCPtr, this, name); - } - - public void Clear() { - lldbJNI.SBEnvironment_Clear(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBError.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBError.java deleted file mode 100644 index ce6dbb555d..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBError.java +++ /dev/null @@ -1,134 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBError { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBError(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBError obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBError obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBError(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBError() { - this(lldbJNI.new_SBError__SWIG_0(), true); - } - - public SBError(SBError rhs) { - this(lldbJNI.new_SBError__SWIG_1(SBError.getCPtr(rhs), rhs), true); - } - - public SBError(String message) { - this(lldbJNI.new_SBError__SWIG_2(message), true); - } - - public String GetCString() { - return lldbJNI.SBError_GetCString(swigCPtr, this); - } - - public void Clear() { - lldbJNI.SBError_Clear(swigCPtr, this); - } - - public boolean Fail() { - return lldbJNI.SBError_Fail(swigCPtr, this); - } - - public boolean Success() { - return lldbJNI.SBError_Success(swigCPtr, this); - } - - public long GetError() { - return lldbJNI.SBError_GetError(swigCPtr, this); - } - - public ErrorType GetType() { - return ErrorType.swigToEnum(lldbJNI.SBError_GetType(swigCPtr, this)); - } - - public void SetError(long err, ErrorType type) { - lldbJNI.SBError_SetError(swigCPtr, this, err, type.swigValue()); - } - - public void SetErrorToErrno() { - lldbJNI.SBError_SetErrorToErrno(swigCPtr, this); - } - - public void SetErrorToGenericError() { - lldbJNI.SBError_SetErrorToGenericError(swigCPtr, this); - } - - public void SetErrorString(String err_str) { - lldbJNI.SBError_SetErrorString(swigCPtr, this, err_str); - } - - public int SetErrorStringWithFormat(String format, String str1, String str2, String str3) { - return lldbJNI.SBError_SetErrorStringWithFormat__SWIG_0(swigCPtr, this, format, str1, str2, str3); - } - - public int SetErrorStringWithFormat(String format, String str1, String str2) { - return lldbJNI.SBError_SetErrorStringWithFormat__SWIG_1(swigCPtr, this, format, str1, str2); - } - - public int SetErrorStringWithFormat(String format, String str1) { - return lldbJNI.SBError_SetErrorStringWithFormat__SWIG_2(swigCPtr, this, format, str1); - } - - public int SetErrorStringWithFormat(String format) { - return lldbJNI.SBError_SetErrorStringWithFormat__SWIG_3(swigCPtr, this, format); - } - - public boolean IsValid() { - return lldbJNI.SBError_IsValid(swigCPtr, this); - } - - public boolean GetDescription(SBStream description) { - return lldbJNI.SBError_GetDescription(swigCPtr, this, SBStream.getCPtr(description), description); - } - - public String __repr__() { - return lldbJNI.SBError___repr__(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBEvent.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBEvent.java deleted file mode 100644 index 13c338b680..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBEvent.java +++ /dev/null @@ -1,102 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBEvent { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBEvent(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBEvent obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBEvent obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBEvent(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBEvent() { - this(lldbJNI.new_SBEvent__SWIG_0(), true); - } - - public SBEvent(SBEvent rhs) { - this(lldbJNI.new_SBEvent__SWIG_1(SBEvent.getCPtr(rhs), rhs), true); - } - - public SBEvent(long event, String cstr, long cstr_len) { - this(lldbJNI.new_SBEvent__SWIG_2(event, cstr, cstr_len), true); - } - - public boolean IsValid() { - return lldbJNI.SBEvent_IsValid(swigCPtr, this); - } - - public String GetDataFlavor() { - return lldbJNI.SBEvent_GetDataFlavor(swigCPtr, this); - } - - public long GetType() { - return lldbJNI.SBEvent_GetType(swigCPtr, this); - } - - public SBBroadcaster GetBroadcaster() { - return new SBBroadcaster(lldbJNI.SBEvent_GetBroadcaster(swigCPtr, this), true); - } - - public String GetBroadcasterClass() { - return lldbJNI.SBEvent_GetBroadcasterClass(swigCPtr, this); - } - - public boolean BroadcasterMatchesRef(SBBroadcaster broadcaster) { - return lldbJNI.SBEvent_BroadcasterMatchesRef(swigCPtr, this, SBBroadcaster.getCPtr(broadcaster), broadcaster); - } - - public void Clear() { - lldbJNI.SBEvent_Clear(swigCPtr, this); - } - - public static String GetCStringFromEvent(SBEvent event) { - return lldbJNI.SBEvent_GetCStringFromEvent(SBEvent.getCPtr(event), event); - } - - public boolean GetDescription(SBStream description) { - return lldbJNI.SBEvent_GetDescription__SWIG_0(swigCPtr, this, SBStream.getCPtr(description), description); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBExecutionContext.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBExecutionContext.java deleted file mode 100644 index 5478181666..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBExecutionContext.java +++ /dev/null @@ -1,94 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBExecutionContext { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBExecutionContext(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBExecutionContext obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBExecutionContext obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBExecutionContext(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBExecutionContext() { - this(lldbJNI.new_SBExecutionContext__SWIG_0(), true); - } - - public SBExecutionContext(SBExecutionContext rhs) { - this(lldbJNI.new_SBExecutionContext__SWIG_1(SBExecutionContext.getCPtr(rhs), rhs), true); - } - - public SBExecutionContext(SBTarget target) { - this(lldbJNI.new_SBExecutionContext__SWIG_2(SBTarget.getCPtr(target), target), true); - } - - public SBExecutionContext(SBProcess process) { - this(lldbJNI.new_SBExecutionContext__SWIG_3(SBProcess.getCPtr(process), process), true); - } - - public SBExecutionContext(SBThread thread) { - this(lldbJNI.new_SBExecutionContext__SWIG_4(SBThread.getCPtr(thread), thread), true); - } - - public SBExecutionContext(SBFrame frame) { - this(lldbJNI.new_SBExecutionContext__SWIG_5(SBFrame.getCPtr(frame), frame), true); - } - - public SBTarget GetTarget() { - return new SBTarget(lldbJNI.SBExecutionContext_GetTarget(swigCPtr, this), true); - } - - public SBProcess GetProcess() { - return new SBProcess(lldbJNI.SBExecutionContext_GetProcess(swigCPtr, this), true); - } - - public SBThread GetThread() { - return new SBThread(lldbJNI.SBExecutionContext_GetThread(swigCPtr, this), true); - } - - public SBFrame GetFrame() { - return new SBFrame(lldbJNI.SBExecutionContext_GetFrame(swigCPtr, this), true); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBExpressionOptions.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBExpressionOptions.java deleted file mode 100644 index 9883af3e3f..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBExpressionOptions.java +++ /dev/null @@ -1,246 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBExpressionOptions { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBExpressionOptions(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBExpressionOptions obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBExpressionOptions obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBExpressionOptions(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBExpressionOptions() { - this(lldbJNI.new_SBExpressionOptions__SWIG_0(), true); - } - - public SBExpressionOptions(SBExpressionOptions rhs) { - this(lldbJNI.new_SBExpressionOptions__SWIG_1(SBExpressionOptions.getCPtr(rhs), rhs), true); - } - - public boolean GetCoerceResultToId() { - return lldbJNI.SBExpressionOptions_GetCoerceResultToId(swigCPtr, this); - } - - public void SetCoerceResultToId(boolean coerce) { - lldbJNI.SBExpressionOptions_SetCoerceResultToId__SWIG_0(swigCPtr, this, coerce); - } - - public void SetCoerceResultToId() { - lldbJNI.SBExpressionOptions_SetCoerceResultToId__SWIG_1(swigCPtr, this); - } - - public boolean GetUnwindOnError() { - return lldbJNI.SBExpressionOptions_GetUnwindOnError(swigCPtr, this); - } - - public void SetUnwindOnError(boolean unwind) { - lldbJNI.SBExpressionOptions_SetUnwindOnError__SWIG_0(swigCPtr, this, unwind); - } - - public void SetUnwindOnError() { - lldbJNI.SBExpressionOptions_SetUnwindOnError__SWIG_1(swigCPtr, this); - } - - public boolean GetIgnoreBreakpoints() { - return lldbJNI.SBExpressionOptions_GetIgnoreBreakpoints(swigCPtr, this); - } - - public void SetIgnoreBreakpoints(boolean ignore) { - lldbJNI.SBExpressionOptions_SetIgnoreBreakpoints__SWIG_0(swigCPtr, this, ignore); - } - - public void SetIgnoreBreakpoints() { - lldbJNI.SBExpressionOptions_SetIgnoreBreakpoints__SWIG_1(swigCPtr, this); - } - - public DynamicValueType GetFetchDynamicValue() { - return DynamicValueType.swigToEnum(lldbJNI.SBExpressionOptions_GetFetchDynamicValue(swigCPtr, this)); - } - - public void SetFetchDynamicValue(DynamicValueType dynamic) { - lldbJNI.SBExpressionOptions_SetFetchDynamicValue__SWIG_0(swigCPtr, this, dynamic.swigValue()); - } - - public void SetFetchDynamicValue() { - lldbJNI.SBExpressionOptions_SetFetchDynamicValue__SWIG_1(swigCPtr, this); - } - - public long GetTimeoutInMicroSeconds() { - return lldbJNI.SBExpressionOptions_GetTimeoutInMicroSeconds(swigCPtr, this); - } - - public void SetTimeoutInMicroSeconds(long timeout) { - lldbJNI.SBExpressionOptions_SetTimeoutInMicroSeconds__SWIG_0(swigCPtr, this, timeout); - } - - public void SetTimeoutInMicroSeconds() { - lldbJNI.SBExpressionOptions_SetTimeoutInMicroSeconds__SWIG_1(swigCPtr, this); - } - - public long GetOneThreadTimeoutInMicroSeconds() { - return lldbJNI.SBExpressionOptions_GetOneThreadTimeoutInMicroSeconds(swigCPtr, this); - } - - public void SetOneThreadTimeoutInMicroSeconds(long timeout) { - lldbJNI.SBExpressionOptions_SetOneThreadTimeoutInMicroSeconds__SWIG_0(swigCPtr, this, timeout); - } - - public void SetOneThreadTimeoutInMicroSeconds() { - lldbJNI.SBExpressionOptions_SetOneThreadTimeoutInMicroSeconds__SWIG_1(swigCPtr, this); - } - - public boolean GetTryAllThreads() { - return lldbJNI.SBExpressionOptions_GetTryAllThreads(swigCPtr, this); - } - - public void SetTryAllThreads(boolean run_others) { - lldbJNI.SBExpressionOptions_SetTryAllThreads__SWIG_0(swigCPtr, this, run_others); - } - - public void SetTryAllThreads() { - lldbJNI.SBExpressionOptions_SetTryAllThreads__SWIG_1(swigCPtr, this); - } - - public boolean GetStopOthers() { - return lldbJNI.SBExpressionOptions_GetStopOthers(swigCPtr, this); - } - - public void SetStopOthers(boolean stop_others) { - lldbJNI.SBExpressionOptions_SetStopOthers__SWIG_0(swigCPtr, this, stop_others); - } - - public void SetStopOthers() { - lldbJNI.SBExpressionOptions_SetStopOthers__SWIG_1(swigCPtr, this); - } - - public boolean GetTrapExceptions() { - return lldbJNI.SBExpressionOptions_GetTrapExceptions(swigCPtr, this); - } - - public void SetTrapExceptions(boolean trap_exceptions) { - lldbJNI.SBExpressionOptions_SetTrapExceptions__SWIG_0(swigCPtr, this, trap_exceptions); - } - - public void SetTrapExceptions() { - lldbJNI.SBExpressionOptions_SetTrapExceptions__SWIG_1(swigCPtr, this); - } - - public void SetLanguage(LanguageType language) { - lldbJNI.SBExpressionOptions_SetLanguage(swigCPtr, this, language.swigValue()); - } - - public boolean GetGenerateDebugInfo() { - return lldbJNI.SBExpressionOptions_GetGenerateDebugInfo(swigCPtr, this); - } - - public void SetGenerateDebugInfo(boolean b) { - lldbJNI.SBExpressionOptions_SetGenerateDebugInfo__SWIG_0(swigCPtr, this, b); - } - - public void SetGenerateDebugInfo() { - lldbJNI.SBExpressionOptions_SetGenerateDebugInfo__SWIG_1(swigCPtr, this); - } - - public boolean GetSuppressPersistentResult() { - return lldbJNI.SBExpressionOptions_GetSuppressPersistentResult(swigCPtr, this); - } - - public void SetSuppressPersistentResult(boolean b) { - lldbJNI.SBExpressionOptions_SetSuppressPersistentResult__SWIG_0(swigCPtr, this, b); - } - - public void SetSuppressPersistentResult() { - lldbJNI.SBExpressionOptions_SetSuppressPersistentResult__SWIG_1(swigCPtr, this); - } - - public String GetPrefix() { - return lldbJNI.SBExpressionOptions_GetPrefix(swigCPtr, this); - } - - public void SetPrefix(String prefix) { - lldbJNI.SBExpressionOptions_SetPrefix(swigCPtr, this, prefix); - } - - public void SetAutoApplyFixIts(boolean b) { - lldbJNI.SBExpressionOptions_SetAutoApplyFixIts__SWIG_0(swigCPtr, this, b); - } - - public void SetAutoApplyFixIts() { - lldbJNI.SBExpressionOptions_SetAutoApplyFixIts__SWIG_1(swigCPtr, this); - } - - public boolean GetAutoApplyFixIts() { - return lldbJNI.SBExpressionOptions_GetAutoApplyFixIts(swigCPtr, this); - } - - public void SetRetriesWithFixIts(java.math.BigInteger retries) { - lldbJNI.SBExpressionOptions_SetRetriesWithFixIts(swigCPtr, this, retries); - } - - public java.math.BigInteger GetRetriesWithFixIts() { - return lldbJNI.SBExpressionOptions_GetRetriesWithFixIts(swigCPtr, this); - } - - public boolean GetTopLevel() { - return lldbJNI.SBExpressionOptions_GetTopLevel(swigCPtr, this); - } - - public void SetTopLevel(boolean b) { - lldbJNI.SBExpressionOptions_SetTopLevel__SWIG_0(swigCPtr, this, b); - } - - public void SetTopLevel() { - lldbJNI.SBExpressionOptions_SetTopLevel__SWIG_1(swigCPtr, this); - } - - public boolean GetAllowJIT() { - return lldbJNI.SBExpressionOptions_GetAllowJIT(swigCPtr, this); - } - - public void SetAllowJIT(boolean allow) { - lldbJNI.SBExpressionOptions_SetAllowJIT(swigCPtr, this, allow); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBFile.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBFile.java deleted file mode 100644 index 9bda910bf7..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBFile.java +++ /dev/null @@ -1,102 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBFile { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBFile(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBFile obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBFile obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBFile(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBFile() { - this(lldbJNI.new_SBFile__SWIG_0(), true); - } - - public SBFile(SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t file_sp) { - this(lldbJNI.new_SBFile__SWIG_1(SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t.getCPtr(file_sp)), true); - } - - public SBFile(int fd, String mode, boolean transfer_ownership) { - this(lldbJNI.new_SBFile__SWIG_2(fd, mode, transfer_ownership), true); - } - - public SBError Read(SWIGTYPE_p_unsigned_char buf, long num_bytes, SWIGTYPE_p_size_t OUTPUT) { - return new SBError(lldbJNI.SBFile_Read(swigCPtr, this, SWIGTYPE_p_unsigned_char.getCPtr(buf), num_bytes, SWIGTYPE_p_size_t.getCPtr(OUTPUT)), true); - } - - public SBError Write(SWIGTYPE_p_unsigned_char buf, long num_bytes, SWIGTYPE_p_size_t OUTPUT) { - return new SBError(lldbJNI.SBFile_Write(swigCPtr, this, SWIGTYPE_p_unsigned_char.getCPtr(buf), num_bytes, SWIGTYPE_p_size_t.getCPtr(OUTPUT)), true); - } - - public SBError Flush() { - return new SBError(lldbJNI.SBFile_Flush(swigCPtr, this), true); - } - - public boolean IsValid() { - return lldbJNI.SBFile_IsValid(swigCPtr, this); - } - - public SBError Close() { - return new SBError(lldbJNI.SBFile_Close(swigCPtr, this), true); - } - - public SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t GetFile() { - return new SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t(lldbJNI.SBFile_GetFile(swigCPtr, this), true); - } - - public static SBFile MakeBorrowed(SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t BORROWED) { - return new SBFile(lldbJNI.SBFile_MakeBorrowed(SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t.getCPtr(BORROWED)), true); - } - - public static SBFile MakeForcingIOMethods(SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t FORCE_IO_METHODS) { - return new SBFile(lldbJNI.SBFile_MakeForcingIOMethods(SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t.getCPtr(FORCE_IO_METHODS)), true); - } - - public static SBFile MakeBorrowedForcingIOMethods(SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t BORROWED_FORCE_IO_METHODS) { - return new SBFile(lldbJNI.SBFile_MakeBorrowedForcingIOMethods(SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t.getCPtr(BORROWED_FORCE_IO_METHODS)), true); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBFileSpec.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBFileSpec.java deleted file mode 100644 index a3ec3ca567..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBFileSpec.java +++ /dev/null @@ -1,118 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBFileSpec { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBFileSpec(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBFileSpec obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBFileSpec obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBFileSpec(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBFileSpec() { - this(lldbJNI.new_SBFileSpec__SWIG_0(), true); - } - - public SBFileSpec(SBFileSpec rhs) { - this(lldbJNI.new_SBFileSpec__SWIG_1(SBFileSpec.getCPtr(rhs), rhs), true); - } - - public SBFileSpec(String path) { - this(lldbJNI.new_SBFileSpec__SWIG_2(path), true); - } - - public SBFileSpec(String path, boolean resolve) { - this(lldbJNI.new_SBFileSpec__SWIG_3(path, resolve), true); - } - - public boolean IsValid() { - return lldbJNI.SBFileSpec_IsValid(swigCPtr, this); - } - - public boolean Exists() { - return lldbJNI.SBFileSpec_Exists(swigCPtr, this); - } - - public boolean ResolveExecutableLocation() { - return lldbJNI.SBFileSpec_ResolveExecutableLocation(swigCPtr, this); - } - - public String GetFilename() { - return lldbJNI.SBFileSpec_GetFilename(swigCPtr, this); - } - - public String GetDirectory() { - return lldbJNI.SBFileSpec_GetDirectory(swigCPtr, this); - } - - public void SetFilename(String filename) { - lldbJNI.SBFileSpec_SetFilename(swigCPtr, this, filename); - } - - public void SetDirectory(String directory) { - lldbJNI.SBFileSpec_SetDirectory(swigCPtr, this, directory); - } - - public long GetPath(String dst_path, long dst_len) { - return lldbJNI.SBFileSpec_GetPath(swigCPtr, this, dst_path, dst_len); - } - - public static int ResolvePath(String src_path, String dst_path, long dst_len) { - return lldbJNI.SBFileSpec_ResolvePath(src_path, dst_path, dst_len); - } - - public boolean GetDescription(SBStream description) { - return lldbJNI.SBFileSpec_GetDescription(swigCPtr, this, SBStream.getCPtr(description), description); - } - - public void AppendPathComponent(String file_or_directory) { - lldbJNI.SBFileSpec_AppendPathComponent(swigCPtr, this, file_or_directory); - } - - public String __repr__() { - return lldbJNI.SBFileSpec___repr__(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBFileSpecList.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBFileSpecList.java deleted file mode 100644 index 9205af563b..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBFileSpecList.java +++ /dev/null @@ -1,90 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBFileSpecList { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBFileSpecList(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBFileSpecList obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBFileSpecList obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBFileSpecList(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBFileSpecList() { - this(lldbJNI.new_SBFileSpecList__SWIG_0(), true); - } - - public SBFileSpecList(SBFileSpecList rhs) { - this(lldbJNI.new_SBFileSpecList__SWIG_1(SBFileSpecList.getCPtr(rhs), rhs), true); - } - - public long GetSize() { - return lldbJNI.SBFileSpecList_GetSize(swigCPtr, this); - } - - public boolean GetDescription(SBStream description) { - return lldbJNI.SBFileSpecList_GetDescription(swigCPtr, this, SBStream.getCPtr(description), description); - } - - public void Append(SBFileSpec sb_file) { - lldbJNI.SBFileSpecList_Append(swigCPtr, this, SBFileSpec.getCPtr(sb_file), sb_file); - } - - public boolean AppendIfUnique(SBFileSpec sb_file) { - return lldbJNI.SBFileSpecList_AppendIfUnique(swigCPtr, this, SBFileSpec.getCPtr(sb_file), sb_file); - } - - public void Clear() { - lldbJNI.SBFileSpecList_Clear(swigCPtr, this); - } - - public long FindFileIndex(long idx, SBFileSpec sb_file, boolean full) { - return lldbJNI.SBFileSpecList_FindFileIndex(swigCPtr, this, idx, SBFileSpec.getCPtr(sb_file), sb_file, full); - } - - public SBFileSpec GetFileSpecAtIndex(long idx) { - return new SBFileSpec(lldbJNI.SBFileSpecList_GetFileSpecAtIndex(swigCPtr, this, idx), true); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBFrame.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBFrame.java deleted file mode 100644 index 426c8bfbf1..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBFrame.java +++ /dev/null @@ -1,230 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBFrame { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBFrame(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBFrame obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBFrame obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBFrame(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBFrame() { - this(lldbJNI.new_SBFrame__SWIG_0(), true); - } - - public SBFrame(SBFrame rhs) { - this(lldbJNI.new_SBFrame__SWIG_1(SBFrame.getCPtr(rhs), rhs), true); - } - - public boolean IsEqual(SBFrame that) { - return lldbJNI.SBFrame_IsEqual(swigCPtr, this, SBFrame.getCPtr(that), that); - } - - public boolean IsValid() { - return lldbJNI.SBFrame_IsValid(swigCPtr, this); - } - - public long GetFrameID() { - return lldbJNI.SBFrame_GetFrameID(swigCPtr, this); - } - - public java.math.BigInteger GetCFA() { - return lldbJNI.SBFrame_GetCFA(swigCPtr, this); - } - - public java.math.BigInteger GetPC() { - return lldbJNI.SBFrame_GetPC(swigCPtr, this); - } - - public boolean SetPC(java.math.BigInteger new_pc) { - return lldbJNI.SBFrame_SetPC(swigCPtr, this, new_pc); - } - - public java.math.BigInteger GetSP() { - return lldbJNI.SBFrame_GetSP(swigCPtr, this); - } - - public java.math.BigInteger GetFP() { - return lldbJNI.SBFrame_GetFP(swigCPtr, this); - } - - public SBAddress GetPCAddress() { - return new SBAddress(lldbJNI.SBFrame_GetPCAddress(swigCPtr, this), true); - } - - public SBSymbolContext GetSymbolContext(long resolve_scope) { - return new SBSymbolContext(lldbJNI.SBFrame_GetSymbolContext(swigCPtr, this, resolve_scope), true); - } - - public SBModule GetModule() { - return new SBModule(lldbJNI.SBFrame_GetModule(swigCPtr, this), true); - } - - public SBCompileUnit GetCompileUnit() { - return new SBCompileUnit(lldbJNI.SBFrame_GetCompileUnit(swigCPtr, this), true); - } - - public SBFunction GetFunction() { - return new SBFunction(lldbJNI.SBFrame_GetFunction(swigCPtr, this), true); - } - - public SBSymbol GetSymbol() { - return new SBSymbol(lldbJNI.SBFrame_GetSymbol(swigCPtr, this), true); - } - - public SBBlock GetBlock() { - return new SBBlock(lldbJNI.SBFrame_GetBlock(swigCPtr, this), true); - } - - public String GetFunctionName() { - return lldbJNI.SBFrame_GetFunctionName__SWIG_0(swigCPtr, this); - } - - public String GetDisplayFunctionName() { - return lldbJNI.SBFrame_GetDisplayFunctionName(swigCPtr, this); - } - - public LanguageType GuessLanguage() { - return LanguageType.swigToEnum(lldbJNI.SBFrame_GuessLanguage(swigCPtr, this)); - } - - public boolean IsInlined() { - return lldbJNI.SBFrame_IsInlined__SWIG_0(swigCPtr, this); - } - - public boolean IsArtificial() { - return lldbJNI.SBFrame_IsArtificial__SWIG_0(swigCPtr, this); - } - - public SBValue EvaluateExpression(String expr) { - return new SBValue(lldbJNI.SBFrame_EvaluateExpression__SWIG_0(swigCPtr, this, expr), true); - } - - public SBValue EvaluateExpression(String expr, DynamicValueType use_dynamic) { - return new SBValue(lldbJNI.SBFrame_EvaluateExpression__SWIG_1(swigCPtr, this, expr, use_dynamic.swigValue()), true); - } - - public SBValue EvaluateExpression(String expr, DynamicValueType use_dynamic, boolean unwind_on_error) { - return new SBValue(lldbJNI.SBFrame_EvaluateExpression__SWIG_2(swigCPtr, this, expr, use_dynamic.swigValue(), unwind_on_error), true); - } - - public SBValue EvaluateExpression(String expr, SBExpressionOptions options) { - return new SBValue(lldbJNI.SBFrame_EvaluateExpression__SWIG_3(swigCPtr, this, expr, SBExpressionOptions.getCPtr(options), options), true); - } - - public SBBlock GetFrameBlock() { - return new SBBlock(lldbJNI.SBFrame_GetFrameBlock(swigCPtr, this), true); - } - - public SBLineEntry GetLineEntry() { - return new SBLineEntry(lldbJNI.SBFrame_GetLineEntry(swigCPtr, this), true); - } - - public SBThread GetThread() { - return new SBThread(lldbJNI.SBFrame_GetThread(swigCPtr, this), true); - } - - public String Disassemble() { - return lldbJNI.SBFrame_Disassemble(swigCPtr, this); - } - - public void Clear() { - lldbJNI.SBFrame_Clear(swigCPtr, this); - } - - public SBValueList GetVariables(boolean arguments, boolean locals, boolean statics, boolean in_scope_only) { - return new SBValueList(lldbJNI.SBFrame_GetVariables__SWIG_0(swigCPtr, this, arguments, locals, statics, in_scope_only), true); - } - - public SBValueList GetVariables(boolean arguments, boolean locals, boolean statics, boolean in_scope_only, DynamicValueType use_dynamic) { - return new SBValueList(lldbJNI.SBFrame_GetVariables__SWIG_1(swigCPtr, this, arguments, locals, statics, in_scope_only, use_dynamic.swigValue()), true); - } - - public SBValueList GetVariables(SBVariablesOptions options) { - return new SBValueList(lldbJNI.SBFrame_GetVariables__SWIG_2(swigCPtr, this, SBVariablesOptions.getCPtr(options), options), true); - } - - public SBValueList GetRegisters() { - return new SBValueList(lldbJNI.SBFrame_GetRegisters(swigCPtr, this), true); - } - - public SBValue FindRegister(String name) { - return new SBValue(lldbJNI.SBFrame_FindRegister(swigCPtr, this, name), true); - } - - public SBValue FindVariable(String var_name) { - return new SBValue(lldbJNI.SBFrame_FindVariable__SWIG_0(swigCPtr, this, var_name), true); - } - - public SBValue FindVariable(String var_name, DynamicValueType use_dynamic) { - return new SBValue(lldbJNI.SBFrame_FindVariable__SWIG_1(swigCPtr, this, var_name, use_dynamic.swigValue()), true); - } - - public SBValue GetValueForVariablePath(String var_expr_cstr, DynamicValueType use_dynamic) { - return new SBValue(lldbJNI.SBFrame_GetValueForVariablePath__SWIG_0(swigCPtr, this, var_expr_cstr, use_dynamic.swigValue()), true); - } - - public SBValue GetValueForVariablePath(String var_path) { - return new SBValue(lldbJNI.SBFrame_GetValueForVariablePath__SWIG_1(swigCPtr, this, var_path), true); - } - - public SBValue FindValue(String name, ValueType value_type) { - return new SBValue(lldbJNI.SBFrame_FindValue__SWIG_0(swigCPtr, this, name, value_type.swigValue()), true); - } - - public SBValue FindValue(String name, ValueType value_type, DynamicValueType use_dynamic) { - return new SBValue(lldbJNI.SBFrame_FindValue__SWIG_1(swigCPtr, this, name, value_type.swigValue(), use_dynamic.swigValue()), true); - } - - public boolean GetDescription(SBStream description) { - return lldbJNI.SBFrame_GetDescription(swigCPtr, this, SBStream.getCPtr(description), description); - } - - public String __repr__() { - return lldbJNI.SBFrame___repr__(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBFunction.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBFunction.java deleted file mode 100644 index 0a559a6622..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBFunction.java +++ /dev/null @@ -1,126 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBFunction { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBFunction(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBFunction obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBFunction obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBFunction(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBFunction() { - this(lldbJNI.new_SBFunction__SWIG_0(), true); - } - - public SBFunction(SBFunction rhs) { - this(lldbJNI.new_SBFunction__SWIG_1(SBFunction.getCPtr(rhs), rhs), true); - } - - public boolean IsValid() { - return lldbJNI.SBFunction_IsValid(swigCPtr, this); - } - - public String GetName() { - return lldbJNI.SBFunction_GetName(swigCPtr, this); - } - - public String GetDisplayName() { - return lldbJNI.SBFunction_GetDisplayName(swigCPtr, this); - } - - public String GetMangledName() { - return lldbJNI.SBFunction_GetMangledName(swigCPtr, this); - } - - public SBInstructionList GetInstructions(SBTarget target) { - return new SBInstructionList(lldbJNI.SBFunction_GetInstructions__SWIG_0(swigCPtr, this, SBTarget.getCPtr(target), target), true); - } - - public SBInstructionList GetInstructions(SBTarget target, String flavor) { - return new SBInstructionList(lldbJNI.SBFunction_GetInstructions__SWIG_1(swigCPtr, this, SBTarget.getCPtr(target), target, flavor), true); - } - - public SBAddress GetStartAddress() { - return new SBAddress(lldbJNI.SBFunction_GetStartAddress(swigCPtr, this), true); - } - - public SBAddress GetEndAddress() { - return new SBAddress(lldbJNI.SBFunction_GetEndAddress(swigCPtr, this), true); - } - - public String GetArgumentName(long arg_idx) { - return lldbJNI.SBFunction_GetArgumentName(swigCPtr, this, arg_idx); - } - - public long GetPrologueByteSize() { - return lldbJNI.SBFunction_GetPrologueByteSize(swigCPtr, this); - } - - public SBType GetType() { - return new SBType(lldbJNI.SBFunction_GetType(swigCPtr, this), true); - } - - public SBBlock GetBlock() { - return new SBBlock(lldbJNI.SBFunction_GetBlock(swigCPtr, this), true); - } - - public LanguageType GetLanguage() { - return LanguageType.swigToEnum(lldbJNI.SBFunction_GetLanguage(swigCPtr, this)); - } - - public boolean GetIsOptimized() { - return lldbJNI.SBFunction_GetIsOptimized(swigCPtr, this); - } - - public boolean GetDescription(SBStream description) { - return lldbJNI.SBFunction_GetDescription(swigCPtr, this, SBStream.getCPtr(description), description); - } - - public String __repr__() { - return lldbJNI.SBFunction___repr__(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBHostOS.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBHostOS.java deleted file mode 100644 index a349f84337..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBHostOS.java +++ /dev/null @@ -1,94 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBHostOS { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBHostOS(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBHostOS obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBHostOS obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBHostOS(swigCPtr); - } - swigCPtr = 0; - } - } - - public static SBFileSpec GetProgramFileSpec() { - return new SBFileSpec(lldbJNI.SBHostOS_GetProgramFileSpec(), true); - } - - public static SBFileSpec GetLLDBPythonPath() { - return new SBFileSpec(lldbJNI.SBHostOS_GetLLDBPythonPath(), true); - } - - public static SBFileSpec GetLLDBPath(PathType path_type) { - return new SBFileSpec(lldbJNI.SBHostOS_GetLLDBPath(path_type.swigValue()), true); - } - - public static SBFileSpec GetUserHomeDirectory() { - return new SBFileSpec(lldbJNI.SBHostOS_GetUserHomeDirectory(), true); - } - - public static void ThreadCreated(String name) { - lldbJNI.SBHostOS_ThreadCreated(name); - } - - public static SWIGTYPE_p_pthread_t ThreadCreate(String name, SWIGTYPE_p_f_p_void__p_void thread_function, SWIGTYPE_p_void thread_arg, SBError err) { - return new SWIGTYPE_p_pthread_t(lldbJNI.SBHostOS_ThreadCreate(name, SWIGTYPE_p_f_p_void__p_void.getCPtr(thread_function), SWIGTYPE_p_void.getCPtr(thread_arg), SBError.getCPtr(err), err), true); - } - - public static boolean ThreadCancel(SWIGTYPE_p_pthread_t thread, SBError err) { - return lldbJNI.SBHostOS_ThreadCancel(SWIGTYPE_p_pthread_t.getCPtr(thread), SBError.getCPtr(err), err); - } - - public static boolean ThreadDetach(SWIGTYPE_p_pthread_t thread, SBError err) { - return lldbJNI.SBHostOS_ThreadDetach(SWIGTYPE_p_pthread_t.getCPtr(thread), SBError.getCPtr(err), err); - } - - public static boolean ThreadJoin(SWIGTYPE_p_pthread_t thread, SWIGTYPE_p_p_void result, SBError err) { - return lldbJNI.SBHostOS_ThreadJoin(SWIGTYPE_p_pthread_t.getCPtr(thread), SWIGTYPE_p_p_void.getCPtr(result), SBError.getCPtr(err), err); - } - - public SBHostOS() { - this(lldbJNI.new_SBHostOS(), true); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBInstruction.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBInstruction.java deleted file mode 100644 index 9a9dd2ab78..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBInstruction.java +++ /dev/null @@ -1,134 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBInstruction { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBInstruction(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBInstruction obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBInstruction obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBInstruction(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBInstruction() { - this(lldbJNI.new_SBInstruction__SWIG_0(), true); - } - - public SBInstruction(SBInstruction rhs) { - this(lldbJNI.new_SBInstruction__SWIG_1(SBInstruction.getCPtr(rhs), rhs), true); - } - - public boolean IsValid() { - return lldbJNI.SBInstruction_IsValid(swigCPtr, this); - } - - public SBAddress GetAddress() { - return new SBAddress(lldbJNI.SBInstruction_GetAddress(swigCPtr, this), true); - } - - public String GetMnemonic(SBTarget target) { - return lldbJNI.SBInstruction_GetMnemonic(swigCPtr, this, SBTarget.getCPtr(target), target); - } - - public String GetOperands(SBTarget target) { - return lldbJNI.SBInstruction_GetOperands(swigCPtr, this, SBTarget.getCPtr(target), target); - } - - public String GetComment(SBTarget target) { - return lldbJNI.SBInstruction_GetComment(swigCPtr, this, SBTarget.getCPtr(target), target); - } - - public InstructionControlFlowKind GetControlFlowKind(SBTarget target) { - return InstructionControlFlowKind.swigToEnum(lldbJNI.SBInstruction_GetControlFlowKind(swigCPtr, this, SBTarget.getCPtr(target), target)); - } - - public SBData GetData(SBTarget target) { - return new SBData(lldbJNI.SBInstruction_GetData(swigCPtr, this, SBTarget.getCPtr(target), target), true); - } - - public long GetByteSize() { - return lldbJNI.SBInstruction_GetByteSize(swigCPtr, this); - } - - public boolean DoesBranch() { - return lldbJNI.SBInstruction_DoesBranch(swigCPtr, this); - } - - public boolean HasDelaySlot() { - return lldbJNI.SBInstruction_HasDelaySlot(swigCPtr, this); - } - - public boolean CanSetBreakpoint() { - return lldbJNI.SBInstruction_CanSetBreakpoint(swigCPtr, this); - } - - public void Print(SBFile out) { - lldbJNI.SBInstruction_Print__SWIG_0(swigCPtr, this, SBFile.getCPtr(out), out); - } - - public void Print(SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t BORROWED) { - lldbJNI.SBInstruction_Print__SWIG_1(swigCPtr, this, SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t.getCPtr(BORROWED)); - } - - public boolean GetDescription(SBStream description) { - return lldbJNI.SBInstruction_GetDescription(swigCPtr, this, SBStream.getCPtr(description), description); - } - - public boolean EmulateWithFrame(SBFrame frame, long evaluate_options) { - return lldbJNI.SBInstruction_EmulateWithFrame(swigCPtr, this, SBFrame.getCPtr(frame), frame, evaluate_options); - } - - public boolean DumpEmulation(String triple) { - return lldbJNI.SBInstruction_DumpEmulation(swigCPtr, this, triple); - } - - public boolean TestEmulation(SBStream output_stream, String test_file) { - return lldbJNI.SBInstruction_TestEmulation(swigCPtr, this, SBStream.getCPtr(output_stream), output_stream, test_file); - } - - public String __repr__() { - return lldbJNI.SBInstruction___repr__(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBInstructionList.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBInstructionList.java deleted file mode 100644 index a9efd8e563..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBInstructionList.java +++ /dev/null @@ -1,110 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBInstructionList { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBInstructionList(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBInstructionList obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBInstructionList obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBInstructionList(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBInstructionList() { - this(lldbJNI.new_SBInstructionList__SWIG_0(), true); - } - - public SBInstructionList(SBInstructionList rhs) { - this(lldbJNI.new_SBInstructionList__SWIG_1(SBInstructionList.getCPtr(rhs), rhs), true); - } - - public boolean IsValid() { - return lldbJNI.SBInstructionList_IsValid(swigCPtr, this); - } - - public long GetSize() { - return lldbJNI.SBInstructionList_GetSize(swigCPtr, this); - } - - public SBInstruction GetInstructionAtIndex(long idx) { - return new SBInstruction(lldbJNI.SBInstructionList_GetInstructionAtIndex(swigCPtr, this, idx), true); - } - - public long GetInstructionsCount(SBAddress start, SBAddress end, boolean canSetBreakpoint) { - return lldbJNI.SBInstructionList_GetInstructionsCount__SWIG_0(swigCPtr, this, SBAddress.getCPtr(start), start, SBAddress.getCPtr(end), end, canSetBreakpoint); - } - - public long GetInstructionsCount(SBAddress start, SBAddress end) { - return lldbJNI.SBInstructionList_GetInstructionsCount__SWIG_1(swigCPtr, this, SBAddress.getCPtr(start), start, SBAddress.getCPtr(end), end); - } - - public void Clear() { - lldbJNI.SBInstructionList_Clear(swigCPtr, this); - } - - public void AppendInstruction(SBInstruction inst) { - lldbJNI.SBInstructionList_AppendInstruction(swigCPtr, this, SBInstruction.getCPtr(inst), inst); - } - - public void Print(SBFile out) { - lldbJNI.SBInstructionList_Print__SWIG_0(swigCPtr, this, SBFile.getCPtr(out), out); - } - - public void Print(SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t BORROWED) { - lldbJNI.SBInstructionList_Print__SWIG_1(swigCPtr, this, SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t.getCPtr(BORROWED)); - } - - public boolean GetDescription(SBStream description) { - return lldbJNI.SBInstructionList_GetDescription(swigCPtr, this, SBStream.getCPtr(description), description); - } - - public boolean DumpEmulationForAllInstructions(String triple) { - return lldbJNI.SBInstructionList_DumpEmulationForAllInstructions(swigCPtr, this, triple); - } - - public String __repr__() { - return lldbJNI.SBInstructionList___repr__(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBLanguageRuntime.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBLanguageRuntime.java deleted file mode 100644 index b678635d4a..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBLanguageRuntime.java +++ /dev/null @@ -1,66 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBLanguageRuntime { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBLanguageRuntime(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBLanguageRuntime obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBLanguageRuntime obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBLanguageRuntime(swigCPtr); - } - swigCPtr = 0; - } - } - - public static LanguageType GetLanguageTypeFromString(String string) { - return LanguageType.swigToEnum(lldbJNI.SBLanguageRuntime_GetLanguageTypeFromString(string)); - } - - public static String GetNameForLanguageType(LanguageType language) { - return lldbJNI.SBLanguageRuntime_GetNameForLanguageType(language.swigValue()); - } - - public SBLanguageRuntime() { - this(lldbJNI.new_SBLanguageRuntime(), true); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBLaunchInfo.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBLaunchInfo.java deleted file mode 100644 index b513930710..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBLaunchInfo.java +++ /dev/null @@ -1,242 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBLaunchInfo { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBLaunchInfo(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBLaunchInfo obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBLaunchInfo obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBLaunchInfo(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBLaunchInfo(String[] argv) { - this(lldbJNI.new_SBLaunchInfo(argv), true); - } - - public java.math.BigInteger GetProcessID() { - return lldbJNI.SBLaunchInfo_GetProcessID(swigCPtr, this); - } - - public long GetUserID() { - return lldbJNI.SBLaunchInfo_GetUserID(swigCPtr, this); - } - - public long GetGroupID() { - return lldbJNI.SBLaunchInfo_GetGroupID(swigCPtr, this); - } - - public boolean UserIDIsValid() { - return lldbJNI.SBLaunchInfo_UserIDIsValid(swigCPtr, this); - } - - public boolean GroupIDIsValid() { - return lldbJNI.SBLaunchInfo_GroupIDIsValid(swigCPtr, this); - } - - public void SetUserID(long uid) { - lldbJNI.SBLaunchInfo_SetUserID(swigCPtr, this, uid); - } - - public void SetGroupID(long gid) { - lldbJNI.SBLaunchInfo_SetGroupID(swigCPtr, this, gid); - } - - public SBFileSpec GetExecutableFile() { - return new SBFileSpec(lldbJNI.SBLaunchInfo_GetExecutableFile(swigCPtr, this), true); - } - - public void SetExecutableFile(SBFileSpec exe_file, boolean add_as_first_arg) { - lldbJNI.SBLaunchInfo_SetExecutableFile(swigCPtr, this, SBFileSpec.getCPtr(exe_file), exe_file, add_as_first_arg); - } - - public SBListener GetListener() { - return new SBListener(lldbJNI.SBLaunchInfo_GetListener(swigCPtr, this), true); - } - - public void SetListener(SBListener listener) { - lldbJNI.SBLaunchInfo_SetListener(swigCPtr, this, SBListener.getCPtr(listener), listener); - } - - public SBListener GetShadowListener() { - return new SBListener(lldbJNI.SBLaunchInfo_GetShadowListener(swigCPtr, this), true); - } - - public void SetShadowListener(SBListener listener) { - lldbJNI.SBLaunchInfo_SetShadowListener(swigCPtr, this, SBListener.getCPtr(listener), listener); - } - - public long GetNumArguments() { - return lldbJNI.SBLaunchInfo_GetNumArguments(swigCPtr, this); - } - - public String GetArgumentAtIndex(long idx) { - return lldbJNI.SBLaunchInfo_GetArgumentAtIndex(swigCPtr, this, idx); - } - - public void SetArguments(String[] argv, boolean append) { - lldbJNI.SBLaunchInfo_SetArguments(swigCPtr, this, argv, append); - } - - public long GetNumEnvironmentEntries() { - return lldbJNI.SBLaunchInfo_GetNumEnvironmentEntries(swigCPtr, this); - } - - public String GetEnvironmentEntryAtIndex(long idx) { - return lldbJNI.SBLaunchInfo_GetEnvironmentEntryAtIndex(swigCPtr, this, idx); - } - - public void SetEnvironmentEntries(String[] envp, boolean append) { - lldbJNI.SBLaunchInfo_SetEnvironmentEntries(swigCPtr, this, envp, append); - } - - public void SetEnvironment(SBEnvironment env, boolean append) { - lldbJNI.SBLaunchInfo_SetEnvironment(swigCPtr, this, SBEnvironment.getCPtr(env), env, append); - } - - public SBEnvironment GetEnvironment() { - return new SBEnvironment(lldbJNI.SBLaunchInfo_GetEnvironment(swigCPtr, this), true); - } - - public void Clear() { - lldbJNI.SBLaunchInfo_Clear(swigCPtr, this); - } - - public String GetWorkingDirectory() { - return lldbJNI.SBLaunchInfo_GetWorkingDirectory(swigCPtr, this); - } - - public void SetWorkingDirectory(String working_dir) { - lldbJNI.SBLaunchInfo_SetWorkingDirectory(swigCPtr, this, working_dir); - } - - public long GetLaunchFlags() { - return lldbJNI.SBLaunchInfo_GetLaunchFlags(swigCPtr, this); - } - - public void SetLaunchFlags(long flags) { - lldbJNI.SBLaunchInfo_SetLaunchFlags(swigCPtr, this, flags); - } - - public String GetProcessPluginName() { - return lldbJNI.SBLaunchInfo_GetProcessPluginName(swigCPtr, this); - } - - public void SetProcessPluginName(String plugin_name) { - lldbJNI.SBLaunchInfo_SetProcessPluginName(swigCPtr, this, plugin_name); - } - - public String GetShell() { - return lldbJNI.SBLaunchInfo_GetShell(swigCPtr, this); - } - - public void SetShell(String path) { - lldbJNI.SBLaunchInfo_SetShell(swigCPtr, this, path); - } - - public boolean GetShellExpandArguments() { - return lldbJNI.SBLaunchInfo_GetShellExpandArguments(swigCPtr, this); - } - - public void SetShellExpandArguments(boolean expand) { - lldbJNI.SBLaunchInfo_SetShellExpandArguments(swigCPtr, this, expand); - } - - public long GetResumeCount() { - return lldbJNI.SBLaunchInfo_GetResumeCount(swigCPtr, this); - } - - public void SetResumeCount(long c) { - lldbJNI.SBLaunchInfo_SetResumeCount(swigCPtr, this, c); - } - - public boolean AddCloseFileAction(int fd) { - return lldbJNI.SBLaunchInfo_AddCloseFileAction(swigCPtr, this, fd); - } - - public boolean AddDuplicateFileAction(int fd, int dup_fd) { - return lldbJNI.SBLaunchInfo_AddDuplicateFileAction(swigCPtr, this, fd, dup_fd); - } - - public boolean AddOpenFileAction(int fd, String path, boolean read, boolean write) { - return lldbJNI.SBLaunchInfo_AddOpenFileAction(swigCPtr, this, fd, path, read, write); - } - - public boolean AddSuppressFileAction(int fd, boolean read, boolean write) { - return lldbJNI.SBLaunchInfo_AddSuppressFileAction(swigCPtr, this, fd, read, write); - } - - public void SetLaunchEventData(String data) { - lldbJNI.SBLaunchInfo_SetLaunchEventData(swigCPtr, this, data); - } - - public String GetLaunchEventData() { - return lldbJNI.SBLaunchInfo_GetLaunchEventData(swigCPtr, this); - } - - public boolean GetDetachOnError() { - return lldbJNI.SBLaunchInfo_GetDetachOnError(swigCPtr, this); - } - - public void SetDetachOnError(boolean enable) { - lldbJNI.SBLaunchInfo_SetDetachOnError(swigCPtr, this, enable); - } - - public String GetScriptedProcessClassName() { - return lldbJNI.SBLaunchInfo_GetScriptedProcessClassName(swigCPtr, this); - } - - public void SetScriptedProcessClassName(String class_name) { - lldbJNI.SBLaunchInfo_SetScriptedProcessClassName(swigCPtr, this, class_name); - } - - public SBStructuredData GetScriptedProcessDictionary() { - return new SBStructuredData(lldbJNI.SBLaunchInfo_GetScriptedProcessDictionary(swigCPtr, this), true); - } - - public void SetScriptedProcessDictionary(SBStructuredData dict) { - lldbJNI.SBLaunchInfo_SetScriptedProcessDictionary(swigCPtr, this, SBStructuredData.getCPtr(dict), dict); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBLineEntry.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBLineEntry.java deleted file mode 100644 index 12a31f4656..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBLineEntry.java +++ /dev/null @@ -1,106 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBLineEntry { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBLineEntry(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBLineEntry obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBLineEntry obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBLineEntry(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBLineEntry() { - this(lldbJNI.new_SBLineEntry__SWIG_0(), true); - } - - public SBLineEntry(SBLineEntry rhs) { - this(lldbJNI.new_SBLineEntry__SWIG_1(SBLineEntry.getCPtr(rhs), rhs), true); - } - - public SBAddress GetStartAddress() { - return new SBAddress(lldbJNI.SBLineEntry_GetStartAddress(swigCPtr, this), true); - } - - public SBAddress GetEndAddress() { - return new SBAddress(lldbJNI.SBLineEntry_GetEndAddress(swigCPtr, this), true); - } - - public boolean IsValid() { - return lldbJNI.SBLineEntry_IsValid(swigCPtr, this); - } - - public SBFileSpec GetFileSpec() { - return new SBFileSpec(lldbJNI.SBLineEntry_GetFileSpec(swigCPtr, this), true); - } - - public long GetLine() { - return lldbJNI.SBLineEntry_GetLine(swigCPtr, this); - } - - public long GetColumn() { - return lldbJNI.SBLineEntry_GetColumn(swigCPtr, this); - } - - public void SetFileSpec(SBFileSpec filespec) { - lldbJNI.SBLineEntry_SetFileSpec(swigCPtr, this, SBFileSpec.getCPtr(filespec), filespec); - } - - public void SetLine(long line) { - lldbJNI.SBLineEntry_SetLine(swigCPtr, this, line); - } - - public void SetColumn(long column) { - lldbJNI.SBLineEntry_SetColumn(swigCPtr, this, column); - } - - public boolean GetDescription(SBStream description) { - return lldbJNI.SBLineEntry_GetDescription(swigCPtr, this, SBStream.getCPtr(description), description); - } - - public String __repr__() { - return lldbJNI.SBLineEntry___repr__(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBListener.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBListener.java deleted file mode 100644 index d15dfc3149..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBListener.java +++ /dev/null @@ -1,134 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBListener { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBListener(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBListener obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBListener obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBListener(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBListener() { - this(lldbJNI.new_SBListener__SWIG_0(), true); - } - - public SBListener(String name) { - this(lldbJNI.new_SBListener__SWIG_1(name), true); - } - - public SBListener(SBListener rhs) { - this(lldbJNI.new_SBListener__SWIG_2(SBListener.getCPtr(rhs), rhs), true); - } - - public void AddEvent(SBEvent event) { - lldbJNI.SBListener_AddEvent(swigCPtr, this, SBEvent.getCPtr(event), event); - } - - public void Clear() { - lldbJNI.SBListener_Clear(swigCPtr, this); - } - - public boolean IsValid() { - return lldbJNI.SBListener_IsValid(swigCPtr, this); - } - - public long StartListeningForEventClass(SBDebugger debugger, String broadcaster_class, long event_mask) { - return lldbJNI.SBListener_StartListeningForEventClass(swigCPtr, this, SBDebugger.getCPtr(debugger), debugger, broadcaster_class, event_mask); - } - - public boolean StopListeningForEventClass(SBDebugger debugger, String broadcaster_class, long event_mask) { - return lldbJNI.SBListener_StopListeningForEventClass(swigCPtr, this, SBDebugger.getCPtr(debugger), debugger, broadcaster_class, event_mask); - } - - public long StartListeningForEvents(SBBroadcaster broadcaster, long event_mask) { - return lldbJNI.SBListener_StartListeningForEvents(swigCPtr, this, SBBroadcaster.getCPtr(broadcaster), broadcaster, event_mask); - } - - public boolean StopListeningForEvents(SBBroadcaster broadcaster, long event_mask) { - return lldbJNI.SBListener_StopListeningForEvents(swigCPtr, this, SBBroadcaster.getCPtr(broadcaster), broadcaster, event_mask); - } - - public boolean WaitForEvent(long num_seconds, SBEvent event) { - return lldbJNI.SBListener_WaitForEvent(swigCPtr, this, num_seconds, SBEvent.getCPtr(event), event); - } - - public boolean WaitForEventForBroadcaster(long num_seconds, SBBroadcaster broadcaster, SBEvent sb_event) { - return lldbJNI.SBListener_WaitForEventForBroadcaster(swigCPtr, this, num_seconds, SBBroadcaster.getCPtr(broadcaster), broadcaster, SBEvent.getCPtr(sb_event), sb_event); - } - - public boolean WaitForEventForBroadcasterWithType(long num_seconds, SBBroadcaster broadcaster, long event_type_mask, SBEvent sb_event) { - return lldbJNI.SBListener_WaitForEventForBroadcasterWithType(swigCPtr, this, num_seconds, SBBroadcaster.getCPtr(broadcaster), broadcaster, event_type_mask, SBEvent.getCPtr(sb_event), sb_event); - } - - public boolean PeekAtNextEvent(SBEvent sb_event) { - return lldbJNI.SBListener_PeekAtNextEvent(swigCPtr, this, SBEvent.getCPtr(sb_event), sb_event); - } - - public boolean PeekAtNextEventForBroadcaster(SBBroadcaster broadcaster, SBEvent sb_event) { - return lldbJNI.SBListener_PeekAtNextEventForBroadcaster(swigCPtr, this, SBBroadcaster.getCPtr(broadcaster), broadcaster, SBEvent.getCPtr(sb_event), sb_event); - } - - public boolean PeekAtNextEventForBroadcasterWithType(SBBroadcaster broadcaster, long event_type_mask, SBEvent sb_event) { - return lldbJNI.SBListener_PeekAtNextEventForBroadcasterWithType(swigCPtr, this, SBBroadcaster.getCPtr(broadcaster), broadcaster, event_type_mask, SBEvent.getCPtr(sb_event), sb_event); - } - - public boolean GetNextEvent(SBEvent sb_event) { - return lldbJNI.SBListener_GetNextEvent(swigCPtr, this, SBEvent.getCPtr(sb_event), sb_event); - } - - public boolean GetNextEventForBroadcaster(SBBroadcaster broadcaster, SBEvent sb_event) { - return lldbJNI.SBListener_GetNextEventForBroadcaster(swigCPtr, this, SBBroadcaster.getCPtr(broadcaster), broadcaster, SBEvent.getCPtr(sb_event), sb_event); - } - - public boolean GetNextEventForBroadcasterWithType(SBBroadcaster broadcaster, long event_type_mask, SBEvent sb_event) { - return lldbJNI.SBListener_GetNextEventForBroadcasterWithType(swigCPtr, this, SBBroadcaster.getCPtr(broadcaster), broadcaster, event_type_mask, SBEvent.getCPtr(sb_event), sb_event); - } - - public boolean HandleBroadcastEvent(SBEvent event) { - return lldbJNI.SBListener_HandleBroadcastEvent(swigCPtr, this, SBEvent.getCPtr(event), event); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBMemoryRegionInfo.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBMemoryRegionInfo.java deleted file mode 100644 index c3e1e64c83..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBMemoryRegionInfo.java +++ /dev/null @@ -1,126 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBMemoryRegionInfo { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBMemoryRegionInfo(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBMemoryRegionInfo obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBMemoryRegionInfo obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBMemoryRegionInfo(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBMemoryRegionInfo() { - this(lldbJNI.new_SBMemoryRegionInfo__SWIG_0(), true); - } - - public SBMemoryRegionInfo(SBMemoryRegionInfo rhs) { - this(lldbJNI.new_SBMemoryRegionInfo__SWIG_1(SBMemoryRegionInfo.getCPtr(rhs), rhs), true); - } - - public SBMemoryRegionInfo(String name, java.math.BigInteger begin, java.math.BigInteger end, long permissions, boolean mapped, boolean stack_memory) { - this(lldbJNI.new_SBMemoryRegionInfo__SWIG_2(name, begin, end, permissions, mapped, stack_memory), true); - } - - public SBMemoryRegionInfo(String name, java.math.BigInteger begin, java.math.BigInteger end, long permissions, boolean mapped) { - this(lldbJNI.new_SBMemoryRegionInfo__SWIG_3(name, begin, end, permissions, mapped), true); - } - - public void Clear() { - lldbJNI.SBMemoryRegionInfo_Clear(swigCPtr, this); - } - - public java.math.BigInteger GetRegionBase() { - return lldbJNI.SBMemoryRegionInfo_GetRegionBase(swigCPtr, this); - } - - public java.math.BigInteger GetRegionEnd() { - return lldbJNI.SBMemoryRegionInfo_GetRegionEnd(swigCPtr, this); - } - - public boolean IsReadable() { - return lldbJNI.SBMemoryRegionInfo_IsReadable(swigCPtr, this); - } - - public boolean IsWritable() { - return lldbJNI.SBMemoryRegionInfo_IsWritable(swigCPtr, this); - } - - public boolean IsExecutable() { - return lldbJNI.SBMemoryRegionInfo_IsExecutable(swigCPtr, this); - } - - public boolean IsMapped() { - return lldbJNI.SBMemoryRegionInfo_IsMapped(swigCPtr, this); - } - - public String GetName() { - return lldbJNI.SBMemoryRegionInfo_GetName(swigCPtr, this); - } - - public boolean HasDirtyMemoryPageList() { - return lldbJNI.SBMemoryRegionInfo_HasDirtyMemoryPageList(swigCPtr, this); - } - - public long GetNumDirtyPages() { - return lldbJNI.SBMemoryRegionInfo_GetNumDirtyPages(swigCPtr, this); - } - - public java.math.BigInteger GetDirtyPageAddressAtIndex(long idx) { - return lldbJNI.SBMemoryRegionInfo_GetDirtyPageAddressAtIndex(swigCPtr, this, idx); - } - - public int GetPageSize() { - return lldbJNI.SBMemoryRegionInfo_GetPageSize(swigCPtr, this); - } - - public boolean GetDescription(SBStream description) { - return lldbJNI.SBMemoryRegionInfo_GetDescription(swigCPtr, this, SBStream.getCPtr(description), description); - } - - public String __repr__() { - return lldbJNI.SBMemoryRegionInfo___repr__(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBMemoryRegionInfoList.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBMemoryRegionInfoList.java deleted file mode 100644 index b4477fee2f..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBMemoryRegionInfoList.java +++ /dev/null @@ -1,86 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBMemoryRegionInfoList { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBMemoryRegionInfoList(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBMemoryRegionInfoList obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBMemoryRegionInfoList obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBMemoryRegionInfoList(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBMemoryRegionInfoList() { - this(lldbJNI.new_SBMemoryRegionInfoList__SWIG_0(), true); - } - - public SBMemoryRegionInfoList(SBMemoryRegionInfoList rhs) { - this(lldbJNI.new_SBMemoryRegionInfoList__SWIG_1(SBMemoryRegionInfoList.getCPtr(rhs), rhs), true); - } - - public long GetSize() { - return lldbJNI.SBMemoryRegionInfoList_GetSize(swigCPtr, this); - } - - public boolean GetMemoryRegionContainingAddress(java.math.BigInteger addr, SBMemoryRegionInfo region_info) { - return lldbJNI.SBMemoryRegionInfoList_GetMemoryRegionContainingAddress(swigCPtr, this, addr, SBMemoryRegionInfo.getCPtr(region_info), region_info); - } - - public boolean GetMemoryRegionAtIndex(long idx, SBMemoryRegionInfo region_info) { - return lldbJNI.SBMemoryRegionInfoList_GetMemoryRegionAtIndex(swigCPtr, this, idx, SBMemoryRegionInfo.getCPtr(region_info), region_info); - } - - public void Append(SBMemoryRegionInfo region) { - lldbJNI.SBMemoryRegionInfoList_Append__SWIG_0(swigCPtr, this, SBMemoryRegionInfo.getCPtr(region), region); - } - - public void Append(SBMemoryRegionInfoList region_list) { - lldbJNI.SBMemoryRegionInfoList_Append__SWIG_1(swigCPtr, this, SBMemoryRegionInfoList.getCPtr(region_list), region_list); - } - - public void Clear() { - lldbJNI.SBMemoryRegionInfoList_Clear(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBModule.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBModule.java deleted file mode 100644 index 96e000539f..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBModule.java +++ /dev/null @@ -1,251 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBModule { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBModule(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBModule obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBModule obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBModule(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBModule() { - this(lldbJNI.new_SBModule__SWIG_0(), true); - } - - public SBModule(SBModule rhs) { - this(lldbJNI.new_SBModule__SWIG_1(SBModule.getCPtr(rhs), rhs), true); - } - - public SBModule(SBModuleSpec module_spec) { - this(lldbJNI.new_SBModule__SWIG_2(SBModuleSpec.getCPtr(module_spec), module_spec), true); - } - - public SBModule(SBProcess process, java.math.BigInteger header_addr) { - this(lldbJNI.new_SBModule__SWIG_3(SBProcess.getCPtr(process), process, header_addr), true); - } - - public boolean IsValid() { - return lldbJNI.SBModule_IsValid(swigCPtr, this); - } - - public void Clear() { - lldbJNI.SBModule_Clear(swigCPtr, this); - } - - public boolean IsFileBacked() { - return lldbJNI.SBModule_IsFileBacked(swigCPtr, this); - } - - public SBFileSpec GetFileSpec() { - return new SBFileSpec(lldbJNI.SBModule_GetFileSpec(swigCPtr, this), true); - } - - public SBFileSpec GetPlatformFileSpec() { - return new SBFileSpec(lldbJNI.SBModule_GetPlatformFileSpec(swigCPtr, this), true); - } - - public boolean SetPlatformFileSpec(SBFileSpec platform_file) { - return lldbJNI.SBModule_SetPlatformFileSpec(swigCPtr, this, SBFileSpec.getCPtr(platform_file), platform_file); - } - - public SBFileSpec GetRemoteInstallFileSpec() { - return new SBFileSpec(lldbJNI.SBModule_GetRemoteInstallFileSpec(swigCPtr, this), true); - } - - public boolean SetRemoteInstallFileSpec(SBFileSpec file) { - return lldbJNI.SBModule_SetRemoteInstallFileSpec(swigCPtr, this, SBFileSpec.getCPtr(file), file); - } - - public ByteOrder GetByteOrder() { - return ByteOrder.swigToEnum(lldbJNI.SBModule_GetByteOrder(swigCPtr, this)); - } - - public long GetAddressByteSize() { - return lldbJNI.SBModule_GetAddressByteSize(swigCPtr, this); - } - - public String GetTriple() { - return lldbJNI.SBModule_GetTriple(swigCPtr, this); - } - - public SWIGTYPE_p_unsigned_char GetUUIDBytes() { - long cPtr = lldbJNI.SBModule_GetUUIDBytes(swigCPtr, this); - return (cPtr == 0) ? null : new SWIGTYPE_p_unsigned_char(cPtr, false); - } - - public String GetUUIDString() { - return lldbJNI.SBModule_GetUUIDString(swigCPtr, this); - } - - public SBSection FindSection(String sect_name) { - return new SBSection(lldbJNI.SBModule_FindSection(swigCPtr, this, sect_name), true); - } - - public SBAddress ResolveFileAddress(java.math.BigInteger vm_addr) { - return new SBAddress(lldbJNI.SBModule_ResolveFileAddress(swigCPtr, this, vm_addr), true); - } - - public SBSymbolContext ResolveSymbolContextForAddress(SBAddress addr, long resolve_scope) { - return new SBSymbolContext(lldbJNI.SBModule_ResolveSymbolContextForAddress(swigCPtr, this, SBAddress.getCPtr(addr), addr, resolve_scope), true); - } - - public boolean GetDescription(SBStream description) { - return lldbJNI.SBModule_GetDescription(swigCPtr, this, SBStream.getCPtr(description), description); - } - - public long GetNumCompileUnits() { - return lldbJNI.SBModule_GetNumCompileUnits(swigCPtr, this); - } - - public SBCompileUnit GetCompileUnitAtIndex(long arg0) { - return new SBCompileUnit(lldbJNI.SBModule_GetCompileUnitAtIndex(swigCPtr, this, arg0), true); - } - - public SBSymbolContextList FindCompileUnits(SBFileSpec sb_file_spec) { - return new SBSymbolContextList(lldbJNI.SBModule_FindCompileUnits(swigCPtr, this, SBFileSpec.getCPtr(sb_file_spec), sb_file_spec), true); - } - - public long GetNumSymbols() { - return lldbJNI.SBModule_GetNumSymbols(swigCPtr, this); - } - - public SBSymbol GetSymbolAtIndex(long idx) { - return new SBSymbol(lldbJNI.SBModule_GetSymbolAtIndex(swigCPtr, this, idx), true); - } - - public SBSymbol FindSymbol(String name, SymbolType type) { - return new SBSymbol(lldbJNI.SBModule_FindSymbol__SWIG_0(swigCPtr, this, name, type.swigValue()), true); - } - - public SBSymbol FindSymbol(String name) { - return new SBSymbol(lldbJNI.SBModule_FindSymbol__SWIG_1(swigCPtr, this, name), true); - } - - public SBSymbolContextList FindSymbols(String name, SymbolType type) { - return new SBSymbolContextList(lldbJNI.SBModule_FindSymbols__SWIG_0(swigCPtr, this, name, type.swigValue()), true); - } - - public SBSymbolContextList FindSymbols(String name) { - return new SBSymbolContextList(lldbJNI.SBModule_FindSymbols__SWIG_1(swigCPtr, this, name), true); - } - - public long GetNumSections() { - return lldbJNI.SBModule_GetNumSections(swigCPtr, this); - } - - public SBSection GetSectionAtIndex(long idx) { - return new SBSection(lldbJNI.SBModule_GetSectionAtIndex(swigCPtr, this, idx), true); - } - - public SBSymbolContextList FindFunctions(String name, long name_type_mask) { - return new SBSymbolContextList(lldbJNI.SBModule_FindFunctions__SWIG_0(swigCPtr, this, name, name_type_mask), true); - } - - public SBSymbolContextList FindFunctions(String name) { - return new SBSymbolContextList(lldbJNI.SBModule_FindFunctions__SWIG_1(swigCPtr, this, name), true); - } - - public SBValueList FindGlobalVariables(SBTarget target, String name, long max_matches) { - return new SBValueList(lldbJNI.SBModule_FindGlobalVariables(swigCPtr, this, SBTarget.getCPtr(target), target, name, max_matches), true); - } - - public SBValue FindFirstGlobalVariable(SBTarget target, String name) { - return new SBValue(lldbJNI.SBModule_FindFirstGlobalVariable(swigCPtr, this, SBTarget.getCPtr(target), target, name), true); - } - - public SBType FindFirstType(String name) { - return new SBType(lldbJNI.SBModule_FindFirstType(swigCPtr, this, name), true); - } - - public SBTypeList FindTypes(String type) { - return new SBTypeList(lldbJNI.SBModule_FindTypes(swigCPtr, this, type), true); - } - - public SBType GetTypeByID(java.math.BigInteger uid) { - return new SBType(lldbJNI.SBModule_GetTypeByID(swigCPtr, this, uid), true); - } - - public SBType GetBasicType(BasicType type) { - return new SBType(lldbJNI.SBModule_GetBasicType(swigCPtr, this, type.swigValue()), true); - } - - public SBTypeList GetTypes(long type_mask) { - return new SBTypeList(lldbJNI.SBModule_GetTypes__SWIG_0(swigCPtr, this, type_mask), true); - } - - public SBTypeList GetTypes() { - return new SBTypeList(lldbJNI.SBModule_GetTypes__SWIG_1(swigCPtr, this), true); - } - - public long GetVersion(SWIGTYPE_p_unsigned_int versions, long num_versions) { - return lldbJNI.SBModule_GetVersion(swigCPtr, this, SWIGTYPE_p_unsigned_int.getCPtr(versions), num_versions); - } - - public SBFileSpec GetSymbolFileSpec() { - return new SBFileSpec(lldbJNI.SBModule_GetSymbolFileSpec(swigCPtr, this), true); - } - - public SBAddress GetObjectFileHeaderAddress() { - return new SBAddress(lldbJNI.SBModule_GetObjectFileHeaderAddress(swigCPtr, this), true); - } - - public SBAddress GetObjectFileEntryPointAddress() { - return new SBAddress(lldbJNI.SBModule_GetObjectFileEntryPointAddress(swigCPtr, this), true); - } - - public static long GetNumberAllocatedModules() { - return lldbJNI.SBModule_GetNumberAllocatedModules(); - } - - public static void GarbageCollectAllocatedModules() { - lldbJNI.SBModule_GarbageCollectAllocatedModules(); - } - - public String __repr__() { - return lldbJNI.SBModule___repr__(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBModuleSpec.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBModuleSpec.java deleted file mode 100644 index 616fb76b06..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBModuleSpec.java +++ /dev/null @@ -1,147 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBModuleSpec { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBModuleSpec(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBModuleSpec obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBModuleSpec obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBModuleSpec(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBModuleSpec() { - this(lldbJNI.new_SBModuleSpec__SWIG_0(), true); - } - - public SBModuleSpec(SBModuleSpec rhs) { - this(lldbJNI.new_SBModuleSpec__SWIG_1(SBModuleSpec.getCPtr(rhs), rhs), true); - } - - public boolean IsValid() { - return lldbJNI.SBModuleSpec_IsValid(swigCPtr, this); - } - - public void Clear() { - lldbJNI.SBModuleSpec_Clear(swigCPtr, this); - } - - public SBFileSpec GetFileSpec() { - return new SBFileSpec(lldbJNI.SBModuleSpec_GetFileSpec(swigCPtr, this), true); - } - - public void SetFileSpec(SBFileSpec fspec) { - lldbJNI.SBModuleSpec_SetFileSpec(swigCPtr, this, SBFileSpec.getCPtr(fspec), fspec); - } - - public SBFileSpec GetPlatformFileSpec() { - return new SBFileSpec(lldbJNI.SBModuleSpec_GetPlatformFileSpec(swigCPtr, this), true); - } - - public void SetPlatformFileSpec(SBFileSpec fspec) { - lldbJNI.SBModuleSpec_SetPlatformFileSpec(swigCPtr, this, SBFileSpec.getCPtr(fspec), fspec); - } - - public SBFileSpec GetSymbolFileSpec() { - return new SBFileSpec(lldbJNI.SBModuleSpec_GetSymbolFileSpec(swigCPtr, this), true); - } - - public void SetSymbolFileSpec(SBFileSpec fspec) { - lldbJNI.SBModuleSpec_SetSymbolFileSpec(swigCPtr, this, SBFileSpec.getCPtr(fspec), fspec); - } - - public String GetObjectName() { - return lldbJNI.SBModuleSpec_GetObjectName(swigCPtr, this); - } - - public void SetObjectName(String name) { - lldbJNI.SBModuleSpec_SetObjectName(swigCPtr, this, name); - } - - public String GetTriple() { - return lldbJNI.SBModuleSpec_GetTriple(swigCPtr, this); - } - - public void SetTriple(String triple) { - lldbJNI.SBModuleSpec_SetTriple(swigCPtr, this, triple); - } - - public SWIGTYPE_p_unsigned_char GetUUIDBytes() { - long cPtr = lldbJNI.SBModuleSpec_GetUUIDBytes(swigCPtr, this); - return (cPtr == 0) ? null : new SWIGTYPE_p_unsigned_char(cPtr, false); - } - - public long GetUUIDLength() { - return lldbJNI.SBModuleSpec_GetUUIDLength(swigCPtr, this); - } - - public boolean SetUUIDBytes(SWIGTYPE_p_unsigned_char uuid, long uuid_len) { - return lldbJNI.SBModuleSpec_SetUUIDBytes(swigCPtr, this, SWIGTYPE_p_unsigned_char.getCPtr(uuid), uuid_len); - } - - public java.math.BigInteger GetObjectOffset() { - return lldbJNI.SBModuleSpec_GetObjectOffset(swigCPtr, this); - } - - public void SetObjectOffset(java.math.BigInteger object_offset) { - lldbJNI.SBModuleSpec_SetObjectOffset(swigCPtr, this, object_offset); - } - - public java.math.BigInteger GetObjectSize() { - return lldbJNI.SBModuleSpec_GetObjectSize(swigCPtr, this); - } - - public void SetObjectSize(java.math.BigInteger object_size) { - lldbJNI.SBModuleSpec_SetObjectSize(swigCPtr, this, object_size); - } - - public boolean GetDescription(SBStream description) { - return lldbJNI.SBModuleSpec_GetDescription(swigCPtr, this, SBStream.getCPtr(description), description); - } - - public String __repr__() { - return lldbJNI.SBModuleSpec___repr__(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBModuleSpecList.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBModuleSpecList.java deleted file mode 100644 index 784c425e57..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBModuleSpecList.java +++ /dev/null @@ -1,98 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBModuleSpecList { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBModuleSpecList(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBModuleSpecList obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBModuleSpecList obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBModuleSpecList(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBModuleSpecList() { - this(lldbJNI.new_SBModuleSpecList__SWIG_0(), true); - } - - public SBModuleSpecList(SBModuleSpecList rhs) { - this(lldbJNI.new_SBModuleSpecList__SWIG_1(SBModuleSpecList.getCPtr(rhs), rhs), true); - } - - public static SBModuleSpecList GetModuleSpecifications(String path) { - return new SBModuleSpecList(lldbJNI.SBModuleSpecList_GetModuleSpecifications(path), true); - } - - public void Append(SBModuleSpec spec) { - lldbJNI.SBModuleSpecList_Append__SWIG_0(swigCPtr, this, SBModuleSpec.getCPtr(spec), spec); - } - - public void Append(SBModuleSpecList spec_list) { - lldbJNI.SBModuleSpecList_Append__SWIG_1(swigCPtr, this, SBModuleSpecList.getCPtr(spec_list), spec_list); - } - - public SBModuleSpec FindFirstMatchingSpec(SBModuleSpec match_spec) { - return new SBModuleSpec(lldbJNI.SBModuleSpecList_FindFirstMatchingSpec(swigCPtr, this, SBModuleSpec.getCPtr(match_spec), match_spec), true); - } - - public SBModuleSpecList FindMatchingSpecs(SBModuleSpec match_spec) { - return new SBModuleSpecList(lldbJNI.SBModuleSpecList_FindMatchingSpecs(swigCPtr, this, SBModuleSpec.getCPtr(match_spec), match_spec), true); - } - - public long GetSize() { - return lldbJNI.SBModuleSpecList_GetSize(swigCPtr, this); - } - - public SBModuleSpec GetSpecAtIndex(long i) { - return new SBModuleSpec(lldbJNI.SBModuleSpecList_GetSpecAtIndex(swigCPtr, this, i), true); - } - - public boolean GetDescription(SBStream description) { - return lldbJNI.SBModuleSpecList_GetDescription(swigCPtr, this, SBStream.getCPtr(description), description); - } - - public String __repr__() { - return lldbJNI.SBModuleSpecList___repr__(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBPlatform.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBPlatform.java deleted file mode 100644 index 795c39c1dc..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBPlatform.java +++ /dev/null @@ -1,186 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBPlatform { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBPlatform(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBPlatform obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBPlatform obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBPlatform(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBPlatform() { - this(lldbJNI.new_SBPlatform__SWIG_0(), true); - } - - public SBPlatform(String platform_name) { - this(lldbJNI.new_SBPlatform__SWIG_1(platform_name), true); - } - - public SBPlatform(SBPlatform rhs) { - this(lldbJNI.new_SBPlatform__SWIG_2(SBPlatform.getCPtr(rhs), rhs), true); - } - - public static SBPlatform GetHostPlatform() { - return new SBPlatform(lldbJNI.SBPlatform_GetHostPlatform(), true); - } - - public boolean IsValid() { - return lldbJNI.SBPlatform_IsValid(swigCPtr, this); - } - - public void Clear() { - lldbJNI.SBPlatform_Clear(swigCPtr, this); - } - - public String GetWorkingDirectory() { - return lldbJNI.SBPlatform_GetWorkingDirectory(swigCPtr, this); - } - - public boolean SetWorkingDirectory(String path) { - return lldbJNI.SBPlatform_SetWorkingDirectory(swigCPtr, this, path); - } - - public String GetName() { - return lldbJNI.SBPlatform_GetName(swigCPtr, this); - } - - public SBError ConnectRemote(SBPlatformConnectOptions connect_options) { - return new SBError(lldbJNI.SBPlatform_ConnectRemote(swigCPtr, this, SBPlatformConnectOptions.getCPtr(connect_options), connect_options), true); - } - - public void DisconnectRemote() { - lldbJNI.SBPlatform_DisconnectRemote(swigCPtr, this); - } - - public boolean IsConnected() { - return lldbJNI.SBPlatform_IsConnected(swigCPtr, this); - } - - public String GetTriple() { - return lldbJNI.SBPlatform_GetTriple(swigCPtr, this); - } - - public String GetHostname() { - return lldbJNI.SBPlatform_GetHostname(swigCPtr, this); - } - - public String GetOSBuild() { - return lldbJNI.SBPlatform_GetOSBuild(swigCPtr, this); - } - - public String GetOSDescription() { - return lldbJNI.SBPlatform_GetOSDescription(swigCPtr, this); - } - - public long GetOSMajorVersion() { - return lldbJNI.SBPlatform_GetOSMajorVersion(swigCPtr, this); - } - - public long GetOSMinorVersion() { - return lldbJNI.SBPlatform_GetOSMinorVersion(swigCPtr, this); - } - - public long GetOSUpdateVersion() { - return lldbJNI.SBPlatform_GetOSUpdateVersion(swigCPtr, this); - } - - public void SetSDKRoot(String sysroot) { - lldbJNI.SBPlatform_SetSDKRoot(swigCPtr, this, sysroot); - } - - public SBError Put(SBFileSpec src, SBFileSpec dst) { - return new SBError(lldbJNI.SBPlatform_Put(swigCPtr, this, SBFileSpec.getCPtr(src), src, SBFileSpec.getCPtr(dst), dst), true); - } - - public SBError Get(SBFileSpec src, SBFileSpec dst) { - return new SBError(lldbJNI.SBPlatform_Get(swigCPtr, this, SBFileSpec.getCPtr(src), src, SBFileSpec.getCPtr(dst), dst), true); - } - - public SBError Install(SBFileSpec src, SBFileSpec dst) { - return new SBError(lldbJNI.SBPlatform_Install(swigCPtr, this, SBFileSpec.getCPtr(src), src, SBFileSpec.getCPtr(dst), dst), true); - } - - public SBError Run(SBPlatformShellCommand shell_command) { - return new SBError(lldbJNI.SBPlatform_Run(swigCPtr, this, SBPlatformShellCommand.getCPtr(shell_command), shell_command), true); - } - - public SBError Launch(SBLaunchInfo launch_info) { - return new SBError(lldbJNI.SBPlatform_Launch(swigCPtr, this, SBLaunchInfo.getCPtr(launch_info), launch_info), true); - } - - public SBError Kill(java.math.BigInteger pid) { - return new SBError(lldbJNI.SBPlatform_Kill(swigCPtr, this, pid), true); - } - - public SBError MakeDirectory(String path, long file_permissions) { - return new SBError(lldbJNI.SBPlatform_MakeDirectory__SWIG_0(swigCPtr, this, path, file_permissions), true); - } - - public SBError MakeDirectory(String path) { - return new SBError(lldbJNI.SBPlatform_MakeDirectory__SWIG_1(swigCPtr, this, path), true); - } - - public long GetFilePermissions(String path) { - return lldbJNI.SBPlatform_GetFilePermissions(swigCPtr, this, path); - } - - public SBError SetFilePermissions(String path, long file_permissions) { - return new SBError(lldbJNI.SBPlatform_SetFilePermissions(swigCPtr, this, path, file_permissions), true); - } - - public SBUnixSignals GetUnixSignals() { - return new SBUnixSignals(lldbJNI.SBPlatform_GetUnixSignals(swigCPtr, this), true); - } - - public SBEnvironment GetEnvironment() { - return new SBEnvironment(lldbJNI.SBPlatform_GetEnvironment(swigCPtr, this), true); - } - - public SBError SetLocateModuleCallback(SWIGTYPE_p_f_p_void_r_q_const__lldb__SBModuleSpec_r_lldb__SBFileSpec_r_lldb__SBFileSpec__lldb__SBError callback, SWIGTYPE_p_void callback_baton) { - return new SBError(lldbJNI.SBPlatform_SetLocateModuleCallback(swigCPtr, this, SWIGTYPE_p_f_p_void_r_q_const__lldb__SBModuleSpec_r_lldb__SBFileSpec_r_lldb__SBFileSpec__lldb__SBError.getCPtr(callback), SWIGTYPE_p_void.getCPtr(callback_baton)), true); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBPlatformConnectOptions.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBPlatformConnectOptions.java deleted file mode 100644 index a62114f6db..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBPlatformConnectOptions.java +++ /dev/null @@ -1,90 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBPlatformConnectOptions { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBPlatformConnectOptions(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBPlatformConnectOptions obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBPlatformConnectOptions obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBPlatformConnectOptions(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBPlatformConnectOptions(String url) { - this(lldbJNI.new_SBPlatformConnectOptions__SWIG_0(url), true); - } - - public SBPlatformConnectOptions(SBPlatformConnectOptions rhs) { - this(lldbJNI.new_SBPlatformConnectOptions__SWIG_1(SBPlatformConnectOptions.getCPtr(rhs), rhs), true); - } - - public String GetURL() { - return lldbJNI.SBPlatformConnectOptions_GetURL(swigCPtr, this); - } - - public void SetURL(String url) { - lldbJNI.SBPlatformConnectOptions_SetURL(swigCPtr, this, url); - } - - public boolean GetRsyncEnabled() { - return lldbJNI.SBPlatformConnectOptions_GetRsyncEnabled(swigCPtr, this); - } - - public void EnableRsync(String options, String remote_path_prefix, boolean omit_remote_hostname) { - lldbJNI.SBPlatformConnectOptions_EnableRsync(swigCPtr, this, options, remote_path_prefix, omit_remote_hostname); - } - - public void DisableRsync() { - lldbJNI.SBPlatformConnectOptions_DisableRsync(swigCPtr, this); - } - - public String GetLocalCacheDirectory() { - return lldbJNI.SBPlatformConnectOptions_GetLocalCacheDirectory(swigCPtr, this); - } - - public void SetLocalCacheDirectory(String path) { - lldbJNI.SBPlatformConnectOptions_SetLocalCacheDirectory(swigCPtr, this, path); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBPlatformShellCommand.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBPlatformShellCommand.java deleted file mode 100644 index 8fab58f46c..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBPlatformShellCommand.java +++ /dev/null @@ -1,114 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBPlatformShellCommand { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBPlatformShellCommand(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBPlatformShellCommand obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBPlatformShellCommand obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBPlatformShellCommand(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBPlatformShellCommand(String shell, String shell_command) { - this(lldbJNI.new_SBPlatformShellCommand__SWIG_0(shell, shell_command), true); - } - - public SBPlatformShellCommand(String shell_command) { - this(lldbJNI.new_SBPlatformShellCommand__SWIG_1(shell_command), true); - } - - public SBPlatformShellCommand(SBPlatformShellCommand rhs) { - this(lldbJNI.new_SBPlatformShellCommand__SWIG_2(SBPlatformShellCommand.getCPtr(rhs), rhs), true); - } - - public void Clear() { - lldbJNI.SBPlatformShellCommand_Clear(swigCPtr, this); - } - - public String GetShell() { - return lldbJNI.SBPlatformShellCommand_GetShell(swigCPtr, this); - } - - public void SetShell(String shell) { - lldbJNI.SBPlatformShellCommand_SetShell(swigCPtr, this, shell); - } - - public String GetCommand() { - return lldbJNI.SBPlatformShellCommand_GetCommand(swigCPtr, this); - } - - public void SetCommand(String shell_command) { - lldbJNI.SBPlatformShellCommand_SetCommand(swigCPtr, this, shell_command); - } - - public String GetWorkingDirectory() { - return lldbJNI.SBPlatformShellCommand_GetWorkingDirectory(swigCPtr, this); - } - - public void SetWorkingDirectory(String path) { - lldbJNI.SBPlatformShellCommand_SetWorkingDirectory(swigCPtr, this, path); - } - - public long GetTimeoutSeconds() { - return lldbJNI.SBPlatformShellCommand_GetTimeoutSeconds(swigCPtr, this); - } - - public void SetTimeoutSeconds(long sec) { - lldbJNI.SBPlatformShellCommand_SetTimeoutSeconds(swigCPtr, this, sec); - } - - public int GetSignal() { - return lldbJNI.SBPlatformShellCommand_GetSignal(swigCPtr, this); - } - - public int GetStatus() { - return lldbJNI.SBPlatformShellCommand_GetStatus(swigCPtr, this); - } - - public String GetOutput() { - return lldbJNI.SBPlatformShellCommand_GetOutput(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBProcess.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBProcess.java deleted file mode 100644 index b028229ed4..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBProcess.java +++ /dev/null @@ -1,401 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBProcess { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBProcess(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBProcess obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBProcess obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBProcess(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBProcess() { - this(lldbJNI.new_SBProcess__SWIG_0(), true); - } - - public SBProcess(SBProcess rhs) { - this(lldbJNI.new_SBProcess__SWIG_1(SBProcess.getCPtr(rhs), rhs), true); - } - - public static String GetBroadcasterClassName() { - return lldbJNI.SBProcess_GetBroadcasterClassName(); - } - - public String GetPluginName() { - return lldbJNI.SBProcess_GetPluginName(swigCPtr, this); - } - - public String GetShortPluginName() { - return lldbJNI.SBProcess_GetShortPluginName(swigCPtr, this); - } - - public void Clear() { - lldbJNI.SBProcess_Clear(swigCPtr, this); - } - - public boolean IsValid() { - return lldbJNI.SBProcess_IsValid(swigCPtr, this); - } - - public SBTarget GetTarget() { - return new SBTarget(lldbJNI.SBProcess_GetTarget(swigCPtr, this), true); - } - - public ByteOrder GetByteOrder() { - return ByteOrder.swigToEnum(lldbJNI.SBProcess_GetByteOrder(swigCPtr, this)); - } - - public long PutSTDIN(String src, long src_len) { - return lldbJNI.SBProcess_PutSTDIN(swigCPtr, this, src, src_len); - } - - public long GetSTDOUT(String dst, long dst_len) { - return lldbJNI.SBProcess_GetSTDOUT(swigCPtr, this, dst, dst_len); - } - - public long GetSTDERR(String dst, long dst_len) { - return lldbJNI.SBProcess_GetSTDERR(swigCPtr, this, dst, dst_len); - } - - public long GetAsyncProfileData(String dst, long dst_len) { - return lldbJNI.SBProcess_GetAsyncProfileData(swigCPtr, this, dst, dst_len); - } - - public void ReportEventState(SBEvent event, SBFile file) { - lldbJNI.SBProcess_ReportEventState__SWIG_0(swigCPtr, this, SBEvent.getCPtr(event), event, SBFile.getCPtr(file), file); - } - - public void ReportEventState(SBEvent event, SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t BORROWED) { - lldbJNI.SBProcess_ReportEventState__SWIG_1(swigCPtr, this, SBEvent.getCPtr(event), event, SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t.getCPtr(BORROWED)); - } - - public void AppendEventStateReport(SBEvent event, SBCommandReturnObject result) { - lldbJNI.SBProcess_AppendEventStateReport(swigCPtr, this, SBEvent.getCPtr(event), event, SBCommandReturnObject.getCPtr(result), result); - } - - public boolean RemoteAttachToProcessWithID(java.math.BigInteger pid, SBError error) { - return lldbJNI.SBProcess_RemoteAttachToProcessWithID(swigCPtr, this, pid, SBError.getCPtr(error), error); - } - - public boolean RemoteLaunch(String[] argv, String[] envp, String stdin_path, String stdout_path, String stderr_path, String working_directory, long launch_flags, boolean stop_at_entry, SBError error) { - return lldbJNI.SBProcess_RemoteLaunch(swigCPtr, this, argv, envp, stdin_path, stdout_path, stderr_path, working_directory, launch_flags, stop_at_entry, SBError.getCPtr(error), error); - } - - public long GetNumThreads() { - return lldbJNI.SBProcess_GetNumThreads(swigCPtr, this); - } - - public SBThread GetThreadAtIndex(long index) { - return new SBThread(lldbJNI.SBProcess_GetThreadAtIndex(swigCPtr, this, index), true); - } - - public SBThread GetThreadByID(java.math.BigInteger sb_thread_id) { - return new SBThread(lldbJNI.SBProcess_GetThreadByID(swigCPtr, this, sb_thread_id), true); - } - - public SBThread GetThreadByIndexID(long index_id) { - return new SBThread(lldbJNI.SBProcess_GetThreadByIndexID(swigCPtr, this, index_id), true); - } - - public SBThread GetSelectedThread() { - return new SBThread(lldbJNI.SBProcess_GetSelectedThread(swigCPtr, this), true); - } - - public SBThread CreateOSPluginThread(java.math.BigInteger tid, java.math.BigInteger context) { - return new SBThread(lldbJNI.SBProcess_CreateOSPluginThread(swigCPtr, this, tid, context), true); - } - - public boolean SetSelectedThread(SBThread thread) { - return lldbJNI.SBProcess_SetSelectedThread(swigCPtr, this, SBThread.getCPtr(thread), thread); - } - - public boolean SetSelectedThreadByID(java.math.BigInteger tid) { - return lldbJNI.SBProcess_SetSelectedThreadByID(swigCPtr, this, tid); - } - - public boolean SetSelectedThreadByIndexID(long index_id) { - return lldbJNI.SBProcess_SetSelectedThreadByIndexID(swigCPtr, this, index_id); - } - - public long GetNumQueues() { - return lldbJNI.SBProcess_GetNumQueues(swigCPtr, this); - } - - public SBQueue GetQueueAtIndex(long index) { - return new SBQueue(lldbJNI.SBProcess_GetQueueAtIndex(swigCPtr, this, index), true); - } - - public StateType GetState() { - return StateType.swigToEnum(lldbJNI.SBProcess_GetState(swigCPtr, this)); - } - - public int GetExitStatus() { - return lldbJNI.SBProcess_GetExitStatus(swigCPtr, this); - } - - public String GetExitDescription() { - return lldbJNI.SBProcess_GetExitDescription(swigCPtr, this); - } - - public java.math.BigInteger GetProcessID() { - return lldbJNI.SBProcess_GetProcessID(swigCPtr, this); - } - - public long GetUniqueID() { - return lldbJNI.SBProcess_GetUniqueID(swigCPtr, this); - } - - public long GetAddressByteSize() { - return lldbJNI.SBProcess_GetAddressByteSize(swigCPtr, this); - } - - public SBError Destroy() { - return new SBError(lldbJNI.SBProcess_Destroy(swigCPtr, this), true); - } - - public SBError Continue() { - return new SBError(lldbJNI.SBProcess_Continue(swigCPtr, this), true); - } - - public SBError Stop() { - return new SBError(lldbJNI.SBProcess_Stop(swigCPtr, this), true); - } - - public SBError Kill() { - return new SBError(lldbJNI.SBProcess_Kill(swigCPtr, this), true); - } - - public SBError Detach() { - return new SBError(lldbJNI.SBProcess_Detach__SWIG_0(swigCPtr, this), true); - } - - public SBError Detach(boolean keep_stopped) { - return new SBError(lldbJNI.SBProcess_Detach__SWIG_1(swigCPtr, this, keep_stopped), true); - } - - public SBError Signal(int signal) { - return new SBError(lldbJNI.SBProcess_Signal(swigCPtr, this, signal), true); - } - - public SBUnixSignals GetUnixSignals() { - return new SBUnixSignals(lldbJNI.SBProcess_GetUnixSignals(swigCPtr, this), true); - } - - public void SendAsyncInterrupt() { - lldbJNI.SBProcess_SendAsyncInterrupt(swigCPtr, this); - } - - public long GetStopID(boolean include_expression_stops) { - return lldbJNI.SBProcess_GetStopID__SWIG_0(swigCPtr, this, include_expression_stops); - } - - public long GetStopID() { - return lldbJNI.SBProcess_GetStopID__SWIG_1(swigCPtr, this); - } - - public SBEvent GetStopEventForStopID(long stop_id) { - return new SBEvent(lldbJNI.SBProcess_GetStopEventForStopID(swigCPtr, this, stop_id), true); - } - - public void ForceScriptedState(StateType new_state) { - lldbJNI.SBProcess_ForceScriptedState(swigCPtr, this, new_state.swigValue()); - } - - public long ReadMemory(java.math.BigInteger addr, SWIGTYPE_p_void buf, long size, SBError error) { - return lldbJNI.SBProcess_ReadMemory(swigCPtr, this, addr, SWIGTYPE_p_void.getCPtr(buf), size, SBError.getCPtr(error), error); - } - - public long WriteMemory(java.math.BigInteger addr, SWIGTYPE_p_void buf, long size, SBError error) { - return lldbJNI.SBProcess_WriteMemory(swigCPtr, this, addr, SWIGTYPE_p_void.getCPtr(buf), size, SBError.getCPtr(error), error); - } - - public long ReadCStringFromMemory(java.math.BigInteger addr, SWIGTYPE_p_void char_buf, long size, SBError error) { - return lldbJNI.SBProcess_ReadCStringFromMemory(swigCPtr, this, addr, SWIGTYPE_p_void.getCPtr(char_buf), size, SBError.getCPtr(error), error); - } - - public java.math.BigInteger ReadUnsignedFromMemory(java.math.BigInteger addr, long byte_size, SBError error) { - return lldbJNI.SBProcess_ReadUnsignedFromMemory(swigCPtr, this, addr, byte_size, SBError.getCPtr(error), error); - } - - public java.math.BigInteger ReadPointerFromMemory(java.math.BigInteger addr, SBError error) { - return lldbJNI.SBProcess_ReadPointerFromMemory(swigCPtr, this, addr, SBError.getCPtr(error), error); - } - - public static StateType GetStateFromEvent(SBEvent event) { - return StateType.swigToEnum(lldbJNI.SBProcess_GetStateFromEvent(SBEvent.getCPtr(event), event)); - } - - public static boolean GetRestartedFromEvent(SBEvent event) { - return lldbJNI.SBProcess_GetRestartedFromEvent(SBEvent.getCPtr(event), event); - } - - public static long GetNumRestartedReasonsFromEvent(SBEvent event) { - return lldbJNI.SBProcess_GetNumRestartedReasonsFromEvent(SBEvent.getCPtr(event), event); - } - - public static String GetRestartedReasonAtIndexFromEvent(SBEvent event, long idx) { - return lldbJNI.SBProcess_GetRestartedReasonAtIndexFromEvent(SBEvent.getCPtr(event), event, idx); - } - - public static SBProcess GetProcessFromEvent(SBEvent event) { - return new SBProcess(lldbJNI.SBProcess_GetProcessFromEvent(SBEvent.getCPtr(event), event), true); - } - - public static boolean GetInterruptedFromEvent(SBEvent event) { - return lldbJNI.SBProcess_GetInterruptedFromEvent(SBEvent.getCPtr(event), event); - } - - public static SBStructuredData GetStructuredDataFromEvent(SBEvent event) { - return new SBStructuredData(lldbJNI.SBProcess_GetStructuredDataFromEvent(SBEvent.getCPtr(event), event), true); - } - - public static boolean EventIsProcessEvent(SBEvent event) { - return lldbJNI.SBProcess_EventIsProcessEvent(SBEvent.getCPtr(event), event); - } - - public static boolean EventIsStructuredDataEvent(SBEvent event) { - return lldbJNI.SBProcess_EventIsStructuredDataEvent(SBEvent.getCPtr(event), event); - } - - public SBBroadcaster GetBroadcaster() { - return new SBBroadcaster(lldbJNI.SBProcess_GetBroadcaster(swigCPtr, this), true); - } - - public static String GetBroadcasterClass() { - return lldbJNI.SBProcess_GetBroadcasterClass(); - } - - public boolean GetDescription(SBStream description) { - return lldbJNI.SBProcess_GetDescription(swigCPtr, this, SBStream.getCPtr(description), description); - } - - public SBStructuredData GetExtendedCrashInformation() { - return new SBStructuredData(lldbJNI.SBProcess_GetExtendedCrashInformation(swigCPtr, this), true); - } - - public long GetNumSupportedHardwareWatchpoints(SBError error) { - return lldbJNI.SBProcess_GetNumSupportedHardwareWatchpoints(swigCPtr, this, SBError.getCPtr(error), error); - } - - public long LoadImage(SBFileSpec remote_image_spec, SBError error) { - return lldbJNI.SBProcess_LoadImage__SWIG_0(swigCPtr, this, SBFileSpec.getCPtr(remote_image_spec), remote_image_spec, SBError.getCPtr(error), error); - } - - public long LoadImage(SBFileSpec local_image_spec, SBFileSpec remote_image_spec, SBError error) { - return lldbJNI.SBProcess_LoadImage__SWIG_1(swigCPtr, this, SBFileSpec.getCPtr(local_image_spec), local_image_spec, SBFileSpec.getCPtr(remote_image_spec), remote_image_spec, SBError.getCPtr(error), error); - } - - public long LoadImageUsingPaths(SBFileSpec image_spec, SBStringList paths, SBFileSpec loaded_path, SBError error) { - return lldbJNI.SBProcess_LoadImageUsingPaths(swigCPtr, this, SBFileSpec.getCPtr(image_spec), image_spec, SBStringList.getCPtr(paths), paths, SBFileSpec.getCPtr(loaded_path), loaded_path, SBError.getCPtr(error), error); - } - - public SBError UnloadImage(long image_token) { - return new SBError(lldbJNI.SBProcess_UnloadImage(swigCPtr, this, image_token), true); - } - - public SBError SendEventData(String data) { - return new SBError(lldbJNI.SBProcess_SendEventData(swigCPtr, this, data), true); - } - - public long GetNumExtendedBacktraceTypes() { - return lldbJNI.SBProcess_GetNumExtendedBacktraceTypes(swigCPtr, this); - } - - public String GetExtendedBacktraceTypeAtIndex(long idx) { - return lldbJNI.SBProcess_GetExtendedBacktraceTypeAtIndex(swigCPtr, this, idx); - } - - public SBThreadCollection GetHistoryThreads(java.math.BigInteger addr) { - return new SBThreadCollection(lldbJNI.SBProcess_GetHistoryThreads(swigCPtr, this, addr), true); - } - - public boolean IsInstrumentationRuntimePresent(InstrumentationRuntimeType type) { - return lldbJNI.SBProcess_IsInstrumentationRuntimePresent(swigCPtr, this, type.swigValue()); - } - - public SBError SaveCore(String file_name, String flavor, SaveCoreStyle core_style) { - return new SBError(lldbJNI.SBProcess_SaveCore__SWIG_0(swigCPtr, this, file_name, flavor, core_style.swigValue()), true); - } - - public SBError SaveCore(String file_name) { - return new SBError(lldbJNI.SBProcess_SaveCore__SWIG_1(swigCPtr, this, file_name), true); - } - - public SBError GetMemoryRegionInfo(java.math.BigInteger load_addr, SBMemoryRegionInfo region_info) { - return new SBError(lldbJNI.SBProcess_GetMemoryRegionInfo(swigCPtr, this, load_addr, SBMemoryRegionInfo.getCPtr(region_info), region_info), true); - } - - public SBMemoryRegionInfoList GetMemoryRegions() { - return new SBMemoryRegionInfoList(lldbJNI.SBProcess_GetMemoryRegions(swigCPtr, this), true); - } - - public SBProcessInfo GetProcessInfo() { - return new SBProcessInfo(lldbJNI.SBProcess_GetProcessInfo(swigCPtr, this), true); - } - - public java.math.BigInteger AllocateMemory(long size, long permissions, SBError error) { - return lldbJNI.SBProcess_AllocateMemory(swigCPtr, this, size, permissions, SBError.getCPtr(error), error); - } - - public SBError DeallocateMemory(java.math.BigInteger ptr) { - return new SBError(lldbJNI.SBProcess_DeallocateMemory(swigCPtr, this, ptr), true); - } - - public SBScriptObject GetScriptedImplementation() { - return new SBScriptObject(lldbJNI.SBProcess_GetScriptedImplementation(swigCPtr, this), true); - } - - public String __repr__() { - return lldbJNI.SBProcess___repr__(swigCPtr, this); - } - - public final static int eBroadcastBitStateChanged = lldbJNI.SBProcess_eBroadcastBitStateChanged_get(); - public final static int eBroadcastBitInterrupt = lldbJNI.SBProcess_eBroadcastBitInterrupt_get(); - public final static int eBroadcastBitSTDOUT = lldbJNI.SBProcess_eBroadcastBitSTDOUT_get(); - public final static int eBroadcastBitSTDERR = lldbJNI.SBProcess_eBroadcastBitSTDERR_get(); - public final static int eBroadcastBitProfileData = lldbJNI.SBProcess_eBroadcastBitProfileData_get(); - public final static int eBroadcastBitStructuredData = lldbJNI.SBProcess_eBroadcastBitStructuredData_get(); - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBProcessInfo.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBProcessInfo.java deleted file mode 100644 index 5c114effd4..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBProcessInfo.java +++ /dev/null @@ -1,118 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBProcessInfo { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBProcessInfo(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBProcessInfo obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBProcessInfo obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBProcessInfo(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBProcessInfo() { - this(lldbJNI.new_SBProcessInfo__SWIG_0(), true); - } - - public SBProcessInfo(SBProcessInfo rhs) { - this(lldbJNI.new_SBProcessInfo__SWIG_1(SBProcessInfo.getCPtr(rhs), rhs), true); - } - - public boolean IsValid() { - return lldbJNI.SBProcessInfo_IsValid(swigCPtr, this); - } - - public String GetName() { - return lldbJNI.SBProcessInfo_GetName(swigCPtr, this); - } - - public SBFileSpec GetExecutableFile() { - return new SBFileSpec(lldbJNI.SBProcessInfo_GetExecutableFile(swigCPtr, this), true); - } - - public java.math.BigInteger GetProcessID() { - return lldbJNI.SBProcessInfo_GetProcessID(swigCPtr, this); - } - - public long GetUserID() { - return lldbJNI.SBProcessInfo_GetUserID(swigCPtr, this); - } - - public long GetGroupID() { - return lldbJNI.SBProcessInfo_GetGroupID(swigCPtr, this); - } - - public boolean UserIDIsValid() { - return lldbJNI.SBProcessInfo_UserIDIsValid(swigCPtr, this); - } - - public boolean GroupIDIsValid() { - return lldbJNI.SBProcessInfo_GroupIDIsValid(swigCPtr, this); - } - - public long GetEffectiveUserID() { - return lldbJNI.SBProcessInfo_GetEffectiveUserID(swigCPtr, this); - } - - public long GetEffectiveGroupID() { - return lldbJNI.SBProcessInfo_GetEffectiveGroupID(swigCPtr, this); - } - - public boolean EffectiveUserIDIsValid() { - return lldbJNI.SBProcessInfo_EffectiveUserIDIsValid(swigCPtr, this); - } - - public boolean EffectiveGroupIDIsValid() { - return lldbJNI.SBProcessInfo_EffectiveGroupIDIsValid(swigCPtr, this); - } - - public java.math.BigInteger GetParentProcessID() { - return lldbJNI.SBProcessInfo_GetParentProcessID(swigCPtr, this); - } - - public String GetTriple() { - return lldbJNI.SBProcessInfo_GetTriple(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBQueue.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBQueue.java deleted file mode 100644 index db7eb79410..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBQueue.java +++ /dev/null @@ -1,110 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBQueue { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBQueue(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBQueue obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBQueue obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBQueue(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBQueue() { - this(lldbJNI.new_SBQueue__SWIG_0(), true); - } - - public SBQueue(SBQueue rhs) { - this(lldbJNI.new_SBQueue__SWIG_1(SBQueue.getCPtr(rhs), rhs), true); - } - - public boolean IsValid() { - return lldbJNI.SBQueue_IsValid(swigCPtr, this); - } - - public void Clear() { - lldbJNI.SBQueue_Clear(swigCPtr, this); - } - - public SBProcess GetProcess() { - return new SBProcess(lldbJNI.SBQueue_GetProcess(swigCPtr, this), true); - } - - public java.math.BigInteger GetQueueID() { - return lldbJNI.SBQueue_GetQueueID(swigCPtr, this); - } - - public String GetName() { - return lldbJNI.SBQueue_GetName(swigCPtr, this); - } - - public long GetIndexID() { - return lldbJNI.SBQueue_GetIndexID(swigCPtr, this); - } - - public long GetNumThreads() { - return lldbJNI.SBQueue_GetNumThreads(swigCPtr, this); - } - - public SBThread GetThreadAtIndex(long arg0) { - return new SBThread(lldbJNI.SBQueue_GetThreadAtIndex(swigCPtr, this, arg0), true); - } - - public long GetNumPendingItems() { - return lldbJNI.SBQueue_GetNumPendingItems(swigCPtr, this); - } - - public SBQueueItem GetPendingItemAtIndex(long arg0) { - return new SBQueueItem(lldbJNI.SBQueue_GetPendingItemAtIndex(swigCPtr, this, arg0), true); - } - - public long GetNumRunningItems() { - return lldbJNI.SBQueue_GetNumRunningItems(swigCPtr, this); - } - - public QueueKind GetKind() { - return QueueKind.swigToEnum(lldbJNI.SBQueue_GetKind(swigCPtr, this)); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBQueueItem.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBQueueItem.java deleted file mode 100644 index 3a2bf45dca..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBQueueItem.java +++ /dev/null @@ -1,86 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBQueueItem { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBQueueItem(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBQueueItem obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBQueueItem obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBQueueItem(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBQueueItem() { - this(lldbJNI.new_SBQueueItem(), true); - } - - public boolean IsValid() { - return lldbJNI.SBQueueItem_IsValid(swigCPtr, this); - } - - public void Clear() { - lldbJNI.SBQueueItem_Clear(swigCPtr, this); - } - - public QueueItemKind GetKind() { - return QueueItemKind.swigToEnum(lldbJNI.SBQueueItem_GetKind(swigCPtr, this)); - } - - public void SetKind(QueueItemKind kind) { - lldbJNI.SBQueueItem_SetKind(swigCPtr, this, kind.swigValue()); - } - - public SBAddress GetAddress() { - return new SBAddress(lldbJNI.SBQueueItem_GetAddress(swigCPtr, this), true); - } - - public void SetAddress(SBAddress addr) { - lldbJNI.SBQueueItem_SetAddress(swigCPtr, this, SBAddress.getCPtr(addr), addr); - } - - public SBThread GetExtendedBacktraceThread(String type) { - return new SBThread(lldbJNI.SBQueueItem_GetExtendedBacktraceThread(swigCPtr, this, type), true); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBReproducer.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBReproducer.java deleted file mode 100644 index d01e441f21..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBReproducer.java +++ /dev/null @@ -1,74 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBReproducer { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBReproducer(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBReproducer obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBReproducer obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBReproducer(swigCPtr); - } - swigCPtr = 0; - } - } - - public static String Capture(String path) { - return lldbJNI.SBReproducer_Capture(path); - } - - public static String PassiveReplay(String path) { - return lldbJNI.SBReproducer_PassiveReplay(path); - } - - public static boolean SetAutoGenerate(boolean b) { - return lldbJNI.SBReproducer_SetAutoGenerate(b); - } - - public static void SetWorkingDirectory(String path) { - lldbJNI.SBReproducer_SetWorkingDirectory(path); - } - - public SBReproducer() { - this(lldbJNI.new_SBReproducer(), true); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBScriptObject.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBScriptObject.java deleted file mode 100644 index b26c4cdc73..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBScriptObject.java +++ /dev/null @@ -1,75 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBScriptObject { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBScriptObject(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBScriptObject obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBScriptObject obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBScriptObject(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBScriptObject(SWIGTYPE_p_void ptr, ScriptLanguage lang) { - this(lldbJNI.new_SBScriptObject__SWIG_0(SWIGTYPE_p_void.getCPtr(ptr), lang.swigValue()), true); - } - - public SBScriptObject(SBScriptObject rhs) { - this(lldbJNI.new_SBScriptObject__SWIG_1(SBScriptObject.getCPtr(rhs), rhs), true); - } - - public boolean IsValid() { - return lldbJNI.SBScriptObject_IsValid(swigCPtr, this); - } - - public SWIGTYPE_p_void GetPointer() { - long cPtr = lldbJNI.SBScriptObject_GetPointer(swigCPtr, this); - return (cPtr == 0) ? null : new SWIGTYPE_p_void(cPtr, false); - } - - public ScriptLanguage GetLanguage() { - return ScriptLanguage.swigToEnum(lldbJNI.SBScriptObject_GetLanguage(swigCPtr, this)); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBSection.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBSection.java deleted file mode 100644 index 8aace6b3f2..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBSection.java +++ /dev/null @@ -1,138 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBSection { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBSection(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBSection obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBSection obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBSection(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBSection() { - this(lldbJNI.new_SBSection__SWIG_0(), true); - } - - public SBSection(SBSection rhs) { - this(lldbJNI.new_SBSection__SWIG_1(SBSection.getCPtr(rhs), rhs), true); - } - - public boolean IsValid() { - return lldbJNI.SBSection_IsValid(swigCPtr, this); - } - - public String GetName() { - return lldbJNI.SBSection_GetName(swigCPtr, this); - } - - public SBSection GetParent() { - return new SBSection(lldbJNI.SBSection_GetParent(swigCPtr, this), true); - } - - public SBSection FindSubSection(String sect_name) { - return new SBSection(lldbJNI.SBSection_FindSubSection(swigCPtr, this, sect_name), true); - } - - public long GetNumSubSections() { - return lldbJNI.SBSection_GetNumSubSections(swigCPtr, this); - } - - public SBSection GetSubSectionAtIndex(long idx) { - return new SBSection(lldbJNI.SBSection_GetSubSectionAtIndex(swigCPtr, this, idx), true); - } - - public java.math.BigInteger GetFileAddress() { - return lldbJNI.SBSection_GetFileAddress(swigCPtr, this); - } - - public java.math.BigInteger GetLoadAddress(SBTarget target) { - return lldbJNI.SBSection_GetLoadAddress(swigCPtr, this, SBTarget.getCPtr(target), target); - } - - public java.math.BigInteger GetByteSize() { - return lldbJNI.SBSection_GetByteSize(swigCPtr, this); - } - - public java.math.BigInteger GetFileOffset() { - return lldbJNI.SBSection_GetFileOffset(swigCPtr, this); - } - - public java.math.BigInteger GetFileByteSize() { - return lldbJNI.SBSection_GetFileByteSize(swigCPtr, this); - } - - public SBData GetSectionData() { - return new SBData(lldbJNI.SBSection_GetSectionData__SWIG_0(swigCPtr, this), true); - } - - public SBData GetSectionData(java.math.BigInteger offset, java.math.BigInteger size) { - return new SBData(lldbJNI.SBSection_GetSectionData__SWIG_1(swigCPtr, this, offset, size), true); - } - - public SectionType GetSectionType() { - return SectionType.swigToEnum(lldbJNI.SBSection_GetSectionType(swigCPtr, this)); - } - - public long GetPermissions() { - return lldbJNI.SBSection_GetPermissions(swigCPtr, this); - } - - public long GetTargetByteSize() { - return lldbJNI.SBSection_GetTargetByteSize(swigCPtr, this); - } - - public long GetAlignment() { - return lldbJNI.SBSection_GetAlignment(swigCPtr, this); - } - - public boolean GetDescription(SBStream description) { - return lldbJNI.SBSection_GetDescription(swigCPtr, this, SBStream.getCPtr(description), description); - } - - public String __repr__() { - return lldbJNI.SBSection___repr__(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBSourceManager.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBSourceManager.java deleted file mode 100644 index b670617ff9..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBSourceManager.java +++ /dev/null @@ -1,74 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBSourceManager { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBSourceManager(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBSourceManager obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBSourceManager obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBSourceManager(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBSourceManager(SBDebugger debugger) { - this(lldbJNI.new_SBSourceManager__SWIG_0(SBDebugger.getCPtr(debugger), debugger), true); - } - - public SBSourceManager(SBTarget target) { - this(lldbJNI.new_SBSourceManager__SWIG_1(SBTarget.getCPtr(target), target), true); - } - - public SBSourceManager(SBSourceManager rhs) { - this(lldbJNI.new_SBSourceManager__SWIG_2(SBSourceManager.getCPtr(rhs), rhs), true); - } - - public long DisplaySourceLinesWithLineNumbers(SBFileSpec file, long line, long context_before, long context_after, String current_line_cstr, SBStream s) { - return lldbJNI.SBSourceManager_DisplaySourceLinesWithLineNumbers(swigCPtr, this, SBFileSpec.getCPtr(file), file, line, context_before, context_after, current_line_cstr, SBStream.getCPtr(s), s); - } - - public long DisplaySourceLinesWithLineNumbersAndColumn(SBFileSpec file, long line, long column, long context_before, long context_after, String current_line_cstr, SBStream s) { - return lldbJNI.SBSourceManager_DisplaySourceLinesWithLineNumbersAndColumn(swigCPtr, this, SBFileSpec.getCPtr(file), file, line, column, context_before, context_after, current_line_cstr, SBStream.getCPtr(s), s); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBStream.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBStream.java deleted file mode 100644 index 38d23fc7dc..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBStream.java +++ /dev/null @@ -1,98 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBStream { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBStream(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBStream obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBStream obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBStream(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBStream() { - this(lldbJNI.new_SBStream(), true); - } - - public boolean IsValid() { - return lldbJNI.SBStream_IsValid(swigCPtr, this); - } - - public String GetData() { - return lldbJNI.SBStream_GetData(swigCPtr, this); - } - - public long GetSize() { - return lldbJNI.SBStream_GetSize(swigCPtr, this); - } - - public void Print(String str) { - lldbJNI.SBStream_Print(swigCPtr, this, str); - } - - public void RedirectToFile(String path, boolean append) { - lldbJNI.SBStream_RedirectToFile__SWIG_0(swigCPtr, this, path, append); - } - - public void RedirectToFile(SBFile file) { - lldbJNI.SBStream_RedirectToFile__SWIG_1(swigCPtr, this, SBFile.getCPtr(file), file); - } - - public void RedirectToFile(SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t file) { - lldbJNI.SBStream_RedirectToFile__SWIG_2(swigCPtr, this, SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t.getCPtr(file)); - } - - public void RedirectToFileDescriptor(int fd, boolean transfer_fh_ownership) { - lldbJNI.SBStream_RedirectToFileDescriptor(swigCPtr, this, fd, transfer_fh_ownership); - } - - public void Clear() { - lldbJNI.SBStream_Clear(swigCPtr, this); - } - - public void RedirectToFileHandle(SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t file, boolean transfer_fh_ownership) { - lldbJNI.SBStream_RedirectToFileHandle(swigCPtr, this, SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t.getCPtr(file), transfer_fh_ownership); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBStringList.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBStringList.java deleted file mode 100644 index 08dea4b1c8..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBStringList.java +++ /dev/null @@ -1,90 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBStringList { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBStringList(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBStringList obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBStringList obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBStringList(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBStringList() { - this(lldbJNI.new_SBStringList__SWIG_0(), true); - } - - public SBStringList(SBStringList rhs) { - this(lldbJNI.new_SBStringList__SWIG_1(SBStringList.getCPtr(rhs), rhs), true); - } - - public boolean IsValid() { - return lldbJNI.SBStringList_IsValid(swigCPtr, this); - } - - public void AppendString(String str) { - lldbJNI.SBStringList_AppendString(swigCPtr, this, str); - } - - public void AppendList(String[] strv, int strc) { - lldbJNI.SBStringList_AppendList__SWIG_0(swigCPtr, this, strv, strc); - } - - public void AppendList(SBStringList strings) { - lldbJNI.SBStringList_AppendList__SWIG_1(swigCPtr, this, SBStringList.getCPtr(strings), strings); - } - - public long GetSize() { - return lldbJNI.SBStringList_GetSize(swigCPtr, this); - } - - public String GetStringAtIndex(long idx) { - return lldbJNI.SBStringList_GetStringAtIndex__SWIG_0(swigCPtr, this, idx); - } - - public void Clear() { - lldbJNI.SBStringList_Clear(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBStructuredData.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBStructuredData.java deleted file mode 100644 index cdcd6a5fee..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBStructuredData.java +++ /dev/null @@ -1,158 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBStructuredData { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBStructuredData(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBStructuredData obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBStructuredData obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBStructuredData(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBStructuredData() { - this(lldbJNI.new_SBStructuredData__SWIG_0(), true); - } - - public SBStructuredData(SBStructuredData rhs) { - this(lldbJNI.new_SBStructuredData__SWIG_1(SBStructuredData.getCPtr(rhs), rhs), true); - } - - public SBStructuredData(SBScriptObject obj, SBDebugger debugger) { - this(lldbJNI.new_SBStructuredData__SWIG_2(SBScriptObject.getCPtr(obj), obj, SBDebugger.getCPtr(debugger), debugger), true); - } - - public boolean IsValid() { - return lldbJNI.SBStructuredData_IsValid(swigCPtr, this); - } - - public SBError SetFromJSON(SBStream stream) { - return new SBError(lldbJNI.SBStructuredData_SetFromJSON__SWIG_0(swigCPtr, this, SBStream.getCPtr(stream), stream), true); - } - - public SBError SetFromJSON(String json) { - return new SBError(lldbJNI.SBStructuredData_SetFromJSON__SWIG_1(swigCPtr, this, json), true); - } - - public void Clear() { - lldbJNI.SBStructuredData_Clear(swigCPtr, this); - } - - public SBError GetAsJSON(SBStream stream) { - return new SBError(lldbJNI.SBStructuredData_GetAsJSON(swigCPtr, this, SBStream.getCPtr(stream), stream), true); - } - - public SBError GetDescription(SBStream stream) { - return new SBError(lldbJNI.SBStructuredData_GetDescription(swigCPtr, this, SBStream.getCPtr(stream), stream), true); - } - - public StructuredDataType GetType() { - return StructuredDataType.swigToEnum(lldbJNI.SBStructuredData_GetType(swigCPtr, this)); - } - - public long GetSize() { - return lldbJNI.SBStructuredData_GetSize(swigCPtr, this); - } - - public boolean GetKeys(SBStringList keys) { - return lldbJNI.SBStructuredData_GetKeys(swigCPtr, this, SBStringList.getCPtr(keys), keys); - } - - public SBStructuredData GetValueForKey(String key) { - return new SBStructuredData(lldbJNI.SBStructuredData_GetValueForKey(swigCPtr, this, key), true); - } - - public SBStructuredData GetItemAtIndex(long idx) { - return new SBStructuredData(lldbJNI.SBStructuredData_GetItemAtIndex(swigCPtr, this, idx), true); - } - - public java.math.BigInteger GetUnsignedIntegerValue(java.math.BigInteger fail_value) { - return lldbJNI.SBStructuredData_GetUnsignedIntegerValue__SWIG_0(swigCPtr, this, fail_value); - } - - public java.math.BigInteger GetUnsignedIntegerValue() { - return lldbJNI.SBStructuredData_GetUnsignedIntegerValue__SWIG_1(swigCPtr, this); - } - - public long GetSignedIntegerValue(long fail_value) { - return lldbJNI.SBStructuredData_GetSignedIntegerValue__SWIG_0(swigCPtr, this, fail_value); - } - - public long GetSignedIntegerValue() { - return lldbJNI.SBStructuredData_GetSignedIntegerValue__SWIG_1(swigCPtr, this); - } - - public java.math.BigInteger GetIntegerValue(java.math.BigInteger fail_value) { - return lldbJNI.SBStructuredData_GetIntegerValue__SWIG_0(swigCPtr, this, fail_value); - } - - public java.math.BigInteger GetIntegerValue() { - return lldbJNI.SBStructuredData_GetIntegerValue__SWIG_1(swigCPtr, this); - } - - public double GetFloatValue(double fail_value) { - return lldbJNI.SBStructuredData_GetFloatValue__SWIG_0(swigCPtr, this, fail_value); - } - - public double GetFloatValue() { - return lldbJNI.SBStructuredData_GetFloatValue__SWIG_1(swigCPtr, this); - } - - public boolean GetBooleanValue(boolean fail_value) { - return lldbJNI.SBStructuredData_GetBooleanValue__SWIG_0(swigCPtr, this, fail_value); - } - - public boolean GetBooleanValue() { - return lldbJNI.SBStructuredData_GetBooleanValue__SWIG_1(swigCPtr, this); - } - - public long GetStringValue(String dst, long dst_len) { - return lldbJNI.SBStructuredData_GetStringValue(swigCPtr, this, dst, dst_len); - } - - public SBScriptObject GetGenericValue() { - return new SBScriptObject(lldbJNI.SBStructuredData_GetGenericValue(swigCPtr, this), true); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBSymbol.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBSymbol.java deleted file mode 100644 index 33bd509442..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBSymbol.java +++ /dev/null @@ -1,126 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBSymbol { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBSymbol(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBSymbol obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBSymbol obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBSymbol(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBSymbol() { - this(lldbJNI.new_SBSymbol__SWIG_0(), true); - } - - public SBSymbol(SBSymbol rhs) { - this(lldbJNI.new_SBSymbol__SWIG_1(SBSymbol.getCPtr(rhs), rhs), true); - } - - public boolean IsValid() { - return lldbJNI.SBSymbol_IsValid(swigCPtr, this); - } - - public String GetName() { - return lldbJNI.SBSymbol_GetName(swigCPtr, this); - } - - public String GetDisplayName() { - return lldbJNI.SBSymbol_GetDisplayName(swigCPtr, this); - } - - public String GetMangledName() { - return lldbJNI.SBSymbol_GetMangledName(swigCPtr, this); - } - - public SBInstructionList GetInstructions(SBTarget target) { - return new SBInstructionList(lldbJNI.SBSymbol_GetInstructions__SWIG_0(swigCPtr, this, SBTarget.getCPtr(target), target), true); - } - - public SBInstructionList GetInstructions(SBTarget target, String flavor_string) { - return new SBInstructionList(lldbJNI.SBSymbol_GetInstructions__SWIG_1(swigCPtr, this, SBTarget.getCPtr(target), target, flavor_string), true); - } - - public SBAddress GetStartAddress() { - return new SBAddress(lldbJNI.SBSymbol_GetStartAddress(swigCPtr, this), true); - } - - public SBAddress GetEndAddress() { - return new SBAddress(lldbJNI.SBSymbol_GetEndAddress(swigCPtr, this), true); - } - - public java.math.BigInteger GetValue() { - return lldbJNI.SBSymbol_GetValue(swigCPtr, this); - } - - public java.math.BigInteger GetSize() { - return lldbJNI.SBSymbol_GetSize(swigCPtr, this); - } - - public long GetPrologueByteSize() { - return lldbJNI.SBSymbol_GetPrologueByteSize(swigCPtr, this); - } - - public SymbolType GetType() { - return SymbolType.swigToEnum(lldbJNI.SBSymbol_GetType(swigCPtr, this)); - } - - public boolean GetDescription(SBStream description) { - return lldbJNI.SBSymbol_GetDescription(swigCPtr, this, SBStream.getCPtr(description), description); - } - - public boolean IsExternal() { - return lldbJNI.SBSymbol_IsExternal(swigCPtr, this); - } - - public boolean IsSynthetic() { - return lldbJNI.SBSymbol_IsSynthetic(swigCPtr, this); - } - - public String __repr__() { - return lldbJNI.SBSymbol___repr__(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBSymbolContext.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBSymbolContext.java deleted file mode 100644 index 25e7cf4870..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBSymbolContext.java +++ /dev/null @@ -1,126 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBSymbolContext { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBSymbolContext(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBSymbolContext obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBSymbolContext obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBSymbolContext(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBSymbolContext() { - this(lldbJNI.new_SBSymbolContext__SWIG_0(), true); - } - - public SBSymbolContext(SBSymbolContext rhs) { - this(lldbJNI.new_SBSymbolContext__SWIG_1(SBSymbolContext.getCPtr(rhs), rhs), true); - } - - public boolean IsValid() { - return lldbJNI.SBSymbolContext_IsValid(swigCPtr, this); - } - - public SBModule GetModule() { - return new SBModule(lldbJNI.SBSymbolContext_GetModule(swigCPtr, this), true); - } - - public SBCompileUnit GetCompileUnit() { - return new SBCompileUnit(lldbJNI.SBSymbolContext_GetCompileUnit(swigCPtr, this), true); - } - - public SBFunction GetFunction() { - return new SBFunction(lldbJNI.SBSymbolContext_GetFunction(swigCPtr, this), true); - } - - public SBBlock GetBlock() { - return new SBBlock(lldbJNI.SBSymbolContext_GetBlock(swigCPtr, this), true); - } - - public SBLineEntry GetLineEntry() { - return new SBLineEntry(lldbJNI.SBSymbolContext_GetLineEntry(swigCPtr, this), true); - } - - public SBSymbol GetSymbol() { - return new SBSymbol(lldbJNI.SBSymbolContext_GetSymbol(swigCPtr, this), true); - } - - public void SetModule(SBModule module) { - lldbJNI.SBSymbolContext_SetModule(swigCPtr, this, SBModule.getCPtr(module), module); - } - - public void SetCompileUnit(SBCompileUnit compile_unit) { - lldbJNI.SBSymbolContext_SetCompileUnit(swigCPtr, this, SBCompileUnit.getCPtr(compile_unit), compile_unit); - } - - public void SetFunction(SBFunction function) { - lldbJNI.SBSymbolContext_SetFunction(swigCPtr, this, SBFunction.getCPtr(function), function); - } - - public void SetBlock(SBBlock block) { - lldbJNI.SBSymbolContext_SetBlock(swigCPtr, this, SBBlock.getCPtr(block), block); - } - - public void SetLineEntry(SBLineEntry line_entry) { - lldbJNI.SBSymbolContext_SetLineEntry(swigCPtr, this, SBLineEntry.getCPtr(line_entry), line_entry); - } - - public void SetSymbol(SBSymbol symbol) { - lldbJNI.SBSymbolContext_SetSymbol(swigCPtr, this, SBSymbol.getCPtr(symbol), symbol); - } - - public SBSymbolContext GetParentOfInlinedScope(SBAddress curr_frame_pc, SBAddress parent_frame_addr) { - return new SBSymbolContext(lldbJNI.SBSymbolContext_GetParentOfInlinedScope(swigCPtr, this, SBAddress.getCPtr(curr_frame_pc), curr_frame_pc, SBAddress.getCPtr(parent_frame_addr), parent_frame_addr), true); - } - - public boolean GetDescription(SBStream description) { - return lldbJNI.SBSymbolContext_GetDescription(swigCPtr, this, SBStream.getCPtr(description), description); - } - - public String __repr__() { - return lldbJNI.SBSymbolContext___repr__(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBSymbolContextList.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBSymbolContextList.java deleted file mode 100644 index 9fdff1443e..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBSymbolContextList.java +++ /dev/null @@ -1,94 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBSymbolContextList { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBSymbolContextList(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBSymbolContextList obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBSymbolContextList obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBSymbolContextList(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBSymbolContextList() { - this(lldbJNI.new_SBSymbolContextList__SWIG_0(), true); - } - - public SBSymbolContextList(SBSymbolContextList rhs) { - this(lldbJNI.new_SBSymbolContextList__SWIG_1(SBSymbolContextList.getCPtr(rhs), rhs), true); - } - - public boolean IsValid() { - return lldbJNI.SBSymbolContextList_IsValid(swigCPtr, this); - } - - public long GetSize() { - return lldbJNI.SBSymbolContextList_GetSize(swigCPtr, this); - } - - public SBSymbolContext GetContextAtIndex(long idx) { - return new SBSymbolContext(lldbJNI.SBSymbolContextList_GetContextAtIndex(swigCPtr, this, idx), true); - } - - public boolean GetDescription(SBStream description) { - return lldbJNI.SBSymbolContextList_GetDescription(swigCPtr, this, SBStream.getCPtr(description), description); - } - - public void Append(SBSymbolContext sc) { - lldbJNI.SBSymbolContextList_Append__SWIG_0(swigCPtr, this, SBSymbolContext.getCPtr(sc), sc); - } - - public void Append(SBSymbolContextList sc_list) { - lldbJNI.SBSymbolContextList_Append__SWIG_1(swigCPtr, this, SBSymbolContextList.getCPtr(sc_list), sc_list); - } - - public void Clear() { - lldbJNI.SBSymbolContextList_Clear(swigCPtr, this); - } - - public String __repr__() { - return lldbJNI.SBSymbolContextList___repr__(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTarget.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTarget.java deleted file mode 100644 index a854c95d66..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTarget.java +++ /dev/null @@ -1,600 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBTarget { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBTarget(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBTarget obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBTarget obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBTarget(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBTarget() { - this(lldbJNI.new_SBTarget__SWIG_0(), true); - } - - public SBTarget(SBTarget rhs) { - this(lldbJNI.new_SBTarget__SWIG_1(SBTarget.getCPtr(rhs), rhs), true); - } - - public boolean IsValid() { - return lldbJNI.SBTarget_IsValid(swigCPtr, this); - } - - public static boolean EventIsTargetEvent(SBEvent event) { - return lldbJNI.SBTarget_EventIsTargetEvent(SBEvent.getCPtr(event), event); - } - - public static SBTarget GetTargetFromEvent(SBEvent event) { - return new SBTarget(lldbJNI.SBTarget_GetTargetFromEvent(SBEvent.getCPtr(event), event), true); - } - - public static long GetNumModulesFromEvent(SBEvent event) { - return lldbJNI.SBTarget_GetNumModulesFromEvent(SBEvent.getCPtr(event), event); - } - - public static SBModule GetModuleAtIndexFromEvent(long idx, SBEvent event) { - return new SBModule(lldbJNI.SBTarget_GetModuleAtIndexFromEvent(idx, SBEvent.getCPtr(event), event), true); - } - - public static String GetBroadcasterClassName() { - return lldbJNI.SBTarget_GetBroadcasterClassName(); - } - - public SBProcess GetProcess() { - return new SBProcess(lldbJNI.SBTarget_GetProcess(swigCPtr, this), true); - } - - public void SetCollectingStats(boolean v) { - lldbJNI.SBTarget_SetCollectingStats(swigCPtr, this, v); - } - - public boolean GetCollectingStats() { - return lldbJNI.SBTarget_GetCollectingStats(swigCPtr, this); - } - - public SBStructuredData GetStatistics() { - return new SBStructuredData(lldbJNI.SBTarget_GetStatistics(swigCPtr, this), true); - } - - public SBPlatform GetPlatform() { - return new SBPlatform(lldbJNI.SBTarget_GetPlatform(swigCPtr, this), true); - } - - public SBEnvironment GetEnvironment() { - return new SBEnvironment(lldbJNI.SBTarget_GetEnvironment(swigCPtr, this), true); - } - - public SBError Install() { - return new SBError(lldbJNI.SBTarget_Install(swigCPtr, this), true); - } - - public SBProcess Launch(SBListener listener, String[] argv, String[] envp, String stdin_path, String stdout_path, String stderr_path, String working_directory, long launch_flags, boolean stop_at_entry, SBError error) { - return new SBProcess(lldbJNI.SBTarget_Launch__SWIG_0(swigCPtr, this, SBListener.getCPtr(listener), listener, argv, envp, stdin_path, stdout_path, stderr_path, working_directory, launch_flags, stop_at_entry, SBError.getCPtr(error), error), true); - } - - public SBProcess LoadCore(String core_file) { - return new SBProcess(lldbJNI.SBTarget_LoadCore__SWIG_0(swigCPtr, this, core_file), true); - } - - public SBProcess LoadCore(String core_file, SBError error) { - return new SBProcess(lldbJNI.SBTarget_LoadCore__SWIG_1(swigCPtr, this, core_file, SBError.getCPtr(error), error), true); - } - - public SBProcess LaunchSimple(String[] argv, String[] envp, String working_directory) { - return new SBProcess(lldbJNI.SBTarget_LaunchSimple(swigCPtr, this, argv, envp, working_directory), true); - } - - public SBProcess Launch(SBLaunchInfo launch_info, SBError error) { - return new SBProcess(lldbJNI.SBTarget_Launch__SWIG_1(swigCPtr, this, SBLaunchInfo.getCPtr(launch_info), launch_info, SBError.getCPtr(error), error), true); - } - - public SBProcess Attach(SBAttachInfo attach_info, SBError error) { - return new SBProcess(lldbJNI.SBTarget_Attach(swigCPtr, this, SBAttachInfo.getCPtr(attach_info), attach_info, SBError.getCPtr(error), error), true); - } - - public SBProcess AttachToProcessWithID(SBListener listener, java.math.BigInteger pid, SBError error) { - return new SBProcess(lldbJNI.SBTarget_AttachToProcessWithID(swigCPtr, this, SBListener.getCPtr(listener), listener, pid, SBError.getCPtr(error), error), true); - } - - public SBProcess AttachToProcessWithName(SBListener listener, String name, boolean wait_for, SBError error) { - return new SBProcess(lldbJNI.SBTarget_AttachToProcessWithName(swigCPtr, this, SBListener.getCPtr(listener), listener, name, wait_for, SBError.getCPtr(error), error), true); - } - - public SBProcess ConnectRemote(SBListener listener, String url, String plugin_name, SBError error) { - return new SBProcess(lldbJNI.SBTarget_ConnectRemote(swigCPtr, this, SBListener.getCPtr(listener), listener, url, plugin_name, SBError.getCPtr(error), error), true); - } - - public SBFileSpec GetExecutable() { - return new SBFileSpec(lldbJNI.SBTarget_GetExecutable(swigCPtr, this), true); - } - - public void AppendImageSearchPath(String from, String to, SBError error) { - lldbJNI.SBTarget_AppendImageSearchPath(swigCPtr, this, from, to, SBError.getCPtr(error), error); - } - - public boolean AddModule(SBModule module) { - return lldbJNI.SBTarget_AddModule__SWIG_0(swigCPtr, this, SBModule.getCPtr(module), module); - } - - public SBModule AddModule(String path, String triple, String uuid) { - return new SBModule(lldbJNI.SBTarget_AddModule__SWIG_1(swigCPtr, this, path, triple, uuid), true); - } - - public SBModule AddModule(String path, String triple, String uuid_cstr, String symfile) { - return new SBModule(lldbJNI.SBTarget_AddModule__SWIG_2(swigCPtr, this, path, triple, uuid_cstr, symfile), true); - } - - public SBModule AddModule(SBModuleSpec module_spec) { - return new SBModule(lldbJNI.SBTarget_AddModule__SWIG_3(swigCPtr, this, SBModuleSpec.getCPtr(module_spec), module_spec), true); - } - - public long GetNumModules() { - return lldbJNI.SBTarget_GetNumModules(swigCPtr, this); - } - - public SBModule GetModuleAtIndex(long idx) { - return new SBModule(lldbJNI.SBTarget_GetModuleAtIndex(swigCPtr, this, idx), true); - } - - public boolean RemoveModule(SBModule module) { - return lldbJNI.SBTarget_RemoveModule(swigCPtr, this, SBModule.getCPtr(module), module); - } - - public SBDebugger GetDebugger() { - return new SBDebugger(lldbJNI.SBTarget_GetDebugger(swigCPtr, this), true); - } - - public SBModule FindModule(SBFileSpec file_spec) { - return new SBModule(lldbJNI.SBTarget_FindModule(swigCPtr, this, SBFileSpec.getCPtr(file_spec), file_spec), true); - } - - public SBSymbolContextList FindCompileUnits(SBFileSpec sb_file_spec) { - return new SBSymbolContextList(lldbJNI.SBTarget_FindCompileUnits(swigCPtr, this, SBFileSpec.getCPtr(sb_file_spec), sb_file_spec), true); - } - - public ByteOrder GetByteOrder() { - return ByteOrder.swigToEnum(lldbJNI.SBTarget_GetByteOrder(swigCPtr, this)); - } - - public long GetAddressByteSize() { - return lldbJNI.SBTarget_GetAddressByteSize(swigCPtr, this); - } - - public String GetTriple() { - return lldbJNI.SBTarget_GetTriple(swigCPtr, this); - } - - public String GetABIName() { - return lldbJNI.SBTarget_GetABIName(swigCPtr, this); - } - - public String GetLabel() { - return lldbJNI.SBTarget_GetLabel(swigCPtr, this); - } - - public SBError SetLabel(String label) { - return new SBError(lldbJNI.SBTarget_SetLabel(swigCPtr, this, label), true); - } - - public long GetDataByteSize() { - return lldbJNI.SBTarget_GetDataByteSize(swigCPtr, this); - } - - public long GetCodeByteSize() { - return lldbJNI.SBTarget_GetCodeByteSize(swigCPtr, this); - } - - public long GetMaximumNumberOfChildrenToDisplay() { - return lldbJNI.SBTarget_GetMaximumNumberOfChildrenToDisplay(swigCPtr, this); - } - - public SBError SetSectionLoadAddress(SBSection section, java.math.BigInteger section_base_addr) { - return new SBError(lldbJNI.SBTarget_SetSectionLoadAddress(swigCPtr, this, SBSection.getCPtr(section), section, section_base_addr), true); - } - - public SBError ClearSectionLoadAddress(SBSection section) { - return new SBError(lldbJNI.SBTarget_ClearSectionLoadAddress(swigCPtr, this, SBSection.getCPtr(section), section), true); - } - - public SBError SetModuleLoadAddress(SBModule module, java.math.BigInteger sections_offset) { - return new SBError(lldbJNI.SBTarget_SetModuleLoadAddress(swigCPtr, this, SBModule.getCPtr(module), module, sections_offset), true); - } - - public SBError ClearModuleLoadAddress(SBModule module) { - return new SBError(lldbJNI.SBTarget_ClearModuleLoadAddress(swigCPtr, this, SBModule.getCPtr(module), module), true); - } - - public SBSymbolContextList FindFunctions(String name, long name_type_mask) { - return new SBSymbolContextList(lldbJNI.SBTarget_FindFunctions__SWIG_0(swigCPtr, this, name, name_type_mask), true); - } - - public SBSymbolContextList FindFunctions(String name) { - return new SBSymbolContextList(lldbJNI.SBTarget_FindFunctions__SWIG_1(swigCPtr, this, name), true); - } - - public SBValueList FindGlobalVariables(String name, long max_matches) { - return new SBValueList(lldbJNI.SBTarget_FindGlobalVariables__SWIG_0(swigCPtr, this, name, max_matches), true); - } - - public SBValue FindFirstGlobalVariable(String name) { - return new SBValue(lldbJNI.SBTarget_FindFirstGlobalVariable(swigCPtr, this, name), true); - } - - public SBValueList FindGlobalVariables(String name, long max_matches, MatchType matchtype) { - return new SBValueList(lldbJNI.SBTarget_FindGlobalVariables__SWIG_1(swigCPtr, this, name, max_matches, matchtype.swigValue()), true); - } - - public SBSymbolContextList FindGlobalFunctions(String name, long max_matches, MatchType matchtype) { - return new SBSymbolContextList(lldbJNI.SBTarget_FindGlobalFunctions(swigCPtr, this, name, max_matches, matchtype.swigValue()), true); - } - - public void Clear() { - lldbJNI.SBTarget_Clear(swigCPtr, this); - } - - public SBAddress ResolveFileAddress(java.math.BigInteger file_addr) { - return new SBAddress(lldbJNI.SBTarget_ResolveFileAddress(swigCPtr, this, file_addr), true); - } - - public SBAddress ResolveLoadAddress(java.math.BigInteger vm_addr) { - return new SBAddress(lldbJNI.SBTarget_ResolveLoadAddress(swigCPtr, this, vm_addr), true); - } - - public SBAddress ResolvePastLoadAddress(long stop_id, java.math.BigInteger vm_addr) { - return new SBAddress(lldbJNI.SBTarget_ResolvePastLoadAddress(swigCPtr, this, stop_id, vm_addr), true); - } - - public SBSymbolContext ResolveSymbolContextForAddress(SBAddress addr, long resolve_scope) { - return new SBSymbolContext(lldbJNI.SBTarget_ResolveSymbolContextForAddress(swigCPtr, this, SBAddress.getCPtr(addr), addr, resolve_scope), true); - } - - public long ReadMemory(SBAddress addr, SWIGTYPE_p_void buf, long size, SBError error) { - return lldbJNI.SBTarget_ReadMemory(swigCPtr, this, SBAddress.getCPtr(addr), addr, SWIGTYPE_p_void.getCPtr(buf), size, SBError.getCPtr(error), error); - } - - public SBBreakpoint BreakpointCreateByLocation(String file, long line) { - return new SBBreakpoint(lldbJNI.SBTarget_BreakpointCreateByLocation__SWIG_0(swigCPtr, this, file, line), true); - } - - public SBBreakpoint BreakpointCreateByLocation(SBFileSpec file_spec, long line) { - return new SBBreakpoint(lldbJNI.SBTarget_BreakpointCreateByLocation__SWIG_1(swigCPtr, this, SBFileSpec.getCPtr(file_spec), file_spec, line), true); - } - - public SBBreakpoint BreakpointCreateByLocation(SBFileSpec file_spec, long line, java.math.BigInteger offset) { - return new SBBreakpoint(lldbJNI.SBTarget_BreakpointCreateByLocation__SWIG_2(swigCPtr, this, SBFileSpec.getCPtr(file_spec), file_spec, line, offset), true); - } - - public SBBreakpoint BreakpointCreateByLocation(SBFileSpec file_spec, long line, java.math.BigInteger offset, SBFileSpecList module_list) { - return new SBBreakpoint(lldbJNI.SBTarget_BreakpointCreateByLocation__SWIG_3(swigCPtr, this, SBFileSpec.getCPtr(file_spec), file_spec, line, offset, SBFileSpecList.getCPtr(module_list), module_list), true); - } - - public SBBreakpoint BreakpointCreateByLocation(SBFileSpec file_spec, long line, long column, java.math.BigInteger offset, SBFileSpecList module_list) { - return new SBBreakpoint(lldbJNI.SBTarget_BreakpointCreateByLocation__SWIG_4(swigCPtr, this, SBFileSpec.getCPtr(file_spec), file_spec, line, column, offset, SBFileSpecList.getCPtr(module_list), module_list), true); - } - - public SBBreakpoint BreakpointCreateByLocation(SBFileSpec file_spec, long line, long column, java.math.BigInteger offset, SBFileSpecList module_list, boolean move_to_nearest_code) { - return new SBBreakpoint(lldbJNI.SBTarget_BreakpointCreateByLocation__SWIG_5(swigCPtr, this, SBFileSpec.getCPtr(file_spec), file_spec, line, column, offset, SBFileSpecList.getCPtr(module_list), module_list, move_to_nearest_code), true); - } - - public SBBreakpoint BreakpointCreateByName(String symbol_name, String module_name) { - return new SBBreakpoint(lldbJNI.SBTarget_BreakpointCreateByName__SWIG_0(swigCPtr, this, symbol_name, module_name), true); - } - - public SBBreakpoint BreakpointCreateByName(String symbol_name) { - return new SBBreakpoint(lldbJNI.SBTarget_BreakpointCreateByName__SWIG_1(swigCPtr, this, symbol_name), true); - } - - public SBBreakpoint BreakpointCreateByName(String symbol_name, SBFileSpecList module_list, SBFileSpecList comp_unit_list) { - return new SBBreakpoint(lldbJNI.SBTarget_BreakpointCreateByName__SWIG_2(swigCPtr, this, symbol_name, SBFileSpecList.getCPtr(module_list), module_list, SBFileSpecList.getCPtr(comp_unit_list), comp_unit_list), true); - } - - public SBBreakpoint BreakpointCreateByName(String symbol_name, long name_type_mask, SBFileSpecList module_list, SBFileSpecList comp_unit_list) { - return new SBBreakpoint(lldbJNI.SBTarget_BreakpointCreateByName__SWIG_3(swigCPtr, this, symbol_name, name_type_mask, SBFileSpecList.getCPtr(module_list), module_list, SBFileSpecList.getCPtr(comp_unit_list), comp_unit_list), true); - } - - public SBBreakpoint BreakpointCreateByName(String symbol_name, long name_type_mask, LanguageType symbol_language, SBFileSpecList module_list, SBFileSpecList comp_unit_list) { - return new SBBreakpoint(lldbJNI.SBTarget_BreakpointCreateByName__SWIG_4(swigCPtr, this, symbol_name, name_type_mask, symbol_language.swigValue(), SBFileSpecList.getCPtr(module_list), module_list, SBFileSpecList.getCPtr(comp_unit_list), comp_unit_list), true); - } - - public SBBreakpoint BreakpointCreateByNames(String[] symbol_name, long num_names, long name_type_mask, SBFileSpecList module_list, SBFileSpecList comp_unit_list) { - return new SBBreakpoint(lldbJNI.SBTarget_BreakpointCreateByNames__SWIG_0(swigCPtr, this, symbol_name, num_names, name_type_mask, SBFileSpecList.getCPtr(module_list), module_list, SBFileSpecList.getCPtr(comp_unit_list), comp_unit_list), true); - } - - public SBBreakpoint BreakpointCreateByNames(String[] symbol_name, long num_names, long name_type_mask, LanguageType symbol_language, SBFileSpecList module_list, SBFileSpecList comp_unit_list) { - return new SBBreakpoint(lldbJNI.SBTarget_BreakpointCreateByNames__SWIG_1(swigCPtr, this, symbol_name, num_names, name_type_mask, symbol_language.swigValue(), SBFileSpecList.getCPtr(module_list), module_list, SBFileSpecList.getCPtr(comp_unit_list), comp_unit_list), true); - } - - public SBBreakpoint BreakpointCreateByNames(String[] symbol_name, long num_names, long name_type_mask, LanguageType symbol_language, java.math.BigInteger offset, SBFileSpecList module_list, SBFileSpecList comp_unit_list) { - return new SBBreakpoint(lldbJNI.SBTarget_BreakpointCreateByNames__SWIG_2(swigCPtr, this, symbol_name, num_names, name_type_mask, symbol_language.swigValue(), offset, SBFileSpecList.getCPtr(module_list), module_list, SBFileSpecList.getCPtr(comp_unit_list), comp_unit_list), true); - } - - public SBBreakpoint BreakpointCreateByRegex(String symbol_name_regex, String module_name) { - return new SBBreakpoint(lldbJNI.SBTarget_BreakpointCreateByRegex__SWIG_0(swigCPtr, this, symbol_name_regex, module_name), true); - } - - public SBBreakpoint BreakpointCreateByRegex(String symbol_name_regex) { - return new SBBreakpoint(lldbJNI.SBTarget_BreakpointCreateByRegex__SWIG_1(swigCPtr, this, symbol_name_regex), true); - } - - public SBBreakpoint BreakpointCreateByRegex(String symbol_name_regex, SBFileSpecList module_list, SBFileSpecList comp_unit_list) { - return new SBBreakpoint(lldbJNI.SBTarget_BreakpointCreateByRegex__SWIG_2(swigCPtr, this, symbol_name_regex, SBFileSpecList.getCPtr(module_list), module_list, SBFileSpecList.getCPtr(comp_unit_list), comp_unit_list), true); - } - - public SBBreakpoint BreakpointCreateByRegex(String symbol_name_regex, LanguageType symbol_language, SBFileSpecList module_list, SBFileSpecList comp_unit_list) { - return new SBBreakpoint(lldbJNI.SBTarget_BreakpointCreateByRegex__SWIG_3(swigCPtr, this, symbol_name_regex, symbol_language.swigValue(), SBFileSpecList.getCPtr(module_list), module_list, SBFileSpecList.getCPtr(comp_unit_list), comp_unit_list), true); - } - - public SBBreakpoint BreakpointCreateBySourceRegex(String source_regex, SBFileSpec source_file, String module_name) { - return new SBBreakpoint(lldbJNI.SBTarget_BreakpointCreateBySourceRegex__SWIG_0(swigCPtr, this, source_regex, SBFileSpec.getCPtr(source_file), source_file, module_name), true); - } - - public SBBreakpoint BreakpointCreateBySourceRegex(String source_regex, SBFileSpec source_file) { - return new SBBreakpoint(lldbJNI.SBTarget_BreakpointCreateBySourceRegex__SWIG_1(swigCPtr, this, source_regex, SBFileSpec.getCPtr(source_file), source_file), true); - } - - public SBBreakpoint BreakpointCreateBySourceRegex(String source_regex, SBFileSpecList module_list, SBFileSpecList source_file) { - return new SBBreakpoint(lldbJNI.SBTarget_BreakpointCreateBySourceRegex__SWIG_2(swigCPtr, this, source_regex, SBFileSpecList.getCPtr(module_list), module_list, SBFileSpecList.getCPtr(source_file), source_file), true); - } - - public SBBreakpoint BreakpointCreateBySourceRegex(String source_regex, SBFileSpecList module_list, SBFileSpecList source_file, SBStringList func_names) { - return new SBBreakpoint(lldbJNI.SBTarget_BreakpointCreateBySourceRegex__SWIG_3(swigCPtr, this, source_regex, SBFileSpecList.getCPtr(module_list), module_list, SBFileSpecList.getCPtr(source_file), source_file, SBStringList.getCPtr(func_names), func_names), true); - } - - public SBBreakpoint BreakpointCreateForException(LanguageType language, boolean catch_bp, boolean throw_bp) { - return new SBBreakpoint(lldbJNI.SBTarget_BreakpointCreateForException(swigCPtr, this, language.swigValue(), catch_bp, throw_bp), true); - } - - public SBBreakpoint BreakpointCreateByAddress(java.math.BigInteger address) { - return new SBBreakpoint(lldbJNI.SBTarget_BreakpointCreateByAddress(swigCPtr, this, address), true); - } - - public SBBreakpoint BreakpointCreateBySBAddress(SBAddress address) { - return new SBBreakpoint(lldbJNI.SBTarget_BreakpointCreateBySBAddress(swigCPtr, this, SBAddress.getCPtr(address), address), true); - } - - public SBBreakpoint BreakpointCreateFromScript(String class_name, SBStructuredData extra_args, SBFileSpecList module_list, SBFileSpecList file_list, boolean request_hardware) { - return new SBBreakpoint(lldbJNI.SBTarget_BreakpointCreateFromScript__SWIG_0(swigCPtr, this, class_name, SBStructuredData.getCPtr(extra_args), extra_args, SBFileSpecList.getCPtr(module_list), module_list, SBFileSpecList.getCPtr(file_list), file_list, request_hardware), true); - } - - public SBBreakpoint BreakpointCreateFromScript(String class_name, SBStructuredData extra_args, SBFileSpecList module_list, SBFileSpecList file_list) { - return new SBBreakpoint(lldbJNI.SBTarget_BreakpointCreateFromScript__SWIG_1(swigCPtr, this, class_name, SBStructuredData.getCPtr(extra_args), extra_args, SBFileSpecList.getCPtr(module_list), module_list, SBFileSpecList.getCPtr(file_list), file_list), true); - } - - public SBError BreakpointsCreateFromFile(SBFileSpec source_file, SBBreakpointList new_bps) { - return new SBError(lldbJNI.SBTarget_BreakpointsCreateFromFile__SWIG_0(swigCPtr, this, SBFileSpec.getCPtr(source_file), source_file, SBBreakpointList.getCPtr(new_bps), new_bps), true); - } - - public SBError BreakpointsCreateFromFile(SBFileSpec source_file, SBStringList matching_names, SBBreakpointList new_bps) { - return new SBError(lldbJNI.SBTarget_BreakpointsCreateFromFile__SWIG_1(swigCPtr, this, SBFileSpec.getCPtr(source_file), source_file, SBStringList.getCPtr(matching_names), matching_names, SBBreakpointList.getCPtr(new_bps), new_bps), true); - } - - public SBError BreakpointsWriteToFile(SBFileSpec dest_file) { - return new SBError(lldbJNI.SBTarget_BreakpointsWriteToFile__SWIG_0(swigCPtr, this, SBFileSpec.getCPtr(dest_file), dest_file), true); - } - - public SBError BreakpointsWriteToFile(SBFileSpec dest_file, SBBreakpointList bkpt_list, boolean append) { - return new SBError(lldbJNI.SBTarget_BreakpointsWriteToFile__SWIG_1(swigCPtr, this, SBFileSpec.getCPtr(dest_file), dest_file, SBBreakpointList.getCPtr(bkpt_list), bkpt_list, append), true); - } - - public SBError BreakpointsWriteToFile(SBFileSpec dest_file, SBBreakpointList bkpt_list) { - return new SBError(lldbJNI.SBTarget_BreakpointsWriteToFile__SWIG_2(swigCPtr, this, SBFileSpec.getCPtr(dest_file), dest_file, SBBreakpointList.getCPtr(bkpt_list), bkpt_list), true); - } - - public long GetNumBreakpoints() { - return lldbJNI.SBTarget_GetNumBreakpoints(swigCPtr, this); - } - - public SBBreakpoint GetBreakpointAtIndex(long idx) { - return new SBBreakpoint(lldbJNI.SBTarget_GetBreakpointAtIndex(swigCPtr, this, idx), true); - } - - public boolean BreakpointDelete(int break_id) { - return lldbJNI.SBTarget_BreakpointDelete(swigCPtr, this, break_id); - } - - public SBBreakpoint FindBreakpointByID(int break_id) { - return new SBBreakpoint(lldbJNI.SBTarget_FindBreakpointByID(swigCPtr, this, break_id), true); - } - - public boolean FindBreakpointsByName(String name, SBBreakpointList bkpt_list) { - return lldbJNI.SBTarget_FindBreakpointsByName(swigCPtr, this, name, SBBreakpointList.getCPtr(bkpt_list), bkpt_list); - } - - public void GetBreakpointNames(SBStringList names) { - lldbJNI.SBTarget_GetBreakpointNames(swigCPtr, this, SBStringList.getCPtr(names), names); - } - - public void DeleteBreakpointName(String name) { - lldbJNI.SBTarget_DeleteBreakpointName(swigCPtr, this, name); - } - - public boolean EnableAllBreakpoints() { - return lldbJNI.SBTarget_EnableAllBreakpoints(swigCPtr, this); - } - - public boolean DisableAllBreakpoints() { - return lldbJNI.SBTarget_DisableAllBreakpoints(swigCPtr, this); - } - - public boolean DeleteAllBreakpoints() { - return lldbJNI.SBTarget_DeleteAllBreakpoints(swigCPtr, this); - } - - public long GetNumWatchpoints() { - return lldbJNI.SBTarget_GetNumWatchpoints(swigCPtr, this); - } - - public SBWatchpoint GetWatchpointAtIndex(long idx) { - return new SBWatchpoint(lldbJNI.SBTarget_GetWatchpointAtIndex(swigCPtr, this, idx), true); - } - - public boolean DeleteWatchpoint(int watch_id) { - return lldbJNI.SBTarget_DeleteWatchpoint(swigCPtr, this, watch_id); - } - - public SBWatchpoint FindWatchpointByID(int watch_id) { - return new SBWatchpoint(lldbJNI.SBTarget_FindWatchpointByID(swigCPtr, this, watch_id), true); - } - - public SBWatchpoint WatchAddress(java.math.BigInteger addr, long size, boolean read, boolean write, SBError error) { - return new SBWatchpoint(lldbJNI.SBTarget_WatchAddress(swigCPtr, this, addr, size, read, write, SBError.getCPtr(error), error), true); - } - - public boolean EnableAllWatchpoints() { - return lldbJNI.SBTarget_EnableAllWatchpoints(swigCPtr, this); - } - - public boolean DisableAllWatchpoints() { - return lldbJNI.SBTarget_DisableAllWatchpoints(swigCPtr, this); - } - - public boolean DeleteAllWatchpoints() { - return lldbJNI.SBTarget_DeleteAllWatchpoints(swigCPtr, this); - } - - public SBBroadcaster GetBroadcaster() { - return new SBBroadcaster(lldbJNI.SBTarget_GetBroadcaster(swigCPtr, this), true); - } - - public SBType FindFirstType(String type) { - return new SBType(lldbJNI.SBTarget_FindFirstType(swigCPtr, this, type), true); - } - - public SBTypeList FindTypes(String type) { - return new SBTypeList(lldbJNI.SBTarget_FindTypes(swigCPtr, this, type), true); - } - - public SBType GetBasicType(BasicType type) { - return new SBType(lldbJNI.SBTarget_GetBasicType(swigCPtr, this, type.swigValue()), true); - } - - public SBValue CreateValueFromAddress(String name, SBAddress addr, SBType type) { - return new SBValue(lldbJNI.SBTarget_CreateValueFromAddress(swigCPtr, this, name, SBAddress.getCPtr(addr), addr, SBType.getCPtr(type), type), true); - } - - public SBValue CreateValueFromData(String name, SBData data, SBType type) { - return new SBValue(lldbJNI.SBTarget_CreateValueFromData(swigCPtr, this, name, SBData.getCPtr(data), data, SBType.getCPtr(type), type), true); - } - - public SBValue CreateValueFromExpression(String name, String expr) { - return new SBValue(lldbJNI.SBTarget_CreateValueFromExpression(swigCPtr, this, name, expr), true); - } - - public SBSourceManager GetSourceManager() { - return new SBSourceManager(lldbJNI.SBTarget_GetSourceManager(swigCPtr, this), true); - } - - public SBInstructionList ReadInstructions(SBAddress base_addr, long count) { - return new SBInstructionList(lldbJNI.SBTarget_ReadInstructions__SWIG_0(swigCPtr, this, SBAddress.getCPtr(base_addr), base_addr, count), true); - } - - public SBInstructionList ReadInstructions(SBAddress base_addr, long count, String flavor_string) { - return new SBInstructionList(lldbJNI.SBTarget_ReadInstructions__SWIG_1(swigCPtr, this, SBAddress.getCPtr(base_addr), base_addr, count, flavor_string), true); - } - - public SBInstructionList GetInstructions(SBAddress base_addr, SWIGTYPE_p_void buf, long size) { - return new SBInstructionList(lldbJNI.SBTarget_GetInstructions(swigCPtr, this, SBAddress.getCPtr(base_addr), base_addr, SWIGTYPE_p_void.getCPtr(buf), size), true); - } - - public SBInstructionList GetInstructionsWithFlavor(SBAddress base_addr, String flavor_string, SWIGTYPE_p_void buf, long size) { - return new SBInstructionList(lldbJNI.SBTarget_GetInstructionsWithFlavor(swigCPtr, this, SBAddress.getCPtr(base_addr), base_addr, flavor_string, SWIGTYPE_p_void.getCPtr(buf), size), true); - } - - public SBSymbolContextList FindSymbols(String name, SymbolType type) { - return new SBSymbolContextList(lldbJNI.SBTarget_FindSymbols__SWIG_0(swigCPtr, this, name, type.swigValue()), true); - } - - public SBSymbolContextList FindSymbols(String name) { - return new SBSymbolContextList(lldbJNI.SBTarget_FindSymbols__SWIG_1(swigCPtr, this, name), true); - } - - public boolean GetDescription(SBStream description, DescriptionLevel description_level) { - return lldbJNI.SBTarget_GetDescription(swigCPtr, this, SBStream.getCPtr(description), description, description_level.swigValue()); - } - - public SBValue EvaluateExpression(String expr) { - return new SBValue(lldbJNI.SBTarget_EvaluateExpression__SWIG_0(swigCPtr, this, expr), true); - } - - public SBValue EvaluateExpression(String expr, SBExpressionOptions options) { - return new SBValue(lldbJNI.SBTarget_EvaluateExpression__SWIG_1(swigCPtr, this, expr, SBExpressionOptions.getCPtr(options), options), true); - } - - public java.math.BigInteger GetStackRedZoneSize() { - return lldbJNI.SBTarget_GetStackRedZoneSize(swigCPtr, this); - } - - public boolean IsLoaded(SBModule module) { - return lldbJNI.SBTarget_IsLoaded(swigCPtr, this, SBModule.getCPtr(module), module); - } - - public SBLaunchInfo GetLaunchInfo() { - return new SBLaunchInfo(lldbJNI.SBTarget_GetLaunchInfo(swigCPtr, this), true); - } - - public void SetLaunchInfo(SBLaunchInfo launch_info) { - lldbJNI.SBTarget_SetLaunchInfo(swigCPtr, this, SBLaunchInfo.getCPtr(launch_info), launch_info); - } - - public SBTrace GetTrace() { - return new SBTrace(lldbJNI.SBTarget_GetTrace(swigCPtr, this), true); - } - - public SBTrace CreateTrace(SBError error) { - return new SBTrace(lldbJNI.SBTarget_CreateTrace(swigCPtr, this, SBError.getCPtr(error), error), true); - } - - public String __repr__() { - return lldbJNI.SBTarget___repr__(swigCPtr, this); - } - - public final static int eBroadcastBitBreakpointChanged = lldbJNI.SBTarget_eBroadcastBitBreakpointChanged_get(); - public final static int eBroadcastBitModulesLoaded = lldbJNI.SBTarget_eBroadcastBitModulesLoaded_get(); - public final static int eBroadcastBitModulesUnloaded = lldbJNI.SBTarget_eBroadcastBitModulesUnloaded_get(); - public final static int eBroadcastBitWatchpointChanged = lldbJNI.SBTarget_eBroadcastBitWatchpointChanged_get(); - public final static int eBroadcastBitSymbolsLoaded = lldbJNI.SBTarget_eBroadcastBitSymbolsLoaded_get(); - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBThread.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBThread.java deleted file mode 100644 index d1bb3978e5..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBThread.java +++ /dev/null @@ -1,328 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBThread { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBThread(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBThread obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBThread obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBThread(swigCPtr); - } - swigCPtr = 0; - } - } - - public static String GetBroadcasterClassName() { - return lldbJNI.SBThread_GetBroadcasterClassName(); - } - - public SBThread() { - this(lldbJNI.new_SBThread__SWIG_0(), true); - } - - public SBThread(SBThread thread) { - this(lldbJNI.new_SBThread__SWIG_1(SBThread.getCPtr(thread), thread), true); - } - - public SBQueue GetQueue() { - return new SBQueue(lldbJNI.SBThread_GetQueue(swigCPtr, this), true); - } - - public boolean IsValid() { - return lldbJNI.SBThread_IsValid(swigCPtr, this); - } - - public void Clear() { - lldbJNI.SBThread_Clear(swigCPtr, this); - } - - public StopReason GetStopReason() { - return StopReason.swigToEnum(lldbJNI.SBThread_GetStopReason(swigCPtr, this)); - } - - public long GetStopReasonDataCount() { - return lldbJNI.SBThread_GetStopReasonDataCount(swigCPtr, this); - } - - public java.math.BigInteger GetStopReasonDataAtIndex(long idx) { - return lldbJNI.SBThread_GetStopReasonDataAtIndex(swigCPtr, this, idx); - } - - public boolean GetStopReasonExtendedInfoAsJSON(SBStream stream) { - return lldbJNI.SBThread_GetStopReasonExtendedInfoAsJSON(swigCPtr, this, SBStream.getCPtr(stream), stream); - } - - public SBThreadCollection GetStopReasonExtendedBacktraces(InstrumentationRuntimeType type) { - return new SBThreadCollection(lldbJNI.SBThread_GetStopReasonExtendedBacktraces(swigCPtr, this, type.swigValue()), true); - } - - public long GetStopDescription(String dst_or_null, long dst_len) { - return lldbJNI.SBThread_GetStopDescription(swigCPtr, this, dst_or_null, dst_len); - } - - public SBValue GetStopReturnValue() { - return new SBValue(lldbJNI.SBThread_GetStopReturnValue(swigCPtr, this), true); - } - - public java.math.BigInteger GetThreadID() { - return lldbJNI.SBThread_GetThreadID(swigCPtr, this); - } - - public long GetIndexID() { - return lldbJNI.SBThread_GetIndexID(swigCPtr, this); - } - - public String GetName() { - return lldbJNI.SBThread_GetName(swigCPtr, this); - } - - public String GetQueueName() { - return lldbJNI.SBThread_GetQueueName(swigCPtr, this); - } - - public java.math.BigInteger GetQueueID() { - return lldbJNI.SBThread_GetQueueID(swigCPtr, this); - } - - public boolean GetInfoItemByPathAsString(String path, SBStream strm) { - return lldbJNI.SBThread_GetInfoItemByPathAsString(swigCPtr, this, path, SBStream.getCPtr(strm), strm); - } - - public void StepOver(RunMode stop_other_threads) { - lldbJNI.SBThread_StepOver__SWIG_0(swigCPtr, this, stop_other_threads.swigValue()); - } - - public void StepOver() { - lldbJNI.SBThread_StepOver__SWIG_1(swigCPtr, this); - } - - public void StepOver(RunMode stop_other_threads, SBError error) { - lldbJNI.SBThread_StepOver__SWIG_2(swigCPtr, this, stop_other_threads.swigValue(), SBError.getCPtr(error), error); - } - - public void StepInto(RunMode stop_other_threads) { - lldbJNI.SBThread_StepInto__SWIG_0(swigCPtr, this, stop_other_threads.swigValue()); - } - - public void StepInto() { - lldbJNI.SBThread_StepInto__SWIG_1(swigCPtr, this); - } - - public void StepInto(String target_name, RunMode stop_other_threads) { - lldbJNI.SBThread_StepInto__SWIG_2(swigCPtr, this, target_name, stop_other_threads.swigValue()); - } - - public void StepInto(String target_name) { - lldbJNI.SBThread_StepInto__SWIG_3(swigCPtr, this, target_name); - } - - public void StepInto(String target_name, long end_line, SBError error, RunMode stop_other_threads) { - lldbJNI.SBThread_StepInto__SWIG_4(swigCPtr, this, target_name, end_line, SBError.getCPtr(error), error, stop_other_threads.swigValue()); - } - - public void StepInto(String target_name, long end_line, SBError error) { - lldbJNI.SBThread_StepInto__SWIG_5(swigCPtr, this, target_name, end_line, SBError.getCPtr(error), error); - } - - public void StepOut() { - lldbJNI.SBThread_StepOut__SWIG_0(swigCPtr, this); - } - - public void StepOut(SBError error) { - lldbJNI.SBThread_StepOut__SWIG_1(swigCPtr, this, SBError.getCPtr(error), error); - } - - public void StepOutOfFrame(SBFrame frame) { - lldbJNI.SBThread_StepOutOfFrame__SWIG_0(swigCPtr, this, SBFrame.getCPtr(frame), frame); - } - - public void StepOutOfFrame(SBFrame frame, SBError error) { - lldbJNI.SBThread_StepOutOfFrame__SWIG_1(swigCPtr, this, SBFrame.getCPtr(frame), frame, SBError.getCPtr(error), error); - } - - public void StepInstruction(boolean step_over) { - lldbJNI.SBThread_StepInstruction__SWIG_0(swigCPtr, this, step_over); - } - - public void StepInstruction(boolean step_over, SBError error) { - lldbJNI.SBThread_StepInstruction__SWIG_1(swigCPtr, this, step_over, SBError.getCPtr(error), error); - } - - public SBError StepOverUntil(SBFrame frame, SBFileSpec file_spec, long line) { - return new SBError(lldbJNI.SBThread_StepOverUntil(swigCPtr, this, SBFrame.getCPtr(frame), frame, SBFileSpec.getCPtr(file_spec), file_spec, line), true); - } - - public SBError StepUsingScriptedThreadPlan(String script_class_name) { - return new SBError(lldbJNI.SBThread_StepUsingScriptedThreadPlan__SWIG_0(swigCPtr, this, script_class_name), true); - } - - public SBError StepUsingScriptedThreadPlan(String script_class_name, boolean resume_immediately) { - return new SBError(lldbJNI.SBThread_StepUsingScriptedThreadPlan__SWIG_1(swigCPtr, this, script_class_name, resume_immediately), true); - } - - public SBError StepUsingScriptedThreadPlan(String script_class_name, SBStructuredData args_data, boolean resume_immediately) { - return new SBError(lldbJNI.SBThread_StepUsingScriptedThreadPlan__SWIG_2(swigCPtr, this, script_class_name, SBStructuredData.getCPtr(args_data), args_data, resume_immediately), true); - } - - public SBError JumpToLine(SBFileSpec file_spec, long line) { - return new SBError(lldbJNI.SBThread_JumpToLine(swigCPtr, this, SBFileSpec.getCPtr(file_spec), file_spec, line), true); - } - - public void RunToAddress(java.math.BigInteger addr) { - lldbJNI.SBThread_RunToAddress__SWIG_0(swigCPtr, this, addr); - } - - public void RunToAddress(java.math.BigInteger addr, SBError error) { - lldbJNI.SBThread_RunToAddress__SWIG_1(swigCPtr, this, addr, SBError.getCPtr(error), error); - } - - public SBError ReturnFromFrame(SBFrame frame, SBValue return_value) { - return new SBError(lldbJNI.SBThread_ReturnFromFrame(swigCPtr, this, SBFrame.getCPtr(frame), frame, SBValue.getCPtr(return_value), return_value), true); - } - - public SBError UnwindInnermostExpression() { - return new SBError(lldbJNI.SBThread_UnwindInnermostExpression(swigCPtr, this), true); - } - - public boolean Suspend() { - return lldbJNI.SBThread_Suspend__SWIG_0(swigCPtr, this); - } - - public boolean Suspend(SBError error) { - return lldbJNI.SBThread_Suspend__SWIG_1(swigCPtr, this, SBError.getCPtr(error), error); - } - - public boolean Resume() { - return lldbJNI.SBThread_Resume__SWIG_0(swigCPtr, this); - } - - public boolean Resume(SBError error) { - return lldbJNI.SBThread_Resume__SWIG_1(swigCPtr, this, SBError.getCPtr(error), error); - } - - public boolean IsSuspended() { - return lldbJNI.SBThread_IsSuspended(swigCPtr, this); - } - - public boolean IsStopped() { - return lldbJNI.SBThread_IsStopped(swigCPtr, this); - } - - public long GetNumFrames() { - return lldbJNI.SBThread_GetNumFrames(swigCPtr, this); - } - - public SBFrame GetFrameAtIndex(long idx) { - return new SBFrame(lldbJNI.SBThread_GetFrameAtIndex(swigCPtr, this, idx), true); - } - - public SBFrame GetSelectedFrame() { - return new SBFrame(lldbJNI.SBThread_GetSelectedFrame(swigCPtr, this), true); - } - - public SBFrame SetSelectedFrame(long frame_idx) { - return new SBFrame(lldbJNI.SBThread_SetSelectedFrame(swigCPtr, this, frame_idx), true); - } - - public static boolean EventIsThreadEvent(SBEvent event) { - return lldbJNI.SBThread_EventIsThreadEvent(SBEvent.getCPtr(event), event); - } - - public static SBFrame GetStackFrameFromEvent(SBEvent event) { - return new SBFrame(lldbJNI.SBThread_GetStackFrameFromEvent(SBEvent.getCPtr(event), event), true); - } - - public static SBThread GetThreadFromEvent(SBEvent event) { - return new SBThread(lldbJNI.SBThread_GetThreadFromEvent(SBEvent.getCPtr(event), event), true); - } - - public SBProcess GetProcess() { - return new SBProcess(lldbJNI.SBThread_GetProcess(swigCPtr, this), true); - } - - public boolean GetDescription(SBStream description) { - return lldbJNI.SBThread_GetDescription__SWIG_0(swigCPtr, this, SBStream.getCPtr(description), description); - } - - public boolean GetDescription(SBStream description, boolean stop_format) { - return lldbJNI.SBThread_GetDescription__SWIG_1(swigCPtr, this, SBStream.getCPtr(description), description, stop_format); - } - - public boolean GetStatus(SBStream status) { - return lldbJNI.SBThread_GetStatus(swigCPtr, this, SBStream.getCPtr(status), status); - } - - public SBThread GetExtendedBacktraceThread(String type) { - return new SBThread(lldbJNI.SBThread_GetExtendedBacktraceThread(swigCPtr, this, type), true); - } - - public long GetExtendedBacktraceOriginatingIndexID() { - return lldbJNI.SBThread_GetExtendedBacktraceOriginatingIndexID(swigCPtr, this); - } - - public SBValue GetCurrentException() { - return new SBValue(lldbJNI.SBThread_GetCurrentException(swigCPtr, this), true); - } - - public SBThread GetCurrentExceptionBacktrace() { - return new SBThread(lldbJNI.SBThread_GetCurrentExceptionBacktrace(swigCPtr, this), true); - } - - public boolean SafeToCallFunctions() { - return lldbJNI.SBThread_SafeToCallFunctions(swigCPtr, this); - } - - public SBValue GetSiginfo() { - return new SBValue(lldbJNI.SBThread_GetSiginfo(swigCPtr, this), true); - } - - public String __repr__() { - return lldbJNI.SBThread___repr__(swigCPtr, this); - } - - public final static int eBroadcastBitStackChanged = lldbJNI.SBThread_eBroadcastBitStackChanged_get(); - public final static int eBroadcastBitThreadSuspended = lldbJNI.SBThread_eBroadcastBitThreadSuspended_get(); - public final static int eBroadcastBitThreadResumed = lldbJNI.SBThread_eBroadcastBitThreadResumed_get(); - public final static int eBroadcastBitSelectedFrameChanged = lldbJNI.SBThread_eBroadcastBitSelectedFrameChanged_get(); - public final static int eBroadcastBitThreadSelected = lldbJNI.SBThread_eBroadcastBitThreadSelected_get(); - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBThreadCollection.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBThreadCollection.java deleted file mode 100644 index 581241d94e..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBThreadCollection.java +++ /dev/null @@ -1,74 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBThreadCollection { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBThreadCollection(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBThreadCollection obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBThreadCollection obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBThreadCollection(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBThreadCollection() { - this(lldbJNI.new_SBThreadCollection__SWIG_0(), true); - } - - public SBThreadCollection(SBThreadCollection rhs) { - this(lldbJNI.new_SBThreadCollection__SWIG_1(SBThreadCollection.getCPtr(rhs), rhs), true); - } - - public boolean IsValid() { - return lldbJNI.SBThreadCollection_IsValid(swigCPtr, this); - } - - public long GetSize() { - return lldbJNI.SBThreadCollection_GetSize(swigCPtr, this); - } - - public SBThread GetThreadAtIndex(long idx) { - return new SBThread(lldbJNI.SBThreadCollection_GetThreadAtIndex(swigCPtr, this, idx), true); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBThreadPlan.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBThreadPlan.java deleted file mode 100644 index f96b9f4611..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBThreadPlan.java +++ /dev/null @@ -1,166 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBThreadPlan { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBThreadPlan(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBThreadPlan obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBThreadPlan obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBThreadPlan(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBThreadPlan() { - this(lldbJNI.new_SBThreadPlan__SWIG_0(), true); - } - - public SBThreadPlan(SBThreadPlan threadPlan) { - this(lldbJNI.new_SBThreadPlan__SWIG_1(SBThreadPlan.getCPtr(threadPlan), threadPlan), true); - } - - public SBThreadPlan(SBThread thread, String class_name) { - this(lldbJNI.new_SBThreadPlan__SWIG_2(SBThread.getCPtr(thread), thread, class_name), true); - } - - public SBThreadPlan(SBThread thread, String class_name, SBStructuredData args_data) { - this(lldbJNI.new_SBThreadPlan__SWIG_3(SBThread.getCPtr(thread), thread, class_name, SBStructuredData.getCPtr(args_data), args_data), true); - } - - public boolean IsValid() { - return lldbJNI.SBThreadPlan_IsValid__SWIG_0(swigCPtr, this); - } - - public void Clear() { - lldbJNI.SBThreadPlan_Clear(swigCPtr, this); - } - - public StopReason GetStopReason() { - return StopReason.swigToEnum(lldbJNI.SBThreadPlan_GetStopReason(swigCPtr, this)); - } - - public long GetStopReasonDataCount() { - return lldbJNI.SBThreadPlan_GetStopReasonDataCount(swigCPtr, this); - } - - public java.math.BigInteger GetStopReasonDataAtIndex(long idx) { - return lldbJNI.SBThreadPlan_GetStopReasonDataAtIndex(swigCPtr, this, idx); - } - - public SBThread GetThread() { - return new SBThread(lldbJNI.SBThreadPlan_GetThread(swigCPtr, this), true); - } - - public boolean GetDescription(SBStream description) { - return lldbJNI.SBThreadPlan_GetDescription(swigCPtr, this, SBStream.getCPtr(description), description); - } - - public void SetPlanComplete(boolean success) { - lldbJNI.SBThreadPlan_SetPlanComplete(swigCPtr, this, success); - } - - public boolean IsPlanComplete() { - return lldbJNI.SBThreadPlan_IsPlanComplete(swigCPtr, this); - } - - public boolean IsPlanStale() { - return lldbJNI.SBThreadPlan_IsPlanStale(swigCPtr, this); - } - - public boolean GetStopOthers() { - return lldbJNI.SBThreadPlan_GetStopOthers(swigCPtr, this); - } - - public void SetStopOthers(boolean stop_others) { - lldbJNI.SBThreadPlan_SetStopOthers(swigCPtr, this, stop_others); - } - - public SBThreadPlan QueueThreadPlanForStepOverRange(SBAddress start_address, java.math.BigInteger range_size) { - return new SBThreadPlan(lldbJNI.SBThreadPlan_QueueThreadPlanForStepOverRange__SWIG_0(swigCPtr, this, SBAddress.getCPtr(start_address), start_address, range_size), true); - } - - public SBThreadPlan QueueThreadPlanForStepOverRange(SBAddress start_address, java.math.BigInteger range_size, SBError error) { - return new SBThreadPlan(lldbJNI.SBThreadPlan_QueueThreadPlanForStepOverRange__SWIG_1(swigCPtr, this, SBAddress.getCPtr(start_address), start_address, range_size, SBError.getCPtr(error), error), true); - } - - public SBThreadPlan QueueThreadPlanForStepInRange(SBAddress start_address, java.math.BigInteger range_size) { - return new SBThreadPlan(lldbJNI.SBThreadPlan_QueueThreadPlanForStepInRange__SWIG_0(swigCPtr, this, SBAddress.getCPtr(start_address), start_address, range_size), true); - } - - public SBThreadPlan QueueThreadPlanForStepInRange(SBAddress start_address, java.math.BigInteger range_size, SBError error) { - return new SBThreadPlan(lldbJNI.SBThreadPlan_QueueThreadPlanForStepInRange__SWIG_1(swigCPtr, this, SBAddress.getCPtr(start_address), start_address, range_size, SBError.getCPtr(error), error), true); - } - - public SBThreadPlan QueueThreadPlanForStepOut(long frame_idx_to_step_to, boolean first_insn) { - return new SBThreadPlan(lldbJNI.SBThreadPlan_QueueThreadPlanForStepOut__SWIG_0(swigCPtr, this, frame_idx_to_step_to, first_insn), true); - } - - public SBThreadPlan QueueThreadPlanForStepOut(long frame_idx_to_step_to) { - return new SBThreadPlan(lldbJNI.SBThreadPlan_QueueThreadPlanForStepOut__SWIG_1(swigCPtr, this, frame_idx_to_step_to), true); - } - - public SBThreadPlan QueueThreadPlanForStepOut(long frame_idx_to_step_to, boolean first_insn, SBError error) { - return new SBThreadPlan(lldbJNI.SBThreadPlan_QueueThreadPlanForStepOut__SWIG_2(swigCPtr, this, frame_idx_to_step_to, first_insn, SBError.getCPtr(error), error), true); - } - - public SBThreadPlan QueueThreadPlanForRunToAddress(SBAddress address) { - return new SBThreadPlan(lldbJNI.SBThreadPlan_QueueThreadPlanForRunToAddress__SWIG_0(swigCPtr, this, SBAddress.getCPtr(address), address), true); - } - - public SBThreadPlan QueueThreadPlanForRunToAddress(SBAddress address, SBError error) { - return new SBThreadPlan(lldbJNI.SBThreadPlan_QueueThreadPlanForRunToAddress__SWIG_1(swigCPtr, this, SBAddress.getCPtr(address), address, SBError.getCPtr(error), error), true); - } - - public SBThreadPlan QueueThreadPlanForStepScripted(String script_class_name) { - return new SBThreadPlan(lldbJNI.SBThreadPlan_QueueThreadPlanForStepScripted__SWIG_0(swigCPtr, this, script_class_name), true); - } - - public SBThreadPlan QueueThreadPlanForStepScripted(String script_class_name, SBError error) { - return new SBThreadPlan(lldbJNI.SBThreadPlan_QueueThreadPlanForStepScripted__SWIG_1(swigCPtr, this, script_class_name, SBError.getCPtr(error), error), true); - } - - public SBThreadPlan QueueThreadPlanForStepScripted(String script_class_name, SBStructuredData args_data, SBError error) { - return new SBThreadPlan(lldbJNI.SBThreadPlan_QueueThreadPlanForStepScripted__SWIG_2(swigCPtr, this, script_class_name, SBStructuredData.getCPtr(args_data), args_data, SBError.getCPtr(error), error), true); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTrace.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTrace.java deleted file mode 100644 index d722cbe047..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTrace.java +++ /dev/null @@ -1,98 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBTrace { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBTrace(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBTrace obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBTrace obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBTrace(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBTrace() { - this(lldbJNI.new_SBTrace(), true); - } - - public static SBTrace LoadTraceFromFile(SBError error, SBDebugger debugger, SBFileSpec trace_description_file) { - return new SBTrace(lldbJNI.SBTrace_LoadTraceFromFile(SBError.getCPtr(error), error, SBDebugger.getCPtr(debugger), debugger, SBFileSpec.getCPtr(trace_description_file), trace_description_file), true); - } - - public SBTraceCursor CreateNewCursor(SBError error, SBThread thread) { - return new SBTraceCursor(lldbJNI.SBTrace_CreateNewCursor(swigCPtr, this, SBError.getCPtr(error), error, SBThread.getCPtr(thread), thread), true); - } - - public SBFileSpec SaveToDisk(SBError error, SBFileSpec bundle_dir, boolean compact) { - return new SBFileSpec(lldbJNI.SBTrace_SaveToDisk__SWIG_0(swigCPtr, this, SBError.getCPtr(error), error, SBFileSpec.getCPtr(bundle_dir), bundle_dir, compact), true); - } - - public SBFileSpec SaveToDisk(SBError error, SBFileSpec bundle_dir) { - return new SBFileSpec(lldbJNI.SBTrace_SaveToDisk__SWIG_1(swigCPtr, this, SBError.getCPtr(error), error, SBFileSpec.getCPtr(bundle_dir), bundle_dir), true); - } - - public String GetStartConfigurationHelp() { - return lldbJNI.SBTrace_GetStartConfigurationHelp(swigCPtr, this); - } - - public SBError Start(SBStructuredData configuration) { - return new SBError(lldbJNI.SBTrace_Start__SWIG_0(swigCPtr, this, SBStructuredData.getCPtr(configuration), configuration), true); - } - - public SBError Start(SBThread thread, SBStructuredData configuration) { - return new SBError(lldbJNI.SBTrace_Start__SWIG_1(swigCPtr, this, SBThread.getCPtr(thread), thread, SBStructuredData.getCPtr(configuration), configuration), true); - } - - public SBError Stop() { - return new SBError(lldbJNI.SBTrace_Stop__SWIG_0(swigCPtr, this), true); - } - - public SBError Stop(SBThread thread) { - return new SBError(lldbJNI.SBTrace_Stop__SWIG_1(swigCPtr, this, SBThread.getCPtr(thread), thread), true); - } - - public boolean IsValid() { - return lldbJNI.SBTrace_IsValid(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTraceCursor.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTraceCursor.java deleted file mode 100644 index 8fdc0b1116..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTraceCursor.java +++ /dev/null @@ -1,130 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBTraceCursor { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBTraceCursor(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBTraceCursor obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBTraceCursor obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBTraceCursor(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBTraceCursor() { - this(lldbJNI.new_SBTraceCursor(), true); - } - - public void SetForwards(boolean forwards) { - lldbJNI.SBTraceCursor_SetForwards(swigCPtr, this, forwards); - } - - public boolean IsForwards() { - return lldbJNI.SBTraceCursor_IsForwards(swigCPtr, this); - } - - public void Next() { - lldbJNI.SBTraceCursor_Next(swigCPtr, this); - } - - public boolean HasValue() { - return lldbJNI.SBTraceCursor_HasValue(swigCPtr, this); - } - - public boolean GoToId(java.math.BigInteger id) { - return lldbJNI.SBTraceCursor_GoToId(swigCPtr, this, id); - } - - public boolean HasId(java.math.BigInteger id) { - return lldbJNI.SBTraceCursor_HasId(swigCPtr, this, id); - } - - public java.math.BigInteger GetId() { - return lldbJNI.SBTraceCursor_GetId(swigCPtr, this); - } - - public boolean Seek(long offset, TraceCursorSeekType origin) { - return lldbJNI.SBTraceCursor_Seek(swigCPtr, this, offset, origin.swigValue()); - } - - public TraceItemKind GetItemKind() { - return TraceItemKind.swigToEnum(lldbJNI.SBTraceCursor_GetItemKind(swigCPtr, this)); - } - - public boolean IsError() { - return lldbJNI.SBTraceCursor_IsError(swigCPtr, this); - } - - public String GetError() { - return lldbJNI.SBTraceCursor_GetError(swigCPtr, this); - } - - public boolean IsEvent() { - return lldbJNI.SBTraceCursor_IsEvent(swigCPtr, this); - } - - public TraceEvent GetEventType() { - return TraceEvent.swigToEnum(lldbJNI.SBTraceCursor_GetEventType(swigCPtr, this)); - } - - public String GetEventTypeAsString() { - return lldbJNI.SBTraceCursor_GetEventTypeAsString(swigCPtr, this); - } - - public boolean IsInstruction() { - return lldbJNI.SBTraceCursor_IsInstruction(swigCPtr, this); - } - - public java.math.BigInteger GetLoadAddress() { - return lldbJNI.SBTraceCursor_GetLoadAddress(swigCPtr, this); - } - - public long GetCPU() { - return lldbJNI.SBTraceCursor_GetCPU(swigCPtr, this); - } - - public boolean IsValid() { - return lldbJNI.SBTraceCursor_IsValid(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBType.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBType.java deleted file mode 100644 index b2a8259224..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBType.java +++ /dev/null @@ -1,250 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBType { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBType(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBType obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBType obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBType(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBType() { - this(lldbJNI.new_SBType__SWIG_0(), true); - } - - public SBType(SBType rhs) { - this(lldbJNI.new_SBType__SWIG_1(SBType.getCPtr(rhs), rhs), true); - } - - public boolean IsValid() { - return lldbJNI.SBType_IsValid(swigCPtr, this); - } - - public java.math.BigInteger GetByteSize() { - return lldbJNI.SBType_GetByteSize(swigCPtr, this); - } - - public boolean IsPointerType() { - return lldbJNI.SBType_IsPointerType(swigCPtr, this); - } - - public boolean IsReferenceType() { - return lldbJNI.SBType_IsReferenceType(swigCPtr, this); - } - - public boolean IsFunctionType() { - return lldbJNI.SBType_IsFunctionType(swigCPtr, this); - } - - public boolean IsPolymorphicClass() { - return lldbJNI.SBType_IsPolymorphicClass(swigCPtr, this); - } - - public boolean IsArrayType() { - return lldbJNI.SBType_IsArrayType(swigCPtr, this); - } - - public boolean IsVectorType() { - return lldbJNI.SBType_IsVectorType(swigCPtr, this); - } - - public boolean IsTypedefType() { - return lldbJNI.SBType_IsTypedefType(swigCPtr, this); - } - - public boolean IsAnonymousType() { - return lldbJNI.SBType_IsAnonymousType(swigCPtr, this); - } - - public boolean IsScopedEnumerationType() { - return lldbJNI.SBType_IsScopedEnumerationType(swigCPtr, this); - } - - public boolean IsAggregateType() { - return lldbJNI.SBType_IsAggregateType(swigCPtr, this); - } - - public SBType GetPointerType() { - return new SBType(lldbJNI.SBType_GetPointerType(swigCPtr, this), true); - } - - public SBType GetPointeeType() { - return new SBType(lldbJNI.SBType_GetPointeeType(swigCPtr, this), true); - } - - public SBType GetReferenceType() { - return new SBType(lldbJNI.SBType_GetReferenceType(swigCPtr, this), true); - } - - public SBType GetTypedefedType() { - return new SBType(lldbJNI.SBType_GetTypedefedType(swigCPtr, this), true); - } - - public SBType GetDereferencedType() { - return new SBType(lldbJNI.SBType_GetDereferencedType(swigCPtr, this), true); - } - - public SBType GetUnqualifiedType() { - return new SBType(lldbJNI.SBType_GetUnqualifiedType(swigCPtr, this), true); - } - - public SBType GetArrayElementType() { - return new SBType(lldbJNI.SBType_GetArrayElementType(swigCPtr, this), true); - } - - public SBType GetArrayType(java.math.BigInteger size) { - return new SBType(lldbJNI.SBType_GetArrayType(swigCPtr, this, size), true); - } - - public SBType GetVectorElementType() { - return new SBType(lldbJNI.SBType_GetVectorElementType(swigCPtr, this), true); - } - - public SBType GetCanonicalType() { - return new SBType(lldbJNI.SBType_GetCanonicalType(swigCPtr, this), true); - } - - public SBType GetEnumerationIntegerType() { - return new SBType(lldbJNI.SBType_GetEnumerationIntegerType(swigCPtr, this), true); - } - - public BasicType GetBasicType() { - return BasicType.swigToEnum(lldbJNI.SBType_GetBasicType__SWIG_0(swigCPtr, this)); - } - - public SBType GetBasicType(BasicType type) { - return new SBType(lldbJNI.SBType_GetBasicType__SWIG_1(swigCPtr, this, type.swigValue()), true); - } - - public long GetNumberOfFields() { - return lldbJNI.SBType_GetNumberOfFields(swigCPtr, this); - } - - public long GetNumberOfDirectBaseClasses() { - return lldbJNI.SBType_GetNumberOfDirectBaseClasses(swigCPtr, this); - } - - public long GetNumberOfVirtualBaseClasses() { - return lldbJNI.SBType_GetNumberOfVirtualBaseClasses(swigCPtr, this); - } - - public SBTypeMember GetFieldAtIndex(long idx) { - return new SBTypeMember(lldbJNI.SBType_GetFieldAtIndex(swigCPtr, this, idx), true); - } - - public SBTypeMember GetDirectBaseClassAtIndex(long idx) { - return new SBTypeMember(lldbJNI.SBType_GetDirectBaseClassAtIndex(swigCPtr, this, idx), true); - } - - public SBTypeMember GetVirtualBaseClassAtIndex(long idx) { - return new SBTypeMember(lldbJNI.SBType_GetVirtualBaseClassAtIndex(swigCPtr, this, idx), true); - } - - public SBTypeEnumMemberList GetEnumMembers() { - return new SBTypeEnumMemberList(lldbJNI.SBType_GetEnumMembers(swigCPtr, this), true); - } - - public long GetNumberOfTemplateArguments() { - return lldbJNI.SBType_GetNumberOfTemplateArguments(swigCPtr, this); - } - - public SBType GetTemplateArgumentType(long idx) { - return new SBType(lldbJNI.SBType_GetTemplateArgumentType(swigCPtr, this, idx), true); - } - - public TemplateArgumentKind GetTemplateArgumentKind(long idx) { - return TemplateArgumentKind.swigToEnum(lldbJNI.SBType_GetTemplateArgumentKind(swigCPtr, this, idx)); - } - - public SBType GetFunctionReturnType() { - return new SBType(lldbJNI.SBType_GetFunctionReturnType(swigCPtr, this), true); - } - - public SBTypeList GetFunctionArgumentTypes() { - return new SBTypeList(lldbJNI.SBType_GetFunctionArgumentTypes(swigCPtr, this), true); - } - - public long GetNumberOfMemberFunctions() { - return lldbJNI.SBType_GetNumberOfMemberFunctions(swigCPtr, this); - } - - public SBTypeMemberFunction GetMemberFunctionAtIndex(long idx) { - return new SBTypeMemberFunction(lldbJNI.SBType_GetMemberFunctionAtIndex(swigCPtr, this, idx), true); - } - - public SBModule GetModule() { - return new SBModule(lldbJNI.SBType_GetModule(swigCPtr, this), true); - } - - public String GetName() { - return lldbJNI.SBType_GetName(swigCPtr, this); - } - - public String GetDisplayTypeName() { - return lldbJNI.SBType_GetDisplayTypeName(swigCPtr, this); - } - - public TypeClass GetTypeClass() { - return TypeClass.swigToEnum(lldbJNI.SBType_GetTypeClass(swigCPtr, this)); - } - - public boolean IsTypeComplete() { - return lldbJNI.SBType_IsTypeComplete(swigCPtr, this); - } - - public long GetTypeFlags() { - return lldbJNI.SBType_GetTypeFlags(swigCPtr, this); - } - - public boolean GetDescription(SBStream description, DescriptionLevel description_level) { - return lldbJNI.SBType_GetDescription(swigCPtr, this, SBStream.getCPtr(description), description, description_level.swigValue()); - } - - public String __repr__() { - return lldbJNI.SBType___repr__(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeCategory.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeCategory.java deleted file mode 100644 index 5d63ffd179..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeCategory.java +++ /dev/null @@ -1,194 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBTypeCategory { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBTypeCategory(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBTypeCategory obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBTypeCategory obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBTypeCategory(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBTypeCategory() { - this(lldbJNI.new_SBTypeCategory__SWIG_0(), true); - } - - public SBTypeCategory(SBTypeCategory rhs) { - this(lldbJNI.new_SBTypeCategory__SWIG_1(SBTypeCategory.getCPtr(rhs), rhs), true); - } - - public boolean IsValid() { - return lldbJNI.SBTypeCategory_IsValid(swigCPtr, this); - } - - public boolean GetEnabled() { - return lldbJNI.SBTypeCategory_GetEnabled(swigCPtr, this); - } - - public void SetEnabled(boolean arg0) { - lldbJNI.SBTypeCategory_SetEnabled(swigCPtr, this, arg0); - } - - public String GetName() { - return lldbJNI.SBTypeCategory_GetName(swigCPtr, this); - } - - public LanguageType GetLanguageAtIndex(long idx) { - return LanguageType.swigToEnum(lldbJNI.SBTypeCategory_GetLanguageAtIndex(swigCPtr, this, idx)); - } - - public long GetNumLanguages() { - return lldbJNI.SBTypeCategory_GetNumLanguages(swigCPtr, this); - } - - public void AddLanguage(LanguageType language) { - lldbJNI.SBTypeCategory_AddLanguage(swigCPtr, this, language.swigValue()); - } - - public boolean GetDescription(SBStream description, DescriptionLevel description_level) { - return lldbJNI.SBTypeCategory_GetDescription(swigCPtr, this, SBStream.getCPtr(description), description, description_level.swigValue()); - } - - public long GetNumFormats() { - return lldbJNI.SBTypeCategory_GetNumFormats(swigCPtr, this); - } - - public long GetNumSummaries() { - return lldbJNI.SBTypeCategory_GetNumSummaries(swigCPtr, this); - } - - public long GetNumFilters() { - return lldbJNI.SBTypeCategory_GetNumFilters(swigCPtr, this); - } - - public long GetNumSynthetics() { - return lldbJNI.SBTypeCategory_GetNumSynthetics(swigCPtr, this); - } - - public SBTypeNameSpecifier GetTypeNameSpecifierForFilterAtIndex(long arg0) { - return new SBTypeNameSpecifier(lldbJNI.SBTypeCategory_GetTypeNameSpecifierForFilterAtIndex(swigCPtr, this, arg0), true); - } - - public SBTypeNameSpecifier GetTypeNameSpecifierForFormatAtIndex(long arg0) { - return new SBTypeNameSpecifier(lldbJNI.SBTypeCategory_GetTypeNameSpecifierForFormatAtIndex(swigCPtr, this, arg0), true); - } - - public SBTypeNameSpecifier GetTypeNameSpecifierForSummaryAtIndex(long arg0) { - return new SBTypeNameSpecifier(lldbJNI.SBTypeCategory_GetTypeNameSpecifierForSummaryAtIndex(swigCPtr, this, arg0), true); - } - - public SBTypeNameSpecifier GetTypeNameSpecifierForSyntheticAtIndex(long arg0) { - return new SBTypeNameSpecifier(lldbJNI.SBTypeCategory_GetTypeNameSpecifierForSyntheticAtIndex(swigCPtr, this, arg0), true); - } - - public SBTypeFilter GetFilterForType(SBTypeNameSpecifier arg0) { - return new SBTypeFilter(lldbJNI.SBTypeCategory_GetFilterForType(swigCPtr, this, SBTypeNameSpecifier.getCPtr(arg0), arg0), true); - } - - public SBTypeFormat GetFormatForType(SBTypeNameSpecifier arg0) { - return new SBTypeFormat(lldbJNI.SBTypeCategory_GetFormatForType(swigCPtr, this, SBTypeNameSpecifier.getCPtr(arg0), arg0), true); - } - - public SBTypeSummary GetSummaryForType(SBTypeNameSpecifier arg0) { - return new SBTypeSummary(lldbJNI.SBTypeCategory_GetSummaryForType(swigCPtr, this, SBTypeNameSpecifier.getCPtr(arg0), arg0), true); - } - - public SBTypeSynthetic GetSyntheticForType(SBTypeNameSpecifier arg0) { - return new SBTypeSynthetic(lldbJNI.SBTypeCategory_GetSyntheticForType(swigCPtr, this, SBTypeNameSpecifier.getCPtr(arg0), arg0), true); - } - - public SBTypeFilter GetFilterAtIndex(long arg0) { - return new SBTypeFilter(lldbJNI.SBTypeCategory_GetFilterAtIndex(swigCPtr, this, arg0), true); - } - - public SBTypeFormat GetFormatAtIndex(long arg0) { - return new SBTypeFormat(lldbJNI.SBTypeCategory_GetFormatAtIndex(swigCPtr, this, arg0), true); - } - - public SBTypeSummary GetSummaryAtIndex(long arg0) { - return new SBTypeSummary(lldbJNI.SBTypeCategory_GetSummaryAtIndex(swigCPtr, this, arg0), true); - } - - public SBTypeSynthetic GetSyntheticAtIndex(long arg0) { - return new SBTypeSynthetic(lldbJNI.SBTypeCategory_GetSyntheticAtIndex(swigCPtr, this, arg0), true); - } - - public boolean AddTypeFormat(SBTypeNameSpecifier arg0, SBTypeFormat arg1) { - return lldbJNI.SBTypeCategory_AddTypeFormat(swigCPtr, this, SBTypeNameSpecifier.getCPtr(arg0), arg0, SBTypeFormat.getCPtr(arg1), arg1); - } - - public boolean DeleteTypeFormat(SBTypeNameSpecifier arg0) { - return lldbJNI.SBTypeCategory_DeleteTypeFormat(swigCPtr, this, SBTypeNameSpecifier.getCPtr(arg0), arg0); - } - - public boolean AddTypeSummary(SBTypeNameSpecifier arg0, SBTypeSummary arg1) { - return lldbJNI.SBTypeCategory_AddTypeSummary(swigCPtr, this, SBTypeNameSpecifier.getCPtr(arg0), arg0, SBTypeSummary.getCPtr(arg1), arg1); - } - - public boolean DeleteTypeSummary(SBTypeNameSpecifier arg0) { - return lldbJNI.SBTypeCategory_DeleteTypeSummary(swigCPtr, this, SBTypeNameSpecifier.getCPtr(arg0), arg0); - } - - public boolean AddTypeFilter(SBTypeNameSpecifier arg0, SBTypeFilter arg1) { - return lldbJNI.SBTypeCategory_AddTypeFilter(swigCPtr, this, SBTypeNameSpecifier.getCPtr(arg0), arg0, SBTypeFilter.getCPtr(arg1), arg1); - } - - public boolean DeleteTypeFilter(SBTypeNameSpecifier arg0) { - return lldbJNI.SBTypeCategory_DeleteTypeFilter(swigCPtr, this, SBTypeNameSpecifier.getCPtr(arg0), arg0); - } - - public boolean AddTypeSynthetic(SBTypeNameSpecifier arg0, SBTypeSynthetic arg1) { - return lldbJNI.SBTypeCategory_AddTypeSynthetic(swigCPtr, this, SBTypeNameSpecifier.getCPtr(arg0), arg0, SBTypeSynthetic.getCPtr(arg1), arg1); - } - - public boolean DeleteTypeSynthetic(SBTypeNameSpecifier arg0) { - return lldbJNI.SBTypeCategory_DeleteTypeSynthetic(swigCPtr, this, SBTypeNameSpecifier.getCPtr(arg0), arg0); - } - - public String __repr__() { - return lldbJNI.SBTypeCategory___repr__(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeEnumMember.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeEnumMember.java deleted file mode 100644 index ab961d717b..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeEnumMember.java +++ /dev/null @@ -1,90 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBTypeEnumMember { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBTypeEnumMember(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBTypeEnumMember obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBTypeEnumMember obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBTypeEnumMember(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBTypeEnumMember() { - this(lldbJNI.new_SBTypeEnumMember__SWIG_0(), true); - } - - public SBTypeEnumMember(SBTypeEnumMember rhs) { - this(lldbJNI.new_SBTypeEnumMember__SWIG_1(SBTypeEnumMember.getCPtr(rhs), rhs), true); - } - - public boolean IsValid() { - return lldbJNI.SBTypeEnumMember_IsValid(swigCPtr, this); - } - - public long GetValueAsSigned() { - return lldbJNI.SBTypeEnumMember_GetValueAsSigned(swigCPtr, this); - } - - public java.math.BigInteger GetValueAsUnsigned() { - return lldbJNI.SBTypeEnumMember_GetValueAsUnsigned(swigCPtr, this); - } - - public String GetName() { - return lldbJNI.SBTypeEnumMember_GetName(swigCPtr, this); - } - - public SBType GetType() { - return new SBType(lldbJNI.SBTypeEnumMember_GetType(swigCPtr, this), true); - } - - public boolean GetDescription(SBStream description, DescriptionLevel description_level) { - return lldbJNI.SBTypeEnumMember_GetDescription(swigCPtr, this, SBStream.getCPtr(description), description, description_level.swigValue()); - } - - public String __repr__() { - return lldbJNI.SBTypeEnumMember___repr__(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeEnumMemberList.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeEnumMemberList.java deleted file mode 100644 index 678a35a6c9..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeEnumMemberList.java +++ /dev/null @@ -1,78 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBTypeEnumMemberList { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBTypeEnumMemberList(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBTypeEnumMemberList obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBTypeEnumMemberList obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBTypeEnumMemberList(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBTypeEnumMemberList() { - this(lldbJNI.new_SBTypeEnumMemberList__SWIG_0(), true); - } - - public SBTypeEnumMemberList(SBTypeEnumMemberList rhs) { - this(lldbJNI.new_SBTypeEnumMemberList__SWIG_1(SBTypeEnumMemberList.getCPtr(rhs), rhs), true); - } - - public boolean IsValid() { - return lldbJNI.SBTypeEnumMemberList_IsValid(swigCPtr, this); - } - - public void Append(SBTypeEnumMember entry) { - lldbJNI.SBTypeEnumMemberList_Append(swigCPtr, this, SBTypeEnumMember.getCPtr(entry), entry); - } - - public SBTypeEnumMember GetTypeEnumMemberAtIndex(long index) { - return new SBTypeEnumMember(lldbJNI.SBTypeEnumMemberList_GetTypeEnumMemberAtIndex(swigCPtr, this, index), true); - } - - public long GetSize() { - return lldbJNI.SBTypeEnumMemberList_GetSize(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeFilter.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeFilter.java deleted file mode 100644 index bb082d7661..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeFilter.java +++ /dev/null @@ -1,110 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBTypeFilter { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBTypeFilter(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBTypeFilter obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBTypeFilter obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBTypeFilter(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBTypeFilter() { - this(lldbJNI.new_SBTypeFilter__SWIG_0(), true); - } - - public SBTypeFilter(long options) { - this(lldbJNI.new_SBTypeFilter__SWIG_1(options), true); - } - - public SBTypeFilter(SBTypeFilter rhs) { - this(lldbJNI.new_SBTypeFilter__SWIG_2(SBTypeFilter.getCPtr(rhs), rhs), true); - } - - public boolean IsValid() { - return lldbJNI.SBTypeFilter_IsValid(swigCPtr, this); - } - - public long GetNumberOfExpressionPaths() { - return lldbJNI.SBTypeFilter_GetNumberOfExpressionPaths(swigCPtr, this); - } - - public String GetExpressionPathAtIndex(long i) { - return lldbJNI.SBTypeFilter_GetExpressionPathAtIndex(swigCPtr, this, i); - } - - public boolean ReplaceExpressionPathAtIndex(long i, String item) { - return lldbJNI.SBTypeFilter_ReplaceExpressionPathAtIndex(swigCPtr, this, i, item); - } - - public void AppendExpressionPath(String item) { - lldbJNI.SBTypeFilter_AppendExpressionPath(swigCPtr, this, item); - } - - public void Clear() { - lldbJNI.SBTypeFilter_Clear(swigCPtr, this); - } - - public long GetOptions() { - return lldbJNI.SBTypeFilter_GetOptions(swigCPtr, this); - } - - public void SetOptions(long arg0) { - lldbJNI.SBTypeFilter_SetOptions(swigCPtr, this, arg0); - } - - public boolean GetDescription(SBStream description, DescriptionLevel description_level) { - return lldbJNI.SBTypeFilter_GetDescription(swigCPtr, this, SBStream.getCPtr(description), description, description_level.swigValue()); - } - - public boolean IsEqualTo(SBTypeFilter rhs) { - return lldbJNI.SBTypeFilter_IsEqualTo(swigCPtr, this, SBTypeFilter.getCPtr(rhs), rhs); - } - - public String __repr__() { - return lldbJNI.SBTypeFilter___repr__(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeFormat.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeFormat.java deleted file mode 100644 index d7402a734e..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeFormat.java +++ /dev/null @@ -1,118 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBTypeFormat { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBTypeFormat(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBTypeFormat obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBTypeFormat obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBTypeFormat(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBTypeFormat() { - this(lldbJNI.new_SBTypeFormat__SWIG_0(), true); - } - - public SBTypeFormat(Format format, long options) { - this(lldbJNI.new_SBTypeFormat__SWIG_1(format.swigValue(), options), true); - } - - public SBTypeFormat(Format format) { - this(lldbJNI.new_SBTypeFormat__SWIG_2(format.swigValue()), true); - } - - public SBTypeFormat(String type, long options) { - this(lldbJNI.new_SBTypeFormat__SWIG_3(type, options), true); - } - - public SBTypeFormat(String type) { - this(lldbJNI.new_SBTypeFormat__SWIG_4(type), true); - } - - public SBTypeFormat(SBTypeFormat rhs) { - this(lldbJNI.new_SBTypeFormat__SWIG_5(SBTypeFormat.getCPtr(rhs), rhs), true); - } - - public boolean IsValid() { - return lldbJNI.SBTypeFormat_IsValid(swigCPtr, this); - } - - public Format GetFormat() { - return Format.swigToEnum(lldbJNI.SBTypeFormat_GetFormat(swigCPtr, this)); - } - - public String GetTypeName() { - return lldbJNI.SBTypeFormat_GetTypeName(swigCPtr, this); - } - - public long GetOptions() { - return lldbJNI.SBTypeFormat_GetOptions(swigCPtr, this); - } - - public void SetFormat(Format arg0) { - lldbJNI.SBTypeFormat_SetFormat(swigCPtr, this, arg0.swigValue()); - } - - public void SetTypeName(String arg0) { - lldbJNI.SBTypeFormat_SetTypeName(swigCPtr, this, arg0); - } - - public void SetOptions(long arg0) { - lldbJNI.SBTypeFormat_SetOptions(swigCPtr, this, arg0); - } - - public boolean GetDescription(SBStream description, DescriptionLevel description_level) { - return lldbJNI.SBTypeFormat_GetDescription(swigCPtr, this, SBStream.getCPtr(description), description, description_level.swigValue()); - } - - public boolean IsEqualTo(SBTypeFormat rhs) { - return lldbJNI.SBTypeFormat_IsEqualTo(swigCPtr, this, SBTypeFormat.getCPtr(rhs), rhs); - } - - public String __repr__() { - return lldbJNI.SBTypeFormat___repr__(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeList.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeList.java deleted file mode 100644 index 2eb4ff6090..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeList.java +++ /dev/null @@ -1,78 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBTypeList { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBTypeList(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBTypeList obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBTypeList obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBTypeList(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBTypeList() { - this(lldbJNI.new_SBTypeList__SWIG_0(), true); - } - - public SBTypeList(SBTypeList rhs) { - this(lldbJNI.new_SBTypeList__SWIG_1(SBTypeList.getCPtr(rhs), rhs), true); - } - - public boolean IsValid() { - return lldbJNI.SBTypeList_IsValid(swigCPtr, this); - } - - public void Append(SBType type) { - lldbJNI.SBTypeList_Append(swigCPtr, this, SBType.getCPtr(type), type); - } - - public SBType GetTypeAtIndex(long index) { - return new SBType(lldbJNI.SBTypeList_GetTypeAtIndex(swigCPtr, this, index), true); - } - - public long GetSize() { - return lldbJNI.SBTypeList_GetSize(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeMember.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeMember.java deleted file mode 100644 index afe0c50528..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeMember.java +++ /dev/null @@ -1,98 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBTypeMember { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBTypeMember(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBTypeMember obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBTypeMember obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBTypeMember(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBTypeMember() { - this(lldbJNI.new_SBTypeMember__SWIG_0(), true); - } - - public SBTypeMember(SBTypeMember rhs) { - this(lldbJNI.new_SBTypeMember__SWIG_1(SBTypeMember.getCPtr(rhs), rhs), true); - } - - public boolean IsValid() { - return lldbJNI.SBTypeMember_IsValid(swigCPtr, this); - } - - public String GetName() { - return lldbJNI.SBTypeMember_GetName(swigCPtr, this); - } - - public SBType GetType() { - return new SBType(lldbJNI.SBTypeMember_GetType(swigCPtr, this), true); - } - - public java.math.BigInteger GetOffsetInBytes() { - return lldbJNI.SBTypeMember_GetOffsetInBytes(swigCPtr, this); - } - - public java.math.BigInteger GetOffsetInBits() { - return lldbJNI.SBTypeMember_GetOffsetInBits(swigCPtr, this); - } - - public boolean IsBitfield() { - return lldbJNI.SBTypeMember_IsBitfield(swigCPtr, this); - } - - public long GetBitfieldSizeInBits() { - return lldbJNI.SBTypeMember_GetBitfieldSizeInBits(swigCPtr, this); - } - - public boolean GetDescription(SBStream description, DescriptionLevel description_level) { - return lldbJNI.SBTypeMember_GetDescription(swigCPtr, this, SBStream.getCPtr(description), description, description_level.swigValue()); - } - - public String __repr__() { - return lldbJNI.SBTypeMember___repr__(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeMemberFunction.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeMemberFunction.java deleted file mode 100644 index 44d0b11ac9..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeMemberFunction.java +++ /dev/null @@ -1,106 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBTypeMemberFunction { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBTypeMemberFunction(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBTypeMemberFunction obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBTypeMemberFunction obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBTypeMemberFunction(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBTypeMemberFunction() { - this(lldbJNI.new_SBTypeMemberFunction__SWIG_0(), true); - } - - public SBTypeMemberFunction(SBTypeMemberFunction rhs) { - this(lldbJNI.new_SBTypeMemberFunction__SWIG_1(SBTypeMemberFunction.getCPtr(rhs), rhs), true); - } - - public boolean IsValid() { - return lldbJNI.SBTypeMemberFunction_IsValid(swigCPtr, this); - } - - public String GetName() { - return lldbJNI.SBTypeMemberFunction_GetName(swigCPtr, this); - } - - public String GetDemangledName() { - return lldbJNI.SBTypeMemberFunction_GetDemangledName(swigCPtr, this); - } - - public String GetMangledName() { - return lldbJNI.SBTypeMemberFunction_GetMangledName(swigCPtr, this); - } - - public SBType GetType() { - return new SBType(lldbJNI.SBTypeMemberFunction_GetType(swigCPtr, this), true); - } - - public SBType GetReturnType() { - return new SBType(lldbJNI.SBTypeMemberFunction_GetReturnType(swigCPtr, this), true); - } - - public long GetNumberOfArguments() { - return lldbJNI.SBTypeMemberFunction_GetNumberOfArguments(swigCPtr, this); - } - - public SBType GetArgumentTypeAtIndex(long arg0) { - return new SBType(lldbJNI.SBTypeMemberFunction_GetArgumentTypeAtIndex(swigCPtr, this, arg0), true); - } - - public MemberFunctionKind GetKind() { - return MemberFunctionKind.swigToEnum(lldbJNI.SBTypeMemberFunction_GetKind(swigCPtr, this)); - } - - public boolean GetDescription(SBStream description, DescriptionLevel description_level) { - return lldbJNI.SBTypeMemberFunction_GetDescription(swigCPtr, this, SBStream.getCPtr(description), description, description_level.swigValue()); - } - - public String __repr__() { - return lldbJNI.SBTypeMemberFunction___repr__(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeNameSpecifier.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeNameSpecifier.java deleted file mode 100644 index 8acacdf81a..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeNameSpecifier.java +++ /dev/null @@ -1,110 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBTypeNameSpecifier { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBTypeNameSpecifier(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBTypeNameSpecifier obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBTypeNameSpecifier obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBTypeNameSpecifier(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBTypeNameSpecifier() { - this(lldbJNI.new_SBTypeNameSpecifier__SWIG_0(), true); - } - - public SBTypeNameSpecifier(String name, boolean is_regex) { - this(lldbJNI.new_SBTypeNameSpecifier__SWIG_1(name, is_regex), true); - } - - public SBTypeNameSpecifier(String name) { - this(lldbJNI.new_SBTypeNameSpecifier__SWIG_2(name), true); - } - - public SBTypeNameSpecifier(String name, FormatterMatchType match_type) { - this(lldbJNI.new_SBTypeNameSpecifier__SWIG_3(name, match_type.swigValue()), true); - } - - public SBTypeNameSpecifier(SBType type) { - this(lldbJNI.new_SBTypeNameSpecifier__SWIG_4(SBType.getCPtr(type), type), true); - } - - public SBTypeNameSpecifier(SBTypeNameSpecifier rhs) { - this(lldbJNI.new_SBTypeNameSpecifier__SWIG_5(SBTypeNameSpecifier.getCPtr(rhs), rhs), true); - } - - public boolean IsValid() { - return lldbJNI.SBTypeNameSpecifier_IsValid(swigCPtr, this); - } - - public String GetName() { - return lldbJNI.SBTypeNameSpecifier_GetName(swigCPtr, this); - } - - public SBType GetType() { - return new SBType(lldbJNI.SBTypeNameSpecifier_GetType(swigCPtr, this), true); - } - - public FormatterMatchType GetMatchType() { - return FormatterMatchType.swigToEnum(lldbJNI.SBTypeNameSpecifier_GetMatchType(swigCPtr, this)); - } - - public boolean IsRegex() { - return lldbJNI.SBTypeNameSpecifier_IsRegex(swigCPtr, this); - } - - public boolean GetDescription(SBStream description, DescriptionLevel description_level) { - return lldbJNI.SBTypeNameSpecifier_GetDescription(swigCPtr, this, SBStream.getCPtr(description), description, description_level.swigValue()); - } - - public boolean IsEqualTo(SBTypeNameSpecifier rhs) { - return lldbJNI.SBTypeNameSpecifier_IsEqualTo(swigCPtr, this, SBTypeNameSpecifier.getCPtr(rhs), rhs); - } - - public String __repr__() { - return lldbJNI.SBTypeNameSpecifier___repr__(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeSummary.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeSummary.java deleted file mode 100644 index 3b076afaf8..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeSummary.java +++ /dev/null @@ -1,142 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBTypeSummary { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBTypeSummary(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBTypeSummary obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBTypeSummary obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBTypeSummary(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBTypeSummary() { - this(lldbJNI.new_SBTypeSummary__SWIG_0(), true); - } - - public static SBTypeSummary CreateWithSummaryString(String data, long options) { - return new SBTypeSummary(lldbJNI.SBTypeSummary_CreateWithSummaryString__SWIG_0(data, options), true); - } - - public static SBTypeSummary CreateWithSummaryString(String data) { - return new SBTypeSummary(lldbJNI.SBTypeSummary_CreateWithSummaryString__SWIG_1(data), true); - } - - public static SBTypeSummary CreateWithFunctionName(String data, long options) { - return new SBTypeSummary(lldbJNI.SBTypeSummary_CreateWithFunctionName__SWIG_0(data, options), true); - } - - public static SBTypeSummary CreateWithFunctionName(String data) { - return new SBTypeSummary(lldbJNI.SBTypeSummary_CreateWithFunctionName__SWIG_1(data), true); - } - - public static SBTypeSummary CreateWithScriptCode(String data, long options) { - return new SBTypeSummary(lldbJNI.SBTypeSummary_CreateWithScriptCode__SWIG_0(data, options), true); - } - - public static SBTypeSummary CreateWithScriptCode(String data) { - return new SBTypeSummary(lldbJNI.SBTypeSummary_CreateWithScriptCode__SWIG_1(data), true); - } - - public SBTypeSummary(SBTypeSummary rhs) { - this(lldbJNI.new_SBTypeSummary__SWIG_1(SBTypeSummary.getCPtr(rhs), rhs), true); - } - - public boolean IsValid() { - return lldbJNI.SBTypeSummary_IsValid(swigCPtr, this); - } - - public boolean IsFunctionCode() { - return lldbJNI.SBTypeSummary_IsFunctionCode(swigCPtr, this); - } - - public boolean IsFunctionName() { - return lldbJNI.SBTypeSummary_IsFunctionName(swigCPtr, this); - } - - public boolean IsSummaryString() { - return lldbJNI.SBTypeSummary_IsSummaryString(swigCPtr, this); - } - - public String GetData() { - return lldbJNI.SBTypeSummary_GetData(swigCPtr, this); - } - - public void SetSummaryString(String data) { - lldbJNI.SBTypeSummary_SetSummaryString(swigCPtr, this, data); - } - - public void SetFunctionName(String data) { - lldbJNI.SBTypeSummary_SetFunctionName(swigCPtr, this, data); - } - - public void SetFunctionCode(String data) { - lldbJNI.SBTypeSummary_SetFunctionCode(swigCPtr, this, data); - } - - public long GetOptions() { - return lldbJNI.SBTypeSummary_GetOptions(swigCPtr, this); - } - - public void SetOptions(long arg0) { - lldbJNI.SBTypeSummary_SetOptions(swigCPtr, this, arg0); - } - - public boolean GetDescription(SBStream description, DescriptionLevel description_level) { - return lldbJNI.SBTypeSummary_GetDescription(swigCPtr, this, SBStream.getCPtr(description), description, description_level.swigValue()); - } - - public boolean DoesPrintValue(SBValue value) { - return lldbJNI.SBTypeSummary_DoesPrintValue(swigCPtr, this, SBValue.getCPtr(value), value); - } - - public boolean IsEqualTo(SBTypeSummary rhs) { - return lldbJNI.SBTypeSummary_IsEqualTo(swigCPtr, this, SBTypeSummary.getCPtr(rhs), rhs); - } - - public String __repr__() { - return lldbJNI.SBTypeSummary___repr__(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeSummaryOptions.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeSummaryOptions.java deleted file mode 100644 index 41c2cd975b..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeSummaryOptions.java +++ /dev/null @@ -1,82 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBTypeSummaryOptions { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBTypeSummaryOptions(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBTypeSummaryOptions obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBTypeSummaryOptions obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBTypeSummaryOptions(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBTypeSummaryOptions() { - this(lldbJNI.new_SBTypeSummaryOptions__SWIG_0(), true); - } - - public SBTypeSummaryOptions(SBTypeSummaryOptions rhs) { - this(lldbJNI.new_SBTypeSummaryOptions__SWIG_1(SBTypeSummaryOptions.getCPtr(rhs), rhs), true); - } - - public boolean IsValid() { - return lldbJNI.SBTypeSummaryOptions_IsValid(swigCPtr, this); - } - - public LanguageType GetLanguage() { - return LanguageType.swigToEnum(lldbJNI.SBTypeSummaryOptions_GetLanguage(swigCPtr, this)); - } - - public TypeSummaryCapping GetCapping() { - return TypeSummaryCapping.swigToEnum(lldbJNI.SBTypeSummaryOptions_GetCapping(swigCPtr, this)); - } - - public void SetLanguage(LanguageType arg0) { - lldbJNI.SBTypeSummaryOptions_SetLanguage(swigCPtr, this, arg0.swigValue()); - } - - public void SetCapping(TypeSummaryCapping arg0) { - lldbJNI.SBTypeSummaryOptions_SetCapping(swigCPtr, this, arg0.swigValue()); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeSynthetic.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeSynthetic.java deleted file mode 100644 index 79dfd2b3d8..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBTypeSynthetic.java +++ /dev/null @@ -1,122 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBTypeSynthetic { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBTypeSynthetic(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBTypeSynthetic obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBTypeSynthetic obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBTypeSynthetic(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBTypeSynthetic() { - this(lldbJNI.new_SBTypeSynthetic__SWIG_0(), true); - } - - public static SBTypeSynthetic CreateWithClassName(String data, long options) { - return new SBTypeSynthetic(lldbJNI.SBTypeSynthetic_CreateWithClassName__SWIG_0(data, options), true); - } - - public static SBTypeSynthetic CreateWithClassName(String data) { - return new SBTypeSynthetic(lldbJNI.SBTypeSynthetic_CreateWithClassName__SWIG_1(data), true); - } - - public static SBTypeSynthetic CreateWithScriptCode(String data, long options) { - return new SBTypeSynthetic(lldbJNI.SBTypeSynthetic_CreateWithScriptCode__SWIG_0(data, options), true); - } - - public static SBTypeSynthetic CreateWithScriptCode(String data) { - return new SBTypeSynthetic(lldbJNI.SBTypeSynthetic_CreateWithScriptCode__SWIG_1(data), true); - } - - public SBTypeSynthetic(SBTypeSynthetic rhs) { - this(lldbJNI.new_SBTypeSynthetic__SWIG_1(SBTypeSynthetic.getCPtr(rhs), rhs), true); - } - - public boolean IsValid() { - return lldbJNI.SBTypeSynthetic_IsValid(swigCPtr, this); - } - - public boolean IsClassCode() { - return lldbJNI.SBTypeSynthetic_IsClassCode(swigCPtr, this); - } - - public boolean IsClassName() { - return lldbJNI.SBTypeSynthetic_IsClassName(swigCPtr, this); - } - - public String GetData() { - return lldbJNI.SBTypeSynthetic_GetData(swigCPtr, this); - } - - public void SetClassName(String data) { - lldbJNI.SBTypeSynthetic_SetClassName(swigCPtr, this, data); - } - - public void SetClassCode(String data) { - lldbJNI.SBTypeSynthetic_SetClassCode(swigCPtr, this, data); - } - - public long GetOptions() { - return lldbJNI.SBTypeSynthetic_GetOptions(swigCPtr, this); - } - - public void SetOptions(long arg0) { - lldbJNI.SBTypeSynthetic_SetOptions(swigCPtr, this, arg0); - } - - public boolean GetDescription(SBStream description, DescriptionLevel description_level) { - return lldbJNI.SBTypeSynthetic_GetDescription(swigCPtr, this, SBStream.getCPtr(description), description, description_level.swigValue()); - } - - public boolean IsEqualTo(SBTypeSynthetic rhs) { - return lldbJNI.SBTypeSynthetic_IsEqualTo(swigCPtr, this, SBTypeSynthetic.getCPtr(rhs), rhs); - } - - public String __repr__() { - return lldbJNI.SBTypeSynthetic___repr__(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBUnixSignals.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBUnixSignals.java deleted file mode 100644 index be88870e87..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBUnixSignals.java +++ /dev/null @@ -1,110 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBUnixSignals { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBUnixSignals(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBUnixSignals obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBUnixSignals obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBUnixSignals(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBUnixSignals() { - this(lldbJNI.new_SBUnixSignals__SWIG_0(), true); - } - - public SBUnixSignals(SBUnixSignals rhs) { - this(lldbJNI.new_SBUnixSignals__SWIG_1(SBUnixSignals.getCPtr(rhs), rhs), true); - } - - public void Clear() { - lldbJNI.SBUnixSignals_Clear(swigCPtr, this); - } - - public boolean IsValid() { - return lldbJNI.SBUnixSignals_IsValid(swigCPtr, this); - } - - public String GetSignalAsCString(int signo) { - return lldbJNI.SBUnixSignals_GetSignalAsCString(swigCPtr, this, signo); - } - - public int GetSignalNumberFromName(String name) { - return lldbJNI.SBUnixSignals_GetSignalNumberFromName(swigCPtr, this, name); - } - - public boolean GetShouldSuppress(int signo) { - return lldbJNI.SBUnixSignals_GetShouldSuppress(swigCPtr, this, signo); - } - - public boolean SetShouldSuppress(int signo, boolean value) { - return lldbJNI.SBUnixSignals_SetShouldSuppress(swigCPtr, this, signo, value); - } - - public boolean GetShouldStop(int signo) { - return lldbJNI.SBUnixSignals_GetShouldStop(swigCPtr, this, signo); - } - - public boolean SetShouldStop(int signo, boolean value) { - return lldbJNI.SBUnixSignals_SetShouldStop(swigCPtr, this, signo, value); - } - - public boolean GetShouldNotify(int signo) { - return lldbJNI.SBUnixSignals_GetShouldNotify(swigCPtr, this, signo); - } - - public boolean SetShouldNotify(int signo, boolean value) { - return lldbJNI.SBUnixSignals_SetShouldNotify(swigCPtr, this, signo, value); - } - - public int GetNumSignals() { - return lldbJNI.SBUnixSignals_GetNumSignals(swigCPtr, this); - } - - public int GetSignalAtIndex(int index) { - return lldbJNI.SBUnixSignals_GetSignalAtIndex(swigCPtr, this, index); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBValue.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBValue.java deleted file mode 100644 index 69d91b0f2b..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBValue.java +++ /dev/null @@ -1,415 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBValue { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBValue(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBValue obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBValue obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBValue(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBValue() { - this(lldbJNI.new_SBValue__SWIG_0(), true); - } - - public SBValue(SBValue rhs) { - this(lldbJNI.new_SBValue__SWIG_1(SBValue.getCPtr(rhs), rhs), true); - } - - public boolean IsValid() { - return lldbJNI.SBValue_IsValid(swigCPtr, this); - } - - public void Clear() { - lldbJNI.SBValue_Clear(swigCPtr, this); - } - - public SBError GetError() { - return new SBError(lldbJNI.SBValue_GetError(swigCPtr, this), true); - } - - public java.math.BigInteger GetID() { - return lldbJNI.SBValue_GetID(swigCPtr, this); - } - - public String GetName() { - return lldbJNI.SBValue_GetName(swigCPtr, this); - } - - public String GetTypeName() { - return lldbJNI.SBValue_GetTypeName(swigCPtr, this); - } - - public String GetDisplayTypeName() { - return lldbJNI.SBValue_GetDisplayTypeName(swigCPtr, this); - } - - public long GetByteSize() { - return lldbJNI.SBValue_GetByteSize(swigCPtr, this); - } - - public boolean IsInScope() { - return lldbJNI.SBValue_IsInScope(swigCPtr, this); - } - - public Format GetFormat() { - return Format.swigToEnum(lldbJNI.SBValue_GetFormat(swigCPtr, this)); - } - - public void SetFormat(Format format) { - lldbJNI.SBValue_SetFormat(swigCPtr, this, format.swigValue()); - } - - public String GetValue() { - return lldbJNI.SBValue_GetValue(swigCPtr, this); - } - - public long GetValueAsSigned(SBError error, long fail_value) { - return lldbJNI.SBValue_GetValueAsSigned__SWIG_0(swigCPtr, this, SBError.getCPtr(error), error, fail_value); - } - - public long GetValueAsSigned(SBError error) { - return lldbJNI.SBValue_GetValueAsSigned__SWIG_1(swigCPtr, this, SBError.getCPtr(error), error); - } - - public java.math.BigInteger GetValueAsUnsigned(SBError error, java.math.BigInteger fail_value) { - return lldbJNI.SBValue_GetValueAsUnsigned__SWIG_0(swigCPtr, this, SBError.getCPtr(error), error, fail_value); - } - - public java.math.BigInteger GetValueAsUnsigned(SBError error) { - return lldbJNI.SBValue_GetValueAsUnsigned__SWIG_1(swigCPtr, this, SBError.getCPtr(error), error); - } - - public long GetValueAsSigned(long fail_value) { - return lldbJNI.SBValue_GetValueAsSigned__SWIG_2(swigCPtr, this, fail_value); - } - - public long GetValueAsSigned() { - return lldbJNI.SBValue_GetValueAsSigned__SWIG_3(swigCPtr, this); - } - - public java.math.BigInteger GetValueAsUnsigned(java.math.BigInteger fail_value) { - return lldbJNI.SBValue_GetValueAsUnsigned__SWIG_2(swigCPtr, this, fail_value); - } - - public java.math.BigInteger GetValueAsUnsigned() { - return lldbJNI.SBValue_GetValueAsUnsigned__SWIG_3(swigCPtr, this); - } - - public ValueType GetValueType() { - return ValueType.swigToEnum(lldbJNI.SBValue_GetValueType(swigCPtr, this)); - } - - public boolean GetValueDidChange() { - return lldbJNI.SBValue_GetValueDidChange(swigCPtr, this); - } - - public String GetSummary() { - return lldbJNI.SBValue_GetSummary__SWIG_0(swigCPtr, this); - } - - public String GetSummary(SBStream stream, SBTypeSummaryOptions options) { - return lldbJNI.SBValue_GetSummary__SWIG_1(swigCPtr, this, SBStream.getCPtr(stream), stream, SBTypeSummaryOptions.getCPtr(options), options); - } - - public String GetObjectDescription() { - return lldbJNI.SBValue_GetObjectDescription(swigCPtr, this); - } - - public SBValue GetDynamicValue(DynamicValueType use_dynamic) { - return new SBValue(lldbJNI.SBValue_GetDynamicValue(swigCPtr, this, use_dynamic.swigValue()), true); - } - - public SBValue GetStaticValue() { - return new SBValue(lldbJNI.SBValue_GetStaticValue(swigCPtr, this), true); - } - - public SBValue GetNonSyntheticValue() { - return new SBValue(lldbJNI.SBValue_GetNonSyntheticValue(swigCPtr, this), true); - } - - public DynamicValueType GetPreferDynamicValue() { - return DynamicValueType.swigToEnum(lldbJNI.SBValue_GetPreferDynamicValue(swigCPtr, this)); - } - - public void SetPreferDynamicValue(DynamicValueType use_dynamic) { - lldbJNI.SBValue_SetPreferDynamicValue(swigCPtr, this, use_dynamic.swigValue()); - } - - public boolean GetPreferSyntheticValue() { - return lldbJNI.SBValue_GetPreferSyntheticValue(swigCPtr, this); - } - - public void SetPreferSyntheticValue(boolean use_synthetic) { - lldbJNI.SBValue_SetPreferSyntheticValue(swigCPtr, this, use_synthetic); - } - - public boolean IsDynamic() { - return lldbJNI.SBValue_IsDynamic(swigCPtr, this); - } - - public boolean IsSynthetic() { - return lldbJNI.SBValue_IsSynthetic(swigCPtr, this); - } - - public boolean IsSyntheticChildrenGenerated() { - return lldbJNI.SBValue_IsSyntheticChildrenGenerated(swigCPtr, this); - } - - public void SetSyntheticChildrenGenerated(boolean arg0) { - lldbJNI.SBValue_SetSyntheticChildrenGenerated(swigCPtr, this, arg0); - } - - public String GetLocation() { - return lldbJNI.SBValue_GetLocation(swigCPtr, this); - } - - public boolean SetValueFromCString(String value_str) { - return lldbJNI.SBValue_SetValueFromCString__SWIG_0(swigCPtr, this, value_str); - } - - public boolean SetValueFromCString(String value_str, SBError error) { - return lldbJNI.SBValue_SetValueFromCString__SWIG_1(swigCPtr, this, value_str, SBError.getCPtr(error), error); - } - - public SBTypeFormat GetTypeFormat() { - return new SBTypeFormat(lldbJNI.SBValue_GetTypeFormat(swigCPtr, this), true); - } - - public SBTypeSummary GetTypeSummary() { - return new SBTypeSummary(lldbJNI.SBValue_GetTypeSummary(swigCPtr, this), true); - } - - public SBTypeFilter GetTypeFilter() { - return new SBTypeFilter(lldbJNI.SBValue_GetTypeFilter(swigCPtr, this), true); - } - - public SBTypeSynthetic GetTypeSynthetic() { - return new SBTypeSynthetic(lldbJNI.SBValue_GetTypeSynthetic(swigCPtr, this), true); - } - - public SBValue GetChildAtIndex(long idx) { - return new SBValue(lldbJNI.SBValue_GetChildAtIndex__SWIG_0(swigCPtr, this, idx), true); - } - - public SBValue CreateChildAtOffset(String name, long offset, SBType type) { - return new SBValue(lldbJNI.SBValue_CreateChildAtOffset(swigCPtr, this, name, offset, SBType.getCPtr(type), type), true); - } - - public SBValue Cast(SBType type) { - return new SBValue(lldbJNI.SBValue_Cast(swigCPtr, this, SBType.getCPtr(type), type), true); - } - - public SBValue CreateValueFromExpression(String name, String expression) { - return new SBValue(lldbJNI.SBValue_CreateValueFromExpression__SWIG_0(swigCPtr, this, name, expression), true); - } - - public SBValue CreateValueFromExpression(String name, String expression, SBExpressionOptions options) { - return new SBValue(lldbJNI.SBValue_CreateValueFromExpression__SWIG_1(swigCPtr, this, name, expression, SBExpressionOptions.getCPtr(options), options), true); - } - - public SBValue CreateValueFromAddress(String name, java.math.BigInteger address, SBType type) { - return new SBValue(lldbJNI.SBValue_CreateValueFromAddress(swigCPtr, this, name, address, SBType.getCPtr(type), type), true); - } - - public SBValue CreateValueFromData(String name, SBData data, SBType type) { - return new SBValue(lldbJNI.SBValue_CreateValueFromData(swigCPtr, this, name, SBData.getCPtr(data), data, SBType.getCPtr(type), type), true); - } - - public SBValue GetChildAtIndex(long idx, DynamicValueType use_dynamic, boolean can_create_synthetic) { - return new SBValue(lldbJNI.SBValue_GetChildAtIndex__SWIG_1(swigCPtr, this, idx, use_dynamic.swigValue(), can_create_synthetic), true); - } - - public long GetIndexOfChildWithName(String name) { - return lldbJNI.SBValue_GetIndexOfChildWithName(swigCPtr, this, name); - } - - public SBValue GetChildMemberWithName(String name) { - return new SBValue(lldbJNI.SBValue_GetChildMemberWithName__SWIG_0(swigCPtr, this, name), true); - } - - public SBValue GetChildMemberWithName(String name, DynamicValueType use_dynamic) { - return new SBValue(lldbJNI.SBValue_GetChildMemberWithName__SWIG_1(swigCPtr, this, name, use_dynamic.swigValue()), true); - } - - public SBValue GetValueForExpressionPath(String expr_path) { - return new SBValue(lldbJNI.SBValue_GetValueForExpressionPath(swigCPtr, this, expr_path), true); - } - - public SBValue AddressOf() { - return new SBValue(lldbJNI.SBValue_AddressOf(swigCPtr, this), true); - } - - public java.math.BigInteger GetLoadAddress() { - return lldbJNI.SBValue_GetLoadAddress(swigCPtr, this); - } - - public SBAddress GetAddress() { - return new SBAddress(lldbJNI.SBValue_GetAddress(swigCPtr, this), true); - } - - public SBData GetPointeeData(long item_idx, long item_count) { - return new SBData(lldbJNI.SBValue_GetPointeeData__SWIG_0(swigCPtr, this, item_idx, item_count), true); - } - - public SBData GetPointeeData(long item_idx) { - return new SBData(lldbJNI.SBValue_GetPointeeData__SWIG_1(swigCPtr, this, item_idx), true); - } - - public SBData GetPointeeData() { - return new SBData(lldbJNI.SBValue_GetPointeeData__SWIG_2(swigCPtr, this), true); - } - - public SBData GetData() { - return new SBData(lldbJNI.SBValue_GetData(swigCPtr, this), true); - } - - public boolean SetData(SBData data, SBError error) { - return lldbJNI.SBValue_SetData(swigCPtr, this, SBData.getCPtr(data), data, SBError.getCPtr(error), error); - } - - public SBValue Clone(String new_name) { - return new SBValue(lldbJNI.SBValue_Clone(swigCPtr, this, new_name), true); - } - - public SBDeclaration GetDeclaration() { - return new SBDeclaration(lldbJNI.SBValue_GetDeclaration(swigCPtr, this), true); - } - - public boolean MightHaveChildren() { - return lldbJNI.SBValue_MightHaveChildren(swigCPtr, this); - } - - public boolean IsRuntimeSupportValue() { - return lldbJNI.SBValue_IsRuntimeSupportValue(swigCPtr, this); - } - - public long GetNumChildren() { - return lldbJNI.SBValue_GetNumChildren__SWIG_0(swigCPtr, this); - } - - public long GetNumChildren(long max) { - return lldbJNI.SBValue_GetNumChildren__SWIG_1(swigCPtr, this, max); - } - - public SWIGTYPE_p_void GetOpaqueType() { - long cPtr = lldbJNI.SBValue_GetOpaqueType(swigCPtr, this); - return (cPtr == 0) ? null : new SWIGTYPE_p_void(cPtr, false); - } - - public SBTarget GetTarget() { - return new SBTarget(lldbJNI.SBValue_GetTarget(swigCPtr, this), true); - } - - public SBProcess GetProcess() { - return new SBProcess(lldbJNI.SBValue_GetProcess(swigCPtr, this), true); - } - - public SBThread GetThread() { - return new SBThread(lldbJNI.SBValue_GetThread(swigCPtr, this), true); - } - - public SBFrame GetFrame() { - return new SBFrame(lldbJNI.SBValue_GetFrame(swigCPtr, this), true); - } - - public SBValue Dereference() { - return new SBValue(lldbJNI.SBValue_Dereference(swigCPtr, this), true); - } - - public boolean TypeIsPointerType() { - return lldbJNI.SBValue_TypeIsPointerType(swigCPtr, this); - } - - public SBType GetType() { - return new SBType(lldbJNI.SBValue_GetType(swigCPtr, this), true); - } - - public SBValue Persist() { - return new SBValue(lldbJNI.SBValue_Persist(swigCPtr, this), true); - } - - public boolean GetDescription(SBStream description) { - return lldbJNI.SBValue_GetDescription(swigCPtr, this, SBStream.getCPtr(description), description); - } - - public boolean GetExpressionPath(SBStream description) { - return lldbJNI.SBValue_GetExpressionPath__SWIG_0(swigCPtr, this, SBStream.getCPtr(description), description); - } - - public boolean GetExpressionPath(SBStream description, boolean qualify_cxx_base_classes) { - return lldbJNI.SBValue_GetExpressionPath__SWIG_1(swigCPtr, this, SBStream.getCPtr(description), description, qualify_cxx_base_classes); - } - - public SBValue EvaluateExpression(String expr) { - return new SBValue(lldbJNI.SBValue_EvaluateExpression__SWIG_0(swigCPtr, this, expr), true); - } - - public SBValue EvaluateExpression(String expr, SBExpressionOptions options) { - return new SBValue(lldbJNI.SBValue_EvaluateExpression__SWIG_1(swigCPtr, this, expr, SBExpressionOptions.getCPtr(options), options), true); - } - - public SBValue EvaluateExpression(String expr, SBExpressionOptions options, String name) { - return new SBValue(lldbJNI.SBValue_EvaluateExpression__SWIG_2(swigCPtr, this, expr, SBExpressionOptions.getCPtr(options), options, name), true); - } - - public SBWatchpoint Watch(boolean resolve_location, boolean read, boolean write, SBError error) { - return new SBWatchpoint(lldbJNI.SBValue_Watch__SWIG_0(swigCPtr, this, resolve_location, read, write, SBError.getCPtr(error), error), true); - } - - public SBWatchpoint Watch(boolean resolve_location, boolean read, boolean write) { - return new SBWatchpoint(lldbJNI.SBValue_Watch__SWIG_1(swigCPtr, this, resolve_location, read, write), true); - } - - public SBWatchpoint WatchPointee(boolean resolve_location, boolean read, boolean write, SBError error) { - return new SBWatchpoint(lldbJNI.SBValue_WatchPointee(swigCPtr, this, resolve_location, read, write, SBError.getCPtr(error), error), true); - } - - public String __repr__() { - return lldbJNI.SBValue___repr__(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBValueList.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBValueList.java deleted file mode 100644 index 0fc92ebd3e..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBValueList.java +++ /dev/null @@ -1,102 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBValueList { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBValueList(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBValueList obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBValueList obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBValueList(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBValueList() { - this(lldbJNI.new_SBValueList__SWIG_0(), true); - } - - public SBValueList(SBValueList rhs) { - this(lldbJNI.new_SBValueList__SWIG_1(SBValueList.getCPtr(rhs), rhs), true); - } - - public boolean IsValid() { - return lldbJNI.SBValueList_IsValid(swigCPtr, this); - } - - public void Clear() { - lldbJNI.SBValueList_Clear(swigCPtr, this); - } - - public void Append(SBValue val_obj) { - lldbJNI.SBValueList_Append__SWIG_0(swigCPtr, this, SBValue.getCPtr(val_obj), val_obj); - } - - public void Append(SBValueList value_list) { - lldbJNI.SBValueList_Append__SWIG_1(swigCPtr, this, SBValueList.getCPtr(value_list), value_list); - } - - public long GetSize() { - return lldbJNI.SBValueList_GetSize(swigCPtr, this); - } - - public SBValue GetValueAtIndex(long idx) { - return new SBValue(lldbJNI.SBValueList_GetValueAtIndex(swigCPtr, this, idx), true); - } - - public SBValue GetFirstValueByName(String name) { - return new SBValue(lldbJNI.SBValueList_GetFirstValueByName(swigCPtr, this, name), true); - } - - public SBValue FindValueObjectByUID(java.math.BigInteger uid) { - return new SBValue(lldbJNI.SBValueList_FindValueObjectByUID(swigCPtr, this, uid), true); - } - - public SBError GetError() { - return new SBError(lldbJNI.SBValueList_GetError(swigCPtr, this), true); - } - - public String __str__() { - return lldbJNI.SBValueList___str__(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBVariablesOptions.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBVariablesOptions.java deleted file mode 100644 index 94b8239409..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBVariablesOptions.java +++ /dev/null @@ -1,122 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBVariablesOptions { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBVariablesOptions(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBVariablesOptions obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBVariablesOptions obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBVariablesOptions(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBVariablesOptions() { - this(lldbJNI.new_SBVariablesOptions__SWIG_0(), true); - } - - public SBVariablesOptions(SBVariablesOptions options) { - this(lldbJNI.new_SBVariablesOptions__SWIG_1(SBVariablesOptions.getCPtr(options), options), true); - } - - public boolean IsValid() { - return lldbJNI.SBVariablesOptions_IsValid(swigCPtr, this); - } - - public boolean GetIncludeArguments() { - return lldbJNI.SBVariablesOptions_GetIncludeArguments(swigCPtr, this); - } - - public void SetIncludeArguments(boolean arg0) { - lldbJNI.SBVariablesOptions_SetIncludeArguments(swigCPtr, this, arg0); - } - - public boolean GetIncludeRecognizedArguments(SBTarget arg0) { - return lldbJNI.SBVariablesOptions_GetIncludeRecognizedArguments(swigCPtr, this, SBTarget.getCPtr(arg0), arg0); - } - - public void SetIncludeRecognizedArguments(boolean arg0) { - lldbJNI.SBVariablesOptions_SetIncludeRecognizedArguments(swigCPtr, this, arg0); - } - - public boolean GetIncludeLocals() { - return lldbJNI.SBVariablesOptions_GetIncludeLocals(swigCPtr, this); - } - - public void SetIncludeLocals(boolean arg0) { - lldbJNI.SBVariablesOptions_SetIncludeLocals(swigCPtr, this, arg0); - } - - public boolean GetIncludeStatics() { - return lldbJNI.SBVariablesOptions_GetIncludeStatics(swigCPtr, this); - } - - public void SetIncludeStatics(boolean arg0) { - lldbJNI.SBVariablesOptions_SetIncludeStatics(swigCPtr, this, arg0); - } - - public boolean GetInScopeOnly() { - return lldbJNI.SBVariablesOptions_GetInScopeOnly(swigCPtr, this); - } - - public void SetInScopeOnly(boolean arg0) { - lldbJNI.SBVariablesOptions_SetInScopeOnly(swigCPtr, this, arg0); - } - - public boolean GetIncludeRuntimeSupportValues() { - return lldbJNI.SBVariablesOptions_GetIncludeRuntimeSupportValues(swigCPtr, this); - } - - public void SetIncludeRuntimeSupportValues(boolean arg0) { - lldbJNI.SBVariablesOptions_SetIncludeRuntimeSupportValues(swigCPtr, this, arg0); - } - - public DynamicValueType GetUseDynamic() { - return DynamicValueType.swigToEnum(lldbJNI.SBVariablesOptions_GetUseDynamic(swigCPtr, this)); - } - - public void SetUseDynamic(DynamicValueType arg0) { - lldbJNI.SBVariablesOptions_SetUseDynamic(swigCPtr, this, arg0.swigValue()); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBWatchpoint.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBWatchpoint.java deleted file mode 100644 index dc7f86e327..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SBWatchpoint.java +++ /dev/null @@ -1,158 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SBWatchpoint { - private transient long swigCPtr; - protected transient boolean swigCMemOwn; - - protected SBWatchpoint(long cPtr, boolean cMemoryOwn) { - swigCMemOwn = cMemoryOwn; - swigCPtr = cPtr; - } - - protected static long getCPtr(SBWatchpoint obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SBWatchpoint obj) { - long ptr = 0; - if (obj != null) { - if (!obj.swigCMemOwn) - throw new RuntimeException("Cannot release ownership as memory is not owned"); - ptr = obj.swigCPtr; - obj.swigCMemOwn = false; - obj.delete(); - } - return ptr; - } - - @SuppressWarnings("deprecation") - protected void finalize() { - delete(); - } - - public synchronized void delete() { - if (swigCPtr != 0) { - if (swigCMemOwn) { - swigCMemOwn = false; - lldbJNI.delete_SBWatchpoint(swigCPtr); - } - swigCPtr = 0; - } - } - - public SBWatchpoint() { - this(lldbJNI.new_SBWatchpoint__SWIG_0(), true); - } - - public SBWatchpoint(SBWatchpoint rhs) { - this(lldbJNI.new_SBWatchpoint__SWIG_1(SBWatchpoint.getCPtr(rhs), rhs), true); - } - - public boolean IsValid() { - return lldbJNI.SBWatchpoint_IsValid(swigCPtr, this); - } - - public SBError GetError() { - return new SBError(lldbJNI.SBWatchpoint_GetError(swigCPtr, this), true); - } - - public int GetID() { - return lldbJNI.SBWatchpoint_GetID(swigCPtr, this); - } - - public int GetHardwareIndex() { - return lldbJNI.SBWatchpoint_GetHardwareIndex(swigCPtr, this); - } - - public java.math.BigInteger GetWatchAddress() { - return lldbJNI.SBWatchpoint_GetWatchAddress(swigCPtr, this); - } - - public long GetWatchSize() { - return lldbJNI.SBWatchpoint_GetWatchSize(swigCPtr, this); - } - - public void SetEnabled(boolean enabled) { - lldbJNI.SBWatchpoint_SetEnabled(swigCPtr, this, enabled); - } - - public boolean IsEnabled() { - return lldbJNI.SBWatchpoint_IsEnabled(swigCPtr, this); - } - - public long GetHitCount() { - return lldbJNI.SBWatchpoint_GetHitCount(swigCPtr, this); - } - - public long GetIgnoreCount() { - return lldbJNI.SBWatchpoint_GetIgnoreCount(swigCPtr, this); - } - - public void SetIgnoreCount(long n) { - lldbJNI.SBWatchpoint_SetIgnoreCount(swigCPtr, this, n); - } - - public String GetCondition() { - return lldbJNI.SBWatchpoint_GetCondition(swigCPtr, this); - } - - public void SetCondition(String condition) { - lldbJNI.SBWatchpoint_SetCondition(swigCPtr, this, condition); - } - - public boolean GetDescription(SBStream description, DescriptionLevel level) { - return lldbJNI.SBWatchpoint_GetDescription(swigCPtr, this, SBStream.getCPtr(description), description, level.swigValue()); - } - - public void Clear() { - lldbJNI.SBWatchpoint_Clear(swigCPtr, this); - } - - public static boolean EventIsWatchpointEvent(SBEvent event) { - return lldbJNI.SBWatchpoint_EventIsWatchpointEvent(SBEvent.getCPtr(event), event); - } - - public static WatchpointEventType GetWatchpointEventTypeFromEvent(SBEvent event) { - return WatchpointEventType.swigToEnum(lldbJNI.SBWatchpoint_GetWatchpointEventTypeFromEvent(SBEvent.getCPtr(event), event)); - } - - public static SBWatchpoint GetWatchpointFromEvent(SBEvent event) { - return new SBWatchpoint(lldbJNI.SBWatchpoint_GetWatchpointFromEvent(SBEvent.getCPtr(event), event), true); - } - - public SBType GetType() { - return new SBType(lldbJNI.SBWatchpoint_GetType(swigCPtr, this), true); - } - - public WatchpointValueKind GetWatchValueKind() { - return WatchpointValueKind.swigToEnum(lldbJNI.SBWatchpoint_GetWatchValueKind(swigCPtr, this)); - } - - public String GetWatchSpec() { - return lldbJNI.SBWatchpoint_GetWatchSpec(swigCPtr, this); - } - - public boolean IsWatchingReads() { - return lldbJNI.SBWatchpoint_IsWatchingReads(swigCPtr, this); - } - - public boolean IsWatchingWrites() { - return lldbJNI.SBWatchpoint_IsWatchingWrites(swigCPtr, this); - } - - public String __repr__() { - return lldbJNI.SBWatchpoint___repr__(swigCPtr, this); - } - -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_double.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_double.java deleted file mode 100644 index 9e7948b0f2..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_double.java +++ /dev/null @@ -1,33 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SWIGTYPE_p_double { - private transient long swigCPtr; - - protected SWIGTYPE_p_double(long cPtr, @SuppressWarnings("unused") boolean futureUse) { - swigCPtr = cPtr; - } - - protected SWIGTYPE_p_double() { - swigCPtr = 0; - } - - protected static long getCPtr(SWIGTYPE_p_double obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SWIGTYPE_p_double obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_f_p_q_const__char_p_void__void.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_f_p_q_const__char_p_void__void.java deleted file mode 100644 index b957c5b45c..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_f_p_q_const__char_p_void__void.java +++ /dev/null @@ -1,33 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SWIGTYPE_p_f_p_q_const__char_p_void__void { - private transient long swigCPtr; - - protected SWIGTYPE_p_f_p_q_const__char_p_void__void(long cPtr, @SuppressWarnings("unused") boolean futureUse) { - swigCPtr = cPtr; - } - - protected SWIGTYPE_p_f_p_q_const__char_p_void__void() { - swigCPtr = 0; - } - - protected static long getCPtr(SWIGTYPE_p_f_p_q_const__char_p_void__void obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SWIGTYPE_p_f_p_q_const__char_p_void__void obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_f_p_void__p_void.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_f_p_void__p_void.java deleted file mode 100644 index 4b91639bd8..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_f_p_void__p_void.java +++ /dev/null @@ -1,33 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SWIGTYPE_p_f_p_void__p_void { - private transient long swigCPtr; - - protected SWIGTYPE_p_f_p_void__p_void(long cPtr, @SuppressWarnings("unused") boolean futureUse) { - swigCPtr = cPtr; - } - - protected SWIGTYPE_p_f_p_void__p_void() { - swigCPtr = 0; - } - - protected static long getCPtr(SWIGTYPE_p_f_p_void__p_void obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SWIGTYPE_p_f_p_void__p_void obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_f_p_void_p_q_const__void_size_t__void.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_f_p_void_p_q_const__void_size_t__void.java deleted file mode 100644 index 82a9182960..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_f_p_void_p_q_const__void_size_t__void.java +++ /dev/null @@ -1,33 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SWIGTYPE_p_f_p_void_p_q_const__void_size_t__void { - private transient long swigCPtr; - - protected SWIGTYPE_p_f_p_void_p_q_const__void_size_t__void(long cPtr, @SuppressWarnings("unused") boolean futureUse) { - swigCPtr = cPtr; - } - - protected SWIGTYPE_p_f_p_void_p_q_const__void_size_t__void() { - swigCPtr = 0; - } - - protected static long getCPtr(SWIGTYPE_p_f_p_void_p_q_const__void_size_t__void obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SWIGTYPE_p_f_p_void_p_q_const__void_size_t__void obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_f_p_void_r_q_const__lldb__SBModuleSpec_r_lldb__SBFileSpec_r_lldb__SBFileSpec__lldb__SBError.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_f_p_void_r_q_const__lldb__SBModuleSpec_r_lldb__SBFileSpec_r_lldb__SBFileSpec__lldb__SBError.java deleted file mode 100644 index 00eb6c74c4..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_f_p_void_r_q_const__lldb__SBModuleSpec_r_lldb__SBFileSpec_r_lldb__SBFileSpec__lldb__SBError.java +++ /dev/null @@ -1,33 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SWIGTYPE_p_f_p_void_r_q_const__lldb__SBModuleSpec_r_lldb__SBFileSpec_r_lldb__SBFileSpec__lldb__SBError { - private transient long swigCPtr; - - protected SWIGTYPE_p_f_p_void_r_q_const__lldb__SBModuleSpec_r_lldb__SBFileSpec_r_lldb__SBFileSpec__lldb__SBError(long cPtr, @SuppressWarnings("unused") boolean futureUse) { - swigCPtr = cPtr; - } - - protected SWIGTYPE_p_f_p_void_r_q_const__lldb__SBModuleSpec_r_lldb__SBFileSpec_r_lldb__SBFileSpec__lldb__SBError() { - swigCPtr = 0; - } - - protected static long getCPtr(SWIGTYPE_p_f_p_void_r_q_const__lldb__SBModuleSpec_r_lldb__SBFileSpec_r_lldb__SBFileSpec__lldb__SBError obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SWIGTYPE_p_f_p_void_r_q_const__lldb__SBModuleSpec_r_lldb__SBFileSpec_r_lldb__SBFileSpec__lldb__SBError obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_f_unsigned_long_long_p_void__void.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_f_unsigned_long_long_p_void__void.java deleted file mode 100644 index dc3a985e46..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_f_unsigned_long_long_p_void__void.java +++ /dev/null @@ -1,33 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SWIGTYPE_p_f_unsigned_long_long_p_void__void { - private transient long swigCPtr; - - protected SWIGTYPE_p_f_unsigned_long_long_p_void__void(long cPtr, @SuppressWarnings("unused") boolean futureUse) { - swigCPtr = cPtr; - } - - protected SWIGTYPE_p_f_unsigned_long_long_p_void__void() { - swigCPtr = 0; - } - - protected static long getCPtr(SWIGTYPE_p_f_unsigned_long_long_p_void__void obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SWIGTYPE_p_f_unsigned_long_long_p_void__void obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_int.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_int.java deleted file mode 100644 index 3d95417163..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_int.java +++ /dev/null @@ -1,33 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SWIGTYPE_p_int { - private transient long swigCPtr; - - protected SWIGTYPE_p_int(long cPtr, @SuppressWarnings("unused") boolean futureUse) { - swigCPtr = cPtr; - } - - protected SWIGTYPE_p_int() { - swigCPtr = 0; - } - - protected static long getCPtr(SWIGTYPE_p_int obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SWIGTYPE_p_int obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_jbyte.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_jbyte.java deleted file mode 100644 index d582918f3f..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_jbyte.java +++ /dev/null @@ -1,33 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SWIGTYPE_p_jbyte { - private transient long swigCPtr; - - protected SWIGTYPE_p_jbyte(long cPtr, @SuppressWarnings("unused") boolean futureUse) { - swigCPtr = cPtr; - } - - protected SWIGTYPE_p_jbyte() { - swigCPtr = 0; - } - - protected static long getCPtr(SWIGTYPE_p_jbyte obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SWIGTYPE_p_jbyte obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_lldb__ConnectionStatus.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_lldb__ConnectionStatus.java deleted file mode 100644 index a7775ac758..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_lldb__ConnectionStatus.java +++ /dev/null @@ -1,33 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SWIGTYPE_p_lldb__ConnectionStatus { - private transient long swigCPtr; - - protected SWIGTYPE_p_lldb__ConnectionStatus(long cPtr, @SuppressWarnings("unused") boolean futureUse) { - swigCPtr = cPtr; - } - - protected SWIGTYPE_p_lldb__ConnectionStatus() { - swigCPtr = 0; - } - - protected static long getCPtr(SWIGTYPE_p_lldb__ConnectionStatus obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SWIGTYPE_p_lldb__ConnectionStatus obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_long_double.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_long_double.java deleted file mode 100644 index 87ed403d0e..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_long_double.java +++ /dev/null @@ -1,33 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SWIGTYPE_p_long_double { - private transient long swigCPtr; - - protected SWIGTYPE_p_long_double(long cPtr, @SuppressWarnings("unused") boolean futureUse) { - swigCPtr = cPtr; - } - - protected SWIGTYPE_p_long_double() { - swigCPtr = 0; - } - - protected static long getCPtr(SWIGTYPE_p_long_double obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SWIGTYPE_p_long_double obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_long_long.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_long_long.java deleted file mode 100644 index 659e38d1db..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_long_long.java +++ /dev/null @@ -1,33 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SWIGTYPE_p_long_long { - private transient long swigCPtr; - - protected SWIGTYPE_p_long_long(long cPtr, @SuppressWarnings("unused") boolean futureUse) { - swigCPtr = cPtr; - } - - protected SWIGTYPE_p_long_long() { - swigCPtr = 0; - } - - protected static long getCPtr(SWIGTYPE_p_long_long obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SWIGTYPE_p_long_long obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_p_void.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_p_void.java deleted file mode 100644 index 5b41cbc5ef..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_p_void.java +++ /dev/null @@ -1,33 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SWIGTYPE_p_p_void { - private transient long swigCPtr; - - protected SWIGTYPE_p_p_void(long cPtr, @SuppressWarnings("unused") boolean futureUse) { - swigCPtr = cPtr; - } - - protected SWIGTYPE_p_p_void() { - swigCPtr = 0; - } - - protected static long getCPtr(SWIGTYPE_p_p_void obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SWIGTYPE_p_p_void obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_pthread_t.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_pthread_t.java deleted file mode 100644 index a3e3ace1b0..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_pthread_t.java +++ /dev/null @@ -1,33 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SWIGTYPE_p_pthread_t { - private transient long swigCPtr; - - protected SWIGTYPE_p_pthread_t(long cPtr, @SuppressWarnings("unused") boolean futureUse) { - swigCPtr = cPtr; - } - - protected SWIGTYPE_p_pthread_t() { - swigCPtr = 0; - } - - protected static long getCPtr(SWIGTYPE_p_pthread_t obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SWIGTYPE_p_pthread_t obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_size_t.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_size_t.java deleted file mode 100644 index 42f986654e..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_size_t.java +++ /dev/null @@ -1,33 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SWIGTYPE_p_size_t { - private transient long swigCPtr; - - protected SWIGTYPE_p_size_t(long cPtr, @SuppressWarnings("unused") boolean futureUse) { - swigCPtr = cPtr; - } - - protected SWIGTYPE_p_size_t() { - swigCPtr = 0; - } - - protected static long getCPtr(SWIGTYPE_p_size_t obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SWIGTYPE_p_size_t obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__Event_t.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__Event_t.java deleted file mode 100644 index 8fc3ade8e7..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__Event_t.java +++ /dev/null @@ -1,29 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.1 - * - * Do not make changes to this file unless you know what you are doing--modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SWIGTYPE_p_std__shared_ptrT_lldb_private__Event_t { - private transient long swigCPtr; - - protected SWIGTYPE_p_std__shared_ptrT_lldb_private__Event_t(long cPtr, @SuppressWarnings("unused") boolean futureUse) { - swigCPtr = cPtr; - } - - protected SWIGTYPE_p_std__shared_ptrT_lldb_private__Event_t() { - swigCPtr = 0; - } - - protected static long getCPtr(SWIGTYPE_p_std__shared_ptrT_lldb_private__Event_t obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t.java deleted file mode 100644 index 38c186ac3a..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t.java +++ /dev/null @@ -1,33 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t { - private transient long swigCPtr; - - protected SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t(long cPtr, @SuppressWarnings("unused") boolean futureUse) { - swigCPtr = cPtr; - } - - protected SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t() { - swigCPtr = 0; - } - - protected static long getCPtr(SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SWIGTYPE_p_std__shared_ptrT_lldb_private__File_t obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__QueueItem_t.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__QueueItem_t.java deleted file mode 100644 index 02374cc713..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__QueueItem_t.java +++ /dev/null @@ -1,29 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.1 - * - * Do not make changes to this file unless you know what you are doing--modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SWIGTYPE_p_std__shared_ptrT_lldb_private__QueueItem_t { - private transient long swigCPtr; - - protected SWIGTYPE_p_std__shared_ptrT_lldb_private__QueueItem_t(long cPtr, @SuppressWarnings("unused") boolean futureUse) { - swigCPtr = cPtr; - } - - protected SWIGTYPE_p_std__shared_ptrT_lldb_private__QueueItem_t() { - swigCPtr = 0; - } - - protected static long getCPtr(SWIGTYPE_p_std__shared_ptrT_lldb_private__QueueItem_t obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__Queue_t.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__Queue_t.java deleted file mode 100644 index 8ee68465b9..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__Queue_t.java +++ /dev/null @@ -1,29 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.1 - * - * Do not make changes to this file unless you know what you are doing--modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SWIGTYPE_p_std__shared_ptrT_lldb_private__Queue_t { - private transient long swigCPtr; - - protected SWIGTYPE_p_std__shared_ptrT_lldb_private__Queue_t(long cPtr, @SuppressWarnings("unused") boolean futureUse) { - swigCPtr = cPtr; - } - - protected SWIGTYPE_p_std__shared_ptrT_lldb_private__Queue_t() { - swigCPtr = 0; - } - - protected static long getCPtr(SWIGTYPE_p_std__shared_ptrT_lldb_private__Queue_t obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__ThreadPlan_t.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__ThreadPlan_t.java deleted file mode 100644 index ccd3af7e5a..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__ThreadPlan_t.java +++ /dev/null @@ -1,29 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.1 - * - * Do not make changes to this file unless you know what you are doing--modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SWIGTYPE_p_std__shared_ptrT_lldb_private__ThreadPlan_t { - private transient long swigCPtr; - - protected SWIGTYPE_p_std__shared_ptrT_lldb_private__ThreadPlan_t(long cPtr, @SuppressWarnings("unused") boolean futureUse) { - swigCPtr = cPtr; - } - - protected SWIGTYPE_p_std__shared_ptrT_lldb_private__ThreadPlan_t() { - swigCPtr = 0; - } - - protected static long getCPtr(SWIGTYPE_p_std__shared_ptrT_lldb_private__ThreadPlan_t obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__TraceCursor_t.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__TraceCursor_t.java deleted file mode 100644 index e7c4339b84..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_std__shared_ptrT_lldb_private__TraceCursor_t.java +++ /dev/null @@ -1,29 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 4.0.1 - * - * Do not make changes to this file unless you know what you are doing--modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SWIGTYPE_p_std__shared_ptrT_lldb_private__TraceCursor_t { - private transient long swigCPtr; - - protected SWIGTYPE_p_std__shared_ptrT_lldb_private__TraceCursor_t(long cPtr, @SuppressWarnings("unused") boolean futureUse) { - swigCPtr = cPtr; - } - - protected SWIGTYPE_p_std__shared_ptrT_lldb_private__TraceCursor_t() { - swigCPtr = 0; - } - - protected static long getCPtr(SWIGTYPE_p_std__shared_ptrT_lldb_private__TraceCursor_t obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_unsigned_char.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_unsigned_char.java deleted file mode 100644 index 4382bfff45..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_unsigned_char.java +++ /dev/null @@ -1,33 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SWIGTYPE_p_unsigned_char { - private transient long swigCPtr; - - protected SWIGTYPE_p_unsigned_char(long cPtr, @SuppressWarnings("unused") boolean futureUse) { - swigCPtr = cPtr; - } - - protected SWIGTYPE_p_unsigned_char() { - swigCPtr = 0; - } - - protected static long getCPtr(SWIGTYPE_p_unsigned_char obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SWIGTYPE_p_unsigned_char obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_unsigned_int.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_unsigned_int.java deleted file mode 100644 index ae9901e9df..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_unsigned_int.java +++ /dev/null @@ -1,33 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SWIGTYPE_p_unsigned_int { - private transient long swigCPtr; - - protected SWIGTYPE_p_unsigned_int(long cPtr, @SuppressWarnings("unused") boolean futureUse) { - swigCPtr = cPtr; - } - - protected SWIGTYPE_p_unsigned_int() { - swigCPtr = 0; - } - - protected static long getCPtr(SWIGTYPE_p_unsigned_int obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SWIGTYPE_p_unsigned_int obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_unsigned_long_long.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_unsigned_long_long.java deleted file mode 100644 index 57568108d2..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_unsigned_long_long.java +++ /dev/null @@ -1,33 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SWIGTYPE_p_unsigned_long_long { - private transient long swigCPtr; - - protected SWIGTYPE_p_unsigned_long_long(long cPtr, @SuppressWarnings("unused") boolean futureUse) { - swigCPtr = cPtr; - } - - protected SWIGTYPE_p_unsigned_long_long() { - swigCPtr = 0; - } - - protected static long getCPtr(SWIGTYPE_p_unsigned_long_long obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SWIGTYPE_p_unsigned_long_long obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_void.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_void.java deleted file mode 100644 index 07dcf16e5b..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SWIGTYPE_p_void.java +++ /dev/null @@ -1,33 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class SWIGTYPE_p_void { - private transient long swigCPtr; - - protected SWIGTYPE_p_void(long cPtr, @SuppressWarnings("unused") boolean futureUse) { - swigCPtr = cPtr; - } - - protected SWIGTYPE_p_void() { - swigCPtr = 0; - } - - protected static long getCPtr(SWIGTYPE_p_void obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } - - protected static long swigRelease(SWIGTYPE_p_void obj) { - return (obj == null) ? 0 : obj.swigCPtr; - } -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SaveCoreStyle.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SaveCoreStyle.java deleted file mode 100644 index e9f335cfeb..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SaveCoreStyle.java +++ /dev/null @@ -1,59 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class SaveCoreStyle { - public final static SaveCoreStyle eSaveCoreUnspecified = new SaveCoreStyle("eSaveCoreUnspecified", lldbJNI.eSaveCoreUnspecified_get()); - public final static SaveCoreStyle eSaveCoreFull = new SaveCoreStyle("eSaveCoreFull", lldbJNI.eSaveCoreFull_get()); - public final static SaveCoreStyle eSaveCoreDirtyOnly = new SaveCoreStyle("eSaveCoreDirtyOnly", lldbJNI.eSaveCoreDirtyOnly_get()); - public final static SaveCoreStyle eSaveCoreStackOnly = new SaveCoreStyle("eSaveCoreStackOnly", lldbJNI.eSaveCoreStackOnly_get()); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static SaveCoreStyle swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + SaveCoreStyle.class + " with value " + swigValue); - } - - private SaveCoreStyle(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private SaveCoreStyle(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private SaveCoreStyle(String swigName, SaveCoreStyle swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static SaveCoreStyle[] swigValues = { eSaveCoreUnspecified, eSaveCoreFull, eSaveCoreDirtyOnly, eSaveCoreStackOnly }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ScriptLanguage.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ScriptLanguage.java deleted file mode 100644 index 2a835533c5..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ScriptLanguage.java +++ /dev/null @@ -1,60 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class ScriptLanguage { - public final static ScriptLanguage eScriptLanguageNone = new ScriptLanguage("eScriptLanguageNone", lldbJNI.eScriptLanguageNone_get()); - public final static ScriptLanguage eScriptLanguagePython = new ScriptLanguage("eScriptLanguagePython"); - public final static ScriptLanguage eScriptLanguageLua = new ScriptLanguage("eScriptLanguageLua"); - public final static ScriptLanguage eScriptLanguageUnknown = new ScriptLanguage("eScriptLanguageUnknown"); - public final static ScriptLanguage eScriptLanguageDefault = new ScriptLanguage("eScriptLanguageDefault", lldbJNI.eScriptLanguageDefault_get()); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static ScriptLanguage swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + ScriptLanguage.class + " with value " + swigValue); - } - - private ScriptLanguage(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private ScriptLanguage(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private ScriptLanguage(String swigName, ScriptLanguage swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static ScriptLanguage[] swigValues = { eScriptLanguageNone, eScriptLanguagePython, eScriptLanguageLua, eScriptLanguageUnknown, eScriptLanguageDefault }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SearchDepth.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SearchDepth.java deleted file mode 100644 index ae5349b42d..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SearchDepth.java +++ /dev/null @@ -1,63 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class SearchDepth { - public final static SearchDepth eSearchDepthInvalid = new SearchDepth("eSearchDepthInvalid", lldbJNI.eSearchDepthInvalid_get()); - public final static SearchDepth eSearchDepthTarget = new SearchDepth("eSearchDepthTarget"); - public final static SearchDepth eSearchDepthModule = new SearchDepth("eSearchDepthModule"); - public final static SearchDepth eSearchDepthCompUnit = new SearchDepth("eSearchDepthCompUnit"); - public final static SearchDepth eSearchDepthFunction = new SearchDepth("eSearchDepthFunction"); - public final static SearchDepth eSearchDepthBlock = new SearchDepth("eSearchDepthBlock"); - public final static SearchDepth eSearchDepthAddress = new SearchDepth("eSearchDepthAddress"); - public final static SearchDepth kLastSearchDepthKind = new SearchDepth("kLastSearchDepthKind", lldbJNI.kLastSearchDepthKind_get()); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static SearchDepth swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + SearchDepth.class + " with value " + swigValue); - } - - private SearchDepth(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private SearchDepth(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private SearchDepth(String swigName, SearchDepth swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static SearchDepth[] swigValues = { eSearchDepthInvalid, eSearchDepthTarget, eSearchDepthModule, eSearchDepthCompUnit, eSearchDepthFunction, eSearchDepthBlock, eSearchDepthAddress, kLastSearchDepthKind }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SectionType.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SectionType.java deleted file mode 100644 index b6ba3e50f3..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SectionType.java +++ /dev/null @@ -1,116 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class SectionType { - public final static SectionType eSectionTypeInvalid = new SectionType("eSectionTypeInvalid"); - public final static SectionType eSectionTypeCode = new SectionType("eSectionTypeCode"); - public final static SectionType eSectionTypeContainer = new SectionType("eSectionTypeContainer"); - public final static SectionType eSectionTypeData = new SectionType("eSectionTypeData"); - public final static SectionType eSectionTypeDataCString = new SectionType("eSectionTypeDataCString"); - public final static SectionType eSectionTypeDataCStringPointers = new SectionType("eSectionTypeDataCStringPointers"); - public final static SectionType eSectionTypeDataSymbolAddress = new SectionType("eSectionTypeDataSymbolAddress"); - public final static SectionType eSectionTypeData4 = new SectionType("eSectionTypeData4"); - public final static SectionType eSectionTypeData8 = new SectionType("eSectionTypeData8"); - public final static SectionType eSectionTypeData16 = new SectionType("eSectionTypeData16"); - public final static SectionType eSectionTypeDataPointers = new SectionType("eSectionTypeDataPointers"); - public final static SectionType eSectionTypeDebug = new SectionType("eSectionTypeDebug"); - public final static SectionType eSectionTypeZeroFill = new SectionType("eSectionTypeZeroFill"); - public final static SectionType eSectionTypeDataObjCMessageRefs = new SectionType("eSectionTypeDataObjCMessageRefs"); - public final static SectionType eSectionTypeDataObjCCFStrings = new SectionType("eSectionTypeDataObjCCFStrings"); - public final static SectionType eSectionTypeDWARFDebugAbbrev = new SectionType("eSectionTypeDWARFDebugAbbrev"); - public final static SectionType eSectionTypeDWARFDebugAddr = new SectionType("eSectionTypeDWARFDebugAddr"); - public final static SectionType eSectionTypeDWARFDebugAranges = new SectionType("eSectionTypeDWARFDebugAranges"); - public final static SectionType eSectionTypeDWARFDebugCuIndex = new SectionType("eSectionTypeDWARFDebugCuIndex"); - public final static SectionType eSectionTypeDWARFDebugFrame = new SectionType("eSectionTypeDWARFDebugFrame"); - public final static SectionType eSectionTypeDWARFDebugInfo = new SectionType("eSectionTypeDWARFDebugInfo"); - public final static SectionType eSectionTypeDWARFDebugLine = new SectionType("eSectionTypeDWARFDebugLine"); - public final static SectionType eSectionTypeDWARFDebugLoc = new SectionType("eSectionTypeDWARFDebugLoc"); - public final static SectionType eSectionTypeDWARFDebugMacInfo = new SectionType("eSectionTypeDWARFDebugMacInfo"); - public final static SectionType eSectionTypeDWARFDebugMacro = new SectionType("eSectionTypeDWARFDebugMacro"); - public final static SectionType eSectionTypeDWARFDebugPubNames = new SectionType("eSectionTypeDWARFDebugPubNames"); - public final static SectionType eSectionTypeDWARFDebugPubTypes = new SectionType("eSectionTypeDWARFDebugPubTypes"); - public final static SectionType eSectionTypeDWARFDebugRanges = new SectionType("eSectionTypeDWARFDebugRanges"); - public final static SectionType eSectionTypeDWARFDebugStr = new SectionType("eSectionTypeDWARFDebugStr"); - public final static SectionType eSectionTypeDWARFDebugStrOffsets = new SectionType("eSectionTypeDWARFDebugStrOffsets"); - public final static SectionType eSectionTypeDWARFAppleNames = new SectionType("eSectionTypeDWARFAppleNames"); - public final static SectionType eSectionTypeDWARFAppleTypes = new SectionType("eSectionTypeDWARFAppleTypes"); - public final static SectionType eSectionTypeDWARFAppleNamespaces = new SectionType("eSectionTypeDWARFAppleNamespaces"); - public final static SectionType eSectionTypeDWARFAppleObjC = new SectionType("eSectionTypeDWARFAppleObjC"); - public final static SectionType eSectionTypeELFSymbolTable = new SectionType("eSectionTypeELFSymbolTable"); - public final static SectionType eSectionTypeELFDynamicSymbols = new SectionType("eSectionTypeELFDynamicSymbols"); - public final static SectionType eSectionTypeELFRelocationEntries = new SectionType("eSectionTypeELFRelocationEntries"); - public final static SectionType eSectionTypeELFDynamicLinkInfo = new SectionType("eSectionTypeELFDynamicLinkInfo"); - public final static SectionType eSectionTypeEHFrame = new SectionType("eSectionTypeEHFrame"); - public final static SectionType eSectionTypeARMexidx = new SectionType("eSectionTypeARMexidx"); - public final static SectionType eSectionTypeARMextab = new SectionType("eSectionTypeARMextab"); - public final static SectionType eSectionTypeCompactUnwind = new SectionType("eSectionTypeCompactUnwind"); - public final static SectionType eSectionTypeGoSymtab = new SectionType("eSectionTypeGoSymtab"); - public final static SectionType eSectionTypeAbsoluteAddress = new SectionType("eSectionTypeAbsoluteAddress"); - public final static SectionType eSectionTypeDWARFGNUDebugAltLink = new SectionType("eSectionTypeDWARFGNUDebugAltLink"); - public final static SectionType eSectionTypeDWARFDebugTypes = new SectionType("eSectionTypeDWARFDebugTypes"); - public final static SectionType eSectionTypeDWARFDebugNames = new SectionType("eSectionTypeDWARFDebugNames"); - public final static SectionType eSectionTypeOther = new SectionType("eSectionTypeOther"); - public final static SectionType eSectionTypeDWARFDebugLineStr = new SectionType("eSectionTypeDWARFDebugLineStr"); - public final static SectionType eSectionTypeDWARFDebugRngLists = new SectionType("eSectionTypeDWARFDebugRngLists"); - public final static SectionType eSectionTypeDWARFDebugLocLists = new SectionType("eSectionTypeDWARFDebugLocLists"); - public final static SectionType eSectionTypeDWARFDebugAbbrevDwo = new SectionType("eSectionTypeDWARFDebugAbbrevDwo"); - public final static SectionType eSectionTypeDWARFDebugInfoDwo = new SectionType("eSectionTypeDWARFDebugInfoDwo"); - public final static SectionType eSectionTypeDWARFDebugStrDwo = new SectionType("eSectionTypeDWARFDebugStrDwo"); - public final static SectionType eSectionTypeDWARFDebugStrOffsetsDwo = new SectionType("eSectionTypeDWARFDebugStrOffsetsDwo"); - public final static SectionType eSectionTypeDWARFDebugTypesDwo = new SectionType("eSectionTypeDWARFDebugTypesDwo"); - public final static SectionType eSectionTypeDWARFDebugRngListsDwo = new SectionType("eSectionTypeDWARFDebugRngListsDwo"); - public final static SectionType eSectionTypeDWARFDebugLocDwo = new SectionType("eSectionTypeDWARFDebugLocDwo"); - public final static SectionType eSectionTypeDWARFDebugLocListsDwo = new SectionType("eSectionTypeDWARFDebugLocListsDwo"); - public final static SectionType eSectionTypeDWARFDebugTuIndex = new SectionType("eSectionTypeDWARFDebugTuIndex"); - public final static SectionType eSectionTypeCTF = new SectionType("eSectionTypeCTF"); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static SectionType swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + SectionType.class + " with value " + swigValue); - } - - private SectionType(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private SectionType(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private SectionType(String swigName, SectionType swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static SectionType[] swigValues = { eSectionTypeInvalid, eSectionTypeCode, eSectionTypeContainer, eSectionTypeData, eSectionTypeDataCString, eSectionTypeDataCStringPointers, eSectionTypeDataSymbolAddress, eSectionTypeData4, eSectionTypeData8, eSectionTypeData16, eSectionTypeDataPointers, eSectionTypeDebug, eSectionTypeZeroFill, eSectionTypeDataObjCMessageRefs, eSectionTypeDataObjCCFStrings, eSectionTypeDWARFDebugAbbrev, eSectionTypeDWARFDebugAddr, eSectionTypeDWARFDebugAranges, eSectionTypeDWARFDebugCuIndex, eSectionTypeDWARFDebugFrame, eSectionTypeDWARFDebugInfo, eSectionTypeDWARFDebugLine, eSectionTypeDWARFDebugLoc, eSectionTypeDWARFDebugMacInfo, eSectionTypeDWARFDebugMacro, eSectionTypeDWARFDebugPubNames, eSectionTypeDWARFDebugPubTypes, eSectionTypeDWARFDebugRanges, eSectionTypeDWARFDebugStr, eSectionTypeDWARFDebugStrOffsets, eSectionTypeDWARFAppleNames, eSectionTypeDWARFAppleTypes, eSectionTypeDWARFAppleNamespaces, eSectionTypeDWARFAppleObjC, eSectionTypeELFSymbolTable, eSectionTypeELFDynamicSymbols, eSectionTypeELFRelocationEntries, eSectionTypeELFDynamicLinkInfo, eSectionTypeEHFrame, eSectionTypeARMexidx, eSectionTypeARMextab, eSectionTypeCompactUnwind, eSectionTypeGoSymtab, eSectionTypeAbsoluteAddress, eSectionTypeDWARFGNUDebugAltLink, eSectionTypeDWARFDebugTypes, eSectionTypeDWARFDebugNames, eSectionTypeOther, eSectionTypeDWARFDebugLineStr, eSectionTypeDWARFDebugRngLists, eSectionTypeDWARFDebugLocLists, eSectionTypeDWARFDebugAbbrevDwo, eSectionTypeDWARFDebugInfoDwo, eSectionTypeDWARFDebugStrDwo, eSectionTypeDWARFDebugStrOffsetsDwo, eSectionTypeDWARFDebugTypesDwo, eSectionTypeDWARFDebugRngListsDwo, eSectionTypeDWARFDebugLocDwo, eSectionTypeDWARFDebugLocListsDwo, eSectionTypeDWARFDebugTuIndex, eSectionTypeCTF }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/StateType.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/StateType.java deleted file mode 100644 index b09d06bf61..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/StateType.java +++ /dev/null @@ -1,68 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class StateType { - public final static StateType eStateInvalid = new StateType("eStateInvalid", lldbJNI.eStateInvalid_get()); - public final static StateType eStateUnloaded = new StateType("eStateUnloaded"); - public final static StateType eStateConnected = new StateType("eStateConnected"); - public final static StateType eStateAttaching = new StateType("eStateAttaching"); - public final static StateType eStateLaunching = new StateType("eStateLaunching"); - public final static StateType eStateStopped = new StateType("eStateStopped"); - public final static StateType eStateRunning = new StateType("eStateRunning"); - public final static StateType eStateStepping = new StateType("eStateStepping"); - public final static StateType eStateCrashed = new StateType("eStateCrashed"); - public final static StateType eStateDetached = new StateType("eStateDetached"); - public final static StateType eStateExited = new StateType("eStateExited"); - public final static StateType eStateSuspended = new StateType("eStateSuspended"); - public final static StateType kLastStateType = new StateType("kLastStateType", lldbJNI.kLastStateType_get()); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static StateType swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + StateType.class + " with value " + swigValue); - } - - private StateType(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private StateType(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private StateType(String swigName, StateType swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static StateType[] swigValues = { eStateInvalid, eStateUnloaded, eStateConnected, eStateAttaching, eStateLaunching, eStateStopped, eStateRunning, eStateStepping, eStateCrashed, eStateDetached, eStateExited, eStateSuspended, kLastStateType }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/StopReason.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/StopReason.java deleted file mode 100644 index 4d7e8b1a94..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/StopReason.java +++ /dev/null @@ -1,70 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class StopReason { - public final static StopReason eStopReasonInvalid = new StopReason("eStopReasonInvalid", lldbJNI.eStopReasonInvalid_get()); - public final static StopReason eStopReasonNone = new StopReason("eStopReasonNone"); - public final static StopReason eStopReasonTrace = new StopReason("eStopReasonTrace"); - public final static StopReason eStopReasonBreakpoint = new StopReason("eStopReasonBreakpoint"); - public final static StopReason eStopReasonWatchpoint = new StopReason("eStopReasonWatchpoint"); - public final static StopReason eStopReasonSignal = new StopReason("eStopReasonSignal"); - public final static StopReason eStopReasonException = new StopReason("eStopReasonException"); - public final static StopReason eStopReasonExec = new StopReason("eStopReasonExec"); - public final static StopReason eStopReasonPlanComplete = new StopReason("eStopReasonPlanComplete"); - public final static StopReason eStopReasonThreadExiting = new StopReason("eStopReasonThreadExiting"); - public final static StopReason eStopReasonInstrumentation = new StopReason("eStopReasonInstrumentation"); - public final static StopReason eStopReasonProcessorTrace = new StopReason("eStopReasonProcessorTrace"); - public final static StopReason eStopReasonFork = new StopReason("eStopReasonFork"); - public final static StopReason eStopReasonVFork = new StopReason("eStopReasonVFork"); - public final static StopReason eStopReasonVForkDone = new StopReason("eStopReasonVForkDone"); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static StopReason swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + StopReason.class + " with value " + swigValue); - } - - private StopReason(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private StopReason(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private StopReason(String swigName, StopReason swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static StopReason[] swigValues = { eStopReasonInvalid, eStopReasonNone, eStopReasonTrace, eStopReasonBreakpoint, eStopReasonWatchpoint, eStopReasonSignal, eStopReasonException, eStopReasonExec, eStopReasonPlanComplete, eStopReasonThreadExiting, eStopReasonInstrumentation, eStopReasonProcessorTrace, eStopReasonFork, eStopReasonVFork, eStopReasonVForkDone }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/StopShowColumn.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/StopShowColumn.java deleted file mode 100644 index a8a72975ef..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/StopShowColumn.java +++ /dev/null @@ -1,59 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class StopShowColumn { - public final static StopShowColumn eStopShowColumnAnsiOrCaret = new StopShowColumn("eStopShowColumnAnsiOrCaret", lldbJNI.eStopShowColumnAnsiOrCaret_get()); - public final static StopShowColumn eStopShowColumnAnsi = new StopShowColumn("eStopShowColumnAnsi", lldbJNI.eStopShowColumnAnsi_get()); - public final static StopShowColumn eStopShowColumnCaret = new StopShowColumn("eStopShowColumnCaret", lldbJNI.eStopShowColumnCaret_get()); - public final static StopShowColumn eStopShowColumnNone = new StopShowColumn("eStopShowColumnNone", lldbJNI.eStopShowColumnNone_get()); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static StopShowColumn swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + StopShowColumn.class + " with value " + swigValue); - } - - private StopShowColumn(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private StopShowColumn(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private StopShowColumn(String swigName, StopShowColumn swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static StopShowColumn[] swigValues = { eStopShowColumnAnsiOrCaret, eStopShowColumnAnsi, eStopShowColumnCaret, eStopShowColumnNone }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/StructuredDataType.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/StructuredDataType.java deleted file mode 100644 index 3fac7521d3..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/StructuredDataType.java +++ /dev/null @@ -1,66 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class StructuredDataType { - public final static StructuredDataType eStructuredDataTypeInvalid = new StructuredDataType("eStructuredDataTypeInvalid", lldbJNI.eStructuredDataTypeInvalid_get()); - public final static StructuredDataType eStructuredDataTypeNull = new StructuredDataType("eStructuredDataTypeNull", lldbJNI.eStructuredDataTypeNull_get()); - public final static StructuredDataType eStructuredDataTypeGeneric = new StructuredDataType("eStructuredDataTypeGeneric"); - public final static StructuredDataType eStructuredDataTypeArray = new StructuredDataType("eStructuredDataTypeArray"); - public final static StructuredDataType eStructuredDataTypeInteger = new StructuredDataType("eStructuredDataTypeInteger"); - public final static StructuredDataType eStructuredDataTypeFloat = new StructuredDataType("eStructuredDataTypeFloat"); - public final static StructuredDataType eStructuredDataTypeBoolean = new StructuredDataType("eStructuredDataTypeBoolean"); - public final static StructuredDataType eStructuredDataTypeString = new StructuredDataType("eStructuredDataTypeString"); - public final static StructuredDataType eStructuredDataTypeDictionary = new StructuredDataType("eStructuredDataTypeDictionary"); - public final static StructuredDataType eStructuredDataTypeSignedInteger = new StructuredDataType("eStructuredDataTypeSignedInteger"); - public final static StructuredDataType eStructuredDataTypeUnsignedInteger = new StructuredDataType("eStructuredDataTypeUnsignedInteger", lldbJNI.eStructuredDataTypeUnsignedInteger_get()); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static StructuredDataType swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + StructuredDataType.class + " with value " + swigValue); - } - - private StructuredDataType(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private StructuredDataType(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private StructuredDataType(String swigName, StructuredDataType swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static StructuredDataType[] swigValues = { eStructuredDataTypeInvalid, eStructuredDataTypeNull, eStructuredDataTypeGeneric, eStructuredDataTypeArray, eStructuredDataTypeInteger, eStructuredDataTypeFloat, eStructuredDataTypeBoolean, eStructuredDataTypeString, eStructuredDataTypeDictionary, eStructuredDataTypeSignedInteger, eStructuredDataTypeUnsignedInteger }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SymbolContextItem.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SymbolContextItem.java deleted file mode 100644 index 560920c95d..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SymbolContextItem.java +++ /dev/null @@ -1,65 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class SymbolContextItem { - public final static SymbolContextItem eSymbolContextTarget = new SymbolContextItem("eSymbolContextTarget", lldbJNI.eSymbolContextTarget_get()); - public final static SymbolContextItem eSymbolContextModule = new SymbolContextItem("eSymbolContextModule", lldbJNI.eSymbolContextModule_get()); - public final static SymbolContextItem eSymbolContextCompUnit = new SymbolContextItem("eSymbolContextCompUnit", lldbJNI.eSymbolContextCompUnit_get()); - public final static SymbolContextItem eSymbolContextFunction = new SymbolContextItem("eSymbolContextFunction", lldbJNI.eSymbolContextFunction_get()); - public final static SymbolContextItem eSymbolContextBlock = new SymbolContextItem("eSymbolContextBlock", lldbJNI.eSymbolContextBlock_get()); - public final static SymbolContextItem eSymbolContextLineEntry = new SymbolContextItem("eSymbolContextLineEntry", lldbJNI.eSymbolContextLineEntry_get()); - public final static SymbolContextItem eSymbolContextSymbol = new SymbolContextItem("eSymbolContextSymbol", lldbJNI.eSymbolContextSymbol_get()); - public final static SymbolContextItem eSymbolContextEverything = new SymbolContextItem("eSymbolContextEverything", lldbJNI.eSymbolContextEverything_get()); - public final static SymbolContextItem eSymbolContextVariable = new SymbolContextItem("eSymbolContextVariable", lldbJNI.eSymbolContextVariable_get()); - public final static SymbolContextItem eSymbolContextLastItem = new SymbolContextItem("eSymbolContextLastItem", lldbJNI.eSymbolContextLastItem_get()); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static SymbolContextItem swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + SymbolContextItem.class + " with value " + swigValue); - } - - private SymbolContextItem(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private SymbolContextItem(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private SymbolContextItem(String swigName, SymbolContextItem swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static SymbolContextItem[] swigValues = { eSymbolContextTarget, eSymbolContextModule, eSymbolContextCompUnit, eSymbolContextFunction, eSymbolContextBlock, eSymbolContextLineEntry, eSymbolContextSymbol, eSymbolContextEverything, eSymbolContextVariable, eSymbolContextLastItem }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SymbolType.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SymbolType.java deleted file mode 100644 index d684e48235..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/SymbolType.java +++ /dev/null @@ -1,85 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class SymbolType { - public final static SymbolType eSymbolTypeAny = new SymbolType("eSymbolTypeAny", lldbJNI.eSymbolTypeAny_get()); - public final static SymbolType eSymbolTypeInvalid = new SymbolType("eSymbolTypeInvalid", lldbJNI.eSymbolTypeInvalid_get()); - public final static SymbolType eSymbolTypeAbsolute = new SymbolType("eSymbolTypeAbsolute"); - public final static SymbolType eSymbolTypeCode = new SymbolType("eSymbolTypeCode"); - public final static SymbolType eSymbolTypeResolver = new SymbolType("eSymbolTypeResolver"); - public final static SymbolType eSymbolTypeData = new SymbolType("eSymbolTypeData"); - public final static SymbolType eSymbolTypeTrampoline = new SymbolType("eSymbolTypeTrampoline"); - public final static SymbolType eSymbolTypeRuntime = new SymbolType("eSymbolTypeRuntime"); - public final static SymbolType eSymbolTypeException = new SymbolType("eSymbolTypeException"); - public final static SymbolType eSymbolTypeSourceFile = new SymbolType("eSymbolTypeSourceFile"); - public final static SymbolType eSymbolTypeHeaderFile = new SymbolType("eSymbolTypeHeaderFile"); - public final static SymbolType eSymbolTypeObjectFile = new SymbolType("eSymbolTypeObjectFile"); - public final static SymbolType eSymbolTypeCommonBlock = new SymbolType("eSymbolTypeCommonBlock"); - public final static SymbolType eSymbolTypeBlock = new SymbolType("eSymbolTypeBlock"); - public final static SymbolType eSymbolTypeLocal = new SymbolType("eSymbolTypeLocal"); - public final static SymbolType eSymbolTypeParam = new SymbolType("eSymbolTypeParam"); - public final static SymbolType eSymbolTypeVariable = new SymbolType("eSymbolTypeVariable"); - public final static SymbolType eSymbolTypeVariableType = new SymbolType("eSymbolTypeVariableType"); - public final static SymbolType eSymbolTypeLineEntry = new SymbolType("eSymbolTypeLineEntry"); - public final static SymbolType eSymbolTypeLineHeader = new SymbolType("eSymbolTypeLineHeader"); - public final static SymbolType eSymbolTypeScopeBegin = new SymbolType("eSymbolTypeScopeBegin"); - public final static SymbolType eSymbolTypeScopeEnd = new SymbolType("eSymbolTypeScopeEnd"); - public final static SymbolType eSymbolTypeAdditional = new SymbolType("eSymbolTypeAdditional"); - public final static SymbolType eSymbolTypeCompiler = new SymbolType("eSymbolTypeCompiler"); - public final static SymbolType eSymbolTypeInstrumentation = new SymbolType("eSymbolTypeInstrumentation"); - public final static SymbolType eSymbolTypeUndefined = new SymbolType("eSymbolTypeUndefined"); - public final static SymbolType eSymbolTypeObjCClass = new SymbolType("eSymbolTypeObjCClass"); - public final static SymbolType eSymbolTypeObjCMetaClass = new SymbolType("eSymbolTypeObjCMetaClass"); - public final static SymbolType eSymbolTypeObjCIVar = new SymbolType("eSymbolTypeObjCIVar"); - public final static SymbolType eSymbolTypeReExported = new SymbolType("eSymbolTypeReExported"); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static SymbolType swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + SymbolType.class + " with value " + swigValue); - } - - private SymbolType(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private SymbolType(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private SymbolType(String swigName, SymbolType swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static SymbolType[] swigValues = { eSymbolTypeAny, eSymbolTypeInvalid, eSymbolTypeAbsolute, eSymbolTypeCode, eSymbolTypeResolver, eSymbolTypeData, eSymbolTypeTrampoline, eSymbolTypeRuntime, eSymbolTypeException, eSymbolTypeSourceFile, eSymbolTypeHeaderFile, eSymbolTypeObjectFile, eSymbolTypeCommonBlock, eSymbolTypeBlock, eSymbolTypeLocal, eSymbolTypeParam, eSymbolTypeVariable, eSymbolTypeVariableType, eSymbolTypeLineEntry, eSymbolTypeLineHeader, eSymbolTypeScopeBegin, eSymbolTypeScopeEnd, eSymbolTypeAdditional, eSymbolTypeCompiler, eSymbolTypeInstrumentation, eSymbolTypeUndefined, eSymbolTypeObjCClass, eSymbolTypeObjCMetaClass, eSymbolTypeObjCIVar, eSymbolTypeReExported }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TemplateArgumentKind.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TemplateArgumentKind.java deleted file mode 100644 index 4472f77047..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TemplateArgumentKind.java +++ /dev/null @@ -1,64 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class TemplateArgumentKind { - public final static TemplateArgumentKind eTemplateArgumentKindNull = new TemplateArgumentKind("eTemplateArgumentKindNull", lldbJNI.eTemplateArgumentKindNull_get()); - public final static TemplateArgumentKind eTemplateArgumentKindType = new TemplateArgumentKind("eTemplateArgumentKindType"); - public final static TemplateArgumentKind eTemplateArgumentKindDeclaration = new TemplateArgumentKind("eTemplateArgumentKindDeclaration"); - public final static TemplateArgumentKind eTemplateArgumentKindIntegral = new TemplateArgumentKind("eTemplateArgumentKindIntegral"); - public final static TemplateArgumentKind eTemplateArgumentKindTemplate = new TemplateArgumentKind("eTemplateArgumentKindTemplate"); - public final static TemplateArgumentKind eTemplateArgumentKindTemplateExpansion = new TemplateArgumentKind("eTemplateArgumentKindTemplateExpansion"); - public final static TemplateArgumentKind eTemplateArgumentKindExpression = new TemplateArgumentKind("eTemplateArgumentKindExpression"); - public final static TemplateArgumentKind eTemplateArgumentKindPack = new TemplateArgumentKind("eTemplateArgumentKindPack"); - public final static TemplateArgumentKind eTemplateArgumentKindNullPtr = new TemplateArgumentKind("eTemplateArgumentKindNullPtr"); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static TemplateArgumentKind swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + TemplateArgumentKind.class + " with value " + swigValue); - } - - private TemplateArgumentKind(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private TemplateArgumentKind(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private TemplateArgumentKind(String swigName, TemplateArgumentKind swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static TemplateArgumentKind[] swigValues = { eTemplateArgumentKindNull, eTemplateArgumentKindType, eTemplateArgumentKindDeclaration, eTemplateArgumentKindIntegral, eTemplateArgumentKindTemplate, eTemplateArgumentKindTemplateExpansion, eTemplateArgumentKindExpression, eTemplateArgumentKindPack, eTemplateArgumentKindNullPtr }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TraceCursorSeekType.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TraceCursorSeekType.java deleted file mode 100644 index e5a918871b..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TraceCursorSeekType.java +++ /dev/null @@ -1,58 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class TraceCursorSeekType { - public final static TraceCursorSeekType eTraceCursorSeekTypeBeginning = new TraceCursorSeekType("eTraceCursorSeekTypeBeginning", lldbJNI.eTraceCursorSeekTypeBeginning_get()); - public final static TraceCursorSeekType eTraceCursorSeekTypeCurrent = new TraceCursorSeekType("eTraceCursorSeekTypeCurrent"); - public final static TraceCursorSeekType eTraceCursorSeekTypeEnd = new TraceCursorSeekType("eTraceCursorSeekTypeEnd"); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static TraceCursorSeekType swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + TraceCursorSeekType.class + " with value " + swigValue); - } - - private TraceCursorSeekType(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private TraceCursorSeekType(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private TraceCursorSeekType(String swigName, TraceCursorSeekType swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static TraceCursorSeekType[] swigValues = { eTraceCursorSeekTypeBeginning, eTraceCursorSeekTypeCurrent, eTraceCursorSeekTypeEnd }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TraceEvent.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TraceEvent.java deleted file mode 100644 index c8c6773e78..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TraceEvent.java +++ /dev/null @@ -1,60 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class TraceEvent { - public final static TraceEvent eTraceEventDisabledSW = new TraceEvent("eTraceEventDisabledSW"); - public final static TraceEvent eTraceEventDisabledHW = new TraceEvent("eTraceEventDisabledHW"); - public final static TraceEvent eTraceEventCPUChanged = new TraceEvent("eTraceEventCPUChanged"); - public final static TraceEvent eTraceEventHWClockTick = new TraceEvent("eTraceEventHWClockTick"); - public final static TraceEvent eTraceEventSyncPoint = new TraceEvent("eTraceEventSyncPoint"); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static TraceEvent swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + TraceEvent.class + " with value " + swigValue); - } - - private TraceEvent(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private TraceEvent(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private TraceEvent(String swigName, TraceEvent swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static TraceEvent[] swigValues = { eTraceEventDisabledSW, eTraceEventDisabledHW, eTraceEventCPUChanged, eTraceEventHWClockTick, eTraceEventSyncPoint }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TraceItemKind.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TraceItemKind.java deleted file mode 100644 index 14e018a1ec..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TraceItemKind.java +++ /dev/null @@ -1,58 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class TraceItemKind { - public final static TraceItemKind eTraceItemKindError = new TraceItemKind("eTraceItemKindError", lldbJNI.eTraceItemKindError_get()); - public final static TraceItemKind eTraceItemKindEvent = new TraceItemKind("eTraceItemKindEvent"); - public final static TraceItemKind eTraceItemKindInstruction = new TraceItemKind("eTraceItemKindInstruction"); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static TraceItemKind swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + TraceItemKind.class + " with value " + swigValue); - } - - private TraceItemKind(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private TraceItemKind(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private TraceItemKind(String swigName, TraceItemKind swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static TraceItemKind[] swigValues = { eTraceItemKindError, eTraceItemKindEvent, eTraceItemKindInstruction }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TraceType.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TraceType.java deleted file mode 100644 index 82509a2741..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TraceType.java +++ /dev/null @@ -1,57 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class TraceType { - public final static TraceType eTraceTypeNone = new TraceType("eTraceTypeNone", lldbJNI.eTraceTypeNone_get()); - public final static TraceType eTraceTypeProcessorTrace = new TraceType("eTraceTypeProcessorTrace"); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static TraceType swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + TraceType.class + " with value " + swigValue); - } - - private TraceType(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private TraceType(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private TraceType(String swigName, TraceType swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static TraceType[] swigValues = { eTraceTypeNone, eTraceTypeProcessorTrace }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TypeClass.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TypeClass.java deleted file mode 100644 index 043de78fa6..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TypeClass.java +++ /dev/null @@ -1,76 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class TypeClass { - public final static TypeClass eTypeClassInvalid = new TypeClass("eTypeClassInvalid", lldbJNI.eTypeClassInvalid_get()); - public final static TypeClass eTypeClassArray = new TypeClass("eTypeClassArray", lldbJNI.eTypeClassArray_get()); - public final static TypeClass eTypeClassBlockPointer = new TypeClass("eTypeClassBlockPointer", lldbJNI.eTypeClassBlockPointer_get()); - public final static TypeClass eTypeClassBuiltin = new TypeClass("eTypeClassBuiltin", lldbJNI.eTypeClassBuiltin_get()); - public final static TypeClass eTypeClassClass = new TypeClass("eTypeClassClass", lldbJNI.eTypeClassClass_get()); - public final static TypeClass eTypeClassComplexFloat = new TypeClass("eTypeClassComplexFloat", lldbJNI.eTypeClassComplexFloat_get()); - public final static TypeClass eTypeClassComplexInteger = new TypeClass("eTypeClassComplexInteger", lldbJNI.eTypeClassComplexInteger_get()); - public final static TypeClass eTypeClassEnumeration = new TypeClass("eTypeClassEnumeration", lldbJNI.eTypeClassEnumeration_get()); - public final static TypeClass eTypeClassFunction = new TypeClass("eTypeClassFunction", lldbJNI.eTypeClassFunction_get()); - public final static TypeClass eTypeClassMemberPointer = new TypeClass("eTypeClassMemberPointer", lldbJNI.eTypeClassMemberPointer_get()); - public final static TypeClass eTypeClassObjCObject = new TypeClass("eTypeClassObjCObject", lldbJNI.eTypeClassObjCObject_get()); - public final static TypeClass eTypeClassObjCInterface = new TypeClass("eTypeClassObjCInterface", lldbJNI.eTypeClassObjCInterface_get()); - public final static TypeClass eTypeClassObjCObjectPointer = new TypeClass("eTypeClassObjCObjectPointer", lldbJNI.eTypeClassObjCObjectPointer_get()); - public final static TypeClass eTypeClassPointer = new TypeClass("eTypeClassPointer", lldbJNI.eTypeClassPointer_get()); - public final static TypeClass eTypeClassReference = new TypeClass("eTypeClassReference", lldbJNI.eTypeClassReference_get()); - public final static TypeClass eTypeClassStruct = new TypeClass("eTypeClassStruct", lldbJNI.eTypeClassStruct_get()); - public final static TypeClass eTypeClassTypedef = new TypeClass("eTypeClassTypedef", lldbJNI.eTypeClassTypedef_get()); - public final static TypeClass eTypeClassUnion = new TypeClass("eTypeClassUnion", lldbJNI.eTypeClassUnion_get()); - public final static TypeClass eTypeClassVector = new TypeClass("eTypeClassVector", lldbJNI.eTypeClassVector_get()); - public final static TypeClass eTypeClassOther = new TypeClass("eTypeClassOther", lldbJNI.eTypeClassOther_get()); - public final static TypeClass eTypeClassAny = new TypeClass("eTypeClassAny", lldbJNI.eTypeClassAny_get()); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static TypeClass swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + TypeClass.class + " with value " + swigValue); - } - - private TypeClass(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private TypeClass(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private TypeClass(String swigName, TypeClass swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static TypeClass[] swigValues = { eTypeClassInvalid, eTypeClassArray, eTypeClassBlockPointer, eTypeClassBuiltin, eTypeClassClass, eTypeClassComplexFloat, eTypeClassComplexInteger, eTypeClassEnumeration, eTypeClassFunction, eTypeClassMemberPointer, eTypeClassObjCObject, eTypeClassObjCInterface, eTypeClassObjCObjectPointer, eTypeClassPointer, eTypeClassReference, eTypeClassStruct, eTypeClassTypedef, eTypeClassUnion, eTypeClassVector, eTypeClassOther, eTypeClassAny }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TypeFlags.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TypeFlags.java deleted file mode 100644 index 1e9fcb3caf..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TypeFlags.java +++ /dev/null @@ -1,78 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class TypeFlags { - public final static TypeFlags eTypeHasChildren = new TypeFlags("eTypeHasChildren", lldbJNI.eTypeHasChildren_get()); - public final static TypeFlags eTypeHasValue = new TypeFlags("eTypeHasValue", lldbJNI.eTypeHasValue_get()); - public final static TypeFlags eTypeIsArray = new TypeFlags("eTypeIsArray", lldbJNI.eTypeIsArray_get()); - public final static TypeFlags eTypeIsBlock = new TypeFlags("eTypeIsBlock", lldbJNI.eTypeIsBlock_get()); - public final static TypeFlags eTypeIsBuiltIn = new TypeFlags("eTypeIsBuiltIn", lldbJNI.eTypeIsBuiltIn_get()); - public final static TypeFlags eTypeIsClass = new TypeFlags("eTypeIsClass", lldbJNI.eTypeIsClass_get()); - public final static TypeFlags eTypeIsCPlusPlus = new TypeFlags("eTypeIsCPlusPlus", lldbJNI.eTypeIsCPlusPlus_get()); - public final static TypeFlags eTypeIsEnumeration = new TypeFlags("eTypeIsEnumeration", lldbJNI.eTypeIsEnumeration_get()); - public final static TypeFlags eTypeIsFuncPrototype = new TypeFlags("eTypeIsFuncPrototype", lldbJNI.eTypeIsFuncPrototype_get()); - public final static TypeFlags eTypeIsMember = new TypeFlags("eTypeIsMember", lldbJNI.eTypeIsMember_get()); - public final static TypeFlags eTypeIsObjC = new TypeFlags("eTypeIsObjC", lldbJNI.eTypeIsObjC_get()); - public final static TypeFlags eTypeIsPointer = new TypeFlags("eTypeIsPointer", lldbJNI.eTypeIsPointer_get()); - public final static TypeFlags eTypeIsReference = new TypeFlags("eTypeIsReference", lldbJNI.eTypeIsReference_get()); - public final static TypeFlags eTypeIsStructUnion = new TypeFlags("eTypeIsStructUnion", lldbJNI.eTypeIsStructUnion_get()); - public final static TypeFlags eTypeIsTemplate = new TypeFlags("eTypeIsTemplate", lldbJNI.eTypeIsTemplate_get()); - public final static TypeFlags eTypeIsTypedef = new TypeFlags("eTypeIsTypedef", lldbJNI.eTypeIsTypedef_get()); - public final static TypeFlags eTypeIsVector = new TypeFlags("eTypeIsVector", lldbJNI.eTypeIsVector_get()); - public final static TypeFlags eTypeIsScalar = new TypeFlags("eTypeIsScalar", lldbJNI.eTypeIsScalar_get()); - public final static TypeFlags eTypeIsInteger = new TypeFlags("eTypeIsInteger", lldbJNI.eTypeIsInteger_get()); - public final static TypeFlags eTypeIsFloat = new TypeFlags("eTypeIsFloat", lldbJNI.eTypeIsFloat_get()); - public final static TypeFlags eTypeIsComplex = new TypeFlags("eTypeIsComplex", lldbJNI.eTypeIsComplex_get()); - public final static TypeFlags eTypeIsSigned = new TypeFlags("eTypeIsSigned", lldbJNI.eTypeIsSigned_get()); - public final static TypeFlags eTypeInstanceIsPointer = new TypeFlags("eTypeInstanceIsPointer", lldbJNI.eTypeInstanceIsPointer_get()); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static TypeFlags swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + TypeFlags.class + " with value " + swigValue); - } - - private TypeFlags(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private TypeFlags(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private TypeFlags(String swigName, TypeFlags swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static TypeFlags[] swigValues = { eTypeHasChildren, eTypeHasValue, eTypeIsArray, eTypeIsBlock, eTypeIsBuiltIn, eTypeIsClass, eTypeIsCPlusPlus, eTypeIsEnumeration, eTypeIsFuncPrototype, eTypeIsMember, eTypeIsObjC, eTypeIsPointer, eTypeIsReference, eTypeIsStructUnion, eTypeIsTemplate, eTypeIsTypedef, eTypeIsVector, eTypeIsScalar, eTypeIsInteger, eTypeIsFloat, eTypeIsComplex, eTypeIsSigned, eTypeInstanceIsPointer }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TypeOptions.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TypeOptions.java deleted file mode 100644 index f64264d636..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TypeOptions.java +++ /dev/null @@ -1,66 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class TypeOptions { - public final static TypeOptions eTypeOptionNone = new TypeOptions("eTypeOptionNone", lldbJNI.eTypeOptionNone_get()); - public final static TypeOptions eTypeOptionCascade = new TypeOptions("eTypeOptionCascade", lldbJNI.eTypeOptionCascade_get()); - public final static TypeOptions eTypeOptionSkipPointers = new TypeOptions("eTypeOptionSkipPointers", lldbJNI.eTypeOptionSkipPointers_get()); - public final static TypeOptions eTypeOptionSkipReferences = new TypeOptions("eTypeOptionSkipReferences", lldbJNI.eTypeOptionSkipReferences_get()); - public final static TypeOptions eTypeOptionHideChildren = new TypeOptions("eTypeOptionHideChildren", lldbJNI.eTypeOptionHideChildren_get()); - public final static TypeOptions eTypeOptionHideValue = new TypeOptions("eTypeOptionHideValue", lldbJNI.eTypeOptionHideValue_get()); - public final static TypeOptions eTypeOptionShowOneLiner = new TypeOptions("eTypeOptionShowOneLiner", lldbJNI.eTypeOptionShowOneLiner_get()); - public final static TypeOptions eTypeOptionHideNames = new TypeOptions("eTypeOptionHideNames", lldbJNI.eTypeOptionHideNames_get()); - public final static TypeOptions eTypeOptionNonCacheable = new TypeOptions("eTypeOptionNonCacheable", lldbJNI.eTypeOptionNonCacheable_get()); - public final static TypeOptions eTypeOptionHideEmptyAggregates = new TypeOptions("eTypeOptionHideEmptyAggregates", lldbJNI.eTypeOptionHideEmptyAggregates_get()); - public final static TypeOptions eTypeOptionFrontEndWantsDereference = new TypeOptions("eTypeOptionFrontEndWantsDereference", lldbJNI.eTypeOptionFrontEndWantsDereference_get()); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static TypeOptions swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + TypeOptions.class + " with value " + swigValue); - } - - private TypeOptions(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private TypeOptions(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private TypeOptions(String swigName, TypeOptions swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static TypeOptions[] swigValues = { eTypeOptionNone, eTypeOptionCascade, eTypeOptionSkipPointers, eTypeOptionSkipReferences, eTypeOptionHideChildren, eTypeOptionHideValue, eTypeOptionShowOneLiner, eTypeOptionHideNames, eTypeOptionNonCacheable, eTypeOptionHideEmptyAggregates, eTypeOptionFrontEndWantsDereference }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TypeSummaryCapping.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TypeSummaryCapping.java deleted file mode 100644 index 06e71f6180..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/TypeSummaryCapping.java +++ /dev/null @@ -1,57 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class TypeSummaryCapping { - public final static TypeSummaryCapping eTypeSummaryCapped = new TypeSummaryCapping("eTypeSummaryCapped", lldbJNI.eTypeSummaryCapped_get()); - public final static TypeSummaryCapping eTypeSummaryUncapped = new TypeSummaryCapping("eTypeSummaryUncapped", lldbJNI.eTypeSummaryUncapped_get()); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static TypeSummaryCapping swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + TypeSummaryCapping.class + " with value " + swigValue); - } - - private TypeSummaryCapping(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private TypeSummaryCapping(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private TypeSummaryCapping(String swigName, TypeSummaryCapping swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static TypeSummaryCapping[] swigValues = { eTypeSummaryCapped, eTypeSummaryUncapped }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ValueType.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ValueType.java deleted file mode 100644 index 3e8de0d12d..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/ValueType.java +++ /dev/null @@ -1,64 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class ValueType { - public final static ValueType eValueTypeInvalid = new ValueType("eValueTypeInvalid", lldbJNI.eValueTypeInvalid_get()); - public final static ValueType eValueTypeVariableGlobal = new ValueType("eValueTypeVariableGlobal", lldbJNI.eValueTypeVariableGlobal_get()); - public final static ValueType eValueTypeVariableStatic = new ValueType("eValueTypeVariableStatic", lldbJNI.eValueTypeVariableStatic_get()); - public final static ValueType eValueTypeVariableArgument = new ValueType("eValueTypeVariableArgument", lldbJNI.eValueTypeVariableArgument_get()); - public final static ValueType eValueTypeVariableLocal = new ValueType("eValueTypeVariableLocal", lldbJNI.eValueTypeVariableLocal_get()); - public final static ValueType eValueTypeRegister = new ValueType("eValueTypeRegister", lldbJNI.eValueTypeRegister_get()); - public final static ValueType eValueTypeRegisterSet = new ValueType("eValueTypeRegisterSet", lldbJNI.eValueTypeRegisterSet_get()); - public final static ValueType eValueTypeConstResult = new ValueType("eValueTypeConstResult", lldbJNI.eValueTypeConstResult_get()); - public final static ValueType eValueTypeVariableThreadLocal = new ValueType("eValueTypeVariableThreadLocal", lldbJNI.eValueTypeVariableThreadLocal_get()); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static ValueType swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + ValueType.class + " with value " + swigValue); - } - - private ValueType(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private ValueType(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private ValueType(String swigName, ValueType swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static ValueType[] swigValues = { eValueTypeInvalid, eValueTypeVariableGlobal, eValueTypeVariableStatic, eValueTypeVariableArgument, eValueTypeVariableLocal, eValueTypeRegister, eValueTypeRegisterSet, eValueTypeConstResult, eValueTypeVariableThreadLocal }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/WatchpointEventType.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/WatchpointEventType.java deleted file mode 100644 index c9bd7768df..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/WatchpointEventType.java +++ /dev/null @@ -1,65 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class WatchpointEventType { - public final static WatchpointEventType eWatchpointEventTypeInvalidType = new WatchpointEventType("eWatchpointEventTypeInvalidType", lldbJNI.eWatchpointEventTypeInvalidType_get()); - public final static WatchpointEventType eWatchpointEventTypeAdded = new WatchpointEventType("eWatchpointEventTypeAdded", lldbJNI.eWatchpointEventTypeAdded_get()); - public final static WatchpointEventType eWatchpointEventTypeRemoved = new WatchpointEventType("eWatchpointEventTypeRemoved", lldbJNI.eWatchpointEventTypeRemoved_get()); - public final static WatchpointEventType eWatchpointEventTypeEnabled = new WatchpointEventType("eWatchpointEventTypeEnabled", lldbJNI.eWatchpointEventTypeEnabled_get()); - public final static WatchpointEventType eWatchpointEventTypeDisabled = new WatchpointEventType("eWatchpointEventTypeDisabled", lldbJNI.eWatchpointEventTypeDisabled_get()); - public final static WatchpointEventType eWatchpointEventTypeCommandChanged = new WatchpointEventType("eWatchpointEventTypeCommandChanged", lldbJNI.eWatchpointEventTypeCommandChanged_get()); - public final static WatchpointEventType eWatchpointEventTypeConditionChanged = new WatchpointEventType("eWatchpointEventTypeConditionChanged", lldbJNI.eWatchpointEventTypeConditionChanged_get()); - public final static WatchpointEventType eWatchpointEventTypeIgnoreChanged = new WatchpointEventType("eWatchpointEventTypeIgnoreChanged", lldbJNI.eWatchpointEventTypeIgnoreChanged_get()); - public final static WatchpointEventType eWatchpointEventTypeThreadChanged = new WatchpointEventType("eWatchpointEventTypeThreadChanged", lldbJNI.eWatchpointEventTypeThreadChanged_get()); - public final static WatchpointEventType eWatchpointEventTypeTypeChanged = new WatchpointEventType("eWatchpointEventTypeTypeChanged", lldbJNI.eWatchpointEventTypeTypeChanged_get()); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static WatchpointEventType swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + WatchpointEventType.class + " with value " + swigValue); - } - - private WatchpointEventType(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private WatchpointEventType(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private WatchpointEventType(String swigName, WatchpointEventType swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static WatchpointEventType[] swigValues = { eWatchpointEventTypeInvalidType, eWatchpointEventTypeAdded, eWatchpointEventTypeRemoved, eWatchpointEventTypeEnabled, eWatchpointEventTypeDisabled, eWatchpointEventTypeCommandChanged, eWatchpointEventTypeConditionChanged, eWatchpointEventTypeIgnoreChanged, eWatchpointEventTypeThreadChanged, eWatchpointEventTypeTypeChanged }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/WatchpointKind.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/WatchpointKind.java deleted file mode 100644 index aadac08f86..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/WatchpointKind.java +++ /dev/null @@ -1,57 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class WatchpointKind { - public final static WatchpointKind eWatchpointKindWrite = new WatchpointKind("eWatchpointKindWrite", lldbJNI.eWatchpointKindWrite_get()); - public final static WatchpointKind eWatchpointKindRead = new WatchpointKind("eWatchpointKindRead", lldbJNI.eWatchpointKindRead_get()); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static WatchpointKind swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + WatchpointKind.class + " with value " + swigValue); - } - - private WatchpointKind(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private WatchpointKind(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private WatchpointKind(String swigName, WatchpointKind swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static WatchpointKind[] swigValues = { eWatchpointKindWrite, eWatchpointKindRead }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/WatchpointValueKind.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/WatchpointValueKind.java deleted file mode 100644 index 56586d137b..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/WatchpointValueKind.java +++ /dev/null @@ -1,58 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public final class WatchpointValueKind { - public final static WatchpointValueKind eWatchPointValueKindInvalid = new WatchpointValueKind("eWatchPointValueKindInvalid", lldbJNI.eWatchPointValueKindInvalid_get()); - public final static WatchpointValueKind eWatchPointValueKindVariable = new WatchpointValueKind("eWatchPointValueKindVariable", lldbJNI.eWatchPointValueKindVariable_get()); - public final static WatchpointValueKind eWatchPointValueKindExpression = new WatchpointValueKind("eWatchPointValueKindExpression", lldbJNI.eWatchPointValueKindExpression_get()); - - public final int swigValue() { - return swigValue; - } - - public String toString() { - return swigName; - } - - public static WatchpointValueKind swigToEnum(int swigValue) { - if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) - return swigValues[swigValue]; - for (int i = 0; i < swigValues.length; i++) - if (swigValues[i].swigValue == swigValue) - return swigValues[i]; - throw new IllegalArgumentException("No enum " + WatchpointValueKind.class + " with value " + swigValue); - } - - private WatchpointValueKind(String swigName) { - this.swigName = swigName; - this.swigValue = swigNext++; - } - - private WatchpointValueKind(String swigName, int swigValue) { - this.swigName = swigName; - this.swigValue = swigValue; - swigNext = swigValue+1; - } - - private WatchpointValueKind(String swigName, WatchpointValueKind swigEnum) { - this.swigName = swigName; - this.swigValue = swigEnum.swigValue; - swigNext = this.swigValue+1; - } - - private static WatchpointValueKind[] swigValues = { eWatchPointValueKindInvalid, eWatchPointValueKindVariable, eWatchPointValueKindExpression }; - private static int swigNext = 0; - private final int swigValue; - private final String swigName; -} - diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/lldb.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/lldb.java deleted file mode 100644 index 70bd54aefa..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/lldb.java +++ /dev/null @@ -1,15 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class lldb implements lldbConstants { -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/lldbConstants.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/lldbConstants.java deleted file mode 100644 index 5c33e701c9..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/lldbConstants.java +++ /dev/null @@ -1,72 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public interface lldbConstants { - public final static int INT32_MAX = lldbJNI.INT32_MAX_get(); - public final static long UINT32_MAX = lldbJNI.UINT32_MAX_get(); - public final static java.math.BigInteger UINT64_MAX = lldbJNI.UINT64_MAX_get(); - public final static long LLDB_GENERIC_ERROR = lldbJNI.LLDB_GENERIC_ERROR_get(); - public final static int LLDB_INVALID_BREAK_ID = lldbJNI.LLDB_INVALID_BREAK_ID_get(); - public final static int LLDB_DEFAULT_BREAK_SIZE = lldbJNI.LLDB_DEFAULT_BREAK_SIZE_get(); - public final static int LLDB_INVALID_WATCH_ID = lldbJNI.LLDB_INVALID_WATCH_ID_get(); - public final static long LLDB_WATCH_TYPE_READ = lldbJNI.LLDB_WATCH_TYPE_READ_get(); - public final static long LLDB_WATCH_TYPE_WRITE = lldbJNI.LLDB_WATCH_TYPE_WRITE_get(); - public final static int LLDB_REGNUM_GENERIC_PC = lldbJNI.LLDB_REGNUM_GENERIC_PC_get(); - public final static int LLDB_REGNUM_GENERIC_SP = lldbJNI.LLDB_REGNUM_GENERIC_SP_get(); - public final static int LLDB_REGNUM_GENERIC_FP = lldbJNI.LLDB_REGNUM_GENERIC_FP_get(); - public final static int LLDB_REGNUM_GENERIC_RA = lldbJNI.LLDB_REGNUM_GENERIC_RA_get(); - public final static int LLDB_REGNUM_GENERIC_FLAGS = lldbJNI.LLDB_REGNUM_GENERIC_FLAGS_get(); - public final static int LLDB_REGNUM_GENERIC_ARG1 = lldbJNI.LLDB_REGNUM_GENERIC_ARG1_get(); - public final static int LLDB_REGNUM_GENERIC_ARG2 = lldbJNI.LLDB_REGNUM_GENERIC_ARG2_get(); - public final static int LLDB_REGNUM_GENERIC_ARG3 = lldbJNI.LLDB_REGNUM_GENERIC_ARG3_get(); - public final static int LLDB_REGNUM_GENERIC_ARG4 = lldbJNI.LLDB_REGNUM_GENERIC_ARG4_get(); - public final static int LLDB_REGNUM_GENERIC_ARG5 = lldbJNI.LLDB_REGNUM_GENERIC_ARG5_get(); - public final static int LLDB_REGNUM_GENERIC_ARG6 = lldbJNI.LLDB_REGNUM_GENERIC_ARG6_get(); - public final static int LLDB_REGNUM_GENERIC_ARG7 = lldbJNI.LLDB_REGNUM_GENERIC_ARG7_get(); - public final static int LLDB_REGNUM_GENERIC_ARG8 = lldbJNI.LLDB_REGNUM_GENERIC_ARG8_get(); - public final static int LLDB_INVALID_STOP_ID = lldbJNI.LLDB_INVALID_STOP_ID_get(); - public final static java.math.BigInteger LLDB_INVALID_ADDRESS = lldbJNI.LLDB_INVALID_ADDRESS_get(); - public final static long LLDB_INVALID_INDEX32 = lldbJNI.LLDB_INVALID_INDEX32_get(); - public final static long LLDB_INVALID_IVAR_OFFSET = lldbJNI.LLDB_INVALID_IVAR_OFFSET_get(); - public final static long LLDB_INVALID_IMAGE_TOKEN = lldbJNI.LLDB_INVALID_IMAGE_TOKEN_get(); - public final static long LLDB_INVALID_MODULE_VERSION = lldbJNI.LLDB_INVALID_MODULE_VERSION_get(); - public final static long LLDB_INVALID_REGNUM = lldbJNI.LLDB_INVALID_REGNUM_get(); - public final static java.math.BigInteger LLDB_INVALID_UID = lldbJNI.LLDB_INVALID_UID_get(); - public final static int LLDB_INVALID_PROCESS_ID = lldbJNI.LLDB_INVALID_PROCESS_ID_get(); - public final static int LLDB_INVALID_THREAD_ID = lldbJNI.LLDB_INVALID_THREAD_ID_get(); - public final static long LLDB_INVALID_FRAME_ID = lldbJNI.LLDB_INVALID_FRAME_ID_get(); - public final static int LLDB_INVALID_SIGNAL_NUMBER = lldbJNI.LLDB_INVALID_SIGNAL_NUMBER_get(); - public final static java.math.BigInteger LLDB_INVALID_OFFSET = lldbJNI.LLDB_INVALID_OFFSET_get(); - public final static long LLDB_INVALID_LINE_NUMBER = lldbJNI.LLDB_INVALID_LINE_NUMBER_get(); - public final static int LLDB_INVALID_COLUMN_NUMBER = lldbJNI.LLDB_INVALID_COLUMN_NUMBER_get(); - public final static int LLDB_INVALID_QUEUE_ID = lldbJNI.LLDB_INVALID_QUEUE_ID_get(); - public final static long LLDB_INVALID_CPU_ID = lldbJNI.LLDB_INVALID_CPU_ID_get(); - public final static String LLDB_ARCH_DEFAULT = lldbJNI.LLDB_ARCH_DEFAULT_get(); - public final static String LLDB_ARCH_DEFAULT_32BIT = lldbJNI.LLDB_ARCH_DEFAULT_32BIT_get(); - public final static String LLDB_ARCH_DEFAULT_64BIT = lldbJNI.LLDB_ARCH_DEFAULT_64BIT_get(); - public final static long LLDB_INVALID_CPUTYPE = lldbJNI.LLDB_INVALID_CPUTYPE_get(); - public final static int LLDB_MAX_NUM_OPTION_SETS = lldbJNI.LLDB_MAX_NUM_OPTION_SETS_get(); - public final static long LLDB_OPT_SET_ALL = lldbJNI.LLDB_OPT_SET_ALL_get(); - public final static long LLDB_OPT_SET_1 = lldbJNI.LLDB_OPT_SET_1_get(); - public final static long LLDB_OPT_SET_2 = lldbJNI.LLDB_OPT_SET_2_get(); - public final static long LLDB_OPT_SET_3 = lldbJNI.LLDB_OPT_SET_3_get(); - public final static long LLDB_OPT_SET_4 = lldbJNI.LLDB_OPT_SET_4_get(); - public final static long LLDB_OPT_SET_5 = lldbJNI.LLDB_OPT_SET_5_get(); - public final static long LLDB_OPT_SET_6 = lldbJNI.LLDB_OPT_SET_6_get(); - public final static long LLDB_OPT_SET_7 = lldbJNI.LLDB_OPT_SET_7_get(); - public final static long LLDB_OPT_SET_8 = lldbJNI.LLDB_OPT_SET_8_get(); - public final static long LLDB_OPT_SET_9 = lldbJNI.LLDB_OPT_SET_9_get(); - public final static long LLDB_OPT_SET_10 = lldbJNI.LLDB_OPT_SET_10_get(); - public final static long LLDB_OPT_SET_11 = lldbJNI.LLDB_OPT_SET_11_get(); - public final static long LLDB_OPT_SET_12 = lldbJNI.LLDB_OPT_SET_12_get(); -} diff --git a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/lldbJNI.java b/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/lldbJNI.java deleted file mode 100644 index 67572b0cf3..0000000000 --- a/Ghidra/Debug/Debugger-swig-lldb/src/main/java/SWIG/lldbJNI.java +++ /dev/null @@ -1,2410 +0,0 @@ -/* ### - * IP: Apache License 2.0 with LLVM Exceptions - */ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (https://www.swig.org). - * Version 4.1.1 - * - * Do not make changes to this file unless you know what you are doing - modify - * the SWIG interface file instead. - * ----------------------------------------------------------------------------- */ - -package SWIG; - -public class lldbJNI { - public final static native long new_ByteArray(int jarg1); - public final static native void delete_ByteArray(long jarg1); - public final static native byte ByteArray_getitem(long jarg1, ByteArray jarg1_, int jarg2); - public final static native void ByteArray_setitem(long jarg1, ByteArray jarg1_, int jarg2, byte jarg3); - public final static native long ByteArray_cast(long jarg1, ByteArray jarg1_); - public final static native long ByteArray_frompointer(long jarg1); - public final static native int INT32_MAX_get(); - public final static native long UINT32_MAX_get(); - public final static native java.math.BigInteger UINT64_MAX_get(); - public final static native long LLDB_GENERIC_ERROR_get(); - public final static native int LLDB_INVALID_BREAK_ID_get(); - public final static native int LLDB_DEFAULT_BREAK_SIZE_get(); - public final static native int LLDB_INVALID_WATCH_ID_get(); - public final static native long LLDB_WATCH_TYPE_READ_get(); - public final static native long LLDB_WATCH_TYPE_WRITE_get(); - public final static native int LLDB_REGNUM_GENERIC_PC_get(); - public final static native int LLDB_REGNUM_GENERIC_SP_get(); - public final static native int LLDB_REGNUM_GENERIC_FP_get(); - public final static native int LLDB_REGNUM_GENERIC_RA_get(); - public final static native int LLDB_REGNUM_GENERIC_FLAGS_get(); - public final static native int LLDB_REGNUM_GENERIC_ARG1_get(); - public final static native int LLDB_REGNUM_GENERIC_ARG2_get(); - public final static native int LLDB_REGNUM_GENERIC_ARG3_get(); - public final static native int LLDB_REGNUM_GENERIC_ARG4_get(); - public final static native int LLDB_REGNUM_GENERIC_ARG5_get(); - public final static native int LLDB_REGNUM_GENERIC_ARG6_get(); - public final static native int LLDB_REGNUM_GENERIC_ARG7_get(); - public final static native int LLDB_REGNUM_GENERIC_ARG8_get(); - public final static native int LLDB_INVALID_STOP_ID_get(); - public final static native java.math.BigInteger LLDB_INVALID_ADDRESS_get(); - public final static native long LLDB_INVALID_INDEX32_get(); - public final static native long LLDB_INVALID_IVAR_OFFSET_get(); - public final static native long LLDB_INVALID_IMAGE_TOKEN_get(); - public final static native long LLDB_INVALID_MODULE_VERSION_get(); - public final static native long LLDB_INVALID_REGNUM_get(); - public final static native java.math.BigInteger LLDB_INVALID_UID_get(); - public final static native int LLDB_INVALID_PROCESS_ID_get(); - public final static native int LLDB_INVALID_THREAD_ID_get(); - public final static native long LLDB_INVALID_FRAME_ID_get(); - public final static native int LLDB_INVALID_SIGNAL_NUMBER_get(); - public final static native java.math.BigInteger LLDB_INVALID_OFFSET_get(); - public final static native long LLDB_INVALID_LINE_NUMBER_get(); - public final static native int LLDB_INVALID_COLUMN_NUMBER_get(); - public final static native int LLDB_INVALID_QUEUE_ID_get(); - public final static native long LLDB_INVALID_CPU_ID_get(); - public final static native String LLDB_ARCH_DEFAULT_get(); - public final static native String LLDB_ARCH_DEFAULT_32BIT_get(); - public final static native String LLDB_ARCH_DEFAULT_64BIT_get(); - public final static native long LLDB_INVALID_CPUTYPE_get(); - public final static native int LLDB_MAX_NUM_OPTION_SETS_get(); - public final static native long LLDB_OPT_SET_ALL_get(); - public final static native long LLDB_OPT_SET_1_get(); - public final static native long LLDB_OPT_SET_2_get(); - public final static native long LLDB_OPT_SET_3_get(); - public final static native long LLDB_OPT_SET_4_get(); - public final static native long LLDB_OPT_SET_5_get(); - public final static native long LLDB_OPT_SET_6_get(); - public final static native long LLDB_OPT_SET_7_get(); - public final static native long LLDB_OPT_SET_8_get(); - public final static native long LLDB_OPT_SET_9_get(); - public final static native long LLDB_OPT_SET_10_get(); - public final static native long LLDB_OPT_SET_11_get(); - public final static native long LLDB_OPT_SET_12_get(); - public final static native int eStateInvalid_get(); - public final static native int kLastStateType_get(); - public final static native int eLaunchFlagNone_get(); - public final static native int eLaunchFlagExec_get(); - public final static native int eLaunchFlagDebug_get(); - public final static native int eLaunchFlagStopAtEntry_get(); - public final static native int eLaunchFlagDisableASLR_get(); - public final static native int eLaunchFlagDisableSTDIO_get(); - public final static native int eLaunchFlagLaunchInTTY_get(); - public final static native int eLaunchFlagLaunchInShell_get(); - public final static native int eLaunchFlagLaunchInSeparateProcessGroup_get(); - public final static native int eLaunchFlagDontSetExitStatus_get(); - public final static native int eLaunchFlagDetachOnError_get(); - public final static native int eLaunchFlagShellExpandArguments_get(); - public final static native int eLaunchFlagCloseTTYOnExit_get(); - public final static native int eLaunchFlagInheritTCCFromParent_get(); - public final static native int eByteOrderInvalid_get(); - public final static native int eByteOrderBig_get(); - public final static native int eByteOrderPDP_get(); - public final static native int eByteOrderLittle_get(); - public final static native int eEncodingInvalid_get(); - public final static native int eFormatDefault_get(); - public final static native int eFormatInvalid_get(); - public final static native int eFormatComplexFloat_get(); - public final static native int eDescriptionLevelBrief_get(); - public final static native int eScriptLanguageNone_get(); - public final static native int eScriptLanguageDefault_get(); - public final static native int eRegisterKindEHFrame_get(); - public final static native int eStopReasonInvalid_get(); - public final static native int eExpressionCompleted_get(); - public final static native int eSearchDepthInvalid_get(); - public final static native int kLastSearchDepthKind_get(); - public final static native int eValueTypeInvalid_get(); - public final static native int eValueTypeVariableGlobal_get(); - public final static native int eValueTypeVariableStatic_get(); - public final static native int eValueTypeVariableArgument_get(); - public final static native int eValueTypeVariableLocal_get(); - public final static native int eValueTypeRegister_get(); - public final static native int eValueTypeRegisterSet_get(); - public final static native int eValueTypeConstResult_get(); - public final static native int eValueTypeVariableThreadLocal_get(); - public final static native int eInputReaderGranularityInvalid_get(); - public final static native int eSymbolContextTarget_get(); - public final static native int eSymbolContextModule_get(); - public final static native int eSymbolContextCompUnit_get(); - public final static native int eSymbolContextFunction_get(); - public final static native int eSymbolContextBlock_get(); - public final static native int eSymbolContextLineEntry_get(); - public final static native int eSymbolContextSymbol_get(); - public final static native int eSymbolContextEverything_get(); - public final static native int eSymbolContextVariable_get(); - public final static native int eSymbolContextLastItem_get(); - public final static native int ePermissionsWritable_get(); - public final static native int ePermissionsReadable_get(); - public final static native int ePermissionsExecutable_get(); - public final static native int eBreakpointEventTypeInvalidType_get(); - public final static native int eBreakpointEventTypeAdded_get(); - public final static native int eBreakpointEventTypeRemoved_get(); - public final static native int eBreakpointEventTypeLocationsAdded_get(); - public final static native int eBreakpointEventTypeLocationsRemoved_get(); - public final static native int eBreakpointEventTypeLocationsResolved_get(); - public final static native int eBreakpointEventTypeEnabled_get(); - public final static native int eBreakpointEventTypeDisabled_get(); - public final static native int eBreakpointEventTypeCommandChanged_get(); - public final static native int eBreakpointEventTypeConditionChanged_get(); - public final static native int eBreakpointEventTypeIgnoreChanged_get(); - public final static native int eBreakpointEventTypeThreadChanged_get(); - public final static native int eBreakpointEventTypeAutoContinueChanged_get(); - public final static native int eWatchpointEventTypeInvalidType_get(); - public final static native int eWatchpointEventTypeAdded_get(); - public final static native int eWatchpointEventTypeRemoved_get(); - public final static native int eWatchpointEventTypeEnabled_get(); - public final static native int eWatchpointEventTypeDisabled_get(); - public final static native int eWatchpointEventTypeCommandChanged_get(); - public final static native int eWatchpointEventTypeConditionChanged_get(); - public final static native int eWatchpointEventTypeIgnoreChanged_get(); - public final static native int eWatchpointEventTypeThreadChanged_get(); - public final static native int eWatchpointEventTypeTypeChanged_get(); - public final static native int eLanguageTypeUnknown_get(); - public final static native int eLanguageTypeC89_get(); - public final static native int eLanguageTypeC_get(); - public final static native int eLanguageTypeAda83_get(); - public final static native int eLanguageTypeC_plus_plus_get(); - public final static native int eLanguageTypeCobol74_get(); - public final static native int eLanguageTypeCobol85_get(); - public final static native int eLanguageTypeFortran77_get(); - public final static native int eLanguageTypeFortran90_get(); - public final static native int eLanguageTypePascal83_get(); - public final static native int eLanguageTypeModula2_get(); - public final static native int eLanguageTypeJava_get(); - public final static native int eLanguageTypeC99_get(); - public final static native int eLanguageTypeAda95_get(); - public final static native int eLanguageTypeFortran95_get(); - public final static native int eLanguageTypePLI_get(); - public final static native int eLanguageTypeObjC_get(); - public final static native int eLanguageTypeObjC_plus_plus_get(); - public final static native int eLanguageTypeUPC_get(); - public final static native int eLanguageTypeD_get(); - public final static native int eLanguageTypePython_get(); - public final static native int eLanguageTypeOpenCL_get(); - public final static native int eLanguageTypeGo_get(); - public final static native int eLanguageTypeModula3_get(); - public final static native int eLanguageTypeHaskell_get(); - public final static native int eLanguageTypeC_plus_plus_03_get(); - public final static native int eLanguageTypeC_plus_plus_11_get(); - public final static native int eLanguageTypeOCaml_get(); - public final static native int eLanguageTypeRust_get(); - public final static native int eLanguageTypeC11_get(); - public final static native int eLanguageTypeSwift_get(); - public final static native int eLanguageTypeJulia_get(); - public final static native int eLanguageTypeDylan_get(); - public final static native int eLanguageTypeC_plus_plus_14_get(); - public final static native int eLanguageTypeFortran03_get(); - public final static native int eLanguageTypeFortran08_get(); - public final static native int eLanguageTypeRenderScript_get(); - public final static native int eLanguageTypeBLISS_get(); - public final static native int eLanguageTypeKotlin_get(); - public final static native int eLanguageTypeZig_get(); - public final static native int eLanguageTypeCrystal_get(); - public final static native int eLanguageTypeC_plus_plus_17_get(); - public final static native int eLanguageTypeC_plus_plus_20_get(); - public final static native int eLanguageTypeC17_get(); - public final static native int eLanguageTypeFortran18_get(); - public final static native int eLanguageTypeAda2005_get(); - public final static native int eLanguageTypeAda2012_get(); - public final static native int eLanguageTypeHIP_get(); - public final static native int eLanguageTypeAssembly_get(); - public final static native int eLanguageTypeC_sharp_get(); - public final static native int eLanguageTypeMojo_get(); - public final static native int eInstrumentationRuntimeTypeAddressSanitizer_get(); - public final static native int eInstrumentationRuntimeTypeThreadSanitizer_get(); - public final static native int eInstrumentationRuntimeTypeUndefinedBehaviorSanitizer_get(); - public final static native int eInstrumentationRuntimeTypeMainThreadChecker_get(); - public final static native int eInstrumentationRuntimeTypeSwiftRuntimeReporting_get(); - public final static native int eNoDynamicValues_get(); - public final static native int eDynamicCanRunTarget_get(); - public final static native int eDynamicDontRunTarget_get(); - public final static native int eStopShowColumnAnsiOrCaret_get(); - public final static native int eStopShowColumnAnsi_get(); - public final static native int eStopShowColumnCaret_get(); - public final static native int eStopShowColumnNone_get(); - public final static native int eArgTypeAddress_get(); - public final static native int eSymbolTypeAny_get(); - public final static native int eSymbolTypeInvalid_get(); - public final static native int eEmulateInstructionOptionNone_get(); - public final static native int eEmulateInstructionOptionAutoAdvancePC_get(); - public final static native int eEmulateInstructionOptionIgnoreConditions_get(); - public final static native int eFunctionNameTypeNone_get(); - public final static native int eFunctionNameTypeAuto_get(); - public final static native int eFunctionNameTypeFull_get(); - public final static native int eFunctionNameTypeBase_get(); - public final static native int eFunctionNameTypeMethod_get(); - public final static native int eFunctionNameTypeSelector_get(); - public final static native int eFunctionNameTypeAny_get(); - public final static native int eBasicTypeInvalid_get(); - public final static native int eBasicTypeVoid_get(); - public final static native int eTraceTypeNone_get(); - public final static native int eStructuredDataTypeInvalid_get(); - public final static native int eStructuredDataTypeNull_get(); - public final static native int eStructuredDataTypeUnsignedInteger_get(); - public final static native int eTypeClassInvalid_get(); - public final static native int eTypeClassArray_get(); - public final static native int eTypeClassBlockPointer_get(); - public final static native int eTypeClassBuiltin_get(); - public final static native int eTypeClassClass_get(); - public final static native int eTypeClassComplexFloat_get(); - public final static native int eTypeClassComplexInteger_get(); - public final static native int eTypeClassEnumeration_get(); - public final static native int eTypeClassFunction_get(); - public final static native int eTypeClassMemberPointer_get(); - public final static native int eTypeClassObjCObject_get(); - public final static native int eTypeClassObjCInterface_get(); - public final static native int eTypeClassObjCObjectPointer_get(); - public final static native int eTypeClassPointer_get(); - public final static native int eTypeClassReference_get(); - public final static native int eTypeClassStruct_get(); - public final static native int eTypeClassTypedef_get(); - public final static native int eTypeClassUnion_get(); - public final static native int eTypeClassVector_get(); - public final static native int eTypeClassOther_get(); - public final static native int eTypeClassAny_get(); - public final static native int eTemplateArgumentKindNull_get(); - public final static native int eLastFormatterMatchType_get(); - public final static native int eTypeOptionNone_get(); - public final static native int eTypeOptionCascade_get(); - public final static native int eTypeOptionSkipPointers_get(); - public final static native int eTypeOptionSkipReferences_get(); - public final static native int eTypeOptionHideChildren_get(); - public final static native int eTypeOptionHideValue_get(); - public final static native int eTypeOptionShowOneLiner_get(); - public final static native int eTypeOptionHideNames_get(); - public final static native int eTypeOptionNonCacheable_get(); - public final static native int eTypeOptionHideEmptyAggregates_get(); - public final static native int eTypeOptionFrontEndWantsDereference_get(); - public final static native int eFilePermissionsUserRead_get(); - public final static native int eFilePermissionsUserWrite_get(); - public final static native int eFilePermissionsUserExecute_get(); - public final static native int eFilePermissionsGroupRead_get(); - public final static native int eFilePermissionsGroupWrite_get(); - public final static native int eFilePermissionsGroupExecute_get(); - public final static native int eFilePermissionsWorldRead_get(); - public final static native int eFilePermissionsWorldWrite_get(); - public final static native int eFilePermissionsWorldExecute_get(); - public final static native int eFilePermissionsUserRW_get(); - public final static native int eFileFilePermissionsUserRX_get(); - public final static native int eFilePermissionsUserRWX_get(); - public final static native int eFilePermissionsGroupRW_get(); - public final static native int eFilePermissionsGroupRX_get(); - public final static native int eFilePermissionsGroupRWX_get(); - public final static native int eFilePermissionsWorldRW_get(); - public final static native int eFilePermissionsWorldRX_get(); - public final static native int eFilePermissionsWorldRWX_get(); - public final static native int eFilePermissionsEveryoneR_get(); - public final static native int eFilePermissionsEveryoneW_get(); - public final static native int eFilePermissionsEveryoneX_get(); - public final static native int eFilePermissionsEveryoneRW_get(); - public final static native int eFilePermissionsEveryoneRX_get(); - public final static native int eFilePermissionsEveryoneRWX_get(); - public final static native int eFilePermissionsFileDefault_get(); - public final static native int eFilePermissionsDirectoryDefault_get(); - public final static native int eQueueItemKindUnknown_get(); - public final static native int eQueueKindUnknown_get(); - public final static native int eExpressionEvaluationParse_get(); - public final static native int eInstructionControlFlowKindUnknown_get(); - public final static native int eWatchpointKindWrite_get(); - public final static native int eWatchpointKindRead_get(); - public final static native int eGdbSignalBadAccess_get(); - public final static native int eGdbSignalBadInstruction_get(); - public final static native int eGdbSignalArithmetic_get(); - public final static native int eGdbSignalEmulation_get(); - public final static native int eGdbSignalSoftware_get(); - public final static native int eGdbSignalBreakpoint_get(); - public final static native int eMemberFunctionKindUnknown_get(); - public final static native int eTypeHasChildren_get(); - public final static native int eTypeHasValue_get(); - public final static native int eTypeIsArray_get(); - public final static native int eTypeIsBlock_get(); - public final static native int eTypeIsBuiltIn_get(); - public final static native int eTypeIsClass_get(); - public final static native int eTypeIsCPlusPlus_get(); - public final static native int eTypeIsEnumeration_get(); - public final static native int eTypeIsFuncPrototype_get(); - public final static native int eTypeIsMember_get(); - public final static native int eTypeIsObjC_get(); - public final static native int eTypeIsPointer_get(); - public final static native int eTypeIsReference_get(); - public final static native int eTypeIsStructUnion_get(); - public final static native int eTypeIsTemplate_get(); - public final static native int eTypeIsTypedef_get(); - public final static native int eTypeIsVector_get(); - public final static native int eTypeIsScalar_get(); - public final static native int eTypeIsInteger_get(); - public final static native int eTypeIsFloat_get(); - public final static native int eTypeIsComplex_get(); - public final static native int eTypeIsSigned_get(); - public final static native int eTypeInstanceIsPointer_get(); - public final static native int eCommandRequiresTarget_get(); - public final static native int eCommandRequiresProcess_get(); - public final static native int eCommandRequiresThread_get(); - public final static native int eCommandRequiresFrame_get(); - public final static native int eCommandRequiresRegContext_get(); - public final static native int eCommandTryTargetAPILock_get(); - public final static native int eCommandProcessMustBeLaunched_get(); - public final static native int eCommandProcessMustBePaused_get(); - public final static native int eCommandProcessMustBeTraced_get(); - public final static native int eTypeSummaryCapped_get(); - public final static native int eTypeSummaryUncapped_get(); - public final static native int eSaveCoreUnspecified_get(); - public final static native int eSaveCoreFull_get(); - public final static native int eSaveCoreDirtyOnly_get(); - public final static native int eSaveCoreStackOnly_get(); - public final static native int eTraceItemKindError_get(); - public final static native int eTraceCursorSeekTypeBeginning_get(); - public final static native int eWatchPointValueKindInvalid_get(); - public final static native int eWatchPointValueKindVariable_get(); - public final static native int eWatchPointValueKindExpression_get(); - public final static native int eNoCompletion_get(); - public final static native int eSourceFileCompletion_get(); - public final static native int eDiskFileCompletion_get(); - public final static native int eDiskDirectoryCompletion_get(); - public final static native int eSymbolCompletion_get(); - public final static native int eModuleCompletion_get(); - public final static native int eSettingsNameCompletion_get(); - public final static native int ePlatformPluginCompletion_get(); - public final static native int eArchitectureCompletion_get(); - public final static native int eVariablePathCompletion_get(); - public final static native int eRegisterCompletion_get(); - public final static native int eBreakpointCompletion_get(); - public final static native int eProcessPluginCompletion_get(); - public final static native int eDisassemblyFlavorCompletion_get(); - public final static native int eTypeLanguageCompletion_get(); - public final static native int eFrameIndexCompletion_get(); - public final static native int eModuleUUIDCompletion_get(); - public final static native int eStopHookIDCompletion_get(); - public final static native int eThreadIndexCompletion_get(); - public final static native int eWatchpointIDCompletion_get(); - public final static native int eBreakpointNameCompletion_get(); - public final static native int eProcessIDCompletion_get(); - public final static native int eProcessNameCompletion_get(); - public final static native int eRemoteDiskFileCompletion_get(); - public final static native int eRemoteDiskDirectoryCompletion_get(); - public final static native int eTypeCategoryNameCompletion_get(); - public final static native int eCustomCompletion_get(); - public final static native long new_SBAddress__SWIG_0(); - public final static native long new_SBAddress__SWIG_1(long jarg1, SBAddress jarg1_); - public final static native long new_SBAddress__SWIG_2(long jarg1, SBSection jarg1_, java.math.BigInteger jarg2); - public final static native long new_SBAddress__SWIG_3(java.math.BigInteger jarg1, long jarg2, SBTarget jarg2_); - public final static native void delete_SBAddress(long jarg1); - public final static native boolean SBAddress_IsValid(long jarg1, SBAddress jarg1_); - public final static native void SBAddress_Clear(long jarg1, SBAddress jarg1_); - public final static native java.math.BigInteger SBAddress_GetFileAddress(long jarg1, SBAddress jarg1_); - public final static native java.math.BigInteger SBAddress_GetLoadAddress(long jarg1, SBAddress jarg1_, long jarg2, SBTarget jarg2_); - public final static native void SBAddress_SetAddress(long jarg1, SBAddress jarg1_, long jarg2, SBSection jarg2_, java.math.BigInteger jarg3); - public final static native void SBAddress_SetLoadAddress(long jarg1, SBAddress jarg1_, java.math.BigInteger jarg2, long jarg3, SBTarget jarg3_); - public final static native boolean SBAddress_OffsetAddress(long jarg1, SBAddress jarg1_, java.math.BigInteger jarg2); - public final static native boolean SBAddress_GetDescription(long jarg1, SBAddress jarg1_, long jarg2, SBStream jarg2_); - public final static native long SBAddress_GetSymbolContext(long jarg1, SBAddress jarg1_, long jarg2); - public final static native long SBAddress_GetSection(long jarg1, SBAddress jarg1_); - public final static native java.math.BigInteger SBAddress_GetOffset(long jarg1, SBAddress jarg1_); - public final static native long SBAddress_GetModule(long jarg1, SBAddress jarg1_); - public final static native long SBAddress_GetCompileUnit(long jarg1, SBAddress jarg1_); - public final static native long SBAddress_GetFunction(long jarg1, SBAddress jarg1_); - public final static native long SBAddress_GetBlock(long jarg1, SBAddress jarg1_); - public final static native long SBAddress_GetSymbol(long jarg1, SBAddress jarg1_); - public final static native long SBAddress_GetLineEntry(long jarg1, SBAddress jarg1_); - public final static native String SBAddress___repr__(long jarg1, SBAddress jarg1_); - public final static native long new_SBAttachInfo__SWIG_0(); - public final static native long new_SBAttachInfo__SWIG_1(java.math.BigInteger jarg1); - public final static native long new_SBAttachInfo__SWIG_2(String jarg1, boolean jarg2); - public final static native long new_SBAttachInfo__SWIG_3(String jarg1, boolean jarg2, boolean jarg3); - public final static native long new_SBAttachInfo__SWIG_4(long jarg1, SBAttachInfo jarg1_); - public final static native void delete_SBAttachInfo(long jarg1); - public final static native java.math.BigInteger SBAttachInfo_GetProcessID(long jarg1, SBAttachInfo jarg1_); - public final static native void SBAttachInfo_SetProcessID(long jarg1, SBAttachInfo jarg1_, java.math.BigInteger jarg2); - public final static native void SBAttachInfo_SetExecutable__SWIG_0(long jarg1, SBAttachInfo jarg1_, String jarg2); - public final static native void SBAttachInfo_SetExecutable__SWIG_1(long jarg1, SBAttachInfo jarg1_, long jarg2, SBFileSpec jarg2_); - public final static native boolean SBAttachInfo_GetWaitForLaunch(long jarg1, SBAttachInfo jarg1_); - public final static native void SBAttachInfo_SetWaitForLaunch__SWIG_0(long jarg1, SBAttachInfo jarg1_, boolean jarg2); - public final static native void SBAttachInfo_SetWaitForLaunch__SWIG_1(long jarg1, SBAttachInfo jarg1_, boolean jarg2, boolean jarg3); - public final static native boolean SBAttachInfo_GetIgnoreExisting(long jarg1, SBAttachInfo jarg1_); - public final static native void SBAttachInfo_SetIgnoreExisting(long jarg1, SBAttachInfo jarg1_, boolean jarg2); - public final static native long SBAttachInfo_GetResumeCount(long jarg1, SBAttachInfo jarg1_); - public final static native void SBAttachInfo_SetResumeCount(long jarg1, SBAttachInfo jarg1_, long jarg2); - public final static native String SBAttachInfo_GetProcessPluginName(long jarg1, SBAttachInfo jarg1_); - public final static native void SBAttachInfo_SetProcessPluginName(long jarg1, SBAttachInfo jarg1_, String jarg2); - public final static native long SBAttachInfo_GetUserID(long jarg1, SBAttachInfo jarg1_); - public final static native long SBAttachInfo_GetGroupID(long jarg1, SBAttachInfo jarg1_); - public final static native boolean SBAttachInfo_UserIDIsValid(long jarg1, SBAttachInfo jarg1_); - public final static native boolean SBAttachInfo_GroupIDIsValid(long jarg1, SBAttachInfo jarg1_); - public final static native void SBAttachInfo_SetUserID(long jarg1, SBAttachInfo jarg1_, long jarg2); - public final static native void SBAttachInfo_SetGroupID(long jarg1, SBAttachInfo jarg1_, long jarg2); - public final static native long SBAttachInfo_GetEffectiveUserID(long jarg1, SBAttachInfo jarg1_); - public final static native long SBAttachInfo_GetEffectiveGroupID(long jarg1, SBAttachInfo jarg1_); - public final static native boolean SBAttachInfo_EffectiveUserIDIsValid(long jarg1, SBAttachInfo jarg1_); - public final static native boolean SBAttachInfo_EffectiveGroupIDIsValid(long jarg1, SBAttachInfo jarg1_); - public final static native void SBAttachInfo_SetEffectiveUserID(long jarg1, SBAttachInfo jarg1_, long jarg2); - public final static native void SBAttachInfo_SetEffectiveGroupID(long jarg1, SBAttachInfo jarg1_, long jarg2); - public final static native java.math.BigInteger SBAttachInfo_GetParentProcessID(long jarg1, SBAttachInfo jarg1_); - public final static native void SBAttachInfo_SetParentProcessID(long jarg1, SBAttachInfo jarg1_, java.math.BigInteger jarg2); - public final static native boolean SBAttachInfo_ParentProcessIDIsValid(long jarg1, SBAttachInfo jarg1_); - public final static native long SBAttachInfo_GetListener(long jarg1, SBAttachInfo jarg1_); - public final static native void SBAttachInfo_SetListener(long jarg1, SBAttachInfo jarg1_, long jarg2, SBListener jarg2_); - public final static native long SBAttachInfo_GetShadowListener(long jarg1, SBAttachInfo jarg1_); - public final static native void SBAttachInfo_SetShadowListener(long jarg1, SBAttachInfo jarg1_, long jarg2, SBListener jarg2_); - public final static native String SBAttachInfo_GetScriptedProcessClassName(long jarg1, SBAttachInfo jarg1_); - public final static native void SBAttachInfo_SetScriptedProcessClassName(long jarg1, SBAttachInfo jarg1_, String jarg2); - public final static native long SBAttachInfo_GetScriptedProcessDictionary(long jarg1, SBAttachInfo jarg1_); - public final static native void SBAttachInfo_SetScriptedProcessDictionary(long jarg1, SBAttachInfo jarg1_, long jarg2, SBStructuredData jarg2_); - public final static native long new_SBBlock__SWIG_0(); - public final static native long new_SBBlock__SWIG_1(long jarg1, SBBlock jarg1_); - public final static native void delete_SBBlock(long jarg1); - public final static native boolean SBBlock_IsInlined(long jarg1, SBBlock jarg1_); - public final static native boolean SBBlock_IsValid(long jarg1, SBBlock jarg1_); - public final static native String SBBlock_GetInlinedName(long jarg1, SBBlock jarg1_); - public final static native long SBBlock_GetInlinedCallSiteFile(long jarg1, SBBlock jarg1_); - public final static native long SBBlock_GetInlinedCallSiteLine(long jarg1, SBBlock jarg1_); - public final static native long SBBlock_GetInlinedCallSiteColumn(long jarg1, SBBlock jarg1_); - public final static native long SBBlock_GetParent(long jarg1, SBBlock jarg1_); - public final static native long SBBlock_GetSibling(long jarg1, SBBlock jarg1_); - public final static native long SBBlock_GetFirstChild(long jarg1, SBBlock jarg1_); - public final static native long SBBlock_GetNumRanges(long jarg1, SBBlock jarg1_); - public final static native long SBBlock_GetRangeStartAddress(long jarg1, SBBlock jarg1_, long jarg2); - public final static native long SBBlock_GetRangeEndAddress(long jarg1, SBBlock jarg1_, long jarg2); - public final static native long SBBlock_GetRangeIndexForBlockAddress(long jarg1, SBBlock jarg1_, long jarg2, SBAddress jarg2_); - public final static native long SBBlock_GetVariables__SWIG_0(long jarg1, SBBlock jarg1_, long jarg2, SBFrame jarg2_, boolean jarg3, boolean jarg4, boolean jarg5, int jarg6); - public final static native long SBBlock_GetVariables__SWIG_1(long jarg1, SBBlock jarg1_, long jarg2, SBTarget jarg2_, boolean jarg3, boolean jarg4, boolean jarg5); - public final static native long SBBlock_GetContainingInlinedBlock(long jarg1, SBBlock jarg1_); - public final static native boolean SBBlock_GetDescription(long jarg1, SBBlock jarg1_, long jarg2, SBStream jarg2_); - public final static native String SBBlock___repr__(long jarg1, SBBlock jarg1_); - public final static native long new_SBBreakpoint__SWIG_0(); - public final static native long new_SBBreakpoint__SWIG_1(long jarg1, SBBreakpoint jarg1_); - public final static native void delete_SBBreakpoint(long jarg1); - public final static native int SBBreakpoint_GetID(long jarg1, SBBreakpoint jarg1_); - public final static native boolean SBBreakpoint_IsValid(long jarg1, SBBreakpoint jarg1_); - public final static native void SBBreakpoint_ClearAllBreakpointSites(long jarg1, SBBreakpoint jarg1_); - public final static native long SBBreakpoint_GetTarget(long jarg1, SBBreakpoint jarg1_); - public final static native long SBBreakpoint_FindLocationByAddress(long jarg1, SBBreakpoint jarg1_, java.math.BigInteger jarg2); - public final static native int SBBreakpoint_FindLocationIDByAddress(long jarg1, SBBreakpoint jarg1_, java.math.BigInteger jarg2); - public final static native long SBBreakpoint_FindLocationByID(long jarg1, SBBreakpoint jarg1_, int jarg2); - public final static native long SBBreakpoint_GetLocationAtIndex(long jarg1, SBBreakpoint jarg1_, long jarg2); - public final static native void SBBreakpoint_SetEnabled(long jarg1, SBBreakpoint jarg1_, boolean jarg2); - public final static native boolean SBBreakpoint_IsEnabled(long jarg1, SBBreakpoint jarg1_); - public final static native void SBBreakpoint_SetOneShot(long jarg1, SBBreakpoint jarg1_, boolean jarg2); - public final static native boolean SBBreakpoint_IsOneShot(long jarg1, SBBreakpoint jarg1_); - public final static native boolean SBBreakpoint_IsInternal(long jarg1, SBBreakpoint jarg1_); - public final static native long SBBreakpoint_GetHitCount(long jarg1, SBBreakpoint jarg1_); - public final static native void SBBreakpoint_SetIgnoreCount(long jarg1, SBBreakpoint jarg1_, long jarg2); - public final static native long SBBreakpoint_GetIgnoreCount(long jarg1, SBBreakpoint jarg1_); - public final static native void SBBreakpoint_SetCondition(long jarg1, SBBreakpoint jarg1_, String jarg2); - public final static native String SBBreakpoint_GetCondition(long jarg1, SBBreakpoint jarg1_); - public final static native void SBBreakpoint_SetAutoContinue(long jarg1, SBBreakpoint jarg1_, boolean jarg2); - public final static native boolean SBBreakpoint_GetAutoContinue(long jarg1, SBBreakpoint jarg1_); - public final static native void SBBreakpoint_SetThreadID(long jarg1, SBBreakpoint jarg1_, java.math.BigInteger jarg2); - public final static native java.math.BigInteger SBBreakpoint_GetThreadID(long jarg1, SBBreakpoint jarg1_); - public final static native void SBBreakpoint_SetThreadIndex(long jarg1, SBBreakpoint jarg1_, long jarg2); - public final static native long SBBreakpoint_GetThreadIndex(long jarg1, SBBreakpoint jarg1_); - public final static native void SBBreakpoint_SetThreadName(long jarg1, SBBreakpoint jarg1_, String jarg2); - public final static native String SBBreakpoint_GetThreadName(long jarg1, SBBreakpoint jarg1_); - public final static native void SBBreakpoint_SetQueueName(long jarg1, SBBreakpoint jarg1_, String jarg2); - public final static native String SBBreakpoint_GetQueueName(long jarg1, SBBreakpoint jarg1_); - public final static native void SBBreakpoint_SetScriptCallbackFunction__SWIG_0(long jarg1, SBBreakpoint jarg1_, String jarg2); - public final static native long SBBreakpoint_SetScriptCallbackFunction__SWIG_1(long jarg1, SBBreakpoint jarg1_, String jarg2, long jarg3, SBStructuredData jarg3_); - public final static native void SBBreakpoint_SetCommandLineCommands(long jarg1, SBBreakpoint jarg1_, long jarg2, SBStringList jarg2_); - public final static native boolean SBBreakpoint_GetCommandLineCommands(long jarg1, SBBreakpoint jarg1_, long jarg2, SBStringList jarg2_); - public final static native long SBBreakpoint_SetScriptCallbackBody(long jarg1, SBBreakpoint jarg1_, String jarg2); - public final static native boolean SBBreakpoint_AddName(long jarg1, SBBreakpoint jarg1_, String jarg2); - public final static native long SBBreakpoint_AddNameWithErrorHandling(long jarg1, SBBreakpoint jarg1_, String jarg2); - public final static native void SBBreakpoint_RemoveName(long jarg1, SBBreakpoint jarg1_, String jarg2); - public final static native boolean SBBreakpoint_MatchesName(long jarg1, SBBreakpoint jarg1_, String jarg2); - public final static native void SBBreakpoint_GetNames(long jarg1, SBBreakpoint jarg1_, long jarg2, SBStringList jarg2_); - public final static native long SBBreakpoint_GetNumResolvedLocations(long jarg1, SBBreakpoint jarg1_); - public final static native long SBBreakpoint_GetNumLocations(long jarg1, SBBreakpoint jarg1_); - public final static native boolean SBBreakpoint_GetDescription__SWIG_0(long jarg1, SBBreakpoint jarg1_, long jarg2, SBStream jarg2_); - public final static native boolean SBBreakpoint_GetDescription__SWIG_1(long jarg1, SBBreakpoint jarg1_, long jarg2, SBStream jarg2_, boolean jarg3); - public final static native boolean SBBreakpoint_EventIsBreakpointEvent(long jarg1, SBEvent jarg1_); - public final static native int SBBreakpoint_GetBreakpointEventTypeFromEvent(long jarg1, SBEvent jarg1_); - public final static native long SBBreakpoint_GetBreakpointFromEvent(long jarg1, SBEvent jarg1_); - public final static native long SBBreakpoint_GetBreakpointLocationAtIndexFromEvent(long jarg1, SBEvent jarg1_, long jarg2); - public final static native long SBBreakpoint_GetNumBreakpointLocationsFromEvent(long jarg1, SBEvent jarg1_); - public final static native boolean SBBreakpoint_IsHardware(long jarg1, SBBreakpoint jarg1_); - public final static native long SBBreakpoint_AddLocation(long jarg1, SBBreakpoint jarg1_, long jarg2, SBAddress jarg2_); - public final static native long SBBreakpoint_SerializeToStructuredData(long jarg1, SBBreakpoint jarg1_); - public final static native String SBBreakpoint___repr__(long jarg1, SBBreakpoint jarg1_); - public final static native long new_SBBreakpointList(long jarg1, SBTarget jarg1_); - public final static native void delete_SBBreakpointList(long jarg1); - public final static native long SBBreakpointList_GetSize(long jarg1, SBBreakpointList jarg1_); - public final static native long SBBreakpointList_GetBreakpointAtIndex(long jarg1, SBBreakpointList jarg1_, long jarg2); - public final static native long SBBreakpointList_FindBreakpointByID(long jarg1, SBBreakpointList jarg1_, int jarg2); - public final static native void SBBreakpointList_Append(long jarg1, SBBreakpointList jarg1_, long jarg2, SBBreakpoint jarg2_); - public final static native boolean SBBreakpointList_AppendIfUnique(long jarg1, SBBreakpointList jarg1_, long jarg2, SBBreakpoint jarg2_); - public final static native void SBBreakpointList_AppendByID(long jarg1, SBBreakpointList jarg1_, int jarg2); - public final static native void SBBreakpointList_Clear(long jarg1, SBBreakpointList jarg1_); - public final static native long new_SBBreakpointLocation__SWIG_0(); - public final static native long new_SBBreakpointLocation__SWIG_1(long jarg1, SBBreakpointLocation jarg1_); - public final static native void delete_SBBreakpointLocation(long jarg1); - public final static native int SBBreakpointLocation_GetID(long jarg1, SBBreakpointLocation jarg1_); - public final static native boolean SBBreakpointLocation_IsValid(long jarg1, SBBreakpointLocation jarg1_); - public final static native long SBBreakpointLocation_GetAddress(long jarg1, SBBreakpointLocation jarg1_); - public final static native java.math.BigInteger SBBreakpointLocation_GetLoadAddress(long jarg1, SBBreakpointLocation jarg1_); - public final static native void SBBreakpointLocation_SetEnabled(long jarg1, SBBreakpointLocation jarg1_, boolean jarg2); - public final static native boolean SBBreakpointLocation_IsEnabled(long jarg1, SBBreakpointLocation jarg1_); - public final static native long SBBreakpointLocation_GetHitCount(long jarg1, SBBreakpointLocation jarg1_); - public final static native long SBBreakpointLocation_GetIgnoreCount(long jarg1, SBBreakpointLocation jarg1_); - public final static native void SBBreakpointLocation_SetIgnoreCount(long jarg1, SBBreakpointLocation jarg1_, long jarg2); - public final static native void SBBreakpointLocation_SetCondition(long jarg1, SBBreakpointLocation jarg1_, String jarg2); - public final static native String SBBreakpointLocation_GetCondition(long jarg1, SBBreakpointLocation jarg1_); - public final static native void SBBreakpointLocation_SetAutoContinue(long jarg1, SBBreakpointLocation jarg1_, boolean jarg2); - public final static native boolean SBBreakpointLocation_GetAutoContinue(long jarg1, SBBreakpointLocation jarg1_); - public final static native void SBBreakpointLocation_SetScriptCallbackFunction__SWIG_0(long jarg1, SBBreakpointLocation jarg1_, String jarg2); - public final static native long SBBreakpointLocation_SetScriptCallbackFunction__SWIG_1(long jarg1, SBBreakpointLocation jarg1_, String jarg2, long jarg3, SBStructuredData jarg3_); - public final static native long SBBreakpointLocation_SetScriptCallbackBody(long jarg1, SBBreakpointLocation jarg1_, String jarg2); - public final static native void SBBreakpointLocation_SetCommandLineCommands(long jarg1, SBBreakpointLocation jarg1_, long jarg2, SBStringList jarg2_); - public final static native boolean SBBreakpointLocation_GetCommandLineCommands(long jarg1, SBBreakpointLocation jarg1_, long jarg2, SBStringList jarg2_); - public final static native void SBBreakpointLocation_SetThreadID(long jarg1, SBBreakpointLocation jarg1_, java.math.BigInteger jarg2); - public final static native java.math.BigInteger SBBreakpointLocation_GetThreadID(long jarg1, SBBreakpointLocation jarg1_); - public final static native void SBBreakpointLocation_SetThreadIndex(long jarg1, SBBreakpointLocation jarg1_, long jarg2); - public final static native long SBBreakpointLocation_GetThreadIndex(long jarg1, SBBreakpointLocation jarg1_); - public final static native void SBBreakpointLocation_SetThreadName(long jarg1, SBBreakpointLocation jarg1_, String jarg2); - public final static native String SBBreakpointLocation_GetThreadName(long jarg1, SBBreakpointLocation jarg1_); - public final static native void SBBreakpointLocation_SetQueueName(long jarg1, SBBreakpointLocation jarg1_, String jarg2); - public final static native String SBBreakpointLocation_GetQueueName(long jarg1, SBBreakpointLocation jarg1_); - public final static native boolean SBBreakpointLocation_IsResolved(long jarg1, SBBreakpointLocation jarg1_); - public final static native boolean SBBreakpointLocation_GetDescription(long jarg1, SBBreakpointLocation jarg1_, long jarg2, SBStream jarg2_, int jarg3); - public final static native long SBBreakpointLocation_GetBreakpoint(long jarg1, SBBreakpointLocation jarg1_); - public final static native String SBBreakpointLocation___repr__(long jarg1, SBBreakpointLocation jarg1_); - public final static native long new_SBBreakpointName__SWIG_0(); - public final static native long new_SBBreakpointName__SWIG_1(long jarg1, SBTarget jarg1_, String jarg2); - public final static native long new_SBBreakpointName__SWIG_2(long jarg1, SBBreakpoint jarg1_, String jarg2); - public final static native long new_SBBreakpointName__SWIG_3(long jarg1, SBBreakpointName jarg1_); - public final static native void delete_SBBreakpointName(long jarg1); - public final static native boolean SBBreakpointName_IsValid(long jarg1, SBBreakpointName jarg1_); - public final static native String SBBreakpointName_GetName(long jarg1, SBBreakpointName jarg1_); - public final static native void SBBreakpointName_SetEnabled(long jarg1, SBBreakpointName jarg1_, boolean jarg2); - public final static native boolean SBBreakpointName_IsEnabled(long jarg1, SBBreakpointName jarg1_); - public final static native void SBBreakpointName_SetOneShot(long jarg1, SBBreakpointName jarg1_, boolean jarg2); - public final static native boolean SBBreakpointName_IsOneShot(long jarg1, SBBreakpointName jarg1_); - public final static native void SBBreakpointName_SetIgnoreCount(long jarg1, SBBreakpointName jarg1_, long jarg2); - public final static native long SBBreakpointName_GetIgnoreCount(long jarg1, SBBreakpointName jarg1_); - public final static native void SBBreakpointName_SetCondition(long jarg1, SBBreakpointName jarg1_, String jarg2); - public final static native String SBBreakpointName_GetCondition(long jarg1, SBBreakpointName jarg1_); - public final static native void SBBreakpointName_SetAutoContinue(long jarg1, SBBreakpointName jarg1_, boolean jarg2); - public final static native boolean SBBreakpointName_GetAutoContinue(long jarg1, SBBreakpointName jarg1_); - public final static native void SBBreakpointName_SetThreadID(long jarg1, SBBreakpointName jarg1_, java.math.BigInteger jarg2); - public final static native java.math.BigInteger SBBreakpointName_GetThreadID(long jarg1, SBBreakpointName jarg1_); - public final static native void SBBreakpointName_SetThreadIndex(long jarg1, SBBreakpointName jarg1_, long jarg2); - public final static native long SBBreakpointName_GetThreadIndex(long jarg1, SBBreakpointName jarg1_); - public final static native void SBBreakpointName_SetThreadName(long jarg1, SBBreakpointName jarg1_, String jarg2); - public final static native String SBBreakpointName_GetThreadName(long jarg1, SBBreakpointName jarg1_); - public final static native void SBBreakpointName_SetQueueName(long jarg1, SBBreakpointName jarg1_, String jarg2); - public final static native String SBBreakpointName_GetQueueName(long jarg1, SBBreakpointName jarg1_); - public final static native void SBBreakpointName_SetScriptCallbackFunction__SWIG_0(long jarg1, SBBreakpointName jarg1_, String jarg2); - public final static native long SBBreakpointName_SetScriptCallbackFunction__SWIG_1(long jarg1, SBBreakpointName jarg1_, String jarg2, long jarg3, SBStructuredData jarg3_); - public final static native void SBBreakpointName_SetCommandLineCommands(long jarg1, SBBreakpointName jarg1_, long jarg2, SBStringList jarg2_); - public final static native boolean SBBreakpointName_GetCommandLineCommands(long jarg1, SBBreakpointName jarg1_, long jarg2, SBStringList jarg2_); - public final static native long SBBreakpointName_SetScriptCallbackBody(long jarg1, SBBreakpointName jarg1_, String jarg2); - public final static native String SBBreakpointName_GetHelpString(long jarg1, SBBreakpointName jarg1_); - public final static native void SBBreakpointName_SetHelpString(long jarg1, SBBreakpointName jarg1_, String jarg2); - public final static native boolean SBBreakpointName_GetAllowList(long jarg1, SBBreakpointName jarg1_); - public final static native void SBBreakpointName_SetAllowList(long jarg1, SBBreakpointName jarg1_, boolean jarg2); - public final static native boolean SBBreakpointName_GetAllowDelete(long jarg1, SBBreakpointName jarg1_); - public final static native void SBBreakpointName_SetAllowDelete(long jarg1, SBBreakpointName jarg1_, boolean jarg2); - public final static native boolean SBBreakpointName_GetAllowDisable(long jarg1, SBBreakpointName jarg1_); - public final static native void SBBreakpointName_SetAllowDisable(long jarg1, SBBreakpointName jarg1_, boolean jarg2); - public final static native boolean SBBreakpointName_GetDescription(long jarg1, SBBreakpointName jarg1_, long jarg2, SBStream jarg2_); - public final static native String SBBreakpointName___repr__(long jarg1, SBBreakpointName jarg1_); - public final static native long new_SBBroadcaster__SWIG_0(); - public final static native long new_SBBroadcaster__SWIG_1(String jarg1); - public final static native long new_SBBroadcaster__SWIG_2(long jarg1, SBBroadcaster jarg1_); - public final static native void delete_SBBroadcaster(long jarg1); - public final static native boolean SBBroadcaster_IsValid(long jarg1, SBBroadcaster jarg1_); - public final static native void SBBroadcaster_Clear(long jarg1, SBBroadcaster jarg1_); - public final static native void SBBroadcaster_BroadcastEventByType__SWIG_0(long jarg1, SBBroadcaster jarg1_, long jarg2, boolean jarg3); - public final static native void SBBroadcaster_BroadcastEventByType__SWIG_1(long jarg1, SBBroadcaster jarg1_, long jarg2); - public final static native void SBBroadcaster_BroadcastEvent__SWIG_0(long jarg1, SBBroadcaster jarg1_, long jarg2, SBEvent jarg2_, boolean jarg3); - public final static native void SBBroadcaster_BroadcastEvent__SWIG_1(long jarg1, SBBroadcaster jarg1_, long jarg2, SBEvent jarg2_); - public final static native void SBBroadcaster_AddInitialEventsToListener(long jarg1, SBBroadcaster jarg1_, long jarg2, SBListener jarg2_, long jarg3); - public final static native long SBBroadcaster_AddListener(long jarg1, SBBroadcaster jarg1_, long jarg2, SBListener jarg2_, long jarg3); - public final static native String SBBroadcaster_GetName(long jarg1, SBBroadcaster jarg1_); - public final static native boolean SBBroadcaster_EventTypeHasListeners(long jarg1, SBBroadcaster jarg1_, long jarg2); - public final static native boolean SBBroadcaster_RemoveListener__SWIG_0(long jarg1, SBBroadcaster jarg1_, long jarg2, SBListener jarg2_, long jarg3); - public final static native boolean SBBroadcaster_RemoveListener__SWIG_1(long jarg1, SBBroadcaster jarg1_, long jarg2, SBListener jarg2_); - public final static native int SBCommandInterpreter_eBroadcastBitThreadShouldExit_get(); - public final static native int SBCommandInterpreter_eBroadcastBitResetPrompt_get(); - public final static native int SBCommandInterpreter_eBroadcastBitQuitCommandReceived_get(); - public final static native int SBCommandInterpreter_eBroadcastBitAsynchronousOutputData_get(); - public final static native int SBCommandInterpreter_eBroadcastBitAsynchronousErrorData_get(); - public final static native long new_SBCommandInterpreter(long jarg1, SBCommandInterpreter jarg1_); - public final static native void delete_SBCommandInterpreter(long jarg1); - public final static native String SBCommandInterpreter_GetArgumentTypeAsCString(int jarg1); - public final static native String SBCommandInterpreter_GetArgumentDescriptionAsCString(int jarg1); - public final static native boolean SBCommandInterpreter_EventIsCommandInterpreterEvent(long jarg1, SBEvent jarg1_); - public final static native boolean SBCommandInterpreter_IsValid(long jarg1, SBCommandInterpreter jarg1_); - public final static native boolean SBCommandInterpreter_CommandExists(long jarg1, SBCommandInterpreter jarg1_, String jarg2); - public final static native boolean SBCommandInterpreter_UserCommandExists(long jarg1, SBCommandInterpreter jarg1_, String jarg2); - public final static native boolean SBCommandInterpreter_AliasExists(long jarg1, SBCommandInterpreter jarg1_, String jarg2); - public final static native long SBCommandInterpreter_GetBroadcaster(long jarg1, SBCommandInterpreter jarg1_); - public final static native String SBCommandInterpreter_GetBroadcasterClass(); - public final static native boolean SBCommandInterpreter_HasCommands(long jarg1, SBCommandInterpreter jarg1_); - public final static native boolean SBCommandInterpreter_HasAliases(long jarg1, SBCommandInterpreter jarg1_); - public final static native boolean SBCommandInterpreter_HasAliasOptions(long jarg1, SBCommandInterpreter jarg1_); - public final static native boolean SBCommandInterpreter_IsInteractive(long jarg1, SBCommandInterpreter jarg1_); - public final static native long SBCommandInterpreter_GetProcess(long jarg1, SBCommandInterpreter jarg1_); - public final static native long SBCommandInterpreter_GetDebugger(long jarg1, SBCommandInterpreter jarg1_); - public final static native void SBCommandInterpreter_SourceInitFileInHomeDirectory__SWIG_0(long jarg1, SBCommandInterpreter jarg1_, long jarg2, SBCommandReturnObject jarg2_); - public final static native void SBCommandInterpreter_SourceInitFileInHomeDirectory__SWIG_1(long jarg1, SBCommandInterpreter jarg1_, long jarg2, SBCommandReturnObject jarg2_, boolean jarg3); - public final static native void SBCommandInterpreter_SourceInitFileInCurrentWorkingDirectory(long jarg1, SBCommandInterpreter jarg1_, long jarg2, SBCommandReturnObject jarg2_); - public final static native int SBCommandInterpreter_HandleCommand__SWIG_0(long jarg1, SBCommandInterpreter jarg1_, String jarg2, long jarg3, SBCommandReturnObject jarg3_, boolean jarg4); - public final static native int SBCommandInterpreter_HandleCommand__SWIG_1(long jarg1, SBCommandInterpreter jarg1_, String jarg2, long jarg3, SBCommandReturnObject jarg3_); - public final static native int SBCommandInterpreter_HandleCommand__SWIG_2(long jarg1, SBCommandInterpreter jarg1_, String jarg2, long jarg3, SBExecutionContext jarg3_, long jarg4, SBCommandReturnObject jarg4_, boolean jarg5); - public final static native int SBCommandInterpreter_HandleCommand__SWIG_3(long jarg1, SBCommandInterpreter jarg1_, String jarg2, long jarg3, SBExecutionContext jarg3_, long jarg4, SBCommandReturnObject jarg4_); - public final static native void SBCommandInterpreter_HandleCommandsFromFile(long jarg1, SBCommandInterpreter jarg1_, long jarg2, SBFileSpec jarg2_, long jarg3, SBExecutionContext jarg3_, long jarg4, SBCommandInterpreterRunOptions jarg4_, long jarg5, SBCommandReturnObject jarg5_); - public final static native int SBCommandInterpreter_HandleCompletion(long jarg1, SBCommandInterpreter jarg1_, String jarg2, long jarg3, int jarg4, int jarg5, long jarg6, SBStringList jarg6_); - public final static native int SBCommandInterpreter_HandleCompletionWithDescriptions(long jarg1, SBCommandInterpreter jarg1_, String jarg2, long jarg3, int jarg4, int jarg5, long jarg6, SBStringList jarg6_, long jarg7, SBStringList jarg7_); - public final static native boolean SBCommandInterpreter_WasInterrupted(long jarg1, SBCommandInterpreter jarg1_); - public final static native boolean SBCommandInterpreter_InterruptCommand(long jarg1, SBCommandInterpreter jarg1_); - public final static native boolean SBCommandInterpreter_IsActive(long jarg1, SBCommandInterpreter jarg1_); - public final static native String SBCommandInterpreter_GetIOHandlerControlSequence(long jarg1, SBCommandInterpreter jarg1_, char jarg2); - public final static native boolean SBCommandInterpreter_GetPromptOnQuit(long jarg1, SBCommandInterpreter jarg1_); - public final static native void SBCommandInterpreter_SetPromptOnQuit(long jarg1, SBCommandInterpreter jarg1_, boolean jarg2); - public final static native void SBCommandInterpreter_AllowExitCodeOnQuit(long jarg1, SBCommandInterpreter jarg1_, boolean jarg2); - public final static native boolean SBCommandInterpreter_HasCustomQuitExitCode(long jarg1, SBCommandInterpreter jarg1_); - public final static native int SBCommandInterpreter_GetQuitStatus(long jarg1, SBCommandInterpreter jarg1_); - public final static native void SBCommandInterpreter_ResolveCommand(long jarg1, SBCommandInterpreter jarg1_, String jarg2, long jarg3, SBCommandReturnObject jarg3_); - public final static native long new_SBCommandInterpreterRunOptions__SWIG_0(); - public final static native long new_SBCommandInterpreterRunOptions__SWIG_1(long jarg1, SBCommandInterpreterRunOptions jarg1_); - public final static native void delete_SBCommandInterpreterRunOptions(long jarg1); - public final static native boolean SBCommandInterpreterRunOptions_GetStopOnContinue(long jarg1, SBCommandInterpreterRunOptions jarg1_); - public final static native void SBCommandInterpreterRunOptions_SetStopOnContinue(long jarg1, SBCommandInterpreterRunOptions jarg1_, boolean jarg2); - public final static native boolean SBCommandInterpreterRunOptions_GetStopOnError(long jarg1, SBCommandInterpreterRunOptions jarg1_); - public final static native void SBCommandInterpreterRunOptions_SetStopOnError(long jarg1, SBCommandInterpreterRunOptions jarg1_, boolean jarg2); - public final static native boolean SBCommandInterpreterRunOptions_GetStopOnCrash(long jarg1, SBCommandInterpreterRunOptions jarg1_); - public final static native void SBCommandInterpreterRunOptions_SetStopOnCrash(long jarg1, SBCommandInterpreterRunOptions jarg1_, boolean jarg2); - public final static native boolean SBCommandInterpreterRunOptions_GetEchoCommands(long jarg1, SBCommandInterpreterRunOptions jarg1_); - public final static native void SBCommandInterpreterRunOptions_SetEchoCommands(long jarg1, SBCommandInterpreterRunOptions jarg1_, boolean jarg2); - public final static native boolean SBCommandInterpreterRunOptions_GetEchoCommentCommands(long jarg1, SBCommandInterpreterRunOptions jarg1_); - public final static native void SBCommandInterpreterRunOptions_SetEchoCommentCommands(long jarg1, SBCommandInterpreterRunOptions jarg1_, boolean jarg2); - public final static native boolean SBCommandInterpreterRunOptions_GetPrintResults(long jarg1, SBCommandInterpreterRunOptions jarg1_); - public final static native void SBCommandInterpreterRunOptions_SetPrintResults(long jarg1, SBCommandInterpreterRunOptions jarg1_, boolean jarg2); - public final static native boolean SBCommandInterpreterRunOptions_GetPrintErrors(long jarg1, SBCommandInterpreterRunOptions jarg1_); - public final static native void SBCommandInterpreterRunOptions_SetPrintErrors(long jarg1, SBCommandInterpreterRunOptions jarg1_, boolean jarg2); - public final static native boolean SBCommandInterpreterRunOptions_GetAddToHistory(long jarg1, SBCommandInterpreterRunOptions jarg1_); - public final static native void SBCommandInterpreterRunOptions_SetAddToHistory(long jarg1, SBCommandInterpreterRunOptions jarg1_, boolean jarg2); - public final static native boolean SBCommandInterpreterRunOptions_GetAutoHandleEvents(long jarg1, SBCommandInterpreterRunOptions jarg1_); - public final static native void SBCommandInterpreterRunOptions_SetAutoHandleEvents(long jarg1, SBCommandInterpreterRunOptions jarg1_, boolean jarg2); - public final static native boolean SBCommandInterpreterRunOptions_GetSpawnThread(long jarg1, SBCommandInterpreterRunOptions jarg1_); - public final static native void SBCommandInterpreterRunOptions_SetSpawnThread(long jarg1, SBCommandInterpreterRunOptions jarg1_, boolean jarg2); - public final static native long new_SBCommandReturnObject__SWIG_0(); - public final static native long new_SBCommandReturnObject__SWIG_1(long jarg1, SBCommandReturnObject jarg1_); - public final static native void delete_SBCommandReturnObject(long jarg1); - public final static native boolean SBCommandReturnObject_IsValid(long jarg1, SBCommandReturnObject jarg1_); - public final static native String SBCommandReturnObject_GetOutput__SWIG_0(long jarg1, SBCommandReturnObject jarg1_); - public final static native String SBCommandReturnObject_GetError__SWIG_0(long jarg1, SBCommandReturnObject jarg1_); - public final static native long SBCommandReturnObject_PutOutput__SWIG_0(long jarg1, SBCommandReturnObject jarg1_, long jarg2, SBFile jarg2_); - public final static native long SBCommandReturnObject_PutOutput__SWIG_1(long jarg1, SBCommandReturnObject jarg1_, long jarg2); - public final static native long SBCommandReturnObject_GetOutputSize(long jarg1, SBCommandReturnObject jarg1_); - public final static native long SBCommandReturnObject_GetErrorSize(long jarg1, SBCommandReturnObject jarg1_); - public final static native long SBCommandReturnObject_PutError__SWIG_0(long jarg1, SBCommandReturnObject jarg1_, long jarg2, SBFile jarg2_); - public final static native long SBCommandReturnObject_PutError__SWIG_1(long jarg1, SBCommandReturnObject jarg1_, long jarg2); - public final static native void SBCommandReturnObject_Clear(long jarg1, SBCommandReturnObject jarg1_); - public final static native int SBCommandReturnObject_GetStatus(long jarg1, SBCommandReturnObject jarg1_); - public final static native void SBCommandReturnObject_SetStatus(long jarg1, SBCommandReturnObject jarg1_, int jarg2); - public final static native boolean SBCommandReturnObject_Succeeded(long jarg1, SBCommandReturnObject jarg1_); - public final static native boolean SBCommandReturnObject_HasResult(long jarg1, SBCommandReturnObject jarg1_); - public final static native void SBCommandReturnObject_AppendMessage(long jarg1, SBCommandReturnObject jarg1_, String jarg2); - public final static native void SBCommandReturnObject_AppendWarning(long jarg1, SBCommandReturnObject jarg1_, String jarg2); - public final static native boolean SBCommandReturnObject_GetDescription(long jarg1, SBCommandReturnObject jarg1_, long jarg2, SBStream jarg2_); - public final static native void SBCommandReturnObject_SetImmediateOutputFile__SWIG_0(long jarg1, SBCommandReturnObject jarg1_, long jarg2, SBFile jarg2_); - public final static native void SBCommandReturnObject_SetImmediateErrorFile__SWIG_0(long jarg1, SBCommandReturnObject jarg1_, long jarg2, SBFile jarg2_); - public final static native void SBCommandReturnObject_SetImmediateOutputFile__SWIG_1(long jarg1, SBCommandReturnObject jarg1_, long jarg2); - public final static native void SBCommandReturnObject_SetImmediateErrorFile__SWIG_1(long jarg1, SBCommandReturnObject jarg1_, long jarg2); - public final static native void SBCommandReturnObject_PutCString__SWIG_0(long jarg1, SBCommandReturnObject jarg1_, String jarg2, int jarg3); - public final static native void SBCommandReturnObject_PutCString__SWIG_1(long jarg1, SBCommandReturnObject jarg1_, String jarg2); - public final static native String SBCommandReturnObject_GetOutput__SWIG_1(long jarg1, SBCommandReturnObject jarg1_, boolean jarg2); - public final static native String SBCommandReturnObject_GetError__SWIG_1(long jarg1, SBCommandReturnObject jarg1_, boolean jarg2); - public final static native void SBCommandReturnObject_SetError__SWIG_0(long jarg1, SBCommandReturnObject jarg1_, long jarg2, SBError jarg2_, String jarg3); - public final static native void SBCommandReturnObject_SetError__SWIG_1(long jarg1, SBCommandReturnObject jarg1_, long jarg2, SBError jarg2_); - public final static native void SBCommandReturnObject_SetError__SWIG_2(long jarg1, SBCommandReturnObject jarg1_, String jarg2); - public final static native String SBCommandReturnObject___repr__(long jarg1, SBCommandReturnObject jarg1_); - public final static native void SBCommandReturnObject_SetImmediateOutputFile__SWIG_2(long jarg1, SBCommandReturnObject jarg1_, long jarg2, boolean jarg3); - public final static native void SBCommandReturnObject_SetImmediateErrorFile__SWIG_2(long jarg1, SBCommandReturnObject jarg1_, long jarg2, boolean jarg3); - public final static native void SBCommandReturnObject_Print(long jarg1, SBCommandReturnObject jarg1_, String jarg2); - public final static native int SBCommunication_eBroadcastBitDisconnected_get(); - public final static native int SBCommunication_eBroadcastBitReadThreadGotBytes_get(); - public final static native int SBCommunication_eBroadcastBitReadThreadDidExit_get(); - public final static native int SBCommunication_eBroadcastBitReadThreadShouldExit_get(); - public final static native int SBCommunication_eBroadcastBitPacketAvailable_get(); - public final static native int SBCommunication_eAllEventBits_get(); - public final static native long new_SBCommunication__SWIG_0(); - public final static native long new_SBCommunication__SWIG_1(String jarg1); - public final static native void delete_SBCommunication(long jarg1); - public final static native boolean SBCommunication_IsValid(long jarg1, SBCommunication jarg1_); - public final static native long SBCommunication_GetBroadcaster(long jarg1, SBCommunication jarg1_); - public final static native String SBCommunication_GetBroadcasterClass(); - public final static native int SBCommunication_AdoptFileDesriptor(long jarg1, SBCommunication jarg1_, int jarg2, boolean jarg3); - public final static native int SBCommunication_Connect(long jarg1, SBCommunication jarg1_, String jarg2); - public final static native int SBCommunication_Disconnect(long jarg1, SBCommunication jarg1_); - public final static native boolean SBCommunication_IsConnected(long jarg1, SBCommunication jarg1_); - public final static native boolean SBCommunication_GetCloseOnEOF(long jarg1, SBCommunication jarg1_); - public final static native void SBCommunication_SetCloseOnEOF(long jarg1, SBCommunication jarg1_, boolean jarg2); - public final static native long SBCommunication_Read(long jarg1, SBCommunication jarg1_, long jarg2, long jarg3, long jarg4, long jarg5); - public final static native long SBCommunication_Write(long jarg1, SBCommunication jarg1_, long jarg2, long jarg3, long jarg4); - public final static native boolean SBCommunication_ReadThreadStart(long jarg1, SBCommunication jarg1_); - public final static native boolean SBCommunication_ReadThreadStop(long jarg1, SBCommunication jarg1_); - public final static native boolean SBCommunication_ReadThreadIsRunning(long jarg1, SBCommunication jarg1_); - public final static native boolean SBCommunication_SetReadThreadBytesReceivedCallback(long jarg1, SBCommunication jarg1_, long jarg2, long jarg3); - public final static native long new_SBCompileUnit__SWIG_0(); - public final static native long new_SBCompileUnit__SWIG_1(long jarg1, SBCompileUnit jarg1_); - public final static native void delete_SBCompileUnit(long jarg1); - public final static native boolean SBCompileUnit_IsValid(long jarg1, SBCompileUnit jarg1_); - public final static native long SBCompileUnit_GetFileSpec(long jarg1, SBCompileUnit jarg1_); - public final static native long SBCompileUnit_GetNumLineEntries(long jarg1, SBCompileUnit jarg1_); - public final static native long SBCompileUnit_GetLineEntryAtIndex(long jarg1, SBCompileUnit jarg1_, long jarg2); - public final static native long SBCompileUnit_FindLineEntryIndex__SWIG_0(long jarg1, SBCompileUnit jarg1_, long jarg2, SBLineEntry jarg2_, boolean jarg3); - public final static native long SBCompileUnit_FindLineEntryIndex__SWIG_1(long jarg1, SBCompileUnit jarg1_, long jarg2, SBLineEntry jarg2_); - public final static native long SBCompileUnit_FindLineEntryIndex__SWIG_2(long jarg1, SBCompileUnit jarg1_, long jarg2, long jarg3, long jarg4, SBFileSpec jarg4_); - public final static native long SBCompileUnit_FindLineEntryIndex__SWIG_3(long jarg1, SBCompileUnit jarg1_, long jarg2, long jarg3, long jarg4, SBFileSpec jarg4_, boolean jarg5); - public final static native long SBCompileUnit_GetSupportFileAtIndex(long jarg1, SBCompileUnit jarg1_, long jarg2); - public final static native long SBCompileUnit_GetNumSupportFiles(long jarg1, SBCompileUnit jarg1_); - public final static native long SBCompileUnit_FindSupportFileIndex(long jarg1, SBCompileUnit jarg1_, long jarg2, long jarg3, SBFileSpec jarg3_, boolean jarg4); - public final static native long SBCompileUnit_GetTypes__SWIG_0(long jarg1, SBCompileUnit jarg1_, long jarg2); - public final static native long SBCompileUnit_GetTypes__SWIG_1(long jarg1, SBCompileUnit jarg1_); - public final static native int SBCompileUnit_GetLanguage(long jarg1, SBCompileUnit jarg1_); - public final static native boolean SBCompileUnit_GetDescription(long jarg1, SBCompileUnit jarg1_, long jarg2, SBStream jarg2_); - public final static native String SBCompileUnit___repr__(long jarg1, SBCompileUnit jarg1_); - public final static native long new_SBData__SWIG_0(); - public final static native long new_SBData__SWIG_1(long jarg1, SBData jarg1_); - public final static native void delete_SBData(long jarg1); - public final static native short SBData_GetAddressByteSize(long jarg1, SBData jarg1_); - public final static native void SBData_SetAddressByteSize(long jarg1, SBData jarg1_, short jarg2); - public final static native void SBData_Clear(long jarg1, SBData jarg1_); - public final static native boolean SBData_IsValid(long jarg1, SBData jarg1_); - public final static native long SBData_GetByteSize(long jarg1, SBData jarg1_); - public final static native int SBData_GetByteOrder(long jarg1, SBData jarg1_); - public final static native void SBData_SetByteOrder(long jarg1, SBData jarg1_, int jarg2); - public final static native float SBData_GetFloat(long jarg1, SBData jarg1_, long jarg2, SBError jarg2_, java.math.BigInteger jarg3); - public final static native double SBData_GetDouble(long jarg1, SBData jarg1_, long jarg2, SBError jarg2_, java.math.BigInteger jarg3); - public final static native long SBData_GetLongDouble(long jarg1, SBData jarg1_, long jarg2, SBError jarg2_, java.math.BigInteger jarg3); - public final static native java.math.BigInteger SBData_GetAddress(long jarg1, SBData jarg1_, long jarg2, SBError jarg2_, java.math.BigInteger jarg3); - public final static native short SBData_GetUnsignedInt8(long jarg1, SBData jarg1_, long jarg2, SBError jarg2_, java.math.BigInteger jarg3); - public final static native int SBData_GetUnsignedInt16(long jarg1, SBData jarg1_, long jarg2, SBError jarg2_, java.math.BigInteger jarg3); - public final static native long SBData_GetUnsignedInt32(long jarg1, SBData jarg1_, long jarg2, SBError jarg2_, java.math.BigInteger jarg3); - public final static native java.math.BigInteger SBData_GetUnsignedInt64(long jarg1, SBData jarg1_, long jarg2, SBError jarg2_, java.math.BigInteger jarg3); - public final static native byte SBData_GetSignedInt8(long jarg1, SBData jarg1_, long jarg2, SBError jarg2_, java.math.BigInteger jarg3); - public final static native short SBData_GetSignedInt16(long jarg1, SBData jarg1_, long jarg2, SBError jarg2_, java.math.BigInteger jarg3); - public final static native int SBData_GetSignedInt32(long jarg1, SBData jarg1_, long jarg2, SBError jarg2_, java.math.BigInteger jarg3); - public final static native long SBData_GetSignedInt64(long jarg1, SBData jarg1_, long jarg2, SBError jarg2_, java.math.BigInteger jarg3); - public final static native String SBData_GetString(long jarg1, SBData jarg1_, long jarg2, SBError jarg2_, java.math.BigInteger jarg3); - public final static native long SBData_ReadRawData(long jarg1, SBData jarg1_, long jarg2, SBError jarg2_, java.math.BigInteger jarg3, long jarg4, long jarg5); - public final static native boolean SBData_GetDescription__SWIG_0(long jarg1, SBData jarg1_, long jarg2, SBStream jarg2_, java.math.BigInteger jarg3); - public final static native boolean SBData_GetDescription__SWIG_1(long jarg1, SBData jarg1_, long jarg2, SBStream jarg2_); - public final static native void SBData_SetData(long jarg1, SBData jarg1_, long jarg2, SBError jarg2_, long jarg3, long jarg4, int jarg5, short jarg6); - public final static native void SBData_SetDataWithOwnership(long jarg1, SBData jarg1_, long jarg2, SBError jarg2_, long jarg3, long jarg4, int jarg5, short jarg6); - public final static native boolean SBData_Append(long jarg1, SBData jarg1_, long jarg2, SBData jarg2_); - public final static native long SBData_CreateDataFromCString(int jarg1, long jarg2, String jarg3); - public final static native long SBData_CreateDataFromUInt64Array(int jarg1, long jarg2, long jarg3, long jarg4); - public final static native long SBData_CreateDataFromUInt32Array(int jarg1, long jarg2, long jarg3, long jarg4); - public final static native long SBData_CreateDataFromSInt64Array(int jarg1, long jarg2, long jarg3, long jarg4); - public final static native long SBData_CreateDataFromSInt32Array(int jarg1, long jarg2, long jarg3, long jarg4); - public final static native long SBData_CreateDataFromDoubleArray(int jarg1, long jarg2, long jarg3, long jarg4); - public final static native boolean SBData_SetDataFromCString(long jarg1, SBData jarg1_, String jarg2); - public final static native boolean SBData_SetDataFromUInt64Array(long jarg1, SBData jarg1_, long jarg2, long jarg3); - public final static native boolean SBData_SetDataFromUInt32Array(long jarg1, SBData jarg1_, long jarg2, long jarg3); - public final static native boolean SBData_SetDataFromSInt64Array(long jarg1, SBData jarg1_, long jarg2, long jarg3); - public final static native boolean SBData_SetDataFromSInt32Array(long jarg1, SBData jarg1_, long jarg2, long jarg3); - public final static native boolean SBData_SetDataFromDoubleArray(long jarg1, SBData jarg1_, long jarg2, long jarg3); - public final static native String SBData___repr__(long jarg1, SBData jarg1_); - public final static native int SBDebugger_eBroadcastBitProgress_get(); - public final static native int SBDebugger_eBroadcastBitWarning_get(); - public final static native int SBDebugger_eBroadcastBitError_get(); - public final static native long new_SBDebugger__SWIG_0(); - public final static native long new_SBDebugger__SWIG_1(long jarg1, SBDebugger jarg1_); - public final static native void delete_SBDebugger(long jarg1); - public final static native String SBDebugger_GetBroadcasterClass(); - public final static native long SBDebugger_GetBroadcaster(long jarg1, SBDebugger jarg1_); - public final static native String SBDebugger_GetProgressFromEvent(long jarg1, SBEvent jarg1_, java.math.BigInteger[] jarg2, java.math.BigInteger[] jarg3, java.math.BigInteger[] jarg4, boolean[] jarg5); - public final static native long SBDebugger_GetProgressDataFromEvent(long jarg1, SBEvent jarg1_); - public final static native long SBDebugger_GetDiagnosticFromEvent(long jarg1, SBEvent jarg1_); - public final static native void SBDebugger_Initialize(); - public final static native long SBDebugger_InitializeWithErrorHandling(); - public final static native void SBDebugger_PrintStackTraceOnError(); - public final static native void SBDebugger_PrintDiagnosticsOnError(); - public final static native void SBDebugger_Terminate(); - public final static native long SBDebugger_Create__SWIG_0(); - public final static native long SBDebugger_Create__SWIG_1(boolean jarg1); - public final static native long SBDebugger_Create__SWIG_2(boolean jarg1, long jarg2, long jarg3); - public final static native void SBDebugger_Destroy(long jarg1, SBDebugger jarg1_); - public final static native void SBDebugger_MemoryPressureDetected(); - public final static native boolean SBDebugger_IsValid(long jarg1, SBDebugger jarg1_); - public final static native void SBDebugger_Clear(long jarg1, SBDebugger jarg1_); - public final static native long SBDebugger_GetSetting__SWIG_0(long jarg1, SBDebugger jarg1_, String jarg2); - public final static native long SBDebugger_GetSetting__SWIG_1(long jarg1, SBDebugger jarg1_); - public final static native void SBDebugger_SetAsync(long jarg1, SBDebugger jarg1_, boolean jarg2); - public final static native boolean SBDebugger_GetAsync(long jarg1, SBDebugger jarg1_); - public final static native void SBDebugger_SkipLLDBInitFiles(long jarg1, SBDebugger jarg1_, boolean jarg2); - public final static native void SBDebugger_SkipAppInitFiles(long jarg1, SBDebugger jarg1_, boolean jarg2); - public final static native long SBDebugger_SetInputString(long jarg1, SBDebugger jarg1_, String jarg2); - public final static native long SBDebugger_SetInputFile__SWIG_0(long jarg1, SBDebugger jarg1_, long jarg2, SBFile jarg2_); - public final static native long SBDebugger_SetOutputFile__SWIG_0(long jarg1, SBDebugger jarg1_, long jarg2, SBFile jarg2_); - public final static native long SBDebugger_SetErrorFile__SWIG_0(long jarg1, SBDebugger jarg1_, long jarg2, SBFile jarg2_); - public final static native long SBDebugger_SetInputFile__SWIG_1(long jarg1, SBDebugger jarg1_, long jarg2); - public final static native long SBDebugger_SetOutputFile__SWIG_1(long jarg1, SBDebugger jarg1_, long jarg2); - public final static native long SBDebugger_SetErrorFile__SWIG_1(long jarg1, SBDebugger jarg1_, long jarg2); - public final static native long SBDebugger_GetInputFile(long jarg1, SBDebugger jarg1_); - public final static native long SBDebugger_GetOutputFile(long jarg1, SBDebugger jarg1_); - public final static native long SBDebugger_GetErrorFile(long jarg1, SBDebugger jarg1_); - public final static native void SBDebugger_SaveInputTerminalState(long jarg1, SBDebugger jarg1_); - public final static native void SBDebugger_RestoreInputTerminalState(long jarg1, SBDebugger jarg1_); - public final static native long SBDebugger_GetCommandInterpreter(long jarg1, SBDebugger jarg1_); - public final static native void SBDebugger_HandleCommand(long jarg1, SBDebugger jarg1_, String jarg2); - public final static native void SBDebugger_RequestInterrupt(long jarg1, SBDebugger jarg1_); - public final static native void SBDebugger_CancelInterruptRequest(long jarg1, SBDebugger jarg1_); - public final static native boolean SBDebugger_InterruptRequested(long jarg1, SBDebugger jarg1_); - public final static native long SBDebugger_GetListener(long jarg1, SBDebugger jarg1_); - public final static native void SBDebugger_HandleProcessEvent__SWIG_0(long jarg1, SBDebugger jarg1_, long jarg2, SBProcess jarg2_, long jarg3, SBEvent jarg3_, long jarg4, SBFile jarg4_, long jarg5, SBFile jarg5_); - public final static native void SBDebugger_HandleProcessEvent__SWIG_1(long jarg1, SBDebugger jarg1_, long jarg2, SBProcess jarg2_, long jarg3, SBEvent jarg3_, long jarg4, long jarg5); - public final static native long SBDebugger_CreateTarget__SWIG_0(long jarg1, SBDebugger jarg1_, String jarg2, String jarg3, String jarg4, boolean jarg5, long jarg6, SBError jarg6_); - public final static native long SBDebugger_CreateTargetWithFileAndTargetTriple(long jarg1, SBDebugger jarg1_, String jarg2, String jarg3); - public final static native long SBDebugger_CreateTargetWithFileAndArch(long jarg1, SBDebugger jarg1_, String jarg2, String jarg3); - public final static native long SBDebugger_CreateTarget__SWIG_1(long jarg1, SBDebugger jarg1_, String jarg2); - public final static native long SBDebugger_GetDummyTarget(long jarg1, SBDebugger jarg1_); - public final static native boolean SBDebugger_DeleteTarget(long jarg1, SBDebugger jarg1_, long jarg2, SBTarget jarg2_); - public final static native long SBDebugger_GetTargetAtIndex(long jarg1, SBDebugger jarg1_, long jarg2); - public final static native long SBDebugger_GetIndexOfTarget(long jarg1, SBDebugger jarg1_, long jarg2, SBTarget jarg2_); - public final static native long SBDebugger_FindTargetWithProcessID(long jarg1, SBDebugger jarg1_, java.math.BigInteger jarg2); - public final static native long SBDebugger_FindTargetWithFileAndArch(long jarg1, SBDebugger jarg1_, String jarg2, String jarg3); - public final static native long SBDebugger_GetNumTargets(long jarg1, SBDebugger jarg1_); - public final static native long SBDebugger_GetSelectedTarget(long jarg1, SBDebugger jarg1_); - public final static native void SBDebugger_SetSelectedTarget(long jarg1, SBDebugger jarg1_, long jarg2, SBTarget jarg2_); - public final static native long SBDebugger_GetSelectedPlatform(long jarg1, SBDebugger jarg1_); - public final static native void SBDebugger_SetSelectedPlatform(long jarg1, SBDebugger jarg1_, long jarg2, SBPlatform jarg2_); - public final static native long SBDebugger_GetNumPlatforms(long jarg1, SBDebugger jarg1_); - public final static native long SBDebugger_GetPlatformAtIndex(long jarg1, SBDebugger jarg1_, long jarg2); - public final static native long SBDebugger_GetNumAvailablePlatforms(long jarg1, SBDebugger jarg1_); - public final static native long SBDebugger_GetAvailablePlatformInfoAtIndex(long jarg1, SBDebugger jarg1_, long jarg2); - public final static native long SBDebugger_GetSourceManager(long jarg1, SBDebugger jarg1_); - public final static native long SBDebugger_SetCurrentPlatform(long jarg1, SBDebugger jarg1_, String jarg2); - public final static native boolean SBDebugger_SetCurrentPlatformSDKRoot(long jarg1, SBDebugger jarg1_, String jarg2); - public final static native boolean SBDebugger_SetUseExternalEditor(long jarg1, SBDebugger jarg1_, boolean jarg2); - public final static native boolean SBDebugger_GetUseExternalEditor(long jarg1, SBDebugger jarg1_); - public final static native boolean SBDebugger_SetUseColor(long jarg1, SBDebugger jarg1_, boolean jarg2); - public final static native boolean SBDebugger_GetUseColor(long jarg1, SBDebugger jarg1_); - public final static native boolean SBDebugger_SetUseSourceCache(long jarg1, SBDebugger jarg1_, boolean jarg2); - public final static native boolean SBDebugger_GetUseSourceCache(long jarg1, SBDebugger jarg1_); - public final static native boolean SBDebugger_GetDefaultArchitecture(String jarg1, long jarg2); - public final static native boolean SBDebugger_SetDefaultArchitecture(String jarg1); - public final static native int SBDebugger_GetScriptingLanguage(long jarg1, SBDebugger jarg1_, String jarg2); - public final static native long SBDebugger_GetScriptInterpreterInfo(long jarg1, SBDebugger jarg1_, int jarg2); - public final static native String SBDebugger_GetVersionString(); - public final static native String SBDebugger_StateAsCString(int jarg1); - public final static native long SBDebugger_GetBuildConfiguration(); - public final static native boolean SBDebugger_StateIsRunningState(int jarg1); - public final static native boolean SBDebugger_StateIsStoppedState(int jarg1); - public final static native boolean SBDebugger_EnableLog(long jarg1, SBDebugger jarg1_, String jarg2, String[] jarg3); - public final static native void SBDebugger_SetLoggingCallback(long jarg1, SBDebugger jarg1_, long jarg2, long jarg3); - public final static native void SBDebugger_SetDestroyCallback(long jarg1, SBDebugger jarg1_, long jarg2, long jarg3); - public final static native void SBDebugger_DispatchInput(long jarg1, SBDebugger jarg1_, long jarg2, long jarg3); - public final static native void SBDebugger_DispatchInputInterrupt(long jarg1, SBDebugger jarg1_); - public final static native void SBDebugger_DispatchInputEndOfFile(long jarg1, SBDebugger jarg1_); - public final static native String SBDebugger_GetInstanceName(long jarg1, SBDebugger jarg1_); - public final static native long SBDebugger_FindDebuggerWithID(int jarg1); - public final static native long SBDebugger_SetInternalVariable(String jarg1, String jarg2, String jarg3); - public final static native long SBDebugger_GetInternalVariableValue(String jarg1, String jarg2); - public final static native boolean SBDebugger_GetDescription(long jarg1, SBDebugger jarg1_, long jarg2, SBStream jarg2_); - public final static native long SBDebugger_GetTerminalWidth(long jarg1, SBDebugger jarg1_); - public final static native void SBDebugger_SetTerminalWidth(long jarg1, SBDebugger jarg1_, long jarg2); - public final static native java.math.BigInteger SBDebugger_GetID(long jarg1, SBDebugger jarg1_); - public final static native String SBDebugger_GetPrompt(long jarg1, SBDebugger jarg1_); - public final static native void SBDebugger_SetPrompt(long jarg1, SBDebugger jarg1_, String jarg2); - public final static native String SBDebugger_GetReproducerPath(long jarg1, SBDebugger jarg1_); - public final static native int SBDebugger_GetScriptLanguage(long jarg1, SBDebugger jarg1_); - public final static native void SBDebugger_SetScriptLanguage(long jarg1, SBDebugger jarg1_, int jarg2); - public final static native int SBDebugger_GetREPLLanguage(long jarg1, SBDebugger jarg1_); - public final static native void SBDebugger_SetREPLLanguage(long jarg1, SBDebugger jarg1_, int jarg2); - public final static native boolean SBDebugger_GetCloseInputOnEOF(long jarg1, SBDebugger jarg1_); - public final static native void SBDebugger_SetCloseInputOnEOF(long jarg1, SBDebugger jarg1_, boolean jarg2); - public final static native long SBDebugger_GetCategory__SWIG_0(long jarg1, SBDebugger jarg1_, String jarg2); - public final static native long SBDebugger_GetCategory__SWIG_1(long jarg1, SBDebugger jarg1_, int jarg2); - public final static native long SBDebugger_CreateCategory(long jarg1, SBDebugger jarg1_, String jarg2); - public final static native boolean SBDebugger_DeleteCategory(long jarg1, SBDebugger jarg1_, String jarg2); - public final static native long SBDebugger_GetNumCategories(long jarg1, SBDebugger jarg1_); - public final static native long SBDebugger_GetCategoryAtIndex(long jarg1, SBDebugger jarg1_, long jarg2); - public final static native long SBDebugger_GetDefaultCategory(long jarg1, SBDebugger jarg1_); - public final static native long SBDebugger_GetFormatForType(long jarg1, SBDebugger jarg1_, long jarg2, SBTypeNameSpecifier jarg2_); - public final static native long SBDebugger_GetSummaryForType(long jarg1, SBDebugger jarg1_, long jarg2, SBTypeNameSpecifier jarg2_); - public final static native long SBDebugger_GetFilterForType(long jarg1, SBDebugger jarg1_, long jarg2, SBTypeNameSpecifier jarg2_); - public final static native long SBDebugger_GetSyntheticForType(long jarg1, SBDebugger jarg1_, long jarg2, SBTypeNameSpecifier jarg2_); - public final static native void SBDebugger_RunCommandInterpreter(long jarg1, SBDebugger jarg1_, boolean jarg2, boolean jarg3, long jarg4, SBCommandInterpreterRunOptions jarg4_, int[] jarg5, boolean[] jarg6, boolean[] jarg7); - public final static native long SBDebugger_RunREPL(long jarg1, SBDebugger jarg1_, int jarg2, String jarg3); - public final static native long SBDebugger_LoadTraceFromFile(long jarg1, SBDebugger jarg1_, long jarg2, SBError jarg2_, long jarg3, SBFileSpec jarg3_); - public final static native String SBDebugger___repr__(long jarg1, SBDebugger jarg1_); - public final static native long SBDebugger_GetInputFileHandle(long jarg1, SBDebugger jarg1_); - public final static native long SBDebugger_GetOutputFileHandle(long jarg1, SBDebugger jarg1_); - public final static native long SBDebugger_GetErrorFileHandle(long jarg1, SBDebugger jarg1_); - public final static native long new_SBDeclaration__SWIG_0(); - public final static native long new_SBDeclaration__SWIG_1(long jarg1, SBDeclaration jarg1_); - public final static native void delete_SBDeclaration(long jarg1); - public final static native boolean SBDeclaration_IsValid(long jarg1, SBDeclaration jarg1_); - public final static native long SBDeclaration_GetFileSpec(long jarg1, SBDeclaration jarg1_); - public final static native long SBDeclaration_GetLine(long jarg1, SBDeclaration jarg1_); - public final static native long SBDeclaration_GetColumn(long jarg1, SBDeclaration jarg1_); - public final static native void SBDeclaration_SetFileSpec(long jarg1, SBDeclaration jarg1_, long jarg2, SBFileSpec jarg2_); - public final static native void SBDeclaration_SetLine(long jarg1, SBDeclaration jarg1_, long jarg2); - public final static native void SBDeclaration_SetColumn(long jarg1, SBDeclaration jarg1_, long jarg2); - public final static native boolean SBDeclaration_GetDescription(long jarg1, SBDeclaration jarg1_, long jarg2, SBStream jarg2_); - public final static native String SBDeclaration___repr__(long jarg1, SBDeclaration jarg1_); - public final static native long new_SBError__SWIG_0(); - public final static native long new_SBError__SWIG_1(long jarg1, SBError jarg1_); - public final static native long new_SBError__SWIG_2(String jarg1); - public final static native void delete_SBError(long jarg1); - public final static native String SBError_GetCString(long jarg1, SBError jarg1_); - public final static native void SBError_Clear(long jarg1, SBError jarg1_); - public final static native boolean SBError_Fail(long jarg1, SBError jarg1_); - public final static native boolean SBError_Success(long jarg1, SBError jarg1_); - public final static native long SBError_GetError(long jarg1, SBError jarg1_); - public final static native int SBError_GetType(long jarg1, SBError jarg1_); - public final static native void SBError_SetError(long jarg1, SBError jarg1_, long jarg2, int jarg3); - public final static native void SBError_SetErrorToErrno(long jarg1, SBError jarg1_); - public final static native void SBError_SetErrorToGenericError(long jarg1, SBError jarg1_); - public final static native void SBError_SetErrorString(long jarg1, SBError jarg1_, String jarg2); - public final static native int SBError_SetErrorStringWithFormat__SWIG_0(long jarg1, SBError jarg1_, String jarg2, String jarg3, String jarg4, String jarg5); - public final static native int SBError_SetErrorStringWithFormat__SWIG_1(long jarg1, SBError jarg1_, String jarg2, String jarg3, String jarg4); - public final static native int SBError_SetErrorStringWithFormat__SWIG_2(long jarg1, SBError jarg1_, String jarg2, String jarg3); - public final static native int SBError_SetErrorStringWithFormat__SWIG_3(long jarg1, SBError jarg1_, String jarg2); - public final static native boolean SBError_IsValid(long jarg1, SBError jarg1_); - public final static native boolean SBError_GetDescription(long jarg1, SBError jarg1_, long jarg2, SBStream jarg2_); - public final static native String SBError___repr__(long jarg1, SBError jarg1_); - public final static native long new_SBEnvironment__SWIG_0(); - public final static native long new_SBEnvironment__SWIG_1(long jarg1, SBEnvironment jarg1_); - public final static native void delete_SBEnvironment(long jarg1); - public final static native String SBEnvironment_Get(long jarg1, SBEnvironment jarg1_, String jarg2); - public final static native long SBEnvironment_GetNumValues(long jarg1, SBEnvironment jarg1_); - public final static native String SBEnvironment_GetNameAtIndex(long jarg1, SBEnvironment jarg1_, long jarg2); - public final static native String SBEnvironment_GetValueAtIndex(long jarg1, SBEnvironment jarg1_, long jarg2); - public final static native long SBEnvironment_GetEntries(long jarg1, SBEnvironment jarg1_); - public final static native void SBEnvironment_PutEntry(long jarg1, SBEnvironment jarg1_, String jarg2); - public final static native void SBEnvironment_SetEntries(long jarg1, SBEnvironment jarg1_, long jarg2, SBStringList jarg2_, boolean jarg3); - public final static native boolean SBEnvironment_Set(long jarg1, SBEnvironment jarg1_, String jarg2, String jarg3, boolean jarg4); - public final static native boolean SBEnvironment_Unset(long jarg1, SBEnvironment jarg1_, String jarg2); - public final static native void SBEnvironment_Clear(long jarg1, SBEnvironment jarg1_); - public final static native long new_SBEvent__SWIG_0(); - public final static native long new_SBEvent__SWIG_1(long jarg1, SBEvent jarg1_); - public final static native long new_SBEvent__SWIG_2(long jarg1, String jarg2, long jarg3); - public final static native void delete_SBEvent(long jarg1); - public final static native boolean SBEvent_IsValid(long jarg1, SBEvent jarg1_); - public final static native String SBEvent_GetDataFlavor(long jarg1, SBEvent jarg1_); - public final static native long SBEvent_GetType(long jarg1, SBEvent jarg1_); - public final static native long SBEvent_GetBroadcaster(long jarg1, SBEvent jarg1_); - public final static native String SBEvent_GetBroadcasterClass(long jarg1, SBEvent jarg1_); - public final static native boolean SBEvent_BroadcasterMatchesRef(long jarg1, SBEvent jarg1_, long jarg2, SBBroadcaster jarg2_); - public final static native void SBEvent_Clear(long jarg1, SBEvent jarg1_); - public final static native String SBEvent_GetCStringFromEvent(long jarg1, SBEvent jarg1_); - public final static native boolean SBEvent_GetDescription__SWIG_0(long jarg1, SBEvent jarg1_, long jarg2, SBStream jarg2_); - public final static native long new_SBExecutionContext__SWIG_0(); - public final static native long new_SBExecutionContext__SWIG_1(long jarg1, SBExecutionContext jarg1_); - public final static native long new_SBExecutionContext__SWIG_2(long jarg1, SBTarget jarg1_); - public final static native long new_SBExecutionContext__SWIG_3(long jarg1, SBProcess jarg1_); - public final static native long new_SBExecutionContext__SWIG_4(long jarg1, SBThread jarg1_); - public final static native long new_SBExecutionContext__SWIG_5(long jarg1, SBFrame jarg1_); - public final static native void delete_SBExecutionContext(long jarg1); - public final static native long SBExecutionContext_GetTarget(long jarg1, SBExecutionContext jarg1_); - public final static native long SBExecutionContext_GetProcess(long jarg1, SBExecutionContext jarg1_); - public final static native long SBExecutionContext_GetThread(long jarg1, SBExecutionContext jarg1_); - public final static native long SBExecutionContext_GetFrame(long jarg1, SBExecutionContext jarg1_); - public final static native long new_SBExpressionOptions__SWIG_0(); - public final static native long new_SBExpressionOptions__SWIG_1(long jarg1, SBExpressionOptions jarg1_); - public final static native void delete_SBExpressionOptions(long jarg1); - public final static native boolean SBExpressionOptions_GetCoerceResultToId(long jarg1, SBExpressionOptions jarg1_); - public final static native void SBExpressionOptions_SetCoerceResultToId__SWIG_0(long jarg1, SBExpressionOptions jarg1_, boolean jarg2); - public final static native void SBExpressionOptions_SetCoerceResultToId__SWIG_1(long jarg1, SBExpressionOptions jarg1_); - public final static native boolean SBExpressionOptions_GetUnwindOnError(long jarg1, SBExpressionOptions jarg1_); - public final static native void SBExpressionOptions_SetUnwindOnError__SWIG_0(long jarg1, SBExpressionOptions jarg1_, boolean jarg2); - public final static native void SBExpressionOptions_SetUnwindOnError__SWIG_1(long jarg1, SBExpressionOptions jarg1_); - public final static native boolean SBExpressionOptions_GetIgnoreBreakpoints(long jarg1, SBExpressionOptions jarg1_); - public final static native void SBExpressionOptions_SetIgnoreBreakpoints__SWIG_0(long jarg1, SBExpressionOptions jarg1_, boolean jarg2); - public final static native void SBExpressionOptions_SetIgnoreBreakpoints__SWIG_1(long jarg1, SBExpressionOptions jarg1_); - public final static native int SBExpressionOptions_GetFetchDynamicValue(long jarg1, SBExpressionOptions jarg1_); - public final static native void SBExpressionOptions_SetFetchDynamicValue__SWIG_0(long jarg1, SBExpressionOptions jarg1_, int jarg2); - public final static native void SBExpressionOptions_SetFetchDynamicValue__SWIG_1(long jarg1, SBExpressionOptions jarg1_); - public final static native long SBExpressionOptions_GetTimeoutInMicroSeconds(long jarg1, SBExpressionOptions jarg1_); - public final static native void SBExpressionOptions_SetTimeoutInMicroSeconds__SWIG_0(long jarg1, SBExpressionOptions jarg1_, long jarg2); - public final static native void SBExpressionOptions_SetTimeoutInMicroSeconds__SWIG_1(long jarg1, SBExpressionOptions jarg1_); - public final static native long SBExpressionOptions_GetOneThreadTimeoutInMicroSeconds(long jarg1, SBExpressionOptions jarg1_); - public final static native void SBExpressionOptions_SetOneThreadTimeoutInMicroSeconds__SWIG_0(long jarg1, SBExpressionOptions jarg1_, long jarg2); - public final static native void SBExpressionOptions_SetOneThreadTimeoutInMicroSeconds__SWIG_1(long jarg1, SBExpressionOptions jarg1_); - public final static native boolean SBExpressionOptions_GetTryAllThreads(long jarg1, SBExpressionOptions jarg1_); - public final static native void SBExpressionOptions_SetTryAllThreads__SWIG_0(long jarg1, SBExpressionOptions jarg1_, boolean jarg2); - public final static native void SBExpressionOptions_SetTryAllThreads__SWIG_1(long jarg1, SBExpressionOptions jarg1_); - public final static native boolean SBExpressionOptions_GetStopOthers(long jarg1, SBExpressionOptions jarg1_); - public final static native void SBExpressionOptions_SetStopOthers__SWIG_0(long jarg1, SBExpressionOptions jarg1_, boolean jarg2); - public final static native void SBExpressionOptions_SetStopOthers__SWIG_1(long jarg1, SBExpressionOptions jarg1_); - public final static native boolean SBExpressionOptions_GetTrapExceptions(long jarg1, SBExpressionOptions jarg1_); - public final static native void SBExpressionOptions_SetTrapExceptions__SWIG_0(long jarg1, SBExpressionOptions jarg1_, boolean jarg2); - public final static native void SBExpressionOptions_SetTrapExceptions__SWIG_1(long jarg1, SBExpressionOptions jarg1_); - public final static native void SBExpressionOptions_SetLanguage(long jarg1, SBExpressionOptions jarg1_, int jarg2); - public final static native boolean SBExpressionOptions_GetGenerateDebugInfo(long jarg1, SBExpressionOptions jarg1_); - public final static native void SBExpressionOptions_SetGenerateDebugInfo__SWIG_0(long jarg1, SBExpressionOptions jarg1_, boolean jarg2); - public final static native void SBExpressionOptions_SetGenerateDebugInfo__SWIG_1(long jarg1, SBExpressionOptions jarg1_); - public final static native boolean SBExpressionOptions_GetSuppressPersistentResult(long jarg1, SBExpressionOptions jarg1_); - public final static native void SBExpressionOptions_SetSuppressPersistentResult__SWIG_0(long jarg1, SBExpressionOptions jarg1_, boolean jarg2); - public final static native void SBExpressionOptions_SetSuppressPersistentResult__SWIG_1(long jarg1, SBExpressionOptions jarg1_); - public final static native String SBExpressionOptions_GetPrefix(long jarg1, SBExpressionOptions jarg1_); - public final static native void SBExpressionOptions_SetPrefix(long jarg1, SBExpressionOptions jarg1_, String jarg2); - public final static native void SBExpressionOptions_SetAutoApplyFixIts__SWIG_0(long jarg1, SBExpressionOptions jarg1_, boolean jarg2); - public final static native void SBExpressionOptions_SetAutoApplyFixIts__SWIG_1(long jarg1, SBExpressionOptions jarg1_); - public final static native boolean SBExpressionOptions_GetAutoApplyFixIts(long jarg1, SBExpressionOptions jarg1_); - public final static native void SBExpressionOptions_SetRetriesWithFixIts(long jarg1, SBExpressionOptions jarg1_, java.math.BigInteger jarg2); - public final static native java.math.BigInteger SBExpressionOptions_GetRetriesWithFixIts(long jarg1, SBExpressionOptions jarg1_); - public final static native boolean SBExpressionOptions_GetTopLevel(long jarg1, SBExpressionOptions jarg1_); - public final static native void SBExpressionOptions_SetTopLevel__SWIG_0(long jarg1, SBExpressionOptions jarg1_, boolean jarg2); - public final static native void SBExpressionOptions_SetTopLevel__SWIG_1(long jarg1, SBExpressionOptions jarg1_); - public final static native boolean SBExpressionOptions_GetAllowJIT(long jarg1, SBExpressionOptions jarg1_); - public final static native void SBExpressionOptions_SetAllowJIT(long jarg1, SBExpressionOptions jarg1_, boolean jarg2); - public final static native long new_SBFile__SWIG_0(); - public final static native long new_SBFile__SWIG_1(long jarg1); - public final static native long new_SBFile__SWIG_2(int jarg1, String jarg2, boolean jarg3); - public final static native void delete_SBFile(long jarg1); - public final static native long SBFile_Read(long jarg1, SBFile jarg1_, long jarg2, long jarg3, long jarg4); - public final static native long SBFile_Write(long jarg1, SBFile jarg1_, long jarg2, long jarg3, long jarg4); - public final static native long SBFile_Flush(long jarg1, SBFile jarg1_); - public final static native boolean SBFile_IsValid(long jarg1, SBFile jarg1_); - public final static native long SBFile_Close(long jarg1, SBFile jarg1_); - public final static native long SBFile_GetFile(long jarg1, SBFile jarg1_); - public final static native long SBFile_MakeBorrowed(long jarg1); - public final static native long SBFile_MakeForcingIOMethods(long jarg1); - public final static native long SBFile_MakeBorrowedForcingIOMethods(long jarg1); - public final static native long new_SBFileSpec__SWIG_0(); - public final static native long new_SBFileSpec__SWIG_1(long jarg1, SBFileSpec jarg1_); - public final static native long new_SBFileSpec__SWIG_2(String jarg1); - public final static native long new_SBFileSpec__SWIG_3(String jarg1, boolean jarg2); - public final static native void delete_SBFileSpec(long jarg1); - public final static native boolean SBFileSpec_IsValid(long jarg1, SBFileSpec jarg1_); - public final static native boolean SBFileSpec_Exists(long jarg1, SBFileSpec jarg1_); - public final static native boolean SBFileSpec_ResolveExecutableLocation(long jarg1, SBFileSpec jarg1_); - public final static native String SBFileSpec_GetFilename(long jarg1, SBFileSpec jarg1_); - public final static native String SBFileSpec_GetDirectory(long jarg1, SBFileSpec jarg1_); - public final static native void SBFileSpec_SetFilename(long jarg1, SBFileSpec jarg1_, String jarg2); - public final static native void SBFileSpec_SetDirectory(long jarg1, SBFileSpec jarg1_, String jarg2); - public final static native long SBFileSpec_GetPath(long jarg1, SBFileSpec jarg1_, String jarg2, long jarg3); - public final static native int SBFileSpec_ResolvePath(String jarg1, String jarg2, long jarg3); - public final static native boolean SBFileSpec_GetDescription(long jarg1, SBFileSpec jarg1_, long jarg2, SBStream jarg2_); - public final static native void SBFileSpec_AppendPathComponent(long jarg1, SBFileSpec jarg1_, String jarg2); - public final static native String SBFileSpec___repr__(long jarg1, SBFileSpec jarg1_); - public final static native long new_SBFileSpecList__SWIG_0(); - public final static native long new_SBFileSpecList__SWIG_1(long jarg1, SBFileSpecList jarg1_); - public final static native void delete_SBFileSpecList(long jarg1); - public final static native long SBFileSpecList_GetSize(long jarg1, SBFileSpecList jarg1_); - public final static native boolean SBFileSpecList_GetDescription(long jarg1, SBFileSpecList jarg1_, long jarg2, SBStream jarg2_); - public final static native void SBFileSpecList_Append(long jarg1, SBFileSpecList jarg1_, long jarg2, SBFileSpec jarg2_); - public final static native boolean SBFileSpecList_AppendIfUnique(long jarg1, SBFileSpecList jarg1_, long jarg2, SBFileSpec jarg2_); - public final static native void SBFileSpecList_Clear(long jarg1, SBFileSpecList jarg1_); - public final static native long SBFileSpecList_FindFileIndex(long jarg1, SBFileSpecList jarg1_, long jarg2, long jarg3, SBFileSpec jarg3_, boolean jarg4); - public final static native long SBFileSpecList_GetFileSpecAtIndex(long jarg1, SBFileSpecList jarg1_, long jarg2); - public final static native long new_SBFrame__SWIG_0(); - public final static native long new_SBFrame__SWIG_1(long jarg1, SBFrame jarg1_); - public final static native void delete_SBFrame(long jarg1); - public final static native boolean SBFrame_IsEqual(long jarg1, SBFrame jarg1_, long jarg2, SBFrame jarg2_); - public final static native boolean SBFrame_IsValid(long jarg1, SBFrame jarg1_); - public final static native long SBFrame_GetFrameID(long jarg1, SBFrame jarg1_); - public final static native java.math.BigInteger SBFrame_GetCFA(long jarg1, SBFrame jarg1_); - public final static native java.math.BigInteger SBFrame_GetPC(long jarg1, SBFrame jarg1_); - public final static native boolean SBFrame_SetPC(long jarg1, SBFrame jarg1_, java.math.BigInteger jarg2); - public final static native java.math.BigInteger SBFrame_GetSP(long jarg1, SBFrame jarg1_); - public final static native java.math.BigInteger SBFrame_GetFP(long jarg1, SBFrame jarg1_); - public final static native long SBFrame_GetPCAddress(long jarg1, SBFrame jarg1_); - public final static native long SBFrame_GetSymbolContext(long jarg1, SBFrame jarg1_, long jarg2); - public final static native long SBFrame_GetModule(long jarg1, SBFrame jarg1_); - public final static native long SBFrame_GetCompileUnit(long jarg1, SBFrame jarg1_); - public final static native long SBFrame_GetFunction(long jarg1, SBFrame jarg1_); - public final static native long SBFrame_GetSymbol(long jarg1, SBFrame jarg1_); - public final static native long SBFrame_GetBlock(long jarg1, SBFrame jarg1_); - public final static native String SBFrame_GetFunctionName__SWIG_0(long jarg1, SBFrame jarg1_); - public final static native String SBFrame_GetDisplayFunctionName(long jarg1, SBFrame jarg1_); - public final static native int SBFrame_GuessLanguage(long jarg1, SBFrame jarg1_); - public final static native boolean SBFrame_IsInlined__SWIG_0(long jarg1, SBFrame jarg1_); - public final static native boolean SBFrame_IsArtificial__SWIG_0(long jarg1, SBFrame jarg1_); - public final static native long SBFrame_EvaluateExpression__SWIG_0(long jarg1, SBFrame jarg1_, String jarg2); - public final static native long SBFrame_EvaluateExpression__SWIG_1(long jarg1, SBFrame jarg1_, String jarg2, int jarg3); - public final static native long SBFrame_EvaluateExpression__SWIG_2(long jarg1, SBFrame jarg1_, String jarg2, int jarg3, boolean jarg4); - public final static native long SBFrame_EvaluateExpression__SWIG_3(long jarg1, SBFrame jarg1_, String jarg2, long jarg3, SBExpressionOptions jarg3_); - public final static native long SBFrame_GetFrameBlock(long jarg1, SBFrame jarg1_); - public final static native long SBFrame_GetLineEntry(long jarg1, SBFrame jarg1_); - public final static native long SBFrame_GetThread(long jarg1, SBFrame jarg1_); - public final static native String SBFrame_Disassemble(long jarg1, SBFrame jarg1_); - public final static native void SBFrame_Clear(long jarg1, SBFrame jarg1_); - public final static native long SBFrame_GetVariables__SWIG_0(long jarg1, SBFrame jarg1_, boolean jarg2, boolean jarg3, boolean jarg4, boolean jarg5); - public final static native long SBFrame_GetVariables__SWIG_1(long jarg1, SBFrame jarg1_, boolean jarg2, boolean jarg3, boolean jarg4, boolean jarg5, int jarg6); - public final static native long SBFrame_GetVariables__SWIG_2(long jarg1, SBFrame jarg1_, long jarg2, SBVariablesOptions jarg2_); - public final static native long SBFrame_GetRegisters(long jarg1, SBFrame jarg1_); - public final static native long SBFrame_FindRegister(long jarg1, SBFrame jarg1_, String jarg2); - public final static native long SBFrame_FindVariable__SWIG_0(long jarg1, SBFrame jarg1_, String jarg2); - public final static native long SBFrame_FindVariable__SWIG_1(long jarg1, SBFrame jarg1_, String jarg2, int jarg3); - public final static native long SBFrame_GetValueForVariablePath__SWIG_0(long jarg1, SBFrame jarg1_, String jarg2, int jarg3); - public final static native long SBFrame_GetValueForVariablePath__SWIG_1(long jarg1, SBFrame jarg1_, String jarg2); - public final static native long SBFrame_FindValue__SWIG_0(long jarg1, SBFrame jarg1_, String jarg2, int jarg3); - public final static native long SBFrame_FindValue__SWIG_1(long jarg1, SBFrame jarg1_, String jarg2, int jarg3, int jarg4); - public final static native boolean SBFrame_GetDescription(long jarg1, SBFrame jarg1_, long jarg2, SBStream jarg2_); - public final static native String SBFrame___repr__(long jarg1, SBFrame jarg1_); - public final static native long new_SBFunction__SWIG_0(); - public final static native long new_SBFunction__SWIG_1(long jarg1, SBFunction jarg1_); - public final static native void delete_SBFunction(long jarg1); - public final static native boolean SBFunction_IsValid(long jarg1, SBFunction jarg1_); - public final static native String SBFunction_GetName(long jarg1, SBFunction jarg1_); - public final static native String SBFunction_GetDisplayName(long jarg1, SBFunction jarg1_); - public final static native String SBFunction_GetMangledName(long jarg1, SBFunction jarg1_); - public final static native long SBFunction_GetInstructions__SWIG_0(long jarg1, SBFunction jarg1_, long jarg2, SBTarget jarg2_); - public final static native long SBFunction_GetInstructions__SWIG_1(long jarg1, SBFunction jarg1_, long jarg2, SBTarget jarg2_, String jarg3); - public final static native long SBFunction_GetStartAddress(long jarg1, SBFunction jarg1_); - public final static native long SBFunction_GetEndAddress(long jarg1, SBFunction jarg1_); - public final static native String SBFunction_GetArgumentName(long jarg1, SBFunction jarg1_, long jarg2); - public final static native long SBFunction_GetPrologueByteSize(long jarg1, SBFunction jarg1_); - public final static native long SBFunction_GetType(long jarg1, SBFunction jarg1_); - public final static native long SBFunction_GetBlock(long jarg1, SBFunction jarg1_); - public final static native int SBFunction_GetLanguage(long jarg1, SBFunction jarg1_); - public final static native boolean SBFunction_GetIsOptimized(long jarg1, SBFunction jarg1_); - public final static native boolean SBFunction_GetDescription(long jarg1, SBFunction jarg1_, long jarg2, SBStream jarg2_); - public final static native String SBFunction___repr__(long jarg1, SBFunction jarg1_); - public final static native long SBHostOS_GetProgramFileSpec(); - public final static native long SBHostOS_GetLLDBPythonPath(); - public final static native long SBHostOS_GetLLDBPath(int jarg1); - public final static native long SBHostOS_GetUserHomeDirectory(); - public final static native void SBHostOS_ThreadCreated(String jarg1); - public final static native long SBHostOS_ThreadCreate(String jarg1, long jarg2, long jarg3, long jarg4, SBError jarg4_); - public final static native boolean SBHostOS_ThreadCancel(long jarg1, long jarg2, SBError jarg2_); - public final static native boolean SBHostOS_ThreadDetach(long jarg1, long jarg2, SBError jarg2_); - public final static native boolean SBHostOS_ThreadJoin(long jarg1, long jarg2, long jarg3, SBError jarg3_); - public final static native long new_SBHostOS(); - public final static native void delete_SBHostOS(long jarg1); - public final static native long new_SBInstruction__SWIG_0(); - public final static native long new_SBInstruction__SWIG_1(long jarg1, SBInstruction jarg1_); - public final static native void delete_SBInstruction(long jarg1); - public final static native boolean SBInstruction_IsValid(long jarg1, SBInstruction jarg1_); - public final static native long SBInstruction_GetAddress(long jarg1, SBInstruction jarg1_); - public final static native String SBInstruction_GetMnemonic(long jarg1, SBInstruction jarg1_, long jarg2, SBTarget jarg2_); - public final static native String SBInstruction_GetOperands(long jarg1, SBInstruction jarg1_, long jarg2, SBTarget jarg2_); - public final static native String SBInstruction_GetComment(long jarg1, SBInstruction jarg1_, long jarg2, SBTarget jarg2_); - public final static native int SBInstruction_GetControlFlowKind(long jarg1, SBInstruction jarg1_, long jarg2, SBTarget jarg2_); - public final static native long SBInstruction_GetData(long jarg1, SBInstruction jarg1_, long jarg2, SBTarget jarg2_); - public final static native long SBInstruction_GetByteSize(long jarg1, SBInstruction jarg1_); - public final static native boolean SBInstruction_DoesBranch(long jarg1, SBInstruction jarg1_); - public final static native boolean SBInstruction_HasDelaySlot(long jarg1, SBInstruction jarg1_); - public final static native boolean SBInstruction_CanSetBreakpoint(long jarg1, SBInstruction jarg1_); - public final static native void SBInstruction_Print__SWIG_0(long jarg1, SBInstruction jarg1_, long jarg2, SBFile jarg2_); - public final static native void SBInstruction_Print__SWIG_1(long jarg1, SBInstruction jarg1_, long jarg2); - public final static native boolean SBInstruction_GetDescription(long jarg1, SBInstruction jarg1_, long jarg2, SBStream jarg2_); - public final static native boolean SBInstruction_EmulateWithFrame(long jarg1, SBInstruction jarg1_, long jarg2, SBFrame jarg2_, long jarg3); - public final static native boolean SBInstruction_DumpEmulation(long jarg1, SBInstruction jarg1_, String jarg2); - public final static native boolean SBInstruction_TestEmulation(long jarg1, SBInstruction jarg1_, long jarg2, SBStream jarg2_, String jarg3); - public final static native String SBInstruction___repr__(long jarg1, SBInstruction jarg1_); - public final static native long new_SBInstructionList__SWIG_0(); - public final static native long new_SBInstructionList__SWIG_1(long jarg1, SBInstructionList jarg1_); - public final static native void delete_SBInstructionList(long jarg1); - public final static native boolean SBInstructionList_IsValid(long jarg1, SBInstructionList jarg1_); - public final static native long SBInstructionList_GetSize(long jarg1, SBInstructionList jarg1_); - public final static native long SBInstructionList_GetInstructionAtIndex(long jarg1, SBInstructionList jarg1_, long jarg2); - public final static native long SBInstructionList_GetInstructionsCount__SWIG_0(long jarg1, SBInstructionList jarg1_, long jarg2, SBAddress jarg2_, long jarg3, SBAddress jarg3_, boolean jarg4); - public final static native long SBInstructionList_GetInstructionsCount__SWIG_1(long jarg1, SBInstructionList jarg1_, long jarg2, SBAddress jarg2_, long jarg3, SBAddress jarg3_); - public final static native void SBInstructionList_Clear(long jarg1, SBInstructionList jarg1_); - public final static native void SBInstructionList_AppendInstruction(long jarg1, SBInstructionList jarg1_, long jarg2, SBInstruction jarg2_); - public final static native void SBInstructionList_Print__SWIG_0(long jarg1, SBInstructionList jarg1_, long jarg2, SBFile jarg2_); - public final static native void SBInstructionList_Print__SWIG_1(long jarg1, SBInstructionList jarg1_, long jarg2); - public final static native boolean SBInstructionList_GetDescription(long jarg1, SBInstructionList jarg1_, long jarg2, SBStream jarg2_); - public final static native boolean SBInstructionList_DumpEmulationForAllInstructions(long jarg1, SBInstructionList jarg1_, String jarg2); - public final static native String SBInstructionList___repr__(long jarg1, SBInstructionList jarg1_); - public final static native int SBLanguageRuntime_GetLanguageTypeFromString(String jarg1); - public final static native String SBLanguageRuntime_GetNameForLanguageType(int jarg1); - public final static native long new_SBLanguageRuntime(); - public final static native void delete_SBLanguageRuntime(long jarg1); - public final static native long new_SBLaunchInfo(String[] jarg1); - public final static native void delete_SBLaunchInfo(long jarg1); - public final static native java.math.BigInteger SBLaunchInfo_GetProcessID(long jarg1, SBLaunchInfo jarg1_); - public final static native long SBLaunchInfo_GetUserID(long jarg1, SBLaunchInfo jarg1_); - public final static native long SBLaunchInfo_GetGroupID(long jarg1, SBLaunchInfo jarg1_); - public final static native boolean SBLaunchInfo_UserIDIsValid(long jarg1, SBLaunchInfo jarg1_); - public final static native boolean SBLaunchInfo_GroupIDIsValid(long jarg1, SBLaunchInfo jarg1_); - public final static native void SBLaunchInfo_SetUserID(long jarg1, SBLaunchInfo jarg1_, long jarg2); - public final static native void SBLaunchInfo_SetGroupID(long jarg1, SBLaunchInfo jarg1_, long jarg2); - public final static native long SBLaunchInfo_GetExecutableFile(long jarg1, SBLaunchInfo jarg1_); - public final static native void SBLaunchInfo_SetExecutableFile(long jarg1, SBLaunchInfo jarg1_, long jarg2, SBFileSpec jarg2_, boolean jarg3); - public final static native long SBLaunchInfo_GetListener(long jarg1, SBLaunchInfo jarg1_); - public final static native void SBLaunchInfo_SetListener(long jarg1, SBLaunchInfo jarg1_, long jarg2, SBListener jarg2_); - public final static native long SBLaunchInfo_GetShadowListener(long jarg1, SBLaunchInfo jarg1_); - public final static native void SBLaunchInfo_SetShadowListener(long jarg1, SBLaunchInfo jarg1_, long jarg2, SBListener jarg2_); - public final static native long SBLaunchInfo_GetNumArguments(long jarg1, SBLaunchInfo jarg1_); - public final static native String SBLaunchInfo_GetArgumentAtIndex(long jarg1, SBLaunchInfo jarg1_, long jarg2); - public final static native void SBLaunchInfo_SetArguments(long jarg1, SBLaunchInfo jarg1_, String[] jarg2, boolean jarg3); - public final static native long SBLaunchInfo_GetNumEnvironmentEntries(long jarg1, SBLaunchInfo jarg1_); - public final static native String SBLaunchInfo_GetEnvironmentEntryAtIndex(long jarg1, SBLaunchInfo jarg1_, long jarg2); - public final static native void SBLaunchInfo_SetEnvironmentEntries(long jarg1, SBLaunchInfo jarg1_, String[] jarg2, boolean jarg3); - public final static native void SBLaunchInfo_SetEnvironment(long jarg1, SBLaunchInfo jarg1_, long jarg2, SBEnvironment jarg2_, boolean jarg3); - public final static native long SBLaunchInfo_GetEnvironment(long jarg1, SBLaunchInfo jarg1_); - public final static native void SBLaunchInfo_Clear(long jarg1, SBLaunchInfo jarg1_); - public final static native String SBLaunchInfo_GetWorkingDirectory(long jarg1, SBLaunchInfo jarg1_); - public final static native void SBLaunchInfo_SetWorkingDirectory(long jarg1, SBLaunchInfo jarg1_, String jarg2); - public final static native long SBLaunchInfo_GetLaunchFlags(long jarg1, SBLaunchInfo jarg1_); - public final static native void SBLaunchInfo_SetLaunchFlags(long jarg1, SBLaunchInfo jarg1_, long jarg2); - public final static native String SBLaunchInfo_GetProcessPluginName(long jarg1, SBLaunchInfo jarg1_); - public final static native void SBLaunchInfo_SetProcessPluginName(long jarg1, SBLaunchInfo jarg1_, String jarg2); - public final static native String SBLaunchInfo_GetShell(long jarg1, SBLaunchInfo jarg1_); - public final static native void SBLaunchInfo_SetShell(long jarg1, SBLaunchInfo jarg1_, String jarg2); - public final static native boolean SBLaunchInfo_GetShellExpandArguments(long jarg1, SBLaunchInfo jarg1_); - public final static native void SBLaunchInfo_SetShellExpandArguments(long jarg1, SBLaunchInfo jarg1_, boolean jarg2); - public final static native long SBLaunchInfo_GetResumeCount(long jarg1, SBLaunchInfo jarg1_); - public final static native void SBLaunchInfo_SetResumeCount(long jarg1, SBLaunchInfo jarg1_, long jarg2); - public final static native boolean SBLaunchInfo_AddCloseFileAction(long jarg1, SBLaunchInfo jarg1_, int jarg2); - public final static native boolean SBLaunchInfo_AddDuplicateFileAction(long jarg1, SBLaunchInfo jarg1_, int jarg2, int jarg3); - public final static native boolean SBLaunchInfo_AddOpenFileAction(long jarg1, SBLaunchInfo jarg1_, int jarg2, String jarg3, boolean jarg4, boolean jarg5); - public final static native boolean SBLaunchInfo_AddSuppressFileAction(long jarg1, SBLaunchInfo jarg1_, int jarg2, boolean jarg3, boolean jarg4); - public final static native void SBLaunchInfo_SetLaunchEventData(long jarg1, SBLaunchInfo jarg1_, String jarg2); - public final static native String SBLaunchInfo_GetLaunchEventData(long jarg1, SBLaunchInfo jarg1_); - public final static native boolean SBLaunchInfo_GetDetachOnError(long jarg1, SBLaunchInfo jarg1_); - public final static native void SBLaunchInfo_SetDetachOnError(long jarg1, SBLaunchInfo jarg1_, boolean jarg2); - public final static native String SBLaunchInfo_GetScriptedProcessClassName(long jarg1, SBLaunchInfo jarg1_); - public final static native void SBLaunchInfo_SetScriptedProcessClassName(long jarg1, SBLaunchInfo jarg1_, String jarg2); - public final static native long SBLaunchInfo_GetScriptedProcessDictionary(long jarg1, SBLaunchInfo jarg1_); - public final static native void SBLaunchInfo_SetScriptedProcessDictionary(long jarg1, SBLaunchInfo jarg1_, long jarg2, SBStructuredData jarg2_); - public final static native long new_SBLineEntry__SWIG_0(); - public final static native long new_SBLineEntry__SWIG_1(long jarg1, SBLineEntry jarg1_); - public final static native void delete_SBLineEntry(long jarg1); - public final static native long SBLineEntry_GetStartAddress(long jarg1, SBLineEntry jarg1_); - public final static native long SBLineEntry_GetEndAddress(long jarg1, SBLineEntry jarg1_); - public final static native boolean SBLineEntry_IsValid(long jarg1, SBLineEntry jarg1_); - public final static native long SBLineEntry_GetFileSpec(long jarg1, SBLineEntry jarg1_); - public final static native long SBLineEntry_GetLine(long jarg1, SBLineEntry jarg1_); - public final static native long SBLineEntry_GetColumn(long jarg1, SBLineEntry jarg1_); - public final static native void SBLineEntry_SetFileSpec(long jarg1, SBLineEntry jarg1_, long jarg2, SBFileSpec jarg2_); - public final static native void SBLineEntry_SetLine(long jarg1, SBLineEntry jarg1_, long jarg2); - public final static native void SBLineEntry_SetColumn(long jarg1, SBLineEntry jarg1_, long jarg2); - public final static native boolean SBLineEntry_GetDescription(long jarg1, SBLineEntry jarg1_, long jarg2, SBStream jarg2_); - public final static native String SBLineEntry___repr__(long jarg1, SBLineEntry jarg1_); - public final static native long new_SBListener__SWIG_0(); - public final static native long new_SBListener__SWIG_1(String jarg1); - public final static native long new_SBListener__SWIG_2(long jarg1, SBListener jarg1_); - public final static native void delete_SBListener(long jarg1); - public final static native void SBListener_AddEvent(long jarg1, SBListener jarg1_, long jarg2, SBEvent jarg2_); - public final static native void SBListener_Clear(long jarg1, SBListener jarg1_); - public final static native boolean SBListener_IsValid(long jarg1, SBListener jarg1_); - public final static native long SBListener_StartListeningForEventClass(long jarg1, SBListener jarg1_, long jarg2, SBDebugger jarg2_, String jarg3, long jarg4); - public final static native boolean SBListener_StopListeningForEventClass(long jarg1, SBListener jarg1_, long jarg2, SBDebugger jarg2_, String jarg3, long jarg4); - public final static native long SBListener_StartListeningForEvents(long jarg1, SBListener jarg1_, long jarg2, SBBroadcaster jarg2_, long jarg3); - public final static native boolean SBListener_StopListeningForEvents(long jarg1, SBListener jarg1_, long jarg2, SBBroadcaster jarg2_, long jarg3); - public final static native boolean SBListener_WaitForEvent(long jarg1, SBListener jarg1_, long jarg2, long jarg3, SBEvent jarg3_); - public final static native boolean SBListener_WaitForEventForBroadcaster(long jarg1, SBListener jarg1_, long jarg2, long jarg3, SBBroadcaster jarg3_, long jarg4, SBEvent jarg4_); - public final static native boolean SBListener_WaitForEventForBroadcasterWithType(long jarg1, SBListener jarg1_, long jarg2, long jarg3, SBBroadcaster jarg3_, long jarg4, long jarg5, SBEvent jarg5_); - public final static native boolean SBListener_PeekAtNextEvent(long jarg1, SBListener jarg1_, long jarg2, SBEvent jarg2_); - public final static native boolean SBListener_PeekAtNextEventForBroadcaster(long jarg1, SBListener jarg1_, long jarg2, SBBroadcaster jarg2_, long jarg3, SBEvent jarg3_); - public final static native boolean SBListener_PeekAtNextEventForBroadcasterWithType(long jarg1, SBListener jarg1_, long jarg2, SBBroadcaster jarg2_, long jarg3, long jarg4, SBEvent jarg4_); - public final static native boolean SBListener_GetNextEvent(long jarg1, SBListener jarg1_, long jarg2, SBEvent jarg2_); - public final static native boolean SBListener_GetNextEventForBroadcaster(long jarg1, SBListener jarg1_, long jarg2, SBBroadcaster jarg2_, long jarg3, SBEvent jarg3_); - public final static native boolean SBListener_GetNextEventForBroadcasterWithType(long jarg1, SBListener jarg1_, long jarg2, SBBroadcaster jarg2_, long jarg3, long jarg4, SBEvent jarg4_); - public final static native boolean SBListener_HandleBroadcastEvent(long jarg1, SBListener jarg1_, long jarg2, SBEvent jarg2_); - public final static native long new_SBMemoryRegionInfo__SWIG_0(); - public final static native long new_SBMemoryRegionInfo__SWIG_1(long jarg1, SBMemoryRegionInfo jarg1_); - public final static native long new_SBMemoryRegionInfo__SWIG_2(String jarg1, java.math.BigInteger jarg2, java.math.BigInteger jarg3, long jarg4, boolean jarg5, boolean jarg6); - public final static native long new_SBMemoryRegionInfo__SWIG_3(String jarg1, java.math.BigInteger jarg2, java.math.BigInteger jarg3, long jarg4, boolean jarg5); - public final static native void delete_SBMemoryRegionInfo(long jarg1); - public final static native void SBMemoryRegionInfo_Clear(long jarg1, SBMemoryRegionInfo jarg1_); - public final static native java.math.BigInteger SBMemoryRegionInfo_GetRegionBase(long jarg1, SBMemoryRegionInfo jarg1_); - public final static native java.math.BigInteger SBMemoryRegionInfo_GetRegionEnd(long jarg1, SBMemoryRegionInfo jarg1_); - public final static native boolean SBMemoryRegionInfo_IsReadable(long jarg1, SBMemoryRegionInfo jarg1_); - public final static native boolean SBMemoryRegionInfo_IsWritable(long jarg1, SBMemoryRegionInfo jarg1_); - public final static native boolean SBMemoryRegionInfo_IsExecutable(long jarg1, SBMemoryRegionInfo jarg1_); - public final static native boolean SBMemoryRegionInfo_IsMapped(long jarg1, SBMemoryRegionInfo jarg1_); - public final static native String SBMemoryRegionInfo_GetName(long jarg1, SBMemoryRegionInfo jarg1_); - public final static native boolean SBMemoryRegionInfo_HasDirtyMemoryPageList(long jarg1, SBMemoryRegionInfo jarg1_); - public final static native long SBMemoryRegionInfo_GetNumDirtyPages(long jarg1, SBMemoryRegionInfo jarg1_); - public final static native java.math.BigInteger SBMemoryRegionInfo_GetDirtyPageAddressAtIndex(long jarg1, SBMemoryRegionInfo jarg1_, long jarg2); - public final static native int SBMemoryRegionInfo_GetPageSize(long jarg1, SBMemoryRegionInfo jarg1_); - public final static native boolean SBMemoryRegionInfo_GetDescription(long jarg1, SBMemoryRegionInfo jarg1_, long jarg2, SBStream jarg2_); - public final static native String SBMemoryRegionInfo___repr__(long jarg1, SBMemoryRegionInfo jarg1_); - public final static native long new_SBMemoryRegionInfoList__SWIG_0(); - public final static native long new_SBMemoryRegionInfoList__SWIG_1(long jarg1, SBMemoryRegionInfoList jarg1_); - public final static native void delete_SBMemoryRegionInfoList(long jarg1); - public final static native long SBMemoryRegionInfoList_GetSize(long jarg1, SBMemoryRegionInfoList jarg1_); - public final static native boolean SBMemoryRegionInfoList_GetMemoryRegionContainingAddress(long jarg1, SBMemoryRegionInfoList jarg1_, java.math.BigInteger jarg2, long jarg3, SBMemoryRegionInfo jarg3_); - public final static native boolean SBMemoryRegionInfoList_GetMemoryRegionAtIndex(long jarg1, SBMemoryRegionInfoList jarg1_, long jarg2, long jarg3, SBMemoryRegionInfo jarg3_); - public final static native void SBMemoryRegionInfoList_Append__SWIG_0(long jarg1, SBMemoryRegionInfoList jarg1_, long jarg2, SBMemoryRegionInfo jarg2_); - public final static native void SBMemoryRegionInfoList_Append__SWIG_1(long jarg1, SBMemoryRegionInfoList jarg1_, long jarg2, SBMemoryRegionInfoList jarg2_); - public final static native void SBMemoryRegionInfoList_Clear(long jarg1, SBMemoryRegionInfoList jarg1_); - public final static native long new_SBModule__SWIG_0(); - public final static native long new_SBModule__SWIG_1(long jarg1, SBModule jarg1_); - public final static native long new_SBModule__SWIG_2(long jarg1, SBModuleSpec jarg1_); - public final static native long new_SBModule__SWIG_3(long jarg1, SBProcess jarg1_, java.math.BigInteger jarg2); - public final static native void delete_SBModule(long jarg1); - public final static native boolean SBModule_IsValid(long jarg1, SBModule jarg1_); - public final static native void SBModule_Clear(long jarg1, SBModule jarg1_); - public final static native boolean SBModule_IsFileBacked(long jarg1, SBModule jarg1_); - public final static native long SBModule_GetFileSpec(long jarg1, SBModule jarg1_); - public final static native long SBModule_GetPlatformFileSpec(long jarg1, SBModule jarg1_); - public final static native boolean SBModule_SetPlatformFileSpec(long jarg1, SBModule jarg1_, long jarg2, SBFileSpec jarg2_); - public final static native long SBModule_GetRemoteInstallFileSpec(long jarg1, SBModule jarg1_); - public final static native boolean SBModule_SetRemoteInstallFileSpec(long jarg1, SBModule jarg1_, long jarg2, SBFileSpec jarg2_); - public final static native int SBModule_GetByteOrder(long jarg1, SBModule jarg1_); - public final static native long SBModule_GetAddressByteSize(long jarg1, SBModule jarg1_); - public final static native String SBModule_GetTriple(long jarg1, SBModule jarg1_); - public final static native long SBModule_GetUUIDBytes(long jarg1, SBModule jarg1_); - public final static native String SBModule_GetUUIDString(long jarg1, SBModule jarg1_); - public final static native long SBModule_FindSection(long jarg1, SBModule jarg1_, String jarg2); - public final static native long SBModule_ResolveFileAddress(long jarg1, SBModule jarg1_, java.math.BigInteger jarg2); - public final static native long SBModule_ResolveSymbolContextForAddress(long jarg1, SBModule jarg1_, long jarg2, SBAddress jarg2_, long jarg3); - public final static native boolean SBModule_GetDescription(long jarg1, SBModule jarg1_, long jarg2, SBStream jarg2_); - public final static native long SBModule_GetNumCompileUnits(long jarg1, SBModule jarg1_); - public final static native long SBModule_GetCompileUnitAtIndex(long jarg1, SBModule jarg1_, long jarg2); - public final static native long SBModule_FindCompileUnits(long jarg1, SBModule jarg1_, long jarg2, SBFileSpec jarg2_); - public final static native long SBModule_GetNumSymbols(long jarg1, SBModule jarg1_); - public final static native long SBModule_GetSymbolAtIndex(long jarg1, SBModule jarg1_, long jarg2); - public final static native long SBModule_FindSymbol__SWIG_0(long jarg1, SBModule jarg1_, String jarg2, int jarg3); - public final static native long SBModule_FindSymbol__SWIG_1(long jarg1, SBModule jarg1_, String jarg2); - public final static native long SBModule_FindSymbols__SWIG_0(long jarg1, SBModule jarg1_, String jarg2, int jarg3); - public final static native long SBModule_FindSymbols__SWIG_1(long jarg1, SBModule jarg1_, String jarg2); - public final static native long SBModule_GetNumSections(long jarg1, SBModule jarg1_); - public final static native long SBModule_GetSectionAtIndex(long jarg1, SBModule jarg1_, long jarg2); - public final static native long SBModule_FindFunctions__SWIG_0(long jarg1, SBModule jarg1_, String jarg2, long jarg3); - public final static native long SBModule_FindFunctions__SWIG_1(long jarg1, SBModule jarg1_, String jarg2); - public final static native long SBModule_FindGlobalVariables(long jarg1, SBModule jarg1_, long jarg2, SBTarget jarg2_, String jarg3, long jarg4); - public final static native long SBModule_FindFirstGlobalVariable(long jarg1, SBModule jarg1_, long jarg2, SBTarget jarg2_, String jarg3); - public final static native long SBModule_FindFirstType(long jarg1, SBModule jarg1_, String jarg2); - public final static native long SBModule_FindTypes(long jarg1, SBModule jarg1_, String jarg2); - public final static native long SBModule_GetTypeByID(long jarg1, SBModule jarg1_, java.math.BigInteger jarg2); - public final static native long SBModule_GetBasicType(long jarg1, SBModule jarg1_, int jarg2); - public final static native long SBModule_GetTypes__SWIG_0(long jarg1, SBModule jarg1_, long jarg2); - public final static native long SBModule_GetTypes__SWIG_1(long jarg1, SBModule jarg1_); - public final static native long SBModule_GetVersion(long jarg1, SBModule jarg1_, long jarg2, long jarg3); - public final static native long SBModule_GetSymbolFileSpec(long jarg1, SBModule jarg1_); - public final static native long SBModule_GetObjectFileHeaderAddress(long jarg1, SBModule jarg1_); - public final static native long SBModule_GetObjectFileEntryPointAddress(long jarg1, SBModule jarg1_); - public final static native long SBModule_GetNumberAllocatedModules(); - public final static native void SBModule_GarbageCollectAllocatedModules(); - public final static native String SBModule___repr__(long jarg1, SBModule jarg1_); - public final static native long new_SBModuleSpec__SWIG_0(); - public final static native long new_SBModuleSpec__SWIG_1(long jarg1, SBModuleSpec jarg1_); - public final static native void delete_SBModuleSpec(long jarg1); - public final static native boolean SBModuleSpec_IsValid(long jarg1, SBModuleSpec jarg1_); - public final static native void SBModuleSpec_Clear(long jarg1, SBModuleSpec jarg1_); - public final static native long SBModuleSpec_GetFileSpec(long jarg1, SBModuleSpec jarg1_); - public final static native void SBModuleSpec_SetFileSpec(long jarg1, SBModuleSpec jarg1_, long jarg2, SBFileSpec jarg2_); - public final static native long SBModuleSpec_GetPlatformFileSpec(long jarg1, SBModuleSpec jarg1_); - public final static native void SBModuleSpec_SetPlatformFileSpec(long jarg1, SBModuleSpec jarg1_, long jarg2, SBFileSpec jarg2_); - public final static native long SBModuleSpec_GetSymbolFileSpec(long jarg1, SBModuleSpec jarg1_); - public final static native void SBModuleSpec_SetSymbolFileSpec(long jarg1, SBModuleSpec jarg1_, long jarg2, SBFileSpec jarg2_); - public final static native String SBModuleSpec_GetObjectName(long jarg1, SBModuleSpec jarg1_); - public final static native void SBModuleSpec_SetObjectName(long jarg1, SBModuleSpec jarg1_, String jarg2); - public final static native String SBModuleSpec_GetTriple(long jarg1, SBModuleSpec jarg1_); - public final static native void SBModuleSpec_SetTriple(long jarg1, SBModuleSpec jarg1_, String jarg2); - public final static native long SBModuleSpec_GetUUIDBytes(long jarg1, SBModuleSpec jarg1_); - public final static native long SBModuleSpec_GetUUIDLength(long jarg1, SBModuleSpec jarg1_); - public final static native boolean SBModuleSpec_SetUUIDBytes(long jarg1, SBModuleSpec jarg1_, long jarg2, long jarg3); - public final static native java.math.BigInteger SBModuleSpec_GetObjectOffset(long jarg1, SBModuleSpec jarg1_); - public final static native void SBModuleSpec_SetObjectOffset(long jarg1, SBModuleSpec jarg1_, java.math.BigInteger jarg2); - public final static native java.math.BigInteger SBModuleSpec_GetObjectSize(long jarg1, SBModuleSpec jarg1_); - public final static native void SBModuleSpec_SetObjectSize(long jarg1, SBModuleSpec jarg1_, java.math.BigInteger jarg2); - public final static native boolean SBModuleSpec_GetDescription(long jarg1, SBModuleSpec jarg1_, long jarg2, SBStream jarg2_); - public final static native String SBModuleSpec___repr__(long jarg1, SBModuleSpec jarg1_); - public final static native long new_SBModuleSpecList__SWIG_0(); - public final static native long new_SBModuleSpecList__SWIG_1(long jarg1, SBModuleSpecList jarg1_); - public final static native void delete_SBModuleSpecList(long jarg1); - public final static native long SBModuleSpecList_GetModuleSpecifications(String jarg1); - public final static native void SBModuleSpecList_Append__SWIG_0(long jarg1, SBModuleSpecList jarg1_, long jarg2, SBModuleSpec jarg2_); - public final static native void SBModuleSpecList_Append__SWIG_1(long jarg1, SBModuleSpecList jarg1_, long jarg2, SBModuleSpecList jarg2_); - public final static native long SBModuleSpecList_FindFirstMatchingSpec(long jarg1, SBModuleSpecList jarg1_, long jarg2, SBModuleSpec jarg2_); - public final static native long SBModuleSpecList_FindMatchingSpecs(long jarg1, SBModuleSpecList jarg1_, long jarg2, SBModuleSpec jarg2_); - public final static native long SBModuleSpecList_GetSize(long jarg1, SBModuleSpecList jarg1_); - public final static native long SBModuleSpecList_GetSpecAtIndex(long jarg1, SBModuleSpecList jarg1_, long jarg2); - public final static native boolean SBModuleSpecList_GetDescription(long jarg1, SBModuleSpecList jarg1_, long jarg2, SBStream jarg2_); - public final static native String SBModuleSpecList___repr__(long jarg1, SBModuleSpecList jarg1_); - public final static native long new_SBPlatformConnectOptions__SWIG_0(String jarg1); - public final static native long new_SBPlatformConnectOptions__SWIG_1(long jarg1, SBPlatformConnectOptions jarg1_); - public final static native void delete_SBPlatformConnectOptions(long jarg1); - public final static native String SBPlatformConnectOptions_GetURL(long jarg1, SBPlatformConnectOptions jarg1_); - public final static native void SBPlatformConnectOptions_SetURL(long jarg1, SBPlatformConnectOptions jarg1_, String jarg2); - public final static native boolean SBPlatformConnectOptions_GetRsyncEnabled(long jarg1, SBPlatformConnectOptions jarg1_); - public final static native void SBPlatformConnectOptions_EnableRsync(long jarg1, SBPlatformConnectOptions jarg1_, String jarg2, String jarg3, boolean jarg4); - public final static native void SBPlatformConnectOptions_DisableRsync(long jarg1, SBPlatformConnectOptions jarg1_); - public final static native String SBPlatformConnectOptions_GetLocalCacheDirectory(long jarg1, SBPlatformConnectOptions jarg1_); - public final static native void SBPlatformConnectOptions_SetLocalCacheDirectory(long jarg1, SBPlatformConnectOptions jarg1_, String jarg2); - public final static native long new_SBPlatformShellCommand__SWIG_0(String jarg1, String jarg2); - public final static native long new_SBPlatformShellCommand__SWIG_1(String jarg1); - public final static native long new_SBPlatformShellCommand__SWIG_2(long jarg1, SBPlatformShellCommand jarg1_); - public final static native void delete_SBPlatformShellCommand(long jarg1); - public final static native void SBPlatformShellCommand_Clear(long jarg1, SBPlatformShellCommand jarg1_); - public final static native String SBPlatformShellCommand_GetShell(long jarg1, SBPlatformShellCommand jarg1_); - public final static native void SBPlatformShellCommand_SetShell(long jarg1, SBPlatformShellCommand jarg1_, String jarg2); - public final static native String SBPlatformShellCommand_GetCommand(long jarg1, SBPlatformShellCommand jarg1_); - public final static native void SBPlatformShellCommand_SetCommand(long jarg1, SBPlatformShellCommand jarg1_, String jarg2); - public final static native String SBPlatformShellCommand_GetWorkingDirectory(long jarg1, SBPlatformShellCommand jarg1_); - public final static native void SBPlatformShellCommand_SetWorkingDirectory(long jarg1, SBPlatformShellCommand jarg1_, String jarg2); - public final static native long SBPlatformShellCommand_GetTimeoutSeconds(long jarg1, SBPlatformShellCommand jarg1_); - public final static native void SBPlatformShellCommand_SetTimeoutSeconds(long jarg1, SBPlatformShellCommand jarg1_, long jarg2); - public final static native int SBPlatformShellCommand_GetSignal(long jarg1, SBPlatformShellCommand jarg1_); - public final static native int SBPlatformShellCommand_GetStatus(long jarg1, SBPlatformShellCommand jarg1_); - public final static native String SBPlatformShellCommand_GetOutput(long jarg1, SBPlatformShellCommand jarg1_); - public final static native long new_SBPlatform__SWIG_0(); - public final static native long new_SBPlatform__SWIG_1(String jarg1); - public final static native long new_SBPlatform__SWIG_2(long jarg1, SBPlatform jarg1_); - public final static native void delete_SBPlatform(long jarg1); - public final static native long SBPlatform_GetHostPlatform(); - public final static native boolean SBPlatform_IsValid(long jarg1, SBPlatform jarg1_); - public final static native void SBPlatform_Clear(long jarg1, SBPlatform jarg1_); - public final static native String SBPlatform_GetWorkingDirectory(long jarg1, SBPlatform jarg1_); - public final static native boolean SBPlatform_SetWorkingDirectory(long jarg1, SBPlatform jarg1_, String jarg2); - public final static native String SBPlatform_GetName(long jarg1, SBPlatform jarg1_); - public final static native long SBPlatform_ConnectRemote(long jarg1, SBPlatform jarg1_, long jarg2, SBPlatformConnectOptions jarg2_); - public final static native void SBPlatform_DisconnectRemote(long jarg1, SBPlatform jarg1_); - public final static native boolean SBPlatform_IsConnected(long jarg1, SBPlatform jarg1_); - public final static native String SBPlatform_GetTriple(long jarg1, SBPlatform jarg1_); - public final static native String SBPlatform_GetHostname(long jarg1, SBPlatform jarg1_); - public final static native String SBPlatform_GetOSBuild(long jarg1, SBPlatform jarg1_); - public final static native String SBPlatform_GetOSDescription(long jarg1, SBPlatform jarg1_); - public final static native long SBPlatform_GetOSMajorVersion(long jarg1, SBPlatform jarg1_); - public final static native long SBPlatform_GetOSMinorVersion(long jarg1, SBPlatform jarg1_); - public final static native long SBPlatform_GetOSUpdateVersion(long jarg1, SBPlatform jarg1_); - public final static native void SBPlatform_SetSDKRoot(long jarg1, SBPlatform jarg1_, String jarg2); - public final static native long SBPlatform_Put(long jarg1, SBPlatform jarg1_, long jarg2, SBFileSpec jarg2_, long jarg3, SBFileSpec jarg3_); - public final static native long SBPlatform_Get(long jarg1, SBPlatform jarg1_, long jarg2, SBFileSpec jarg2_, long jarg3, SBFileSpec jarg3_); - public final static native long SBPlatform_Install(long jarg1, SBPlatform jarg1_, long jarg2, SBFileSpec jarg2_, long jarg3, SBFileSpec jarg3_); - public final static native long SBPlatform_Run(long jarg1, SBPlatform jarg1_, long jarg2, SBPlatformShellCommand jarg2_); - public final static native long SBPlatform_Launch(long jarg1, SBPlatform jarg1_, long jarg2, SBLaunchInfo jarg2_); - public final static native long SBPlatform_Kill(long jarg1, SBPlatform jarg1_, java.math.BigInteger jarg2); - public final static native long SBPlatform_MakeDirectory__SWIG_0(long jarg1, SBPlatform jarg1_, String jarg2, long jarg3); - public final static native long SBPlatform_MakeDirectory__SWIG_1(long jarg1, SBPlatform jarg1_, String jarg2); - public final static native long SBPlatform_GetFilePermissions(long jarg1, SBPlatform jarg1_, String jarg2); - public final static native long SBPlatform_SetFilePermissions(long jarg1, SBPlatform jarg1_, String jarg2, long jarg3); - public final static native long SBPlatform_GetUnixSignals(long jarg1, SBPlatform jarg1_); - public final static native long SBPlatform_GetEnvironment(long jarg1, SBPlatform jarg1_); - public final static native long SBPlatform_SetLocateModuleCallback(long jarg1, SBPlatform jarg1_, long jarg2, long jarg3); - public final static native int SBProcess_eBroadcastBitStateChanged_get(); - public final static native int SBProcess_eBroadcastBitInterrupt_get(); - public final static native int SBProcess_eBroadcastBitSTDOUT_get(); - public final static native int SBProcess_eBroadcastBitSTDERR_get(); - public final static native int SBProcess_eBroadcastBitProfileData_get(); - public final static native int SBProcess_eBroadcastBitStructuredData_get(); - public final static native long new_SBProcess__SWIG_0(); - public final static native long new_SBProcess__SWIG_1(long jarg1, SBProcess jarg1_); - public final static native void delete_SBProcess(long jarg1); - public final static native String SBProcess_GetBroadcasterClassName(); - public final static native String SBProcess_GetPluginName(long jarg1, SBProcess jarg1_); - public final static native String SBProcess_GetShortPluginName(long jarg1, SBProcess jarg1_); - public final static native void SBProcess_Clear(long jarg1, SBProcess jarg1_); - public final static native boolean SBProcess_IsValid(long jarg1, SBProcess jarg1_); - public final static native long SBProcess_GetTarget(long jarg1, SBProcess jarg1_); - public final static native int SBProcess_GetByteOrder(long jarg1, SBProcess jarg1_); - public final static native long SBProcess_PutSTDIN(long jarg1, SBProcess jarg1_, String jarg2, long jarg3); - public final static native long SBProcess_GetSTDOUT(long jarg1, SBProcess jarg1_, String jarg2, long jarg3); - public final static native long SBProcess_GetSTDERR(long jarg1, SBProcess jarg1_, String jarg2, long jarg3); - public final static native long SBProcess_GetAsyncProfileData(long jarg1, SBProcess jarg1_, String jarg2, long jarg3); - public final static native void SBProcess_ReportEventState__SWIG_0(long jarg1, SBProcess jarg1_, long jarg2, SBEvent jarg2_, long jarg3, SBFile jarg3_); - public final static native void SBProcess_ReportEventState__SWIG_1(long jarg1, SBProcess jarg1_, long jarg2, SBEvent jarg2_, long jarg3); - public final static native void SBProcess_AppendEventStateReport(long jarg1, SBProcess jarg1_, long jarg2, SBEvent jarg2_, long jarg3, SBCommandReturnObject jarg3_); - public final static native boolean SBProcess_RemoteAttachToProcessWithID(long jarg1, SBProcess jarg1_, java.math.BigInteger jarg2, long jarg3, SBError jarg3_); - public final static native boolean SBProcess_RemoteLaunch(long jarg1, SBProcess jarg1_, String[] jarg2, String[] jarg3, String jarg4, String jarg5, String jarg6, String jarg7, long jarg8, boolean jarg9, long jarg10, SBError jarg10_); - public final static native long SBProcess_GetNumThreads(long jarg1, SBProcess jarg1_); - public final static native long SBProcess_GetThreadAtIndex(long jarg1, SBProcess jarg1_, long jarg2); - public final static native long SBProcess_GetThreadByID(long jarg1, SBProcess jarg1_, java.math.BigInteger jarg2); - public final static native long SBProcess_GetThreadByIndexID(long jarg1, SBProcess jarg1_, long jarg2); - public final static native long SBProcess_GetSelectedThread(long jarg1, SBProcess jarg1_); - public final static native long SBProcess_CreateOSPluginThread(long jarg1, SBProcess jarg1_, java.math.BigInteger jarg2, java.math.BigInteger jarg3); - public final static native boolean SBProcess_SetSelectedThread(long jarg1, SBProcess jarg1_, long jarg2, SBThread jarg2_); - public final static native boolean SBProcess_SetSelectedThreadByID(long jarg1, SBProcess jarg1_, java.math.BigInteger jarg2); - public final static native boolean SBProcess_SetSelectedThreadByIndexID(long jarg1, SBProcess jarg1_, long jarg2); - public final static native long SBProcess_GetNumQueues(long jarg1, SBProcess jarg1_); - public final static native long SBProcess_GetQueueAtIndex(long jarg1, SBProcess jarg1_, long jarg2); - public final static native int SBProcess_GetState(long jarg1, SBProcess jarg1_); - public final static native int SBProcess_GetExitStatus(long jarg1, SBProcess jarg1_); - public final static native String SBProcess_GetExitDescription(long jarg1, SBProcess jarg1_); - public final static native java.math.BigInteger SBProcess_GetProcessID(long jarg1, SBProcess jarg1_); - public final static native long SBProcess_GetUniqueID(long jarg1, SBProcess jarg1_); - public final static native long SBProcess_GetAddressByteSize(long jarg1, SBProcess jarg1_); - public final static native long SBProcess_Destroy(long jarg1, SBProcess jarg1_); - public final static native long SBProcess_Continue(long jarg1, SBProcess jarg1_); - public final static native long SBProcess_Stop(long jarg1, SBProcess jarg1_); - public final static native long SBProcess_Kill(long jarg1, SBProcess jarg1_); - public final static native long SBProcess_Detach__SWIG_0(long jarg1, SBProcess jarg1_); - public final static native long SBProcess_Detach__SWIG_1(long jarg1, SBProcess jarg1_, boolean jarg2); - public final static native long SBProcess_Signal(long jarg1, SBProcess jarg1_, int jarg2); - public final static native long SBProcess_GetUnixSignals(long jarg1, SBProcess jarg1_); - public final static native void SBProcess_SendAsyncInterrupt(long jarg1, SBProcess jarg1_); - public final static native long SBProcess_GetStopID__SWIG_0(long jarg1, SBProcess jarg1_, boolean jarg2); - public final static native long SBProcess_GetStopID__SWIG_1(long jarg1, SBProcess jarg1_); - public final static native long SBProcess_GetStopEventForStopID(long jarg1, SBProcess jarg1_, long jarg2); - public final static native void SBProcess_ForceScriptedState(long jarg1, SBProcess jarg1_, int jarg2); - public final static native long SBProcess_ReadMemory(long jarg1, SBProcess jarg1_, java.math.BigInteger jarg2, long jarg3, long jarg4, long jarg5, SBError jarg5_); - public final static native long SBProcess_WriteMemory(long jarg1, SBProcess jarg1_, java.math.BigInteger jarg2, long jarg3, long jarg4, long jarg5, SBError jarg5_); - public final static native long SBProcess_ReadCStringFromMemory(long jarg1, SBProcess jarg1_, java.math.BigInteger jarg2, long jarg3, long jarg4, long jarg5, SBError jarg5_); - public final static native java.math.BigInteger SBProcess_ReadUnsignedFromMemory(long jarg1, SBProcess jarg1_, java.math.BigInteger jarg2, long jarg3, long jarg4, SBError jarg4_); - public final static native java.math.BigInteger SBProcess_ReadPointerFromMemory(long jarg1, SBProcess jarg1_, java.math.BigInteger jarg2, long jarg3, SBError jarg3_); - public final static native int SBProcess_GetStateFromEvent(long jarg1, SBEvent jarg1_); - public final static native boolean SBProcess_GetRestartedFromEvent(long jarg1, SBEvent jarg1_); - public final static native long SBProcess_GetNumRestartedReasonsFromEvent(long jarg1, SBEvent jarg1_); - public final static native String SBProcess_GetRestartedReasonAtIndexFromEvent(long jarg1, SBEvent jarg1_, long jarg2); - public final static native long SBProcess_GetProcessFromEvent(long jarg1, SBEvent jarg1_); - public final static native boolean SBProcess_GetInterruptedFromEvent(long jarg1, SBEvent jarg1_); - public final static native long SBProcess_GetStructuredDataFromEvent(long jarg1, SBEvent jarg1_); - public final static native boolean SBProcess_EventIsProcessEvent(long jarg1, SBEvent jarg1_); - public final static native boolean SBProcess_EventIsStructuredDataEvent(long jarg1, SBEvent jarg1_); - public final static native long SBProcess_GetBroadcaster(long jarg1, SBProcess jarg1_); - public final static native String SBProcess_GetBroadcasterClass(); - public final static native boolean SBProcess_GetDescription(long jarg1, SBProcess jarg1_, long jarg2, SBStream jarg2_); - public final static native long SBProcess_GetExtendedCrashInformation(long jarg1, SBProcess jarg1_); - public final static native long SBProcess_GetNumSupportedHardwareWatchpoints(long jarg1, SBProcess jarg1_, long jarg2, SBError jarg2_); - public final static native long SBProcess_LoadImage__SWIG_0(long jarg1, SBProcess jarg1_, long jarg2, SBFileSpec jarg2_, long jarg3, SBError jarg3_); - public final static native long SBProcess_LoadImage__SWIG_1(long jarg1, SBProcess jarg1_, long jarg2, SBFileSpec jarg2_, long jarg3, SBFileSpec jarg3_, long jarg4, SBError jarg4_); - public final static native long SBProcess_LoadImageUsingPaths(long jarg1, SBProcess jarg1_, long jarg2, SBFileSpec jarg2_, long jarg3, SBStringList jarg3_, long jarg4, SBFileSpec jarg4_, long jarg5, SBError jarg5_); - public final static native long SBProcess_UnloadImage(long jarg1, SBProcess jarg1_, long jarg2); - public final static native long SBProcess_SendEventData(long jarg1, SBProcess jarg1_, String jarg2); - public final static native long SBProcess_GetNumExtendedBacktraceTypes(long jarg1, SBProcess jarg1_); - public final static native String SBProcess_GetExtendedBacktraceTypeAtIndex(long jarg1, SBProcess jarg1_, long jarg2); - public final static native long SBProcess_GetHistoryThreads(long jarg1, SBProcess jarg1_, java.math.BigInteger jarg2); - public final static native boolean SBProcess_IsInstrumentationRuntimePresent(long jarg1, SBProcess jarg1_, int jarg2); - public final static native long SBProcess_SaveCore__SWIG_0(long jarg1, SBProcess jarg1_, String jarg2, String jarg3, int jarg4); - public final static native long SBProcess_SaveCore__SWIG_1(long jarg1, SBProcess jarg1_, String jarg2); - public final static native long SBProcess_GetMemoryRegionInfo(long jarg1, SBProcess jarg1_, java.math.BigInteger jarg2, long jarg3, SBMemoryRegionInfo jarg3_); - public final static native long SBProcess_GetMemoryRegions(long jarg1, SBProcess jarg1_); - public final static native long SBProcess_GetProcessInfo(long jarg1, SBProcess jarg1_); - public final static native java.math.BigInteger SBProcess_AllocateMemory(long jarg1, SBProcess jarg1_, long jarg2, long jarg3, long jarg4, SBError jarg4_); - public final static native long SBProcess_DeallocateMemory(long jarg1, SBProcess jarg1_, java.math.BigInteger jarg2); - public final static native long SBProcess_GetScriptedImplementation(long jarg1, SBProcess jarg1_); - public final static native String SBProcess___repr__(long jarg1, SBProcess jarg1_); - public final static native long new_SBProcessInfo__SWIG_0(); - public final static native long new_SBProcessInfo__SWIG_1(long jarg1, SBProcessInfo jarg1_); - public final static native void delete_SBProcessInfo(long jarg1); - public final static native boolean SBProcessInfo_IsValid(long jarg1, SBProcessInfo jarg1_); - public final static native String SBProcessInfo_GetName(long jarg1, SBProcessInfo jarg1_); - public final static native long SBProcessInfo_GetExecutableFile(long jarg1, SBProcessInfo jarg1_); - public final static native java.math.BigInteger SBProcessInfo_GetProcessID(long jarg1, SBProcessInfo jarg1_); - public final static native long SBProcessInfo_GetUserID(long jarg1, SBProcessInfo jarg1_); - public final static native long SBProcessInfo_GetGroupID(long jarg1, SBProcessInfo jarg1_); - public final static native boolean SBProcessInfo_UserIDIsValid(long jarg1, SBProcessInfo jarg1_); - public final static native boolean SBProcessInfo_GroupIDIsValid(long jarg1, SBProcessInfo jarg1_); - public final static native long SBProcessInfo_GetEffectiveUserID(long jarg1, SBProcessInfo jarg1_); - public final static native long SBProcessInfo_GetEffectiveGroupID(long jarg1, SBProcessInfo jarg1_); - public final static native boolean SBProcessInfo_EffectiveUserIDIsValid(long jarg1, SBProcessInfo jarg1_); - public final static native boolean SBProcessInfo_EffectiveGroupIDIsValid(long jarg1, SBProcessInfo jarg1_); - public final static native java.math.BigInteger SBProcessInfo_GetParentProcessID(long jarg1, SBProcessInfo jarg1_); - public final static native String SBProcessInfo_GetTriple(long jarg1, SBProcessInfo jarg1_); - public final static native long new_SBQueue__SWIG_0(); - public final static native long new_SBQueue__SWIG_1(long jarg1, SBQueue jarg1_); - public final static native void delete_SBQueue(long jarg1); - public final static native boolean SBQueue_IsValid(long jarg1, SBQueue jarg1_); - public final static native void SBQueue_Clear(long jarg1, SBQueue jarg1_); - public final static native long SBQueue_GetProcess(long jarg1, SBQueue jarg1_); - public final static native java.math.BigInteger SBQueue_GetQueueID(long jarg1, SBQueue jarg1_); - public final static native String SBQueue_GetName(long jarg1, SBQueue jarg1_); - public final static native long SBQueue_GetIndexID(long jarg1, SBQueue jarg1_); - public final static native long SBQueue_GetNumThreads(long jarg1, SBQueue jarg1_); - public final static native long SBQueue_GetThreadAtIndex(long jarg1, SBQueue jarg1_, long jarg2); - public final static native long SBQueue_GetNumPendingItems(long jarg1, SBQueue jarg1_); - public final static native long SBQueue_GetPendingItemAtIndex(long jarg1, SBQueue jarg1_, long jarg2); - public final static native long SBQueue_GetNumRunningItems(long jarg1, SBQueue jarg1_); - public final static native int SBQueue_GetKind(long jarg1, SBQueue jarg1_); - public final static native long new_SBQueueItem(); - public final static native void delete_SBQueueItem(long jarg1); - public final static native boolean SBQueueItem_IsValid(long jarg1, SBQueueItem jarg1_); - public final static native void SBQueueItem_Clear(long jarg1, SBQueueItem jarg1_); - public final static native int SBQueueItem_GetKind(long jarg1, SBQueueItem jarg1_); - public final static native void SBQueueItem_SetKind(long jarg1, SBQueueItem jarg1_, int jarg2); - public final static native long SBQueueItem_GetAddress(long jarg1, SBQueueItem jarg1_); - public final static native void SBQueueItem_SetAddress(long jarg1, SBQueueItem jarg1_, long jarg2, SBAddress jarg2_); - public final static native long SBQueueItem_GetExtendedBacktraceThread(long jarg1, SBQueueItem jarg1_, String jarg2); - public final static native String SBReproducer_Capture(String jarg1); - public final static native String SBReproducer_PassiveReplay(String jarg1); - public final static native boolean SBReproducer_SetAutoGenerate(boolean jarg1); - public final static native void SBReproducer_SetWorkingDirectory(String jarg1); - public final static native long new_SBReproducer(); - public final static native void delete_SBReproducer(long jarg1); - public final static native long new_SBScriptObject__SWIG_0(long jarg1, int jarg2); - public final static native long new_SBScriptObject__SWIG_1(long jarg1, SBScriptObject jarg1_); - public final static native void delete_SBScriptObject(long jarg1); - public final static native boolean SBScriptObject_IsValid(long jarg1, SBScriptObject jarg1_); - public final static native long SBScriptObject_GetPointer(long jarg1, SBScriptObject jarg1_); - public final static native int SBScriptObject_GetLanguage(long jarg1, SBScriptObject jarg1_); - public final static native long new_SBSection__SWIG_0(); - public final static native long new_SBSection__SWIG_1(long jarg1, SBSection jarg1_); - public final static native void delete_SBSection(long jarg1); - public final static native boolean SBSection_IsValid(long jarg1, SBSection jarg1_); - public final static native String SBSection_GetName(long jarg1, SBSection jarg1_); - public final static native long SBSection_GetParent(long jarg1, SBSection jarg1_); - public final static native long SBSection_FindSubSection(long jarg1, SBSection jarg1_, String jarg2); - public final static native long SBSection_GetNumSubSections(long jarg1, SBSection jarg1_); - public final static native long SBSection_GetSubSectionAtIndex(long jarg1, SBSection jarg1_, long jarg2); - public final static native java.math.BigInteger SBSection_GetFileAddress(long jarg1, SBSection jarg1_); - public final static native java.math.BigInteger SBSection_GetLoadAddress(long jarg1, SBSection jarg1_, long jarg2, SBTarget jarg2_); - public final static native java.math.BigInteger SBSection_GetByteSize(long jarg1, SBSection jarg1_); - public final static native java.math.BigInteger SBSection_GetFileOffset(long jarg1, SBSection jarg1_); - public final static native java.math.BigInteger SBSection_GetFileByteSize(long jarg1, SBSection jarg1_); - public final static native long SBSection_GetSectionData__SWIG_0(long jarg1, SBSection jarg1_); - public final static native long SBSection_GetSectionData__SWIG_1(long jarg1, SBSection jarg1_, java.math.BigInteger jarg2, java.math.BigInteger jarg3); - public final static native int SBSection_GetSectionType(long jarg1, SBSection jarg1_); - public final static native long SBSection_GetPermissions(long jarg1, SBSection jarg1_); - public final static native long SBSection_GetTargetByteSize(long jarg1, SBSection jarg1_); - public final static native long SBSection_GetAlignment(long jarg1, SBSection jarg1_); - public final static native boolean SBSection_GetDescription(long jarg1, SBSection jarg1_, long jarg2, SBStream jarg2_); - public final static native String SBSection___repr__(long jarg1, SBSection jarg1_); - public final static native long new_SBSourceManager__SWIG_0(long jarg1, SBDebugger jarg1_); - public final static native long new_SBSourceManager__SWIG_1(long jarg1, SBTarget jarg1_); - public final static native long new_SBSourceManager__SWIG_2(long jarg1, SBSourceManager jarg1_); - public final static native void delete_SBSourceManager(long jarg1); - public final static native long SBSourceManager_DisplaySourceLinesWithLineNumbers(long jarg1, SBSourceManager jarg1_, long jarg2, SBFileSpec jarg2_, long jarg3, long jarg4, long jarg5, String jarg6, long jarg7, SBStream jarg7_); - public final static native long SBSourceManager_DisplaySourceLinesWithLineNumbersAndColumn(long jarg1, SBSourceManager jarg1_, long jarg2, SBFileSpec jarg2_, long jarg3, long jarg4, long jarg5, long jarg6, String jarg7, long jarg8, SBStream jarg8_); - public final static native long new_SBStream(); - public final static native void delete_SBStream(long jarg1); - public final static native boolean SBStream_IsValid(long jarg1, SBStream jarg1_); - public final static native String SBStream_GetData(long jarg1, SBStream jarg1_); - public final static native long SBStream_GetSize(long jarg1, SBStream jarg1_); - public final static native void SBStream_Print(long jarg1, SBStream jarg1_, String jarg2); - public final static native void SBStream_RedirectToFile__SWIG_0(long jarg1, SBStream jarg1_, String jarg2, boolean jarg3); - public final static native void SBStream_RedirectToFile__SWIG_1(long jarg1, SBStream jarg1_, long jarg2, SBFile jarg2_); - public final static native void SBStream_RedirectToFile__SWIG_2(long jarg1, SBStream jarg1_, long jarg2); - public final static native void SBStream_RedirectToFileDescriptor(long jarg1, SBStream jarg1_, int jarg2, boolean jarg3); - public final static native void SBStream_Clear(long jarg1, SBStream jarg1_); - public final static native void SBStream_RedirectToFileHandle(long jarg1, SBStream jarg1_, long jarg2, boolean jarg3); - public final static native long new_SBStringList__SWIG_0(); - public final static native long new_SBStringList__SWIG_1(long jarg1, SBStringList jarg1_); - public final static native void delete_SBStringList(long jarg1); - public final static native boolean SBStringList_IsValid(long jarg1, SBStringList jarg1_); - public final static native void SBStringList_AppendString(long jarg1, SBStringList jarg1_, String jarg2); - public final static native void SBStringList_AppendList__SWIG_0(long jarg1, SBStringList jarg1_, String[] jarg2, int jarg3); - public final static native void SBStringList_AppendList__SWIG_1(long jarg1, SBStringList jarg1_, long jarg2, SBStringList jarg2_); - public final static native long SBStringList_GetSize(long jarg1, SBStringList jarg1_); - public final static native String SBStringList_GetStringAtIndex__SWIG_0(long jarg1, SBStringList jarg1_, long jarg2); - public final static native void SBStringList_Clear(long jarg1, SBStringList jarg1_); - public final static native long new_SBStructuredData__SWIG_0(); - public final static native long new_SBStructuredData__SWIG_1(long jarg1, SBStructuredData jarg1_); - public final static native long new_SBStructuredData__SWIG_2(long jarg1, SBScriptObject jarg1_, long jarg2, SBDebugger jarg2_); - public final static native void delete_SBStructuredData(long jarg1); - public final static native boolean SBStructuredData_IsValid(long jarg1, SBStructuredData jarg1_); - public final static native long SBStructuredData_SetFromJSON__SWIG_0(long jarg1, SBStructuredData jarg1_, long jarg2, SBStream jarg2_); - public final static native long SBStructuredData_SetFromJSON__SWIG_1(long jarg1, SBStructuredData jarg1_, String jarg2); - public final static native void SBStructuredData_Clear(long jarg1, SBStructuredData jarg1_); - public final static native long SBStructuredData_GetAsJSON(long jarg1, SBStructuredData jarg1_, long jarg2, SBStream jarg2_); - public final static native long SBStructuredData_GetDescription(long jarg1, SBStructuredData jarg1_, long jarg2, SBStream jarg2_); - public final static native int SBStructuredData_GetType(long jarg1, SBStructuredData jarg1_); - public final static native long SBStructuredData_GetSize(long jarg1, SBStructuredData jarg1_); - public final static native boolean SBStructuredData_GetKeys(long jarg1, SBStructuredData jarg1_, long jarg2, SBStringList jarg2_); - public final static native long SBStructuredData_GetValueForKey(long jarg1, SBStructuredData jarg1_, String jarg2); - public final static native long SBStructuredData_GetItemAtIndex(long jarg1, SBStructuredData jarg1_, long jarg2); - public final static native java.math.BigInteger SBStructuredData_GetUnsignedIntegerValue__SWIG_0(long jarg1, SBStructuredData jarg1_, java.math.BigInteger jarg2); - public final static native java.math.BigInteger SBStructuredData_GetUnsignedIntegerValue__SWIG_1(long jarg1, SBStructuredData jarg1_); - public final static native long SBStructuredData_GetSignedIntegerValue__SWIG_0(long jarg1, SBStructuredData jarg1_, long jarg2); - public final static native long SBStructuredData_GetSignedIntegerValue__SWIG_1(long jarg1, SBStructuredData jarg1_); - public final static native java.math.BigInteger SBStructuredData_GetIntegerValue__SWIG_0(long jarg1, SBStructuredData jarg1_, java.math.BigInteger jarg2); - public final static native java.math.BigInteger SBStructuredData_GetIntegerValue__SWIG_1(long jarg1, SBStructuredData jarg1_); - public final static native double SBStructuredData_GetFloatValue__SWIG_0(long jarg1, SBStructuredData jarg1_, double jarg2); - public final static native double SBStructuredData_GetFloatValue__SWIG_1(long jarg1, SBStructuredData jarg1_); - public final static native boolean SBStructuredData_GetBooleanValue__SWIG_0(long jarg1, SBStructuredData jarg1_, boolean jarg2); - public final static native boolean SBStructuredData_GetBooleanValue__SWIG_1(long jarg1, SBStructuredData jarg1_); - public final static native long SBStructuredData_GetStringValue(long jarg1, SBStructuredData jarg1_, String jarg2, long jarg3); - public final static native long SBStructuredData_GetGenericValue(long jarg1, SBStructuredData jarg1_); - public final static native long new_SBSymbol__SWIG_0(); - public final static native void delete_SBSymbol(long jarg1); - public final static native long new_SBSymbol__SWIG_1(long jarg1, SBSymbol jarg1_); - public final static native boolean SBSymbol_IsValid(long jarg1, SBSymbol jarg1_); - public final static native String SBSymbol_GetName(long jarg1, SBSymbol jarg1_); - public final static native String SBSymbol_GetDisplayName(long jarg1, SBSymbol jarg1_); - public final static native String SBSymbol_GetMangledName(long jarg1, SBSymbol jarg1_); - public final static native long SBSymbol_GetInstructions__SWIG_0(long jarg1, SBSymbol jarg1_, long jarg2, SBTarget jarg2_); - public final static native long SBSymbol_GetInstructions__SWIG_1(long jarg1, SBSymbol jarg1_, long jarg2, SBTarget jarg2_, String jarg3); - public final static native long SBSymbol_GetStartAddress(long jarg1, SBSymbol jarg1_); - public final static native long SBSymbol_GetEndAddress(long jarg1, SBSymbol jarg1_); - public final static native java.math.BigInteger SBSymbol_GetValue(long jarg1, SBSymbol jarg1_); - public final static native java.math.BigInteger SBSymbol_GetSize(long jarg1, SBSymbol jarg1_); - public final static native long SBSymbol_GetPrologueByteSize(long jarg1, SBSymbol jarg1_); - public final static native int SBSymbol_GetType(long jarg1, SBSymbol jarg1_); - public final static native boolean SBSymbol_GetDescription(long jarg1, SBSymbol jarg1_, long jarg2, SBStream jarg2_); - public final static native boolean SBSymbol_IsExternal(long jarg1, SBSymbol jarg1_); - public final static native boolean SBSymbol_IsSynthetic(long jarg1, SBSymbol jarg1_); - public final static native String SBSymbol___repr__(long jarg1, SBSymbol jarg1_); - public final static native long new_SBSymbolContext__SWIG_0(); - public final static native long new_SBSymbolContext__SWIG_1(long jarg1, SBSymbolContext jarg1_); - public final static native void delete_SBSymbolContext(long jarg1); - public final static native boolean SBSymbolContext_IsValid(long jarg1, SBSymbolContext jarg1_); - public final static native long SBSymbolContext_GetModule(long jarg1, SBSymbolContext jarg1_); - public final static native long SBSymbolContext_GetCompileUnit(long jarg1, SBSymbolContext jarg1_); - public final static native long SBSymbolContext_GetFunction(long jarg1, SBSymbolContext jarg1_); - public final static native long SBSymbolContext_GetBlock(long jarg1, SBSymbolContext jarg1_); - public final static native long SBSymbolContext_GetLineEntry(long jarg1, SBSymbolContext jarg1_); - public final static native long SBSymbolContext_GetSymbol(long jarg1, SBSymbolContext jarg1_); - public final static native void SBSymbolContext_SetModule(long jarg1, SBSymbolContext jarg1_, long jarg2, SBModule jarg2_); - public final static native void SBSymbolContext_SetCompileUnit(long jarg1, SBSymbolContext jarg1_, long jarg2, SBCompileUnit jarg2_); - public final static native void SBSymbolContext_SetFunction(long jarg1, SBSymbolContext jarg1_, long jarg2, SBFunction jarg2_); - public final static native void SBSymbolContext_SetBlock(long jarg1, SBSymbolContext jarg1_, long jarg2, SBBlock jarg2_); - public final static native void SBSymbolContext_SetLineEntry(long jarg1, SBSymbolContext jarg1_, long jarg2, SBLineEntry jarg2_); - public final static native void SBSymbolContext_SetSymbol(long jarg1, SBSymbolContext jarg1_, long jarg2, SBSymbol jarg2_); - public final static native long SBSymbolContext_GetParentOfInlinedScope(long jarg1, SBSymbolContext jarg1_, long jarg2, SBAddress jarg2_, long jarg3, SBAddress jarg3_); - public final static native boolean SBSymbolContext_GetDescription(long jarg1, SBSymbolContext jarg1_, long jarg2, SBStream jarg2_); - public final static native String SBSymbolContext___repr__(long jarg1, SBSymbolContext jarg1_); - public final static native long new_SBSymbolContextList__SWIG_0(); - public final static native long new_SBSymbolContextList__SWIG_1(long jarg1, SBSymbolContextList jarg1_); - public final static native void delete_SBSymbolContextList(long jarg1); - public final static native boolean SBSymbolContextList_IsValid(long jarg1, SBSymbolContextList jarg1_); - public final static native long SBSymbolContextList_GetSize(long jarg1, SBSymbolContextList jarg1_); - public final static native long SBSymbolContextList_GetContextAtIndex(long jarg1, SBSymbolContextList jarg1_, long jarg2); - public final static native boolean SBSymbolContextList_GetDescription(long jarg1, SBSymbolContextList jarg1_, long jarg2, SBStream jarg2_); - public final static native void SBSymbolContextList_Append__SWIG_0(long jarg1, SBSymbolContextList jarg1_, long jarg2, SBSymbolContext jarg2_); - public final static native void SBSymbolContextList_Append__SWIG_1(long jarg1, SBSymbolContextList jarg1_, long jarg2, SBSymbolContextList jarg2_); - public final static native void SBSymbolContextList_Clear(long jarg1, SBSymbolContextList jarg1_); - public final static native String SBSymbolContextList___repr__(long jarg1, SBSymbolContextList jarg1_); - public final static native int SBTarget_eBroadcastBitBreakpointChanged_get(); - public final static native int SBTarget_eBroadcastBitModulesLoaded_get(); - public final static native int SBTarget_eBroadcastBitModulesUnloaded_get(); - public final static native int SBTarget_eBroadcastBitWatchpointChanged_get(); - public final static native int SBTarget_eBroadcastBitSymbolsLoaded_get(); - public final static native long new_SBTarget__SWIG_0(); - public final static native long new_SBTarget__SWIG_1(long jarg1, SBTarget jarg1_); - public final static native void delete_SBTarget(long jarg1); - public final static native boolean SBTarget_IsValid(long jarg1, SBTarget jarg1_); - public final static native boolean SBTarget_EventIsTargetEvent(long jarg1, SBEvent jarg1_); - public final static native long SBTarget_GetTargetFromEvent(long jarg1, SBEvent jarg1_); - public final static native long SBTarget_GetNumModulesFromEvent(long jarg1, SBEvent jarg1_); - public final static native long SBTarget_GetModuleAtIndexFromEvent(long jarg1, long jarg2, SBEvent jarg2_); - public final static native String SBTarget_GetBroadcasterClassName(); - public final static native long SBTarget_GetProcess(long jarg1, SBTarget jarg1_); - public final static native void SBTarget_SetCollectingStats(long jarg1, SBTarget jarg1_, boolean jarg2); - public final static native boolean SBTarget_GetCollectingStats(long jarg1, SBTarget jarg1_); - public final static native long SBTarget_GetStatistics(long jarg1, SBTarget jarg1_); - public final static native long SBTarget_GetPlatform(long jarg1, SBTarget jarg1_); - public final static native long SBTarget_GetEnvironment(long jarg1, SBTarget jarg1_); - public final static native long SBTarget_Install(long jarg1, SBTarget jarg1_); - public final static native long SBTarget_Launch__SWIG_0(long jarg1, SBTarget jarg1_, long jarg2, SBListener jarg2_, String[] jarg3, String[] jarg4, String jarg5, String jarg6, String jarg7, String jarg8, long jarg9, boolean jarg10, long jarg11, SBError jarg11_); - public final static native long SBTarget_LoadCore__SWIG_0(long jarg1, SBTarget jarg1_, String jarg2); - public final static native long SBTarget_LoadCore__SWIG_1(long jarg1, SBTarget jarg1_, String jarg2, long jarg3, SBError jarg3_); - public final static native long SBTarget_LaunchSimple(long jarg1, SBTarget jarg1_, String[] jarg2, String[] jarg3, String jarg4); - public final static native long SBTarget_Launch__SWIG_1(long jarg1, SBTarget jarg1_, long jarg2, SBLaunchInfo jarg2_, long jarg3, SBError jarg3_); - public final static native long SBTarget_Attach(long jarg1, SBTarget jarg1_, long jarg2, SBAttachInfo jarg2_, long jarg3, SBError jarg3_); - public final static native long SBTarget_AttachToProcessWithID(long jarg1, SBTarget jarg1_, long jarg2, SBListener jarg2_, java.math.BigInteger jarg3, long jarg4, SBError jarg4_); - public final static native long SBTarget_AttachToProcessWithName(long jarg1, SBTarget jarg1_, long jarg2, SBListener jarg2_, String jarg3, boolean jarg4, long jarg5, SBError jarg5_); - public final static native long SBTarget_ConnectRemote(long jarg1, SBTarget jarg1_, long jarg2, SBListener jarg2_, String jarg3, String jarg4, long jarg5, SBError jarg5_); - public final static native long SBTarget_GetExecutable(long jarg1, SBTarget jarg1_); - public final static native void SBTarget_AppendImageSearchPath(long jarg1, SBTarget jarg1_, String jarg2, String jarg3, long jarg4, SBError jarg4_); - public final static native boolean SBTarget_AddModule__SWIG_0(long jarg1, SBTarget jarg1_, long jarg2, SBModule jarg2_); - public final static native long SBTarget_AddModule__SWIG_1(long jarg1, SBTarget jarg1_, String jarg2, String jarg3, String jarg4); - public final static native long SBTarget_AddModule__SWIG_2(long jarg1, SBTarget jarg1_, String jarg2, String jarg3, String jarg4, String jarg5); - public final static native long SBTarget_AddModule__SWIG_3(long jarg1, SBTarget jarg1_, long jarg2, SBModuleSpec jarg2_); - public final static native long SBTarget_GetNumModules(long jarg1, SBTarget jarg1_); - public final static native long SBTarget_GetModuleAtIndex(long jarg1, SBTarget jarg1_, long jarg2); - public final static native boolean SBTarget_RemoveModule(long jarg1, SBTarget jarg1_, long jarg2, SBModule jarg2_); - public final static native long SBTarget_GetDebugger(long jarg1, SBTarget jarg1_); - public final static native long SBTarget_FindModule(long jarg1, SBTarget jarg1_, long jarg2, SBFileSpec jarg2_); - public final static native long SBTarget_FindCompileUnits(long jarg1, SBTarget jarg1_, long jarg2, SBFileSpec jarg2_); - public final static native int SBTarget_GetByteOrder(long jarg1, SBTarget jarg1_); - public final static native long SBTarget_GetAddressByteSize(long jarg1, SBTarget jarg1_); - public final static native String SBTarget_GetTriple(long jarg1, SBTarget jarg1_); - public final static native String SBTarget_GetABIName(long jarg1, SBTarget jarg1_); - public final static native String SBTarget_GetLabel(long jarg1, SBTarget jarg1_); - public final static native long SBTarget_SetLabel(long jarg1, SBTarget jarg1_, String jarg2); - public final static native long SBTarget_GetDataByteSize(long jarg1, SBTarget jarg1_); - public final static native long SBTarget_GetCodeByteSize(long jarg1, SBTarget jarg1_); - public final static native long SBTarget_GetMaximumNumberOfChildrenToDisplay(long jarg1, SBTarget jarg1_); - public final static native long SBTarget_SetSectionLoadAddress(long jarg1, SBTarget jarg1_, long jarg2, SBSection jarg2_, java.math.BigInteger jarg3); - public final static native long SBTarget_ClearSectionLoadAddress(long jarg1, SBTarget jarg1_, long jarg2, SBSection jarg2_); - public final static native long SBTarget_SetModuleLoadAddress(long jarg1, SBTarget jarg1_, long jarg2, SBModule jarg2_, java.math.BigInteger jarg3); - public final static native long SBTarget_ClearModuleLoadAddress(long jarg1, SBTarget jarg1_, long jarg2, SBModule jarg2_); - public final static native long SBTarget_FindFunctions__SWIG_0(long jarg1, SBTarget jarg1_, String jarg2, long jarg3); - public final static native long SBTarget_FindFunctions__SWIG_1(long jarg1, SBTarget jarg1_, String jarg2); - public final static native long SBTarget_FindGlobalVariables__SWIG_0(long jarg1, SBTarget jarg1_, String jarg2, long jarg3); - public final static native long SBTarget_FindFirstGlobalVariable(long jarg1, SBTarget jarg1_, String jarg2); - public final static native long SBTarget_FindGlobalVariables__SWIG_1(long jarg1, SBTarget jarg1_, String jarg2, long jarg3, int jarg4); - public final static native long SBTarget_FindGlobalFunctions(long jarg1, SBTarget jarg1_, String jarg2, long jarg3, int jarg4); - public final static native void SBTarget_Clear(long jarg1, SBTarget jarg1_); - public final static native long SBTarget_ResolveFileAddress(long jarg1, SBTarget jarg1_, java.math.BigInteger jarg2); - public final static native long SBTarget_ResolveLoadAddress(long jarg1, SBTarget jarg1_, java.math.BigInteger jarg2); - public final static native long SBTarget_ResolvePastLoadAddress(long jarg1, SBTarget jarg1_, long jarg2, java.math.BigInteger jarg3); - public final static native long SBTarget_ResolveSymbolContextForAddress(long jarg1, SBTarget jarg1_, long jarg2, SBAddress jarg2_, long jarg3); - public final static native long SBTarget_ReadMemory(long jarg1, SBTarget jarg1_, long jarg2, SBAddress jarg2_, long jarg3, long jarg4, long jarg5, SBError jarg5_); - public final static native long SBTarget_BreakpointCreateByLocation__SWIG_0(long jarg1, SBTarget jarg1_, String jarg2, long jarg3); - public final static native long SBTarget_BreakpointCreateByLocation__SWIG_1(long jarg1, SBTarget jarg1_, long jarg2, SBFileSpec jarg2_, long jarg3); - public final static native long SBTarget_BreakpointCreateByLocation__SWIG_2(long jarg1, SBTarget jarg1_, long jarg2, SBFileSpec jarg2_, long jarg3, java.math.BigInteger jarg4); - public final static native long SBTarget_BreakpointCreateByLocation__SWIG_3(long jarg1, SBTarget jarg1_, long jarg2, SBFileSpec jarg2_, long jarg3, java.math.BigInteger jarg4, long jarg5, SBFileSpecList jarg5_); - public final static native long SBTarget_BreakpointCreateByLocation__SWIG_4(long jarg1, SBTarget jarg1_, long jarg2, SBFileSpec jarg2_, long jarg3, long jarg4, java.math.BigInteger jarg5, long jarg6, SBFileSpecList jarg6_); - public final static native long SBTarget_BreakpointCreateByLocation__SWIG_5(long jarg1, SBTarget jarg1_, long jarg2, SBFileSpec jarg2_, long jarg3, long jarg4, java.math.BigInteger jarg5, long jarg6, SBFileSpecList jarg6_, boolean jarg7); - public final static native long SBTarget_BreakpointCreateByName__SWIG_0(long jarg1, SBTarget jarg1_, String jarg2, String jarg3); - public final static native long SBTarget_BreakpointCreateByName__SWIG_1(long jarg1, SBTarget jarg1_, String jarg2); - public final static native long SBTarget_BreakpointCreateByName__SWIG_2(long jarg1, SBTarget jarg1_, String jarg2, long jarg3, SBFileSpecList jarg3_, long jarg4, SBFileSpecList jarg4_); - public final static native long SBTarget_BreakpointCreateByName__SWIG_3(long jarg1, SBTarget jarg1_, String jarg2, long jarg3, long jarg4, SBFileSpecList jarg4_, long jarg5, SBFileSpecList jarg5_); - public final static native long SBTarget_BreakpointCreateByName__SWIG_4(long jarg1, SBTarget jarg1_, String jarg2, long jarg3, int jarg4, long jarg5, SBFileSpecList jarg5_, long jarg6, SBFileSpecList jarg6_); - public final static native long SBTarget_BreakpointCreateByNames__SWIG_0(long jarg1, SBTarget jarg1_, String[] jarg2, long jarg3, long jarg4, long jarg5, SBFileSpecList jarg5_, long jarg6, SBFileSpecList jarg6_); - public final static native long SBTarget_BreakpointCreateByNames__SWIG_1(long jarg1, SBTarget jarg1_, String[] jarg2, long jarg3, long jarg4, int jarg5, long jarg6, SBFileSpecList jarg6_, long jarg7, SBFileSpecList jarg7_); - public final static native long SBTarget_BreakpointCreateByNames__SWIG_2(long jarg1, SBTarget jarg1_, String[] jarg2, long jarg3, long jarg4, int jarg5, java.math.BigInteger jarg6, long jarg7, SBFileSpecList jarg7_, long jarg8, SBFileSpecList jarg8_); - public final static native long SBTarget_BreakpointCreateByRegex__SWIG_0(long jarg1, SBTarget jarg1_, String jarg2, String jarg3); - public final static native long SBTarget_BreakpointCreateByRegex__SWIG_1(long jarg1, SBTarget jarg1_, String jarg2); - public final static native long SBTarget_BreakpointCreateByRegex__SWIG_2(long jarg1, SBTarget jarg1_, String jarg2, long jarg3, SBFileSpecList jarg3_, long jarg4, SBFileSpecList jarg4_); - public final static native long SBTarget_BreakpointCreateByRegex__SWIG_3(long jarg1, SBTarget jarg1_, String jarg2, int jarg3, long jarg4, SBFileSpecList jarg4_, long jarg5, SBFileSpecList jarg5_); - public final static native long SBTarget_BreakpointCreateBySourceRegex__SWIG_0(long jarg1, SBTarget jarg1_, String jarg2, long jarg3, SBFileSpec jarg3_, String jarg4); - public final static native long SBTarget_BreakpointCreateBySourceRegex__SWIG_1(long jarg1, SBTarget jarg1_, String jarg2, long jarg3, SBFileSpec jarg3_); - public final static native long SBTarget_BreakpointCreateBySourceRegex__SWIG_2(long jarg1, SBTarget jarg1_, String jarg2, long jarg3, SBFileSpecList jarg3_, long jarg4, SBFileSpecList jarg4_); - public final static native long SBTarget_BreakpointCreateBySourceRegex__SWIG_3(long jarg1, SBTarget jarg1_, String jarg2, long jarg3, SBFileSpecList jarg3_, long jarg4, SBFileSpecList jarg4_, long jarg5, SBStringList jarg5_); - public final static native long SBTarget_BreakpointCreateForException(long jarg1, SBTarget jarg1_, int jarg2, boolean jarg3, boolean jarg4); - public final static native long SBTarget_BreakpointCreateByAddress(long jarg1, SBTarget jarg1_, java.math.BigInteger jarg2); - public final static native long SBTarget_BreakpointCreateBySBAddress(long jarg1, SBTarget jarg1_, long jarg2, SBAddress jarg2_); - public final static native long SBTarget_BreakpointCreateFromScript__SWIG_0(long jarg1, SBTarget jarg1_, String jarg2, long jarg3, SBStructuredData jarg3_, long jarg4, SBFileSpecList jarg4_, long jarg5, SBFileSpecList jarg5_, boolean jarg6); - public final static native long SBTarget_BreakpointCreateFromScript__SWIG_1(long jarg1, SBTarget jarg1_, String jarg2, long jarg3, SBStructuredData jarg3_, long jarg4, SBFileSpecList jarg4_, long jarg5, SBFileSpecList jarg5_); - public final static native long SBTarget_BreakpointsCreateFromFile__SWIG_0(long jarg1, SBTarget jarg1_, long jarg2, SBFileSpec jarg2_, long jarg3, SBBreakpointList jarg3_); - public final static native long SBTarget_BreakpointsCreateFromFile__SWIG_1(long jarg1, SBTarget jarg1_, long jarg2, SBFileSpec jarg2_, long jarg3, SBStringList jarg3_, long jarg4, SBBreakpointList jarg4_); - public final static native long SBTarget_BreakpointsWriteToFile__SWIG_0(long jarg1, SBTarget jarg1_, long jarg2, SBFileSpec jarg2_); - public final static native long SBTarget_BreakpointsWriteToFile__SWIG_1(long jarg1, SBTarget jarg1_, long jarg2, SBFileSpec jarg2_, long jarg3, SBBreakpointList jarg3_, boolean jarg4); - public final static native long SBTarget_BreakpointsWriteToFile__SWIG_2(long jarg1, SBTarget jarg1_, long jarg2, SBFileSpec jarg2_, long jarg3, SBBreakpointList jarg3_); - public final static native long SBTarget_GetNumBreakpoints(long jarg1, SBTarget jarg1_); - public final static native long SBTarget_GetBreakpointAtIndex(long jarg1, SBTarget jarg1_, long jarg2); - public final static native boolean SBTarget_BreakpointDelete(long jarg1, SBTarget jarg1_, int jarg2); - public final static native long SBTarget_FindBreakpointByID(long jarg1, SBTarget jarg1_, int jarg2); - public final static native boolean SBTarget_FindBreakpointsByName(long jarg1, SBTarget jarg1_, String jarg2, long jarg3, SBBreakpointList jarg3_); - public final static native void SBTarget_GetBreakpointNames(long jarg1, SBTarget jarg1_, long jarg2, SBStringList jarg2_); - public final static native void SBTarget_DeleteBreakpointName(long jarg1, SBTarget jarg1_, String jarg2); - public final static native boolean SBTarget_EnableAllBreakpoints(long jarg1, SBTarget jarg1_); - public final static native boolean SBTarget_DisableAllBreakpoints(long jarg1, SBTarget jarg1_); - public final static native boolean SBTarget_DeleteAllBreakpoints(long jarg1, SBTarget jarg1_); - public final static native long SBTarget_GetNumWatchpoints(long jarg1, SBTarget jarg1_); - public final static native long SBTarget_GetWatchpointAtIndex(long jarg1, SBTarget jarg1_, long jarg2); - public final static native boolean SBTarget_DeleteWatchpoint(long jarg1, SBTarget jarg1_, int jarg2); - public final static native long SBTarget_FindWatchpointByID(long jarg1, SBTarget jarg1_, int jarg2); - public final static native long SBTarget_WatchAddress(long jarg1, SBTarget jarg1_, java.math.BigInteger jarg2, long jarg3, boolean jarg4, boolean jarg5, long jarg6, SBError jarg6_); - public final static native boolean SBTarget_EnableAllWatchpoints(long jarg1, SBTarget jarg1_); - public final static native boolean SBTarget_DisableAllWatchpoints(long jarg1, SBTarget jarg1_); - public final static native boolean SBTarget_DeleteAllWatchpoints(long jarg1, SBTarget jarg1_); - public final static native long SBTarget_GetBroadcaster(long jarg1, SBTarget jarg1_); - public final static native long SBTarget_FindFirstType(long jarg1, SBTarget jarg1_, String jarg2); - public final static native long SBTarget_FindTypes(long jarg1, SBTarget jarg1_, String jarg2); - public final static native long SBTarget_GetBasicType(long jarg1, SBTarget jarg1_, int jarg2); - public final static native long SBTarget_CreateValueFromAddress(long jarg1, SBTarget jarg1_, String jarg2, long jarg3, SBAddress jarg3_, long jarg4, SBType jarg4_); - public final static native long SBTarget_CreateValueFromData(long jarg1, SBTarget jarg1_, String jarg2, long jarg3, SBData jarg3_, long jarg4, SBType jarg4_); - public final static native long SBTarget_CreateValueFromExpression(long jarg1, SBTarget jarg1_, String jarg2, String jarg3); - public final static native long SBTarget_GetSourceManager(long jarg1, SBTarget jarg1_); - public final static native long SBTarget_ReadInstructions__SWIG_0(long jarg1, SBTarget jarg1_, long jarg2, SBAddress jarg2_, long jarg3); - public final static native long SBTarget_ReadInstructions__SWIG_1(long jarg1, SBTarget jarg1_, long jarg2, SBAddress jarg2_, long jarg3, String jarg4); - public final static native long SBTarget_GetInstructions(long jarg1, SBTarget jarg1_, long jarg2, SBAddress jarg2_, long jarg3, long jarg4); - public final static native long SBTarget_GetInstructionsWithFlavor(long jarg1, SBTarget jarg1_, long jarg2, SBAddress jarg2_, String jarg3, long jarg4, long jarg5); - public final static native long SBTarget_FindSymbols__SWIG_0(long jarg1, SBTarget jarg1_, String jarg2, int jarg3); - public final static native long SBTarget_FindSymbols__SWIG_1(long jarg1, SBTarget jarg1_, String jarg2); - public final static native boolean SBTarget_GetDescription(long jarg1, SBTarget jarg1_, long jarg2, SBStream jarg2_, int jarg3); - public final static native long SBTarget_EvaluateExpression__SWIG_0(long jarg1, SBTarget jarg1_, String jarg2); - public final static native long SBTarget_EvaluateExpression__SWIG_1(long jarg1, SBTarget jarg1_, String jarg2, long jarg3, SBExpressionOptions jarg3_); - public final static native java.math.BigInteger SBTarget_GetStackRedZoneSize(long jarg1, SBTarget jarg1_); - public final static native boolean SBTarget_IsLoaded(long jarg1, SBTarget jarg1_, long jarg2, SBModule jarg2_); - public final static native long SBTarget_GetLaunchInfo(long jarg1, SBTarget jarg1_); - public final static native void SBTarget_SetLaunchInfo(long jarg1, SBTarget jarg1_, long jarg2, SBLaunchInfo jarg2_); - public final static native long SBTarget_GetTrace(long jarg1, SBTarget jarg1_); - public final static native long SBTarget_CreateTrace(long jarg1, SBTarget jarg1_, long jarg2, SBError jarg2_); - public final static native String SBTarget___repr__(long jarg1, SBTarget jarg1_); - public final static native int SBThread_eBroadcastBitStackChanged_get(); - public final static native int SBThread_eBroadcastBitThreadSuspended_get(); - public final static native int SBThread_eBroadcastBitThreadResumed_get(); - public final static native int SBThread_eBroadcastBitSelectedFrameChanged_get(); - public final static native int SBThread_eBroadcastBitThreadSelected_get(); - public final static native String SBThread_GetBroadcasterClassName(); - public final static native long new_SBThread__SWIG_0(); - public final static native long new_SBThread__SWIG_1(long jarg1, SBThread jarg1_); - public final static native void delete_SBThread(long jarg1); - public final static native long SBThread_GetQueue(long jarg1, SBThread jarg1_); - public final static native boolean SBThread_IsValid(long jarg1, SBThread jarg1_); - public final static native void SBThread_Clear(long jarg1, SBThread jarg1_); - public final static native int SBThread_GetStopReason(long jarg1, SBThread jarg1_); - public final static native long SBThread_GetStopReasonDataCount(long jarg1, SBThread jarg1_); - public final static native java.math.BigInteger SBThread_GetStopReasonDataAtIndex(long jarg1, SBThread jarg1_, long jarg2); - public final static native boolean SBThread_GetStopReasonExtendedInfoAsJSON(long jarg1, SBThread jarg1_, long jarg2, SBStream jarg2_); - public final static native long SBThread_GetStopReasonExtendedBacktraces(long jarg1, SBThread jarg1_, int jarg2); - public final static native long SBThread_GetStopDescription(long jarg1, SBThread jarg1_, String jarg2, long jarg3); - public final static native long SBThread_GetStopReturnValue(long jarg1, SBThread jarg1_); - public final static native java.math.BigInteger SBThread_GetThreadID(long jarg1, SBThread jarg1_); - public final static native long SBThread_GetIndexID(long jarg1, SBThread jarg1_); - public final static native String SBThread_GetName(long jarg1, SBThread jarg1_); - public final static native String SBThread_GetQueueName(long jarg1, SBThread jarg1_); - public final static native java.math.BigInteger SBThread_GetQueueID(long jarg1, SBThread jarg1_); - public final static native boolean SBThread_GetInfoItemByPathAsString(long jarg1, SBThread jarg1_, String jarg2, long jarg3, SBStream jarg3_); - public final static native void SBThread_StepOver__SWIG_0(long jarg1, SBThread jarg1_, int jarg2); - public final static native void SBThread_StepOver__SWIG_1(long jarg1, SBThread jarg1_); - public final static native void SBThread_StepOver__SWIG_2(long jarg1, SBThread jarg1_, int jarg2, long jarg3, SBError jarg3_); - public final static native void SBThread_StepInto__SWIG_0(long jarg1, SBThread jarg1_, int jarg2); - public final static native void SBThread_StepInto__SWIG_1(long jarg1, SBThread jarg1_); - public final static native void SBThread_StepInto__SWIG_2(long jarg1, SBThread jarg1_, String jarg2, int jarg3); - public final static native void SBThread_StepInto__SWIG_3(long jarg1, SBThread jarg1_, String jarg2); - public final static native void SBThread_StepInto__SWIG_4(long jarg1, SBThread jarg1_, String jarg2, long jarg3, long jarg4, SBError jarg4_, int jarg5); - public final static native void SBThread_StepInto__SWIG_5(long jarg1, SBThread jarg1_, String jarg2, long jarg3, long jarg4, SBError jarg4_); - public final static native void SBThread_StepOut__SWIG_0(long jarg1, SBThread jarg1_); - public final static native void SBThread_StepOut__SWIG_1(long jarg1, SBThread jarg1_, long jarg2, SBError jarg2_); - public final static native void SBThread_StepOutOfFrame__SWIG_0(long jarg1, SBThread jarg1_, long jarg2, SBFrame jarg2_); - public final static native void SBThread_StepOutOfFrame__SWIG_1(long jarg1, SBThread jarg1_, long jarg2, SBFrame jarg2_, long jarg3, SBError jarg3_); - public final static native void SBThread_StepInstruction__SWIG_0(long jarg1, SBThread jarg1_, boolean jarg2); - public final static native void SBThread_StepInstruction__SWIG_1(long jarg1, SBThread jarg1_, boolean jarg2, long jarg3, SBError jarg3_); - public final static native long SBThread_StepOverUntil(long jarg1, SBThread jarg1_, long jarg2, SBFrame jarg2_, long jarg3, SBFileSpec jarg3_, long jarg4); - public final static native long SBThread_StepUsingScriptedThreadPlan__SWIG_0(long jarg1, SBThread jarg1_, String jarg2); - public final static native long SBThread_StepUsingScriptedThreadPlan__SWIG_1(long jarg1, SBThread jarg1_, String jarg2, boolean jarg3); - public final static native long SBThread_StepUsingScriptedThreadPlan__SWIG_2(long jarg1, SBThread jarg1_, String jarg2, long jarg3, SBStructuredData jarg3_, boolean jarg4); - public final static native long SBThread_JumpToLine(long jarg1, SBThread jarg1_, long jarg2, SBFileSpec jarg2_, long jarg3); - public final static native void SBThread_RunToAddress__SWIG_0(long jarg1, SBThread jarg1_, java.math.BigInteger jarg2); - public final static native void SBThread_RunToAddress__SWIG_1(long jarg1, SBThread jarg1_, java.math.BigInteger jarg2, long jarg3, SBError jarg3_); - public final static native long SBThread_ReturnFromFrame(long jarg1, SBThread jarg1_, long jarg2, SBFrame jarg2_, long jarg3, SBValue jarg3_); - public final static native long SBThread_UnwindInnermostExpression(long jarg1, SBThread jarg1_); - public final static native boolean SBThread_Suspend__SWIG_0(long jarg1, SBThread jarg1_); - public final static native boolean SBThread_Suspend__SWIG_1(long jarg1, SBThread jarg1_, long jarg2, SBError jarg2_); - public final static native boolean SBThread_Resume__SWIG_0(long jarg1, SBThread jarg1_); - public final static native boolean SBThread_Resume__SWIG_1(long jarg1, SBThread jarg1_, long jarg2, SBError jarg2_); - public final static native boolean SBThread_IsSuspended(long jarg1, SBThread jarg1_); - public final static native boolean SBThread_IsStopped(long jarg1, SBThread jarg1_); - public final static native long SBThread_GetNumFrames(long jarg1, SBThread jarg1_); - public final static native long SBThread_GetFrameAtIndex(long jarg1, SBThread jarg1_, long jarg2); - public final static native long SBThread_GetSelectedFrame(long jarg1, SBThread jarg1_); - public final static native long SBThread_SetSelectedFrame(long jarg1, SBThread jarg1_, long jarg2); - public final static native boolean SBThread_EventIsThreadEvent(long jarg1, SBEvent jarg1_); - public final static native long SBThread_GetStackFrameFromEvent(long jarg1, SBEvent jarg1_); - public final static native long SBThread_GetThreadFromEvent(long jarg1, SBEvent jarg1_); - public final static native long SBThread_GetProcess(long jarg1, SBThread jarg1_); - public final static native boolean SBThread_GetDescription__SWIG_0(long jarg1, SBThread jarg1_, long jarg2, SBStream jarg2_); - public final static native boolean SBThread_GetDescription__SWIG_1(long jarg1, SBThread jarg1_, long jarg2, SBStream jarg2_, boolean jarg3); - public final static native boolean SBThread_GetStatus(long jarg1, SBThread jarg1_, long jarg2, SBStream jarg2_); - public final static native long SBThread_GetExtendedBacktraceThread(long jarg1, SBThread jarg1_, String jarg2); - public final static native long SBThread_GetExtendedBacktraceOriginatingIndexID(long jarg1, SBThread jarg1_); - public final static native long SBThread_GetCurrentException(long jarg1, SBThread jarg1_); - public final static native long SBThread_GetCurrentExceptionBacktrace(long jarg1, SBThread jarg1_); - public final static native boolean SBThread_SafeToCallFunctions(long jarg1, SBThread jarg1_); - public final static native long SBThread_GetSiginfo(long jarg1, SBThread jarg1_); - public final static native String SBThread___repr__(long jarg1, SBThread jarg1_); - public final static native long new_SBThreadCollection__SWIG_0(); - public final static native long new_SBThreadCollection__SWIG_1(long jarg1, SBThreadCollection jarg1_); - public final static native void delete_SBThreadCollection(long jarg1); - public final static native boolean SBThreadCollection_IsValid(long jarg1, SBThreadCollection jarg1_); - public final static native long SBThreadCollection_GetSize(long jarg1, SBThreadCollection jarg1_); - public final static native long SBThreadCollection_GetThreadAtIndex(long jarg1, SBThreadCollection jarg1_, long jarg2); - public final static native long new_SBThreadPlan__SWIG_0(); - public final static native long new_SBThreadPlan__SWIG_1(long jarg1, SBThreadPlan jarg1_); - public final static native long new_SBThreadPlan__SWIG_2(long jarg1, SBThread jarg1_, String jarg2); - public final static native long new_SBThreadPlan__SWIG_3(long jarg1, SBThread jarg1_, String jarg2, long jarg3, SBStructuredData jarg3_); - public final static native void delete_SBThreadPlan(long jarg1); - public final static native boolean SBThreadPlan_IsValid__SWIG_0(long jarg1, SBThreadPlan jarg1_); - public final static native void SBThreadPlan_Clear(long jarg1, SBThreadPlan jarg1_); - public final static native int SBThreadPlan_GetStopReason(long jarg1, SBThreadPlan jarg1_); - public final static native long SBThreadPlan_GetStopReasonDataCount(long jarg1, SBThreadPlan jarg1_); - public final static native java.math.BigInteger SBThreadPlan_GetStopReasonDataAtIndex(long jarg1, SBThreadPlan jarg1_, long jarg2); - public final static native long SBThreadPlan_GetThread(long jarg1, SBThreadPlan jarg1_); - public final static native boolean SBThreadPlan_GetDescription(long jarg1, SBThreadPlan jarg1_, long jarg2, SBStream jarg2_); - public final static native void SBThreadPlan_SetPlanComplete(long jarg1, SBThreadPlan jarg1_, boolean jarg2); - public final static native boolean SBThreadPlan_IsPlanComplete(long jarg1, SBThreadPlan jarg1_); - public final static native boolean SBThreadPlan_IsPlanStale(long jarg1, SBThreadPlan jarg1_); - public final static native boolean SBThreadPlan_GetStopOthers(long jarg1, SBThreadPlan jarg1_); - public final static native void SBThreadPlan_SetStopOthers(long jarg1, SBThreadPlan jarg1_, boolean jarg2); - public final static native long SBThreadPlan_QueueThreadPlanForStepOverRange__SWIG_0(long jarg1, SBThreadPlan jarg1_, long jarg2, SBAddress jarg2_, java.math.BigInteger jarg3); - public final static native long SBThreadPlan_QueueThreadPlanForStepOverRange__SWIG_1(long jarg1, SBThreadPlan jarg1_, long jarg2, SBAddress jarg2_, java.math.BigInteger jarg3, long jarg4, SBError jarg4_); - public final static native long SBThreadPlan_QueueThreadPlanForStepInRange__SWIG_0(long jarg1, SBThreadPlan jarg1_, long jarg2, SBAddress jarg2_, java.math.BigInteger jarg3); - public final static native long SBThreadPlan_QueueThreadPlanForStepInRange__SWIG_1(long jarg1, SBThreadPlan jarg1_, long jarg2, SBAddress jarg2_, java.math.BigInteger jarg3, long jarg4, SBError jarg4_); - public final static native long SBThreadPlan_QueueThreadPlanForStepOut__SWIG_0(long jarg1, SBThreadPlan jarg1_, long jarg2, boolean jarg3); - public final static native long SBThreadPlan_QueueThreadPlanForStepOut__SWIG_1(long jarg1, SBThreadPlan jarg1_, long jarg2); - public final static native long SBThreadPlan_QueueThreadPlanForStepOut__SWIG_2(long jarg1, SBThreadPlan jarg1_, long jarg2, boolean jarg3, long jarg4, SBError jarg4_); - public final static native long SBThreadPlan_QueueThreadPlanForRunToAddress__SWIG_0(long jarg1, SBThreadPlan jarg1_, long jarg2, SBAddress jarg2_); - public final static native long SBThreadPlan_QueueThreadPlanForRunToAddress__SWIG_1(long jarg1, SBThreadPlan jarg1_, long jarg2, SBAddress jarg2_, long jarg3, SBError jarg3_); - public final static native long SBThreadPlan_QueueThreadPlanForStepScripted__SWIG_0(long jarg1, SBThreadPlan jarg1_, String jarg2); - public final static native long SBThreadPlan_QueueThreadPlanForStepScripted__SWIG_1(long jarg1, SBThreadPlan jarg1_, String jarg2, long jarg3, SBError jarg3_); - public final static native long SBThreadPlan_QueueThreadPlanForStepScripted__SWIG_2(long jarg1, SBThreadPlan jarg1_, String jarg2, long jarg3, SBStructuredData jarg3_, long jarg4, SBError jarg4_); - public final static native long new_SBTrace(); - public final static native long SBTrace_LoadTraceFromFile(long jarg1, SBError jarg1_, long jarg2, SBDebugger jarg2_, long jarg3, SBFileSpec jarg3_); - public final static native long SBTrace_CreateNewCursor(long jarg1, SBTrace jarg1_, long jarg2, SBError jarg2_, long jarg3, SBThread jarg3_); - public final static native long SBTrace_SaveToDisk__SWIG_0(long jarg1, SBTrace jarg1_, long jarg2, SBError jarg2_, long jarg3, SBFileSpec jarg3_, boolean jarg4); - public final static native long SBTrace_SaveToDisk__SWIG_1(long jarg1, SBTrace jarg1_, long jarg2, SBError jarg2_, long jarg3, SBFileSpec jarg3_); - public final static native String SBTrace_GetStartConfigurationHelp(long jarg1, SBTrace jarg1_); - public final static native long SBTrace_Start__SWIG_0(long jarg1, SBTrace jarg1_, long jarg2, SBStructuredData jarg2_); - public final static native long SBTrace_Start__SWIG_1(long jarg1, SBTrace jarg1_, long jarg2, SBThread jarg2_, long jarg3, SBStructuredData jarg3_); - public final static native long SBTrace_Stop__SWIG_0(long jarg1, SBTrace jarg1_); - public final static native long SBTrace_Stop__SWIG_1(long jarg1, SBTrace jarg1_, long jarg2, SBThread jarg2_); - public final static native boolean SBTrace_IsValid(long jarg1, SBTrace jarg1_); - public final static native void delete_SBTrace(long jarg1); - public final static native long new_SBTraceCursor(); - public final static native void SBTraceCursor_SetForwards(long jarg1, SBTraceCursor jarg1_, boolean jarg2); - public final static native boolean SBTraceCursor_IsForwards(long jarg1, SBTraceCursor jarg1_); - public final static native void SBTraceCursor_Next(long jarg1, SBTraceCursor jarg1_); - public final static native boolean SBTraceCursor_HasValue(long jarg1, SBTraceCursor jarg1_); - public final static native boolean SBTraceCursor_GoToId(long jarg1, SBTraceCursor jarg1_, java.math.BigInteger jarg2); - public final static native boolean SBTraceCursor_HasId(long jarg1, SBTraceCursor jarg1_, java.math.BigInteger jarg2); - public final static native java.math.BigInteger SBTraceCursor_GetId(long jarg1, SBTraceCursor jarg1_); - public final static native boolean SBTraceCursor_Seek(long jarg1, SBTraceCursor jarg1_, long jarg2, int jarg3); - public final static native int SBTraceCursor_GetItemKind(long jarg1, SBTraceCursor jarg1_); - public final static native boolean SBTraceCursor_IsError(long jarg1, SBTraceCursor jarg1_); - public final static native String SBTraceCursor_GetError(long jarg1, SBTraceCursor jarg1_); - public final static native boolean SBTraceCursor_IsEvent(long jarg1, SBTraceCursor jarg1_); - public final static native int SBTraceCursor_GetEventType(long jarg1, SBTraceCursor jarg1_); - public final static native String SBTraceCursor_GetEventTypeAsString(long jarg1, SBTraceCursor jarg1_); - public final static native boolean SBTraceCursor_IsInstruction(long jarg1, SBTraceCursor jarg1_); - public final static native java.math.BigInteger SBTraceCursor_GetLoadAddress(long jarg1, SBTraceCursor jarg1_); - public final static native long SBTraceCursor_GetCPU(long jarg1, SBTraceCursor jarg1_); - public final static native boolean SBTraceCursor_IsValid(long jarg1, SBTraceCursor jarg1_); - public final static native void delete_SBTraceCursor(long jarg1); - public final static native long new_SBTypeMember__SWIG_0(); - public final static native long new_SBTypeMember__SWIG_1(long jarg1, SBTypeMember jarg1_); - public final static native void delete_SBTypeMember(long jarg1); - public final static native boolean SBTypeMember_IsValid(long jarg1, SBTypeMember jarg1_); - public final static native String SBTypeMember_GetName(long jarg1, SBTypeMember jarg1_); - public final static native long SBTypeMember_GetType(long jarg1, SBTypeMember jarg1_); - public final static native java.math.BigInteger SBTypeMember_GetOffsetInBytes(long jarg1, SBTypeMember jarg1_); - public final static native java.math.BigInteger SBTypeMember_GetOffsetInBits(long jarg1, SBTypeMember jarg1_); - public final static native boolean SBTypeMember_IsBitfield(long jarg1, SBTypeMember jarg1_); - public final static native long SBTypeMember_GetBitfieldSizeInBits(long jarg1, SBTypeMember jarg1_); - public final static native boolean SBTypeMember_GetDescription(long jarg1, SBTypeMember jarg1_, long jarg2, SBStream jarg2_, int jarg3); - public final static native String SBTypeMember___repr__(long jarg1, SBTypeMember jarg1_); - public final static native long new_SBTypeMemberFunction__SWIG_0(); - public final static native long new_SBTypeMemberFunction__SWIG_1(long jarg1, SBTypeMemberFunction jarg1_); - public final static native void delete_SBTypeMemberFunction(long jarg1); - public final static native boolean SBTypeMemberFunction_IsValid(long jarg1, SBTypeMemberFunction jarg1_); - public final static native String SBTypeMemberFunction_GetName(long jarg1, SBTypeMemberFunction jarg1_); - public final static native String SBTypeMemberFunction_GetDemangledName(long jarg1, SBTypeMemberFunction jarg1_); - public final static native String SBTypeMemberFunction_GetMangledName(long jarg1, SBTypeMemberFunction jarg1_); - public final static native long SBTypeMemberFunction_GetType(long jarg1, SBTypeMemberFunction jarg1_); - public final static native long SBTypeMemberFunction_GetReturnType(long jarg1, SBTypeMemberFunction jarg1_); - public final static native long SBTypeMemberFunction_GetNumberOfArguments(long jarg1, SBTypeMemberFunction jarg1_); - public final static native long SBTypeMemberFunction_GetArgumentTypeAtIndex(long jarg1, SBTypeMemberFunction jarg1_, long jarg2); - public final static native int SBTypeMemberFunction_GetKind(long jarg1, SBTypeMemberFunction jarg1_); - public final static native boolean SBTypeMemberFunction_GetDescription(long jarg1, SBTypeMemberFunction jarg1_, long jarg2, SBStream jarg2_, int jarg3); - public final static native String SBTypeMemberFunction___repr__(long jarg1, SBTypeMemberFunction jarg1_); - public final static native long new_SBType__SWIG_0(); - public final static native long new_SBType__SWIG_1(long jarg1, SBType jarg1_); - public final static native void delete_SBType(long jarg1); - public final static native boolean SBType_IsValid(long jarg1, SBType jarg1_); - public final static native java.math.BigInteger SBType_GetByteSize(long jarg1, SBType jarg1_); - public final static native boolean SBType_IsPointerType(long jarg1, SBType jarg1_); - public final static native boolean SBType_IsReferenceType(long jarg1, SBType jarg1_); - public final static native boolean SBType_IsFunctionType(long jarg1, SBType jarg1_); - public final static native boolean SBType_IsPolymorphicClass(long jarg1, SBType jarg1_); - public final static native boolean SBType_IsArrayType(long jarg1, SBType jarg1_); - public final static native boolean SBType_IsVectorType(long jarg1, SBType jarg1_); - public final static native boolean SBType_IsTypedefType(long jarg1, SBType jarg1_); - public final static native boolean SBType_IsAnonymousType(long jarg1, SBType jarg1_); - public final static native boolean SBType_IsScopedEnumerationType(long jarg1, SBType jarg1_); - public final static native boolean SBType_IsAggregateType(long jarg1, SBType jarg1_); - public final static native long SBType_GetPointerType(long jarg1, SBType jarg1_); - public final static native long SBType_GetPointeeType(long jarg1, SBType jarg1_); - public final static native long SBType_GetReferenceType(long jarg1, SBType jarg1_); - public final static native long SBType_GetTypedefedType(long jarg1, SBType jarg1_); - public final static native long SBType_GetDereferencedType(long jarg1, SBType jarg1_); - public final static native long SBType_GetUnqualifiedType(long jarg1, SBType jarg1_); - public final static native long SBType_GetArrayElementType(long jarg1, SBType jarg1_); - public final static native long SBType_GetArrayType(long jarg1, SBType jarg1_, java.math.BigInteger jarg2); - public final static native long SBType_GetVectorElementType(long jarg1, SBType jarg1_); - public final static native long SBType_GetCanonicalType(long jarg1, SBType jarg1_); - public final static native long SBType_GetEnumerationIntegerType(long jarg1, SBType jarg1_); - public final static native int SBType_GetBasicType__SWIG_0(long jarg1, SBType jarg1_); - public final static native long SBType_GetBasicType__SWIG_1(long jarg1, SBType jarg1_, int jarg2); - public final static native long SBType_GetNumberOfFields(long jarg1, SBType jarg1_); - public final static native long SBType_GetNumberOfDirectBaseClasses(long jarg1, SBType jarg1_); - public final static native long SBType_GetNumberOfVirtualBaseClasses(long jarg1, SBType jarg1_); - public final static native long SBType_GetFieldAtIndex(long jarg1, SBType jarg1_, long jarg2); - public final static native long SBType_GetDirectBaseClassAtIndex(long jarg1, SBType jarg1_, long jarg2); - public final static native long SBType_GetVirtualBaseClassAtIndex(long jarg1, SBType jarg1_, long jarg2); - public final static native long SBType_GetEnumMembers(long jarg1, SBType jarg1_); - public final static native long SBType_GetNumberOfTemplateArguments(long jarg1, SBType jarg1_); - public final static native long SBType_GetTemplateArgumentType(long jarg1, SBType jarg1_, long jarg2); - public final static native int SBType_GetTemplateArgumentKind(long jarg1, SBType jarg1_, long jarg2); - public final static native long SBType_GetFunctionReturnType(long jarg1, SBType jarg1_); - public final static native long SBType_GetFunctionArgumentTypes(long jarg1, SBType jarg1_); - public final static native long SBType_GetNumberOfMemberFunctions(long jarg1, SBType jarg1_); - public final static native long SBType_GetMemberFunctionAtIndex(long jarg1, SBType jarg1_, long jarg2); - public final static native long SBType_GetModule(long jarg1, SBType jarg1_); - public final static native String SBType_GetName(long jarg1, SBType jarg1_); - public final static native String SBType_GetDisplayTypeName(long jarg1, SBType jarg1_); - public final static native int SBType_GetTypeClass(long jarg1, SBType jarg1_); - public final static native boolean SBType_IsTypeComplete(long jarg1, SBType jarg1_); - public final static native long SBType_GetTypeFlags(long jarg1, SBType jarg1_); - public final static native boolean SBType_GetDescription(long jarg1, SBType jarg1_, long jarg2, SBStream jarg2_, int jarg3); - public final static native String SBType___repr__(long jarg1, SBType jarg1_); - public final static native long new_SBTypeList__SWIG_0(); - public final static native long new_SBTypeList__SWIG_1(long jarg1, SBTypeList jarg1_); - public final static native void delete_SBTypeList(long jarg1); - public final static native boolean SBTypeList_IsValid(long jarg1, SBTypeList jarg1_); - public final static native void SBTypeList_Append(long jarg1, SBTypeList jarg1_, long jarg2, SBType jarg2_); - public final static native long SBTypeList_GetTypeAtIndex(long jarg1, SBTypeList jarg1_, long jarg2); - public final static native long SBTypeList_GetSize(long jarg1, SBTypeList jarg1_); - public final static native long new_SBTypeCategory__SWIG_0(); - public final static native long new_SBTypeCategory__SWIG_1(long jarg1, SBTypeCategory jarg1_); - public final static native void delete_SBTypeCategory(long jarg1); - public final static native boolean SBTypeCategory_IsValid(long jarg1, SBTypeCategory jarg1_); - public final static native boolean SBTypeCategory_GetEnabled(long jarg1, SBTypeCategory jarg1_); - public final static native void SBTypeCategory_SetEnabled(long jarg1, SBTypeCategory jarg1_, boolean jarg2); - public final static native String SBTypeCategory_GetName(long jarg1, SBTypeCategory jarg1_); - public final static native int SBTypeCategory_GetLanguageAtIndex(long jarg1, SBTypeCategory jarg1_, long jarg2); - public final static native long SBTypeCategory_GetNumLanguages(long jarg1, SBTypeCategory jarg1_); - public final static native void SBTypeCategory_AddLanguage(long jarg1, SBTypeCategory jarg1_, int jarg2); - public final static native boolean SBTypeCategory_GetDescription(long jarg1, SBTypeCategory jarg1_, long jarg2, SBStream jarg2_, int jarg3); - public final static native long SBTypeCategory_GetNumFormats(long jarg1, SBTypeCategory jarg1_); - public final static native long SBTypeCategory_GetNumSummaries(long jarg1, SBTypeCategory jarg1_); - public final static native long SBTypeCategory_GetNumFilters(long jarg1, SBTypeCategory jarg1_); - public final static native long SBTypeCategory_GetNumSynthetics(long jarg1, SBTypeCategory jarg1_); - public final static native long SBTypeCategory_GetTypeNameSpecifierForFilterAtIndex(long jarg1, SBTypeCategory jarg1_, long jarg2); - public final static native long SBTypeCategory_GetTypeNameSpecifierForFormatAtIndex(long jarg1, SBTypeCategory jarg1_, long jarg2); - public final static native long SBTypeCategory_GetTypeNameSpecifierForSummaryAtIndex(long jarg1, SBTypeCategory jarg1_, long jarg2); - public final static native long SBTypeCategory_GetTypeNameSpecifierForSyntheticAtIndex(long jarg1, SBTypeCategory jarg1_, long jarg2); - public final static native long SBTypeCategory_GetFilterForType(long jarg1, SBTypeCategory jarg1_, long jarg2, SBTypeNameSpecifier jarg2_); - public final static native long SBTypeCategory_GetFormatForType(long jarg1, SBTypeCategory jarg1_, long jarg2, SBTypeNameSpecifier jarg2_); - public final static native long SBTypeCategory_GetSummaryForType(long jarg1, SBTypeCategory jarg1_, long jarg2, SBTypeNameSpecifier jarg2_); - public final static native long SBTypeCategory_GetSyntheticForType(long jarg1, SBTypeCategory jarg1_, long jarg2, SBTypeNameSpecifier jarg2_); - public final static native long SBTypeCategory_GetFilterAtIndex(long jarg1, SBTypeCategory jarg1_, long jarg2); - public final static native long SBTypeCategory_GetFormatAtIndex(long jarg1, SBTypeCategory jarg1_, long jarg2); - public final static native long SBTypeCategory_GetSummaryAtIndex(long jarg1, SBTypeCategory jarg1_, long jarg2); - public final static native long SBTypeCategory_GetSyntheticAtIndex(long jarg1, SBTypeCategory jarg1_, long jarg2); - public final static native boolean SBTypeCategory_AddTypeFormat(long jarg1, SBTypeCategory jarg1_, long jarg2, SBTypeNameSpecifier jarg2_, long jarg3, SBTypeFormat jarg3_); - public final static native boolean SBTypeCategory_DeleteTypeFormat(long jarg1, SBTypeCategory jarg1_, long jarg2, SBTypeNameSpecifier jarg2_); - public final static native boolean SBTypeCategory_AddTypeSummary(long jarg1, SBTypeCategory jarg1_, long jarg2, SBTypeNameSpecifier jarg2_, long jarg3, SBTypeSummary jarg3_); - public final static native boolean SBTypeCategory_DeleteTypeSummary(long jarg1, SBTypeCategory jarg1_, long jarg2, SBTypeNameSpecifier jarg2_); - public final static native boolean SBTypeCategory_AddTypeFilter(long jarg1, SBTypeCategory jarg1_, long jarg2, SBTypeNameSpecifier jarg2_, long jarg3, SBTypeFilter jarg3_); - public final static native boolean SBTypeCategory_DeleteTypeFilter(long jarg1, SBTypeCategory jarg1_, long jarg2, SBTypeNameSpecifier jarg2_); - public final static native boolean SBTypeCategory_AddTypeSynthetic(long jarg1, SBTypeCategory jarg1_, long jarg2, SBTypeNameSpecifier jarg2_, long jarg3, SBTypeSynthetic jarg3_); - public final static native boolean SBTypeCategory_DeleteTypeSynthetic(long jarg1, SBTypeCategory jarg1_, long jarg2, SBTypeNameSpecifier jarg2_); - public final static native String SBTypeCategory___repr__(long jarg1, SBTypeCategory jarg1_); - public final static native long new_SBTypeEnumMember__SWIG_0(); - public final static native long new_SBTypeEnumMember__SWIG_1(long jarg1, SBTypeEnumMember jarg1_); - public final static native void delete_SBTypeEnumMember(long jarg1); - public final static native boolean SBTypeEnumMember_IsValid(long jarg1, SBTypeEnumMember jarg1_); - public final static native long SBTypeEnumMember_GetValueAsSigned(long jarg1, SBTypeEnumMember jarg1_); - public final static native java.math.BigInteger SBTypeEnumMember_GetValueAsUnsigned(long jarg1, SBTypeEnumMember jarg1_); - public final static native String SBTypeEnumMember_GetName(long jarg1, SBTypeEnumMember jarg1_); - public final static native long SBTypeEnumMember_GetType(long jarg1, SBTypeEnumMember jarg1_); - public final static native boolean SBTypeEnumMember_GetDescription(long jarg1, SBTypeEnumMember jarg1_, long jarg2, SBStream jarg2_, int jarg3); - public final static native String SBTypeEnumMember___repr__(long jarg1, SBTypeEnumMember jarg1_); - public final static native long new_SBTypeEnumMemberList__SWIG_0(); - public final static native long new_SBTypeEnumMemberList__SWIG_1(long jarg1, SBTypeEnumMemberList jarg1_); - public final static native void delete_SBTypeEnumMemberList(long jarg1); - public final static native boolean SBTypeEnumMemberList_IsValid(long jarg1, SBTypeEnumMemberList jarg1_); - public final static native void SBTypeEnumMemberList_Append(long jarg1, SBTypeEnumMemberList jarg1_, long jarg2, SBTypeEnumMember jarg2_); - public final static native long SBTypeEnumMemberList_GetTypeEnumMemberAtIndex(long jarg1, SBTypeEnumMemberList jarg1_, long jarg2); - public final static native long SBTypeEnumMemberList_GetSize(long jarg1, SBTypeEnumMemberList jarg1_); - public final static native long new_SBTypeFilter__SWIG_0(); - public final static native long new_SBTypeFilter__SWIG_1(long jarg1); - public final static native long new_SBTypeFilter__SWIG_2(long jarg1, SBTypeFilter jarg1_); - public final static native void delete_SBTypeFilter(long jarg1); - public final static native boolean SBTypeFilter_IsValid(long jarg1, SBTypeFilter jarg1_); - public final static native long SBTypeFilter_GetNumberOfExpressionPaths(long jarg1, SBTypeFilter jarg1_); - public final static native String SBTypeFilter_GetExpressionPathAtIndex(long jarg1, SBTypeFilter jarg1_, long jarg2); - public final static native boolean SBTypeFilter_ReplaceExpressionPathAtIndex(long jarg1, SBTypeFilter jarg1_, long jarg2, String jarg3); - public final static native void SBTypeFilter_AppendExpressionPath(long jarg1, SBTypeFilter jarg1_, String jarg2); - public final static native void SBTypeFilter_Clear(long jarg1, SBTypeFilter jarg1_); - public final static native long SBTypeFilter_GetOptions(long jarg1, SBTypeFilter jarg1_); - public final static native void SBTypeFilter_SetOptions(long jarg1, SBTypeFilter jarg1_, long jarg2); - public final static native boolean SBTypeFilter_GetDescription(long jarg1, SBTypeFilter jarg1_, long jarg2, SBStream jarg2_, int jarg3); - public final static native boolean SBTypeFilter_IsEqualTo(long jarg1, SBTypeFilter jarg1_, long jarg2, SBTypeFilter jarg2_); - public final static native String SBTypeFilter___repr__(long jarg1, SBTypeFilter jarg1_); - public final static native long new_SBTypeFormat__SWIG_0(); - public final static native long new_SBTypeFormat__SWIG_1(int jarg1, long jarg2); - public final static native long new_SBTypeFormat__SWIG_2(int jarg1); - public final static native long new_SBTypeFormat__SWIG_3(String jarg1, long jarg2); - public final static native long new_SBTypeFormat__SWIG_4(String jarg1); - public final static native long new_SBTypeFormat__SWIG_5(long jarg1, SBTypeFormat jarg1_); - public final static native void delete_SBTypeFormat(long jarg1); - public final static native boolean SBTypeFormat_IsValid(long jarg1, SBTypeFormat jarg1_); - public final static native int SBTypeFormat_GetFormat(long jarg1, SBTypeFormat jarg1_); - public final static native String SBTypeFormat_GetTypeName(long jarg1, SBTypeFormat jarg1_); - public final static native long SBTypeFormat_GetOptions(long jarg1, SBTypeFormat jarg1_); - public final static native void SBTypeFormat_SetFormat(long jarg1, SBTypeFormat jarg1_, int jarg2); - public final static native void SBTypeFormat_SetTypeName(long jarg1, SBTypeFormat jarg1_, String jarg2); - public final static native void SBTypeFormat_SetOptions(long jarg1, SBTypeFormat jarg1_, long jarg2); - public final static native boolean SBTypeFormat_GetDescription(long jarg1, SBTypeFormat jarg1_, long jarg2, SBStream jarg2_, int jarg3); - public final static native boolean SBTypeFormat_IsEqualTo(long jarg1, SBTypeFormat jarg1_, long jarg2, SBTypeFormat jarg2_); - public final static native String SBTypeFormat___repr__(long jarg1, SBTypeFormat jarg1_); - public final static native long new_SBTypeNameSpecifier__SWIG_0(); - public final static native long new_SBTypeNameSpecifier__SWIG_1(String jarg1, boolean jarg2); - public final static native long new_SBTypeNameSpecifier__SWIG_2(String jarg1); - public final static native long new_SBTypeNameSpecifier__SWIG_3(String jarg1, int jarg2); - public final static native long new_SBTypeNameSpecifier__SWIG_4(long jarg1, SBType jarg1_); - public final static native long new_SBTypeNameSpecifier__SWIG_5(long jarg1, SBTypeNameSpecifier jarg1_); - public final static native void delete_SBTypeNameSpecifier(long jarg1); - public final static native boolean SBTypeNameSpecifier_IsValid(long jarg1, SBTypeNameSpecifier jarg1_); - public final static native String SBTypeNameSpecifier_GetName(long jarg1, SBTypeNameSpecifier jarg1_); - public final static native long SBTypeNameSpecifier_GetType(long jarg1, SBTypeNameSpecifier jarg1_); - public final static native int SBTypeNameSpecifier_GetMatchType(long jarg1, SBTypeNameSpecifier jarg1_); - public final static native boolean SBTypeNameSpecifier_IsRegex(long jarg1, SBTypeNameSpecifier jarg1_); - public final static native boolean SBTypeNameSpecifier_GetDescription(long jarg1, SBTypeNameSpecifier jarg1_, long jarg2, SBStream jarg2_, int jarg3); - public final static native boolean SBTypeNameSpecifier_IsEqualTo(long jarg1, SBTypeNameSpecifier jarg1_, long jarg2, SBTypeNameSpecifier jarg2_); - public final static native String SBTypeNameSpecifier___repr__(long jarg1, SBTypeNameSpecifier jarg1_); - public final static native long new_SBTypeSummaryOptions__SWIG_0(); - public final static native long new_SBTypeSummaryOptions__SWIG_1(long jarg1, SBTypeSummaryOptions jarg1_); - public final static native void delete_SBTypeSummaryOptions(long jarg1); - public final static native boolean SBTypeSummaryOptions_IsValid(long jarg1, SBTypeSummaryOptions jarg1_); - public final static native int SBTypeSummaryOptions_GetLanguage(long jarg1, SBTypeSummaryOptions jarg1_); - public final static native int SBTypeSummaryOptions_GetCapping(long jarg1, SBTypeSummaryOptions jarg1_); - public final static native void SBTypeSummaryOptions_SetLanguage(long jarg1, SBTypeSummaryOptions jarg1_, int jarg2); - public final static native void SBTypeSummaryOptions_SetCapping(long jarg1, SBTypeSummaryOptions jarg1_, int jarg2); - public final static native long new_SBTypeSummary__SWIG_0(); - public final static native long SBTypeSummary_CreateWithSummaryString__SWIG_0(String jarg1, long jarg2); - public final static native long SBTypeSummary_CreateWithSummaryString__SWIG_1(String jarg1); - public final static native long SBTypeSummary_CreateWithFunctionName__SWIG_0(String jarg1, long jarg2); - public final static native long SBTypeSummary_CreateWithFunctionName__SWIG_1(String jarg1); - public final static native long SBTypeSummary_CreateWithScriptCode__SWIG_0(String jarg1, long jarg2); - public final static native long SBTypeSummary_CreateWithScriptCode__SWIG_1(String jarg1); - public final static native long new_SBTypeSummary__SWIG_1(long jarg1, SBTypeSummary jarg1_); - public final static native void delete_SBTypeSummary(long jarg1); - public final static native boolean SBTypeSummary_IsValid(long jarg1, SBTypeSummary jarg1_); - public final static native boolean SBTypeSummary_IsFunctionCode(long jarg1, SBTypeSummary jarg1_); - public final static native boolean SBTypeSummary_IsFunctionName(long jarg1, SBTypeSummary jarg1_); - public final static native boolean SBTypeSummary_IsSummaryString(long jarg1, SBTypeSummary jarg1_); - public final static native String SBTypeSummary_GetData(long jarg1, SBTypeSummary jarg1_); - public final static native void SBTypeSummary_SetSummaryString(long jarg1, SBTypeSummary jarg1_, String jarg2); - public final static native void SBTypeSummary_SetFunctionName(long jarg1, SBTypeSummary jarg1_, String jarg2); - public final static native void SBTypeSummary_SetFunctionCode(long jarg1, SBTypeSummary jarg1_, String jarg2); - public final static native long SBTypeSummary_GetOptions(long jarg1, SBTypeSummary jarg1_); - public final static native void SBTypeSummary_SetOptions(long jarg1, SBTypeSummary jarg1_, long jarg2); - public final static native boolean SBTypeSummary_GetDescription(long jarg1, SBTypeSummary jarg1_, long jarg2, SBStream jarg2_, int jarg3); - public final static native boolean SBTypeSummary_DoesPrintValue(long jarg1, SBTypeSummary jarg1_, long jarg2, SBValue jarg2_); - public final static native boolean SBTypeSummary_IsEqualTo(long jarg1, SBTypeSummary jarg1_, long jarg2, SBTypeSummary jarg2_); - public final static native String SBTypeSummary___repr__(long jarg1, SBTypeSummary jarg1_); - public final static native long new_SBTypeSynthetic__SWIG_0(); - public final static native long SBTypeSynthetic_CreateWithClassName__SWIG_0(String jarg1, long jarg2); - public final static native long SBTypeSynthetic_CreateWithClassName__SWIG_1(String jarg1); - public final static native long SBTypeSynthetic_CreateWithScriptCode__SWIG_0(String jarg1, long jarg2); - public final static native long SBTypeSynthetic_CreateWithScriptCode__SWIG_1(String jarg1); - public final static native long new_SBTypeSynthetic__SWIG_1(long jarg1, SBTypeSynthetic jarg1_); - public final static native void delete_SBTypeSynthetic(long jarg1); - public final static native boolean SBTypeSynthetic_IsValid(long jarg1, SBTypeSynthetic jarg1_); - public final static native boolean SBTypeSynthetic_IsClassCode(long jarg1, SBTypeSynthetic jarg1_); - public final static native boolean SBTypeSynthetic_IsClassName(long jarg1, SBTypeSynthetic jarg1_); - public final static native String SBTypeSynthetic_GetData(long jarg1, SBTypeSynthetic jarg1_); - public final static native void SBTypeSynthetic_SetClassName(long jarg1, SBTypeSynthetic jarg1_, String jarg2); - public final static native void SBTypeSynthetic_SetClassCode(long jarg1, SBTypeSynthetic jarg1_, String jarg2); - public final static native long SBTypeSynthetic_GetOptions(long jarg1, SBTypeSynthetic jarg1_); - public final static native void SBTypeSynthetic_SetOptions(long jarg1, SBTypeSynthetic jarg1_, long jarg2); - public final static native boolean SBTypeSynthetic_GetDescription(long jarg1, SBTypeSynthetic jarg1_, long jarg2, SBStream jarg2_, int jarg3); - public final static native boolean SBTypeSynthetic_IsEqualTo(long jarg1, SBTypeSynthetic jarg1_, long jarg2, SBTypeSynthetic jarg2_); - public final static native String SBTypeSynthetic___repr__(long jarg1, SBTypeSynthetic jarg1_); - public final static native long new_SBUnixSignals__SWIG_0(); - public final static native long new_SBUnixSignals__SWIG_1(long jarg1, SBUnixSignals jarg1_); - public final static native void delete_SBUnixSignals(long jarg1); - public final static native void SBUnixSignals_Clear(long jarg1, SBUnixSignals jarg1_); - public final static native boolean SBUnixSignals_IsValid(long jarg1, SBUnixSignals jarg1_); - public final static native String SBUnixSignals_GetSignalAsCString(long jarg1, SBUnixSignals jarg1_, int jarg2); - public final static native int SBUnixSignals_GetSignalNumberFromName(long jarg1, SBUnixSignals jarg1_, String jarg2); - public final static native boolean SBUnixSignals_GetShouldSuppress(long jarg1, SBUnixSignals jarg1_, int jarg2); - public final static native boolean SBUnixSignals_SetShouldSuppress(long jarg1, SBUnixSignals jarg1_, int jarg2, boolean jarg3); - public final static native boolean SBUnixSignals_GetShouldStop(long jarg1, SBUnixSignals jarg1_, int jarg2); - public final static native boolean SBUnixSignals_SetShouldStop(long jarg1, SBUnixSignals jarg1_, int jarg2, boolean jarg3); - public final static native boolean SBUnixSignals_GetShouldNotify(long jarg1, SBUnixSignals jarg1_, int jarg2); - public final static native boolean SBUnixSignals_SetShouldNotify(long jarg1, SBUnixSignals jarg1_, int jarg2, boolean jarg3); - public final static native int SBUnixSignals_GetNumSignals(long jarg1, SBUnixSignals jarg1_); - public final static native int SBUnixSignals_GetSignalAtIndex(long jarg1, SBUnixSignals jarg1_, int jarg2); - public final static native long new_SBValue__SWIG_0(); - public final static native long new_SBValue__SWIG_1(long jarg1, SBValue jarg1_); - public final static native void delete_SBValue(long jarg1); - public final static native boolean SBValue_IsValid(long jarg1, SBValue jarg1_); - public final static native void SBValue_Clear(long jarg1, SBValue jarg1_); - public final static native long SBValue_GetError(long jarg1, SBValue jarg1_); - public final static native java.math.BigInteger SBValue_GetID(long jarg1, SBValue jarg1_); - public final static native String SBValue_GetName(long jarg1, SBValue jarg1_); - public final static native String SBValue_GetTypeName(long jarg1, SBValue jarg1_); - public final static native String SBValue_GetDisplayTypeName(long jarg1, SBValue jarg1_); - public final static native long SBValue_GetByteSize(long jarg1, SBValue jarg1_); - public final static native boolean SBValue_IsInScope(long jarg1, SBValue jarg1_); - public final static native int SBValue_GetFormat(long jarg1, SBValue jarg1_); - public final static native void SBValue_SetFormat(long jarg1, SBValue jarg1_, int jarg2); - public final static native String SBValue_GetValue(long jarg1, SBValue jarg1_); - public final static native long SBValue_GetValueAsSigned__SWIG_0(long jarg1, SBValue jarg1_, long jarg2, SBError jarg2_, long jarg3); - public final static native long SBValue_GetValueAsSigned__SWIG_1(long jarg1, SBValue jarg1_, long jarg2, SBError jarg2_); - public final static native java.math.BigInteger SBValue_GetValueAsUnsigned__SWIG_0(long jarg1, SBValue jarg1_, long jarg2, SBError jarg2_, java.math.BigInteger jarg3); - public final static native java.math.BigInteger SBValue_GetValueAsUnsigned__SWIG_1(long jarg1, SBValue jarg1_, long jarg2, SBError jarg2_); - public final static native long SBValue_GetValueAsSigned__SWIG_2(long jarg1, SBValue jarg1_, long jarg2); - public final static native long SBValue_GetValueAsSigned__SWIG_3(long jarg1, SBValue jarg1_); - public final static native java.math.BigInteger SBValue_GetValueAsUnsigned__SWIG_2(long jarg1, SBValue jarg1_, java.math.BigInteger jarg2); - public final static native java.math.BigInteger SBValue_GetValueAsUnsigned__SWIG_3(long jarg1, SBValue jarg1_); - public final static native int SBValue_GetValueType(long jarg1, SBValue jarg1_); - public final static native boolean SBValue_GetValueDidChange(long jarg1, SBValue jarg1_); - public final static native String SBValue_GetSummary__SWIG_0(long jarg1, SBValue jarg1_); - public final static native String SBValue_GetSummary__SWIG_1(long jarg1, SBValue jarg1_, long jarg2, SBStream jarg2_, long jarg3, SBTypeSummaryOptions jarg3_); - public final static native String SBValue_GetObjectDescription(long jarg1, SBValue jarg1_); - public final static native long SBValue_GetDynamicValue(long jarg1, SBValue jarg1_, int jarg2); - public final static native long SBValue_GetStaticValue(long jarg1, SBValue jarg1_); - public final static native long SBValue_GetNonSyntheticValue(long jarg1, SBValue jarg1_); - public final static native int SBValue_GetPreferDynamicValue(long jarg1, SBValue jarg1_); - public final static native void SBValue_SetPreferDynamicValue(long jarg1, SBValue jarg1_, int jarg2); - public final static native boolean SBValue_GetPreferSyntheticValue(long jarg1, SBValue jarg1_); - public final static native void SBValue_SetPreferSyntheticValue(long jarg1, SBValue jarg1_, boolean jarg2); - public final static native boolean SBValue_IsDynamic(long jarg1, SBValue jarg1_); - public final static native boolean SBValue_IsSynthetic(long jarg1, SBValue jarg1_); - public final static native boolean SBValue_IsSyntheticChildrenGenerated(long jarg1, SBValue jarg1_); - public final static native void SBValue_SetSyntheticChildrenGenerated(long jarg1, SBValue jarg1_, boolean jarg2); - public final static native String SBValue_GetLocation(long jarg1, SBValue jarg1_); - public final static native boolean SBValue_SetValueFromCString__SWIG_0(long jarg1, SBValue jarg1_, String jarg2); - public final static native boolean SBValue_SetValueFromCString__SWIG_1(long jarg1, SBValue jarg1_, String jarg2, long jarg3, SBError jarg3_); - public final static native long SBValue_GetTypeFormat(long jarg1, SBValue jarg1_); - public final static native long SBValue_GetTypeSummary(long jarg1, SBValue jarg1_); - public final static native long SBValue_GetTypeFilter(long jarg1, SBValue jarg1_); - public final static native long SBValue_GetTypeSynthetic(long jarg1, SBValue jarg1_); - public final static native long SBValue_GetChildAtIndex__SWIG_0(long jarg1, SBValue jarg1_, long jarg2); - public final static native long SBValue_CreateChildAtOffset(long jarg1, SBValue jarg1_, String jarg2, long jarg3, long jarg4, SBType jarg4_); - public final static native long SBValue_Cast(long jarg1, SBValue jarg1_, long jarg2, SBType jarg2_); - public final static native long SBValue_CreateValueFromExpression__SWIG_0(long jarg1, SBValue jarg1_, String jarg2, String jarg3); - public final static native long SBValue_CreateValueFromExpression__SWIG_1(long jarg1, SBValue jarg1_, String jarg2, String jarg3, long jarg4, SBExpressionOptions jarg4_); - public final static native long SBValue_CreateValueFromAddress(long jarg1, SBValue jarg1_, String jarg2, java.math.BigInteger jarg3, long jarg4, SBType jarg4_); - public final static native long SBValue_CreateValueFromData(long jarg1, SBValue jarg1_, String jarg2, long jarg3, SBData jarg3_, long jarg4, SBType jarg4_); - public final static native long SBValue_GetChildAtIndex__SWIG_1(long jarg1, SBValue jarg1_, long jarg2, int jarg3, boolean jarg4); - public final static native long SBValue_GetIndexOfChildWithName(long jarg1, SBValue jarg1_, String jarg2); - public final static native long SBValue_GetChildMemberWithName__SWIG_0(long jarg1, SBValue jarg1_, String jarg2); - public final static native long SBValue_GetChildMemberWithName__SWIG_1(long jarg1, SBValue jarg1_, String jarg2, int jarg3); - public final static native long SBValue_GetValueForExpressionPath(long jarg1, SBValue jarg1_, String jarg2); - public final static native long SBValue_AddressOf(long jarg1, SBValue jarg1_); - public final static native java.math.BigInteger SBValue_GetLoadAddress(long jarg1, SBValue jarg1_); - public final static native long SBValue_GetAddress(long jarg1, SBValue jarg1_); - public final static native long SBValue_GetPointeeData__SWIG_0(long jarg1, SBValue jarg1_, long jarg2, long jarg3); - public final static native long SBValue_GetPointeeData__SWIG_1(long jarg1, SBValue jarg1_, long jarg2); - public final static native long SBValue_GetPointeeData__SWIG_2(long jarg1, SBValue jarg1_); - public final static native long SBValue_GetData(long jarg1, SBValue jarg1_); - public final static native boolean SBValue_SetData(long jarg1, SBValue jarg1_, long jarg2, SBData jarg2_, long jarg3, SBError jarg3_); - public final static native long SBValue_Clone(long jarg1, SBValue jarg1_, String jarg2); - public final static native long SBValue_GetDeclaration(long jarg1, SBValue jarg1_); - public final static native boolean SBValue_MightHaveChildren(long jarg1, SBValue jarg1_); - public final static native boolean SBValue_IsRuntimeSupportValue(long jarg1, SBValue jarg1_); - public final static native long SBValue_GetNumChildren__SWIG_0(long jarg1, SBValue jarg1_); - public final static native long SBValue_GetNumChildren__SWIG_1(long jarg1, SBValue jarg1_, long jarg2); - public final static native long SBValue_GetOpaqueType(long jarg1, SBValue jarg1_); - public final static native long SBValue_GetTarget(long jarg1, SBValue jarg1_); - public final static native long SBValue_GetProcess(long jarg1, SBValue jarg1_); - public final static native long SBValue_GetThread(long jarg1, SBValue jarg1_); - public final static native long SBValue_GetFrame(long jarg1, SBValue jarg1_); - public final static native long SBValue_Dereference(long jarg1, SBValue jarg1_); - public final static native boolean SBValue_TypeIsPointerType(long jarg1, SBValue jarg1_); - public final static native long SBValue_GetType(long jarg1, SBValue jarg1_); - public final static native long SBValue_Persist(long jarg1, SBValue jarg1_); - public final static native boolean SBValue_GetDescription(long jarg1, SBValue jarg1_, long jarg2, SBStream jarg2_); - public final static native boolean SBValue_GetExpressionPath__SWIG_0(long jarg1, SBValue jarg1_, long jarg2, SBStream jarg2_); - public final static native boolean SBValue_GetExpressionPath__SWIG_1(long jarg1, SBValue jarg1_, long jarg2, SBStream jarg2_, boolean jarg3); - public final static native long SBValue_EvaluateExpression__SWIG_0(long jarg1, SBValue jarg1_, String jarg2); - public final static native long SBValue_EvaluateExpression__SWIG_1(long jarg1, SBValue jarg1_, String jarg2, long jarg3, SBExpressionOptions jarg3_); - public final static native long SBValue_EvaluateExpression__SWIG_2(long jarg1, SBValue jarg1_, String jarg2, long jarg3, SBExpressionOptions jarg3_, String jarg4); - public final static native long SBValue_Watch__SWIG_0(long jarg1, SBValue jarg1_, boolean jarg2, boolean jarg3, boolean jarg4, long jarg5, SBError jarg5_); - public final static native long SBValue_Watch__SWIG_1(long jarg1, SBValue jarg1_, boolean jarg2, boolean jarg3, boolean jarg4); - public final static native long SBValue_WatchPointee(long jarg1, SBValue jarg1_, boolean jarg2, boolean jarg3, boolean jarg4, long jarg5, SBError jarg5_); - public final static native String SBValue___repr__(long jarg1, SBValue jarg1_); - public final static native long new_SBValueList__SWIG_0(); - public final static native long new_SBValueList__SWIG_1(long jarg1, SBValueList jarg1_); - public final static native void delete_SBValueList(long jarg1); - public final static native boolean SBValueList_IsValid(long jarg1, SBValueList jarg1_); - public final static native void SBValueList_Clear(long jarg1, SBValueList jarg1_); - public final static native void SBValueList_Append__SWIG_0(long jarg1, SBValueList jarg1_, long jarg2, SBValue jarg2_); - public final static native void SBValueList_Append__SWIG_1(long jarg1, SBValueList jarg1_, long jarg2, SBValueList jarg2_); - public final static native long SBValueList_GetSize(long jarg1, SBValueList jarg1_); - public final static native long SBValueList_GetValueAtIndex(long jarg1, SBValueList jarg1_, long jarg2); - public final static native long SBValueList_GetFirstValueByName(long jarg1, SBValueList jarg1_, String jarg2); - public final static native long SBValueList_FindValueObjectByUID(long jarg1, SBValueList jarg1_, java.math.BigInteger jarg2); - public final static native long SBValueList_GetError(long jarg1, SBValueList jarg1_); - public final static native String SBValueList___str__(long jarg1, SBValueList jarg1_); - public final static native long new_SBVariablesOptions__SWIG_0(); - public final static native long new_SBVariablesOptions__SWIG_1(long jarg1, SBVariablesOptions jarg1_); - public final static native void delete_SBVariablesOptions(long jarg1); - public final static native boolean SBVariablesOptions_IsValid(long jarg1, SBVariablesOptions jarg1_); - public final static native boolean SBVariablesOptions_GetIncludeArguments(long jarg1, SBVariablesOptions jarg1_); - public final static native void SBVariablesOptions_SetIncludeArguments(long jarg1, SBVariablesOptions jarg1_, boolean jarg2); - public final static native boolean SBVariablesOptions_GetIncludeRecognizedArguments(long jarg1, SBVariablesOptions jarg1_, long jarg2, SBTarget jarg2_); - public final static native void SBVariablesOptions_SetIncludeRecognizedArguments(long jarg1, SBVariablesOptions jarg1_, boolean jarg2); - public final static native boolean SBVariablesOptions_GetIncludeLocals(long jarg1, SBVariablesOptions jarg1_); - public final static native void SBVariablesOptions_SetIncludeLocals(long jarg1, SBVariablesOptions jarg1_, boolean jarg2); - public final static native boolean SBVariablesOptions_GetIncludeStatics(long jarg1, SBVariablesOptions jarg1_); - public final static native void SBVariablesOptions_SetIncludeStatics(long jarg1, SBVariablesOptions jarg1_, boolean jarg2); - public final static native boolean SBVariablesOptions_GetInScopeOnly(long jarg1, SBVariablesOptions jarg1_); - public final static native void SBVariablesOptions_SetInScopeOnly(long jarg1, SBVariablesOptions jarg1_, boolean jarg2); - public final static native boolean SBVariablesOptions_GetIncludeRuntimeSupportValues(long jarg1, SBVariablesOptions jarg1_); - public final static native void SBVariablesOptions_SetIncludeRuntimeSupportValues(long jarg1, SBVariablesOptions jarg1_, boolean jarg2); - public final static native int SBVariablesOptions_GetUseDynamic(long jarg1, SBVariablesOptions jarg1_); - public final static native void SBVariablesOptions_SetUseDynamic(long jarg1, SBVariablesOptions jarg1_, int jarg2); - public final static native long new_SBWatchpoint__SWIG_0(); - public final static native long new_SBWatchpoint__SWIG_1(long jarg1, SBWatchpoint jarg1_); - public final static native void delete_SBWatchpoint(long jarg1); - public final static native boolean SBWatchpoint_IsValid(long jarg1, SBWatchpoint jarg1_); - public final static native long SBWatchpoint_GetError(long jarg1, SBWatchpoint jarg1_); - public final static native int SBWatchpoint_GetID(long jarg1, SBWatchpoint jarg1_); - public final static native int SBWatchpoint_GetHardwareIndex(long jarg1, SBWatchpoint jarg1_); - public final static native java.math.BigInteger SBWatchpoint_GetWatchAddress(long jarg1, SBWatchpoint jarg1_); - public final static native long SBWatchpoint_GetWatchSize(long jarg1, SBWatchpoint jarg1_); - public final static native void SBWatchpoint_SetEnabled(long jarg1, SBWatchpoint jarg1_, boolean jarg2); - public final static native boolean SBWatchpoint_IsEnabled(long jarg1, SBWatchpoint jarg1_); - public final static native long SBWatchpoint_GetHitCount(long jarg1, SBWatchpoint jarg1_); - public final static native long SBWatchpoint_GetIgnoreCount(long jarg1, SBWatchpoint jarg1_); - public final static native void SBWatchpoint_SetIgnoreCount(long jarg1, SBWatchpoint jarg1_, long jarg2); - public final static native String SBWatchpoint_GetCondition(long jarg1, SBWatchpoint jarg1_); - public final static native void SBWatchpoint_SetCondition(long jarg1, SBWatchpoint jarg1_, String jarg2); - public final static native boolean SBWatchpoint_GetDescription(long jarg1, SBWatchpoint jarg1_, long jarg2, SBStream jarg2_, int jarg3); - public final static native void SBWatchpoint_Clear(long jarg1, SBWatchpoint jarg1_); - public final static native boolean SBWatchpoint_EventIsWatchpointEvent(long jarg1, SBEvent jarg1_); - public final static native int SBWatchpoint_GetWatchpointEventTypeFromEvent(long jarg1, SBEvent jarg1_); - public final static native long SBWatchpoint_GetWatchpointFromEvent(long jarg1, SBEvent jarg1_); - public final static native long SBWatchpoint_GetType(long jarg1, SBWatchpoint jarg1_); - public final static native int SBWatchpoint_GetWatchValueKind(long jarg1, SBWatchpoint jarg1_); - public final static native String SBWatchpoint_GetWatchSpec(long jarg1, SBWatchpoint jarg1_); - public final static native boolean SBWatchpoint_IsWatchingReads(long jarg1, SBWatchpoint jarg1_); - public final static native boolean SBWatchpoint_IsWatchingWrites(long jarg1, SBWatchpoint jarg1_); - public final static native String SBWatchpoint___repr__(long jarg1, SBWatchpoint jarg1_); -} diff --git a/Ghidra/Debug/Debugger/certification.manifest b/Ghidra/Debug/Debugger/certification.manifest index 3c55cc5b0d..61f075738a 100644 --- a/Ghidra/Debug/Debugger/certification.manifest +++ b/Ghidra/Debug/Debugger/certification.manifest @@ -26,7 +26,6 @@ src/main/help/help/topics/DebuggerCopyActionsPlugin/DebuggerCopyActionsPlugin.ht src/main/help/help/topics/DebuggerCopyActionsPlugin/images/DebuggerCopyIntoProgramDialog.png||GHIDRA||||END| src/main/help/help/topics/DebuggerDisassemblerPlugin/DebuggerDisassemblerPlugin.html||GHIDRA||||END| src/main/help/help/topics/DebuggerEmulationServicePlugin/DebuggerEmulationServicePlugin.html||GHIDRA||||END| -src/main/help/help/topics/DebuggerInterpreterPlugin/DebuggerInterpreterPlugin.html||GHIDRA||||END| src/main/help/help/topics/DebuggerListingPlugin/DebuggerListingPlugin.html||GHIDRA||||END| src/main/help/help/topics/DebuggerListingPlugin/images/DebuggerGoToDialog.png||GHIDRA||||END| src/main/help/help/topics/DebuggerListingPlugin/images/DebuggerListingPlugin.png||GHIDRA||||END| @@ -36,15 +35,10 @@ src/main/help/help/topics/DebuggerMemviewPlugin/DebuggerMemviewPlugin.html||GHID src/main/help/help/topics/DebuggerMemviewPlugin/images/DebuggerMemviewPlugin.png||GHIDRA||||END| src/main/help/help/topics/DebuggerModelPlugin/DebuggerModelPlugin.html||GHIDRA||||END| src/main/help/help/topics/DebuggerModelPlugin/images/DebuggerModelPlugin.png||GHIDRA||||END| -src/main/help/help/topics/DebuggerModelServicePlugin/DebuggerModelServicePlugin.html||GHIDRA||||END| src/main/help/help/topics/DebuggerModulesPlugin/DebuggerModulesPlugin.html||GHIDRA||||END| src/main/help/help/topics/DebuggerModulesPlugin/images/DebuggerModuleMapProposalDialog.png||GHIDRA||||END| src/main/help/help/topics/DebuggerModulesPlugin/images/DebuggerModulesPlugin.png||GHIDRA||||END| src/main/help/help/topics/DebuggerModulesPlugin/images/DebuggerSectionMapProposalDialog.png||GHIDRA||||END| -src/main/help/help/topics/DebuggerObjectsPlugin/DebuggerObjectsPlugin.html||GHIDRA||||END| -src/main/help/help/topics/DebuggerObjectsPlugin/images/DebuggerBreakpointDialog.png||GHIDRA||||END| -src/main/help/help/topics/DebuggerObjectsPlugin/images/DebuggerMethodInvocationDialog_ForLaunch.png||GHIDRA||||END| -src/main/help/help/topics/DebuggerObjectsPlugin/images/DebuggerObjectsPlugin.png||GHIDRA||||END| src/main/help/help/topics/DebuggerPcodeStepperPlugin/DebuggerPcodeStepperPlugin.html||GHIDRA||||END| src/main/help/help/topics/DebuggerPcodeStepperPlugin/images/DebuggerPcodeStepperPlugin.png||GHIDRA||||END| src/main/help/help/topics/DebuggerPlatformPlugin/DebuggerPlatformPlugin.html||GHIDRA||||END| @@ -60,9 +54,6 @@ src/main/help/help/topics/DebuggerStackPlugin/images/DebuggerStackPlugin.png||GH src/main/help/help/topics/DebuggerStackPlugin/images/DebuggerStackUnwindInListing.png||GHIDRA||||END| src/main/help/help/topics/DebuggerStaticMappingPlugin/DebuggerStaticMappingPlugin.html||GHIDRA||||END| src/main/help/help/topics/DebuggerStaticMappingPlugin/images/DebuggerStaticMappingPlugin.png||GHIDRA||||END| -src/main/help/help/topics/DebuggerTargetsPlugin/DebuggerTargetsPlugin.html||GHIDRA||||END| -src/main/help/help/topics/DebuggerTargetsPlugin/images/DebuggerConnectDialog.png||GHIDRA||||END| -src/main/help/help/topics/DebuggerTargetsPlugin/images/DebuggerTargetsPlugin.png||GHIDRA||||END| src/main/help/help/topics/DebuggerThreadsPlugin/DebuggerThreadsPlugin.html||GHIDRA||||END| src/main/help/help/topics/DebuggerThreadsPlugin/images/DebuggerThreadsPlugin.png||GHIDRA||||END| src/main/help/help/topics/DebuggerTimePlugin/DebuggerTimePlugin.html||GHIDRA||||END| diff --git a/Ghidra/Debug/Debugger/src/main/help/help/TOC_Source.xml b/Ghidra/Debug/Debugger/src/main/help/help/TOC_Source.xml index 992d5f9500..f109d33014 100644 --- a/Ghidra/Debug/Debugger/src/main/help/help/TOC_Source.xml +++ b/Ghidra/Debug/Debugger/src/main/help/help/TOC_Source.xml @@ -66,15 +66,6 @@ sortgroup="m" target="help/topics/Debugger/Troubleshooting.html" /> - - - - - @@ -83,18 +74,10 @@ sortgroup="m" target="help/topics/DebuggerCopyActionsPlugin/DebuggerCopyActionsPlugin.html" /> - - - - diff --git a/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerBreakpointMarkerPlugin/DebuggerBreakpointMarkerPlugin.html b/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerBreakpointMarkerPlugin/DebuggerBreakpointMarkerPlugin.html index 76d6fffe76..13b8fd7d2e 100644 --- a/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerBreakpointMarkerPlugin/DebuggerBreakpointMarkerPlugin.html +++ b/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerBreakpointMarkerPlugin/DebuggerBreakpointMarkerPlugin.html @@ -64,12 +64,11 @@

Actions

+ They allow the placement and toggling of breakpoints by address, kind, and length. NOTE: + These actions may also appear in other address-based contexts, but not all of those contexts + include visual breakpoint indicators. The Model pane may provide actions + to set breakpoints in other ways.

Toggle Breakpoint (K)

diff --git a/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerInterpreterPlugin/DebuggerInterpreterPlugin.html b/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerInterpreterPlugin/DebuggerInterpreterPlugin.html deleted file mode 100644 index 0134999ec1..0000000000 --- a/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerInterpreterPlugin/DebuggerInterpreterPlugin.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - Debugger: Interpreters - - - - - -

Debugger: Interpreters

- -

This window only supports the older "Recorder-based" - targets. For newer "TraceRmi-based" targets, the actual debugger runs in an integrated VT-100 - terminal emulator.

- -

For debuggers which have built-in interpreters (many do), and whose connectors expose that - interpreter in the model, the interpreters plugin can provide user access to it via a graphical - console. The plugin leverages the existing interpreter console framework in Ghidra, so the - interface should be relatively familiar. Typically, the console is accessed via the Objects - window's Console action. - Output is displayed in a large text field, and user input is taken via a small text field at - the bottom. The prompt, commands, and outputs are all defined by the connector.

- -

Actions

- -

Each interpreter console has the following actions:

- -

Clear Interpreter

- -

This action is always available. It clears the console's output buffer.

- -

Remove Interpreter

- -

This action appears when the target's interpreter is no longer valid, i.e., the connection - was closed. It permanently closes the console. Note this action can only appear if this console - was pinned.

- -

Pin Interpreter

- -

This action is always available. Normally interpreter consoles are permanently closed - immediately upon the associated target interpreter becoming invalid, i.e., the connection was - closed. Pinning an interpreter keeps it open, but in a disabled state, so that the buffer can - be examined after invalidation.

- -

Interrupt

- -

This action is always available. It interrupts the current target's execution.

- - diff --git a/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerModelServicePlugin/DebuggerModelServicePlugin.html b/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerModelServicePlugin/DebuggerModelServicePlugin.html deleted file mode 100644 index f646d504e3..0000000000 --- a/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerModelServicePlugin/DebuggerModelServicePlugin.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - Debugger: Model Service - - - - - -

Debugger: Model Service

- -

This service is the source of older "Recorder-based" - targets. Recorders are being replaced with a system we call Trace RMI. The other - topics in Help have been updated accordingly. See Getting Started.

- -

This service plugin backs the Targets window. It maintains - all debugger connections across the entire Ghidra session, that is, they're shared across all - tools.

- -

Actions

- -

The plugin also provides some shortcut actions.

- -

Debug Program

- -

This group of actions is available whenever there exists a debug launcher that knows how to - run the current program. Various launchers may all make offers to run the current program, each - of which is presented as a item in this group. Not all offers are guaranteed to work. For - example, an offer to launch the program remotely via SSH depends on the host's availability, - the user's credentials, and the presence of the target binary on the host. The offers are - ordered by most recent activation. The most recent offer used is the default launcher for the - current program. Each launcher may check various conditions before making an offer. Most - commonly, it will check that there is a suitable debugger for the current program's - architecture (language) on the local system, that the program's original executable image still - exists on disk, and that the user has permission to execute it. A launcher may take any - arbitrary action to run the program. Most commonly, it starts a new connection suitable for the - target, and then launches the program on that connection. If Record - Automatically is enabled, this will provide a single-click action to debug the current - program. This is similar to the Quick Launch - action in the Commands and Objects window, except this one does not require an existing - connection.

- -

The launch offers are presented in two places. First, they are listed as drop-down items - from the "Debug Program" action in the main toolbar. When activated here, there are typically - no further prompts. One notable exception is SSH, where authentication may be required. Second, - they are listed under the Debugger → Debug Program menu. When - activated here, the launcher should prompt for arguments. The chosen arguments are saved as the - default for future launches of the current program.

- -

Disconnect All

- -

This action is always available from the main application window. It closes all debugger - connections, no matter what tool created them. This is a sort of panic and reset action. NOTE: - A complete and total reset is not always possible. Some connectors may load native libraries - into Ghidra's JVM. Unless that connector is careful to reset that library's state, subsequent - connections could be affected.

- - diff --git a/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerObjectsPlugin/DebuggerObjectsPlugin.html b/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerObjectsPlugin/DebuggerObjectsPlugin.html deleted file mode 100644 index 19ae48ac6b..0000000000 --- a/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerObjectsPlugin/DebuggerObjectsPlugin.html +++ /dev/null @@ -1,370 +0,0 @@ - - - - - - - Debugger: Commands and Objects - - - - - -

Debugger: Commands and Objects

- -
- -
- -

This window only supports the older "Recorder-based" - targets. For newer "TraceRmi-based" targets, see the Model window.

- -

The Objects window permits the user to interact directly with a connected debugger and its - targets. Along with the command-line interpreter, it is the primary mechanism for issuing - commands, e.g., step, to a target. Commands are accessible from the tool bar, the - pull-down, and pop-up menus. Commands are enabled in two ways: (1) the object selected has a - property that marks it as a logical target for that command, or (2) the object has an ancestor - for which the command makes sense. The Enable By Selection Only function - determines whether both options are in play. For example, threads and inferiors/processes are - both resumable, so the Resume action - works on both. For many of our targets, processes are interruptible while threads are - not. Nevertheless, if Enable By Selection Only is off, you can interrupt a thread - because it descends from an inferior or process. In almost every case, the selection directly - or indirectly determines the set of valid or enabled actions.

- -

The tree will display the active object, e.g., the current thread, and its ancestors in - bold font. By default, this is also the selected object. To activate a different object, - double-click it or select it and press ENTER. This will command the debugger and the rest of - the UI to make that object the current object. For example, double-clicking the 2nd thread - would be equivalent to thread 2 in GDB, or ~2s in WinDbg. The actions - apply to the selected object, which may differ from the active object. For - example, suppose Thread 1 is active. If you click "Step Into," it will command the debugger to - step Thread 1. If you select (but do not activate) Thread 2 and click "Step Into," it will - command the debugger to step Thread 2, even though Thread 1 is still the active thread. Likely, - Thread 2 will become active during the Step Into command, but that behavior is determined by - the model implementation.

- -

The application of these special properties to each object to determine its behavior and - relevant actions allows all objects to be treated generically. This feature has several - powerful implications. All objects may be represented in many ways, and one representation may - easily be converted into another. The default representation is a tree, and the Objects plugin - starts with a tree to represent a debugger session's state. Any portion of the tree may be - reproduced as its own subtree or as a table or as a graph using the Display as... actions. Any portion of the display - may be exported from or imported into the plugin. The generic aspect of all objects also allows - the user to process them in scripts or plugins in common ways. For example, you could write a - script to walk the entire tree and find objects with "File" in the name or with the value - 0xDEADBEEF.

- -

The hierarchy reflected in the initial display has either been derived from the target, as - is the case with WinDbg Preview's dbgmodel.dll engine, or imposed by the designers of the - current connector's "model." The model has a type schema chosen by the authors for a particular - debugger target. It usually mirrors to some extent the underlying relationships in the native - debugger, but need not, and is usually fixed for that target. Commands executed within this - plugin are passed from the GUI through the model, typically manifesting in native API calls, or - commands sent to a special interpreter of the debugger. This plugin does not operate on traces, - except for actions which initiate a recording.

- -

Actions for Target Management

- -

Quick Launch

- -

Launches a new target using the current program. This action is the fastest and probably - most common way of starting a debugger target on an existing connection. The action attempts to - launch the program in the currently selected tab of the static listing window. The success of - the action depends on the program being associated with an existing executable file on the - local system. The value associated with the program may, of course, be checked using the About Program File function.

- -

Launch

- -

Launch a new target. Sometimes you may wish to launch a program which has not been imported, - to launch a program with various configuration options, or to pass arguments to the program. - The launch dialog allows you to do this. Typically, the dialog will present a single empty box - into which you can enter the command with arguments as you would on a command line. For some - targets, the dialog will present pre-configured options corresponding to common launch modes - for the platform.

- -

For example, the CommandLineLaunch version of the dialog for JDI targets displays a check - box for whether the target should be suspended on launch, the default quote character used by - the command line, the program used to start the virtual machine (java), the path to where it's - installed, and fields for the name of the class and any user options you might supply:

- -
- -
- -

The options displayed by the Launch command are, for some targets, connected to the - currently selected item under Connectors. For example, the dbgmodel.dll connector offers - several launchers: one for command-line launch, one for attach, open for kernel-mode debugging, - and one for opening previously-generated dump or TTD trace files.

- -

Attach

- -

Attach to a running target. If the debugger has available a list of running targets for the - local system, the attach action provides a convenient way to select and attach to an existing - process. If the highlighted object in the provider is considered "attachable", the attach - action attempts to connect that element. The list of "attachable" targets is typically - displayed in the tree under Session/Available. Bear in mind it often takes time to - populate the Available list, which may need to be manually refreshed.

- -

Detach

- -

Detach from the selected target, usually allowing it to resume execution. As a consequence, - this action terminates the trace for the current target, if applicable.

- -

Re-attach

- -

Re-attaches to the selected target. (Some targets require a separate action for re-attaching - vs. attaching for the first time. If so, this action provides that capability.)

- -

Kill

- -

Kill the current target. As a consequence, this action terminates the trace for the current - target, if applicable.

- -

Actions for Execution Management

- -

Interrupt (Pause, - Suspend, Break)

- -

Interrupt the current target's execution.

- -

Resume (Continue, Go)

- -

Allow the current target to resume execution.

- -

Step Into

- -

Step the current target to the next instruction.

- -

Step Over

- -

Step the current target to the next instruction in the current subroutine.

- -

Finish

- -

Allow the current target to finish the current subroutine, pausing after.

- -

Step Last / - Extended

- -

Perform a target-defined step, often the last (possibly custom or extended) step.

- -

Set - Breakpoint

- -

Set a breakpoint, which will trap target execution under certain conditions.

- -
- -
- -

The given expression can follow any form accepted by the connected debugger, although most - often this will be an address. Compare this to the listing, which can only set breakpoints on - specific addresses, not symbols or expressions. Furthermore, some targets allow breakpoints to - be specified before a target is launched. Conversely, the listing is not available until the - target is launched and being recorded. For a recorded target, breakpoints (including locations - set via this action) can be managed in the Breakpoints window - or using the Breakpoint - Marker actions from the disassembly listings.

- -

Toggle Option

- -

Toggle an object. This may apply to a breakpoint or to configuration options provided in the - model tree.

- -

Actions for Trace Management

- -

The following actions manage target tracing. Note that many other windows are not usable - until a target is recorded into a trace.

- -

Record

- -

Record the current target, if its platform is recognized, and open its trace. If Ghidra - cannot uniquely identify the platform, it may prompt the user to select from a list of - possibilities.

- -

Record - Automatically

- -

Automatically record and open recognized targets. If Ghidra cannot uniquely identify the - platform, it will select one by priority without prompting the user.

- -

Actions for Display Management

- -

The following actions can create additional displays of portions of the debugger model.

- -

Display As - Tree

- -

Constructs a new tree using the selection as the new root, synchronized with the current - provider.

- -

Display As - Table

- -

Constructs a table from the current object, synchronized with the current provider. If the - object is a container, its elements will be rows in the new table and their attributes will be - columns. If not, the attributes will be rows and their name, kind, value, and type will be - columns.

- -

Display As - Graph

- -

Constructs and displays a graph from the selection and its visible descendants. NOTE: The - graph does not currently maintain synchronization.

- -

Display As - XML

- -

Encodes the selected object and its visible descendants in XML and prints the result to the - console. NOTE: Various characters not allowed in XML may be converted, typically to - underscores, in the result.

- -

Display - Filtered Tree

- -

Constructs a static snapshot of the selection and its visible descendants as a tree, - applying a filter to the selection.

- -

Display - Filtered Table

- -

Constructs a static snapshot of the selection and its visible descendants as a table, - applying a filter to the selection.

- -

- Display Filtered Graph

- -

Constructs a static snapshot of the selection and its visible descendants as a graph, - applying a filter to the selection.

- -

- Display Filtered XML

- -

Constructs a static snapshot of the selection and its visible descendants as XML, applying a - filter to the selection.

- -

Display Methods

- -

Displays a list of the methods available for the selection, which may be applied and - combined in a filter.

- -

Actions for Data Management

- -

Export as - XML

- -

Converts the selection and its visible descendants to XML and exports the result to a file - of the user's choosing.

- -

Import - from XML

- -

Imports "facts" from a file of the user's choosing and renders it as a tree.

- -

Export - as Facts

- -

Converts the selection and its visible descendants to "fact" files and exports the result to - a directory of the user's choosing. Currently, "fact" files itemize the path, name, value, - type, and children for each object.

- -

- Import from Facts

- -

Imports XML from a directory of the user's choosing and renders them as a tree.

- -

Import from - trace

- -

Import from trace is roughly equivalent to using the open dump/trace connector.

- -

Miscellaneous Actions

- -

Console

- -

Shows the console for the selected context, usually the debugger's command-line interpreter. - Some models may also present a target's standard I/O via a console.

- -

Refresh Node

- -

Queries the model for the current object's children and rebuilds that portion of the - display.

- -

Toggle Base

- -

Asks the connector to display numeric values in decimal or hexadecimal. This may also cause - updates to the trace database, renaming objects whose names are derived from those numeric - values.

- -

Subscribe / Unsubscribe to Selection

- -

Asks the recorder to include or exclude the current object from the trace.

- -

Enable By Selection Only

- -

Toggles the scope of the other action menus. If "selection only" is chosen, the current - object must have the property used to enable the particular action. For instance, the - step action will only be enabled for objects marked steppable. If "selection - only" is off, the debugger will walk the path up from the current object looking for an - ancestor for which the action is enabled. For example, if threads are steppable and - contain registers as descendants, step will still be enabled for that thread if the - current selection is one of its registers.

- -

Hide Intrinsic Attributes

- -

Toggle whether hidden objects are visible — mostly for diagnostic purposes. Some - attributes convey information intended for the user and some convey information for the - machine. The latter are not normally visible, because they just clutter the display. However, - under certain circumstances, the user may want to see them. For example, the _state - attribute indicates whether a thread is running or stopped. In the latter case, this - information is reflected for the user by visual cues in the display, but the invisible - attribute actually determines the behavior.

- -

Ignore State

- -

Many actions are normally allowed only if the target is stopped or in some other defined - state. Sometimes you may wish to ignore the current state and force the action, as, for - example, when the debugger has lost track of the true state.

- -

Update While Running

- -

By default, events are passed to the Objects Viewer even while the target is running. The - resulting changes in the GUI may be distracting for some. To disable updates to the Objects - Viewer, toggle "Updates While Running" off.

- -

Set Node Timeout

- -

Set the default value for the timeout used when expanding a node, i.e. populating its - children.

- -

Color Options

- -

The debugger represents different types of objects with different colors. Bear in mind these - colors are not blended, i.e. one color may override another. Examples include:

- -
    -
  • Default: normal objects
  • - -
  • Modified: objects recently changed
  • - -
  • Links: objects from a different portion of the display
  • - -
  • Intrinsics: objects with a value, such as strings or numbers
  • - -
  • Invisible: objects used internally by the provider
  • - -
  • Accessors: objects which may used to supply other objects (before they've been - populated)
  • - -
  • Targets: native objects with special properties
  • -
- - diff --git a/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerObjectsPlugin/images/DebuggerBreakpointDialog.png b/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerObjectsPlugin/images/DebuggerBreakpointDialog.png deleted file mode 100644 index de3d6988cfede18940de055efaf5df6a536ea249..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6103 zcmb7IbySpJx28jZAq14}ln{_cx^XCxl9C1qK}tGg=#Yj%1c9MJKuWrqfk8lE=x&CT zt~>hsKJWL(y=&e3&%56BuKk|9pL6zpo@bp%Eub>tJ*sM{>Mmo!F6on0 zHTygT4xL&%M*D&nsRGG5hL*kNgE5A!hZ*}JSOyDZ|=LTl{khhv9`9Z?w21f?OIr}3V6^+1}5w^1>(dIH>L;`SuqlY{Lf&# zqj>)A?%9RuXC7eP$WZPCfeHKUlZSZKJk*$L3JD^^gBEo?aY=ll&zI0;MSJSf@SqpY zBw663Ob;8VhUV$dox@(-WK5Yh0VVZ&VA4%?=mj+0&*D2&nq}Q}J#j@bvhUt&QUU+A z>nNvQ=7UnZ^9cP5+!_d8;uFpvK?%v)56H7xfB5pu?7AHFnvjZ`e=h4wqc&es+ZcSU zJlUp^MZ~v4l!SZVU?C4&sUfrZ>>N(Pdq~gUzkMI}WNhQIY=#sryh6gUv%}(60Vtw} z+SCfB13(pmEr`@W++g08w;0w^t+QxX8V+BANB9B9i3M>LL6FAm))D^q4&^CQGikWc z3x`br4Y2mnj!>wSqkvVnTifTBw|(YHvEm8B!(;VrBm5Ej;t5K&iVV+KyVP^38wr`bzYW}dGhG4rM}Cfb1i;bdJS&xE2pte5UXz-CD`Gt zbzxzBbUn0?XB2agmt&Y3qXH5jj4&!^gWY-b?x!>?O4N(6` zbNRA&J@IO%JSaY3(LBo|s}AC}9wlR_+h=A2*M7I|_oOFrKVTu3fLlU2W0EPTw5zO7 z@oB`8qzAeejjR1sX3!=2ir{C$vj+`lA9@~MMUKT=Q9!^P=q`jYJP{_Qu(mMA@>i4u zCrEAlo7ix7-29WG&=cnNY4oz!zz^`V`^bNI*o`8h{I zvE%?AUf3i~NAb5TFV{ZC-jI2lE~Syw)dzE%o!9uFA9EufrVgPtN`)_paS!{Ev7h*3 zPnV&pY!2xNRl)CXbuaO~{ThR>}x@HbGW2&acg+y%1+}vO`%wU4SPWficEgTUL(%UUQC@~m}t|zBx4xQ zCz2oMo`=ILR4Fnx44tpE@c(Y!Kr8hDHXTTlu4JwjJnTIB4j|AKR8h5VW&DwzS@lBP z#}}@sexplGF}#|<4oP-Q)HN?0SHUIrND0KF30LZU+ZSx@s-twX3V^vyAL`ixQRn6@ z!lnq!K&30Ip_3=1dHuRIpxZzPbdP3KH(=r%GdC~@sSSb*nGzU3l_xvK=dD>R{a|Qa zbzyg4HF^8u9Lqui7Y1WoKSj-x`8s3EwQzVxaeHOn3GRf;xB&|sJmX2nV(a6k);N*B zb)SKVdSywN%$zA!;$s%HAAdy@)#fH^gBP#{NdG7I!DuPluO~&9QtXB}?q}etRp&Ru zoZ5e?bG_45vwR@dkogD}0N~i*#w2Q|B#`Ue@Z}d{x4R0cF5jN48Zla?u43nGfBNGV3x9HWnX2n|7Grv(b&AK#O@V(&1Z5Gr0oN=QC3=45Q}{u)FEJJg zU^qwmP8YsmP-RY{oXB8%GA@oKn@RIG@IR@04OBxeGNxY9!rb0f?IHu05nBWOTy}hh z%RNuBXfY+iVEY+-gqbMF!(*}++^50Y1Z_nZ!(2X$b6&#FDu*K;EN6k!6=7455`pxOSHj(a{gYt zOM=yw3Cfwq!T-VOIMs*w>_BPNFP7J(adD7yxS50uB{#q0`1qevH~a1f=)^}#3B5}f zvv0IPUc$4bU+U`S2>CcDjz=%31)pE?)xXf7F<(vRT}^Br81JMuL#AsGZTNij`mCEJ-sZIpykP zQggVU?JY0q+Vx7j^!iZNWS!FtN)$mLknY*1XZ}qVUEvib-%CnMzc)7C++OYHOYyuT zHcdnv`p7R};u8Hr#p;#5WMgAXNl95-TWe}+8vZ23O!yh&OiNq)aKoTdPYdW1p4raI ziWK#`OsjlVS=NevWMz}X!h@TUnJw;55d_5m@QH^se$bO05p!#J)8mjNYa@068BR%w zucMckbE1fJbf^OmMmM}`6kbvIG{@n~Df?c1?^tTP(!iU7UzkoPu!Cv3y>nFj%!(wv z&2{88W+*xfTrm&a+S*!ISGVx=fup0NgNdta)rSu~<;L}NQtwx{x3`hV=ih(qkwz!S zS@y-1mzH9h+}zv@4GuEcnVTo1r72UbuCG&3QH{Pe{f;`uL0IF`u-x+E_~=?`YUQu& zCyqo;KD*vT#q>k{d)IF%sfH!=G;nw4P0qYuJ}ah7Nw&AQPkP@6%zk-QAz|nmUiap) z%09Y{{rjF@ZKj9sR5^>y9#@7(rp;tCXam#B92^|_mr}U(ADA{lAP{|HWA$wSo#f_d z0m=^H#FBH;?k}`yZpYJ0zkK;J92!R}K|@Qc`lF)*z0g_bP6B%^*|rE@vJSK#QeeZ* z!;?N{r=Gs7Ldz8u6(tleEP1VYPJPF|je zho`i()B@kg$jHIPMRPebGm|)sjIVE zfB)GC?s5UvRuBVnm2+&`-VRMGSN+vIxeo{{(ydd+6Al(bHRxQE$9;VKi-Rt}Kruu! zC;Y>Q4xDP#v|-{9sAy`kA1*GMKYjZ2Loa20tjDTHE(kSwJJVX5@lJO(vSNwvS;QHP zSfHvqT3lRQGTP4hVyS6v%Xe>XoSEs}-uw8>wFTatB4;QlD55F(3T?COfB&;84@9tT zZ*JDQECihHPE~2=+gej#7akZ3Df%$7->T!O2!^ES^4?E8Mww(GW-Z_!uAJu)i`E9_ zU&yRI=HN(1ktC<6JJS#z(}n~FDvJHU%r8ywe<1Y#|7c0{JGr04T&4K+Gs~7@I z-I}>>O6=K)TEScRjdFx{P>hTz!s_h+lurZJe~C1UCpkoW6x>`ju*~=ZzGm!6VOrFB ziv;`)oTAThU70}U1YS@w(J?S5PzoDLhC#)~uV7KsXB9uCh=Is#(89CpwGPcTbgkl+ zW2qUO3kew|2EI4d4PnTb_vc+-a_DZNB5?chRzEza0OY!f`<8uwhpdp{a+xo^*-Lbp zw!R^pDwm2w!=ZMY$k&^g^~ZuBPWv4(eJqlCSiOC*{O&~{g8o%vy584m4K7qN0HtmfT&HRtPo zVWhM8;2eJl(YmZGD;rEG%=0_)m9W#C=h=Lh7mW%H^&6w#2)yx9#sb!>ud7Q1ii> z3o<9PU*CP7ZeR4R?j)T=2K|71n>@^~!Fk^wRdeUQ`kyHV5nhW<|_&hk+@ST{tC zYs&fGc-^}n3|q45jW%jsJ-<7dDvNrIIu@uy+meUAjt&sYZ4Ht#dN<`!r+fvRE}tnf zn2uG4@`W;FQ|DHhG{`=zu~t{4Ix|?R9BGx0rr@EXeiR`Iwh$jIiH+J;E;j~HIgq3o zc2j%Kw074~A#Hst7-YTZ7vhY>onDOZvNhyWykc_FxyL&#(Nt1DrsX(8#O2ygjm0(Z zDD1UYQd*S%vqrOx_G>W<$6BMopB_8EbZPduk~riab^aM1YmD%|EzTpU^F(Q(({%0E zuU~I2U$aJb`Qi~>Y>#RBa&U9+>`+@-ZzP?cPE2(SFik_7b{pa*&lA*>(|nH<3kvR_NU1T7A|+{Tgd^_;^K<7YEuoLOe+x$ zVbJXzO70SfM)uz3s@(E{a9NqtJz!4DE06IpSl^Ey5#5wmj|GJvC7WsatzY-3CP5Mw zq2mFCg`t|{pBi0@9R?AHf;RBN&?^1E!{MIZ)!cm@J<8b@puZlTgf;^|a`f_<`|{Df zTuC$R5&kJSl;@2Xt4&hFX`hL_rH&o-5K*=Y?YyW9mReW$aUKU}{k@17$l<~HO0A(K zv-?zFSy8qP?zI1U9{Dy>NJP1N6o;5#Dota%!#7FXZY$wE2sjq9L;@gMdrV~j>~5BDDp#8vlh!Mz6Q@z@842KtN+OiTedDmn3Ls|m%Eo7 zJf_x^bo+_uexazC(tLcj5SY`Q3wKfikdu@1nN+M1Vr;iAXi>RMW85Z-Mm!|`NSW)F z8J9tlrN@>X)*RhhoPrwPfUPvZhKZH(XN3X^E-ucb_w3ocGpF>{Gwn0Bp;#(7<@>4< zguXywx|#ESq{P;sNwu@B&h72sapJ&5E#-?=aqs5Pm$n;*(RP-2IJ-cW6Q1v6x%)8L z+WO`gmpDm{mD!O^hFN*e;hulECh^Qo7!ihudD!TD!zMg`vBH~$88Vz|T2j{fwxSHY z{WBfR?_OwYb&Rt$QSQ4pz+{>*qb`Xz5UnK^i!7`*!+}jr?^{*88JE;oAJWT^+NBY!4zKq4-WF5b|7Y)NIrJbYrVQ$tXON@0%l^K&I8QtC2Fc{P! zYlBAT6a&+kml9%wByYU_ql*FyV<19d#^S9Eq>zxO!Y=Q318mQ!I2y%eDyqzxF0T}Q z(;+x_ZQa)tPRQgkD<*EH%*q&R0i3sj1bGS@xPW=@jIIBDL1MQK7$h#98|Y=epAi~$YKVJh}NUJj_*c*;Fs@RC}8^AJ|3YR zpAo(^_{+`P`pB_aRoAAzdqZ)A(nqvXPu9;3N7>j`%7zSV^-k*0UMwbv;O*ON=Kh85 z6|9duk;r2b;4;#zq%2eS{q^%c%C2^pXg}fK_dn>s&91HWn>_DYNfIqTAS!imhI^Rd z8S6eDI^CIYVUhJV-JEIpUh%Q|$ktyvK4O;nE%B2-3?*L#z9|QjX_`>Tz1;d1y0QI& zvY^VQ6Z|N!g17V+*G%aJMx<@13*jF*uUUUT+w2ecE9X;_vy9&wloJru=|>EUZR+R0kz;;i$p!CAHX_X1eC`<(?o3rlGZ;B?vemB?1z|(A_BwQcAaUcO%_r z;p-cp`}_7j=Q{fj{ur)jJ+1qmM)&EWnGr}b~x$_cdK^YyHB^zTsJ&7 z?7CJr%S&-Ja}PQ>r|jWdSRl~!-b()A!t z%s33i?%)aZWZZ`&yFb`=?mr>>>JsgZ&1L^0kzht-`?L9YrT@p0qx1dQ%(iQ=8+-O0 zj_<_%LoUW>doS~CF6%cj$&#+d)gz|Kjl#;wqY~`C$1Ct^e|^9o^J#G;ANX}P;LYzb zt3hN<<)mTH6&3`Rvk~X;yvJ&CqTylMePK^bPH;p&$j5uGqHZ;%Lwb2{Jcny5_w4nU z(Nq7j%>Z(N9XLmOs(*J*`4raWQJ|)FO3u_hF6&_^N1hSplY78f=VxP;X=@X-SYB@K zU&ps{!JbY(xI;|Y6>$yX-6|RdCPG#otgrAv-A=VuiMSk|k+@Aa$#EkkW?l0R>w8&b zl4D}{Tn^UOXNk(#18}19#^)!CQR&?U(N=Zsd1+<=M~3xv5y=;xu38>rW*`z26W(l; zL7h3?QkxgJVJ>M3@t%_~Cn5gkR<53Z2SON4YbB!*VXm+;n#{s8Xtn*|vNykQbmRE+ z@<&vXSwIfjC6`^(C&?PJGZLFGyR}5}kdsD4{kAcj$^sYC9dkJoysY_@?xlRw z>ORl#h%NGK?ZfreUVkL7w|PQk|i>R&u;gEw-^{{Q@gP)=3C1NbJH5xNd$C^99vU+XWsROXB?11Um(Ek z6OaG}eT!-B4xz0#8g6_Ve1wOjO{VnAp{SUxps7MoWAY#(xkWmyq5FVrb%C`+rfvo$ zLh}Oo*+iXGNUHXh1G_-GbtQKy3905GVnN>wn3oMt4Xa?${j= zNUW>I^^gr#?N5QB+tfSTl=K0}#Mg2E_MyL$5Yz+u&+|KpK>YkH&_EzKW!B62UgTq( z>!9ZmqKTzI_Ik-B^r!(@UH@3tm-&#O2!LZe!Mv}A1^Z~no6kmjeh2g%-qXo2 z+56CU$Q!&MLe9s!HpdI{T1|*mu1@B{%)JR|(}9gwaoz$YP%W2DxTlEx`R^GRBO~K= zP=+@;?4=JF8{{~ft6qK$l;y>>V+ZZM`vkH%b7|u>nBntj6`~Cx2Q;%E&e__n)=Qb&(N$rS0 z0;ZU!dVc1zl1;9QVJ!Qyc-qP_6IG6N7bj~!oxjeLuBI5#;ocJ1<7{g-3n4t z^p|@QBO@aT2nc-8ace!!T`Vp0!o&N4{i&ki+b>jC^A?6{D-oO@(%1O6N3pbvm)3we zV9M%6`jX+a(#t-rO-x@s&c;8 z?oziA-`<7EnXPJu%4cgz@}=(;hlf%-3f;WB9f`vJmQ%Iob0Gq^(9vZ+J$Z8riA08f z_@E-Jt2kavoL0om7L}A4eo3>a_;%FZcRvWbNgUMF$T8GdyEu)hlIV zQY*Q87~;b0v@{R)jA_xbhyZ2Mi zb#u+AEIPRzH#<=M`#EF``u^*t>$2QY;@vloIdNwxxs(s;XeL`+n}l=oY1RZU!hrmB zIY8(Zmsn1YKi%oUu-fhiIXpv0(M>o$-fcf!-W%)PL<=&-jecf73K3wK``EE!UR^i763 zyz7hVFLtRG=hZhEDOwQT0JBSf(ODbHUE$K?{z7%`PeW$v&Xj9~pE>^oqO@{Z$4VFt z{V|&Iy7Lf`w+Z&~Zl+UPY#smow)kKf(RZTJu|IXQV2$Yf?_w)tWt^=Lz1PY+B=Dt(KNi77Sc5xLCEmnl`{ zudRSd~>(?cy|l?H!1H%ej`I>SG`Q!pltDccr43H%5vfn%XDsv&ov) zoiXfeffp4$b}nLKekc?1gT$f5E8McaW55f?3-hr7DM3=H0w7Y~_`Nu|tC zP2y*ciOI>~nbE4J2c$#(zEb(xa_?Yq{O%{S&4I_1d~DLu&r;=7Gp2DB2HQNg#;cv} zq@<)O^^RGdE9a_-x(YiiePwR8O8@*BYOB35S{ln?K}<~C*1BSouc~@vhsuMQWS#T% zDRlE4j!)LOrcxIzSJv)vtC{73FAw(dS)ik%W4_(X z{1ee)ucCXR5?*D$at{n{Y)QQ=xQd$8{amVuhxkyrns=}i@v`-GbB_#$7n|5Csmnyg zO1WyD0wEbJFD@#m{kpVaO(;4ukO+jnqj8cXIy(C7JMx{&Zo%a^p70GA8%4xo69naE z3*_++IS~uzVb9HXlt1bbM|Ne{4b(h%f}x)D9SAw=BuXzZo(TL67#kz*9Yt0<8idUE ziY#?syr2g?#|K!lf&YpuuY(lPVLS_ws0!e;;B>*;ZR7o&FvUszajKV*Ei-?#r{bcOxl{(E;Dt=dkM-c&| zc56cxATRm^5~b=ugDZ`Yfjl}ocifsp17-YkXafr0kAfa^qTsI?>k$}9N%aWZtlOUO zRXu>c-vuOHhbVnc*;ANdf!I-9kWt;pYarKv{nsYyJKu$)m<) zzxw1T1@(1k^c!xbN|{@!LSST?p&=;`JQ(4=9laaaC5;)=_gNCmz_8|wMX+WCL>@PM zlu=!s$IdRWLHNAb7R&i^)-jU3s4x>Cv%NvC$^!%q4UMorPH9O=NkPE_UZ?H-weNOz zcF4H6&B>Z};tXqh`;PW@Fb{i_@ZA)l(HL0puCPc1?Bj>92pLzlT% z7@1l+(%Vb7`TSXSNQx1MiEjI8I1YJ)rbqxYA0NP)^#V74gYaMTj&j1Cw$5L*vfBO#?CK5A8L%lS254>n=reOC z7nH5PQf9zqxVnOxPqsa#*#l1#W^Zdd3doZn63&amy32`b=kO5p8#i)P3U!ZvEF_Bs z^-UotBz(mqU?oLG7q8FL#?L;yO;NNW*PfhSAE$9zeV;S_#pjzz4R1{we0Gm0f9jI| zDc!3B_oSgk09+@=`E=*Nl2u_;y)7-Y+}tN!NS@TxR3I!C<`4)3KwFlB zS@@T_a>@{I3Vbqv#)*kXj%LJ5%(4L}ouic&T4dJuxnXg_?XYTYYPh&OpgZzo&@GOz zs8PY!NE->Q2nz}--B-XOs7f;!nmITwAs+`hMWpR ze(*Yk_+cg(<@VznHVMbJ@D0H%wP_I_>QjCITe2QPd#8V8-z{{Q$X)!KFg9pO6CGV9 zAh)j!Lw#f7{|9#bG7m`(Lpj(tK^Yi3%#l~qB{@)0l>w6V8c6ZlKVU#abfW^k#sR=t z4>rSO^Rp{|F#vNryQp&9`fccRH>NPKSx@HRhBp8%iUPP8+<}O=B!Y-)wpQ6yYim_j06M*W`1@%wgpTJATMn__X7gd z%FOAI?P+Vo$GhDEQH-j6IjXFqvq9tn7g5?CVeH$pK->a6R$N$UGLV6XZ!h6P$fA|f zC~$G)vl_vmJd~+m1ZY&nevBZ`{XykQ+9C#jfB&(Ok>1#-+PfQ^KHlDpOiTdsahMNN z)H>hDGzEkmE^T_L`AAm55ihBOQ<~oT#iP9Hq1-VM^Qma0wf`gQRT(nSI9?paYQ zmaQgX@giF+pY$$khfS*5w}N;`sBupM79n$JF#(g>{LGA?Pl@2zXB%q#M>q-!{Xno6 zx~vXl_Enfy=Hbb!Y)#g5qXay67dv~C#k=FU6o%>p0W0F{?Ch=?3EX2RN&pp9RaMp6 z+${IhX?q$0hTsrAd%HS3JWR&tvW${YCWBg2C~)!UH+$d2%0P*9pEPrZ0NJu?O?AG$ zuu@8EkEU7X8nSep@cwDkFzeomSw z0RCQ`?|GVbwzhyNw;cbR=t-q{yg5;oW9Xj~x*upo2B3%HoXD5n%$p7I3C9WU3jT+a z+HhWKNZs-{qC-Q@H_MtT)oQA?J(6kn;2^D12F0(~A1^ohjmp$Fq{MO}hV0v=Lmm*@ zaErsu2n$7k7)9hhP4beHquLD; z5wo%4p;-ijJT`OwJ2bzxHecO#LJz{ID=v|ng(YNleEgJTve>A* z%|*Y|e7;-Y@=;KkNq-t}mztIK08Ic1=uM`V{xZ5RgHdt2RlN-u@{&6Zm6K-Vys}%B zhp6Nq06ae}EY8@(M3SVVpy0_)C$+?@K+L!d2YmpPQ|QqFRJNw_&Ug%<`=5A+1L#0{ z%s6A~X^|UpasZ^GUFoJPv{#$`_)!s1Vpmnz>6w35wfUbk-)}`9IUchiKR{W&bs}uP znof=f4^JHnD-Z-!X)IO#0`;V%gYil@2`B+`*$;n9m*`4WnnL(JE+?uEe;c}O}MA{b^WTCSBDM2jC()|wgN7Ru;XjnRDliF zV6XPaU7BS920@^V3tSJqwXXJ*$1VZmqQBh|%MbTNf$VSY_HC23Cg&&EVmE_38K8}~ zoSjG*YW|W4A}&$zpK z75JoPCMFd+bCK_J+-$*vt_LlJ3Xk$PCs2A*5EuKchC1>TvdtGmEdk$YZ<^K0*uzl| z?lYQ&lDZsh3g^RkUbtwQt)-{%0lFR_aJe_&z)fxL@l4TnphVXzQ~8WMU+KWr$mL^M zL59Gy*KC)gHh@gt@93-;brN*I`rAt8wj&bPILa({OENQ8`Ypyp&8O%#B{LR|Ht$ui!IHdO#A{O+f@a)x&W460M*ySeVBYkNfOw8UDm!>u1YvA)YL8w(`_ z$=;MRX411y`cQY*P=DLISX;B^<5+=Fzz#4UoGCoEnXSKV6;FRImJ%39B8@wR_YDUf_KB(M zCP-1Rt(2fq7RJV!eQE$pgfj2q37i?PwaS!R7@3-`0-E@^js0xB`exw9M(j}j)N94* z;c9PI^Xh5)l>w7tbBm3RPNrM9``vBs+d>0%=EtV#1WeMM9e}2O2tJ(-p-x9!OKwq7 z87Q|}ed0NDj|S#8(;N-KWNCZ%o<{>Phh3VQM;QNdh${OH0_b8h8u~(A&dt$1g|%C~3tsA0YY99@BSb}NWP;LYLT!4DX( z{aZ#NUbtVe9U%ulm(!@vS_+vX-Pp3^l#fz1S~{%}l19UIFX^IGoj=v(=+kY*{EKa{ zLqGzD4Ko0d@_D5X{A{WC*h4Td%m==v0rKJ;{mx4+TkoJX+a&3^7D_upvKL&mJXI{4 z6xns}q!TpBvPnsivpA26W3)0P!RnK!$oPiU^>M0Ecu@@PkF}mfIRw}h8&$$m6FOYY z)6g_fl6|_{OIJa#&&1Qy`-ag)s;A&-m~OP`G0y z&24Qlq^^=BQ=v*BbLP3h$8!Rq6HE-W=Ej z?-7O1Ur9mKhG5Ry1me%;87s@V$N@t>Y_+eHgv8Nd^Byl;Ov!QvcwazaOhYEV=2S$q zwU0J9&e-DoK1oXPM3q2mt<2u?B(?DmAC|4fw;hglhZLP*TGWoMJ#eSGJ-+QmNkN4p zxN*`wh{F!{xa%I9(atEwD1F|Mb(DRmQ<+u5&zz(Cu69S5%SNiH6)^8IygP3JYgis) z^<&1KgA5$oQ>b91z{)C~P5@BLq6?;Gc_BPDeI@Zq%TbkW>HAz2w9Ji+taRi&_3M|% z&+c((Sy!?FC@wAzsf7Je58L%vah>*Ovk`edeLlrA#;IAbO-ch>UuM_+KBHhmltEif62^;p1B%L%Teo1^)k_k+4RKOxi3$VHEoLFd1$hPB{YyVk>6+>2 z;QeL_6$j!0^Nsee{;{cbtIqY1>|cj=y+ONuc=v{!aKH zWiNBag;oaXF@G_3SRDNE!UKVn(XOue!OA#5LIlKCwa)w{BGgWe>hNb*7j2$!ZHO3d zg6ah4T4X}wb02TJ|B^mHqhMGpM35cWK@=DO)6GDhudAPiZ=9y#sGa_TjuQzN!*JTN zzGD2Fza-V;P4G(MCtyWmUEL4AD)mDifC>AV_F{m|TuI+E7rpkYDi;8d`{_|pjD8eS zy=k>%@4f9I;t{_GX_B*DE8y}{sQo~{bj)}$XIEdJZDR`)KovT%o0pT$-;dD8rwZz}%VcJ4nuznH&jB2$acHMwGVQ(!nIeGa<% zedD**^8ef=o)viBu(CVmKz(|k!;*@~F8RBd67ov!1#jMiu6A(E z4-J-M?k64NnlwF29V&M;*bq*rr4?hn(cM9QS65w|U(I4PI3yX-(R^tZZ>|RK;Go_v@?kG>)OK0(@;&?W;6|{ViTy}sYV`p>Y z<_fdfS(Uc2G`Q-M+Z1U0G1+F@rN+e~PlS*e6%Ie~)dl`>4iA=YSQjH5;pn+&6TwS2 zfkH>?M>8Bckde@S=IvyinSOLnj?a5z3|utY?TdZbbXq;uyrb>Cz-?0-d@G93)~r>c zG@rQm1}O08PoDs%Z|FYkuPf{;{M$O`T5-nvDt&dc=Lh(%sqQ%PG&Z7tHRESSijFbNxA^Lckae zu$DW`euGTJZ=Fk?;pHOFLIa|ACyT8X^>s~0D>Yl;JV_%*lO@$*a}YI7)A5AF!4y@y zeauw>%Qx@W!SG$cZ7odN2;6Jt&_ z5n2>x2+JkNAE{n@-2&NJVYzdAx!?2M5X?iuR|>aVy6V6)#+qt6HGzYayKtxecEbh_ z{Prmu2Nie4R{hLL?7r|C1#|F6u3bVD-{tKV1>QnI#(`#d37L#KRaT>W0)@$&M)FGX1Kv0M-6+l z>~|lXYwUp3#CSr&3?h&++t>|Ot)ae9Aq9h##)e1pM<3E5lhRcMenNz^dsp=bJ8eFG z`04=V4q{FoC`MYC6Bozu!%lWsRFSdT=0K0c6y4vja0lH0Op1)ddC1$bx(8O3Hn%ty z)klWh`3ozg0qyJdVLR2MD1fC?!*2LI0=-UoWoI;9eGXG1P~)8?*r89a6dERY6%0n+3!vp-0-qZ9$KJd@@s$5Pfsmuw($x|OL^j4G#-ZhRpHB( z1p2BY(7`?qk3Z;H#R2b`VP{d#2c>*1q=#wE*Ew0aHPHPlc-=(P9<`xR5O7|~d)qp1 zfUiALz|-m|rf7QbJwcCUVKivb7M`^wx@8jR82|`KAte6bp{zS2~E;ogTZa3UcY74A)s%Ag`Ui-6rstHSR z*L`X3y-w8`%R@`XO-1st%f*e}l+;V;Dr{4yROIeH>$B|^O`Vq$l|ftQ}e9zWsj9-BoZ^aw+wwTZK&NUeOPv19%EhnOv_^O4Vh*F|6B zTv&{H^e7cjFp+CbE38^uL!A*Z{e7%rx8582*aUBX-|uN=0xm4A4d!JiNs^bB4Ku&JX`4A?|%5BIlz4 z;V}2btWyS_KxPk;h!{_bWc>^O6&+XG!xa2?NP6#|_y*RBm3P@8c@Cff&Xb4Mx(59X z{Q@V;CJPV0LQi!%GNa8DJ`{KN>$o(evTAz*1=XzKOy-~O*+-D&TqMEt+G zZ|C->`($=|ue)gU{FJW8?2mWU%Ia0{`vS%NTt2BU%^WD_Pg16&c<~(JQ7Ppcwxrdvy>_$jY9rf=4QH7 zdUwq3=4rM})W^w_{llq?&wr0eNT~L`j*k_0gc};`xfmqM;DSRo)u!haZYJ=zh?y;V zH@|>VtuQ=KnI@t}YsJNN>UB!!mO{nwyT%s*&tt?Lb<3)_UFaKX*}gb=<3qP|+yDKw zlaxK@6$OC-?Jk7x^@uxvepmaSG$8KP0I#c0Ykz%Cct$RVZaByL!V&m37X*?Ng^A<| Hz4rb;eEP`$ diff --git a/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerObjectsPlugin/images/DebuggerObjectsPlugin.png b/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerObjectsPlugin/images/DebuggerObjectsPlugin.png deleted file mode 100644 index f35a4a69b11d04c3a0ff29668f215cd4fe9a2b7c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 29118 zcmd43cT|(x);(-P5v3_bsiFeXMLJSMn)DtzL6F{i2L%zOiu7JX?^U`80jZ%QUFk(Y zItc{69X#jWbI(2JzV{u!_m6Kl)RBzjdG@pSUTe)Y=iGUxC@+bNLxywi+&NsSXJX3d z&Ru|jzc|>J!8_kq&PSX(XXh^^CZg)9_hagsj+)vuk1boAV8+XrQEqO+NbVhOqw%5n zLxCv6LEex>4bImbv&)0Qfm7X5GVQI(gK-SuG9#{R(pU@0q(tIG*NNF4OcT^Fe#5H4 z#-1%atvl`7cTREIC?S?VZcIV?eDx@-Jm4d2wi(e{O60x-hHy@9A4PsMH)IkU^P(4N z&~HDe&t);fOoZeAG)?h=>b*{b68>bBx0n~;J^OUa%lW5nb1JIW3bJR8Ba^)>gm66{ zKO0JYcWt@Gg{04h4r_2n8oj?s!+AKRh?<&LbboGt3+*j^3)gLv!+i_wpMLUi&w)&6 z-NAi@8rs(-jg&pbZ`f|Wi<%1-pMPw~-az&-_Sl#;P1x(B>QIWXmc&VUbbroRmv~5W zxo?~2F)ey?l5M5Z4cZTlLQM#_nEhyK%(6Q@iEleSBF8zLCwE5=M(v`Gqjrt^7~Ppn zxf&Yux#X^grn)@6YpVS0K3dQbw}HIs4V_O_bQZIY%qClK`hjp*dM;FKQ26Ag=wK8| zUx~R#gF@z&%&h6+fGbKdH!PaAuVCRSrw6>6Q!+QKNk?+0QA^?UI#l5l<$e*ZovY9| z_AI4HHWQhDgTZu|POHTICYGdSR^ONVO3y8-`aV}`FYn|Ork~tQk_|Gb>Yx2;RdJu& zKe`RpS9Z8wA@KZ4q2g+njS7ROE~8h2klauw?qjpzwoOx~Sr?-4So!dT0kfV(-3o3q z9&rZZ1|xj9<&>yh$8Dl&7Qfl*b(oFHet+%yktsS9T_KVil6&O=J4*!jdUs~e3}xnh zSXCBvdSM-&()I?k^q5y{)us~T95!r2@Tu8R=s>Sm`*Iz+{Q>%u-FTE+qO*zdV6xv> zq}}qR^`6c&bU=-~@?v;|<4;poO8#g`O=(J@WCh8xogVM=sbEWVetlYE-~6-${2QfD ze7n540N3Aq<1@l&E|0I#re`Zwj^z>)Df1;J%pX;YynF2qW{7E7=_Bjv2SP&b0tm~* z45L=W0`gi^`r*grT}``g=z?8U-n{JXh54i#?PK&o%Ri9zc}dRbD%)_yv4gL6 z(pDUOQ#K445TtB3({Vg#d{ClVwLwlma3_!bV8MR>C>nM={Z39uET!OB9y!&JWXv`r zLPJ=$Jh85M_gU`TK1DZ-?dE=5Mef26!>ZT6Px7O?8g@^VeO^7*_AET^YE|Ytk}2J_ zj5{>EQ_Tb0H=@d-%$GWd|Ua^&^WJUq$!45AK+f0ixWjDWkKBVx5h>N>-Dgx;%c?t6P->thhWET ze@aI5$^k+ExR8o15F@TPIh_6brqD*L!cD)oSbkp}q@i74j?GZUlabqv0I zg5pCN4{MbRv05*AQ_&yf4lnC-Z49arktE#>3|lzKB8iw#*~}DZk_4g8o!PVx1Z}^aYdArz?e;$2G)(Rpr6cP*Kp~(2EoBd$ro95P@A90;ocN6y@y#+pF6Jk)SHJCUc zi`#0v&j&rK(EXV>#o;m72uQ8UL_A27%8BBp>`ACI5~ZA&kdWg@O)ah4q_*2JS2!HW zW{~r(8>`lRz4owk3FYn4+^N@;VKn5$9L2J&VG`&^Tuxe`@ob2@Tz{`Wa4#Ld8K+tL zgm%Mp?5HIzy1a>qPh*QZ%ej1_fB9omUx!0Yq_(0ZcW+!7Noql5*Jzg!lLp^SD(2yJ zY=)6Qle)v0(~n!lg9*i_{?p!uM1n`cUhsyC?NbZ3AKfixXI8%8i`YIng}y!NfUi#? z=3MJN@oQX>h!NQ+9f9Z=tc4>DCP^PwzGwb60@B4kWl`Qo&XGB%w@IJx&xocdK?m}s zKe`+BFd1n6R4rZCRG+>WRkyM<>!Az{7hxKqPHUI+v2uo1ezbwt-ZQX?^aN`$Rqs}g ztze&{3?d}B;V5rm`GCc|OJw`Vma+l${qn-5a>cfb!9}m~=fW(3Q!*+-Ga}U9Nh0hk z*`~-5PZT3xSQRy&BsJ?q|6SiGA%T^as7hy<1;>(E#i(x!;!2%8dr{w3q|CINILK{s zB@oxL^TzqzPlZeGo~zIHT-fP%Xc}mHh^(DZDmvuty_BCgxMa3`loEF-zo7m`e}KNf zKI~-HSWQiBHlM|XQ6qOR!c90WS9?19b9pvgkHoG1o)OEFUkL)Pp5N^&YWUd?R!d0( z*J9D$!eu!vY0%VHv3TS6U7DH`sj=bW7_3#Vlysob@x4QDi%XJXvTtJvMbxiKf9la^-z(P^w|RYp`ch!w1o! zA)jtrUR66j;sV!>Fq1sqXX_N)!K*UTIgKA<2j1WjTh$#OoBp6@>M4p~ayz{mPhB&d z$zs|A8Lt)AerzI;wfmG;PBvw^DWma{wUQeT zpH`fh%;2Q6@oc0!5D%;Bc}aO##_@X_ENc-yBP-HV@lJ~wl!O-XxD|ykpwYu+2la)5 z_;H2$#O3I7UN^!sv6vbqXE*MpE8s#X(nqqXNxoO*RV8yXB3htV70pXfK{qn1eh5lb z?%_HXm1!Y;Y*%L8xisu@0%dwKuaR2hZfp~yHf)oz6|o^jHwz9)*CeUE#3rh3NKYFJ zY6hF73pcLS4yHE*W9NHziWo%1`ZH91MD&-i#0cr+EWG1p$H zMk_&q4!uTcU?5IByWwS6X69Q5nRq4;>R*<^6eml0OXq2z7KH^^4=mQV_d=sNzBg;} z+2c#L@hYRnN==fzv@G8)35)f*anCHex47%y$wSA{o1)BPR^FbarX%~eq96!Z@heyK=4rC zrd$zjHAx@llI5Bu?V}(R)2_j2=ob|b@U@#2N>93(KY$Rj+d@X=k5)J=3Y+*lZwN2R zFf!ynT2T)R>V@>B7_*G_1~7bIu@tX#*3*GVWeA-N%x^JINftUpaS_#Xk1-!}!I%X@ z8_c{`8%jOJi&6NcyW% z%!O>W(3_+A&4GT~S7c@@VV@W}_XIfJ>Mv+D2QJLd_r1P)GpC|L)nZVzPYcHd zlepJ6ScMk3HyjpE*|o3T2^9$SWb-guDLq`fG_#Kvz-V!B6?$80vq5-j@sqPvngH2zRkV z!q@s_yB&1Syhq1@pvTX}1C;EdSVF=mfLp)UC9B>*)dic0%VfE)=~#uR9??o5r(EBc zg_8EYy65Kj%{FmH9 z1~a{ZP5UIb*?hjhC|wR0;@M3jjSH#YZ6DHi5?@(b^4dueVSt4--PNdpl+51F#}_(G z74OxU(!n`a2-3lsC)h&eFM34LA*)Hfwq3Q2m|osO@{UkhjPE`P)FC(F9)YYJByO<_ z$GDtK_Rb@<-I*;aAJ07r(!iNFs_aOcfS=IqEqQ-?{j4-DsU=G2_~#pE@5)q9eCq+;ip5%L(drbRjjtwNdgh0Z-qQ;g6@1i=pNhc4}Qn#rusPkIHt~YLvpjPddAxV ze27)&qwU1BHI1zu4kb%o=6pf9rCX9rmBW&}yUF~NmaD5x_f&<|1h-r4nAiNQ&y`idLyfjmZ#wC)7OQQq`Lfml zL)|9tsTaYX)E@A(z|+(n!QnB^A`!$%wW-647QvYU2`c-)lBaQxD`ka>yyJ}5HVUUN7)Wl8dpI+??{;*K9n0#7(S zF8V)cmOjmEvhoOJI;Ho%hjqy+C@9a5#q=MIMD$o&PC%sYe}aJO4c2Ia||jJM253E7>g(r5CKi)Y|M8PH$Vu z@_=N8WWjR9C%IBOBa4&P#NhLFu*|;l1TOrebUVqcu|1Glo%-9yLoM%6fiBt$J@AQ} z1wRCBED(Nv#KN0R51QNh^=X^Jh*kX590M!b8Jk`kI8Tln64%{R+1;UHD$2m(iFr4q zPh3jt7fPI*_6c@%H|s|7qE|yW-U7)zjT*%g1C|xFS1ibNl8+h_FDtd!@px4vTnJ#7 zRo%eK)KpndNe^bp-GsMCZ#-YIn?L$uv?3Jk8zmso7*;p{lGehqw%AW?dfsvh*PV5e z4?P=(g%rpdqNAv7o0A_~E?~6vcc7u(qK;Po^Mj4dSLerMX8~jY}t!m%lgnQ#b z9zPq%JfM{n$VNN6l1?Sx;oiBWD8`K7h=tw$(c7F3Zt*u#_a8L*xI{qpFEsG7ypr&) zmqKbsrXKf}AJY|w3S}t`GjAHgNZ62D-g$k?R(A=$p!dyJ(|H+rRpdvDW(c6jLegEd zY&~Pi@m)1&E%WF1gJs);5&(@u~c6<%U0hT_4}EHZPe~$FiPu605)aJ_yQ{ zR%Ijkvj-m4uxmsDJkR?J+_Xj^%s$aOI=MmMN8dXQ9_SER%~Nq@m|s#kySD5@zt zSj9v82l;DzcD~mS@%T}i!e@)d9KP8+-yXhsk2GSlEEV9g5V+bce`fwWo&0Hf2ZCYUY|akkxMD&6=`9A>;n_ z<;m}6vk_P4k8p*-2m zLP)pCuBD)%QdP!v$;mSl*Ei}nN~51xXy8qkGIpsL)x8->R+)JZjl1A~x|x6&wo~+` zPtdHPjN$yzS0+4lo6{PIk9(Oje5QT>6I&+6Ko&H@Q)bDEs*%kmpR8$0gVl!eAd;Ikhs6 zPtYp**L!r*j*BLfW!4TzRAk)=SrquC43})uT>M4{UF!COQVmv2TEg2c%@#g1uNHSw zTch)rw6tk7Xf$pU7W|~?4k>Q?uz642u;U;+zjXeHS2>!yn5W8>Brpc6&>MRv`bD;J z-jI1Wf|l(XE7T>HE?}LYm}H(i8OEsobR^Cpl;z@TP)ih9!C~ygp_*6yr4I6?n!~UC zMzw_uk2}_g*$DIAgt$pDU)xU3Kgjm#%RE}`3g1j{l|0SSCCWIKpDbeuxiMms^|sP( zcO{*Rb1NmB=%?NN26ndiX_N^ki$-bah>djG(B>n8g7~^s@}j=uFWOyhg@ptK1O>s^ z5SMhFt(d!cE3gxhm*`f;4F>3)!C)5I}4kmR|^a(B$x_ybSIk1%qwEtR@B-%+~P6>$yUz zGCk?XKZdpcY?6^l>x^r+lmgS4S4rwi>>HJTDL*pFqi0+(XOZ<-hr1|#?r4M}Y;5Rv z9u1I{7=9ZwWStVsun7tPnVDx4J$&~58P(m`?HiTYct(4JkA@Qa693}FBSnn3G`y;o zEq>$3BQGu}mRtbzxhXD*cWLZM;mngY9?SICPHPNwC)!%%l#<~}rP6T4)^Ss<20ASy znW%-~jRzYOxVwdqoaYt`v4J9R?wmVCL8y_5$^zWHR#8dBq&G%sE3VuzZ})lWGEG^GtZn~-C5*y?xe4Zu0|y?WnWX{QdRN6YR2dhPXI9k{`+(X8*UVJM4>f?ZKTpp9*|^edp64!%0GNb)H@fy*+ZOwPECmVMY?qZ z*VyWxfSxlZVC=O%7PwNkR>}DLSg|ImT?+Ab+FR5G_6`m`Pl?s#5>*^jTWRjD%+!jLa`16~H`;XH09IvDOGdz)_b~ZPk3b68<6ucEK<+Gn2#cwqS z`oDR@?Oql5H!c1AckYg~2Yh^*iNdGHJ6hUua=3D_4`0$c+=unf**YyTr|_E7>V& zIbU7p{M1B5UP+bke{X$6#rCVooQ-3&4svlB4XIGTBOe|fo}HYS(6%6d>|9`~-Q+E} zK2fbeflno%v8KLBc>A^#hG%UruHO!n@~LxP?{3TI#oj`8Mlr1<*fiSJ&h#%;JFY0B zPL4J!oxvy`M#J>EHd9WyuR=~TB*>`?zJB(7?9(`D6w#x<@I8&(EQLauRj>X* zuUk`8VA!yoxzmrYN^9y9t7~hyMMd%y9`5e(yF1(I0(!$R8B)96(Y(>egPY4cb)Lww z5sVzw7U8GX)`;F+)V4{ulz)Qu5%0H~A)_t`3=C|&0daP&nl!p;qq;-@@A9E2;#Gy= z-o88T9CnKazgh~9Av*fPX2XGAKLi5Fs$9uEC?PHwy3Is&PdJM#arf7az;wQxkimn< zM6*=iDv&^(!VmS~A3l7Tr>i?0_NiBzvfQbyuI^xtzBknO++qiHxHSilWl+h|NZeD} zOoQU=Dt%4~JP@**cy;kgt9>Gc;}EP7NL8l)dUe(vA;|1H$?K>y}qfJ?Y z9{aq*_+UPJeh;uN$m_vy!!cDoxA0CT#+74#dwyN_=xrQ@dm7*Z=XmFuP7pWePkd6+ zkEl*;P{Lj*Y4j;*$`Bv4)mBz&4N^Q3>KGrI^hNY6%aoW5v_tz$nC2J^TAa1Y=)&6+ zjv`TL>q~-r6Y8cL+0QGu`9tLy&odR5-1-&a(eKJh2P%+VX6+}26-TCog$lwF77_UU zKg5-WPT}mF_Qx-9pfzvGLSLwKj6M35RV=2D4sLWZFsIFy1yu-VzrJyhn7T|UxjdoE zSK*D2A`^6@5j|$3&}nDaXCMUp0#i7Rr7B8X+mTpeFW>s$gg?%!VO!mCNF60 zV#pRmF6@5JsW$5@z*2QTxu9F?34+ntVb{>qGNgR?3TE@#b84&$JB7~E%9k-|XyVhmlxz!{yR; zs*L^&$u3>FSQKT{^MyT4o zALp~YH5?PE=w-(a!=+>#cSa&RTCDQ&^Y1CpzNZv)kF0fEc^bp2o4&nmzpd;$;eU;^ z!p^hXikO&qHu0juM3q&p%jR@sWMpPYIhUc)T0Eb_;`{1qp1sYP6dW8JS(K`gkrAio zp)JV38I4{?$`TT9Mle$*w`5t;+4S{^PvXNU5+BM5d*3K61_p+0#UR&}Fj1l_jF{nR z*VolqXL>QI7i9_`f5)G7jlD5+m>5F&IC`-sAv+}Du?uSmIgk8f6QIteQa*O>L-?FH z6!t($3`UBsUca8Xx@sOT>cPy-DX}deFQ31}O=D3-Wmp68Mdwbrx&NYKS;DO%BoGm@E;2lN^x^K^yQY1qBI8aV)H9vdM*0`JVsf*x+RS4Is3+>$!u8=Y;V>9% zoDZ}9`RvV%JG+|h(>70cu=2AS8Q(+E?c~Ef+{GRq3Ec)`96l$WrSsYCU0xz0BD1{w z{PCBs-@3y{M<+qv!Xa6o*nZw@AXCbiremPA!NQf{{gEXLRwx;lG|^@yf8lE>Ju-}p zKgUU@u>h?XYod6RhxCmiY@J{^M7|SL(-BZvkj*iumt^4L8qN$s3^&NsU;mn~&Zab4 z3>|IzDU^+=-52o%o|Ky)xUWe?hpy|kB#gRAbdD@KP4jMUZnAMt>|8#~$$3zSNony# z?9F)<-{aS=oI#HanzICU>(W1v1o+Ik%OYoa>LIo-F?jV-grETP?seZ^`GMe9e(}5W z`&T=~w(xk%9VwWzY@-tU-)Ct8kV_LGcuhWY^iNgtm_! zJ<9p`G4=%H>P}H`&(tW}4t@AjQBiV1ZP3pHUB@COB}HH|E9H2e{;mcHo(|oo|BfMo z&SeD#1!V+Kd&lxSF6(n&Gs;&GDlRCbmrUeYO&zAe07VQZuw+ zdnhq_ZL~NWprUtk&3;!b&<9g4DcBs^RhIqZ6e|%e_yLSUOC=TN!;E&_R@;a0AW{p& z+^Z{8eJCqI5^z)AHX}b`?T@x;*lIgVAbnYu-7XLi05C~SU41b4Hpg?wJ<6{u?atXp=Y3|CwEvz7YgxdxOsR4?VwQZAT`}=KmNMyy3u4e_hxLb zis~A;3B}w%b6!r)Gv;z56O%4oZa|RmDdtw5g;C3ghzN1s?+YTs4F}Uqg^3GFO~o|QKT9=4aBwvpO>LSU z?XRn9Ys=*3=H89Ge(T|rHELn+deekQMmV~So|-N&hUw$pxmuS^Ru|155q{wrGOtE@ z)uMkJ=XP^m=^q2cGRHtP0FSuKw7$MQVUW+1QrKH(ZRr!2*}#2}V@N@+>1FQASrSm$ zUCszoHZVw6@nUq^;YaA$X-?EzZ%z&vf-3&fP|NDqwkP}Vw*Bwe8%*8bMa%%B-=9$U zI|SM89*mcVM`=Y!XtpIO$!UF@E1uUb{V-7k!#GQFE@*-4J=Dwp%TO>MY|H!=3ZMkF z22itUR|QA2L0Lm!$w6wsHfy7L$NC4f|^)S1_MK2#0f`x@e*Sz}rW|u4AaA^WBMgiphk!5;HmuEo8 z#Yo`FUA@nB?t6K>i`*l9eNTX@O|PJ!FkWqwqOn2#Q2(WAwF?Wl)TCP>w?-+beu0Wy zAZONe(IqrXUls0EY$3do0qWCRLp;U2!A>s#r=?wHym+QOHXBrxm1loef-l>eRIci) zsj7TEcdoEP8#QZhZHIhCc!z~zRzx~tR zBEJV(sMo11+EuX?UCqygs>Ouc!ndM1_xZth)dTd0vCp4BpZ@ge(+9%B(2c4fQ8nKf zQgMd!V$iF}$>|79!?xhGb}Elxi7+aw0oE%N$Vn=b_IxrAN)Rmh;MSM8G;)baNF@CI z{kI?HyJiLY4fQ^6$!W}dy&4q6V708+U)6c?__#t>*+02=yWx@2pZ zKg158TSl^=hcbXbmE6SCh&Yab`i6#FpVJdnMMeFA?ChrOW8QxUKhCEG~HVr)&gMdWxfa)7N16L)Q1mu@hjiPobZa-r78n|M>S9n*CfWP?H8m`Ez~D> zLIW5?LJ(>rpTkZ(CqLTVJzSpHZGZLZm8!0;++emsc8s2T$1E>WXM>#2{=R=efQqQ- zMOr#K?Wvo@y`a)$!{PDyrJ>{f3{PuT?m& zYuVKs_mJ5YeYhA3+sVsgEayg-jw7IM60$Sd^w8{f4!y}N2*`$&jbIT6LCuh|so%P6 zHC3zT0*dd;HOvEXDPmo@qN1mlJZVMx*ZtdScO1vv%w$10IMhEf-MZXS{fM&)W1f zUAe}7cZzUITPUT)K%0yQ2Hbp|nwok6jr3%_a;GLF%#EQ0U?xk3pV`7_261umcY?a* z#yyW}8n9;2PM=Tucy z-#0ZieSI-g=VC+nMHSRpSOAs#GfTZCxgT3wTfc7x45{rsHL1@Cm5;=?S$NO_jePm;ZC~(BeQIB|dzUUHESSE&aYarzP%F>FmWHjYBgT*j>_lQZoR&sAovYFwY;^p^-#49 zwDZfC)L&i4)E~MIx&vlN^2E1hzgz%K=+>h*@&iLcU_xG~x0)4_RBo>!#d?K%pd=p0 z(r9q`QWOkHOG$+XXtm1tP^9xJ=7LC{n4Ow(y0;Ga1~s)PY|eje3(_@MUw{k4+;$et z<`#RCWaipJZnmR5P=|+okqjz1fXlEj9NFmNO@(D;4MZ`iKY09DI~Z_IrnvtWMPt_> z)6>)ALd-?`>k~oypv)@)WU~y=yyM=gnq6X46fJ7^;Ku;$ni>RRz669>qX>G1Ecz7B z57Vx5xTOMDLCc_Z2RsH@j<25|0~?zH$aFk;4sT}{gz?lV@&?{qC$y@Q41N#h@d}e0 z!+Vo35G79ctZ(z$-Vv9OP!=&CSeM*C?cW+6Qz!|c<` z^XUc#1{Ka;CGHDR>ZYqhxvEfTaV5L!=vPnt(d6Y9DvD)f10C} znr@|{rY`<{kufC3|6336r{FQabV6W!lKQ;n7x(xMf%8Yy6PE<@hTKsHS$_raW27nH zT^74+3Oh1V&delHi5&HVG0awWFkpAzORB2w5~#$Iq}xVe65u~PQCNs3^#JBJ)h zIT53!rKLm1ut7(Pw)Xc)toHWyRMpk#L){jooj^MfSOw}(p&Wc}H>_j0)KIdpNivKo zeZBb#b>_je2jay@2L!6J0jgS`G6)TI$OedR2e7<<4gr~FDTH!Uty_{w z(Z>QSy`=>nw;lcixp>ZZ?t81^>*JLibxrQQ95P`-s0W~O^AG)V0>MW6JH-BXJ?@|O z_n+!YJRqt5$hH3+%D?O8>iTxp(AwcO3hA}IgyQR*-a`qU$hH8u@eV^{JO?9Vx$LXP z@ujDS>zbMlA0HoJb9hy0UEP!-Z}9E{Um*i3kq~Tt->x#FE>q<8!ffnB;&YZ;m`hRY zLW*=4+KyM%n?BTmu+X}GDc|@88QJ*q*ncP=yN7dOL7(hTj@^_zkAtAcPj@kVP+~wp zK+p~`6Xfj*8MCptSxx`&6AvOdS~a+1-@?7!7}_ z77prd4*K6U)AH4e0}ZVWadB~nntXh=cXu-}jWO&qAoAZj3rhMDp6+bLf@<_d*SWYj zH#aRi**y>>d`UYyJ50WP67))cI2c$m9y}dBM(!-ICRko(qCMsn1@5c7BAuGMp?pt3 zjmohYEph~X_8{n3Wk5jG=G&B!1Y`QxJ0RIcaKC8@?;hU^P8s~I4pzADnb(kmd@Bwh zmjp7X}1I_nJ%mqZ!WBSlx*poIyh#w(BYio3_ zJ#4M0u|wR5TUDL^M|pr0LE<+WI!@i`Sl9v!IwtY?Ns?frTZKmFnEKLp1=33S(D z(g3pQ`d)bZWZUZMYU{uh;CSvtvm%*N9O{xQ^&Nrp^4&h5ulh)#p3j{UEB66>404`U z1tiZm9H5Cs{t;l|0)Pc+*c;I{ka`~!He9Xkx?VXdR`M<+gm~#V3Q?1k`|261nxkU{ zw&4hB!Px{ui))enndkY>F@OoGzom$9;&FwN0rvB@1Vifs!LmHx5n*4h(rSW>`iDVz z>w9mnvT)O8vd2c6HyYJ{hNK`EhU!xoke09EU}F;y-?;Gr&+1sIPw@eU%#} z{d1Sd3v`i6fa3wcIf}}CnMSMZ#XHWsLP+Rk^AAp_kf=<19br~u559; zD=UZqhF6L{NdlmOO|7}3QFDh+k+1H)DJJnRON`S8kO4n-!G~J>pnMQVTGS~!u5Hjd z#}xz6KM5ZwCeHyn3C<3s55piVR%{6CGhEf?=4J!UZcShd7A0akwfhL@aPAjxO(z5m zUJFdp@eO^Ed8MbPr>douM{XBXs6Sk!`?&VEPC^nxlEl2!U+|4b7zId^_= z*HGSasz)Z8RL=LTt&J3B0D4)m+Ip(BJ5fl$F6VfG&4;1r2*^D-4okh5zTk<&(~=7@ zP79sHfLu>EN%4YgfG08~!G?VM;CeZT=kpG;Ca@%7`l3GO|AG4auR;PdQ#9SOo{-dH zHh4|VJL!WhLh9Zh%zNb*HbDa$ltTRV)}f*i;5dL<$_gagC#uh$VJ|E#bxk?{4u3u^ z{|&klMJ$dX{rMko^m_?(1_=;N#?fRn5^Nnp5(PFXvz)?!J%K%i{i2(R; zqnAg&_i`W2YJbKR-8$!xBE1I2(DJe}v6Pc!-CD=A&Q9rd9i#O|%kBA&UEn?$Ah)Tf ziKYjcZ-eL(6KUqz1JG;6ffLIi=`d9fMJgFYe{8+}ofb!H^?aO!+&%(pQi3kZr z{4V1Tj8k5PRBd#DE%x9~&9<#Jh~dv#EUM| zadhOw1r({OtZeW|5k3TH&Ny;O{82y_uH-geYoy>u9<^{hUs+kX`x=aX^6Fp3PT*Y6 zLiDutE1ry_qoauI8}sf58*)lYN?O!x7x!0(WrhIqtOU)-Y|mN~vd1O|G+K1)RU06U zC=>p4mHNO_+TPx7;RSMh_09h?di0-Qi*#rR|GDwMX$83{#5u)TrmK5B9Z@NdL633~ zEI8I*w$tZ-Yp3tXPWoaQTVXgOQ3F~P@4x-ZF;N8kKth5J7lgpk+SOa zwQaFi1Ku%qGAt~HMVqb&SPlwJnHU+zG9_jDLF$WTRtv0hFW3fV5^;4hNL~d=p;o461f5D2?y`Q?q^1pCZ_}H&F^B zB?3JMHHPq}8wWay%+6xZU|Ubp;}}5VX6t4EfVq^KG5d+b3+0$sRFq{lm=zut7S`b^ z6Gnd^E-9%3z5{o&vMS{DIs6__S$a=0H1p?ATXR!Wf>-&_CU25W!xeT=Yn((eWh~X+ zS*p*tWcz1dNCg5C`>nAnhAn6g$QdetYiiv}6Aj1#?Smtrv1>6DaBpYlKv6#ws-^}@ zDreQLHMNS0iZW=EGFsna-s@NbE{f4McMlH>nsAvJdMLdx00kA+|0qh4F){Qm6L9ij zKC!KB>HsD@H8asSZ>y&6Nq`oojF@g-2#x%whSxff3}fHklcg>=%%>>WwVdi2;bW7D zj*eb+w<&c>ngkkYAwB>O=BxP^kpF5>u=KxLqu|rqWpnZJbpqm>Hx2EAJq71rpFVwh zl9!uHDC4`WoSIzdF~&~~D6$87z5<1><@LxaIOT<0TwJn&{-X=}k_zsB54B)Fe;t&N zAe!%2ToJM5YLeZ9B3vVc5VlUMLmjh=PJ-G8Wlp^b%V;zjZm9uE7+jB0W^R5*v)uTd zEp6EOb1z3O{=evPe_fO?(-82GV@vZ@Vo6auN{jlxS#Z zB2z$PIRRwU=B}XhNX5+JO9~48OV=@Q@TE3pladt-0UVX_`SVk^STz9^xQO{u$#Yex z^3y#yJd)cn$8_TN?i)ByFhc84jf06hAZwS0a#d=>!R>^-F-wjIF$YHyV^$d)FS{P*K`&StMpfT?@=K%sxRZWdH zl!=L{V{lLfBT8e~Brw+hk@k7PqOqlpc{o!m@C8K`DDjtndbH(?ODSmBur6P|tSl!N zqH&{D`OaUjJJ^J-7X@wfHivR=as%Vhll)&cD*bK<|~Vl0(P^Yw{IUJuZw_L8oBUynesLDZ<*5erTcEb+aKG{jJcpipv8vxet z0S}M51z6aJWFV$L`2D@tfx;BDd2r@oApEte3yogM|K(cvh|NP0iP~E;u}1^Cd_f zlfQfpa^^4jJr5r`E%&_&rQkCd=&i4>#~f;TJUSRw?gCK5u^Jxakshl~oij@zv?=-I zuwA%w3OvOdOp=%LQoHl7a@cFwla}4}42h5%@Gi&fC;|ZCqua(FFa2wVWai>h`>}%B zEB2AQf=BTl!#P|Bx{~y}YVDspH$Cz`x@L8bDZ-ht$g*sTb8-ld5?tS4ye>q<#71_B z4Gz<(2#;(a(!H?TsimdJ)AQUCuel9MVbzloU+O}juk-<1PQ`*0W*%^xal9ij_`Go^ zpYS)72F8ExpFV{DRbZJa6?k!mbobkVOSs%PD-wT|9eKYMXqLBSvfRC!-rwBbzeYg` zii#~g&EI89+w|YEB_1z^c$)fXCz`mUE@Wf*({7hvvK@oZr2bbiw)Dps%g)Jpdl{EZ zEa|aJ)>5)ZsC*JXY>$|TNb&Rp-7ztdu-F}EXrDxpT(AdtwSp zC(?+%>B}!}lm_sV%gh7=(*ad!r=zJUm7JWcl@hS+YEJD_Ns>J8fM!QHZ`EjF@C1rZ zAz4;I2zkF@tBoAf8WjSC@|*J$OxK@^gNK(@UoQZJmp{tID!zo(zsbd9ws_P+vKSXE zz(KJU8~_6shhENiULWrVm>6#7<<&5(4=-27_j#vu=}3Vl#E&?DmUY^~N$cu6j8c|*+yFq- zKa?`e991g+iTaoHCAKM8>RC(TcPazy=f$vkH?OH$r=bi<{MC`dgxI8Vk^)9X#xFB7 z(C*iJ8&le^*@r=@TS*I`x&e$qH$6N(>oM*zea`<&e#e^WWcjuQwTDA?#cND*EW{+o zS^VdV_@vQ5GkHd39`)y{b=zFO6oO*!$)yzl!!f1A6kl+PSTkp~v!eqeH~j`cO480k zYV_8~=b*~{$A9>^s;Q}Ih6zxfrSa6v&$O_|ty-?(CZ!msFzCe~N1DHEKO(_}i;$CymoTmZa`x!y=?7I51jWI&7(h)_T4e9JtPF^I zbl2AMm$(1u&j{f4`PqDB1(2Z}3Ah+^1b)$j6r!qnKe`*V(||;E&8Vfw85%!hfN1Pp zOGm6X6EO~q^umII?o8d`aubFACYMb;!Y}h4U#~&p;^O8rJn_L{OZsHjr)PKz2V61c zUoAgB_p?wEz0+U5!?o%f9JsxYUHiF>I*B6Un2FgI>`sC9zZ}HY_^_^BhOOa#Zy^g- zo-3538dM0~Gfsx+Qa(hwe#$o`q+H6xQXX9y8(oM8Ro4HL!ha_ zg;*+eH!vHXbUPm$q>jXNUKn;F>&buPY6G(Kp0JH);IE&{*~?(N#Pr)K z0Y9APU&jZCI#a>VrQC*GoWXl!A&U7~ojfjZwxF{Fb=Uez17&Sn0VU>WLe7XXHsnEz zIr5F87CCW0-B%$pid&=muYjJrAw#5c^G zsb%(lXp0b4qR$PF@L)uPh;~iJxJjGhY290L0o#Eq+fn(dDlTz&izM3D{rzTeVc^&x z8JZV!^1)otUw;@U$nOK~$Y%nCn4P|T7DZAGPN+0V7`j+3VI_r$=N;yPV~kOg*2T^g z0#b&H{)4G5zGmQ5m0eh8JbwhcLKBh!X0)JeX>OcBedX+|MK(c!mYER++mP>tE&(&Q zsz6|k?CiIV()QF7I0;e_CWXs0T1_6TyJ*fH&lTT`n#Zsyl{`j>4> zpB>k4vn@gCuT&dMrcD||2%VTLaZkqr$awKgL|xjUn_F$*DRGi81?bF7mX7}l1#Xc@&HF^*VYuuql4J7OjtGQ zqmv4A=w?3AYEdH$l2pcdfAXPz&Ce8=pFk$`v&KUgTExJY;YfXA(iDAXVXs_psvZ0o zNZWbo^#i0nq1y1spxQz}MP5~?Ui=AlIk>_8yEF?1?W@Ln>P6;;)}E&gW4zO%m6m9i z^ppdg-1U0q!%?3p6jH5YGy`+;1V-Yk#>9$;E8RP1g zwM1X`mcUOVJ)G5KI^nn9$2q&jjv7}w+UE2`g84v`ynXLDlc2vnjAmx^2Gad(GkydM z;l>g?Wj#WtZs;3z4;Uuzn6RP_AtgnFU%FUqKB56JrLj^mIuYzg~9Qfr(=aKpGO8dGXhqf^$yUU`E-g>YO(fHtvrx4}1CPzKrH6DXM{f9P`?(H7 zwtHkzYQqC>bOYc8amN(Hzb`NAC8o&da1L#7>@qI*EXr2fH86p)>HtoVVIoWm81mDu zGkIcjoW1e@uYR53xvdI5_bVDN4+DM;1OE!o|Ce-BVwHaLg>rn|ML@}Y2+&ei-{9Q=cm~r0>ChGWGE(erYxZXwq?IfEM)d=_%+RCh1;3zLs*@Obb{| z0)L$ua7~SKF$yg@F&U|r>|J9Kg3^(_C=adaV*}J*F@PNQ{GnyLn@}wVQAY=bH zkon=k5uM|6nyV2AaHgp^WN&|e`wR?H)@4Ee z;uPom42gYzw7XP)%&q_FoDw@bJ4ySOQ4T$v>%e9Yj0dInAFyGqj@8B#?wn~Sv|k3L zm*-(3fE#iEtW&8NkmP%=fQ$S8N!$Bt$_Y?3@ayW?@=46rdZXn|Y}!lp@1`-R@C^nP z{(zMMGAo74A{twL`xbB_CT4lt%c~S$IcNHcpx|4mc8UIZK-|Wv zDJs4f7-HPg^!oz~^|5^LkRDQWM)XQ~Z=g0i6e3YDW$nxp%v(SaC-5bnwEGKZ_&@Bh zDnHxNBuI}m;bL|3Lgj;%@%gP@^WVS98T7j|85{fKKCde`gbaZs~{#23Z3q zR&7L!`x5GTyj(QAZCVIwFjfyN(U;R8tC5k<0G)sM=!jvTgogL`8h*MSf{ zAeHNw3pH9x2@1=8pq6c6=qaf1P)H=Jnc&a1yK>&9BY3_YJ1(1QR11 zaR(|_j;zoQcGT4!hwgaJ`SW<^&W(cOM?G0N%cs>YY(JHvT*%t56{zN)mzs2M*)XuM zVEQ^9SXDdSr$tbzM8>GN85mPrRw!-6#Q3&QSFC<0&uC&G@9lRI)-oL;nzt{%VTmZ# zyq39u{hj2__ZyzhCrhsUCez)C-S_>-wvW7pPLmv_cakGGZr1J`Hg3LvtSlzjjDRj_ zN;KRut=9iR!b!QUQCi+dL&;)rg3Q|bz|=Yx+ab*V0P$`(sFbW|=y{9a%^PReX z&;9#7&+~izUeD|G{bR51YoEhD*XQ%T-q-cHu4{wD3Tz4_WWrSNo*qoen>1PAZkckD z>|q&ur*OenGQ|A`B;vh(v1}RyE+q^`A)L@{Sk#)&UBOA}{#P86+w1vl$8uADU5Wu zM7ziP>a$(UhOG^u#oIonSbRWmGjc1Q+M*jrNq+@kxT-n);D4EZQKtHN%^Etah-;%^*;-Fl$`w_mHJ zl2k2VZzv_1T4)LZJ%Z?Dq&i}!>v|YymF9(Q9Zub^?{4d9S1@+wRj%LQ++mNTnL>uw z34!f$JuJq&o4M}vq)^0GV5I|qxTA4$%E61(*IGr`0VT>-65|utedYH1C zjWa_Cg)0q29YHg+(tMq}uRJ}J9S{SS44X-jRC!b%5`=VDm1fhO#;QN(^0;|P(p;_J zhRK~WU)zRxA*u9z=Q*>(J!2>i`;kde)U4;|i}+jzzXwck$YTw!N9&FXri-z@UmmLG zDm+gKom~VoiCR(09g{0-w>RH)iQB3mY<*rw7I{(W*s+@pdDjm^C38JOW{W#|ETE+@ z+*i}=#u_aVk)hd7p^Qh@?p#TfGB%K%B2{d;)=$=xT3L?+H{Ka=tBtAo5qM0JRqbWD z7D274>B<`8W@@BTs^??PK4#1y?m%(53m?*wPhHSnkMLTeFQ1s!x>X+h{)EMJUr(o6 z8!8)Fs^RAtL4%^FSMkK&XNjJhFA|E$qB+?wnCHwJr1nCp+0 z#3;l4Jx4g%g50FxvN&PsE>VIsXBZr68$qh+KiUYR^(%dc1Q$l{K>D@cjrMzNrkmQt z3-RKu-J%v1tTuah%R+1;naFuJRwE-?^sOw3%UC{K@K{pJj|32YWJ(i+)A)8ep=)jgIiPu#KUS7*r&5y~Ks7P4r|Z1LItG7MN) zL^LnWGyz<7j^J(#EJgoxJ)1&o(C~c%5xM41VNJkUvq@%CL{=t5z#aaU_%`Jrk4q8n zEsJKDb=|AuZf~nh%qfB_vi{d-aWH>lC8iGr&vs`rHr7b9W6s#e^y~^od2KoNBS8 z`iPHwcsuRRY3|0AJ=fvp?D2T@L^4zP`#>;;Atb3h7dtQ-ZydS0ydEWBUKY0eobk!2 z>Kv9PI45XOej#@E7A)Wuu`}s-q)^in0T*K!0yz62JWj3$z=z9ePD6w&xZb;#%#^NvRxs{^rb*fAN03?m}B2> zt6V87UL>eE#uezi(MM%`&^^-xUP4e$Hj4=Djgi>*Y&A;pqb}D|lC?mg$FjroonPs=f{4^>W^#guJ7_GzSz!z>L-zh zKFz+-7l0?I>>=MQbNzhxq+%sJYkgvE?hP+~n}FYXVgDawrt)_;%a9t=qqWaDj&FJ* zlZJeH$Cv(?4WW1BFSd}TZ%wG>Lrw?CF39r4? zKHp|}omI+`6d9=B$Fb_GXj{eHHfAGg3TgUHz6tW)n?foh9n?HNd)M3=$PZMu+CoRb z*iLY(Tm!LajWz+}IrW*e3^U!mknRgJOZ^<`tfunXAVS&UBmA(o%$ZfNyl^dFidLkm zITnOBO2ZMi&Iaw+kfS-ezq7XgvV69#+gOmv8`y) zaa0n8>ebaLJ`_v|kidJ7%XB`8bPb@^^gwOu3?6lc&b70abbZ2TD#HP>;PROYGcZ92 zq_Jmct{W{sE(gmY<~IZghc>4li;5Y^{Vga z)=_{Vibyh|-Xl>5AkOs*rjUrZy7Pwz2%j?JWfKTu`;QLadPN%E!0>7$0UTheqdC&O z!)Nrh$E1UBAcLmX_2gi7L||jrDtme|{!Qv(?ztPBGoi~I+NyPg;;@_QEAu4jxTgQ}HEk%A7a9`M#SH+Kp#8CQaq_7{^QS-> z2R0;?!@ml~N2~+_yybs_BA)>F0UG3$kJz%aeAFgaBxLhB6Z<2isi9u1H7dy(_n!P4FRFm!L6qT6(W$A>Gv zRa_ThDvTK;ntO5QX~hJJ}3L`BEievUN# zGFjV5n`ImAih#vJd%3kk)3v^%QSm!@i@7=!{HB~chxqBx{}I9czmD>a-(EI_3xaN| zi2(T|K_{iXZT(#FU$YZ1)O2kPm{-;Vg;%DNBPCdnv8vKxAAnhs@0)vv=^@7x^A z{cM`H6XK}NcJ%u6a`{99CI zc+c%kMX}_!Nm1W{yB!KXZK5j?98||n?*IsGp?ObHLA^mlmX@)KLw(7VGZ+*wcgR-r z!pSAigB=3U*ZSCExNoB5i|6>N-yU6P^u$DRHgx;hv8#dX5zsW}O7EkRZNqUI;Lo}(QXpf}r+ov6?JhKFWT`GaJc%qIb7 zqc9<%cT@YYnU?MNgps@ZJlD4ZiPxKPMd?hSYD=6k1F``aF;LDtkbZT6H3e}fbaImLNEqaaNcF>M(7w>#9^7WPjE;0S6~GU-7zq;$WnfR7KJC=?p_|?G?6jr%=rOu2oW4p#nok1h%Gsfr!ONpO zDP=YLZ!F-Z4u~mAN{Pe19CDO++hb6hV2}Ti?0(4Z_O?qh#x}6B)S1SA-r>WtAW*N^ zzu(=XpsK*U-X`K>w8D-(DQAbayiAVEqkA&`+V8anmKdplMmz7p9=PDIDg51NpuW^A z^klSbdaHkTmS{t1g3+l2RzO;Eq0h`Ol~9R1vU=97nVIP`1UR(m{IpzPS8k8L2{bYt z=CkNFN{fm1BbXcAst9(bC_HHWR+Wbz>f5B?y`AZ%r}Ze+?K%RWb6g;I?w~`V-@%Uj zb!A7pLdDsEPd-_nOR}gsJ(IhN?FkugQD`hSHzDC$$9>O zG=%2A=(xN2O8G4vEdnpGpHb^@$MsF_tK>(?I@WX=Wc~@#6y6p(a~~`O%4zzy=Knv? zvBD3P~8JK2&AD86!A_~AL(O9MdZnoPNH4NDFFWyEV9c!gR88zO84o<)> zA(_$ZVN-9!xQsbXU*w$2)DySdzLGq&v+3E4*&su9=F_wNR+0WhD1x_gi^Mmu3xhzQ zCA42TV(e8?eGXNn9{JjB+tUXwWYAzQChn-H)h2+m)l{h1-$nF&5NP3XfjsS=KOfAW zL@zx(aZ!8a+pR2q0T@c1<-XGvt3S|OuFRP=u79M`2w?+#z1V(`;%5l&HCy=_f3$tg zB6ISSL7qof?!k*|7%v7U;wwAo;?)4m27b#ytf~K)C3`kqwef1^NfQJ^v*@A_Nrk>2 z*x-4)ixbd(z4*weGE*JD{xgZXKzdp*V5RoxZH*~E?ivGGb-g3E|A6n^ca$tGHdW=_ z7GDy!gH~EvS_huZLQjIl6eE-^X)C5Pw8`Jsn`EN~#3WCqhmVBM>-q_c&}=^E7oq9^ zz}(?qQ12n%t%)s5x?-1tpKNfwhya2b=mj+{OZ1jMVEvO~t0;^U?rD|O_hH*|`|9gY zL#-HcwwhKoSBEb=Hd(i;1=Q|P#jF041rAySWNv_M`LP-jSEZsWzwRxHeen`tI|l5M z#AC9Q($ibn(_^dCc_T#bYu6?&e5!_;>&#UgQ5fbt)Sj3vpoFs3!%NL0rBoj`twKo| zDv1Px?9HG;%=+F{iw+m)G6mVe3_)qLYE3>TPI`^L6w?gqJ6l4vEzRD7yVv=z$NIPT zPsh}*ixCFD-#6K0Us!oO&963q&DS0JuD+2(6HhW3v#!kTBrRLsew)7q4r!D>_D?e@ zTBV4O0Xi>D!T7MgVL`Se_@HsfPEZcdZ%XUZ8-*)o!q#sJh$YCa>m~(`bLw1A8qKHq zjB(>tO}9Qr;?nFjIMuu;p+g6l+?^#JM%G>GM%Dv1N(Ub3_(xQ`IFTp1({czil#`Z4u=%KQ??nT{&c;(*VT%%HdU^{^`QNbH(YfmX z*8jiB6u(S<>K|okU*Ah}s{E4%OykodK_!Pqo-?VbQ`FkVIY=e3zpCqB4alm{(c6I0 z8q6dDK4S}76F$D+XgpXIYQ0Kj-QWNoaeJ(b=FJ{)HQS{9mY2#qYTmh!E8Y3TVYK}h z2LS%H>2R{)S>U3?+eo5#rdwtEt?yxLb#a@UC9w|oE2ki$Hj>zcGog!=iQwspP*iYE zj09kHfv&46+Rld+@BEFkh*7aBtGK13rsgWHB-5TRprlBLNZjg&JxJ__p8&Ee?(3JY zKD+fdo9XF2#oas2n!hd$4Xvs#!T@)nZTKp`^W9=400)ou8jo;kxLVi}N3{6Mm~w z!poz;qgZvw_UB9YBJV9qJ~{lC2`}l^nlb5`S2wQhg=3ol~h zoBM9s$p)ym+)>mrkg;m^UY?V}mli+dcV4LPm?1Ruk5-vy!#g0D1HkR`Gi9;by$9{M z@Sba2?*VH4k9n=7s)Gw(m!9anrO0OErZG{LY(Se53D@0|7D@#8D;;pvNXvGZHIqfD zEwOM2o$d3$$;>O3m1BE)LL}%~QAvK02)mvD34T?s+p!k)&GgBO6NN7W%O;8`xNscX zYa}x=v%wqVfu8yF-n~IHyxo*BqF}O?W5G?Zp3W%nzK46gX`8k4Y7g4GIx<6#e>XF= z71s%V`ijxO`d)%3Ban=yfic}Kb_-cnLXB2ZWE|QWLyjWiOYIjrSl(Z9HRWu#X2|(jK+?Il%^h%KYyPjF3pduXg|Xh99X>JZ22=Nll`O;cnWS}u zOfLr#n*vc2rIhI;dlQFBV>Pvr7u%Td{+jFt^2&?BZT-SPe7~HiWsyEXQVsUv41!iP zhVn0wRI#W3C>2CZ53_fF03V-om5F?R!W*d5mV|*i@a>p$+RgMXJvsW~dm}EQM;^xh zx>d!F}V~8QSCdM_Z1H@a#n{H z9Jl}|`_OT%nP=8vA$7{m{Z3(SEvIEv*D5^TXG(`>TWu^fUJ$n)nRluGA5t+o#fvxA`Ap$%v$cAs z=Rg4pwrAJ#va#edx}(o*oRB)B&#w1hhVqy2szZ5weL(iAscL_EH+pJGOtJciBsSx1 zhkl8?aR;pLFK{>}V!eg3e?AF>GCX-ew03X9u2{zd$Z_M+TFRlZXz* zTvS@k_YzHVrhjz8L2C&pC-@WB|A?bf!0T9OrKSa(@~qJ7vnTn6S!fh2fvU|jaV9vC~;c9ff`AU!wObp61*`JZ)2e35w13g zxrqn3kX_QVvTzU5^5qs894cq=Rn-R;g%%a|K*S*Fv!INs5hBXU0n10E+rcsEuhVIKuTapYzQk`{rA#cr@l0INMa|e zZ=`Ch5bNP#iXIbbh0o!mGF1 zSAPj1&sr`R7_+Qc9pm(*CFW)2Ge3X8Mrx0t%Z@l6PBAa{KKj>54C1`EYR`w&kK?)Z zD`aoAv%{x|6x_5MN2{^kte;qE)=%Lnkw=_e{iCOQfm6sA$(NkRe&zJ#tf#BD9P*4h zaMgj9dDec#y+6!+J|`2M1{F4iSwVd!XT2G?(!SO(6SG?V+x%tUX#^a71reHgw~%xH z>98v{9BO{+v^B|;6oPdoTp^43WAc?aQqx7LOkkQDag{=O!LiVjia$Tg#XvJQ - - - - - - Debugger: Targets - - - - - -

Debugger: Targets

- -
- -
- -

This window only supports the older "Recorder-based" - targets. For newer "TraceRmi-based" targets, see the Connection Manager window.

- -

The targets window manages connections to live debuggers. In most cases, each item is a - GADP/TCP connection to a local "agent" process which manages a native debugger, communicating - information about its targets. It is possible, however, to create a connection without starting - an agent, e.g., to re-connect to an existing agent, or a remote agent. Additionally, different - connectors may implement alternative protocols, or use a debugging API directly. This window - allows the user to establish and terminate connections.

- -

Actions

- -

This window provides the following actions for managing connections.

- -

Connect

- -

Prompts the user to select a connector and configure its parameters.

- -
- -
- -

The top drop-down displays a list of pluggable connectors. A description and the options for - the currently-selected connector are displayed below. Some will start a new session, while - others may simply connect to an existing session. Each connector defines its own options, but - common ones include port numbers, host names, the system paths of debugging components, etc. - Each connector should provide help in the form of tool tips, accessed by hovering over an - option's name. Clicking "Connect" will start the connector and dismiss the dialog.

- -

Disconnect

- -

This action is available when a connection is selected. It closes the connection. Note, - depending on the robustness of the connector's termination logic, this may not clean up all - processes created by the connector.

- -

Disconnect All

- -

This action is always available. It closes all debugger connections, no matter what tool - created them. This is a sort of panic and reset action. As with Disconnect, clean-up depends on - each connector's implementation.

- -

Flush Caches

- -

This maintenance command instructs the selected connector to flush its local caches. It - should rarely, if ever, be needed by the user. It may be useful if, e.g., stale memory is not - getting updated.

- - diff --git a/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerTargetsPlugin/images/DebuggerConnectDialog.png b/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerTargetsPlugin/images/DebuggerConnectDialog.png deleted file mode 100644 index e6f95c2e0fd5933037bf99be4457b001a24e5acb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11787 zcmcI~Wl)^Uwl)z$f?I%~Aqf^Ff#5LM-~@LM?hsstfdrQz!QI{6Ed&_c-Q5Qr+`b{% zXYYN^J@;0fTlb@Ce$dtL>h2}ade-Xpmyr@dLncHH~gBUl&?4>WL`s;ukyVK9)8hCOYvWS zD9Tr_Pl=_Q^WJnOw|b-1z8?LO3;qQxtF8jcf_=?;!N;7H}wJIpj=X0mLt0eylt2xDkXT~bC%cC@L z9TYfRE(KoCI8+3pU%HI&dK8sRG7LA2?F>kl8u+D#d_70fAG%42t!@IZoHj!8|Mh3R3n?}N`j`9?m`k2n+mr%P_ol(q4M2~P_^E* z2^|m>j0*QTD*d4Nl^xV0^M$?-S9|6kglF))8)>LKj`)%7uFv zSeJB~Ki46K6HD}r4Gyz#VFD2sX3^)o3#?1*6DD$z^5wl*y)~0a4xY1oc0nVsp4@NP zk9}I*rFB|ZKV7*uy)b2823dBQB46tRvsEnlIyMn4-^&$GF02oc1#jSw)2}DRKnYfEt>C;w<&_L?yO>wyo<#fENV0b)mO{Z%MCV%yMn?zFARf~`F^6&9J z$k>L7ut}i%6u}M^9^jm(oIb3Uw+|2&e}Yc7$7TpzygfWTj&uU!2;?&7A0wQ9`Ug<_ z>xVx722Y%WQUk5G++^9L1Ro+a2!G`(Z87r3s|`tQp*2AXrmWi!L_!En`JCdnXbUXV z=om~ri0HanUf)Ait36q~q~~HapGQZyH0^t`-=1IHt6HbCIhx5q$O^vbtW}>Kzm$dJ zV1Iw?UnoOF+Rd(KK{Eq*UKF%3{pU2RLtq_8E*yX z;2eLu$_4WM`*D@LOlK`+w2s?m4coIZGTT4Ic_?@aICFA_cA3kPA4F4Q=)DMeZzn76fi zeT;pzJOXm#^<4H4@RY_b)#wPF@G!t2<-z*U$Fn-4!dH%Gj^$mJWdSw7*V`~>4>P;sdsvisxQ3m<=fe*YRgp&4$5?((-zVlAU5CQwlm07n1~ zn|+kR`;3Q%D(CG?Sy=^pjAp@!;J^bE+0w&2QUC~p?6C2@e#-IUjz0}-oldpv4aLL! zi6Z%Edjc*?4={>vpscdk@w&rGhjaun^8^G8fM%L`y(P%uRTVSboEcEF!d%ku+aG^?R*!xve^H+)rxv|SG zhs*7%NVH}<+wuRdzU zM?^!{{!578c1K~4HO&v%L$lMXE3dWy`l*J2?(V!-joq}0am|*#`o(&@%7}W#!?+*&)uP5EBB*7V>s^n!sO)$J+>d~x<7jATI0_~OQqQMxFAox5#6lFg z3iaO}n#j~WyRkK&u$di&(H)W_@F4rsu%+vU4+wP>&90oS)DrkV_}LLbuU-{B^4U!} z-%5mr0Ejbdl#yZJKLq;Nz|jRZy+S8ZZ4{5p`=Rqa>^6+tbVo^P+|9^C8=|OTo?L`y(F(As{Z;D+;eFDz zFUXxxtSv2WOUgV-S1$w4f;`Lpwd{Mu#fZi3VFtQPEnOV^k^R#**8^k43!$7dldh%a z?SzLWu$?3{b=)n;xv@@kj*2#sCXWG>JAv+9mU+fb zTSUbS9HANB_=FJK)3efS+k68DM!gme?k^?bgQKSlW_ZL4(n2-R%f+^Kg;+Ok{F$1b zo&416J2rz|?a7b?cB)s~(>Ef`xY);dbX5g1KYDv-O%^|0e(t;%Fxzl^?y?Q_iySkPa|aelU=(PSZyk;-!0~qud>;6Ap>CP} zrRDW?6Db$&#hs6W)$Lik&R!t3e_AocJO~DxSh#(JaJfA+(7e#;;;I-~xhAS|Z~~f6 z3=mJZlv-(2!-(5!k}kai%bu*?rIA(|7nkqAZu?(fg4rG;z!dl0JnLXKHrI6v_hM#_M3)IGZh}oSY7SvOyOPOF_BO=1OsyBkMjbc!0 zxq@bcJhz`o)r&~VO+3U4p%7T%4JFr zRev_Fw79a=2~#v<9nDn_aZpuN)+#fP{EV9_8caKHU~bOzc`$TGtoSa3!n*!PeWEIW zk;5~sJg*NwBFWC>17KYSh1aN5w>@tnhsL!t&}i`l%JwPkYV=un*3-b3-&4dLtx0-r zkFTd}*GoHUyhe8yS`D>Wuc}LiD9y4T4Ixju9#SOgG+v@fog*4sWgnBV%{S_{i&x|U zKxegh(HUDQ%ShC{vGw6tqU)nf0}Y50oAZUD-(Q8jSjMqJJ@1cA5_H)HZ1m$xiH)qJ zp^s`6X*hFscl6Cy>@ttH4%-Yg0Si2%Y-O%g9CoLb(+vx;DZ~}}Zg1=gvd{TT@eVJp zki6_RCu4&piYFbQT*6ubL(Fd-v)>4VH@DIyq;SHS7C6w-*1|qAOhqK*Wi7=?`D>#^ zu5SofY-n`)5+FZC&X#mhEs;DG-yUz=Sj(Rfsjrg-7flFM1&({LvYAf{*Ka2LQsfSMc_@Hpqhr;lV>isn`@%klAE!3Nm8YUIJ5Drm1ykv4m?NVcMl$^zBUlF z2;JkaLUX$klZ68)r`e#8=L@`StWDMc`7lzKj)q!bRQ{%gr>f(AXYe{ z_UbzWyr>K}PKK0Pfa+Y=eM78??p!)A+oiI(Y4gF?5mS3oshroe{6qK7eA=#8Wwh3tWG1 z(+_i>*l@*F?D&?La-$L^KgO&vLX)eBCOP0e-CrAu!6-IQ zC{KQ}ToX4_C=gGx+1gCT*vqLEPJ43VlkYfgsh6;#Dd?A7L??yvMv@iqo8qt>SJXF= z{kAJ$t$e0fj_F2$+jbTPp*J_tPNbEaoWTzx#y3y%y`A#b5f_Rh%uP!VNL*P^m`v4_#>zd~A)-Z5{TFH4q zKJ4SGZ-9$E6*0EdS3HW6KUosPrpE?h8adDelnYGYu4#_zg?sWd7nTxq0W56O{#iuW zVLRcL&d8DqmjO zSNr_&U{^9A5ZIL-&MfE6s+!2_428n{0u1qyCF{`f)8wK2ERsh}ROz|0J=}3kykV$a zht^_AubYb2h`suk`(8I?Z-#jl>2HOb=buSQCbnMauyiumh5cdEjKjtb zaVf=-&yv|04lK+7d{eFs0iL!&!L!^aY5P8tnP~M{i$mFX0B^fyJ}|X-J8)DB&BRpa zL_-5jmhDlYGSE~6-V#8i19}U@k5X?5Bdxvr$P6YHLw{>-YFaFp`Brl*(2>y;cz0_OnoI=y9gxsE2+ zt>KgSP6P2M`k-$zSnE98Mi%o=UYZ@Clsw;`0+a1#sNZ84q(+-^OalTrnurwHlO*0Zat%JE^FsL0D77sqBmP7wy;=osQ$y#WwSTspdbBfoYnI;3sYuAh(DMh4 z(Y<{=rNWXZ?Stx;HywqrSn-~jR6Qe|;w;&Hka(D|4tNvr%GH0QL`SdM8mG9O0`W<5 zb~{$bk!>DH(N@H0kx$ld=mVn;L2iwb!KZ7{+Gs?FjjQ`;^xCym4vBRY)djIH5~+nS z%ob`vy!3*(!PEhlhY~}7t2?ZqNNJzow4syUt71^D{W549EqM|ec713 zfSE3Gm2-k!hbjpuUc$Y*LtbChO)hKgb1MUXrRkXCK7iUXwa;|SOtfwYuy~dZiKs3~ z$qv~2sQMb<9N}3Z==HYsdD$x8vaQU_?WK`>`T8&m37B-WNYiM=(CS`c5%Cqb*9rR| zrZ_@_{@21*>u!${wC*x`yW{#lKp+%J;uf0g98cqSSj|(jziDBxn2t}^ZXlSAR><^5 zS#WK(-!r%#Veq3U4%IcA_G~`xewfhBEiv3>qfSdzK{r{l9)HDouQXVH?|M z+8IHiCWExy5rQb=cQ1O&f8U5syK-)0K0SND?GC8hU9mMDN$Wn+h-9B)d98xreZNL% z(&j!Z75&Z+PpW}8mUAG5j?vMUmc^FT^wHGh8DclOF9P=)6vgvoYj4Z=2nRBwhrkP- zi&qoP)(vOIAuy1%Q$DMCCI=C#WjAXs5icGe`Tb_!1csvHzk}4&1Q#x(kS|bauX6g- zg~T`jR(Oi7%h#E+&$P&@roe3qf30B6DF}HJMJ?+wh7rBrTfxZ^kfcmvBm zwOQ+qkBzmO-390jgkOQ`xo3>a>Mk` zl1EbEMYG9ZM(m)#+<7Si@-G#tdTIF8VRKE76-v#ynA>jKVa%+be*LlWP6z`2or}G0 zA2r!F+0g6Uwo(WSQzSk?*F90I+%7@46C0cD=V9g!U^W|{weMx``dTqCu(Qa_aIQvJ zYHth-FPOW1J$A(zl5&}6aW%#8_f^{_Xy82oI1Ts&Rm`7G;34YW#($MgtB^wt%Wjb~ z&_40oX%ECVA}J^+kWNI`Kf!T(pfn!o{k0$s?4}jp#E|_eyc0v@A*w`#vF^mSib_JM zze!_9RY79vU-qPkWiElgrU6GKB% zl5o+Jw~Bel%EED%`Gsb6glXrP1L-DiNl-SRt3dGwq<+o(PbVBC`EK%{)bD@aSy*5M zItkaniJEBSuL5%yUZ1tM<+=tZ7_UqQ?-y6`bhksHj=(C1bj>-H`rKTaK1$dGGjFlA zQT7T}mxr^Nqg)#Of`jO+D51U0GUOq(;C*=Le{TytI|Z8#;g0so@?RoOP_g5pv!-Q`_5peHSeoYO*SbT! z2e|*+(Eg850Z?iP<)mIbHX=O<27@U zzSkejtNAY0{ni-~5f8wBU7mIJE8wLQ07M7KnF#oQ{~X@mKky(Je#n?X^@dUZ)2Em7 zy?R)NJqso%iu|Z1UkSp5jzHa`Rh{4KWo=vq86)0>yV@Z#X58Zk56?LshYg!JdYjCH zcYfsbn831wL-L9?iVRK+LQ_LSt?}M(Z!5Z{9sjBhDlc@W0$9xbWX^%B-?IoVj|X@m zA!JrMI78Vwg^{ke&orLo8@}RRl3sX~5bMx79qXGDI3B&a6 zBml^Cyg;=~Urb$n#>?yRc+nO$KR-VjA@h4Craam7j@z57DO3R+FtXV1V|Zhrr?$7- z@6Id;FBH`7#8?;1%{I)&*~jY^XP+lN+rG4ClRRFYQGue z>^wCyQ|=%sQd&{LZL``*=6?M>A%Xi-3qqH}XSC>!S)h8KfX?N~P@{O1F zmq>d9rRtIjSPTo>o82^hQnw@5R2rW=rNX#~h_-FJLtQ<+pWE85hu)v*)2p~arv-AE z;sp%7!p{TfmD~@P5jEFK>ax;RR8`^o-8+TOn1?^tsS;4c1ggP9YH0;%%*f1~AwjB? zjcieNiM1eaF=PLpkw(7uXhXfx(KL>#*%(gGXfpz_?q?i91^k199qjDr?o)DuOT>G|1Z20d;UYtgs2w_&pXI8!UccQ9?s)K5&jYZl(siH+r$p_9w- z(@(liqw!(Z%$8v|PzF{wp6$)?-d!IrxZmBtw&Z!h%3iHBYAYb-qGrhMeX+I0hE+JMIqEa zboBJ9>9w`B;+eW9t@3{^jms?6@7WUCIDsetG9Cx~eZJCbcfiJhR$H&Ka z#tTf$ZU*>jonJ9T%=*5tNSWed>=(u6a}8pL)$RL`DuTJ zn9D;(g_b{t{}#LOi=>8MZngF7&uIMn)D&fB6%}?|m0vRc7o6l@fNL1XY`n&Vd1&|ng-CA2S4CGdW3XO}u$hm> z?5BIb*WfTM_BsFZ`SWLX>*cl;IOYIcm`z7>;J{FJ%4#u93~+(XH-ZL|dC!iHZ0ziC zL#8Xuq7xGnomkxraiM?Uqjj)GZPX`yg|M*|Y`H`vG?ot^-oX>reUEuSy(9zP-1`1X zNDvm@9=veI5$99ft8-5)Z^`EMHuP0#no zLIZautD9SzRBb01SG;b6EoOW*Yu>ylO3-KxxP7Dz<;Mjr$Hf`8kn`# z6W#3M$eITyT(WBLObUWdSHc6Zx&%eY;t!~=Nnm7UHJR&RT+|>it1c_!vF8jOlRigO zQB}sfMDiB)^F6j*FFp%OjfshY6NZeetN@}ZJvz9*s;Lp0)!J=g&jsJ?yWi=7+7olH z;Z`0R8ah2a#i9Hdx-0M<_qV#4*Zfjbb#_m1?@P+L|f6kppjAT~A(9 z@cN*Wa;u~Yc;_n@i#s;ZLeV(fFsM_M{ef>q6XPm zgRbU63+IfL*(z@&B_-h`=J4k++$d_bHWZpj&+yp=wx-Id=CW=MA!OB73l6rnIPPq3 za1ZanC4Ht8uHzhqJO}7>5DAykD3*}qAL^7x9SVvGKVF2hSa|J(7MF21x<#5P9zD)1 z)-(t^^HCWZm0GJ_a7#Z8r;=th8E)(B?CkD_`17*kj$CFTcGV@VBXh z`P_7L#K?5N?DBtBzWfVR{3n&q|KCqvoxuyP(APWwr`m7i2w$!}{>}C8|Jb1Zs|ftR zm?oz8^#0142v{rw|FcuL4I;nQeFh);&+1ZU@sItp;MLvUwfThs4Mx|?GJ#;cuTdU& zUQyoKv|4iF>r*KQ03-~nOPvkjeG+eC`iJz0^iSzgnw7o~$c4wxDr@G~^o$J)~zM!Bk$|I+3poFjs0k<6m(dsx!nDLKH|}GNe+PdnV5!o+-ZK?AaX`XD;L>~; z6nC$0N>=x-fP#9AUwcT=ASfo`yO*WpY z!dckxOg$r7$azMO-mI%@i^ovweC2j~#7m@5RWPNrPx35p^ouRIX7gUhS(jr4ovR+{ zy$ybO#Lg=Bt%AO8aM2qhgU2kH1Zg`dCL39@u&31DbgkwNR(zhSu{+o$E_YR5`Lx^Z zaFu*i{eUx425$+BOIi7gmE)^}E%j8=1S{1}Sa$(gjW?^_JC8(y>5Wtm%jGg>?4i!= z>~WQ3ykraRo5sgSQFc%9&s5Eyq#kViOmAOO{%9UG(b}ticBC9#q&=Wr<7I_`-Z+?R ztBiva4yV@kyOS4cA0L`!L&|K%rr$MRcXxK?@O%0gJ@QZmskw|#TI0M`$T5a@>F2M7 z3K#*${cp~4Bj2jNAR=;~$<|JLD;eX(tNYh!&DdI?Do(D!*i3u*uDt04X`oVMT3SE7 zPP^Q#xnwu7-UjJ@NanF#kE+7?lIY8YdB=mZ6T+!s2Dxnh@Fq`@QU@0aX4}uRE}Oj} z52Bx-+7@bMH=UlQ>QPQujGFiG-!;17tJ!Z(7Z!gob0l0+s&`xIih&+j0o8?nK>yaq?meaeKzR7>`aCtIyk_g7Y(X_e{;V3v$+Mdq;Y_Hx=i%<5L2x zzCU#d(8os3O`DZW;5<<&_!FNX$JwS_6u| zs-t|R;Cyl9ww)_pu_N0({b-};P%oad0^Z4^T+r$-TMo0}DQI%)`C$_ksggL4y=>W< zmF3VQ9;v*~Lo?q#IEE=nYm#wBx*(6EM(oz!)*%_!!L}|7kB5)I>`>KneW_kC!o9a{MKJbKLi@4eO@^+#Zu}KPdV`?) z>om^OP3dPsIRfzo_Xa4vH$Xrqf06uK6|mN9iQrhVX&tCg7Ye$5CqEn;7s;#mGfN_}2&o}zZSC63wbc4J_XLBMlbL)FyQ zf+;N+rb@lccXLWgqi;6W@Ml%bZ130{=LN<^H$Lj+D^=3y=quDq%}J`e$#97^rTimq zm7Brt$%8x7?U@VBFUHqTNT#OL&h|2S8V-Sm#yzVzhHn=Jm^|a}BFb1DsNP$gXv{xQ*FvJAX5tT>>3jrhmVFPeZI_My&onm638dP zk0S7!(WvO!bUcPX&W$P(m+Esmgt*@wPw@W9xg>O@@|B;G`!EMc)G)T2IqxI^o6GJx zI;zb6l+s%K{2k9yM*s_v<}Br@BjL1T%iWAHB7v#{;|zitKKMp_&+_sD0PQ3Pd?v2UqzPQA$jkKdJ>2QF~T2tBZvt} K2^I-_^7wyl8}QKp diff --git a/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerTargetsPlugin/images/DebuggerTargetsPlugin.png b/Ghidra/Debug/Debugger/src/main/help/help/topics/DebuggerTargetsPlugin/images/DebuggerTargetsPlugin.png deleted file mode 100644 index b0e988ccb931c7802ef9af79a0a346243d158f01..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10486 zcmeI2_gfRexBpR8l&**r1BghG5;}w~MXFK_O&~%j0s;o4Bs38LX$eJ|^d?dxAib$T zLPwCI(j+0FgAhVM5N`DIz4y8Q!uNUZFPqt&%*@U?bKd)!vm0w_tj9#pO;1BZ!(^bZ zV@^YJ21zZ?U%Ws)ivC&FprH}zFwoI_5ah6#OBZt0<>b^1y)p+m4RmP8Ez64&b^x;w z_Rg8hT#3~t=I6+y%QlIC_u zI0>#$KQuD3HS*|+q5Agpx^@6D3+@_Ff7HGV&$~3EbCLfgYxcA7;xajD^sSeyT2-7J za=jJ++6#=2IHMgo^J}l_5s`M(QuIz71a`d0f}d+S`MtA?)mXcfa^3r4%5@*clx**D zSDu zCuBjtj339zcE@ z@)(na^XZez@|cs$^7EDlWJya|Zp;1kr@7lB;WMKd`#eOW80Nz9!eTL=e1^2;JQly@ zLypf&Q5@Y%y&2b zN=Dtrc5N1Z?8T>d{wXenoN}&e6e!R_oj)$u%CK@R4J=1OUB3JTajEJInp#DN)S5@% zgtYGVT8R+`(N_IdeTp?9YEK$MWM|VH1?;%gWgK*G6ysc$R?elFL9aN=?N*CHF*V6P z*cO?9kfMR+0v#^YJ^j}Ov7TU|d%iBXC4U+BII+~SRv8!Dl!1xu59fsYKm2q)^llaV zBx{$YE_>HC1d?rYTgK0_B1A(4>^fXNJo_L^EwE$gl8vO_@~S~<(xJPIlt>TU+a8-7U71WAZB8E%ML;XYK^RST+HxPZ0ZR_RVXNj=c9x-#XRD&N<- znUc9QV0#N5Q)Tp>-=MtamcV+Tq2U{`^6N?BHu-si?$_}S;z04ZOt#h@&$*U7Wez%>o!*S~CCTtyLzpSx zDqXK8?D6d%;iiploBOsXId0f&z>M?ilvfrbSBeOa3h-GxZBeF-u$k?BAHjMjrv^;8 zD76W-CHA}|a#JO6aQ=mp;Hx=!6t9a-R7=JEd-JItw^0lZ0L57;hfdB`!(By|jE&52 z1LBMP!IiOcLxAGKMv89z&TvWpbD?pW=F*UIvg*J4EC2zWVOQBX1|oQhXT5L{DcxIj zRi6PUh09LT+u@q=v}%dH3~bKRaa{xH@cXk7AStvoJfLV+`h=N$R-R|(fzYUdY0*1L z7!7sO)VU+;ZzCg*0uc?dt)MSor5a;Z_BVHb@F`u#JsvNKje~d0`Oe_(m}rMb1cSib8&yS4!BoGw6*3H4d0;iI58IKBjT=bc-{g=Jg&p9Z#M1sVoudh0 z#of9g)kd16)VNA(lb!sAXp47`zwe*E z^+|@8K(6S@8%*JW;4^y)QW5iwUau0k({8%B2sd1SnH67-sl}cdiQ=XE=Rtw@AgQv5 z#oH=gH=`?uj;{MD^h8)+`s|SleiB>kIj!H1Y|84k zM`ldL4ODaUoHy*wRVcR9K=YHClJC;XmoeK955HJnE=}Bqi6isWik;_LL%@_;Xj)2+U4i^oJoPVZ!lnJ6 zBH1g#UKRT--@U??UA%uA2+a7odVMmW6?7xv{rRl5oPh>qwk!LOuUO;Kqc7V71axcC z+S|>`tE$pJe=e5UY-6G>-m#V5s$NH7z2-rN;?j0Ppo^Lqjurc4ZX)qq3?Py#DN#*XViKkena4b#|a2PTVRF< z)1v78iwqy~KHs!ye3B860APWY)GUZR&`$Uj= zwqmP?YbK3sPvpb^kvTctw%y!oycHgEh{o1k#W-5h&EKYA?DDmN`3{%H-UtUwykt~c zOog)hS(;YR(<s1yHUFei)Fy^a3EYG=^o0~6M0b-cJeX~i7)n`zP zrtDN1nt1!}pa8EhwuThFl>}n-!*7)&v%Hoq|C$cU3s=|j#cf$g-my8+8ub2-mF6>Y zcX;(fNTso5>OkD@7V{o}nMZjJ4}ulhdUzPOL@sh3%f-=Zed!&;Eyyk{^?S_VJ~meK z<`Ax7wONM$PQ#S>_6qJf>vJG8{xDaWpsYb{fUm`lh9HY6deU_^>(Z|?@*farurhJ9 zpQYkxyA3#N#(T%e;0#88*iR*!+8F-pv;fHq} z$TtFdB6199`9z4yn^Rs!0L6KbX5CkzcN{l7zgL@^nUy$*SYP{ukBbYfgYGnVWFHR; z$e%el8H7E$Mn`0Iaxxi(EfLc_n4Z2`=!Zd3#oBtKymZ|CbhcsJ*RXihsKwC)7zN#) z7uek$j1MtJM)JuhIaoh?fCHc;c{tb}0O+aKO+EE|C0ed+1QZ|rnVO^!`$VrJIW^>GrgpIw|b zJgGMyYKK=joSUw8BbB_}eMMhY(RHWI^7wu#yG2POagg7JI-Z%>6!cFS}=V7yOe=` zpT*G%E^|vBYgRBoHG%U%F8(6DEt&{&SZ~xZ__-Nqm-^jbka>s_LiR68IZG5z`QUf{ zq^Gt|4qFSaUj|^SY_cZ-*s^?#C|8L3t}xN$CFsGy46k6LHg|}XL}+R z*r@AHE&z6;RPcM_OwZ?=>xWD|v7j~4lXHvcdnR{aceo4rJ#Tr!Wyv>JBwvGnosEj= z9h7JYv^->^dsm|*ctmMCLDD9+?QDa-bbo~86)(e%gVLsc@+3KQ6m@J>jBmHnGtIrd zELw%I)KF59J0k>4zR&el(tp!Yy`ivP;a?&W3{rs~wNo>I=?mX@) z`%m+}gNKJ*_<+q;9r<^iC&=RLsru)4*6`b)wRK6X#wJ_kIVZ|Ch!vs@K34e)FHg^> z&SDfUtFbUX%$m_*G&x*%U!gw14+<}dAm82>HridYCTkTgFaG9(3HLEb>gb=IT#^ZT zS~T@e*W+xa@BE*pH4@Qfz{13x$?r(Yz)0-Dpf0R{g9NGGh~l_b;dom-e;sGtC~o9A z(ST{Sdi~^kDCsA#zmz0lEQN*{0Z+WJ=@ZzoZ1sO3g) z;UMjc=W=JMqb#R_bWsLoR!hy<4Bh5lKZbT#>7vo5$iwJTqxus2wj@6XfUK*xdHB^= zi*0FQeuPQy%m46eq7cN|*FC-2VC?rPj<)tF6hQ52B<<9<1lYTyeKL6YAI)sU76aKb zl5h=Mb}at^FuGpYwO*Kd^nYVs0SM4r2Ku{u!dSKUI5skLOEGqHYQv~UDJ0GU0DbXR zmRd|uY3zZGUWfcGGxmO>)`A9=#E{q2I+LXx#Y!ht1Ud$&on+Q$)Qck1-&{q|NhC=Z z!p1|tJ)t1wZT2G-79=Q`J;x0#JIM=EK zi}hi$6w~!b4is%1T0Pvwp9>G;Udv?k<1hKt8<7_cWSVYriK>ui^PvDyW@$LtPte^H`I=ATwqPmYN^-Le@8Qpff$&i? z{*>0xCP1YGq!pNz8kiG&2DlhVhDOsH{dP3fn2^sihpUml*<5zh_I~7UX-ZQG2}m zb6a)4o9@u`yR;zlM&$DRes}G7pvTJ%psGkc)VyOvQ-g)1>|DI>hz&8FVd+ZK3r3|y z?OYd>7MQU|l8&8mH{r+lo!x=}hg1%9GI@p)G%5QSQSxLYAoNdF%Mc{Tn@{9qjbvq+ zA(2h*7hN0D~<6UF=tE63dYTMj)P2?c1_tk!NVQn31Cp9IEXAFrbE&o(q{$iJyx zvl_Qg>$H$JM<{(H0YOi#4F|<;J)6AH(zX0F@UUwEAoMl8229QX+@=I2zPJCj##FI& z{3oWNj@<#Ph_Q|i)y7R#DzkWeg0^8BNI3~8x(kw%h$O)^|Ctnv8DK)lTg*16Eb@d#9U<224zcGZ;H;y=`Q^{nIFRK;OpIJZm{0a)RPoiIIQl|Q~^5>eYlI*mn+KaX?H;nP@ zw_lKcH}31wl3;bal*+{K}V z$EOLsAf*0Cd)sOE?A<+i=b(hV^LdKuLkH#4Q7$C*!b9uMarejXudvs=8+K9V6zYDT z+j-J}cCFy2?-1r#p{k>px*gGMn<3xCU$X1hq1%Z9fu8buoLkI50`y9q{)Xz*x;7I4B6Lm%a|I9 zs2gVqHOjX_jAug)>0J&PB&aBhJhV0>X-z16uN@9GR=o}-^FJknkcV@a3g&xu&_2gt zhvfF7%@B0x<{qe`!gJPF6CbI25yj8Y0hCjXqC*|1vOwT|O91)VUlmiVnS*-;5j|ja zOfT7=>-+gNLu-fvA6?>kOwS;a$I7MPE%7yWzxmBn#?ChpBUOd;>rh}fl(ds5oo=(~ zNofwqOPz#P`V;Y)qqJ&9d)8738CD_sa}ONBCI#nyG+SNUU1LLqW?3Oot4>y z8-h_)E=`7a?C$fNI*joq~2ln~rL4!yYAYL07(wF2FM*l`c=~Mf}S9)XPlN+Vd|nhEH#bSuPirsfV8uAAv>=0Gyc23+!~Q{RXS+&YmkMrY8JI z>YD)p(G~ZV@ox<{9~se}qkZej6+W6*m(-Z_Y1xWa#>I!)!Us~K*ldeJV^C$3`BAb#M2OyO7e;vS`Sub|Yaq z8{7Pchc2;4kL_AT-gteeaJhjCUV)}5a?OuQW{Sui{Gn6LnWHz$+)^5kW;y)M6Y)pN zP21_!q|AqRSa5B94UI_8WhEQ6Mq7>*RjHoxt`kE*Y1wuAc8vs_+_aZlXz1w)>?8z7+L={S#aOuE2ES5hnInC2|u^R}m8uv;`qcjApTg+07r1vphdXF`dMNub$rKkl6sl92c^l?sB1gqq{1$>|l<@CYoh}3)- z#!64Q*@c;SZtP#>c`$m3=`~DUcfnx}3^uP=in;IuG#&Y{FtP!|?sxHkry!#=!%<~6 zH~P<00#b&w6PkOSTTAXybLyo}P<&Ey7ybv_*b-GebzT{T5(d7m>Zoa}keY}!fOjw^ zsz-+&^NhybAr#bvo&G+_4AeHEFWQqo*C)j!#5`-3)>cvKnJM}YGlw}PmBhBK*oe(D zqQd*U@~TmJ(e~~+m7mgT<_GUcUQ85@e)lx$2|x?V8LhN1{s{N6=jrdaj|ExwRKL)E zYL=}TlA1!bl}Q~#-Hh=em$nc#bwKTXKJ|(%%;!mEqJGGqP`YlZp~JssJqs^bUR**Q z{pBM+F(y%FDr^ytQC=`st&9B6aW`JF;x5KTvTD5&7_otEXf#4X{WplXVd70{wOew% z5Yj?kxWsw+F~thYeH$pbf3RjvtyyMvy9-ETKXicbR7U1S?>wYoKwabBzeVo-9K}HR z;fYQYx^H|6%-Pl6m&ca?g=eNXmOm@8j+@FgQ}bHyf3I0TeLMa!=Gx&HD(sdOB(&k# z$`{S?ulA6S&hr=m^svMrl`**aRYJm^$JKOko10AwVQt4t!Ww28wNLJbg>~+&O&U?N z=o?wi6V;uUI(mB9isYXsN81!-*L(L8R1bbe`W_N82EkVLg1O56)Wpxt zK)9V<&Ik9ex;4!>dhp3wCEC!yAhvCGP3d~e4u;AV(qrvEE_be}v*k<>oM(RH>_Bv^ zD-^&==#`aF*PgXd57o{t(v4+BDiZ!hqhFNCTF#of_!DAPRn_aNDse95XYY=299>D| z_32*AM4!gXA;E zn?B){JrSWu9u=V@%65j5A5s77+xvtL$~@_tgD?nWz12Z+K$CjmFQcLiG&Lh$r=|6O zjG!$AS6XiE9&NRmeD3ZhP%oI<*@>gOPFg>BPLG&IGWc~Ub3j6Bb3TXTf7AW~Q?h>k zk5f2z{M94og(K$Olso6kh%Ua4<3DllNt3n4C1??Nf zCD!!Nt5#jV)7lS-*%ijn7A|}%o3Qb_1z99Y*)(HPUD+SjDWbQ{iDu&Vwc9A@T(4;} zwnRH@&R<*JA5qzUw;4uhTPVj`b6gBx_UV~E(!s8U61PJ=9E3Q8s7_ab@T_00R9vsI zZ=3j%gq&2+HO)&+6&QXa?+1Y|gi_|}yk-=rcHvwi5LzW~A~v=|#x80mSgO(I-i^OTeGQ}L?66tyK>EGd z9aG8A&@S{?!~wA?h;lGLJ^54Wzdq#w^4^~Ba8Q#~ou=ary7PyZo`Hdos5t*LBkR%w zs{+4IjlWMW@~)%19K12jTlJ&rsf}JU6_rnx7GwAtXZ6Z}BOEwQl>fl%+q z=_z-Oh`-cG=pXWQTL!GO!++h9;;XA0t;dr&{YhEnT!q+|mPZfqCl4E+nE7)L4s%Wy zW<)TYy%ge`$ z?lQnBbAiLXOR8m`dKdR9p_`A$#Jk;zi#K_wF|b0&Y(6_U^Q-uiVhSrep`hd zQ%?d|((D4hyLg1r-noXbe@v5**sn&J#g7FYszB_ra1|W*Nmt7nyYlGEDXFQ$cj+PI zH`Dlb$(E%n>_g#p&&KYql`-qUj}KPS&b?45579R~vq^sX@0zZLhZpw^j}Esp&u~j# z7{X$qY6ZZN=~rDYl~AtyY{?=2H<$L*&sc8D3U6DycN^uEU(g4NbK3!8{37ia`W^9= zP!`uv&-uA4m5P#>g#57I?vy&}%1t0N%>`t~sXM!fdoFZ#Ob4kEK~j{$$XZWE3mQh1 zbLY>O^Cr#XKTbX-5r-$klrfloPRLK~M1E$0OxaJhiHhelcfe)vKh;h16-1Aah|2k) zp?g#Z?l&%NSQa%%+h7C&&?z2Cwe148=Oh9Bs+}RljPjCfs?_8P2o+41ldF<;KVeT<@MISuF z|Hd79wiRoI`IDmoF?3%NzxD+5*))}Rj-0fvE=P%h5+shgL)4RQAQQ!m_nt}#c>{tm z&B`@55}69vi3tCpb-hIHQq0uYouaY(1_ox`LCT!LSg%|R{5+H==p+;0H!{Ku!d`w? zb7%R5SK<*A`5DCWeDTUG&r4pum&njWGG+BE7K)_x&w{WBP}N2ESOPzr;0I{#zT_uk zIm5lvp#J6P)|aE9ghNnJUeG8Wjz7fD2JdgI)-oxbx|_ltOH00ia5+FSBd34d$L)72J z+ihxzeq6_bjsL+MCMxC#dIPismU)|3q(*EmYpGI=ks~r}x_f7|So(PzSUGS@eA>=0 z@wb?toNlJT4w=HUv=N~aE>+SPO!4*?lQ?;r%Ib7KGA=U7kA2AKku_6Oe!%+FFjOX& z6?dsu^CEu_HDg76aj$0zpuVyPX#T|>*t!3!_&<~Uf4Uf6di~3eCgeTG{rl{s(iHGF zLs}dZODpy-kqT+=iD3VmD1{=&*c@ByQG6({OjWw zvk}W+2RaAhXvC14Urx?q`aWm#=e0I|2_1I%NOn`cR&l9zFfOG-J2j zFU?>#Z`yS+R}(u^+^aa-t*{p_S$+8<_eW+g*b>_MB*w*pB2^WY@1Cg096r-sENk@E zNqNR(m>l-?tBap2a{A;I^WSJ(mJaA0gF3}+NLD9l6NHy;`0hP397w{~c|o%F68lmW zU(|^c3bm=>+Xqjuhdl$d7!Qbwy3B1E8q8Y=_QSy`AKDDB_?Zl>Rk2-3vjGZM=%hbE zCw0c}>r-I!yI;yVU~=x`J)ZX3(bPSU+_jB3{Ho*nQeSOqN@J6)!bbIYn598Q3f3TY z!C%YLnfGgtnSlFIgy#1ghH)%>sS1DaYHMF$;>^^<*Izjr zm!h_3>rNqT{&HIVP@v!VxFgOxS#VcZC$_3zshq4V3PuaquKSD6`98SjqkglLAY3w+ zq=Qm^wssF-S@&yF<$ImP!}+k~&=%qwPePp7Ntf!MC&30Y&6Cj6QM&NkT}OYm2}SY1 zU1iGx>VQd@7d)^M=Ox3LOG>*AOJ`PP%JgLzJWH~L66ePRcM&ULHXWprszLvLfdIEC z9UpX3Hz94@dqo+Ac(w)x5U~hE_^jTWg|AwcJs2bNHC^~|Y*~q4#_+I)Bf{kOyD6FA+cWXT22KHK&$6~{Pg8_aeXIbMY|EFv z*C?SP-+*{|%=K_mSnF#mwRzWl+6~fmds{Quu2>MLTeO{T!mb2vRA|-O4m)+TI&OXO z7Sf8inQBsGxYV-E;5@u9(?3yCd!GTp6R!yFW2mR}$6W5+ot+4gcaF-#+DaS^ik1!+ zC|`+z=Yq4)SOky?qAg1)Mh}3U2Tt;UsC-Olqc^29=9{+&vz9)TKM5qH>pDpK%20xB zzX^x$Iv9KlGdB?6UoU9~Y}hVnKGaayO)4RPjYPdCC(Q%e4Q(lqb+ZiPj`(g5Brf{8 z_v@ABb7->VQNF={cbK$vUupN_N3U@&*9cWb1j_m9M4yobL&?#s*6P&{R#O|Qx39~& zS52q1w;86$!2sy0WIFZo<+h5DSUeSLUJE9V@y>*em*vm;`7ktubz|;jac~1A9yT=2 zE-WZR3PBh76VI#Q?(lB3St_HxOQ4u$BzV#R8N%3QgF*D}Qu%v&xa$rqtxVtpxj`wQ z&epcQYoM4p7r{X%^jWeCN00JvuB;e!qn)tBmS)%s4ZoQymYC-f`J0De%rve7-0Cri##kC;WQwjP5HdZ;R!e~$wV#WbdH!Z4 zMxfL{O-5N7!Q7*ksFTT|WlyQ^(h8U)ejGDopEdB`3u<_s|1P~^%>#ZA38IDub*zg@ zs9G_kG-;gBtLeGa*@R!J;T+h(beQX;=7Qkruk2m!=U>wGpLSu z$touPSJhq~eAWh7|JCWtJ7&0#8vkTj@s#edilpg&$ooX<_lz_Kca3#wv>v_qFJzJ} Ag8%>k diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/DebuggerResources.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/DebuggerResources.java index 20fecad781..7ec53f2f18 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/DebuggerResources.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/DebuggerResources.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -41,11 +41,9 @@ import ghidra.app.plugin.core.debug.gui.memory.DebuggerRegionsPlugin; import ghidra.app.plugin.core.debug.gui.model.DebuggerModelPlugin; import ghidra.app.plugin.core.debug.gui.modules.DebuggerModulesPlugin; import ghidra.app.plugin.core.debug.gui.modules.DebuggerStaticMappingPlugin; -import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsPlugin; import ghidra.app.plugin.core.debug.gui.pcode.DebuggerPcodeStepperPlugin; import ghidra.app.plugin.core.debug.gui.register.DebuggerRegistersPlugin; import ghidra.app.plugin.core.debug.gui.stack.DebuggerStackPlugin; -import ghidra.app.plugin.core.debug.gui.target.DebuggerTargetsPlugin; import ghidra.app.plugin.core.debug.gui.thread.DebuggerThreadsPlugin; import ghidra.app.plugin.core.debug.gui.time.DebuggerTimePlugin; import ghidra.app.plugin.core.debug.gui.watch.DebuggerWatchesPlugin; @@ -228,11 +226,6 @@ public interface DebuggerResources { HelpLocation HELP_PROVIDER_REGISTERS = new HelpLocation( PluginUtils.getPluginNameFromClass(DebuggerRegistersPlugin.class), HELP_ANCHOR_PLUGIN); - String TITLE_PROVIDER_TARGETS = "Debugger Targets"; - Icon ICON_PROVIDER_TARGETS = ICON_CONNECTION; // TODO: Same icon as action - HelpLocation HELP_PROVIDER_TARGETS = new HelpLocation( - PluginUtils.getPluginNameFromClass(DebuggerTargetsPlugin.class), HELP_ANCHOR_PLUGIN); - String TITLE_PROVIDER_STACK = "Stack"; Icon ICON_PROVIDER_STACK = ICON_STACK; HelpLocation HELP_PROVIDER_STACK = new HelpLocation( @@ -248,11 +241,6 @@ public interface DebuggerResources { HelpLocation HELP_PROVIDER_TIME = new HelpLocation( PluginUtils.getPluginNameFromClass(DebuggerTimePlugin.class), HELP_ANCHOR_PLUGIN); - String TITLE_PROVIDER_OBJECTS = "Objects"; - Icon ICON_PROVIDER_OBJECTS = new GIcon("icon.debugger.provider.objects"); - HelpLocation HELP_PROVIDER_OBJECTS = new HelpLocation( - PluginUtils.getPluginNameFromClass(DebuggerObjectsPlugin.class), HELP_ANCHOR_PLUGIN); - String TITLE_PROVIDER_MODEL = "Model"; // TODO: An icon Icon ICON_PROVIDER_MODEL = new GIcon("icon.debugger.provider.model"); HelpLocation HELP_PROVIDER_MODEL = new HelpLocation( @@ -263,8 +251,6 @@ public interface DebuggerResources { HelpLocation HELP_PROVIDER_WATCHES = new HelpLocation( PluginUtils.getPluginNameFromClass(DebuggerWatchesPlugin.class), HELP_ANCHOR_PLUGIN); - String TITLE_PROVIDER_INTERPRETER = "Interpreter"; - String BOOKMARK_CATEGORY_MEMORY_READ_ERROR = "Debugger Memory Read Error"; GColor COLOR_BACKGROUND_STALE = new GColor("color.bg.debugger.plugin.resources.stale"); diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/action/LoadEmulatorAutoReadMemorySpec.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/action/LoadEmulatorAutoReadMemorySpec.java index e230e09747..e9d86acc22 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/action/LoadEmulatorAutoReadMemorySpec.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/action/LoadEmulatorAutoReadMemorySpec.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -23,7 +23,6 @@ import javax.swing.Icon; import db.Transaction; import ghidra.app.plugin.core.debug.gui.DebuggerResources.AutoReadMemoryAction; import ghidra.app.plugin.core.debug.service.emulation.ProgramEmulationUtils; -import ghidra.app.plugin.core.debug.service.model.record.RecorderUtils; import ghidra.app.plugin.core.debug.utils.AbstractMappedMemoryBytesVisitor; import ghidra.app.services.DebuggerStaticMappingService; import ghidra.debug.api.tracemgr.DebuggerCoordinates; @@ -58,6 +57,22 @@ public class LoadEmulatorAutoReadMemorySpec implements AutoReadMemorySpec { return AutoReadMemoryAction.ICON_LOAD_EMU; } + protected AddressSetView quantize(int blockBits, AddressSetView set) { + if (blockBits == 1) { + return set; + } + long blockMask = -1L << blockBits; + AddressSet result = new AddressSet(); + // Not terribly efficient, but this is one range most of the time + for (AddressRange range : set) { + AddressSpace space = range.getAddressSpace(); + Address min = space.getAddress(range.getMinAddress().getOffset() & blockMask); + Address max = space.getAddress(range.getMaxAddress().getOffset() | ~blockMask); + result.add(new AddressRangeImpl(min, max)); + } + return result; + } + @Override public CompletableFuture readMemory(PluginTool tool, DebuggerCoordinates coordinates, AddressSetView visible) { @@ -73,7 +88,7 @@ public class LoadEmulatorAutoReadMemorySpec implements AutoReadMemorySpec { return CompletableFuture.completedFuture(false); } TraceMemoryManager mm = trace.getMemoryManager(); - AddressSet toRead = new AddressSet(RecorderUtils.INSTANCE.quantize(12, visible)); + AddressSet toRead = new AddressSet(quantize(12, visible)); for (Lifespan span : coordinates.getView().getViewport().getOrderedSpans()) { AddressSetView alreadyKnown = mm.getAddressesWithState(span.lmin(), visible, s -> s == TraceMemoryState.KNOWN); diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/interpreters/AbstractDebuggerWrappedConsoleConnection.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/interpreters/AbstractDebuggerWrappedConsoleConnection.java deleted file mode 100644 index 7af5c3e75b..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/interpreters/AbstractDebuggerWrappedConsoleConnection.java +++ /dev/null @@ -1,286 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.interpreters; - -import java.io.*; -import java.lang.invoke.MethodHandles; -import java.util.Collections; -import java.util.List; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.atomic.AtomicBoolean; - -import javax.swing.Icon; - -import docking.ActionContext; -import docking.action.DockingAction; -import docking.action.ToggleDockingAction; -import ghidra.app.plugin.core.console.CodeCompletion; -import ghidra.app.plugin.core.debug.gui.DebuggerResources; -import ghidra.app.plugin.core.debug.gui.DebuggerResources.InterpreterInterruptAction; -import ghidra.app.plugin.core.debug.gui.DebuggerResources.PinInterpreterAction; -import ghidra.app.plugin.core.interpreter.InterpreterComponentProvider; -import ghidra.app.plugin.core.interpreter.InterpreterConsole; -import ghidra.dbg.AnnotatedDebuggerAttributeListener; -import ghidra.dbg.DebugModelConventions; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetConsole.Channel; -import ghidra.debug.api.interpreter.DebuggerInterpreterConnection; -import ghidra.util.Msg; -import ghidra.util.Swing; - -public abstract class AbstractDebuggerWrappedConsoleConnection - implements DebuggerInterpreterConnection { - - /** - * We inherit console text output from interpreter listener, even though we may be listening to - * a plain console. - */ - protected class ForInterpreterListener extends AnnotatedDebuggerAttributeListener { - public ForInterpreterListener() { - super(MethodHandles.lookup()); - } - - @Override - public void consoleOutput(TargetObject object, Channel channel, byte[] out) { - if (object != targetConsole) { - return; - } - OutputStream os; - switch (channel) { - case STDOUT: - os = stdOut; - break; - case STDERR: - os = stdErr; - break; - default: - throw new AssertionError(); - } - // It's possible stdOut/Err was not initialized, yet - if (os == null) { - return; - } - try { - os.write(out); - } - catch (IOException e) { - Msg.error(this, "Cannot write to interpreter window: ", e); - } - } - - @AttributeCallback(TargetObject.DISPLAY_ATTRIBUTE_NAME) - public void displayChanged(TargetObject object, String display) { - if (object != targetConsole) { - return; - } - // TODO: Add setSubTitle(String) to InterpreterConsole - if (guiConsole == null) { - /** - * Can happen during init. setSubTitle will get called immediately after guiConsole - * is initialized. - */ - return; - } - InterpreterComponentProvider provider = (InterpreterComponentProvider) guiConsole; - Swing.runLater(() -> provider.setSubTitle(display)); - } - - @AttributeCallback(TargetInterpreter.PROMPT_ATTRIBUTE_NAME) - public void promptChanged(TargetObject object, String prompt) { - if (object != targetConsole) { - return; - } - if (guiConsole == null) { - /** - * Can happen during init. setPrompt will get called immediately after guiConsole is - * initialized. NB. It happens in DebuggerWrappedInterpreterConnection - */ - return; - } - Swing.runLater(() -> guiConsole.setPrompt(prompt)); - } - - @Override - public void invalidated(TargetObject object, TargetObject branch, String reason) { - if (object != targetConsole) { - return; - } - Swing.runLater(() -> { - consoleInvalidated(); - }); - } - } - - protected final DebuggerInterpreterPlugin plugin; - protected final T targetConsole; - - protected final AtomicBoolean running = new AtomicBoolean(false); - protected final ForInterpreterListener listener = new ForInterpreterListener(); - protected Thread thread; - protected InterpreterConsole guiConsole; - protected BufferedReader inReader; - protected OutputStream stdOut; - protected OutputStream stdErr; - - protected ToggleDockingAction actionPin; - protected boolean pinned = false; - - public AbstractDebuggerWrappedConsoleConnection(DebuggerInterpreterPlugin plugin, - T targetConsole) { - this.plugin = plugin; - this.targetConsole = targetConsole; - targetConsole.getModel().addModelListener(listener); - } - - protected abstract CompletableFuture sendLine(String line); - - @Override - public String getTitle() { - return DebuggerResources.TITLE_PROVIDER_INTERPRETER; - } - - @Override - public Icon getIcon() { - return DebuggerResources.ICON_CONSOLE; - } - - @Override - public List getCompletions(String cmd) { - // TODO: If GDB or WinDBG ever provides an API for completion.... - // TODO: Of course, that's another method on TargetInterpeter, too. - return Collections.emptyList(); - } - - public void setConsole(InterpreterConsole guiConsole) { - assert this.guiConsole == null; - this.guiConsole = guiConsole; - - InterpreterComponentProvider provider = (InterpreterComponentProvider) guiConsole; - provider.setSubTitle(targetConsole.getDisplay()); - - setStdErr(guiConsole.getStdErr()); - setStdOut(guiConsole.getStdOut()); - setStdIn(guiConsole.getStdin()); - - createActions(); - - if (!targetConsole.isValid()) { - consoleInvalidated(); - } - } - - protected void consoleInvalidated() { - if (pinned) { - running.set(false); - plugin.disableConsole(targetConsole, guiConsole); - } - else { - plugin.destroyConsole(targetConsole, guiConsole); - } - } - - protected void createActions() { - actionPin = PinInterpreterAction.builder(plugin) - .onAction(this::activatedPin) - .selected(pinned) - .build(); - guiConsole.addAction(actionPin); - - DockingAction interruptAction = InterpreterInterruptAction.builder(plugin) - .onAction(this::sendInterrupt) - .build(); - guiConsole.addAction(interruptAction); - } - - public void setStdOut(OutputStream stdOut) { - this.stdOut = stdOut; - } - - public void setStdErr(OutputStream stdErr) { - this.stdErr = stdErr; - } - - public void setStdIn(InputStream stdIn) { - this.inReader = new BufferedReader(new InputStreamReader(stdIn)); - } - - public void runInBackground() { - running.set(true); - thread = new Thread(this::run); - thread.start(); - } - - private void activatedPin(ActionContext ignore) { - pinned = actionPin.isSelected(); - } - - private void sendInterrupt(ActionContext ignore) { - CompletableFuture futureInterruptible = - DebugModelConventions.suitable(TargetInterruptible.class, targetConsole); - if (futureInterruptible != null) { - futureInterruptible.thenCompose(i -> i.interrupt()) - .thenRun(() -> guiConsole.getOutWriter().println("Interrupt sent")) - .exceptionally(exc -> { - guiConsole.getErrWriter().println("Failed to send Interrupt"); - return null; - }); - } - } - - protected void run() { - try { - while (running.get()) { - String line = inReader.readLine(); - if (line == null || !running.get()) { - return; - } - sendLine(line).exceptionally(e -> { - /** - * Do not print such errors to the console. The model ought to output an error, - * but in case the exception is not from the user typing an invalid command, we - * ought to log it for debugging. - */ - Msg.debug(this, "Debugger console exception sending '" + line + "'", e); - return null; - }); - } - } - catch (IOException e) { - Msg.debug(this, "Lost console?"); - } - } - - @Override - public InterpreterConsole getInterpreterConsole() { - return guiConsole; - } - - @Override - public TargetObject getTargetConsole() { - return targetConsole; - } - - @Override - public boolean isPinned() { - return pinned; - } - - @Override - public void setPinned(boolean pinned) { - this.pinned = pinned; - actionPin.setSelected(pinned); - } -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/interpreters/DebuggerInterpreterPlugin.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/interpreters/DebuggerInterpreterPlugin.java deleted file mode 100644 index 37bdd8714b..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/interpreters/DebuggerInterpreterPlugin.java +++ /dev/null @@ -1,129 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.interpreters; - -import java.util.HashMap; -import java.util.Map; - -import javax.swing.SwingUtilities; - -import ghidra.app.plugin.PluginCategoryNames; -import ghidra.app.plugin.core.debug.AbstractDebuggerPlugin; -import ghidra.app.plugin.core.debug.DebuggerPluginPackage; -import ghidra.app.plugin.core.interpreter.*; -import ghidra.app.services.DebuggerInterpreterService; -import ghidra.dbg.target.*; -import ghidra.debug.api.interpreter.DebuggerInterpreterConnection; -import ghidra.framework.plugintool.PluginInfo; -import ghidra.framework.plugintool.PluginTool; -import ghidra.framework.plugintool.annotation.AutoServiceConsumed; -import ghidra.framework.plugintool.util.PluginStatus; - -@PluginInfo( - shortDescription = "Debugger interpreter panel service", - description = "Manage interpreter panels within debug sessions", - category = PluginCategoryNames.DEBUGGER, - packageName = DebuggerPluginPackage.NAME, - status = PluginStatus.RELEASED, - servicesRequired = { - InterpreterPanelService.class, - }, - servicesProvided = { - DebuggerInterpreterService.class, - }) -public class DebuggerInterpreterPlugin extends AbstractDebuggerPlugin - implements DebuggerInterpreterService { - - @AutoServiceConsumed - protected InterpreterPanelService consoleService; - - protected final Map connections = new HashMap<>(); - - public DebuggerInterpreterPlugin(PluginTool tool) { - super(tool); - } - - @Override - public DebuggerInterpreterConnection showConsole(TargetConsole targetConsole) { - DebuggerInterpreterConnection conn; - synchronized (connections) { - conn = connections.computeIfAbsent(targetConsole, c -> createConnection(targetConsole)); - } - conn.getInterpreterConsole().show(); - return conn; - } - - @Override - public DebuggerInterpreterConnection showConsole(TargetInterpreter targetInterpreter) { - DebuggerInterpreterConnection conn; - synchronized (connections) { - conn = connections.computeIfAbsent(targetInterpreter, - c -> createConnection(targetInterpreter)); - } - conn.getInterpreterConsole().show(); - return conn; - } - - protected void disableConsole(TargetObject targetConsole, InterpreterConsole guiConsole) { - DebuggerInterpreterConnection old; - synchronized (connections) { - old = connections.remove(targetConsole); - } - assert old.getInterpreterConsole() == guiConsole; - SwingUtilities.invokeLater(() -> { - if (guiConsole.isInputPermitted()) { - guiConsole.setInputPermitted(false); - guiConsole.setTransient(); - guiConsole.setPrompt(">>INVALID<<"); - } - }); - } - - protected void createConsole(AbstractDebuggerWrappedConsoleConnection connection) { - //InterpreterConsole console = consoleService.createInterpreterPanel(connection, true); - // TODO: Just fix the console plugin - InterpreterConsole console = new DebuggerInterpreterProvider( - (InterpreterPanelPlugin) consoleService, connection, true); - connection.setConsole(console); - connection.runInBackground(); - } - - protected DebuggerInterpreterConnection createConnection(TargetConsole targetConsole) { - DebuggerWrappedConsoleConnection conn = - new DebuggerWrappedConsoleConnection(this, targetConsole); - createConsole(conn); - return conn; - } - - protected DebuggerInterpreterConnection createConnection( - TargetInterpreter targetInterpreter) { - DebuggerWrappedInterpreterConnection conn = - new DebuggerWrappedInterpreterConnection(this, targetInterpreter); - createConsole(conn); - return conn; - } - - public void destroyConsole(TargetObject targetConsole, InterpreterConsole guiConsole) { - DebuggerInterpreterConnection old; - synchronized (connections) { - old = connections.remove(targetConsole); - } - assert old.getInterpreterConsole() == guiConsole; - SwingUtilities.invokeLater(() -> { - guiConsole.dispose(); - }); - } -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/interpreters/DebuggerInterpreterProvider.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/interpreters/DebuggerInterpreterProvider.java deleted file mode 100644 index 27a9a94a31..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/interpreters/DebuggerInterpreterProvider.java +++ /dev/null @@ -1,42 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.interpreters; - -import ghidra.app.plugin.core.interpreter.*; - -public class DebuggerInterpreterProvider extends InterpreterComponentProvider { - - // If only ComponentProvider#subTitle weren't private - // Really, if only InterpreterComponentProvider#getSubTitle weren't overridden - // TODO: Have it just call setSubTitle in its constructor - protected String subTitle; - - public DebuggerInterpreterProvider(InterpreterPanelPlugin plugin, - InterpreterConnection interpreter, boolean visible) { - super(plugin, interpreter, visible); - } - - @Override - public void setSubTitle(String subTitle) { - this.subTitle = subTitle; - super.setSubTitle(subTitle); - } - - @Override - public String getSubTitle() { - return subTitle; - } -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/interpreters/DebuggerWrappedConsoleConnection.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/interpreters/DebuggerWrappedConsoleConnection.java deleted file mode 100644 index 334b3ecb99..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/interpreters/DebuggerWrappedConsoleConnection.java +++ /dev/null @@ -1,34 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.interpreters; - -import java.util.concurrent.CompletableFuture; - -import ghidra.dbg.target.TargetConsole; - -public class DebuggerWrappedConsoleConnection - extends AbstractDebuggerWrappedConsoleConnection { - - public DebuggerWrappedConsoleConnection(DebuggerInterpreterPlugin plugin, - TargetConsole targetConsole) { - super(plugin, targetConsole); - } - - @Override - protected CompletableFuture sendLine(String line) { - return targetConsole.write(line.getBytes(TargetConsole.CHARSET)); - } -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/interpreters/DebuggerWrappedInterpreterConnection.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/interpreters/DebuggerWrappedInterpreterConnection.java deleted file mode 100644 index c0b2dcb602..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/interpreters/DebuggerWrappedInterpreterConnection.java +++ /dev/null @@ -1,41 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.interpreters; - -import java.util.concurrent.CompletableFuture; - -import ghidra.app.plugin.core.interpreter.InterpreterConsole; -import ghidra.dbg.target.TargetInterpreter; - -public class DebuggerWrappedInterpreterConnection - extends AbstractDebuggerWrappedConsoleConnection { - - public DebuggerWrappedInterpreterConnection(DebuggerInterpreterPlugin plugin, - TargetInterpreter interpreter) { - super(plugin, interpreter); - } - - @Override - public void setConsole(InterpreterConsole guiConsole) { - super.setConsole(guiConsole); - guiConsole.setPrompt(targetConsole.getPrompt()); - } - - @Override - protected CompletableFuture sendLine(String line) { - return targetConsole.execute(line); - } -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/DebuggerObjectsPlugin.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/DebuggerObjectsPlugin.java deleted file mode 100644 index 873ce800aa..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/DebuggerObjectsPlugin.java +++ /dev/null @@ -1,282 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.objects; - -import java.util.ArrayList; -import java.util.List; - -import javax.swing.SwingUtilities; - -import ghidra.app.events.*; -import ghidra.app.plugin.PluginCategoryNames; -import ghidra.app.plugin.core.debug.AbstractDebuggerPlugin; -import ghidra.app.plugin.core.debug.DebuggerPluginPackage; -import ghidra.app.plugin.core.debug.event.*; -import ghidra.app.plugin.core.debug.gui.DebuggerResources; -import ghidra.app.services.*; -import ghidra.dbg.DebuggerObjectModel; -import ghidra.dbg.target.TargetInterpreter; -import ghidra.dbg.target.TargetObject; -import ghidra.framework.options.SaveState; -import ghidra.framework.plugintool.*; -import ghidra.framework.plugintool.annotation.AutoServiceConsumed; -import ghidra.framework.plugintool.util.PluginStatus; -import ghidra.program.model.listing.Program; -import ghidra.util.Msg; -import ghidra.util.Swing; -import ghidra.util.datastruct.CollectionChangeListener; - -@PluginInfo( - shortDescription = "Debugger objects manager", - description = """ - GUI to manage connections to external debuggers and trace recording. \ - Deprecated since 11.2 for removal in 11.3.""", - category = PluginCategoryNames.DEBUGGER, - packageName = DebuggerPluginPackage.NAME, - status = PluginStatus.DEPRECATED, - eventsConsumed = { - ProgramActivatedPluginEvent.class, // for default launch executable path - ProgramOpenedPluginEvent.class, - ProgramSelectionPluginEvent.class, - TraceActivatedPluginEvent.class, - TraceOpenedPluginEvent.class, - TraceClosedPluginEvent.class, - ModelActivatedPluginEvent.class, - }, - servicesProvided = { ObjectUpdateService.class }, - servicesRequired = { - DebuggerTraceManagerService.class, - DebuggerModelService.class, - DebuggerInterpreterService.class, - }) -public class DebuggerObjectsPlugin extends AbstractDebuggerPlugin - implements ObjectUpdateService, CollectionChangeListener { - - static final String TITLE_PROVIDER_TARGETS = "Debugger Objects"; - - @AutoServiceConsumed - protected DebuggerInterpreterService interpreterService; - @AutoServiceConsumed - public DebuggerModelService modelService; - @AutoServiceConsumed - private DebuggerConsoleService consoleService; - - private List providers = new ArrayList<>(); - private Program activeProgram; - // Because there's no "primary" provider, save a copy of read config state to apply to new providers - private SaveState copiedSaveState = new SaveState(); - - public DebuggerObjectsPlugin(PluginTool tool) { - super(tool); - } - - @Override - protected void init() { - try { - ObjectContainer init = new ObjectContainer(null, null); - DebuggerObjectsProvider p = new DebuggerObjectsProvider(this, null, init, true); - p.readConfigState(copiedSaveState); - init.propagateProvider(p); - p.update(init); - p.setVisible(true); - } - catch (Exception e) { - e.printStackTrace(); - } - super.init(); - } - - @Override - protected void dispose() { - providers.get(0).setVisible(true); - super.dispose(); - } - - @Override - public void processEvent(PluginEvent event) { - super.processEvent(event); - if (event instanceof TraceOpenedPluginEvent) { - TraceOpenedPluginEvent ev = (TraceOpenedPluginEvent) event; - for (DebuggerObjectsProvider provider : providers) { - provider.traceOpened(ev.getTrace()); - } - } - else if (event instanceof TraceActivatedPluginEvent ev) { - for (DebuggerObjectsProvider provider : providers) { - provider.traceActivated(ev.getActiveCoordinates()); - } - } - else if (event instanceof TraceClosedPluginEvent ev) { - for (DebuggerObjectsProvider provider : providers) { - provider.traceClosed(ev.getTrace()); - } - } - else if (event instanceof ModelActivatedPluginEvent ev) { - for (DebuggerObjectsProvider provider : providers) { - provider.modelActivated(ev.getActiveModel()); - } - } - else if (event instanceof ProgramActivatedPluginEvent ev) { - for (DebuggerObjectsProvider provider : providers) { - provider.setProgram(ev.getActiveProgram()); - } - } - else if (event instanceof ProgramOpenedPluginEvent ev) { - for (DebuggerObjectsProvider provider : providers) { - provider.setProgram(ev.getProgram()); - } - } - else if (event instanceof ProgramSelectionPluginEvent ev) { - for (DebuggerObjectsProvider provider : providers) { - provider.setProgram(ev.getProgram()); - } - } - } - - public void addProvider(DebuggerObjectsProvider provider) { - providers.add(provider); - } - - @Override - public void fireObjectUpdated(ObjectContainer object) { - final ObjectUpdatedEvent event = new ObjectUpdatedEvent(object); - - // distribute selection within Ghidra tool - Runnable r = () -> firePluginEvent(event); - SwingUtilities.invokeLater(r); - } - - public void showConsole(TargetInterpreter interpreter) { - Swing.runIfSwingOrRunLater(() -> { - interpreterService.showConsole(interpreter); - }); - } - - @AutoServiceConsumed - private void setModelService(DebuggerModelService modelService) { - if (this.modelService != null) { - this.modelService.removeModelsChangedListener(this); - } - this.modelService = modelService; - if (this.modelService != null) { - this.modelService.addModelsChangedListener(this); - } - } - - class ProviderRunnable implements Runnable { - private DebuggerObjectsPlugin plugin; - private DebuggerObjectModel model; - - ProviderRunnable(DebuggerObjectsPlugin p, DebuggerObjectModel m) { - this.plugin = p; - this.model = m; - } - - @Override - public void run() { - try { - writeConfigState(copiedSaveState); - ObjectContainer container = new ObjectContainer(null, null); - DebuggerObjectsProvider p = - new DebuggerObjectsProvider(plugin, model, container, true); - p.readConfigState(copiedSaveState); - container.propagateProvider(p); - p.update(container); - p.refresh(); - } - catch (Exception e) { - e.printStackTrace(); - } - } - } - - @Override - public void elementAdded(DebuggerObjectModel model) { - DebuggerObjectsProvider top = providers.get(providers.size() - 1); - DebuggerObjectModel existingModel = top.getModel(); - if (existingModel == null) { - top.setModel(model); - } - else { - SwingUtilities.invokeLater(new ProviderRunnable(this, model)); - } - } - - @Override - public void elementRemoved(DebuggerObjectModel model) { - List toRemove = new ArrayList<>(); - for (DebuggerObjectsProvider p : providers) { - if (model.equals(p.getModel())) { - tool.removeComponentProvider(p); - toRemove.add(p); - } - } - writeConfigState(copiedSaveState); - for (DebuggerObjectsProvider p : toRemove) { - providers.remove(p); - } - if (providers.size() == 0) { - Swing.runIfSwingOrRunLater(() -> { - init(); - }); - } - } - - @Override - public void elementModified(DebuggerObjectModel model) { - System.err.println("modelModified " + model); - } - - public void setFocus(TargetObject object, TargetObject focused) { - for (DebuggerObjectsProvider p : providers) { - p.setFocus(object, focused); - } - } - - public Program getActiveProgram() { - return activeProgram; - } - - public void setActiveProgram(Program program) { - this.activeProgram = program; - } - - @Override - public void writeConfigState(SaveState saveState) { - if (providers.isEmpty()) { - return; - } - providers.get(0).writeConfigState(saveState); - } - - @Override - public void readConfigState(SaveState saveState) { - copiedSaveState = new SaveState(saveState.saveToXml()); - if (providers.isEmpty()) { - return; - } - providers.get(0).readConfigState(saveState); - } - - public void objectError(String message, Throwable ex) { - if (consoleService == null) { - Msg.error(this, message); - return; - } - consoleService.log(DebuggerResources.ICON_LOG_ERROR, message, ex); - } - -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/DebuggerObjectsProvider.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/DebuggerObjectsProvider.java deleted file mode 100644 index 8dac3586de..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/DebuggerObjectsProvider.java +++ /dev/null @@ -1,2027 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.objects; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.event.MouseEvent; -import java.io.PrintWriter; -import java.lang.invoke.MethodHandles; -import java.util.*; -import java.util.Map.Entry; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicReference; -import java.util.function.Function; -import java.util.stream.Collectors; - -import javax.swing.JComponent; -import javax.swing.JPanel; -import javax.swing.tree.TreePath; - -import org.apache.commons.collections4.map.LinkedMap; -import org.apache.commons.lang3.StringUtils; - -import docking.*; -import docking.action.*; -import docking.action.builder.ActionBuilder; -import docking.action.builder.ToggleActionBuilder; -import docking.widgets.OptionDialog; -import docking.widgets.table.DefaultEnumeratedColumnTableModel; -import docking.widgets.tree.GTree; -import generic.jar.ResourceFile; -import generic.theme.GColor; -import ghidra.app.plugin.core.debug.DebuggerPluginPackage; -import ghidra.app.plugin.core.debug.gui.DebuggerResources; -import ghidra.app.plugin.core.debug.gui.DebuggerResources.*; -import ghidra.app.plugin.core.debug.gui.objects.actions.*; -import ghidra.app.plugin.core.debug.gui.objects.components.*; -import ghidra.app.script.*; -import ghidra.app.services.*; -import ghidra.app.services.DebuggerTraceManagerService.ActivationCause; -import ghidra.async.*; -import ghidra.dbg.*; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.error.DebuggerMemoryAccessException; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetConsole.Channel; -import ghidra.dbg.target.TargetExecutionStateful.TargetExecutionState; -import ghidra.dbg.target.TargetMethod.ParameterDescription; -import ghidra.dbg.target.TargetMethod.TargetParameterMap; -import ghidra.dbg.target.TargetSteppable.TargetStepKind; -import ghidra.dbg.util.DebuggerCallbackReorderer; -import ghidra.dbg.util.PathUtils; -import ghidra.debug.api.ValStr; -import ghidra.debug.api.model.DebuggerMemoryMapper; -import ghidra.debug.api.model.TraceRecorder; -import ghidra.debug.api.tracemgr.DebuggerCoordinates; -import ghidra.framework.model.Project; -import ghidra.framework.options.AutoOptions; -import ghidra.framework.options.SaveState; -import ghidra.framework.options.annotation.AutoOptionDefined; -import ghidra.framework.plugintool.*; -import ghidra.framework.plugintool.annotation.AutoConfigStateField; -import ghidra.framework.plugintool.annotation.AutoServiceConsumed; -import ghidra.program.model.address.Address; -import ghidra.program.model.address.AddressRange; -import ghidra.program.model.listing.Program; -import ghidra.program.util.ProgramLocation; -import ghidra.program.util.ProgramSelection; -import ghidra.trace.model.Trace; -import ghidra.trace.model.thread.TraceThread; -import ghidra.util.*; -import ghidra.util.datastruct.PrivatelyQueuedListener; -import ghidra.util.table.GhidraTable; -import ghidra.util.task.TaskMonitor; - -public class DebuggerObjectsProvider extends ComponentProviderAdapter - implements ObjectContainerListener { - - public static final String PATH_JOIN_CHAR = "."; - //private static final String AUTOUPDATE_ATTRIBUTE_NAME = "autoupdate"; - - public static final Color COLOR_FOREGROUND = - new GColor("color.fg.debugger.plugin.objects.default"); - public static final Color COLOR_BACKGROUND = - new GColor("color.bg.debugger.plugin.objects.default"); - public static final Color COLOR_FOREGROUND_INVISIBLE = - new GColor("color.fg.debugger.plugin.objects.invisible"); - public static final Color COLOR_FOREGROUND_INVALIDATED = - new GColor("color.fg.debugger.plugin.objects.invalidated"); - public static final Color COLOR_FOREGROUND_MODIFIED = - new GColor("color.fg.debugger.plugin.objects.modified"); - public static final Color COLOR_FOREGROUND_SUBSCRIBED = - new GColor("color.fg.debugger.plugin.objects.subscribed"); - public static final Color COLOR_FOREGROUND_ERROR = - new GColor("color.fg.debugger.plugin.objects.error"); - public static final Color COLOR_FOREGROUND_INTRINSIC = - new GColor("color.fg.debugger.plugin.objects.intrinsic"); - public static final Color COLOR_FOREGROUND_TARGET = - new GColor("color.fg.debugger.plugin.objects.target"); - public static final Color COLOR_FOREGROUND_ACCESSOR = - new GColor("color.fg.debugger.plugin.objects.accessor"); - public static final Color COLOR_FOREGROUND_LINK = - new GColor("color.fg.debugger.plugin.objects.link"); - - private static final AutoConfigState.ClassHandler CONFIG_STATE_HANDLER = - AutoConfigState.wireHandler(DebuggerObjectsProvider.class, MethodHandles.lookup()); - - private final DebuggerObjectsPlugin plugin; - - @AutoServiceConsumed - public DebuggerModelService modelService; - @AutoServiceConsumed - private DebuggerTraceManagerService traceManager; - @AutoServiceConsumed - private DebuggerStaticMappingService mappingService; - @AutoServiceConsumed - private DebuggerListingService listingService; - @AutoServiceConsumed - private GraphDisplayBroker graphBroker; - @AutoServiceConsumed - private ConsoleService consoleService; - @SuppressWarnings("unused") - private final AutoService.Wiring autoServiceWiring; - - @AutoOptionDefined( - name = "Default Extended Step", - description = "The default string for the extended step command") - String extendedStep = ""; - - @SuppressWarnings("unused") - private final AutoOptions.Wiring autoOptionsWiring; - - private JPanel mainPanel; - private ObjectPane pane; - protected ObjectContainer root; - private Map targetMap; - private Set refSet; - - public Program currentProgram; // For quick launch - protected Map traces = new HashMap<>(); - protected Trace currentTrace; - protected DebuggerObjectModel currentModel; - private TargetObject targetFocus; - // NB: We're getting rid of this because the ObjectsProvider is beating the trace - // to the punch and causing the pattern-matcher to fail - // private TraceRecorder recorder; - protected Runnable repeatLastSet = () -> { - }; - - private boolean asTree = true; - private MyObjectListener listener = new MyObjectListener(); - - public DebuggerMethodInvocationDialog configDialog; - public DebuggerMethodInvocationDialog methodDialog; - public DebuggerAttachDialog attachDialog; - public DebuggerBreakpointDialog breakpointDialog; - private GenericDebuggerProgramLaunchOffer launchOffer; - - DockingAction actionLaunch; - DockingAction actionAddBreakpoint; - DisplayAsTreeAction displayAsTreeAction; - DisplayAsTableAction displayAsTableAction; - DisplayAsGraphAction displayAsGraphAction; - DisplayAsXMLAction displayAsXMLAction; - DisplayFilteredTreeAction displayFilteredTreeAction; - DisplayFilteredTableAction displayFilteredTableAction; - DisplayFilteredGraphAction displayFilteredGraphAction; - DisplayFilteredXMLAction displayFilteredXMLAction; - DisplayMethodsAction displayMethodsAction; - ExportAsXMLAction exportAsXMLAction; - ExportAsFactsAction exportAsFactsAction; - ImportFromXMLAction importFromXMLAction; - ImportFromFactsAction importFromFactsAction; - OpenWinDbgTraceAction openTraceAction; - SetTimeoutAction setTimeoutAction; - - private ToggleDockingAction actionToggleBase; - private ToggleDockingAction actionToggleSubscribe; - private ToggleDockingAction actionToggleAutoRecord; - private ToggleDockingAction actionToggleHideIntrinsics; - private ToggleDockingAction actionToggleSelectionOnly; - private ToggleDockingAction actionToggleIgnoreState; - private ToggleDockingAction actionToggleUpdateWhileRunning; - private ToggleDockingAction actionSuppressDescent; - - @AutoConfigStateField - private boolean autoRecord = true; - @AutoConfigStateField - private boolean hideIntrinsics = true; - @AutoConfigStateField - private boolean selectionOnly = false; - @AutoConfigStateField - private boolean ignoreState = false; - @AutoConfigStateField - private boolean updateWhileRunning = true; - @AutoConfigStateField - private boolean suppressDescent = false; - @AutoConfigStateField - private int nodeTimeout = 60; - - Set configurables = new HashSet<>(); - private String lastMethod = ""; - Map scripts = new HashMap<>(); - Map scriptNames = new HashMap<>(); - - public DebuggerObjectsProvider(final DebuggerObjectsPlugin plugin, DebuggerObjectModel model, - ObjectContainer container, boolean asTree) throws Exception { - super(plugin.getTool(), container.getPrefixedName(), plugin.getName()); - this.plugin = plugin; - currentProgram = plugin.getActiveProgram(); - plugin.addProvider(this); - this.currentModel = model; - launchOffer = new GenericDebuggerProgramLaunchOffer(currentProgram, tool, currentModel); - this.root = container; - this.asTree = asTree; - setIcon(asTree ? ObjectTree.ICON_TREE : ObjectTable.ICON_TABLE); - - targetMap = new LinkedMap<>(); - refSet = new HashSet<>(); - getRoot().propagateProvider(this); - - this.autoServiceWiring = AutoService.wireServicesConsumed(plugin, this); - this.autoOptionsWiring = AutoOptions.wireOptions(plugin, this); - - setHelpLocation(DebuggerResources.HELP_PROVIDER_OBJECTS); - - // Not sure any of this has any effect - setDefaultWindowPosition(WindowPosition.STACK); - setWindowGroup("Debugger.Core.Objects"); - setIntraGroupPosition(WindowPosition.STACK); - setWindowMenuGroup(DebuggerPluginPackage.NAME); - - buildMainPanel(); - - setVisible(true); - createActions(); - - repeatLastSet.run(); - } - - void dispose() { - // TODO This is not currently called, since the clients of this provider to not hold onto - // the provider after creation. Ideally, these providers should either be tracked and - // disposed, or this provider should perform cleanup on itself when it is no longer used. - configDialog.dispose(); - methodDialog.dispose(); - attachDialog.dispose(); - breakpointDialog.dispose(); - } - - @Override - public void addLocalAction(DockingActionIf action) { - super.addLocalAction(action); - } - - @Override - public ObjectActionContext getActionContext(MouseEvent event) { - return new ObjectActionContext(this); - } - - public TargetObject getObjectFromContext(ActionContext context) { - /* - Object obj = context.getContextObject(); - ObjectContainer sel = getSelectedContainer(obj); - if (sel == null) { - return null; - } - return sel.getTargetObject(); - */ - return pane == null ? null : pane.getSelectedObject(); - } - - public DebuggerObjectModel getModel() { - return currentModel; - } - - public void setModel(DebuggerObjectModel model) { - currentModel = model; - currentModel.addModelListener(getListener(), true); - launchOffer = new GenericDebuggerProgramLaunchOffer(currentProgram, tool, currentModel); - refresh(); - } - - @Override - public JComponent getComponent() { - return mainPanel; - } - - private void buildMainPanel() throws Exception { - mainPanel = new JPanel(new BorderLayout()); - if (asTree) { - addTree(getRoot()); - } - else { - addTable(getRoot()); - } - - methodDialog = new DebuggerMethodInvocationDialog(tool, "Method", "Method", - DebuggerResources.ICON_LAUNCH); - //attachDialogOld = new DebuggerAttachDialog(this); - attachDialog = new DebuggerAttachDialog(this); - breakpointDialog = new DebuggerBreakpointDialog(this); - configDialog = new DebuggerMethodInvocationDialog(tool, "Configuration", "Configure", - DebuggerResources.ICON_CONFIG); - } - - private void addToPanel(ObjectPane p) throws Exception { - if (p == null) { - throw new Exception("NULL PANE generated!"); - } - pane = p; - mainPanel.add(pane.getComponent()); - } - - JComponent getContextObject() { - return pane == null ? null : pane.getPrincipalComponent(); - } - - public void setProgram(Program program) { - if (program == currentProgram) { - return; - } - currentProgram = program; - plugin.setActiveProgram(currentProgram); - launchOffer = new GenericDebuggerProgramLaunchOffer(currentProgram, tool, currentModel); - contextChanged(); - } - - private boolean hasModelAndProgram() { - return currentModel != null && currentProgram != null; - } - - public void traceOpened(Trace trace) { - //refresh(); - repeatLastSet.run(); - } - - public void refresh() { - if (pane != null) { - if (currentModel != null) { - currentModel.fetchModelRoot().thenAccept(this::refresh).exceptionally(ex -> { - plugin.objectError("Error refreshing model root", ex); - return null; - }); - } - } - } - - public void refresh(TargetObject targetObject) { - if (pane != null) { - Swing.runIfSwingOrRunLater(() -> { - pane.setRoot(getRoot(), targetObject); - getRoot().propagateProvider(getRoot().getProvider()); - pane.signalUpdate(getRoot()); - }); - } - } - - public void refresh(String key) { - if (pane != null) { - if (key != null) { - List containers = new ArrayList<>(); - for (String path : targetMap.keySet()) { - if (path.endsWith(key)) { - synchronized (targetMap) { - ObjectContainer container = targetMap.get(path); - containers.add(container); - } - } - } - for (ObjectContainer container : containers) { - pane.signalUpdate(container); - } - } - else { - pane.signalUpdate(pane.getContainer()); - } - } - } - - public void modelActivated(DebuggerObjectModel model) { - //TODO: what do we want here - change of focus, selection? - if (model != null && model.equals(currentModel)) { - this.requestFocus(); // COMPONENT - this.toFront(); - setSubTitle(currentModel.getBrief()); - } - } - - // TODO: These events aren't being called anymore - // TraceActivatedEvents now carry complete "coordinates" (trace,thread,snap,frame,etc.) - public void traceActivated(DebuggerCoordinates coordinates) { - - if (currentTrace == coordinates.getTrace()) { - return; - } - setTrace(coordinates.getTrace(), coordinates.getThread(), true); - - } - - public void setTrace(Trace trace, TraceThread thread, boolean select) { - TargetObject target = modelService.getTarget(trace); - if (!refSet.contains(target)) { - return; - } - repeatLastSet = () -> setTrace(trace, thread, select); - if (trace != null) { - //traces.put(thread.getKey(), trace); - currentTrace = trace; - } - contextChanged(); - //refresh(getRoot().getName()); - } - - public void traceClosed(Trace trace) { - if (trace == currentTrace) { - setTrace(null, null, true); - } - //rootNode.tracesNode.traceClosed(trace); - } - - public GraphDisplayBroker getGraphBroker() { - return graphBroker; - } - - public ConsoleService getConsoleService() { - return consoleService; - } - - public ObjectContainer getSelectedContainer(Object obj) { - if (obj instanceof GTree) { - GTree tree = (GTree) obj; - TreePath path = tree.getSelectionPath(); - if (path != null) { - Object last = path.getLastPathComponent(); - if (last instanceof ObjectNode) { - return ((ObjectNode) last).getContainer(); - } - } - return pane.getContainer(); - } - if (obj instanceof GhidraTable) { - GhidraTable table = (GhidraTable) obj; - ObjectContainer container = pane.getContainer(); - if (pane.getPrincipalComponent().equals(table)) { - TargetObject object = pane.getSelectedObject(); - if (object instanceof DummyTargetObject) { - return container; - } - ObjectContainer subContainer = container.getSubContainer(object); - if (subContainer != null) { - return subContainer; - } - } - return container; - } - return null; - } - - // TODO: right now, getSelectedObject and getSelectedContainer.getTargetObject - // might (?) not return the same thing. Remedy? - public TargetObject getSelectedObject() { - TargetObject selectedObject = pane.getSelectedObject(); - if (selectedObject != null) { - return selectedObject; - } - return null; - } - - public void addTree(ObjectContainer container) { - ObjectTree objTree = new ObjectTree(container); - try { - addToPanel(objTree); - } - catch (Exception e) { - e.printStackTrace(); - } - GTree tree = (GTree) objTree.getPrincipalComponent(); - tree.setRootVisible(true); - } - - public void addTable(ObjectContainer container) { - AtomicReference update = new AtomicReference<>(); - AsyncUtils.sequence(TypeSpec.cls(ObjectContainer.class)).then(seq -> { - container.getOffspring(RefreshBehavior.REFRESH_WHEN_ABSENT).handle(seq::next); - }, update).then(seq -> { - try { - ObjectContainer oc = update.get(); - if (oc.hasElements()) { - addToPanel(buildTableFromElements(oc)); - } - else { - addToPanel(buildTableFromAttributes(oc)); - } - seq.exit(); - } - catch (Exception e) { - e.printStackTrace(); - } - }).finish().completeExceptionally(new RuntimeException("Unable to add table")); - } - - private ObjectTable buildTableFromAttributes(ObjectContainer container) { - TargetObject targetObject = container.getTargetObject(); - String name = targetObject.getName(); - DefaultEnumeratedColumnTableModel model = - new DefaultEnumeratedColumnTableModel<>(tool, name, ObjectAttributeColumn.class); - Map map = container.getAttributeMap(); - List list = new ArrayList<>(); - for (Object val : map.values()) { - if (val instanceof TargetObject) { - TargetObject ref = (TargetObject) val; - list.add(new ObjectAttributeRow(ref, container.getProvider())); - } - } - model.addAll(list); - return new ObjectTable<>(container, ObjectAttributeRow.class, model); - } - - private ObjectTable buildTableFromElements(ObjectContainer container) { - TargetObject targetObject = container.getTargetObject(); - String name = targetObject.getName(); - Map map = container.getElementMap(); - List list = new ArrayList<>(); - for (Object obj : map.values()) { - if (obj instanceof TargetObject) { - TargetObject ref = (TargetObject) obj; - list.add(new ObjectElementRow(ref, container.getProvider())); - } - } - ObjectElementColumn[] cols = new ObjectElementColumn[1]; - cols[0] = new ObjectElementColumn("Accessor", ObjectElementRow::getValue); - ObjectEnumeratedColumnTableModel model = - new ObjectEnumeratedColumnTableModel<>(name, cols); - model.addAll(list); - ObjectTable table = - new ObjectTable<>(container, ObjectElementRow.class, model); - for (Object obj : map.values()) { - if (obj instanceof TargetObject) { - TargetObject ref = (TargetObject) obj; - ref.fetchAttributes(RefreshBehavior.REFRESH_ALWAYS).thenAccept(attrs -> { - table.setColumns(); - // TODO: What with attrs? - }).exceptionally(ex -> { - plugin.objectError("Failed to fetch attributes", ex); - return null; - }); - } - } - return table; - } - - public DebuggerObjectsPlugin getPlugin() { - return plugin; - } - - public void addTargetToMap(ObjectContainer container) { - DebuggerObjectsProvider provider = container.getProvider(); - if (!this.equals(provider)) { - plugin.objectError("TargetMap corrupted", null); - } - TargetObject targetObject = container.getTargetObject(); - if (targetObject != null && !container.isLink()) { - String key = targetObject.getJoinedPath(PATH_JOIN_CHAR); - container.subscribe(); - synchronized (targetMap) { - targetMap.put(key, container); - refSet.add(targetObject); - if (targetObject instanceof TargetConfigurable) { - configurables.add((TargetConfigurable) targetObject); - } - } - if (targetObject instanceof TargetInterpreter) { - TargetInterpreter interpreter = (TargetInterpreter) targetObject; - getPlugin().showConsole(interpreter); - pane.setSelectedObject(targetObject); - } - } - } - - public void deleteFromMap(ObjectContainer container) { - TargetObject targetObject = container.getTargetObject(); - if (targetObject != null) { - synchronized (targetMap) { - targetMap.remove(targetObject.getJoinedPath(PATH_JOIN_CHAR)); - refSet.remove(targetObject); - if (targetObject instanceof TargetConfigurable) { - configurables.remove(targetObject); - } - } - } - } - - public ObjectContainer getContainerByPath(List path) { - return targetMap.get(PathUtils.toString(path, PATH_JOIN_CHAR)); - } - - static List getContainersFromObjects(Map objectMap, - TargetObject parent, boolean usingAttributes) { - List result = new ArrayList<>(); - if (parent == null || parent instanceof DummyTargetObject) { - return result; - } - synchronized (objectMap) { - for (String key : objectMap.keySet()) { - Object object = objectMap.get(key); - if (object == null) { - System.err.println("null object for " + key); - continue; - } - ObjectContainer container = null; - try { - container = buildContainerFromObject(parent, key, object, usingAttributes); - } - catch (Exception e) { - e.printStackTrace(); - } - if (container != null) { - result.add(container); - } - } - } - return result; - - } - - static ObjectContainer buildContainerFromObject(TargetObject parent, String key, Object val, - boolean usingAttributes) { - String xkey = usingAttributes ? key : "[" + key + "]"; - if (val instanceof TargetObject) { - TargetObject to = (TargetObject) val; - List path = to.getPath(); - boolean isLink = PathUtils.isLink(parent.getPath(), xkey, path); - boolean isMethod = false; - isMethod = to instanceof TargetMethod; - if (!(val instanceof DummyTargetObject) && !isMethod) { - return new ObjectContainer(to, isLink ? xkey : null); - } - } - else { - List xpath = PathUtils.extend(parent.getPath(), key); - DummyTargetObject to = new DummyTargetObject(parent, xpath, "", val, ""); - return new ObjectContainer(to, null); - } - return null; - } - - @Override - public void closeComponent() { - DebuggerObjectModel model = getModel(); - if (model != null) { - model.removeModelListener(getListener()); - } - super.closeComponent(); - } - - public void signalDataChanged(ObjectContainer container) { - if (pane != null) { - pane.signalDataChanged(container); - } - } - - public void signalContentsChanged(ObjectContainer container) { - if (pane != null) { - pane.signalContentsChanged(container); - } - } - - @Override - public void update(ObjectContainer container) { - if (pane != null) { - pane.signalUpdate(container); - } - } - - public ObjectContainer getRoot() { - return root; - } - - public ObjectContainer getParent(ObjectContainer container) { - List path = container.getTargetObject().getPath(); - List ppath = new ArrayList<>(); - for (String link : path) { - ppath.add(link); - } - if (path.size() == 0) { - return null; - } - ppath.remove(path.size() - 1); - String joinedPath = StringUtils.join(ppath, PATH_JOIN_CHAR); - return targetMap.get(joinedPath); - } - - public void fireObjectUpdated(ObjectContainer object) { - plugin.fireObjectUpdated(object); - } - - class ObjectActionContext extends DefaultActionContext { - - private DebuggerObjectsProvider provider; - - ObjectActionContext(DebuggerObjectsProvider provider) { - super(provider); - this.provider = provider; - } - - @Override - public Object getContextObject() { - return provider.getContextObject(); - } - - } - - public boolean isRoot(ActionContext context) { - TargetObject object = this.getObjectFromContext(context); - if (object == null) { - return false; - } - return object.isRoot(); - } - - public boolean isInstance(ActionContext context, Class clazz) { - TargetObject object = this.getObjectFromContext(context); - if (object == null) { - return false; - } - if (isLocalOnly()) { - return clazz.isInstance(object); - } - TargetObject result = null; - try { - result = - DebugModelConventions.findSuitable(clazz, object).get(100, TimeUnit.MILLISECONDS); - } - catch (Exception e) { - // IGNORE - } - return result != null; - } - - public boolean hasInstance(ActionContext context, Class clazz) { - TargetObject object = this.getObjectFromContext(context); - if (object == null) { - return false; - } - if (isLocalOnly()) { - return clazz.isInstance(object); - } - for (Object attr : object.getCachedAttributes().values()) { - if (clazz.isInstance(attr)) { - return true; - } - } - return false; - } - - public TargetObject getAncestor(ActionContext context, Class clazz) { - TargetObject object = this.getObjectFromContext(context); - TargetObject ref = object; - while (ref != null) { - if (clazz.isInstance(ref)) { - return ref; - } - ref = ref.getParent(); - } - return null; - } - - public boolean descendsFrom(ActionContext context, Class clazz) { - TargetObject ref = getAncestor(context, clazz); - return ref != null; - } - - //@formatter:off - private void createActions() { - int groupTargetIndex = 0; - - new ActionBuilder("Refresh Node", plugin.getName()) - .keyBinding("SHIFT R") - .toolBarGroup(DebuggerResources.GROUP_MAINTENANCE, "M" + groupTargetIndex) - .toolBarIcon(AbstractRefreshAction.ICON) - .helpLocation(new HelpLocation(plugin.getName(), "refresh")) - .onAction(ctx -> performRefresh(ctx)) - .enabled(true) - .buildAndInstallLocal(this); - - groupTargetIndex++; - - actionToggleBase = new ToggleActionBuilder("Toggle Base", plugin.getName()) - .keyBinding("B") - .menuPath("&Toggle base") - .menuGroup(DebuggerResources.GROUP_TARGET, "M" + groupTargetIndex) - .helpLocation(new HelpLocation(plugin.getName(), "toggle_base")) - .onAction(ctx -> performToggleBase(ctx)) - .buildAndInstallLocal(this); - - groupTargetIndex++; - - actionToggleSubscribe = new ToggleActionBuilder("Toggle Subscription", plugin.getName()) - .keyBinding("U") - .menuPath("&Toggle subscription") - .menuGroup(DebuggerResources.GROUP_TARGET, "M" + groupTargetIndex) - .helpLocation(new HelpLocation(plugin.getName(), "toggle_subscription")) - .onAction(ctx -> performToggleSubscription(ctx)) - .buildAndInstallLocal(this); - - groupTargetIndex++; - - actionToggleAutoRecord = new ToggleActionBuilder("&Record Automatically", plugin.getName()) - .menuPath("&Record Automatically") - .menuGroup(DebuggerResources.GROUP_TARGET, "M" + groupTargetIndex) - .helpLocation(new HelpLocation(plugin.getName(), "record_automatically")) - .onAction(ctx -> performToggleAutoRecord(ctx)) - .selected(autoRecord) - .enabled(true) - .buildAndInstallLocal(this); - - groupTargetIndex++; - - actionToggleHideIntrinsics = new ToggleActionBuilder("Hide Intrinsic Atributes", plugin.getName()) - .menuPath("Maintenance","&Hide Intrinsic Attributes") - .menuGroup(DebuggerResources.GROUP_TARGET, "M" + groupTargetIndex) - .helpLocation(new HelpLocation(plugin.getName(), "hide_intrinsic_attributes")) - .onAction(ctx -> performToggleHideIntrinsics(ctx)) - .selected(hideIntrinsics) - .enabled(true) - .buildAndInstallLocal(this); - - groupTargetIndex++; - - actionToggleSelectionOnly = new ToggleActionBuilder("Enable By Selection Only", plugin.getName()) - .menuPath("Maintenance","Enable By &Selection Only") - .menuGroup(DebuggerResources.GROUP_TARGET, "M" + groupTargetIndex) - .helpLocation(new HelpLocation(plugin.getName(), "act_on_selection_only")) - .onAction(ctx -> performToggleSelectionOnly(ctx)) - .selected(selectionOnly) - .enabled(true) - .buildAndInstallLocal(this); - - groupTargetIndex++; - - actionToggleIgnoreState = new ToggleActionBuilder("Toggle ignore state on/off", plugin.getName()) - .menuPath("Maintenance","&Ignore State") - .menuGroup(DebuggerResources.GROUP_TARGET, "M" + groupTargetIndex) - .helpLocation(new HelpLocation(plugin.getName(), "toggle_ignore_state")) - .onAction(ctx -> performToggleIgnoreState(ctx)) - .selected(ignoreState) - .enabled(true) - .buildAndInstallLocal(this); - - groupTargetIndex++; - - actionToggleUpdateWhileRunning = new ToggleActionBuilder("Toggle update while running", plugin.getName()) - .menuPath("Maintenance","&Update While Running") - .menuGroup(DebuggerResources.GROUP_TARGET, "M" + groupTargetIndex) - .helpLocation(new HelpLocation(plugin.getName(), "toggle_update_while_running")) - .onAction(ctx -> performToggleUpdateWhileRunning(ctx)) - .selected(isUpdateWhileRunning()) - .enabled(true) - .buildAndInstallLocal(this); - - groupTargetIndex++; - - /* - actionSuppressDescent = new ToggleActionBuilder("Automatically populate containers", plugin.getName()) - .menuPath("Maintenance","&Auto-populate") - .menuGroup(DebuggerResources.GROUP_TARGET, "M" + groupTargetIndex) - .helpLocation(new HelpLocation(plugin.getName(), "auto-populate containers")) - .onAction(ctx -> performToggleAutoPopulateContainers(ctx)) - .selected(isUpdateWhileRunning()) - .enabled(true) - .buildAndInstallLocal(this); - */ - - groupTargetIndex = 0; - - new ActionBuilder("Quick Launch", plugin.getName()) - .keyBinding("Q") - .toolBarGroup(DebuggerResources.GROUP_TARGET, "" + groupTargetIndex) - .toolBarIcon(AbstractQuickLaunchAction.ICON) - .helpLocation(AbstractQuickLaunchAction.help(plugin)) - .enabledWhen(ctx -> hasModelAndProgram()) - .onAction(ctx -> performQuickLaunch(ctx)) - .enabled(currentModel != null) - .buildAndInstallLocal(this); - - groupTargetIndex++; - - actionLaunch = new ActionBuilder("Launch", plugin.getName()) - .keyBinding("X") - .toolBarGroup(DebuggerResources.GROUP_TARGET, "T" + groupTargetIndex) - .toolBarIcon(AbstractLaunchAction.ICON) - .popupMenuPath("&Exec") - .popupMenuGroup(DebuggerResources.GROUP_TARGET, "T" + groupTargetIndex) - .popupMenuIcon(AbstractLaunchAction.ICON) - .helpLocation(AbstractLaunchAction.help(plugin)) - .enabledWhen(ctx -> isInstance(ctx, TargetLauncher.class)) - .popupWhen(ctx -> isInstance(ctx, TargetLauncher.class)) - .onAction(ctx -> performLaunch(ctx)) - .enabled(false) - .buildAndInstallLocal(this); - - groupTargetIndex++; - - new ActionBuilder("Attach", plugin.getName()) - .keyBinding("A") - .toolBarGroup(DebuggerResources.GROUP_TARGET, "T" + groupTargetIndex) - .toolBarIcon(AbstractAttachAction.ICON) - .popupMenuPath("&Attach") - .popupMenuGroup(DebuggerResources.GROUP_TARGET, "T" + groupTargetIndex) - .popupMenuIcon(AbstractAttachAction.ICON) - .helpLocation(AbstractAttachAction.help(plugin)) - .enabledWhen(ctx -> isInstance(ctx, TargetAttachable.class)) - .onAction(ctx -> performAttach(ctx)) - .enabled(true) - .buildAndInstallLocal(this); - - groupTargetIndex++; - - new ActionBuilder("Re-attach", plugin.getName()) - .keyBinding("ALT A") - .menuPath("&Reattach") - .menuGroup(DebuggerResources.GROUP_TARGET, "T" + groupTargetIndex) - .menuIcon(AbstractDetachAction.ICON) - .helpLocation(AbstractAttachAction.help(plugin)) - .enabledWhen(ctx -> isInstance(ctx, TargetAttachable.class) && isStopped(ctx)) - .onAction(ctx -> performReattach(ctx)) - .enabled(true) - .buildAndInstallLocal(this); - - groupTargetIndex++; - - new ActionBuilder("Method", plugin.getName()) - .keyBinding("M") - .menuPath("Exec &Method") - .menuGroup(DebuggerResources.GROUP_TARGET, "T" + groupTargetIndex) - .menuIcon(AbstractDetachAction.ICON) - .popupMenuPath("Exec &Method") - .popupMenuGroup(DebuggerResources.GROUP_TARGET, "T" + groupTargetIndex) - .popupMenuIcon(AbstractDetachAction.ICON) - .helpLocation(AbstractAttachAction.help(plugin)) - .enabledWhen(ctx -> hasInstance(ctx, TargetMethod.class)) - .onAction(ctx -> performMethod(ctx)) - .enabled(true) - .buildAndInstallLocal(this); - - groupTargetIndex++; - - /* - new ActionBuilder("AttachAction", plugin.getName()) - .keyBinding("A") - .toolBarGroup(DebuggerResources.GROUP_TARGET, "T" + groupTargetIndex) - .toolBarIcon(AbstractAttachAction.ICON) - .popupMenuPath("&Attach") - .popupMenuGroup(DebuggerResources.GROUP_TARGET, "T" + groupTargetIndex) - .popupMenuIcon(AbstractAttachAction.ICON) - .enabledWhen(ctx -> isInstance(ctx, TargetAttachable.class) || isInstance(ctx, TargetAttacher.class)) - .popupWhen(ctx -> isInstance(ctx, TargetAttachable.class) || isInstance(ctx, TargetAttacher.class)) - .onAction(ctx -> performAttach(ctx)) - .enabled(false) - .buildAndInstallLocal(this); - - groupTargetIndex++; - */ - - new ActionBuilder("Detach", plugin.getName()) - .keyBinding("D") - .menuPath("&Detach") - .menuGroup(DebuggerResources.GROUP_TARGET, "T" + groupTargetIndex) - .menuIcon(AbstractDetachAction.ICON) - .popupMenuPath("&Detach") - .popupMenuGroup(DebuggerResources.GROUP_TARGET, "T" + groupTargetIndex) - .popupMenuIcon(AbstractDetachAction.ICON) - .helpLocation(AbstractDetachAction.help(plugin)) - .popupWhen(ctx -> isInstance(ctx, TargetDetachable.class) && isStopped(ctx)) - .enabledWhen(ctx -> isInstance(ctx, TargetDetachable.class) && isStopped(ctx)) - .onAction(ctx -> performDetach(ctx)) - .enabled(false) - .buildAndInstallLocal(this); - - groupTargetIndex++; - - new ActionBuilder("Kill", plugin.getName()) - .keyBinding("K") - .menuPath("&Kill") - .menuGroup(DebuggerResources.GROUP_TARGET, "T" + groupTargetIndex) - .menuIcon(AbstractKillAction.ICON) - .popupMenuPath("&Kill") - .popupMenuGroup(DebuggerResources.GROUP_TARGET, "T" + groupTargetIndex) - .popupMenuIcon(AbstractKillAction.ICON) - .helpLocation(AbstractKillAction.help(plugin)) - .enabledWhen(ctx -> isInstance(ctx, TargetKillable.class) && (isStopped(ctx) || !isAccessConditioned(ctx))) - .popupWhen(ctx -> isInstance(ctx, TargetKillable.class) && (isStopped(ctx) || !isAccessConditioned(ctx))) - .onAction(ctx -> performKill(ctx)) - .enabled(false) - .buildAndInstallLocal(this); - - groupTargetIndex++; - - new ActionBuilder("Start Recording", plugin.getName()) - .keyBinding("R") - .menuPath("&Record") - .menuGroup(DebuggerResources.GROUP_TARGET, "T" + groupTargetIndex) - .menuIcon(AbstractRecordAction.ICON) - .popupMenuPath("&Record") - .popupMenuGroup(DebuggerResources.GROUP_TARGET, "T" + groupTargetIndex) - .popupMenuIcon(AbstractRecordAction.ICON) - .helpLocation(new HelpLocation(plugin.getName(), "record")) - .enabledWhen(ctx -> isInstance(ctx, TargetProcess.class) || isRoot(ctx)) - .popupWhen(ctx -> isInstance(ctx, TargetProcess.class) || isRoot(ctx)) - .onAction(ctx -> performStartRecording(ctx)) - .enabled(true) - .buildAndInstallLocal(this); - - groupTargetIndex = 0; - - new ActionBuilder("Resume", plugin.getName()) - .keyBinding("F5") - .toolBarGroup(DebuggerResources.GROUP_CONTROL, "C" + groupTargetIndex) - .toolBarIcon(AbstractResumeAction.ICON) - .popupMenuPath("&Resume") - .popupMenuGroup(DebuggerResources.GROUP_CONTROL, "C" + groupTargetIndex) - .popupMenuIcon(AbstractResumeAction.ICON) - .helpLocation(AbstractResumeAction.help(plugin)) - .enabledWhen(ctx -> - isInstance(ctx, TargetResumable.class) && isStopped(ctx)) - .popupWhen(ctx -> - isInstance(ctx, TargetResumable.class) && isStopped(ctx)) - .onAction(ctx -> performResume(ctx)) - .enabled(false) - .buildAndInstallLocal(this); - - groupTargetIndex++; - - new ActionBuilder("Interrupt", plugin.getName()) - .keyBinding("pause") - .toolBarGroup(DebuggerResources.GROUP_CONTROL, "C" + groupTargetIndex) - .toolBarIcon(AbstractInterruptAction.ICON) - .popupMenuPath("&Interrupt") - .popupMenuGroup(DebuggerResources.GROUP_CONTROL, "C" + groupTargetIndex) - .popupMenuIcon(AbstractInterruptAction.ICON) - .helpLocation(AbstractInterruptAction.help(plugin)) - .enabledWhen(ctx -> - isInstance(ctx, TargetInterruptible.class) && (!isStopped(ctx) || ignoreState)) - .popupWhen(ctx -> - isInstance(ctx, TargetInterruptible.class) && (!isStopped(ctx) || ignoreState)) - .onAction(ctx -> performInterrupt(ctx)) - .enabled(false) - .buildAndInstallLocal(this); - - groupTargetIndex++; - - new ActionBuilder("Step Into", plugin.getName()) - .keyBinding("F8") - .toolBarGroup(DebuggerResources.GROUP_CONTROL, "C" + groupTargetIndex) - .toolBarIcon(AbstractStepIntoAction.ICON) - .popupMenuPath("&Step Into") - .popupMenuGroup(DebuggerResources.GROUP_CONTROL, "C" + groupTargetIndex) - .popupMenuIcon(AbstractStepIntoAction.ICON) - .helpLocation(AbstractStepIntoAction.help(plugin)) - .enabledWhen(ctx -> - isInstance(ctx, TargetSteppable.class) && isStopped(ctx)) - .popupWhen(ctx -> - isInstance(ctx, TargetSteppable.class) && isStopped(ctx)) - .onAction(ctx -> performStepInto(ctx)) - .enabled(false) - .buildAndInstallLocal(this); - - groupTargetIndex++; - - new ActionBuilder("Step Over", plugin.getName()) - .keyBinding("F10") - .toolBarGroup(DebuggerResources.GROUP_CONTROL, "C" + groupTargetIndex) - .toolBarIcon(AbstractStepOverAction.ICON) - .popupMenuPath("&Step Over") - .popupMenuGroup(DebuggerResources.GROUP_CONTROL, "C" + groupTargetIndex) - .popupMenuIcon(AbstractStepOverAction.ICON) - .helpLocation(AbstractStepOverAction.help(plugin)) - //.withContext(ObjectActionContext.class) - .enabledWhen(ctx -> - isInstance(ctx, TargetSteppable.class) && isStopped(ctx)) - .popupWhen(ctx -> - isInstance(ctx, TargetSteppable.class) && isStopped(ctx)) - .onAction(ctx -> performStepOver(ctx)) - .enabled(false) - .buildAndInstallLocal(this); - - groupTargetIndex++; - - new ActionBuilder("Finish", plugin.getName()) - .keyBinding("F12") - .toolBarGroup(DebuggerResources.GROUP_CONTROL, "C" + groupTargetIndex) - .toolBarIcon(AbstractStepFinishAction.ICON) - .popupMenuPath("&Finish") - .popupMenuGroup(DebuggerResources.GROUP_CONTROL, "C" + groupTargetIndex) - .popupMenuIcon(AbstractStepFinishAction.ICON) - .helpLocation(AbstractStepFinishAction.help(plugin)) - //.withContext(ObjectActionContext.class) - .enabledWhen(ctx -> - isInstance(ctx, TargetSteppable.class) && isStopped(ctx)) - .popupWhen(ctx -> - isInstance(ctx, TargetSteppable.class) && isStopped(ctx)) - .onAction(ctx -> performStepFinish(ctx)) - .enabled(false) - .buildAndInstallLocal(this); - - groupTargetIndex++; - - new ActionBuilder("Step Last", plugin.getName()) - .keyBinding("ALT F8") - .toolBarGroup(DebuggerResources.GROUP_CONTROL, "C" + groupTargetIndex) - .toolBarIcon(AbstractStepLastAction.ICON) - .popupMenuPath("&Step Last") - .popupMenuGroup(DebuggerResources.GROUP_CONTROL, "C" + groupTargetIndex) - .popupMenuIcon(AbstractStepLastAction.ICON) - .helpLocation(AbstractStepLastAction.help(plugin)) - //.withContext(ObjectActionContext.class) - .enabledWhen(ctx -> - isInstance(ctx, TargetSteppable.class) && isStopped(ctx)) - .popupWhen(ctx -> - isInstance(ctx, TargetSteppable.class) && isStopped(ctx)) - .onAction(ctx -> performStepLast(ctx)) - .enabled(false) - .buildAndInstallLocal(this); - - groupTargetIndex++; - - actionAddBreakpoint = new ActionBuilder("Add Breakpoint", plugin.getName()) - .keyBinding("F3") - .toolBarGroup(DebuggerResources.GROUP_CONTROL, "C" + groupTargetIndex) - .toolBarIcon(AbstractSetBreakpointAction.ICON) - .popupMenuPath("&Add Breakpoint") - .popupMenuGroup(DebuggerResources.GROUP_CONTROL, "C" + groupTargetIndex) - .popupMenuIcon(AbstractSetBreakpointAction.ICON) - .helpLocation(AbstractSetBreakpointAction.help(plugin)) - //.withContext(ObjectActionContext.class) - .enabledWhen(ctx -> - isInstance(ctx, TargetBreakpointSpecContainer.class) && isStopped(ctx)) - .popupWhen(ctx -> - isInstance(ctx, TargetBreakpointSpecContainer.class) && isStopped(ctx)) - .onAction(ctx -> performSetBreakpoint(ctx)) - .enabled(false) - .buildAndInstallLocal(this); - - groupTargetIndex = 0; - - new ActionBuilder("Show Console", plugin.getName()) - //.keyBinding("pause") - .toolBarGroup(DebuggerResources.GROUP_CONNECTION, "X" + groupTargetIndex) - .toolBarIcon(AbstractConsoleAction.ICON) - .popupMenuPath("&Show Console") - .popupMenuGroup(DebuggerResources.GROUP_CONNECTION, "X" + groupTargetIndex) - .popupMenuIcon(AbstractConsoleAction.ICON) - .helpLocation(AbstractConsoleAction.help(plugin)) - //.withContext(ObjectActionContext.class) - .enabledWhen(ctx -> isInstance(ctx, TargetInterpreter.class)) - .popupWhen(ctx -> isInstance(ctx, TargetInterpreter.class)) - .onAction(ctx -> initiateConsole(ctx)) - .enabled(false) - .buildAndInstallLocal(this); - - groupTargetIndex++; - - new ActionBuilder("Toggle", plugin.getName()) - .keyBinding("T") - .toolBarGroup(DebuggerResources.GROUP_CONTROL, "X" + groupTargetIndex) - .popupMenuPath("&Toggle") - .popupMenuGroup(DebuggerResources.GROUP_CONTROL, "X" + groupTargetIndex) - .helpLocation(AbstractToggleAction.help(plugin)) - .enabledWhen(ctx -> isInstance(ctx, TargetTogglable.class)) - .popupWhen(ctx -> isInstance(ctx, TargetTogglable.class)) - .onAction(ctx -> performToggle(ctx)) - .enabled(false) - .buildAndInstallLocal(this); - - groupTargetIndex++; - - new ActionBuilder("Configure", plugin.getName()) - .keyBinding("C") - .toolBarGroup(DebuggerResources.GROUP_CONTROL, "X" + groupTargetIndex) - .popupMenuPath("&Configure") - .popupMenuGroup(DebuggerResources.GROUP_CONTROL, "X" + groupTargetIndex) - .helpLocation(AbstractToggleAction.help(plugin)) - .enabledWhen(ctx -> isInstance(ctx, TargetConfigurable.class)) - .popupWhen(ctx -> isInstance(ctx, TargetConfigurable.class)) - .onAction(ctx -> performConfigure(ctx)) - .enabled(false) - .buildAndInstallLocal(this); - - groupTargetIndex++; - - new ActionBuilder("GoTo", plugin.getName()) - .keyBinding("G") - .toolBarGroup(DebuggerResources.GROUP_CONTROL, "X" + groupTargetIndex) - .popupMenuPath("&GoTo") - .popupMenuGroup(DebuggerResources.GROUP_CONTROL, "X" + groupTargetIndex) - .helpLocation(AbstractToggleAction.help(plugin)) - .enabledWhen(ctx -> isInstance(ctx, TargetObject.class)) - .popupWhen(ctx -> isInstance(ctx, TargetObject.class)) - .onAction(ctx -> performNavigate(ctx)) - .enabled(false) - .buildAndInstallLocal(this); - - groupTargetIndex++; - - - displayAsTreeAction = new DisplayAsTreeAction(tool, plugin.getName(), this); - displayAsTableAction = new DisplayAsTableAction(tool, plugin.getName(), this); - displayAsGraphAction = new DisplayAsGraphAction(tool, plugin.getName(), this); - displayAsXMLAction = new DisplayAsXMLAction(tool, plugin.getName(), this); - - displayFilteredTreeAction = - new DisplayFilteredTreeAction(tool, plugin.getName(), this); - displayFilteredTableAction = - new DisplayFilteredTableAction(tool, plugin.getName(), this); - displayFilteredGraphAction = - new DisplayFilteredGraphAction(tool, plugin.getName(), this); - displayFilteredXMLAction = - new DisplayFilteredXMLAction(tool, plugin.getName(), this); - - displayMethodsAction = new DisplayMethodsAction(tool, plugin.getName(), this); - - exportAsXMLAction = new ExportAsXMLAction(tool, plugin.getName(), this); - exportAsFactsAction = new ExportAsFactsAction(tool, plugin.getName(), this); - importFromXMLAction = new ImportFromXMLAction(tool, plugin.getName(), this); - importFromFactsAction = new ImportFromFactsAction(tool, plugin.getName(), this); - openTraceAction = new OpenWinDbgTraceAction(tool, plugin.getName(), this); - setTimeoutAction = new SetTimeoutAction(tool, plugin.getName(), this); - } - - //@formatter:on - - public void performRefresh(ActionContext context) { - TargetObject current = getObjectFromContext(context); - if (current != null) { - current.resync(RefreshBehavior.REFRESH_ALWAYS, RefreshBehavior.REFRESH_ALWAYS); - refresh(current.getName()); - } - else { - TargetObject modelRoot = getModel().getModelRoot(); - if (modelRoot != null) { - modelRoot.resync(RefreshBehavior.REFRESH_ALWAYS, RefreshBehavior.REFRESH_ALWAYS); - } - refresh(); - } - } - - public void performToggleAutoupdate(ActionContext context) { - /* - TargetObject object = getObjectFromContext(context); - if (object instanceof DefaultTargetObject) { - Map attributes = object.listAttributes(); - Boolean autoupdate = (Boolean) attributes.get(AUTOUPDATE_ATTRIBUTE_NAME); - if (autoupdate == null) { - autoupdate = false; - } - @SuppressWarnings("unchecked") - DefaultTargetObject defobj = - (DefaultTargetObject) object; - defobj.changeAttributes(List.of(), Map.of(// - AUTOUPDATE_ATTRIBUTE_NAME, !autoupdate), // - "Refreshed"); - } - */ - } - - public void performToggleBase(ActionContext context) { - for (TargetConfigurable configurable : configurables) { - Object value = configurable.getCachedAttribute(TargetConfigurable.BASE_ATTRIBUTE_NAME); - if (value != null) { - Integer base = (Integer) value; - base = base == 10 ? 16 : 10; - configurable.writeConfigurationOption(TargetConfigurable.BASE_ATTRIBUTE_NAME, base); - } - } - } - - public void performToggleSubscription(ActionContext context) { - Object contextObject = context.getContextObject(); - ObjectContainer container = getSelectedContainer(contextObject); - if (container.isSubscribed()) { - container.unsubscribe(); - } - else { - container.subscribe(); - } - } - - public void performToggleAutoRecord(ActionContext context) { - autoRecord = actionToggleAutoRecord.isSelected(); - } - - public void performToggleHideIntrinsics(ActionContext context) { - hideIntrinsics = actionToggleHideIntrinsics.isSelected(); - refresh(""); - } - - public void performToggleSelectionOnly(ActionContext context) { - selectionOnly = actionToggleSelectionOnly.isSelected(); - refresh(""); - } - - public void performToggleIgnoreState(ActionContext context) { - ignoreState = actionToggleIgnoreState.isSelected(); - refresh(""); - } - - public void performToggleUpdateWhileRunning(ActionContext context) { - updateWhileRunning = actionToggleUpdateWhileRunning.isSelected(); - refresh(""); - } - - /* - public void performToggleAutoPopulateContainers(ActionContext context) { - suppressDescent = !actionSuppressDescent.isSelected(); - if (currentModel != null) { - currentModel.setSuppressDescent(suppressDescent); - } - refresh(""); - } - */ - - protected void performAction(ActionContext context, - boolean fallbackRoot, Class cls, Function> func, - String errorMsg) { - TargetObject obj = getObjectFromContext(context); - if (obj == null && fallbackRoot) { - obj = root.getTargetObject(); - } - if (!isLocalOnly()) { - DebugModelConventions.findSuitable(cls, obj).thenCompose(t -> { - return func.apply(t); - }).exceptionally(DebuggerResources.showError(getComponent(), errorMsg)); - } - else { - T t = cls.cast(obj); - func.apply(t).exceptionally(DebuggerResources.showError(getComponent(), errorMsg)); - } - } - - public void performQuickLaunch(ActionContext context) { - if (currentProgram == null) { - return; - } - performLaunchAction(context, false); - } - - public void performLaunch(ActionContext context) { - performLaunchAction(context, true); - } - - private void performLaunchAction(ActionContext context, boolean p) { - performAction(context, true, TargetLauncher.class, launcher -> { - var locals = new Object() { - boolean prompt = p; - }; - return AsyncUtils.loop(TypeSpec.VOID, (loop) -> { - Map> args = launchOffer.getLauncherArgs(launcher, locals.prompt); - if (args == null) { - // Cancelled - loop.exit(); - } - else { - Map a = ValStr.toPlainMap(args); - launcher.launch(a).thenAccept(loop::exit).exceptionally(ex -> { - loop.repeat(); - return null; - }); - } - locals.prompt = true; - }); - }, "Couldn't launch"); - } - - public void performAttach(ActionContext context) { - TargetObject obj = getObjectFromContext(context); - performAction(context, false, TargetAttacher.class, attacher -> { - attachDialog.setAttacher(attacher); - if (obj instanceof TargetAttachable) { - return attacher.attach((TargetAttachable) obj); - } - attachDialog.fetchAndDisplayAttachable(); - tool.showDialog(attachDialog); - return AsyncUtils.nil(); - }, "Couldn't attach"); - } - - public void performReattach(ActionContext context) { - TargetObject obj = getObjectFromContext(context); - if (!(obj instanceof TargetAttachable)) { - return; - } - // NB. This doesn't really mean anything in local-only actions mode - DebugModelConventions.findSuitable(TargetAttacher.class, obj).thenCompose(attacher -> { - return attacher.attach((TargetAttachable) obj); - }).exceptionally(DebuggerResources.showError(getComponent(), "Couldn't re-attach")); - } - - public void performMethod(ActionContext context) { - TargetObject obj = getObjectFromContext(context); - List list = new ArrayList<>(); - Map attributes = obj.getCachedAttributes(); - for (Entry entry : attributes.entrySet()) { - if (entry.getValue() instanceof TargetMethod) { - list.add(entry.getKey()); - } - } - String choice = OptionDialog.showInputChoiceDialog(getComponent(), "Methods", "Methods", - list.toArray(new String[] {}), lastMethod, OptionDialog.QUESTION_MESSAGE); - if (choice != null) { - TargetMethod method = (TargetMethod) attributes.get(choice); - TargetParameterMap parameters = method.getParameters(); - if (parameters.isEmpty()) { - method.invoke(new HashMap()); - if (!choice.equals("unload")) { - lastMethod = choice; - } - return; - } - Map args = methodDialog.promptArguments(parameters, Map.of(), Map.of()); - if (args != null) { - String script = (String) args.get("Script"); - if (script != null && !script.isEmpty()) { - mapScript(args); - } - method.invoke(args); - if (!choice.equals("unload")) { - lastMethod = choice; - } - } - } - } - - private void mapScript(Map args) { - String name = (String) args.get("Name"); - String scriptName = (String) args.get("Script"); - if (name.isEmpty() || scriptName.isEmpty()) { - return; - } - - ResourceFile sourceFile = GhidraScriptUtil.findScriptByName(scriptName); - if (sourceFile == null) { - Msg.error(this, "Couldn't find script"); - return; - } - GhidraScriptProvider provider = GhidraScriptUtil.getProvider(sourceFile); - if (provider == null) { - Msg.error(this, "Couldn't find script provider"); - return; - } - - PrintWriter writer = consoleService.getStdOut(); - GhidraScript script; - try { - script = provider.getScriptInstance(sourceFile, writer); - } - catch (GhidraScriptLoadException e) { - Msg.error(this, e.getMessage()); - return; - } - scripts.put(name, script); - scriptNames.put(name, scriptName); - } - - private void fireScript(String key, String[] args) { - GhidraScript script = scripts.get(key); - String scriptName = scriptNames.get(key); - if (script == null || scriptName == null) { - return; - } - - Project project = tool.getProject(); - - ProgramLocation currentLocation = listingService.getCurrentLocation(); - ProgramSelection currentSelection = listingService.getCurrentSelection(); - - GhidraState state = - new GhidraState(tool, project, currentProgram, currentLocation, currentSelection, null); - - PrintWriter writer = consoleService.getStdOut(); - TaskMonitor monitor = TaskMonitor.DUMMY; - script.set(state, monitor, writer); - - try { - script.runScript(scriptName, args); - } - catch (Exception e) { - e.printStackTrace(); - } - } - - public void startRecording(TargetObject targetObject, boolean prompt) { - TraceRecorder rec = modelService.getRecorder(targetObject); - if (rec != null) { - return; // Already being recorded - } - if (prompt) { - rec = modelService.recordTargetPromptOffers(targetObject); - } - else { - rec = modelService.recordTargetBestOffer(targetObject); - } - if (rec == null) { - return; // Cancelled - } - //this.recorder = rec; - Trace trace = rec.getTrace(); - traceManager.openTrace(trace); - traceManager.activate(traceManager.resolveTrace(trace), ActivationCause.START_RECORDING); - } - - public void stopRecording(TargetObject targetObject) { - // TODO: Do `this.recorder = ...` on every object selection change? - TraceRecorder rec = modelService.getRecorderForSuccessor(targetObject); - if (rec != null) { - rec.stopRecording(); - } - } - - public void performDetach(ActionContext context) { - performAction(context, false, TargetDetachable.class, TargetDetachable::detach, - "Couldn't detach"); - } - - public void performKill(ActionContext context) { - performAction(context, false, TargetKillable.class, TargetKillable::kill, "Couldn't kill"); - } - - public void performStartRecording(ActionContext context) { - TargetObject maybeRoot = getObjectFromContext(context); - if (maybeRoot.isRoot()) { - startRecording(maybeRoot, true); - return; - } - performAction(context, false, TargetProcess.class, proc -> { - TargetProcess valid = DebugModelConventions.liveProcessOrNull(proc); - if (valid != null) { - startRecording(valid, true); - } - return AsyncUtils.nil(); - }, "Couldn't record"); - } - - public void performResume(ActionContext context) { - performAction(context, false, TargetResumable.class, TargetResumable::resume, - "Couldn't resume"); - } - - public void performInterrupt(ActionContext context) { - performAction(context, false, TargetInterruptible.class, TargetInterruptible::interrupt, - "Couldn't interrupt"); - } - - public void performStepInto(ActionContext context) { - performAction(context, false, TargetSteppable.class, TargetSteppable::step, - "Couldn't step into"); - } - - public void performStepOver(ActionContext context) { - performAction(context, false, TargetSteppable.class, s -> s.step(TargetStepKind.OVER), - "Couldn't step over"); - } - - public void performStepFinish(ActionContext context) { - performAction(context, false, TargetSteppable.class, s -> s.step(TargetStepKind.FINISH), - "Couldn't step finish"); - } - - public void performStepLast(ActionContext context) { - performAction(context, false, TargetSteppable.class, s -> { - if (extendedStep.equals("")) { - return s.step(TargetStepKind.EXTENDED); - } - return s.step(Map.of("Command", extendedStep)); - }, "Couldn't step extended(" + extendedStep + ")"); - } - - public void performSetBreakpoint(ActionContext context) { - setText(context); - performAction(context, false, TargetBreakpointSpecContainer.class, container -> { - breakpointDialog.setContainer(container); - tool.showDialog(breakpointDialog); - return AsyncUtils.nil(); - }, "Couldn't set breakpoint"); - } - - private void setText(ActionContext context) { - breakpointDialog.setText(""); - TargetObject obj = getObjectFromContext(context); - Object key = obj.getCachedAttribute(TargetBreakpointSpec.AS_BPT_ATTRIBUTE_NAME); - if (key != null) { - breakpointDialog.setText(key.toString()); - } - else { - if (obj instanceof DummyTargetObject) { - DummyTargetObject dto = (DummyTargetObject) obj; - breakpointDialog.setText(dto.getValue().toString()); - } - } - } - - public void performToggle(ActionContext context) { - performAction(context, false, TargetTogglable.class, t -> { - return t.toggle(!t.isEnabled()); - }, "Couldn't toggle"); - } - - public void performConfigure(ActionContext context) { - performAction(context, false, TargetConfigurable.class, configurable -> { - Map> configParameters = - configurable.getConfigurableOptions(); - if (configParameters.isEmpty()) { - return AsyncUtils.nil(); - } - Map args = - configDialog.promptArguments(configParameters, Map.of(), Map.of()); - if (args == null) { - // User cancelled - return AsyncUtils.nil(); - } - AsyncFence fence = new AsyncFence(); - for (Entry entry : args.entrySet()) { - fence.include( - configurable.writeConfigurationOption(entry.getKey(), entry.getValue())); - } - return fence.ready(); - }, "Couldn't configure one or more options"); - } - - public void performNavigate(ActionContext context) { - performAction(context, false, TargetObject.class, t -> { - if (t != null) { - navigateToSelectedObject(t, null); - } - return AsyncUtils.nil(); - }, "Couldn't navigate"); - } - - public void initiateConsole(ActionContext context) { - performAction(context, false, TargetInterpreter.class, interpreter -> { - getPlugin().showConsole(interpreter); - return AsyncUtils.nil(); - }, "Couldn't show interpreter"); - } - - public boolean isAccessConditioned(ActionContext context) { - TargetObject object = this.getObjectFromContext(context); - if (object == null) { - return false; - } - return object instanceof TargetAccessConditioned; - } - - public boolean isStopped(ActionContext context) { - TargetObject object = this.getObjectFromContext(context); - return isStopped(object); - } - - public boolean isStopped(TargetObject object) { - if (object == null) { - return false; - } - if (ignoreState) { - return true; - } - if (isLocalOnly()) { - if (object instanceof TargetExecutionStateful) { - TargetExecutionStateful stateful = (TargetExecutionStateful) object; - TargetExecutionState executionState = stateful.getExecutionState(); - //System.err.println(stateful + ":" + executionState); - return !executionState.equals(TargetExecutionState.RUNNING); - } - return false; - } - TargetObject result = null; - try { - result = DebugModelConventions.findSuitable(TargetExecutionStateful.class, object) - .get(100, TimeUnit.MILLISECONDS); - } - catch (Exception e) { - // IGNORE - } - if (result != null) { - TargetExecutionStateful stateful = (TargetExecutionStateful) result; - TargetExecutionState executionState = stateful.getExecutionState(); - return !executionState.equals(TargetExecutionState.RUNNING); - } - return false; - } - - class MyObjectListener extends AnnotatedDebuggerAttributeListener { - protected final DebuggerCallbackReorderer reorderer = new DebuggerCallbackReorderer(this); - protected final PrivatelyQueuedListener queue = - new PrivatelyQueuedListener<>(DebuggerModelListener.class, "ObjectsProvider-EventQueue", - reorderer); - - public MyObjectListener() { - super(MethodHandles.lookup()); - } - - @AttributeCallback(TargetAccessConditioned.ACCESSIBLE_ATTRIBUTE_NAME) - public void accessibilityChanged(TargetObject object, boolean accessible) { - //this.access = accessibility.equals(TargetAccessibility.ACCESSIBLE); - plugin.getTool().contextChanged(DebuggerObjectsProvider.this); - } - - @Override - public void consoleOutput(TargetObject console, Channel channel, byte[] bytes) { - String ret = new String(bytes); - if (ret.contains(TargetMethod.REDIRECT)) { - String[] split = ret.split(TargetMethod.REDIRECT); - String key = split[0]; - String val = split[1]; - GhidraScript script = scripts.get(key); - if (script != null) { - String[] args = new String[1]; - args[0] = val; - fireScript(key, args); - return; - } - } - System.err.println("consoleOutput: " + new String(ret)); - } - - @AttributeCallback(TargetObject.DISPLAY_ATTRIBUTE_NAME) - public void displayChanged(TargetObject object, String display) { - //System.err.println("displayChanged: " + display); - if (ObjectContainer.visibleByDefault(object.getName())) { - pane.signalDataChanged(getContainerByPath(object.getPath())); - } - } - - @AttributeCallback(TargetObject.MODIFIED_ATTRIBUTE_NAME) - public void modifiedChanged(TargetObject object, boolean modified) { - //System.err.println("modifiedChanged: " + display); - if (ObjectContainer.visibleByDefault(object.getName())) { - pane.signalDataChanged(getContainerByPath(object.getPath())); - } - } - - @AttributeCallback(TargetExecutionStateful.STATE_ATTRIBUTE_NAME) - public void executionStateChanged(TargetObject object, TargetExecutionState state) { - //this.state = state; - contextChanged(); - } - - @AttributeCallback(TargetFocusScope.FOCUS_ATTRIBUTE_NAME) - public void focusChanged(TargetObject object, TargetObject focused) { - plugin.setFocus(object, focused); - contextChanged(); - } - - @Override - public void memoryUpdated(TargetObject memory, Address address, byte[] data) { - //System.err.println("memoryUpdated"); - } - - @Override - public void memoryReadError(TargetObject memory, AddressRange range, - DebuggerMemoryAccessException e) { - System.err.println("memoryReadError"); - } - - @AttributeCallback(TargetInterpreter.PROMPT_ATTRIBUTE_NAME) - public void promptChanged(TargetObject interpreter, String prompt) { - //System.err.println("promptChanged: " + prompt); - } - - @Override - public void registersUpdated(TargetObject bank, Map updates) { - Map cachedElements = bank.getCachedElements(); - for (String key : cachedElements.keySet()) { - TargetObject ref = cachedElements.get(key); - displayChanged(ref, "registersUpdated"); - } - Map cachedAttributes = bank.getCachedAttributes(); - for (String key : cachedAttributes.keySet()) { - Object obj = cachedAttributes.get(key); - if (obj instanceof TargetObject) { - displayChanged((TargetObject) obj, "registersUpdated"); - } - } - } - - @Override - public void elementsChanged(TargetObject parent, Collection removed, - Map added) { - //System.err.println("local EC: " + parent); - ObjectContainer container = - parent == null ? null : getContainerByPath(parent.getPath()); - if (container != null) { - container.augmentElements(removed, added); - boolean visibleChange = false; - for (String key : removed) { - visibleChange |= ObjectContainer.visibleByDefault(key); - } - for (String key : added.keySet()) { - visibleChange |= ObjectContainer.visibleByDefault(key); - } - if (visibleChange) { - container.propagateProvider(DebuggerObjectsProvider.this); - update(container); - getComponent().repaint(); - } - } - } - - @Override - public void attributesChanged(TargetObject parent, Collection removed, - Map added) { - super.attributesChanged(parent, removed, added); - //System.err.println("local AC: " + parent + ":" + removed + ":" + added); - ObjectContainer container = - parent == null ? null : getContainerByPath(parent.getPath()); - if (container != null) { - container.augmentAttributes(removed, added); - boolean visibleChange = false; - for (String key : removed) { - visibleChange |= ObjectContainer.visibleByDefault(key); - } - for (String key : added.keySet()) { - visibleChange |= ObjectContainer.visibleByDefault(key); - } - if (visibleChange) { - container.propagateProvider(DebuggerObjectsProvider.this); - update(container); - getComponent().repaint(); - } - } - if (parent != null && isAutorecord() && - parent.getCachedAttribute(TargetExecutionStateful.STATE_ATTRIBUTE_NAME) != null) { - TargetProcess proc = DebugModelConventions.liveProcessOrNull(parent); - if (proc != null) { - startRecording(proc, false); - } - } - } - } - - public void setFocus(TargetObject object, TargetObject focused) { - if (focused.getModel() != currentModel) { - return; - } - this.targetFocus = focused; - if (isStopped(focused) || isUpdateWhileRunning()) { - if (pane != null) { - pane.setFocus(object, focused); - } - } - } - - public DebuggerTraceManagerService getTraceManager() { - return traceManager; - } - - public boolean isHideIntrinsics() { - return hideIntrinsics; - } - - public void setHideIntrinsics(boolean hideIntrinsics) { - this.hideIntrinsics = hideIntrinsics; - } - - public boolean isLocalOnly() { - return selectionOnly; - } - - public void setLocalOnly(boolean localOnly) { - this.selectionOnly = localOnly; - } - - public boolean isAutorecord() { - return autoRecord; - } - - public void setAutorecord(boolean autorecord) { - this.autoRecord = autorecord; - } - - public int getNodeTimeout() { - return nodeTimeout; - } - - public void setNodeTimeout(int timeout) { - this.nodeTimeout = timeout; - } - - public void updateActions(ObjectContainer providerContainer) { - TargetObject obj = getSelectedObject(); - if (obj != null) { - actionToggleSubscribe.setEnabled(true); - actionToggleSubscribe.setSelected(providerContainer.isSubscribed()); - MenuData menuData = actionToggleSubscribe.getMenuBarData(); - if (menuData != null) { - menuData.setMenuPath(new String[] { "Subscribe to '" + obj.getDisplay() + "'" }); - } - } - else { - actionToggleSubscribe.setEnabled(false); - actionToggleSubscribe.setSelected(false); - MenuData menuData = actionToggleSubscribe.getMenuBarData(); - if (menuData != null) { - menuData.setMenuPath(new String[] { "Subscribe" }); - } - } - } - - public void writeConfigState(SaveState saveState) { - CONFIG_STATE_HANDLER.writeConfigState(this, saveState); - methodDialog.writeConfigState(saveState); - } - - public void readConfigState(SaveState saveState) { - CONFIG_STATE_HANDLER.readConfigState(this, saveState); - - actionToggleAutoRecord.setSelected(autoRecord); - actionToggleHideIntrinsics.setSelected(hideIntrinsics); - actionToggleSelectionOnly.setSelected(selectionOnly); - setTimeoutAction.setNodeTimeout(nodeTimeout); - - methodDialog.readConfigState(saveState); - } - - @Override - public void componentActivated() { - if (currentTrace != null && !this.isActive()) { - traceManager.activateTrace(currentTrace); - } - } - - public DebuggerModelService getModelService() { - return modelService; - } - - public DebuggerListingService getListingService() { - return listingService; - } - - public DebuggerModelListener getListener() { - return listener.queue.in; - } - - public Address navigateToSelectedObject(TargetObject object, Object value) { - if (listingService == null || modelService == null) { - return null; - } - // TODO: Could probably inspect schema for any attribute of type Address[Range], or String - if (value == null) { - value = object.getCachedAttribute(TargetObject.PREFIX_INVISIBLE + "address"); - } - if (value == null) { - value = object.getCachedAttribute(TargetObject.PREFIX_INVISIBLE + "range"); - } - if (value == null) { - value = object.getCachedAttribute(TargetObject.VALUE_ATTRIBUTE_NAME); - } - if (value == null) { - return null; - } - - Address addr = null; - if (value instanceof Address a) { - addr = a; - } - else if (value instanceof AddressRange range) { - addr = range.getMinAddress(); - } - else if (value instanceof Long lval) { - addr = object.getModel().getAddress("ram", lval); - } - else if (value instanceof String sval) { - addr = stringToAddress(object, addr, sval); - } - if (addr != null) { - TraceRecorder recorder = modelService.getRecorderForSuccessor(object); - if (recorder == null) { - recorder = modelService.getRecorder(currentTrace); - if (recorder == null) { - return addr; - } - } - DebuggerMemoryMapper memoryMapper = recorder.getMemoryMapper(); - Address traceAddr = memoryMapper.targetToTrace(addr); - listingService.goTo(traceAddr, true); - } - return addr; - } - - private Address stringToAddress(TargetObject selectedObject, Address addr, String sval) { - Integer base = 16; - if (selectedObject instanceof TargetConfigurable) { - TargetConfigurable configurable = (TargetConfigurable) selectedObject; - base = - (Integer) configurable.getCachedAttribute(TargetConfigurable.BASE_ATTRIBUTE_NAME); - } - try { - Long lval = Long.parseLong(sval, base); - addr = selectedObject.getModel().getAddress("ram", lval); - } - catch (NumberFormatException nfe) { - // IGNORE - } - return addr; - } - - public boolean isUpdateWhileRunning() { - return updateWhileRunning; - } - - public TargetObject getFocus() { - return targetFocus; - } -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/ObjectContainer.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/ObjectContainer.java deleted file mode 100644 index 3aa607d689..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/ObjectContainer.java +++ /dev/null @@ -1,593 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.objects; - -import java.util.*; -import java.util.Map.Entry; -import java.util.concurrent.CompletableFuture; - -import org.jdom.Element; - -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.util.PathUtils; -import ghidra.util.xml.XmlUtilities; - -public class ObjectContainer implements Comparable { - - private DebuggerObjectsProvider provider; - protected TargetObject targetObject; - private final Map elementMap = new LinkedHashMap<>(); - private final Map attributeMap = new LinkedHashMap<>(); - private Set currentChildren = new TreeSet<>(); - - private boolean immutable; - private boolean visible = true; - private boolean isSubscribed = false; - private boolean isLink = false; - private boolean useSort = true; - private String treePath; - public String linkKey; - - public ObjectContainer(TargetObject to, String linkKey) { - this.linkKey = linkKey; - this.isLink = linkKey != null; - if (to != null) { - targetObject = to; - if (!isLink) { - rebuildContainers(targetObject.getCachedElements(), - targetObject.getCachedAttributes()); - } - visible = visibleByDefault(getName()); - } - } - - public static boolean visibleByDefault(String key) { - return key == null || !PathUtils.isHidden(key); - } - - public static ObjectContainer clone(ObjectContainer container) { - ObjectContainer nc = new ObjectContainer(container.getTargetObject(), container.linkKey); - nc.rebuildContainers(container.getElementMap(), container.getAttributeMap()); - nc.propagateProvider(container.getProvider()); - return nc; - } - - public void updateUsing(ObjectContainer container) { - attributeMap.clear(); - attributeMap.putAll(container.getAttributeMap()); - elementMap.clear(); - elementMap.putAll(container.getElementMap()); - targetObject = container.targetObject; - } - - public boolean hasElements() { - return !elementMap.isEmpty(); - } - - public String getName() { - if (targetObject == null) { - return "Objects"; - } - if (isLink) { - return linkKey; - } - boolean noTarget = targetObject == null; - String name = noTarget ? targetObject.getName() : targetObject.getName(); - String hint = noTarget ? null : targetObject.getTypeHint(); - if (name == null) { - return hint; - } - return name; - } - - public String getDecoratedName() { - if (targetObject == null) { - return "Objects"; - } - if (isLink) { - String refname = targetObject.getName(); - if (linkKey.equals(refname)) { - return "->" + linkKey; - } - return linkKey + ":" + refname; - } - String name = targetObject.getName(); - if (targetObject.getCachedAttributes().containsKey(TargetObject.DISPLAY_ATTRIBUTE_NAME)) { - if (name != null) { - return targetObject.getDisplay(); - } - } - String hint = targetObject.getTypeHint(); - return (name == null) ? hint : name; - } - - public String getPrefixedName() { - if (targetObject == null) { - return "Objects"; - } - List path = targetObject.getPath(); - int index = path.size() - 1; - if (index < 0) { - return targetObject.getName(); - } - String parent = path.get(index); - if (parent.contains("(")) { - while (parent.contains("(")) { - parent = path.get(--index); - } - String initVal = path.get(path.size() - 1); - return parent + initVal.substring(initVal.indexOf(")") + 1); - } - return parent; - } - - public String getShortName() { - if (targetObject == null) { - return "Objects"; - } - return targetObject == null ? targetObject.getName() : targetObject.getName(); - } - - public ObjectContainer getParent() { - return provider.getParent(this); - } - - /* - * For all of what follow, you want to preserve the following pattern: - * rebuildContainers - * propagateProvider(p) - * p.update - */ - - public CompletableFuture getOffspring(RefreshBehavior refresh) { - if (targetObject == null) { - return CompletableFuture.completedFuture(null); - } - return targetObject.resync(refresh, refresh).thenApplyAsync(__ -> { - rebuildContainers(targetObject.getCachedElements(), targetObject.getCachedAttributes()); - propagateProvider(provider); - return this; - }); - } - - /* - protected void checkAutoRecord() { - if (targetObject != null && provider.isAutorecord()) { - TargetProcess proc = DebugModelConventions.liveProcessOrNull(targetObject); - if (proc != null) { - provider.startRecording(proc, false); - } - } - } - */ - - public void augmentElements(Collection elementsRemoved, - Map elementsAdded) { - Set result = new TreeSet(); - Map newAdds = new HashMap<>(); - for (Entry entry : elementsAdded.entrySet()) { - newAdds.put(entry.getKey(), entry.getValue()); - } - boolean structureChanged = false; - synchronized (elementMap) { - for (ObjectContainer child : currentChildren) { - String key = child.getName(); - if (key.startsWith("[")) { - key = key.substring(1, key.length() - 1); - } - if (elementsRemoved.contains(key) && !elementsAdded.containsKey(key)) { - elementMap.remove(key); - structureChanged = true; - continue; - } - if (elementsAdded.containsKey(key)) { - Object val = elementsAdded.get(key); - ObjectContainer newChild = - DebuggerObjectsProvider.buildContainerFromObject(targetObject, key, val, - true); - child.updateUsing(newChild); - newAdds.remove(key); - provider.signalDataChanged(child); - } - result.add(child); - } - for (String key : elementsAdded.keySet()) { - TargetObject val = elementsAdded.get(key); - ObjectContainer child = - DebuggerObjectsProvider.buildContainerFromObject(targetObject, key, val, false); - elementMap.put(key, val); - result.add(child); - structureChanged = true; - } - } - currentChildren = result; - if (structureChanged) { - provider.signalContentsChanged(this); - } - provider.fireObjectUpdated(this); - //provider.update(this); - } - - public void augmentAttributes(Collection attributesRemoved, - Map attributesAdded) { - Set result = new TreeSet(); - Map newAdds = new HashMap<>(); - for (Entry entry : attributesAdded.entrySet()) { - newAdds.put(entry.getKey(), entry.getValue()); - } - boolean structureChanged = false; - synchronized (attributeMap) { - for (ObjectContainer child : currentChildren) { - String key = child.getName(); - if (attributesRemoved.contains(key) && !attributesAdded.containsKey(key)) { - attributeMap.remove(key); - structureChanged = true; - continue; - } - if (attributesAdded.containsKey(key)) { - Object val = attributesAdded.get(key); - ObjectContainer newChild = - DebuggerObjectsProvider.buildContainerFromObject(targetObject, key, val, - true); - child.updateUsing(newChild); - newAdds.remove(key); - provider.signalDataChanged(child); - } - result.add(child); - } - for (String key : newAdds.keySet()) { - Object val = newAdds.get(key); - ObjectContainer child = - DebuggerObjectsProvider.buildContainerFromObject(targetObject, key, val, true); - if (child != null) { - attributeMap.put(key, val); - result.add(child); - structureChanged = true; - } - } - } - currentChildren = result; - if (structureChanged) { - provider.signalContentsChanged(this); - } - provider.fireObjectUpdated(this); - //provider.update(this); - } - - public void rebuildContainers(Map elements, - Map attributes) { - synchronized (elementMap) { - elementMap.clear(); - if (elements != null) { - elementMap.putAll(elements); - } - } - synchronized (attributeMap) { - attributeMap.clear(); - if (attributes != null) { - attributeMap.putAll(attributes); - } - } - - Set result = new TreeSet(); - List nodeFromElements = - DebuggerObjectsProvider.getContainersFromObjects(elementMap, targetObject, false); - result.addAll(nodeFromElements); - - List nodeFromAttributes = - DebuggerObjectsProvider.getContainersFromObjects(attributeMap, targetObject, true); - result.addAll(nodeFromAttributes); - - currentChildren = result; - } - - public Set getCurrentChildren() { - return currentChildren; - } - - public void setCurrentChildren(Set children) { - currentChildren = children; - } - - public Map updateMap(Map map, List removed, - Map added) { - if (removed != null) { - for (String key : removed) { - map.remove(key); - } - } - if (added != null) { - for (String key : added.keySet()) { - Object object = added.get(key); - map.put(key, object); - } - } - return map; - } - - public Map getAttributeMap() { - return attributeMap; - } - - public Map getElementMap() { - return elementMap; - } - - public TargetObject getTargetObject() { - return targetObject; - } - - public ObjectContainer getSubContainer(TargetObject object) { - for (ObjectContainer c1 : currentChildren) { - if (c1.getTargetObject().equals(object)) { - return c1; - } - for (ObjectContainer c2 : c1.getCurrentChildren()) { - if (c2.getTargetObject().equals(object)) { - return c2; - } - } - } - return null; - } - - public DebuggerObjectsProvider getProvider() { - return provider; - } - - public void propagateProvider(DebuggerObjectsProvider newProvider) { - if (newProvider == null) { - throw new RuntimeException("Provider reset to null"); - } - if (!newProvider.equals(provider)) { - this.provider = newProvider; - provider.addTargetToMap(this); - } - for (ObjectContainer c : currentChildren) { - c.propagateProvider(provider); - } - provider.fireObjectUpdated(this); - //checkAutoRecord(); - } - - // This should only be called once when the connection is activated - public void setTargetObject(TargetObject rootObject) { - this.targetObject = rootObject; - rebuildContainers(rootObject.getCachedElements(), rootObject.getCachedAttributes()); - if (provider != null) { - provider.addTargetToMap(this); - provider.update(this); - } - } - - /** - * Converts this object into XML - * - * @return new jdom {@link Element} - */ - public Element toXml() { - String name = getPrefixedName(); - name = name.replaceAll(" ", "_"); - if (name.contains("[")) { - name = name.replaceAll("\\[", "_"); - name = name.replaceAll("\\]", ""); - name = name.replaceAll("/", "_"); - } - Element result = new Element(name); - for (ObjectContainer child : getCurrentChildren()) { - String key = child.getShortName(); - if (elementMap.containsKey(key)) { - result.addContent(child.toXml()); - } - else { - result.addContent(child.toXml()); - } - } - if (targetObject != null) { - if (!targetObject.getTypeHint().equals("")) { - XmlUtilities.setStringAttr(result, "Type", targetObject.getTypeHint()); - } - if (!targetObject.getDisplay().equals("")) { - XmlUtilities.setStringAttr(result, "Value", targetObject.getDisplay()); - } - } - - return result; - } - - /* - public void toXmlSchema(Element root) { - Element element = this.toXmlSchema(); - root.addContent(element); - - for (ObjectContainer child : getCurrentChildren()) { - String key = child.getShortName(); - if (attributeMap.containsKey(key)) { - if (!(child.targetObject instanceof DummyTargetObject)) { - child.toXmlSchema(root); - } - } - } - for (ObjectContainer child : getCurrentChildren()) { - if (elementMap.containsValue(child.targetObject)) { - child.toXmlSchema(root); - break; - } - } - } - - public Element toXmlSchema() { - String name = getPrefixedName(); - if (name == null) { - name = provider.getRoot().getName(); - } - name = sanitize(name); - Element result = new Element("schema"); - XmlUtilities.setStringAttr(result, "name", name); - for (ObjectContainer child : getCurrentChildren()) { - String key = child.getShortName(); - if (attributeMap.containsKey(key)) { - Element n = new Element("attribute"); - String typeHint = null; - if (child.targetObject != null) { - typeHint = child.targetObject.getTypeHint(); - } - XmlUtilities.setStringAttr(n, "name", key); - if (typeHint != null) { - XmlUtilities.setStringAttr(n, "schema", typeHint); - } - if (key.startsWith("_")) { - XmlUtilities.setStringAttr(n, "hidden", "yes"); - } - result.addContent(n); - } - } - if (elementMap.isEmpty()) { - Element n = new Element("element"); - XmlUtilities.setStringAttr(n, "schema", "VOID"); - result.addContent(n); - } - else { - for (ObjectContainer child : getCurrentChildren()) { - if (elementMap.containsValue(child.targetObject)) { - Element n = new Element("element"); - String typeHint = null; - if (child.targetObject != null) { - typeHint = child.targetObject.getTypeHint(); - } - XmlUtilities.setStringAttr(n, "name", child.getName()); - if (typeHint != null) { - Element ifc = new Element("interface"); - try { - XmlUtilities.setStringAttr(n, "name", sanitize(typeHint)); - } - catch (Exception e) { - //do nothing - } - result.addContent(ifc); - } - result.addContent(n); - break; - } - } - } - Element n = new Element("attribute"); - XmlUtilities.setStringAttr(n, "schema", "VOID"); - result.addContent(n); - return result; - } - - private String sanitize(String name) { - name = name.replaceAll(" ", "_"); - name = name.replaceAll("/", "_"); - if (name.contains("[")) { - name = name.replaceAll("\\[", "_"); - name = name.replaceAll("\\]", ""); - name = name.replaceAll("/", "_"); - } - return name; - } - */ - - public boolean isImmutable() { - return immutable; - } - - public void setImmutable(boolean immutable) { - this.immutable = immutable; - } - - public boolean isVisible() { - return visible; - } - - public void setVisible(boolean visible) { - this.visible = visible; - } - - @Override - public String toString() { - return targetObject == null ? super.toString() : targetObject.toString(); - } - - public boolean isSubscribed() { - return isSubscribed; - } - - public void subscribe() { - isSubscribed = true; - } - - public void unsubscribe() { - isSubscribed = false; - } - - public boolean isModified() { - Object object = targetObject == null ? null - : targetObject.getCachedAttributes().get(TargetObject.MODIFIED_ATTRIBUTE_NAME); - return object != null && ((Boolean) object); - } - - public boolean isLink() { - return isLink; - } - - public boolean isFocused() { - if (provider == null || targetObject == null) { - return false; - } - TargetObject focus = provider.getFocus(); - if (focus == null) { - return false; - } - return PathUtils.isAncestor(targetObject.getPath(), focus.getPath()); - } - - public String getOrder() { - Integer order = (Integer) attributeMap.get(TargetObject.ORDER_ATTRIBUTE_NAME); - return order == null ? getName() : Integer.toString(order); - } - - public boolean useSort() { - return useSort; - } - - public void setUseSort(boolean useSort) { - this.useSort = useSort; - } - - // NB: WOuld be nice if we could use the real treePath but our use case - // precede the node's actual placement in the tree - - public String getTreePath() { - return treePath; - } - - public void setTreePath(String treePath) { - this.treePath = treePath; - } - - @Override - public int compareTo(ObjectContainer that) { - String thisTreePath = this.toString(); - String thatTreePath = that.toString(); - if (thisTreePath != null && thatTreePath != null) { - return thisTreePath.compareTo(thatTreePath); - } - return this.hashCode() - that.hashCode(); - } -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/ObjectContainerListener.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/ObjectContainerListener.java deleted file mode 100644 index 6504006b4c..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/ObjectContainerListener.java +++ /dev/null @@ -1,22 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.objects; - -public interface ObjectContainerListener { - - void update(ObjectContainer objectPresentationContainer); - -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/ObjectUpdateService.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/ObjectUpdateService.java deleted file mode 100644 index 1de95b7c99..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/ObjectUpdateService.java +++ /dev/null @@ -1,29 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.objects; - -import ghidra.framework.plugintool.ServiceInfo; - -/** - * Service for notifying others of object tree state changes. - * - */ -@ServiceInfo(/* defaultProvider = NONE, */ description = "Object change notification") -public interface ObjectUpdateService { - - void fireObjectUpdated(ObjectContainer object); - -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/ObjectUpdatedEvent.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/ObjectUpdatedEvent.java deleted file mode 100644 index ed46661c3c..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/ObjectUpdatedEvent.java +++ /dev/null @@ -1,33 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.objects; - -import ghidra.framework.plugintool.PluginEvent; - -public class ObjectUpdatedEvent extends PluginEvent { - - private ObjectContainer object; - - public ObjectUpdatedEvent(ObjectContainer object) { - super(object.getName(), "update"); - this.object = object; - } - - public ObjectContainer getObject() { - return object; - } - -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayAsAction.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayAsAction.java deleted file mode 100644 index 0a970ef880..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayAsAction.java +++ /dev/null @@ -1,99 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.objects.actions; - -import static ghidra.async.AsyncUtils.sequence; - -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.atomic.AtomicReference; - -import javax.swing.SwingUtilities; - -import docking.ActionContext; -import docking.action.DockingAction; -import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider; -import ghidra.app.plugin.core.debug.gui.objects.ObjectContainer; -import ghidra.async.AsyncFence; -import ghidra.async.TypeSpec; -import ghidra.dbg.target.TargetObject; -import ghidra.framework.plugintool.PluginTool; - -public abstract class DisplayAsAction extends DockingAction { - - protected PluginTool tool; - protected DebuggerObjectsProvider provider; - protected boolean isTree = false; - - public DisplayAsAction(String name, PluginTool tool, String owner, - DebuggerObjectsProvider provider) { - super(name, owner); - this.tool = tool; - this.provider = provider; - } - - @Override - public boolean isEnabledForContext(ActionContext context) { - Object obj = context.getContextObject(); - ObjectContainer sel = provider.getSelectedContainer(obj); - return sel != null; - } - - @Override - public void actionPerformed(ActionContext context) { - Object contextObject = context.getContextObject(); - ObjectContainer container = provider.getSelectedContainer(contextObject); - if (container != null) { - doAction(container); - } - } - - protected abstract void doAction(ObjectContainer container); - - protected CompletableFuture getOffspring(ObjectContainer container) { - AtomicReference> elements = new AtomicReference<>(); - AtomicReference> attributes = new AtomicReference<>(); - return sequence(TypeSpec.VOID).then(seq -> { - AsyncFence fence = new AsyncFence(); - TargetObject to = container.getTargetObject(); - fence.include(to.fetchElements() - .thenAccept(elements::set)); - fence.include(to.fetchAttributes() - .thenAccept(attributes::set)); - fence.ready().handle(seq::next); - }).then(seq -> { - container.rebuildContainers(elements.get(), attributes.get()); - finishGetOffspring(container); - seq.exit(); - }).finish(); - } - - protected void finishGetOffspring(ObjectContainer container) { - SwingUtilities.invokeLater(() -> { - try { - DebuggerObjectsProvider p = new DebuggerObjectsProvider(provider.getPlugin(), - provider.getModel(), container, isTree); - container.propagateProvider(p); - p.update(container); - p.setFocus(null, provider.getFocus()); - } - catch (Exception e) { - e.printStackTrace(); - } - }); - } - -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayAsGraphAction.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayAsGraphAction.java deleted file mode 100644 index 6518ac2d9f..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayAsGraphAction.java +++ /dev/null @@ -1,99 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.objects.actions; - -import java.awt.event.InputEvent; -import java.awt.event.KeyEvent; -import java.util.*; - -import javax.swing.Icon; - -import docking.action.KeyBindingData; -import docking.action.MenuData; -import generic.theme.GIcon; -import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider; -import ghidra.app.plugin.core.debug.gui.objects.ObjectContainer; -import ghidra.app.services.GraphDisplayBroker; -import ghidra.framework.plugintool.PluginTool; -import ghidra.service.graph.*; -import ghidra.util.HelpLocation; -import ghidra.util.Msg; -import ghidra.util.exception.CancelledException; -import ghidra.util.exception.GraphException; -import ghidra.util.task.TaskMonitor; - -public class DisplayAsGraphAction extends DisplayAsAction { - - protected GraphDisplayBroker graphBroker; - - protected static final Icon ICON_GRAPH = new GIcon("icon.debugger.display.graph"); - - public DisplayAsGraphAction(PluginTool tool, String owner, DebuggerObjectsProvider provider) { - super("DisplayGraph", tool, owner, provider); - String[] path = new String[] { "Display as...", "Graph" }; - setPopupMenuData(new MenuData(path, ICON_GRAPH)); - setKeyBindingData(new KeyBindingData(KeyEvent.VK_G, InputEvent.CTRL_DOWN_MASK)); - setHelpLocation(new HelpLocation(owner, "display_as_graph")); - provider.addLocalAction(this); - } - - @Override - protected void doAction(ObjectContainer container) { - graphBroker = provider.getGraphBroker(); - if (graphBroker == null) { - Msg.showError(this, tool.getToolFrame(), "DisplayAsGraph Error", - "GraphBroker not found: Please add a graph provider to your tool"); - return; - } - addGraph(container); - } - - public void addGraph(ObjectContainer container) { - GraphDisplayProvider graphProvider = graphBroker.getDefaultGraphDisplayProvider(); - AttributedGraph graph = new AttributedGraph(container.getName(), new EmptyGraphType()); - AttributedVertex start = graph.addVertex(container.toString(), container.getName()); - graphContainer(container, graph, start); - try { - GraphDisplay graphDisplay = graphProvider.getGraphDisplay(true, TaskMonitor.DUMMY); - graphDisplay.setGraph(graph, container.getName(), false, TaskMonitor.DUMMY); - } - catch (GraphException e) { - e.printStackTrace(); - } - catch (CancelledException e) { - //DO NOTHING - } - } - - private void graphContainer(ObjectContainer container, AttributedGraph graph, - AttributedVertex start) { - Map starts = new HashMap<>(); - Set children = container.getCurrentChildren(); - for (ObjectContainer c : children) { - if (!c.isVisible()) { - continue; - } - AttributedVertex end = graph.addVertex(c.toString(), c.getName()); - graph.addEdge(start, end, start + ":" + end); - starts.put(c, end); - } - for (ObjectContainer c : starts.keySet()) { - AttributedVertex s = starts.get(c); - graphContainer(c, graph, s); - } - } - -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayAsTableAction.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayAsTableAction.java deleted file mode 100644 index 910100d011..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayAsTableAction.java +++ /dev/null @@ -1,47 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.objects.actions; - -import java.awt.event.InputEvent; -import java.awt.event.KeyEvent; - -import docking.action.KeyBindingData; -import docking.action.MenuData; -import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider; -import ghidra.app.plugin.core.debug.gui.objects.ObjectContainer; -import ghidra.app.plugin.core.debug.gui.objects.components.ObjectTable; -import ghidra.framework.plugintool.PluginTool; -import ghidra.util.HelpLocation; - -public class DisplayAsTableAction extends DisplayAsAction { - - public DisplayAsTableAction(PluginTool tool, String owner, DebuggerObjectsProvider provider) { - super("DisplayTable", tool, owner, provider); - String[] path = new String[] { "Display as...", "Table" }; - setPopupMenuData(new MenuData(path, ObjectTable.ICON_TABLE)); - setKeyBindingData(new KeyBindingData(KeyEvent.VK_T, InputEvent.CTRL_DOWN_MASK)); - setHelpLocation(new HelpLocation(owner, "display_as_table")); - provider.addLocalAction(this); - } - - @Override - protected void doAction(ObjectContainer container) { - ObjectContainer clone = ObjectContainer.clone(container); - finishGetOffspring(clone); - //getOffspring(clone); - } - -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayAsTreeAction.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayAsTreeAction.java deleted file mode 100644 index 323b55c90f..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayAsTreeAction.java +++ /dev/null @@ -1,48 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.objects.actions; - -import java.awt.event.InputEvent; -import java.awt.event.KeyEvent; - -import docking.action.KeyBindingData; -import docking.action.MenuData; -import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider; -import ghidra.app.plugin.core.debug.gui.objects.ObjectContainer; -import ghidra.app.plugin.core.debug.gui.objects.components.ObjectTree; -import ghidra.framework.plugintool.PluginTool; -import ghidra.util.HelpLocation; - -public class DisplayAsTreeAction extends DisplayAsAction { - - public DisplayAsTreeAction(PluginTool tool, String owner, DebuggerObjectsProvider provider) { - super("DisplayTree", tool, owner, provider); - isTree = true; - String[] path = new String[] { "Display as...", "Tree" }; - setPopupMenuData(new MenuData(path, ObjectTree.ICON_TREE)); - setKeyBindingData(new KeyBindingData(KeyEvent.VK_R, InputEvent.CTRL_DOWN_MASK)); - setHelpLocation(new HelpLocation(owner, "display_as_tree")); - provider.addLocalAction(this); - } - - @Override - protected void doAction(ObjectContainer container) { - ObjectContainer clone = new ObjectContainer(container.getTargetObject(), container.linkKey); - finishGetOffspring(clone); - //getOffspring(clone); - } - -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayAsXMLAction.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayAsXMLAction.java deleted file mode 100644 index 5d302c7e97..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayAsXMLAction.java +++ /dev/null @@ -1,69 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.objects.actions; - -import java.awt.event.InputEvent; -import java.awt.event.KeyEvent; - -import javax.swing.Icon; - -import org.jdom.Element; - -import docking.action.KeyBindingData; -import docking.action.MenuData; -import generic.theme.GIcon; -import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider; -import ghidra.app.plugin.core.debug.gui.objects.ObjectContainer; -import ghidra.app.services.ConsoleService; -import ghidra.framework.plugintool.PluginTool; -import ghidra.util.HelpLocation; -import ghidra.util.Msg; -import ghidra.util.xml.XmlUtilities; - -public class DisplayAsXMLAction extends DisplayAsAction { - - protected ConsoleService consoleService; - protected static final Icon ICON_XML = new GIcon("icon.debugger.display.xml"); - - public DisplayAsXMLAction(PluginTool tool, String owner, DebuggerObjectsProvider provider) { - super("DisplayXml", tool, owner, provider); - String[] path = new String[] { "Display as...", "XML" }; - setPopupMenuData(new MenuData(path, ICON_XML)); - setKeyBindingData(new KeyBindingData(KeyEvent.VK_E, InputEvent.CTRL_DOWN_MASK)); - setHelpLocation(new HelpLocation(owner, "display_as_xml")); - provider.addLocalAction(this); - } - - @Override - protected void doAction(ObjectContainer container) { - consoleService = provider.getConsoleService(); - if (consoleService == null) { - Msg.showError(this, tool.getToolFrame(), "DisplayAsXML Error", - "ConsoleService not found: Please add a console service provider to your tool"); - return; - } - writeXml(container); - } - - public void writeXml(ObjectContainer container) { - Element root = container.toXml(); - XmlUtilities.setStringAttr(root, "Path", container.getTargetObject().getJoinedPath(".")); - //Document doc = new Document(root); - //XmlUtilities.writePrettyDocToFile(doc, destFile); - consoleService.println(XmlUtilities.toString(root)); - } - -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayFilteredAction.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayFilteredAction.java deleted file mode 100644 index 30afe4e3a6..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayFilteredAction.java +++ /dev/null @@ -1,104 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.objects.actions; - -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.CompletableFuture; - -import javax.swing.SwingUtilities; - -import docking.ActionContext; -import docking.action.DockingAction; -import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider; -import ghidra.app.plugin.core.debug.gui.objects.ObjectContainer; -import ghidra.app.script.AskDialog; -import ghidra.dbg.DebuggerObjectModel; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.TargetObject; -import ghidra.framework.plugintool.PluginTool; - -public abstract class DisplayFilteredAction extends DockingAction { - - protected PluginTool tool; - protected DebuggerObjectsProvider provider; - protected boolean isTree = false; - private String lastCmd; - - public DisplayFilteredAction(String name, PluginTool tool, String owner, - DebuggerObjectsProvider provider) { - super(name, owner); - this.tool = tool; - this.provider = provider; - } - - @Override - public boolean isEnabledForContext(ActionContext context) { - Object obj = context.getContextObject(); - ObjectContainer sel = provider.getSelectedContainer(obj); - return sel != null; - } - - @Override - public void actionPerformed(ActionContext context) { - Object contextObject = context.getContextObject(); - ObjectContainer container = provider.getSelectedContainer(contextObject); - if (container != null) { - AskDialog dialog = - new AskDialog("Filter", "Filter", AskDialog.STRING, lastCmd); - if (dialog.isCanceled()) { - return; - } - - lastCmd = dialog.getValueAsString(); - List path = new ArrayList<>(); - path.addAll(container.getTargetObject().getPath()); - path.add(lastCmd); - - doAction(container, path); - } - } - - protected abstract void doAction(ObjectContainer container, List path); - - protected CompletableFuture getOffspring(ObjectContainer container, - final List path) { - TargetObject to = container.getTargetObject(); - DebuggerObjectModel model = to.getModel(); - model.fetchModelObject(path, RefreshBehavior.REFRESH_ALWAYS).thenAccept(obj -> { - container.setTargetObject(obj); - finishGetOffspring(container, path); - }); - return CompletableFuture.completedFuture(null); - } - - protected void finishGetOffspring(ObjectContainer container, final List path) { - SwingUtilities.invokeLater(new Runnable() { - @Override - public void run() { - try { - DebuggerObjectsProvider p = new DebuggerObjectsProvider(provider.getPlugin(), - provider.getModel(), container, isTree); - container.propagateProvider(p); - p.update(container); - } - catch (Exception e) { - e.printStackTrace(); - } - } - }); - } -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayFilteredGraphAction.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayFilteredGraphAction.java deleted file mode 100644 index 3c18478b73..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayFilteredGraphAction.java +++ /dev/null @@ -1,98 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.objects.actions; - -import java.awt.event.InputEvent; -import java.awt.event.KeyEvent; -import java.util.List; -import java.util.Set; - -import javax.swing.Icon; - -import docking.action.KeyBindingData; -import docking.action.MenuData; -import generic.theme.GIcon; -import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider; -import ghidra.app.plugin.core.debug.gui.objects.ObjectContainer; -import ghidra.app.services.GraphDisplayBroker; -import ghidra.framework.plugintool.PluginTool; -import ghidra.service.graph.*; -import ghidra.util.HelpLocation; -import ghidra.util.Msg; -import ghidra.util.exception.CancelledException; -import ghidra.util.exception.GraphException; -import ghidra.util.task.TaskMonitor; - -public class DisplayFilteredGraphAction extends DisplayFilteredAction { - - protected GraphDisplayBroker graphBroker; - - protected static final Icon ICON_GRAPH = new GIcon("icon.debugger.display.xml.filtered"); - - public DisplayFilteredGraphAction(PluginTool tool, String owner, - DebuggerObjectsProvider provider) { - super("DisplayFilteredGraph", tool, owner, provider); - String[] path = new String[] { "Display filtered...", "Graph" }; - setPopupMenuData(new MenuData(path, ICON_GRAPH)); - setKeyBindingData(new KeyBindingData(KeyEvent.VK_G, - InputEvent.CTRL_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK)); - setHelpLocation(new HelpLocation(owner, "display_filtered_graph")); - provider.addLocalAction(this); - } - - @Override - protected void doAction(ObjectContainer container, List path) { - graphBroker = provider.getGraphBroker(); - if (graphBroker == null) { - Msg.showError(this, tool.getToolFrame(), "DisplayAsGraph Error", - "GraphBroker not found: Please add a graph provider to your tool"); - return; - } - ObjectContainer clone = ObjectContainer.clone(container); - clone.setImmutable(true); - getOffspring(clone, path); - } - - private void graphContainer(ObjectContainer container, AttributedGraph graph, - AttributedVertex start) { - Set children = container.getCurrentChildren(); - for (ObjectContainer c : children) { - AttributedVertex end = graph.addVertex(c.getName(), c.toString()); - graph.addEdge(start, end, c.getTargetObject().getName()); - if (c.hasElements()) { - graphContainer(c, graph, end); - } - } - } - - @Override - protected void finishGetOffspring(ObjectContainer container, final List path) { - GraphDisplayProvider graphProvider = graphBroker.getDefaultGraphDisplayProvider(); - AttributedGraph graph = new AttributedGraph(container.getName(), new EmptyGraphType()); - AttributedVertex start = graph.addVertex(container.getName(), container.toString()); - graphContainer(container, graph, start); - try { - GraphDisplay graphDisplay = graphProvider.getGraphDisplay(true, TaskMonitor.DUMMY); - graphDisplay.setGraph(graph, container.getName(), false, TaskMonitor.DUMMY); - } - catch (GraphException e) { - e.printStackTrace(); - } - catch (CancelledException e) { - //DO NOTHING - } - } -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayFilteredTableAction.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayFilteredTableAction.java deleted file mode 100644 index fe1890291d..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayFilteredTableAction.java +++ /dev/null @@ -1,52 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.objects.actions; - -import java.awt.event.InputEvent; -import java.awt.event.KeyEvent; -import java.util.List; - -import docking.action.KeyBindingData; -import docking.action.MenuData; -import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider; -import ghidra.app.plugin.core.debug.gui.objects.ObjectContainer; -import ghidra.app.plugin.core.debug.gui.objects.components.ObjectTable; -import ghidra.framework.plugintool.PluginTool; -import ghidra.util.HelpLocation; - -public class DisplayFilteredTableAction extends DisplayFilteredAction { - - protected String lastCmd = ""; - - public DisplayFilteredTableAction(PluginTool tool, String owner, - DebuggerObjectsProvider provider) { - super("DisplayFilteredTable", tool, owner, provider); - String[] path = new String[] { "Display filtered...", "Table" }; - setPopupMenuData(new MenuData(path, ObjectTable.ICON_TABLE)); - setKeyBindingData(new KeyBindingData(KeyEvent.VK_T, - InputEvent.CTRL_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK)); - setHelpLocation(new HelpLocation(owner, "display_filtered_table")); - provider.addLocalAction(this); - } - - @Override - protected void doAction(ObjectContainer container, List path) { - ObjectContainer clone = ObjectContainer.clone(container); - clone.setImmutable(true); - getOffspring(clone, path); - } - -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayFilteredTreeAction.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayFilteredTreeAction.java deleted file mode 100644 index 8390925f2a..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayFilteredTreeAction.java +++ /dev/null @@ -1,51 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.objects.actions; - -import java.awt.event.InputEvent; -import java.awt.event.KeyEvent; -import java.util.List; - -import docking.action.KeyBindingData; -import docking.action.MenuData; -import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider; -import ghidra.app.plugin.core.debug.gui.objects.ObjectContainer; -import ghidra.app.plugin.core.debug.gui.objects.components.ObjectTree; -import ghidra.framework.plugintool.PluginTool; -import ghidra.util.HelpLocation; - -public class DisplayFilteredTreeAction extends DisplayFilteredAction { - - public DisplayFilteredTreeAction(PluginTool tool, String owner, - DebuggerObjectsProvider provider) { - super("DisplayFilteredTree", tool, owner, provider); - isTree = true; - String[] path = new String[] { "Display filtered...", "Tree" }; - setPopupMenuData(new MenuData(path, ObjectTree.ICON_TREE)); - setKeyBindingData(new KeyBindingData(KeyEvent.VK_R, - InputEvent.CTRL_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK)); - setHelpLocation(new HelpLocation(owner, "display_filtered_tree")); - provider.addLocalAction(this); - } - - @Override - protected void doAction(ObjectContainer container, List path) { - ObjectContainer clone = ObjectContainer.clone(container); - clone.setImmutable(true); - getOffspring(clone, path); - } - -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayFilteredXMLAction.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayFilteredXMLAction.java deleted file mode 100644 index 9ae256bd59..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayFilteredXMLAction.java +++ /dev/null @@ -1,79 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.objects.actions; - -import java.awt.event.InputEvent; -import java.awt.event.KeyEvent; -import java.util.List; - -import javax.swing.Icon; - -import org.apache.commons.lang3.StringUtils; -import org.jdom.Element; - -import docking.action.KeyBindingData; -import docking.action.MenuData; -import generic.theme.GIcon; -import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider; -import ghidra.app.plugin.core.debug.gui.objects.ObjectContainer; -import ghidra.app.services.ConsoleService; -import ghidra.framework.plugintool.PluginTool; -import ghidra.util.HelpLocation; -import ghidra.util.Msg; -import ghidra.util.xml.XmlUtilities; - -public class DisplayFilteredXMLAction extends DisplayFilteredAction { - - protected ConsoleService consoleService; - protected static final Icon ICON_XML = new GIcon("icon.debugger.display.xml.filtered"); - - public DisplayFilteredXMLAction(PluginTool tool, String owner, - DebuggerObjectsProvider provider) { - super("DisplayFilteredXML", tool, owner, provider); - String[] path = new String[] { "Display filtered...", "XML" }; - setPopupMenuData(new MenuData(path, ICON_XML)); - setKeyBindingData(new KeyBindingData(KeyEvent.VK_E, - InputEvent.CTRL_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK)); - setHelpLocation(new HelpLocation(owner, "display_filtered_xml")); - provider.addLocalAction(this); - } - - @Override - protected void doAction(ObjectContainer container, List path) { - consoleService = provider.getConsoleService(); - if (consoleService == null) { - Msg.showError(this, tool.getToolFrame(), "DisplayFilteredGraph Error", - "ConsoleService not found: Please add a console service provider to your tool"); - return; - } - ObjectContainer clone = ObjectContainer.clone(container); - clone.setImmutable(true); - getOffspring(clone, path); - } - - @Override - protected void finishGetOffspring(ObjectContainer container, final List path) { - writeXml(container, path); - } - - public void writeXml(ObjectContainer container, final List path) { - Element root = container.toXml(); - String joinedPath = StringUtils.join(path, "."); - XmlUtilities.setStringAttr(root, "Path", joinedPath); - consoleService.println(XmlUtilities.toString(root)); - } - -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayMethodsAction.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayMethodsAction.java deleted file mode 100644 index 59790ce92e..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/DisplayMethodsAction.java +++ /dev/null @@ -1,111 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.objects.actions; - -import static ghidra.async.AsyncUtils.sequence; - -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.atomic.AtomicReference; - -import docking.ActionContext; -import docking.action.DockingAction; -import docking.action.MenuData; -import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider; -import ghidra.app.plugin.core.debug.gui.objects.ObjectContainer; -import ghidra.app.services.ConsoleService; -import ghidra.async.AsyncFence; -import ghidra.async.TypeSpec; -import ghidra.dbg.target.TargetMethod; -import ghidra.dbg.target.TargetObject; -import ghidra.framework.plugintool.PluginTool; -import ghidra.util.HelpLocation; -import ghidra.util.Msg; - -public class DisplayMethodsAction extends DockingAction { - private static final String GROUP = null; // TODO: What group? - - private PluginTool tool; - protected DebuggerObjectsProvider provider; - private ConsoleService consoleService; - - public DisplayMethodsAction(PluginTool tool, String owner, DebuggerObjectsProvider provider) { - super("DisplayMethods", owner); - this.tool = tool; - this.provider = provider; - - String[] path = new String[] { "Display methods" }; - setPopupMenuData(new MenuData(path, GROUP)); - setHelpLocation(new HelpLocation(owner, "display_methods")); - provider.addLocalAction(this); - } - - @Override - public boolean isEnabledForContext(ActionContext context) { - Object obj = context.getContextObject(); - ObjectContainer sel = provider.getSelectedContainer(obj); - return sel != null; - } - - @Override - public void actionPerformed(ActionContext context) { - Object contextObject = context.getContextObject(); - ObjectContainer container = provider.getSelectedContainer(contextObject); - if (container != null) { - doAction(container); - } - } - - protected void doAction(ObjectContainer container) { - consoleService = provider.getConsoleService(); - if (consoleService == null) { - Msg.showError(this, tool.getToolFrame(), "DisplayMethods Error", - "ConsoleService not found: Please add a console service provider to your tool"); - return; - } - ObjectContainer clone = ObjectContainer.clone(container); - getAttributes(clone); - } - - private CompletableFuture getAttributes(ObjectContainer container) { - AtomicReference> attributes = new AtomicReference<>(); - return sequence(TypeSpec.VOID).then(seq -> { - AsyncFence fence = new AsyncFence(); - TargetObject to = container.getTargetObject(); - fence.include(to.fetchAttributes().thenAccept(attributes::set)); - fence.ready().handle(seq::next); - }).then(seq -> { - finishGetAttributes(container, attributes); - seq.exit(); - }).finish(); - } - - protected void finishGetAttributes(ObjectContainer container, - AtomicReference> methods) { - consoleService.println("Methods for " + container.getTargetObject().getName() + ":"); - Map map = methods.get(); - for (String key : map.keySet()) { - Object object = map.get(key); - if (object instanceof TargetObject) { - TargetObject to = (TargetObject) object; - if (to instanceof TargetMethod) { - consoleService.println(key); - } - } - } - } - -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/ExportAsFactsAction.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/ExportAsFactsAction.java deleted file mode 100644 index 348e19aaa4..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/ExportAsFactsAction.java +++ /dev/null @@ -1,108 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.objects.actions; - -import java.awt.event.InputEvent; -import java.awt.event.KeyEvent; -import java.io.*; -import java.util.HashMap; -import java.util.Map; - -import javax.swing.Icon; - -import docking.action.KeyBindingData; -import docking.action.MenuData; -import docking.widgets.filechooser.GhidraFileChooserMode; -import generic.theme.GIcon; -import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider; -import ghidra.app.plugin.core.debug.gui.objects.ObjectContainer; -import ghidra.dbg.target.TargetObject; -import ghidra.framework.plugintool.PluginTool; -import ghidra.util.HelpLocation; - -public class ExportAsFactsAction extends ImportExportAsAction { - - public static String SEP = "\t"; - public static String JOIN = "."; - public static String SPLIT = "\\."; - public static String fileExt2 = ".facts"; - protected static final Icon ICON_FACTS = new GIcon("icon.debugger.display.export.facts"); - private Map files = new HashMap<>(); - - public ExportAsFactsAction(PluginTool tool, String owner, DebuggerObjectsProvider provider) { - super("ExportAsFacts", tool, owner, provider); - fileExt = ""; - fileMode = GhidraFileChooserMode.DIRECTORIES_ONLY; - String[] path = new String[] { "Export as...", "Facts" }; - setPopupMenuData(new MenuData(path, ICON_FACTS)); - setKeyBindingData(new KeyBindingData(KeyEvent.VK_F, - InputEvent.SHIFT_DOWN_MASK)); - setHelpLocation(new HelpLocation(owner, "export_as_facts")); - provider.addLocalAction(this); - } - - @Override - protected void doAction(ObjectContainer container, File dir) { - if (container == null) { - return; - } - writeFacts(container, dir); - for (PrintWriter pw : files.values()) { - pw.flush(); - pw.close(); - } - } - - public String writeFacts(ObjectContainer container, File dir) { - TargetObject to = container.getTargetObject(); - if (to == null) { - return ""; - } - String id = Integer.toHexString(to.getPath().hashCode()); - PrintWriter pw = getOrAddWriter(dir, "ObjectPath"); - pw.println(id + SEP + to.getJoinedPath(JOIN)); - pw = getOrAddWriter(dir, "ObjectName"); - pw.println(id + SEP + container.getPrefixedName()); - pw = getOrAddWriter(dir, "ObjectValue"); - pw.println(id + SEP + to.getDisplay()); - pw = getOrAddWriter(dir, "ObjectType"); - pw.println(id + SEP + to.getTypeHint()); - pw = getOrAddWriter(dir, "ObjectChildren"); - for (ObjectContainer c : container.getCurrentChildren()) { - String cid = writeFacts(c, dir); - pw.println(id + SEP + cid); - } - return id; - } - - private PrintWriter getOrAddWriter(File dir, String name) { - name += fileExt2; - if (files.containsKey(name)) { - return files.get(name); - } - File f = new File(dir, name); - PrintWriter pw = null; - try { - pw = new PrintWriter(f); - files.put(name, pw); - } - catch (FileNotFoundException e) { - e.printStackTrace(); - } - return pw; - } - -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/ExportAsXMLAction.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/ExportAsXMLAction.java deleted file mode 100644 index 71be677be1..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/ExportAsXMLAction.java +++ /dev/null @@ -1,76 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.objects.actions; - -import java.awt.event.InputEvent; -import java.awt.event.KeyEvent; -import java.io.File; -import java.io.IOException; - -import javax.swing.Icon; - -import org.apache.commons.lang3.StringUtils; -import org.jdom.Document; -import org.jdom.Element; - -import docking.action.KeyBindingData; -import docking.action.MenuData; -import docking.widgets.filechooser.GhidraFileChooserMode; -import generic.theme.GIcon; -import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider; -import ghidra.app.plugin.core.debug.gui.objects.ObjectContainer; -import ghidra.framework.plugintool.PluginTool; -import ghidra.util.HelpLocation; -import ghidra.util.xml.XmlUtilities; - -public class ExportAsXMLAction extends ImportExportAsAction { - - protected static final Icon ICON_XML = new GIcon("icon.debugger.display.export.xml"); - - public ExportAsXMLAction(PluginTool tool, String owner, DebuggerObjectsProvider provider) { - super("ExportAsXML", tool, owner, provider); - fileExt = ".xml"; - fileMode = GhidraFileChooserMode.FILES_ONLY; - String[] path = new String[] { "Export as...", "XML" }; - setPopupMenuData(new MenuData(path, ICON_XML)); - setKeyBindingData(new KeyBindingData(KeyEvent.VK_E, - InputEvent.SHIFT_DOWN_MASK)); - setHelpLocation(new HelpLocation(owner, "export_as_xml")); - provider.addLocalAction(this); - } - - @Override - protected void doAction(ObjectContainer container, File f) { - writeXml(container, f); - } - - public void writeXml(ObjectContainer container, File f) { - if (container == null) { - return; - } - Element root = container.toXml(); - String joinedPath = StringUtils.join(container.getTargetObject().getPath(), "."); - XmlUtilities.setStringAttr(root, "Path", joinedPath); - Document doc = new Document(root); - try { - XmlUtilities.writePrettyDocToFile(doc, f); - } - catch (IOException e) { - e.printStackTrace(); - } - } - -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/ImportExportAsAction.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/ImportExportAsAction.java deleted file mode 100644 index d96604bb6d..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/ImportExportAsAction.java +++ /dev/null @@ -1,90 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.objects.actions; - -import java.io.File; - -import docking.ActionContext; -import docking.action.DockingAction; -import docking.widgets.filechooser.GhidraFileChooser; -import docking.widgets.filechooser.GhidraFileChooserMode; -import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider; -import ghidra.app.plugin.core.debug.gui.objects.ObjectContainer; -import ghidra.framework.Application; -import ghidra.framework.plugintool.PluginTool; -import ghidra.util.filechooser.GhidraFileChooserModel; -import ghidra.util.filechooser.GhidraFileFilter; - -public abstract class ImportExportAsAction extends DockingAction { - - protected PluginTool tool; - protected DebuggerObjectsProvider provider; - protected String fileExt; - protected GhidraFileChooserMode fileMode; - - protected String IMPORT = "Import..."; - protected String GROUP = "ImportExport"; - - public ImportExportAsAction(String name, PluginTool tool, String owner, - DebuggerObjectsProvider provider) { - super(name, owner); - this.tool = tool; - this.provider = provider; - } - - @Override - public boolean isEnabledForContext(ActionContext context) { - Object obj = context.getContextObject(); - ObjectContainer sel = provider.getSelectedContainer(obj); - return sel != null; - } - - @Override - public void actionPerformed(ActionContext context) { - Object contextObject = context.getContextObject(); - ObjectContainer container = provider.getSelectedContainer(contextObject); - - GhidraFileChooser chooser = new GhidraFileChooser(provider.getComponent()); - chooser.setFileFilter(new GhidraFileFilter() { - - @Override - public String getDescription() { - return "*" + fileExt; - } - - @Override - public boolean accept(File file, GhidraFileChooserModel chooserModel) { - if (file.getName().endsWith(fileExt)) { - return true; - } - return file.isDirectory(); - } - }); - chooser.setFileSelectionMode(fileMode); - - chooser.setCurrentDirectory(Application.getUserSettingsDirectory()); - - File f = chooser.getSelectedFile(); - chooser.dispose(); - if (chooser.wasCancelled() || f == null) { // Redundant? Meh, it's cheap. - return; - } - doAction(container, f); - } - - protected abstract void doAction(ObjectContainer container, File f); - -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/ImportFromFactsAction.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/ImportFromFactsAction.java deleted file mode 100644 index 9656c25871..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/ImportFromFactsAction.java +++ /dev/null @@ -1,145 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.objects.actions; - -import java.awt.event.InputEvent; -import java.awt.event.KeyEvent; -import java.io.*; -import java.util.*; - -import javax.swing.Icon; -import javax.swing.SwingUtilities; - -import docking.ActionContext; -import docking.action.KeyBindingData; -import docking.action.MenuData; -import docking.widgets.filechooser.GhidraFileChooserMode; -import generic.theme.GIcon; -import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider; -import ghidra.app.plugin.core.debug.gui.objects.ObjectContainer; -import ghidra.app.plugin.core.debug.gui.objects.components.DummyTargetObject; -import ghidra.framework.plugintool.PluginTool; -import ghidra.util.HelpLocation; -import ghidra.util.Msg; - -public class ImportFromFactsAction extends ImportExportAsAction { - - protected static final Icon ICON_FACTS = new GIcon("icon.debugger.display.import.facts"); - private Map> maps = - new LinkedHashMap<>(); - - public ImportFromFactsAction(PluginTool tool, String owner, DebuggerObjectsProvider provider) { - super("ImportFromFacts", tool, owner, provider); - fileExt = ""; - fileMode = GhidraFileChooserMode.DIRECTORIES_ONLY; - setMenuBarData(new MenuData(new String[] { IMPORT, "from facts" }, ICON_FACTS, GROUP)); - setKeyBindingData(new KeyBindingData(KeyEvent.VK_F, InputEvent.ALT_DOWN_MASK)); - setHelpLocation(new HelpLocation(owner, "import_from_facts")); - provider.addLocalAction(this); - } - - @Override - public boolean isEnabledForContext(ActionContext context) { - return true; - } - - @Override - protected void doAction(ObjectContainer container, File dir) { - SwingUtilities.invokeLater(new Runnable() { - - @Override - public void run() { - try { - ObjectContainer cp = new ObjectContainer(null, null); - DebuggerObjectsProvider p = new DebuggerObjectsProvider(provider.getPlugin(), - provider.getModel(), cp, true); - cp.propagateProvider(p); - p.update(cp); - - if (!dir.isDirectory()) { - return; - } - for (File f : dir.listFiles()) { - BufferedReader reader = - new BufferedReader(new InputStreamReader(new FileInputStream(f))); - Map map = new LinkedHashMap<>(); - String name = f.getName(); - name = name.substring(0, name.indexOf(ExportAsFactsAction.fileExt2)); - maps.put(name, map); - String line; - while (null != (line = reader.readLine())) { - String[] split = line.split(ExportAsFactsAction.SEP); - if (split.length == 2) { - map.put(split[0], split[1]); - } - else { - map.put(split[0], ""); - } - } - reader.close(); - } - - Map objMap = new LinkedHashMap<>(); - Map map = maps.get("ObjectPath"); - for (String key : map.keySet()) { - String pathStr = map.get(key); - String[] split = pathStr.split(ExportAsFactsAction.SPLIT); - List path = new ArrayList<>(); - for (String s : split) { - path.add(s); - } - String name = maps.get("ObjectName").get(key); - String value = maps.get("ObjectValue").get(key); - String kind = maps.get("ObjectType").get(key); - DummyTargetObject to = - new DummyTargetObject(convertName(name), path, kind, value, "", null); - objMap.put(key, to); - } - Map cmap = maps.get("ObjectChildren"); - for (String key : cmap.keySet()) { - String cid = cmap.get(key); - String pkey = key.substring(0, key.indexOf(":")); - DummyTargetObject to = objMap.get(pkey); - DummyTargetObject cto = objMap.get(cid); - to.addObject(cto); - cto.setParent(to); - } - DummyTargetObject root = null; - for (DummyTargetObject to : objMap.values()) { - if (to.getParent() == null) { - root = to; - break; - } - } - if (root != null) { - ObjectContainer c = p.getRoot(); - c.setTargetObject(root); - provider.update(c); - } - } - catch (Exception e) { - e.printStackTrace(); - Msg.showError(this, provider.getComponent(), "Load Failed", e); - } - } - }); - } - - private String convertName(String name) { - return name.contains("_0x") ? "[" + name.substring(name.indexOf("_") + 1) + "]" : name; - } - -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/ImportFromXMLAction.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/ImportFromXMLAction.java deleted file mode 100644 index 7fa6be2a47..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/ImportFromXMLAction.java +++ /dev/null @@ -1,132 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.objects.actions; - -import java.awt.event.InputEvent; -import java.awt.event.KeyEvent; -import java.io.*; -import java.util.ArrayList; -import java.util.List; - -import javax.swing.Icon; -import javax.swing.SwingUtilities; - -import org.jdom.Attribute; -import org.jdom.Element; -import org.jdom.input.SAXBuilder; - -import docking.ActionContext; -import docking.action.KeyBindingData; -import docking.action.MenuData; -import docking.widgets.filechooser.GhidraFileChooserMode; -import generic.theme.GIcon; -import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider; -import ghidra.app.plugin.core.debug.gui.objects.ObjectContainer; -import ghidra.app.plugin.core.debug.gui.objects.components.DummyTargetObject; -import ghidra.dbg.target.TargetObject; -import ghidra.framework.plugintool.PluginTool; -import ghidra.util.HelpLocation; -import ghidra.util.Msg; -import ghidra.util.xml.XmlUtilities; - -public class ImportFromXMLAction extends ImportExportAsAction { - - protected static final Icon ICON_XML = new GIcon("icon.debugger.display.import.xml"); - - public ImportFromXMLAction(PluginTool tool, String owner, DebuggerObjectsProvider provider) { - super("ImportFromXML", tool, owner, provider); - fileExt = ".xml"; - fileMode = GhidraFileChooserMode.FILES_ONLY; - setMenuBarData(new MenuData(new String[] { IMPORT, "from XML" }, ICON_XML, GROUP)); - setKeyBindingData(new KeyBindingData(KeyEvent.VK_E, InputEvent.ALT_DOWN_MASK)); - setHelpLocation(new HelpLocation(owner, "import_from_xml")); - provider.addLocalAction(this); - } - - @Override - public boolean isEnabledForContext(ActionContext context) { - return true; - } - - @Override - protected void doAction(ObjectContainer container, File f) { - SwingUtilities.invokeLater(new Runnable() { - @Override - public void run() { - InputStream is = null; - try { - - ObjectContainer cp = new ObjectContainer(null, null); - DebuggerObjectsProvider p = new DebuggerObjectsProvider(provider.getPlugin(), - provider.getModel(), cp, true); - cp.propagateProvider(p); - p.update(cp); - - is = new FileInputStream(f); - SAXBuilder sax = XmlUtilities.createSecureSAXBuilder(false, false); - Element root = sax.build(is).getRootElement(); - - List path = new ArrayList<>(); - Attribute pathStr = root.getAttribute("Path"); - for (String s : pathStr.getValue().split("\\.")) { - path.add(s); - } - DummyTargetObject to = xmlToObject(p, root, path); - ObjectContainer c = p.getRoot(); - c.setTargetObject(to); - provider.update(c); - } - catch (Exception e) { - Msg.showError(this, provider.getComponent(), "Load Failed", e.getMessage()); - } - finally { - try { - is.close(); - } - catch (IOException e) { - // we tried - } - } - } - }); - } - - private DummyTargetObject xmlToObject(DebuggerObjectsProvider p, Element e, List path) { - String key = convertName(e.getName()); - Attribute type = e.getAttribute("Type"); - Attribute value = e.getAttribute("Value"); - List objects = new ArrayList<>(); - for (Object c : e.getChildren()) { - if (c instanceof Element) { - Element ce = (Element) c; - List npath = new ArrayList<>(); - npath.addAll(path); - npath.add(convertName(ce.getName())); - TargetObject to = xmlToObject(p, ce, npath); - objects.add(to); - } - } - String tstr = (type != null) ? type.getValue() : ""; - String vstr = (value != null) ? value.getValue() : ""; - //return new DummyTargetObject(p.getRoot().getTargetObject().getClient(), path, tstr, vstr, ""); - return new DummyTargetObject(key, path, tstr, vstr, "", objects); - } - - private String convertName(String name) { - return name.contains("_0x") ? "[" + name.substring(name.indexOf("_") + 1) + "]" : name; - } - -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/OpenWinDbgTraceAction.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/OpenWinDbgTraceAction.java deleted file mode 100644 index a46320c874..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/OpenWinDbgTraceAction.java +++ /dev/null @@ -1,86 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.objects.actions; - -import java.awt.event.InputEvent; -import java.awt.event.KeyEvent; -import java.io.File; -import java.util.Map; -import java.util.concurrent.atomic.AtomicReference; - -import javax.swing.Icon; -import javax.swing.SwingUtilities; - -import docking.ActionContext; -import docking.action.KeyBindingData; -import docking.action.MenuData; -import docking.widgets.filechooser.GhidraFileChooserMode; -import generic.theme.GIcon; -import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider; -import ghidra.app.plugin.core.debug.gui.objects.ObjectContainer; -import ghidra.async.AsyncUtils; -import ghidra.async.TypeSpec; -import ghidra.dbg.DebugModelConventions; -import ghidra.dbg.target.TargetLauncher; -import ghidra.dbg.target.TargetLauncher.TargetCmdLineLauncher; -import ghidra.dbg.target.TargetObject; -import ghidra.framework.plugintool.PluginTool; -import ghidra.util.HelpLocation; - -public class OpenWinDbgTraceAction extends ImportExportAsAction { - - protected static final Icon ICON_TRACE = new GIcon("icon.debugger.open.windbg.trace"); - private ActionContext context; - - public OpenWinDbgTraceAction(PluginTool tool, String owner, DebuggerObjectsProvider provider) { - super("OpenTrace", tool, owner, provider); - fileExt = ".run"; - fileMode = GhidraFileChooserMode.FILES_AND_DIRECTORIES; - setMenuBarData(new MenuData(new String[] { IMPORT, "from trace" }, ICON_TRACE, GROUP)); - setKeyBindingData(new KeyBindingData(KeyEvent.VK_T, InputEvent.ALT_DOWN_MASK)); - setHelpLocation(new HelpLocation(owner, "open_trace")); - provider.addLocalAction(this); - } - - @Override - public boolean isEnabledForContext(ActionContext context) { - this.context = context; - return provider.isInstance(context, TargetLauncher.class); - } - - @Override - protected void doAction(ObjectContainer container, File f) { - if (f == null) { - return; - } - SwingUtilities.invokeLater(() -> { - String[] args = new String[2]; - args[0] = ".opendump"; - args[1] = f.getAbsolutePath(); - AtomicReference launcher = new AtomicReference<>(); - AsyncUtils.sequence(TypeSpec.VOID).then(seq -> { - TargetObject obj = provider.getObjectFromContext(context); - DebugModelConventions.findSuitable(TargetLauncher.class, obj).handle(seq::next); - }, launcher).then(seq -> { - launcher.get() - .launch(Map.of(TargetCmdLineLauncher.CMDLINE_ARGS_NAME, args)) - .handle(seq::next); - seq.exit(); - }).finish(); - }); - } - -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/SetTimeoutAction.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/SetTimeoutAction.java deleted file mode 100644 index 7b6fb803e8..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/actions/SetTimeoutAction.java +++ /dev/null @@ -1,61 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.objects.actions; - -import docking.ActionContext; -import docking.action.DockingAction; -import docking.action.MenuData; -import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider; -import ghidra.app.script.AskDialog; -import ghidra.framework.plugintool.PluginTool; -import ghidra.util.HelpLocation; - -public class SetTimeoutAction extends DockingAction { - - DebuggerObjectsProvider provider; - int timeout = 0; - - public SetTimeoutAction(PluginTool tool, String owner, DebuggerObjectsProvider provider) { - super("SetTimeout", owner); - setMenuBarData( - new MenuData(new String[] { "Maintenance", "&Set Node Timeout" }, null, "M100")); - setHelpLocation(new HelpLocation(owner, "set_node_timeout")); - this.provider = provider; - provider.addLocalAction(this); - this.timeout = provider.getNodeTimeout(); - } - - @Override - public boolean isEnabledForContext(ActionContext context) { - return true; - } - - @Override - public void actionPerformed(ActionContext context) { - AskDialog dialog = - new AskDialog("Set Node Timeout", "Seconds", AskDialog.INT, timeout); - if (dialog.isCanceled()) { - return; - } - timeout = Integer.parseInt(dialog.getValueAsString()); - provider.setNodeTimeout(timeout); - } - - public void setNodeTimeout(int timeout) { - this.timeout = timeout; - } - -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/AttachableProcessesTableColumns.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/AttachableProcessesTableColumns.java deleted file mode 100644 index d53a0f6f19..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/AttachableProcessesTableColumns.java +++ /dev/null @@ -1,53 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.objects.components; - -import java.util.function.Function; - -import docking.widgets.table.DefaultEnumeratedColumnTableModel.EnumeratedTableColumn; -import ghidra.dbg.target.TargetAttachable; - -public enum AttachableProcessesTableColumns - implements EnumeratedTableColumn { - ID("ID", String.class, TargetAttachable::getName), - NAME("Name", String.class, TargetAttachable::getTypeHint); - - private final String header; - private final Function func; - private Class cls; - - AttachableProcessesTableColumns(String header, Class cls, - Function func) { - this.header = header; - this.cls = cls; - this.func = func; - } - - @Override - public Class getValueClass() { - return cls; - } - - @Override - public Object getValueOf(TargetAttachable proc) { - return func.apply(proc); - } - - @Override - public String getHeader() { - return header; - } -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/DebuggerAttachDialog.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/DebuggerAttachDialog.java deleted file mode 100644 index 30e44746be..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/DebuggerAttachDialog.java +++ /dev/null @@ -1,163 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.objects.components; - -import static ghidra.app.plugin.core.debug.gui.DebuggerResources.*; - -import java.awt.BorderLayout; -import java.util.List; -import java.util.Map; -import java.util.concurrent.atomic.AtomicReference; - -import javax.swing.*; - -import docking.ActionContext; -import docking.ReusableDialogComponentProvider; -import docking.action.ToolBarData; -import docking.widgets.table.*; -import ghidra.app.plugin.core.debug.gui.DebuggerResources.AbstractAttachAction; -import ghidra.app.plugin.core.debug.gui.DebuggerResources.AbstractRefreshAction; -import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsPlugin; -import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider; -import ghidra.async.AsyncUtils; -import ghidra.async.TypeSpec; -import ghidra.dbg.target.*; -import ghidra.util.MessageType; -import ghidra.util.Msg; -import ghidra.util.table.GhidraTableFilterPanel; - -public class DebuggerAttachDialog extends ReusableDialogComponentProvider { - - protected class RefreshAction extends AbstractRefreshAction { - public static final String GROUP = GROUP_GENERAL; - - public RefreshAction() { - super(plugin); - setToolBarData(new ToolBarData(ICON, GROUP)); - addAction(this); - setEnabled(true); - } - - @Override - public void actionPerformed(ActionContext context) { - fetchAndDisplayAttachable(); - } - } - - private final DebuggerObjectsPlugin plugin; - private final DebuggerObjectsProvider provider; - - protected RefreshAction actionRefresh; - protected JButton attachButton; - - private final RowObjectTableModel processes; - protected TargetAttacher attacher; - private GTable processTable; - - public DebuggerAttachDialog(DebuggerObjectsProvider provider) { - super(AbstractAttachAction.NAME, true, true, true, false); - this.provider = provider; - this.plugin = provider.getPlugin(); - processes = new DefaultEnumeratedColumnTableModel<>(plugin.getTool(), "Attachables", - AttachableProcessesTableColumns.class); - - populateComponents(); - createActions(); - } - - protected void populateComponents() { - // TODO: Lost connection seems to cause stale tree and NPEs - // TODO: Detached process causes stale tree and NPEs - // TODO: Looks like error is in GDB wrapper. Need tests for removed threads - JPanel panel = new JPanel(new BorderLayout()); - - processTable = new GTable(processes); - processTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - panel.add(new JScrollPane(processTable)); - processTable.setAutoLookupColumn(AttachableProcessesTableColumns.NAME.ordinal()); - - GhidraTableFilterPanel filterPanel = - new GhidraTableFilterPanel<>(processTable, processes); - panel.add(filterPanel, BorderLayout.SOUTH); - - addWorkPanel(panel); - - processTable.getColumn(AttachableProcessesTableColumns.ID.getHeader()).setPreferredWidth(8); - processTable.getColumn(AttachableProcessesTableColumns.NAME.getHeader()) - .setPreferredWidth(16); - - attachButton = new JButton(); - AbstractAttachAction.styleButton(attachButton); - attachButton.setToolTipText("Attach to the selected target"); - attachButton.addActionListener(e -> this.attach()); - tableRowActivationAction(processTable, () -> this.attach()); - addButton(attachButton); - - addCancelButton(); - } - - protected void createActions() { - actionRefresh = new RefreshAction(); - } - - protected void attach() { - TargetAttachable proc = processes.getRowObject(processTable.getSelectedRow()); - if (proc == null) { - return; - } - setStatusText("Attaching"); - attacher.attach(proc).thenAccept(__ -> { - close(); - }).exceptionally(e -> { - Msg.showError(this, getComponent(), "Could not attach", e); - setStatusText("Could not attach: " + e.getMessage(), MessageType.ERROR); - return null; - }); - } - - public void fetchAndDisplayAttachable() { - AtomicReference available = new AtomicReference<>(); - AtomicReference> procs = new AtomicReference<>(); - AsyncUtils.sequence(TypeSpec.VOID).then(seq -> { - setStatusText("Fetching process list"); - provider.getModel().fetchModelObject(List.of("Available")).handle(seq::next); - }, available).then(seq -> { - available.get() - .fetchElements() - .handle(seq::next); - }, procs).then(seq -> { - List modelData = processes.getModelData(); - modelData.clear(); - for (Object p : procs.get().values()) { - if (p instanceof TargetAttachable) { - modelData.add((TargetAttachable) p); - } - } - processes.fireTableDataChanged(); // This may not be most efficient. - setStatusText(""); - seq.exit(); - }).finish().exceptionally(e -> { - Msg.showError(this, getComponent(), "Could not fetch process list", e); - setStatusText("Could not fetch process list: " + e.getMessage(), MessageType.ERROR); - return null; - }); - } - - public void setAttacher(TargetAttacher attacher) { - this.attacher = attacher; - } - -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/DebuggerAttachDialogOld.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/DebuggerAttachDialogOld.java deleted file mode 100644 index b62e5975a7..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/DebuggerAttachDialogOld.java +++ /dev/null @@ -1,101 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.objects.components; - -import java.awt.*; -import java.awt.event.ActionEvent; -import java.util.Arrays; - -import javax.swing.*; - -import docking.DialogComponentProvider; -import ghidra.app.plugin.core.debug.gui.DebuggerResources.AbstractAttachAction; -import ghidra.app.plugin.core.debug.gui.DebuggerResources.AbstractLaunchAction; -import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider; -import ghidra.async.AsyncUtils; -import ghidra.async.TypeSpec; -import ghidra.dbg.target.TargetAttacher; -import ghidra.dbg.util.ShellUtils; -import ghidra.util.MessageType; -import ghidra.util.Msg; - -public class DebuggerAttachDialogOld extends DialogComponentProvider { - protected DebuggerObjectsProvider provider; - protected TargetAttacher attacher; - - protected JTextField pidField; - - protected JButton attachButton; - - public DebuggerAttachDialogOld(DebuggerObjectsProvider provider) { - super(AbstractAttachAction.NAME, true, true, true, false); - this.provider = provider; - - populateComponents(); - } - - protected void populateComponents() { - JPanel panel = new JPanel(new BorderLayout()); - - JPanel centerPanel = new JPanel(new FlowLayout(FlowLayout.CENTER)); - panel.add(centerPanel, BorderLayout.CENTER); - - JPanel grid = new JPanel(new GridLayout(1, 2)); - centerPanel.add(grid); - - JLabel cmdLineLabel = new JLabel("Target pid"); - grid.add(cmdLineLabel); - - pidField = new JTextField(); - grid.add(pidField); - - // TODO: Configurable working directory, if applicable, etc. - // Will require API and protocol extension. - - addWorkPanel(panel); - - attachButton = new JButton(); - AbstractLaunchAction.styleButton(attachButton); - addButton(attachButton); - - addCancelButton(); - - attachButton.addActionListener(this::attach); - } - - protected void attach(ActionEvent evt) { - String pidstr = pidField.getText(); - long pid = pidstr.startsWith("0x") ? Long.parseLong(pidstr, 16) : Long.parseLong(pidstr); - AsyncUtils.sequence(TypeSpec.VOID).then(seq -> { - setStatusText("Attaching"); - attacher.attach(pid).handle(seq::next); - }).finish().exceptionally(e -> { - Msg.showError(this, getComponent(), "Could not attach", e); - setStatusText("Could not attach: " + e.getMessage(), MessageType.ERROR); - return null; - }); - } - - public void setLauncher(TargetAttacher attacher) { - this.attacher = attacher; - } - - public void setArgs(String... args) { - String cmdLine = ShellUtils.generateLine(Arrays.asList(args)); - pidField.setText(cmdLine); - } - -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/DebuggerBreakpointDialog.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/DebuggerBreakpointDialog.java deleted file mode 100644 index 4fe8d5ad36..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/DebuggerBreakpointDialog.java +++ /dev/null @@ -1,98 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.objects.components; - -import java.awt.BorderLayout; -import java.awt.FlowLayout; -import java.awt.event.ActionEvent; -import java.util.HashSet; -import java.util.Set; - -import javax.swing.*; - -import docking.DialogComponentProvider; -import ghidra.app.plugin.core.debug.gui.DebuggerResources.AbstractSetBreakpointAction; -import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider; -import ghidra.dbg.target.TargetBreakpointSpec.TargetBreakpointKind; -import ghidra.dbg.target.TargetBreakpointSpecContainer; -import ghidra.util.MessageType; -import ghidra.util.Msg; -import ghidra.util.layout.PairLayout; - -public class DebuggerBreakpointDialog extends DialogComponentProvider { - protected DebuggerObjectsProvider provider; - protected TargetBreakpointSpecContainer container; - - protected JTextField expressionField; - - protected JButton addButton; - - public DebuggerBreakpointDialog(DebuggerObjectsProvider provider) { - super(AbstractSetBreakpointAction.NAME, true, true, true, false); - this.provider = provider; - - populateComponents(); - } - - protected void populateComponents() { - JPanel panel = new JPanel(new BorderLayout()); - - JPanel centerPanel = new JPanel(new FlowLayout(FlowLayout.CENTER)); - panel.add(centerPanel, BorderLayout.CENTER); - - JPanel pairPanel = new JPanel(new PairLayout(5, 5)); - centerPanel.add(pairPanel); - - JLabel expressionLabel = new JLabel("Expression"); - pairPanel.add(expressionLabel); - - expressionField = new JTextField(); - pairPanel.add(expressionField); - - addWorkPanel(panel); - - addButton = new JButton(); - AbstractSetBreakpointAction.styleButton(addButton); - addButton(addButton); - - addCancelButton(); - - addButton.addActionListener(this::addBreakpoint); - } - - protected void addBreakpoint(ActionEvent evt) { - String expression = expressionField.getText(); - - setStatusText("Adding"); - Set kinds = new HashSet<>(); - kinds.add(TargetBreakpointKind.SW_EXECUTE); - container.placeBreakpoint(expression, kinds).exceptionally(e -> { - Msg.showError(this, getComponent(), "Could not set breakpoint", e); - setStatusText("Could not set breakpoint: " + e.getMessage(), MessageType.ERROR); - return null; - }); - close(); - } - - public void setContainer(TargetBreakpointSpecContainer container) { - this.container = container; - } - - public void setText(String text) { - expressionField.setText(text); - } - -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/DebuggerMethodInvocationDialog.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/DebuggerMethodInvocationDialog.java index 0f111d2ea8..c45d3e0889 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/DebuggerMethodInvocationDialog.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/DebuggerMethodInvocationDialog.java @@ -16,9 +16,7 @@ package ghidra.app.plugin.core.debug.gui.objects.components; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; -import java.util.stream.Collectors; import javax.swing.Icon; @@ -30,6 +28,7 @@ import ghidra.framework.options.SaveState; import ghidra.framework.plugintool.AutoConfigState.ConfigStateField; import ghidra.framework.plugintool.PluginTool; +@Deprecated(forRemoval = true, since = "11.3") public class DebuggerMethodInvocationDialog extends AbstractDebuggerParameterDialog> { diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/DummyTargetObject.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/DummyTargetObject.java deleted file mode 100644 index 2dd4e7c31f..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/DummyTargetObject.java +++ /dev/null @@ -1,233 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.objects.components; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import org.apache.commons.lang3.StringUtils; - -import ghidra.async.AsyncUtils; -import ghidra.dbg.DebuggerObjectModel; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.TargetObject; - -public class DummyTargetObject implements TargetObject { - private static final String PATH_SEPARATOR_STRING = "."; - - private final DebuggerObjectModel model; - private final String joinedPath; - final List path; - final int hash; - - private final Map attributes = new LinkedHashMap<>(); - private final Map elements = new LinkedHashMap<>(); - - private TargetObject parent; - - private final String kind; - private final Object value; - private final String type; - private final String key; - - public DummyTargetObject(DebuggerObjectModel model, String root, List path) { - this(model, path, "", "", ""); - } - - public DummyTargetObject(DebuggerObjectModel model, List path, String kind, - Object value, String type) { - this.model = model; - this.joinedPath = StringUtils.join(path, PATH_SEPARATOR_STRING); - this.path = path; - this.kind = kind; - this.value = value; - this.type = type; - this.key = path.size() > 0 ? path.get(path.size() - 1) : ""; - this.hash = computeHashCode(); - } - - public DummyTargetObject(String key, List path, String kind, Object value, String type, - List objects) { - this.model = null; - this.joinedPath = StringUtils.join(path, PATH_SEPARATOR_STRING); - this.path = path; - this.kind = kind; - this.value = value; - this.type = type; - this.key = path.size() > 0 ? path.get(path.size() - 1) : ""; - this.hash = computeHashCode(); - if (objects != null) { - for (TargetObject obj : objects) { - addObject(obj); - } - } - } - - public DummyTargetObject(TargetObject parent, List path, String kind, Object value, - String type) { - this.parent = parent; - this.model = parent.getModel(); - this.joinedPath = StringUtils.join(path, PATH_SEPARATOR_STRING); - this.path = path; - this.kind = kind; - this.value = value; - this.type = type; - this.key = path.size() > 0 ? path.get(path.size() - 1) : ""; - this.hash = computeHashCode(); - if (!(parent instanceof DummyTargetObject)) { - fetchAttributes(); - } - } - - @Override - public boolean equals(Object obj) { - return doEquals(obj); - } - - @Override - public int hashCode() { - return hash; - } - - @Override - public TargetObject getParent() { - return parent; - } - - public void addObject(TargetObject obj) { - String name = obj.getName(); - if (name.contains("[")) { - elements.put(name, obj); - } - else { - attributes.put(name, obj); - } - } - - public void addAttribute(String name, Object val) { - attributes.put(name, val); - } - - public void setParent(TargetObject parent) { - this.parent = parent; - } - - @Override - public DebuggerObjectModel getModel() { - return model; - } - - @Override - public String getName() { - if (path == null) { - return ""; - } - String ret = path.get(path.size() - 1); - if (ret.endsWith("]")) { - ret = ret.substring(ret.indexOf("[")); - } - return ret; - } - - @Override - public Object getProtocolID() { - return path; - } - - @Override - public List getPath() { - return path; - } - - @Override - public String getTypeHint() { - return kind; - } - - @Override - public CompletableFuture resync(RefreshBehavior attributes, RefreshBehavior elements) { - return AsyncUtils.nil(); - } - - @Override - public CompletableFuture> fetchElements() { - // Why not completedFuture(elements)? - return CompletableFuture.supplyAsync(() -> elements); - } - - @Override - public Map getCachedElements() { - return elements; - } - - @Override - public Map getCallbackElements() { - return elements; - } - - @Override - public CompletableFuture> fetchAttributes() { - if (!key.equals(TargetObject.DISPLAY_ATTRIBUTE_NAME)) { - if (getValue() != null) { - String display = getName() + " : " + getValue(); - addAttribute(TargetObject.DISPLAY_ATTRIBUTE_NAME, display); - } - if (kind != null && !kind.equals("")) { - addAttribute(TargetObject.KIND_ATTRIBUTE_NAME, kind); - } - else { - addAttribute(TargetObject.KIND_ATTRIBUTE_NAME, "OBJECT_INTRINSIC"); - } - if (getValue() != null) { - addAttribute(TargetObject.VALUE_ATTRIBUTE_NAME, getValue()); - } - if (type != null) { - addAttribute(TargetObject.TYPE_ATTRIBUTE_NAME, type); - } - } - // Why not completedFuture(attributes)? - return CompletableFuture.supplyAsync(() -> attributes); - } - - @Override - public Map getCachedAttributes() { - return attributes; - } - - @Override - public Map getCallbackAttributes() { - return attributes; - } - - public String getJoinedPath() { - return joinedPath; - } - - @Override - public boolean isValid() { - return true; - } - - @Override - public String toString() { - return getName(); - } - - @Override - public Object getValue() { - return value; - } -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/GenericDebuggerProgramLaunchOffer.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/GenericDebuggerProgramLaunchOffer.java deleted file mode 100644 index 40b3272bec..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/GenericDebuggerProgramLaunchOffer.java +++ /dev/null @@ -1,59 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.objects.components; - -import java.util.concurrent.CompletableFuture; - -import ghidra.app.plugin.core.debug.service.model.launch.AbstractDebuggerProgramLaunchOffer; -import ghidra.dbg.DebuggerObjectModel; -import ghidra.framework.plugintool.PluginTool; -import ghidra.program.model.listing.Program; - -public class GenericDebuggerProgramLaunchOffer extends AbstractDebuggerProgramLaunchOffer { - - private DebuggerObjectModel model; - - public GenericDebuggerProgramLaunchOffer(Program program, PluginTool tool, - DebuggerObjectModel model) { - super(program, tool, null); - this.model = model; - } - - @Override - public String getConfigName() { - return program.getName(); - } - - @Override - public String getButtonTitle() { - return "Launch"; - } - - @Override - public String getMenuTitle() { - return model.getBrief(); - } - - @Override - public String getMenuParentTitle() { - return model.getBrief(); - } - - protected CompletableFuture connect(boolean prompt) { - throw new RuntimeException("Unable to connect using GenericDebuggerProgramLaunchOffer"); - } - -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectAttributeColumn.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectAttributeColumn.java deleted file mode 100644 index 79752aec4d..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectAttributeColumn.java +++ /dev/null @@ -1,53 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.objects.components; - -import java.util.function.Function; - -import docking.widgets.table.DefaultEnumeratedColumnTableModel.EnumeratedTableColumn; - -public enum ObjectAttributeColumn - implements EnumeratedTableColumn { - NAME("Name", String.class, ObjectAttributeRow::getName), - KIND("Kind", String.class, ObjectAttributeRow::getKind), - VALUE("Value", String.class, ObjectAttributeRow::getValue), - TYPE("Type", String.class, ObjectAttributeRow::getType); - - private final String header; - private final Function getter; - private final Class cls; - - ObjectAttributeColumn(String header, Class cls, Function getter) { - this.header = header; - this.cls = cls; - this.getter = getter; - } - - @Override - public String getHeader() { - return header; - } - - @Override - public Class getValueClass() { - return cls; - } - - @Override - public Object getValueOf(ObjectAttributeRow row) { - return getter.apply(row); - } -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectAttributeRow.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectAttributeRow.java deleted file mode 100644 index 52de258909..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectAttributeRow.java +++ /dev/null @@ -1,74 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.objects.components; - -import java.util.Map; - -import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider; -import ghidra.dbg.target.TargetObject; - -public class ObjectAttributeRow { - - private final TargetObject to; - - public ObjectAttributeRow(TargetObject to, DebuggerObjectsProvider provider) { - this.to = to; - } - - public TargetObject getTargetObject() { - return to; - } - - public String getName() { - return to.getName(); - } - - public String getKind() { - Map attributes = to.getCachedAttributes(); - Object object = attributes.get(TargetObject.KIND_ATTRIBUTE_NAME); - if (object != null) { - return (String) object; - } - return to.getTypeHint(); - } - - public String getValue() { - Map attributes = to.getCachedAttributes(); - Object object = attributes.get(TargetObject.VALUE_ATTRIBUTE_NAME); - if (object != null) { - return (String) object; - } - return to.getDisplay(); - } - - public String getDisplay() { - String value = to.getDisplay(); - if (value.indexOf(":") > 0) { - value = value.substring(0, value.indexOf(":")); - } - return value; - } - - public String getType() { - Map attributes = to.getCachedAttributes(); - Object object = attributes.get(TargetObject.TYPE_ATTRIBUTE_NAME); - if (object != null) { - return (String) object; - } - return ""; - } - -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectElementColumn.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectElementColumn.java deleted file mode 100644 index 66f8b718d8..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectElementColumn.java +++ /dev/null @@ -1,57 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.objects.components; - -import java.util.Comparator; -import java.util.List; -import java.util.function.Function; - -import ghidra.app.plugin.core.debug.gui.objects.components.ObjectEnumeratedColumnTableModel.ObjectsEnumeratedTableColumn; - -public class ObjectElementColumn - implements ObjectsEnumeratedTableColumn { - - private final String header; - private final Function getter; - - public ObjectElementColumn(String header, Function getter) { - this.header = header; - this.getter = getter; - } - - @Override - public String getHeader() { - return header; - } - - @Override - public Object getValueOf(ObjectElementRow row) { - row.setCurrentKey(header); - return getter.apply(row); - } - - public static ObjectsEnumeratedTableColumn[] generateColumns( - List keys) { - keys.sort(Comparator.comparing(String::toString)); - ObjectElementColumn[] array = new ObjectElementColumn[keys.size()]; - int i = 0; - for (String k : keys) { - ObjectElementColumn col = new ObjectElementColumn(k, ObjectElementRow::getValue); - array[i++] = col; - } - return array; - } -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectElementRow.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectElementRow.java deleted file mode 100644 index b5bcd818ff..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectElementRow.java +++ /dev/null @@ -1,97 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.objects.components; - -import java.util.*; - -import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsPlugin; -import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.TargetMethod; -import ghidra.dbg.target.TargetObject; - -public class ObjectElementRow { - - private Map map; - private TargetObject to; - private String currentKey; - - public ObjectElementRow(TargetObject ref, DebuggerObjectsProvider provider) { - this.to = ref; - to.fetchAttributes(RefreshBehavior.REFRESH_ALWAYS).thenAccept(attributes -> { - map = attributes; - }).exceptionally(ex -> { - DebuggerObjectsPlugin plugin = provider.getPlugin(); - plugin.objectError("Failed to fetch attributes", ex); - return null; - }); - } - - public void setAttributes(Map attributes) { - map = attributes; - } - - public List getKeys() { - List keys = new ArrayList(); - keys.add("Accessor"); - if (map == null) { - return keys; - } - for (String key : map.keySet()) { - Object value = map.get(key); - if (value instanceof TargetObject) { - TargetObject t = (TargetObject) value; - if (!(t instanceof TargetMethod)) { - keys.add(key); - } - } - else { - keys.add(key); - } - } - return keys; - } - - public void setCurrentKey(String key) { - this.currentKey = key; - } - - public Object getValue() { - if (currentKey.equals("Accessor")) { - return getTargetObject().getName(); - } - if (map == null) { - return ""; - } - Object value = map.get(currentKey); - if (value instanceof TargetObject) { - TargetObject obj = (TargetObject) value; - Map attributes = obj.getCachedAttributes(); - if (attributes.containsKey(TargetObject.VALUE_ATTRIBUTE_NAME)) { - return attributes.get(TargetObject.VALUE_ATTRIBUTE_NAME).toString(); - } - if (attributes.containsKey(TargetObject.DISPLAY_ATTRIBUTE_NAME)) { - return obj.getDisplay(); - } - } - return value == null ? "" : value; - } - - public TargetObject getTargetObject() { - return to; - } - -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectEnumeratedColumnTableModel.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectEnumeratedColumnTableModel.java deleted file mode 100644 index 4868e1bc3b..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectEnumeratedColumnTableModel.java +++ /dev/null @@ -1,253 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.objects.components; - -import java.util.*; -import java.util.function.Predicate; - -import javax.swing.SwingUtilities; -import javax.swing.event.TableModelEvent; - -import docking.widgets.table.AbstractSortedTableModel; -import docking.widgets.table.ColumnSortState.SortDirection; -import docking.widgets.table.EnumeratedColumnTableModel; -import ghidra.app.plugin.core.debug.gui.objects.components.ObjectEnumeratedColumnTableModel.ObjectsEnumeratedTableColumn; - -public class ObjectEnumeratedColumnTableModel, R> - extends AbstractSortedTableModel implements EnumeratedColumnTableModel { - - // NOTE: If I need to track indices, addSortListener - public static interface ObjectsEnumeratedTableColumn { - public Object getValueOf(R row); - - public String getHeader(); - - default public void setValueOf(R row, Object value) { - throw new UnsupportedOperationException("Cell is not editable"); - } - - default public boolean isEditable(R row) { - return false; - } - - default public boolean isSortable() { - return true; - } - - default public SortDirection defaultSortDirection() { - return SortDirection.ASCENDING; - } - } - - private final List modelData = new ArrayList<>(); - private final String name; - private C[] cols; - - public ObjectEnumeratedColumnTableModel(String name, C[] cols) { - this.name = name; - this.cols = cols; - } - - public void setColumns(C[] cols) { - this.cols = cols; - fireTableStructureChanged(); - } - - @Override - public String getName() { - return name; - } - - @Override - public List getModelData() { - return modelData; - } - - public List defaultSortOrder() { - return Collections.emptyList(); - } - - @Override - public int getRowCount() { - return modelData.size(); - } - - @Override - public int getColumnCount() { - return cols.length; - } - - @Override - public Object getValueAt(int rowIndex, int columnIndex) { - if (rowIndex >= modelData.size()) { - return ""; - } - return getColumnValueForRow(modelData.get(rowIndex), columnIndex); - } - - @Override - public void setValueAt(Object aValue, int rowIndex, int columnIndex) { - R row = modelData.get(rowIndex); - C col = cols[columnIndex]; - Class cls = String.class; - col.setValueOf(row, cls.cast(aValue)); - fireTableCellUpdated(rowIndex, columnIndex); - } - - @Override - public boolean isCellEditable(int rowIndex, int columnIndex) { - R row = modelData.get(rowIndex); - C col = cols[columnIndex]; - return col.isEditable(row); - } - - @Override - public boolean isSortable(int columnIndex) { - C col = cols[columnIndex]; - return col.isSortable(); - } - - @Override - public Class getColumnClass(int columnIndex) { - return String.class; - } - - @Override - public String getColumnName(int column) { - return cols[column].getHeader(); - } - - @Override - public Object getColumnValueForRow(R t, int columnIndex) { - if (columnIndex >= cols.length) { - return ""; - } - return cols[columnIndex].getValueOf(t); - } - - @Override - public void add(R row) { - int rowIndex = modelData.size(); - modelData.add(row); - fireTableRowsInserted(rowIndex, rowIndex); - } - - @Override - public void addAll(Collection c) { - int startIndex = modelData.size(); - modelData.addAll(c); - int endIndex = modelData.size() - 1; - fireTableRowsInserted(startIndex, endIndex); - } - - @Override - public void notifyUpdated(R row) { - int rowIndex = modelData.indexOf(row); - fireTableRowsUpdated(rowIndex, rowIndex); - } - - @Override - public List notifyUpdatedWith(Predicate predicate) { - int lastIndexUpdated = 0; - ListIterator rit = modelData.listIterator(); - List updated = new ArrayList<>(); - while (rit.hasNext()) { - R row = rit.next(); - if (predicate.test(row)) { - lastIndexUpdated = rit.previousIndex(); - updated.add(row); - } - } - int size = updated.size(); - if (size == 0) { - } - else if (size == 1) { - fireTableRowsUpdated(lastIndexUpdated, lastIndexUpdated); - } - else { - fireTableDataChanged(); - } - return updated; - } - - @Override - public void delete(R row) { - int rowIndex = modelData.indexOf(row); - modelData.remove(rowIndex); - fireTableRowsDeleted(rowIndex, rowIndex); - } - - @Override - public List deleteWith(Predicate predicate) { - int lastIndexRemoved = 0; - ListIterator rit = modelData.listIterator(); - List removed = new ArrayList<>(); - while (rit.hasNext()) { - R row = rit.next(); - if (predicate.test(row)) { - lastIndexRemoved = rit.previousIndex(); - rit.remove(); - removed.add(row); - } - } - int size = removed.size(); - if (size == 0) { - } - else if (size == 1) { - fireTableRowsDeleted(lastIndexRemoved, lastIndexRemoved); - } - else { - fireTableDataChanged(); - } - return removed; - } - - @Override - public R findFirst(Predicate predicate) { - for (R row : modelData) { - if (predicate.test(row)) { - return row; - } - } - return null; - } - - @Override - public void clear() { - modelData.clear(); - fireTableDataChanged(); - } - - public R getRow(int index) { - return modelData.get(index); - } - - public void updateColumns(ObjectElementRow x) { - List keys = x.getKeys(); - cols = (C[]) ObjectElementColumn.generateColumns(keys); - } - - @Override - public void fireTableChanged(TableModelEvent e) { - if (SwingUtilities.isEventDispatchThread()) { - super.fireTableChanged(e); - return; - } - final TableModelEvent e1 = e; - SwingUtilities.invokeLater(() -> super.fireTableChanged(e1)); - } - -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectNode.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectNode.java deleted file mode 100644 index d0d9bc181f..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectNode.java +++ /dev/null @@ -1,242 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.objects.components; - -import java.util.*; -import java.util.concurrent.*; - -import javax.swing.Icon; - -import docking.widgets.tree.*; -import generic.theme.GIcon; -import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider; -import ghidra.app.plugin.core.debug.gui.objects.ObjectContainer; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetExecutionStateful.TargetExecutionState; -import ghidra.util.Msg; -import ghidra.util.exception.CancelledException; -import ghidra.util.task.TaskMonitor; - -public class ObjectNode extends GTreeSlowLoadingNode { //extends GTreeNode - - static final Icon ICON_POPULATED = new GIcon("icon.debugger.node.object.populated"); - static final Icon ICON_EMPTY = new GIcon("icon.debugger.node.object.empty"); - static final Icon ICON_RUNNING = new GIcon("icon.debugger.node.object.running"); - static final Icon ICON_TERMINATED = new GIcon("icon.debugger.node.object.terminated"); - static final Icon ICON_EVENT = new GIcon("icon.debugger.node.object.event"); - - private ObjectContainer container; - private String name; - private ObjectTree tree; - private Set oldChildren; - private boolean restructured = false; - - public ObjectNode(ObjectTree tree, ObjectContainer parent, ObjectContainer container) { - this.tree = tree; - setContainer(tree, parent, container); - } - - public ObjectContainer getContainer() { - return container; - } - - public void setContainer(ObjectTree tree, ObjectContainer parent, ObjectContainer container) { - this.container = container; - name = container.getName(); - if (parent != null) { - tree.addToMap(parent, container, this); - } - //fireNodeStructureChanged(this); - } - - public TargetObject getTargetObject() { - return container.getTargetObject(); - } - - @Override - public String getName() { - return name; - } - - @Override - public String toString() { - return container.getDecoratedName(); - } - - @Override - public List generateChildren(TaskMonitor monitor) - throws CancelledException { - - if (!container.isImmutable() || isInProgress()) { - try { - CompletableFuture cf = - container.getOffspring(RefreshBehavior.REFRESH_WHEN_ABSENT); - if (cf != null) { - // NB: We're allowed to do this because we're guaranteed to be - // in our own thread by the GTreeSlowLoadingNode - ObjectContainer oc = - cf.get(tree.getProvider().getNodeTimeout(), TimeUnit.SECONDS); - return tree.update(oc); - } - } - catch (InterruptedException | ExecutionException e) { - Msg.warn(this, e); - } - catch (TimeoutException e) { - Msg.showWarn(this, container.getProvider().getComponent(), "Timeout Exception", - "Request for children timed - out - try refreshing the node"); - } - } - List list = new ArrayList<>(); - if (oldChildren != null) { - list.addAll(oldChildren); - } - return list; - } - - public DebuggerObjectsProvider getProvider() { - return container.getProvider(); - } - - @Override - public String getDisplayText() { - return getContainer().getDecoratedName(); - } - - @Override - public int loadAll(TaskMonitor monitor) throws CancelledException { - int count = 1; - if (!isLoaded()) { - return count; -// This was too aggressive: these children do not have provider or any of -// the necessary fields for constructing a node -// if (container.getCurrentChildren() == null) { -// return count; -// } -// doSetChildren(tree.update(container)); - } - List children = children(); - monitor = new TreeTaskMonitor(monitor, children.size()); - for (GTreeNode child : children) { - monitor.checkCancelled(); - count += child.loadAll(monitor); - monitor.incrementProgress(1); - } - return count; - } - - @Override - public Icon getIcon(boolean expanded) { - TargetObject targetObject = container.getTargetObject(); - if (targetObject instanceof TargetExecutionStateful) { - TargetExecutionStateful stateful = (TargetExecutionStateful) targetObject; - if (stateful.getExecutionState().equals(TargetExecutionState.RUNNING)) { - return ICON_RUNNING; - } - if (stateful.getExecutionState().equals(TargetExecutionState.TERMINATED)) { - return ICON_TERMINATED; - } - } - /* - Map attributeMap = container.getAttributeMap(); - if (attributeMap.containsKey(TargetExecutionStateful.STATE_ATTRIBUTE_NAME)) { - Object object = attributeMap.get(TargetExecutionStateful.STATE_ATTRIBUTE_NAME); - if (object.equals(TargetExecutionState.RUNNING)) { - return ICON_RUNNING; - } - } - */ - DebuggerObjectsProvider provider = getProvider(); - if (provider != null) { - ObjectContainer rootContainer = provider.getRoot(); - Map rootMap = rootContainer.getAttributeMap(); - if (rootMap.containsKey(TargetEventScope.EVENT_OBJECT_ATTRIBUTE_NAME)) { - TargetObject targetProcess = - (TargetObject) rootMap.get(TargetEventScope.EVENT_OBJECT_ATTRIBUTE_NAME); - if (container.getTargetObject().equals(targetProcess)) { - return ICON_EVENT; - } - } - } - return container.hasElements() ? ICON_POPULATED : ICON_EMPTY; - } - - @Override - public String getToolTip() { - return container.getDecoratedName(); - } - - @Override - public boolean isLeaf() { - TargetObject to = container.getTargetObject(); - return to != null && to instanceof DummyTargetObject; - } - - public boolean isVisible() { - return container.isVisible(); - } - - public void markExpanded() { - //container.subscribe(); - } - - public void markCollapsed() { - //container.unsubscribe(); - } - - public void cleanUpOldChildren(List newChildren) { - if (oldChildren != null) { - synchronized (oldChildren) { - oldChildren.removeAll(newChildren); - for (GTreeNode node : oldChildren) { - setRestructured(true); - tree.cleanupOldNode((ObjectNode) node); - } - } - } - oldChildren = new HashSet<>(newChildren); - } - - public void callUpdate() { - // NB: this has to be in its own thread - CompletableFuture.runAsync(() -> { - List updateNodes = tree.update(container); - if (isRestructured()) { - setChildren(updateNodes); - } - }); - } - - public void callModified() { - // NB: this has to be in its own thread - CompletableFuture.runAsync(() -> { - List updateNodes = tree.update(container); - for (GTreeNode n : updateNodes) { - n.fireNodeChanged(); - } - }); - } - - public boolean isRestructured() { - return restructured; - } - - public void setRestructured(boolean restructured) { - this.restructured = restructured; - } - -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectPane.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectPane.java deleted file mode 100644 index 0e845b9f59..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectPane.java +++ /dev/null @@ -1,51 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.objects.components; - -import java.util.List; - -import javax.swing.JComponent; - -import ghidra.app.plugin.core.debug.gui.objects.ObjectContainer; -import ghidra.dbg.target.TargetObject; - -public interface ObjectPane { - public ObjectContainer getContainer(); - - public TargetObject getTargetObject(); - - public TargetObject getSelectedObject(); - - public JComponent getComponent(); - - public JComponent getPrincipalComponent(); - - public List update(ObjectContainer container); - - public void signalDataChanged(ObjectContainer container); - - public void signalContentsChanged(ObjectContainer container); - - public void signalUpdate(ObjectContainer container); - - public String getName(); - - public void setFocus(TargetObject object, TargetObject focused); - - public void setSelectedObject(TargetObject object); - - public void setRoot(ObjectContainer root, TargetObject targetObject); -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectTable.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectTable.java deleted file mode 100644 index e6a303eaaa..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectTable.java +++ /dev/null @@ -1,310 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.objects.components; - -import java.awt.event.*; -import java.util.*; - -import javax.swing.*; - -import docking.widgets.table.AbstractSortedTableModel; -import docking.widgets.table.EnumeratedColumnTableModel; -import generic.theme.GIcon; -import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider; -import ghidra.app.plugin.core.debug.gui.objects.ObjectContainer; -import ghidra.dbg.DebugModelConventions; -import ghidra.dbg.target.TargetObject; -import ghidra.util.Msg; -import ghidra.util.Swing; -import ghidra.util.table.GhidraTable; - -public class ObjectTable implements ObjectPane { - - public static final Icon ICON_TABLE = new GIcon("icon.debugger.table.object"); - - private final ObjectContainer container; - private final Class clazz; - private final AbstractSortedTableModel model; - private final GhidraTable table; - private final JScrollPane component; - - public ObjectTable(ObjectContainer container, Class clazz, - AbstractSortedTableModel model) { - this.table = new GhidraTable(model); - this.component = new JScrollPane(table); - this.container = container; - this.clazz = clazz; - this.model = model; - - table.getSelectionModel().addListSelectionListener(e -> { - if (e.getValueIsAdjusting()) { - return; - } - DebuggerObjectsProvider provider = container.getProvider(); - provider.getTool().contextChanged(provider); - }); - table.setDefaultRenderer(String.class, - new ObjectTableCellRenderer(container.getProvider())); - table.setDefaultRenderer(Object.class, - new ObjectTableCellRenderer(container.getProvider())); - table.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent e) { - if (e.getClickCount() == 2 && e.getButton() == MouseEvent.BUTTON1) { - activateOrNavigateSelectedObject(); - } - } - }); - table.addKeyListener(new KeyAdapter() { - @Override - public void keyPressed(KeyEvent e) { - if (e.getKeyCode() == KeyEvent.VK_ENTER) { - activateOrNavigateSelectedObject(); - e.consume(); // lest it select the next row down - } - } - }); - container.subscribe(); - signalUpdate(container); - } - - private void activateOrNavigateSelectedObject() { - int selectedRow = table.getSelectedRow(); - int selectedColumn = table.getSelectedColumn(); - Object value = table.getValueAt(selectedRow, selectedColumn); - if (container.getProvider() - .navigateToSelectedObject(container.getTargetObject(), value) != null) { - return; - } - R row = model.getModelData().get(selectedRow); // No filter? - TargetObject object; - if (row instanceof ObjectElementRow eRow) { - object = eRow.getTargetObject(); - } - else if (row instanceof ObjectAttributeRow aRow) { - object = aRow.getTargetObject(); - } - else { - return; - } - if (object instanceof DummyTargetObject) { - return; - } - DebugModelConventions.requestActivation(object).exceptionally(ex -> { - Msg.error(this, "Could not activate " + object, ex); - return null; - }); - /*DebugModelConventions.requestFocus(object).exceptionally(ex -> { - Msg.error(this, "Could not focus " + object, ex); - return null; - });*/ - } - - @Override - public ObjectContainer getContainer() { - return container; - } - - @Override - public TargetObject getTargetObject() { - return container.getTargetObject(); - } - - @Override - public JComponent getComponent() { - return component; - } - - @Override - public JComponent getPrincipalComponent() { - return table; - } - - @Override - public String getName() { - TargetObject targetObject = getTargetObject(); - return targetObject == null ? "Main" : targetObject.getName(); - } - - @Override - public void signalDataChanged(ObjectContainer oc) { - Swing.runIfSwingOrRunLater(() -> { - update(oc); - }); - } - - @Override - public void signalContentsChanged(ObjectContainer oc) { - Swing.runIfSwingOrRunLater(() -> { - update(oc); - }); - } - - @Override - public void signalUpdate(ObjectContainer oc) { - Swing.runIfSwingOrRunLater(() -> { - update(oc); - }); - } - - @Override - public List update(ObjectContainer changed) { - if (changed.equals(container) && - ((clazz.equals(ObjectElementRow.class) && changed.hasElements()) || - (clazz.equals(ObjectAttributeRow.class) && !changed.hasElements()))) { - return generateRows(changed); - } - else if (clazz.equals(ObjectElementRow.class) && !changed.hasElements()) { - ObjectElementRow match = findMatch(changed); - if (match != null) { - return updateMatch(match); - } - } - return new ArrayList<>(); - } - - private List generateRows(ObjectContainer changed) { - List list = new ArrayList<>(); - for (ObjectContainer child : changed.getCurrentChildren()) { - if (child.isVisible() || !getContainer().getProvider().isHideIntrinsics()) { - TargetObject to = child.getTargetObject(); - try { - R r = clazz - .getDeclaredConstructor(TargetObject.class, - DebuggerObjectsProvider.class) - .newInstance(to, container.getProvider()); - list.add(r); - } - catch (Exception e) { - e.printStackTrace(); - } - } - } - if (model instanceof EnumeratedColumnTableModel) { - @SuppressWarnings("unchecked") - EnumeratedColumnTableModel m = (EnumeratedColumnTableModel) model; - m.clear(); - m.addAll(list); - } - for (ObjectContainer child : changed.getCurrentChildren()) { - if (child.isVisible()) { - update(child); - } - } - model.fireTableStructureChanged(); - return list; - } - - private ObjectElementRow findMatch(ObjectContainer changed) { - TargetObject changedTarget = changed.getTargetObject(); - ObjectElementRow match = null; - for (int i = 0; i < model.getRowCount(); i++) { - R r = model.getRowObject(i); - if (r instanceof ObjectElementRow row) { - if (row.getTargetObject().equals(changedTarget)) { - row.setAttributes(changed.getAttributeMap()); - match = row; - break; - } - } - } - return match; - } - - private List updateMatch(ObjectElementRow match) { - ObjectEnumeratedColumnTableModel m = (ObjectEnumeratedColumnTableModel) model; - m.updateColumns(match); - m.fireTableDataChanged(); - List list = new ArrayList<>(); - if (match != null) { - list.add((R) match); - model.setLastSelectedObjects(list); - model.fireTableStructureChanged(); - } - return list; - } - - public void setColumns() { - ObjectEnumeratedColumnTableModel m = (ObjectEnumeratedColumnTableModel) model; - for (int i = 0; i < model.getRowCount(); i++) { - R r = model.getRowObject(i); - if (r instanceof ObjectElementRow row) { - m.updateColumns(row); - break; - } - } - m.fireTableStructureChanged(); - } - - @Override - public TargetObject getSelectedObject() { - int selectedColumn = table.getSelectedColumn(); - R r = model.getRowObject(table.getSelectedRow()); - if (r instanceof ObjectAttributeRow row) { - return row.getTargetObject(); - } - if (r instanceof ObjectElementRow row) { - TargetObject targetObject = row.getTargetObject(); - if (selectedColumn > 0) { - List keys = row.getKeys(); - if (selectedColumn >= keys.size()) { - selectedColumn = 0; - } - String key = keys.get(selectedColumn); - Map attributes = targetObject.getCachedAttributes(); - Object object = attributes.get(key); - if (object instanceof TargetObject to) { - return to; - } - } - return targetObject; - } - return null; - } - - @Override - public void setSelectedObject(TargetObject selection) { - for (int i = 0; i < model.getRowCount(); i++) { - R r = model.getRowObject(i); - if (r instanceof ObjectAttributeRow row) { - if (row.getTargetObject().equals(selection)) { - table.selectRow(i); - break; - } - } - if (r instanceof ObjectElementRow row) { - if (row.getTargetObject().equals(selection)) { - table.selectRow(i); - break; - } - } - } - } - - @Override - public void setFocus(TargetObject object, TargetObject focused) { - // Should this setSelectedObject, too? - Swing.runIfSwingOrRunLater(() -> { - table.repaint(); - }); - } - - @Override - public void setRoot(ObjectContainer container, TargetObject targetObject) { - container.setTargetObject(targetObject); - } - -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectTableCellRenderer.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectTableCellRenderer.java deleted file mode 100644 index 8ace1a8bba..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectTableCellRenderer.java +++ /dev/null @@ -1,62 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.objects.components; - -import java.awt.Component; - -import docking.widgets.table.GTableCellRenderingData; -import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.util.PathUtils; -import ghidra.docking.settings.Settings; -import ghidra.util.table.column.AbstractGhidraColumnRenderer; - -public class ObjectTableCellRenderer extends AbstractGhidraColumnRenderer { - private final DebuggerObjectsProvider provider; - - public ObjectTableCellRenderer(DebuggerObjectsProvider provider) { - this.provider = provider; - } - - @Override - public String getFilterString(Object t, Settings settings) { - return t == null ? "" : t.toString(); - } - - @Override - public Component getTableCellRendererComponent(GTableCellRenderingData data) { - super.getTableCellRendererComponent(data); - TargetObject focus = provider.getFocus(); - if (focus == null) { - return this; - } - Object rowObject = data.getRowObject(); - TargetObject object; - if (rowObject instanceof ObjectElementRow eRow) { - object = eRow.getTargetObject(); - } - else if (rowObject instanceof ObjectAttributeRow aRow) { - object = aRow.getTargetObject(); - } - else { - return this; - } - if (PathUtils.isAncestor(object.getPath(), focus.getPath())) { - setBold(); - } - return this; - } -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectTree.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectTree.java deleted file mode 100644 index d89fddcbd4..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectTree.java +++ /dev/null @@ -1,429 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.objects.components; - -import java.awt.Point; -import java.awt.event.*; -import java.util.*; -import java.util.concurrent.atomic.AtomicReference; - -import javax.swing.*; -import javax.swing.event.TreeExpansionEvent; -import javax.swing.event.TreeExpansionListener; -import javax.swing.tree.TreePath; -import javax.swing.tree.TreeSelectionModel; - -import docking.widgets.tree.GTree; -import docking.widgets.tree.GTreeNode; -import docking.widgets.tree.support.GTreeSelectionEvent; -import docking.widgets.tree.support.GTreeSelectionEvent.EventOrigin; -import docking.widgets.tree.support.GTreeSelectionListener; -import generic.theme.GIcon; -import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider; -import ghidra.app.plugin.core.debug.gui.objects.ObjectContainer; -import ghidra.async.AsyncUtils; -import ghidra.async.TypeSpec; -import ghidra.dbg.DebugModelConventions; -import ghidra.dbg.target.TargetAccessConditioned; -import ghidra.dbg.target.TargetObject; -import ghidra.util.Msg; -import ghidra.util.Swing; -import ghidra.util.task.SwingUpdateManager; - -public class ObjectTree implements ObjectPane { - - public static final Icon ICON_TREE = new GIcon("icon.debugger.tree.object"); - - private static class MyGTree extends GTree { - public MyGTree(GTreeNode root) { - super(root); - getJTree().setToggleClickCount(0); - } - - private JTree tree() { - return getJTree(); - } - } - - private final ObjectNode root; - private final MyGTree tree; - - private final Map nodeMap = new LinkedHashMap<>(); - private final SwingUpdateManager restoreTreeStateManager = - new SwingUpdateManager(this::restoreTreeState); - - private TreePath[] currentSelectionPaths; - private List currentExpandedPaths; - private Point currentViewPosition; - - public ObjectTree(ObjectContainer container) { - this.root = new ObjectNode(this, null, container); - addToMap(null, container, root); - this.tree = new MyGTree(root); - - tree.addGTreeSelectionListener(new GTreeSelectionListener() { - @Override - public void valueChanged(GTreeSelectionEvent e) { - DebuggerObjectsProvider provider = container.getProvider(); - provider.updateActions(container); - provider.getTool().contextChanged(provider); - if (e.getEventOrigin() == EventOrigin.INTERNAL_GENERATED) { - restoreTreeStateManager.updateLater(); - return; - } - TreePath[] selectionPaths = tree.getSelectionPaths(); - if (e.getEventOrigin() == EventOrigin.API_GENERATED) { - if (currentSelectionPaths != null && currentSelectionPaths.length > 0) { - if (selectionPaths != null && selectionPaths.length > 0) { - TreePath currentPath = currentSelectionPaths[0]; - TreePath selectedPath = selectionPaths[0]; - // NB. isDescendant == has a descendant - if (selectedPath.isDescendant(currentPath)) { - return; - } - } - } - } - currentSelectionPaths = selectionPaths; - List paths = tree.getExpandedPaths(); - if (currentExpandedPaths == null) { - currentExpandedPaths = paths; - } - else if (paths != null && (paths.size() >= currentExpandedPaths.size())) { - currentExpandedPaths = paths; - } - currentViewPosition = tree.getViewPosition(); - restoreTreeStateManager.updateLater(); - } - }); - tree.setCellRenderer(new ObjectTreeCellRenderer(root.getProvider())); - tree.setDataTransformer(t -> { - if (t instanceof ObjectNode node) { - return List.of(node.getContainer().getDecoratedName()); - } - return null; - }); - tree.addTreeExpansionListener(new TreeExpansionListener() { - - @Override - public void treeExpanded(TreeExpansionEvent event) { - TreePath expandedPath = event.getPath(); - Object last = expandedPath.getLastPathComponent(); - if (last instanceof ObjectNode node) { - node.markExpanded(); - currentExpandedPaths = tree.getExpandedPaths(); - } - } - - @Override - public void treeCollapsed(TreeExpansionEvent event) { - TreePath collapsedPath = event.getPath(); - Object last = collapsedPath.getLastPathComponent(); - if (last instanceof ObjectNode node) { - node.markCollapsed(); - currentExpandedPaths = tree.getExpandedPaths(); - } - } - }); - - tree.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent e) { - if (e.getClickCount() == 2 && e.getButton() == MouseEvent.BUTTON1) { - activateOrNavigateSelectedObject(); - } - } - }); - tree.tree().addKeyListener(new KeyAdapter() { - @Override - public void keyPressed(KeyEvent e) { - if (e.getKeyCode() == KeyEvent.VK_ENTER) { - activateOrNavigateSelectedObject(); - e.consume(); - } - } - }); - - tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); - tree.setSelectedNode(root); - } - - private void activateOrNavigateSelectedObject() { - TargetObject object = getSelectedObject(); - if (object == null) { - return; - } - if (getProvider().navigateToSelectedObject(object, null) != null) { - return; - } - if (object instanceof DummyTargetObject) { - return; - } - DebugModelConventions.requestActivation(object).exceptionally(ex -> { - Msg.error(this, "Could not activate " + object, ex); - return null; - }); - /*DebugModelConventions.requestFocus(object).exceptionally(ex -> { - Msg.error(this, "Could not focus " + object, ex); - return null; - });*/ - } - - @Override - public ObjectContainer getContainer() { - return root.getContainer(); - } - - @Override - public TargetObject getTargetObject() { - return root.getTargetObject(); - } - - public DebuggerObjectsProvider getProvider() { - return root.getProvider(); - } - - @Override - public TargetObject getSelectedObject() { - TreePath path = tree.getSelectionPath(); - if (path == null && currentSelectionPaths != null && currentSelectionPaths.length > 0) { - path = currentSelectionPaths[0]; - } - if (path != null) { - Object last = path.getLastPathComponent(); - if (last instanceof ObjectNode node) { - return node.getContainer().getTargetObject(); - } - } - return null; - } - - @Override - public JComponent getComponent() { - return tree; - } - - @Override - public JComponent getPrincipalComponent() { - return tree; - } - - private void restoreTreeState() { - if (currentExpandedPaths != null) { - if (!tree.getExpandedPaths().equals(currentExpandedPaths)) { - tree.expandPaths(currentExpandedPaths); - } - } - if (currentSelectionPaths != null) { - tree.setSelectionPaths(currentSelectionPaths); - } - if (currentViewPosition != null) { - tree.runTask(m -> { - if (currentViewPosition != null) { - tree.setViewPosition(currentViewPosition); - } - currentViewPosition = null; - }); - } - } - - @Override - public String getName() { - TargetObject targetObject = getTargetObject(); - return targetObject == null ? "Main" : targetObject.getName(); - } - - @Override - public void signalContentsChanged(ObjectContainer container) { - ObjectNode node = nodeMap.get(path(container)); - if (node != null) { - node.callUpdate(); - } - } - - @Override - public void signalDataChanged(ObjectContainer container) { - Swing.runIfSwingOrRunLater(() -> { - ObjectNode node = nodeMap.get(path(container)); - if (node != null) { - node.setContainer(this, container.getParent(), container); - node.fireNodeChanged(); - } - }); - } - - @Override - public void signalUpdate(ObjectContainer container) { - AtomicReference access = new AtomicReference<>(); - TargetObject targetObject = container.getTargetObject(); - if (targetObject == null) { - return; - } - AsyncUtils.sequence(TypeSpec.VOID).then(seq -> { - DebugModelConventions.findSuitable(TargetAccessConditioned.class, targetObject) - .handle(seq::next); - }, access).then(seq -> { - boolean accessible = true; - TargetAccessConditioned conditioned = access.get(); - if (conditioned != null) { - accessible = conditioned.isAccessible(); - } - if (accessible) { - Swing.runIfSwingOrRunLater(() -> { - ObjectNode node = nodeMap.get(path(container)); - //Msg.debug(this, "update node: " + node); - if (node != null) { - if (currentSelectionPaths == null) { - currentSelectionPaths = tree.getSelectionPaths(); - } - if (currentExpandedPaths == null) { - currentExpandedPaths = tree.getExpandedPaths(); - } - if (currentViewPosition == null) { - currentViewPosition = tree.getViewPosition(); - } - tree.runTask(monitor -> node.unloadChildren()); - restoreTreeStateManager.updateLater(); - } - }); - } - }).finish(); - } - - public void waitOnLoad() { - List expandedPaths = tree.getExpandedPaths(); - while (!checkLoaded(expandedPaths)) { - try { - Thread.sleep(10); - } - catch (InterruptedException e) { - e.printStackTrace(); - } - } - } - - private boolean checkLoaded(List expandedPaths) { - for (TreePath path : expandedPaths) { - Object[] objs = path.getPath(); - for (int i = 0; i < objs.length - 2; i++) { - if (objs[i] instanceof ObjectNode node) { - if (!node.isLoaded()) { - return false; - } - } - } - } - return true; - } - - @Override - public List update(ObjectContainer container) { - ObjectNode node = nodeMap.get(path(container)); - if (node == null) { - if (path(container) != null) { - Msg.warn(this, "Missing node: " + path(container)); - } - return new ArrayList<>(); - } - - Set currentChildren = container.getCurrentChildren(); - List childList = new ArrayList<>(); - - node.setRestructured(false); - for (ObjectContainer c : currentChildren) { - ObjectNode nc; - String path = path(c); - boolean hideIntrinsics = getContainer().getProvider().isHideIntrinsics(); - if (c.isVisible() || !hideIntrinsics) { - if (nodeMap.containsKey(path)) { - nc = nodeMap.get(path); - nc.setContainer(this, container, c); - } - else { - node.setRestructured(true); - nc = new ObjectNode(this, container, c); - } - childList.add(nc); - } - } - node.markExpanded(); - node.cleanUpOldChildren(childList); - return childList; - } - - private String path(ObjectContainer container) { - if (container == null) { - return null; - } - return container.getTreePath(); - } - - @Override - public void setFocus(TargetObject object, TargetObject focused) { - Swing.runIfSwingOrRunLater(() -> { - List path = focused.getPath(); - tree.setSelectedNodeByNamePath(addRootNameToPath(path)); - }); - } - - @Override - public void setSelectedObject(TargetObject object) { - Swing.runIfSwingOrRunLater(() -> { - List path = object.getPath(); - tree.setSelectedNodeByNamePath(addRootNameToPath(path)); - }); - } - - private String[] addRootNameToPath(List path) { - String[] fullPath = new String[path.size() + 1]; - fullPath[0] = tree.getModelRoot().getName(); - for (int i = 0; i < path.size(); i++) { - fullPath[i + 1] = path.get(i); - } - return fullPath; - } - - public void addToMap(ObjectContainer parent, ObjectContainer container, ObjectNode node) { - String ppath = parent == null ? "" : parent.getTreePath(); - String tpath = ppath + ":" + node.getName(); - container.setTreePath(tpath); - nodeMap.put(tpath, node); - } - - @Override - public void setRoot(ObjectContainer container, TargetObject targetObject) { - nodeMap.remove(path(container)); - container.setTargetObject(targetObject); - root.setContainer(this, null, container); - nodeMap.put(path(container), root); - tree.setRootVisible(true); - // tree.setSelectedNode(root); - } - - public void setSelectedNode(ObjectNode node) { - if (tree != null) { - tree.setSelectedNode(node); - } - } - - public void cleanupOldNode(ObjectNode node) { - DebuggerObjectsProvider provider = getProvider(); - ObjectContainer oc = node.getContainer(); - provider.deleteFromMap(oc); - nodeMap.remove(path(node.getContainer())); - } - -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectTreeCellRenderer.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectTreeCellRenderer.java deleted file mode 100644 index 8f2cd0d60a..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/objects/components/ObjectTreeCellRenderer.java +++ /dev/null @@ -1,124 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.objects.components; - -import java.awt.*; -import java.util.Map; - -import javax.swing.JTree; -import javax.swing.tree.TreePath; - -import docking.widgets.tree.support.GTreeRenderer; -import generic.theme.GColor; -import generic.theme.Gui; -import ghidra.app.plugin.core.debug.gui.objects.DebuggerObjectsProvider; -import ghidra.app.plugin.core.debug.gui.objects.ObjectContainer; -import ghidra.dbg.target.TargetExecutionStateful; -import ghidra.dbg.target.TargetExecutionStateful.TargetExecutionState; -import ghidra.dbg.target.TargetObject; - -class ObjectTreeCellRenderer extends GTreeRenderer { - - private static final Color COLOR_FOREGROUND_SELECTION = new GColor("color.fg.tree.selected"); - private static final String FONT_ID = "font.debugger.object.tree.renderer"; - - private final DebuggerObjectsProvider provider; - - public ObjectTreeCellRenderer(DebuggerObjectsProvider provider) { - this.provider = provider; - } - - @Override - public Component getTreeCellRendererComponent(JTree t, Object value, boolean sel, boolean exp, - boolean leaf, int row, boolean focus) { - Component component = - super.getTreeCellRendererComponent(t, value, sel, exp, leaf, row, focus); - if (value instanceof ObjectNode node) { - ObjectContainer container = node.getContainer(); - setText(container.getDecoratedName()); - component.setForeground(provider.COLOR_FOREGROUND); - TargetObject targetObject = container.getTargetObject(); - if (container.isSubscribed()) { - Color color = provider.COLOR_FOREGROUND_SUBSCRIBED; - if (!color.equals(getTextNonSelectionColor())) { - component.setForeground(color); - } - } - if (targetObject != null) { - Map attrs = targetObject.getCachedAttributes(); - String kind = (String) attrs.get(TargetObject.KIND_ATTRIBUTE_NAME); - if (kind != null && !kind.equals("")) { - if (kind.equals("OBJECT_INTRINSIC")) { - container.subscribe(); - } - setColor(component, kind); - } - } - if (!node.isVisible() && !provider.isHideIntrinsics()) { - component.setForeground(provider.COLOR_FOREGROUND_INVISIBLE); - } - if (container.getTargetObject() instanceof TargetExecutionStateful) { - TargetExecutionStateful stateful = (TargetExecutionStateful) targetObject; - if (stateful.getExecutionState().equals(TargetExecutionState.TERMINATED)) { - component.setForeground(provider.COLOR_FOREGROUND_INVALIDATED); - } - } - if (container.isLink()) { - component.setForeground(provider.COLOR_FOREGROUND_LINK); - } - if (container.isModified()) { - component.setForeground(provider.COLOR_FOREGROUND_MODIFIED); - } - TreePath path = t.getSelectionPath(); - if (path != null) { - Object last = path.getLastPathComponent(); - if (last instanceof ObjectNode) { - ObjectContainer selection = ((ObjectNode) last).getContainer(); - if (container.equals(selection)) { - component.setForeground(COLOR_FOREGROUND_SELECTION); - } - } - } - Font font = Gui.getFont(FONT_ID); - if (container.isFocused()) { - font = font.deriveFont(Font.BOLD); - } - component.setFont(font); - } - return component; - } - - private void setColor(Component component, String kind) { - switch (kind) { - case "OBJECT_PROPERTY_ACCESSOR": - component.setForeground(provider.COLOR_FOREGROUND); - break; - case "OBJECT_INTRINSIC": - component.setForeground(provider.COLOR_FOREGROUND_INTRINSIC); - break; - case "OBJECT_TARGET_OBJECT": - component.setForeground(provider.COLOR_FOREGROUND_TARGET); - break; - case "OBJECT_ERROR": - component.setForeground(provider.COLOR_FOREGROUND_ERROR); - break; - } - } - - protected Component highlight(Component component) { - return component; - } -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/target/DebuggerConnectionsNode.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/target/DebuggerConnectionsNode.java deleted file mode 100644 index 04afb24577..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/target/DebuggerConnectionsNode.java +++ /dev/null @@ -1,114 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.target; - -import java.util.*; - -import docking.widgets.tree.SearchableByObjectGTreeNode; -import ghidra.app.plugin.core.debug.gui.DebuggerResources.AbstractDebuggerConnectionsNode; -import ghidra.app.services.DebuggerModelService; -import ghidra.dbg.DebuggerObjectModel; -import ghidra.util.Swing; -import ghidra.util.datastruct.CollectionChangeListener; - -public class DebuggerConnectionsNode extends AbstractDebuggerConnectionsNode - implements SearchableByObjectGTreeNode { - - protected class ModelsChangedListener implements CollectionChangeListener { - @Override - public void elementAdded(DebuggerObjectModel element) { - DebuggerModelNode node; - synchronized (models) { - if (models.containsKey(element)) { - return; - } - node = new DebuggerModelNode(element, provider); - models.put(element, node); - } - Swing.runIfSwingOrRunLater(() -> { - addNode(node); - expand(); - }); - } - - @Override - public void elementModified(DebuggerObjectModel element) { - fireNodeChanged(); - } - - @Override - public void elementRemoved(DebuggerObjectModel element) { - DebuggerModelNode node; - synchronized (models) { - node = models.remove(element); - if (node == null) { - return; - } - } - Swing.runIfSwingOrRunLater(() -> { - removeNode(node); - }); - } - } - - private final DebuggerModelService service; - private final DebuggerTargetsProvider provider; - - private final Map models = new HashMap<>(); - private final ModelsChangedListener modelsChangedListener = new ModelsChangedListener(); - - public DebuggerConnectionsNode(DebuggerModelService service, - DebuggerTargetsProvider provider) { - this.service = service; - this.provider = provider; - if (service == null) { - return; - } - service.addModelsChangedListener(modelsChangedListener); - Set toAdd = new LinkedHashSet<>(); - synchronized (models) { - Set current = service.getModels(); - for (DebuggerObjectModel element : current) { - DebuggerModelNode node = new DebuggerModelNode(element, provider); - models.put(element, node); - toAdd.add(node); - } - } - for (DebuggerModelNode node : toAdd) { - addNode(node); - } - } - - @Override - public void dispose() { - service.removeModelsChangedListener(modelsChangedListener); - super.dispose(); - } - - @Override - public boolean isLeaf() { - return false; - } - - public DebuggerModelService getTargetService() { - return service; - } - - @Override - public Map getObjectNodeMap() { - return models; - } -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/target/DebuggerModelActionContext.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/target/DebuggerModelActionContext.java deleted file mode 100644 index 5985c8f8c7..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/target/DebuggerModelActionContext.java +++ /dev/null @@ -1,56 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.target; - -import java.util.function.Function; - -import javax.swing.tree.TreePath; - -import docking.ComponentProvider; -import docking.DefaultActionContext; -import docking.widgets.tree.GTree; -import docking.widgets.tree.GTreeNode; -import ghidra.app.services.DebuggerModelService; -import ghidra.dbg.DebuggerObjectModel; - -public class DebuggerModelActionContext extends DefaultActionContext { - private final TreePath path; - - DebuggerModelActionContext(ComponentProvider provider, TreePath path, GTree tree) { - super(provider, path, tree); - this.path = path; - } - - protected U getIf(Class cls, Function getter) { - if (path == null) { - return null; - } - Object last = path.getLastPathComponent(); - if (!cls.isAssignableFrom(last.getClass())) { - return null; - } - T node = cls.cast(last); - return getter.apply(node); - } - - public DebuggerModelService getIfModelService() { - return getIf(DebuggerConnectionsNode.class, DebuggerConnectionsNode::getTargetService); - } - - public DebuggerObjectModel getIfDebuggerModel() { - return getIf(DebuggerModelNode.class, DebuggerModelNode::getDebuggerModel); - } -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/target/DebuggerModelNode.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/target/DebuggerModelNode.java deleted file mode 100644 index 4c79c2599b..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/target/DebuggerModelNode.java +++ /dev/null @@ -1,60 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.target; - -import java.util.Objects; - -import ghidra.app.plugin.core.debug.gui.DebuggerResources.AbstractDebuggerModelNode; -import ghidra.dbg.DebuggerModelListener; -import ghidra.dbg.DebuggerObjectModel; - -public class DebuggerModelNode extends AbstractDebuggerModelNode implements DebuggerModelListener { - private final DebuggerObjectModel model; - private final DebuggerTargetsProvider provider; - private String name; - - public DebuggerModelNode(DebuggerObjectModel model, DebuggerTargetsProvider provider) { - this.model = Objects.requireNonNull(model); - this.provider = Objects.requireNonNull(provider); - name = model.getClass() + "@" + Integer.toHexString(System.identityHashCode(model)); - - model.addModelListener(this); - } - - @Override - public String getDisplayText() { - return model.getBrief(); - } - - @Override - public String getName() { - return name; - } - - @Override - public boolean isLeaf() { - return true; - } - - public DebuggerObjectModel getDebuggerModel() { - return model; - } - - @Override - public void modelStateChanged() { - provider.updateTree(false, null); - } -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/target/DebuggerTargetsPlugin.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/target/DebuggerTargetsPlugin.java deleted file mode 100644 index 3a6c49439b..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/target/DebuggerTargetsPlugin.java +++ /dev/null @@ -1,71 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.target; - -import ghidra.app.plugin.PluginCategoryNames; -import ghidra.app.plugin.core.debug.AbstractDebuggerPlugin; -import ghidra.app.plugin.core.debug.DebuggerPluginPackage; -import ghidra.app.plugin.core.debug.event.ModelActivatedPluginEvent; -import ghidra.app.services.DebuggerModelService; -import ghidra.framework.plugintool.*; -import ghidra.framework.plugintool.annotation.AutoServiceConsumed; -import ghidra.framework.plugintool.util.PluginStatus; - -@PluginInfo( - shortDescription = "Debugger targets manager", - description = """ - GUI to manage connections to external debuggers and trace recording. \ - Deprecated since 11.2 for removal in 11.3.""", - category = PluginCategoryNames.DEBUGGER, - packageName = DebuggerPluginPackage.NAME, - status = PluginStatus.DEPRECATED, - eventsConsumed = { - ModelActivatedPluginEvent.class, - }, - servicesRequired = { - DebuggerModelService.class, - }) -public class DebuggerTargetsPlugin extends AbstractDebuggerPlugin { - @AutoServiceConsumed - protected DebuggerModelService modelService; - - protected DebuggerTargetsProvider provider; - - public DebuggerTargetsPlugin(PluginTool tool) { - super(tool); - } - - @Override - protected void init() { - provider = new DebuggerTargetsProvider(this); - super.init(); - } - - @Override - protected void dispose() { - tool.removeComponentProvider(provider); - super.dispose(); - } - - @Override - public void processEvent(PluginEvent event) { - super.processEvent(event); - if (event instanceof ModelActivatedPluginEvent) { - ModelActivatedPluginEvent evt = (ModelActivatedPluginEvent) event; - provider.modelActivated(evt.getActiveModel()); - } - } -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/target/DebuggerTargetsProvider.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/target/DebuggerTargetsProvider.java deleted file mode 100644 index 1f306272ad..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/target/DebuggerTargetsProvider.java +++ /dev/null @@ -1,310 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.target; - -import static ghidra.app.plugin.core.debug.gui.DebuggerResources.*; - -import java.awt.BorderLayout; -import java.awt.event.MouseEvent; - -import javax.swing.JComponent; -import javax.swing.JPanel; -import javax.swing.tree.TreePath; -import javax.swing.tree.TreeSelectionModel; - -import docking.ActionContext; -import docking.WindowPosition; -import docking.action.*; -import docking.widgets.tree.*; -import docking.widgets.tree.support.GTreeSelectionEvent.EventOrigin; -import ghidra.app.plugin.core.debug.DebuggerPluginPackage; -import ghidra.app.plugin.core.debug.gui.DebuggerResources; -import ghidra.app.plugin.core.debug.gui.DebuggerResources.*; -import ghidra.app.services.DebuggerModelService; -import ghidra.app.services.ProgramManager; -import ghidra.dbg.DebuggerObjectModel; -import ghidra.framework.plugintool.AutoService; -import ghidra.framework.plugintool.ComponentProviderAdapter; -import ghidra.framework.plugintool.annotation.AutoServiceConsumed; -import ghidra.program.model.listing.Program; - -public class DebuggerTargetsProvider extends ComponentProviderAdapter { - - protected static DebuggerModelService getModelServiceFromContext(ActionContext context) { - if (!(context instanceof DebuggerModelActionContext)) { - return null; - } - DebuggerModelActionContext ctx = (DebuggerModelActionContext) context; - return ctx.getIfModelService(); - } - - protected static DebuggerObjectModel getModelFromContext(ActionContext context) { - if (!(context instanceof DebuggerModelActionContext)) { - return null; - } - DebuggerModelActionContext ctx = (DebuggerModelActionContext) context; - return ctx.getIfDebuggerModel(); - } - - protected class FlushCachesAction extends AbstractFlushCachesAction { - public static final String GROUP = DebuggerResources.GROUP_MAINTENANCE; - - public FlushCachesAction() { - super(plugin); - setPopupMenuData(new MenuData(new String[] { NAME }, GROUP)); - addLocalAction(this); - setEnabled(true); - } - - @Override - public void actionPerformed(ActionContext context) { - DebuggerModelService service = myActionContext.getIfModelService(); - if (service != null) { - clearServiceCaches(service); - return; - } - DebuggerObjectModel model = myActionContext.getIfDebuggerModel(); - if (model != null) { - model.invalidateAllLocalCaches(); - return; - } - } - - @Override - public boolean isAddToPopup(ActionContext context) { - if (myActionContext.getIfModelService() != null) { - return true; - } - if (myActionContext.getIfDebuggerModel() != null) { - return true; - } - return false; - } - } - - protected class ConnectAction extends AbstractConnectAction { - public static final String GROUP = DebuggerResources.GROUP_CONNECTION; - - public ConnectAction() { - super(plugin); - setToolBarData(new ToolBarData(ICON, GROUP)); - setPopupMenuData(new MenuData(new String[] { NAME }, ICON, GROUP)); - addLocalAction(this); - } - - @Override - public void actionPerformed(ActionContext context) { - // NB. Drop the future on the floor, because the UI will report issues. - // Cancellation should be ignored. - ProgramManager programManager = tool.getService(ProgramManager.class); - Program program = programManager == null ? null : programManager.getCurrentProgram(); - modelService.showConnectDialog(program); - } - - @Override - public boolean isAddToPopup(ActionContext context) { - return getModelServiceFromContext(myActionContext) != null; - } - - @Override - public boolean isEnabledForContext(ActionContext context) { - return modelService != null; - } - } - - protected class DisconnectAction extends AbstractDisconnectAction { - public static final String GROUP = DebuggerResources.GROUP_CONNECTION; - - public DisconnectAction() { - super(plugin); - setMenuBarData(new MenuData(new String[] { NAME }, ICON, GROUP)); - setPopupMenuData(new MenuData(new String[] { NAME }, ICON, GROUP)); - addLocalAction(this); - setEnabled(false); - } - - @Override - public void actionPerformed(ActionContext context) { - DebuggerObjectModel model = getModelFromContext(myActionContext); - if (model == null) { - return; - } - model.close().exceptionally(showError(getComponent(), "Problem disconnecting")); - } - - @Override - public boolean isAddToPopup(ActionContext context) { - return getModelFromContext(myActionContext) != null; - } - - @Override - public boolean isEnabledForContext(ActionContext context) { - return getModelFromContext(myActionContext) != null; - } - } - - final DebuggerTargetsPlugin plugin; - - @AutoServiceConsumed - DebuggerModelService modelService; - @SuppressWarnings("unused") - private final AutoService.Wiring autoServiceWiring; - - private JPanel mainPanel; - protected GTree tree; - protected DebuggerConnectionsNode rootNode; - - ConnectAction actionConnect; - DisconnectAction actionDisconnect; - DockingAction actionDisconnectAll; - FlushCachesAction actionFlushCaches; - - DebuggerModelActionContext myActionContext; - - public DebuggerTargetsProvider(final DebuggerTargetsPlugin plugin) { - super(plugin.getTool(), DebuggerResources.TITLE_PROVIDER_TARGETS, plugin.getName()); - this.plugin = plugin; - - this.autoServiceWiring = AutoService.wireServicesConsumed(plugin, this); - - setTitle(DebuggerResources.TITLE_PROVIDER_TARGETS); - setIcon(DebuggerResources.ICON_PROVIDER_TARGETS); - setHelpLocation(DebuggerResources.HELP_PROVIDER_TARGETS); - setWindowMenuGroup(DebuggerPluginPackage.NAME); - - buildMainPanel(); - - setDefaultWindowPosition(WindowPosition.LEFT); - setVisible(true); - createActions(); - - myActionContext = new DebuggerModelActionContext(this, null, tree); - } - - @Override - public void addLocalAction(DockingActionIf action) { - super.addLocalAction(action); - } - - private void createActions() { - actionConnect = new ConnectAction(); - actionDisconnect = new DisconnectAction(); - actionDisconnectAll = DisconnectAllAction.builder(plugin, plugin) - .menuPath(DisconnectAllAction.NAME) - .onAction(this::activatedDisconnectAll) - .buildAndInstallLocal(this); - actionFlushCaches = new FlushCachesAction(); - } - - private void activatedDisconnectAll(ActionContext context) { - if (modelService == null) { - return; - } - modelService.closeAllModels(); - } - - @Override - public ActionContext getActionContext(MouseEvent event) { - if (myActionContext == null) { - return super.getActionContext(event); - } - return myActionContext; - } - - @Override - public JComponent getComponent() { - return mainPanel; - } - - private void setContext() { - myActionContext = new DebuggerModelActionContext(this, tree.getSelectionPath(), tree); - contextChanged(); - } - - private void emitEvents() { - DebuggerObjectModel model = myActionContext.getIfDebuggerModel(); - if (model != null) { - modelService.activateModel(model); - } - } - - private void buildMainPanel() { - mainPanel = new JPanel(new BorderLayout()); - - rootNode = new DebuggerConnectionsNode(modelService, this); - tree = new GTree(rootNode); - tree.setRootVisible(false); - tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); - mainPanel.add(tree); - - tree.setAccessibleNamePrefix("Debugger Targets"); - - // NB: for both of these, setContext should precede emitEvents - tree.getGTSelectionModel().addGTreeSelectionListener(evt -> { - setContext(); - if (evt.getEventOrigin() != EventOrigin.API_GENERATED) { - emitEvents(); - } - }); - tree.addGTModelListener((AnyChangeTreeModelListener) e -> { - setContext(); - emitEvents(); - }); - } - - @AutoServiceConsumed - private void setModelService(DebuggerModelService modelService) { - if (tree != null) { - rootNode = new DebuggerConnectionsNode(modelService, this); - tree.setRootNode(rootNode); - } - } - - protected void updateTree(boolean select, Object obj) { - if (tree == null) { - return; - } - tree.repaint(); - if (!select) { - return; - } - GTreeNode node = rootNode.findNodeForObject(obj); - if (node != null) { - tree.setSelectedNode(node); - myActionContext = new DebuggerModelActionContext(this, node.getTreePath(), tree); - contextChanged(); - } - } - - public void modelActivated(DebuggerObjectModel model) { - if (rootNode == null || tree == null) { - return; - } - GTreeNode node = rootNode.findNodeForObject(model); - if (node == null) { - return; - // TODO: Ensure when tree is populated, correct model is selected - } - // Note, setSelectedNode does not take EventOrigin - tree.setSelectionPaths(new TreePath[] { node.getTreePath() }, EventOrigin.API_GENERATED); - } - - protected void clearServiceCaches(DebuggerModelService service) { - for (DebuggerObjectModel model : service.getModels()) { - model.invalidateAllLocalCaches(); - } - } -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/mapping/DefaultDebuggerMappingOffer.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/mapping/DefaultDebuggerMappingOffer.java deleted file mode 100644 index 760e8bfdcb..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/mapping/DefaultDebuggerMappingOffer.java +++ /dev/null @@ -1,89 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.mapping; - -import java.util.Collection; -import java.util.Set; - -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.util.PathUtils; -import ghidra.debug.api.model.DebuggerMappingOffer; -import ghidra.debug.api.model.DebuggerTargetTraceMapper; -import ghidra.program.model.lang.*; - -public class DefaultDebuggerMappingOffer implements DebuggerMappingOffer { - protected final TargetObject target; - protected final int confidence; - protected final String description; - protected final LanguageID langID; - protected final CompilerSpecID csID; - - // TODO: Not sure this really belongs here.... - protected final Set extraRegNames; - - public DefaultDebuggerMappingOffer(TargetObject target, int confidence, - String description, LanguageID langID, CompilerSpecID csID, - Collection extraRegNames) { - this.target = target; - this.confidence = confidence; - this.description = description; - this.langID = langID; - this.csID = csID; - - this.extraRegNames = Set.copyOf(extraRegNames); - } - - @Override - public String toString() { - return String.format("", description, - langID, csID, confidence, PathUtils.toString(target.getPath())); - } - - @Override - public int getConfidence() { - return confidence; - } - - @Override - public String getDescription() { - return description; - } - - @Override - public LanguageID getTraceLanguageID() { - return langID; - } - - @Override - public CompilerSpecID getTraceCompilerSpecID() { - return csID; - } - - protected DebuggerTargetTraceMapper createMapper() - throws LanguageNotFoundException, CompilerSpecNotFoundException { - return new DefaultDebuggerTargetTraceMapper(target, langID, csID, extraRegNames); - } - - @Override - public DebuggerTargetTraceMapper take() { - try { - return createMapper(); - } - catch (LanguageNotFoundException | CompilerSpecNotFoundException e) { - throw new AssertionError(e); - } - } -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/mapping/DefaultDebuggerMemoryMapper.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/mapping/DefaultDebuggerMemoryMapper.java index 574270ca8b..8083a2bd80 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/mapping/DefaultDebuggerMemoryMapper.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/mapping/DefaultDebuggerMemoryMapper.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -21,6 +21,7 @@ import ghidra.program.model.address.*; import ghidra.program.model.lang.Language; import ghidra.util.MathUtilities; +@Deprecated(forRemoval = true, since = "11.3") public class DefaultDebuggerMemoryMapper implements DebuggerMemoryMapper { protected final AddressFactory traceAddressFactory; protected final AddressFactory targetAddressFactory; diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/mapping/DefaultDebuggerRegisterMapper.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/mapping/DefaultDebuggerRegisterMapper.java index 370a043f8e..ed52cf7f26 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/mapping/DefaultDebuggerRegisterMapper.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/mapping/DefaultDebuggerRegisterMapper.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -22,6 +22,7 @@ import ghidra.dbg.target.TargetRegisterContainer; import ghidra.debug.api.model.DebuggerRegisterMapper; import ghidra.program.model.lang.*; +@Deprecated(forRemoval = true, since = "11.3") public class DefaultDebuggerRegisterMapper implements DebuggerRegisterMapper { protected final Language language; protected final CompilerSpec cspec; diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/mapping/DefaultDebuggerTargetTraceMapper.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/mapping/DefaultDebuggerTargetTraceMapper.java index 8808d5a135..a97433a585 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/mapping/DefaultDebuggerTargetTraceMapper.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/mapping/DefaultDebuggerTargetTraceMapper.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -27,6 +27,7 @@ import ghidra.program.model.lang.*; import ghidra.program.util.DefaultLanguageService; import ghidra.trace.model.Trace; +@Deprecated(forRemoval = true, since = "11.3") public class DefaultDebuggerTargetTraceMapper implements DebuggerTargetTraceMapper { protected final TargetObject target; protected final Language language; diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/mapping/LargestSubDebuggerRegisterMapper.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/mapping/LargestSubDebuggerRegisterMapper.java deleted file mode 100644 index 891ff538b1..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/mapping/LargestSubDebuggerRegisterMapper.java +++ /dev/null @@ -1,202 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.mapping; - -import java.math.BigInteger; -import java.util.*; - -import ghidra.dbg.target.TargetRegister; -import ghidra.dbg.target.TargetRegisterContainer; -import ghidra.dbg.util.ConversionUtils; -import ghidra.program.model.lang.*; -import ghidra.util.Msg; - -public class LargestSubDebuggerRegisterMapper extends DefaultDebuggerRegisterMapper { - protected static final Comparator LENGTH_COMPARATOR = - Comparator.comparing(Register::getBitLength); - protected Map allLanguageRegs = new LinkedHashMap<>(); - protected Map> present = new HashMap<>(); - - public LargestSubDebuggerRegisterMapper(CompilerSpec cSpec, - TargetRegisterContainer targetRegContainer, boolean caseSensitive) { - super(cSpec, targetRegContainer, caseSensitive); - - for (Register lReg : cSpec.getLanguage().getRegisters()) { - allLanguageRegs.put(normalizeName(lReg.getName()), lReg); - } - } - - @Override - protected boolean includeTraceRegister(Register lReg) { - return true; - } - - @Override - protected synchronized Register considerRegister(String index) { - Register lReg = super.considerRegister(index); - if (lReg == null) { - return null; - } - //synchronized (present) { - present.computeIfAbsent(lReg.getBaseRegister(), r -> new TreeSet<>(LENGTH_COMPARATOR)) - .add(lReg); - //} - return lReg; - } - - @Override - protected synchronized Register considerRegister(TargetRegister tReg) { - Register lReg = super.considerRegister(tReg); - if (lReg == null) { - return null; - } - //synchronized (present) { - present.computeIfAbsent(lReg.getBaseRegister(), r -> new TreeSet<>(LENGTH_COMPARATOR)) - .add(lReg); - //} - return lReg; - } - - @Override - protected synchronized Register removeRegister(TargetRegister tReg) { - Register lReg = super.removeRegister(tReg); - //synchronized (present) { - if (lReg == null) { - return null; - } - Register lbReg = lReg.getBaseRegister(); - TreeSet set = present.get(lbReg); - set.remove(lReg); - if (set.isEmpty()) { - present.remove(lbReg); - } - //} - return lReg; - } - - @Override - public synchronized Register getTraceRegister(String name) { - Register lReg = allLanguageRegs.get(normalizeName(name)); - if (lReg == null || !present.containsKey(lReg)) { - return null; - } - return lReg; - } - - @Override - public synchronized Map.Entry traceToTarget(RegisterValue registerValue) { - Register lbReg = registerValue.getRegister(); - if (!lbReg.isBaseRegister()) { - throw new IllegalArgumentException(); - } - TreeSet subs = present.get(lbReg); - if (subs == null) { - return null; - } - Register lReg = subs.last(); // largest - RegisterValue subValue = registerValue.getRegisterValue(lReg); - TargetRegister tReg = targetRegs.get(normalizeName(lReg.getName())); - if (tReg == null) { - return null; - } - return Map.entry(tReg.getIndex(), ConversionUtils - .bigIntegerToBytes(lReg.getMinimumByteSize(), subValue.getUnsignedValue())); - } - - @Override - public synchronized TargetRegister traceToTarget(Register lbReg) { - TreeSet subs = present.get(lbReg); - if (subs == null) { // Not a base reg, or not known - return null; - } - Register lReg = subs.last(); // largest - return super.traceToTarget(lReg); - } - - @Override - public synchronized RegisterValue targetToTrace(String tRegName, byte[] value) { - if (value == null) { - return null; - } - Register lReg = languageRegs.get(normalizeName(tRegName)); - if (lReg == null) { - lReg = considerRegister(tRegName); - if (lReg == null) { - return null; - } - } - Register lbReg = lReg.getBaseRegister(); - TreeSet subs = present.get(lbReg); - if (subs == null) { - return null; - } - if (lReg != subs.last()) { - /** - * Neither the recorder nor the UI ought to have read or written this register, since it - * is not the "largest" known. But apparently something did, so it's possible there are - * two names in the cache belonging to the same structural register whose values don't - * necessarily agree. This can happen, e.g., if "EAX" is written but "RAX" is already in - * the cache. The next read for "RAX" will likely return a stale value. Granted, the - * cache is invalidated fairly frequently -- every step, at least. Nevertheless, this - * should not have happened. - */ - Msg.warn(this, "Potential register cache aliasing: " + lReg + " vs " + subs.last()); - /** - * After testing, there is a problem with data truncation. If, e.g., EAX is sent, - * followed by AX, and we expand to fill RAX, then we're going to truncate the upper 16 - * bits of EAX :( . To avoid this, we'll only map the largest register from target to - * trace. We'll still warn as a courtesy, but we'll abort the mapping. - */ - return null; - } - /** - * TODO: A mapping with masks may be useful in the future, but as it is, the trace database - * will reject it. Furthermore, we'd still want to mark the whole base register as known, - * which is not intuitive, and makes me worry about that method. - */ - // return new RegisterValue(lReg, new BigInteger(1,value)).getBaseRegisterValue(); - // Pad zeroes in the rest of base register - RegisterValue lbVal = new RegisterValue(lbReg, BigInteger.ZERO); - return lbVal.assign(lReg, new BigInteger(1, value)); - } - - @Override - public RegisterValue targetToTrace(TargetRegister tReg, byte[] value) { - return targetToTrace(tReg.getIndex(), value); - } - - @Override - public synchronized Register targetToTrace(TargetRegister tReg) { - Register lReg = languageRegs.get(normalizeName(tReg.getIndex())); - if (lReg == null) { - return null; - } - Register lbReg = lReg.getBaseRegister(); - TreeSet subs = present.get(lbReg); - if (subs == null) { - return null; - } - if (lReg != subs.last()) { - return null; - } - return lbReg; - } - - @Override - public synchronized Set getRegistersOnTarget() { - return Set.copyOf(present.keySet()); - } -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/mapping/ObjectBasedDebuggerMappingOffer.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/mapping/ObjectBasedDebuggerMappingOffer.java deleted file mode 100644 index e2ff2f0f2c..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/mapping/ObjectBasedDebuggerMappingOffer.java +++ /dev/null @@ -1,41 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.mapping; - -import java.util.Set; - -import ghidra.dbg.target.TargetObject; -import ghidra.debug.api.model.DebuggerTargetTraceMapper; -import ghidra.program.model.lang.*; - -public class ObjectBasedDebuggerMappingOffer extends DefaultDebuggerMappingOffer { - private static final String DESCRIPTION = - "EXPERIMENTAL: Object-based recording, deferred mapping"; - private static final int CONFIDENCE = -100; // TODO: Increase this when it becomes preferred - protected static final LanguageID LANGID_DATA64 = new LanguageID("DATA:BE:64:default"); - protected static final CompilerSpecID CSID_PTR64 = new CompilerSpecID("pointer64"); - - public ObjectBasedDebuggerMappingOffer(TargetObject target) { - // TODO: Is extraRegNames relevant? - super(target, CONFIDENCE, DESCRIPTION, LANGID_DATA64, CSID_PTR64, Set.of()); - } - - @Override - protected DebuggerTargetTraceMapper createMapper() - throws LanguageNotFoundException, CompilerSpecNotFoundException { - return new ObjectBasedDebuggerTargetTraceMapper(target, langID, csID, extraRegNames); - } -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/mapping/ObjectBasedDebuggerMappingOpinion.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/mapping/ObjectBasedDebuggerMappingOpinion.java deleted file mode 100644 index 8f2d2d4ff7..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/mapping/ObjectBasedDebuggerMappingOpinion.java +++ /dev/null @@ -1,46 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.mapping; - -import java.util.Set; - -import ghidra.dbg.target.TargetEnvironment; -import ghidra.dbg.target.TargetObject; -import ghidra.debug.api.model.DebuggerMappingOffer; -import ghidra.debug.api.model.DebuggerMappingOpinion; - -public class ObjectBasedDebuggerMappingOpinion implements DebuggerMappingOpinion { - - @Override - public Set getOffers(TargetObject target, boolean includeOverrides) { - // TODO: Remove this check - if (!includeOverrides) { - return Set.of(); - } - // TODO: Do I want to require it to record the whole model? - // If not, I need to figure out how to locate object dependencies and still record them. - if (!target.isRoot()) { - return Set.of(); - } - return Set.of(new ObjectBasedDebuggerMappingOffer(target)); - } - - @Override - public Set offersForEnv(TargetEnvironment env, TargetObject target, - boolean includeOverrides) { - throw new UnsupportedOperationException(); - } -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/mapping/ObjectBasedDebuggerMemoryMapper.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/mapping/ObjectBasedDebuggerMemoryMapper.java index 11b9ecbb30..709d387547 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/mapping/ObjectBasedDebuggerMemoryMapper.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/mapping/ObjectBasedDebuggerMemoryMapper.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -24,6 +24,7 @@ import ghidra.program.model.address.*; import ghidra.trace.model.Trace; import ghidra.util.exception.DuplicateNameException; +@Deprecated(forRemoval = true, since = "11.3") public class ObjectBasedDebuggerMemoryMapper implements DebuggerMemoryMapper { protected final Trace trace; protected final AddressSpace base; diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/mapping/ObjectBasedDebuggerTargetTraceMapper.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/mapping/ObjectBasedDebuggerTargetTraceMapper.java index 7b41497d9f..d1894b07d2 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/mapping/ObjectBasedDebuggerTargetTraceMapper.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/mapping/ObjectBasedDebuggerTargetTraceMapper.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -24,6 +24,7 @@ import ghidra.framework.plugintool.PluginTool; import ghidra.program.model.lang.*; import ghidra.trace.model.Trace; +@Deprecated(forRemoval = true, since = "11.3") public class ObjectBasedDebuggerTargetTraceMapper extends DefaultDebuggerTargetTraceMapper { protected ObjectBasedDebuggerMemoryMapper memoryMapper; diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/OverridesDebuggerMappingOpinion.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/OverridesDebuggerMappingOpinion.java deleted file mode 100644 index c5e4892944..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/OverridesDebuggerMappingOpinion.java +++ /dev/null @@ -1,74 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.platform; - -import java.util.Set; -import java.util.stream.Collectors; - -import ghidra.app.plugin.core.debug.mapping.*; -import ghidra.dbg.target.TargetEnvironment; -import ghidra.dbg.target.TargetObject; -import ghidra.debug.api.model.DebuggerMappingOffer; -import ghidra.debug.api.model.DebuggerMappingOpinion; -import ghidra.program.model.lang.*; -import ghidra.program.util.DefaultLanguageService; - -/** - * An "opinion" which offers every known language, but with only default mapping logic. - * - *

- * Mileage will vary greatly, but some mileage is better than none. - */ -public class OverridesDebuggerMappingOpinion implements DebuggerMappingOpinion { - - /** - * An opinion-specific offer class so that offers can be recognized in unit testing - */ - protected static class OverrideOffer extends DefaultDebuggerMappingOffer { - public OverrideOffer(TargetObject target, int confidence, String description, - LanguageCompilerSpecPair lcsp) { - super(target, confidence, description, lcsp.languageID, lcsp.compilerSpecID, Set.of()); - } - } - - protected DebuggerMappingOffer offerForLanguageAndCSpec(TargetObject target, Endian endian, - LanguageCompilerSpecPair lcsp) { - try { - return new OverrideOffer(target, - endian == lcsp.getLanguageDescription().getEndian() ? -10 : -20, - "Override to " + lcsp, lcsp); - } - catch (LanguageNotFoundException e) { - throw new AssertionError(e); - } - } - - @Override - public Set offersForEnv(TargetEnvironment env, TargetObject target, - boolean includeOverrides) { - if (!includeOverrides) { - return Set.of(); - } - Endian endian = DebuggerMappingOpinion.getEndian(env); - LanguageService langServ = DefaultLanguageService.getLanguageService(); - return langServ.getLanguageCompilerSpecPairs( - // ALL THE SPECS!!! - new LanguageCompilerSpecQuery(null, null, null, null, null)) - .stream() - .map(lcsp -> offerForLanguageAndCSpec(target, endian, lcsp)) - .collect(Collectors.toSet()); - } -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/dbgeng/DbgDebuggerProgramLaunchOpinion.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/dbgeng/DbgDebuggerProgramLaunchOpinion.java deleted file mode 100644 index c0bf45a179..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/dbgeng/DbgDebuggerProgramLaunchOpinion.java +++ /dev/null @@ -1,134 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.platform.dbgeng; - -import java.util.Collection; -import java.util.List; - -import ghidra.app.plugin.core.debug.service.model.launch.*; -import ghidra.dbg.DebuggerModelFactory; -import ghidra.dbg.util.PathUtils; -import ghidra.debug.api.model.DebuggerProgramLaunchOffer; -import ghidra.framework.plugintool.PluginTool; -import ghidra.program.model.listing.Program; - -public class DbgDebuggerProgramLaunchOpinion extends AbstractDebuggerProgramLaunchOpinion { - protected static final List> OFFER_CLASSES = - List.of( - InVmDbgengDebuggerProgramLaunchOffer.class, - GadpDbgengDebuggerProgramLaunchOffer.class, - InVmDbgmodelDebuggerProgramLaunchOffer.class, - GadpDbgmodelDebuggerProgramLaunchOffer.class); - - protected static abstract class AbstractDbgDebuggerProgramLaunchOffer - extends AbstractDebuggerProgramLaunchOffer { - - public AbstractDbgDebuggerProgramLaunchOffer(Program program, PluginTool tool, - DebuggerModelFactory factory) { - super(program, tool, factory); - } - - @Override - protected List getLauncherPath() { - return PathUtils.parse(""); - } - } - - @FactoryClass("agent.dbgeng.DbgEngInJvmDebuggerModelFactory") - protected static class InVmDbgengDebuggerProgramLaunchOffer - extends AbstractDbgDebuggerProgramLaunchOffer { - - public InVmDbgengDebuggerProgramLaunchOffer(Program program, PluginTool tool, - DebuggerModelFactory factory) { - super(program, tool, factory); - } - - @Override - public String getConfigName() { - return "IN-VM dbgeng"; - } - - @Override - public String getMenuTitle() { - return "in dbgeng locally IN-VM"; - } - } - - @FactoryClass("agent.dbgeng.gadp.DbgEngGadpDebuggerModelFactory") - protected static class GadpDbgengDebuggerProgramLaunchOffer - extends AbstractDbgDebuggerProgramLaunchOffer { - - public GadpDbgengDebuggerProgramLaunchOffer(Program program, PluginTool tool, - DebuggerModelFactory factory) { - super(program, tool, factory); - } - - @Override - public String getConfigName() { - return "GADP dbgeng"; - } - - @Override - public String getMenuTitle() { - return "in dbgeng locally via GADP"; - } - } - - @FactoryClass("agent.dbgmodel.DbgModelInJvmDebuggerModelFactory") - protected static class InVmDbgmodelDebuggerProgramLaunchOffer - extends AbstractDbgDebuggerProgramLaunchOffer { - - public InVmDbgmodelDebuggerProgramLaunchOffer(Program program, PluginTool tool, - DebuggerModelFactory factory) { - super(program, tool, factory); - } - - @Override - public String getConfigName() { - return "IN-VM dbgmodel"; - } - - @Override - public String getMenuTitle() { - return "in dbgmodel locally IN-VM"; - } - } - - @FactoryClass("agent.dbgmodel.gadp.DbgModelGadpDebuggerModelFactory") - protected static class GadpDbgmodelDebuggerProgramLaunchOffer - extends AbstractDbgDebuggerProgramLaunchOffer { - - public GadpDbgmodelDebuggerProgramLaunchOffer(Program program, PluginTool tool, - DebuggerModelFactory factory) { - super(program, tool, factory); - } - - @Override - public String getConfigName() { - return "GADP dbgmodel"; - } - - @Override - public String getMenuTitle() { - return "in dbgmodel locally via GADP"; - } - } - - @Override - protected Collection> getOfferClasses() { - return OFFER_CLASSES; - } -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/dbgeng/DbgengX64DebuggerMappingOpinion.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/dbgeng/DbgengX64DebuggerMappingOpinion.java deleted file mode 100644 index 81ca4f020b..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/dbgeng/DbgengX64DebuggerMappingOpinion.java +++ /dev/null @@ -1,94 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.platform.dbgeng; - -import java.util.Collection; -import java.util.Set; - -import ghidra.app.plugin.core.debug.mapping.*; -import ghidra.dbg.target.*; -import ghidra.debug.api.model.*; -import ghidra.program.model.lang.*; - -public class DbgengX64DebuggerMappingOpinion implements DebuggerMappingOpinion { - protected static final LanguageID LANG_ID_X86_64 = new LanguageID("x86:LE:64:default"); - protected static final CompilerSpecID COMP_ID_VS = new CompilerSpecID("windows"); - - protected static class DbgI386X86_64RegisterMapper extends LargestSubDebuggerRegisterMapper { - public DbgI386X86_64RegisterMapper(CompilerSpec cSpec, - TargetRegisterContainer targetRegContainer) { - super(cSpec, targetRegContainer, false); - } - - @Override - protected String normalizeName(String name) { - name = super.normalizeName(name); - if ("efl".equals(name)) { - return "eflags"; - } - if ("rfl".equals(name)) { - return "eflags"; - } - if ("rflags".equals(name)) { - return "eflags"; - } - return name; - } - } - - protected static class DbgI386X86_64WindowsTraceMapper - extends DefaultDebuggerTargetTraceMapper { - public DbgI386X86_64WindowsTraceMapper(TargetObject target, LanguageID langID, - CompilerSpecID csId, Collection extraRegNames) - throws LanguageNotFoundException, CompilerSpecNotFoundException { - super(target, langID, csId, extraRegNames); - } - - @Override - protected DebuggerRegisterMapper createRegisterMapper(TargetRegisterContainer registers) { - return new DbgI386X86_64RegisterMapper(cSpec, registers); - } - } - - protected static class DbgI386X86_64WindowsOffer extends DefaultDebuggerMappingOffer { - public DbgI386X86_64WindowsOffer(TargetProcess process) { - super(process, 100, "Dbgeng on Windows x64", LANG_ID_X86_64, COMP_ID_VS, Set.of()); - } - - @Override - public DebuggerTargetTraceMapper createMapper() - throws LanguageNotFoundException, CompilerSpecNotFoundException { - return new DbgI386X86_64WindowsTraceMapper(target, langID, csID, extraRegNames); - } - } - - @Override - public Set offersForEnv(TargetEnvironment env, TargetObject target, - boolean includeOverrides) { - if (!(target instanceof TargetProcess)) { - return Set.of(); - } - if (env == null || !env.getDebugger().toLowerCase().contains("dbg")) { - return Set.of(); - } - boolean is64Bit = - env.getArchitecture().contains("x86_64") || env.getArchitecture().contains("x64_32"); - if (is64Bit) { - return Set.of(new DbgI386X86_64WindowsOffer((TargetProcess) target)); - } - return null; - } -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/frida/FridaArmDebuggerMappingOpinion.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/frida/FridaArmDebuggerMappingOpinion.java deleted file mode 100644 index c7aaaf5f1f..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/frida/FridaArmDebuggerMappingOpinion.java +++ /dev/null @@ -1,80 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.platform.frida; - -import java.util.Set; - -import ghidra.app.plugin.core.debug.mapping.*; -import ghidra.dbg.target.*; -import ghidra.debug.api.model.DebuggerMappingOffer; -import ghidra.debug.api.model.DebuggerMappingOpinion; -import ghidra.program.model.lang.*; -import ghidra.util.Msg; - -/** - * TODO: How does Frida name its target architectures? If same as GNU, use that. If not, maybe we - * should add those external names to .ldefs? It'd be nice to have an .ldefs-based opinion that this - * can be refactored onto. - */ -public class FridaArmDebuggerMappingOpinion implements DebuggerMappingOpinion { - protected static final LanguageID LANG_ID_AARCH64 = new LanguageID("AARCH64:LE:64:v8A"); - protected static final CompilerSpecID COMP_ID_DEFAULT = new CompilerSpecID("default"); - - protected static class FridaI386X86_64RegisterMapper extends DefaultDebuggerRegisterMapper { - public FridaI386X86_64RegisterMapper(CompilerSpec cSpec, - TargetRegisterContainer targetRegContainer) { - super(cSpec, targetRegContainer, false); - } - - @Override - protected String normalizeName(String name) { - name = super.normalizeName(name); - if ("rflags".equals(name)) { - return "eflags"; - } - return name; - } - } - - protected static class FridaAarch64MacosOffer extends DefaultDebuggerMappingOffer { - public FridaAarch64MacosOffer(TargetProcess process) { - super(process, 50, "AARCH64/Frida on macos", LANG_ID_AARCH64, COMP_ID_DEFAULT, - Set.of("cpsr")); - } - } - - @Override - public Set offersForEnv(TargetEnvironment env, TargetObject target, - boolean includesOverrides) { - if (!(target instanceof TargetProcess)) { - return Set.of(); - } - if (!env.getDebugger().toLowerCase().contains("frida")) { - return Set.of(); - } - String arch = env.getArchitecture(); - boolean is64Bit = - arch.contains("AARCH64") || arch.contains("arm64") || arch.contains("arm"); - String os = env.getOperatingSystem(); - if (os.contains("macos") || os.contains("ios")) { - if (is64Bit) { - Msg.info(this, "Using os=" + os + " arch=" + arch); - return Set.of(new FridaAarch64MacosOffer((TargetProcess) target)); - } - } - return Set.of(); - } -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/frida/FridaDebuggerProgramLaunchOpinion.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/frida/FridaDebuggerProgramLaunchOpinion.java deleted file mode 100644 index 8b75e53ae4..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/frida/FridaDebuggerProgramLaunchOpinion.java +++ /dev/null @@ -1,98 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.platform.frida; - -import java.util.Collection; -import java.util.List; - -import ghidra.app.plugin.core.debug.service.model.launch.*; -import ghidra.dbg.DebuggerModelFactory; -import ghidra.dbg.util.PathUtils; -import ghidra.debug.api.model.DebuggerProgramLaunchOffer; -import ghidra.framework.plugintool.PluginTool; -import ghidra.program.model.listing.Program; - -public class FridaDebuggerProgramLaunchOpinion extends AbstractDebuggerProgramLaunchOpinion { - protected static final List> OFFER_CLASSES = - List.of( - InVmFridaDebuggerProgramLaunchOffer.class, - GadpFridaDebuggerProgramLaunchOffer.class); - - protected static abstract class AbstractFridaDebuggerProgramLaunchOffer - extends AbstractDebuggerProgramLaunchOffer { - - public AbstractFridaDebuggerProgramLaunchOffer(Program program, PluginTool tool, - DebuggerModelFactory factory) { - super(program, tool, factory); - } - - @Override - public String getMenuParentTitle() { - return "Debug " + program.getName(); - } - - @Override - protected List getLauncherPath() { - return PathUtils.parse(""); - } - - } - - @FactoryClass("agent.frida.FridaInJvmDebuggerModelFactory") - protected static class InVmFridaDebuggerProgramLaunchOffer - extends AbstractFridaDebuggerProgramLaunchOffer { - - public InVmFridaDebuggerProgramLaunchOffer(Program program, PluginTool tool, - DebuggerModelFactory factory) { - super(program, tool, factory); - } - - @Override - public String getConfigName() { - return "IN-VM Frida"; - } - - @Override - public String getMenuTitle() { - return "in Frida locally IN-VM"; - } - } - - @FactoryClass("agent.frida.gadp.FridaGadpDebuggerModelFactory") - protected static class GadpFridaDebuggerProgramLaunchOffer - extends AbstractFridaDebuggerProgramLaunchOffer { - - public GadpFridaDebuggerProgramLaunchOffer(Program program, PluginTool tool, - DebuggerModelFactory factory) { - super(program, tool, factory); - } - - @Override - public String getConfigName() { - return "GADP Frida"; - } - - @Override - public String getMenuTitle() { - return "in Frida locally via GADP"; - } - } - - @Override - protected Collection> getOfferClasses() { - return OFFER_CLASSES; - } -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/frida/FridaX86DebuggerMappingOpinion.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/frida/FridaX86DebuggerMappingOpinion.java deleted file mode 100644 index 98c652b41b..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/frida/FridaX86DebuggerMappingOpinion.java +++ /dev/null @@ -1,133 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.platform.frida; - -import java.util.Set; - -import ghidra.app.plugin.core.debug.mapping.*; -import ghidra.dbg.target.*; -import ghidra.debug.api.model.DebuggerMappingOffer; -import ghidra.debug.api.model.DebuggerMappingOpinion; -import ghidra.program.model.lang.CompilerSpecID; -import ghidra.program.model.lang.LanguageID; -import ghidra.util.Msg; - -public class FridaX86DebuggerMappingOpinion implements DebuggerMappingOpinion { - protected static final LanguageID LANG_ID_X86 = new LanguageID("x86:LE:32:default"); - protected static final LanguageID LANG_ID_X86_64 = new LanguageID("x86:LE:64:default"); - protected static final CompilerSpecID COMP_ID_DEFAULT = new CompilerSpecID("default"); - protected static final CompilerSpecID COMP_ID_GCC = new CompilerSpecID("gcc"); - protected static final CompilerSpecID COMP_ID_VS = new CompilerSpecID("windows"); - - protected static class FridaI386MacosOffer extends DefaultDebuggerMappingOffer { - public FridaI386MacosOffer(TargetProcess process) { - super(process, 100, "Frida on macOS i386", LANG_ID_X86, COMP_ID_GCC, Set.of()); - } - } - - protected static class FridaI386LinuxOffer extends DefaultDebuggerMappingOffer { - public FridaI386LinuxOffer(TargetProcess process) { - super(process, 100, "Frida on Linux i386", LANG_ID_X86, COMP_ID_GCC, Set.of()); - } - } - - // TODO - protected static class FridaI386WindowsOffer extends DefaultDebuggerMappingOffer { - public FridaI386WindowsOffer(TargetProcess process) { - super(process, 100, "Frida on Windows i386", LANG_ID_X86, COMP_ID_VS, - Set.of()); - } - } - - protected static class FridaI386X86_64MacosOffer extends DefaultDebuggerMappingOffer { - public FridaI386X86_64MacosOffer(TargetProcess process) { - super(process, 100, "Frida on macOS x86_64", LANG_ID_X86_64, COMP_ID_GCC, Set.of()); - } - } - - protected static class FridaI386X86_64LinuxOffer extends DefaultDebuggerMappingOffer { - public FridaI386X86_64LinuxOffer(TargetProcess process) { - super(process, 100, "Frida on Linux x86_64", LANG_ID_X86_64, COMP_ID_GCC, Set.of()); - } - } - - protected static class FridaI386X86_64WindowsOffer extends DefaultDebuggerMappingOffer { - public FridaI386X86_64WindowsOffer(TargetProcess process) { - super(process, 100, "Frida on Windows x64", LANG_ID_X86_64, COMP_ID_VS, - Set.of()); - } - } - - @Override - public Set offersForEnv(TargetEnvironment env, TargetObject target, - boolean includeOverrides) { - if (!(target instanceof TargetProcess)) { - return Set.of(); - } - TargetProcess process = (TargetProcess) target; - if (!env.getDebugger().toLowerCase().contains("frida")) { - return Set.of(); - } - String arch = env.getArchitecture(); - boolean is32Bit = - arch.contains("ia32") || arch.contains("x86-32") || arch.contains("i386") || - arch.contains("x86_32"); - boolean is64Bit = - arch.contains("x64") || arch.contains("x86-64") || arch.contains("x64-32") || - arch.contains("x86_64") || arch.contains("x64_32") || arch.contains("i686"); - String os = env.getOperatingSystem(); - if (os.contains("darwin")) { - if (is64Bit) { - Msg.info(this, "Using os=" + os + " arch=" + arch); - return Set.of(new FridaI386X86_64MacosOffer(process)); - } - else if (is32Bit) { - Msg.info(this, "Using os=" + os + " arch=" + arch); - return Set.of(new FridaI386MacosOffer(process)); - } - else { - return Set.of(); - } - } - else if (os.contains("Linux") || os.contains("linux")) { - if (is64Bit) { - Msg.info(this, "Using os=" + os + " arch=" + arch); - return Set.of(new FridaI386X86_64LinuxOffer(process)); - } - else if (is32Bit) { - Msg.info(this, "Using os=" + os + " arch=" + arch); - return Set.of(new FridaI386LinuxOffer(process)); - } - else { - return Set.of(); - } - } - else if (os.contains("windows")) { - if (is64Bit) { - Msg.info(this, "Using os=" + os + " arch=" + arch); - return Set.of(new FridaI386X86_64WindowsOffer(process)); - } - else if (is32Bit) { - Msg.info(this, "Using os=" + os + " arch=" + arch); - return Set.of(new FridaI386WindowsOffer(process)); - } - else { - return Set.of(); - } - } - return Set.of(); - } -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/gdb/DefaultGdbDebuggerMappingOpinion.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/gdb/DefaultGdbDebuggerMappingOpinion.java deleted file mode 100644 index e49031d8db..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/gdb/DefaultGdbDebuggerMappingOpinion.java +++ /dev/null @@ -1,99 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.platform.gdb; - -import java.util.*; -import java.util.stream.Collectors; - -import org.apache.commons.lang3.tuple.Pair; - -import ghidra.app.plugin.core.debug.mapping.*; -import ghidra.dbg.target.TargetEnvironment; -import ghidra.dbg.target.TargetObject; -import ghidra.debug.api.model.DebuggerMappingOffer; -import ghidra.debug.api.model.DebuggerMappingOpinion; -import ghidra.program.model.lang.*; -import ghidra.program.util.DefaultLanguageService; - -public class DefaultGdbDebuggerMappingOpinion implements DebuggerMappingOpinion { - public static final String EXTERNAL_TOOL = "gnu"; - public static final CompilerSpecID PREFERRED_CSPEC_ID = new CompilerSpecID("gcc"); - - private static final Map, List> CACHE = - new HashMap<>(); - - /** - * An opinion-specific offer class so that offers can be recognized in unit testing - */ - protected static class GdbDefaultOffer extends DefaultDebuggerMappingOffer { - public GdbDefaultOffer(TargetObject target, int confidence, String description, - LanguageCompilerSpecPair lcsp, Collection extraRegNames) { - super(target, confidence, description, lcsp.languageID, lcsp.compilerSpecID, - extraRegNames); - } - } - - public static List getCompilerSpecsForGnu(String arch, - Endian endian) { - synchronized (CACHE) { - return CACHE.computeIfAbsent(Pair.of(arch, endian), p -> { - LanguageService langServ = DefaultLanguageService.getLanguageService(); - return langServ.getLanguageCompilerSpecPairs( - new ExternalLanguageCompilerSpecQuery(arch, EXTERNAL_TOOL, - endian, null, PREFERRED_CSPEC_ID)); - }); - } - } - - public static boolean isGdb(TargetEnvironment env) { - if (env == null) { - return false; - } - if (!env.getDebugger().toLowerCase().contains("gdb")) { - return false; - } - return true; - } - - public static boolean isLinux(TargetEnvironment env) { - if (env == null) { - return false; - } - if (!env.getOperatingSystem().contains("Linux")) { - return false; - } - return true; - } - - protected Set offersForLanguageAndCSpec(TargetObject target, String arch, - Endian endian, LanguageCompilerSpecPair lcsp) { - return Set.of(new GdbDefaultOffer(target, 10, "Default GDB for " + arch, lcsp, Set.of())); - } - - @Override - public Set offersForEnv(TargetEnvironment env, TargetObject target, - boolean includeOverrides) { - if (!isGdb(env)) { - return Set.of(); - } - Endian endian = DebuggerMappingOpinion.getEndian(env); - String arch = env.getArchitecture(); - - return getCompilerSpecsForGnu(arch, endian).stream() - .flatMap(lcsp -> offersForLanguageAndCSpec(target, arch, endian, lcsp).stream()) - .collect(Collectors.toSet()); - } -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/gdb/GdbArmDebuggerMappingOpinion.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/gdb/GdbArmDebuggerMappingOpinion.java deleted file mode 100644 index c15085cd85..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/gdb/GdbArmDebuggerMappingOpinion.java +++ /dev/null @@ -1,73 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.platform.gdb; - -import java.util.Collection; -import java.util.Set; - -import ghidra.dbg.target.TargetObject; -import ghidra.debug.api.model.DebuggerMappingOffer; -import ghidra.program.model.lang.*; -import ghidra.program.util.DefaultLanguageService; - -public class GdbArmDebuggerMappingOpinion extends DefaultGdbDebuggerMappingOpinion { - - /** - * An opinion-specific offer class so that offers can be recognized in unit testing - */ - protected static class GdbArmOffer extends GdbDefaultOffer { - public GdbArmOffer(TargetObject target, int confidence, String description, - LanguageCompilerSpecPair lcsp, Collection extraRegNames) { - super(target, confidence, description, lcsp, extraRegNames); - } - } - - /** - * An opinion-specific offer class so that offers can be recognized in unit testing - */ - protected static class GdbAArch64Offer extends GdbDefaultOffer { - public GdbAArch64Offer(TargetObject target, int confidence, String description, - LanguageCompilerSpecPair lcsp, Collection extraRegNames) { - super(target, confidence, description, lcsp, extraRegNames); - } - } - - @Override - protected Set offersForLanguageAndCSpec(TargetObject target, String arch, - Endian endian, LanguageCompilerSpecPair lcsp) { - LanguageService langServ = DefaultLanguageService.getLanguageService(); - LanguageDescription desc; - try { - desc = langServ.getLanguageDescription(lcsp.languageID); - } - catch (LanguageNotFoundException e) { - throw new AssertionError(e); - } - String proc = desc.getProcessor().toString(); - if ("ARM".equalsIgnoreCase(proc)) { - if ("Cortex".equalsIgnoreCase(desc.getVariant())) { - return Set.of( - new GdbArmOffer(target, 50, "ARM-Cortex/GDB for " + arch, lcsp, Set.of())); - } - return Set.of(new GdbArmOffer(target, 50, "ARM/GDB for " + arch, lcsp, Set.of("cpsr"))); - } - if ("AARCH64".equalsIgnoreCase(proc)) { - return Set.of( - new GdbAArch64Offer(target, 50, "AARCH64/GDB for " + arch, lcsp, Set.of("cpsr"))); - } - return Set.of(); - } -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/gdb/GdbDebuggerProgramLaunchOpinion.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/gdb/GdbDebuggerProgramLaunchOpinion.java deleted file mode 100644 index ef2c1a1acb..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/gdb/GdbDebuggerProgramLaunchOpinion.java +++ /dev/null @@ -1,122 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.platform.gdb; - -import java.util.*; - -import ghidra.app.plugin.core.debug.service.model.launch.*; -import ghidra.dbg.DebuggerModelFactory; -import ghidra.dbg.util.ConfigurableFactory.Property; -import ghidra.debug.api.model.DebuggerProgramLaunchOffer; -import ghidra.dbg.util.PathUtils; -import ghidra.framework.plugintool.PluginTool; -import ghidra.program.model.listing.Program; - -public class GdbDebuggerProgramLaunchOpinion extends AbstractDebuggerProgramLaunchOpinion { - protected static final List> OFFER_CLASSES = - List.of( - InVmGdbDebuggerProgramLaunchOffer.class, - GadpGdbDebuggerProgramLaunchOffer.class, - SshGdbDebuggerProgramLaunchOffer.class); - - protected static abstract class AbstractGdbDebuggerProgramLaunchOffer - extends AbstractDebuggerProgramLaunchOffer { - - public AbstractGdbDebuggerProgramLaunchOffer(Program program, PluginTool tool, - DebuggerModelFactory factory) { - super(program, tool, factory); - } - - @Override - protected List getLauncherPath() { - return PathUtils.parse("Inferiors[1]"); - } - - } - - @FactoryClass("agent.gdb.GdbInJvmDebuggerModelFactory") - protected static class InVmGdbDebuggerProgramLaunchOffer - extends AbstractGdbDebuggerProgramLaunchOffer { - - public InVmGdbDebuggerProgramLaunchOffer(Program program, PluginTool tool, - DebuggerModelFactory factory) { - super(program, tool, factory); - } - - @Override - public String getConfigName() { - return "IN-VM GDB"; - } - - @Override - public String getMenuTitle() { - return "in GDB locally IN-VM"; - } - } - - @FactoryClass("agent.gdb.gadp.GdbGadpDebuggerModelFactory") - protected static class GadpGdbDebuggerProgramLaunchOffer - extends AbstractGdbDebuggerProgramLaunchOffer { - - public GadpGdbDebuggerProgramLaunchOffer(Program program, PluginTool tool, - DebuggerModelFactory factory) { - super(program, tool, factory); - } - - @Override - public String getConfigName() { - return "GADP GDB"; - } - - @Override - public String getMenuTitle() { - return "in GDB locally via GADP"; - } - } - - @FactoryClass("agent.gdb.GdbOverSshDebuggerModelFactory") - protected static class SshGdbDebuggerProgramLaunchOffer - extends AbstractGdbDebuggerProgramLaunchOffer { - - public SshGdbDebuggerProgramLaunchOffer(Program program, PluginTool tool, - DebuggerModelFactory factory) { - super(program, tool, factory); - } - - @Override - public String getConfigName() { - return "SSH GDB"; - } - - @Override - public String getQuickTitle() { - Map> opts = factory.getOptions(); - return String.format("in GDB via ssh:%s@%s", - opts.get("SSH username").getValue(), - opts.get("SSH hostname").getValue()); - } - - @Override - public String getMenuTitle() { - return "in GDB via ssh"; - } - } - - @Override - protected Collection> getOfferClasses() { - return OFFER_CLASSES; - } -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/gdb/GdbM68kDebuggerMappingOpinion.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/gdb/GdbM68kDebuggerMappingOpinion.java deleted file mode 100644 index 29e9326d85..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/gdb/GdbM68kDebuggerMappingOpinion.java +++ /dev/null @@ -1,66 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.platform.gdb; - -import java.util.Set; - -import ghidra.app.plugin.core.debug.mapping.*; -import ghidra.dbg.target.*; -import ghidra.debug.api.model.DebuggerMappingOffer; -import ghidra.debug.api.model.DebuggerMappingOpinion; -import ghidra.program.model.lang.CompilerSpecID; -import ghidra.program.model.lang.LanguageID; - -/** - * TODO: Without architecture-specific extensions, this opinion is supplanted by the .ldefs-based - * one. Remove me? - */ -public class GdbM68kDebuggerMappingOpinion implements DebuggerMappingOpinion { - protected static final LanguageID LANG_ID_68K_BE = new LanguageID("68000:BE:32:default"); - protected static final CompilerSpecID COMP_ID_DEFAULT = new CompilerSpecID("default"); - - protected static class GdbM68kBELinux32DefOffer extends DefaultDebuggerMappingOffer { - public GdbM68kBELinux32DefOffer(TargetProcess process) { - super(process, 100, "GDB on Linux m68k - 32-bit", LANG_ID_68K_BE, COMP_ID_DEFAULT, - Set.of()); - } - } - - @Override - public Set offersForEnv(TargetEnvironment env, TargetObject target, - boolean includeOverrides) { - if (!(target instanceof TargetProcess)) { - return Set.of(); - } - if (!env.getDebugger().toLowerCase().contains("gdb")) { - return Set.of(); - } - String os = env.getOperatingSystem(); - if (!os.contains("Linux")) { - return Set.of(); - } - String endian = env.getEndian(); - if (!endian.contains("big")) { - return Set.of(); - } - String arch = env.getArchitecture(); - if (arch.startsWith("m68k")) { - return Set.of(new GdbM68kBELinux32DefOffer((TargetProcess) target)); - } - return Set.of(); - } - -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/gdb/GdbMipsDebuggerMappingOpinion.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/gdb/GdbMipsDebuggerMappingOpinion.java deleted file mode 100644 index 97055dcd70..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/gdb/GdbMipsDebuggerMappingOpinion.java +++ /dev/null @@ -1,125 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.platform.gdb; - -import java.util.Set; - -import ghidra.app.plugin.core.debug.mapping.*; -import ghidra.dbg.target.*; -import ghidra.debug.api.model.DebuggerMappingOffer; -import ghidra.debug.api.model.DebuggerMappingOpinion; -import ghidra.program.model.lang.CompilerSpecID; -import ghidra.program.model.lang.LanguageID; - -/** - * TODO: Without architecture-specific extensions, this opinion is supplanted by the .ldefs-based - * one. Remove me? - */ -public class GdbMipsDebuggerMappingOpinion implements DebuggerMappingOpinion { - protected static final LanguageID LANG_ID_MIPS32_BE = new LanguageID("MIPS:BE:32:default"); - protected static final LanguageID LANG_ID_MIPS64_BE = new LanguageID("MIPS:BE:64:default"); - protected static final LanguageID LANG_ID_MIPS64_32BE = new LanguageID("MIPS:BE:64:64-32addr"); - protected static final LanguageID LANG_ID_MIPS32_BE_R6 = new LanguageID("MIPS:BE:32:R6"); - protected static final LanguageID LANG_ID_MIPS64_BE_R6 = new LanguageID("MIPS:BE:64:R6"); - protected static final LanguageID LANG_ID_MIPS32_BE_MICRO = new LanguageID("MIPS:BE:32:micro"); - protected static final CompilerSpecID COMP_ID_DEFAULT = new CompilerSpecID("default"); - - protected static class GdbMipsBELinux32DefOffer extends DefaultDebuggerMappingOffer { - public GdbMipsBELinux32DefOffer(TargetProcess process) { - super(process, 100, "GDB on Linux mips - 32-bit", LANG_ID_MIPS32_BE, COMP_ID_DEFAULT, - Set.of()); - } - } - - protected static class GdbMipsBELinux64DefOffer extends DefaultDebuggerMappingOffer { - public GdbMipsBELinux64DefOffer(TargetProcess process) { - super(process, 100, "GDB on Linux mips - 64-bit", LANG_ID_MIPS64_BE, COMP_ID_DEFAULT, - Set.of()); - } - } - - protected static class GdbMipsBELinux64_32Offer extends DefaultDebuggerMappingOffer { - public GdbMipsBELinux64_32Offer(TargetProcess process) { - super(process, 100, "GDB on Linux mips - 64/32-bit", LANG_ID_MIPS64_32BE, - COMP_ID_DEFAULT, Set.of()); - } - } - - protected static class GdbMipsBELinux32_R6Offer extends DefaultDebuggerMappingOffer { - public GdbMipsBELinux32_R6Offer(TargetProcess process) { - super(process, 100, "GDB on Linux mips - 32-bit R6", LANG_ID_MIPS32_BE_R6, - COMP_ID_DEFAULT, Set.of()); - } - } - - protected static class GdbMipsBELinux64_R6Offer extends DefaultDebuggerMappingOffer { - public GdbMipsBELinux64_R6Offer(TargetProcess process) { - super(process, 100, "GDB on Linux mips - 64-bit R6", LANG_ID_MIPS64_BE_R6, - COMP_ID_DEFAULT, Set.of()); - } - } - - protected static class GdbMipsBELinux32MicroOffer extends DefaultDebuggerMappingOffer { - public GdbMipsBELinux32MicroOffer(TargetProcess process) { - super(process, 100, "GDB on Linux mips - 32-bit micro", LANG_ID_MIPS32_BE_MICRO, - COMP_ID_DEFAULT, Set.of()); - } - } - - @Override - public Set offersForEnv(TargetEnvironment env, TargetObject target, - boolean includeOverrides) { - if (!(target instanceof TargetProcess)) { - return Set.of(); - } - TargetProcess process = (TargetProcess) target; - if (!env.getDebugger().toLowerCase().contains("gdb")) { - return Set.of(); - } - String os = env.getOperatingSystem(); - if (!os.contains("Linux")) { - return Set.of(); - } - String endian = env.getEndian(); - if (!endian.contains("big")) { - return Set.of(); - } - String arch = env.getArchitecture(); - if (arch.startsWith("mips:32")) { - return Set.of(new GdbMipsBELinux32DefOffer(process)); - } - else if (arch.startsWith("mips:64")) { - return Set.of(new GdbMipsBELinux64DefOffer(process)); - } - else if (arch.startsWith("mips:64_32")) { - return Set.of(new GdbMipsBELinux64_32Offer(process)); - } - else if (arch.startsWith("mips:32_R6")) { - return Set.of(new GdbMipsBELinux32_R6Offer(process)); - } - else if (arch.startsWith("mips:64_R6")) { - return Set.of(new GdbMipsBELinux64_R6Offer(process)); - } - else if (arch.startsWith("mips:32_micro")) { - return Set.of(new GdbMipsBELinux32MicroOffer(process)); - } - else if (arch.startsWith("mips")) { - return Set.of(new GdbMipsBELinux64DefOffer(process)); - } - return Set.of(); - } - -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/gdb/GdbPowerPCDebuggerMappingOpinion.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/gdb/GdbPowerPCDebuggerMappingOpinion.java deleted file mode 100644 index b734bc60a5..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/gdb/GdbPowerPCDebuggerMappingOpinion.java +++ /dev/null @@ -1,101 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.platform.gdb; - -import java.util.Set; - -import ghidra.app.plugin.core.debug.mapping.*; -import ghidra.dbg.target.*; -import ghidra.debug.api.model.DebuggerMappingOffer; -import ghidra.debug.api.model.DebuggerMappingOpinion; -import ghidra.program.model.lang.CompilerSpecID; -import ghidra.program.model.lang.LanguageID; - -/** - * TODO: Without architecture-specific extensions, this opinion is supplanted by the .ldefs-based - * one. Remove me? - */ -public class GdbPowerPCDebuggerMappingOpinion implements DebuggerMappingOpinion { - protected static final LanguageID LANG_ID_PPC32_BE = new LanguageID("PowerPC:BE:32:default"); - protected static final LanguageID LANG_ID_PPC64_BE = new LanguageID("PowerPC:BE:64:default"); - protected static final LanguageID LANG_ID_PPC64_BE_A2 = - new LanguageID("PowerPC:BE:64:A2-32addr"); - protected static final LanguageID LANG_ID_PPC64_BE_A2ALT = - new LanguageID("PowerPC:BE:64:A2ALT-32addr"); - protected static final CompilerSpecID COMP_ID_DEFAULT = new CompilerSpecID("default"); - - protected static class GdbPowerPCBE32DefLinuxOffer extends DefaultDebuggerMappingOffer { - public GdbPowerPCBE32DefLinuxOffer(TargetProcess process) { - super(process, 100, "GDB on Linux PowerPC - 32-bit", LANG_ID_PPC32_BE, COMP_ID_DEFAULT, - Set.of()); - } - } - - protected static class GdbPowerPCBE64DefLinuxOffer extends DefaultDebuggerMappingOffer { - public GdbPowerPCBE64DefLinuxOffer(TargetProcess process) { - super(process, 100, "GDB on Linux PowerPC - 64-bit", LANG_ID_PPC64_BE, COMP_ID_DEFAULT, - Set.of()); - } - } - - protected static class GdbPowerPCBE64A2LinuxOffer extends DefaultDebuggerMappingOffer { - public GdbPowerPCBE64A2LinuxOffer(TargetProcess process) { - super(process, 100, "GDB on Linux PowerPC - 64-bit A2", LANG_ID_PPC64_BE_A2, - COMP_ID_DEFAULT, Set.of()); - } - } - - protected static class GdbPowerPCBA64A2AltLinuxOffer extends DefaultDebuggerMappingOffer { - public GdbPowerPCBA64A2AltLinuxOffer(TargetProcess process) { - super(process, 100, "GDB on Linux PowerPC - 64-bit A2 ALT", LANG_ID_PPC64_BE_A2ALT, - COMP_ID_DEFAULT, Set.of()); - } - } - - @Override - public Set offersForEnv(TargetEnvironment env, TargetObject target, - boolean includeOverrides) { - if (!(target instanceof TargetProcess)) { - return Set.of(); - } - TargetProcess process = (TargetProcess) target; - if (!env.getDebugger().toLowerCase().contains("gdb")) { - return Set.of(); - } - String os = env.getOperatingSystem(); - if (!os.contains("Linux")) { - return Set.of(); - } - String endian = env.getEndian(); - if (!endian.contains("big")) { - return Set.of(); - } - String arch = env.getArchitecture(); - if (arch.startsWith("powerpc:32")) { - return Set.of(new GdbPowerPCBE32DefLinuxOffer(process)); - } - else if (arch.startsWith("powerpc:A2")) { - return Set.of(new GdbPowerPCBE64A2LinuxOffer(process)); - } - else if (arch.startsWith("powerpc:A2-Alt")) { - return Set.of(new GdbPowerPCBA64A2AltLinuxOffer(process)); - } - else if (arch.startsWith("powerpc")) { - return Set.of(new GdbPowerPCBE64DefLinuxOffer(process)); - } - return Set.of(); - } -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/gdb/GdbX86DebuggerMappingOpinion.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/gdb/GdbX86DebuggerMappingOpinion.java deleted file mode 100644 index 95569e7b22..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/gdb/GdbX86DebuggerMappingOpinion.java +++ /dev/null @@ -1,138 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.platform.gdb; - -import java.util.Collection; -import java.util.Set; - -import ghidra.app.plugin.core.debug.mapping.*; -import ghidra.dbg.target.*; -import ghidra.debug.api.model.*; -import ghidra.program.model.lang.*; -import ghidra.util.Msg; - -/** - * TODO: Refactor this onto the .ldefs-based gdb opinion. - */ -public class GdbX86DebuggerMappingOpinion implements DebuggerMappingOpinion { - protected static final LanguageID LANG_ID_X86 = new LanguageID("x86:LE:32:default"); - protected static final LanguageID LANG_ID_X86_64 = new LanguageID("x86:LE:64:default"); - protected static final CompilerSpecID COMP_ID_GCC = new CompilerSpecID("gcc"); - protected static final CompilerSpecID COMP_ID_VS = new CompilerSpecID("windows"); - - protected static class GdbI386X86_64RegisterMapper extends DefaultDebuggerRegisterMapper { - public GdbI386X86_64RegisterMapper(CompilerSpec cSpec, - TargetRegisterContainer targetRegContainer) { - super(cSpec, targetRegContainer, false); - } - - @Override - protected String normalizeName(String name) { - name = super.normalizeName(name); - if ("rflags".equals(name)) { - return "eflags"; - } - return name; - } - } - - protected static class GdbI386LinuxOffer extends DefaultDebuggerMappingOffer { - public GdbI386LinuxOffer(TargetProcess process) { - super(process, 100, "GDB on Linux i386", LANG_ID_X86, COMP_ID_GCC, Set.of()); - } - } - - protected static class GdbI386WindowsOffer extends DefaultDebuggerMappingOffer { - public GdbI386WindowsOffer(TargetProcess process) { - super(process, 100, "GDB on Cygwin/MSYS (Windows) i386", LANG_ID_X86, COMP_ID_VS, - Set.of()); - } - } - - protected static class GdbI386X86_64TraceMapper extends DefaultDebuggerTargetTraceMapper { - public GdbI386X86_64TraceMapper(TargetObject target, LanguageID langID, CompilerSpecID csId, - Collection extraRegNames) - throws LanguageNotFoundException, CompilerSpecNotFoundException { - super(target, langID, csId, extraRegNames); - } - - @Override - protected DebuggerRegisterMapper createRegisterMapper(TargetRegisterContainer registers) { - return new GdbI386X86_64RegisterMapper(cSpec, registers); - } - } - - protected static class GdbI386X86_64LinuxOffer extends DefaultDebuggerMappingOffer { - public GdbI386X86_64LinuxOffer(TargetProcess process) { - super(process, 100, "GDB on Linux x86_64", LANG_ID_X86_64, COMP_ID_GCC, Set.of()); - } - - @Override - public DebuggerTargetTraceMapper createMapper() - throws LanguageNotFoundException, CompilerSpecNotFoundException { - return new GdbI386X86_64TraceMapper(target, langID, csID, extraRegNames); - } - } - - protected static class GdbI386X86_64WindowsOffer extends DefaultDebuggerMappingOffer { - public GdbI386X86_64WindowsOffer(TargetProcess process) { - super(process, 100, "GDB on Cygwin/MSYS2 (Windows) x64", LANG_ID_X86_64, COMP_ID_VS, - Set.of()); - } - - @Override - public DebuggerTargetTraceMapper createMapper() - throws LanguageNotFoundException, CompilerSpecNotFoundException { - return new GdbI386X86_64TraceMapper(target, langID, csID, extraRegNames); - } - } - - @Override - public Set offersForEnv(TargetEnvironment env, TargetObject target, - boolean includeOverrides) { - if (!(target instanceof TargetProcess)) { - return Set.of(); - } - TargetProcess process = (TargetProcess) target; - if (!env.getDebugger().toLowerCase().contains("gdb")) { - return Set.of(); - } - String arch = env.getArchitecture(); - if (!arch.startsWith("i386")) { - return Set.of(); - } - boolean is64Bit = arch.contains("x86-64") || arch.contains("x64-32"); - String os = env.getOperatingSystem(); - Msg.info(this, "Generating offer for os=" + os + " arch=" + arch); - if (os.contains("Linux")) { - if (is64Bit) { - return Set.of(new GdbI386X86_64LinuxOffer(process)); - } - else { - return Set.of(new GdbI386LinuxOffer(process)); - } - } - else if (os.contains("Cygwin") || os.contains("Windows")) { - if (is64Bit) { - return Set.of(new GdbI386X86_64WindowsOffer(process)); - } - else { - return Set.of(new GdbI386WindowsOffer(process)); - } - } - return Set.of(); - } -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/jdi/JdiDalvikDebuggerMappingOpinion.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/jdi/JdiDalvikDebuggerMappingOpinion.java deleted file mode 100644 index 7baaf694b5..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/jdi/JdiDalvikDebuggerMappingOpinion.java +++ /dev/null @@ -1,82 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.platform.jdi; - -import java.util.Collection; -import java.util.Set; - -import ghidra.app.plugin.core.debug.mapping.*; -import ghidra.dbg.target.*; -import ghidra.debug.api.model.*; -import ghidra.program.model.lang.*; - -public class JdiDalvikDebuggerMappingOpinion implements DebuggerMappingOpinion { - protected static final LanguageID LANG_ID_DALVIK = new LanguageID("Dalvik:LE:32:default"); - protected static final CompilerSpecID COMP_ID_VS = new CompilerSpecID("default"); - - protected static final Set DALVIK_VM_NAMES = Set.of("Dalvik"); - - protected static class DalvikDebuggerTargetTraceMapper - extends DefaultDebuggerTargetTraceMapper { - public DalvikDebuggerTargetTraceMapper(TargetObject target, LanguageID langID, - CompilerSpecID csId, Collection extraRegNames) - throws LanguageNotFoundException, CompilerSpecNotFoundException { - super(target, langID, csId, extraRegNames); - } - - @Override - protected DebuggerMemoryMapper createMemoryMapper(TargetMemory memory) { - return new DefaultDebuggerMemoryMapper(language, memory.getModel()); - } - - @Override - protected DebuggerRegisterMapper createRegisterMapper(TargetRegisterContainer registers) { - return new DefaultDebuggerRegisterMapper(cSpec, registers, false); - } - } - - protected static class DalvikDebuggerMappingOffer extends DefaultDebuggerMappingOffer { - public DalvikDebuggerMappingOffer(TargetProcess process) { - super(process, 100, "Dalvik Virtual Machine", LANG_ID_DALVIK, COMP_ID_VS, Set.of()); - } - - @Override - public DebuggerTargetTraceMapper createMapper() - throws LanguageNotFoundException, CompilerSpecNotFoundException { - return new DalvikDebuggerTargetTraceMapper(target, langID, csID, extraRegNames); - } - } - - protected static boolean containsRecognizedJvmName(String name) { - return DALVIK_VM_NAMES.stream().anyMatch(name::contains); - } - - @Override - public Set offersForEnv(TargetEnvironment env, TargetObject target, - boolean includeOverrides) { - if (!(target instanceof TargetProcess)) { - return Set.of(); - } - if (!env.getDebugger().contains("Java Debug Interface")) { - return Set.of(); - } - if (!containsRecognizedJvmName(env.getArchitecture())) { - return Set.of(); - } - // NOTE: Not worried about JRE version - return Set.of(new DalvikDebuggerMappingOffer((TargetProcess) target)); - } -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/jdi/JdiJvmDebuggerMappingOpinion.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/jdi/JdiJvmDebuggerMappingOpinion.java deleted file mode 100644 index 3db516abff..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/jdi/JdiJvmDebuggerMappingOpinion.java +++ /dev/null @@ -1,82 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.platform.jdi; - -import java.util.Collection; -import java.util.Set; - -import ghidra.app.plugin.core.debug.mapping.*; -import ghidra.dbg.target.*; -import ghidra.debug.api.model.*; -import ghidra.program.model.lang.*; - -public class JdiJvmDebuggerMappingOpinion implements DebuggerMappingOpinion { - protected static final LanguageID LANG_ID_JAVA = new LanguageID("JVM:BE:32:default"); - protected static final CompilerSpecID COMP_ID_VS = new CompilerSpecID("default"); - - // TODO: Catalog other VMs that are Java, but not Dalvik - protected static final Set JVM_NAMES = Set.of("OpenJDK"); - - protected static class JavaDebuggerTargetTraceMapper extends DefaultDebuggerTargetTraceMapper { - public JavaDebuggerTargetTraceMapper(TargetObject target, LanguageID langID, - CompilerSpecID csId, Collection extraRegNames) - throws LanguageNotFoundException, CompilerSpecNotFoundException { - super(target, langID, csId, extraRegNames); - } - - @Override - protected DebuggerMemoryMapper createMemoryMapper(TargetMemory memory) { - return new DefaultDebuggerMemoryMapper(language, memory.getModel()); - } - - @Override - protected DebuggerRegisterMapper createRegisterMapper(TargetRegisterContainer registers) { - return new DefaultDebuggerRegisterMapper(cSpec, registers, false); - } - } - - protected static class JavaDebuggerMappingOffer extends DefaultDebuggerMappingOffer { - public JavaDebuggerMappingOffer(TargetProcess process) { - super(process, 100, "Java Virtual Machine", LANG_ID_JAVA, COMP_ID_VS, Set.of()); - } - - @Override - public DebuggerTargetTraceMapper createMapper() - throws LanguageNotFoundException, CompilerSpecNotFoundException { - return new JavaDebuggerTargetTraceMapper(target, langID, csID, extraRegNames); - } - } - - protected static boolean containsRecognizedJvmName(String name) { - return JVM_NAMES.stream().anyMatch(name::contains); - } - - @Override - public Set offersForEnv(TargetEnvironment env, TargetObject target, - boolean includeOverrides) { - if (!(target instanceof TargetProcess)) { - return Set.of(); - } - if (!env.getDebugger().contains("Java Debug Interface")) { - return Set.of(); - } - if (!containsRecognizedJvmName(env.getArchitecture())) { - return Set.of(); - } - // NOTE: Not worried about JRE version - return Set.of(new JavaDebuggerMappingOffer((TargetProcess) target)); - } -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/lldb/LldbArmDebuggerMappingOpinion.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/lldb/LldbArmDebuggerMappingOpinion.java deleted file mode 100644 index 63eb512829..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/lldb/LldbArmDebuggerMappingOpinion.java +++ /dev/null @@ -1,79 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.platform.lldb; - -import java.util.Set; - -import ghidra.app.plugin.core.debug.mapping.*; -import ghidra.dbg.target.*; -import ghidra.debug.api.model.DebuggerMappingOffer; -import ghidra.debug.api.model.DebuggerMappingOpinion; -import ghidra.program.model.lang.*; -import ghidra.util.Msg; - -/** - * TODO: How does LLDB name its target architectures? If same as GNU, use that. If not, maybe we - * should add those external names to .ldefs? It'd be nice to have an .ldefs-based opinion that this - * can be refactored onto. - */ -public class LldbArmDebuggerMappingOpinion implements DebuggerMappingOpinion { - protected static final LanguageID LANG_ID_AARCH64 = new LanguageID("AARCH64:LE:64:v8A"); - protected static final CompilerSpecID COMP_ID_DEFAULT = new CompilerSpecID("default"); - - protected static class LldbI386X86_64RegisterMapper extends DefaultDebuggerRegisterMapper { - public LldbI386X86_64RegisterMapper(CompilerSpec cSpec, - TargetRegisterContainer targetRegContainer) { - super(cSpec, targetRegContainer, false); - } - - @Override - protected String normalizeName(String name) { - name = super.normalizeName(name); - if ("rflags".equals(name)) { - return "eflags"; - } - return name; - } - } - - protected static class LldbAarch64MacosOffer extends DefaultDebuggerMappingOffer { - public LldbAarch64MacosOffer(TargetProcess process) { - super(process, 50, "AARCH64/LLDB on macos", LANG_ID_AARCH64, COMP_ID_DEFAULT, - Set.of("cpsr")); - } - } - - @Override - public Set offersForEnv(TargetEnvironment env, TargetObject target, - boolean includesOverrides) { - if (!(target instanceof TargetProcess)) { - return Set.of(); - } - if (!env.getDebugger().toLowerCase().contains("lldb")) { - return Set.of(); - } - String arch = env.getArchitecture(); - boolean is64Bit = arch.contains("AARCH64") || arch.contains("arm64"); - String os = env.getOperatingSystem(); - if (os.contains("macos") || os.contains("ios")) { - if (is64Bit) { - Msg.info(this, "Using os=" + os + " arch=" + arch); - return Set.of(new LldbAarch64MacosOffer((TargetProcess) target)); - } - } - return Set.of(); - } -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/lldb/LldbDebuggerProgramLaunchOpinion.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/lldb/LldbDebuggerProgramLaunchOpinion.java deleted file mode 100644 index 82a7480a89..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/lldb/LldbDebuggerProgramLaunchOpinion.java +++ /dev/null @@ -1,93 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.platform.lldb; - -import java.util.Collection; -import java.util.List; - -import ghidra.app.plugin.core.debug.service.model.launch.*; -import ghidra.dbg.DebuggerModelFactory; -import ghidra.dbg.util.PathUtils; -import ghidra.debug.api.model.DebuggerProgramLaunchOffer; -import ghidra.framework.plugintool.PluginTool; -import ghidra.program.model.listing.Program; - -public class LldbDebuggerProgramLaunchOpinion extends AbstractDebuggerProgramLaunchOpinion { - protected static final List> OFFER_CLASSES = - List.of( - InVmLldbDebuggerProgramLaunchOffer.class, - GadpLldbDebuggerProgramLaunchOffer.class); - - protected static abstract class AbstractLldbDebuggerProgramLaunchOffer - extends AbstractDebuggerProgramLaunchOffer { - - public AbstractLldbDebuggerProgramLaunchOffer(Program program, PluginTool tool, - DebuggerModelFactory factory) { - super(program, tool, factory); - } - - @Override - protected List getLauncherPath() { - return PathUtils.parse(""); - } - - } - - @FactoryClass("agent.lldb.LldbInJvmDebuggerModelFactory") - protected static class InVmLldbDebuggerProgramLaunchOffer - extends AbstractLldbDebuggerProgramLaunchOffer { - - public InVmLldbDebuggerProgramLaunchOffer(Program program, PluginTool tool, - DebuggerModelFactory factory) { - super(program, tool, factory); - } - - @Override - public String getConfigName() { - return "IN-VM LLDB"; - } - - @Override - public String getMenuTitle() { - return "in LLDB locally IN-VM"; - } - } - - @FactoryClass("agent.lldb.gadp.LldbGadpDebuggerModelFactory") - protected static class GadpLldbDebuggerProgramLaunchOffer - extends AbstractLldbDebuggerProgramLaunchOffer { - - public GadpLldbDebuggerProgramLaunchOffer(Program program, PluginTool tool, - DebuggerModelFactory factory) { - super(program, tool, factory); - } - - @Override - public String getConfigName() { - return "GADP LLDB"; - } - - @Override - public String getMenuTitle() { - return "in LLDB locally via GADP"; - } - } - - @Override - protected Collection> getOfferClasses() { - return OFFER_CLASSES; - } -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/lldb/LldbX86DebuggerMappingOpinion.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/lldb/LldbX86DebuggerMappingOpinion.java deleted file mode 100644 index ab4ac525ae..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/platform/lldb/LldbX86DebuggerMappingOpinion.java +++ /dev/null @@ -1,131 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.platform.lldb; - -import java.util.Set; - -import ghidra.app.plugin.core.debug.mapping.*; -import ghidra.dbg.target.*; -import ghidra.debug.api.model.DebuggerMappingOffer; -import ghidra.debug.api.model.DebuggerMappingOpinion; -import ghidra.program.model.lang.CompilerSpecID; -import ghidra.program.model.lang.LanguageID; -import ghidra.util.Msg; - -public class LldbX86DebuggerMappingOpinion implements DebuggerMappingOpinion { - protected static final LanguageID LANG_ID_X86 = new LanguageID("x86:LE:32:default"); - protected static final LanguageID LANG_ID_X86_64 = new LanguageID("x86:LE:64:default"); - protected static final CompilerSpecID COMP_ID_DEFAULT = new CompilerSpecID("default"); - protected static final CompilerSpecID COMP_ID_GCC = new CompilerSpecID("gcc"); - protected static final CompilerSpecID COMP_ID_VS = new CompilerSpecID("windows"); - - protected static class LldbI386MacosOffer extends DefaultDebuggerMappingOffer { - public LldbI386MacosOffer(TargetProcess process) { - super(process, 100, "LLDB on macOS i386", LANG_ID_X86, COMP_ID_GCC, Set.of()); - } - } - - protected static class LldbI386LinuxOffer extends DefaultDebuggerMappingOffer { - public LldbI386LinuxOffer(TargetProcess process) { - super(process, 100, "LLDB on Linux i386", LANG_ID_X86, COMP_ID_GCC, Set.of()); - } - } - - // TODO - protected static class LldbI386WindowsOffer extends DefaultDebuggerMappingOffer { - public LldbI386WindowsOffer(TargetProcess process) { - super(process, 100, "LLDB on Windows i386", LANG_ID_X86, COMP_ID_VS, - Set.of()); - } - } - - protected static class LldbI386X86_64MacosOffer extends DefaultDebuggerMappingOffer { - public LldbI386X86_64MacosOffer(TargetProcess process) { - super(process, 100, "LLDB on macOS x86_64", LANG_ID_X86_64, COMP_ID_GCC, Set.of()); - } - } - - protected static class LldbI386X86_64LinuxOffer extends DefaultDebuggerMappingOffer { - public LldbI386X86_64LinuxOffer(TargetProcess process) { - super(process, 100, "LLDB on Linux x86_64", LANG_ID_X86_64, COMP_ID_GCC, Set.of()); - } - } - - protected static class LldbI386X86_64WindowsOffer extends DefaultDebuggerMappingOffer { - public LldbI386X86_64WindowsOffer(TargetProcess process) { - super(process, 100, "LLDB on Windows x64", LANG_ID_X86_64, COMP_ID_VS, - Set.of()); - } - } - - @Override - public Set offersForEnv(TargetEnvironment env, TargetObject target, - boolean includeOverrides) { - if (!(target instanceof TargetProcess)) { - return Set.of(); - } - TargetProcess process = (TargetProcess) target; - if (!env.getDebugger().toLowerCase().contains("lldb")) { - return Set.of(); - } - String arch = env.getArchitecture(); - boolean is32Bit = arch.contains("x86-32") || arch.contains("i386") || - arch.contains("x86_32"); - boolean is64Bit = arch.contains("x86-64") || arch.contains("x64-32") || - arch.contains("x86_64") || arch.contains("x64_32") || arch.contains("i686"); - String os = env.getOperatingSystem(); - if (os.contains("macos")) { - if (is64Bit) { - Msg.info(this, "Using os=" + os + " arch=" + arch); - return Set.of(new LldbI386X86_64MacosOffer(process)); - } - else if (is32Bit) { - Msg.info(this, "Using os=" + os + " arch=" + arch); - return Set.of(new LldbI386MacosOffer(process)); - } - else { - return Set.of(); - } - } - else if (os.contains("Linux") || os.contains("linux")) { - if (is64Bit) { - Msg.info(this, "Using os=" + os + " arch=" + arch); - return Set.of(new LldbI386X86_64LinuxOffer(process)); - } - else if (is32Bit) { - Msg.info(this, "Using os=" + os + " arch=" + arch); - return Set.of(new LldbI386LinuxOffer(process)); - } - else { - return Set.of(); - } - } - else if (os.contains("windows")) { - if (is64Bit) { - Msg.info(this, "Using os=" + os + " arch=" + arch); - return Set.of(new LldbI386X86_64WindowsOffer(process)); - } - else if (is32Bit) { - Msg.info(this, "Using os=" + os + " arch=" + arch); - return Set.of(new LldbI386WindowsOffer(process)); - } - else { - return Set.of(); - } - } - return Set.of(); - } -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DebuggerConnectDialog.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DebuggerConnectDialog.java index cbdc0c2e1a..7fa51b2f49 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DebuggerConnectDialog.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DebuggerConnectDialog.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -45,6 +45,7 @@ import ghidra.program.model.listing.Program; import ghidra.util.*; import ghidra.util.datastruct.CollectionChangeListener; +@Deprecated(forRemoval = true, since = "11.3") public class DebuggerConnectDialog extends ReusableDialogComponentProvider implements PropertyChangeListener { private static final String KEY_CURRENT_FACTORY_CLASSNAME = "currentFactoryCls"; diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DebuggerModelServiceInternal.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DebuggerModelServiceInternal.java index 7c546e1c40..f5e3b4f098 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DebuggerModelServiceInternal.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DebuggerModelServiceInternal.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -34,6 +34,7 @@ import ghidra.lifecycle.Internal; * purposes only. */ @Internal +@Deprecated(forRemoval = true, since = "11.2") public interface DebuggerModelServiceInternal extends DebuggerModelService { /** * Force the set of factory instances to be that given diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DebuggerModelServicePlugin.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DebuggerModelServicePlugin.java index 01a561f8a7..77b58808dd 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DebuggerModelServicePlugin.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DebuggerModelServicePlugin.java @@ -73,6 +73,7 @@ import ghidra.util.datastruct.ListenerSet; servicesProvided = { DebuggerModelService.class }) +@Deprecated(forRemoval = true, since = "11.2") public class DebuggerModelServicePlugin extends Plugin implements DebuggerModelServiceInternal, ApplicationLevelOnlyPlugin { diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DebuggerModelServiceProxyPlugin.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DebuggerModelServiceProxyPlugin.java index 9a95b0ec33..c218c20f0d 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DebuggerModelServiceProxyPlugin.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DebuggerModelServiceProxyPlugin.java @@ -87,6 +87,7 @@ import ghidra.util.task.TaskMonitor; DebuggerTargetService.class, DebuggerTraceManagerService.class, }, servicesProvided = { DebuggerModelService.class, }) +@Deprecated(forRemoval = true, since = "11.2") public class DebuggerModelServiceProxyPlugin extends Plugin implements DebuggerModelServiceInternal { diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DebuggerSelectMappingOfferDialog.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DebuggerSelectMappingOfferDialog.java index 9a6637d4d0..ac8ca94d2d 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DebuggerSelectMappingOfferDialog.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DebuggerSelectMappingOfferDialog.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -35,6 +35,7 @@ import ghidra.program.util.DefaultLanguageService; import ghidra.util.table.GhidraTable; import ghidra.util.table.GhidraTableFilterPanel; +@Deprecated(forRemoval = true, since = "11.3") public class DebuggerSelectMappingOfferDialog extends ReusableDialogComponentProvider { protected enum OfferTableColumns diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DefaultBreakpointRecorder.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DefaultBreakpointRecorder.java index e899d41125..3948fcda90 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DefaultBreakpointRecorder.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DefaultBreakpointRecorder.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -22,13 +22,14 @@ import ghidra.app.plugin.core.debug.service.model.interfaces.ManagedBreakpointRe import ghidra.dbg.target.*; import ghidra.dbg.util.PathUtils; import ghidra.debug.api.model.TraceRecorder; -import ghidra.program.model.address.*; +import ghidra.program.model.address.AddressRange; import ghidra.trace.model.Trace; import ghidra.trace.model.breakpoint.*; import ghidra.trace.model.thread.TraceThread; import ghidra.util.Msg; import ghidra.util.exception.DuplicateNameException; +@Deprecated(forRemoval = true, since = "11.3") public class DefaultBreakpointRecorder implements ManagedBreakpointRecorder { protected static String nameBreakpoint(TargetBreakpointLocation bpt) { diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DefaultMemoryRecorder.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DefaultMemoryRecorder.java index 8cd66b1487..c011059738 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DefaultMemoryRecorder.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DefaultMemoryRecorder.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -32,6 +32,7 @@ import ghidra.util.Msg; import ghidra.util.exception.DuplicateNameException; import ghidra.util.task.TaskMonitor; +@Deprecated(forRemoval = true, since = "11.3") public class DefaultMemoryRecorder implements ManagedMemoryRecorder { // For large memory captures diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DefaultModuleRecorder.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DefaultModuleRecorder.java index 574260f694..745e8aeceb 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DefaultModuleRecorder.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DefaultModuleRecorder.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -24,6 +24,7 @@ import ghidra.trace.model.modules.*; import ghidra.util.Msg; import ghidra.util.exception.DuplicateNameException; +@Deprecated(forRemoval = true, since = "11.3") public class DefaultModuleRecorder implements ManagedModuleRecorder { private final DefaultTraceRecorder recorder; diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DefaultProcessRecorder.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DefaultProcessRecorder.java index e2891b5132..0e2835fcfd 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DefaultProcessRecorder.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DefaultProcessRecorder.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -24,6 +24,7 @@ import ghidra.program.model.address.AddressSetView; import ghidra.trace.model.Trace; import ghidra.util.TriConsumer; +@Deprecated(forRemoval = true, since = "11.3") public class DefaultProcessRecorder implements ManagedProcessRecorder { private final AbstractRecorderMemory processMemory; diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DefaultStackRecorder.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DefaultStackRecorder.java index a554dc23cf..7bd4f8fdb9 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DefaultStackRecorder.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DefaultStackRecorder.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -28,6 +28,7 @@ import ghidra.trace.model.Trace; import ghidra.trace.model.stack.*; import ghidra.trace.model.thread.TraceThread; +@Deprecated(forRemoval = true, since = "11.3") public class DefaultStackRecorder implements ManagedStackRecorder { protected static int getFrameLevel(TargetStackFrame frame) { diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DefaultThreadRecorder.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DefaultThreadRecorder.java index eba86126e5..88b3ef9cd0 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DefaultThreadRecorder.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DefaultThreadRecorder.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -41,6 +41,7 @@ import ghidra.util.Msg; import ghidra.util.TimedMsg; import ghidra.util.exception.DuplicateNameException; +@Deprecated(forRemoval = true, since = "11.3") public class DefaultThreadRecorder implements ManagedThreadRecorder { //private static final boolean LOG_STACK_TRACE = false; diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DefaultTimeRecorder.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DefaultTimeRecorder.java index 37a39dafd5..2507c305ea 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DefaultTimeRecorder.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DefaultTimeRecorder.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -19,6 +19,7 @@ import ghidra.trace.model.Trace; import ghidra.trace.model.thread.TraceThread; import ghidra.trace.model.time.TraceSnapshot; +@Deprecated(forRemoval = true, since = "11.3") public class DefaultTimeRecorder { private DefaultTraceRecorder recorder; diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DefaultTraceRecorder.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DefaultTraceRecorder.java index 1dd3e6cd7c..d69607b59f 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DefaultTraceRecorder.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/DefaultTraceRecorder.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -46,8 +46,7 @@ import ghidra.trace.model.memory.TraceMemoryRegion; import ghidra.trace.model.modules.TraceModule; import ghidra.trace.model.modules.TraceSection; import ghidra.trace.model.stack.TraceStackFrame; -import ghidra.trace.model.target.TraceObject; -import ghidra.trace.model.target.TraceObjectKeyPath; +import ghidra.trace.model.target.*; import ghidra.trace.model.thread.TraceThread; import ghidra.trace.model.time.TraceSnapshot; import ghidra.util.Msg; @@ -55,6 +54,7 @@ import ghidra.util.datastruct.ListenerSet; import ghidra.util.exception.DuplicateNameException; import ghidra.util.task.TaskMonitor; +@Deprecated(forRemoval = true, since = "11.3") public class DefaultTraceRecorder implements TraceRecorder { static final int POOL_SIZE = Math.min(16, Runtime.getRuntime().availableProcessors()); diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/PermanentTransactionExecutor.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/PermanentTransactionExecutor.java index 3c32404d73..e40c9c3ac8 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/PermanentTransactionExecutor.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/PermanentTransactionExecutor.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -29,6 +29,7 @@ import ghidra.framework.model.DomainObjectException; import ghidra.util.Msg; import ghidra.util.exception.ClosedException; +@Deprecated(forRemoval = true, since = "11.3") public class PermanentTransactionExecutor { private final TransactionCoalescer txc; diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/RecorderBreakpointLocationResolver.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/RecorderBreakpointLocationResolver.java index daf599f887..8d6be1fe46 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/RecorderBreakpointLocationResolver.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/RecorderBreakpointLocationResolver.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -26,6 +26,7 @@ import ghidra.dbg.util.PathUtils; import ghidra.trace.model.thread.TraceThread; import ghidra.util.Msg; +@Deprecated(forRemoval = true, since = "11.3") public class RecorderBreakpointLocationResolver { // TODO: I'm not sure this class really offers anything anymore diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/RecorderPermanentTransaction.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/RecorderPermanentTransaction.java index fefa9c6abd..93a7c77a3f 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/RecorderPermanentTransaction.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/RecorderPermanentTransaction.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -18,6 +18,7 @@ package ghidra.app.plugin.core.debug.service.model; import db.Transaction; import ghidra.framework.model.DomainObject; +@Deprecated(forRemoval = true, since = "11.3") public class RecorderPermanentTransaction implements AutoCloseable { public static RecorderPermanentTransaction start(DomainObject obj, String description) { diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/RecorderSimpleMemory.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/RecorderSimpleMemory.java index 54080e0032..b532603b86 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/RecorderSimpleMemory.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/RecorderSimpleMemory.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -26,6 +26,7 @@ import ghidra.dbg.target.*; import ghidra.debug.api.model.DebuggerMemoryMapper; import ghidra.program.model.address.*; +@Deprecated(forRemoval = true, since = "11.3") public class RecorderSimpleMemory implements AbstractRecorderMemory { private static final int BLOCK_SIZE = 4096; diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/RecorderSimpleRegisterSet.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/RecorderSimpleRegisterSet.java deleted file mode 100644 index c2d024b8ef..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/RecorderSimpleRegisterSet.java +++ /dev/null @@ -1,34 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.service.model; - -import ghidra.dbg.target.TargetRegisterBank; -import ghidra.debug.api.model.TraceRecorder; - -public class RecorderSimpleRegisterSet { - - private TraceRecorder recorder; - private TargetRegisterBank bank; - - public RecorderSimpleRegisterSet(TraceRecorder recorder) { - this.recorder = recorder; - } - - public void updateRegisters(TargetRegisterBank newRegs, TargetRegisterBank oldRegs) { - this.bank = newRegs; - } - -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/RecorderThreadMap.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/RecorderThreadMap.java index e11ee0ee6c..dcf4b99af8 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/RecorderThreadMap.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/RecorderThreadMap.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -22,6 +22,7 @@ import ghidra.dbg.target.TargetObject; import ghidra.dbg.target.TargetThread; import ghidra.trace.model.thread.TraceThread; +@Deprecated(forRemoval = true, since = "11.3") public class RecorderThreadMap { protected final NavigableSet observedThreadPathLengths = new TreeSet<>(); diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/TraceEventListener.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/TraceEventListener.java index 1879a3bf31..9f29d50714 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/TraceEventListener.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/TraceEventListener.java @@ -38,6 +38,7 @@ import ghidra.util.Msg; import ghidra.util.TimedMsg; import ghidra.util.datastruct.PrivatelyQueuedListener; +@Deprecated(forRemoval = true, since = "11.3") public class TraceEventListener extends AnnotatedDebuggerAttributeListener { private final DefaultTraceRecorder recorder; diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/TraceObjectListener.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/TraceObjectListener.java index 710923d80f..89b267a040 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/TraceObjectListener.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/TraceObjectListener.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -27,6 +27,7 @@ import ghidra.dbg.util.PathUtils.PathComparator; import ghidra.util.Msg; import ghidra.util.datastruct.PrivatelyQueuedListener; +@Deprecated(forRemoval = true, since = "11.3") public class TraceObjectListener implements DebuggerModelListener { private TraceObjectManager objectManager; diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/TraceObjectManager.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/TraceObjectManager.java index 66010922c8..0585a0c857 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/TraceObjectManager.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/TraceObjectManager.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -23,7 +23,7 @@ import java.util.function.*; import java.util.stream.Collectors; import db.Transaction; -import ghidra.app.plugin.core.debug.mapping.*; +import ghidra.app.plugin.core.debug.mapping.DefaultDebuggerTargetTraceMapper; import ghidra.app.plugin.core.debug.service.model.interfaces.*; import ghidra.async.AsyncLazyMap; import ghidra.dbg.target.*; @@ -41,6 +41,7 @@ import ghidra.util.Msg; import ghidra.util.datastruct.ListenerSet; import ghidra.util.exception.DuplicateNameException; +@Deprecated(forRemoval = true, since = "11.3") public class TraceObjectManager { private final TargetObject target; diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/TraceRecorderTarget.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/TraceRecorderTarget.java index 5e4a766a83..7781cc8bef 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/TraceRecorderTarget.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/TraceRecorderTarget.java @@ -16,12 +16,10 @@ package ghidra.app.plugin.core.debug.service.model; import java.util.*; -import java.util.Map.Entry; import java.util.concurrent.CompletableFuture; import java.util.concurrent.TimeUnit; import java.util.function.Function; import java.util.function.Predicate; -import java.util.stream.Collectors; import docking.ActionContext; import ghidra.app.context.ProgramLocationActionContext; @@ -58,6 +56,7 @@ import ghidra.trace.model.thread.TraceThread; import ghidra.util.Msg; import ghidra.util.task.TaskMonitor; +@Deprecated(forRemoval = true, since = "11.3") public class TraceRecorderTarget extends AbstractTarget { private final TraceRecorder recorder; diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/interfaces/AbstractRecorderMemory.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/interfaces/AbstractRecorderMemory.java index 5b5e22c68a..6be65ca5d7 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/interfaces/AbstractRecorderMemory.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/interfaces/AbstractRecorderMemory.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -22,6 +22,7 @@ import ghidra.dbg.target.*; import ghidra.debug.api.model.DebuggerMemoryMapper; import ghidra.program.model.address.*; +@Deprecated(forRemoval = true, since = "11.3") public interface AbstractRecorderMemory { public void addMemory(TargetMemory memory); diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/interfaces/AbstractTraceRecorder.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/interfaces/AbstractTraceRecorder.java index 1c460e8ea0..70824b6780 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/interfaces/AbstractTraceRecorder.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/interfaces/AbstractTraceRecorder.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -18,6 +18,7 @@ package ghidra.app.plugin.core.debug.service.model.interfaces; import ghidra.debug.api.model.DebuggerMemoryMapper; import ghidra.trace.model.Trace; +@Deprecated(forRemoval = true, since = "11.3") public interface AbstractTraceRecorder { public Trace getTrace(); diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/interfaces/ManagedBreakpointRecorder.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/interfaces/ManagedBreakpointRecorder.java index 4bf6cf69d0..8a23fe0ad5 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/interfaces/ManagedBreakpointRecorder.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/interfaces/ManagedBreakpointRecorder.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -24,6 +24,7 @@ import ghidra.trace.model.breakpoint.TraceBreakpoint; import ghidra.trace.model.breakpoint.TraceBreakpointKind; import ghidra.trace.model.thread.TraceThread; +@Deprecated(forRemoval = true, since = "11.3") public interface ManagedBreakpointRecorder { void offerBreakpointContainer(TargetBreakpointSpecContainer added); diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/interfaces/ManagedMemoryRecorder.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/interfaces/ManagedMemoryRecorder.java index b1e12e97b5..31aebbdf8c 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/interfaces/ManagedMemoryRecorder.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/interfaces/ManagedMemoryRecorder.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -19,6 +19,7 @@ import ghidra.dbg.target.TargetMemory; import ghidra.dbg.target.TargetMemoryRegion; import ghidra.trace.model.memory.TraceMemoryRegion; +@Deprecated(forRemoval = true, since = "11.3") public interface ManagedMemoryRecorder { void offerProcessMemory(TargetMemory memory); diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/interfaces/ManagedModuleRecorder.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/interfaces/ManagedModuleRecorder.java index ad177f6e2e..ea6e4df637 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/interfaces/ManagedModuleRecorder.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/interfaces/ManagedModuleRecorder.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -20,6 +20,7 @@ import ghidra.dbg.target.TargetSection; import ghidra.trace.model.modules.TraceModule; import ghidra.trace.model.modules.TraceSection; +@Deprecated(forRemoval = true, since = "11.3") public interface ManagedModuleRecorder { void offerProcessModule(TargetModule module); diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/interfaces/ManagedProcessRecorder.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/interfaces/ManagedProcessRecorder.java index 337a9f537a..adba276f46 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/interfaces/ManagedProcessRecorder.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/interfaces/ManagedProcessRecorder.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -15,6 +15,7 @@ */ package ghidra.app.plugin.core.debug.service.model.interfaces; +@Deprecated(forRemoval = true, since = "11.3") public interface ManagedProcessRecorder extends AbstractTraceRecorder { public AbstractRecorderMemory getProcessMemory(); diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/interfaces/ManagedStackRecorder.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/interfaces/ManagedStackRecorder.java index 6d495d9b1b..37f56a8757 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/interfaces/ManagedStackRecorder.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/interfaces/ManagedStackRecorder.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -20,6 +20,7 @@ import ghidra.dbg.target.TargetStackFrame; import ghidra.trace.model.stack.TraceStackFrame; import ghidra.trace.model.thread.TraceThread; +@Deprecated(forRemoval = true, since = "11.3") public interface ManagedStackRecorder { void offerStackFrame(TargetStackFrame added); diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/interfaces/ManagedThreadRecorder.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/interfaces/ManagedThreadRecorder.java index e9cdda6b86..5abae978ba 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/interfaces/ManagedThreadRecorder.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/interfaces/ManagedThreadRecorder.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -23,6 +23,7 @@ import ghidra.dbg.target.TargetExecutionStateful.TargetExecutionState; import ghidra.debug.api.model.DebuggerRegisterMapper; import ghidra.trace.model.thread.TraceThread; +@Deprecated(forRemoval = true, since = "11.3") public interface ManagedThreadRecorder extends AbstractTraceRecorder { public TargetThread getTargetThread(); diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/launch/AbstractDebuggerProgramLaunchOffer.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/launch/AbstractDebuggerProgramLaunchOffer.java deleted file mode 100644 index 0295f0abcc..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/launch/AbstractDebuggerProgramLaunchOffer.java +++ /dev/null @@ -1,710 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.service.model.launch; - -import static ghidra.async.AsyncUtils.loop; - -import java.io.File; -import java.io.IOException; -import java.util.*; -import java.util.Map.Entry; -import java.util.concurrent.CancellationException; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import javax.swing.Icon; -import javax.swing.JOptionPane; - -import org.jdom.Element; -import org.jdom.JDOMException; - -import db.Transaction; -import ghidra.app.plugin.core.debug.gui.DebuggerResources; -import ghidra.app.plugin.core.debug.gui.objects.components.DebuggerMethodInvocationDialog; -import ghidra.app.services.*; -import ghidra.app.services.DebuggerTraceManagerService.ActivationCause; -import ghidra.async.*; -import ghidra.dbg.*; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetLauncher.TargetCmdLineLauncher; -import ghidra.dbg.target.TargetMethod.ParameterDescription; -import ghidra.dbg.target.TargetMethod.TargetParameterMap; -import ghidra.dbg.target.schema.TargetObjectSchema; -import ghidra.dbg.util.PathUtils; -import ghidra.debug.api.ValStr; -import ghidra.debug.api.model.DebuggerProgramLaunchOffer; -import ghidra.debug.api.model.TraceRecorder; -import ghidra.debug.api.modules.*; -import ghidra.debug.api.modules.ModuleMapProposal.ModuleMapEntry; -import ghidra.framework.model.DomainFile; -import ghidra.framework.options.SaveState; -import ghidra.framework.plugintool.AutoConfigState.ConfigStateField; -import ghidra.framework.plugintool.PluginTool; -import ghidra.program.model.address.*; -import ghidra.program.model.listing.*; -import ghidra.program.util.ProgramLocation; -import ghidra.trace.model.Trace; -import ghidra.trace.model.TraceLocation; -import ghidra.trace.model.modules.TraceModule; -import ghidra.util.Msg; -import ghidra.util.Swing; -import ghidra.util.datastruct.CollectionChangeListener; -import ghidra.util.exception.CancelledException; -import ghidra.util.task.TaskMonitor; -import ghidra.util.xml.XmlUtilities; - -public abstract class AbstractDebuggerProgramLaunchOffer implements DebuggerProgramLaunchOffer { - private static final String HTML = "

"; - private static final String NO_PAUSE_DIAGNOSTIC_MESSAGE = "" + - "It's possible the target launched but never paused, and so Ghidra has not been " + - "able to inspect it. Try interrupting the target, then inspect the process list. " + - "Further intervention may be required to establish the module/address mappings."; - - protected final Program program; - protected final PluginTool tool; - protected final DebuggerModelFactory factory; - - public AbstractDebuggerProgramLaunchOffer(Program program, PluginTool tool, - DebuggerModelFactory factory) { - this.program = program; - this.tool = tool; - this.factory = factory; - } - - @Override - public Icon getIcon() { - return DebuggerResources.ICON_DEBUGGER; - } - - @Override - public String getMenuParentTitle() { - String name = program.getName(); - DomainFile df = program.getDomainFile(); - if (df != null) { - name = df.getName(); - } - return "Debug " + name; - } - - protected List getLauncherPath() { - return PathUtils.parse(""); - } - - protected long getTimeoutMillis() { - return 10000; - } - - protected static class TargetResult extends CompletableFuture - implements DebuggerModelListener { - private final DebuggerObjectModel model; - - public TargetResult(DebuggerObjectModel model) { - this.model = model; - exceptionally(this::onError); - model.addModelListener(this); - } - - protected void checkObject(TargetObject object) { - if (DebugModelConventions.liveProcessOrNull(object) == null) { - return; - } - complete(object); - model.removeModelListener(this); - } - - protected TargetObject onError(Throwable ex) { - model.removeModelListener(this); - return null; - } - - @Override - public void created(TargetObject object) { - checkObject(object); - } - - @Override - public void attributesChanged(TargetObject object, Collection removed, - Map added) { - if (!added.containsKey(TargetExecutionStateful.STATE_ATTRIBUTE_NAME)) { - return; - } - checkObject(object); - } - } - - /** - * Listen for the launched target in the model - * - *

- * The abstract offer will invoke this before invoking the launch command, so there should be no - * need to replay. Once the target has been found, the listener must remove itself. The default - * is to just listen for the first live {@link TargetProcess} that appears. See - * {@link DebugModelConventions#isProcessAlive(TargetProcess)}. - * - * @param model the model - * @return a future that completes with the target object - */ - protected CompletableFuture listenForTarget(DebuggerObjectModel model) { - return new TargetResult(model); - } - - protected static class RecorderResult extends CompletableFuture - implements CollectionChangeListener { - private final DebuggerModelService service; - private final TargetObject target; - - public RecorderResult(DebuggerModelService service, TargetObject target) { - this.service = service; - this.target = target; - exceptionally(this::onError); - service.addTraceRecordersChangedListener(this); - } - - protected TraceRecorder onError(Throwable ex) { - service.removeTraceRecordersChangedListener(this); - return null; - } - - @Override - public void elementAdded(TraceRecorder element) { - if (element.getTarget() == target) { - complete(element); - service.removeTraceRecordersChangedListener(this); - } - } - } - - /** - * Listen for the recording of a given target - * - * @param service the model service - * @param target the expected target - * @return a future that completes with the recorder - */ - protected CompletableFuture listenForRecorder(DebuggerModelService service, - TargetObject target) { - return new RecorderResult(service, target); - } - - protected static class MappingResult extends CompletableFuture - implements DebuggerStaticMappingChangeListener { - private final DebuggerStaticMappingService mappingService; - private final TraceRecorder recorder; - private final Program program; - - private final Trace trace; - private final ProgramLocation probe; - - public MappingResult(DebuggerStaticMappingService mappingService, TraceRecorder recorder, - Program program) { - this.mappingService = mappingService; - this.recorder = recorder; - this.program = program; - - this.probe = new ProgramLocation(program, getMappingProbeAddress()); - this.trace = recorder.getTrace(); - - exceptionally(this::onError); - mappingService.addChangeListener(this); - check(); - } - - protected Void onError(Throwable ex) { - mappingService.removeChangeListener(this); - return null; - } - - protected Address getMappingProbeAddress() { - AddressIterator eepi = program.getSymbolTable().getExternalEntryPointIterator(); - if (eepi.hasNext()) { - return eepi.next(); - } - InstructionIterator ii = program.getListing().getInstructions(true); - if (ii.hasNext()) { - return ii.next().getAddress(); - } - AddressSetView es = program.getMemory().getExecuteSet(); - if (!es.isEmpty()) { - return es.getMinAddress(); - } - if (!program.getMemory().isEmpty()) { - return program.getMinAddress(); - } - return null; // There's no hope - } - - @Override - public void mappingsChanged(Set affectedTraces, Set affectedPrograms) { - if (!affectedPrograms.contains(program) && - !affectedTraces.contains(trace)) { - return; - } - check(); - } - - protected void check() { - TraceLocation result = - mappingService.getOpenMappedLocation(trace, probe, recorder.getSnap()); - if (result == null) { - return; - } - complete(null); - mappingService.removeChangeListener(this); - } - } - - protected CompletableFuture listenForMapping( - DebuggerStaticMappingService mappingService, TraceRecorder recorder) { - return new MappingResult(mappingService, recorder, program); - } - - protected Collection invokeMapper(TaskMonitor monitor, - DebuggerStaticMappingService mappingService, TraceRecorder recorder) - throws CancelledException { - Map map = - mappingService.proposeModuleMaps(recorder.getTrace().getModuleManager().getAllModules(), - List.of(program)); - Collection proposal = MapProposal.flatten(map.values()); - mappingService.addModuleMappings(proposal, monitor, true); - return proposal; - } - - private void saveLauncherArgs(Map> args, - Map> params) { - SaveState state = new SaveState(); - for (ParameterDescription param : params.values()) { - ValStr val = args.get(param.name); - if (val != null) { - ConfigStateField.putState(state, param.type.asSubclass(Object.class), param.name, - val.val()); - } - } - if (program != null) { - ProgramUserData userData = program.getProgramUserData(); - try (Transaction tx = userData.openTransaction()) { - Element element = state.saveToXml(); - userData.setStringProperty(TargetCmdLineLauncher.CMDLINE_ARGS_NAME, - XmlUtilities.toString(element)); - } - } - } - - protected Map takeDefaultsForParameters( - Map> params) { - return params.values().stream().collect(Collectors.toMap(p -> p.name, p -> p.defaultValue)); - } - - /** - * Generate the default launcher arguments - * - *

- * It is not sufficient to simply take the defaults specified in the parameters. This must - * populate the arguments necessary to launch the requested program. - * - * @param params the parameters - * @return the default arguments - */ - protected Map> generateDefaultLauncherArgs( - Map> params) { - if (program == null) { - return Map.of(); - } - Map> map = new LinkedHashMap<>(); - for (Entry> entry : params.entrySet()) { - map.put(entry.getKey(), ValStr.from(entry.getValue().defaultValue)); - } - String almostExecutablePath = program.getExecutablePath(); - File f = new File(almostExecutablePath); - map.put(TargetCmdLineLauncher.CMDLINE_ARGS_NAME, - ValStr.from(TargetCmdLineLauncher.quoteImagePathIfSpaces(f.getAbsolutePath()))); - return map; - } - - /** - * Prompt the user for arguments, showing those last used or defaults - * - * @param params the parameters of the model's launcher - * @return the arguments given by the user, or null if cancelled - */ - protected Map> promptLauncherArgs(TargetLauncher launcher, - LaunchConfigurator configurator) { - TargetParameterMap params = launcher.getParameters(); - DebuggerMethodInvocationDialog dialog = - new DebuggerMethodInvocationDialog(tool, getButtonTitle(), "Launch", getIcon()); - - // NB. Do not invoke read/writeConfigState - - Map> defaultArgs = generateDefaultLauncherArgs(params); - Map> lastArgs = configurator.configureLauncher(launcher, - loadLastLauncherArgs(launcher, true), RelPrompt.BEFORE); - Map> args = dialog.promptArguments(params, lastArgs, defaultArgs); - saveLauncherArgs(args, params); - return args; - } - - /** - * Load the arguments last used for this offer, or give the defaults - * - *

- * If there are no saved "last used" arguments, then this will return the defaults. If there are - * saved arguments, but they cannot be loaded, then this will behave differently depending on - * whether the user will be confirming the arguments. If there will be no prompt/confirmation, - * then this method must throw an exception in order to avoid launching with defaults, when the - * user may be expecting a customized launch. If there will be a prompt, then this may safely - * return the defaults, since the user will be given a chance to correct them. - * - * @param params the parameters of the model's launcher - * @param forPrompt true if the user will be confirming the arguments - * @return the loaded arguments, or defaults - */ - protected Map> loadLastLauncherArgs(TargetLauncher launcher, - boolean forPrompt) { - /** - * TODO: Supposedly, per-program, per-user config stuff is being generalized for analyzers. - * Re-examine this if/when that gets merged - */ - if (program != null) { - TargetParameterMap params = launcher.getParameters(); - ProgramUserData userData = program.getProgramUserData(); - String property = - userData.getStringProperty(TargetCmdLineLauncher.CMDLINE_ARGS_NAME, null); - if (property != null) { - try { - Element element = XmlUtilities.fromString(property); - SaveState state = new SaveState(element); - List names = List.of(state.getNames()); - Map> args = new LinkedHashMap<>(); - for (ParameterDescription param : params.values()) { - if (names.contains(param.name)) { - Object configState = - ConfigStateField.getState(state, param.type, param.name); - if (configState != null) { - args.put(param.name, ValStr.from(configState)); - } - } - } - if (!args.isEmpty()) { - return args; - } - } - catch (JDOMException | IOException e) { - if (!forPrompt) { - throw new RuntimeException( - "Saved launcher args are corrupt, or launcher parameters changed. Not launching.", - e); - } - Msg.error(this, - "Saved launcher args are corrupt, or launcher parameters changed. Defaulting.", - e); - } - } - Map> args = generateDefaultLauncherArgs(params); - saveLauncherArgs(args, params); - return args; - } - - return new LinkedHashMap<>(); - } - - /** - * Obtain the launcher args - * - *

- * This should either call {@link #promptLauncherArgs(TargetLauncher,LaunchConfigurator)} or - * {@link #loadLastLauncherArgs(TargetLauncher, boolean)}. Note if choosing the latter, the user - * will not be prompted to confirm. - * - * @param launcher the model's launcher - * @param prompt true to prompt the user, false to use saved arguments - * @param configurator a means of configuring the launcher - * @return the chosen arguments, or null if the user cancels at the prompt - */ - public Map> getLauncherArgs(TargetLauncher launcher, boolean prompt, - LaunchConfigurator configurator) { - return prompt - ? configurator.configureLauncher(launcher, - promptLauncherArgs(launcher, configurator), RelPrompt.AFTER) - : configurator.configureLauncher(launcher, loadLastLauncherArgs(launcher, false), - RelPrompt.NONE); - } - - public Map> getLauncherArgs(TargetLauncher launcher, boolean prompt) { - return getLauncherArgs(launcher, prompt, LaunchConfigurator.NOP); - } - - /** - * Get the model factory, as last configured by the user, for this launcher - * - * @return the factory - */ - protected DebuggerModelFactory getModelFactory() { - return factory; - } - - /** - * TODO: This could be more surgical, and perhaps ought to be part of - * {@link DebugModelConventions}. - */ - static class ValueExpecter extends CompletableFuture implements DebuggerModelListener { - private final DebuggerObjectModel model; - private final List path; - - public ValueExpecter(DebuggerObjectModel model, List path) { - this.model = model; - this.path = path; - model.addModelListener(this); - retryFetch(); - } - - protected void retryFetch() { - model.fetchModelValue(path).thenAccept(v -> { - if (v != null) { - model.removeModelListener(this); - complete(v); - } - }).exceptionally(ex -> { - model.removeModelListener(this); - completeExceptionally(ex); - return null; - }); - } - - @Override - public void rootAdded(TargetObject root) { - retryFetch(); - } - - @Override - public void attributesChanged(TargetObject object, Collection removed, - Map added) { - retryFetch(); - } - - @Override - public void elementsChanged(TargetObject object, Collection removed, - Map added) { - retryFetch(); - } - } - - protected CompletableFuture connect(DebuggerModelService service, - boolean prompt, LaunchConfigurator configurator) { - DebuggerModelFactory factory = getModelFactory(); - configurator.configureConnector(factory); - if (prompt) { - return service.showConnectDialog(factory); - } - return factory.build().thenApplyAsync(m -> { - service.addModel(m); - return m; - }, SwingExecutorService.LATER); - } - - protected CompletableFuture findLauncher(DebuggerObjectModel m) { - List launcherPath = getLauncherPath(); - TargetObjectSchema schema = m.getRootSchema().getSuccessorSchema(launcherPath); - if (!schema.getInterfaces().contains(TargetLauncher.class)) { - throw new AssertionError("LaunchOffer / model implementation error: " + - "The given launcher path is not a TargetLauncher, according to its schema"); - } - return new ValueExpecter(m, launcherPath).thenApply(o -> (TargetLauncher) o); - } - - // Eww. - protected CompletableFuture launch(TargetLauncher launcher, - boolean prompt, LaunchConfigurator configurator, TaskMonitor monitor) { - Map> args = getLauncherArgs(launcher, prompt, configurator); - if (args == null) { - throw new CancellationException(); - } - Map a = ValStr.toPlainMap(args); - return AsyncTimer.DEFAULT_TIMER.mark() - .timeOut( - launcher.launch(a), getTimeoutMillis(), () -> onTimedOutLaunch(monitor)); - } - - protected void checkCancelled(TaskMonitor monitor) { - if (monitor.isCancelled()) { - throw new CancellationException("User cancelled"); - } - } - - protected TargetLauncher onTimedOutFindLauncher(TaskMonitor monitor) { - checkCancelled(monitor); - monitor.setMessage("Timed out finding the launcher. Aborting."); - JOptionPane.showMessageDialog(null, HTML + "Timed out finding the launcher. " + - "This indicates an error in the implementation of the connector and/or the launcher " + - "opinion. Try again, and/or report the bug.", - getMenuParentTitle(), JOptionPane.ERROR_MESSAGE); - throw new CancellationException("Timed out"); - } - - protected Void onTimedOutLaunch(TaskMonitor monitor) { - checkCancelled(monitor); - monitor.setMessage("Timed out waiting for launch. Aborting."); - JOptionPane.showMessageDialog(null, HTML + - "Timed out waiting for launch. " + NO_PAUSE_DIAGNOSTIC_MESSAGE, - getMenuParentTitle(), JOptionPane.ERROR_MESSAGE); - throw new CancellationException("Timed out"); - } - - protected TargetObject onTimedOutTarget(TaskMonitor monitor) { - checkCancelled(monitor); - monitor.setMessage("Timed out waiting for target. Aborting."); - JOptionPane.showMessageDialog(null, HTML + - "Timed out waiting for target. " + NO_PAUSE_DIAGNOSTIC_MESSAGE, - getMenuParentTitle(), JOptionPane.ERROR_MESSAGE); - throw new CancellationException("Timed out"); - } - - protected CompletableFuture waitRecorder(DebuggerModelService service, - TargetObject target) { - CompletableFuture futureRecorder = listenForRecorder(service, target); - TraceRecorder recorder = service.getRecorder(target); - if (recorder != null) { - futureRecorder.cancel(true); - return CompletableFuture.completedFuture(recorder); - } - return futureRecorder; - } - - protected TraceRecorder onTimedOutRecorder(TaskMonitor monitor, DebuggerModelService service, - TargetObject target) { - checkCancelled(monitor); - monitor.setMessage("Timed out waiting for recording. Invoking the recorder."); - TraceRecorder recorder = service.recordTargetPromptOffers(target); - if (recorder == null) { - throw new CancellationException("User cancelled at record dialog"); - } - DebuggerTraceManagerService traceManager = - tool.getService(DebuggerTraceManagerService.class); - if (traceManager != null) { - Trace trace = recorder.getTrace(); - Swing.runLater(() -> { - traceManager.openTrace(trace); - traceManager.activate(traceManager.resolveTrace(trace), - ActivationCause.START_RECORDING); - }); - } - return recorder; - } - - protected Void onTimedOutMapping(TaskMonitor monitor, - DebuggerStaticMappingService mappingService, TraceRecorder recorder) { - checkCancelled(monitor); - monitor.setMessage("Timed out waiting for module map. Invoking the mapper."); - Collection mapped; - try { - mapped = invokeMapper(monitor, mappingService, recorder); - } - catch (CancelledException e) { - throw new CancellationException(e.getMessage()); - } - if (mapped.isEmpty()) { - monitor.setMessage( - "Could not formulate a mapping with the target program. " + - "Continuing without one."); - Msg.showWarn(this, null, "Launch " + program, - "The resulting target process has no mapping to the static image " + - program + ". Intervention is required before static and dynamic " + - "addresses can be translated. Check the target's module list."); - } - return null; - } - - @Override - public CompletableFuture launchProgram(TaskMonitor monitor, PromptMode mode, - LaunchConfigurator configurator) { - DebuggerModelService service = tool.getService(DebuggerModelService.class); - DebuggerStaticMappingService mappingService = - tool.getService(DebuggerStaticMappingService.class); - monitor.initialize(6); - monitor.setMessage("Connecting"); - var locals = new Object() { - DebuggerObjectModel model; - CompletableFuture futureTarget; - TargetObject target; - TraceRecorder recorder; - Throwable exception; - boolean prompt = mode == PromptMode.ALWAYS; - - LaunchResult getResult() { - return new LaunchResult(model, target, recorder, exception); - } - }; - return connect(service, locals.prompt, configurator).thenCompose(m -> { - checkCancelled(monitor); - locals.model = m; - monitor.incrementProgress(1); - monitor.setMessage("Finding Launcher"); - return AsyncTimer.DEFAULT_TIMER.mark() - .timeOut(findLauncher(m), getTimeoutMillis(), - () -> onTimedOutFindLauncher(monitor)); - }).thenCompose(l -> { - checkCancelled(monitor); - monitor.incrementProgress(1); - monitor.setMessage("Launching"); - locals.futureTarget = listenForTarget(l.getModel()); - return loop(TypeSpec.VOID, (loop) -> { - launch(l, locals.prompt, configurator, monitor).thenAccept(loop::exit) - .exceptionally(ex -> { - loop.repeat(); - return null; - }); - locals.prompt = mode != PromptMode.NEVER; - }); - }).thenCompose(__ -> { - checkCancelled(monitor); - monitor.incrementProgress(1); - monitor.setMessage("Waiting for target"); - return AsyncTimer.DEFAULT_TIMER.mark() - .timeOut(locals.futureTarget, getTimeoutMillis(), - () -> onTimedOutTarget(monitor)); - }).thenCompose(t -> { - checkCancelled(monitor); - locals.target = t; - monitor.incrementProgress(1); - monitor.setMessage("Waiting for recorder"); - return AsyncTimer.DEFAULT_TIMER.mark() - .timeOut(waitRecorder(service, t), getTimeoutMillis(), - () -> onTimedOutRecorder(monitor, service, t)); - }).thenCompose(r -> { - checkCancelled(monitor); - locals.recorder = r; - monitor.incrementProgress(1); - if (r == null) { - throw new CancellationException(); - } - monitor.setMessage("Confirming program is mapped to target"); - return AsyncTimer.DEFAULT_TIMER.mark() - .timeOut(listenForMapping(mappingService, r), getTimeoutMillis(), - () -> onTimedOutMapping(monitor, mappingService, r)); - }).exceptionally(ex -> { - locals.exception = AsyncUtils.unwrapThrowable(ex); - return null; - }).thenApply(__ -> { - if (locals.exception != null) { - monitor.setMessage("Launch error: " + locals.exception); - Msg.error(this, "Launch error", locals.exception); - return locals.getResult(); - } - monitor.setMessage("Launch successful"); - monitor.incrementProgress(1); - return locals.getResult(); - }); - } - -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/launch/AbstractDebuggerProgramLaunchOpinion.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/launch/AbstractDebuggerProgramLaunchOpinion.java deleted file mode 100644 index 620346df67..0000000000 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/launch/AbstractDebuggerProgramLaunchOpinion.java +++ /dev/null @@ -1,87 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.service.model.launch; - -import java.lang.annotation.*; -import java.lang.invoke.*; -import java.lang.invoke.MethodHandles.Lookup; -import java.util.*; - -import ghidra.app.services.DebuggerModelService; -import ghidra.dbg.DebuggerModelFactory; -import ghidra.debug.api.model.DebuggerProgramLaunchOffer; -import ghidra.framework.plugintool.PluginTool; -import ghidra.program.model.listing.Program; -import ghidra.util.Msg; - -public abstract class AbstractDebuggerProgramLaunchOpinion implements DebuggerProgramLaunchOpinion { - protected static final Lookup LOOKUP = MethodHandles.lookup(); - protected static final MethodType CON_SIG = MethodType.methodType(void.class, Program.class, - PluginTool.class, DebuggerModelFactory.class); - - @Target(ElementType.TYPE) - @Retention(RetentionPolicy.RUNTIME) - protected @interface FactoryClass { - String value(); - } - - protected static DebuggerModelFactory getFactory( - Class offerClass, DebuggerModelService service) { - FactoryClass annotation = offerClass.getAnnotation(FactoryClass.class); - if (annotation == null) { - Msg.error(AbstractDebuggerProgramLaunchOpinion.class, - "Missing @" + FactoryClass.class.getSimpleName() + " annotation on " + offerClass); - return null; - } - Optional found = service.getModelFactories() - .stream() - .filter(f -> f.getClass().getName().equals(annotation.value())) - .findAny(); - if (found.isEmpty()) { - Msg.error(AbstractDebuggerProgramLaunchOpinion.class, - "No factory with name " + annotation.value() + " required by " + offerClass); - return null; - } - return found.get(); - } - - protected abstract Collection> getOfferClasses(); - - @Override - public Collection getOffers(Program program, PluginTool tool, - DebuggerModelService service) { - String exe = program.getExecutablePath(); - if (exe == null || exe.isBlank()) { - return List.of(); - } - List offers = new ArrayList<>(); - for (Class cls : getOfferClasses()) { - DebuggerModelFactory factory = getFactory(cls, service); - if (factory == null || !factory.isCompatible(program)) { - continue; - } - try { - MethodHandle constructor = LOOKUP.findConstructor(cls, CON_SIG); - offers.add((DebuggerProgramLaunchOffer) constructor.invoke(program, tool, factory)); - } - catch (Throwable e) { - throw new AssertionError(e); - } - } - return offers; - } - -} diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/launch/DebuggerProgramLaunchOpinion.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/launch/DebuggerProgramLaunchOpinion.java index 7797551e22..2602a5d3f1 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/launch/DebuggerProgramLaunchOpinion.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/launch/DebuggerProgramLaunchOpinion.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -23,6 +23,7 @@ import ghidra.framework.plugintool.PluginTool; import ghidra.program.model.listing.Program; import ghidra.util.classfinder.ExtensionPoint; +@Deprecated(forRemoval = true, since = "11.3") public interface DebuggerProgramLaunchOpinion extends ExtensionPoint { Collection getOffers(Program program, PluginTool tool, DebuggerModelService service); diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/record/DataTypeRecorder.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/record/DataTypeRecorder.java index cab36653ce..3394ffaeac 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/record/DataTypeRecorder.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/record/DataTypeRecorder.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -29,6 +29,7 @@ import ghidra.program.model.data.*; import ghidra.trace.model.Trace; import ghidra.util.task.TaskMonitor; +@Deprecated(forRemoval = true, since = "11.3") public class DataTypeRecorder { //private TraceRecorder recorder; diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/record/EmptyDebuggerRegisterMapper.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/record/EmptyDebuggerRegisterMapper.java index f3aebc3ebf..09160755a3 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/record/EmptyDebuggerRegisterMapper.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/record/EmptyDebuggerRegisterMapper.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -21,6 +21,7 @@ import ghidra.dbg.target.TargetRegister; import ghidra.debug.api.model.DebuggerRegisterMapper; import ghidra.program.model.lang.Register; +@Deprecated(forRemoval = true, since = "11.3") public class EmptyDebuggerRegisterMapper implements DebuggerRegisterMapper { @Override public TargetRegister getTargetRegister(String name) { diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/record/MemoryRecorder.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/record/MemoryRecorder.java index 94064fc390..2d9c30c50d 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/record/MemoryRecorder.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/record/MemoryRecorder.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -28,6 +28,7 @@ import ghidra.trace.model.memory.*; import ghidra.util.Msg; import utilities.util.IDKeyed; +@Deprecated(forRemoval = true, since = "11.3") class MemoryRecorder { protected final ObjectBasedTraceRecorder recorder; protected final TraceMemoryManager memoryManager; diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/record/ObjectBasedTraceRecorder.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/record/ObjectBasedTraceRecorder.java index 4562789ada..4171a6f4ac 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/record/ObjectBasedTraceRecorder.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/record/ObjectBasedTraceRecorder.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -60,6 +60,7 @@ import ghidra.util.Msg; import ghidra.util.datastruct.ListenerSet; import ghidra.util.task.TaskMonitor; +@Deprecated(forRemoval = true, since = "11.3") public class ObjectBasedTraceRecorder implements TraceRecorder { protected static final int POOL_SIZE = Math.min(16, Runtime.getRuntime().availableProcessors()); protected static final int DELAY_MS = 100; diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/record/ObjectRecorder.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/record/ObjectRecorder.java index bf444c18cb..00557fdcff 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/record/ObjectRecorder.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/record/ObjectRecorder.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -48,6 +48,7 @@ import ghidra.trace.model.thread.TraceThread; import ghidra.util.Msg; import utilities.util.IDKeyed; +@Deprecated(forRemoval = true, since = "11.3") class ObjectRecorder { protected final ObjectBasedTraceRecorder recorder; protected final TraceObjectManager objectManager; diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/record/RecorderUtils.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/record/RecorderUtils.java index ec365c3afd..e9052ffcd6 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/record/RecorderUtils.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/record/RecorderUtils.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -24,6 +24,7 @@ import ghidra.program.model.address.*; import ghidra.util.Msg; import ghidra.util.task.TaskMonitor; +@Deprecated(forRemoval = true, since = "11.3") public enum RecorderUtils { INSTANCE; diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/record/SymbolRecorder.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/record/SymbolRecorder.java index 8dd2240270..aecd4abdc3 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/record/SymbolRecorder.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/record/SymbolRecorder.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -32,6 +32,7 @@ import ghidra.util.exception.DuplicateNameException; import ghidra.util.exception.InvalidInputException; import ghidra.util.task.TaskMonitor; +@Deprecated(forRemoval = true, since = "11.3") public class SymbolRecorder { private final TraceRecorder recorder; diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/record/TimeRecorder.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/record/TimeRecorder.java index be754a33bc..5f276e0efc 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/record/TimeRecorder.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/model/record/TimeRecorder.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -19,6 +19,7 @@ import ghidra.app.plugin.core.debug.service.model.RecorderPermanentTransaction; import ghidra.trace.model.thread.TraceThread; import ghidra.trace.model.time.TraceSnapshot; +@Deprecated(forRemoval = true, since = "11.3") class TimeRecorder { protected final ObjectBasedTraceRecorder recorder; diff --git a/Ghidra/Debug/Debugger/src/screen/java/ghidra/app/plugin/core/debug/gui/objects/DebuggerObjectsPluginScreenShots.java b/Ghidra/Debug/Debugger/src/screen/java/ghidra/app/plugin/core/debug/gui/objects/DebuggerObjectsPluginScreenShots.java deleted file mode 100644 index 034c914f03..0000000000 --- a/Ghidra/Debug/Debugger/src/screen/java/ghidra/app/plugin/core/debug/gui/objects/DebuggerObjectsPluginScreenShots.java +++ /dev/null @@ -1,252 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.objects; - -import static ghidra.lifecycle.Unfinished.TODO; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import org.junit.Before; -import org.junit.Test; - -import ghidra.app.plugin.core.debug.gui.objects.components.*; -import ghidra.app.plugin.core.debug.service.model.DebuggerModelServiceProxyPlugin; -import ghidra.dbg.model.*; -import ghidra.dbg.target.*; -import ghidra.dbg.testutil.DebuggerModelTestUtils; -import ghidra.util.Swing; -import help.screenshot.GhidraScreenShotGenerator; - -public class DebuggerObjectsPluginScreenShots extends GhidraScreenShotGenerator - implements DebuggerModelTestUtils { - - TestDebuggerModelBuilder mb = new TestDebuggerModelBuilder(); - DebuggerModelServiceProxyPlugin modelService; - DebuggerObjectsPlugin objectsPlugin; - DebuggerObjectsProvider objectsProvider; - - @Before - public void setUpMine() throws Exception { - modelService = addPlugin(tool, DebuggerModelServiceProxyPlugin.class); - objectsPlugin = addPlugin(tool, DebuggerObjectsPlugin.class); - objectsProvider = waitForComponentProvider(DebuggerObjectsProvider.class); - } - - // A cheap way to control what buttons are enabled - static class ActionyTestTargetObject - extends DefaultTestTargetObject - implements TargetInterpreter, TargetResumable, TargetSteppable, TargetLauncher, - TargetAttacher, TargetAttachable, TargetThread, TargetExecutionStateful { - - public ActionyTestTargetObject(TestTargetObject parent, String name, String typeHint) { - super(parent, name, typeHint); - setAttributes(Map.of( - TargetExecutionStateful.STATE_ATTRIBUTE_NAME, TargetExecutionState.STOPPED), - "Init"); - } - - @Override - public CompletableFuture launch(Map args) { - return TODO(); - } - - @Override - public CompletableFuture attach(TargetAttachable attachable) { - return TODO(); - } - - @Override - public CompletableFuture attach(long id) { - return TODO(); - } - - @Override - public CompletableFuture step(TargetStepKind kind) { - return TODO(); - } - - @Override - public CompletableFuture resume() { - return TODO(); - } - - @Override - public CompletableFuture execute(String cmd) { - return TODO(); - } - - @Override - public CompletableFuture executeCapture(String cmd) { - return TODO(); - } - } - - /** - * NOTE: The icon selection looks like it relies on "duck typing", which is probably not the - * Right Way. I would have expected it to consume the type hint. Eh. Anyway, let's take a - * screenshot, shall we? - * - *

- * Depending on the text in the help, we could probably do something more generic, or maybe even - * just use the test model as is. Don't know how much illustration is needed in the screenshot. - */ - @Test - public void testCaptureDebuggerObjectsPlugin() throws Throwable { - mb.createTestModel("Debugger"); - - DefaultTestTargetObject available = - new DefaultTestTargetObject<>(mb.testModel.session, "Available", ""); - DefaultTestTargetObject sessions = - new DefaultTestTargetObject<>(mb.testModel.session, "Sessions", ""); - - DefaultTestTargetObject session0 = - new DefaultTestTargetObject<>(sessions, "[0x0]", ""); - - DefaultTestTargetObject sAttributes = - new DefaultTestTargetObject<>(session0, "Attributes", ""); - DefaultTestTargetObject sDevices = - new DefaultTestTargetObject<>(session0, "Devices", ""); - DefaultTestTargetObject sProcesses = - new DefaultTestTargetObject<>(session0, "Processes", ""); - - DefaultTestTargetObject process1a12 = - new DefaultTestTargetObject<>(sProcesses, "[0x1a12]", ""); - - DefaultTestTargetObject pDebug = - new DefaultTestTargetObject<>(process1a12, "Debug", ""); - DefaultTestTargetObject pDevices = - new DefaultTestTargetObject<>(process1a12, "Devices", ""); - DefaultTestTargetObject pEnvironment = - new DefaultTestTargetObject<>(process1a12, "Environment", ""); - DefaultTestTargetObject pIo = new DefaultTestTargetObject<>(process1a12, "Io", ""); - DefaultTestTargetObject pMemory = - new DefaultTestTargetObject<>(process1a12, "Memory", ""); - DefaultTestTargetObject pModules = - new DefaultTestTargetObject<>(process1a12, "Modules", ""); - DefaultTestTargetObject pThreads = - new DefaultTestTargetObject<>(process1a12, "Threads", ""); - - DefaultTestTargetObject thread1a34 = - new ActionyTestTargetObject(pThreads, "[0x1a34]", ""); - - mb.testModel.session.setAttributes(List.of(), - Map.of(TargetEventScope.EVENT_OBJECT_ATTRIBUTE_NAME, thread1a34, // Get arrow icon on thread - TargetObject.DISPLAY_ATTRIBUTE_NAME, "Debugger"), - "TestOverride"); - - DefaultTestTargetObject tEnvironment = - new DefaultTestTargetObject<>(thread1a34, "Environment", ""); - - DefaultTestTargetObject teEnvBlock = - new DefaultTestTargetObject<>(tEnvironment, "EnvironmentBlock", ""); - - DefaultTestTargetObject activationContextStackPointer = - new DefaultTestTargetObject<>(teEnvBlock, "ActivationContextStackPointer", ""); - activationContextStackPointer - .setAttributes(List.of(), - Map.of(TargetObject.DISPLAY_ATTRIBUTE_NAME, - "ActivationContextStackPointer : 789abc", "_modified", true), - "Initialized"); - DefaultTestTargetObject activeFrame = - new DefaultTestTargetObject<>(teEnvBlock, "ActiveFrame", ""); - activeFrame.setAttributes(List.of(), - Map.of(TargetObject.DISPLAY_ATTRIBUTE_NAME, "ActiveFrame : 0", "_modified", true), - "Initialized"); - DefaultTestTargetObject bogusFocus = - new DefaultTestTargetObject<>(teEnvBlock, "BOGUS FOCUS", ""); - teEnvBlock.setAttributes(List.of(activationContextStackPointer, activeFrame, bogusFocus), - Map.of("_kind", "OBJECT_TARGET_OBJECT"), // Makes it magenta - "Initialized"); - - tEnvironment.setAttributes(List.of(teEnvBlock), Map.of(), "Initialized"); - - thread1a34.setAttributes(List.of(tEnvironment), - Map.of(TargetObject.DISPLAY_ATTRIBUTE_NAME, "0x1a34"), "Initialized"); - - pThreads.setElements(List.of(thread1a34), Map.of(), "Initialized"); - - process1a12.setAttributes( - List.of(pDebug, pDevices, pEnvironment, pIo, pMemory, pModules, pThreads), - Map.of(TargetObject.DISPLAY_ATTRIBUTE_NAME, "0x1a12", "Handle", "321", "Id", "1a12", - "Name", "winmine.exe"), - "Initialized"); - - sProcesses.setElements(List.of(process1a12), Map.of(), "Initialized"); - - session0.setAttributes(List.of(sAttributes, sDevices, sProcesses), - Map.of(TargetObject.DISPLAY_ATTRIBUTE_NAME, "0x0", "Id", 0), "Initialized"); - - sessions.setElements(List.of(session0), Map.of(), "Initialized"); - - mb.testModel.session.changeAttributes(List.of(), List.of(available, sessions), Map.of(), - "Initialized"); - - Swing.runNow(() -> { - modelService.addModel(mb.testModel); - modelService.activateModel(mb.testModel); - }); - waitForSwing(); - - mb.testModel.session.requestFocus(bogusFocus); - waitForSwing(); - mb.testModel.session.requestFocus(mb.testModel.session); - waitForSwing(); - teEnvBlock.changeAttributes(List.of("BOGUS FOCUS"), List.of(), Map.of(), "Clean"); - waitForSwing(); - mb.testModel.session.requestFocus(thread1a34); - waitForSwing(); - - captureIsolatedProvider(objectsProvider, 600, 600); - } - - @Test - public void testCaptureDebuggerMethodInvocationDialog_ForLaunch() throws Throwable { - mb.createTestModel(); - mb.createTestProcessesAndThreads(); - - modelService.addModel(mb.testModel); - modelService.activateModel(mb.testModel); - waitForSwing(); - - waitOn(mb.testModel.session.requestFocus(mb.testModel.session.mimickJavaLauncher)); - waitForSwing(); - - performAction(objectsProvider.actionLaunch, false); - DebuggerMethodInvocationDialog dialog = - waitForDialogComponent(DebuggerMethodInvocationDialog.class); - captureDialog(dialog); - } - - @Test - public void testCaptureDebuggerBreakpointDialog() throws Throwable { - mb.createTestModel(); - mb.createTestProcessesAndThreads(); - - modelService.addModel(mb.testModel); - modelService.activateModel(mb.testModel); - waitForSwing(); - - waitOn(mb.testModel.session.requestFocus(mb.testProcess1.breaks)); - waitForSwing(); - - performAction(objectsProvider.actionAddBreakpoint, false); - DebuggerBreakpointDialog dialog = waitForDialogComponent(DebuggerBreakpointDialog.class); - DebuggerObjectsAccessHelper.setDebuggerBreakpointDialogExpression(dialog, "get_env"); - captureDialog(dialog); - } -} diff --git a/Ghidra/Debug/Debugger/src/screen/java/ghidra/app/plugin/core/debug/gui/objects/components/DebuggerObjectsAccessHelper.java b/Ghidra/Debug/Debugger/src/screen/java/ghidra/app/plugin/core/debug/gui/objects/components/DebuggerObjectsAccessHelper.java deleted file mode 100644 index b331ea2823..0000000000 --- a/Ghidra/Debug/Debugger/src/screen/java/ghidra/app/plugin/core/debug/gui/objects/components/DebuggerObjectsAccessHelper.java +++ /dev/null @@ -1,23 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.objects.components; - -public class DebuggerObjectsAccessHelper { - public static void setDebuggerBreakpointDialogExpression(DebuggerBreakpointDialog dialog, - String expression) { - dialog.expressionField.setText(expression); - } -} diff --git a/Ghidra/Debug/Debugger/src/screen/java/ghidra/app/plugin/core/debug/gui/target/DebuggerTargetsPluginScreenShots.java b/Ghidra/Debug/Debugger/src/screen/java/ghidra/app/plugin/core/debug/gui/target/DebuggerTargetsPluginScreenShots.java deleted file mode 100644 index 1cdefee288..0000000000 --- a/Ghidra/Debug/Debugger/src/screen/java/ghidra/app/plugin/core/debug/gui/target/DebuggerTargetsPluginScreenShots.java +++ /dev/null @@ -1,113 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.target; - -import java.util.List; -import java.util.concurrent.CompletableFuture; - -import org.junit.Before; -import org.junit.Test; - -import ghidra.app.plugin.core.debug.service.model.*; -import ghidra.dbg.DebuggerModelFactory; -import ghidra.dbg.DebuggerObjectModel; -import ghidra.dbg.agent.AbstractDebuggerObjectModel; -import ghidra.dbg.agent.DefaultTargetModelRoot; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.util.ConfigurableFactory.FactoryDescription; -import ghidra.program.model.address.AddressFactory; -import help.screenshot.GhidraScreenShotGenerator; - -public class DebuggerTargetsPluginScreenShots extends GhidraScreenShotGenerator { - - @FactoryDescription( - brief = "Demo Debugger", - htmlDetails = "A connection for demonstration purposes") - protected static class ScreenShotDebuggerModelFactory implements DebuggerModelFactory { - - private void nop() { - } - - @FactoryOption("Remote") - public final Property remoteOption = Property.fromAccessors(Boolean.class, - () -> true, v -> nop()); - @FactoryOption("Host") - public final Property hostOption = Property.fromAccessors(String.class, - () -> "localhost", v -> nop()); - @FactoryOption("Port") - public final Property portOption = Property.fromAccessors(Integer.class, - () -> 12345, v -> nop()); - - @Override - public CompletableFuture build() { - throw new AssertionError(); - } - } - - protected static class ScreenShotDebuggerObjectModel extends AbstractDebuggerObjectModel { - final DefaultTargetModelRoot root = new DefaultTargetModelRoot(this, "Session"); - final String display; - - public ScreenShotDebuggerObjectModel(String display) { - this.display = display; - addModelRoot(root); - } - - @Override - public String getBrief() { - return display; - } - - @Override - public CompletableFuture fetchModelRoot() { - return CompletableFuture.completedFuture(root); - } - - @Override - public AddressFactory getAddressFactory() { - throw new AssertionError(); - } - } - - DebuggerModelServiceInternal modelService; - DebuggerTargetsPlugin targetsPlugin; - DebuggerTargetsProvider targetsProvider; - - @Before - public void setUpMine() throws Throwable { - modelService = addPlugin(tool, DebuggerModelServiceProxyPlugin.class); - targetsPlugin = addPlugin(tool, DebuggerTargetsPlugin.class); - targetsProvider = waitForComponentProvider(DebuggerTargetsProvider.class); - } - - @Test - public void testCaptureDebuggerTargetsPlugin() throws Throwable { - modelService.addModel( - new ScreenShotDebuggerObjectModel("DEMO@1234abcd localhost:12345")); - modelService.addModel( - new ScreenShotDebuggerObjectModel("DEMO@4321fedc debug-demo:12345")); - - captureIsolatedProvider(targetsProvider, 400, 300); - } - - @Test - public void testCaptureDebuggerConnectDialog() throws Throwable { - modelService.setModelFactories(List.of(new ScreenShotDebuggerModelFactory())); - performAction(targetsProvider.actionConnect, false); - - captureDialog(DebuggerConnectDialog.class); - } -} diff --git a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/AbstractGhidraHeadedDebuggerTest.java b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/AbstractGhidraHeadedDebuggerTest.java index 1644727887..dc22e81743 100644 --- a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/AbstractGhidraHeadedDebuggerTest.java +++ b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/AbstractGhidraHeadedDebuggerTest.java @@ -56,12 +56,12 @@ import ghidra.app.plugin.core.debug.service.target.DebuggerTargetServicePlugin; import ghidra.app.plugin.core.debug.service.tracemgr.DebuggerTraceManagerServicePlugin; import ghidra.app.services.*; import ghidra.app.util.viewer.listingpanel.ListingPanel; +import ghidra.async.AsyncTestUtils; import ghidra.dbg.model.AbstractTestTargetRegisterBank; import ghidra.dbg.model.TestDebuggerModelBuilder; import ghidra.dbg.target.*; import ghidra.dbg.target.schema.SchemaContext; import ghidra.dbg.target.schema.XmlSchemaContext; -import ghidra.dbg.testutil.DebuggerModelTestUtils; import ghidra.debug.api.action.*; import ghidra.debug.api.model.*; import ghidra.docking.settings.SettingsImpl; @@ -82,12 +82,13 @@ import ghidra.trace.model.thread.TraceThread; import ghidra.trace.util.TraceAddressSpace; import ghidra.trace.util.TraceEvents; import ghidra.util.InvalidNameException; +import ghidra.util.NumericUtilities; import ghidra.util.datastruct.TestDataStructureErrorHandlerInstaller; import ghidra.util.exception.CancelledException; import ghidra.util.task.ConsoleTaskMonitor; public abstract class AbstractGhidraHeadedDebuggerTest - extends AbstractGhidraHeadedIntegrationTest implements DebuggerModelTestUtils { + extends AbstractGhidraHeadedIntegrationTest implements AsyncTestUtils { public static final String LANGID_TOYBE64 = "Toy:BE:64:default"; @@ -108,6 +109,10 @@ public abstract class AbstractGhidraHeadedDebuggerTest } } + protected static byte[] arr(String hex) { + return NumericUtilities.convertStringToBytes(hex); + } + protected static SchemaContext xmlSchema(String xml) { try { return XmlSchemaContext.deserialize(xml); @@ -401,8 +406,7 @@ public abstract class AbstractGhidraHeadedDebuggerTest } /** - * Only use this to escape from pop-up menus. Otherwise, use - * {@link #triggerEscape(Component)}. + * Only use this to escape from pop-up menus. Otherwise, use {@link #triggerEscape(Component)}. * * @throws AWTException */ diff --git a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/DebuggerManualTest.java b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/DebuggerManualTest.java index 0ba4d9ace1..8b66762767 100644 --- a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/DebuggerManualTest.java +++ b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/DebuggerManualTest.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -30,7 +30,6 @@ import ghidra.app.plugin.core.debug.gui.breakpoint.DebuggerBreakpointsPlugin; import ghidra.app.plugin.core.debug.gui.listing.DebuggerListingPlugin; import ghidra.app.plugin.core.debug.gui.modules.DebuggerModulesPlugin; import ghidra.app.plugin.core.debug.gui.register.DebuggerRegistersPlugin; -import ghidra.app.plugin.core.debug.gui.target.DebuggerTargetsPlugin; import ghidra.app.plugin.core.debug.gui.thread.DebuggerThreadsPlugin; import ghidra.app.plugin.core.debug.gui.time.DebuggerTimePlugin; import ghidra.app.plugin.core.disassembler.DisassemblerPlugin; @@ -85,7 +84,6 @@ public class DebuggerManualTest extends AbstractGhidraHeadedDebuggerTest { addPlugin(tool, DebuggerModulesPlugin.class); addPlugin(tool, DebuggerRegistersPlugin.class); //addPlugin(tool, DebuggerRegsListingPlugin.class); - addPlugin(tool, DebuggerTargetsPlugin.class); addPlugin(tool, DebuggerThreadsPlugin.class); addPlugin(tool, DebuggerTimePlugin.class); diff --git a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/interpreters/DebuggerInterpreterPluginTest.java b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/interpreters/DebuggerInterpreterPluginTest.java deleted file mode 100644 index c423efd562..0000000000 --- a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/interpreters/DebuggerInterpreterPluginTest.java +++ /dev/null @@ -1,151 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.interpreters; - -import static org.junit.Assert.*; - -import java.awt.Robot; -import java.awt.event.KeyEvent; -import java.util.List; -import java.util.Map; - -import org.junit.Before; -import org.junit.Test; -import org.junit.experimental.categories.Category; - -import generic.test.category.NightlyCategory; -import ghidra.app.plugin.core.debug.gui.AbstractGhidraHeadedDebuggerTest; -import ghidra.app.plugin.core.interpreter.InterpreterComponentProvider; -import ghidra.dbg.model.TestTargetInterpreter.ExecuteCall; -import ghidra.dbg.target.TargetConsole.Channel; -import ghidra.debug.api.interpreter.DebuggerInterpreterConnection; - -@Category(NightlyCategory.class) -public class DebuggerInterpreterPluginTest extends AbstractGhidraHeadedDebuggerTest { - private DebuggerInterpreterPlugin interpreterPlugin; - - @Before - public void setUpInterpreterPluginTest() throws Exception { - interpreterPlugin = addPlugin(tool, DebuggerInterpreterPlugin.class); - } - - @Test - public void testShowConsole() throws Exception { - createTestModel(); - interpreterPlugin.showConsole(mb.testModel.session.interpreter); - InterpreterComponentProvider interpreter = - waitForComponentProvider(InterpreterComponentProvider.class); - - assertEquals("Test Debugger", interpreter.getSubTitle()); - assertTrue(interpreter.isVisible()); - } - - @Test - public void testInputExecutes() throws Exception { - createTestModel(); - interpreterPlugin.showConsole(mb.testModel.session.interpreter); - InterpreterComponentProvider interpreter = - waitForComponentProvider(InterpreterComponentProvider.class); - - interpreter.requestFocus(); - waitForSwing(); - - // Can't get at the component, so send keystrokes? - Robot robot = new Robot(); - ExecuteCall exe = waitForValue(() -> { - robot.keyPress(KeyEvent.VK_A); - robot.keyRelease(KeyEvent.VK_A); - robot.keyPress(KeyEvent.VK_ENTER); - robot.keyRelease(KeyEvent.VK_ENTER); - waitForSwing(); - return mb.testModel.session.interpreter.pollExecute(); - }); - assertEquals("a", exe.cmd); - exe.complete(null); // Not necessary, but cleaner - } - - @Test - public void testOutputDisplaysInConsole() throws Exception { - createTestModel(); - interpreterPlugin.showConsole(mb.testModel.session.interpreter); - InterpreterComponentProvider interpreter = - waitForComponentProvider(InterpreterComponentProvider.class); - - mb.testModel.session.interpreter.output(Channel.STDOUT, "Hello, World!"); - waitForSwing(); - - // I/O processing has a dedicated thread - waitForPass(() -> assertEquals("Hello, World!\n", interpreter.getOutputText())); - } - - @Test - public void testPromptChangeUpdatesPrompt() throws Exception { - createTestModel(); - interpreterPlugin.showConsole(mb.testModel.session.interpreter); - InterpreterComponentProvider interpreter = - waitForComponentProvider(InterpreterComponentProvider.class); - - mb.testModel.session.interpreter.setPrompt("DEBUG>>"); - waitForSwing(); - - assertEquals("DEBUG>>", interpreter.getPrompt()); - } - - @Test - public void testDisplayChangeUpdatesTitle() throws Throwable { - createTestModel(); - interpreterPlugin.showConsole(mb.testModel.session.interpreter); - InterpreterComponentProvider interpreter = - waitForComponentProvider(InterpreterComponentProvider.class); - - mb.testModel.session.interpreter.setDisplay("Test Debugger X.0"); - waitOn(mb.testModel.flushEvents()); - waitForSwing(); - - assertEquals("Test Debugger X.0", interpreter.getSubTitle()); - } - - @Test - public void testInvalidateInterpreterDestroysConsole() throws Exception { - createTestModel(); - interpreterPlugin.showConsole(mb.testModel.session.interpreter); - InterpreterComponentProvider interpreter = - waitForComponentProvider(InterpreterComponentProvider.class); - - mb.testModel.session.changeAttributes(List.of("Interpreter" // - ), Map.of(), "Invalidate interpreter"); - waitForSwing(); - - waitForPass(() -> assertFalse(interpreter.isVisible())); - assertFalse(interpreter.isInTool()); - } - - @Test - public void testInvalidatePinnedInterpreterDisablesConsole() throws Exception { - createTestModel(); - DebuggerInterpreterConnection conn = - interpreterPlugin.showConsole(mb.testModel.session.interpreter); - InterpreterComponentProvider interpreter = - waitForComponentProvider(InterpreterComponentProvider.class); - conn.setPinned(true); - - mb.testModel.session.changeAttributes(List.of("Interpreter" // - ), Map.of(), "Invalidate interpreter"); - waitForSwing(); - - waitForPass(() -> assertFalse(interpreter.isInputPermitted())); - } -} diff --git a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/objects/DebuggerObjectsProviderTest.java b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/objects/DebuggerObjectsProviderTest.java deleted file mode 100644 index 9477b21c4a..0000000000 --- a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/objects/DebuggerObjectsProviderTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.objects; - -import org.junit.Before; -import org.junit.Test; - -import db.Transaction; -import ghidra.app.plugin.core.debug.gui.AbstractGhidraHeadedDebuggerTest; -import ghidra.app.services.CodeViewerService; -import ghidra.app.services.DebuggerStaticMappingService; - -public class DebuggerObjectsProviderTest extends AbstractGhidraHeadedDebuggerTest { - protected DebuggerObjectsPlugin objectsPlugin; - protected DebuggerObjectsProvider objectsProvider; - - protected DebuggerStaticMappingService mappingService; - protected CodeViewerService codeViewer; - - @Before - public void setUpListingProviderTest() throws Exception { - objectsPlugin = addPlugin(tool, DebuggerObjectsPlugin.class); - objectsProvider = waitForComponentProvider(DebuggerObjectsProvider.class); - - mappingService = tool.getService(DebuggerStaticMappingService.class); - codeViewer = tool.getService(CodeViewerService.class); - } - - @Test - public void testBasic() throws Exception { - createAndOpenTrace(); - traceManager.activateTrace(tb.trace); - try (Transaction tx = tb.startTransaction()) { - //objectsProvider.importFromXMLAction.run(); - } - waitForDomainObject(tb.trace); - } -} diff --git a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/target/DebuggerTargetsProviderFriend.java b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/target/DebuggerTargetsProviderFriend.java deleted file mode 100644 index 9464ff51ea..0000000000 --- a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/target/DebuggerTargetsProviderFriend.java +++ /dev/null @@ -1,36 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.target; - -import javax.swing.tree.TreePath; - -import docking.test.AbstractDockingTest; -import docking.widgets.tree.GTreeNode; -import docking.widgets.tree.support.GTreeSelectionEvent.EventOrigin; -import generic.test.AbstractGTest; - -public interface DebuggerTargetsProviderFriend { - static void selectNodeForObject(DebuggerTargetsProvider provider, Object target) { - AbstractDockingTest.waitForTree(provider.tree); - GTreeNode node = provider.rootNode.findNodeForObject(target); - TreePath[] paths = new TreePath[] { node.getTreePath() }; - provider.tree.setSelectionPaths(paths, EventOrigin.USER_GENERATED); - AbstractGTest.waitForCondition(() -> { - TreePath path = provider.tree.getSelectionPath(); - return path != null && path.getLastPathComponent() == node; - }, "Selection in target tree timed out"); - } -} diff --git a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/target/DebuggerTargetsProviderTest.java b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/target/DebuggerTargetsProviderTest.java deleted file mode 100644 index 0f3685a13e..0000000000 --- a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/target/DebuggerTargetsProviderTest.java +++ /dev/null @@ -1,178 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.gui.target; - -import static ghidra.app.plugin.core.debug.gui.target.DebuggerTargetsProviderFriend.*; -import static org.junit.Assert.*; - -import java.awt.event.MouseEvent; -import java.util.List; -import java.util.Set; - -import org.junit.Before; -import org.junit.Test; -import org.junit.experimental.categories.Category; - -import docking.widgets.tree.GTreeNode; -import generic.test.category.NightlyCategory; -import ghidra.app.plugin.core.debug.gui.AbstractGhidraHeadedDebuggerTest; -import ghidra.app.plugin.core.debug.gui.DebuggerResources.*; -import ghidra.app.plugin.core.debug.service.model.DebuggerConnectDialog; -import ghidra.dbg.model.TestDebuggerObjectModel; - -/** - * Tests of the target provider - */ -@Category(NightlyCategory.class) // this may actually be an @PortSensitive test -public class DebuggerTargetsProviderTest extends AbstractGhidraHeadedDebuggerTest { - protected DebuggerTargetsPlugin targetsPlugin; - protected DebuggerTargetsProvider targetsProvider; - - @Before - public void setUpTargetsProviderTest() throws Exception { - targetsPlugin = addPlugin(tool, DebuggerTargetsPlugin.class); - targetsProvider = waitForComponentProvider(DebuggerTargetsProvider.class); - } - - @Test - public void testConnectActionShowDialog() { - modelServiceInternal.setModelFactories(List.of(mb.testFactory)); - waitForSwing(); - - performAction(targetsProvider.actionConnect, false); - DebuggerConnectDialog dialog = waitForDialogComponent(DebuggerConnectDialog.class); - - pressButtonByText(dialog, "Cancel", true); - } - - @Test - public void testRegisteredModelsShowInTree() throws Exception { - createTestModel(); - waitForSwing(); - - GTreeNode root = targetsProvider.tree.getModelRoot(); - assertEquals(targetsProvider.rootNode, root); - - List modelNodes = root.getChildren(); - assertEquals(1, modelNodes.size()); - - GTreeNode nodeForTestModel = modelNodes.get(0); - assertEquals(DebuggerModelNode.class, nodeForTestModel.getClass()); - - DebuggerModelNode node = (DebuggerModelNode) nodeForTestModel; - assertEquals(mb.testModel, node.getDebuggerModel()); - assertEquals(TestDebuggerObjectModel.TEST_MODEL_STRING, node.getDisplayText()); - } - - @Test - public void testActionConnect() { - assertTrue(targetsProvider.actionConnect.isEnabled()); - - performAction(targetsProvider.actionConnect, false); - waitForDialogComponent(DebuggerConnectDialog.class).close(); - } - - @Test - public void testActionDisconnect() throws Exception { - assertFalse(targetsProvider.actionDisconnect.isEnabled()); - - createTestModel(); - waitForSwing(); - // The first model is now selected automatically. - //assertFalse(targetsProvider.actionDisconnect.isEnabled()); - - selectNodeForObject(targetsProvider, mb.testModel); - waitForSwing(); - assertTrue(targetsProvider.actionDisconnect.isEnabled()); - - performAction(targetsProvider.actionDisconnect, true); - waitForSwing(); - assertNull(targetsProvider.rootNode.findNodeForObject(mb.testModel)); - } - - @Test - public void testActionFlushCaches() throws Exception { - createTestModel(); - TestDebuggerObjectModel secondModel = new TestDebuggerObjectModel(); - modelService.addModel(secondModel); - waitForSwing(); - - selectNodeForObject(targetsProvider, mb.testModel); - waitForSwing(); - performAction(targetsProvider.actionFlushCaches, false); - waitForSwing(); - assertEquals(1, mb.testModel.clearInvalidateCachesCount()); - assertEquals(0, secondModel.clearInvalidateCachesCount()); - } - - protected static final Set POPUP_ACTIONS = Set.of(AbstractConnectAction.NAME, - AbstractDisconnectAction.NAME, AbstractFlushCachesAction.NAME); - - @Test - public void testPopupActionsOnDebuggerModel() throws Exception { - createTestModel(); - waitForSwing(); - - clickTreeNode(targetsProvider.tree, - targetsProvider.rootNode.findNodeForObject(mb.testModel), MouseEvent.BUTTON3); - waitForSwing(); - assertMenu(POPUP_ACTIONS, - Set.of(AbstractDisconnectAction.NAME, AbstractFlushCachesAction.NAME)); - } - - @Test - public void testModelActivationOnClick() throws Exception { - createTestModel(); - TestDebuggerObjectModel secondModel = new TestDebuggerObjectModel(); - modelService.addModel(secondModel); - waitForSwing(); - - // NB. Expansion is run in background task - waitForPass(noExc(() -> { - clickTreeNode(targetsProvider.tree, - targetsProvider.rootNode.findNodeForObject(mb.testModel), MouseEvent.BUTTON1); - waitForSwing(); - assertEquals(mb.testModel, modelService.getCurrentModel()); - })); - - waitForPass(noExc(() -> { - clickTreeNode(targetsProvider.tree, - targetsProvider.rootNode.findNodeForObject(secondModel), MouseEvent.BUTTON1); - waitForSwing(); - assertEquals(secondModel, modelService.getCurrentModel()); - })); - } - - @Test - public void testActivateModelChangesSelection() throws Exception { - createTestModel(); - TestDebuggerObjectModel secondModel = new TestDebuggerObjectModel(); - modelService.addModel(secondModel); - waitForSwing(); - - modelService.activateModel(mb.testModel); - waitForSwing(); - DebuggerModelNode node1 = - (DebuggerModelNode) targetsProvider.tree.getSelectionPath().getLastPathComponent(); - assertEquals(mb.testModel, node1.getDebuggerModel()); - - modelService.activateModel(secondModel); - waitForSwing(); - DebuggerModelNode node2 = - (DebuggerModelNode) targetsProvider.tree.getSelectionPath().getLastPathComponent(); - assertEquals(secondModel, node2.getDebuggerModel()); - } -} diff --git a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/trace/DebuggerTraceTabPanelTest.java b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/trace/DebuggerTraceTabPanelTest.java index ea1bf923ef..1b07a02559 100644 --- a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/trace/DebuggerTraceTabPanelTest.java +++ b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/gui/trace/DebuggerTraceTabPanelTest.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -78,11 +78,11 @@ public class DebuggerTraceTabPanelTest extends AbstractGhidraHeadedDebuggerTest traceManager.openTrace(tb2.trace); waitForSwing(); - traceTabs.selectTab(tb1.trace); + runSwing(() -> traceTabs.selectTab(tb1.trace)); waitForSwing(); assertEquals(tb1.trace, traceManager.getCurrentTrace()); - traceTabs.selectTab(tb2.trace); + runSwing(() -> traceTabs.selectTab(tb2.trace)); waitForSwing(); assertEquals(tb2.trace, traceManager.getCurrentTrace()); } diff --git a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/mapping/DefaultDebuggerRegisterMapperTest.java b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/mapping/DefaultDebuggerRegisterMapperTest.java deleted file mode 100644 index 5510f27564..0000000000 --- a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/mapping/DefaultDebuggerRegisterMapperTest.java +++ /dev/null @@ -1,133 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.mapping; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; - -import java.util.Objects; -import java.util.Set; - -import org.junit.Before; -import org.junit.Test; - -import ghidra.app.plugin.core.debug.gui.AbstractGhidraHeadedDebuggerTest; -import ghidra.dbg.model.TestTargetRegister; -import ghidra.dbg.model.TestTargetRegisterValue; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.TargetRegister; -import ghidra.debug.api.action.ActionSource; -import ghidra.debug.api.model.DebuggerRegisterMapper; -import ghidra.debug.api.model.TraceRecorder; -import ghidra.program.model.lang.*; -import ghidra.test.ToyProgramBuilder; -import ghidra.trace.model.thread.TraceThread; - -public class DefaultDebuggerRegisterMapperTest extends AbstractGhidraHeadedDebuggerTest { - - static class TestTargetMapper extends DefaultDebuggerTargetTraceMapper { - public TestTargetMapper(TargetObject target) - throws LanguageNotFoundException, CompilerSpecNotFoundException { - super(target, new LanguageID(ToyProgramBuilder._TOY64_BE), - new CompilerSpecID("default"), Set.of()); - } - } - - protected static void assertSameRegister(TargetRegister expected, TargetObject actual) { - if (actual instanceof TestTargetRegister tr) { - assertEquals(expected, tr); - } - else if (actual instanceof TestTargetRegisterValue rv) { - assertEquals(expected, rv.desc); - } - else { - fail(); - } - } - - @Before - public void setUpMapperTest() throws Throwable { - createTestModel(); - mb.createTestProcessesAndThreads(); - mb.createTestThreadRegisterBanks(); - } - - protected DebuggerRegisterMapper doGetRegisterMapper(String toConfirm) - throws Throwable { - TraceRecorder recorder = modelService.recordTarget(mb.testProcess1, - new TestTargetMapper(mb.testProcess1), ActionSource.AUTOMATIC); - TraceThread thread1 = waitForValue(() -> recorder.getTraceThread(mb.testThread1)); - DebuggerRegisterMapper rm = waitForValue(() -> recorder.getRegisterMapper(thread1)); - waitForValue(() -> rm.getTargetRegister(toConfirm)); - return rm; - } - - protected DebuggerRegisterMapper getRegisterMapper() throws Throwable { - mb.testProcess1.regs.addRegistersFromLanguage(getToyBE64Language(), r -> true); - return doGetRegisterMapper("r0"); - } - - protected DebuggerRegisterMapper getRegisterMapperAliased() throws Throwable { - Register r0 = getToyBE64Language().getRegister("r0"); - mb.testProcess1.regs.addRegistersFromLanguage(getToyBE64Language(), r -> r != r0); - mb.testProcess1.regs.addRegister("a0", r0); - return doGetRegisterMapper("r1"); - } - - @Test - public void testTraceToTargetRegCanonical() throws Throwable { - DebuggerRegisterMapper rm = getRegisterMapper(); - TestTargetRegister tR0 = - Objects.requireNonNull(mb.testProcess1.regs.getCachedElements().get("r0")); - Register lR0 = Objects.requireNonNull(getToyBE64Language().getRegister("r0")); - - TargetRegister tReg = waitForValue(() -> rm.traceToTarget(lR0)); - assertSameRegister(tR0, tReg); - } - - @Test - public void testTargetToTraceRegCanonical() throws Throwable { - DebuggerRegisterMapper rm = getRegisterMapper(); - TestTargetRegister tR0 = - Objects.requireNonNull(mb.testProcess1.regs.getCachedElements().get("r0")); - Register lR0 = Objects.requireNonNull(getToyBE64Language().getRegister("r0")); - - Register lReg = waitForValue(() -> rm.targetToTrace(tR0)); - assertEquals(lR0, lReg); - } - - @Test - public void testTraceToTargetRegAlias() throws Throwable { - DebuggerRegisterMapper rm = getRegisterMapperAliased(); - TestTargetRegister tA0 = - Objects.requireNonNull(mb.testProcess1.regs.getCachedElements().get("a0")); - Register lR0 = Objects.requireNonNull(getToyBE64Language().getRegister("r0")); - - TargetRegister tReg = waitForValue(() -> rm.traceToTarget(lR0)); - assertSameRegister(tA0, tReg); - } - - @Test - public void testTargetToTraceRegAlias() throws Throwable { - DebuggerRegisterMapper rm = getRegisterMapperAliased(); - TestTargetRegister tA0 = - Objects.requireNonNull(mb.testProcess1.regs.getCachedElements().get("a0")); - Register lR0 = Objects.requireNonNull(getToyBE64Language().getRegister("r0")); - - Register lReg = waitForValue(() -> rm.targetToTrace(tA0)); - assertEquals(lR0, lReg); - } -} diff --git a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/mapping/LargestSubDebuggerRegisterMapperTest.java b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/mapping/LargestSubDebuggerRegisterMapperTest.java deleted file mode 100644 index 47c6b3e079..0000000000 --- a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/mapping/LargestSubDebuggerRegisterMapperTest.java +++ /dev/null @@ -1,318 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.mapping; - -import static org.junit.Assert.*; - -import java.math.BigInteger; -import java.util.*; - -import org.junit.Before; -import org.junit.Test; - -import ghidra.app.plugin.core.debug.gui.AbstractGhidraHeadedDebuggerTest; -import ghidra.dbg.model.*; -import ghidra.dbg.target.*; -import ghidra.dbg.util.CollectionUtils.Delta; -import ghidra.debug.api.action.ActionSource; -import ghidra.debug.api.model.*; -import ghidra.program.model.lang.*; -import ghidra.test.ToyProgramBuilder; -import ghidra.trace.model.thread.TraceThread; - -public class LargestSubDebuggerRegisterMapperTest extends AbstractGhidraHeadedDebuggerTest { - - static class TestTargetMapper extends DefaultDebuggerTargetTraceMapper { - public TestTargetMapper(TargetObject target) - throws LanguageNotFoundException, CompilerSpecNotFoundException { - super(target, new LanguageID(ToyProgramBuilder._X64), new CompilerSpecID("gcc"), - Set.of()); - } - - @Override - protected DebuggerRegisterMapper createRegisterMapper( - TargetRegisterContainer registers) { - return new LargestSubDebuggerRegisterMapper(cSpec, registers, false); - } - - @Override - protected DebuggerMemoryMapper createMemoryMapper(TargetMemory memory) { - return new DefaultDebuggerMemoryMapper(language, memory.getModel()); - } - } - - protected static void assertSameRegister(TargetRegister expected, TargetObject actual) { - if (actual instanceof TestTargetRegister tr) { - assertEquals(expected, tr); - } - else if (actual instanceof TestTargetRegisterValue rv) { - assertEquals(expected, rv.desc); - } - else { - fail(); - } - } - - @Before - public void setUpMapperTest() throws Throwable { - createTestModel(); - mb.createTestProcessesAndThreads(); - mb.createTestThreadRegisterBanks(); - } - - protected DebuggerRegisterMapper getRegisterMapperBase() throws Throwable { - mb.testProcess1.regs.addRegistersFromLanguage(getSLEIGH_X86_64_LANGUAGE(), r -> true); - - TraceRecorder recorder = modelService.recordTarget(mb.testProcess1, - new TestTargetMapper(mb.testProcess1), ActionSource.AUTOMATIC); - TraceThread thread1 = waitForValue(() -> recorder.getTraceThread(mb.testThread1)); - DebuggerRegisterMapper rm = waitForValue(() -> recorder.getRegisterMapper(thread1)); - waitForValue(() -> rm.getTargetRegister("rax")); - return rm; - } - - // This simulates mapping 32-bit x86 into 64-bit x86, as required for WoW64 - protected DebuggerRegisterMapper getRegisterMapperSub() throws Throwable { - mb.testProcess1.regs.addRegistersFromLanguage(getSLEIGH_X86_LANGUAGE(), r -> true); - - TraceRecorder recorder = modelService.recordTarget(mb.testProcess1, - new TestTargetMapper(mb.testProcess1), ActionSource.AUTOMATIC); - TraceThread thread1 = waitForValue(() -> recorder.getTraceThread(mb.testThread1)); - DebuggerRegisterMapper rm = waitForValue(() -> recorder.getRegisterMapper(thread1)); - waitForValue(() -> rm.getTargetRegister("eax")); - return rm; - } - - protected static byte[] genBytes8() { - return new byte[] { - (byte) 0x01, (byte) 0x23, (byte) 0x45, (byte) 0x67, - (byte) 0x89, (byte) 0xab, (byte) 0xcd, (byte) 0xef }; - } - - @Test - public void testGetTargetRegisterNameBase() throws Throwable { - DebuggerRegisterMapper rm = getRegisterMapperBase(); - TestTargetRegister tRAX = - Objects.requireNonNull(mb.testProcess1.regs.getCachedElements().get("RAX")); - TestTargetRegister tEAX = - Objects.requireNonNull(mb.testProcess1.regs.getCachedElements().get("EAX")); - - assertSameRegister(tRAX, waitForValue(() -> rm.getTargetRegister("rax"))); - assertSameRegister(tEAX, waitForValue(() -> rm.getTargetRegister("eax"))); // Seems reasonable - } - - @Test - public void testGetTraceRegisterNameBase() throws Throwable { - DebuggerRegisterMapper rm = getRegisterMapperBase(); - Register lRAX = Objects.requireNonNull(getSLEIGH_X86_64_LANGUAGE().getRegister("RAX")); - - assertEquals(lRAX, waitForValue(() -> rm.getTraceRegister("rax"))); - assertNull(rm.getTraceRegister("eax")); - } - - @Test - public void testTraceToTargetValueBase() throws Throwable { - DebuggerRegisterMapper rm = getRegisterMapperBase(); - Register lRAX = Objects.requireNonNull(getSLEIGH_X86_64_LANGUAGE().getRegister("RAX")); - RegisterValue rv = new RegisterValue(lRAX, new BigInteger("0123456789abcdef", 16)); - - Map.Entry ent = rm.traceToTarget(rv); - assertEquals("RAX", ent.getKey()); - assertArrayEquals(genBytes8(), ent.getValue()); - } - - @Test - public void testTraceToTargetRegBase() throws Throwable { - DebuggerRegisterMapper rm = getRegisterMapperBase(); - TestTargetRegister tRAX = - Objects.requireNonNull(mb.testProcess1.regs.getCachedElements().get("RAX")); - Register lRAX = Objects.requireNonNull(getSLEIGH_X86_64_LANGUAGE().getRegister("RAX")); - - TargetRegister tReg = waitForValue(() -> rm.traceToTarget(lRAX)); - assertSameRegister(tRAX, tReg); - } - - @Test - public void testTargetToTraceNameValueBase() throws Throwable { - DebuggerRegisterMapper rm = getRegisterMapperBase(); - Register lRAX = Objects.requireNonNull(getSLEIGH_X86_64_LANGUAGE().getRegister("RAX")); - - RegisterValue rv = waitForValue(() -> rm.targetToTrace("rax", genBytes8())); - assertEquals(new RegisterValue(lRAX, new BigInteger("0123456789abcdef", 16)), rv); - } - - @Test - public void testTargetToTraceRegValueBase() throws Throwable { - DebuggerRegisterMapper rm = getRegisterMapperBase(); - Register lRAX = Objects.requireNonNull(getSLEIGH_X86_64_LANGUAGE().getRegister("RAX")); - TestTargetRegister tRAX = - Objects.requireNonNull(mb.testProcess1.regs.getCachedElements().get("RAX")); - - RegisterValue rv = waitForValue(() -> rm.targetToTrace(tRAX, genBytes8())); - assertEquals(new RegisterValue(lRAX, new BigInteger("0123456789abcdef", 16)), rv); - } - - @Test - public void testTargetToTraceRegBase() throws Throwable { - DebuggerRegisterMapper rm = getRegisterMapperBase(); - Register lRAX = getSLEIGH_X86_64_LANGUAGE().getRegister("RAX"); - TestTargetRegister tRAX = - Objects.requireNonNull(mb.testProcess1.regs.getCachedElements().get("RAX")); - - Register lReg = waitForValue(() -> rm.targetToTrace(tRAX)); - assertEquals(lRAX, lReg); - } - - protected static byte[] genBytes4() { - return new byte[] { - (byte) 0x89, (byte) 0xab, (byte) 0xcd, (byte) 0xef }; - } - - @Test - public void testGetTargetRegisterNameSub() throws Throwable { - DebuggerRegisterMapper rm = getRegisterMapperSub(); - TestTargetRegister tEAX = - Objects.requireNonNull(mb.testProcess1.regs.getCachedElements().get("EAX")); - - assertSameRegister(tEAX, waitForValue(() -> rm.getTargetRegister("eax"))); - assertNull(rm.getTargetRegister("rax")); - } - - @Test - public void testGetTraceRegisterNameSub() throws Throwable { - /** - * Seems counter-intuitive, but trace side should be base registers only, and the trace is - * still 64-bit. - */ - DebuggerRegisterMapper rm = getRegisterMapperSub(); - Register lRAX = Objects.requireNonNull(getSLEIGH_X86_64_LANGUAGE().getRegister("RAX")); - - assertEquals(lRAX, waitForValue(() -> rm.getTraceRegister("rax"))); - assertNull(rm.getTraceRegister("eax")); - } - - @Test - public void testTraceToTargetValueSub() throws Throwable { - DebuggerRegisterMapper rm = getRegisterMapperSub(); - Register lRAX = Objects.requireNonNull(getSLEIGH_X86_64_LANGUAGE().getRegister("RAX")); - RegisterValue rv = new RegisterValue(lRAX, new BigInteger("0123456789abcdef", 16)); - - Map.Entry ent = waitForValue(() -> rm.traceToTarget(rv)); - assertEquals("EAX", ent.getKey()); - assertArrayEquals(genBytes4(), ent.getValue()); - } - - @Test - public void testTraceToTargetRegSub() throws Throwable { - DebuggerRegisterMapper rm = getRegisterMapperSub(); - TestTargetRegister tEAX = - Objects.requireNonNull(mb.testProcess1.regs.getCachedElements().get("EAX")); - Register lRAX = Objects.requireNonNull(getSLEIGH_X86_64_LANGUAGE().getRegister("RAX")); - - TargetRegister tReg = waitForValue(() -> rm.traceToTarget(lRAX)); - assertSameRegister(tEAX, tReg); - } - - @Test - public void testTargetToTraceNameValueSub() throws Throwable { - DebuggerRegisterMapper rm = getRegisterMapperSub(); - Register lRAX = Objects.requireNonNull(getSLEIGH_X86_64_LANGUAGE().getRegister("RAX")); - - RegisterValue rv = waitForValue(() -> rm.targetToTrace("eax", genBytes4())); - assertEquals(new RegisterValue(lRAX, new BigInteger("0000000089abcdef", 16)), rv); - } - - @Test - public void testTargetToTraceRegValueSub() throws Throwable { - DebuggerRegisterMapper rm = getRegisterMapperSub(); - Register lRAX = Objects.requireNonNull(getSLEIGH_X86_64_LANGUAGE().getRegister("RAX")); - TestTargetRegister tEAX = - Objects.requireNonNull(mb.testProcess1.regs.getCachedElements().get("EAX")); - - RegisterValue rv = waitForValue(() -> rm.targetToTrace(tEAX, genBytes4())); - assertEquals(new RegisterValue(lRAX, new BigInteger("0000000089abcdef", 16)), rv); - } - - @Test - public void testTargetToTraceRegSub() throws Throwable { - DebuggerRegisterMapper rm = getRegisterMapperSub(); - Register lRAX = getSLEIGH_X86_64_LANGUAGE().getRegister("RAX"); - TestTargetRegister tEAX = - Objects.requireNonNull(mb.testProcess1.regs.getCachedElements().get("EAX")); - - Register lReg = waitForValue(() -> rm.targetToTrace(tEAX)); - assertEquals(lRAX, lReg); - } - - @Test - public void testTargetToTraceAmidChanges() throws Throwable { - DebuggerRegisterMapper rm = getRegisterMapperBase(); - Register lRAX = Objects.requireNonNull(getSLEIGH_X86_64_LANGUAGE().getRegister("RAX")); - RegisterValue rv; - - rv = waitForValue(() -> rm.targetToTrace("rax", genBytes8())); - assertEquals(new RegisterValue(lRAX, new BigInteger("0123456789abcdef", 16)), rv); - // NOTE: This is not allowed, but still generates a courtesy warning - assertNull(rm.targetToTrace("eax", genBytes4())); - - Delta delta = mb.testProcess1.regs.removeRegister(lRAX, "WoW64"); - assertFalse(delta.removed.isEmpty()); - waitForPass(() -> assertNull(rm.getTargetRegister("rax"))); - - rv = waitForValue(() -> rm.targetToTrace("eax", genBytes4())); - assertEquals(new RegisterValue(lRAX, new BigInteger("0000000089abcdef", 16)), rv); - /** - * Should this be kept? I favoring a more accepting model makes sense, but I worry about - * erroneous cases we might not be catching, by re-generating missing registers on the fly. - */ - // assertNull(rm.targetToTrace("rax", genBytes8())); // Should no longer understand this one - - // This might be quite kick, back to 64-bit - mb.testProcess1.regs.addRegistersFromLanguage(getSLEIGH_X86_64_LANGUAGE(), r -> true); - waitForValue(() -> rm.getTargetRegister("rax")); - - rv = waitForValue(() -> rm.targetToTrace("rax", genBytes8())); - assertEquals(new RegisterValue(lRAX, new BigInteger("0123456789abcdef", 16)), rv); - } - - @Test - public void testTraceToTargetAmidChanges() throws Throwable { - DebuggerRegisterMapper rm = getRegisterMapperBase(); - Register lRAX = Objects.requireNonNull(getSLEIGH_X86_64_LANGUAGE().getRegister("RAX")); - RegisterValue rv = new RegisterValue(lRAX, new BigInteger("0123456789abcdef", 16)); - Map.Entry ent; - - ent = waitForValue(() -> rm.traceToTarget(rv)); - assertEquals("RAX", ent.getKey()); - assertArrayEquals(genBytes8(), ent.getValue()); - - Delta delta = mb.testProcess1.regs.removeRegister(lRAX, "WoW64"); - assertFalse(delta.removed.isEmpty()); - waitForPass(() -> assertNull(rm.getTargetRegister("rax"))); - - ent = waitForValue(() -> rm.traceToTarget(rv)); - assertEquals("EAX", ent.getKey()); - assertArrayEquals(genBytes4(), ent.getValue()); - - // This might be quite kick, back to 64-bit - mb.testProcess1.regs.addRegistersFromLanguage(getSLEIGH_X86_64_LANGUAGE(), r -> true); - waitForValue(() -> rm.getTargetRegister("rax")); - - ent = waitForValue(() -> rm.traceToTarget(rv)); - assertEquals("RAX", ent.getKey()); - assertArrayEquals(genBytes8(), ent.getValue()); - } -} diff --git a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/platform/gdb/DefaultGdbDebuggerMappingOpinionTest.java b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/platform/gdb/DefaultGdbDebuggerMappingOpinionTest.java deleted file mode 100644 index d62f08c30b..0000000000 --- a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/platform/gdb/DefaultGdbDebuggerMappingOpinionTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.platform.gdb; - -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - -import java.util.*; -import java.util.stream.Collectors; - -import org.junit.Test; - -import ghidra.app.plugin.core.debug.platform.gdb.DefaultGdbDebuggerMappingOpinion.GdbDefaultOffer; -import ghidra.dbg.model.TestDebuggerObjectModel; -import ghidra.dbg.model.TestTargetProcess; -import ghidra.debug.api.model.DebuggerMappingOffer; -import ghidra.debug.api.model.DebuggerMappingOpinion; -import ghidra.program.model.lang.LanguageID; -import ghidra.test.AbstractGhidraHeadlessIntegrationTest; - -public class DefaultGdbDebuggerMappingOpinionTest extends AbstractGhidraHeadlessIntegrationTest { - @Test - public void testQueryOpinionsIncludesLdefsBased() { - TestDebuggerObjectModel model = new TestDebuggerObjectModel(); - - model.session.environment.changeAttributes(List.of(), Map.ofEntries( - Map.entry("_debugger", "gdb"), - Map.entry("_arch", "armv5t"), - Map.entry("_endian", "little")), - "Testing"); - - TestTargetProcess process = model.addProcess(1234); - - List offers = DebuggerMappingOpinion.queryOpinions(process, false); - assertFalse(offers.isEmpty()); - Set ldefsOnes = offers.stream() - .filter(o -> o.getClass().equals(GdbDefaultOffer.class)) - .collect(Collectors.toSet()); - assertFalse(ldefsOnes.isEmpty()); - Set ids = - ldefsOnes.stream().map(o -> o.getTraceLanguageID()).collect(Collectors.toSet()); - assertTrue(ids.contains(new LanguageID("ARM:LE:32:v5t"))); - } -} diff --git a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/platform/gdb/GdbArmDebuggerMappingOpinionTest.java b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/platform/gdb/GdbArmDebuggerMappingOpinionTest.java deleted file mode 100644 index 2ece30b38f..0000000000 --- a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/platform/gdb/GdbArmDebuggerMappingOpinionTest.java +++ /dev/null @@ -1,102 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.platform.gdb; - -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - -import java.util.*; -import java.util.stream.Collectors; - -import org.junit.Test; - -import ghidra.app.plugin.core.debug.platform.gdb.GdbArmDebuggerMappingOpinion.GdbAArch64Offer; -import ghidra.app.plugin.core.debug.platform.gdb.GdbArmDebuggerMappingOpinion.GdbArmOffer; -import ghidra.dbg.model.TestDebuggerObjectModel; -import ghidra.dbg.model.TestTargetProcess; -import ghidra.debug.api.model.DebuggerMappingOffer; -import ghidra.debug.api.model.DebuggerMappingOpinion; -import ghidra.program.model.lang.LanguageID; -import ghidra.test.AbstractGhidraHeadlessIntegrationTest; - -public class GdbArmDebuggerMappingOpinionTest extends AbstractGhidraHeadlessIntegrationTest { - @Test - public void testQueryOpinionsIncludesArmLdefsBased() { - TestDebuggerObjectModel model = new TestDebuggerObjectModel(); - - model.session.environment.changeAttributes(List.of(), Map.ofEntries( - Map.entry("_debugger", "gdb"), - Map.entry("_arch", "armv7"), - Map.entry("_endian", "little")), - "Testing"); - - TestTargetProcess process = model.addProcess(1234); - - List offers = DebuggerMappingOpinion.queryOpinions(process, false); - assertFalse(offers.isEmpty()); - Set ldefsOnes = offers.stream() - .filter(o -> o.getClass().equals(GdbArmOffer.class)) - .collect(Collectors.toSet()); - assertFalse(ldefsOnes.isEmpty()); - Set ids = - ldefsOnes.stream().map(o -> o.getTraceLanguageID()).collect(Collectors.toSet()); - assertTrue(ids.contains(new LanguageID("ARM:LE:32:v7"))); - } - - @Test - public void testQueryOpinionsExcludesArmLdefsBased() { - TestDebuggerObjectModel model = new TestDebuggerObjectModel(); - - model.session.environment.changeAttributes(List.of(), Map.ofEntries( - Map.entry("_debugger", "gdb"), - Map.entry("_arch", "i386:x86-64:intel"), - Map.entry("_endian", "little")), - "Testing"); - - TestTargetProcess process = model.addProcess(1234); - - List offers = DebuggerMappingOpinion.queryOpinions(process, false); - assertFalse(offers.isEmpty()); - Set ldefsOnes = offers.stream() - .filter(o -> o.getClass().equals(GdbArmOffer.class)) - .collect(Collectors.toSet()); - assertTrue(ldefsOnes.isEmpty()); - } - - @Test - public void testQueryOpinionsIncludesAArch64LdefsBased() { - TestDebuggerObjectModel model = new TestDebuggerObjectModel(); - - model.session.environment.changeAttributes(List.of(), Map.ofEntries( - Map.entry("_debugger", "gdb"), - Map.entry("_arch", "aarch64"), - Map.entry("_endian", "little")), - "Testing"); - - TestTargetProcess process = model.addProcess(1234); - - List offers = DebuggerMappingOpinion.queryOpinions(process, false); - assertFalse(offers.isEmpty()); - Set ldefsOnes = offers.stream() - .filter(o -> o.getClass().equals(GdbAArch64Offer.class)) - .collect(Collectors.toSet()); - assertFalse(ldefsOnes.isEmpty()); - Set ids = - ldefsOnes.stream().map(o -> o.getTraceLanguageID()).collect(Collectors.toSet()); - assertTrue(ids.contains(new LanguageID("AARCH64:LE:64:v8A"))); - } - -} diff --git a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/service/model/DebuggerModelServiceTest.java b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/service/model/DebuggerModelServiceTest.java deleted file mode 100644 index 6d7f7bb620..0000000000 --- a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/service/model/DebuggerModelServiceTest.java +++ /dev/null @@ -1,571 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.service.model; - -import static org.junit.Assert.*; - -import java.awt.Component; -import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import javax.swing.JLabel; -import javax.swing.JTextField; - -import org.junit.Test; -import org.junit.experimental.categories.Category; - -import generic.Unique; -import generic.test.category.NightlyCategory; -import ghidra.app.plugin.core.debug.gui.AbstractGhidraHeadedDebuggerTest; -import ghidra.app.plugin.core.debug.gui.DebuggerResources.AbstractConnectAction; -import ghidra.app.plugin.core.debug.service.model.DebuggerConnectDialog.FactoryEntry; -import ghidra.app.plugin.core.debug.service.model.TestDebuggerProgramLaunchOpinion.TestDebuggerProgramLaunchOffer; -import ghidra.dbg.DebuggerModelFactory; -import ghidra.dbg.DebuggerObjectModel; -import ghidra.dbg.model.TestDebuggerModelFactory; -import ghidra.dbg.model.TestDebuggerObjectModel; -import ghidra.dbg.target.TargetEnvironment; -import ghidra.debug.api.action.ActionSource; -import ghidra.debug.api.model.DebuggerProgramLaunchOffer; -import ghidra.debug.api.model.TraceRecorder; -import ghidra.trace.model.Trace; -import ghidra.trace.model.thread.TraceThread; -import ghidra.util.Swing; -import ghidra.util.SystemUtilities; -import ghidra.util.datastruct.CollectionChangeListener; - -/** - * TODO: Cover the error cases, and cases where {@code null} is expected - * - *

- * TODO: Cover cases where multiple recorders are present - */ -@Category(NightlyCategory.class) -public class DebuggerModelServiceTest extends AbstractGhidraHeadedDebuggerTest { - protected static final long TIMEOUT_MILLIS = - SystemUtilities.isInTestingBatchMode() ? 5000 : Long.MAX_VALUE; - - protected static class NoDuplicatesTrackingChangeListener - implements CollectionChangeListener { - Set current = new HashSet<>(); - - protected String formatObj(E e) { - return String.format("%s@%08x", e.getClass().getSimpleName(), - System.identityHashCode(e)); - } - - @Override - public synchronized void elementAdded(E element) { - assertTrue(current.add(element)); - } - - @Override - public synchronized void elementModified(E element) { - assertTrue(current.contains(element)); - } - - @Override - public synchronized void elementRemoved(E element) { - assertTrue(current.remove(element)); - } - - public synchronized void sync(Collection current) { - this.current.clear(); - this.current.addAll(current); - } - - public synchronized void assertAgrees(Collection expected) { - assertEquals(Set.copyOf(expected), current); - } - } - - NoDuplicatesTrackingChangeListener factoryChangeListener = - new NoDuplicatesTrackingChangeListener<>(); - NoDuplicatesTrackingChangeListener modelChangeListener = - new NoDuplicatesTrackingChangeListener<>(); - NoDuplicatesTrackingChangeListener recorderChangeListener = - new NoDuplicatesTrackingChangeListener<>(); - - @Test - public void testGetModelFactories() throws Exception { - modelServiceInternal.setModelFactories(List.of(mb.testFactory)); - assertEquals(Set.of(mb.testFactory), modelService.getModelFactories()); - } - - @Test - public void testListenModelFactoryAdded() throws Exception { - modelServiceInternal.setModelFactories(List.of()); - modelService.addFactoriesChangedListener(factoryChangeListener); - modelServiceInternal.setModelFactories(List.of(mb.testFactory)); - - factoryChangeListener.assertAgrees(modelService.getModelFactories()); - } - - @Test - public void testListenModelFactoryRemoved() throws Exception { - modelServiceInternal.setModelFactories(List.of(mb.testFactory)); - modelService.addFactoriesChangedListener(factoryChangeListener); - factoryChangeListener.sync(modelService.getModelFactories()); - modelServiceInternal.setModelFactories(List.of()); - - factoryChangeListener.assertAgrees(modelService.getModelFactories()); - } - - @Test - public void testGetProgramLaunchOffers() throws Exception { - createAndOpenProgramWithExePath("/my/fun/path"); - TestDebuggerModelFactory factory = new TestDebuggerModelFactory(); - modelServiceInternal.setModelFactories(List.of(factory)); - List offers = - modelService.getProgramLaunchOffers(program).collect(Collectors.toList()); - DebuggerProgramLaunchOffer offer = Unique.assertOne(offers); - assertEquals(TestDebuggerProgramLaunchOffer.class, offer.getClass()); - } - - @Test - public void testGetModels() throws Exception { - assertEquals(Set.of(), modelService.getModels()); - createTestModel(); - assertEquals(Set.of(mb.testModel), modelService.getModels()); - } - - @Test - public void testListenModelAdded() throws Exception { - modelService.addModelsChangedListener(modelChangeListener); - createTestModel(); - - modelChangeListener.assertAgrees(modelService.getModels()); - } - - @Test - public void testListenModelRemoved() throws Exception { - createTestModel(); - - modelService.addModelsChangedListener(modelChangeListener); - modelChangeListener.sync(modelService.getModels()); - modelService.removeModel(mb.testModel); - - modelChangeListener.assertAgrees(modelService.getModels()); - } - - @Test - public void testGetTraceRecorders() throws Exception { - createTestModel(); - mb.createTestProcessesAndThreads(); - - assertEquals(Set.of(), Set.copyOf(modelService.getTraceRecorders())); - TraceRecorder recorder = modelService.recordTarget(mb.testProcess1, - createTargetTraceMapper(mb.testProcess1), ActionSource.AUTOMATIC); - - assertEquals(Set.of(recorder), Set.copyOf(modelService.getTraceRecorders())); - } - - @Test - public void testListenTraceRecorderAdded() throws Exception { - createTestModel(); - mb.createTestProcessesAndThreads(); - - modelService.addTraceRecordersChangedListener(recorderChangeListener); - modelService.recordTarget(mb.testProcess1, createTargetTraceMapper(mb.testProcess1), - ActionSource.AUTOMATIC); - - recorderChangeListener.assertAgrees(modelService.getTraceRecorders()); - } - - @Test - public void testListenTraceRecorderRemoved() throws Exception { - createTestModel(); - mb.createTestProcessesAndThreads(); - - TraceRecorder recorder = modelService.recordTarget(mb.testProcess1, - createTargetTraceMapper(mb.testProcess1), ActionSource.AUTOMATIC); - modelService.addTraceRecordersChangedListener(recorderChangeListener); - recorderChangeListener.sync(modelService.getTraceRecorders()); - Trace trace = recorder.getTrace(); - recorder.stopRecording(); - waitForDomainObject(trace); - - recorderChangeListener.assertAgrees(modelService.getTraceRecorders()); - } - - @Test - public void testRecordThenCloseStopsRecording() throws Throwable { - createTestModel(); - mb.createTestProcessesAndThreads(); - - TraceRecorder recorder = modelService.recordTarget(mb.testProcess1, - createTargetTraceMapper(mb.testProcess1), ActionSource.AUTOMATIC); - assertNotNull(recorder); - waitOn(recorder.init()); // Already initializing, just wait for it to complete - - waitOn(mb.testModel.close()); - waitForPass(() -> { - assertFalse("Still recording", recorder.isRecording()); - }); - } - - @Test - public void testRecordAndOpenThenCloseModelAndTraceLeavesNoConsumers() throws Throwable { - createTestModel(); - mb.createTestProcessesAndThreads(); - - modelService.recordTargetAndActivateTrace(mb.testProcess1, - createTargetTraceMapper(mb.testProcess1)); - waitForSwing(); - - Trace trace = traceManager.getCurrentTrace(); - assertNotNull("No active trace", trace); - - traceManager.closeTrace(trace); - waitOn(mb.testModel.close()); - waitForPass(() -> { - assertEquals(List.of(tb), trace.getConsumerList()); - }); - } - - @Test - public void testGetRecorderByTarget() throws Exception { - createTestModel(); - mb.createTestProcessesAndThreads(); - - TraceRecorder recorder = modelService.recordTarget(mb.testProcess1, - createTargetTraceMapper(mb.testProcess1), ActionSource.AUTOMATIC); - - assertEquals(recorder, modelService.getRecorder(mb.testProcess1)); - } - - @Test - public void testGetRecorderByTrace() throws Exception { - createTestModel(); - mb.createTestProcessesAndThreads(); - - TraceRecorder recorder = modelService.recordTarget(mb.testProcess1, - createTargetTraceMapper(mb.testProcess1), ActionSource.AUTOMATIC); - - assertEquals(recorder, modelService.getRecorder(recorder.getTrace())); - } - - @Test - public void testGetTarget() throws Exception { - createTestModel(); - mb.createTestProcessesAndThreads(); - - TraceRecorder recorder = modelService.recordTarget(mb.testProcess1, - createTargetTraceMapper(mb.testProcess1), ActionSource.AUTOMATIC); - - assertEquals(mb.testProcess1, modelService.getTarget(recorder.getTrace())); - } - - @Test - public void testGetTrace() throws Exception { - createTestModel(); - mb.createTestProcessesAndThreads(); - - TraceRecorder recorder = modelService.recordTarget(mb.testProcess1, - createTargetTraceMapper(mb.testProcess1), ActionSource.AUTOMATIC); - - assertEquals(recorder.getTrace(), modelService.getTrace(mb.testProcess1)); - } - - @Test - public void testGetTargetThread() throws Exception { - createTestModel(); - mb.createTestProcessesAndThreads(); - - TraceRecorder recorder = modelService.recordTarget(mb.testProcess1, - createTargetTraceMapper(mb.testProcess1), ActionSource.AUTOMATIC); - - // The most complicated case, lest I want another dimension in a cross product - mb.createTestThreadStacksAndFramesHaveRegisterBanks(); - - // Recorder uses async executor, so wait for thread to appear.... - waitFor(() -> recorder.getTrace() - .getThreadManager() - .getThreadsByPath("Processes[1].Threads[1]") - .size() == 1); - - TraceThread traceThread = Unique.assertOne( - recorder.getTrace().getThreadManager().getThreadsByPath("Processes[1].Threads[1]")); - /** - * There's a brief period where the trace thread exists, but it hasn't been entered into the - * recorder's internal map, yet. So, we have to wait. - */ - waitForPass(() -> { - assertEquals(mb.testThread1, modelService.getTargetThread(traceThread)); - }); - } - - protected void doTestGetTraceThread(Runnable preRec, Runnable postRec) throws Exception { - createTestModel(); - mb.createTestProcessesAndThreads(); - - preRec.run(); - - modelService.recordTarget(mb.testProcess1, createTargetTraceMapper(mb.testProcess1), - ActionSource.AUTOMATIC); - - postRec.run(); - - waitForPass(() -> { - TraceThread traceThread = modelService.getTraceThread(mb.testThread1); - assertNotNull("testThread1 is mapped to null", traceThread); - assertEquals("Processes[1].Threads[1]", traceThread.getPath()); - }); - } - - @Test - public void testGetTraceThreadWhereBankInThreadPreRecord() throws Exception { - doTestGetTraceThread(mb::createTestThreadRegisterBanks, this::nop); - } - - @Test - public void testGetTraceThreadWhereBankInThreadPostRecord() throws Exception { - doTestGetTraceThread(this::nop, mb::createTestThreadRegisterBanks); - } - - @Test - public void testGetTraceThreadWhereBankInStackPreRecord() throws Exception { - doTestGetTraceThread(mb::createTestThreadStacksAndFramesAreRegisterBanks, this::nop); - } - - @Test - public void testGetTraceThreadWhereBankInStackPostRecord() throws Exception { - doTestGetTraceThread(this::nop, mb::createTestThreadStacksAndFramesAreRegisterBanks); - } - - @Test - public void testGetTraceThreadWhereBankInFramePreRecord() throws Exception { - doTestGetTraceThread(mb::createTestThreadStacksAndFramesHaveRegisterBanks, this::nop); - } - - @Test - public void testGetTraceThreadWhereBankInFramePostRecord() throws Exception { - doTestGetTraceThread(this::nop, mb::createTestThreadStacksAndFramesHaveRegisterBanks); - } - - @Test - public void testGetTraceThreadWithTarget() throws Throwable { - createTestModel(); - mb.createTestProcessesAndThreads(); - - TraceRecorder recorder = - modelService.recordTarget(mb.testProcess1, createTargetTraceMapper(mb.testProcess1), - ActionSource.AUTOMATIC); - waitRecorder(recorder); - - // The most complicated case, lest I want another dimension in a cross product - mb.createTestThreadStacksAndFramesHaveRegisterBanks(); - waitRecorder(recorder); - - waitForPass(() -> { - TraceThread traceThread = modelService.getTraceThread(mb.testProcess1, mb.testThread1); - assertNotNull(traceThread); - assertEquals("Processes[1].Threads[1]", traceThread.getPath()); - }); - } - - @Test - public void testTargetFocus() throws Throwable { - createTestModel(); - mb.createTestProcessesAndThreads(); - - // NOTE: getTargetFocus assumes the target is being recorded - modelService.recordTarget(mb.testProcess1, - createTargetTraceMapper(mb.testProcess1), ActionSource.AUTOMATIC); - modelService.recordTarget(mb.testProcess3, - createTargetTraceMapper(mb.testProcess3), ActionSource.AUTOMATIC); - - assertNull(modelService.getTargetFocus(mb.testProcess1)); - assertNull(modelService.getTargetFocus(mb.testProcess3)); - - waitOn(mb.testModel.requestFocus(mb.testThread1)); - waitForPass( - () -> assertEquals(mb.testThread1, modelService.getTargetFocus(mb.testProcess1))); - waitForPass(() -> assertNull(modelService.getTargetFocus(mb.testProcess3))); - - waitOn(mb.testModel.requestFocus(mb.testThread2)); - waitForPass( - () -> assertEquals(mb.testThread2, modelService.getTargetFocus(mb.testProcess1))); - waitForPass(() -> assertNull(modelService.getTargetFocus(mb.testProcess3))); - - waitOn(mb.testModel.requestFocus(mb.testThread3)); - waitForPass( - () -> assertEquals(mb.testThread2, modelService.getTargetFocus(mb.testProcess1))); - waitForPass( - () -> assertEquals(mb.testThread3, modelService.getTargetFocus(mb.testProcess3))); - - waitOn(mb.testModel.requestFocus(mb.testThread4)); - waitForPass( - () -> assertEquals(mb.testThread2, modelService.getTargetFocus(mb.testProcess1))); - waitForPass( - () -> assertEquals(mb.testThread4, modelService.getTargetFocus(mb.testProcess3))); - } - - @Test - public void testCurrentModelNullAfterClose() throws Throwable { - createTestModel(); - - // Ensure the model is initialized before we close it - waitOn(mb.testModel.fetchModelRoot()); - - modelService.activateModel(mb.testModel); - assertEquals(mb.testModel, modelService.getCurrentModel()); - - waitOn(mb.testModel.close()); - assertNull(modelService.getCurrentModel()); - } - - @Test - public void testCurrentModelNullAfterCloseNoWait() throws Throwable { - createTestModel(); - - modelService.activateModel(mb.testModel); - assertEquals(mb.testModel, modelService.getCurrentModel()); - - waitOn(mb.testModel.close()); - assertNull(modelService.getCurrentModel()); - } - - @Test - public void testConnectDialogPopulates() { - modelServiceInternal.setModelFactories(List.of(mb.testFactory)); - waitForSwing(); - - Swing.runLater(() -> modelService.showConnectDialog()); - DebuggerConnectDialog dialog = waitForDialogComponent(DebuggerConnectDialog.class); - - FactoryEntry fe = (FactoryEntry) dialog.dropdownModel.getSelectedItem(); - assertEquals(mb.testFactory, fe.factory()); - - assertEquals(TestDebuggerModelFactory.FAKE_DETAILS_HTML, dialog.description.getText()); - - Component[] components = dialog.gridPanel.getComponents(); - - assertTrue(components[0] instanceof JLabel); - JLabel label = (JLabel) components[0]; - assertEquals("" + TestDebuggerModelFactory.FAKE_OPTION_NAME, label.getText()); - - assertTrue(components[1] instanceof JTextField); - JTextField field = (JTextField) components[1]; - assertEquals(TestDebuggerModelFactory.FAKE_DEFAULT, field.getText()); - - pressButtonByText(dialog, "Cancel", true); - } - - @Test - public void testConnectDialogConnectsAndRegistersModelWithService() throws Throwable { - modelServiceInternal.setModelFactories(List.of(mb.testFactory)); - - CompletableFuture futureModel = new CompletableFuture<>(); - CollectionChangeListener listener = - new CollectionChangeListener() { - @Override - public void elementAdded(DebuggerObjectModel element) { - futureModel.complete(element); - } - - @Override - public void elementModified(DebuggerObjectModel element) { - // Don't care - } - - @Override - public void elementRemoved(DebuggerObjectModel element) { - fail(); - } - }; - modelService.addModelsChangedListener(listener); - Swing.runLater(() -> modelService.showConnectDialog()); - - DebuggerConnectDialog connectDialog = waitForDialogComponent(DebuggerConnectDialog.class); - - FactoryEntry fe = (FactoryEntry) connectDialog.dropdownModel.getSelectedItem(); - assertEquals(mb.testFactory, fe.factory()); - - pressButtonByText(connectDialog, AbstractConnectAction.NAME, true); - // NOTE: testModel is null. Don't use #createTestModel(), which adds to service - TestDebuggerObjectModel model = new TestDebuggerObjectModel(); - mb.testFactory.pollBuild().complete(model); - assertEquals(model, waitOn(futureModel)); - } - - @Test - public void testRecordBestOfferRecognized() throws Exception { - createTestModel(); - mb.testModel.session.environment.changeAttributes(List.of(), - Map.of(TargetEnvironment.ARCH_ATTRIBUTE_NAME, TestKnownArchDebuggerMappingOpinion.ARCH), - "Testing"); - mb.createTestProcessesAndThreads(); - // NB. Model service does not "auto-record". Objects provider does that. - - modelService.recordTargetBestOffer(mb.testProcess1); - - assertEquals(1, modelService.getTraceRecorders().size()); - } - - @Test(expected = NoSuchElementException.class) - public void testRecordBestOfferUnrecognized() throws Exception { - createTestModel(); - mb.testModel.session.environment.changeAttributes(List.of(), - Map.of(TargetEnvironment.ARCH_ATTRIBUTE_NAME, "test-bogus-arch"), "Testing"); - mb.createTestProcessesAndThreads(); - - modelService.recordTargetBestOffer(mb.testProcess1); - } - - @Test - public void testRecordPromptOffersRecognized() throws Exception { - createTestModel(); - mb.testModel.session.environment.changeAttributes(List.of(), - Map.of(TargetEnvironment.ARCH_ATTRIBUTE_NAME, TestKnownArchDebuggerMappingOpinion.ARCH), - "Testing"); - mb.createTestProcessesAndThreads(); - - runSwingLater(() -> modelService.recordTargetPromptOffers(mb.testProcess1)); - DebuggerSelectMappingOfferDialog dialog = - waitForDialogComponent(DebuggerSelectMappingOfferDialog.class); - dialog.okCallback(); - - waitForPass(() -> assertEquals(1, modelService.getTraceRecorders().size())); - } - - @Test - public void testRecordPromptOffersUnrecognized() throws Exception { - createTestModel(); - mb.testModel.session.environment.changeAttributes(List.of(), - Map.of(TargetEnvironment.ARCH_ATTRIBUTE_NAME, "test-bogus-arch"), "Testing"); - mb.createTestProcessesAndThreads(); - - runSwingLater(() -> modelService.recordTargetPromptOffers(mb.testProcess1)); - DebuggerSelectMappingOfferDialog dialog = - waitForDialogComponent(DebuggerSelectMappingOfferDialog.class); - - assertTrue(dialog.getDisplayedOffers().isEmpty()); - - runSwing(() -> dialog.setFilterRecommended(false)); - waitForPass(() -> assertFalse(dialog.getDisplayedOffers().isEmpty())); - // TODO: setFilterRecommended's call to selectPreferred comes to early. - if (dialog.getSelectedOffer() == null) { - dialog.setSelectedOffer(dialog.getDisplayedOffers().get(0)); - } - - // Do I care which language is actually selected? - dialog.okCallback(); - - waitForPass(() -> assertEquals(1, modelService.getTraceRecorders().size())); - } -} diff --git a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/service/model/DefaultTraceRecorderTest.java b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/service/model/DefaultTraceRecorderTest.java deleted file mode 100644 index 2a8806b065..0000000000 --- a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/service/model/DefaultTraceRecorderTest.java +++ /dev/null @@ -1,255 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.service.model; - -import static org.junit.Assert.*; - -import java.math.BigInteger; -import java.util.Map.Entry; - -import org.junit.Test; - -import db.Transaction; -import ghidra.app.plugin.core.debug.gui.AbstractGhidraHeadedDebuggerTest; -import ghidra.dbg.model.TestTargetMemoryRegion; -import ghidra.dbg.model.TestTargetRegisterBankInThread; -import ghidra.dbg.util.PathUtils; -import ghidra.debug.api.action.ActionSource; -import ghidra.debug.api.model.DebuggerRegisterMapper; -import ghidra.debug.api.model.TraceRecorder; -import ghidra.program.model.data.PointerDataType; -import ghidra.program.model.lang.Language; -import ghidra.program.model.lang.Register; -import ghidra.trace.model.*; -import ghidra.trace.model.listing.TraceCodeSpace; -import ghidra.trace.model.memory.*; -import ghidra.trace.model.thread.TraceThread; - -public class DefaultTraceRecorderTest extends AbstractGhidraHeadedDebuggerTest { - - @Test - public void testThreadsRecorded() throws Exception { - createTestModel(); - mb.createTestProcessesAndThreads(); - - TraceRecorder recorder = modelService.recordTarget(mb.testProcess1, - createTargetTraceMapper(mb.testProcess1), ActionSource.AUTOMATIC); - waitForPass(() -> { - assertNotNull(recorder.getTraceThread(mb.testThread1)); - assertNotNull(recorder.getTraceThread(mb.testThread2)); - }); - } - - @Test - public void testRegionsRecorded() throws Exception { - createTestModel(); - mb.createTestProcessesAndThreads(); - - TraceRecorder recorder = modelService.recordTarget(mb.testProcess1, - createTargetTraceMapper(mb.testProcess1), ActionSource.AUTOMATIC); - Trace trace = recorder.getTrace(); - - TestTargetMemoryRegion targetRegion = - mb.testProcess1.addRegion("bin:.text", mb.rng(0x55550000, 0x5555ffff), "rx"); - - waitForPass(() -> { - assertNotNull(trace.getMemoryManager() - .getLiveRegionByPath(recorder.getSnap(), - PathUtils.toString(targetRegion.getPath()))); - }); - } - - protected TraceMemorySpace createRegSpace(TraceThread thread) { - try (Transaction tx = thread.getTrace().openTransaction("Create register space")) { - return thread.getTrace().getMemoryManager().getMemoryRegisterSpace(thread, true); - } - } - - protected boolean registerMapped(TraceRecorder recorder, TraceThread thread, - Register register) { - DebuggerRegisterMapper rm = recorder.getRegisterMapper(thread); - if (rm == null) { - return false; - } - return null != rm.traceToTarget(register); - } - - @Test - public void testHandlesWrongLengthRegValsGracefully() throws Exception { - createTestModel(); - createTrace(); // Silly. Just to get tb.arr? - mb.createTestProcessesAndThreads(); - - TraceRecorder recorder = modelService.recordTarget(mb.testProcess1, - createTargetTraceMapper(mb.testProcess1), ActionSource.AUTOMATIC); - Trace trace = recorder.getTrace(); - Language lang = trace.getBaseLanguage(); - Register r0 = lang.getRegister("r0"); - Register r1 = lang.getRegister("r1"); - TraceThread thread = waitForValue(() -> recorder.getTraceThread(mb.testThread1)); - //TraceThread thread = recorder.getTraceThread(mb.testThread1); - TraceMemorySpace rs = createRegSpace(thread); - mb.testProcess1.regs.addRegistersFromLanguage(getToyBE64Language(), - Register::isBaseRegister); - TestTargetRegisterBankInThread regs = mb.testThread1.addRegisterBank(); - - //waitForCondition(() -> registerMapped(recorder, thread, r0)); - regs.writeRegister("r0", tb.arr(1)).get(); - - waitForPass(() -> { - assertEquals(BigInteger.ONE, rs.getValue(recorder.getSnap(), r0).getUnsignedValue()); - }); - - regs.writeRegister("r1", tb.arr(1, 2, 3, 4, 5, 6, 7, 8, 9)).get(); - - waitForPass(() -> { - assertEquals(BigInteger.valueOf(0x02030405_06070809L), - rs.getValue(recorder.getSnap(), r1).getUnsignedValue()); - }); - } - - @Test - public void testUpdateRegsMemIgnoresNullSpVal() throws Exception { - createTestModel(); - createTrace(); // Silly. Just to get tb.arr? - mb.createTestProcessesAndThreads(); - - TraceRecorder recorder = modelService.recordTarget(mb.testProcess1, - createTargetTraceMapper(mb.testProcess1), ActionSource.AUTOMATIC); - Trace trace = recorder.getTrace(); - Language lang = trace.getBaseLanguage(); - Register pc = lang.getRegister("pc"); - Register sp = lang.getRegister("sp"); - TraceThread thread = waitForValue(() -> recorder.getTraceThread(mb.testThread1)); - TraceMemorySpace rs = createRegSpace(thread); - mb.testProcess1.addRegion("bin:.text", mb.rng(0x55550000, 0x5555ffff), "rx"); - mb.testProcess1.regs.addRegistersFromLanguage(getToyBE64Language(), - r -> r.isBaseRegister() && r != pc && r != sp); - TestTargetRegisterBankInThread regs = mb.testThread1.addRegisterBank(); - try (Transaction tx = trace.openTransaction("Add PC type")) { - TraceCodeSpace code = trace.getCodeManager().getCodeRegisterSpace(thread, true); - code.definedData().create(Lifespan.nowOn(0), pc, PointerDataType.dataType); - } - - assertNull(rs.getMostRecentStateEntry(recorder.getSnap(), pc.getAddress())); - assertNull(rs.getMostRecentStateEntry(recorder.getSnap(), sp.getAddress())); - - mb.testProcess1.regs.addRegister(pc); - //waitForCondition(() -> registerMapped(recorder, thread, pc)); - regs.writeRegister("pc", tb.arr(0x55, 0x55, 0x01, 0x23)); - - waitForPass(() -> { - assertEquals(BigInteger.valueOf(0x55550123), - rs.getValue(recorder.getSnap(), pc).getUnsignedValue()); - }); - - assertNull(rs.getMostRecentStateEntry(recorder.getSnap(), sp.getAddress())); - - TraceMemoryManager mm = trace.getMemoryManager(); - waitForPass(() -> { - Entry ent = - mm.getMostRecentStateEntry(recorder.getSnap(), tb.addr(0x55550123)); - assertNotNull(ent); - assertEquals(TraceMemoryState.KNOWN, ent.getValue()); - }); - - // Don't let null's get interpreted as 0 - assertNull(mm.getMostRecentStateEntry(recorder.getSnap(), tb.addr(0))); - } - - @Test - public void testUpdateRegsMemIgnoresNullPcVal() throws Exception { - createTestModel(); - createTrace(); // Silly. Just to get tb.arr? - mb.createTestProcessesAndThreads(); - - TraceRecorder recorder = modelService.recordTarget(mb.testProcess1, - createTargetTraceMapper(mb.testProcess1), ActionSource.AUTOMATIC); - Trace trace = recorder.getTrace(); - Language lang = trace.getBaseLanguage(); - Register pc = lang.getRegister("pc"); - Register sp = lang.getRegister("sp"); - TraceThread thread = waitForValue(() -> recorder.getTraceThread(mb.testThread1)); - TraceMemorySpace rs = createRegSpace(thread); - mb.testProcess1.addRegion("[stack]", mb.rng(0x22220000, 0x2222ffff), "rw"); - mb.testProcess1.regs.addRegistersFromLanguage(getToyBE64Language(), - r -> r.isBaseRegister() && r != pc && r != sp); - TestTargetRegisterBankInThread regs = mb.testThread1.addRegisterBank(); - try (Transaction tx = trace.openTransaction("Add SP type")) { - TraceCodeSpace code = trace.getCodeManager().getCodeRegisterSpace(thread, true); - code.definedData().create(Lifespan.nowOn(0), sp, PointerDataType.dataType); - } - - assertNull(rs.getMostRecentStateEntry(recorder.getSnap(), pc.getAddress())); - assertNull(rs.getMostRecentStateEntry(recorder.getSnap(), sp.getAddress())); - - mb.testProcess1.regs.addRegister(sp); - //waitForCondition(() -> registerMapped(recorder, thread, sp)); - regs.writeRegister("sp", tb.arr(0x22, 0x22, 0x03, 0x21)); - - waitForPass(() -> { - assertEquals(BigInteger.valueOf(0x22220321), - rs.getValue(recorder.getSnap(), sp).getUnsignedValue()); - }); - - assertNull(rs.getMostRecentStateEntry(recorder.getSnap(), pc.getAddress())); - - TraceMemoryManager mm = trace.getMemoryManager(); - waitForPass(() -> { - Entry ent = - mm.getMostRecentStateEntry(recorder.getSnap(), tb.addr(0x22220321)); - assertNotNull(ent); - assertEquals(TraceMemoryState.KNOWN, ent.getValue()); - }); - - // Don't let PC's null get interpreted as 0 - assertNull(mm.getMostRecentStateEntry(recorder.getSnap(), tb.addr(0))); - } - - @Test - public void testUpdatRegsMemStaysInRegions() throws Exception { - createTestModel(); - createTrace(); // Silly. Just to get tb.arr? - mb.createTestProcessesAndThreads(); - - TraceRecorder recorder = modelService.recordTarget(mb.testProcess1, - createTargetTraceMapper(mb.testProcess1), ActionSource.AUTOMATIC); - Trace trace = recorder.getTrace(); - Language lang = trace.getBaseLanguage(); - Register pc = lang.getRegister("pc"); - mb.testProcess1.addRegion("bin:.text", mb.rng(0x55550123, 0x55550321), "rx"); - mb.testProcess1.regs.addRegistersFromLanguage(getToyBE64Language(), - Register::isBaseRegister); - TestTargetRegisterBankInThread regs = mb.testThread1.addRegisterBank(); - - //waitForCondition(() -> registerMapped(recorder, thread, pc)); - TraceThread thread = waitForValue(() -> recorder.getTraceThread(mb.testThread1)); - try (Transaction tx = trace.openTransaction("Add PC type")) { - TraceCodeSpace code = trace.getCodeManager().getCodeRegisterSpace(thread, true); - code.definedData().create(Lifespan.nowOn(0), pc, PointerDataType.dataType); - } - regs.writeRegister("pc", tb.arr(0x55, 0x55, 0x02, 0x22)); - - TraceMemoryManager mm = trace.getMemoryManager(); - waitForPass(() -> { - Entry ent = - mm.getMostRecentStateEntry(recorder.getSnap(), tb.addr(0x55550222)); - assertNotNull(ent); - assertEquals(TraceMemoryState.KNOWN, ent.getValue()); - assertEquals(tb.range(0x55550123, 0x55550321), ent.getKey().getRange()); - }); - } -} diff --git a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/service/model/TestDebuggerProgramLaunchOpinion.java b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/service/model/TestDebuggerProgramLaunchOpinion.java deleted file mode 100644 index be62224400..0000000000 --- a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/service/model/TestDebuggerProgramLaunchOpinion.java +++ /dev/null @@ -1,71 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.service.model; - -import java.util.Collection; -import java.util.List; -import java.util.concurrent.CompletableFuture; - -import javax.swing.Icon; - -import ghidra.app.plugin.core.debug.gui.DebuggerResources; -import ghidra.app.plugin.core.debug.service.model.launch.DebuggerProgramLaunchOpinion; -import ghidra.app.services.DebuggerModelService; -import ghidra.debug.api.model.DebuggerProgramLaunchOffer; -import ghidra.framework.plugintool.PluginTool; -import ghidra.program.model.listing.Program; -import ghidra.util.task.TaskMonitor; - -public class TestDebuggerProgramLaunchOpinion implements DebuggerProgramLaunchOpinion { - - public static class TestDebuggerProgramLaunchOffer implements DebuggerProgramLaunchOffer { - @Override - public CompletableFuture launchProgram(TaskMonitor monitor, PromptMode prompt, - LaunchConfigurator configurator) { - return CompletableFuture - .completedFuture(LaunchResult.totalFailure(new AssertionError())); - } - - @Override - public String getConfigName() { - return "TEST"; - } - - @Override - public Icon getIcon() { - return DebuggerResources.ICON_DEBUGGER; - } - - @Override - public String getMenuParentTitle() { - return "Debug it"; - } - - @Override - public String getMenuTitle() { - return "in Fake Debugger"; - } - } - - @Override - public Collection getOffers(Program program, PluginTool tool, - DebuggerModelService service) { - //DebuggerModelFactory factory = Unique.assertOne(service.getModelFactories()); - //assertEquals(TestDebuggerModelFactory.class, factory.getClass()); - - return List.of(new TestDebuggerProgramLaunchOffer()); - } -} diff --git a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/service/model/TestKnownArchDebuggerMappingOpinion.java b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/service/model/TestKnownArchDebuggerMappingOpinion.java deleted file mode 100644 index 703f484112..0000000000 --- a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/service/model/TestKnownArchDebuggerMappingOpinion.java +++ /dev/null @@ -1,41 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.service.model; - -import java.util.Set; - -import ghidra.app.plugin.core.debug.mapping.*; -import ghidra.dbg.target.TargetEnvironment; -import ghidra.dbg.target.TargetObject; -import ghidra.debug.api.model.DebuggerMappingOffer; -import ghidra.debug.api.model.DebuggerMappingOpinion; -import ghidra.program.model.lang.CompilerSpecID; -import ghidra.program.model.lang.LanguageID; - -public class TestKnownArchDebuggerMappingOpinion implements DebuggerMappingOpinion { - public static final String ARCH = "test-known-arch"; - - @Override - public Set offersForEnv(TargetEnvironment env, TargetObject target, - boolean includeOverrides) { - if (!ARCH.equals(env.getArchitecture())) { - return Set.of(); - } - return Set.of(new DefaultDebuggerMappingOffer(target, 100, "Offer for test-known-arch", - new LanguageID(DebuggerModelServiceTest.LANGID_TOYBE64), new CompilerSpecID("default"), - Set.of())); - } -} diff --git a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/service/model/record/ObjectBasedTraceRecorderTest.java b/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/service/model/record/ObjectBasedTraceRecorderTest.java deleted file mode 100644 index 015185ec33..0000000000 --- a/Ghidra/Debug/Debugger/src/test/java/ghidra/app/plugin/core/debug/service/model/record/ObjectBasedTraceRecorderTest.java +++ /dev/null @@ -1,571 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.debug.service.model.record; - -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.oneOf; -import static org.junit.Assert.*; - -import java.nio.ByteBuffer; -import java.util.*; - -import org.junit.Test; - -import generic.Unique; -import ghidra.app.plugin.core.debug.gui.AbstractGhidraHeadedDebuggerTest; -import ghidra.app.plugin.core.debug.mapping.ObjectBasedDebuggerMappingOpinion; -import ghidra.dbg.error.DebuggerMemoryAccessException; -import ghidra.dbg.model.*; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetBreakpointSpec.TargetBreakpointKind; -import ghidra.dbg.target.TargetEventScope.TargetEventType; -import ghidra.dbg.target.TargetExecutionStateful.TargetExecutionState; -import ghidra.debug.api.action.ActionSource; -import ghidra.debug.api.model.*; -import ghidra.program.model.address.Address; -import ghidra.program.model.address.AddressRangeImpl; -import ghidra.program.model.lang.Language; -import ghidra.trace.model.*; -import ghidra.trace.model.breakpoint.*; -import ghidra.trace.model.memory.*; -import ghidra.trace.model.modules.*; -import ghidra.trace.model.stack.TraceStackFrame; -import ghidra.trace.model.target.*; -import ghidra.trace.model.thread.*; -import ghidra.trace.model.time.TraceSnapshot; -import ghidra.trace.model.time.TraceTimeManager; -import ghidra.util.StreamUtils; -import ghidra.util.task.TaskMonitor; - -public class ObjectBasedTraceRecorderTest extends AbstractGhidraHeadedDebuggerTest { - DebuggerMappingOpinion opinion = new ObjectBasedDebuggerMappingOpinion(); - TraceRecorder recorder; - - TraceBreakpointManager breaks; - TraceObjectManager objects; - TraceMemoryManager memory; - TraceModuleManager modules; - TraceThreadManager threads; - TraceTimeManager time; - - protected void startRecording() throws Exception { - createTestModel(); - TargetObject target = mb.testModel.session; - DebuggerTargetTraceMapper mapper = Unique.assertOne(opinion.getOffers(target, true)).take(); - recorder = modelService.recordTarget(mb.testModel.session, mapper, ActionSource.MANUAL); - - useTrace(recorder.getTrace()); - breaks = tb.trace.getBreakpointManager(); - objects = tb.trace.getObjectManager(); - memory = tb.trace.getMemoryManager(); - modules = tb.trace.getModuleManager(); - threads = tb.trace.getThreadManager(); - time = tb.trace.getTimeManager(); - } - - protected void dumpValues(TraceObject obj) { - System.err.println("Values of " + obj); - for (TraceObjectValue val : obj.getValues(Lifespan.ALL)) { - System.err.println(" " + val.getEntryKey() + " = " + val.getValue()); - } - } - - protected void dumpValues(TraceObjectInterface obj) { - dumpValues(obj.getObject()); - } - - protected void dumpObjects() { - System.err.println("All objects:"); - for (TraceObject object : StreamUtils.iter(objects.getAllObjects())) { - System.err.println(" " + object); - } - } - - @Test - public void testRecordBaseSession() throws Throwable { - startRecording(); - - waitForPass(noExc(() -> { - waitOn(recorder.flushTransactions()); - assertEquals(5, objects.getObjectCount()); - })); - } - - @Test - public void testCloseModelStopsRecording() throws Throwable { - startRecording(); - waitForPass(() -> assertTrue(recorder.isRecording())); - - waitOn(mb.testModel.close()); - waitForPass(() -> assertFalse(recorder.isRecording())); - } - - @Test - public void testRecordEvents() throws Throwable { - startRecording(); - - waitForPass(() -> assertEquals(0, recorder.getSnap())); - mb.testModel.fire() - .event(mb.testModel.session, null, TargetEventType.RUNNING, "Test RUNNING", - List.of()); - mb.testModel.fire() - .event(mb.testModel.session, null, TargetEventType.STOPPED, "Test STOPPED", - List.of()); - waitForPass(() -> { - assertEquals(1, recorder.getSnap()); - TraceSnapshot snapshot = time.getSnapshot(1, false); - assertEquals("Test STOPPED", snapshot.getDescription()); - }); - - mb.createTestProcessesAndThreads(); - mb.testModel.fire() - .event(mb.testModel.session, mb.testThread1, TargetEventType.STEP_COMPLETED, - "Test STEP", List.of()); - waitForPass(() -> { - assertEquals(2, recorder.getSnap()); - TraceSnapshot snapshot = time.getSnapshot(2, false); - assertEquals("Test STEP", snapshot.getDescription()); - TraceThread thread = recorder.getTraceThread(mb.testThread1); - assertEquals(thread, snapshot.getEventThread()); - }); - } - - @Test - public void testRecordThreads() throws Throwable { - startRecording(); - mb.createTestProcessesAndThreads(); - - waitForPass(noExc(() -> { - waitOn(recorder.flushTransactions()); - assertEquals(4, threads.getAllThreads().size()); - - TraceThread thread = recorder.getTraceThread(mb.testThread1); - assertEquals(mb.testThread1, recorder.getTargetThread(thread)); - - assertEquals(TargetExecutionState.STOPPED, - recorder.getTargetThreadState(mb.testThread1)); - assertEquals(TargetExecutionState.STOPPED, recorder.getTargetThreadState(thread)); - })); - - assertEquals(Set.of(mb.testThread1, mb.testThread2, mb.testThread3, mb.testThread4), - recorder.getLiveTargetThreads()); - } - - @Test - public void testRecordThreadNameReuse() throws Throwable { - startRecording(); - mb.createTestProcessesAndThreads(); - waitRecorder(recorder); - TraceThread thread1 = recorder.getTraceThread(mb.testThread1); - assertNotNull(thread1); - TraceObject object1 = ((TraceObjectThread) thread1).getObject(); - - recorder.forceSnapshot(); - mb.testProcess1.threads.removeThreads(mb.testThread1); - waitRecorder(recorder); - assertEquals(Lifespan.at(0), thread1.getLifespan()); - assertNull(recorder.getTraceThread(mb.testThread1)); - - recorder.forceSnapshot(); - mb.testThread1 = mb.testProcess1.addThread(1); - waitRecorder(recorder); - assertSame(thread1, recorder.getTraceThread(mb.testThread1)); - assertEquals(Set.of(Lifespan.at(0L), Lifespan.nowOn(2L)), object1.getLife().spans()); - } - - @Test - public void testRecordMemoryRegion() throws Throwable { - startRecording(); - mb.createTestProcessesAndThreads(); - TestTargetMemoryRegion text = - mb.testProcess1.memory.addRegion("exe:.text", mb.rng(0x00400000, 0x00400fff), "wrx"); - - waitForPass(() -> { - TraceMemoryRegion region = Unique.assertOne(memory.getAllRegions()); - assertEquals("[exe:.text]", region.getName()); - assertEquals("Processes[1].Memory[exe:.text]", region.getPath()); - assertEquals(tb.range(0x00400000, 0x00400fff), region.getRange()); - assertEquals( - Set.of(TraceMemoryFlag.READ, TraceMemoryFlag.WRITE, TraceMemoryFlag.EXECUTE), - region.getFlags()); - - assertEquals(region, recorder.getTraceMemoryRegion(text)); - assertEquals(text, recorder.getTargetMemoryRegion(region)); - }); - } - - @Test - public void testRecordMemoryAddressSet() throws Throwable { - startRecording(); - mb.createTestProcessesAndThreads(); - - mb.testProcess1.memory.addRegion("exe:.text", mb.rng(0x00400000, 0x00400fff), "rx"); - waitForPass(() -> { - assertEquals(tb.set(tb.range(0x00400000, 0x00400fff)), recorder.getAccessibleMemory()); - }); - - TestTargetMemoryRegion data = - mb.testProcess1.memory.addRegion("exe:.data", mb.rng(0x00401000, 0x00401fff), "wr"); - waitForPass(() -> { - assertEquals(tb.set(tb.range(0x00400000, 0x00401fff)), recorder.getAccessibleMemory()); - }); - - mb.testProcess1.memory.removeRegion(data); - waitForPass(() -> { - assertEquals(tb.set(tb.range(0x00400000, 0x00400fff)), recorder.getAccessibleMemory()); - }); - - mb.testModel.removeProcess(mb.testProcess1); - waitForPass(() -> { - assertEquals(tb.set(), recorder.getAccessibleMemory()); - }); - } - - @Test - public void testRecordMemoryBytes() throws Throwable { - startRecording(); - mb.createTestProcessesAndThreads(); - mb.testProcess1.memory.addRegion("exe:.text", mb.rng(0x00400000, 0x00400fff), "wrx"); - mb.testProcess1.memory.writeMemory(mb.addr(0x00400123), mb.arr(1, 2, 3, 4, 5, 6, 7, 8, 9)); - - byte[] data = new byte[9]; - waitForPass(() -> { - memory.getBytes(recorder.getSnap(), tb.addr(0x00400123), ByteBuffer.wrap(data)); - assertArrayEquals(tb.arr(1, 2, 3, 4, 5, 6, 7, 8, 9), data); - }); - } - - protected void flushAndWait() throws Throwable { - waitOn(mb.testModel.flushEvents()); - waitOn(recorder.flushTransactions()); - waitForDomainObject(tb.trace); - } - - @Test - public void testRecordMemoryInvalidateCacheRequested() throws Throwable { - startRecording(); - mb.createTestProcessesAndThreads(); - - mb.testProcess1.memory.addRegion("exe:.text", mb.rng(0x00400000, 0x00400fff), "rwx"); - - waitOn(mb.testProcess1.memory.writeMemory(mb.addr(0x00400123), - mb.arr(1, 2, 3, 4, 5, 6, 7, 8, 9))); - flushAndWait(); - assertEquals(TraceMemoryState.KNOWN, - memory.getState(recorder.getSnap(), tb.addr(0x00400123))); - - mb.testModel.fire().invalidateCacheRequested(mb.testProcess1.memory); - flushAndWait(); - assertEquals(TraceMemoryState.UNKNOWN, - memory.getState(recorder.getSnap(), tb.addr(0x00400123))); - - waitOn(mb.testProcess1.memory.writeMemory(mb.addr(0x00400123), - mb.arr(1, 2, 3, 4, 5, 6, 7, 8, 9))); - flushAndWait(); - assertEquals(TraceMemoryState.KNOWN, - memory.getState(recorder.getSnap(), tb.addr(0x00400123))); - - mb.testModel.fire() - .event(mb.testModel.session, null, TargetEventType.RUNNING, "Test RUNNING", - List.of()); - mb.testModel.fire().invalidateCacheRequested(mb.testProcess1.memory); - flushAndWait(); - assertEquals(TraceMemoryState.KNOWN, - memory.getState(recorder.getSnap(), tb.addr(0x00400123))); - - mb.testModel.fire() - .event(mb.testModel.session, null, TargetEventType.STOPPED, "Test STOPPED", - List.of()); - flushAndWait(); - assertEquals(TraceMemoryState.UNKNOWN, - memory.getState(recorder.getSnap(), tb.addr(0x00400123))); - } - - @Test - public void testReadMemory() throws Throwable { - startRecording(); - mb.createTestProcessesAndThreads(); - - mb.testProcess1.memory.addRegion("exe:.text", mb.rng(0x00400000, 0x00400fff), "rwx"); - mb.testProcess1.memory.setMemory(tb.addr(0x00400123), mb.arr(1, 2, 3, 4, 5, 6, 7, 8, 9)); - flushAndWait(); - assertThat(memory.getState(recorder.getSnap(), tb.addr(0x00400123)), - is(oneOf(null, TraceMemoryState.UNKNOWN))); - - byte[] data = new byte[10]; - waitOn(recorder.readMemory(tb.addr(0x00400123), 10)); - flushAndWait(); - assertEquals(TraceMemoryState.KNOWN, - memory.getState(recorder.getSnap(), tb.addr(0x00400123))); - memory.getBytes(recorder.getSnap(), tb.addr(0x00400123), ByteBuffer.wrap(data)); - assertArrayEquals(tb.arr(1, 2, 3, 4, 5, 6, 7, 8, 9, 0), data); - } - - protected Map.Entry stateEntry(long min, long max, - TraceMemoryState state) { - return Map.entry(new ImmutableTraceAddressSnapRange(tb.range(min, max), recorder.getSnap()), - state); - } - - @Test - public void testReadMemoryBlocks() throws Throwable { - startRecording(); - mb.createTestProcessesAndThreads(); - - mb.testProcess1.memory.addRegion("exe:.text", mb.rng(0x00400000, 0x00400fff), "rx"); - mb.testProcess1.memory.addRegion("exe:.data", mb.rng(0x00600000, 0x00602fff), "rw"); - mb.testProcess1.memory.setMemory(tb.addr(0x00400123), mb.arr(1, 2, 3, 4, 5, 6, 7, 8, 9)); - flushAndWait(); - assertThat(memory.getState(recorder.getSnap(), tb.addr(0x00400123)), - is(oneOf(null, TraceMemoryState.UNKNOWN))); - - byte[] data = new byte[10]; - waitOn(recorder.readMemoryBlocks( - tb.set(tb.range(0x00400123, 0x00400123), tb.range(0x00600ffe, 0x00601000)), - TaskMonitor.DUMMY)); - flushAndWait(); - assertEquals(Set.of( - stateEntry(0x00400000, 0x00400fff, TraceMemoryState.KNOWN), - stateEntry(0x00600000, 0x00601fff, TraceMemoryState.KNOWN)), - Set.copyOf(memory.getStates(recorder.getSnap(), tb.range(0x00400000, 0x00602fff)))); - memory.getBytes(recorder.getSnap(), tb.addr(0x00400123), ByteBuffer.wrap(data)); - assertArrayEquals(tb.arr(1, 2, 3, 4, 5, 6, 7, 8, 9, 0), data); - } - - @Test - public void testWriteMemory() throws Throwable { - startRecording(); - mb.createTestProcessesAndThreads(); - - mb.testProcess1.memory.addRegion("exe:.text", mb.rng(0x00400000, 0x00400fff), "rwx"); - flushAndWait(); - assertThat(memory.getState(recorder.getSnap(), tb.addr(0x00400123)), - is(oneOf(null, TraceMemoryState.UNKNOWN))); - - byte[] data = new byte[10]; - waitOn(recorder.writeMemory(tb.addr(0x00400123), tb.arr(1, 2, 3, 4, 5, 6, 7, 8, 9))); - flushAndWait(); - assertEquals(TraceMemoryState.KNOWN, - memory.getState(recorder.getSnap(), tb.addr(0x00400123))); - memory.getBytes(recorder.getSnap(), tb.addr(0x00400123), ByteBuffer.wrap(data)); - assertArrayEquals(tb.arr(1, 2, 3, 4, 5, 6, 7, 8, 9, 0), data); - } - - @Test - public void testRecordMemoryError() throws Throwable { - startRecording(); - mb.createTestProcessesAndThreads(); - - mb.testProcess1.memory.addRegion("exe:.text", mb.rng(0x00400000, 0x00400fff), "rx"); - flushAndWait(); - assertEquals(Set.of(), Set.copyOf(memory.getStates(recorder.getSnap(), tb.range(0, -1)))); - - mb.testModel.fire() - .memoryReadError(mb.testProcess1.memory, mb.rng(0x00400123, 0x00400321), - new DebuggerMemoryAccessException("Test error")); - flushAndWait(); - // NB, only the first byte of the reported range is marked. - assertEquals(Set.of(stateEntry(0x00400123, 0x00400123, TraceMemoryState.ERROR)), - Set.copyOf(memory.getStates(recorder.getSnap(), tb.range(0, -1)))); - } - - @Test - public void testRecordMemoryBytes2Processes() throws Throwable { - startRecording(); - mb.createTestProcessesAndThreads(); - Address tgtAddr1 = mb.addr(0x00400123); - Address tgtAddr3 = mb.testModel.ram3.getAddress(0x00400123); - - mb.testProcess1.memory.addRegion("exe:.text", mb.rng(0x00400000, 0x00400fff), "wrx"); - mb.testProcess3.memory.addRegion("exe:.text", new AddressRangeImpl(tgtAddr3, 0x1000), - "rwx"); - - mb.testProcess1.memory.writeMemory(tgtAddr1, mb.arr(1, 2, 3, 4, 5, 6, 7, 8, 9)); - mb.testProcess3.memory.writeMemory(tgtAddr3, mb.arr(11, 12, 13, 14, 15)); - - Address trcAddr1 = recorder.getMemoryMapper().targetToTrace(tgtAddr1); - Address trcAddr3 = recorder.getMemoryMapper().targetToTrace(tgtAddr3); - - byte[] data = new byte[9]; - waitForPass(() -> { - memory.getBytes(recorder.getSnap(), trcAddr1, ByteBuffer.wrap(data)); - assertArrayEquals(tb.arr(1, 2, 3, 4, 5, 6, 7, 8, 9), data); - - memory.getBytes(recorder.getSnap(), trcAddr3, ByteBuffer.wrap(data)); - assertArrayEquals(tb.arr(11, 12, 13, 14, 15, 0, 0, 0, 0), data); - }); - } - - @Test - public void testRecordFocus() throws Throwable { - startRecording(); - mb.createTestProcessesAndThreads(); - - flushAndWait(); - // TODO: Is focus really a concern of the recorder? - assertTrue(recorder.isSupportsFocus()); - assertNull(recorder.getFocus()); - - waitOn(recorder.requestFocus(mb.testThread1)); - flushAndWait(); - assertEquals(mb.testThread1, recorder.getFocus()); - } - - @Test - public void testRecordBreakpoint() throws Throwable { - startRecording(); - mb.createTestProcessesAndThreads(); - flushAndWait(); - - assertEquals(Set.of(TraceBreakpointKind.values()), - Set.copyOf(recorder.getSupportedBreakpointKinds())); - - waitOn(mb.testProcess1.breaks.placeBreakpoint(mb.rng(0x00400123, 0x00400126), - Set.of(TargetBreakpointKind.SW_EXECUTE))); - flushAndWait(); - - TraceBreakpoint loc = Unique.assertOne(breaks.getAllBreakpoints()); - assertEquals(tb.range(0x00400123, 0x00400126), loc.getRange()); - assertEquals(Set.of(TraceBreakpointKind.SW_EXECUTE), loc.getKinds()); - - assertEquals(Set.of(), - Set.copyOf(recorder.collectBreakpointContainers(mb.testThread1))); - assertEquals(Set.of(mb.testProcess1.breaks, mb.testProcess3.breaks), - Set.copyOf(recorder.collectBreakpointContainers(null))); - - TargetBreakpointLocation targetLoc = recorder.getTargetBreakpoint(loc); - assertEquals(loc, recorder.getTraceBreakpoint(targetLoc)); - - // This must *not* show as applicable to thread1 - waitOn(mb.testProcess3.breaks.placeBreakpoint(mb.testModel.ram3.getAddress(0x00400321), - Set.of(TargetBreakpointKind.SW_EXECUTE))); - flushAndWait(); - assertEquals(2, breaks.getAllBreakpoints().size()); - assertEquals(Set.of(targetLoc), - Set.copyOf(recorder.collectBreakpoints(mb.testThread1))); - } - - @Test - public void testRecordModuleAndSection() throws Throwable { - startRecording(); - mb.createTestProcessesAndThreads(); - - TestTargetModule targetExe = - mb.testProcess1.modules.addModule("exe", mb.rng(0x00400000, 0x00602fff)); - TestTargetSection targetText = - targetExe.addSection(".text", mb.rng(0x00400000, 0x00400fff)); - flushAndWait(); - - TraceModule exe = Unique.assertOne(modules.getAllModules()); - assertEquals(exe, recorder.getTraceModule(targetExe)); - assertEquals(targetExe, recorder.getTargetModule(exe)); - - assertEquals("exe", exe.getName()); - assertEquals("Processes[1].Modules[exe]", exe.getPath()); - assertEquals(tb.range(0x00400000, 0x00602fff), exe.getRange()); - - TraceSection text = Unique.assertOne(modules.getAllSections()); - assertEquals(text, recorder.getTraceSection(targetText)); - assertEquals(targetText, recorder.getTargetSection(text)); - - assertEquals("[.text]", text.getName()); - assertEquals("Processes[1].Modules[exe].Sections[.text]", text.getPath()); - assertEquals(tb.range(0x00400000, 0x00400fff), text.getRange()); - - assertEquals(exe, text.getModule()); - assertEquals(Set.of(text), Set.copyOf(exe.getSections())); - } - - @Test - public void testRecordRegisters() throws Throwable { - startRecording(); - mb.createTestProcessesAndThreads(); - // TODO: Other bank placements. Will need different schemas, though :/ - mb.createTestThreadRegisterBanks(); - - Language toy = getToyBE64Language(); - mb.testProcess1.regs.addRegister(toy.getRegister("pc")); - mb.testProcess1.regs.addRegister(toy.getRegister("r0")); - TestTargetRegisterValue targetPC = - (TestTargetRegisterValue) mb.testBank1.getCachedAttribute("pc"); - targetPC.changeAttributes(List.of(), - Map.of(TargetRegister.VALUE_ATTRIBUTE_NAME, tb.arr(0, 0, 0, 0, 0, 0x40, 0x01, 0x23)), - "Write PC=0x00400123"); - TestTargetRegisterValue targetR0 = - (TestTargetRegisterValue) mb.testBank1.getCachedAttribute("r0"); - targetR0.changeAttributes(List.of(), - Map.of(TargetRegister.VALUE_ATTRIBUTE_NAME, tb.arr(0, 0, 0, 0, 0, 0, 0, 0)), - "Write R0=0x00000000"); - flushAndWait(); - - TraceObjectThread thread = (TraceObjectThread) recorder.getTraceThread(mb.testThread1); - assertNotNull(thread); - - assertEquals(Set.of(mb.testBank1), recorder.getTargetRegisterBanks(thread, 0)); - assertEquals(thread, recorder.getTraceThreadForSuccessor(mb.testBank1)); - - TraceObject traceBank = thread.getObject() - .querySuccessorsTargetInterface(Lifespan.at(recorder.getSnap()), - TargetRegisterBank.class, false) - .map(p -> p.getDestination(thread.getObject())) - .findAny() - .orElseThrow(); - - TraceObject pc = traceBank.getAttribute(recorder.getSnap(), "pc").getChild(); - assertNotNull(pc); - assertArrayEquals(tb.arr(0, 0, 0, 0, 0, 0x40, 0x01, 0x23), - (byte[]) pc.getAttribute(recorder.getSnap(), TargetObject.VALUE_ATTRIBUTE_NAME) - .getValue()); - TraceObject r0 = traceBank.getAttribute(recorder.getSnap(), "r0").getChild(); - assertNotNull(r0); - assertArrayEquals(tb.arr(0, 0, 0, 0, 0, 0, 0, 0), - (byte[]) r0.getAttribute(recorder.getSnap(), TargetObject.VALUE_ATTRIBUTE_NAME) - .getValue()); - } - - @Test - public void testRecordStack() throws Throwable { - startRecording(); - mb.createTestProcessesAndThreads(); - - TestTargetStack targetStack = mb.testThread1.addStack(); - // TODO: These "push" semantics don't seem to work as designed.... - TestTargetStackFrame targetFrame0 = targetStack.pushFrameNoBank(mb.addr(0x00400123)); - TestTargetStackFrame targetFrame1 = targetStack.pushFrameNoBank(mb.addr(0x00400321)); - flushAndWait(); - - TraceObjectThread thread = (TraceObjectThread) recorder.getTraceThread(mb.testThread1); - assertNotNull(thread); - - assertEquals(targetFrame0, recorder.getTargetStackFrame(thread, 0)); - assertEquals(targetFrame1, recorder.getTargetStackFrame(thread, 1)); - assertEquals(thread, recorder.getTraceThreadForSuccessor(targetFrame0)); - assertEquals(thread, recorder.getTraceThreadForSuccessor(targetFrame1)); - - TraceStackFrame frame0 = recorder.getTraceStackFrame(targetFrame0); - TraceStackFrame frame1 = recorder.getTraceStackFrame(targetFrame1); - - // TODO: This can use a bank, once we test the frame-has-bank schema - assertEquals(frame0, recorder.getTraceStackFrameForSuccessor(targetFrame0)); - assertEquals(frame1, recorder.getTraceStackFrameForSuccessor(targetFrame1)); - - assertEquals(0, frame0.getLevel()); - assertEquals(1, frame1.getLevel()); - - assertEquals(tb.addr(0x00400123), frame0.getProgramCounter(Long.MAX_VALUE)); - assertEquals(tb.addr(0x00400321), frame1.getProgramCounter(Long.MAX_VALUE)); - } -} diff --git a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/AnnotatedDebuggerAttributeListenerTest.java b/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/AnnotatedDebuggerAttributeListenerTest.java deleted file mode 100644 index 5000e03dbc..0000000000 --- a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/AnnotatedDebuggerAttributeListenerTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg; - -import java.lang.invoke.MethodHandles; -import java.util.*; - -import org.junit.Test; - -import ghidra.async.AsyncReference; -import ghidra.dbg.agent.AbstractDebuggerObjectModel; -import ghidra.dbg.agent.DefaultTargetModelRoot; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.testutil.DebuggerModelTestUtils; -import ghidra.program.model.address.AddressFactory; - -public class AnnotatedDebuggerAttributeListenerTest implements DebuggerModelTestUtils { - @Test - public void testAnnotatedListener() throws Throwable { - AbstractDebuggerObjectModel model = new AbstractDebuggerObjectModel() { - @Override - public AddressFactory getAddressFactory() { - return null; - } - }; - DefaultTargetModelRoot obj = new DefaultTargetModelRoot(model, "Test"); - - AsyncReference display = new AsyncReference<>(); - DebuggerModelListener l = new AnnotatedDebuggerAttributeListener(MethodHandles.lookup()) { - @AttributeCallback("_test") - private void testChanged(TargetObject object, String disp) { - display.set(disp, null); - } - - @Override - public void attributesChanged(TargetObject object, Collection removed, - Map added) { - if (object != obj) { - return; - } - super.attributesChanged(object, removed, added); - } - }; - obj.getModel().addModelListener(l); - obj.changeAttributes(List.of(), Map.ofEntries(Map.entry("_test", "Testing")), "Because"); - waitOn(display.waitValue("Testing")); - - obj.changeAttributes(List.of("_test"), Map.of(), "Because"); - waitOn(display.waitValue(null)); - } -} diff --git a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/DebugModelConventionsTest.java b/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/DebugModelConventionsTest.java deleted file mode 100644 index b00bd26034..0000000000 --- a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/DebugModelConventionsTest.java +++ /dev/null @@ -1,127 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg; - -import static ghidra.lifecycle.Unfinished.TODO; -import static org.junit.Assert.assertEquals; - -import java.util.concurrent.TimeUnit; - -import org.junit.Ignore; -import org.junit.Test; - -import ghidra.dbg.model.TestDebuggerModelBuilder; -import ghidra.dbg.target.*; -import ghidra.util.SystemUtilities; - -public class DebugModelConventionsTest { - protected static final long TIMEOUT_MILLIS = - SystemUtilities.isInTestingBatchMode() ? 5000 : Long.MAX_VALUE; - - protected final TestDebuggerModelBuilder mb = new TestDebuggerModelBuilder(); - - @Test - public void testFindSuitableWithinContainerSeedContainer() throws Exception { - mb.createTestModel(); - mb.createTestProcessesAndThreads(); - - TargetBreakpointSpecContainer bpts = DebugModelConventions - .findSuitable(TargetBreakpointSpecContainer.class, mb.testProcess1) - .get(TIMEOUT_MILLIS, TimeUnit.MILLISECONDS); - assertEquals(mb.testProcess1.breaks, bpts); - } - - @Test - public void testFindSuitableWithinContainerSeedChild() throws Exception { - mb.createTestModel(); - mb.createTestProcessesAndThreads(); - - TargetBreakpointSpecContainer bpts = DebugModelConventions - .findSuitable(TargetBreakpointSpecContainer.class, mb.testProcess1.threads) - .get(TIMEOUT_MILLIS, TimeUnit.MILLISECONDS); - assertEquals(mb.testProcess1.breaks, bpts); - } - - @Test - public void testFindSuitableOutsideContainer() throws Exception { - mb.createTestModel(); - mb.createTestProcessesAndThreads(); - - TargetEnvironment env = DebugModelConventions - .findSuitable(TargetEnvironment.class, mb.testProcess1) - .get(TIMEOUT_MILLIS, TimeUnit.MILLISECONDS); - assertEquals(mb.testModel.session.environment, env); - } - - @Test - public void testFindSuitableAtRootSeedChild() throws Exception { - mb.createTestModel(); - mb.createTestProcessesAndThreads(); - - TargetFocusScope scope = DebugModelConventions - .findSuitable(TargetFocusScope.class, mb.testThread1) - .get(TIMEOUT_MILLIS, TimeUnit.MILLISECONDS); - assertEquals(mb.testModel.session, scope); - } - - @Test - @Ignore("TODO") - public void testNearestAncestor() throws Exception { - TODO(); - } - - @Test - @Ignore("TODO") - public void testCollectAncestors() throws Exception { - TODO(); - } - - @Test - @Ignore("TODO") - public void testCollectSucccessorElements() throws Exception { - TODO(); - } - - @Test - @Ignore("TODO") - public void testIsExecution() throws Exception { - TODO(); - } - - @Test - @Ignore("TODO") - public void testFindExecution() throws Exception { - TODO(); - } - - @Test - @Ignore("TODO") - public void testSubTreeListenerAdapter() throws Exception { - TODO(); // Possibly many tests. Separate class? - } - - @Test - @Ignore("TODO") - public void testTrackAccessibility() throws Exception { - TODO(); - } - - @Test - @Ignore("TODO") - public void testRequestFocus() throws Exception { - TODO(); - } -} diff --git a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelActivationTest.java b/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelActivationTest.java deleted file mode 100644 index 3bd93577da..0000000000 --- a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelActivationTest.java +++ /dev/null @@ -1,198 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.test; - -import static org.junit.Assert.*; -import static org.junit.Assume.*; - -import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; - -import org.junit.Test; - -import generic.Unique; -import ghidra.dbg.target.*; -import ghidra.dbg.util.PathUtils; - -/** - * Test model object activation and focus - * - *

- * Activation and focus are related but separate concepts. Focus is a little looser, and is allowed - * by the model to exactly match the client's notion of focus, usually indicating the object of the - * user's interest. Activation, however, commands the model to make the given object the "current" - * object. This implies any commands issued to the CLI will affect the active object. The model - * reflects the active object back to the client via focus. This allows the model and client to - * synchronize their "active" objects, while reducing the likelihood of event feedback loops. - * Furthermore, not every object can be activated. For example, activating a register will likely - * result in the containing thread or frame becoming active instead. Or, activating a thread may - * result in its innermost frame becoming active as well. - */ -public abstract class AbstractDebuggerModelActivationTest extends AbstractDebuggerModelTest { - - /** - * Use the interpreter to activate the given object - * - * @param obj the object to activate - * @param interpreter the interpreter to use - * @throws Throwable if anything goes wrong - */ - protected void activateViaInterpreter(TargetObject obj, TargetInterpreter interpreter) - throws Throwable { - fail("Unless hasInterpreter is false, the test must implement this method"); - } - - /** - * Use the interpreter to verify the given object is active/current - * - *

- * Note, it may be necessary to run and capture several commands, depending on what's being - * verified and what sort of commands the interpreter makes available. For example, to verify a - * frame is active, the test should check that the containing thread and process are active, - * too. - * - * @param expected the expected active or current object - * @param interpreter the interpreter to use - * @throws Throwable if anything goes wrong - */ - protected void assertActiveViaInterpreter(TargetObject expected, - TargetInterpreter interpreter) throws Throwable { - fail("Unless hasInterpreter is false, the test must implement this method"); - } - - /** - * Get (possibly generate) things for this focus test to try out - * - * @throws Throwable if anything goes wrong - */ - protected abstract Set getActivatableThings() throws Throwable; - - /** - * Governs whether assertions permit the actual object to be a successor of the expected object - * - * @return true to permit successors, false to require exact - */ - protected boolean permitSuccessor() { - return true; - } - - protected void assertSuccessorOrExact(TargetObject expected, TargetObject actual) { - assertNotNull(actual); - if (permitSuccessor()) { - assertTrue("Expected successor of '" + expected.getJoinedPath(".") + - "' got '" + actual.getJoinedPath(".") + "'", - PathUtils.isAncestor(expected.getPath(), actual.getPath())); - } - else { - assertSame(expected, actual); - } - } - - /** - * If the default focus is one of the activatable things (after generation), assert its path - * - * @return the path of the expected default focus, or {@code null} for no assertion - */ - protected List getExpectedDefaultActivePath() { - return null; - } - - @Test - public void testDefaultFocusIsAsExpected() throws Throwable { - List expectedDefaultFocus = getExpectedDefaultActivePath(); - assumeNotNull(expectedDefaultFocus); - m.build(); - - TargetFocusScope focusScope = findFocusScope(); - Set activatable = getActivatableThings(); - // The default must be one of the activatable objects - TargetObject obj = Unique.assertOne(activatable.stream() - .filter(f -> PathUtils.isAncestor(f.getPath(), expectedDefaultFocus)) - .collect(Collectors.toList())); - retryVoid(() -> { - assertEquals(expectedDefaultFocus, focusScope.getFocus().getPath()); - }, List.of(AssertionError.class)); - if (m.hasInterpreter()) { - TargetInterpreter interpreter = findInterpreter(); - assertActiveViaInterpreter(obj, interpreter); - } - } - - @Test - public void testActivateEachOnce() throws Throwable { - m.build(); - - TargetFocusScope focusScope = findFocusScope(); - TargetActiveScope activeScope = findActiveScope(); - Set activatable = getActivatableThings(); - for (TargetObject obj : activatable) { - waitOn(activeScope.requestActivation(obj)); - retryVoid(() -> { - assertSuccessorOrExact(obj, focusScope.getFocus()); - }, List.of(AssertionError.class)); - if (m.hasInterpreter()) { - TargetInterpreter interpreter = findInterpreter(); - assertActiveViaInterpreter(obj, interpreter); - } - } - - } - - @Test - public void testActivateEachTwice() throws Throwable { - m.build(); - - TargetFocusScope focusScope = findFocusScope(); - TargetActiveScope activeScope = findActiveScope(); - Set activatable = getActivatableThings(); - for (TargetObject obj : activatable) { - waitOn(activeScope.requestActivation(obj)); - retryVoid(() -> { - assertSuccessorOrExact(obj, focusScope.getFocus()); - }, List.of(AssertionError.class)); - if (m.hasInterpreter()) { - TargetInterpreter interpreter = findInterpreter(); - assertActiveViaInterpreter(obj, interpreter); - } - waitOn(activeScope.requestActivation(obj)); - retryVoid(() -> { - assertSuccessorOrExact(obj, focusScope.getFocus()); - }, List.of(AssertionError.class)); - if (m.hasInterpreter()) { - TargetInterpreter interpreter = findInterpreter(); - assertActiveViaInterpreter(obj, interpreter); - } - } - } - - @Test - public void testActivateEachViaInterpreter() throws Throwable { - assumeTrue(m.hasInterpreter()); - m.build(); - - TargetFocusScope focusScope = findFocusScope(); - Set activatable = getActivatableThings(); - TargetInterpreter interpreter = findInterpreter(); - for (TargetObject obj : activatable) { - activateViaInterpreter(obj, interpreter); - retryVoid(() -> { - assertSuccessorOrExact(obj, focusScope.getFocus()); - }, List.of(AssertionError.class)); - assertActiveViaInterpreter(obj, interpreter); - } - } -} diff --git a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelAttacherTest.java b/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelAttacherTest.java deleted file mode 100644 index 50a97c74b8..0000000000 --- a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelAttacherTest.java +++ /dev/null @@ -1,260 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.test; - -import static org.junit.Assert.*; -import static org.junit.Assume.assumeNotNull; -import static org.junit.Assume.assumeTrue; - -import java.lang.invoke.MethodHandles; -import java.util.Collection; -import java.util.List; -import java.util.concurrent.CompletableFuture; - -import org.junit.Test; - -import ghidra.dbg.AnnotatedDebuggerAttributeListener; -import ghidra.dbg.DebugModelConventions; -import ghidra.dbg.agent.AbstractDebuggerObjectModel; -import ghidra.dbg.agent.DefaultTargetModelRoot; -import ghidra.dbg.error.DebuggerIllegalArgumentException; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetExecutionStateful.TargetExecutionState; -import ghidra.dbg.target.TargetMethod.TargetParameterMap; -import ghidra.program.model.address.AddressFactory; - -public abstract class AbstractDebuggerModelAttacherTest extends AbstractDebuggerModelTest - implements RequiresAttachSpecimen { - - public List getExpectedAttacherPath() { - return null; - } - - public List getExpectedAttachableContainerPath() { - return null; - } - - public abstract TargetParameterMap getExpectedAttachParameters(); - - public abstract void assertEnvironment(TargetEnvironment environment); - - @Test - public void testAttacherIsWhereExpected() throws Throwable { - List expectedAttacherPath = getExpectedAttacherPath(); - assumeNotNull(expectedAttacherPath); - m.build(); - - TargetAttacher attacher = findAttacher(); - assertEquals(expectedAttacherPath, attacher.getPath()); - } - - @Test - public void testAttachableContainerIsWhereExpected() throws Throwable { - List expectedAttachableContainerPath = getExpectedAttachableContainerPath(); - assumeNotNull(expectedAttachableContainerPath); - m.build(); - - TargetObject container = findAttachableContainer(); - assertEquals(expectedAttachableContainerPath, container.getPath()); - } - - protected void runTestListAttachable(TargetObject container) throws Throwable { - DebuggerTestSpecimen specimen = getAttachSpecimen(); - waitAcc(container); - Collection attachables = fetchAttachables(container); - assertNotNull(getAttachable(attachables, specimen, dummy, this)); - } - - @Test - public void testListAttachable() throws Throwable { - DebuggerTestSpecimen specimen = getAttachSpecimen(); - assumeTrue(m.hasAttachableContainer()); - m.build(); - dummy = specimen.runDummy(); - - TargetObject container = findAttachableContainer(); - runTestListAttachable(container); - } - - // TODO: Attacher parameters, when we go that way. - - protected void runTestAttachByPid(TargetAttacher attacher) throws Throwable { - waitAcc(attacher); - waitOn(attacher.attach(dummy.pid)); - } - - @Test - public void testAttachByPid() throws Throwable { - DebuggerTestSpecimen specimen = getAttachSpecimen(); - m.build(); - dummy = specimen.runDummy(); - - var listener = new AnnotatedDebuggerAttributeListener(MethodHandles.lookup()) { - CompletableFuture observedCreated = new CompletableFuture<>(); - - @AttributeCallback(TargetExecutionStateful.STATE_ATTRIBUTE_NAME) - public void stateChanged(TargetObject object, TargetExecutionState state) { - // We're only expecting one process, so this should be fine - TargetProcess process = DebugModelConventions.liveProcessOrNull(object); - if (process == null) { - return; - } - try { - TargetEnvironment env = findEnvironment(process.getPath()); - assertEnvironment(env); - observedCreated.complete(null); - } - catch (Throwable e) { - observedCreated.completeExceptionally(e); - } - } - }; - // NB. I've intentionally omitted the reorderer here. The model should get it right. - m.getModel().addModelListener(listener); - - TargetAttacher attacher = m.find(TargetAttacher.class, List.of()); - runTestAttachByPid(attacher); - waitOn(listener.observedCreated); - } - - protected void runTestAttachByObj(TargetAttacher attacher, TargetObject container) - throws Throwable { - DebuggerTestSpecimen specimen = getAttachSpecimen(); - Collection attachables = fetchAttachables(container); - TargetAttachable target = getAttachable(attachables, specimen, dummy, this); - waitAcc(attacher); - waitOn(attacher.attach(target)); - } - - @Test - public void testAttachByObj() throws Throwable { - DebuggerTestSpecimen specimen = getAttachSpecimen(); - assumeTrue(m.hasAttachableContainer()); - m.build(); - dummy = specimen.runDummy(); - - TargetAttacher attacher = findAttacher(); - TargetObject container = findAttachableContainer(); - runTestAttachByObj(attacher, container); - } - - protected static class BogusObjectModel extends AbstractDebuggerObjectModel { - @Override - public AddressFactory getAddressFactory() { - return null; - } - } - - protected static class BogusTargetAttachable extends DefaultTargetModelRoot - implements TargetAttachable { - public BogusTargetAttachable(AbstractDebuggerObjectModel model) { - super(model, "Bogus"); - } - } - - protected void runTestAttachByObjBogusThrowsException(TargetAttacher attacher) - throws Throwable { - waitAcc(attacher); - BogusObjectModel bogusModel = new BogusObjectModel(); - TargetAttachable bogusAttachable = new BogusTargetAttachable(bogusModel); - waitOn(attacher.attach(bogusAttachable)); - } - - @Test(expected = DebuggerIllegalArgumentException.class) - public void testAttachByObjBogusThrowsException() throws Throwable { - m.build(); - - TargetAttacher attacher = m.find(TargetAttacher.class, List.of()); - runTestAttachByObjBogusThrowsException(attacher); - } - - protected void runTestAttachByPidThenDetach(TargetAttacher attacher) - throws Throwable { - DebuggerTestSpecimen specimen = getAttachSpecimen(); - assertNull(getProcessRunning(specimen, this)); - runTestAttachByPid(attacher); - runTestDetach(specimen); - assertTrue(dummy.process.isAlive()); - } - - @Test - public void testAttachByPidThenDetach() throws Throwable { - DebuggerTestSpecimen specimen = getAttachSpecimen(); - assumeTrue(m.hasDetachableProcesses()); - m.build(); - dummy = specimen.runDummy(); - - TargetAttacher attacher = findAttacher(); - runTestAttachByPidThenDetach(attacher); - } - - protected void runTestAttachByPidThenKill(TargetAttacher attacher) - throws Throwable { - DebuggerTestSpecimen specimen = getAttachSpecimen(); - assertNull(getProcessRunning(specimen, this)); - runTestAttachByPid(attacher); - runTestKill(specimen); - retryVoid(() -> assertFalse(dummy.process.isAlive()), List.of(AssertionError.class)); - } - - @Test - public void testAttachByPidThenKill() throws Throwable { - DebuggerTestSpecimen specimen = getAttachSpecimen(); - assumeTrue(m.hasKillableProcesses()); - m.build(); - dummy = specimen.runDummy(); - - TargetAttacher attacher = findAttacher(); - runTestAttachByPidThenKill(attacher); - } - - protected void runTestAttachByPidThenResumeInterrupt(TargetAttacher attacher) throws Throwable { - DebuggerTestSpecimen specimen = getAttachSpecimen(); - assertNull(getProcessRunning(specimen, this)); - runTestAttachByPid(attacher); - runTestResumeInterruptMany(specimen, 3); - assertTrue(dummy.process.isAlive()); - } - - @Test - public void testAttachByPidThenResumeInterrupt() throws Throwable { - DebuggerTestSpecimen specimen = getAttachSpecimen(); - assumeTrue(m.hasResumableProcesses()); - m.build(); - dummy = specimen.runDummy(); - - TargetAttacher attacher = findAttacher(); - runTestAttachByPidThenResumeInterrupt(attacher); - } - - protected void runTestAttachShowsInProcessContainer(TargetAttacher attacher) throws Throwable { - DebuggerTestSpecimen specimen = getAttachSpecimen(); - assertNull(getProcessRunning(specimen, this)); - runTestAttachByPid(attacher); - retryForProcessRunning(specimen, this); - } - - @Test - public void testAttachShowsInProcessContainer() throws Throwable { - DebuggerTestSpecimen specimen = getAttachSpecimen(); - assumeTrue(m.hasProcessContainer()); - m.build(); - dummy = specimen.runDummy(); - - TargetAttacher attacher = findAttacher(); - runTestAttachShowsInProcessContainer(attacher); - } -} diff --git a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelBreakpointsTest.java b/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelBreakpointsTest.java deleted file mode 100644 index 056d57062a..0000000000 --- a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelBreakpointsTest.java +++ /dev/null @@ -1,619 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.test; - -import static org.junit.Assert.*; -import static org.junit.Assume.assumeNotNull; -import static org.junit.Assume.assumeTrue; - -import java.util.*; -import java.util.Map.Entry; -import java.util.stream.Collectors; - -import org.junit.Test; - -import ghidra.dbg.DebuggerModelListener; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetBreakpointSpec.TargetBreakpointKind; -import ghidra.dbg.target.TargetBreakpointSpecContainer.TargetBreakpointKindSet; -import ghidra.dbg.target.schema.TargetObjectSchema; -import ghidra.dbg.util.DebuggerCallbackReorderer; -import ghidra.program.model.address.AddressRange; -import ghidra.util.Msg; - -/** - * Tests the functionality of breakpoints - * - *

- * Note that this test does not check for nuances regarding specification vs. location, as it is - * meant to generalize across models for interests of the UI only. As such, we only test that we can - * set breakpoints at given addresses and that a location manifests there, regardless of the - * intervening mechanisms. We also test some basic operations on the breakpoint (location) itself. - * Models which have separate specifications from locations, or for which you want to test - * non-address specifications will need to add their own tests, tailored to the semantics of that - * model's breakpoint specifications. - * - *

- * TODO: Enable, disable (if supported), delete (if supported), manipulation via CLI is synced - */ -public abstract class AbstractDebuggerModelBreakpointsTest extends AbstractDebuggerModelTest - implements RequiresTarget { - - /** - * Get the expected (absolute) path of the target's breakpoint container - * - * @param targetPath the path of the target - * @return the expected path, or {@code null} for no assertion - */ - public List getExpectedBreakpointContainerPath(List targetPath) { - return null; - } - - public abstract TargetBreakpointKindSet getExpectedSupportedKinds(); - - public abstract AddressRange getSuitableRangeForBreakpoint(TargetObject target, - TargetBreakpointKind kind) throws Throwable; - - public boolean isSupportsTogglableLocations() { - return false; - } - - public boolean isSupportsDeletableLocations() { - return false; - } - - @Test - public void testBreakpointContainerIsWhereExpected() throws Throwable { - m.build(); - - TargetObject target = obtainTarget(); - List expectedBreakpointContainerPath = - getExpectedBreakpointContainerPath(target.getPath()); - assumeNotNull(expectedBreakpointContainerPath); - TargetBreakpointSpecContainer container = - m.suitable(TargetBreakpointSpecContainer.class, target.getPath()); - assertEquals(expectedBreakpointContainerPath, container.getPath()); - } - - @Test - public void testBreakpointContainerSupportsExpectedKinds() throws Throwable { - m.build(); - - TargetObject target = obtainTarget(); - TargetBreakpointSpecContainer container = - m.suitable(TargetBreakpointSpecContainer.class, target.getPath()); - waitOn(container.fetchAttributes()); - assertEquals(getExpectedSupportedKinds(), container.getSupportedBreakpointKinds()); - } - - @Test - public void testBreakpointsSupportTogglableAsExpected() throws Throwable { - m.build(); - - for (TargetObjectSchema schema : m.getModel() - .getRootSchema() - .getContext() - .getAllSchemas()) { - Set> ifs = schema.getInterfaces(); - if (ifs.contains(TargetBreakpointLocation.class)) { - boolean supportsTogglableLocations = ifs.contains(TargetTogglable.class) && - !ifs.contains(TargetBreakpointSpec.class); - assertEquals(isSupportsTogglableLocations(), supportsTogglableLocations); - } - } - } - - @Test - public void testBreakpointLocationsSupportDeletableAsExpected() throws Throwable { - m.build(); - - for (TargetObjectSchema schema : m.getModel() - .getRootSchema() - .getContext() - .getAllSchemas()) { - Set> ifs = schema.getInterfaces(); - if (ifs.contains(TargetBreakpointLocation.class)) { - boolean supportsDeletableLocations = ifs.contains(TargetDeletable.class) && - !ifs.contains(TargetBreakpointSpec.class); - assertEquals(isSupportsDeletableLocations(), supportsDeletableLocations); - } - } - } - - protected TargetBreakpointLocation assertAtLeastOneLocCovers( - Collection locs, AddressRange range, - TargetBreakpointKind kind) throws Throwable { - for (TargetBreakpointLocation l : locs) { - TargetBreakpointSpec spec = l.getSpecification(); - if (spec == null) { // Mid construction? - continue; - } - AddressRange actualRange = l.getRange(); - if (actualRange == null) { - continue; - } - if (!actualRange.contains(range.getMinAddress()) || - !actualRange.contains(range.getMaxAddress())) { - continue; - } - if (spec.getKinds() == null) { - continue; - } - if (!spec.getKinds().contains(kind)) { - continue; - } - return l; - } - fail("No location covers expected breakpoint"); - return null; - } - - /** - * Verify that the given breakpoint location covers the required range and kind, using the - * interpreter - * - * @param range the requested range of the breakpoint - * @param kind the requested kind of the breakpoint - * @param loc the location object - * @param interpreter the interpreter - * @throws Throwable if anything goes wrong - */ - protected void assertLocCoversViaInterpreter(AddressRange range, - TargetBreakpointKind kind, TargetBreakpointLocation loc, - TargetInterpreter interpreter) throws Throwable { - fail("Unless hasInterpreter is false, the test must implement this method"); - } - - /** - * Verify that the given spec and/or location is in the given state, using the interpreter - * - * @param t the spec or location - * @param enabled the expected state: true for enabled, false for disabled - * @param interpreter the interpreter - * @throws Throwable if anything goes wrong - */ - protected void assertEnabledViaInterpreter(TargetTogglable t, boolean enabled, - TargetInterpreter interpreter) throws Throwable { - fail("Unless hasInterpreter is false, the test must implement this method"); - } - - /** - * Verify that the given spec and/or location no longer exists, using the interpreter - * - * @param d the spec or location - * @param interpreter the interpreter - * @throws Throwable if anything goes wrong - */ - protected void assertDeletedViaInterpreter(TargetDeletable d, TargetInterpreter interpreter) - throws Throwable { - fail("Unless hasInterpreter is false, the test must implement this method"); - } - - /** - * Place the given breakpoint using the interpreter - * - * @param range the requested range - * @param kind the requested kind - * @param interpreter the interpreter - * @throws Throwable if anything goes wrong - */ - protected void placeBreakpointViaInterpreter(AddressRange range, TargetBreakpointKind kind, - TargetInterpreter interpreter) throws Throwable { - fail("Unless hasInterpreter is false, the test must implement this method"); - } - - /** - * Disable the given spec and/or location using the interpreter - * - * @param t the spec and/or location - * @param interpreter the interpreter - * @throws Throwable if anything goes wrong - */ - protected void disableViaInterpreter(TargetTogglable t, TargetInterpreter interpreter) - throws Throwable { - fail("Unless hasInterpreter is false, the test must implement this method"); - } - - /** - * Enable the given spec and/or location using the interpreter - * - * @param t the spec and/or location - * @param interpreter the interpreter - * @throws Throwable if anything goes wrong - */ - protected void enableViaInterpreter(TargetTogglable t, TargetInterpreter interpreter) - throws Throwable { - fail("Unless hasInterpreter is false, the test must implement this method"); - } - - /** - * Delete the given spec and/or location using the interpreter - * - * @param d the spec and/or location - * @param interpreter the interpreter - * @throws Throwable if anything goes wrong - */ - protected void deleteViaInterpreter(TargetDeletable d, TargetInterpreter interpreter) - throws Throwable { - fail("Unless hasInterpreter is false, the test must implement this method"); - } - - protected void addMonitor() { - var monitor = new DebuggerModelListener() { - DebuggerCallbackReorderer reorderer = new DebuggerCallbackReorderer(this); - - @Override - public void created(TargetObject object) { - if (!object.getJoinedPath(".").contains("reak")) { - return; - } - Msg.debug(this, "CREATED " + object.getJoinedPath(".")); - } - - protected String logDisp(Object val) { - if (val == null) { - return ""; // Should never happen - } - if (val instanceof TargetObject) { - TargetObject obj = (TargetObject) val; - return "obj-" + obj.getJoinedPath("."); - } - return val.toString(); - } - - @Override - public void attributesChanged(TargetObject object, Collection removed, - Map added) { - if (!object.getJoinedPath(".").contains("reak")) { - return; - } - Msg.debug(this, - "ATTRIBUTES: object=" + object.getJoinedPath(".") + ",removed=" + removed); - for (Entry ent : added.entrySet()) { - Msg.debug(this, - " ATTR_added: " + ent.getKey() + "=" + logDisp(ent.getValue())); - } - } - - @Override - public void elementsChanged(TargetObject object, Collection removed, - Map added) { - if (!object.getJoinedPath(".").contains("reak")) { - return; - } - Msg.debug(this, - "ELEMENTS: object=" + object.getJoinedPath(".") + ",removed=" + removed); - for (Entry ent : added.entrySet()) { - Msg.debug(this, - " ELEM_added: " + ent.getKey() + "=" + logDisp(ent.getValue())); - } - } - }; - m.getModel().addModelListener(monitor.reorderer, true); - } - - protected void runTestPlaceBreakpoint(TargetBreakpointKind kind) throws Throwable { - assumeTrue(getExpectedSupportedKinds().contains(kind)); - m.build(); - - addMonitor(); - - TargetObject target = obtainTarget(); - TargetBreakpointSpecContainer container = findBreakpointSpecContainer(target.getPath()); - AddressRange range = getSuitableRangeForBreakpoint(target, kind); - waitOn(container.placeBreakpoint(range, Set.of(kind))); - TargetBreakpointLocation loc = retry(() -> { - Collection found = - m.findAll(TargetBreakpointLocation.class, target.getPath(), true).values(); - return assertAtLeastOneLocCovers(found, range, kind); - }, List.of(AssertionError.class)); - if (m.hasInterpreter()) { - TargetInterpreter interpreter = findInterpreter(); - assertLocCoversViaInterpreter(range, kind, loc, interpreter); - } - } - - protected void runTestPlaceBreakpointViaInterpreter(TargetBreakpointKind kind) - throws Throwable { - assumeTrue(getExpectedSupportedKinds().contains(kind)); - assumeTrue(m.hasInterpreter()); - m.build(); - - addMonitor(); - - TargetObject target = obtainTarget(); - TargetInterpreter interpreter = findInterpreter(); - AddressRange range = getSuitableRangeForBreakpoint(target, kind); - placeBreakpointViaInterpreter(range, kind, interpreter); - TargetBreakpointLocation loc = retry(() -> { - Collection found = - m.findAll(TargetBreakpointLocation.class, target.getPath(), true).values(); - return assertAtLeastOneLocCovers(found, range, kind); - }, List.of(AssertionError.class)); - assertLocCoversViaInterpreter(range, kind, loc, interpreter); - } - - @Test - public void testPlaceSoftwareExecuteBreakpoint() throws Throwable { - runTestPlaceBreakpoint(TargetBreakpointKind.SW_EXECUTE); - } - - @Test - public void testPlaceHardwareExecuteBreakpoint() throws Throwable { - runTestPlaceBreakpoint(TargetBreakpointKind.HW_EXECUTE); - } - - @Test - public void testPlaceReadBreakpoint() throws Throwable { - runTestPlaceBreakpoint(TargetBreakpointKind.READ); - } - - @Test - public void testPlaceWriteBreakpoint() throws Throwable { - runTestPlaceBreakpoint(TargetBreakpointKind.WRITE); - } - - @Test - public void testPlaceSoftwareExecuteBreakpointViaInterpreter() throws Throwable { - runTestPlaceBreakpointViaInterpreter(TargetBreakpointKind.SW_EXECUTE); - } - - @Test - public void testPlaceHardwareExecuteBreakpointViaInterpreter() throws Throwable { - runTestPlaceBreakpointViaInterpreter(TargetBreakpointKind.HW_EXECUTE); - } - - @Test - public void testPlaceReadBreakpointViaInterpreter() throws Throwable { - runTestPlaceBreakpointViaInterpreter(TargetBreakpointKind.READ); - } - - @Test - public void testPlaceWriteBreakpointViaInterpreter() throws Throwable { - runTestPlaceBreakpointViaInterpreter(TargetBreakpointKind.WRITE); - } - - protected Set createLocations() throws Throwable { - // TODO: Test with multiple targets? - TargetObject target = obtainTarget(); - TargetBreakpointSpecContainer container = findBreakpointSpecContainer(target.getPath()); - assertNotNull("No breakpoint spec container", container); - Set locs = new HashSet<>(); - for (TargetBreakpointKind kind : getExpectedSupportedKinds()) { - AddressRange range = getSuitableRangeForBreakpoint(target, kind); - waitOn(container.placeBreakpoint(range, Set.of(kind))); - locs.add(retry(() -> { - Collection found = - m.findAll(TargetBreakpointLocation.class, target.getPath(), true).values(); - return assertAtLeastOneLocCovers(found, range, kind); - }, List.of(AssertionError.class))); - } - Msg.debug(this, "Have locations: " + - locs.stream().map(l -> l.getJoinedPath(".")).collect(Collectors.toSet())); - return locs; - } - - protected void runToggleTest(Set set) throws Throwable { - List order = new ArrayList<>(set); - Collections.shuffle(order); - // Disable each - for (TargetTogglable t : order) { - waitOn(t.disable()); - retryVoid(() -> { - assertFalse(t.isEnabled()); - }, List.of(AssertionError.class)); - if (m.hasInterpreter()) { - TargetInterpreter interpreter = findInterpreter(); - assertEnabledViaInterpreter(t, false, interpreter); - } - } - // Repeat it for fun. Should have no effect - for (TargetTogglable t : order) { - waitOn(t.disable()); - retryVoid(() -> { - assertFalse(t.isEnabled()); - }, List.of(AssertionError.class)); - if (m.hasInterpreter()) { - TargetInterpreter interpreter = findInterpreter(); - assertEnabledViaInterpreter(t, false, interpreter); - } - } - - // Enable each - for (TargetTogglable t : order) { - waitOn(t.enable()); - retryVoid(() -> { - assertTrue(t.isEnabled()); - }, List.of(AssertionError.class)); - if (m.hasInterpreter()) { - TargetInterpreter interpreter = findInterpreter(); - assertEnabledViaInterpreter(t, true, interpreter); - } - } - // Repeat it for fun. Should have no effect - for (TargetTogglable t : order) { - waitOn(t.enable()); - retryVoid(() -> { - assertTrue(t.isEnabled()); - }, List.of(AssertionError.class)); - if (m.hasInterpreter()) { - TargetInterpreter interpreter = findInterpreter(); - assertEnabledViaInterpreter(t, true, interpreter); - } - } - } - - protected void runToggleTestViaInterpreter(Set set, - TargetInterpreter interpreter) throws Throwable { - List order = new ArrayList<>(set); - Collections.shuffle(order); - // Disable each - for (TargetTogglable t : order) { - disableViaInterpreter(t, interpreter); - retryVoid(() -> { - assertFalse(t.isEnabled()); - }, List.of(AssertionError.class)); - assertEnabledViaInterpreter(t, false, interpreter); - } - // Repeat it for fun. Should have no effect - for (TargetTogglable t : order) { - disableViaInterpreter(t, interpreter); - retryVoid(() -> { - assertFalse(t.isEnabled()); - }, List.of(AssertionError.class)); - assertEnabledViaInterpreter(t, false, interpreter); - } - - // Enable each - for (TargetTogglable t : order) { - enableViaInterpreter(t, interpreter); - retryVoid(() -> { - assertTrue(t.isEnabled()); - }, List.of(AssertionError.class)); - assertEnabledViaInterpreter(t, true, interpreter); - } - // Repeat it for fun. Should have no effect - for (TargetTogglable t : order) { - enableViaInterpreter(t, interpreter); - retryVoid(() -> { - assertTrue(t.isEnabled()); - }, List.of(AssertionError.class)); - assertEnabledViaInterpreter(t, true, interpreter); - } - } - - @Test - public void testToggleBreakpoints() throws Throwable { - m.build(); - - Set locs = createLocations(); - runToggleTest(locs.stream() - .map(l -> l.getSpecification().as(TargetTogglable.class)) - .collect(Collectors.toSet())); - } - - @Test - public void testToggleBreakpointsViaInterpreter() throws Throwable { - assumeTrue(m.hasInterpreter()); - m.build(); - - Set locs = createLocations(); - TargetInterpreter interpreter = findInterpreter(); - runToggleTestViaInterpreter(locs.stream() - .map(l -> l.getSpecification().as(TargetTogglable.class)) - .collect(Collectors.toSet()), - interpreter); - } - - @Test - public void testToggleBreakpointLocations() throws Throwable { - assumeTrue(isSupportsTogglableLocations()); - m.build(); - - Set locs = createLocations(); - runToggleTest( - locs.stream().map(l -> l.as(TargetTogglable.class)).collect(Collectors.toSet())); - } - - @Test - public void testToggleBreakpointLocationsViaInterpreter() throws Throwable { - assumeTrue(isSupportsTogglableLocations()); - assumeTrue(m.hasInterpreter()); - m.build(); - - Set locs = createLocations(); - TargetInterpreter interpreter = findInterpreter(); - runToggleTestViaInterpreter( - locs.stream().map(l -> l.as(TargetTogglable.class)).collect(Collectors.toSet()), - interpreter); - } - - protected void runDeleteTest(Set set) throws Throwable { - List order = new ArrayList<>(set); - Collections.shuffle(order); - // Delete each - for (TargetDeletable d : order) { - waitOn(d.delete()); - retryVoid(() -> { - assertFalse(d.isValid()); - }, List.of(AssertionError.class)); - if (m.hasInterpreter()) { - TargetInterpreter interpreter = findInterpreter(); - assertDeletedViaInterpreter(d, interpreter); - } - } - } - - protected void runDeleteTestViaInterpreter(Set set, - TargetInterpreter interpreter) throws Throwable { - List order = new ArrayList<>(set); - Collections.shuffle(order); - // Delete each - for (TargetDeletable d : order) { - deleteViaInterpreter(d, interpreter); - retryVoid(() -> { - assertFalse(d.isValid()); - }, List.of(AssertionError.class)); - assertDeletedViaInterpreter(d, interpreter); - } - } - - @Test - public void testDeleteBreakpoints() throws Throwable { - m.build(); - - Set locs = createLocations(); - runDeleteTest(locs.stream() - .map(l -> l.getSpecification().as(TargetDeletable.class)) - .collect(Collectors.toSet())); - } - - @Test - public void testDeleteBreakpointsViaInterpreter() throws Throwable { - assumeTrue(m.hasInterpreter()); - m.build(); - - Set locs = createLocations(); - TargetInterpreter interpreter = findInterpreter(); - runDeleteTestViaInterpreter(locs.stream() - .map(l -> l.getSpecification().as(TargetDeletable.class)) - .collect(Collectors.toSet()), - interpreter); - } - - @Test - public void testDeleteBreakpointLocations() throws Throwable { - assumeTrue(isSupportsDeletableLocations()); - m.build(); - - Set locs = createLocations(); - runDeleteTest( - locs.stream().map(l -> l.as(TargetDeletable.class)).collect(Collectors.toSet())); - } - - @Test - public void testDeleteBreakpointLocationsViaInterpreter() throws Throwable { - assumeTrue(isSupportsDeletableLocations()); - assumeTrue(m.hasInterpreter()); - m.build(); - - TargetInterpreter interpreter = findInterpreter(); - Set locs = createLocations(); - runDeleteTestViaInterpreter( - locs.stream().map(l -> l.as(TargetDeletable.class)).collect(Collectors.toSet()), - interpreter); - } -} diff --git a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelEnvironmentTest.java b/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelEnvironmentTest.java deleted file mode 100644 index 29c1eb021d..0000000000 --- a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelEnvironmentTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.test; - -import java.util.Map; - -import ghidra.dbg.test.AbstractDebuggerModelTest.DebuggerTestSpecimen; - -public abstract class AbstractDebuggerModelEnvironmentTest { - protected void doTestLaunchEnvironment(DebuggerTestSpecimen specimen, - Map expectedEnvironment) { - // TODO: Check that the environment is as expected before PROCESS_CREATED is emitted - // For models without event scope, before TargetProcess gets added. - } -} diff --git a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelFactoryTest.java b/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelFactoryTest.java deleted file mode 100644 index e473942284..0000000000 --- a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelFactoryTest.java +++ /dev/null @@ -1,93 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.test; - -import static org.junit.Assert.*; - -import java.util.HashMap; -import java.util.Map; - -import org.junit.Test; - -import ghidra.dbg.DebugModelConventions.AsyncAccess; -import ghidra.dbg.error.DebuggerModelTerminatingException; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.schema.*; -import ghidra.util.Msg; - -public abstract class AbstractDebuggerModelFactoryTest extends AbstractDebuggerModelTest { - - protected abstract Map getFailingFactoryOptions(); - - @Test - public void testBuildAndClose() throws Throwable { - m.build(); - assertNotNull(m.getModel()); - } - - @Test - public void testBuildFailingOptionsErr() throws Throwable { - for (Map.Entry bad : getFailingFactoryOptions().entrySet()) { - Map options = new HashMap<>(m.getFactoryOptions()); - options.put(bad.getKey(), bad.getValue()); - try { - m.buildModel(options); - fail(); - } - catch (Exception ex) { - if (!DebuggerModelTerminatingException.isIgnorable(ex)) { - throw ex; - } - // Pass - } - } - } - - @Test - public void testPing() throws Throwable { - m.build(); - waitOn(m.getModel().ping("Hello, Ghidra Async Debugging!")); - } - - @Test - public void testWaitRootAccess() throws Throwable { - m.build(); - - TargetObject root = m.getRoot(); - AsyncAccess access = access(root); - waitAcc(access); - } - - @Test - public void testHasNonEnumerableRootSchema() throws Throwable { - m.build(); - - TargetObjectSchema rootSchema = m.getModel().getRootSchema(); - Msg.info(this, rootSchema.getContext()); - Msg.info(this, XmlSchemaContext.serialize(rootSchema.getContext())); - assertFalse(rootSchema instanceof EnumerableTargetObjectSchema); - } - - @Test - public void testNonExistentPathGivesNull() throws Throwable { - m.build(); - - TargetObject root = m.getRoot(); - waitAcc(root); - TargetObject noExist = waitOn(root.fetchSuccessor(m.getBogusPath())); - assertNull(noExist); - } -} diff --git a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelInterpreterTest.java b/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelInterpreterTest.java deleted file mode 100644 index 9f643afb1b..0000000000 --- a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelInterpreterTest.java +++ /dev/null @@ -1,265 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.test; - -import static org.junit.Assert.*; -import static org.junit.Assume.assumeNotNull; -import static org.junit.Assume.assumeTrue; - -import java.util.List; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import org.junit.Test; - -import ghidra.async.AsyncReference; -import ghidra.dbg.DebugModelConventions; -import ghidra.dbg.DebuggerModelListener; -import ghidra.dbg.error.DebuggerModelTerminatingException; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetConsole.Channel; -import ghidra.dbg.testutil.CatchOffThread; -import ghidra.util.Msg; - -public abstract class AbstractDebuggerModelInterpreterTest extends AbstractDebuggerModelTest - implements RequiresAttachSpecimen, RequiresLaunchSpecimen { - - /** - * Get the path of the expected result of {@link #findInterpreter()} for this test - * - * @return the expected path - */ - public List getExpectedInterpreterPath() { - return null; - } - - /** - * Get the CLI command to echo a string back - * - * @param msg the message to echo - * @return the command - */ - protected abstract String getEchoCommand(String msg); - - /** - * If applicable, get the CLI command to terminate the session / model - * - * @return the command - */ - protected abstract String getQuitCommand(); - - /** - * Get the CLI command to attach to the {@link #dummy} process - * - * @return the command - */ - protected abstract String getAttachCommand(); - - /** - * Get the CLI command to detach from the given process - * - *

- * Note that the given process should already be the current/active process of the interpreter, - * so the parameter may not be needed. - * - * @param process the process to detach from, which should already be active - * @return the command - */ - protected abstract String getDetachCommand(TargetProcess process); - - /** - * Get the CLI command to kill the given process - * - *

- * Note that the given process should already be the current/active process of the interpreter, - * so the parameter may not be needed. - * - * @param process the process to kill, which should already be active - * @return the command - */ - protected abstract String getKillCommand(TargetProcess process); - - /** - * Perform an pre-test actions to ensure an interpreter exists where expected - * - *

- * The model will have been built already. This method is invoked immediately preceding - * {@link #findInterpreter()} - * - * @throws Throwable if anything goes wrong - */ - protected void ensureInterpreterAvailable() throws Throwable { - } - - @Test - public void testInterpreterIsWhereExpected() throws Throwable { - List expectedInterpreterPath = getExpectedInterpreterPath(); - assumeNotNull(expectedInterpreterPath); - m.build(); - - ensureInterpreterAvailable(); - TargetInterpreter interpreter = findInterpreter(); - assertEquals(expectedInterpreterPath, interpreter.getPath()); - } - - protected void runTestExecute(TargetInterpreter interpreter, String cmd) throws Throwable { - AsyncReference lastOut = new AsyncReference<>(); - DebuggerModelListener l = new DebuggerModelListener() { - @Override - public void consoleOutput(TargetObject object, Channel channel, byte[] out) { - if (object != interpreter) { - return; - } - String str = new String(out); - Msg.debug(this, "Got " + channel + " output: " + str); - for (String line : str.split("\n")) { - lastOut.set(line.trim(), null); - } - } - }; - interpreter.getModel().addModelListener(l); - waitAcc(interpreter); - waitOn(interpreter.execute(cmd)); - waitOn(lastOut.waitValue("test")); - } - - @Test - public void testExecute() throws Throwable { - String cmd = getEchoCommand("test"); - assumeNotNull(cmd); - m.build(); - - ensureInterpreterAvailable(); - TargetInterpreter interpreter = findInterpreter(); - runTestExecute(interpreter, cmd); - } - - protected void runTestExecuteCapture(TargetInterpreter interpreter, String cmd) - throws Throwable { - waitAcc(interpreter); - try (CatchOffThread off = new CatchOffThread()) { - DebuggerModelListener l = new DebuggerModelListener() { - @Override - public void consoleOutput(TargetObject object, Channel channel, byte[] out) { - if (object != interpreter) { - return; - } - String str = new String(out); - Msg.debug(this, "Got " + channel + " output: " + str); - if (!str.contains("test")) { - return; - } - off.catching(() -> fail("Unexpected output:" + str)); - } - }; - interpreter.getModel().addModelListener(l); - waitAcc(interpreter); - String out = waitOn(interpreter.executeCapture(cmd)); - // Not the greatest, but allow extra lines - List lines = - Stream.of(out.split("\n")).map(s -> s.trim()).collect(Collectors.toList()); - assertTrue(lines.contains("test")); - } - } - - @Test - public void testExecuteCapture() throws Throwable { - String cmd = getEchoCommand("test"); - assumeNotNull(cmd); - m.build(); - - ensureInterpreterAvailable(); - TargetInterpreter interpreter = findInterpreter(); - runTestExecuteCapture(interpreter, cmd); - } - - /** - * Test that the user quitting via the CLI properly terminates the model - * - * @throws Throwable expected since the model will terminate - */ - @Test(expected = DebuggerModelTerminatingException.class) - public void testExecuteQuit() throws Throwable { - String cmd = getQuitCommand(); - assumeNotNull(cmd); - m.build(); - - ensureInterpreterAvailable(); - TargetInterpreter interpreter = findInterpreter(); - runTestExecute(interpreter, cmd); - } - - protected TargetProcess runTestLaunchViaInterpreterShowsInProcessContainer( - TargetInterpreter interpreter) throws Throwable { - DebuggerTestSpecimen specimen = getLaunchSpecimen(); - assertNull(getProcessRunning(specimen, this)); - for (String line : specimen.getLaunchScript()) { - waitOn(interpreter.execute(line)); - } - return retryForProcessRunning(specimen, this); - } - - protected void runTestKillViaInterpreter(TargetProcess process, TargetInterpreter interpreter) - throws Throwable { - waitOn(interpreter.execute(getKillCommand(process))); - retryVoid(() -> { - assertFalse(DebugModelConventions.isProcessAlive(process)); - }, List.of(AssertionError.class)); - } - - @Test - public void testLaunchViaInterpreterShowsInProcessContainer() throws Throwable { - assumeTrue(m.hasProcessContainer()); - m.build(); - - ensureInterpreterAvailable(); - TargetInterpreter interpreter = findInterpreter(); - TargetProcess process = runTestLaunchViaInterpreterShowsInProcessContainer(interpreter); - - runTestKillViaInterpreter(process, interpreter); - } - - protected TargetProcess runTestAttachViaInterpreterShowsInProcessContainer( - TargetInterpreter interpreter) throws Throwable { - DebuggerTestSpecimen specimen = getAttachSpecimen(); - assertNull(getProcessRunning(specimen, this)); - String cmd = getAttachCommand(); - waitOn(interpreter.execute(cmd)); - return retryForProcessRunning(specimen, this); - } - - protected void runTestDetachViaInterpreter(TargetProcess process, TargetInterpreter interpreter) - throws Throwable { - waitOn(interpreter.execute(getDetachCommand(process))); - retryVoid(() -> { - assertFalse(DebugModelConventions.isProcessAlive(process)); - }, List.of(AssertionError.class)); - } - - @Test - public void testAttachViaInterpreterShowsInProcessContainer() throws Throwable { - DebuggerTestSpecimen specimen = getAttachSpecimen(); - assumeTrue(m.hasProcessContainer()); - m.build(); - dummy = specimen.runDummy(); - - ensureInterpreterAvailable(); - TargetInterpreter interpreter = findInterpreter(); - TargetProcess process = runTestAttachViaInterpreterShowsInProcessContainer(interpreter); - - runTestDetachViaInterpreter(process, interpreter); - } -} diff --git a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelLauncherTest.java b/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelLauncherTest.java deleted file mode 100644 index 0628b5b1dc..0000000000 --- a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelLauncherTest.java +++ /dev/null @@ -1,180 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.test; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; -import static org.junit.Assume.assumeNotNull; -import static org.junit.Assume.assumeTrue; - -import java.lang.invoke.MethodHandles; -import java.util.List; -import java.util.concurrent.CompletableFuture; - -import org.junit.Test; - -import ghidra.dbg.AnnotatedDebuggerAttributeListener; -import ghidra.dbg.DebugModelConventions; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetExecutionStateful.TargetExecutionState; -import ghidra.dbg.target.TargetMethod.TargetParameterMap; - -public abstract class AbstractDebuggerModelLauncherTest extends AbstractDebuggerModelTest - implements RequiresLaunchSpecimen { - - protected class ProcessCreatedDebugModelListener extends AnnotatedDebuggerAttributeListener { - public final CompletableFuture observedCreated = new CompletableFuture<>(); - - public ProcessCreatedDebugModelListener() { - super(MethodHandles.lookup()); - } - - @AttributeCallback(TargetExecutionStateful.STATE_ATTRIBUTE_NAME) - public void stateChanged(TargetObject object, TargetExecutionState state) { - // We're only expecting one process, so this should be fine - TargetProcess process = DebugModelConventions.liveProcessOrNull(object); - if (process == null) { - return; - } - try { - TargetEnvironment env = findEnvironment(process.getPath()); - assertEnvironment(env); - observedCreated.complete(null); - } - catch (Throwable e) { - observedCreated.completeExceptionally(e); - } - } - } - - public List getExpectedLauncherPath() { - return null; - } - - public abstract TargetParameterMap getExpectedLauncherParameters(); - - public abstract void assertEnvironment(TargetEnvironment environment); - - @Test - public void testLauncherIsWhereExpected() throws Throwable { - List expectedLauncherPath = getExpectedLauncherPath(); - assumeNotNull(expectedLauncherPath); - m.build(); - - TargetLauncher launcher = findLauncher(); - assertEquals(expectedLauncherPath, launcher.getPath()); - } - - protected void runTestLaunchParameters(TargetLauncher launcher, - TargetParameterMap expectedParameters) throws Throwable { - waitAcc(launcher); - waitOn(launcher.fetchAttributes()); - assertEquals(expectedParameters, launcher.getParameters()); - } - - @Test - public void testLaunchParameters() throws Throwable { - TargetParameterMap expectedParameters = getExpectedLauncherParameters(); - assumeNotNull(expectedParameters); - m.build(); - - TargetLauncher launcher = findLauncher(); - runTestLaunchParameters(launcher, expectedParameters); - } - - protected void runTestLaunch(TargetLauncher launcher) throws Throwable { - DebuggerTestSpecimen specimen = getLaunchSpecimen(); - waitAcc(launcher); - waitOn(launcher.launch(specimen.getLauncherArgs())); - } - - @Test - public void testLaunch() throws Throwable { - m.build(); - - ProcessCreatedDebugModelListener listener = new ProcessCreatedDebugModelListener(); - // NB. I've intentionally omitted the reorderer here. The model should get it right. - m.getModel().addModelListener(listener); - - TargetLauncher launcher = findLauncher(); - runTestLaunch(launcher); - waitOn(listener.observedCreated); - } - - protected void runTestLaunchThenDetach(TargetLauncher launcher) throws Throwable { - DebuggerTestSpecimen specimen = getLaunchSpecimen(); - assertNull(getProcessRunning(specimen, this)); - runTestLaunch(launcher); - runTestDetach(specimen); - } - - @Test - public void testLaunchThenDetach() throws Throwable { - assumeTrue(m.hasDetachableProcesses()); - m.build(); - - TargetLauncher launcher = findLauncher(); - runTestLaunchThenDetach(launcher); - } - - protected void runTestLaunchThenKill(TargetLauncher launcher) throws Throwable { - DebuggerTestSpecimen specimen = getLaunchSpecimen(); - assertNull(getProcessRunning(specimen, this)); - runTestLaunch(launcher); - runTestKill(specimen); - } - - @Test - public void testLaunchThenKill() throws Throwable { - assumeTrue(m.hasKillableProcesses()); - m.build(); - - TargetLauncher launcher = findLauncher(); - runTestLaunchThenKill(launcher); - } - - protected void runTestLaunchThenResume(TargetLauncher launcher) throws Throwable { - DebuggerTestSpecimen specimen = getLaunchSpecimen(); - assertNull(getProcessRunning(specimen, this)); - runTestLaunch(launcher); - runTestResumeTerminates(specimen); - } - - @Test - public void testLaunchThenResume() throws Throwable { - assumeTrue(m.hasKillableProcesses()); - m.build(); - - TargetLauncher launcher = findLauncher(); - runTestLaunchThenResume(launcher); - } - - protected void runTestLaunchShowsInProcessContainer(TargetLauncher launcher) throws Throwable { - DebuggerTestSpecimen specimen = getLaunchSpecimen(); - assertNull(getProcessRunning(specimen, this)); - runTestLaunch(launcher); - retryForProcessRunning(specimen, this); - } - - @Test - public void testLaunchShowsInProcessContainer() throws Throwable { - assumeTrue(m.hasProcessContainer()); - m.build(); - - TargetLauncher launcher = findLauncher(); - runTestLaunchShowsInProcessContainer(launcher); - } -} diff --git a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelMultiprocessTest.java b/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelMultiprocessTest.java deleted file mode 100644 index 5c62e9d6a7..0000000000 --- a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelMultiprocessTest.java +++ /dev/null @@ -1,32 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.test; - -/** - * TODO: We need more tests to verify that commands affect the specified thing. - * Some models seem to just use the "current," which is usually correct - * in practice because of focus syncing, but it may not be, esp., if the user is - * scripting. In particular, when it comes to actions on processes and threads: - * - *

    - *
  • Process.kill
  • - *
  • Process.detach
  • - *
  • Thread.step
  • - *
- */ -public class AbstractDebuggerModelMultiprocessTest { - -} diff --git a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelRegistersTest.java b/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelRegistersTest.java deleted file mode 100644 index bc29621753..0000000000 --- a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelRegistersTest.java +++ /dev/null @@ -1,234 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.test; - -import static org.junit.Assert.*; -import static org.junit.Assume.assumeNotNull; - -import java.math.BigInteger; -import java.util.*; -import java.util.Map.Entry; - -import org.junit.Test; - -import ghidra.dbg.target.*; -import ghidra.dbg.target.schema.TargetObjectSchema; - -/** - * Tests the functionality of a register bank - * - *

- * Note that multiple sub-cases of this test can be generated to separate - * testing various types of registers. E.g., one for user registers, one for - * control registers, another for vector registers, etc. The model developer - * should be thorough, and decide how best to break the tests down, depending on - * the mechanism the model uses to read and/or write to each set. Even if - * different cases are not used, the total register set should exercise all the - * various register types. - */ -public abstract class AbstractDebuggerModelRegistersTest extends AbstractDebuggerModelTest - implements RequiresTarget { - - /** - * Get the expected (absolute) path of the target's (inner-most) register - * bank - * - * @param threadPath the path of the target (usually a thread) - * @return the expected path, or {@code null} for no assertion - */ - public List getExpectedRegisterBankPath(List threadPath) { - return null; - } - - /** - * This has been a popular convention, and may soon become required - * - *

- * Background: Technically, the descriptions (register container) can be - * higher up the model tree, e.g., to apply to an entire process, rather - * than to specific threads. Of course, this might imply all threads have - * the same set of registers. That assumption seems intuitive, but on some - * platforms, e.g., dbgeng with WoW64, some threads may only have the 32-bit - * registers available. Even then, a process could present two register - * containers, one for the 64-bit and one for the 32-bit registers, - * assigning the bank's {@link TargetRegisterBank#getDescriptions()} - * attribute accordingly. - * - *

- * However, none of that really matters if you choose the - * banks-are-containers convention. The primary motivation for doing this is - * to present register values as attributes in the tree. This makes them - * accessible from the "Objects" window of the UI, which is significant, - * because using the "Registers" window requires the target be recorded into - * a trace. Thus, if this test detects that the model's - * {@link TargetRegisterBank}s are also {@link TargetRegisterContainer}s, - * then this method must return true, and it will further verify the - * {@link TargetObject#getValue()} attribute of each register object - * correctly reports the same values as - * {@link TargetRegisterBank#readRegistersNamed(Collection)}. TODO: - * Currently the value is given as a string, encoding the value in base-16. - * I'd rather it were a byte array. - * - * @return true if the convention is expected and should be tested, false if - * not - */ - public boolean isRegisterBankAlsoContainer() { - return true; - } - - /** - * Get the values to write to the registers - * - *

- * This collection is used for validation in other tests. The descriptions - * are validated to have lengths consistent with the written values, and the - * read values are expected to have lengths equal to the written values. - * - * @return the name-value map to write, and use for validation - */ - public abstract Map getRegisterWrites(); - - /** - * This various slightly from the usual find pattern, since we attempt to - * find any thread first - * - * @param seedPath the path to the target or thread - * @return the bank, or {@code null} if one cannot be uniquely identified in - * a thread, or the target - * @throws Throwable if anything goes wrong - */ - protected TargetRegisterBank findRegisterBank(List seedPath) throws Throwable { - return m.findWithIndex(TargetRegisterBank.class, "0", seedPath); - } - - /** - * @param seedPath the path to the target or thread - * @return the set of banks - * @throws Throwable if anything goes wrong - */ - protected Map, TargetRegisterBank> findRegisterBanks(List seedPath) throws Throwable { - return m.findAll(TargetRegisterBank.class, seedPath, true); - } - - @Test - public void testRegisterBankIsWhereExpected() throws Throwable { - m.build(); - - TargetObject target = maybeSubstituteThread(obtainTarget()); - List expectedRegisterBankPath = - getExpectedRegisterBankPath(target.getPath()); - assumeNotNull(expectedRegisterBankPath); - - TargetRegisterBank bank = findRegisterBank(target.getPath()); - assertEquals(expectedRegisterBankPath, bank.getPath()); - } - - @Test - public void testBanksAreContainersConventionIsAsExpected() throws Throwable { - m.build(); - - boolean banksAreContainers = true; - for (TargetObjectSchema schema : m.getModel() - .getRootSchema() - .getContext() - .getAllSchemas()) { - if (schema.getInterfaces().contains(TargetRegisterBank.class)) { - banksAreContainers &= - schema.getInterfaces().contains(TargetRegisterContainer.class); - } - } - assertEquals(isRegisterBankAlsoContainer(), banksAreContainers); - } - - @Test - public void testRegistersHaveExpectedSizes() throws Throwable { - m.build(); - - TargetObject target = maybeSubstituteThread(obtainTarget()); - TargetRegisterBank bank = m.findWithIndex(TargetRegisterBank.class, "0", target.getPath()); - TargetObject descriptions = bank.getDescriptions(); - for (Entry ent : getRegisterWrites().entrySet()) { - String regName = ent.getKey(); - TargetRegister reg = - m.findWithIndex(TargetRegister.class, regName, descriptions.getPath()); - assertEquals(ent.getValue().length, (reg.getBitLength() + 7) / 8); - } - } - - // TODO: Test cases for writing to non-existing registers (by name) - - @Test - public void testReadRegisters() throws Throwable { - m.build(); - - TargetObject target = maybeSubstituteThread(obtainTarget()); - TargetRegisterBank bank = m.findWithIndex(TargetRegisterBank.class, "0", target.getPath()); - Map exp = getRegisterWrites(); - Map read = waitOn(bank.readRegistersNamed(exp.keySet())); - assertEquals("Not all registers were read, or extras were read", exp.keySet(), - read.keySet()); - - // NB. The specimen is not expected to control the register values. Just validate lengths - for (String name : exp.keySet()) { - assertEquals(exp.get(name).length, read.get(name).length); - } - - if (!isRegisterBankAlsoContainer()) { - return; // pass - } - - for (String name : exp.keySet()) { - expectRegisterObjectValue(bank, name, read.get(name)); - } - } - - protected void expectRegisterObjectValue(TargetRegisterBank bank, String name, byte[] value) - throws Throwable { - retryVoid(() -> { - TargetRegister reg = m.findWithIndex(TargetRegister.class, name, bank.getPath()); - assertNotNull(reg); - String actualHex = (String) reg.getValue(); - assertNotNull(actualHex); - assertEquals(new BigInteger(1, value), new BigInteger(actualHex, 16)); - }, List.of(AssertionError.class)); - } - - @Test - public void testWriteRegisters() throws Throwable { - m.build(); - - TargetObject target = maybeSubstituteThread(obtainTarget()); - TargetRegisterBank bank = m.findWithIndex(TargetRegisterBank.class, "0", target.getPath()); - Map write = getRegisterWrites(); - waitOn(bank.writeRegistersNamed(write)); - // NB. This only really tests the cache, if applicable. A scenario checks for efficacy. - Map read = waitOn(bank.readRegistersNamed(write.keySet())); - assertEquals("Not all registers were read, or extras were read", write.keySet(), - read.keySet()); - - for (String name : write.keySet()) { - assertArrayEquals(write.get(name), read.get(name)); - } - - if (!isRegisterBankAlsoContainer()) { - return; // pass - } - - for (String name : write.keySet()) { - expectRegisterObjectValue(bank, name, read.get(name)); - } - } -} diff --git a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelScenarioCloneExitTest.java b/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelScenarioCloneExitTest.java deleted file mode 100644 index 03ca83ccb5..0000000000 --- a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelScenarioCloneExitTest.java +++ /dev/null @@ -1,157 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.test; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import java.lang.invoke.MethodHandles; -import java.util.*; - -import org.junit.Test; - -import ghidra.dbg.AnnotatedDebuggerAttributeListener; -import ghidra.dbg.DebugModelConventions; -import ghidra.dbg.DebugModelConventions.AsyncState; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetBreakpointSpec.TargetBreakpointKind; -import ghidra.dbg.target.TargetExecutionStateful.TargetExecutionState; -import ghidra.util.Msg; - -/** - * A scenario which tests a single process with two threads - */ -public abstract class AbstractDebuggerModelScenarioCloneExitTest extends AbstractDebuggerModelTest { - /** - * Time to wait to observe the child from the clone before resuming again - */ - public static final long WAIT_FOR_CHILD_MS = 1000; - - /** - * This specimen must clone or similar, and then both parent and child must exit immediately - * - *

- * They may optionally print information, but they cannot spin, sleep, or otherwise hang around. - * - * @return the specimen - */ - protected abstract DebuggerTestSpecimen getSpecimen(); - - /** - * Perform whatever preparation is necessary to ensure the child will remain attached and be - * trapped upon its being clone from its parent - * - *

- * If this cannot be done without a handle to the parent process, override - * {@link #postLaunch(TargetObject, TargetProcess)} instead. - * - * @param launcher the launcher - * @throws Throwable if anything goes wrong - */ - protected void preLaunch(TargetLauncher launcher) throws Throwable { - } - - /** - * Perform whatever preparation is necessary to ensure the child will remain attached and be - * trapped upon its being cloned from its parent - * - *

- * For most debuggers, no special setup is necessary. - * - * @param process the process trapped at launch -- typically at {@code main()}. - * @throws Throwable if anything goes wrong - */ - protected void postLaunch(TargetProcess process) throws Throwable { - } - - /** - * Get a breakpoint expression that will trap both threads post-clone - * - * @return the expression - */ - protected abstract String getBreakpointExpression(); - - /** - * Test the following scenario: - * - *

    - *
  1. Obtain a launcher and use it to start the specimen
  2. - *
  3. Place a breakpoint on the new process
  4. - *
  5. Resume the process until it is TERMINATED
  6. - *
  7. Verify exactly two unique threads were trapped by the breakpoint
  8. - *
- * - *

- * Note because some platforms, notably Windows, may produce additional threads before executing - * {@code main}, we cannot simply count THREAD_CREATED events. We mitigate this by using a - * breakpoint which should only trap threads executing user code. Note that we do not verify - * which thread is trapped first, since we do not control thread scheduling. - */ - @Test - public void testScenario() throws Throwable { - DebuggerTestSpecimen specimen = getSpecimen(); - m.build(); - - List trapped = new ArrayList<>(); - var monitor = new AnnotatedDebuggerAttributeListener(MethodHandles.lookup()) { - // For model developer diagnostics - @AttributeCallback(TargetExecutionStateful.STATE_ATTRIBUTE_NAME) - private void stateChanged(TargetObject obj, TargetExecutionState state) { - Msg.debug(this, obj.getJoinedPath(".") + " is now " + state); - } - - @Override - public void breakpointHit(TargetObject container, TargetObject thread, - TargetStackFrame frame, TargetBreakpointSpec spec, - TargetBreakpointLocation breakpoint) { - Msg.debug(this, thread.getJoinedPath(".") + " trapped by " + - breakpoint.getJoinedPath(".") + " (" + spec.getExpression() + ")"); - if (spec.getExpression().equals(getBreakpointExpression())) { - Msg.debug(this, " Counted"); - trapped.add(thread); - } - } - }; - m.getModel().addModelListener(monitor); - - TargetLauncher launcher = findLauncher(); - preLaunch(launcher); - Msg.debug(this, "Launching " + specimen); - waitOn(launcher.launch(specimen.getLauncherArgs())); - Msg.debug(this, " Done launching"); - TargetProcess process = retryForProcessRunning(specimen, this); - postLaunch(process); - TargetBreakpointSpecContainer bpContainer = - findBreakpointSpecContainer(process.getPath()); - Msg.debug(this, "Placing breakpoint"); - waitOn(bpContainer.placeBreakpoint(getBreakpointExpression(), - Set.of(TargetBreakpointKind.SW_EXECUTE))); - - assertTrue(DebugModelConventions.isProcessAlive(process)); - AsyncState state = - new AsyncState(m.suitable(TargetExecutionStateful.class, process.getPath())); - - for (int i = 1; DebugModelConventions.isProcessAlive(process); i++) { - Msg.debug(this, "(" + i + ") Resuming process until terminated"); - resume(process); - Msg.debug(this, " Done " + i); - waitOn(state.waitUntil(s -> s != TargetExecutionState.RUNNING)); - } - - assertEquals(2, trapped.size()); - assertEquals(2, Set.copyOf(trapped).size()); - } -} diff --git a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelScenarioForkExitTest.java b/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelScenarioForkExitTest.java deleted file mode 100644 index 8ea92e69d9..0000000000 --- a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelScenarioForkExitTest.java +++ /dev/null @@ -1,256 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.test; - -import static org.junit.Assert.*; - -import java.lang.invoke.MethodHandles; -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import org.junit.Test; - -import ghidra.dbg.AnnotatedDebuggerAttributeListener; -import ghidra.dbg.DebugModelConventions; -import ghidra.dbg.DebugModelConventions.AsyncState; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetBreakpointSpec.TargetBreakpointKind; -import ghidra.dbg.target.TargetEventScope.TargetEventType; -import ghidra.dbg.target.TargetExecutionStateful.TargetExecutionState; -import ghidra.util.Msg; - -/** - * A scenario which tests multiple processes -- a child forked from a parent. The debugger must - * become attached to both. If the debugger does not support attaching to the child, while remaining - * attached to the parent as well, then this scenario cannot be applied to test it. - */ -public abstract class AbstractDebuggerModelScenarioForkExitTest extends AbstractDebuggerModelTest { - /** - * Time to wait to observe the child from the fork before resuming again - */ - public static final long WAIT_FOR_CHILD_MS = 1000; - - /** - * This specimen must fork or similar, and then both parent and child must exit immediately - * - *

- * They may optionally print information, but they cannot spin, sleep, or otherwise hang around. - * For platforms without {@code fork()}, e.g., Windows, the nearest equivalent behavior should - * be performed, e.g., roughly {@code CreateProcess("SameSpecimen.exe /child")}. - * - * @return the specimen - */ - protected abstract DebuggerTestSpecimen getSpecimen(); - - /** - * Perform whatever preparation is necessary to ensure the child will remain attached and be - * trapped upon its being forked from its parent - * - *

- * If this cannot be done without a handle to the parent process, override - * {@link #postLaunch(TargetObject, TargetProcess)} instead. - * - * @param launcher the launcher - * @throws Throwable if anything goes wrong - */ - protected void preLaunch(TargetLauncher launcher) throws Throwable { - } - - /** - * Perform whatever preparation is necessary to ensure the child will remain attached and be - * trapped upon its being forked from its parent - * - * @param parentProcess the parent process - * @throws Throwable if anything goes wrong - */ - protected void postLaunch(TargetProcess parentProcess) throws Throwable { - } - - protected void postFork(TargetProcess parentProcess, TargetProcess childProcess) - throws Throwable { - } - - /** - * Get a breakpoint expression that will trap the parent post-fork - * - *

- * Ideally, this same expression will trap the child post-fork as well. Note this test presumes - * the child will be trapped by the debugger upon fork. See - * {@link #getChildBreakpointExpression()} - * - * @return the expression - */ - protected abstract String getParentBreakpointExpression(); - - /** - * Get a breakpoint expression that will trap the child post-fork - * - *

- * If breakpoints are not passed from parent to child, the test will need to set a breakpoint to - * trap the child. Override this with a suitable expression, if needed. - * - * @return the expression - */ - protected String getChildBreakpointExpression() { - return null; - } - - /** - * This is invoked for both the launch of the specimen and upon fork - * - *

- * Because one is forked from the other, we should expect to see the same environment attributes - * for both processes. That said, if a tester does need to distinguish, and please - * think carefully about whether or not you should, you can examine the environment's path to - * determine which process it applies to. - * - * @param environment the environment at the time the process became alive - */ - public abstract void assertEnvironment(TargetEnvironment environment); - - /** - * Test the following scenario: - * - *

    - *
  1. Obtain a launcher and use it to start the specimen
  2. - *
  3. Place a breakpoint on the new (parent) process
  4. - *
  5. Resume the process until the fork is observed, generating the child process
  6. - *
  7. Verify both processes are ALIVE
  8. - *
  9. Resume the parent process until it is TERMINATED
  10. - *
  11. Verify the child process is still ALIVE
  12. - *
  13. Resume the child process until it is TERMIANTED
  14. - *
- */ - @Test - public void testScenario() throws Throwable { - DebuggerTestSpecimen specimen = getSpecimen(); - m.build(); - - var stateMonitor = new AnnotatedDebuggerAttributeListener(MethodHandles.lookup()) { - Set observed = new HashSet<>(); - CompletableFuture observedParent = new CompletableFuture<>(); - CompletableFuture observedChild = new CompletableFuture<>(); - List> futures = - List.of(observedParent, observedChild); - - @AttributeCallback(TargetExecutionStateful.STATE_ATTRIBUTE_NAME) - private void stateChanged(TargetObject obj, TargetExecutionState state) { - Msg.debug(this, "STATE: " + obj.getJoinedPath(".") + " is now " + state); - - TargetProcess process = DebugModelConventions.liveProcessOrNull(obj); - if (process == null) { - return; - } - - CompletableFuture f = futures.get(observed.size()); - if (observed.add(process)) { - try { - TargetEnvironment env = findEnvironment(process.getPath()); - assertEnvironment(env); - f.complete(process); - } - catch (Throwable e) { - f.completeExceptionally(e); - } - } - } - - @Override - public void event(TargetObject object, TargetThread eventThread, - TargetEventType type, String description, List parameters) { - Msg.debug(this, "EVENT: " + object.getJoinedPath(".") + " emitted " + type + - "(desc=" + description + ",params=" + parameters + ")"); - } - }; - m.getModel().addModelListener(stateMonitor); - - TargetLauncher launcher = findLauncher(); - preLaunch(launcher); - Msg.debug(this, "Launching " + specimen); - waitOn(launcher.launch(specimen.getLauncherArgs())); - Msg.debug(this, " Done launching"); - TargetProcess parentProcess = waitOn(stateMonitor.observedParent); - Msg.debug(this, "Parent is " + parentProcess.getJoinedPath(".")); - postLaunch(parentProcess); - - AsyncState parentState = - new AsyncState(m.suitable(TargetExecutionStateful.class, parentProcess.getPath())); - waitOn(parentState.waitValue(TargetExecutionState.STOPPED)); - - placeBreakpoint("parent", parentProcess, getParentBreakpointExpression()); - - TargetProcess childProcess = null; - for (int i = 1; childProcess == null; i++) { - Msg.debug(this, "(" + i + ") Resuming until fork"); - resume(parentProcess); - Msg.debug(this, " Done " + i); - waitAcc(access(parentProcess)); - try { - childProcess = retryForOtherProcessRunning(specimen, this, - p -> p != parentProcess, WAIT_FOR_CHILD_MS); - } - catch (AssertionError e) { - // Try resuming again - } - } - Msg.debug(this, "Child is " + childProcess.getJoinedPath(".")); - assertNotSame(parentProcess, childProcess); - assertNotEquals(parentProcess, childProcess); - assertSame(childProcess, waitOn(stateMonitor.observedChild)); - - assertTrue(DebugModelConventions.isProcessAlive(parentProcess)); - AsyncState childState = - new AsyncState(m.suitable(TargetExecutionStateful.class, childProcess.getPath())); - waitOn(parentState.waitUntil(s -> s == TargetExecutionState.STOPPED)); - postFork(parentProcess, childProcess); - - placeChildBreakpoint(childProcess); - - for (int i = 1; DebugModelConventions.isProcessAlive(parentProcess); i++) { - Msg.debug(this, "(" + i + ") Resuming parent until terminated"); - resume(parentProcess); - Msg.debug(this, " Done " + i); - TargetExecutionState state = - waitOn(parentState.waitUntil(s -> s != TargetExecutionState.RUNNING)); - Msg.debug(this, "Parent state after resume-wait-not-running: " + state); - Msg.debug(this, " And Child: " + childState.get()); - } - - assertTrue(DebugModelConventions.isProcessAlive(childProcess)); - waitOn(childState.waitUntil(s -> s == TargetExecutionState.STOPPED)); - for (int i = 1; DebugModelConventions.isProcessAlive(childProcess); i++) { - Msg.debug(this, "Resuming child until terminated"); - resume(childProcess); - Msg.debug(this, " Done " + i); - waitOn(childState.waitUntil(s -> s != TargetExecutionState.RUNNING)); - } - } - - protected void placeBreakpoint(String who, TargetProcess process, String expression) - throws Throwable { - TargetBreakpointSpecContainer container = - findBreakpointSpecContainer(process.getPath()); - Msg.debug(this, "Placing breakpoint (on " + who + ")"); - waitOn(container.placeBreakpoint(expression, Set.of(TargetBreakpointKind.SW_EXECUTE))); - } - - protected void placeChildBreakpoint(TargetProcess childProcess) throws Throwable { - String expression = getChildBreakpointExpression(); - if (expression != null) { - placeBreakpoint("child", childProcess, expression); - } - } -} diff --git a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelScenarioMemoryTest.java b/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelScenarioMemoryTest.java deleted file mode 100644 index 0ea8d95aa2..0000000000 --- a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelScenarioMemoryTest.java +++ /dev/null @@ -1,173 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.test; - -import static org.junit.Assert.assertArrayEquals; -import static org.junit.Assert.assertTrue; - -import java.lang.invoke.MethodHandles; -import java.util.Objects; - -import org.junit.Assert; -import org.junit.Test; - -import ghidra.dbg.AnnotatedDebuggerAttributeListener; -import ghidra.dbg.DebugModelConventions; -import ghidra.dbg.DebugModelConventions.AsyncState; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetExecutionStateful.TargetExecutionState; -import ghidra.program.model.address.Address; -import ghidra.util.Msg; - -/** - * A scenario that verifies memory writes affect the target - */ -public abstract class AbstractDebuggerModelScenarioMemoryTest extends AbstractDebuggerModelTest { - - // TODO: Something for expected flags, permissions? - - /** - * This specimen must perform some observable action, which can be affected by a memory write - * - *

- * A common example is to exit with a code read from memory. It may also be useful for debugging - * purposes to print a message from the same memory. - * - * @return the specimen - */ - protected abstract DebuggerTestSpecimen getSpecimen(); - - /** - * Get the destination address to write to - * - *

- * The most reliable way to do this is to ensure an easily identifiable symbol for the - * destination address is exported, then use the debugging API to obtain its address. - * - * @param process the process running the specimen - * @return the destination address - * @throws Throwable if anything goes wrong - */ - protected abstract Address getAddressToWrite(TargetProcess process) throws Throwable; - - /** - * Get the bytes to write - * - *

- * It's probably best to use a string encoded in the platform's preferred format. - * - * @return the bytes - */ - protected abstract byte[] getBytesToWrite(); - - /** - * Get the expected bytes after read - * - *

- * This should be the same as {@link #getBytesToWrite()}, but preferably includes some - * additional bytes after, so that memory reads can be verified to come from the actual target, - * and not just from a cached write. A common scenario is to partially write over a string, then - * read the entire string, verifying both the overwritten part and the remainder. - * - * @return the bytes - */ - protected abstract byte[] getExpectedBytes(); - - /** - * Perform whatever preparation is necessary to observe the expected effect - * - * @param process the process trapped at launch -- typically at {@code main()}. - * @throws Throwable if anything goes wrong - */ - protected void postLaunch(TargetProcess process) throws Throwable { - } - - /** - * Verify, using {@link Assert}, that the target exhibited the effect of the memory write - * - *

- * Note that the given process may be invalid, depending on the model's implementation. The - * tester should know how the model under test behaves. If the object is invalid, it's possible - * its attributes were updated immediately preceding invalidation with observable information, - * but this is usually not the case. The better approach is to devise an effect that can be - * observed in an event callback. To install such a listener, override - * {@link #postLaunch(TargetProcess)} and record the relevant information to be validated here. - * Do not place assertions in the event callback, since the failures they could produce will not - * be recorded as test failures. If the effect can be observed in multiple ways, it is best to - * verify all of them. - * - * @param process the target process, which may no longer be valid - * @throws Throwable if anything goes wrong or an assertion fails - */ - protected abstract void verifyExpectedEffect(TargetProcess process) throws Throwable; - - /** - * Test the following scenario: - * - *

    - *
  1. Obtain a launcher and use it to start the specimen
  2. - *
  3. Overwrite bytes at a designated address in memory
  4. - *
  5. Read those bytes and verify they were modified
  6. - *
  7. Resume the process until it is TERMINATED
  8. - *
  9. Verify some effect, usually the exit code
  10. - *
- */ - @Test - public void testScenario() throws Throwable { - DebuggerTestSpecimen specimen = getSpecimen(); - m.build(); - - // For model developer diagnostics - var stateMonitor = new AnnotatedDebuggerAttributeListener(MethodHandles.lookup()) { - @AttributeCallback(TargetExecutionStateful.STATE_ATTRIBUTE_NAME) - private void stateChanged(TargetObject obj, TargetExecutionState state) { - Msg.debug(this, obj.getJoinedPath(".") + " is now " + state); - } - }; - m.getModel().addModelListener(stateMonitor); - - TargetLauncher launcher = findLauncher(); - Msg.debug(this, "Launching " + specimen); - waitOn(launcher.launch(specimen.getLauncherArgs())); - Msg.debug(this, " Done launching"); - TargetProcess process = retryForProcessRunning(specimen, this); - postLaunch(process); - - Address address = Objects.requireNonNull(getAddressToWrite(process)); - byte[] data = Objects.requireNonNull(getBytesToWrite()); - TargetMemory memory = Objects.requireNonNull(findMemory(process.getPath())); - Msg.debug(this, "Writing memory"); - waitOn(memory.writeMemory(address, data)); - Msg.debug(this, " Done"); - byte[] expected = getExpectedBytes(); - byte[] read = waitOn(memory.readMemory(address, expected.length)); - assertArrayEquals(expected, read); - - assertTrue(DebugModelConventions.isProcessAlive(process)); - AsyncState state = - new AsyncState(m.suitable(TargetExecutionStateful.class, process.getPath())); - - for (int i = 1; DebugModelConventions.isProcessAlive(process); i++) { - Msg.debug(this, "(" + i + ") Resuming process until terminated"); - resume(process); - Msg.debug(this, " Done " + i); - waitOn(state.waitUntil(s -> s != TargetExecutionState.RUNNING)); - Msg.debug(this, "Parent state after resume-wait-not-running: " + state); - } - - verifyExpectedEffect(process); - } -} diff --git a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelScenarioRegistersTest.java b/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelScenarioRegistersTest.java deleted file mode 100644 index 7e7e021eea..0000000000 --- a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelScenarioRegistersTest.java +++ /dev/null @@ -1,203 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.test; - -import static org.junit.Assert.assertTrue; - -import java.lang.invoke.MethodHandles; -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import org.junit.Assert; -import org.junit.Test; - -import ghidra.dbg.AnnotatedDebuggerAttributeListener; -import ghidra.dbg.DebugModelConventions; -import ghidra.dbg.DebugModelConventions.AsyncState; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetBreakpointSpec.TargetBreakpointKind; -import ghidra.dbg.target.TargetExecutionStateful.TargetExecutionState; -import ghidra.util.Msg; - -public abstract class AbstractDebuggerModelScenarioRegistersTest extends AbstractDebuggerModelTest { - - /** - * This specimen must have an observable behavior which can be effected by writing a register - * - *

- * The simplest is probably to exit with a code from a known register. This can probably be best - * accomplished by having main call {@code exit(some_func(0));} where {@code some_func} has a - * known calling convention and simply returns its parameter. This way, the test can break on - * {@code some_func} and write to the register for that first parameter. On architectures where - * the standard calling convention passes parameters via memory, you may be able to select an - * alternative that uses registers, or you may have to use inline/pure assembly. - * - * @return the specimen - */ - protected abstract DebuggerTestSpecimen getSpecimen(); - - /** - * Perform any work needed after the specimen has been launched - * - * @param process the process running the specimen - * @throws Throwable if anything goes wrong - */ - protected void postLaunch(TargetProcess process) throws Throwable { - } - - /** - * Get the expression to break when the register write should be made - * - *

- * More than likely, this should just be the symbol for that function. - * - * @return the expression - */ - protected abstract String getBreakpointExpression(); - - /** - * Get the registers and values to write to achieve the desired effect - * - * @return the name-value map of registers to write - */ - protected abstract Map getRegisterWrites(); - - /** - * Perform the register writing portion of the test - * - *

- * TODO: It is necessary to override this for LLDB, since it presents its registers in various - * "sub" banks. For it, we need to search the banks for each register to write, and delegate to - * the appropriate bank. - * - * @param toWrite - * - * @param the trapped thread - */ - protected void performRegisterWrites(TargetObject target, Map toWrite) - throws Throwable { - TargetRegisterBank bank = Objects - .requireNonNull(m.findWithIndex(TargetRegisterBank.class, "0", target.getPath())); - waitOn(bank.writeRegistersNamed(toWrite)); - } - - /** - * Verify, using {@link Assert}, that the target exhibited the effect of the register write - * - *

- * Note that the given process may be invalid, depending on the model's implementation. The - * tester should know how the model under test behaves. If the object is invalid, it's possible - * its attributes were updated immediately preceding invalidation with observable information, - * but this is usually not the case. The better approach is to devise an effect that can be - * observed in an event callback. To install such a listener, override - * {@link #postLaunch(TargetProcess)} and record the relevant information to be validated here. - * Do not place assertions in the event callback, since the failures they could produce will not - * be recorded as test failures. If the effect can be observed in multiple ways, it is best to - * verify all of them. - * - * @param process the target process, which may no longer be valid - * @throws Throwable if anything goes wrong or an assertion fails - */ - protected abstract void verifyExpectedEffect(TargetProcess process) throws Throwable; - - /** - * Test the following scenario - * - *

    - *
  1. Obtain a launcher and use it to start the specimen
  2. - *
  3. Place a breakpoint
  4. - *
  5. Continue until a thread hits the breakpoint
  6. - *
  7. Write that thread's registers
  8. - *
  9. Resume the process until it is TERMINATED
  10. - *
  11. Verify some effect, usually the exit code
  12. - *
- */ - @Test - public void testScenario() throws Throwable { - DebuggerTestSpecimen specimen = getSpecimen(); - m.build(); - - // For model developer diagnostics - var bpMonitor = new AnnotatedDebuggerAttributeListener(MethodHandles.lookup()) { - CompletableFuture trapped = new CompletableFuture<>(); - - @AttributeCallback(TargetExecutionStateful.STATE_ATTRIBUTE_NAME) - private void stateChanged(TargetObject obj, TargetExecutionState state) { - Msg.debug(this, obj.getJoinedPath(".") + " is now " + state); - } - - @Override - public void breakpointHit(TargetObject container, TargetObject trapped, - TargetStackFrame frame, TargetBreakpointSpec spec, - TargetBreakpointLocation breakpoint) { - Msg.debug(this, "TRAPPED by " + spec); - if (getBreakpointExpression().equals(spec.getExpression())) { - this.trapped.complete(trapped); - Msg.debug(this, " Counted"); - } - } - }; - m.getModel().addModelListener(bpMonitor); - - TargetLauncher launcher = findLauncher(); - Msg.debug(this, "Launching " + specimen); - waitOn(launcher.launch(specimen.getLauncherArgs())); - Msg.debug(this, " Done launching"); - TargetProcess process = retryForProcessRunning(specimen, this); - postLaunch(process); - - TargetBreakpointSpecContainer breakpointContainer = - findBreakpointSpecContainer(process.getPath()); - Msg.debug(this, "Placing breakpoint"); - waitOn(breakpointContainer.placeBreakpoint(getBreakpointExpression(), - Set.of(TargetBreakpointKind.SW_EXECUTE))); - - assertTrue(DebugModelConventions.isProcessAlive(process)); - AsyncState state = - new AsyncState(m.suitable(TargetExecutionStateful.class, process.getPath())); - - /** - * NB. If an assert(isAlive) is failing, check that breakpointHit() is emitted before - * attributeChanged(state=STOPPED) - */ - for (int i = 1; !bpMonitor.trapped.isDone(); i++) { - assertTrue(state.get().isAlive()); - Msg.debug(this, "(" + i + ") Resuming process until breakpoint hit"); - resume(process); - Msg.debug(this, " Done " + i); - waitOn(state.waitUntil(s -> s != TargetExecutionState.RUNNING)); - } - assertTrue(state.get().isAlive()); - TargetObject target = waitOn(bpMonitor.trapped); - - Map toWrite = getRegisterWrites(); - Msg.debug(this, "Writing registers: " + toWrite.keySet()); - performRegisterWrites(target, toWrite); - Msg.debug(this, " Done"); - - assertTrue(DebugModelConventions.isProcessAlive(process)); - - for (int i = 1; DebugModelConventions.isProcessAlive(process); i++) { - Msg.debug(this, "(" + i + ") Resuming process until terminated"); - resume(process); - Msg.debug(this, " Done " + i); - waitOn(state.waitUntil(s -> s != TargetExecutionState.RUNNING)); - Msg.debug(this, "Parent state after resume-wait-not-running: " + state); - } - - verifyExpectedEffect(process); - } -} diff --git a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelScenarioStackTest.java b/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelScenarioStackTest.java deleted file mode 100644 index c6fc99288b..0000000000 --- a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelScenarioStackTest.java +++ /dev/null @@ -1,175 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.test; - -import static org.junit.Assert.*; - -import java.lang.invoke.MethodHandles; -import java.util.List; -import java.util.Set; - -import org.junit.Test; - -import ghidra.dbg.AnnotatedDebuggerAttributeListener; -import ghidra.dbg.DebugModelConventions; -import ghidra.dbg.DebugModelConventions.AsyncState; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetBreakpointSpec.TargetBreakpointKind; -import ghidra.dbg.target.TargetExecutionStateful.TargetExecutionState; -import ghidra.dbg.util.PathMatcher; -import ghidra.dbg.util.PathPattern; -import ghidra.program.model.address.Address; -import ghidra.util.Msg; - -public abstract class AbstractDebuggerModelScenarioStackTest extends AbstractDebuggerModelTest { - - /** - * This specimen must create a stack easily recognizable by examination of 4 frames' PCs - * - *

- * This is accomplished by writing 4 functions where each calls the next, the innermost - * function's symbol providing an easily-placed breakpoint. When the breakpoint is hit, frame 0 - * should be at the entry of the innermost function, and the pc for each frame after that should - * be within the body of its respective following function. - * - * @return the specimen - */ - protected abstract DebuggerTestSpecimen getSpecimen(); - - /** - * Perform any work needed after the specimen has been launched - * - * @param process the process running the specimen - * @throws Throwable if anything goes wrong - */ - protected void postLaunch(TargetProcess process) throws Throwable { - } - - /** - * Get the expression to break at the innermost recognizable function - * - *

- * More than likely, this should just be the symbol for that function. - * - * @return the expression - */ - protected abstract String getBreakpointExpression(); - - /** - * Examine the address of the given frame and verify it is where expected - * - *

- * Note if this validation needs access to the process, it should at least record where that - * process is by overriding {@link #postLaunch(TargetProcess)}. Ideally, it can perform all of - * the necessary lookups, e.g., to record symbol values, there instead of here. - * - * @param index the index - * @param pc the program counter - */ - protected abstract void validateFramePC(int index, Address pc); - - /** - * Test the following scenario: - * - *

    - *
  1. Obtain a launcher and use it to start the specimen
  2. - *
  3. Place the breakpoint on the new process
  4. - *
  5. Resume the process until the breakpoint is hit
  6. - *
  7. Read the stack and verify the PC for each frame
  8. - *
  9. Resume the process until it is TERMINATED
  10. - *
- */ - @Test - public void testScenario() throws Throwable { - DebuggerTestSpecimen specimen = getSpecimen(); - m.build(); - - var bpMonitor = new AnnotatedDebuggerAttributeListener(MethodHandles.lookup()) { - boolean hit = false; - - @AttributeCallback(TargetExecutionStateful.STATE_ATTRIBUTE_NAME) - private void stateChanged(TargetObject object, TargetExecutionState state) { - Msg.debug(this, "STATE " + object.getJoinedPath(".") + " is now " + state); - } - - @Override - public void breakpointHit(TargetObject container, TargetObject trapped, - TargetStackFrame frame, TargetBreakpointSpec spec, - TargetBreakpointLocation breakpoint) { - Msg.debug(this, "TRAPPED by " + spec); - if (getBreakpointExpression().equals(spec.getExpression())) { - hit = true; - Msg.debug(this, " Counted"); - } - } - }; - m.getModel().addModelListener(bpMonitor); - - Msg.debug(this, "Launching " + specimen); - TargetLauncher launcher = findLauncher(); - waitOn(launcher.launch(specimen.getLauncherArgs())); - Msg.debug(this, " Done launching"); - TargetProcess process = retryForProcessRunning(specimen, this); - postLaunch(process); - - TargetBreakpointSpecContainer breakpointContainer = - findBreakpointSpecContainer(process.getPath()); - Msg.debug(this, "Placing breakpoint"); - waitOn(breakpointContainer.placeBreakpoint(getBreakpointExpression(), - Set.of(TargetBreakpointKind.SW_EXECUTE))); - - assertTrue(DebugModelConventions.isProcessAlive(process)); - AsyncState state = - new AsyncState(m.suitable(TargetExecutionStateful.class, process.getPath())); - - /** - * NB. If an assert(isAlive) is failing, check that breakpointHit() is emitted before - * attributeChanged(state=STOPPED) - */ - for (int i = 1; !bpMonitor.hit; i++) { - assertTrue(state.get().isAlive()); - Msg.debug(this, "(" + i + ") Resuming process until breakpoint hit"); - resume(process); - Msg.debug(this, " Done " + i); - waitOn(state.waitUntil(s -> s != TargetExecutionState.RUNNING)); - } - assertTrue(state.get().isAlive()); - - TargetStack stack = findStack(process.getPath()); - PathMatcher matcher = stack.getSchema().searchFor(TargetStackFrame.class, true); - PathPattern pattern = matcher.getSingletonPattern(); - assertNotNull("Frames are not clearly indexable", pattern); - assertEquals("Frames are not clearly indexable", 1, pattern.countWildcards()); - // Sort by path should present them innermost to outermost - List frames = retry(() -> { - List result = - List.copyOf(m.findAll(TargetStackFrame.class, stack.getPath(), true).values()); - assertTrue("Fewer than 4 frames", result.size() > 4); - return result; - }, List.of(AssertionError.class)); - for (int i = 0; i < 4; i++) { - TargetStackFrame f = frames.get(i); - validateFramePC(i, f.getProgramCounter()); - } - - for (int i = 1; DebugModelConventions.isProcessAlive(process); i++) { - Msg.debug(this, "(" + i + ") Resuming process until terminated"); - resume(process); - Msg.debug(this, " Done " + i); - waitOn(state.waitUntil(s -> s != TargetExecutionState.RUNNING)); - } - } -} diff --git a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelSteppableTest.java b/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelSteppableTest.java deleted file mode 100644 index d724cf1c09..0000000000 --- a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelSteppableTest.java +++ /dev/null @@ -1,331 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.test; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; -import static org.junit.Assume.assumeNotNull; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; - -import org.junit.Test; - -import ghidra.async.AsyncDebouncer; -import ghidra.async.AsyncTimer; -import ghidra.dbg.DebugModelConventions.AsyncState; -import ghidra.dbg.DebuggerModelListener; -import ghidra.dbg.target.TargetEventScope.TargetEventType; -import ghidra.dbg.target.TargetExecutionStateful; -import ghidra.dbg.target.TargetExecutionStateful.TargetExecutionState; -import ghidra.dbg.target.TargetMemory; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.TargetRegisterBank; -import ghidra.dbg.target.TargetSteppable; -import ghidra.dbg.target.TargetThread; -import ghidra.util.Msg; - -/** - * Tests the functionality of a single-stepping a target - * - *

- * Note that multiple sub-cases of this test can be generated in order to test each steppable object - * in the model. Take care when selecting which object (usually a thread) to put under test. If, for - * example, the selected thread is performing a blocking system call, then the tests will almost - * certainly time out. - */ -public abstract class AbstractDebuggerModelSteppableTest extends AbstractDebuggerModelTest - implements RequiresTarget { - - /** - * Get the expected (absolute) path of the steppable under test - * - * @param threadPath the path of the target (usually a thread) - * @return the expected path, or {@code null} for no assertion - */ - public List getExpectedSteppablePath(List threadPath) { - return null; - } - - @Test - public void testSteppableIsWhereExpected() throws Throwable { - m.build(); - - TargetObject target = maybeSubstituteThread(obtainTarget()); - List expectedSteppablePath = getExpectedSteppablePath(target.getPath()); - assumeNotNull(expectedSteppablePath); - - TargetSteppable steppable = findSteppable(target.getPath()); - assertEquals(expectedSteppablePath, steppable.getPath()); - } - - /** - * An arbitrary number - * - *

- * Should be enough to prove that stepping works consistently, but not so high that the test - * drags on. Definitely 2 or greater :) - * - * @return the number of steps in the test - */ - protected int getStepCount() { - return 5; - } - - /** - * This just steps the target some number of times and verifies the execution state between - * - * @throws Throwable if anything goes wrong - */ - @Test - public void testStep() throws Throwable { - m.build(); - - TargetObject target = maybeSubstituteThread(obtainTarget()); - AsyncState state = - new AsyncState(m.suitable(TargetExecutionStateful.class, target.getPath())); - TargetSteppable steppable = findSteppable(target.getPath()); - for (int i = 0; i < getStepCount(); i++) { - waitOn(steppable.step()); - TargetExecutionState st = - waitOn(state.waitUntil(s -> s != TargetExecutionState.RUNNING)); - assertTrue("Target terminated while stepping", st.isAlive()); - } - } - - // TODO: Test other kinds of steps - // TODO: Test expected step kinds (or expected parameters) - // TODO: Once there, use the generic method invocation style - - /** - * The window of silence necessary to assume no more callbacks will occur - * - * @return the window in milliseconds - */ - protected long getDebounceWindowMs() { - return 5000; - } - - enum CallbackType { - EVENT_RUNNING, - EVENT_STOPPED, - REGS_UPDATED, - REGS_CACHE_INVALIDATED, - MEM_CACHE_INVALIDATED; - } - - /** - * Test event order for single stepping - * - *

- * This tests that the {@link DebuggerModelListener#registersUpdated(TargetObject, Map)} - * callback occurs "last" following a step. While other callbacks may intervene, the order ought - * to be {@code event(RUNNING)}, {@code event(STOPPED)}, {@code registersUpdated()}. An - * {@code event()} cannot follow, as that would cause the snap to advance, making registers - * appear stale . Worse, if {@code registersUpdated} precedes {@code STOPPED}, the recorder will - * write values into the snap previous to the one it ought. This principle applies to all - * {@code event()}s, but is easiest to test for single-stepping. We also check that the - * registers (cached) are not invalidated after they are updated for the step. Note that - * {@code STOPPED} can be substituted for any event which implies the target is stopped. - * - * @throws Throwable if anything goes wrong - */ - @Test - public void testStepEventOrder() throws Throwable { - m.build(); - - var listener = new DebuggerModelListener() { - List callbacks = new ArrayList<>(); - List log = new ArrayList<>(); - AsyncDebouncer debouncer = - new AsyncDebouncer(AsyncTimer.DEFAULT_TIMER, getDebounceWindowMs()); - - @Override - public void event(TargetObject object, TargetThread eventThread, TargetEventType type, - String description, List parameters) { - synchronized (callbacks) { - if (type == TargetEventType.RUNNING) { - callbacks.add(CallbackType.EVENT_RUNNING); - } - else if (type.impliesStop) { - callbacks.add(CallbackType.EVENT_STOPPED); - } - log.add("event(" + type + "): " + description); - } - debouncer.contact(null); - } - - @Override - public void registersUpdated(TargetObject bank, Map updates) { - synchronized (callbacks) { - callbacks.add(CallbackType.REGS_UPDATED); - log.add("registersUpdated()"); - } - debouncer.contact(null); - } - - @Override - public void invalidateCacheRequested(TargetObject object) { - synchronized (callbacks) { - if (object instanceof TargetRegisterBank) { - callbacks.add(CallbackType.REGS_CACHE_INVALIDATED); - log.add("invalidateCacheRequested(TargetRegisterBank)"); - } - else if (object instanceof TargetMemory) { - callbacks.add(CallbackType.MEM_CACHE_INVALIDATED); - log.add("invalidateCacheRequested(TargetMemory)"); - } - } - debouncer.contact(null); - } - - @Override - public void attributesChanged(TargetObject object, Collection removed, - Map added) { - debouncer.contact(null); - } - - @Override - public void elementsChanged(TargetObject object, Collection removed, - Map added) { - debouncer.contact(null); - } - }; - m.getModel().addModelListener(listener); - - CompletableFuture settledBefore = listener.debouncer.settled(); - TargetObject target = maybeSubstituteThread(obtainTarget()); - AsyncState state = - new AsyncState(m.suitable(TargetExecutionStateful.class, target.getPath())); - TargetSteppable steppable = findSteppable(target.getPath()); - waitOnNoValidate(settledBefore); - synchronized (listener.callbacks) { - listener.callbacks.clear(); - listener.log.add("CLEARED callbacks"); - } - - CompletableFuture settledAfter = listener.debouncer.settled(); - waitOn(steppable.step()); - TargetExecutionState st = - waitOn(state.waitUntil(s -> s != TargetExecutionState.RUNNING)); - assertTrue("Target terminated while stepping", st.isAlive()); - waitOnNoValidate(settledAfter); - - List callbacks; - synchronized (listener.callbacks) { - callbacks = List.copyOf(listener.callbacks); - } - - Msg.info(this, "Observations: " + callbacks); - - boolean observedRunning = false; - boolean observedStopped = false; - boolean observedRegsUpdated = false; - boolean observedInvalidateRegs = false; - boolean observedInvalidateMem = false; - for (CallbackType cb : callbacks) { - switch (cb) { - case EVENT_RUNNING: - if (observedRunning) { - fail("Observed a second event(RUNNING)."); - } - observedRunning = true; - break; - case EVENT_STOPPED: - if (observedStopped) { - fail("Observed a second event(STOPPED)."); - } - observedStopped = true; - break; - case REGS_UPDATED: - if (!observedStopped) { - fail("Observed registersUpdated() before event(STOPPED)."); - } - observedRegsUpdated = true; - break; - case REGS_CACHE_INVALIDATED: - if (!observedStopped) { - if (observedRunning) { - // Recorder will ignore, but it still counts for flushing model - break; - } - /** - * Spurious cache invalidations are not permitted before the recorder would - * create a new snap. It knows to ignore invalidations that occur between - * event(RUNNING) and event(STOPPED). - */ - fail("Observed a spurious invalidateCacheRequested(Regs)."); - } - else if (observedInvalidateRegs) { - Msg.warn(this, - "Observed an extra invalidateCacheRequested(Regs) after event(STOPPED)."); - } - else if (observedRegsUpdated) { - // The invalidate would effectively undo the update - fail("Observed invalidateCacheRequested(Regs) after registersUpdated()."); - } - else { - observedInvalidateRegs = true; - } - break; - case MEM_CACHE_INVALIDATED: - if (!observedStopped) { - if (observedRunning) { - // Recorder will ignore, but it still counts for flushing model - observedInvalidateMem = true; - break; - } - /** - * Spurious cache invalidations are not permitted before the recorder would - * create a new snap. It knows to ignore invalidations that occur between - * event(RUNNING) and event(STOPPED). - */ - fail("Observed a spurious invalidateCacheRequested(Mem)."); - } - else if (observedInvalidateMem) { - Msg.warn(this, - "Observed an extra invalidateCacheRequested(Mem) after event(STOPPED)."); - } - else { - observedInvalidateMem = true; - } - break; - default: - throw new AssertionError(); - } - } - - if (!observedStopped) { - fail("Never observed event(STOPPED)."); - } - if (!observedRegsUpdated && !observedInvalidateRegs) { - fail("Observed neither invalidateCacheRequested(Regs) nor registersUpdated()."); - } - if (!observedInvalidateMem) { - /** - * NOTE: even though STOPPED advances the snapshot, we still require - * invalidateCacheRequested(Mem) to ensure the model's memory cache is not stale. - * Whether or not your model employs an internal cache, this is required, because your - * model may be accessed via a proxy model (e.g., GADP) that uses a cache. - */ - fail("Never observed invalidateCacheRequested(Mem)."); - } - } -} diff --git a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelTest.java b/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelTest.java deleted file mode 100644 index 3cb4163e8b..0000000000 --- a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractDebuggerModelTest.java +++ /dev/null @@ -1,341 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.test; - -import static org.junit.Assert.*; - -import java.util.*; -import java.util.concurrent.CompletableFuture; - -import org.junit.After; -import org.junit.Before; - -import ghidra.dbg.DebugModelConventions; -import ghidra.dbg.DebugModelConventions.AsyncState; -import ghidra.dbg.DebuggerModelListener; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetBreakpointSpec.TargetBreakpointKind; -import ghidra.dbg.target.TargetEventScope.TargetEventType; -import ghidra.dbg.target.TargetExecutionStateful.TargetExecutionState; -import ghidra.dbg.testutil.*; -import ghidra.test.AbstractGhidraHeadedIntegrationTest; -import ghidra.util.Msg; - -/** - * - *
    - *
  • TODO: ensure order: created(Thread), event(THREAD_CREATED), created(RegisterBank) ?
  • - *
  • TODO: ensure registersUpdated(RegisterBank) immediately upon created(RegisterBank) ?
  • - *
- * - * @deprecated All derivative tests are now ignored, since running them is no longer of any real - * value. - */ -@Deprecated(forRemoval = true, since = "11.2") -public abstract class AbstractDebuggerModelTest extends AbstractGhidraHeadedIntegrationTest - implements TestDebuggerModelProvider, DebuggerModelTestUtils { - - protected DummyProc dummy; - public ModelHost m; - - /** - * The default seed path to use when searching for a type of object - * - * @return the seed path - */ - protected List seedPath() { - return List.of(); - } - - protected TargetActiveScope findActiveScope() throws Throwable { - return m.find(TargetActiveScope.class, seedPath()); - } - - protected TargetObject findAttachableContainer() throws Throwable { - return m.findContainer(TargetAttachable.class, seedPath()); - } - - protected TargetAttacher findAttacher() throws Throwable { - return m.find(TargetAttacher.class, seedPath()); - } - - protected TargetFocusScope findFocusScope() throws Throwable { - return m.find(TargetFocusScope.class, seedPath()); - } - - protected TargetInterpreter findInterpreter() throws Throwable { - return m.find(TargetInterpreter.class, seedPath()); - } - - /** - * Get the launcher under test - * - *

- * This can be overridden to force a different launcher under the test. - * - * @return the launcher - * @throws Throwable if anything goes wrong - */ - protected TargetLauncher findLauncher() throws Throwable { - return m.find(TargetLauncher.class, seedPath()); - } - - /** - * Get the breakpoint container of a target under test - * - * @param seedPath the path to the target - * @return the breakpoint container - * @throws Throwable if anything goes wrong - */ - protected TargetBreakpointSpecContainer findBreakpointSpecContainer(List seedPath) - throws Throwable { - return m.suitable(TargetBreakpointSpecContainer.class, seedPath); - } - - protected TargetEnvironment findEnvironment(List seedPath) throws Throwable { - return m.suitable(TargetEnvironment.class, seedPath); - } - - /** - * Get the steppable object of a target under test - * - * @param seedPath the path to the target - * @return the steppable object - * @throws Throwable if anything goes wrong - */ - protected TargetSteppable findSteppable(List seedPath) throws Throwable { - return m.find(TargetSteppable.class, seedPath); - } - - /** - * Get the memory of a target under test - * - * @param seedPath the path to the target - * @return the memory - * @throws Throwable if anything goes wrong - */ - protected TargetMemory findMemory(List seedPath) throws Throwable { - return m.suitable(TargetMemory.class, seedPath); - } - - /** - * Find any thread to put under test - * - * @param seedPath the path to the target process - * @return the thread - * @throws Throwable if anything goes wrong - */ - protected TargetThread findAnyThread(List seedPath) throws Throwable { - return m.findAny(TargetThread.class, seedPath); - } - - // TODO: Seems TargetStack is just a container for TargetStackFrame - // This could be replaced by findContainer(TargetStackFrame) - protected TargetStack findStack(List seedPath) throws Throwable { - return m.find(TargetStack.class, seedPath); - } - - protected TargetRegisterBank findAnyRegisterBank(List seedPath) throws Throwable { - return m.findAny(TargetRegisterBank.class, seedPath); - } - - protected TargetStackFrame findAnyStackFrame(List seedPath) throws Throwable { - return m.findAny(TargetStackFrame.class, seedPath); - } - - protected TargetObject maybeSubstituteThread(TargetObject target) throws Throwable { - TargetThread thread = findAnyThread(target.getPath()); - return thread == null ? target : thread; - } - - @Override - public void validateCompletionThread() { - m.validateCompletionThread(); - } - - @Before - public void setUpDebuggerModelTest() throws Throwable { - m = modelHost(); - } - - @After - public void tearDownDebuggerModelTest() throws Throwable { - /** - * NB. Model has to be closed before dummy. If dummy is suspended by a debugger, terminating - * it, even forcibly, may fail. - */ - if (m != null) { - m.close(); - } - if (dummy != null) { - dummy.close(); - } - } - - public interface DebuggerTestSpecimen { - /** - * Run the specimen outside the debugger - * - *

- * This is really only applicable to processes which are going to run/wait indefinitely, - * since this is likely used in tests involving attach. - * - * @return a handle to the process - * @throws Throwable if anything goes wrong - */ - DummyProc runDummy() throws Throwable; - - /** - * Get the arguments to launch this specimen using the model's launcher - * - * @return the arguments - */ - Map getLauncherArgs(); - - /** - * Get the script to launch this specimen via the interpreter - */ - List getLaunchScript(); - - /** - * Check if this specimen is the image for the given process - * - * @param process the process to examine - * @param test the test case - * @return true if the specimen is the image, false otherwise - * @throws Throwable if anything goes wrong - */ - boolean isRunningIn(TargetProcess process, AbstractDebuggerModelTest test) throws Throwable; - - /** - * Check if this specimen is the image for the given attachable process - * - *

- * The actual check is usually done by the OS-assigned PID. - * - * @param dummy the dummy process whose image is known to be this specimen - * @param attachable the attachable process presented by the model - * @param test the test case - * @return true if the attachable process represents the given dummy - * @throws Throwable if anything goes wrong - */ - boolean isAttachable(DummyProc dummy, TargetAttachable attachable, - AbstractDebuggerModelTest test) throws Throwable; - } - - /** - * Set a software breakpoint and resume until it is hit - * - * @param bpExpression the expression for the breakpoint - * @param target the target to resume - * @return the object which is actually trapped, often a thread - * @throws Throwable if anything goes wrong - */ - protected TargetObject trapAt(String bpExpression, TargetObject target) throws Throwable { - var listener = new DebuggerModelListener() { - CompletableFuture trapped = new CompletableFuture<>(); - - @Override - public void event(TargetObject object, TargetThread eventThread, TargetEventType type, - String description, List parameters) { - Msg.debug(this, "EVENT " + type + " '" + description + "'"); - } - - @Override - public void breakpointHit(TargetObject container, TargetObject trapped, - TargetStackFrame frame, TargetBreakpointSpec spec, - TargetBreakpointLocation breakpoint) { - if (bpExpression.equals(spec.getExpression())) { - this.trapped.complete(trapped); - } - } - }; - target.getModel().addModelListener(listener); - - TargetBreakpointSpecContainer breakpoints = findBreakpointSpecContainer(target.getPath()); - waitOn(breakpoints.placeBreakpoint(bpExpression, Set.of(TargetBreakpointKind.SW_EXECUTE))); - - AsyncState state = - new AsyncState(m.suitable(TargetExecutionStateful.class, target.getPath())); - while (!listener.trapped.isDone()) { - resume(target); - TargetExecutionState st = - waitOn(state.waitUntil(s -> s != TargetExecutionState.RUNNING)); - assertTrue("Target terminated before it was trapped", st.isAlive()); - } - target.getModel().removeModelListener(listener); - return waitOn(listener.trapped); - } - - protected void runTestDetach(DebuggerTestSpecimen specimen) - throws Throwable { - TargetProcess process = retryForProcessRunning(specimen, this); - TargetDetachable detachable = m.suitable(TargetDetachable.class, process.getPath()); - waitAcc(detachable); - waitOn(detachable.detach()); - retryVoid(() -> assertFalse(DebugModelConventions.isProcessAlive(process)), - List.of(AssertionError.class)); - } - - protected void runTestKill(DebuggerTestSpecimen specimen) - throws Throwable { - TargetProcess process = retryForProcessRunning(specimen, this); - TargetKillable killable = m.suitable(TargetKillable.class, process.getPath()); - waitAcc(killable); - waitOn(killable.kill()); - retryVoid(() -> assertFalse(DebugModelConventions.isProcessAlive(process)), - List.of(AssertionError.class)); - } - - protected void runTestResumeTerminates(DebuggerTestSpecimen specimen) throws Throwable { - TargetProcess process = retryForProcessRunning(specimen, this); - TargetResumable resumable = m.suitable(TargetResumable.class, process.getPath()); - AsyncState state = - new AsyncState(m.suitable(TargetExecutionStateful.class, process.getPath())); - TargetExecutionState st = waitOn(state.waitUntil(s -> s != TargetExecutionState.RUNNING)); - assertTrue(st.isAlive()); - waitOn(resumable.resume()); - retryVoid(() -> assertFalse(DebugModelConventions.isProcessAlive(process)), - List.of(AssertionError.class)); - } - - protected void runTestResumeInterruptMany(DebuggerTestSpecimen specimen, - int repetitions) throws Throwable { - TargetProcess process = retryForProcessRunning(specimen, this); - TargetResumable resumable = m.suitable(TargetResumable.class, process.getPath()); - TargetInterruptible interruptible = - m.suitable(TargetInterruptible.class, process.getPath()); - TargetExecutionStateful stateful = - m.suitable(TargetExecutionStateful.class, process.getPath()); - for (int i = 0; i < repetitions; i++) { - waitAcc(resumable); - waitOn(resumable.resume()); - if (stateful != null) { - retryVoid(() -> { - assertEquals(TargetExecutionState.RUNNING, stateful.getExecutionState()); - }, List.of(AssertionError.class)); - } - // NB. Never have to waitAcc to interrupt. It's likely inaccessible, anyway. - waitOn(interruptible.interrupt()); - if (stateful != null) { - retryVoid(() -> { - assertEquals(TargetExecutionState.STOPPED, stateful.getExecutionState()); - }, List.of(AssertionError.class)); - } - } - waitOn(m.getModel().ping("Are you still there?")); - } -} diff --git a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractModelHost.java b/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractModelHost.java deleted file mode 100644 index 1bd440078b..0000000000 --- a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/AbstractModelHost.java +++ /dev/null @@ -1,285 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.test; - -import java.util.*; -import java.util.Map.Entry; -import java.util.function.Function; - -import ghidra.dbg.DebuggerModelFactory; -import ghidra.dbg.DebuggerObjectModel; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.testutil.*; -import ghidra.dbg.testutil.TestDebuggerModelProvider.ModelHost; -import ghidra.dbg.util.*; -import ghidra.dbg.util.ConfigurableFactory.Property; -import ghidra.dbg.util.PathUtils.PathComparator; - -public abstract class AbstractModelHost implements ModelHost, DebuggerModelTestUtils { - - public class WithoutThreadValidationImpl implements WithoutThreadValidation { - public WithoutThreadValidationImpl() { - withoutThreadValCount++; - } - - @Override - public void close() throws Exception { - withoutThreadValCount--; - } - } - - private int withoutThreadValCount = 0; - - protected DebuggerObjectModel model; - public CallbackValidator callbackValidator; - public EventValidator eventValidator; - public TargetObjectAddedWaiter waiter; - public DebuggerConsole console; - - protected boolean validateCallbacks = true; - // NB. GDB's modules actually aren't "unloaded" until the inferior's file is replaced - protected boolean validateEvents = false; - protected boolean provideConsole = true; - - @Override - public DebuggerObjectModel buildModel(Map options) throws Throwable { - DebuggerModelFactory factory = getModelFactory(); - for (Map.Entry opt : options.entrySet()) { - @SuppressWarnings("unchecked") - Property property = (Property) factory.getOptions().get(opt.getKey()); - property.setValue(opt.getValue()); - } - DebuggerObjectModel model = waitOn(factory.build()); - if (validateCallbacks) { - callbackValidator = new CallbackValidator(model); - } - if (validateEvents) { - eventValidator = new EventValidator(model); - } - if (provideConsole) { - console = new DebuggerConsole(model); - } - waiter = new TargetObjectAddedWaiter(model); - return model; - } - - @Override - public AbstractModelHost build() throws Throwable { - model = buildModel(getFactoryOptions()); - return this; - } - - @Override - public DebuggerObjectModel getModel() { - return model; - } - - @Override - public void validateCompletionThread() { - if (callbackValidator != null && withoutThreadValCount == 0) { - callbackValidator.validateCompletionThread(); - } - } - - @Override - public TargetObject getRoot() throws Throwable { - // Nothing waits on root unless they call this. Cannot use getModelRoot() - return waitOn(model.fetchModelRoot()); - } - - @Override - public void close() throws Exception { - if (model != null) { - try { - waitOn(model.close()); - } - catch (Exception e) { - throw e; - } - catch (Throwable e) { - throw new AssertionError(e); - } - } - if (callbackValidator != null) { - callbackValidator.close(); - } - if (eventValidator != null) { - eventValidator.close(); - } - if (console != null) { - console.close(); - } - if (waiter != null) { - waiter.close(); - } - } - - public abstract DebuggerModelFactory getModelFactory(); - - @Override - public List getBogusPath() { - return PathUtils.parse("THIS.PATH[SHOULD].NEVER[EXIST]"); - } - - @Override - public boolean hasDetachableProcesses() { - return true; - } - - @Override - public boolean hasInterpreter() { - return true; - } - - @Override - public boolean hasInterruptibleProcesses() { - return true; - } - - @Override - public boolean hasKillableProcesses() { - return true; - } - - @Override - public boolean hasResumableProcesses() { - return true; - } - - @Override - public boolean hasAttachableContainer() { - return true; - } - - @Override - public boolean hasAttacher() { - return true; - } - - @Override - public boolean hasEventScope() { - return true; - } - - @Override - public boolean hasLauncher() { - return true; - } - - @Override - public boolean hasProcessContainer() { - return true; - } - - @Override - public WithoutThreadValidation withoutThreadValidation() { - return new WithoutThreadValidationImpl(); - } - - @Override - public TargetObjectAddedWaiter getAddedWaiter() { - return waiter; - } - - @Override - public T find(Class cls, List seedPath) throws Throwable { - PathMatcher matcher = - model.getRootSchema().getSuccessorSchema(seedPath).searchFor(cls, seedPath, true); - if (matcher.isEmpty()) { - return null; - } - return cls.cast(assertUniqueShortest(waitOn(waiter.waitAtLeastOne(matcher)))); - } - - @Override - public T findWithIndex(Class cls, String index, - List seedPath) throws Throwable { - Objects.requireNonNull(index); // Use find if no index is expected - PathPredicates matcher = model.getRootSchema() - .getSuccessorSchema(seedPath) - .searchFor(cls, seedPath, true) - .applyKeys(index); - if (matcher.isEmpty()) { - return null; - } - return cls.cast(waitOn(waiter.wait(matcher.getSingletonPath()))); - } - - @Override - public T findAny(Class cls, List seedPath) - throws Throwable { - PathMatcher matcher = - model.getRootSchema().getSuccessorSchema(seedPath).searchFor(cls, seedPath, true); - if (matcher.isEmpty()) { - return null; - } - return cls.cast(waitOn(waiter.waitAtLeastOne(matcher)).firstEntry().getValue()); - } - - @Override - public NavigableMap, T> findAll(Class cls, - List seedPath, boolean atLeastOne) throws Throwable { - return findAll(cls, seedPath, pred -> pred, atLeastOne); - } - - @Override - public NavigableMap, T> findAll(Class cls, - List seedPath, Function adjustPredicates, - boolean atLeastOne) throws Throwable { - PathPredicates matcher = adjustPredicates.apply(model.getRootSchema() - .getSuccessorSchema(seedPath) - .searchFor(cls, seedPath, false)); - if (matcher.isEmpty()) { - return new TreeMap<>(); - } - - NavigableMap, ?> found = atLeastOne - ? waitOn(waiter.waitAtLeastOne(matcher)) - : matcher.getCachedValues(model.getModelRoot()); - // NB. Outside of testing, an "unsafe" cast of the map should be fine. - // During testing, we should expend the energy to verify the heap. - NavigableMap, T> result = new TreeMap<>(PathComparator.KEYED); - for (Entry, ?> ent : found.entrySet()) { - //TODO GP-1301 - if (cls.isInstance(ent.getValue())) { - result.put(ent.getKey(), cls.cast(ent.getValue())); - } - } - return result; - } - - @Override - public TargetObject findContainer(Class cls, List seedPath) - throws Throwable { - List foundSub = - model.getRootSchema().getSuccessorSchema(seedPath).searchForCanonicalContainer(cls); - if (foundSub == null) { - return null; - } - List path = PathUtils.extend(seedPath, foundSub); - return (TargetObject) waitOn(waiter.wait(path)); - } - - @Override - public T suitable(Class cls, List seedPath) - throws Throwable { - List path = model.getRootSchema().searchForSuitable(cls, seedPath); - if (path == null) { - return null; - } - return cls.cast(waitOn(waiter.wait(path))); - } -} diff --git a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/ProvidesTargetViaAttachSpecimen.java b/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/ProvidesTargetViaAttachSpecimen.java deleted file mode 100644 index 3dc2b34a7c..0000000000 --- a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/ProvidesTargetViaAttachSpecimen.java +++ /dev/null @@ -1,39 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.test; - -import ghidra.dbg.target.TargetAttacher; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.test.AbstractDebuggerModelTest.DebuggerTestSpecimen; -import ghidra.dbg.testutil.DummyProc; - -public interface ProvidesTargetViaAttachSpecimen extends RequiresTarget, RequiresAttachSpecimen { - - void setDummy(DummyProc dummy); - - AbstractDebuggerModelTest getTest(); - - @Override - default TargetObject obtainTarget() throws Throwable { - TargetAttacher attacher = getTest().findAttacher(); - DebuggerTestSpecimen specimen = getAttachSpecimen(); - waitAcc(attacher); - DummyProc dummy = specimen.runDummy(); - setDummy(dummy); - attacher.attach(dummy.pid); - return retryForProcessRunning(specimen, getTest()); - } -} diff --git a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/ProvidesTargetViaLaunchSpecimen.java b/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/ProvidesTargetViaLaunchSpecimen.java deleted file mode 100644 index 68f76fee3b..0000000000 --- a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/ProvidesTargetViaLaunchSpecimen.java +++ /dev/null @@ -1,42 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.test; - -import static org.junit.Assert.assertNotNull; - -import ghidra.dbg.target.TargetLauncher; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.test.AbstractDebuggerModelTest.DebuggerTestSpecimen; - -public interface ProvidesTargetViaLaunchSpecimen extends RequiresTarget, RequiresLaunchSpecimen { - - /** - * Probably just {@code return this;} - * - * @return the test - */ - AbstractDebuggerModelTest getTest(); - - @Override - default TargetObject obtainTarget() throws Throwable { - TargetLauncher launcher = getTest().findLauncher(); - assertNotNull("No launcher found", launcher); - DebuggerTestSpecimen specimen = getLaunchSpecimen(); - waitAcc(launcher); - launcher.launch(specimen.getLauncherArgs()); - return retryForProcessRunning(specimen, getTest()); - } -} diff --git a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/RequiresAttachSpecimen.java b/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/RequiresAttachSpecimen.java deleted file mode 100644 index 753d92d662..0000000000 --- a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/RequiresAttachSpecimen.java +++ /dev/null @@ -1,32 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.test; - -import ghidra.dbg.test.AbstractDebuggerModelTest.DebuggerTestSpecimen; - -public interface RequiresAttachSpecimen { - - /** - * Get the specimen to use for attach tests - * - *

- * This specimen should live indefinitely. It should only terminate when the debugger or - * operating system kills it. A good example on UNIX is "{@code dd}". - * - * @return the specimen - */ - DebuggerTestSpecimen getAttachSpecimen(); -} diff --git a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/RequiresLaunchSpecimen.java b/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/RequiresLaunchSpecimen.java deleted file mode 100644 index f5995e6ea5..0000000000 --- a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/RequiresLaunchSpecimen.java +++ /dev/null @@ -1,33 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.test; - -import ghidra.dbg.test.AbstractDebuggerModelTest.DebuggerTestSpecimen; - -public interface RequiresLaunchSpecimen { - - /** - * Get the specimen to use for launch tests - * - *

- * This specimen should live for only a short period of time. When left to execute freely, it - * should immediately terminate on its own without error. A good example on UNIX is - * "{@code echo Hello, World!}" - * - * @return the specimen - */ - DebuggerTestSpecimen getLaunchSpecimen(); -} diff --git a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/RequiresTarget.java b/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/RequiresTarget.java deleted file mode 100644 index fde6929180..0000000000 --- a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/test/RequiresTarget.java +++ /dev/null @@ -1,34 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.test; - -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.TargetProcess; -import ghidra.dbg.testutil.DebuggerModelTestUtils; - -public interface RequiresTarget extends DebuggerModelTestUtils { - - /** - * Perform whatever minimal setup is necessary to obtain a target suitable for testing - * - *

- * For user-mode debugging this is almost certainly a {@link TargetProcess}. - * - * @return the target - * @throws Throwable if anything goes wrong - */ - TargetObject obtainTarget() throws Throwable; -} diff --git a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/testutil/CallbackValidator.java b/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/testutil/CallbackValidator.java deleted file mode 100644 index 04907c02ff..0000000000 --- a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/testutil/CallbackValidator.java +++ /dev/null @@ -1,394 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.testutil; - -import static org.junit.Assert.*; - -import java.util.*; -import java.util.Map.Entry; - -import ghidra.dbg.*; -import ghidra.dbg.agent.AbstractTargetObject; -import ghidra.dbg.attributes.TargetObjectList; -import ghidra.dbg.attributes.TargetStringList; -import ghidra.dbg.error.DebuggerMemoryAccessException; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetAttacher.TargetAttachKind; -import ghidra.dbg.target.TargetAttacher.TargetAttachKindSet; -import ghidra.dbg.target.TargetBreakpointSpec.TargetBreakpointKind; -import ghidra.dbg.target.TargetBreakpointSpecContainer.TargetBreakpointKindSet; -import ghidra.dbg.target.TargetConsole.Channel; -import ghidra.dbg.target.TargetEventScope.TargetEventType; -import ghidra.dbg.target.TargetExecutionStateful.TargetExecutionState; -import ghidra.dbg.target.TargetMethod.TargetParameterMap; -import ghidra.dbg.target.TargetSteppable.TargetStepKind; -import ghidra.dbg.target.TargetSteppable.TargetStepKindSet; -import ghidra.program.model.address.Address; -import ghidra.program.model.address.AddressRange; -import ghidra.util.Msg; -import ghidra.util.NumericUtilities; - -public class CallbackValidator implements DebuggerModelListener, AutoCloseable { - - protected static class CreationRecord { - private final TargetObject object; - private final Throwable stack; - - public CreationRecord(TargetObject object) { - this.object = object; - this.stack = new Throwable("Existing object created here"); - } - } - - public CatchOffThread off = new CatchOffThread(); - - public final DebuggerObjectModel model; - public Thread thread = null; - public Map valid = new HashMap<>(); - - // Knobs - // TODO: Make these methods instead? - public boolean log = false; - public boolean requireSameThread = true; - public boolean requireSameModel = true; - public boolean requireValid = true; - public boolean requireProxy = true; - public Set> allowedTypes = Set.of( // When not a TargetObject - Boolean.class, boolean.class, Byte.class, byte.class, byte[].class, Character.class, - char.class, Double.class, double.class, Float.class, float.class, Integer.class, int.class, - Long.class, long.class, String.class, TargetStringList.class, Address.class, - AddressRange.class, TargetAttachKind.class, TargetAttachKindSet.class, - TargetBreakpointKind.class, TargetBreakpointKindSet.class, TargetStepKind.class, - TargetStepKindSet.class, TargetExecutionState.class, TargetEventType.class, - TargetParameterMap.class, TargetObjectList.class, Class.class); - - public CallbackValidator(DebuggerObjectModel model) { - this.model = model; - model.addModelListener(this, true); - } - - public void validateCallbackThread(String callback) { - if (thread == null) { - thread = Thread.currentThread(); - } - if (requireSameThread) { - assertEquals("Callback " + callback + " came from an unexpected thread", thread, - Thread.currentThread()); - } - } - - public void validateCompletionThread() { - if (thread == null) { - thread = Thread.currentThread(); - } - if (requireSameThread) { - assertEquals("Completion came from an unexpected thread. Probably forgot gateFuture()", - thread, Thread.currentThread()); - } - } - - public void validateObjectModel(String callback, TargetObject obj) { - if (requireSameModel) { - assertEquals("Callback " + callback + " included foreign object " + obj, model, - obj.getModel()); - } - } - - public void validateObjectProxy(String callback, TargetObject obj) { - if (requireProxy && obj instanceof AbstractTargetObject) { - AbstractTargetObject ato = (AbstractTargetObject) obj; - assertEquals( - "Non-proxy object " + obj.getJoinedPath(".") + "leaked into callback " + callback, - obj, ato.getProxy()); - } - } - - public void validateObjectValid(String callback, TargetObject obj) { - if (requireValid) { - assertTrue("Object " + obj.getJoinedPath(".") + " invalid during callback " + callback, - valid.containsKey(obj)); - } - } - - public void validateObjectInvalid(String callback, TargetObject obj) { - if (requireValid) { - assertFalse("Object " + obj.getJoinedPath(".") + " valid during callback " + callback + - ", but should have been invalid", valid.containsKey(obj)); - } - } - - public void validateInvalidObject(String callback, TargetObject obj) { - assertNotNull(obj); - validateObjectModel(callback, obj); - validateObjectProxy(callback, obj); - validateObjectInvalid(callback, obj); - } - - public void validateObject(String callback, TargetObject obj) { - assertNotNull(obj); - validateObjectModel(callback, obj); - validateObjectProxy(callback, obj); - validateObjectValid(callback, obj); - } - - public void validateObjectOptional(String callback, TargetObject obj) { - if (obj != null) { - validateObject(callback, obj); - } - } - - public void validateObjects(String callback, Collection objs) { - for (TargetObject obj : objs) { - validateObject(callback, obj); - } - } - - public void validateObjectsInMap(String callback, Map map) { - for (Entry ent : map.entrySet()) { - Object obj = ent.getValue(); - validateObjectOrAllowedType(callback + "(key=" + ent.getKey() + ")", obj); - } - } - - public void validateObjectOrAllowedType(String callback, Object obj) { - if (obj instanceof TargetObject) { - validateObject(callback, (TargetObject) obj); - return; - } - for (Class cls : allowedTypes) { - if (cls.isInstance(obj)) { - return; - } - } - fail( - "Invalid object type in callback " + callback + " " + obj + "(" + obj.getClass() + ")"); - } - - public void validateObjectsInCollection(String callback, Collection objs) { - for (Object obj : objs) { - validateObjectOrAllowedType(callback, obj); - } - } - - @Override - public synchronized void catastrophic(Throwable t) { - if (log) { - Msg.info(this, "catastrophic(t=" + t + ")"); - } - off.catching(() -> { - throw new AssertionError("Catastrophic error", t); - }); - } - - @Override - public void modelClosed(DebuggerModelClosedReason reason) { - if (log) { - Msg.info(this, "modelClosed(reason=" + reason + ")"); - } - } - - @Override - public synchronized void elementsChanged(TargetObject object, Collection removed, - Map added) { - if (log) { - Msg.info(this, "elementsChanged(object=" + object + ",removed=" + removed + ",added=" + - added + ")"); - } - off.catching(() -> { - validateCallbackThread("elementsChanged"); - validateObject("elementsChanged.object", object); - validateObjectsInMap("elementsChanged.added(object=" + object.getJoinedPath(".") + ")", - added); - }); - } - - @Override - public synchronized void attributesChanged(TargetObject object, Collection removed, - Map added) { - if (log) { - Msg.info(this, "attributesChanged(object=" + object + ",removed=" + removed + - ",added=" + added + ")"); - } - off.catching(() -> { - validateCallbackThread("attributesChanged"); - validateObject("attributesChanged.object", object); - validateObjectsInMap( - "attributesChanged.added(object=" + object.getJoinedPath(".") + ")", added); - }); - } - - @Override - public synchronized void breakpointHit(TargetObject container, TargetObject trapped, - TargetStackFrame frame, TargetBreakpointSpec spec, - TargetBreakpointLocation breakpoint) { - if (log) { - Msg.info(this, "breakpointHit(container=" + container + ",trapped=" + trapped + - ",frame=" + frame + ",spec=" + spec + ",breakpoint=" + breakpoint + ")"); - } - off.catching(() -> { - validateCallbackThread("breakpointHit"); - validateObject("breakpointHit.container", container); - validateObject("breakpointHit.trapped", trapped); - validateObjectOptional("breakpointHit.frame", frame); - validateObject("breakpointHit.spec", spec); - validateObject("breakpointHit.breakpoint", breakpoint); - }); - } - - @Override - public synchronized void consoleOutput(TargetObject console, Channel channel, byte[] data) { - if (log) { - Msg.info(this, "consoleOutput(console=" + console + ",channel=" + channel + ",data=" + - new String(data) + ")"); - } - off.catching(() -> { - validateCallbackThread("consoleOutput"); - validateObject("consoleOutput", console); - assertNotNull(data); - }); - } - - @Override - public synchronized void created(TargetObject object) { - if (log) { - Msg.info(this, "created(object=" + object + ")"); - } - CreationRecord record = new CreationRecord(object); - CreationRecord exists = valid.put(object, record); - off.catching(() -> { - if (exists != null) { - Msg.error(this, "Original creation: ", exists.stack); - Msg.error(this, "New creation: ", record.stack); - if (exists.object == object) { - fail("created twice (same object): " + object.getJoinedPath(".")); - } - else { - fail("replaced before invalidation. old=" + exists.object + ", new=" + object); - } - } - validateCallbackThread("created"); - validateObject("created", object); - }); - } - - @Override - public synchronized void event(TargetObject object, TargetThread eventThread, - TargetEventType type, String description, List parameters) { - if (log) { - Msg.info(this, "event(object=" + object + ",eventThread=" + eventThread + ",type=" + - type + ",description=" + description + ",parameters=" + parameters + ")"); - } - off.catching(() -> { - validateCallbackThread("event(" + type + ")"); - validateObject("event(" + type + ")", object); - if (type == TargetEventType.THREAD_CREATED || type == TargetEventType.THREAD_EXITED) { - validateObject("event(" + type + ")", eventThread); - } - else { - validateObjectOptional("event(" + type + ").eventThread", eventThread); - } - assertNotNull(type); - assertNotNull(description); - validateObjectsInCollection("event(" + type + ").parameters", parameters); - }); - } - - @Override - public synchronized void invalidateCacheRequested(TargetObject object) { - if (log) { - Msg.info(this, "invalidateCacheRequested(object=" + object + ")"); - } - off.catching(() -> { - validateCallbackThread("invalidateCacheRequested"); - validateObject("invalidateCacheRequested", object); - }); - } - - @Override - public synchronized void invalidated(TargetObject object, TargetObject branch, String reason) { - if (log) { - Msg.info(this, - "invalidated(object=" + object + ",branch=" + branch + ",reason=" + reason + ")"); - } - off.catching(() -> { - validateCallbackThread("invalidated"); - validateObject("invalidated", object); - valid.remove(object); - validateInvalidObject("invalidated", branch); // pre-ordered callbacks - assertNotNull(reason); - }); - } - - @Override - public synchronized void memoryReadError(TargetObject memory, AddressRange range, - DebuggerMemoryAccessException e) { - if (log) { - Msg.info(this, - "memoryReadError(memory=" + memory + ",range=" + range + ",e=" + e + ")"); - } - off.catching(() -> { - validateCallbackThread("memoryReadError"); - validateObject("memoryReadError", memory); - assertNotNull(range); - throw new AssertionError("Memory read error", e); - }); - } - - @Override - public void memoryUpdated(TargetObject memory, Address address, byte[] data) { - if (log) { - Msg.info(this, "memoryUpdated(memory=" + memory + ",address=" + address + ",data=" + - NumericUtilities.convertBytesToString(data) + ")"); - } - off.catching(() -> { - validateCallbackThread("memoryUpdated"); - validateObject("memoryUpdated", memory); - assertNotNull(address); - // TODO: Validate address for regions - assertNotNull(data); - }); - } - - @Override - public void registersUpdated(TargetObject bank, Map updates) { - if (log) { - Msg.info(this, "registersUpdated(bank=" + bank + ",updates=" + - DebuggerModelTestUtils.hexlify(updates) + ")"); - } - off.catching(() -> { - validateCallbackThread("registersUpdated"); - validateObject("registersUpdated", bank); - assertNotNull(updates); - // TODO: Validate names to descriptions, including lengths of values - }); - } - - @Override - public void rootAdded(TargetObject root) { - if (log) { - Msg.info(this, "rootAdded(root=" + root + ")"); - } - off.catching(() -> { - validateCallbackThread("rootAdded"); - validateObject("rootAdded", root); - }); - } - - @Override - public synchronized void close() throws Exception { - off.close(); - } -} diff --git a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/testutil/DebuggerModelTestUtils.java b/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/testutil/DebuggerModelTestUtils.java index 4d5a23fb55..af8e3144da 100644 --- a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/testutil/DebuggerModelTestUtils.java +++ b/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/testutil/DebuggerModelTestUtils.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -15,272 +15,7 @@ */ package ghidra.dbg.testutil; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import java.util.*; -import java.util.Map.Entry; -import java.util.function.Predicate; -import java.util.stream.Collectors; - -import ghidra.async.*; -import ghidra.dbg.*; -import ghidra.dbg.DebugModelConventions.AsyncAccess; -import ghidra.dbg.DebuggerObjectModel.RefreshBehavior; -import ghidra.dbg.error.DebuggerMemoryAccessException; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetConsole.Channel; -import ghidra.dbg.target.TargetEventScope.TargetEventType; -import ghidra.dbg.target.TargetSteppable.TargetStepKind; -import ghidra.dbg.test.AbstractDebuggerModelTest; -import ghidra.dbg.test.AbstractDebuggerModelTest.DebuggerTestSpecimen; -import ghidra.dbg.util.PathUtils; -import ghidra.program.model.address.Address; -import ghidra.program.model.address.AddressRange; -import ghidra.util.NumericUtilities; +import ghidra.async.AsyncTestUtils; public interface DebuggerModelTestUtils extends AsyncTestUtils { - - default byte[] arr(String hex) { - return NumericUtilities.convertStringToBytes(hex); - } - - /** - * Performs the cast, after verifying the schema, too - * - * @param the type of the object - * @param type the class of the object - * @param obj the object to cast - * @return the same object - */ - default T cast(Class type, TargetObject obj) { - assertTrue(obj.getSchema().getInterfaces().contains(type)); - return type.cast(obj); - } - - default T ancestor(Class type, TargetObject seed) throws Throwable { - return DebugModelConventions.ancestor(type, seed); - } - - default AsyncAccess access(TargetObject obj) throws Throwable { - return new AsyncAccess( - ancestor(TargetAccessConditioned.class, Objects.requireNonNull(obj))); - } - - default void waitAcc(TargetObject obj) throws Throwable { - AsyncAccess acc = access(obj); - waitAcc(acc); - acc.dispose(); - } - - default void waitAcc(AsyncReference access) throws Throwable { - waitOn(access.waitValue(true)); - } - - default void cli(TargetObject interpreter, String cmd) throws Throwable { - TargetInterpreter as = interpreter.as(TargetInterpreter.class); - waitOn(as.execute(cmd)); - } - - default String captureCli(TargetObject interpreter, String cmd) throws Throwable { - TargetInterpreter as = interpreter.as(TargetInterpreter.class); - return waitOn(as.executeCapture(cmd)); - } - - default void launch(TargetObject launcher, Map args) throws Throwable { - TargetLauncher as = launcher.as(TargetLauncher.class); - waitOn(as.launch(args)); - } - - default void resume(TargetObject resumable) throws Throwable { - TargetResumable as = resumable.as(TargetResumable.class); - waitOn(as.resume()); - } - - default void step(TargetObject steppable, TargetStepKind kind) throws Throwable { - TargetSteppable as = steppable.as(TargetSteppable.class); - waitOn(as.step(kind)); - } - - default TargetObject getFocus(TargetObject scope) { - TargetFocusScope as = scope.as(TargetFocusScope.class); - return as.getFocus(); - } - - default void focus(TargetObject scope, TargetObject focus) throws Throwable { - TargetFocusScope as = scope.as(TargetFocusScope.class); - waitOn(as.requestFocus(focus)); - } - - static Map hexlify(Map map) { - return map.entrySet() - .stream() - .collect(Collectors.toMap(Entry::getKey, - e -> NumericUtilities.convertBytesToString(e.getValue()))); - } - - /** - * Assert that there is a single reference with shortest path, and get it - * - * @param the type of object reference - * @param refs the map of paths to references, sorted shortest-key-first - * @return the value of the entry with shortest key - */ - default T assertUniqueShortest(NavigableMap, T> refs) { - assertTrue(refs.size() >= 1); - Iterator, T>> rit = refs.entrySet().iterator(); - Entry, T> shortest = rit.next(); - if (!rit.hasNext()) { - return shortest.getValue(); - } - Entry, T> next = rit.next(); - assertTrue("Shortest is not unique: " + refs, - next.getKey().size() > shortest.getKey().size()); - - return shortest.getValue(); - } - - default TargetAttachable getAttachable(Collection attachables, - DebuggerTestSpecimen specimen, DummyProc dummy, AbstractDebuggerModelTest test) { - return attachables.stream().filter(a -> { - try { - return specimen.isAttachable(dummy, a, test); - } - catch (Throwable e) { - throw new AssertionError(e); - } - }).findFirst().orElse(null); - } - - default TargetProcess getProcessRunning(Collection processes, - DebuggerTestSpecimen specimen, AbstractDebuggerModelTest test) { - return getProcessRunning(processes, specimen, test, p -> true); - } - - default TargetProcess getProcessRunning(Collection processes, - DebuggerTestSpecimen specimen, AbstractDebuggerModelTest test, - Predicate predicate) { - return processes.stream().filter(p -> { - try { - return predicate.test(p) && specimen.isRunningIn(p, test); - } - catch (Throwable e) { - throw new AssertionError(e); - } - }).findFirst().orElse(null); - } - - default Collection fetchProcesses(AbstractDebuggerModelTest test) - throws Throwable { - return test.m.findAll(TargetProcess.class, PathUtils.parse(""), false).values(); - } - - @SuppressWarnings({ "rawtypes", "unchecked" }) - default Collection fetchAttachables(TargetObject container) - throws Throwable { - return (Collection) waitOn(container.fetchElements(RefreshBehavior.REFRESH_ALWAYS)).values(); - } - - default TargetProcess getProcessRunning(DebuggerTestSpecimen specimen, - AbstractDebuggerModelTest test) throws Throwable { - return getProcessRunning(specimen, test, p -> true); - } - - default TargetProcess getProcessRunning(DebuggerTestSpecimen specimen, - AbstractDebuggerModelTest test, Predicate predicate) throws Throwable { - return getProcessRunning(fetchProcesses(test), specimen, test, predicate); - } - - default TargetProcess retryForProcessRunning( - DebuggerTestSpecimen specimen, AbstractDebuggerModelTest test) throws Throwable { - return retry(() -> { - TargetProcess process = getProcessRunning(specimen, test); - assertNotNull(process); - return process; - }, List.of(AssertionError.class)); - } - - default TargetProcess retryForOtherProcessRunning(DebuggerTestSpecimen specimen, - AbstractDebuggerModelTest test, Predicate predicate, long timeoutMs) - throws Throwable { - return retry(timeoutMs, () -> { - TargetProcess process = getProcessRunning(specimen, test, predicate); - assertNotNull(process); - return process; - }, List.of(AssertionError.class)); - } - - default void waitSettled(DebuggerObjectModel model, int ms) throws Throwable { - AsyncDebouncer debouncer = new AsyncDebouncer<>(AsyncTimer.DEFAULT_TIMER, ms); - var listener = new DebuggerModelListener() { - @Override - public void attributesChanged(TargetObject object, Collection removed, - Map added) { - debouncer.contact(null); - } - - @Override - public void breakpointHit(TargetObject container, TargetObject trapped, - TargetStackFrame frame, TargetBreakpointSpec spec, - TargetBreakpointLocation breakpoint) { - debouncer.contact(null); - } - - @Override - public void consoleOutput(TargetObject console, Channel channel, byte[] data) { - debouncer.contact(null); - } - - @Override - public void created(TargetObject object) { - debouncer.contact(null); - } - - @Override - public void elementsChanged(TargetObject object, Collection removed, - Map added) { - debouncer.contact(null); - } - - @Override - public void event(TargetObject object, TargetThread eventThread, TargetEventType type, - String description, List parameters) { - debouncer.contact(null); - } - - @Override - public void invalidateCacheRequested(TargetObject object) { - debouncer.contact(null); - } - - @Override - public void invalidated(TargetObject object, TargetObject branch, String reason) { - debouncer.contact(null); - } - - @Override - public void memoryReadError(TargetObject memory, AddressRange range, - DebuggerMemoryAccessException e) { - debouncer.contact(null); - } - - @Override - public void memoryUpdated(TargetObject memory, Address address, byte[] data) { - debouncer.contact(null); - } - - @Override - public void registersUpdated(TargetObject bank, Map updates) { - debouncer.contact(null); - } - - @Override - public void rootAdded(TargetObject root) { - debouncer.contact(null); - } - }; - model.addModelListener(listener); - debouncer.contact(null); - waitOnNoValidate(debouncer.settled()); - } } diff --git a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/testutil/EventValidator.java b/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/testutil/EventValidator.java deleted file mode 100644 index 423151359f..0000000000 --- a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/testutil/EventValidator.java +++ /dev/null @@ -1,297 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.testutil; - -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.fail; - -import java.util.*; -import java.util.function.Function; - -import ghidra.dbg.DebuggerModelListener; -import ghidra.dbg.DebuggerObjectModel; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetEventScope.TargetEventType; -import ghidra.util.Msg; - -public class EventValidator - implements DebuggerModelListener, AutoCloseable, DebuggerModelTestUtils { - public CatchOffThread off = new CatchOffThread(); - - interface Observation { - String getEvent(); - - TargetObject getObject(); - - Observation inParameter(String event); - - default Observation inAncestor(String event, TargetObject successor) { - return inParameter("Parent of " + successor.getJoinedPath(".") + " in " + event); - } - - Observation inCreated(String event); - - Observation inDestroyed(String event); - } - - static abstract class AbstractObservation implements Observation { - private final String event; - private final TargetObject object; - - public AbstractObservation(String event, TargetObject object) { - this.event = event; - this.object = object; - } - - @Override - public String getEvent() { - return event; - } - - @Override - public TargetObject getObject() { - return object; - } - - protected String getPath() { - return object.getJoinedPath("."); - } - } - - static class NoObservation extends AbstractObservation { - public NoObservation(TargetObject object) { - super("[none]", object); - } - - @Override - public Observation inParameter(String event) { - return new UseObservation(event, getObject()); - } - - @Override - public Observation inCreated(String event) { - return new CreatedObservation(event, getObject()); - } - - @Override - public Observation inDestroyed(String event) { - return new DestroyedObservation(event, getObject()); - } - } - - static class UseObservation extends AbstractObservation { - public UseObservation(String event, TargetObject object) { - super(event, object); - } - - @Override - public Observation inParameter(String event) { - return this; - } - - @Override - public Observation inCreated(String event) { - throw new AssertionError( - "Observed " + getEvent() + " for " + getPath() + " before " + event); - } - - @Override - public Observation inDestroyed(String event) { - return new DestroyedObservation(event, getObject()); - } - } - - static class CreatedObservation extends AbstractObservation { - public CreatedObservation(String event, TargetObject object) { - super(event, object); - } - - @Override - public Observation inParameter(String event) { - return this; - } - - @Override - public Observation inCreated(String event) { - throw new AssertionError("Observed double-" + event + " of " + getPath()); - } - - @Override - public Observation inDestroyed(String event) { - return new DestroyedObservation(event, getObject()); - } - } - - static class DestroyedObservation extends AbstractObservation { - public DestroyedObservation(String event, TargetObject object) { - super(event, object); - } - - @Override - public Observation inParameter(String event) { - throw new AssertionError( - "Observed " + event + " of " + getPath() + " after " + getEvent()); - } - - @Override - public Observation inCreated(String event) { - return new CreatedObservation(event, getObject()); - } - - @Override - public Observation inDestroyed(String event) { - throw new AssertionError("Observed double-" + event + " of " + getPath()); - } - } - - public final DebuggerObjectModel model; - public Map processes = new HashMap<>(); - public Map threads = new HashMap<>(); - public Map modules = new HashMap<>(); - - // Knobs - public boolean log = false; - - public EventValidator(DebuggerObjectModel model) { - this.model = model; - model.addModelListener(this); - } - - @Override - public void invalidated(TargetObject object, TargetObject branch, String reason) { - if (log) { - Msg.info(this, - "invalidated(object=" + object + ",branch=" + branch + ",reason=" + reason + ")"); - } - processes.remove(object); - threads.remove(object); - modules.remove(object); - } - - @Override - public synchronized void event(TargetObject object, TargetThread eventThread, - TargetEventType type, String description, List parameters) { - if (log) { - Msg.info(this, - "event(object=" + object + ",eventThread=" + eventThread + ",type=" + type + - ",description=" + description + ",parameters=" + parameters + ")"); - } - off.catching(() -> { - switch (type) { - case PROCESS_CREATED: - validateCreated(type.name(), TargetProcess.class, processes, parameters); - break; - case PROCESS_EXITED: - validateDestroyed(type.name(), TargetProcess.class, processes, parameters); - break; - case THREAD_CREATED: - validateCreated(type.name(), TargetThread.class, threads, parameters); - break; - case THREAD_EXITED: - validateDestroyed(type.name(), TargetThread.class, threads, parameters); - break; - case STOPPED: - case RUNNING: - case BREAKPOINT_HIT: - case STEP_COMPLETED: - case EXCEPTION: - case SIGNAL: - validateParameters(type.name(), parameters); - break; - default: - fail("Unexpected event type"); - } - }); - } - - protected void observe(Map map, T object, - Function func) { - map.compute(object, (__, observation) -> { - if (observation == null) { - observation = new NoObservation(object); - } - return func.apply(observation); - }); - } - - protected void validateParameters(String event, List objects) { - for (Object obj : objects) { - if (obj instanceof TargetProcess) { - observe(processes, (TargetProcess) obj, o -> o.inParameter(event)); - } - if (obj instanceof TargetThread) { - observe(threads, (TargetThread) obj, o -> o.inParameter(event)); - } - if (obj instanceof TargetModule) { - observe(modules, (TargetModule) obj, o -> o.inParameter(event)); - } - } - } - - protected void validateAncestors(String event, TargetObject object) { - TargetObject ancestor = object; - while (null != (ancestor = ancestor.getParent())) { // Yes, pre-step to parent - if (ancestor instanceof TargetProcess) { - observe(processes, (TargetProcess) ancestor, o -> o.inAncestor(event, object)); - } - if (ancestor instanceof TargetThread) { - observe(threads, (TargetThread) ancestor, o -> o.inAncestor(event, object)); - } - if (ancestor instanceof TargetModule) { - observe(modules, (TargetModule) ancestor, o -> o.inAncestor(event, object)); - } - } - } - - protected T doGetFirstAs(Class cls, List objects) { - if (objects.isEmpty()) { - return null; - } - Object first = objects.get(0); - if (!cls.isInstance(first)) { - return null; - } - return cls.cast(first); - } - - protected T getFirstAs(String event, Class cls, List objects) { - T result = doGetFirstAs(cls, objects); - assertNotNull("The first parameter of " + event + " must be a " + cls.getSimpleName(), - result); - return result; - } - - protected void validateCreated(String event, Class cls, - Map map, List objects) { - T t = getFirstAs(event, cls, objects); - observe(map, t, o -> o.inCreated(event)); - validateAncestors(event, t); - validateParameters(event, objects.subList(1, objects.size())); - } - - protected void validateDestroyed(String event, Class cls, - Map map, List objects) { - T t = getFirstAs(event, cls, objects); - observe(map, t, o -> o.inDestroyed(event)); - validateAncestors(event, t); - validateParameters(event, objects.subList(1, objects.size())); - } - - @Override - public synchronized void close() throws Exception { - off.close(); - } -} diff --git a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/util/DebuggerCallbackReordererTest.java b/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/util/DebuggerCallbackReordererTest.java deleted file mode 100644 index 25fa53303c..0000000000 --- a/Ghidra/Debug/Framework-Debugging/src/test/java/ghidra/dbg/util/DebuggerCallbackReordererTest.java +++ /dev/null @@ -1,417 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.dbg.util; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; - -import org.junit.Test; - -import ghidra.dbg.DebuggerModelListener; -import ghidra.dbg.agent.AbstractDebuggerObjectModel; -import ghidra.dbg.agent.DefaultDebuggerObjectModelTest.FakeTargetObject; -import ghidra.dbg.agent.DefaultDebuggerObjectModelTest.FakeTargetRegisterBank; -import ghidra.dbg.agent.DefaultTargetModelRoot; -import ghidra.dbg.model.EmptyDebuggerObjectModel; -import ghidra.dbg.target.*; -import ghidra.dbg.target.TargetEventScope.TargetEventType; -import ghidra.dbg.target.schema.*; -import ghidra.dbg.testutil.DebuggerModelTestUtils; - -public class DebuggerCallbackReordererTest implements DebuggerModelTestUtils { - - @TargetObjectSchemaInfo - public static class EmptyTargetSession extends DefaultTargetModelRoot { - public EmptyTargetSession(AbstractDebuggerObjectModel model, String typeHint, - TargetObjectSchema schema) { - super(model, typeHint, schema); - } - } - - public static final AnnotatedSchemaContext SCHEMA_CTX = new AnnotatedSchemaContext(); - public static final TargetObjectSchema EMPTY_SCHEMA = - SCHEMA_CTX.getSchemaForClass(EmptyTargetSession.class); - - public static class TestReorderedListener implements DebuggerModelListener { - protected final DebuggerCallbackReorderer reorderer = new DebuggerCallbackReorderer(this); - protected final Map, CompletableFuture> waits; - protected final List added = new ArrayList<>(); - - public TestReorderedListener(Collection> paths) { - waits = - paths.stream().collect(Collectors.toMap(p -> p, p -> new CompletableFuture<>())); - } - - protected void done(TargetObject obj) { - synchronized (added) { - added.add(obj); - } - CompletableFuture cf = waits.get(obj.getPath()); - if (cf != null) { - cf.complete(obj); - } - } - - public CompletableFuture get(List path) { - return waits.get(path); - } - - public List getAdded() { - synchronized (added) { - assertEquals("Duplicates added: " + added, added.size(), Set.copyOf(added).size()); - return List.copyOf(added); - } - } - - @Override - public void rootAdded(TargetObject root) { - done(root); - } - - @Override - public void attributesChanged(TargetObject object, Collection removed, - Map added) { - for (Object val : added.values()) { - if (val instanceof TargetObject) { - done((TargetObject) val); - } - } - } - - @Override - public void elementsChanged(TargetObject object, Collection removed, - Map added) { - for (TargetObject obj : added.values()) { - done(obj); - } - } - } - - @Test - public void testRootOnly() throws Throwable { - EmptyDebuggerObjectModel model = new EmptyDebuggerObjectModel(); - TestReorderedListener listener = new TestReorderedListener(List.of(PathUtils.parse(""))); - model.addModelListener(listener.reorderer); - - assertEquals(List.of(), listener.getAdded()); - DefaultTargetModelRoot root = - new DefaultTargetModelRoot(model, "Root", model.getRootSchema()); - model.addModelRoot(root); - assertEquals(root, waitOn(listener.get(PathUtils.parse("")))); - } - - @Test - public void testChain2TopDown() throws Throwable { - EmptyDebuggerObjectModel model = new EmptyDebuggerObjectModel(); - TestReorderedListener listener = - new TestReorderedListener(List.of(PathUtils.parse("A[1]"))); - model.addModelListener(listener.reorderer); - - DefaultTargetModelRoot root = - new DefaultTargetModelRoot(model, "Root", model.getRootSchema()); - FakeTargetObject toA = new FakeTargetObject(model, root, "A"); - FakeTargetObject toA1 = new FakeTargetObject(model, toA, "[1]"); - - model.addModelRoot(root); - root.changeAttributes(List.of(), List.of(toA), Map.of(), "Test"); - toA.changeElements(List.of(), List.of(toA1), "Test"); - - assertEquals(toA1, waitOn(listener.get(PathUtils.parse("A[1]")))); - assertEquals(List.of(root, toA, toA1), listener.getAdded()); - } - - @Test - public void testChain2BottomUp() throws Throwable { - EmptyDebuggerObjectModel model = new EmptyDebuggerObjectModel(); - TestReorderedListener listener = - new TestReorderedListener(List.of(PathUtils.parse("A[1]"))); - model.addModelListener(listener.reorderer); - - DefaultTargetModelRoot root = - new DefaultTargetModelRoot(model, "Root", model.getRootSchema()); - FakeTargetObject toA = new FakeTargetObject(model, root, "A"); - FakeTargetObject toA1 = new FakeTargetObject(model, toA, "[1]"); - - toA.changeElements(List.of(), List.of(toA1), "Test"); - root.changeAttributes(List.of(), List.of(toA), Map.of(), "Test"); - model.addModelRoot(root); - - assertEquals(toA1, waitOn(listener.get(PathUtils.parse("A[1]")))); - assertEquals(List.of(root, toA, toA1), listener.getAdded()); - } - - @Test - public void testChain3RootLast() throws Throwable { - EmptyDebuggerObjectModel model = new EmptyDebuggerObjectModel(); - TestReorderedListener listener = - new TestReorderedListener(List.of(PathUtils.parse("A[1].i"))); - model.addModelListener(listener.reorderer); - - DefaultTargetModelRoot root = - new DefaultTargetModelRoot(model, "Root", model.getRootSchema()); - FakeTargetObject toA = new FakeTargetObject(model, root, "A"); - FakeTargetObject toA1 = new FakeTargetObject(model, toA, "[1]"); - FakeTargetObject toA1i = new FakeTargetObject(model, toA1, "i"); - - toA.changeElements(List.of(), List.of(toA1), "Test"); - root.changeAttributes(List.of(), List.of(toA), Map.of(), "Test"); - toA1.changeAttributes(List.of(), List.of(toA1i), Map.of(), "Test"); - model.addModelRoot(root); - - assertEquals(toA1i, waitOn(listener.get(PathUtils.parse("A[1].i")))); - assertEquals(List.of(root, toA, toA1, toA1i), listener.getAdded()); - } - - @Test - public void test2xChain2BottomUpBreadth() throws Throwable { - EmptyDebuggerObjectModel model = new EmptyDebuggerObjectModel(); - TestReorderedListener listener = new TestReorderedListener(List.of( - PathUtils.parse("A[1]"), - PathUtils.parse("B[2]"))); - model.addModelListener(listener.reorderer); - - DefaultTargetModelRoot root = - new DefaultTargetModelRoot(model, "Root", model.getRootSchema()); - FakeTargetObject toA = new FakeTargetObject(model, root, "A"); - FakeTargetObject toA1 = new FakeTargetObject(model, toA, "[1]"); - FakeTargetObject toB = new FakeTargetObject(model, root, "B"); - FakeTargetObject toB2 = new FakeTargetObject(model, toB, "[2]"); - - toA.changeElements(List.of(), List.of(toA1), "Test"); - toB.changeElements(List.of(), List.of(toB2), "Test"); - root.changeAttributes(List.of(), List.of(toA, toB), Map.of(), "Test"); - model.addModelRoot(root); - - assertEquals(toA1, waitOn(listener.get(PathUtils.parse("A[1]")))); - assertEquals(toB2, waitOn(listener.get(PathUtils.parse("B[2]")))); - - // Note the order is not unique, but there are constraints. - // It's similar to a topological sort. - List order = List.copyOf(listener.getAdded()); - assertEquals(0, order.indexOf(root)); - assertTrue(order.indexOf(root) < order.indexOf(toA)); - assertTrue(order.indexOf(root) < order.indexOf(toB)); - assertTrue(order.indexOf(toA) < order.indexOf(toA1)); - assertTrue(order.indexOf(toB) < order.indexOf(toB2)); - } - - @Test - public void test2xChain2BottomUpDepthRootBefore2nd() throws Throwable { - EmptyDebuggerObjectModel model = new EmptyDebuggerObjectModel(); - TestReorderedListener listener = new TestReorderedListener(List.of( - PathUtils.parse("A[1]"), - PathUtils.parse("B[2]"))); - model.addModelListener(listener.reorderer); - - DefaultTargetModelRoot root = - new DefaultTargetModelRoot(model, "Root", model.getRootSchema()); - FakeTargetObject toA = new FakeTargetObject(model, root, "A"); - FakeTargetObject toA1 = new FakeTargetObject(model, toA, "[1]"); - FakeTargetObject toB = new FakeTargetObject(model, root, "B"); - FakeTargetObject toB2 = new FakeTargetObject(model, toB, "[2]"); - - toA.changeElements(List.of(), List.of(toA1), "Test"); - root.changeAttributes(List.of(), List.of(toA), Map.of(), "Test"); - model.addModelRoot(root); - toB.changeElements(List.of(), List.of(toB2), "Test"); - root.changeAttributes(List.of(), List.of(toB), Map.of(), "Test"); - - assertEquals(toA1, waitOn(listener.get(PathUtils.parse("A[1]")))); - assertEquals(toB2, waitOn(listener.get(PathUtils.parse("B[2]")))); - assertEquals(List.of(root, toA, toA1, toB, toB2), listener.getAdded()); - } - - @Test - public void testEventOrdering() throws Throwable { - EmptyDebuggerObjectModel model = new EmptyDebuggerObjectModel(); - var listener = new TestReorderedListener(List.of(PathUtils.parse("A[r1].i"))) { - List captured; - - @Override - public void registersUpdated(TargetObject bank, Map updates) { - captured = getAdded(); // NB. "duplicates" exception may cause NPE - } - }; - model.addModelListener(listener.reorderer); - - DefaultTargetModelRoot root = - new DefaultTargetModelRoot(model, "Root", model.getRootSchema()); - FakeTargetObject toA = new FakeTargetRegisterBank(model, root, "A"); - FakeTargetObject toA1 = new FakeTargetObject(model, toA, "[r1]"); - FakeTargetObject toA1i = new FakeTargetObject(model, toA1, "i"); - - /** - * Because A's elements will be added before registersUpdated is replayed, we wait on a - * child of [r1], to guarantee registersUpdated has happened - */ - toA.changeElements(List.of(), List.of(toA1), "Test"); - toA.broadcast().registersUpdated(toA, Map.of("r1", new byte[4])); - root.changeAttributes(List.of(), List.of(toA), Map.of(), "Test"); - /** - * CFs may get queued in depth, so add root here to ensure registersUpdated comes before - * toA1i - */ - model.addModelRoot(root); - toA1.changeAttributes(List.of(), List.of(toA1i), Map.of(), "Test"); - - assertEquals(toA1i, waitOn(listener.get(PathUtils.parse("A[r1].i")))); - assertEquals(List.of(root, toA, toA1), listener.captured); - listener.getAdded(); - } - - public static class FakeTargetRoot extends DefaultTargetModelRoot implements TargetEventScope { - public FakeTargetRoot(AbstractDebuggerObjectModel model, String typeHint, - TargetObjectSchema schema) { - super(model, typeHint, schema); - } - } - - public static class FakeTargetThread extends FakeTargetObject implements TargetThread { - public FakeTargetThread(AbstractDebuggerObjectModel model, TargetObject parent, - String name) { - super(model, parent, name); - } - } - - public static class FakeTargetProcess extends FakeTargetObject implements TargetProcess { - public FakeTargetProcess(AbstractDebuggerObjectModel model, TargetObject parent, - String name) { - super(model, parent, name); - } - } - - @Test - public void testEventOrderingResilient() throws Throwable { - EmptyDebuggerObjectModel model = new EmptyDebuggerObjectModel(); - List toWait = PathUtils.parse("Processes[1].Threads[1].i"); - var listener = new TestReorderedListener(List.of(toWait)) { - Map> events = new LinkedHashMap<>(); - - @Override - public void event(TargetObject object, TargetThread eventThread, - TargetEventType type, - String description, List parameters) { - while (events.containsKey(description)) { - description = description + " (DUPLICATE)"; - } - events.put(description, getAdded()); - // Test that errors do not prevent processing of next event(s) - throw new RuntimeException("This stack is supposed to appear"); - } - }; - model.addModelListener(listener.reorderer); - - FakeTargetRoot root = new FakeTargetRoot(model, "Root", model.getRootSchema()); - FakeTargetObject processes = new FakeTargetObject(model, root, "Processes"); - FakeTargetProcess proc1 = new FakeTargetProcess(model, processes, "[1]"); - root.broadcast() - .event(root, null, TargetEventType.PROCESS_CREATED, "Process 1 created", - List.of(proc1)); - FakeTargetObject p1threads = new FakeTargetObject(model, proc1, "Threads"); - FakeTargetThread thread1 = new FakeTargetThread(model, p1threads, "[1]"); - root.broadcast() - .event(root, thread1, TargetEventType.THREAD_CREATED, "Thread 1 created", - List.of()); - - p1threads.changeElements(List.of(), List.of(thread1), "Test"); - proc1.changeAttributes(List.of(), List.of(p1threads), Map.of(), "Test"); - processes.changeElements(List.of(), List.of(proc1), "Test"); - root.changeAttributes(List.of(), List.of(processes), Map.of(), "Test"); - model.addModelRoot(root); - thread1.changeAttributes(List.of(), List.of(new FakeTargetObject(model, thread1, "i")), - Map.of(), "Dummy"); - - waitOn(listener.get(toWait)); - assertEquals(List.of("Process 1 created", "Thread 1 created"), - List.copyOf(listener.events.keySet())); - assertTrue(listener.events.get("Process 1 created").contains(proc1)); - assertTrue(listener.events.get("Thread 1 created").contains(thread1)); - } - - @Test - public void testEventOrderingCareful() throws Throwable { - EmptyDebuggerObjectModel model = new EmptyDebuggerObjectModel(); - List toWait = PathUtils.parse("Processes[1].Threads[1].i"); - var listener = new TestReorderedListener(List.of(toWait)) { - Map> events = new LinkedHashMap<>(); - - @Override - public void event(TargetObject object, TargetThread eventThread, - TargetEventType type, - String description, List parameters) { - while (events.containsKey(description)) { - description = description + " (DUPLICATE)"; - } - events.put(description, getAdded()); - // Test that errors do not prevent processing of next event(s) - throw new RuntimeException("This stack is supposed to appear"); - } - }; - model.addModelListener(listener.reorderer); - FakeTargetRoot root = new FakeTargetRoot(model, "Root", model.getRootSchema()); - FakeTargetObject processes = new FakeTargetObject(model, root, "Processes"); - FakeTargetProcess proc1 = new FakeTargetProcess(model, processes, "[1]"); - root.broadcast() - .event(root, null, TargetEventType.PROCESS_CREATED, "Process 1 created", - List.of(proc1)); - FakeTargetObject p1threads = new FakeTargetObject(model, proc1, "Threads"); - FakeTargetThread thread1 = new FakeTargetThread(model, p1threads, "[1]"); - root.broadcast() - .event(root, thread1, TargetEventType.THREAD_CREATED, "Thread 1 created", - List.of()); - FakeTargetThread thread2 = new FakeTargetThread(model, p1threads, "[2]"); - root.broadcast() - .event(root, thread1, TargetEventType.THREAD_CREATED, "Thread 2 created", - List.of()); - - p1threads.changeElements(List.of(), List.of(thread2), "Test"); - proc1.changeAttributes(List.of(), List.of(p1threads), Map.of(), "Test"); - processes.changeElements(List.of(), List.of(proc1), "Test"); - root.changeAttributes(List.of(), List.of(processes), Map.of(), "Test"); - model.addModelRoot(root); - - assertTrue(listener.events.isEmpty()); - - p1threads.changeElements(List.of(), List.of(thread1), "Test"); - thread1.changeAttributes(List.of(), List.of(new FakeTargetObject(model, thread1, "i")), - Map.of(), "Dummy"); - - waitOn(listener.get(toWait)); - assertEquals(List.of("Process 1 created", "Thread 1 created", "Thread 2 created"), - List.copyOf(listener.events.keySet())); - assertTrue(listener.events.get("Process 1 created").contains(proc1)); - assertTrue(listener.events.get("Thread 1 created").contains(thread1)); - assertTrue(listener.events.get("Thread 2 created").contains(thread2)); - } - - @Test - public void testRootLink() throws Throwable { - EmptyDebuggerObjectModel model = new EmptyDebuggerObjectModel(); - TestReorderedListener listener = new TestReorderedListener(List.of(PathUtils.parse(""))); - model.addModelListener(listener.reorderer); - - assertEquals(List.of(), listener.getAdded()); - DefaultTargetModelRoot root = - new DefaultTargetModelRoot(model, "Root", model.getRootSchema()); - root.changeAttributes(List.of(), Map.of("link", root), "Test"); - model.addModelRoot(root); - assertEquals(root, waitOn(listener.get(PathUtils.parse("")))); - } -} diff --git a/Ghidra/Debug/Debugger-agent-gdb/src/main/resources/session.py b/Ghidra/Framework/Pty/src/main/resources/session.py similarity index 100% rename from Ghidra/Debug/Debugger-agent-gdb/src/main/resources/session.py rename to Ghidra/Framework/Pty/src/main/resources/session.py diff --git a/Ghidra/Test/DebuggerIntegrationTest/build.gradle b/Ghidra/Test/DebuggerIntegrationTest/build.gradle index 1d1eeb24f2..ff13fb27f8 100644 --- a/Ghidra/Test/DebuggerIntegrationTest/build.gradle +++ b/Ghidra/Test/DebuggerIntegrationTest/build.gradle @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -86,4 +86,14 @@ integrationTest { dependsOn { project(':Debugger-agent-gdb').assemblePyPackage } dependsOn { project(':Debugger-agent-lldb').assemblePyPackage } dependsOn { project(':Debugger-agent-dbgeng').assemblePyPackage } + + if ("linux_x86_64".equals(getCurrentPlatformName())) { + dependsOn(":Framework-Debugging:testSpecimenLinux_x86_64") + } + if ("mac_x86_64".equals(getCurrentPlatformName())) { + dependsOn(":Framework-Debugging:testSpecimenMac_x86_64") + } + if ("win_x86_64".equals(getCurrentPlatformName())) { + dependsOn(":Framework-Debugging:testSpecimenWin_x86_64") + } } diff --git a/Ghidra/Test/DebuggerIntegrationTest/src/screen/java/ghidra/app/plugin/core/debug/gui/breakpoint/DebuggerBreakpointsPluginScreenShots.java b/Ghidra/Test/DebuggerIntegrationTest/src/screen/java/ghidra/app/plugin/core/debug/gui/breakpoint/DebuggerBreakpointsPluginScreenShots.java index c8eb6be044..fac9db978e 100644 --- a/Ghidra/Test/DebuggerIntegrationTest/src/screen/java/ghidra/app/plugin/core/debug/gui/breakpoint/DebuggerBreakpointsPluginScreenShots.java +++ b/Ghidra/Test/DebuggerIntegrationTest/src/screen/java/ghidra/app/plugin/core/debug/gui/breakpoint/DebuggerBreakpointsPluginScreenShots.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -17,7 +17,6 @@ package ghidra.app.plugin.core.debug.gui.breakpoint; import static ghidra.app.plugin.core.debug.gui.AbstractGhidraHeadedDebuggerTest.waitForPass; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; import java.util.List; import java.util.Set; @@ -25,7 +24,6 @@ import java.util.Set; import org.junit.*; import db.Transaction; -import generic.Unique; import ghidra.app.plugin.core.debug.service.breakpoint.DebuggerLogicalBreakpointServicePlugin; import ghidra.app.plugin.core.debug.service.control.MockTarget; import ghidra.app.plugin.core.debug.service.emulation.ProgramEmulationUtils; @@ -35,10 +33,7 @@ import ghidra.app.plugin.core.debug.service.target.DebuggerTargetServicePlugin; import ghidra.app.plugin.core.debug.service.tracemgr.DebuggerTraceManagerServicePlugin; import ghidra.app.plugin.core.progmgr.ProgramManagerPlugin; import ghidra.app.services.*; -import ghidra.dbg.target.TargetBreakpointSpec.TargetBreakpointKind; -import ghidra.dbg.target.TargetBreakpointSpecContainer; -import ghidra.dbg.target.TargetTogglable; -import ghidra.dbg.testutil.DebuggerModelTestUtils; +import ghidra.async.AsyncTestUtils; import ghidra.debug.api.breakpoint.LogicalBreakpoint; import ghidra.framework.model.DomainFolder; import ghidra.program.database.ProgramBuilder; @@ -49,15 +44,13 @@ import ghidra.test.ToyProgramBuilder; import ghidra.trace.database.ToyDBTraceBuilder; import ghidra.trace.database.breakpoint.DBTraceBreakpointManager; import ghidra.trace.model.*; -import ghidra.trace.model.breakpoint.TraceBreakpoint; import ghidra.trace.model.breakpoint.TraceBreakpointKind; -import ghidra.trace.model.target.TraceObjectKeyPath; import ghidra.util.Msg; import ghidra.util.task.TaskMonitor; import help.screenshot.GhidraScreenShotGenerator; public class DebuggerBreakpointsPluginScreenShots extends GhidraScreenShotGenerator - implements DebuggerModelTestUtils { + implements AsyncTestUtils { DebuggerTargetService targetService; DebuggerStaticMappingService mappingService; diff --git a/Ghidra/Test/DebuggerIntegrationTest/src/screen/java/ghidra/app/plugin/core/debug/gui/tracermi/launcher/TraceRmiLauncherServicePluginScreenShots.java b/Ghidra/Test/DebuggerIntegrationTest/src/screen/java/ghidra/app/plugin/core/debug/gui/tracermi/launcher/TraceRmiLauncherServicePluginScreenShots.java index 5146eac664..3cf5db9f6b 100644 --- a/Ghidra/Test/DebuggerIntegrationTest/src/screen/java/ghidra/app/plugin/core/debug/gui/tracermi/launcher/TraceRmiLauncherServicePluginScreenShots.java +++ b/Ghidra/Test/DebuggerIntegrationTest/src/screen/java/ghidra/app/plugin/core/debug/gui/tracermi/launcher/TraceRmiLauncherServicePluginScreenShots.java @@ -20,7 +20,6 @@ import java.util.Map; import org.junit.Test; -import ghidra.app.plugin.core.debug.gui.objects.components.DebuggerMethodInvocationDialog; import ghidra.app.plugin.core.terminal.TerminalProvider; import ghidra.debug.api.ValStr; import ghidra.debug.api.tracermi.TraceRmiLaunchOffer; @@ -48,7 +47,7 @@ public class TraceRmiLauncherServicePluginScreenShots extends GhidraScreenShotGe runSwingLater(() -> servicePlugin.configureAndLaunch(offer)); - captureDialog(DebuggerMethodInvocationDialog.class); + captureDialog(TraceRmiLaunchDialog.class); } protected ValStr fileArg(String path) { diff --git a/Ghidra/Test/DebuggerIntegrationTest/src/screen/java/ghidraclass/debugger/screenshot/TutorialDebuggerScreenShots.java b/Ghidra/Test/DebuggerIntegrationTest/src/screen/java/ghidraclass/debugger/screenshot/TutorialDebuggerScreenShots.java index fe8982df4d..e4e4b99d2c 100644 --- a/Ghidra/Test/DebuggerIntegrationTest/src/screen/java/ghidraclass/debugger/screenshot/TutorialDebuggerScreenShots.java +++ b/Ghidra/Test/DebuggerIntegrationTest/src/screen/java/ghidraclass/debugger/screenshot/TutorialDebuggerScreenShots.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -51,7 +51,6 @@ import ghidra.app.plugin.core.debug.gui.memory.DebuggerMemoryBytesProvider; import ghidra.app.plugin.core.debug.gui.memory.DebuggerRegionsProvider; import ghidra.app.plugin.core.debug.gui.modules.DebuggerModulesProvider; import ghidra.app.plugin.core.debug.gui.modules.DebuggerStaticMappingProvider; -import ghidra.app.plugin.core.debug.gui.objects.components.DebuggerMethodInvocationDialog; import ghidra.app.plugin.core.debug.gui.pcode.DebuggerPcodeStepperPlugin; import ghidra.app.plugin.core.debug.gui.pcode.DebuggerPcodeStepperProvider; import ghidra.app.plugin.core.debug.gui.register.DebuggerRegistersProvider; @@ -60,7 +59,9 @@ import ghidra.app.plugin.core.debug.gui.stack.vars.VariableValueHoverPlugin; import ghidra.app.plugin.core.debug.gui.thread.DebuggerThreadsProvider; import ghidra.app.plugin.core.debug.gui.time.DebuggerTimeProvider; import ghidra.app.plugin.core.debug.gui.time.DebuggerTimeSelectionDialog; +import ghidra.app.plugin.core.debug.gui.tracermi.connection.TraceRmiConnectDialog; import ghidra.app.plugin.core.debug.gui.tracermi.connection.TraceRmiConnectionManagerPlugin; +import ghidra.app.plugin.core.debug.gui.tracermi.launcher.TraceRmiLaunchDialog; import ghidra.app.plugin.core.debug.gui.watch.DebuggerWatchesProvider; import ghidra.app.plugin.core.debug.service.emulation.DebuggerEmulationServicePlugin; import ghidra.app.plugin.core.debug.service.emulation.DebuggerEmulationServicePlugin.EmulateProgramAction; @@ -262,7 +263,7 @@ public class TutorialDebuggerScreenShots extends GhidraScreenShotGenerator } })); - captureDialog(DebuggerMethodInvocationDialog.class); + captureDialog(TraceRmiLaunchDialog.class); } @Test @@ -775,7 +776,7 @@ public class TutorialDebuggerScreenShots extends GhidraScreenShotGenerator performAction("Connect by Accept", PluginUtils.getPluginNameFromClass(TraceRmiConnectionManagerPlugin.class), false); - captureDialog(DebuggerMethodInvocationDialog.class); + captureDialog(TraceRmiConnectDialog.class); } protected Function findCommandLineParser() throws Throwable { diff --git a/Ghidra/Test/DebuggerIntegrationTest/src/test/java/ghidra/debug/flatapi/FlatDebuggerRecorderAPITest.java b/Ghidra/Test/DebuggerIntegrationTest/src/test/java/ghidra/debug/flatapi/FlatDebuggerRecorderAPITest.java deleted file mode 100644 index c049fb9c8a..0000000000 --- a/Ghidra/Test/DebuggerIntegrationTest/src/test/java/ghidra/debug/flatapi/FlatDebuggerRecorderAPITest.java +++ /dev/null @@ -1,502 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.debug.flatapi; - -import static org.junit.Assert.*; - -import java.io.IOException; -import java.math.BigInteger; -import java.util.*; -import java.util.concurrent.CancellationException; -import java.util.concurrent.CompletableFuture; -import java.util.function.BooleanSupplier; -import java.util.function.Function; - -import org.junit.Test; - -import generic.Unique; -import ghidra.app.plugin.core.debug.service.model.TestDebuggerProgramLaunchOpinion.TestDebuggerProgramLaunchOffer; -import ghidra.app.plugin.core.debug.service.model.launch.AbstractDebuggerProgramLaunchOffer; -import ghidra.dbg.DebuggerModelFactory; -import ghidra.dbg.DebuggerObjectModel; -import ghidra.dbg.model.*; -import ghidra.dbg.target.TargetLauncher.TargetCmdLineLauncher; -import ghidra.dbg.target.TargetObject; -import ghidra.dbg.target.TargetSteppable.TargetStepKind; -import ghidra.debug.api.model.DebuggerProgramLaunchOffer; -import ghidra.debug.api.model.DebuggerProgramLaunchOffer.LaunchResult; -import ghidra.debug.api.model.TraceRecorder; -import ghidra.program.model.address.AddressSpace; -import ghidra.program.model.lang.*; -import ghidra.program.model.listing.Program; -import ghidra.trace.model.Trace; -import ghidra.trace.model.thread.TraceThread; - -public class FlatDebuggerRecorderAPITest - extends AbstractLiveFlatDebuggerAPITest { - - protected static class TestFactory implements DebuggerModelFactory { - private final DebuggerObjectModel model; - - public TestFactory(DebuggerObjectModel model) { - this.model = model; - } - - @Override - public CompletableFuture build() { - return CompletableFuture.completedFuture(model); - } - } - - protected class TestOffer extends AbstractDebuggerProgramLaunchOffer { - public TestOffer(Program program, DebuggerModelFactory factory) { - super(program, env.getTool(), factory); - } - - public TestOffer(Program program, DebuggerObjectModel model) { - this(program, new TestFactory(model)); - } - - @Override - public String getConfigName() { - return "TEST"; - } - - @Override - public String getMenuTitle() { - return "in Test Debugger"; - } - } - - protected static class TestModelBuilder extends TestDebuggerModelBuilder { - private final TestDebuggerObjectModel model; - - public TestModelBuilder(TestDebuggerObjectModel model) { - this.model = model; - } - - @Override - protected TestDebuggerObjectModel newModel(String typeHint) { - return model; - } - } - - protected class TestFlatRecorderAPI extends TestFlatAPI implements FlatDebuggerRecorderAPI { - } - - @Override - protected FlatDebuggerRecorderAPI newFlatAPI() { - return new TestFlatRecorderAPI(); - } - - protected TraceRecorder recordTarget(TargetObject target) - throws LanguageNotFoundException, CompilerSpecNotFoundException, IOException { - return modelService.recordTargetAndActivateTrace(target, - new TestDebuggerTargetTraceMapper(target)); - } - - @Test - public void testReadLiveMemory() throws Throwable { - createTestModel(); - mb.createTestProcessesAndThreads(); - mb.testProcess1.memory.writeMemory(mb.addr(0x00400000), mb.arr(1, 2, 3, 4, 5, 6, 7, 8)); - waitOn(mb.testModel.flushEvents()); - TraceRecorder recorder = recordTarget(mb.testProcess1); - waitRecorder(recorder); - useTrace(recorder.getTrace()); - waitForSwing(); - - byte[] data = api.readMemory(tb.addr(0x00400000), 8, monitor); - assertArrayEquals(tb.arr(1, 2, 3, 4, 5, 6, 7, 8), data); - } - - @Test - public void testReadLiveRegister() throws Throwable { - createTestModel(); - mb.createTestProcessesAndThreads(); - mb.createTestThreadRegisterBanks(); - mb.testProcess1.regs.addRegistersFromLanguage(getToyBE64Language(), r -> true); - mb.testBank1.writeRegister("r0", mb.arr(1, 2, 3, 4, 5, 6, 7, 8)); - waitOn(mb.testModel.flushEvents()); - TraceRecorder recorder = recordTarget(mb.testProcess1); - waitRecorder(recorder); - useTrace(recorder.getTrace()); - traceManager.activateThread(recorder.getTraceThread(mb.testThread1)); - waitForSwing(); - - RegisterValue rv = api.readRegister("r0"); - assertEquals(BigInteger.valueOf(0x0102030405060708L), rv.getUnsignedValue()); - } - - @Test - public void testReadLiveRegisters() throws Throwable { - createTestModel(); - mb.createTestProcessesAndThreads(); - mb.createTestThreadRegisterBanks(); - mb.testProcess1.regs.addRegistersFromLanguage(getToyBE64Language(), r -> true); - mb.testBank1.writeRegister("r0", mb.arr(1, 2, 3, 4, 5, 6, 7, 8)); - mb.testBank1.writeRegister("r1", mb.arr(8, 7, 6, 5, 4, 3, 2, 1)); - waitOn(mb.testModel.flushEvents()); - TraceRecorder recorder = recordTarget(mb.testProcess1); - waitRecorder(recorder); - useTrace(recorder.getTrace()); - traceManager.activateThread(recorder.getTraceThread(mb.testThread1)); - waitForSwing(); - - Register r0 = tb.language.getRegister("r0"); - Register r1 = tb.language.getRegister("r1"); - assertEquals(List.of( - new RegisterValue(r0, BigInteger.valueOf(0x0102030405060708L)), - new RegisterValue(r1, BigInteger.valueOf(0x0807060504030201L))), - api.readRegistersNamed(List.of("r0", "r1"))); - } - - @Test - public void testGetLaunchOffers() throws Throwable { - createProgram(); - programManager.openProgram(program); - waitForSwing(); - - Unique.assertOne(api.getLaunchOffers().stream().mapMulti((o, m) -> { - if (o instanceof TestDebuggerProgramLaunchOffer to) { - m.accept(to); - } - })); - } - - @Test - public void testLaunchCustomCommandLine() throws Throwable { - createProgram(); - programManager.openProgram(program); - waitForSwing(); - - var model = new TestDebuggerObjectModel() { - Map observedParams; - - @Override - protected TestTargetSession newTestTargetSession(String rootHint) { - return new TestTargetSession(this, "Session", ROOT_SCHEMA) { - @Override - public CompletableFuture launch(Map params) { - observedParams = params; - throw new CancellationException(); - } - }; - } - }; - DebuggerProgramLaunchOffer offer = new TestOffer(program, model); - - LaunchResult result = api.launch(offer, "custom command line", monitor); - - assertEquals("custom command line", - model.observedParams.get(TargetCmdLineLauncher.CMDLINE_ARGS_NAME)); - assertNotNull(result.model()); - assertNull(result.target()); - assertEquals(CancellationException.class, result.exception().getClass()); - } - - @Test - public void testGetTarget() throws Exception { - createTestModel(); - mb.createTestProcessesAndThreads(); - TraceRecorder recorder = recordTarget(mb.testProcess1); - - assertEquals(mb.testProcess1, api.getTarget(recorder.getTrace())); - } - - @Test - public void testGetTargetThread() throws Throwable { - createTestModel(); - mb.createTestProcessesAndThreads(); - TraceRecorder recorder = recordTarget(mb.testProcess1); - waitRecorder(recorder); - - Trace trace = recorder.getTrace(); - TraceThread thread = - trace.getThreadManager() - .getLiveThreadByPath(recorder.getSnap(), "Processes[1].Threads[1]"); - assertNotNull(thread); - assertEquals(mb.testThread1, api.getTargetThread(thread)); - } - - @Test - public void testGetTargetFocus() throws Throwable { - createTestModel(); - mb.createTestProcessesAndThreads(); - TraceRecorder recorder = recordTarget(mb.testProcess1); - waitRecorder(recorder); - - waitOn(mb.testModel.requestFocus(mb.testThread2)); - waitRecorder(recorder); - - assertEquals(mb.testThread2, api.getTargetFocus(recorder.getTrace())); - } - - protected void runTestStep(BooleanSupplier step, TargetStepKind kind) throws Throwable { - var model = new TestDebuggerObjectModel() { - TestTargetThread observedThread; - TargetStepKind observedKind; - - @Override - protected TestTargetThread newTestTargetThread(TestTargetThreadContainer container, - int tid) { - return new TestTargetThread(container, tid) { - @Override - public CompletableFuture step(TargetStepKind kind) { - observedThread = this; - observedKind = kind; - return super.step(kind); - } - }; - } - }; - mb = new TestModelBuilder(model); - createTestModel(); - mb.createTestProcessesAndThreads(); - TraceRecorder recorder = recordTarget(mb.testProcess1); - waitRecorder(recorder); - assertTrue(waitOn(recorder.requestFocus(mb.testThread2))); - waitRecorder(recorder); - - assertTrue(step.getAsBoolean()); - waitRecorder(recorder); - assertEquals(mb.testThread2, model.observedThread); - assertEquals(kind, model.observedKind); - } - - @Test - public void testStepGivenThread() throws Throwable { - runTestStep(() -> api.step(api.getCurrentThread(), TargetStepKind.INTO), - TargetStepKind.INTO); - } - - @Test - public void testStepInto() throws Throwable { - runTestStep(api::stepInto, TargetStepKind.INTO); - } - - @Test - public void testStepOver() throws Throwable { - runTestStep(api::stepOver, TargetStepKind.OVER); - } - - @Test - public void testStepOut() throws Throwable { - runTestStep(api::stepOut, TargetStepKind.FINISH); - } - - @Override - protected void runTestResume(BooleanSupplier resume) throws Throwable { - var model = new TestDebuggerObjectModel() { - TestTargetThread observedThread; - - @Override - protected TestTargetThread newTestTargetThread(TestTargetThreadContainer container, - int tid) { - return new TestTargetThread(container, tid) { - @Override - public CompletableFuture resume() { - observedThread = this; - return super.resume(); - } - }; - } - }; - mb = new TestModelBuilder(model); - createTestModel(); - mb.createTestProcessesAndThreads(); - TraceRecorder recorder = recordTarget(mb.testProcess1); - waitRecorder(recorder); - assertTrue(waitOn(recorder.requestFocus(mb.testThread2))); - waitRecorder(recorder); - - assertTrue(resume.getAsBoolean()); - waitRecorder(recorder); - assertEquals(mb.testThread2, model.observedThread); - } - - @Override - protected void runTestInterrupt(BooleanSupplier interrupt) throws Throwable { - var model = new TestDebuggerObjectModel() { - TestTargetThread observedThread; - - @Override - protected TestTargetThread newTestTargetThread(TestTargetThreadContainer container, - int tid) { - return new TestTargetThread(container, tid) { - @Override - public CompletableFuture interrupt() { - observedThread = this; - return super.interrupt(); - } - }; - } - }; - mb = new TestModelBuilder(model); - createTestModel(); - mb.createTestProcessesAndThreads(); - TraceRecorder recorder = recordTarget(mb.testProcess1); - waitRecorder(recorder); - assertTrue(waitOn(recorder.requestFocus(mb.testThread2))); - waitRecorder(recorder); - - assertTrue(interrupt.getAsBoolean()); - waitRecorder(recorder); - assertEquals(mb.testThread2, model.observedThread); - } - - @Override - protected void runTestKill(BooleanSupplier kill) throws Throwable { - var model = new TestDebuggerObjectModel() { - TestTargetThread observedThread; - - @Override - protected TestTargetThread newTestTargetThread(TestTargetThreadContainer container, - int tid) { - return new TestTargetThread(container, tid) { - @Override - public CompletableFuture kill() { - observedThread = this; - return super.kill(); - } - }; - } - }; - mb = new TestModelBuilder(model); - createTestModel(); - mb.createTestProcessesAndThreads(); - TraceRecorder recorder = recordTarget(mb.testProcess1); - waitRecorder(recorder); - assertTrue(waitOn(recorder.requestFocus(mb.testThread2))); - waitRecorder(recorder); - - assertTrue(kill.getAsBoolean()); - waitRecorder(recorder); - assertEquals(mb.testThread2, model.observedThread); - } - - @Override - protected void runTestExecuteCapture(Function executeCapture) throws Throwable { - // NOTE: Can't use TestTargetInterpreter.queueExecute stuff, since flat API waits - var model = new TestDebuggerObjectModel() { - @Override - protected TestTargetInterpreter newTestTargetInterpreter(TestTargetSession session) { - return new TestTargetInterpreter(session) { - @Override - public CompletableFuture executeCapture(String cmd) { - return CompletableFuture.completedFuture("Response to " + cmd); - } - }; - } - }; - mb = new TestModelBuilder(model); - createTestModel(); - mb.createTestProcessesAndThreads(); - TraceRecorder recorder = recordTarget(mb.testProcess1); - waitRecorder(recorder); - assertTrue(waitOn(recorder.requestFocus(mb.testThread2))); - waitRecorder(recorder); - - assertEquals("Response to cmd", executeCapture.apply("cmd")); - } - - @Test - public void testGetModelValue() throws Throwable { - createTestModel(); - mb.createTestProcessesAndThreads(); - recordTarget(mb.testProcess1); - - assertEquals(mb.testThread2, api.getModelValue("Processes[1].Threads[2]")); - } - - @Test - public void testRefreshObjectChildren() throws Throwable { - var model = new TestDebuggerObjectModel() { - Set observed = new HashSet<>(); - - @Override - protected TestTargetProcess newTestTargetProcess(TestTargetProcessContainer container, - int pid, AddressSpace space) { - return new TestTargetProcess(container, pid, space) { - @Override - public CompletableFuture resync(RefreshBehavior refreshAttributes, - RefreshBehavior refreshElements) { - observed.add(this); - return super.resync(refreshAttributes, refreshElements); - } - }; - } - }; - mb = new TestModelBuilder(model); - createTestModel(); - mb.createTestProcessesAndThreads(); - - api.refreshObjectChildren(mb.testProcess1); - assertEquals(Set.of(mb.testProcess1), model.observed); - } - - @Test - public void testRefreshSubtree() throws Throwable { - var model = new TestDebuggerObjectModel() { - Set observed = new HashSet<>(); - - @Override - protected TestTargetProcess newTestTargetProcess(TestTargetProcessContainer container, - int pid, AddressSpace space) { - return new TestTargetProcess(container, pid, space) { - @Override - public CompletableFuture resync(RefreshBehavior refreshAttributes, - RefreshBehavior refreshElements) { - observed.add(this); - return super.resync(refreshAttributes, refreshElements); - } - }; - } - - @Override - protected TestTargetThread newTestTargetThread(TestTargetThreadContainer container, - int tid) { - return new TestTargetThread(container, tid) { - @Override - public CompletableFuture resync(RefreshBehavior refreshAttributes, - RefreshBehavior refreshElements) { - observed.add(this); - return super.resync(refreshAttributes, refreshElements); - } - }; - } - }; - mb = new TestModelBuilder(model); - createTestModel(); - mb.createTestProcessesAndThreads(); - - api.refreshSubtree(mb.testModel.session); - assertEquals(Set.of(mb.testProcess1, mb.testProcess3, mb.testThread1, mb.testThread2, - mb.testThread3, mb.testThread4), model.observed); - } - - @Test - public void testFlushAsyncPipelines() throws Throwable { - createTestModel(); - mb.createTestProcessesAndThreads(); - TraceRecorder recorder = recordTarget(mb.testProcess1); - - // Ensure it works whether or not there are pending events - for (int i = 0; i < 10; i++) { - api.flushAsyncPipelines(recorder.getTrace()); - } - } -} diff --git a/GhidraDocs/GhidraClass/Debugger/images/GettingStarted_LaunchGDBDialog.png b/GhidraDocs/GhidraClass/Debugger/images/GettingStarted_LaunchGDBDialog.png index 0f1e49d3b7893376f7673025946a4ddec1ce3da1..cb344c8936964a1701405cb72e6b5d30e4363b37 100644 GIT binary patch literal 16333 zcmch81yq$=+wDdLBnB@LUBl7_p` zbIup{`|p469e3P4hK#X=cfBj;Gv|Dsd@cV9%7vJxXoqxnnqQxkS^FVeXA+qeDEG2Ole zqGO^I-@U~V?fnP&!;cgN@ASj1iR~2#T1>@n2V;FheRAuYJI1ZM^R6^h5g9o(#-Y+a zZ&t2ck@MLuXIsc^#P*zW-v`qgFE7YgCR%DzQqs7sMwM;4&QbeWGWeF%=tB!WJ~v2G zz?X-Z<{#g^duKpfM2U%s>7V@Tm!tBhmClSrTn1BFUwjjY#0)pSeX+W8ke(Emt)egd z;6XT#94$c>UMLEmg_GLFv(l4j4eQ>ifBC^iLo zC(5}taq=Z^f*9JD<9E{u@WGE_?``jsydU377Pk=(1?*@py92hVr&(LB8v?CGFiN3) z{(ic#j@-?Ok~=6_%&OhyDD}-n*DG~uyzQ)W-PcH3@|$9)g}M~w`>Py!mhpSY8|iy| zrURKICJNsOwLXY+``8iIH`pHf6p^_KYBjiTR<7Hw(w1wN2fBP_uu`bnGjclZJ~&A3 zti5bGNy&fQ-noH^3VoTqJGdxOcr{h|zV>H^XOdQ8lhhS{b3{8~9m`HU%^9{Paj9nc ze03o2nakPdhitF9j?gPEtxdkmFJ^N1Z-u|_n}$1X&UtbLoY5&em7Z@r_}yI&UD3e! zR??#nXMezO$#-w4&1S9Yp1dAVx``9uBgi~uJsKOJA;>PAwo=>HwJeh~Zm!@FLCW?s zeLX=~<2=GcI3)t=h6cKaYS=tn@y%e)gRld!t=m$yXHNicc-?}bH2X$sB8~OO`@W^? zrzfDWr)slLncrjHMEi7`w!tuAojaVlIi6KApVrNCZPN9*V>gaMx8^MQT35tadym=r z_mDhUeAu1{%FSIyOi4!C^OmNui%vn(+B3TrI7!2lQS+)#y{DU{llAv!i&lHInXh2G*QJXIJcY@gfwh&@we@s$KCX3yuiUSFNv8a=0d|{yi%#eu1h>!cTk+Y?{43C(C{3n8z ztL~cpiqYo0{+IX;zTh=V8Fls6(`jQfr`Q=13%+KYAvlC}XUTCs?-Z98wpYrW8b2~V zZYOs$BE`?Sg-!aZ6Ni<#h|-@*(kdu9VD`*f_;|Z$%T@5gZ9k33gFhjw)ztr;!Q21E zx%m6g_&52?K_Ff@c4t4gFiB?7AduLXZ9eG`h`wv15BLdz-hx1G7EwYV54~_uAdL|7 z+YktvzAyyx3_@}P;)ODP7XrclfAgovTAZ!Ud#NL$4O$oJD$gg9CwS2z(LyTb>bXo~ z#FIqs{2d{%lm>2y7pfOd;A1PH&&qg)zD7Hw5Pi&*iuq#0E)&y>(?c>+QfldF>)izr zf~YY?QFZqgADlYZBg@e|js2A#Uu>e#;NZrv)RYv_AaWV^%acCO%XY!b-NP}x*vgd9 z&t$xcdrj}rvvm~}_rAZsQw|&Pryu6C{tjWZb#O3>ahp^3PSu7jh%#$eexIMWnR7o1 zB<7HukZ^H14U-d?sI*y(((};Rj(b=7t*2*ebD{*_9R&iz-k-8=dWSkNFi=%hm8({m zQA($jQN%T}F_N3v9ghEFEj1`KM?49OkSQ&rriNFGn25;K%4%n6snl+@S1O7rq$7!@5jUVp{T zY1r@O4IpGz{i@-+z7hX%pCD8=)xZB@)=P@`to!#7kTI|w@9hOMoE z4jZF^k{Vz8Z1V5uIGQG!eoP4VQ<7zh{AM>KO}5$Ts@AN91<62C>Tc zBVIi7=)}Z6g#A&Dwj`c#jH z%9;7{H@cJ^9yzLK2M*#eOZ9ejDP??lAG(;=yJ#PvGe8JQ`ueN{C(#8-r&(&yhFKko zg^BqgATBl}DOX3G{vi9)Gn+U;Pu-Ztem#Y+Q&X{#qAy>b_g$U$W!YvGn~gDH;y!%l zl}X1N!plz8JW!mV8aJ}vmE3u8G^h7h<1IDp8`jdq_r9*M`UY?)t_jRV*CU%N9 zcwA(W6A)xb>#r5k;yrlqQfg*;dTlN^IGDq1RNh;{?PPD6Pi8`*&gJlvrO;>VHPx|# z^IlE?0o@oMUPA~B->5t}H<|woBsNG7Kq8<6mAseM=e@85x<7(ECO#j?3m97?1N> zvTqhS9$sp-GDC9=ziYY9Nd+wm3QA|G=}^W*%n!!SJdG0i(;JZChbk4x5UrP;PJ10R zSLdsOyxiRR+Et2GAB~<1`(T^S);fn#%g`Ew;C}B1PWG`0F5ruy>uLhBWNn<}=l0tdGFawPs~wo0*weuOA;98R;ZOi?hA7VSywOKu9#-spP7bnT-`lgi+r_$K`Y0ORIbck;nRf17FcSKAH`1m~ObB zpUctxo}`KFX4RY`e-*`eo2=ey)|D+8^Z<)2)nw23QBByikLIo<<(&dpMb3*7CGULY zSNOSUJd5)2aKrAYSX@n#LH{w*$mx_zxTaZlDbCigz70zm+IKC5nK)SgW^^$=WqY_v zDQGuCNmwhpY*Bx9*1l-m2Znz-W}2Tq2wjTaeaT67p`eO`AX6$g_}Y~HpZ~Ni4vLL~ zvo)9=P*+!%n`@@593ET_a0P6mp~2pG-a@U40)rk~9*50`WMn-^v(da)_{gPsUkWA_ z673O%m8RG2pHEIti)j>bCV4n-6|`MA8EY z061noR-jX2)bllvBq}~$XF!VER*lE^=WaU%FAq;~ru_2qvJ8UVZ;;1+?YV2On%YcC zEk4!o$ie!M=`FDHW$US`#+^R%?lOVU=_E_YhaR1a*! zw6l3%hwuqMZSIew$s8Lpw@#lk?`lH`0gVD-KH(CT70OesRz4Oc6N4F zR;bg;Ooxm>FkvUPR}Ca$%K%eGEteoo^GHQDo@WFAKLA?Ac-{NNO@lRh;>jr=&?%gk zLOy={7#A0pm-iI;>il^3_sod|5FD-#(J(PFac~?)sOb*KsXnq2hvV~D@$vE9zkeT` zjrPxExu-?)$qezrBs}&ewzjNhrza;k51;)}Mas;~45ouXr9JG0T4iSDYPRj^&n;fh zOE-cs9$G367F^A<)Ki0XY{FdHB0}68Xp*sy!cNH5(fnzra94I8WVVxkVRJ zQu&TQC8?&O;(fiBRy%G?!eN%zLx-0O>Fk>F2BLWm=ZwCf%l5PBpQIQel=AD1X?$-# zQ_QoKFgi=G@bh|z@juA=CA0ozjO>%_97czW?Lqr-AfhORjhI$MOfA^t^i!+XIT*;2 z7+yj(|evx%|WeZ&zHjFA|o5J9x$tH$Q-6G zG`XMsJlq%yvSiupH0@7%8~g`**@At*lfJF8Q20Ad8J>F+OZani3Ki za;f~Q6~XqmYw_|K_ihm_{~_;<$YaV&nSAf@d7w_QIjrob*kRisQ9%u!3TPo;K*jNS zE?(6mb_Nb=A*Dl2wrY`lJ5fJYUwYB8bbnU8L$dUr`rIU}YyMOd;7roK$FA-=UI<_& zcisFlxJOfOHCgJn{eJvW73WBlKl(bE`PO6^5fPDyh=_e^vRltuPw>e4mO?J)Y+9Ja z;f!u($M>LMW0U;BY$clNR|-s__o@eZ*k9pk?(A!7Jt$9kX~vWRmzV73!sXL2^HkP* zisviEku@^>>+tb}FbEBWvkdSg5;d0@*#~H@e!9=&u)Lbt2|po~C#tA%wft6(mQ|+S z>m%%on_ltMWiClAOC}bIpY53By3}yK%*@`Bc?zflb2W-awLP8I6A%IwcmIe-d7|XP z>>m_#ba=RI!^z3%>3Oxex%uJ4EeZ;X{8=ZqKmPC{m5INdcuOTsQU+~iv%R(TN5&}q zix)2v5)#5CR_))sd9oGC8c1oM4mWA0Ug?eR61=(h^Cz@gYm@W+s z4T*hvn5-RTlxi=Q7#jLWTcgGIPA1B$M7BX>EyKv=4r64=Jb*sw;zwiTcljpaT^=ke6loq;4&Z}!1PF4TiYbcvJ=x<|PG$x7qEuWlC49 zQg|FE+iI~t=!xab6ge>1tuZS9IA(^SQbC!;Kq}xC-D|~y=>^S*W6P9Fv>Yplf0*CZ z=%d>8iHL0tmx_+Aqow8bN_WhH0py7^w{e2|&x!Hz@%`1lAPT{Ry|y+u(Re=$0~0f) z23jo~^X%1)t2{CY8TiY!$Xc+Y7`4jXcH0Oi=1{e8{-b=+4}j)bc&;f={X~aMrO`u6 zYe;Ntdi1~Gn7;Z-_UyG<8R@+8t1Kp!yjzWR$^Os>!W@146Iu7!w!MgIa+aeFc$91* zMG&KsE>)l*NQCLbVzB4Y!E(YP{fys zXJL02EbAvGntxvURS&L}^McA@`Qtzh3l%y9OJ0P8{?&{8IgR3)Gd1yutV`r9HnPd_9~as^HL76l5+lIv#_j{+bl*I+T zT-nby5EivNrivUZbX67wMuwGg?&1^#f|nG43N6)C zwpe35G7hJIz{|_~>dD)PWLQgRXlQ9^X;xO&MYa5mbcN!gQ;*l%?{FAznVWpQL88f@ z1C^GMkr5ZK^th;wcIN~XE&OSoCFoJIw--*2y1sC(*oY7NdX2*tB02}{x`FEJ?i1XA zvM=s7`=|!x;7AA+mwzLr((xHH+9{GQGMZ@JngDttqRMZKY!}fILy?!I*N;bEGe-|6%EwZ z(Fr2w?;Hg7!OF(QRIT$qwG0CLH(P$15EaE~I{3ujajl<{i!0huOIy3vdcN6VYZ53z z^XW>PiHV7)y1xBiUM*#xYv@sT+T=W)Ma0>z+fD?|DHSsdHk^*1Tgk?E)wlrZ9b_Di zt?Th2v#ySVs^mLtAc91Xtn+m0+IL}O~c!eO3f21sA~8k@yuE6YT6Bi z&N8hE?3j!lFF(^-)}xKE?1`wt*-8lv;rFSBN3iorJPC~k#Z^;owb@DgL9k9Jd96P0 z(Qy0&0v^9Yy>*M-a(cYIokl<)fdl9^jmgJBeE09&3keGgi-_Pb>sl(uAh>vnl0r}G+= z2+l=y)J%p&uU_`fcWz$~Y){D`!T39KIMB!?UyK6|kLW9wPIEW#D0GT~T2E(oNeRdM z(TeVqWTd4P@pODfoV!}W20w(1L}*u9Hw_GgjF?J(TMYs>O|2FoVbu7zx~iO%l-X1{ zW9}GbsW}(Z(y`yC`%Q$k6KCs|Rrm?=KJA z!?&`je3>3Z?y?6p>Nz3SdG!s53$v(Awno}g%y!J>){kZ>K0Ca{v4FUfOh%;YMafW! z-Riay9;xh~uCUSrKEhgg)RsF~1NAt|taYQ95j#6OX93f2!)qSdw*bG*Na9hwI*sIC zy``s|BY}_L{KBKMb{RebccDi4LZ*N2u|XiWv6)$nagm{_%^<_@!mLm(pN@4vPZ)n2yZ6VC&elz!lwVVP{$QrR6!DEzsk zE5Tip#!RR|B7)LUAa-A&8wc(p5a!yZ#DcygVup7rlV7QdP<=P5`$Y(mu;=WiyAHpe z@BWHpx^Eewk8d1(^})r(jfGmInCiQ^)fN^q2ld7CMtNGUZEf`|{$^+_EG+glWJE;k zi;FE_h$p}o&uMDvl}zW*+y@UOhJuKUh@>(#*ZcdT1^&sV%oEQlZb3^i%)j}}&(E{Zn2i@D zhlLI8Eq6J`ZGWb@W<>peG9s!XCmS1<^s36renvZRwt?DJuf+ver8Y)$>BgGq`f9?_ z6dbY|i*90}eTNgr&Q+{V|HA2U`{U-v%Z@##*Jshq*j3V{HzJqQk~)q#{^!oE3()nl z1x-^;3{6*#{jLv6ggA3_G=>+agTyW7gwRqKWD$ui5o+hmM0|pT83ky5}IXKH3wU}+%7sJWFp|+LTMFWGwSeWE# zQSwMCtOaK93uxubC?U`B0X||h+bPJ)OEWn!`E%es;lG28iYn6ZR{;1cG~9+1VSK8_ z0`~FvEzucN5S+|!qyk7sfk5B>f@T9jNMrH0v822Ayl@y>FFViA(I82PU)$sts-qM= zxkhVX^iYEM^VH9rp8FAScW#5=BlRd&^7HM+Yk0ra82Udw;>B%IX}>;*hC^I?wq3LE zZqoNhBLNn$tMw(`D0SRJDVZp$tgHka@tUrBW-~Dr7y<)Zo%2_4m@uydrUr0El+um+ z62K({gPfEh@ai_Vwm|%;29{iK z@Lgl$Rnb7=s_N=JU*<4RLMH9;0-YM89z-As=e1E+NKQ;VnJz`B8NWC2{`KaAqSAO? z$H87D+11|ov3#xecPprW56!4#9$>1##eq^za6TAR>*AZZWMN-w8k&-f#6${DgW{;D zC^~4`?83r=xHWL|z&n2K?)n7<8Ou02Iz|#ae7H709|HWxm>6z{&2fzqqumi-9FoZB zXz`QF%S%g3OQEYzP>V_P@gho2&Zq+(qwa^xkL*zXp0NG#;DZC;g@?*Wb|v~r!|&s1 zy_}Vhlw62mr&_|RURyI!GLH@oZAO9}HM|tmoI>5RqCV5sMg@gNjsO?omy*{!X3VjB8!GH{lz7g}?_+7*kGs%@*usVYW z!3Q!>^Pvo!pxAr=7;KXd@TY=zn6h&d_+29<1s*L*$8miDEAkt3G=RIL!ADQuIWiLA zo=ZYZtf@glKuE}}S3lj>=IxSn0els_`yY(-_4S7`WSs35zXk>goYLk`0e=|yO#b-Y z=>I$#db{HvuWVBumMQ*yf~@bDbG`ohX?S=zE$zvjJ3+u;_7BK^@OKZVZ<3(>Ge(@p z;^m_My%modeabQZeuKU+)<5CMV?MuK-@1CJRB1P)ayuktf@1Wo>l8Mz+ zzjOl<{n-g$_u{uOWIIJF6$9~Q*d16ibo~DC7O-S>$Bqx1Xm6t0-j$h{NHO z0EZA1BdNK=Sadf@ZfFUs%A_+r8X37BtBHqlP=O+I8n*dua~uthi0Y5ZYJ`t&tbBQ; zt2+yF7zj?QS+G66f7dT~4?KpBFdC&=;I1;L6(~;z57JfvXHY3aI=R%pep_B$oy%&L zkA{W@9UWcL=*46|Fh}VItKnujKhQ^%e1|>%YtW(Lij4+GokdSiZ*uD&Ow{eLzrUYJ zr@9{*-X|E{&m&Ex$-D%-a*$aOUHtK*c!sU0{X`09lce3Mh%8(u4t!*AdS2|9~!i(;Qi zli5|(goY?iv?wQoi-qeS!GFQr8y48!&RDjDQk7&n9i;?_sKwQ)^`o!o2V5xEpLHbX zC4`5!=8Gu_!HQjkgx(GM@X6|Cu&bgsb_T1oFh8oXJ=n;}#kz+AaCMvgM8?e0l4%U3 zEt{@AJLQuSaV~>GK`ya!!8g}YD_EQNO1=9TSdg(i4K`>c4l(=P`yVo{UsX(*-*sh@ zl$Y1N-D@Uc0|TOgb}{@b5~5C23`6?hz*l?#mCBQ~drqE-8KhK?oDMePk3f*9J~0Ih zL@2BpNEi!IQBeg21tX)3fsry?CBMk)r)cC7zzp2n<5F>o+hgIpHR_*7oF5>Lf4#wh zcH(l}*1oJtuBhM~YXUMSt3!}N8Rp$yS6h4B?kRcW#*Nd1bvz1+!t?21XsaM++IlPq zQUPYpk|tm<8Sme>fX!x7E~N$RJC5q=-;;I)lCXPyIOrg_h{SqmLpmE()-$jlFb6`T0@`Z^+q{XRE$beID3 zT2$@#UV1XKB^$%)?MWd+VrT>C97r)pk`#dB5o$UB&Y{ftkQ)R^`Y*dEIrN&ht+ZzK zyzayzA|w<;;H5&wpMcfqzUq!;d5tzR2oj{uPEOr%+)CQ!`)lJr0y$@|sY;dI>Y9V= z&&>&7cA4MT;DE2Fk$_s3wSsbx%fh3U{?^fPk8p~Q2dZ5L!=DKqs=He12rJaCdc=g* zNFAc`Uhkmz{!g>1yO2L#|JPVKq4K&^7{K&Hfj$UC8Euz7hg_8R!{3DLFBJYSr9LJW z*5bkfE-6=I{nML};k)(`ZSC!Z`1lxO-~SZr+0WS6_DA!zDo`LC7&?ab`5||`&HAtX z11y^#-(O_ig>*e1Bi6BL<}mriD93}Y0&aMr{tCYT7EI2SkrjoYnYX`bA0koHK=|?p z1Y&;oI=}$fDXkF(901TE`}1QPmX^q@dYoM9;+%X`FO^^H5V&S}wjfCX$Q=J}E1n~B z1tSQ8up9ZtkgTtU*EEoAD!9^VHwC1`NY$X(_kR3;)c zcW>{{qa#N zkMG^P2WXv!h6adBM1mfCdOGlm^|qus9`{rBDTethB2B0pNGmtDv~+cLn#`;wdM2Qv zhFo0ic+S;0?to4M58Ai~A(GlO^lcIl;qN{E@HA=&ob3LbmQ`K)gA~&FUku);gfbJ@ z|4Ufpgo94rf&>0(EvuoDex(<^sVQ`HtF}ukh zPj1V+DpbBB*5&i%%a_MupUo$V4Kroq>#r_d2}*0U-T>s))z!79={@qzq`UGAD2nXA z)ySiNf4a`K;xnezoE-_PYy#i<_wS%grESnw=0~RAV4i=bsi}w`@RQP4eDEbEftc=3 z1HQP9l;Z_R(XgAbRr4%|6{%l*3wfO5n`$VGCK0&ZW2)JMI7E&pF{LLT?{zVQLI=y) zS`BseZyYqovg%Umm|i1Ef(&ndP4P+v<%_U*04WM>Jv}{hbArHtqoizVZ*R|14Zn5k z7Qi*&@93UX&HrY-?C$&f`>$;-aAl^MtU`M@EhfXGqQrh9_bI^s+PXTqDB+q+7cNa` z+GP+Kud1r5=&#+NUIgB9kkM@SEflN*U3VbVye3H0mmt^YF}+GwSBQ=jF> z)L0oYA0aBF%WE}d*x^SvALQxHgcx)P#O2yK{qHz2!8`XUR7laoJr3HJw*WSNp|}EV zVg0X#@4skec?R>W)7Jy4Xn*r{SQ$>)0{k8$$->boN*2a1Eo?Vw4eEjbt#CS;aco2V z`V7XOiov67tizUKDBKG~3Rq(br|)ll$z4o9`uf_a1X(lzAQg?4LAKH@0*^)(o0RLv z<=Kv-gTo~NQXd(eqJ(#KpzsnqvY2 z7he0O<37l669DWO69mj4#g^cy`g0iqIayiio#0O(3;~-e!SnLOzurFE$oJF~a8;1- z`he5KF9wYuy$4KwK(f0N!p1;x2-qCtnOKX9L4pqU_IYZBx~3<0w1D>O1325%bnV8j ze(>>eSRZTy5)Y^@LD3k$ZdsIoFpJ-sofk3liG=fWhQd=ON2bCqkkj1Wz8Ic-88J|t z9FO4gxHudG9z)Pbwoq<~3rOh(h4~1aEa9mV>buLvLbvw&1Xr8j8>2Fb0v8SuJjy9y z4#;6T1Y=}GL^k;YNaV{uJB*I~@W*;)q9PSAOZ$^v@W~Q>1?fLip(X?fa!A0ZwYB5+ z=sLoME6n};{GO2groH5Z^wm1k0cbhSC-D%Uw}Xj9Q|+EeN3e zFmB)egLg>z^DP+}0-D8!tIIQctr?J_0!3>vk$dFoiJX?xYf}}>t}^R-IZA0TGWr3D z{oUQ`x;Bfl_ct1wei3q94^Y^o&=28 z+1i@;d|MRqo?lqFPeRg#G&MD~U;K*HjE^0B@KebQPvz@N;Cv1NNke>>prf-BHdoId zpyX|tu2K8qJsP`d58Z0jYC`O@S3)Apj!BMDz(wv&6imEarg*8E*)lb0DtLLkh$qL_ zbX|{=6_|sBYclcxsg$;icyr1wo(}Fg+`41iX3Y7*AcY;FY z)xQ^%Wx%JRYe$!mSywttdvtTI;p!bK)^WSr@S9yAp!%DNdHnol->U0)WxOr*!)H+a zA#TXK^gb!^Cn((`=d$)HY^H}yGyK}?Y~#T)XzKz|V&O_6H8op{o15mR2Z3ti#?En| zQiP7PU13XGJ?fLh*t6WBbE#PZ;p>^OCz)j;TmU6zeMs|+?#1)h0>HfCxvQEfnX8(w zuG8U%M+53e$}MM3qZ-b=<)FDk^A=m|Ofs@u#U#tilij9Fm#OG9Wm-Lx_BZ9+B zlB%m;+1rReO-e~%auMIwOj;US?lvao-oZiIZJof7kPra@fu{wNRYe8A%niXA=wKaR zKCM+ia+x3f>tP>|*#K2R>LB_X8La?E;GgFW6+ z(8J>6EnausdbgMrv(kO#tL>T{m!F%?AU@^5vs%O1v+n+h25jR+VnO6u<>vR^4dd&0 zq=y>*GgFVfBXI168aVmv*|Q>0m{zL+@+EF3wuFR)h?V})7GT6`m)X72LGV>qR}cCF z=L{DIC!(UQ9~?^-SPS@GOa?6bEf6Ty)zz=-Rc6f*k!)|i1(%kx*E3BdYR`e-6{YKv zEq+R{yd0&MadW9Df+746N&J?brc(|F z7)bjmNG2+R;^cu3i0AOs&hN8zt|0bnsjG{_Pot0zvc>a>00ZB~$k|pjFd|W;VrMS} zg{>f$R!~r|x&F0tUETC#agE@AvP#eXtQn*EV_(2jk=y;$9v$5ms0=0VJ{E5`qV(g^ zcVHI-*CxFaYC`5Gch@w z-?8e6juYkUYipCDE-o&5JK+HH?N>)aUG-Z4t_M1@`xE3~WT5|}?cc7R zvy02u*4F-fPymw_6ciMfY7T1uK=Nh0P)`tiC|_WW+!}h%0k(A`|BDeF$?dl|fV)RA z>uoPA2vu|grE(h!E6grjrkXc_2M*h?&1&931ky`$G#%*Ue8KT_$7!s44xa0NEv(OT zoahWz;5q|P%6>e82G;#QWdZ&#_x$f9f=V06PsF8=SU z-@Q!0UlnQ4n>&#J)fy{kPAf|a>gT`y?3E+&oYnACKy9qVyM0P^Dqx4tk#J1g}3;z-Ltys7QH ziz;ek5GMm!W-)uOgjHEAuNQ?xlbgf1<KxV6D|#RLwlV*$*>XI>F&S91&rU%Q;>Tr>V5{ypdBjOuLO7!@o5#nxw7oQs<-o@cS1MeOozAdy zgMA(AW1PT0KK!!tnt7AQ<<-!o9dAkr^gK>hsqH3>o%@PK7h^TOgK~gEU3o5_L0K>| zP9f*_8`)##GsS)Etcr)@g_9Xoa#%U9lhEx2`$ebGL3|t529DA{E^WFb->KqI4cD z_8J_qV=Kq_^AW6_P2J-8;~yteatU2(OftPs&*ze6QVF-td05@2LiX)0-T9z(MOT|W zsOg5C>^?JOn&sx)pq45;`~gcUv9fVL*bnqU(E>noyPU3PYL%Mof{OwN+cU0U;~I$K z$j3J+h`_;)EjMcsF}ou|rF(AFx8BfjoUZ7dhaFQVqCJmmBpCKdF`f}I2d2{+@h_BqEdx(Ki5KuV{qY%CSy?3|C4sW#H0l3?B^xcP_j}f#Ge)VPuDBww zY^LF@OzyrLAhENBJ9(F}Ak~H%glUj!M$FEG961kcI19vG0>V(|F#3(L!ky9lDfgq9 z)s>YKWbMm!`J6Wnx=ThcTOcy=l)3RzcRV~P0aXh(P97`2dI9GedjH6WI z&!>B3r1a)AB>a5*;9YC?La9_kbsx6Ug{$!L_kN~{si~6F9UumJd3V4pCj-|C=sLi; zf_74mHYbKs#qLOMOqOi`XC5BfWgO?(I7sh}EYn%OH#F}JBH6WeG~os{*2s<|mz6AB z+>H+^-QL%5U_R+X;epq6D8|~s8;ty*a1=dUpbM-5l*JF|5_moYLi zC4g!ehQiwB1tC@|MZ=|UAs_*pj(2^Z#Xg{Q!QKK0owW3Ha09{=Sj?v#8Tt++p_d*F z>6aCw&TVSG-7`p@;Wq*| z7dK|i)vL1gmJ7H%9c$=R63l<2^sEL4y_QJ!9bRW6XNyuVq3+d|V{w8ures0R>5wc+ z%;y4Yf}O$iE|5vl;OFJ70Y+WkEV$)yo$O;{3*#Wt>=4zXCi{H|a6M0l62-R-l!dtd zy?0qSbJ~adN?}*WD`|bhg$?5o;zCRGn}?m$BURYKhtmFjexOn(Ib%&21DO;{W+4F|?J ztJROYu5{I{XA?@zO;|6r{CF)SD?1-iMR^t!*E?soIk+#?KmoO?32u}p7YBI}Z~{%* zvu3O8j0NPvDP6%0A$e9a7}XeXVX)}D_vPryxCe3?fOezOg1dq4$i)-wG z!h~gCNf2R#Zza4bjG6Oy##HWmQq5IiF?C)2<&sMQs^t6DXKIc@sic_n>fJ!L z;@)G?hy0myt~>m9?%YAXJf1Fkqyj^}_8^g+vKP4OG#1Rb;1uB9GFWG`605x&=$k-w zyif~cBMd;VFEebb!04;JxL6EpKvXZ#EGvGt{sV}9kYL79QO(yJY4E%XqmdgVk+8RC z4bTIeP4aOGlSWmy&cLU@DoYp-tIRTWju zX*c%1(^l*kDF;Sfiv8W*FkLJ2dXL47aj7lQ!^wiZj}tfkY`^e~X};&q3afP4bn z7K_Pgnv0qY%r8kf&X1P1#EKnW8oLw5mvJD^E6~}5uEJQyt-3y6 zWE&8ck^fp;Bdp(Cq13k9tRO}@~R zx#La1L$040Wjfk8({2ktk38<$J{S~;E`I$GBY`mYTx^)s?@e?Fz7rTy01OU)g6Y(nfb z-;4@V3?=}vHE^(%W8+57m;;Accl9-8^o`{)k%3xd*f zW(b7cT7;iZ&Q@(J{;}nvEBdS zBZQ)-^eD0JFMnx4cvbH6g_+`5rWhk<5D{t6zr+eMU8-G_3)qPdlk-_$j~022{hH}! zRu)xicoME~GGuv^ZclE>sak3I^Xd$N68r?HNXBz44J~0aJiq-JdwT!={T68r*zE_{ z7nFC>($dKHq5OP&e2l*jwh)M-q9zJld2HkH?C*-DWNyBInrrg%A{sFrAsTyq{i=1K z8+TFUfhsLdPz61OoL?XCF9y*!R=&oeeo!quSw{gh3uG(oQu=c=93GbOWnizzdwidDVj+m7^Br3`rV+;`O%D5y%sW*Z5FBhIDTjjr9ur8DwX|)M{lN&SZ40 z6Nw!A12jo~Y>0x%$T}YQ5!-uXG9#fDi}rM}U%P(Z#m#(aPhh7@ZQ#4mO-sYa66jQc zomB6PGfW+?_$n60S<5{I4_a%&X))_airlW^c(Tgm)^c?pgMj9OU7#xOc1%VLO+o?M z0S+U@yetoqox*A0r|L7OCjAFj$i5!c$v@^wu#psbnPI8RoA*0QV&9mJ5nqSlaqb`e zta(s)imP^4n;*CK9&Yl`=hu4kRXT>-rogO)w&fA%MKCpSCw8L#d4t(dVbuX`pdV44G8oe1ah~42m*QWf9KS(YLxhnpcMI5+p^Zk z_jd|mzBW%FuRJ@(3IyZxhD(@Qk5c{R&=z9vLKG3k`j{sq3`pepH~Z$}??Sp7_Ms}3 zmQ-}#RjW#iiw~k0wdqwWo98EfG(XCLPn2XioNW8!vVIy!{aOFzE;>58ow=pup%)rS zX7B9H^@+>%L1NwMJQ9<_bHmX*d@@1~ORse@GO|Ffec^-U?yR@nt`AWMl8?70i^Xf< zxs7O%F%|v3SPb?K4!nnbuqIDbEY6?p?W-f-Ke#?XxjrAQGvds6Nw>ed%jR%wY^M(S zY}B+5jpMZWBrY!g>C<)$%STF+Mz_bbl1IuvjJ%_j?{l3khNeY)tkT_$)HYdQFAyTwwz1J#|abrIhuBIC?xG315%w_BD3MMP95J8D@Ltl zLBlr&Ysmt>%e{#V)-1Xm&$AhnigX&j-q(s7#$r$t_s!g2j)g~@+=paBY2h%*ckj^B zf*Tb>*R9rv(9lZ|z5M)iBxDF!3~}0Hn9GvM6H$GHX+mO~F~}Ml8x7VzBizmG!7nkL zdut>Uw9aY0sS#})TuLw4HD$2U6K`l}Zf@@ASUonZ9mw4}&z$vqAvZzgf&BHZCvVuF zuQYB-O(m@)NZnAXl+iPk)AWt&D$sOx=J_}7gxVSi!qp&mQ zNk}d`D3_<%1(*+AwP<k z{2Ls#2lB_;(_#&^P8a*kh3F=p%lvHiBZI!h_RiRHXFE67JNvZ|$gqdIi7-00alCm%Eh28L|-bfvtw#tZd#Vy33A=#F-Gzq!C*u+cnKF%0rO z-Oh+T=E6|0^3hXn(8eS&)r=yVSvR+Pj3^2nkReK1W0;MNjdBSXGn0PL;rg&x*XB$O z=P(wnqUqWG5{XcN<=TLNO7@nlAHSgB0LG`B_uma9Bje*G67ZqMQBVm6V)M&WvxqkV zVp3AQ?d=*xB+ln+6baQE|GTcz;`wBUR#%La=O4;#z$}eBOXicPwgvNE9V(3nk z7%n*>K(hTiCZ)g95$jrRjBK6M-PGjdZ1`Z%Gz&1_#bGnm2ql-mff@_5gB|re(#J~I z?VhN@kM3C3jGmvV1L|YD%)0zvuj0ECZ!Yym9M9J>vPAe8g*M&NgXok?o|4>d+_>Ca zS}7^1O8Vo21B++Qic(@?DH4P3yBqm+d0UP{neR$gqxBPr)FXe#4Yf8*nw?&y{7no= zVFwZf!U7rV!|94*T-Y2h?u=xhz#Tw-r-ls4M5y-|(OBvT|Nf!u(^!FKo%5As0v8p- z1IQ5M|4s_SEKZuKk)-pr6&t#UTzx<%NmeT3Ex#F(?FW+|8P*z~@zeN$GEC{0n86ZZ zRFs24>WS;i9=(k#f3t*+qGnoyU6jYEaf%a!@~h>OZwp*3K$GiI*!V zk5fk3{Z7f6fvk*YQA)fNRqR6`uQckIZAimnjYm5fi#Pf7c7|YFnZqFJBZ^;W>W5absm7vIRY}u^fWgI zhqCBovA$F!y{f_5LLhG~h_ro{P6H61;^N3T`KnbB@|mG+1P-}!Eae^VmKzq@0x!Iq2&zqZ5<0KW&o?H#4Uddu{WQfU`f;+9Zi`)AwL)O)J%47-&rpiN zMs7$ee0Gt3_zsuk(B@f%V1vV?vZ;?(2cKR7V#ie-ggx03`Gc}-y6_xi)>F3W7R8&-|?_lG` zLQRtAzNM_UV5!rp7yIokv<-d{4wuc4WHIRbHIODImr>>>Sa5jFDwFNC`wLx)3ypvv zAvDxtuJQi5=HY7ppP4&5SUFkkC*k4Yp`+XKXPtSKK$|=rWRAh{sk){HRHx#iBEbN> zEJwx6q43~Hs6pSiu(0PNhbJdHlVxyGY;avQdJP?QTPUBtZN6HKWO#qEelNSlazXiw z@3X7`v%X2frC42^azz2RuU8i*83YC=ckbR@V>>)Lk`NZwkN`XHUvui)C>f8vD7DZIJz&P2O>_u!Lj2(;dlGT5=lZ zqBVrsH{?n_M0DERWy|T)UoO(^JWN0=vf3CyBN3F=?N1gsEQAf>W!LRCB9(}xozw-( z2=HT9+wKu}M=7dS^;RcO*~LUtXK;1splx}C<&;-cw6wGoa^S0dSN@@8g|_6YCCos_ z&K}K>9B9K6nIyux!w>frEPboGXUOUQz-1`=A44Y7S`_}p#{pN0x0Zs#1)6!nIlqlQ zo<*o}L-h9^l1unVUY2Ro<<(~}I21K3701?K0rDM8;(f+6W?9RET#`hAeRp#RR1Rvl z^sB-3P;;QfP`2`Ltk%iF&IlV6;q2w_vQnBGYOx`}Onp&g{aY*OkuC`n~fw z`roIfvuh{Ya51G?bT48a1z@AuZ_S@%%vU--p=^!cPQ)!rL@=TqDW3br=ekPb%fq^g zZ!}({Yq!q5igV_2z2aivA$4>+)s_fFwtHHo!jrN4-{<)_?g*zJDuo3F{aRURTOc4H zKtMnkA0PMj_O7k11<$Uhq4APEh9kK4F}2h%Gqz~k!vOui7omNs!s6m^4Mvg}9L#9BDs843<3E7mWMq_WsRvS~+XFYJUg4aB zys#@?#a#U+P$_u<-eZ>E1{uTF))tH!%<^H??A3NxG?QFLVfy)8ljk_G3A`g|v7w;g z)wuzPHu{S@?rm!+lhe~R&f{>CjnVwk4S!Z7L`1!wI1#mU*t#n!Pf!GPtRH~)g8n$s zn|0;oQP#cP-Tu~DA4l^*NyPYj*!SWeYqtfYRr-)nmuyHBD^t6m!? zDTCQta}xVnH6dU5hv*b0iU5EL252=(m)X&D^G7&umrNcRy8{H%w?`+0(AO5Hy?nSf z2nH9CQi^PBP$nMz+C5J?Bs8?9rY1u&o|@so8&~$Wu1&vtL6d~E#>amC~ zC|eP~erZ%1rO<>iYPat0Od!1a%HD>o8UprasZz0Ce$6q?MU_Ss!hg$B@cKPiwov1Z zCaxjBqU2gVBu_{f@(6NEiMVOY?_zFddywE$BQMEll0gWN!%LFzvYiRq1qJ>(rX8@> z^%J2UQL)Rz{^XZs1Mn7@YhvB~$9G(M zhagV!WY%4d-%d)jCRRlhcle`>yY+%4wjA0`B%6@<`<=ktQP3Eb>?XyQ0u0M2Yw5RS-uGAC%`7t1LGGTF;yx4qH&*A4@PnjvrmdK@aN&2wlZxJ#jBuloB9#m<~Eg@N&6Kj@9-fc#^b%xOATu_mF zft!Zq{`G*8y6ycJ@0JZnAabmj#hQ6N+-%`Lk^h>&X;!%%o=8dEy13hA7YQZTA>7*z z!TU4zJ>1Ckt-$>!-|SVR**#iM4ytx)2OS*a&2>_Hj#||#=yauCQA_3cRY*zi zXrNGQH^m_LBqwk?tb2<*L4e%TfC(Xx-2H6!_wUVaK*FWj|BrC(7sSb3AnJ{g7xips zyoQDWdM~}exJD1i{jaA{mRNxFn?4e+L;`z8`eZc(j?u2fCMfuLZn@9Tmc^D$b z8ErPs?Gfe2_8(73pA&Xg`v5(ysPE?;+zGnFkpTxsEQrPf%c6P@Yu^EnPsPq}viQx+ z%|isAjbV%8Mudf>W@HEn2@$?RB$LJ=6U!ldwM0MGCtB};Nn4OKol>HytgNi1H4jqd z(&k0dJ<${$L#y9UaL?GF0elCyDDFV&POCqzc{bvIJvfT=`)G*cB9~K1`hXxQtu~CS zVv1DIn9aaWT<@BN)%W~s`1;0K1Lj!YHb^AcBv3~esfh?ehDv$Y;_UpDhaWUxRc!>u z!r>S+?=82dDgb(p=dkke@_K}VVlrFnRAYZMH9Z}O&)GT}WrH zqi#yFyLP`LX2GJC%Zh$y!e1Sp*iMUGut_QPp`3&z=a+K-usRQ~<6NM{vBk&Lqp5yg zqoulD70PNg^R3Z>u};-%>(4evWhNO6ShM98Z9#_DPokn*X^Lyvq9dG^CK$>nHKm39 z_G)lywlfxycx6}C*cE1{%?D7RmXOV64*(Yf0|O~E?>~3|aA*DKC@T@s7Zz@AZl#HT zqFMLH=;VF`+%YXzS62Xf$I5sF2BPjjDJk10Cpj4z8EI%fF17~`rb}p>;lAzlh+pBq za=aSVzk}*i`)lNMPRBX1PAC-Xy`#f&hyRBgk)Dm3!?NXmKjH*ywjTv;4nmpIx<@wp zN>jqUVs(S}bqyc=9=Z>=nSR!y?v0i***Vq2zwK^yYi>0$5mB?=z@~ z5_wyjn|D7=PfY>tq6h|CBcJm=_Y-V&+*EGWJMpy`srs(o37Mx-jo9ZoHd|*iyU=A( zu5Oz%_#n--K+;|UlX>3pO&eUcbOj5)R?#*-!|vf#`(W2B0@I+aK=ijVg-D-IwBzCH zN7wKGYgZI}$O6=oy2)1cBee;C<33cbHEsF&>Y}E)dbKEW%L&AqVjO+unpX6%g@uJ3 zk71bZYopP;?s=$N0t)Yh&8O~Kix39tp;W}~SjBj1OQ()?L3?t9LVS&>S_{t%?(O_B zx4m>V6$S|gK6t)IK9``y&*YrCzTp#G-1%t@*u(lS#$$P^RRE;x>gi!(VDz^z1a5Sr za9XYgg^{BAnTSF8^TW;!}@86fVx%nfUgwS|eT%R*l39 z_9KfCiI8lGWwqm{R`B_|` zv&6Q!y1F_Xtz+QgibYPod-o22IIt}!O-{vsH6-TWOxQ_2=bS^zyKJl>H)^yErG6-j zICkP8ceZk(Pi0WOa$=okwuire7zMH#K$~2W3T?MIh-URK9P~`F8epb@si~>ekcvN;Nf*Sg zVG}DW`IYJGL5)KIEsLK zM?>QO_yetBQ;RRwXqN0s&B;tC)(}_f!%`pkgSxuyZauS-3k!&EX~Za)$`T3fp~YltGmAgv|Qz~Pt)aQ3-3|{b@lZR zhDU+^Qm8GY9KS#AsvUPvaRQWggB7Zky*9$x0?oTf%9#IrU?4Z2qy+LLBaUag++1@> zwqi3INQ;UhemuXpIG`ZEI6aNhhON`_@Fd*BdhufH8{b`Z^;;Qn zHYSsIFDp)Wchk|+2Mh!8;KL82mUa8Hf#osncqyR6J)lD}e)O58KSmTcxWEr()_#L7 zL zv({$8X~1+SAXk<(BzcBeKopBSFiaWfB`ffg)7}DBMCzhO*}Z&Nk~X^8m*iT07q7Hu)eSHXb9|+&dz921@$}OY-2C=t;0$hXcNPAn` zd-v|?=<5%XmFDNe1x#Mx;Z5ZzP^e1#zN^85j^?ZDXTfw+@1; zHW^AwPp?*L932~rd-Ud_*lOcFn1=`V@3R;Ud9kv>XD$~*r3Na2JNg(El|jA1{NL+_ zG*&Qx$8PQxM=7)ge9*skz#hbyO}8Vgq@-kVQ3np+$&$_J@cpmH!N4}>=LbOC-cl-c z$xVWPUcDOi@2~ic)c%f>|NMXlfhb~au~Q0=0&w~nrZJ!jOrm66RcIo@LCXy=oL~y3uOnV?zg!xGz_wg8TrOG!y%~Z1k-{`ph zB9P}?xP&O}ojIu2>5}nA`?$IgA{+;ojscXoOcLpB!{nyg;gY)`4x z*vIoYodZpl+u``RN&Eag`QM}IO608*3MAOu+cPvYgjer9KnfwGx{<>knu}w%P>kc) zoUP*}1CrIl|HPa$VaLtrQf{7}D~pRN<)&YBxa|)OYR`c-7a9^m$@}tUeN&Tb%aK~T z*9S=#fK2fFttLU%Y2;Fv?7nY1r}$4z5?kCn6*c&tD)5i~}m9?T&wA)#wk^n&GV zXJaTeOT~SFUs#5oo<27(GXLbYz~PLree|OAdnu40M^dPWSd_RK8Q+x<1%^ga`41x$ zFqLG_Q3T6kw{HA3dBO@Ym&q)wtdSd^=ZA(`vxr;4c>>K=;e2KSGsU;~&FGJ)m;+>V zV^bh?lYm5XyKee0<;a`<`lF4}`0bj==NaixNeo6w!(0G!ljQwP#`@Z)UO}M|!-h}V z7v$#5Iuv?P3`b;>Dm3jvoMjp4S+XYoh5U4Nb)!{OcXWML$H7&*i$6niB`w|%WFQ90 z@+^DQtMz9K?vTnPtEl=2E4F(48@X+09B+;fEzY9)D9@SQa_FN(VGRw9KmzV(&z?2! zpcuj~9bhrFXBQX6TT%qLIx4zwmOgGGgkXTp_PEDw=_wCNt#K!fx z&9}@HLihw0Gwr9RwgYi^_v?xJvs?A9^=HDUWLHC=|G;aWZC)s|b}R9~x=Q4<37{{_ zkV>Ryc<|?f?TM#&c;dh9G(sjlaY@O5>ajUSt)_4qg#j{l)r&wv-s|<@oP90e)PFZJ z6=L9=`&H;tOYfq7zn_F@+@fseNMu#d$&o43bbakge zPNIi=<47v@>tT78Z22SxCAaYqAxRV9T`Gc^ZftPk2AVn{tYFSe|bi5*y^#mp`3J&w`zx<(I#5C@`X7staIRNgk=vAU# zX*RC*r<|>KOsBKD9^p}Vhm4nR~KOib&mb1UVOa0N9@J`o+4^T9-75)xn} zz6Z*O$pkYFN`l}>EiirH5&0>GcQiJFPG_7>RNr|`JQDf~fiIQ-(B#;#AcK>?OQ9TW zd8#6_SlC7|*nLMc*7Fzw||Mqs$YGi8hxN%!s zT0nsX9)cb|hvg~gtWfM*a}I84Z9P9d?F(m{B}^c{zQHu4%X<9Tsh;!&8k#1*yA5GE z3O0pQf~B=}t>v1GVKn*aAiv@Jmchdk;sF3a5xY@3Ll0x^0RWx`qJ2Q#xv!6p!HAx@ zRR@J;;W-e%!x@BnJ&;3iRAUEAK+PV`CZkVFI^8Vp1#Lbc9m*>zwzE*2Nh*seBYvLN zaD3n1_Zx9nqdbn;%vGrfq5cowg!~8bGr%8GgaQG1*mG$5gMAIpmqB%(Z{=jRsHzr$ z&KBv4si_f|O!xNoF0KQ+aeKPzWbL)VN!abv4BY@HG+(_=66$!^FQile{NKZ*MvL|k zFz?l73xa}zt)SVae3^7s+F^M4G>_oG*&a*2Hj{SmZ#_T5MI7!`1l_ zq08kSC~mPsK93~afxEFbKmV5g^p`8DVo)9o?D?@|N$Q@P_p22F`+^>KI<|_muT*V_pLd=0USH;msEc%VvP6F}<1AuUvacRe(gy^vx4#RbQes|=5 z9O@kFORXSqKAo$s=3-aoW{dWZj2s0WG-p1Y5p)N~$C&onn8FrCmvXmE05h$MKUW79 z`gr(@d5YGn*RP9!Xa=}*n(j$d5{E#CY|cZFbsv5mP$kAJC6d4GJt)*}1F5#Es;c-Q zvF{+G5uoI~v8?$3jezDX0v01VYip?b$-jtq#2AGHHP|Yfo10U~0!Z1r?CD|o0?!lG z`bI}>rYo)FlmM#&q^ntA7}UA?yL@Z(Xq}U$e@O0P`CqpEmq&<*$w&i$2IS`E29pR$ z#zOs9f&yh^WK!kzdK0=6lcxT-=adIO0HNNu0+}6bxmES8rp=tYe-9y|3@Fk#IRJ?E zA-@xS2_&Mwq{8?-DLYAX^Vd=fIl%IPl9PK3izseQ{8)IbRf}n1EL?rL-uCr+qxkyzM$&y)US1ZA>{6|=29uiu z6*3+e-fQ+o{}9H9;XG_CquFuqz;(D;^74oUf_mq66xuKi9?;7O;d*)-(#9JK#HAO!+C@zYZ7K#_u2KmPx*D-neH|JdvJauRez;zgL_&fJGU z+Ll>yJJ5w75Yt!xuZ$U>OBWQBFNUrr_p2`=Pn%-9W8pl-!NkF{s}>a#6BQj8985_` zL4_dv{nuAo951jLW1A$6g;%Oa?o;OW{c2y3SB{B@h=_`^Jy@1F+u6g%{a?>!OE-RR zOTB`1R%32#@Ww#Vz;tnsnl3Hy5VUZ$(|oS7G5r0fMz6ILRxPM!{8*60*F~GhQ#GA} zf&}>kGL@~tvJKp~S2cQJ3$SZJ9~v91D7JZ&!DoYEcOv)m!&C~>ki?fNOvcfQnZii) zEP(MNc{KitsY+*Ug^}Tb^R)KF$fwZK!{}O*#m3z_cz`#%)!FEWGCO6ypGTSqRU%%E z*(~@=6{<&Q#oB-0z-nx_C%%d=HsHLv*kt<#|LpLhq<}<;Gr1SeZK?<3?`ZTdB*Aib zs5x5lsPR^SU)nF7GceqDzUn&dWx%TUIQBDdHhwZz5GPeDsd8*bEAIn;&Pit(f;CA# ztl4w|6%0JPu$gUDox+GeTB{w}5_(f!(!Ud9D`jkkvrhyOr%1HJyUT7<(5=tADe1urL$&tpiED_6;=dIgdz>?He|B zd9`lLGR^tu>Ld%BD;i?mcHkV5f3o|uj~VD4o0z!YqK>(Raz1~`YKC<}P*uKEUop*y z1-%O5lWlROuyE4f>7uJ7w~=#wmoOPlP>3TeA3#agfmRHRzq@G)aOd)^<~}9PMBAf5 zgdJnTy**AH*!#tyhkWt@s=kxESN{DB^rsUR>sV@_V}R8{sQ%pbIc{dEd_@V$G68)4Op_?TIj<>Sj|V+9Z1g_DSS-_Bs$k2(EWQYpmi+LMy} zOs9=PE{nFWETnePMR9j)1T}m)>V>f^{1o5mNz-< z=+#wXLgY{D8qi3Vcg~2ZwO9HNm~O0y=~D`N4^8f;jkYj*3~~cBbKC4RG$hBKf+(lk z7q()ZCe+0S1XlYwcdQtw$@y**D)4Qcc4lhK1zDuS8{Q>@$!{_79|_$AT^8W z%)F5}o7!_a>b;n&wNqA0eXg`;(|KvNw6fBh$a_<(6i%UjVL5ey))1?; zXk{6Y8Wt7?nxpzC96@uO2Pz?O3)|*pUc+T{Zy_e9jq_@fCl?pjGjw#N%TaX~GKO1{ z3wqB01!YVyeu7yx7sSqKgV)|pS8KL({yl_-6+V3v>0yZFQ$2faE+*I7KXh5{_cb+l z{;-qRL2^19P;oO;gUI#K{N8o2VbzLsL;$9aWj1_my*Wms;C#Vt4@^yv_R~rLp)r}M z9v3zr_d8%!RCbrXjXFk>>htxSotl#bJi4ZKv^1_4VL}1sriv7~T2!|?m8}Ft!3n$V zNQkM~8Sc5a{OShK)WjQOcu{pgPw-&|?-kYS*ZTl{fzB>q2|6tJvnr~HE(4x|3*7|m zgqEM_l}o(ngB9a?P=GQC#{FR#b2>kx=I=bABq+2TQ@S_^v7ZAk%rmCWEew z-!82&#$Mjoy{XnwL$`k0Q|tMY#GBquMO9U4+6!eZQ}+l+!uy8(gx9+dw}zw`#_?!B zHPtdT3Y*HTv69dpInH&f!$Xfs(!MRm3?xe4(c$1|QmO`02H^gBM*!gfJ)^)Lv>?9E zSBno1Z;3&!(FuizqW#$dkLoU_cZ9di|`0#fJ?EpmK1p#Oi692bXizpJxiC4 z^eduz+u>nIE&22_7ZQiqj4L2NyVM?c=9g_>I&O^;h8ACl&yv$G6=0bIkW^B_4El@l zIjsxW;^&NCVE_0ys<&5O&K85o0zwt$`DE7dz<*CC!^bbgZGS57&bJY8+Wprfw)bQ8gmZgCB+vg0?7qwYD4%i(eSpd%_Ivr!H?g2#NnVVPRO$t^GH9tx{QG^wDn>bunjXFsiC*W$f&3pIwM13dGa|Cc&~9m zDOy8gYRt*6#d-dmRH(C$Gx_idh>H|fHVh88F238)aGeN}RWy%xYnK;RzBE$z=^e^n zoG2Bq^rMb^?Fc zch+G=nx|sz&-*d}AvuDYMj>x=FrybV(XP3Y0wmh%Pj-5ChR^F9r}st&R#~LSSF^a> z9V;6&Oyl!sMTmea9uNm4=r~@N1bR=sv1B;B77Sx5&&bgdnkOFlClc+&uS=mu6y!7_nHGteJlgh{%(FwxYs zkmN}KOv*vvpV`GJq%JemT|NWu)B3uozJq~5W{KQ5b3lv9>1J~`)_#6#>e7x^&qQKe ztn=9lSt8+q{YH+Vj%&Bv1UrC9=NZ*~1vZV3(!rp=7Rd-iMq*m8*e7(#ZR z6zrS*VA(i4j%-`&fO>3#w=e1t{;}BMxR@ljDg86b&N8N|gYzZk46=%g?R1Z=W`&6? zKD1iVl#Y6CVC{fxPamm{BLpKn>|m$dmoIi9J)eCyQozAMe0u$AB$5PcOSORUxQUy> zX=dE|Ao7Db1IwQvv$*#M@7S<9#C;q@> zs%2N(<0hecW7QqNgxY|L0+RDf1<%)`H=I_VZ;q!Q4lL3eadlW!4UjB9`t#IVc%2iw zp!K9z^3t(A4!@r_Ej=|IK4x~hbjCTWjB(aG?d=etcSS*T5nC=+6__ylB6@Fo!c`6K zgpG5oEh!1;iMI*2BtMv`PtADumb}LC3X~x3rLvlLIYC zPfrifmJrwu<;`VfdNNlT4Xf6ZufJhmUr%8!3cKY`@qiR(pp6t27mEat^29t)tF{e} zd7df&nsIJv@rO5HXlBiuxVJ;I)`D^I$vsYZsr>jb!P6UU5C#YMhqI6

The following actions are added to all disassembly listings by the breakpoint marker plugin. - They allow the placement and toggling of breakpoints by address, kind, and length. To set - breakpoints on arbitrary expressions, use the Set - Breakpoint action of the Objects window. NOTE: These actions may also appear in - other address-based contexts, but not all of those contexts include visual breakpoint - indicators.