Skip to content

executils refactoring #921

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 25, 2020
Merged

executils refactoring #921

merged 3 commits into from
Aug 25, 2020

Conversation

cmaglie
Copy link
Member

@cmaglie cmaglie commented Aug 25, 2020

This helper should avoid common pitfalls arising mainly after the adoption of the avrdude-stdin-hack, for example see #904.
It also streamlines some of the most common operations (like process Kill or Signal).

This helper should avoid common pitfalls arising mainly after the adoption
of the 'avrdude-stdin-hack'. For example see arduino#904
It also streamlines some of the most common operations (like process
Kill or Signal).
Even if no board are attached to the host system, it's always another
smoke-test that runs automatically.

Having this check enabled, for example, would have prevented:
arduino#904
@cmaglie cmaglie changed the title executils refacoring executils refactoring Aug 25, 2020
@cmaglie cmaglie requested a review from silvanocerza August 25, 2020 15:02
@kittaakos
Copy link
Contributor

I did a quick local verification after building the CLI from the fork. I did the followings:

I executed the the debug command from a terminal:

/path/to/arduino-cli debug -p /dev/cu.usbmodem14602 -b arduino:samd:arduino_zero_edbg --interpreter mi2 /path/to/my/sketch -v --log-level trace

I got back the expected output:

DEBU[0000] Executing debugger                            param0=/Users/akos.kitta/Library/Arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin//arm-none-eabi-gdb param1="--interpreter=mi2" param2=-ex param3="set remotetimeout 5" param4=-ex param5="set pagination off" param6=-ex param7="target extended-remote | \"/Users/akos.kitta/Library/Arduino15/packages/arduino/tools/openocd/0.10.0-arduino7/bin/openocd\" -s \"/Users/akos.kitta/Library/Arduino15/packages/arduino/tools/openocd/0.10.0-arduino7/share/openocd/scripts/\" --file \"/Users/akos.kitta/Library/Arduino15/packages/arduino/hardware/samd/1.8.8/variants/arduino_zero/openocd_scripts/arduino_zero.cfg\" -c \"gdb_port pipe\" -c \"telnet_port 0\"" param8=/Users/akos.kitta/Documents/Arduino/sketch_aug24c_x1/build/arduino.samd.arduino_zero_edbg/sketch_aug24c_x1.ino.elf
=thread-group-added,id="i1"
~"GNU gdb (GNU Tools for Arm Embedded Processors 7-2017-q4-major) 8.0.50.20171128-git\n"
~"Copyright (C) 2017 Free Software Foundation, Inc.\n"
~"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.  Type \"show copying\"\nand \"show warranty\" for details.\n"
~"This GDB was configured as \"--host=x86_64-apple-darwin10 --target=arm-none-eabi\".\nType \"show configuration\" for configuration details."
~"\nFor bug reporting instructions, please see:\n"
~"<http://www.gnu.org/software/gdb/bugs/>.\n"
~"Find the GDB manual and other documentation resources online at:\n<http://www.gnu.org/software/gdb/documentation/>.\n"
~"For help, type \"help\".\n"
~"Type \"apropos word\" to search for commands related to \"word\"...\n"
~"Reading symbols from /Users/akos.kitta/Documents/Arduino/sketch_aug24c_x1/build/arduino.samd.arduino_zero_edbg/sketch_aug24c_x1.ino.elf..."
~"done.\n"
=cmd-param-changed,param="remotetimeout",value="5"
=cmd-param-changed,param="pagination",value="off"
~"Remote debugging using | \"/Users/akos.kitta/Library/Arduino15/packages/arduino/tools/openocd/0.10.0-arduino7/bin/openocd\" -s \"/Users/akos.kitta/Library/Arduino15/packages/arduino/tools/openocd/0.10.0-arduino7/share/openocd/scripts/\" --file \"/Users/akos.kitta/Library/Arduino15/packages/arduino/hardware/samd/1.8.8/variants/arduino_zero/openocd_scripts/arduino_zero.cfg\" -c \"gdb_port pipe\" -c \"telnet_port 0\"\n"
&"Open On-Chip Debugger 0.10.0+dev-gf0767a31 (2018-06-11-13:48)\n"
&"Licensed under GNU GPL v2\n"
&"For bug reports, read\n"
&"\thttp://openocd.org/doc/doxygen/bugs.html\n"
&"Info : auto-selecting first available session transport \"swd\". To override use 'transport select <transport>'.\n"
&"none separate\n"
&"adapter speed: 400 kHz\n"
&"cortex_m reset_config sysresetreq\n"
&"Info : Listening on port 6666 for tcl connections\n"
&"Info : Listening on port 56621 for telnet connections\n"
&"Info : CMSIS-DAP: SWD  Supported\n"
&"Info : CMSIS-DAP: Interface Initialised (SWD)\n"
&"Info : CMSIS-DAP: FW Version = 02.01.0157\n"
&"Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 1 TDO = 1 nTRST = 0 nRESET = 1\n"
&"Info : CMSIS-DAP: Interface ready\n"
&"Info : clock speed 400 kHz\n"
&"Info : SWD DPIDR 0x0bc11477\n"
&"Info : at91samd21g18.cpu: hardware has 4 breakpoints, 2 watchpoints\n"
&"Info : accepting 'gdb' connection from pipe\n"
&"target halted due to debug-request, current mode: Thread \n"
&"xPSR: 0x41000000 pc: 0x000022cc msp: 0x20007fcc\n"
&"Info : SAMD MCU: SAMD21G18A (256KB Flash, 32KB RAM)\n"
=thread-group-started,id="i1",pid="42000"
=thread-created,id="1",group-id="i1"
~"resetExternalChip () at /Users/akos.kitta/Library/Arduino15/packages/arduino/hardware/samd/1.8.7/cores/arduino/Reset.h:29\n"
&"29\t/Users/akos.kitta/Library/Arduino15/packages/arduino/hardware/samd/1.8.7/cores/arduino/Reset.h: No such file or directory.\n"
*stopped,frame={addr="0x000022cc",func="resetExternalChip",args=[],file="/Users/akos.kitta/Library/Arduino15/packages/arduino/hardware/samd/1.8.7/cores/arduino/Reset.h",fullname="/Users/akos.kitta/Library/Arduino15/packages/arduino/hardware/samd/1.8.7/cores/arduino/Reset.h",line="29"},thread-id="1",stopped-threads="all"

I also dropped the CLI into the 0.1.0 Pro IDE and could start the debugger.
screencast 2020-08-25 17-24-52

@cmaglie cmaglie merged commit 48383da into arduino:master Aug 25, 2020
@cmaglie cmaglie deleted the executils_refacoring branch August 25, 2020 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants