Module: remote-nub Synopsis: Functional interface implementations for the CORBA Debugger Nub of the Remote Debugger Author: Nosa Omo Copyright: Original Code is Copyright (c) 1995-2004 Functional Objects, Inc. All rights reserved. License: Functional Objects Library Public License Version 1.0 Dual-license: GNU Lesser General Public License Warranty: Distributed WITHOUT WARRANTY OF ANY KIND define inline method import- (x :: ) => (i :: ) if (instance?(x, )) x else make(, high: $minimum-unsigned-machine-word, low: x); end if; end method; define inline method import- (v :: , #key sz) => (vector :: Rtmgr/RemoteNub/) let size :: = sz | v.size; let vector = make (Rtmgr/RemoteNub/, size: size, fill: 0); for (i :: from 0 below size) let x :: = pointer-value(v, index: i); vector[i] := import-(x); end for; vector end method; define inline method import-(x) => (x) x end method; define inline method export- (x :: ) => (i :: ) if (instance?(x, )) x else as(, x); end if; end method; define inline method export- (vector :: Rtmgr/RemoteNub/, #key vec, sz) => (v :: ) let size :: = sz | vector.size; let v :: = vec | (make (, element-count: size)); for (i :: from 0 below size) let x :: = vector[i]; pointer-value(v, index: i) := export-(x); end for; v end method; define inline method export-(x) => (x) x end method; define macro corba-type-definer { define corba-type ?type:name = ?alias:name } => { define constant "import-" ## ?type = "import-" ## ?alias; define constant "export-" ## ?type = "export-" ## ?alias } end macro; define corba-type Rtmgr/RemoteNub/ = ; define corba-type Rtmgr/RemoteNub/ = ; define corba-type Rtmgr/RemoteNub/ = ; define corba-type Rtmgr/RemoteNub/ = ; define corba-type Rtmgr/RemoteNub/ = ; define corba-type Rtmgr/RemoteNub/ = ; define corba-type Rtmgr/RemoteNub/ = ; define corba-type Rtmgr/RemoteNub/ = ; define corba-type Rtmgr/RemoteNub/ = ; define corba-type Rtmgr/RemoteNub/ = ; define corba-type Rtmgr/RemoteNub/ = ; define corba-type Rtmgr/RemoteNub/ = ; define corba-type Rtmgr/RemoteNub/ = ; define corba-type CORBA/ = ; define macro corba-method-definer { define corba-method ?method-name:name (?arg-specs:*) => (?result-specs:*) ?:body end } => { define corba-method-aux ?method-name (?arg-specs) (?result-specs) (?result-specs) ?body end } end macro; define macro corba-method-aux-definer { define corba-method-aux ?method-name:name (?nub:name :: ?nub-implementation:name, ?arg-specs:*) (?result-specs:*) (?specs:*) ?:body end } => { define method ?method-name (?nub :: ?nub-implementation, ?arg-specs) => (?result-specs) export-corba-values (?arg-specs) let (?specs) = begin ?body end; import-corba-values (?result-specs) values(?specs); end; end end } specs: { } => { } { ?spec:name :: ?type:name, ...} => { ?spec, ...} end macro; define macro import-corba-values { import-corba-values () ?:body end } => { ?body } { import-corba-values (?spec:name :: ?type:name, ?specs:*) ?:body end } => { let ?spec :: ?type = "import-" ## ?type(?spec); import-corba-values (?specs) ?body end } end macro; define macro export-corba-values { export-corba-values () ?:body end } => { ?body } { export-corba-values (?spec:name :: ?type:name, ?specs:*) ?:body end } => { let ?spec = "export-" ## ?type(?spec); export-corba-values (?specs) ?body end } end macro; /* define corba-method Rtmgr/RemoteNub/create-and-debug-process (rnub :: , command :: CORBA/, arguments :: CORBA/, path-count :: Rtmgr/RemoteNub/, lib-count :: Rtmgr/RemoteNub/, working-dir :: CORBA/, create-shell :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-create-and-debug-process (process, command, arguments, path-count, lib-count, working-dir, create-shell); end corba-method; define corba-method Rtmgr/RemoteNub/debug-active-process (rnub :: , process-name :: CORBA/, process-id :: CORBA/, actual-process-id :: CORBA/, path-count :: Rtmgr/RemoteNub/, jit-info :: CORBA/) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-debug-active-process (process, process-name, process-id, actual-process-id, path-count, jit-info); end corba-method; */ define corba-method Rtmgr/RemoteNub/remote-value-byte-size (rnub :: ) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-remote-value-byte-size (process); end corba-method; define corba-method Rtmgr/RemoteNub/get-process-page-fault-count (rnub :: ) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-get-process-page-fault-count (process); end corba-method; define corba-method Rtmgr/RemoteNub/thread-os-priority (rnub :: , nubthread :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-thread-os-priority (process, nubthread); end corba-method; define corba-method Rtmgr/RemoteNub/get-thread-cpu-time (rnub :: , nubthread :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-get-thread-cpu-time (process, nubthread); end corba-method; define corba-method Rtmgr/RemoteNub/get-library-base-address (rnub :: , dll :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-get-library-base-address (process, dll); end corba-method; define corba-method Rtmgr/RemoteNub/get-library-version (rnub :: , dll :: Rtmgr/RemoteNub/) => (maj :: Rtmgr/RemoteNub/, min :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-get-library-version (process, dll); end corba-method; define corba-method Rtmgr/RemoteNub/get-library-filename (rnub :: , dll :: Rtmgr/RemoteNub/) => (result :: CORBA/) let process = remote-process(rnub); let name-length :: = nub-get-library-filename-length(process, dll); let C-filename = make (, size: name-length); nub-get-library-filename (process, dll, name-length, C-filename); C-filename end corba-method; define corba-method Rtmgr/RemoteNub/get-library-undecorated-name (rnub :: , dll :: Rtmgr/RemoteNub/) => (result :: CORBA/) let process = remote-process(rnub); let name-length = nub-get-library-undecorated-name-length(process, dll); let basic-name = make(, size: name-length); nub-get-library-undecorated-name (process, dll, name-length, basic-name); basic-name end corba-method; define corba-method Rtmgr/RemoteNub/get-register-name (rnub :: , reg :: Rtmgr/RemoteNub/) => (result :: CORBA/) let process = remote-process(rnub); let name-length :: = nub-get-register-name-length(process, reg); let register-name = make (, size: name-length); nub-get-register-name (process, reg, name-length, register-name); register-name end corba-method; define corba-method Rtmgr/RemoteNub/get-register-enumeration-code (rnub :: , reg :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-get-register-enumeration-code (process, reg); end corba-method; define corba-method Rtmgr/RemoteNub/all-registers (rnub :: ) => (first :: Rtmgr/RemoteNub/, last :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-all-registers (process); end corba-method; define corba-method Rtmgr/RemoteNub/general-registers (rnub :: ) => (first :: Rtmgr/RemoteNub/, last :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-general-registers (process); end corba-method; define corba-method Rtmgr/RemoteNub/special-registers (rnub :: ) => (first :: Rtmgr/RemoteNub/, last :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-special-registers (process); end corba-method; /* define corba-method Rtmgr/RemoteNub/floating-registers (rnub :: ) => (first :: Rtmgr/RemoteNub/, last :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-floating-registers (process); end corba-method; */ define corba-method Rtmgr/RemoteNub/page-read-permission (rnub :: , address :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-page-read-permission (process, address); end corba-method; define corba-method Rtmgr/RemoteNub/page-write-permission (rnub :: , address :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-page-write-permission (process, address); end corba-method; define corba-method Rtmgr/RemoteNub/page-relative-address (rnub :: , address :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/, offset :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-page-relative-address (process, address); end corba-method; define corba-method Rtmgr/RemoteNub/virtual-page-size (rnub :: ) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-virtual-page-size (process); end corba-method; define corba-method Rtmgr/RemoteNub/read-value-from-process-memory (rnub :: , address :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/, status :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-read-value-from-process-memory (process, address); end corba-method; define corba-method Rtmgr/RemoteNub/write-value-to-process-memory (rnub :: , address :: Rtmgr/RemoteNub/, val :: Rtmgr/RemoteNub/) => (status :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-write-value-to-process-memory (process, address, val); end corba-method; define corba-method Rtmgr/RemoteNub/calculate-stack-address (rnub :: , nubthread :: Rtmgr/RemoteNub/, offset :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-calculate-stack-address (process, nubthread, offset); end corba-method; define corba-method Rtmgr/RemoteNub/target-address-to-string (rnub :: , x :: Rtmgr/RemoteNub/, sz :: Rtmgr/RemoteNub/, radix :: Rtmgr/RemoteNub/, pad :: Rtmgr/RemoteNub/) => (result :: CORBA/, truncated :: Rtmgr/RemoteNub/) let process = remote-process(rnub); let str = make(, size: sz); let trunc? = nub-target-address-to-string (process, x, sz, str, radix, pad); values(str, trunc?) end corba-method; define corba-method Rtmgr/RemoteNub/string-to-target-address (rnub :: , sz :: Rtmgr/RemoteNub/, buffer :: CORBA/, radix :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/, overflow :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-string-to-target-address (process, sz, buffer, radix); end corba-method; define corba-method Rtmgr/RemoteNub/read-single-float-from-process-memory (rnub :: , address :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/, status :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-read-single-float-from-process-memory (process, address); end corba-method; define corba-method Rtmgr/RemoteNub/write-single-float-to-process-memory (rnub :: , address :: Rtmgr/RemoteNub/, value :: Rtmgr/RemoteNub/) => (status :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-write-single-float-to-process-memory (process, address, value); end corba-method; define corba-method Rtmgr/RemoteNub/read-double-float-from-process-memory (rnub :: , address :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/, status :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-read-double-float-from-process-memory (process, address); end corba-method; define corba-method Rtmgr/RemoteNub/write-double-float-to-process-memory (rnub :: , address :: Rtmgr/RemoteNub/, value :: Rtmgr/RemoteNub/) => (status :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-write-double-float-to-process-memory (process, address, value); end corba-method; define corba-method Rtmgr/RemoteNub/read-byte-string-from-process-memory (rnub :: , address :: Rtmgr/RemoteNub/, sz :: Rtmgr/RemoteNub/) => (buffer :: CORBA/, status :: Rtmgr/RemoteNub/) let process = remote-process(rnub); let string-destination = make (, size: sz); values(string-destination, nub-read-byte-string-from-process-memory (process, address, sz, string-destination)); end corba-method; define corba-method Rtmgr/RemoteNub/write-byte-string-to-process-memory (rnub :: , address :: Rtmgr/RemoteNub/, sz :: Rtmgr/RemoteNub/, buffer :: CORBA/) => (status :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-write-byte-string-to-process-memory (process, address, sz, buffer); end corba-method; define corba-method Rtmgr/RemoteNub/read-value-from-process-register-in-stack-frame (rnub :: , nubthread :: Rtmgr/RemoteNub/, reg :: Rtmgr/RemoteNub/, frame-index :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/, status :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-read-value-from-process-register-in-stack-frame (process, nubthread, reg, frame-index); end corba-method; define corba-method Rtmgr/RemoteNub/read-value-from-process-register (rnub :: , nubthread :: Rtmgr/RemoteNub/, reg :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/, status :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-read-value-from-process-register (process, nubthread, reg); end corba-method; define corba-method Rtmgr/RemoteNub/write-value-to-process-register (rnub :: , nubthread :: Rtmgr/RemoteNub/, reg :: Rtmgr/RemoteNub/, value :: Rtmgr/RemoteNub/) => (status :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-write-value-to-process-register (process, nubthread, reg, value); end corba-method; define corba-method Rtmgr/RemoteNub/read-single-float-from-process-register (rnub :: , nubthread :: Rtmgr/RemoteNub/, reg :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/, status :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-read-single-float-from-process-register (process, nubthread, reg); end corba-method; define corba-method Rtmgr/RemoteNub/write-single-float-to-process-register (rnub :: , nubthread :: Rtmgr/RemoteNub/, reg :: Rtmgr/RemoteNub/, value :: Rtmgr/RemoteNub/) => (status :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-write-single-float-to-process-register (process, nubthread, reg, value); end corba-method; define corba-method Rtmgr/RemoteNub/read-double-float-from-process-register (rnub :: , nubthread :: Rtmgr/RemoteNub/, reg :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/, status :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-read-double-float-from-process-register (process, nubthread, reg); end corba-method; define corba-method Rtmgr/RemoteNub/write-double-float-to-process-register (rnub :: , nubthread :: Rtmgr/RemoteNub/, reg :: Rtmgr/RemoteNub/, value :: Rtmgr/RemoteNub/) => (status :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-write-double-float-to-process-register (process, nubthread, reg, value); end corba-method; define corba-method Rtmgr/RemoteNub/application-restart (rnub :: ) => () let process = remote-process(rnub); nub-application-restart (process); end corba-method; define corba-method Rtmgr/RemoteNub/application-stop (rnub :: ) => () let process = remote-process(rnub); nub-application-stop (process); end corba-method; define corba-method Rtmgr/RemoteNub/application-continue (rnub :: ) => () let process = remote-process(rnub); nub-application-continue (process); end corba-method; define corba-method Rtmgr/RemoteNub/application-continue-unhandled (rnub :: ) => () let process = remote-process(rnub); nub-application-continue-unhandled (process); end corba-method; define corba-method Rtmgr/RemoteNub/application-step (rnub :: , n :: Rtmgr/RemoteNub/) => () let process = remote-process(rnub); nub-application-step (process, n); end corba-method; define corba-method Rtmgr/RemoteNub/application-step-over (rnub :: , n :: Rtmgr/RemoteNub/) => () let process = remote-process(rnub); nub-application-step-over (process, n); end corba-method; define corba-method Rtmgr/RemoteNub/application-step-out (rnub :: ) => () let process = remote-process(rnub); nub-application-step-out (process); end corba-method; define corba-method Rtmgr/RemoteNub/set-stepping-control-on-thread (rnub :: , nubthread :: Rtmgr/RemoteNub/, fp :: Rtmgr/RemoteNub/, calling-fp :: Rtmgr/RemoteNub/, location-count :: Rtmgr/RemoteNub/, locs :: Rtmgr/RemoteNub/, operation :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); // Fill in a pre-allocated vector of addresses with those that the // client has calculated. let locations :: = export-(locs, vec: rnub.stepping-locations-vector, sz: location-count); nub-set-stepping-control-on-thread (process, nubthread, fp, calling-fp, location-count, locations, operation); end corba-method; define corba-method Rtmgr/RemoteNub/clear-stepping-control-on-thread (rnub :: , nubthread :: Rtmgr/RemoteNub/) => () let process = remote-process(rnub); nub-clear-stepping-control-on-thread (process, nubthread); end corba-method; define corba-method Rtmgr/RemoteNub/thread-stop (rnub :: , nubthread :: Rtmgr/RemoteNub/) => () let process = remote-process(rnub); nub-thread-stop (process, nubthread); end corba-method; define corba-method Rtmgr/RemoteNub/thread-continue (rnub :: , nubthread :: Rtmgr/RemoteNub/) => () let process = remote-process(rnub); nub-thread-continue (process, nubthread); end corba-method; define corba-method Rtmgr/RemoteNub/thread-suspendedQ (rnub :: , thread :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); let result = nub-thread-suspended?(thread); if (result = #f) 0 else 1 end; end corba-method; define corba-method Rtmgr/RemoteNub/thread-suspended (rnub :: , thread :: Rtmgr/RemoteNub/) => () let process = remote-process(rnub); nub-thread-suspended (thread); end corba-method; define corba-method Rtmgr/RemoteNub/thread-resumed (rnub :: , thread :: Rtmgr/RemoteNub/) => () let process = remote-process(rnub); nub-thread-resumed (thread); end corba-method; define corba-method Rtmgr/RemoteNub/kill-application (rnub :: ) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-kill-application (process); end corba-method; define corba-method Rtmgr/RemoteNub/close-application (rnub :: ) => () let process = remote-process(rnub); nub-close-application (process); end corba-method; /* define corba-method Rtmgr/RemoteNub/close-remote-tether (rnub :: ) => () let process = remote-process(rnub); nub-close-remote-tether (process); end corba-method; */ define corba-method Rtmgr/RemoteNub/setup-function-call (rnub :: , nubthread :: Rtmgr/RemoteNub/, func :: Rtmgr/RemoteNub/, arg-count :: Rtmgr/RemoteNub/, args :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/, cx-handle :: Rtmgr/RemoteNub/) let process = remote-process(rnub); // Construct the vector of arguments let arg-vector :: = export-(args, sz: arg-count); let (ret-addr, context-cookie) = nub-setup-function-call (process, nubthread, func, arg-count, arg-vector); // Since the debugger nub will now have copied the arguments onto the // runtime stack, we can destroy the allocated vector. destroy(arg-vector); values(ret-addr, context-cookie); end corba-method; define corba-method Rtmgr/RemoteNub/remote-call-spy (rnub :: , nubthread :: Rtmgr/RemoteNub/, func :: Rtmgr/RemoteNub/, arg-count :: Rtmgr/RemoteNub/, args :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/, status :: Rtmgr/RemoteNub/) let process = remote-process(rnub); // Construct the vector of arguments let arg-vector :: = export-(args, vec: rnub.spy-function-argument-vector, sz: arg-count); // And make the call, returning the results from the nub. nub-remote-call-spy (process, nubthread, func, arg-count, arg-vector); end corba-method; define corba-method Rtmgr/RemoteNub/get-function-result (rnub :: , nubthread :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-get-function-result (process, nubthread); end corba-method; define corba-method Rtmgr/RemoteNub/restore-context (rnub :: , nubthread :: Rtmgr/RemoteNub/, the-context :: Rtmgr/RemoteNub/) => () let process = remote-process(rnub); nub-restore-context (process, nubthread, the-context); end corba-method; define corba-method Rtmgr/RemoteNub/set-breakpoint (rnub :: , address :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-set-breakpoint (process, address); end corba-method; define corba-method Rtmgr/RemoteNub/clear-breakpoint (rnub :: , address :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-clear-breakpoint (process, address); end corba-method; define corba-method Rtmgr/RemoteNub/query-breakpoint (rnub :: , address :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-query-breakpoint (process, address); end corba-method; define corba-method Rtmgr/RemoteNub/wait-for-stop-reason-with-timeout (rnub :: , timeout :: Rtmgr/RemoteNub/) => (code :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-wait-for-stop-reason-with-timeout (process, timeout); end corba-method; define corba-method Rtmgr/RemoteNub/profile-wait-for-stop-reason-with-timeout (rnub :: , timeout :: Rtmgr/RemoteNub/, profiling-interval :: Rtmgr/RemoteNub/) => (code :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-profile-wait-for-stop-reason-with-timeout (process, timeout, profiling-interval); end corba-method; define corba-method Rtmgr/RemoteNub/inform-profiling-started (rnub :: ) => () let process = remote-process(rnub); nub-inform-profiling-started (process); end corba-method; define corba-method Rtmgr/RemoteNub/inform-profiling-stopped (rnub :: ) => () let process = remote-process(rnub); nub-inform-profiling-stopped (process); end corba-method; define corba-method Rtmgr/RemoteNub/can-receive-first-chance (rnub :: , ecode :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-can-receive-first-chance (process, ecode); end corba-method; define corba-method Rtmgr/RemoteNub/set-first-chance (rnub :: , ecode :: Rtmgr/RemoteNub/) => () let process = remote-process(rnub); nub-set-first-chance (process, ecode); end corba-method; define corba-method Rtmgr/RemoteNub/unset-first-chance (rnub :: , ecode :: Rtmgr/RemoteNub/) => () let process = remote-process(rnub); nub-unset-first-chance (process, ecode); end corba-method; define corba-method Rtmgr/RemoteNub/thread-stop-information (rnub :: , nubthread :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/, fchance :: Rtmgr/RemoteNub/, fstart :: Rtmgr/RemoteNub/, ret-addr :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-thread-stop-information (process, nubthread); end corba-method; define corba-method Rtmgr/RemoteNub/wait-for-stop-reason-no-timeout (rnub :: ) => (ecode :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-wait-for-stop-reason-no-timeout (process); end corba-method; define corba-method Rtmgr/RemoteNub/profile-wait-for-stop-reason-no-timeout (rnub :: , profile-interval :: Rtmgr/RemoteNub/) => (ecode :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-profile-wait-for-stop-reason-no-timeout (process, profile-interval); end corba-method; define corba-method Rtmgr/RemoteNub/stop-reason-process (rnub :: ) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-stop-reason-process (process); end corba-method; define corba-method Rtmgr/RemoteNub/stop-reason-thread (rnub :: ) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-stop-reason-thread (process); end corba-method; define corba-method Rtmgr/RemoteNub/first-hard-coded-breakpoint (rnub :: ) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-first-hard-coded-breakpoint (process); end corba-method; define corba-method Rtmgr/RemoteNub/stop-reason-process-exit-code (rnub :: ) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-stop-reason-process-exit-code (process); end corba-method; define corba-method Rtmgr/RemoteNub/stop-reason-thread-exit-code (rnub :: ) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-stop-reason-thread-exit-code (process); end corba-method; define corba-method Rtmgr/RemoteNub/stop-reason-library (rnub :: ) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-stop-reason-library (process); end corba-method; define corba-method Rtmgr/RemoteNub/stop-reason-violation-op (rnub :: ) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-stop-reason-violation-op (process); end corba-method; define corba-method Rtmgr/RemoteNub/exception-first-chance (rnub :: ) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-exception-first-chance (process); end corba-method; define corba-method Rtmgr/RemoteNub/stop-reason-violation-address (rnub :: ) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-stop-reason-violation-address (process); end corba-method; define corba-method Rtmgr/RemoteNub/stop-reason-exception-address (rnub :: ) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-stop-reason-exception-address (process); end corba-method; define corba-method Rtmgr/RemoteNub/stop-reason-debug-string-address (rnub :: ) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-stop-reason-debug-string-address (process); end corba-method; define corba-method Rtmgr/RemoteNub/stop-reason-debug-string-length (rnub :: ) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-stop-reason-debug-string-length (process); end corba-method; define corba-method Rtmgr/RemoteNub/stop-reason-debug-string-is-unicode (rnub :: ) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-stop-reason-debug-string-is-unicode (process); end corba-method; define corba-method Rtmgr/RemoteNub/initialize-stack-vectors (rnub :: , nubthread :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-initialize-stack-vectors (process, nubthread); end corba-method; define corba-method Rtmgr/RemoteNub/read-stack-vectors (rnub :: , nubthread :: Rtmgr/RemoteNub/, frame-count :: Rtmgr/RemoteNub/) => (frame-pointers :: Rtmgr/RemoteNub/, instruction-pointers :: Rtmgr/RemoteNub/, return-addresses :: Rtmgr/RemoteNub/) let process = remote-process(rnub); // Construct three primitive vectors that we can pass through the // FFI. One for frame pointers, one for return addresses, and one for // instruction pointers. let fp-vector = make(, element-count: frame-count); let ip-vector = make(, element-count: frame-count); let ra-vector = make(, element-count: frame-count); // Call the debugger nub to actually fill in the required data for each // stack frame. nub-read-stack-vectors (process, nubthread, frame-count, fp-vector, ip-vector, ra-vector); values(import-(fp-vector, sz: frame-count), import-(ip-vector, sz: frame-count), import-(ra-vector, sz: frame-count)); end corba-method; define corba-method Rtmgr/RemoteNub/all-frame-lexicals (rnub :: , frame :: Rtmgr/RemoteNub/, ip :: Rtmgr/RemoteNub/) => (first :: Rtmgr/RemoteNub/, last :: Rtmgr/RemoteNub/, table :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-all-frame-lexicals (process, frame, ip); end corba-method; define corba-method Rtmgr/RemoteNub/register-interactive-code-segment (rnub :: , lo :: Rtmgr/RemoteNub/, hi :: Rtmgr/RemoteNub/) => () let process = remote-process(rnub); nub-register-interactive-code-segment (process, lo, hi); end corba-method; define corba-method Rtmgr/RemoteNub/get-lexical-variable-name (rnub :: , table :: Rtmgr/RemoteNub/, variable :: Rtmgr/RemoteNub/) => (result :: CORBA/) let process = remote-process(rnub); let name-length :: = nub-get-lexical-variable-name-length (process, table, variable); let variable-name = make (, size: name-length); nub-get-lexical-variable-name (process, table, variable, name-length, variable-name); variable-name end corba-method; define corba-method Rtmgr/RemoteNub/lexical-variable-address (rnub :: , fp :: Rtmgr/RemoteNub/, table :: Rtmgr/RemoteNub/, variable :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/, in-reg :: Rtmgr/RemoteNub/, hireg :: Rtmgr/RemoteNub/, loreg :: Rtmgr/RemoteNub/, arg :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-lexical-variable-address (process, fp, table, variable); end corba-method; define corba-method Rtmgr/RemoteNub/lookup-symbol-name (rnub :: , table :: Rtmgr/RemoteNub/, sym :: Rtmgr/RemoteNub/) => (result :: CORBA/) let process = remote-process(rnub); let name-length = nub-lookup-symbol-name-length(process, table, sym); let name = make(, size: name-length); nub-lookup-symbol-name (process, table, sym, name-length, name); name end corba-method; define corba-method Rtmgr/RemoteNub/lookup-symbol-address (rnub :: , table :: Rtmgr/RemoteNub/, sym :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-lookup-symbol-address (process, table, sym); end corba-method; define corba-method Rtmgr/RemoteNub/lookup-function-debug-start (rnub :: , table :: Rtmgr/RemoteNub/, sym :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-lookup-function-debug-start (process, table, sym); end corba-method; define corba-method Rtmgr/RemoteNub/lookup-function-debug-end (rnub :: , table :: Rtmgr/RemoteNub/, sym :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-lookup-function-debug-end (process, table, sym); end corba-method; /* define corba-method Rtmgr/RemoteNub/lookup-symbol-language (rnub :: , table :: Rtmgr/RemoteNub/, sym :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-lookup-symbol-language (process, table, sym); end corba-method; */ define corba-method Rtmgr/RemoteNub/lookup-function-end (rnub :: , table :: Rtmgr/RemoteNub/, sym :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-lookup-function-end (process, table, sym); end corba-method; define corba-method Rtmgr/RemoteNub/symbol-is-function (rnub :: , table :: Rtmgr/RemoteNub/, sym :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-symbol-is-function (process, table, sym); end corba-method; define corba-method Rtmgr/RemoteNub/nearest-symbols (rnub :: , address :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/, lib :: Rtmgr/RemoteNub/, table :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-nearest-symbols (process, address); end corba-method; define corba-method Rtmgr/RemoteNub/closest-symbol (rnub :: , address :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/, lib :: Rtmgr/RemoteNub/, actual-address :: Rtmgr/RemoteNub/, offset :: Rtmgr/RemoteNub/, name-length :: Rtmgr/RemoteNub/, type :: Rtmgr/RemoteNub/, is-function :: Rtmgr/RemoteNub/, debug-start :: Rtmgr/RemoteNub/, debug-end :: Rtmgr/RemoteNub/, language :: Rtmgr/RemoteNub/, final-address-of-definition :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-closest-symbol (process, address); end corba-method; define corba-method Rtmgr/RemoteNub/function-bounding-addresses (rnub :: , address :: Rtmgr/RemoteNub/) => (lower :: Rtmgr/RemoteNub/, upper :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-function-bounding-addresses (process, address); end corba-method; define corba-method Rtmgr/RemoteNub/closest-symbol-name (rnub :: , sz :: Rtmgr/RemoteNub/) => (result :: CORBA/) let process = remote-process(rnub); let sym-name = make(, size: sz); nub-closest-symbol-name (process, sz, sym-name); sym-name end corba-method; define corba-method Rtmgr/RemoteNub/find-symbol-in-library (rnub :: , nublibrary :: Rtmgr/RemoteNub/, sz :: Rtmgr/RemoteNub/, name :: CORBA/) => (result :: Rtmgr/RemoteNub/, address :: Rtmgr/RemoteNub/, type :: Rtmgr/RemoteNub/, is-function :: Rtmgr/RemoteNub/, debug-start :: Rtmgr/RemoteNub/, debug-end :: Rtmgr/RemoteNub/, symbol-language :: Rtmgr/RemoteNub/, final-address-of-definition :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-find-symbol-in-library (process, nublibrary, sz, name); end corba-method; define corba-method Rtmgr/RemoteNub/dispose-lookups (rnub :: , lookups :: Rtmgr/RemoteNub/) => () let process = remote-process(rnub); nub-dispose-lookups (process, lookups); end corba-method; define corba-method Rtmgr/RemoteNub/resolve-source-location (rnub :: , nublibrary :: Rtmgr/RemoteNub/, filename :: CORBA/, line-number :: Rtmgr/RemoteNub/, column-number :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/, valid :: Rtmgr/RemoteNub/, path :: Rtmgr/RemoteNub/, search :: Rtmgr/RemoteNub/, exact :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-resolve-source-location (process, nublibrary, filename, line-number, column-number); end corba-method; define corba-method Rtmgr/RemoteNub/fetch-source-locations (rnub :: , start-loc :: Rtmgr/RemoteNub/, end-loc :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-fetch-source-locations (process, start-loc, end-loc); end corba-method; define corba-method Rtmgr/RemoteNub/source-location-address (rnub :: , table :: Rtmgr/RemoteNub/, index :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-source-location-address (process, table, index); end corba-method; define corba-method Rtmgr/RemoteNub/source-location-linenumber (rnub :: , table :: Rtmgr/RemoteNub/, index :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-source-location-linenumber (process, table, index); end corba-method; define corba-method Rtmgr/RemoteNub/source-location-filename (rnub :: , table :: Rtmgr/RemoteNub/) => (result :: CORBA/) let process = remote-process(rnub); let fname-length :: = nub-source-location-filename-length(process, table); let fname = make(, size: fname-length); nub-source-location-filename (process, table, fname-length, fname); fname end corba-method; define corba-method Rtmgr/RemoteNub/number-of-source-locations (rnub :: , table :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-number-of-source-locations (process, table); end corba-method; define corba-method Rtmgr/RemoteNub/dispose-source-locations (rnub :: , table :: Rtmgr/RemoteNub/) => () let process = remote-process(rnub); nub-dispose-source-locations (process, table); end corba-method; define corba-method Rtmgr/RemoteNub/interpret-instruction-at-current-location (rnub :: , nubthread :: Rtmgr/RemoteNub/) => (flow :: Rtmgr/RemoteNub/, destination :: Rtmgr/RemoteNub/, instruction-size :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-interpret-instruction-at-current-location (process, nubthread); end corba-method; define corba-method Rtmgr/RemoteNub/dylan-calculate-step-into (rnub :: , nubthread :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/, function-register-live :: Rtmgr/RemoteNub/, ok :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-dylan-calculate-step-into (process, nubthread); end corba-method; define corba-method Rtmgr/RemoteNub/dylan-thread-environment-block-address (rnub :: , thread :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/, valid :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-dylan-thread-environment-block-address (process, thread); end corba-method; define corba-method Rtmgr/RemoteNub/dylan-thread-mv-buffer-live (rnub :: , thread :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-dylan-thread-mv-buffer-live (process, thread); end corba-method; define corba-method Rtmgr/RemoteNub/older-stack-frame (rnub :: , this-one :: Rtmgr/RemoteNub/, than-this-one :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-older-stack-frame (process, this-one, than-this-one); end corba-method; define corba-method Rtmgr/RemoteNub/dylan-current-function (rnub :: , nubthread :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-dylan-current-function (process, nubthread); end corba-method; define corba-method Rtmgr/RemoteNub/perform-absolute-relocation (rnub :: , address :: Rtmgr/RemoteNub/, destination :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-perform-absolute-relocation (process, address, destination); end corba-method; define corba-method Rtmgr/RemoteNub/perform-relative-relocation (rnub :: , address :: Rtmgr/RemoteNub/, destination :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-perform-relative-relocation (process, address, destination); end corba-method; define corba-method Rtmgr/RemoteNub/recover-breakpoint (rnub :: , thread :: Rtmgr/RemoteNub/) => () let process = remote-process(rnub); nub-recover-breakpoint (process, thread); end corba-method; define corba-method Rtmgr/RemoteNub/get-process-wall-clock-time (rnub :: ) => (result :: Rtmgr/RemoteNub/) let process = remote-process(rnub); nub-get-process-wall-clock-time (process); end corba-method; define corba-method Rtmgr/RemoteNub/register-exit-process-function (rnub :: , ExitProcess :: Rtmgr/RemoteNub/) => () let process = remote-process(rnub); nub-register-exit-process-function (process, ExitProcess); end corba-method; define corba-method Rtmgr/RemoteNub/open-local-tether (rnub :: , command :: CORBA/, arguments :: CORBA/, paths :: Rtmgr/RemoteNub/, lib-paths :: Rtmgr/RemoteNub/, working-directory :: CORBA/, create-shell :: Rtmgr/RemoteNub/) => (result :: Rtmgr/RemoteNub/, success :: Rtmgr/RemoteNub/) let symfile-c-strings = map(curry(as, ), paths); let symfile-dir-array = make(, element-count: symfile-c-strings.size); for (i :: from 0 below symfile-c-strings.size) symfile-dir-array[i] := symfile-c-strings[i]; end for; let lsp-c-strings = map(curry(as, ), lib-paths); let lsp-dir-array = make(, element-count: lsp-c-strings.size); for (i :: from 0 below lsp-c-strings.size) lsp-dir-array[i] := lsp-c-strings[i]; end for; let (proc, success) = open-local-tether(command, arguments, paths.size, symfile-dir-array, lib-paths.size, lsp-dir-array, working-directory, create-shell); rnub.process := proc; destroy(symfile-dir-array); do(destroy, symfile-c-strings); destroy(lsp-dir-array); do(destroy, lsp-c-strings); values(proc, success) end corba-method; define corba-method Rtmgr/RemoteNub/attach-local-tether (rnub :: , process :: Rtmgr/RemoteNub/, process-name :: CORBA/, process-system-id :: CORBA/, process-actual-id :: Rtmgr/RemoteNub/, symbol-paths :: Rtmgr/RemoteNub/, system-JIT-information :: CORBA/) => (result :: Rtmgr/RemoteNub/, success :: Rtmgr/RemoteNub/) let symfile-c-strings = map(curry(as, ), symbol-paths); let symfile-dir-array = make(, element-count: symfile-c-strings.size); for (i :: from 0 below symfile-c-strings.size) symfile-dir-array[i] := symfile-c-strings[i]; end for; let (proc, success) = attach-remote-tether(process, process-name.size, process-name, process-system-id.size, process-system-id, process-actual-id, symbol-paths.size, symfile-dir-array, system-JIT-information); rnub.process := proc; destroy(symfile-dir-array); do(destroy, symfile-c-strings); values(proc, success) end corba-method;