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

Add print zend string function to gdbinit #2293

Closed
wants to merge 1 commit into from

Conversation

mhagstrand
Copy link
Contributor

I have been digging around in a core dump and I found having a function to print zend_strings useful.

Usage example:

(gdb) print_zstr 0x7ff967402a50
length (9): "microtime"

@krakjoe
Copy link
Member

krakjoe commented Jan 9, 2017 via email

@mhagstrand
Copy link
Contributor Author

Yeah, I screwed up and put the PR against the wrong branch.

@mhagstrand
Copy link
Contributor Author

It is fixed now.

@mhagstrand mhagstrand changed the title Print zstr gdbinit Add print zend string function to gdbinit Jan 9, 2017
@krakjoe
Copy link
Member

krakjoe commented Jan 9, 2017

Can I suggest that it may be better to print as ZE would var_dump it (if it were a zval):

string (%d) "%s"

In that format ?

On a side note, .gdbinit is in very poor shape, having not been updated for ZE3 properly ... not your problem, but if you were looking for something else to do :)

@mhagstrand
Copy link
Contributor Author

I think that is a good suggestion, I'll make the update.

When I get a chance I'll dig into cleaning up .gdbinit a bit.

@krakjoe
Copy link
Member

krakjoe commented Jan 9, 2017

Don't forget to rebase and squash ;)

@mhagstrand
Copy link
Contributor Author

I didn't forget this time =)

Output:

(gdb) print_zstr 0x7ff967402a50
string(9) "microtime"

@nikic
Copy link
Member

nikic commented Jan 9, 2017

Merged via 9ad3413, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants