Basic tests for transmitting data between a Python client and a C++
server using pw_transfer.
Change-Id: I75c361ec100b055e0d6afb0091e64cc9d773c568
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/54707
Commit-Queue: Wyatt Hepler <hepler@google.com>
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Reviewed-by: Alexei Frolov <frolv@google.com>
- Create utilties for interacting with a host binary running a pw_rpc
server using HDLC over a socket.
- Write a test that runs commands in a Python client on a C++ server.
Change-Id: I1da75c9d4e989112b392c77c82bdab82a2ea60d3
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/54665
Reviewed-by: Alexei Frolov <frolv@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
Adds helper literals including _B, _KiB, _MiB, _GiB, _TiB, _PiB,
and _EiB to define a number of bytes.
Change-Id: I8aa5eae85eb84dd2f071ff1e24e630b9c35f1418
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/55682
Reviewed-by: Wyatt Hepler <hepler@google.com>
Pigweed-Auto-Submit: Ewout van Bekkum <ewout@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Adds the ability to capture CPU state and the main stack thread
state for snapshots.
Change-Id: If1669861a73ce1f95c041ce1cf4d409bc6d98451
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/54441
Commit-Queue: Ewout van Bekkum <ewout@google.com>
Pigweed-Auto-Submit: Ewout van Bekkum <ewout@google.com>
Reviewed-by: Armando Montanez <amontanez@google.com>
- Add the pyperclip package to facilitate copy/paste from the host
machine's clipboard.
- Remove unused ipdb dep
- Add a ctrl-c binding to copy the currently visible log lines in any
log window.
- Add a ctrl-v binding to paste text into the Python repl. This will
bypass ptpython's auto-formatter.
- Add a ctrl-alt-c binding to copy the python output text when the
repl is in focus.
- Above functions added as clickable buttons to all toolbars
- Edit menu added with:
- Copy visible lines from active window
- Paste to Python Input
- Python Output Changes:
- Output is now focusable
- Text can be selected with shift+arrows or mouse drag
- Selected text can be copied with Ctrl-C
- Line wrapping disabled since it breakes mouse wheel scrolling.
Horizontal scrolling is possible my moving the cursor when the
output is focused.
Test: Copy/Paste tested on: Linux
Test: Copy Paste Steps 1-9
Change-Id: Ifc44d2a4f2ba13146669dd63278fbae17a644c37
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/55080
Commit-Queue: Anthony DiGirolamo <tonymd@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
- Refactor WindowManager.active_panes into it's own WindowList class.
- Add move window pane left and right feature that will move panes into
a new vertically split column of windows. This is a simplified verison
of i3 style window movement.
- Vertical columns can be viewed as a horizontally split stack or a
tabbed view.
- Add move and resize pane+splits to the [View] menu.
Test: Window Management Steps 1-15
Change-Id: I32e138bc802eea97577bf034f360462c7dd4713d
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/55021
Commit-Queue: Anthony DiGirolamo <tonymd@google.com>
Pigweed-Auto-Submit: Anthony DiGirolamo <tonymd@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Replace the rotate window order option with move window up and
down. Rotate windows was very confusing and made positionining a
specific window impossible.
Test: Window Management Steps 1-12
Change-Id: Iaff75ccf240f540d3c292284b136c8b64b509957
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/55020
Commit-Queue: Anthony DiGirolamo <tonymd@google.com>
Pigweed-Auto-Submit: Anthony DiGirolamo <tonymd@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Refactor window management functions out of ConsoleApp.
This CL is just a move of the existing fuctions, no new
features or additional refactoring.
Test: Manual Window Management 1-9
Change-Id: I8f133e0c7d18921b54b88c6e8d2e51d195f41829
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/54960
Commit-Queue: Anthony DiGirolamo <tonymd@google.com>
Pigweed-Auto-Submit: Anthony DiGirolamo <tonymd@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Simplify adding only the pylint and mypy checks to downstream projects
and not adding test_python_packages.
Change-Id: Ib94f19dec61ea90937eb35445e4ea341697f5601
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/55982
Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
Google typically recommends installing brew packages to ~/homebrew/opt/.
Pigweed, however, expects packages in the default brew location
/usr/local/opt. Added a note to clarify.
Change-Id: I2d927e922f17bd07fa47774a5538c9aca545f9b1
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/55305
Pigweed-Auto-Submit: Jared Weinstein <jaredweinstein@google.com>
Reviewed-by: Armando Montanez <amontanez@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
- Add the PwConsoleEmbed class for future customization of the embedded
environment before actually running it.
- Set repl start and stop logs to debug level.
Testing: No UI code changes.
Change-Id: Ifd8407b6b51a046f1139ca535cb998ad0b82d3ca
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/55860
Reviewed-by: Keir Mierle <keir@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Anthony DiGirolamo <tonymd@google.com>
- Log erros when errors occur while creating / configuring the socket.
- Use UNKNOWN status instead of INTERNAL for errors. INTERNAL is used
for serious internal errors (e.g. an invariant has been violated).
- Make the port used by the host system_rpc_server configurable.
- CHECK that socket setup succeeds in the host system_rpc_server.
- In the system_rpc_server, print logs to stderr in addition to the
HDLC channel. Otherwise, it's not possible to see logs from before the
socket it setup.
Change-Id: I3475676ff7bb1461b3b72f603a27638f292f87eb
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/55505
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Reviewed-by: Alexei Frolov <frolv@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Don't set a transfer context's handler (activating the transfer) if its
Prepare function fails.
Change-Id: Id91a042a54aef14f12a153b00fba30060de02a13
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/55509
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Alexei Frolov <frolv@google.com>
- Previously, the PW_CHECK_OK expression was evaluated twice: once in
the if statement, and, when the CHECK failed, again in
pw_StatusString. Now the status is stored in a variable before it is
checked.
- Update the multi-evaluation tests to avoid using global state.
- Switch from #if PW_ASSERT_ENABLE_DEBUG to a constant to avoid
duplication and the risk of code rot.
- Add multi-evaluation tests for PW_CHECK_OK and PW_DCHECK_OK.
Change-Id: Ic6895eff2daf4a06eda833dba9a0d61a0c2922fa
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/55504
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Adds an argument to pw_snapshot's process_snapshot() that allows users
to pass a function that provides a matching ELF file for a given
Snapshot.
Change-Id: Ic0a67ed26cde9682db09775c94c86b8f7486a165
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/55054
Pigweed-Auto-Submit: Armando Montanez <amontanez@google.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Sets up pw_thread to use pw_symbolizer to symbolize backtraces.
Change-Id: Ic2a7c3c9ed3c9039b8fb1f2e75043d7910ed94f5
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/55053
Commit-Queue: Armando Montanez <amontanez@google.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Adds Bazel test to the quick build checks, and disables modules that no
longer work with Bazel.
No-Docs-Update-Reason: Only config changes.
Change-Id: Ied82269a3564739f5289c345edee172a53028709
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/55480
Reviewed-by: Akira Baruah <akirabaruah@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: Keir Mierle <keir@google.com>
Renames the function name sha256::Digest() to sha256::Hash() since
"digest" is more commonly used to denote the output of hashing.
Change-Id: I1463b61504757c744d4610ba453098579066de4d
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/53780
Pigweed-Auto-Submit: Ali Zhang <alizhang@google.com>
Commit-Queue: Ali Zhang <alizhang@google.com>
Reviewed-by: Darren Krahn <dkrahn@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Since multiple modules depend on the Mbed TLS library, each requiring
different configurations in order to achieve optimal code size and
performance, it is eventually a product responsibility to configure the
Mbed TLS library per the exact set of modules selected. To facilitate
that process, we document the specific Mbed TLS options needed for each
module that depend on Mbed TLS.
Change-Id: I7e491f7b6510359f83f5a40fed870147ca9bcff7
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/53741
Reviewed-by: Darren Krahn <dkrahn@google.com>
Pigweed-Auto-Submit: Ali Zhang <alizhang@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Use the mbedtls_sha256_* APIs instead of the more general mbedtls_md_*
for an immediate reduction in code size -- 19KiB --> 2.8KiB. This avoids
the need to configure Mbed TLS to remove unused hashing algorithms
supported by mbedtls_md_*.
No-Docs-Update-Reason: no behavioral changes.
Change-Id: I7d450e6cb102aa395daabc20a98d1f0ca56360c0
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/53540
Reviewed-by: Darren Krahn <dkrahn@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Pigweed-Auto-Submit: Ali Zhang <alizhang@google.com>
Since the build directory can be set to anything in gn gen, remap
absolute paths to it to "out" using -ffile-prefix-map.
The build directory is often nested under //, so it should be removed
first. However, GCC and Clang apply -ffile-prefix-map options in
opposite order, so apply this option first and last to handle both
compilers.
Change-Id: Iba135ba23048b7b0bf8b682397ddabb53dee4360
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/52381
Reviewed-by: Rob Mohr <mohrr@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
- Standardize finishing transfers through a finish function and call it
on all exit paths.
- Handle RPC-level errors in the transfer client.
- Temporarily disable stream closing on transfer completion as it runs
into issues.
Change-Id: I545e0f635d73b61092d980d9c9a06278d01c3e8a
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/54902
Commit-Queue: Alexei Frolov <frolv@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
This starts the RPC transfer service in C++. Initially, only simple read
transfers are supported, where all read data is sent synchronously in
response to parameter requests from the client.
Change-Id: I8ca76702ea8795ed07f702227d84afdf99874205
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/53140
Commit-Queue: Alexei Frolov <frolv@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
Add the first two RPCs in the pw.rpc.Benchmark service.
Change-Id: Icb45736936620e8e78e2e983808db55f62ac7941
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/54664
Commit-Queue: Wyatt Hepler <hepler@google.com>
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Reviewed-by: Alexei Frolov <frolv@google.com>
Performance shouldn't be a primary concern since this will be running on
the user's machine rather than on-device.
Passes all unit tests from the python HDLC library.
Change-Id: Ib683dd870199b947a6e1828c0f19b785fddb67e3
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/53663
Pigweed-Auto-Submit: Jared Weinstein <jaredweinstein@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Alexei Frolov <frolv@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Ignores two more warnings to get H7 to build.
Verified by building and running binary on H7 board.
Change-Id: Ibc3ad4819dd78efadc579fcfddb32c49436de0ed
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/55048
Reviewed-by: Ali Zhang <alizhang@google.com>
Commit-Queue: Varun Sharma <vars@google.com>
Adds a python library for processing Thread protos to provide additional
information that can be inferred from the captured data.
Change-Id: Ic1d7adb628e6486f733f41c3f6406f30e9a4452a
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/55001
Pigweed-Auto-Submit: Armando Montanez <amontanez@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Keir Mierle <keir@google.com>
Adjusts an enum's values to ensure that a value of 0 is used in the
constexpr constructor to ensure that the object is bss eligible
instead of requiring placement in data.
Change-Id: Ied32426852661b5b534b6e4682a0e52fa28a57ae
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/55027
Reviewed-by: Wyatt Hepler <hepler@google.com>
Pigweed-Auto-Submit: Ewout van Bekkum <ewout@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
This adds a set of repository rules to generate a set of Bazel macros
that configure pigweeds CIPD deps.
Change-Id: I4c4dccf5522abfbb875569a05c8854c94aa40621
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/53480
Reviewed-by: Keir Mierle <keir@google.com>
Reviewed-by: Rob Mohr <mohrr@google.com>
Commit-Queue: Keir Mierle <keir@google.com>