Skip to content

phpdbg few fixes, mostly printf-like format issues due to C str -> ze… #9210

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

Closed
Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion Zend/zend_alloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ typedef struct _zend_mm_heap zend_mm_heap;

ZEND_API zend_mm_heap *zend_mm_startup(void);
ZEND_API void zend_mm_shutdown(zend_mm_heap *heap, bool full_shutdown, bool silent);
ZEND_API ZEND_ATTRIBUTE_MALLOC void* ZEND_FASTCALL _zend_mm_alloc(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
ZEND_API ZEND_ATTRIBUTE_MALLOC void* ZEND_FASTCALL _zend_mm_alloc(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_ALLOC_SIZE(2);
ZEND_API void ZEND_FASTCALL _zend_mm_free(zend_mm_heap *heap, void *p ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
ZEND_API void* ZEND_FASTCALL _zend_mm_realloc(zend_mm_heap *heap, void *p, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
ZEND_API void* ZEND_FASTCALL _zend_mm_realloc2(zend_mm_heap *heap, void *p, size_t size, size_t copy_size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
Expand Down
2 changes: 1 addition & 1 deletion sapi/phpdbg/phpdbg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1076,7 +1076,7 @@ void phpdbg_sighup_handler(int sig) /* {{{ */
} /* }}} */
#endif

void *phpdbg_malloc_wrapper(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) /* {{{ */
ZEND_ATTRIBUTE_MALLOC ZEND_ATTRIBUTE_ALLOC_SIZE(1) void *phpdbg_malloc_wrapper(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) /* {{{ */
{
return _zend_mm_alloc(zend_mm_get_heap(), size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
} /* }}} */
Expand Down
6 changes: 3 additions & 3 deletions sapi/phpdbg/phpdbg_bp.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ PHPDBG_API void phpdbg_set_breakpoint_file(const char *path, size_t path_len, ze
ZEND_HASH_MAP_FOREACH_STR_KEY(&PHPDBG_G(file_sources), file) {
HashTable *fileht;

phpdbg_debug("Compare against loaded %s\n", file);
phpdbg_debug("Compare against loaded %s\n", ZSTR_VAL(file));

if (!(pending = ((fileht = phpdbg_resolve_pending_file_break_ex(ZSTR_VAL(file), ZSTR_LEN(file), path_str, broken)) == NULL))) {
new_break = *(phpdbg_breakfile_t *) zend_hash_index_find_ptr(fileht, line_num);
Expand Down Expand Up @@ -378,7 +378,7 @@ PHPDBG_API HashTable *phpdbg_resolve_pending_file_break_ex(const char *file, uin
PHPDBG_G(flags) &= ~PHPDBG_HAS_PENDING_FILE_BP;
}

phpdbg_debug("compiled file: %s, cur bp file: %s\n", file, cur);
phpdbg_debug("compiled file: %s, cur bp file: %s\n", file, ZSTR_VAL(cur));

return master;
}
Expand All @@ -395,7 +395,7 @@ PHPDBG_API void phpdbg_resolve_pending_file_break(const char *file) /* {{{ */
phpdbg_debug("was compiled: %s\n", file);

ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(&PHPDBG_G(bp)[PHPDBG_BREAK_FILE_PENDING], cur, fileht) {
phpdbg_debug("check bp: %s\n", cur);
phpdbg_debug("check bp: %s\n", ZSTR_VAL(cur));

phpdbg_resolve_pending_file_break_ex(file, filelen, cur, fileht);
} ZEND_HASH_FOREACH_END();
Expand Down