Skip to content

Instantly share code, notes, and snippets.

@shi-yan
Created November 1, 2018 22:07
Show Gist options
  • Save shi-yan/3b2225bd267fcd6114de87d4a7e2c063 to your computer and use it in GitHub Desktop.
Save shi-yan/3b2225bd267fcd6114de87d4a7e2c063 to your computer and use it in GitHub Desktop.
gdb exit if program succeeds, break if program crashes?
https://stackoverflow.com/questions/8657648/how-to-have-gdb-exit-if-program-succeeds-break-if-program-crashes
If you put the following lines in your ~/.gdbinit file, gdb will exit when your program exits with a status code of 0.
python
def exit_handler ( event ):
if event .exit_code == 0:
gdb .execute ( "quit" )
gdb .events .exited .connect ( exit_handler )
end
@shi-yan
Copy link
Author

shi-yan commented Dec 4, 2018

break dlopen if $_regex($1,".+libssl.so.1.1.+")

https://stackoverflow.com/questions/7423577/how-to-compare-a-stored-string-variable-in-gdb

compare string and break

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