Comments (5)
Can you check if this still happens, and if so provide a full test case? As far as I can tell, all errors lead to a return value of 1 from main.
from armips.
Yeah, it still happens. Using current nightly:
test1.asm
.error "deliberate error"
test2.asm
.gba
.open "test.bin","test.bin",0
.close
test.bat
@echo off
armips test1.asm
if errorlevel 1 ( echo armips exited with errors )
armips test2.asm
if errorlevel 1 ( echo armips exited with errors )
echo done
Produces:
test1.asm(1) error: deliberate error
Aborting.
armips exited with errors
test2.asm(3) fatal error: Could not copy file test.bin
done
There's no "armips exited with errors" being printed after the second run.
from armips.
I think this error may be Windows-only, as I do not get any error messages at all in the second case on Linux when a test.bin exists. Linux is likely less restrictive about opening files multiple times than Windows here. When I do not have a test.bin file, I get fatal error: Could not open file test.bin
as expected.
For reference, here is the script I ported to Linux from test.bat:
armips test1.asm || echo "armips exited with errors"
armips test2.asm || echo "armips exited with errors"
echo "done"
and the script output (when test.bin exists):
/home/simon/ppriv/armipstest/test1.asm(1) error: deliberate error
Aborting.
armips exited with errors
done
from armips.
Ah, I see the confusion. You're right in that the exit code is 1 if there is no test.bin. However, if test.bin does exist, then it returns exit code 0 instead.
EDIT: For reference:
test1.asm
.gba
.open "exists.bin","exists.bin",0
.close
test2asm
.gba
.open "doesntexist.bin","doesntexist.bin",0
.close
test.bat
@echo off
armips test1.asm
if errorlevel 1 ( echo armips exited with errors )
armips test2.asm
if errorlevel 1 ( echo armips exited with errors )
echo done
Produces:
test1.asm(2) fatal error: Could not open file doesntexist.bin
Aborting.
armips exited with errors
test2.asm(3) fatal error: Could not copy file exists.bin
done
EDIT2:
It looks like the error occurs on line 3 (.close
) for test2.asm, so maybe the .close directive isn't forwarding errors properly?
from armips.
The problem is that the error is only detected in the encoding stage, as CopyFileW (correctly) fails to copy a file to itself. On Linux the copying is done manually, apparently with non-blocking files. Currently errors are not supposed to happen during the encode stage. I'll add a check to ensure the source and target files are different.
from armips.
Related Issues (20)
- A .repeat directive HOT 1
- Allow data address as load/store offset HOT 4
- Vector loads/stores element not checked for validity HOT 1
- No data range checks
- Enums
- Non-one-line-expanding macro in a delay slot should cause an error
- Tons of uninitialized memory access bugs HOT 9
- New validation of RSP vector instructions seems to incorrectly mark some cases as invalid HOT 11
- OT question but still related to your works
- Improve RSP immediate value range
- [feature request] get the hash for a binary file and check out the value
- .autoregion broken on latest version of armips. HOT 3
- cmp with negative immediate value off by 1 HOT 1
- missing ARM addressing modes for LDRH
- [feature request] Either inputname() or some way to .org to end of file HOT 3
- Automated builds return 404 error HOT 2
- Missing option to export symbols from armips HOT 1
- Build failure on Linux Xubuntu 22.04 LTS HOT 1
- Automated Armips Build links return 404 HOT 7
- ARM ldrsh parameter failure
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from armips.