Skip to content
This repository was archived by the owner on Dec 15, 2021. It is now read-only.

Commit 5c3e2b3

Browse files
committed
Auto merge of #13 - japaric:v2, r=japaric
update CHANGELOG, fix cargo doc warnings and add missing documentation bits None
2 parents 19a77e0 + 2ed242e commit 5c3e2b3

File tree

6 files changed

+44
-36
lines changed

6 files changed

+44
-36
lines changed

CHANGELOG.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,29 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [Unreleased]
99

10+
## [v0.2.0] - 2018-01-11
11+
12+
### Added
13+
14+
- (library) A `Decoder` abstraction for parsing ITM packets out of `Read`-able sources.
15+
- (library) A `Packet` type that represent ITM packets.
16+
- (cli) The stimulus port to read ITM data from can be changed using the `-s` flag. If the flag is
17+
omitted the port 0 is used by default.
18+
- (cli) A follow mode (`-F` flag) to keep reading the input file. Use this mode if your OS doesn't
19+
support named pipes.
20+
- (cli) Support for reading from stdin when no `-f` flag is passed.
21+
22+
### Changed
23+
24+
- [breaking-change][] (cli) the file to read must now be passed as an argument of the `-f` flag
25+
1026
## [v0.1.1] - 2016-10-20
1127

1228
### Changed
1329

1430
- `itmdump` no longer depends on the `mkfifo` command.
1531
- `itmdump`, which normally uses named pipes, now fallbacks to regular files to
16-
be work on Windows.
32+
be work on Windows.
1733
- `itmdump` now is restrictive with about the arguments it receives. Before, a
1834
second argument would simply be ignored, but, now, that has become a hard
1935
error.
@@ -24,7 +40,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
2440
### Added
2541

2642
- `itmdump` tool that parses instrumentation packets from the stimulus port 0
27-
and dumps the payload to `stdout`.
43+
and dumps the payload to `stdout`.
2844

29-
[Unreleased]: https://github.com/japaric/itm/compare/v0.1.1...HEAD
45+
[Unreleased]: https://github.com/japaric/itm/compare/v0.2.0...HEAD
46+
[v0.2.0]: https://github.com/japaric/itm/compare/v0.1.1...v0.2.0
3047
[v0.1.1]: https://github.com/japaric/itm/compare/v0.1.0...v0.1.1

Cargo.lock

Lines changed: 1 addition & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
[package]
2-
authors = ["Jorge Aparicio <[email protected]>"]
2+
authors = ["Jorge Aparicio <[email protected]>"]
33
build = "build.rs"
44
description = "Tool to parse and dump ITM packets"
55
documentation = "https://docs.rs/itm"
66
keywords = ["parse", "tool", "ARM", "ITM"]
77
license = "MIT OR Apache-2.0"
88
name = "itm"
99
repository = "https://github.com/japaric/itm"
10-
version = "0.1.1"
10+
version = "0.2.0"
1111

1212
[dependencies]
1313
chrono = "^0.4"

src/error.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,21 @@ use std::io;
44

55
error_chain! {
66
foreign_links {
7-
Io(io::Error);
7+
Io(io::Error) #[doc = "I/O error"];
88
}
99

1010
errors {
11+
/// unknown header byte
1112
UnknownHeader(b: u8) {
1213
description("unknown header byte"),
1314
display("unknown header byte: {:x}", b),
1415
}
16+
/// end of file during packet
1517
EofDuringPacket {
1618
description("end of file during packet"),
1719
display("end of file during packet"),
1820
}
21+
/// end of file before packet
1922
EofBeforePacket {
2023
description("end of file before packet"),
2124
display("end of file before packet"),

src/lib.rs

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,29 +23,26 @@
2323
//! ```
2424
//!
2525
//! ### Example: reading from saved ITM data in a file
26+
//!
2627
//! ``` text
2728
//! $ itmdump -f /tmp/itm.dump
2829
//! PANIC at 'Hello, world!', examples/panic.rs:13
2930
//! ```
3031
//!
3132
//! ### Example: reading from OpenOCD via a named pipe
3233
//!
33-
//! [OpenOCD][openocd home] is an open-source tool to debug and flash
34-
//! microcontrollers.
34+
//! [OpenOCD][openocd home] is an open-source tool to debug and flash microcontrollers.
3535
//!
36-
//! Reading via a named pipe works well on POSIX machines; e.g. Linux
37-
//! or macOS, but not Windows.
36+
//! Reading via a named pipe works well on POSIX machines; e.g. Linux or macOS, but not Windows.
3837
//!
3938
//! ``` text
4039
//! $ mkfifo /tmp/itm.fifo
4140
//! $ itmdump -f /tmp/itm.fifo
4241
//! ```
4342
//!
44-
//! This will create a named pipe: `/tmp/itm.fifo`. Another
45-
//! application, e.g. OpenOCD, will have to connect to this pipe and
46-
//! write to it. Here's an example command for OpenOCD
47-
//! + GDB that does that. ([OpenOCD documentation on ITM and
48-
//! TPIU][openocd v7m]).
43+
//! This will create a named pipe: `/tmp/itm.fifo`. Another application, e.g. OpenOCD, will have to
44+
//! connect to this pipe and write to it. Here's an example command for OpenOCD + GDB that does
45+
//! that. ([OpenOCD documentation on ITM and TPIU][openocd v7m]).
4946
//!
5047
//! [openocd home]: http://openocd.org/
5148
//! [openocd v7m]: http://openocd.org/doc/html/Architecture-and-Core-Commands.html#ARMv7_002dM-specific-commands
@@ -54,21 +51,18 @@
5451
//! (gdb) monitor tpiu config internal /tmp/itm.fifo uart off 8000000
5552
//! ```
5653
//!
57-
//! `itmdump` will read from the pipe, parse the packets and write the payload
58-
//! to `stdout`:
54+
//! `itmdump` will read from the pipe, parse the packets and write the payload to `stdout`:
5955
//!
6056
//! ``` text
6157
//! PANIC at 'Hello, world!', examples/panic.rs:13
6258
//! ```
6359
//!
6460
//! ### Example: monitoring a file
6561
//!
66-
//! `itmdump` can monitor a file and dump new ITM data written to it
67-
//! (similar to `tail -f`).
62+
//! `itmdump` can monitor a file and dump new ITM data written to it (similar to `tail -f`).
6863
//!
69-
//! This may be useful on Windows especially where POSIX named pipes
70-
//! are not available. Just let OpenOCD capture to a file and monitor
71-
//! it with `itmdump`.
64+
//! This may be useful on Windows especially where POSIX named pipes are not available. Just let
65+
//! OpenOCD capture to a file and monitor it with `itmdump`.
7266
//!
7367
//! ``` text
7468
//! $ itmdump -f /tmp/itm.live -F
@@ -79,13 +73,15 @@
7973
//!
8074
//! - ARMv7-M Architecture Reference Manual - Appendix D4.2 Packet descriptions
8175
//!
82-
//! Available to download [as a PDF][ARMv7-m]
83-
//! after a free registration.
84-
//! [ARMv7-m]: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0403e.b/index.html
76+
//! Available to download [as a PDF][ARMv7-m] after a free registration.
77+
//!
78+
//! [ARMv7-m]: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0403e.b/index.html
8579
//!
8680
//! - [ARM CoreSight Technical Reference Manual section on ITM][CoreSight ITM]
87-
//! [CoreSight ITM]: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0314h/CAAGGCDH.html
81+
//!
82+
//! [CoreSight ITM]: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0314h/CAAGGCDH.html
8883
84+
#![deny(missing_docs)]
8985
#![deny(warnings)]
9086

9187
#[macro_use]

src/packet.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Defines ITM packets and their possible contents.
22
3-
pub const MAX_PAYLOAD_SIZE: usize = 4;
3+
pub(crate) const MAX_PAYLOAD_SIZE: usize = 4;
44

55
/// Represents a complete received packet.
66
#[derive(Debug)]

0 commit comments

Comments
 (0)