Closed
Bug 490011
Opened 17 years ago
Closed 17 years ago
abcasm exception handling is too hard to use and it needs something like try/catch
Categories
(Tamarin Graveyard :: Tools, defect)
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: cpeyer, Assigned: tharwood)
Details
Attachments
(3 files, 2 obsolete files)
|
7.22 KB,
patch
|
edwsmith
:
review+
|
Details | Diff | Splinter Review |
|
7.26 KB,
patch
|
Details | Diff | Splinter Review | |
|
1001 bytes,
application/octet-stream
|
Details |
exception handling currently requires all exceptions to be defined in the .method_body_info element using from, to and target labels to specify where to deal with the exceptions. This is not very readable as it is all defined outside of the code. An as-like try/catch syntax would be much more readable and usable.
Flags: in-testsuite-
| Assignee | ||
Comment 1•17 years ago
|
||
Possible syntax:
.try {
instruction
instruction
} .catch {
getlocal0
pushscope
instruction
}
Per abcasm design goals, it's up to the assembly-language programmer to follow the rules (or not) regarding stack and scope depth, etc.
| Assignee | ||
Comment 2•17 years ago
|
||
try/catch support, and fixes for two latent bugs.
try/catch is as in previous comment, with an enhancement: the catch type can be specified.
Latent bugs are:
- assembler blocks with no instructions weren't correctly handled
- stack depth processing didn't account for catch block's characteristics.
Attachment #374765 -
Flags: review?(edwsmith)
| Assignee | ||
Comment 3•17 years ago
|
||
| Assignee | ||
Comment 4•17 years ago
|
||
Attachment #374765 -
Attachment is obsolete: true
Attachment #374765 -
Flags: review?(edwsmith)
| Assignee | ||
Updated•17 years ago
|
Attachment #374782 -
Flags: review?(edwsmith)
| Assignee | ||
Updated•17 years ago
|
Attachment #374782 -
Attachment is patch: true
Attachment #374782 -
Attachment mime type: application/octet-stream → text/plain
Comment 5•17 years ago
|
||
can you post an example of the abs for how this is used?
Comment 6•17 years ago
|
||
nevermind
Comment 7•17 years ago
|
||
Comment on attachment 374782 [details] [diff] [review]
Patch without the binary diff
looks fine as as long as it's still possible to do it the old/hard way (for testing situations you can't express this way, such as non-nested but overlapping try regions)
Attachment #374782 -
Flags: review?(edwsmith) → review+
| Assignee | ||
Comment 8•17 years ago
|
||
Yah, the old school way will continue to work and it has coverage; this is syntactic sugar for the "hard" way. Semantic sugar we don't do by design, i.e., the assembler leaves balancing the stack in the hands of the assembly language programmer who will probably suffer a bit on that account.
| Assignee | ||
Comment 9•17 years ago
|
||
Per F2F discussion with Ed, changed patch slightly: the to-be-pushed version doesn't insert a synthetic jump. This makes the .try/.catch regions easier to modify into try/catch/finally, and generally explore more misadventures in control flow, which is a primary goal of the assembler :)
| Assignee | ||
Comment 10•17 years ago
|
||
Attachment #374769 -
Attachment is obsolete: true
| Assignee | ||
Comment 11•17 years ago
|
||
Pushed patch and testcase: 1791:e1b14fa22f28
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
| Reporter | ||
Updated•16 years ago
|
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•