diff options
author | Justus Winter <justus@gnupg.org> | 2017-06-19 21:20:57 +0200 |
---|---|---|
committer | Justus Winter <justus@gnupg.org> | 2017-08-05 18:42:22 +0200 |
commit | 835b293d35a209d38047126443d41fa7090daa4c (patch) | |
tree | 5bf956895e6030f91cd618fb191b2151f6d25423 /ext2fs/ext2fs.h | |
parent | dc0b5a43224999223a246870912b0f292b1980e9 (diff) | |
download | hurd-835b293d35a209d38047126443d41fa7090daa4c.tar.gz hurd-835b293d35a209d38047126443d41fa7090daa4c.tar.bz2 hurd-835b293d35a209d38047126443d41fa7090daa4c.zip |
Use our own variant of 'assert' and 'assert_perror'.
Our variants print stack traces on failures. This will make locating
errors much easier.
Diffstat (limited to 'ext2fs/ext2fs.h')
-rw-r--r-- | ext2fs/ext2fs.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ext2fs/ext2fs.h b/ext2fs/ext2fs.h index 2104dba3..08cb510a 100644 --- a/ext2fs/ext2fs.h +++ b/ext2fs/ext2fs.h @@ -29,7 +29,7 @@ #include <hurd/store.h> #include <hurd/diskfs.h> #include <hurd/ihash.h> -#include <assert.h> +#include <assert-backtrace.h> #include <pthread.h> #include <sys/mman.h> @@ -362,7 +362,7 @@ boffs_ptr (off_t offset) pthread_mutex_lock (&disk_cache_lock); char *ptr = hurd_ihash_find (disk_cache_bptr, block); pthread_mutex_unlock (&disk_cache_lock); - assert (ptr); + assert_backtrace (ptr); ptr += offset % block_size; ext2_debug ("(%lld) = %p", offset, ptr); return ptr; @@ -374,11 +374,11 @@ bptr_offs (void *ptr) { vm_offset_t mem_offset = (char *)ptr - (char *)disk_cache; off_t offset; - assert (mem_offset < disk_cache_size); + assert_backtrace (mem_offset < disk_cache_size); pthread_mutex_lock (&disk_cache_lock); offset = (off_t) disk_cache_info[boffs_block (mem_offset)].block << log2_block_size; - assert (offset || mem_offset < block_size); + assert_backtrace (offset || mem_offset < block_size); offset += mem_offset % block_size; pthread_mutex_unlock (&disk_cache_lock); ext2_debug ("(%p) = %lld", ptr, offset); @@ -481,7 +481,7 @@ record_global_poke (void *ptr) block_t block = boffs_block (bptr_offs (ptr)); void *block_ptr = bptr (block); ext2_debug ("(%p = %p)", ptr, block_ptr); - assert (disk_cache_block_is_ref (block)); + assert_backtrace (disk_cache_block_is_ref (block)); global_block_modified (block); pokel_add (&global_pokel, block_ptr, block_size); } @@ -507,7 +507,7 @@ record_indir_poke (struct node *node, void *ptr) block_t block = boffs_block (bptr_offs (ptr)); void *block_ptr = bptr (block); ext2_debug ("(%llu, %p)", node->cache_id, ptr); - assert (disk_cache_block_is_ref (block)); + assert_backtrace (disk_cache_block_is_ref (block)); global_block_modified (block); pokel_add (&diskfs_node_disknode (node)->indir_pokel, block_ptr, block_size); } |