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)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: cpeyer, Assigned: tharwood)

Details

Attachments

(3 files, 2 obsolete files)

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-
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.
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)
Attached file Testcase and sample (obsolete) —
Attachment #374765 - Attachment is obsolete: true
Attachment #374765 - Flags: review?(edwsmith)
Attachment #374782 - Flags: review?(edwsmith)
Attachment #374782 - Attachment is patch: true
Attachment #374782 - Attachment mime type: application/octet-stream → text/plain
can you post an example of the abs for how this is used?
nevermind
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+
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.
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 :)
Attachment #374769 - Attachment is obsolete: true
Pushed patch and testcase: 1791:e1b14fa22f28
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: