388 Commits
Author SHA1 Message Date
Marius Muench 56a90cfe73 Hotfix: Pin Unicorn version to 2.0.1.post1
Currently, Univorn v2.1.0/v2.1.1 breaks avatars import logic. This hotfix surpresses the errors, but a proper fix is to be provided later.
2024-10-23 15:13:00 +01:00
e29b338b8b INTFowarder & HWRunner introduction (#125)
* WIP: Getting coresight to work

* Fixing Coresight protocol and interrupt forwarding TO QEmu

* WIP interrupts fixing my own mistakes

* Added interrupt state transfer

* Reactivated interrupt forwarding, works with timer but the alarm runs out of sync so it only works for a couple of seconds

* Fixing crash due to protocol shutdown order

interrupt protocol depends on memory

* Fixed issues with memory protocols

* Fixed IVT setup in interrupt protocol

* WIP: Added interrupt recording plugin and protocol, not complete

* WIP: Fixed the stub to include an end of buffer flag

* Interrupt recording protocol and plugin v1

* Interrupt recording protocol cleanup

* Added rudimentary support for ARM Cortex M4 (without FPU registers)

* Interrupt recording without manipulating main loop control flow

* WIP: USB rehosting

* Updated interrupt messages to include the IRQ-Address

* IRQ fixing

* IRQ fixing; Reordering of setup code and removal of IRQ init because it might not complete before the first IRQ fires

* IRQ message passing fixes

* Allow plugins to get configuration parameters at load time

* Switch to trace approach for interrupt rehosting, to capture quickly firing interrupts

* Allow avatar peripherals to know on what target they got called

* WIP: Prevent interrupt interleaving

* Fixed wrong program counter

* WIP: picow-blink rehosting, runs much further but crashes because it runs a re-init of the CYW43

* Allow OpenOCD target to have a gdb binary for symbols

* WIP HAL calling

* WIP HAL calling step 2

* WIP HAL calling step 2- THIS IS BROKEN AF

* Finally a working version

* First working HAL implementation for send-uart

* Make HALCaller config more expressive

* Made HAL calls more generic, allow for up more arguments, allow void function returns, allow pointer/mem bocks for function return

* OpenOCD protocol, rework raw memory read/write for higher performance in memory transfers

* Trigger HAL Exit after Hardware reset is complete

* Make protocol usable as a signaled target continue protocol

* WIP: PICOW rehosting

* WIP: Software interrupt rehosting support by using the hardware in the loop as the only source of interrupts

* WIP: USB rehosting, cleanup of software interrupt stuff

* Cleanup interrupt recording

* HAL only deal with interrupt protocol if present

* HALCaller rename to HWRunner

* HWRunner OpenOCD fix; WiFi experiments final

* HWRunner naming cleanup

* Interrupt Recorder naming cleanup

* Interrupt Forwarding naming cleanup

* Cleanup and fixup of refactorings

* INTFowrader & HWRunner summary

* Final cleanup

* Remove union types for type hint

Union in type hint is introduced with PEP 604 in python 3.10.
However, we aim to support python 3.6.

* Remove crashing log

* Remove crashing log line when using pypanda

---------

Co-authored-by: Florian Albrecht <[email protected]>
Co-authored-by: rawsample <[email protected]>
2023-12-03 21:20:15 +01:00
rawsample a64a8b6775 Update PANDA commit for CI 2023-12-01 16:59:30 +01:00
rawsample 4ad2c27e3a Update dead links 2023-10-11 21:00:21 +02:00
Marius Muench a2d06c9313 Merge pull request #118 from albrecht-flo/xpsr_register
Fix xpsr register issues between QEmu and OpenOCD targets
2023-03-21 17:33:07 +01:00
Florian Albrecht 7271ec5236 Added debug logging to register sync and some final comments 2023-03-21 11:45:50 +01:00
Florian Albrecht fbac3863ef The xpsr register needs to be read by name because of a missalignment of register numbers between QEmu and OpenOCD 2023-03-20 18:05:59 +01:00
Florian Albrecht 5656c12079 Small update to the arm architecture to fix endless recursion bug; Small typo fixes (#117) 2023-03-08 11:50:57 +01:00
kindtrojan dd3f025370 fixing a parsing error (#115)
The parsing assumes a 4 lines header, which is removed and assumes to blank line.
However, it appears to have blank lines in the output, which causes index out of range errors. 
Solution: 1) splitting on the last part of the header "objfile" to remove unwanted header lines, and then ignoring the blank lines while parsing.
2023-01-06 10:01:33 +01:00
rawsample 25de83f961 Bump setup.py version v1.4.7 2022-02-10 12:45:16 +01:00
Marius Muench 04752c0ac3 Merge pull request #100 from avatartwo/dev/v1.4.7
New release for v1.4.7
2022-02-10 09:30:08 +00:00
rawsample 236ff04f2a Avatar release V1.4.7 2022-02-10 10:17:08 +01:00
rawsample 8436450588 delete Travis yaml 2022-02-10 10:10:13 +01:00
rawsample 9f6a9a4f69 CI: fix path 2022-02-10 09:00:47 +01:00
rawsample 9d37b9e1fb Update default version for targets qemu and panda 2022-02-10 08:27:26 +01:00
Luke Craig ed6309594b Update pypanda usage link (#99)
Old link doesn't work because the file moved.
2022-02-09 11:37:09 +01:00
mariusmue 06d4eb28ff JLink-Target: Serial default to None 2022-02-08 23:41:38 +01:00
SilentDawn 8951a93a68 Fix JLink Target and JLink Protocol. (#96)
* fix JLink Target and JLink JLink Protocol. It works now and is tested by Segger JLink EDU and FRDMK64F.
2022-02-08 23:36:57 +01:00
samplandGrant Hernandez 3f26761731 Merge PR #97: Add UNIX socket support for GDBProtocol and protocol users
This PR adds support for using UNIX sockets for GDB connections instead
of TCP.

One aspect I didn't consider was where the sockets should be created by
default since I use is not None to detect if UNIX should be used. Maybe
sockets should be automatically placed in the avatar2 output directory
(which should be unique per instance), but this would require more
invasive changes to the KWArgs for transport selection.

Co-authored-by: Grant Hernandez <[email protected]>
Co-authored-by: sampl <[email protected]>
2022-01-26 13:55:43 +01:00
sampl 4f98afb4f4 Merging with rework on unit tests 2022-01-26 13:45:49 +01:00
37fa74d1ff Fixed version checking for pygdbmi (#95)
* Fixed version checking for pygdbmi
* Fix checks on shutdown to avoid "AttributeError: 'GDBProtocol' object has no attribute '_communicator'"

Co-authored-by: Matt Borgerson <[email protected]>
Co-authored-by: Jelle Nauta <[email protected]>
Co-authored-by: sampl <[email protected]>
2022-01-26 09:28:45 +01:00
rawsampleandmariusmue c996a4a8a8 Improve CI (#98)
* New action to publish on release the python package on Pypi
* Migrate tests to unittest and pytest
* Rework the CI pipeline to build and test on 3 python versions (3.7, 3.8 and 3.9)
* Rename Dockerfile into avatar2.Dockerfile

Co-authored-by: mariusmue <[email protected]>
2022-01-25 19:45:37 +01:00
Grant Hernandez f4ad6fc6e8 QEMUTarget: add support for GDB UNIX sockets 2022-01-14 18:17:29 -05:00
Grant Hernandez 08c119d7c5 Support remote UNIX sockets for GDBProtocol 2022-01-14 17:01:11 -05:00
sampl a321ba22b3 merge jobs to remove burden of passing a 8GB container artifact 2022-01-10 11:06:06 +01:00
Grant Hernandez f13ac1d02e Move GDB remote connect logic to common function 2022-01-09 16:46:20 -05:00
Grant Hernandez 49893f7f53 Fix GDB protocol test stability across address changes 2022-01-09 16:40:45 -05:00
sampl 1ec410613b Add self hosted runner 2022-01-06 11:34:50 +01:00
Matt Borgerson 21ba70e1ae Fix typo in target state change log message 2021-11-17 10:52:50 +01:00
sampl 349ca4aceb Action to publish to PyPI on git push --tags 2021-07-27 11:04:05 +02:00
sampl e2cbffb985 Correct condition for package publishing 2021-07-26 17:30:52 +02:00
sampl b66b0b0da9 make action triggers on new tags 2021-07-26 11:41:26 +02:00
sampl 79c11f82f1 Action to publish package to Test PyPI 2021-07-26 11:24:23 +02:00
sampl 86a824072e New version V1.4.6 v1.4.6 2021-06-22 14:38:56 +02:00
sampl b3eabbfd29 Add alias for ARM register IP to r12 #91 2021-06-22 14:38:56 +02:00
rawsample fc652c3823 Qemu cpu_model override avatar's one #89 (#90)
When QemuTarget `cpu_model` is specified, it should override
the one of Avatar in the generate_qemu_config() function.
See issue #89
2021-06-22 14:38:56 +02:00
Marius Muench 66ed7aa4d5 Change docker login method for travis CI 2021-06-22 14:38:56 +02:00
Fabian Freyer de738621cd OpenOCDTarget: don't check for script existence (#88)
* OpenOCDTarget: don't check for script existence

The OpenOCD protocol supports passing multiple scripts if a list is
passed. However, the OpenOCD target checked the path to the script using
`os.path.exists`, which does not handle lists of paths.

Furthermore, OpenOCD can search for scripts in other locations that
avatar2 does not have knowledge about, for example if a search path is
passed using `-s` in `additional_args`, or the global scripts path.
2021-06-22 14:38:56 +02:00
Fabian Freyer 9ab21f3188 RemoteMemoryProtocol: Handle ImportError on darwin (#87)
* RemoteMemoryProtocol: Handle ImportError on darwin

Darwin doesn't have mqueue.h, so the posix_ipc dependency raises an
ImportError when remote_memory.py tries to import MessageQueue.

For now, just fail gracefully, and don't add a rmp to a qemu_target if
RemoteMemoryProtocol can't be imported.
2021-06-22 14:38:56 +02:00
sampl 9beb1b9b71 Start moving CI to Github Actions 2021-06-22 14:38:56 +02:00
mariusmue 6d6aef5085 adjust API to recent pypanda version (0.1.1.2) 2021-06-22 14:38:56 +02:00
Grant Hernandez dd91ce208b Unlink RemoteMemory message queue after opened (#85)
When using Pypanda/QEMU/Panda with avatar and the POSIX memory queues, if for some reason the memory queue isn't unlinked before the process exits (for example due to a crash), then /dev/mqueue can completely fill up leading to this error message due to ULIMIT:

```
qemu: qemu_avatar_mq_open_read: No space left on device
```
This technically will only happen if the TX/RX queue names are changing, such as when changing the `name` field of the target being spawned to include an identifier, such as PID

```
ls /dev/mqueue
EMU34129_tx_queue  EMU41915_tx_queue  EMU44523_tx_queue
EMU36565_rx_queue  EMU42910_rx_queue  EMU45457_rx_queue
...
```
It seems error prone to have to rely on a process itself to clean up at atexit, if it never makes it there. A quick fix is to immediately unlink the queue after it has been connected to by Avatar and after it is created by QEMU. This assumes the queue is for a single connection pair and it will not be reusable as it has been unlinked. Unclear if other clients of remote memory will have issue with this, but since Avatar only supports opening an existing queue instead of creating one, I believe this works out.
2021-06-22 14:38:56 +02:00
mariusmue 4d772f72a0 Version bump to 1.4.5 to replace version on PyPi v1.4.5 2021-03-29 09:14:51 +02:00
Marius Muenchandsampl 402725ecbf Dev/v1.4.4 (#84)
* Fix version check of pydbmi

* bugfix in pypanda CI testcase

* Allow docker login in CI to fail

The login was introduced to work around rate limiting for docker pulls
on dockerhub. However, the required tokens/env variables are not present
for pull requests, resulting into the CI failing. Hence, we now allow
this to be failing, and may need to manually restart CI builds for PRs.

* fix typos

* skip executable check for pypanda target

* v1.4.4: Update Changelog and setup.py

Co-authored-by: sampl <[email protected]>
v1.4.4
2021-03-28 20:21:22 +02:00
Grant Hernandez bc3d7b8c88 Add option to configure logging (#82)
Some clients already configure logging and avatar2 will hijack the logging config leading to duplicate output. Give clients the option to disable this behavior.
2021-03-28 18:41:05 +02:00
Grant Hernandez 6181c99fea Check for active PyPanda target during shutdown (#81)
* Check for active PyPanda target during shutdown

* Call super destructor for PyPanda target

Otherwise RemoteMemory /dev/mqueue items never get deleted.
2021-03-28 18:40:50 +02:00
Adam Van ScyocandAdam Van Scyoc 3085789337 Gdb core dumper plugin (#80)
* Add gdb_core_dumper plugin dump_core functionality

* Add gdb_core_dumper plugin documentation

* Remove redundant code

Co-authored-by: Adam Van Scyoc <[email protected]>
2021-03-11 19:26:30 +01:00
Marius Muench e5711d1ef3 V1.4.3 (#79)
* Conditional support for pc in remote memory accesses to pyperipherals

Only if all registered read and write handler support pc, it is
forwarded from the message

* black autoformatting

* qemu_target: logfile kwarg is absolute

* black autoformatting

* Update setup.py and changelog

* fix cached_property import according to pyversion
v1.4.3
2021-03-08 20:58:39 +01:00
mariusmue ea30c459e0 bugfix memory_ranges interval argument v1.4.2 2021-02-26 12:19:27 +01:00
Marius MuenchandGrant Hernandez 6666119dde Dev/v1.4.2 (#77)
* allow inlining of pyperipherals into qemu via API

* unicorn_caller plugin

* wrapper for add_hook

* adjust unicorn_caller import path

* Flags for transfer state rather than absolute bools

* allow avatar-reference to be dictifyable

* added overwrite option to memory ranges

* working version of mr-overwriting

* bugfix for overwrite option

* Rename memory region on overwrite to shorter name

QEMU has a memory name limit of 255. Memory regions with many splits can
create names that exceed this, leading to conflicts.

* additional debugging output

* Add pypanda add_hook function and testcase

The CI test is currently not working due to a bug on PANDAs hooking
infrastructure, which is investigated in parallel. Once fixed, the CI
test should work as expected.

* Bump version and updated changelog

Co-authored-by: Grant Hernandez <[email protected]>
2021-02-26 10:53:08 +01:00