Skip to content

Implemented FR #63188 (Display class name when debugging with gdb macro ... #209

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

Merged
merged 3 commits into from
Oct 1, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 49 additions & 8 deletions .gdbinit
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,53 @@ define dump_bt
set $t = $arg0
while $t
printf "[%p] ", $t
if $t->function_state.function->common.function_name
if $t->function_state.arguments
set $count = (int)*($t->function_state.arguments)
printf "%s(", $t->function_state.function->common.function_name
set $fst = $t->function_state
if $fst.function->common.function_name
if $fst.arguments
set $count = (int)*($fst.arguments)

if $t->object
if $fst.function.common.scope
printf "%s->", $fst.function.common.scope->name
else
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This branch will not be executed that much, but for completeness, I have to do that...

if !$eg && !basic_functions_module.zts
____executor_globals
end

set $known_class = 0
if $eg
set $handle = $t->object.value.obj.handle
set $handlers = $t->object.value.obj.handlers
set $zobj = (zend_object *)$eg.objects_store.object_buckets[$handle].bucket.obj.object

if $handlers->get_class_entry == &zend_std_object_get_class
set $known_class = 1

if $handlers.get_class_name
if $handlers.get_class_name != &zend_std_object_get_class_name
set $known_class = 0
end
end

if $known_class
printf "%s->", $zobj->ce.name
end
end
end

if !$known_class
printf "Unknow->"
end
end
else
if $fst.function.common.scope
printf "%s::", $fst.function.common.scope->name
end
end

printf "%s(", $fst.function->common.function_name
while $count > 0
set $zvalue = *(zval **)($t->function_state.arguments - $count)
set $zvalue = *(zval **)($fst.arguments - $count)
set $type = $zvalue->type
if $type == 0
printf "NULL"
Expand Down Expand Up @@ -73,7 +114,7 @@ define dump_bt
if $type == 7
printf "resource(#%d)", $zvalue->value.lval
end
if $type == 8
if $type == 8
printf "constant"
end
if $type == 9
Expand All @@ -89,7 +130,7 @@ define dump_bt
end
printf ") "
else
printf "%s() ", $t->function_state.function->common.function_name
printf "%s() ", $fst.function->common.function_name
end
else
printf "??? "
Expand Down Expand Up @@ -600,7 +641,7 @@ define zmemcheck
end
end
if $not_found
printf "no such block that begins at %p.\n", $aptr
printf "no such block that begins at %p.\n", $aptr
end
if $arg0 == 0
printf "-------------------------------------------------------------------------------\n"
Expand Down