Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add synthetic IntegerDivideByZero exception#7496

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
earlephilhower merged 3 commits intoesp8266:masterfromearlephilhower:div0
Aug 17, 2020

Conversation

@earlephilhower
Copy link
Collaborator

The ROM routine __divsi3 is called by code whenever a division is needed,
because there is no divide unit on the ESP8266 core. When the divide
routine in ROM hits a div-by-zero case, it jumpt to an ILL(egal instruction)
at a fixed address which causes a HW exception 0 (IllegalInsnException).

In the postmortem dump, when an ILL exception is detected at this address
in ROM, convert it to a DivByZeroException for printout (6).

Divde by zero errors now print as follows:

--------------- CUT HERE FOR EXCEPTION DECODER ---------------Exception (6):epc1=0x4000dce5 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000>>>stack>>>...<<<stack<<<--------------- CUT HERE FOR EXCEPTION DECODER ---------------

And will decode as follows:

Exception 6: IntegerDivideByZero: QUOS, QUOU, REMS, or REMU divisor operand is zeroPC: 0x4000dce5EXCVADDR: 0x00000000Decoding stack results...

The ROM routine __divsi3 is called by code whenever a division is needed,because there is no divide unit on the ESP8266 core.  When the divideroutine in ROM hits a div-by-zero case, it jumpt to an ILL(egal instruction)at a fixed address which causes a HW exception 0 (IllegalInsnException).In the postmortem dump, when an ILL exception is detected at this addressin ROM, convert it to a DivByZeroException for printout (6).Divde by zero errors now print as follows:````--------------- CUT HERE FOR EXCEPTION DECODER ---------------Exception (6):epc1=0x4000dce5 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000>>>stack>>>...<<<stack<<<--------------- CUT HERE FOR EXCEPTION DECODER ---------------````And will decode as follows:````Exception 6: IntegerDivideByZero: QUOS, QUOU, REMS, or REMU divisor operand is zeroPC: 0x4000dce5EXCVADDR: 0x00000000Decoding stack results...````
@earlephilhower
Copy link
CollaboratorAuthor

Unfortunately, the mod (%) operator intrinsic function is not in ROM, so the same trick can't be used as it will move around in flash depending on the code.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@devytedevytedevyte approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@earlephilhower@devyte

[8]ページ先頭

©2009-2025 Movatter.jp