Ticket #8252: add_debug_profile.patch

File add_debug_profile.patch, 5.9 KB (added by umccullough, 12 years ago)

patch to add debug profile and fix build on 64bit host

  • src/kits/support/BlockCache.cpp

    From f17e669f8c3c99b130f9ab8e441054b719c21cbe Mon Sep 17 00:00:00 2001
    From: Urias McCullough <umccullough@gmail.com>
    Date: Sat, 17 Dec 2011 21:53:31 -0800
    Subject: [PATCH 1/2] Partial fix for DEBUG=1 build on a 64bit host
    
    ---
     src/kits/support/BlockCache.cpp |    8 ++++----
     1 files changed, 4 insertions(+), 4 deletions(-)
    
    diff --git a/src/kits/support/BlockCache.cpp b/src/kits/support/BlockCache.cpp
    index f35308a..b699ff5 100644
    a b BBlockCache::BBlockCache(uint32 blockCount,  
    8383        block->next = fFreeList;
    8484        fFreeList = block;
    8585        DEBUG_ONLY(block->magic1 = MAGIC1);
    86         DEBUG_ONLY(block->magic2 = MAGIC2 + (uint32)block->next);
     86        DEBUG_ONLY(block->magic2 = MAGIC2 + (uint32)(addr_t)block->next);
    8787    }
    8888}
    8989
    BBlockCache::~BBlockCache()  
    9393    fLocker.Lock();
    9494    while (fFreeList) {
    9595        ASSERT(fFreeList->magic1 == MAGIC1);
    96         ASSERT(fFreeList->magic2 == MAGIC2 + (uint32)fFreeList->next);
     96        ASSERT(fFreeList->magic2 == MAGIC2 + (uint32)(addr_t)fFreeList->next);
    9797        void *pointer = fFreeList;
    9898        fFreeList = fFreeList->next;
    9999        DEBUG_ONLY(memset(pointer, 0xCC, sizeof(_FreeBlock)));
    BBlockCache::Get(size_t blockSize)  
    111111    if (blockSize == fBlockSize && fFreeList != 0) {
    112112        // we can take a block from the list
    113113        ASSERT(fFreeList->magic1 == MAGIC1);
    114         ASSERT(fFreeList->magic2 == MAGIC2 + (uint32)fFreeList->next);
     114        ASSERT(fFreeList->magic2 == MAGIC2 + (uint32)(addr_t)fFreeList->next);
    115115        pointer = fFreeList;
    116116        fFreeList = fFreeList->next;
    117117        fFreeBlocks--;
    BBlockCache::Save(void *pointer, size_t blockSize)  
    138138        fFreeList = block;
    139139        fFreeBlocks++;
    140140        DEBUG_ONLY(block->magic1 = MAGIC1);
    141         DEBUG_ONLY(block->magic2 = MAGIC2 + (uint32)block->next);
     141        DEBUG_ONLY(block->magic2 = MAGIC2 + (uint32)(addr_t)block->next);
    142142    } else {
    143143        DEBUG_ONLY(memset(pointer, 0xCC, sizeof(_FreeBlock)));
    144144        fFree(pointer);
  • Jamrules

    -- 
    1.7.4.1
    
    
    From 424bcc84eb9c9b76291e105fbfed1c39b5ca379d Mon Sep 17 00:00:00 2001
    From: Urias McCullough <umccullough@gmail.com>
    Date: Sat, 17 Dec 2011 22:02:39 -0800
    Subject: [PATCH 2/2] Add a debug build profile for use with Buildbot
    
    * DEBUG=1 set by default for entire tree
    * DEBUG=0 set for several subdirectories that gave problems (hint: these
      deserve attention)
    * Debug image size set to 650 MiB which is still a bit tight
    ---
     Jamrules                     |    1 +
     build/jam/DebugBuildProfiles |   45 ++++++++++++++++++++++++++++++++++++++++++
     2 files changed, 46 insertions(+), 0 deletions(-)
     create mode 100644 build/jam/DebugBuildProfiles
    
    diff --git a/Jamrules b/Jamrules
    index 60fb1d5..44543bc 100644
    a b if ! $(HAIKU_IGNORE_USER_BUILD_CONFIG) {  
    7676}
    7777
    7878include [ FDirName $(HAIKU_BUILD_RULES_DIR) ReleaseBuildProfiles ] ;
     79include [ FDirName $(HAIKU_BUILD_RULES_DIR) DebugBuildProfiles ] ;
    7980
    8081# If a build profile was specified on the command line, now is the time to
    8182# check whether it is unknown or one of the default profiles.
  • new file uild/jam/DebugBuildProfiles

    diff --git a/build/jam/DebugBuildProfiles b/build/jam/DebugBuildProfiles
    new file mode 100644
    index 0000000..7c83150
    - +  
     1DefineBuildProfile debug : image : "haiku-debug.image" ;
     2
     3switch $(HAIKU_BUILD_PROFILE) {
     4    case "debug" : {
     5        Echo Building Debug Image ;
     6
     7        # For a debug image the binaries are a little bit larger
     8        HAIKU_IMAGE_SIZE = 650 ;
     9
     10        SetConfigVar DEBUG : HAIKU_TOP : 1 : global ;
     11
     12        # Targets in these subdirectories need some DEBUG love
     13        SetConfigVar DEBUG : HAIKU_TOP src add-ons disk_systems bfs : 0 : local ;
     14        SetConfigVar DEBUG : HAIKU_TOP src add-ons kernel drivers audio hda : 0 : local ;
     15        SetConfigVar DEBUG : HAIKU_TOP src add-ons kernel drivers midi usb_midi : 0 : local ;
     16        SetConfigVar DEBUG : HAIKU_TOP src add-ons kernel file_systems btrfs : 0 : local ;
     17        SetConfigVar DEBUG : HAIKU_TOP src add-ons kernel file_systems ntfs libntfs : 0 : local ;
     18        SetConfigVar DEBUG : HAIKU_TOP src add-ons kernel file_systems udf : 0 : local ;
     19        SetConfigVar DEBUG : HAIKU_TOP src add-ons mail_daemon inbound_protocols pop3 : 0 : local ;
     20        SetConfigVar DEBUG : HAIKU_TOP src add-ons media media-add-ons dvb : 0 : local ;
     21        SetConfigVar DEBUG : HAIKU_TOP src add-ons media media-add-ons opensound : 0 : local ;
     22        SetConfigVar DEBUG : HAIKU_TOP src add-ons media plugins ffmpeg libavcodec : 0 : local ;
     23        SetConfigVar DEBUG : HAIKU_TOP src add-ons media plugins ffmpeg libavcodec x86 : 0 : local ;
     24        SetConfigVar DEBUG : HAIKU_TOP src add-ons media plugins ffmpeg libavformat : 0 : local ;
     25        SetConfigVar DEBUG : HAIKU_TOP src add-ons media plugins ffmpeg libswscale : 0 : local ;
     26        SetConfigVar DEBUG : HAIKU_TOP src add-ons print drivers gutenprint : 0 : local ;
     27        SetConfigVar DEBUG : HAIKU_TOP src apps bsnow : 0 : local ;
     28        SetConfigVar DEBUG : HAIKU_TOP src apps cortex addons AudioAdapter : 0 : local ;
     29        SetConfigVar DEBUG : HAIKU_TOP src apps cortex NodeManager : 0 : local ;
     30        SetConfigVar DEBUG : HAIKU_TOP src apps cortex TransportView : 0 : local ;
     31        SetConfigVar DEBUG : HAIKU_TOP src bin coreutils src : 0 : local ;
     32        SetConfigVar DEBUG : HAIKU_TOP src bin ctags : 0 : local ;
     33        SetConfigVar DEBUG : HAIKU_TOP src bin network tcpdump : 0 : local ;
     34        SetConfigVar DEBUG : HAIKU_TOP src libs print libgutenprint src main : 0 : local ;
     35        SetConfigVar DEBUG : HAIKU_TOP src libs print libprint : 0 : local ;
     36        SetConfigVar DEBUG : HAIKU_TOP src preferences mouse : 0 : local ;
     37        SetConfigVar DEBUG : HAIKU_TOP src servers input : 0 : local ;
     38        SetConfigVar DEBUG : HAIKU_TOP src servers media : 0 : local ;
     39        SetConfigVar DEBUG : HAIKU_TOP src servers media_addon : 0 : local ;
     40        SetConfigVar DEBUG : HAIKU_TOP src servers mount : 0 : local ;
     41        SetConfigVar DEBUG : HAIKU_TOP src system boot loader file_systems bfs : 0 : local ;
     42        SetConfigVar DEBUG : HAIKU_TOP src system boot loader file_systems tarfs : 0 : local ;
     43    }
     44
     45}