This adds detection of UART core dumps to IDF monitor. By default,
core dumps are not printed to the console, but are processed by
espcoredump.py using 'info_corefile' command. The result is printed
to stdout.
This feature can be disabled in menuconfig.
In the future this can be extended to allow running espcoredump.py
with 'dbg_corefile' argument, which is similar to the current GDB Stub
behavior.
Related to IDF-52.
This solves the issue that target is changed to the default one after
idf.py fullclean.
Also allow setting the default target using sdkconfig.defaults, e.g.
CONFIG_IDF_TARGET="esp32s2"
Closes IDF-1040
Python 2 expect the environ variables are all of type 'str', but
sometimes wrong 'unicode' type is given.
Here we force all variables that are not str to become str.
1. Call cli with explicit argv
When using debugging tools like `pydbg.py --some_arg idf.py -G Ninga
build`, those tools usually call the python script with sys.argv
modified to correct value. But if the cli is called with argv blank, the
cli will get the argv again, and finally get the original command line,
which is incorrect for debugging.
2. Encode the style unicode string back to ascii in menuconfig cmd
On Windows MSYS python2.7, the unicode string set in os.environ will
cause the subprocess creating to fail. All os.environ values should be
strings.