VirtualBox

Changeset 16056 in vbox for trunk/src


Ignore:
Timestamp:
Jan 19, 2009 7:19:02 PM (16 years ago)
Author:
vboxsync
Message:

REM: Wrap all printf and fprintf calls like we used to do (and does for VBoxREM2), except when DEBUG_TMP_LOGGING is set. DEBUG_TMP_LOGGING can be used with DEBUG_ALL_LOGGING only to split the log output where some of the qemu logging goes to /tmp/vbox-qemu.log.

Location:
trunk/src/recompiler_new
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/recompiler_new/Makefile.kmk

    r15761 r16056  
    110110$(REM_MOD)_DEFS           += VBOX_WITH_NEW_RECOMPILER
    111111#$(REM_MOD)_DEFS           += DEBUG_ALL_LOGGING DEBUG_DISAS DEBUG_PCALL DEBUG_EXEC DEBUG_FLUSH DEBUG_IOPORT DEBUG_SIGNAL DEBUG_TLB_CHECK DEBUG_TB_INVALIDATE DEBUG_TLB  # Enables huge amounts of debug logging.
     112#$(REM_MOD)_DEFS           += DEBUG_TMP_LOGGING # log qemu parts to "/tmp/vbox-qemu.log" - does not work with VBoxREM2.
    112113$(REM_MOD)_DEFS.linux      = _GNU_SOURCE
    113114ifdef VBOX_SOLARIS_10
     
    125126        $(PATH_ROOT)/src/VBox/VMM       \
    126127        .
     128ifn1of ($($(REM_MOD)_DEFS),DEBUG_TMP_LOGGING)
     129$(REM_MOD)_INCS           <= \
     130        Sun/crt
     131endif
    127132
    128133$(REM_MOD)_SOURCES         =            \
  • trunk/src/recompiler_new/Sun/crt/stdio.h

    r15452 r16056  
    6868#define fprintf(logfile, ...)   LogIt(LOG_INSTANCE, 0, LOG_GROUP_REM_PRINTF, (__VA_ARGS__))
    6969
     70#ifdef DEBUG_TMP_LOGGING
     71# error "DEBUG_TMP_LOGGING doesn't work with the Sun/crt/stdio.h wrapper."
     72#endif
    7073
    7174__END_DECLS
  • trunk/src/recompiler_new/VBoxRecompiler.c

    r15920 r16056  
    390390#ifdef DEBUG_ALL_LOGGING
    391391    loglevel = ~0;
     392# ifdef DEBUG_TMP_LOGGING
    392393    logfile = fopen("/tmp/vbox-qemu.log", "w");
     394# endif
    393395#endif
    394396
     
    29742976 * @param   pTLBEntry   The TLB entry.
    29752977 */
    2976 target_ulong remR3PhysGetPhysicalAddressCode(CPUState*          env, 
    2977                                              target_ulong       addr, 
     2978target_ulong remR3PhysGetPhysicalAddressCode(CPUState*          env,
     2979                                             target_ulong       addr,
    29782980                                             CPUTLBEntry*       pTLBEntry,
    29792981                                             target_phys_addr_t ioTLBEntry)
     
    29832985    if ((ioTLBEntry & ~TARGET_PAGE_MASK) == pVM->rem.s.iHandlerMemType)
    29842986    {
    2985         /* If code memory is being monitored, appropriate IOTLB entry will have 
    2986            handler IO type, and addend will provide real physical address, no 
     2987        /* If code memory is being monitored, appropriate IOTLB entry will have
     2988           handler IO type, and addend will provide real physical address, no
    29872989           matter if we store VA in TLB or not, as handlers are always passed PA */
    29882990        target_ulong ret = (ioTLBEntry & TARGET_PAGE_MASK) + addr;
     
    36773679void disas(FILE *phFile, void *pvCode, unsigned long cb)
    36783680{
    3679 #ifdef DEBUG_ALL_LOGGING
    3680 #define DISAS_PRINTF(x...) fprintf(phFile, x)
     3681#ifdef DEBUG_TMP_LOGGING
     3682# define DISAS_PRINTF(x...) fprintf(phFile, x)
    36813683#else
    3682 #define DISAS_PRINTF(x...) RTLogPrintf(x)
     3684# define DISAS_PRINTF(x...) RTLogPrintf(x)
    36833685    if (LogIs2Enabled())
    36843686#endif
     
    37273729void target_disas(FILE *phFile, target_ulong uCode, target_ulong cb, int fFlags)
    37283730{
    3729 #ifdef DEBUG_ALL_LOGGING
    3730 #define DISAS_PRINTF(x...) fprintf(phFile, x)
     3731#ifdef DEBUG_TMP_LOGGING
     3732# define DISAS_PRINTF(x...) fprintf(phFile, x)
    37313733#else
    3732 #define DISAS_PRINTF(x...) RTLogPrintf(x)
     3734# define DISAS_PRINTF(x...) RTLogPrintf(x)
    37333735    if (LogIs2Enabled())
    37343736#endif
  • trunk/src/recompiler_new/osdep.h

    r14763 r16056  
    3737#define fflush(file)            RTLogFlush(NULL)
    3838#define printf(...)             LogIt(LOG_INSTANCE, 0, LOG_GROUP_REM_PRINTF, (__VA_ARGS__))
    39 /* If DEBUG_ALL_LOGGING - goes to QEMU log file */
    40 #ifndef DEBUG_ALL_LOGGING
    41  #define fprintf(logfile, ...)   LogIt(LOG_INSTANCE, 0, LOG_GROUP_REM_PRINTF, (__VA_ARGS__))
     39/* If DEBUG_TMP_LOGGING - goes to QEMU log file */
     40#ifndef DEBUG_TMP_LOGGING
     41# define fprintf(logfile, ...)  LogIt(LOG_INSTANCE, 0, LOG_GROUP_REM_PRINTF, (__VA_ARGS__))
    4242#endif
    4343
     
    126126#ifdef _MSC_VER
    127127/** @todo: maybe wrong, or slow */
    128 #define REGPARM 
     128#define REGPARM
    129129#else
    130130#define REGPARM __attribute((regparm(3)))
     
    165165#ifdef _MSC_VER
    166166#define ALIGNED_MEMBER(type, name, bytes) type name
    167 #define ALIGNED_MEMBER_DEF(type, name) type name 
     167#define ALIGNED_MEMBER_DEF(type, name) type name
    168168#define PACKED_STRUCT(name) struct name
    169169#define REGISTER_BOUND_GLOBAL(type, var, reg) type var
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette