Struct probe_rs::Session[][src]

pub struct Session { /* fields omitted */ }
Expand description

The Session struct represents an active debug session.

Creating a session

The session can be created by calling the Session::auto_attach() function, which tries to automatically select a probe, and then connect to the target.

For more control, the Probe::attach() and Probe::attach_under_reset() methods can be used to open a Session from a specific Probe.

Usage

The Session is the common handle that gives a user exclusive access to an active probe. You can create and share a session between threads to enable multiple stakeholders (e.g. GDB and RTT) to access the target taking turns, by using Arc<Mutex<Session>>.

If you do so, make sure that both threads sleep in between tasks such that other stakeholders may take their turn.

To get access to a single Core from the Session, the Session::core() method can be used. Please see the Session::core() method for more usage guidelines.

Implementations

Automatically creates a session with the first connected probe found.

Lists the available cores with their number and their type.

Attaches to the core with the given number.

Usage

Everytime you want to perform an operation on the chip, you need to get the Core handle with the [Session::core() method. This Core handle is merely a view into the core. And provides a convenient API surface.

All the state is stored in the Session handle.

The first time you call Session::core() for a specific core, it will run the attach/init sequences and return a handle to the Core.

Every subsequent call is a no-op. It simply returns the handle for the user to use in further operations without calling any int sequences again.

It is strongly advised to never store the Core handle for any significant duration! Free it as fast as possible such that other stakeholders can have access to the Core too.

The idea behind this is: You need the smallest common denominator which you can share between threads. Since you sometimes need the Core, sometimes the Probe or sometimes the Target, the Session is the only common ground and the only handle you should actively store in your code.

Read available data from the SWO interface without waiting.

This method is only supported for ARM-based targets, and will return Error::ArchitectureRequired otherwise.

Reads all the available ARM CoresightComponents of the currently attached target.

This will recursively parse the Romtable of the attached target and create a list of all the contained components.

Get the target description of the connected target.

Configure the target and probe for serial wire view (SWV) tracing.

Configure the target to stop emitting SWV trace data.

Begin tracing a memory address over SWV.

Stop tracing from a given SWV unit

👎 Deprecated:

Use the Session::target function instead

Returns the memory map of the target.

Return the Architecture of the currently connected chip.

Clears all hardware breakpoints on all cores

Trait Implementations

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Converts self into T using Into<T>. Read more

Causes self to use its Binary implementation when Debug-formatted.

Causes self to use its Display implementation when Debug-formatted. Read more

Causes self to use its LowerExp implementation when Debug-formatted. Read more

Causes self to use its LowerHex implementation when Debug-formatted. Read more

Causes self to use its Octal implementation when Debug-formatted.

Causes self to use its Pointer implementation when Debug-formatted. Read more

Causes self to use its UpperExp implementation when Debug-formatted. Read more

Causes self to use its UpperHex implementation when Debug-formatted. Read more

Performs the conversion.

Performs the conversion.

Pipes by value. This is generally the method you want to use. Read more

Borrows self and passes that borrow into the pipe function. Read more

Mutably borrows self and passes that borrow into the pipe function. Read more

Borrows self, then passes self.borrow() into the pipe function. Read more

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more

Borrows self, then passes self.as_ref() into the pipe function.

Mutably borrows self, then passes self.as_mut() into the pipe function. Read more

Borrows self, then passes self.deref() into the pipe function.

Mutably borrows self, then passes self.deref_mut() into the pipe function. Read more

Immutable access to a value. Read more

Mutable access to a value. Read more

Immutable access to the Borrow<B> of a value. Read more

Mutable access to the BorrowMut<B> of a value. Read more

Immutable access to the AsRef<R> view of a value. Read more

Mutable access to the AsMut<R> view of a value. Read more

Immutable access to the Deref::Target of a value. Read more

Mutable access to the Deref::Target of a value. Read more

Calls .tap() only in debug builds, and is erased in release builds.

Calls .tap_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref_mut() only in debug builds, and is erased in release builds. Read more

Attempts to convert self into T using TryInto<T>. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.