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

Extracting common dwarf reader functionality into its own area #37

Closed
wants to merge 1 commit into from

Conversation

epipho
Copy link
Contributor

@epipho epipho commented Dec 31, 2014

Searching by name through the dwarf data is not sufficient for many advanced use cases. This is the beginning of an attempt to rectify this by creating a more intelligent reader.

Current functionality:

  • Seek reader to function by pc. Replaces looking up the function name by pc and then looking up the function by name.
  • Seek reader to a specific dwarf entry.
  • Traverse scope variables.

Assuming you approve of this direction, the next PR would add:

  • Variable -> Base type mapping
  • Member data traversal
  • Read stack program instructions from an entry

if err != nil {
return nil, err
}
return entry, nil
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the entry be returned here? It's just returning the entry that was passed in, maybe just return the error?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not, I had this idea that all the seek functions should have the same signature but in retrospect I think that is unnecessary.

@derekparker
Copy link
Member

A few notes but I really like this.

@epipho
Copy link
Contributor Author

epipho commented Dec 31, 2014

Moved ThreadContext.Reader to DebuggedProcess.DwarfReader and squashed down the commits.

Glad you like it, with some more work it will simplify a lot of the code while increasing the accuracy.

@derekparker
Copy link
Member

Merged.

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

Successfully merging this pull request may close these issues.

2 participants