Skip to content

Instantly share code, notes, and snippets.

@m6w6
Last active February 3, 2016 19:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save m6w6/815173ccabd23808a54a to your computer and use it in GitHub Desktop.
Save m6w6/815173ccabd23808a54a to your computer and use it in GitHub Desktop.
psi glob
(gdb) r
Starting program: /home/mike/build/php-master-dbg/sapi/cli/php -d psi.directory=psi.d:/home/mike/src/psi/tests/glob /home/mike/src/psi/tests/glob/glob002.php
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Hardware watchpoint 4: *(char **)0xd70298
Old value = <unreadable>
New value = 0xd702f0 ""
0x00007ffff641bfa5 in __fopen_internal () from /usr/lib/libc.so.6
(gdb) c
Continuing.
Hardware watchpoint 3: *(char **)0xd70290
Old value = <unreadable>
New value = 0x0
0x00007ffff6428906 in _IO_old_init () from /usr/lib/libc.so.6
(gdb) c
Continuing.
Hardware watchpoint 2: *(char**)0xd70270
Old value = <unreadable>
New value = 0x0
0x00007ffff642897a in _IO_old_init () from /usr/lib/libc.so.6
(gdb) c
Continuing.
===TEST===
Hardware watchpoint 2: *(char**)0xd70270
Old value = 0x0
New value = 0x7ffff6751b98 <main_arena+88> "P\207", <incomplete sequence \327>
0x00007ffff642d05c in _int_malloc () from /usr/lib/libc.so.6
(gdb) c
Continuing.
Hardware watchpoint 2: *(char**)0xd70270
Old value = 0x7ffff6751b98 <main_arena+88> "P\207", <incomplete sequence \327>
New value = 0x7ffff6751db8 <main_arena+632> "\250\035u\366\377\177"
0x00007ffff642d937 in _int_realloc () from /usr/lib/libc.so.6
(gdb) c
Continuing.
Hardware watchpoint 4: *(char **)0xd70298
Old value = 0xd702f0 ""
New value = 0xd5f750 "glob002.php"
0x00007ffff642d969 in _int_realloc () from /usr/lib/libc.so.6
(gdb) c
Continuing.
Breakpoint 6, psi_do_set (return_value=0x7ffff5e790b0, set=0xc8c3a0) at /home/mike/src/php-master/ext/psi/src/engine.c:378
378 decl_arg *set_arg = set->vars->vars[0]->arg;
(gdb) n
380 zval_dtor(return_value);
(gdb)
381 set->func->handler(return_value, set, set_arg->let ? set_arg->let->ptr : set_arg->ptr);
(gdb) s
psi_to_array (return_value=0x7ffff5e790b0, set=0xc8c3a0, r_val=0xc16db0) at /home/mike/src/php-master/ext/psi/src/marshal.c:238
238 decl_var *var = set->vars->vars[0];
(gdb) p *(glob_t*)r_val->ptr
$97 = {
gl_pathc = 4,
gl_pathv = 0xd70270,
gl_offs = 5,
gl_flags = 1320,
gl_closedir = 0x0,
gl_readdir = 0x0,
gl_opendir = 0x0,
gl_lstat = 0x0,
gl_stat = 0x0
}
(gdb) p *(((glob_t*)r_val->ptr)->gl_pathv)@9
$98 = {0x7ffff6751db8 <main_arena+632> "\250\035u\366\377\177", 0x7ffff6751db8 <main_arena+632> "\250\035u\366\377\177", 0x0, 0x0, 0x0,
0xd5f750 "glob002.php", 0xd62fc0 "glob001.phpt", 0xd61cb0 "glob002.phpt", 0xd70250 "glob003.phpt"}
(gdb) c
Continuing.
Breakpoint 1, psi_to_string (return_value=0x7fffffffa190, set=0xc8cfb0, ret_val=0xd70270) at /home/mike/src/php-master/ext/psi/src/marshal.c:130
130 decl_var *var = set->vars->vars[0];
$69 = (void *) 0x7ffff6751db8 <main_arena+632>
Breakpoint 1, psi_to_string (return_value=0x7fffffffa190, set=0xc8cfb0, ret_val=0xd70278) at /home/mike/src/php-master/ext/psi/src/marshal.c:130
130 decl_var *var = set->vars->vars[0];
$70 = (void *) 0x7ffff6751db8 <main_arena+632>
Breakpoint 1, psi_to_string (return_value=0x7fffffffa190, set=0xc8cfb0, ret_val=0xd70280) at /home/mike/src/php-master/ext/psi/src/marshal.c:130
130 decl_var *var = set->vars->vars[0];
$71 = (void *) 0x0
Breakpoint 1, psi_to_string (return_value=0x7fffffffa190, set=0xc8cfb0, ret_val=0xd70288) at /home/mike/src/php-master/ext/psi/src/marshal.c:130
130 decl_var *var = set->vars->vars[0];
$72 = (void *) 0x0
Breakpoint 1, psi_to_string (return_value=0x7fffffffa190, set=0xc8cfb0, ret_val=0xd70290) at /home/mike/src/php-master/ext/psi/src/marshal.c:130
130 decl_var *var = set->vars->vars[0];
$73 = (void *) 0x0
Breakpoint 1, psi_to_string (return_value=0x7fffffffa190, set=0xc8cfb0, ret_val=0xd70298) at /home/mike/src/php-master/ext/psi/src/marshal.c:130
130 decl_var *var = set->vars->vars[0];
$74 = (void *) 0xd5f750
Breakpoint 1, psi_to_string (return_value=0x7fffffffa190, set=0xc8cfb0, ret_val=0xd702a0) at /home/mike/src/php-master/ext/psi/src/marshal.c:130
130 decl_var *var = set->vars->vars[0];
$75 = (void *) 0xd62fc0
Breakpoint 1, psi_to_string (return_value=0x7fffffffa190, set=0xc8cfb0, ret_val=0xd702a8) at /home/mike/src/php-master/ext/psi/src/marshal.c:130
130 decl_var *var = set->vars->vars[0];
$76 = (void *) 0xd61cb0
Breakpoint 1, psi_to_string (return_value=0x7fffffffa190, set=0xc8cfb0, ret_val=0xd702b0) at /home/mike/src/php-master/ext/psi/src/marshal.c:130
130 decl_var *var = set->vars->vars[0];
$77 = (void *) 0xd70250
Hardware watchpoint 2: *(char**)0xd70270
Old value = 0x7ffff6751db8 <main_arena+632> "\250\035u\366\377\177"
New value = 0x0
0x00007ffff642b14c in _int_free () from /usr/lib/libc.so.6
(gdb) c
Continuing.
int(0)
array(4) {
["gl_pathc"]=>
int(4)
["gl_offs"]=>
int(5)
["gl_flags"]=>
int(1320)
["gl_pathv"]=>
array(9) {
[0]=>
string(6) "�u��"
[1]=>
string(6) "�u��"
[2]=>
string(0) ""
[3]=>
string(0) ""
[4]=>
string(0) ""
[5]=>
string(11) "glob002.php"
[6]=>
string(12) "glob001.phpt"
[7]=>
string(12) "glob002.phpt"
[8]=>
string(12) "glob003.phpt"
}
}
===DONE===
[Inferior 1 (process 18776) exited normally]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment