-
Notifications
You must be signed in to change notification settings - Fork 522
Add IL offset and method token to stack frame details. #2130
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
Conversation
Thanks @joncham let me test it tomorrow. I'll get back to you! |
@@ -48,8 +48,8 @@ struct _GHashTable { | |||
Slot **table; | |||
int table_size; | |||
int in_use; | |||
int threshold; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was only used in one place, but never updated.
int last_rehash; | ||
gboolean uses_default_hash_and_equality; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This allows us to perform the same hashing/equality operations when out of process.
@@ -239,8 +240,7 @@ g_hash_table_insert_replace (GHashTable *hash, gpointer key, gpointer value, gbo | |||
sanity_check (hash); | |||
|
|||
equal = hash->key_equal_func; | |||
if (hash->in_use >= hash->threshold) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rehash was always occurring, as threshold
was always 0
.
result |= (byte & 0x7f) << shift; | ||
if ((byte & 0x80) == 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see in mono-debug
that these hardcoded values are used there as well but I'm still curious what they are?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is variable length encoding of integer values. Thus small values could be contained within a single byte. Larger values two bytes, etc.
Add support to read IL offset and method token out-of-process (oop). This will enable the symbolication of managed frames to file/line level rather than just the method level.
Notes:
int _GHashTable::threshold
field. This was never updated, always had value0
, and thus always caused a rehash when checked.gboolean _GHashTable::uses_default_hash_and_equality
field. The out-of-process read logic needs to inspect a hash table, and thus can only be done when direct hash/equality is used; custom hash/equality functions are not supported.g_hash_table_lookup_oop
to perform the actual hash lookup. This was done inmono/eglib/ghashtable.c
directly to avoid having to expose hashtable implementation internals.mono/metadata/oop.c
replicate enough data/logic for a simple oop version ofmono_debug_read_method
that can retrieve the offset/token info.These changes have some risk, but they are only invoked when processing a crash. Thus, we may lose some crash info in the case of errors, but we should not cause any additional crashes.
Reviewers: please consider these questions as well! ❤️