summaryrefslogtreecommitdiffstatshomepage
path: root/unix/main.c
Commit message (Collapse)AuthorAge
* unix: Detect and print compile error.Damien George2014-10-05
|
* py: Change [u]int to mp_[u]int_t in qstr.[ch], and some other places.Damien George2014-10-03
| | | | This should pretty much resolve issue #50.
* unix: Do a proper clean-up on sys.exit/SystemExit.Damien George2014-10-01
| | | | Addresses issue #859.
* py: For malloc and vstr functions, use size_t exclusively for int type.Damien George2014-09-25
| | | | | | It seems most sensible to use size_t for measuring "number of bytes" in malloc and vstr functions (since that's what size_t is for). We don't use mp_uint_t because malloc and vstr are not Micro Python specific.
* py: Move definition of mp_sys_exit to core.Damien George2014-09-15
| | | | | | | | sys.exit always raises SystemExit so doesn't need a special implementation for each port. If C exit() is really needed, use the standard os._exit function. Also initialise mp_sys_path and mp_sys_argv in teensy port.
* py: Change uint to mp_uint_t in runtime.h, stackctrl.h, binary.h.Damien George2014-08-30
| | | | Part of code cleanup, working towards resolving issue #50.
* py: Make tuple and list use mp_int_t/mp_uint_t.Damien George2014-08-30
| | | | Part of code cleanup, to resolve issue #50.
* py: Fix bug where GC collected native/viper/asm function data.Damien George2014-08-24
| | | | | | | | Because (for Thumb) a function pointer has the LSB set, pointers to dynamic functions in RAM (eg native, viper or asm functions) were not being traced by the GC. This patch is a comprehensive fix for this. Addresses issue #820.
* py: Put SystemExit in builtin namespace.Damien George2014-08-16
| | | | Also fix unix port so that SystemExit with no arg exits with value 0.
* Put call to qstr_init and mp_init_emergency_exc_buf in mp_init.Damien George2014-08-04
| | | | | | | qstr_init is always called exactly before mp_init, so makes sense to just have mp_init call it. Similarly with mp_init_emergency_exception_buf. Doing this makes the ports simpler and less error prone (ie they can no longer forget to call these).
* Merge pull request #738 from dhylands/except-argsDamien George2014-07-29
|\ | | | | Add support for storing args during an exception raised by an irq.
| * Add support for storing args during an exception raised by an irq.Dave Hylands2014-07-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The user code should call micropython.alloc_emergency_exception_buf(size) where size is the size of the buffer used to print the argument passed to the exception. With the test code from #732, and a call to micropython.alloc_emergenncy_exception_buf(100) the following error is now printed: ```python >>> import heartbeat_irq Uncaught exception in Timer(4) interrupt handler Traceback (most recent call last): File "0://heartbeat_irq.py", line 14, in heartbeat_cb NameError: name 'led' is not defined ```
* | py: Implement __file__ attribute for modules.Paul Sokolovsky2014-07-28
|/
* Rename machine_(u)int_t to mp_(u)int_t.Damien George2014-07-03
| | | | See discussion in issue #50.
* stackctrl: Add "mp_" prefix.Paul Sokolovsky2014-07-01
|
* windows: Sync mpconfigport.h with the unix' versionstijn2014-06-29
| | | | | | - rearrange/add definitions that were not there so it's easier to compare both - use MICROPY_PY_SYS_PLATFORM in main.c since it's available anyway - define EWOULDBLOCK, it is missing from ingw32
* py: Move stack_ctrl_init() to mp_init().Paul Sokolovsky2014-06-27
| | | | | | As stack checking is enabled by default, ports which don't call stack_ctrl_init() are broken now (report RuntimeError on startup). Save them trouble and just init stack control framework in interpreter init.
* py: Add portable framework to query/check C stack usage.Paul Sokolovsky2014-06-27
| | | | | | | | Such mechanism is important to get stable Python functioning, because Python function calling is handled with C stack. The idea is to sprinkle STACK_CHECK() calls in places where there can be C recursion. TODO: Add more STACK_CHECK()'s.
* unix: Dump default heap size in usage message.Paul Sokolovsky2014-06-24
|
* unix: uClibc doesn't like NULL as a buffer arg to realpath().Paul Sokolovsky2014-06-22
| | | | So, allocate one explicitly.
* unix: Fix path seperator used depending on OSstijn2014-06-05
| | | | ';' is the standard seperator used for paths in environment variables on Windows
* py: Instead of having "debug on" var, have "optimization level" var.Paul Sokolovsky2014-06-03
| | | | | This allows to have multiple "optimization" levels (CPython has two (-OO removes docstrings), we can have more).
* unix: Properly print script filename in case of error.Paul Sokolovsky2014-06-03
|
* unix: 64-bit cleanness.Paul Sokolovsky2014-05-31
|
* unix: Add poorman's stack usage info to mem_info() dump.Paul Sokolovsky2014-05-31
|
* Add SystemExit exception and use it in unix/ and stmhal/ ports.Damien George2014-05-24
| | | | Addresses issue #598.
* Merge pull request #600 from stinos/unix-exitcodeDamien George2014-05-13
|\ | | | | unix: Use standard return codes for main
| * unix: Use standard return codes for mainstijn2014-05-11
| | | | | | | | | | As in the CPython manual: "Unix programs generally use 2 for command line syntax errors and 1 for all other kind of errors"
* | unix: Implement -O option to turn off __debug__ flag.Damien George2014-05-12
| |
* | py: Rename BYTE_CODE to BYTECODE (this was missed in previous rename).Damien George2014-05-12
|/
* modsys, unix: Add sys.exit(), should be implemented by a port.Paul Sokolovsky2014-05-10
|
* Add input command for unixDave Hylands2014-05-07
|
* modgc: Add new module for GC-related functionality.Paul Sokolovsky2014-05-06
|
* py, unix: Add -v option, print bytecode dump if used.Paul Sokolovsky2014-05-05
| | | | | | | | | | This will work if MICROPY_DEBUG_PRINTERS is defined, which is only for unix/windows ports. This makes it convenient to user uPy normally, but easily get bytecode dump on the spot if needed, without constant recompiles back and forth. TODO: Add more useful debug output, adjust verbosity level on which specifically bytecode dump happens.
* unix: Remove test class and code.Damien George2014-05-04
|
* Add license header to (almost) all files.Damien George2014-05-03
| | | | | | | Blanket wide to all .c and .h files. Some files originating from ST are difficult to deal with (license wise) so it was left out of those. Also merged modpyb.h, modos.h, modstm.h and modtime.h in stmhal/.
* Don't print git hash as well as git tag in banner.v1.0Damien George2014-05-03
|
* Merge branch 'master' of github.com:micropython/micropythonDamien George2014-05-03
|\
| * mingw: Add implementation of realpath()stijn2014-05-03
| | | | | | | | | | | | | | | | | | The mingw port used _fullpath() until now, but the behaviour is not exactly the same as realpath()'s on unix; major difference being that it doesn't return an error for non-existing files, which would bypass main's error checking and bail out without any error message. Also realpath() will return forward slashes only since main() relies on that.
* | py: Print tag/version/git describe in uPy banner.Damien George2014-05-03
|/
* py, unix: Make "mpconfig.h" be first included, as other headers depend on it.Paul Sokolovsky2014-05-02
| | | | Specifically, nlr.h does.
* unix windows: mingw32 doesn't have realpath(), use _fullpath() instead.Paul Sokolovsky2014-04-20
|
* unix mem_info(): Dump GC info only if it's enabled.Paul Sokolovsky2014-04-20
|
* unix modffi: Convert to static module structures.Paul Sokolovsky2014-04-18
|
* unix modsocket: Convert to static module structures.Paul Sokolovsky2014-04-17
|
* unix: Make mem_info() dump GC info too.Paul Sokolovsky2014-04-17
| | | | mem_info() is already pretty hacky, let it be more hacky.
* unix modtime: Convert to static module structures.Paul Sokolovsky2014-04-17
|
* build: Simplify build directory layout by putting all headers in genhdr.Damien George2014-04-17
| | | | | Any generated headers go in $(BUILD)/genhdr/, and are #included as 'genhdr/xxx.h'.
* py, unix: Convert sys module to static representation.Paul Sokolovsky2014-04-13
|
* unix: Add option to only compile, and not execute code.Damien George2014-04-10
|