Skip to content

Instantly share code, notes, and snippets.

@kivikakk
Created June 30, 2016 16:51
Show Gist options
  • Select an option

  • Save kivikakk/2e021fa5be80a79500c2efd19162de67 to your computer and use it in GitHub Desktop.

Select an option

Save kivikakk/2e021fa5be80a79500c2efd19162de67 to your computer and use it in GitHub Desktop.
find the method referred to by ci->mid
mid = int(gdb.parse_and_eval("ci->mid"))
bin_number = mid % int(gdb.parse_and_eval("global_symbols.id_str.num_bins"))
next_count = 0
while True:
key = int(gdb.parse_and_eval("global_symbols.id_str.as.big.bins[{}]{}.key".format(bin_number, ".next" * next_count)))
if key == mid:
break
next_count += 1
gdb.write("{}\n".format(gdb.parse_and_eval("RSTRING_PTR(global_symbols.id_str.as.big.bins[{}]{}.record)".format(bin_number, ".next" * next_count)).string()))
@kivikakk

Copy link
Copy Markdown
Author

this is way overspecific and horrible i'm sorry

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