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

Appearance settings

lizrice/debugger-from-scratch

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

debugger-from-scratch

This is a very simple debugger that shows how ptrace can be used to set breakpoints and generate stack traces in a target process. You can choose where to breakpoint the target process, and single step or continue to the next breakpoint (or target exit).

Big caveat: it assumes there is only one file in the target!

I fully expect this only to work on Linux.

This is a more detailed version of the code I wrote in my Debuggers From Scratch talk at dotGo Paris. Here are the slides from that talk.

A note on compiling the target executable

You may find it helpful to compile your target excutable with --gcflags="all=-N -l" (--gcflags="-N -l" in Go 1.9 and earlier) to turn off compiler optimization and in-lining (otherwise you might find that the symbol table doesn't appear to know about code where you expect it to be!)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.