Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to generate a coredump when emulation hits a crash? #1858

Closed
c01dkit opened this issue Aug 1, 2023 · 4 comments
Closed

How to generate a coredump when emulation hits a crash? #1858

c01dkit opened this issue Aug 1, 2023 · 4 comments

Comments

@c01dkit
Copy link

c01dkit commented Aug 1, 2023

Hi there,
Does unicorn support generate a coredump (to save memory data, registers, environment variables, etc.) when emulation hits a crash ( such as UC_ERR_READ_UNMAPPED) ? A coredump can automatically generates in normal linux system. I'm wondering if unicorn has already support the same feature, or one needs to implement such mechanism manually (in exit handler) ?

@wtdcode
Copy link
Member

wtdcode commented Aug 1, 2023

Coredump is generated when a process exits abnormally, e.g. abort() was called. UC_ERR_READ_UNMAPPED means a normal exit, not an abort().

To save a "coredump", you may look at context API.

@c01dkit
Copy link
Author

c01dkit commented Aug 2, 2023

Thanks for reply!
I found functions like uc_context_*, uc_mem_* and uc_reg_*. However, it seems that there is no single function aims to save all information. ( I'm not sure )
Maybe I should try to combine them.

@wtdcode
Copy link
Member

wtdcode commented Aug 2, 2023 via email

@c01dkit
Copy link
Author

c01dkit commented Aug 4, 2023

Thanks for reply! I think this issue could be closed : )

@c01dkit c01dkit closed this as completed Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants