Initial checkin (and this time I better not be writing over somebody else's

files, damn it! :-)


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3122 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Tyler Dauwalder 2003-04-29 00:26:13 +00:00
parent 3807c90cf1
commit 25b288e0dd
4 changed files with 136 additions and 0 deletions

View File

@ -0,0 +1,85 @@
#ifndef DEBUG_H
#define DEBUG_H
/* Debug - debug stuff
**
** Initial version by Axel Dörfler, axeld@pinc-software.de
** UDF version by Tyler Dauwalder, tyler@dauwalder.net
** This file may be used under the terms of the OpenBeOS License.
*/
#ifdef DEBUG
# include <string.h>
#endif
#ifdef USER
# include <stdio.h>
# define __out printf
#else
# define __out dprintf
#endif
// Which debugger should be used when?
// The DEBUGGER() macro actually has no effect if DEBUG is not defined,
// use the DIE() macro if you really want to die.
#ifdef DEBUG
# ifdef USER
# define DEBUGGER(x) debugger x
# else
# define DEBUGGER(x) kernel_debugger x
# endif
#else
# define DEBUGGER(x) ;
#endif
#ifdef USER
# define DIE(x) debugger x
#else
# define DIE(x) kernel_debugger x
#endif
// Short overview over the debug output macros:
// PRINT()
// is for general messages that very unlikely should appear in a release build
// FATAL()
// this is for fatal messages, when something has really gone wrong
// INFORM()
// general information, as disk size, etc.
// REPORT_ERROR(status_t)
// prints out error information
// RETURN_ERROR(status_t)
// calls REPORT_ERROR() and return the value
// D()
// the statements in D() are only included if DEBUG is defined
#include <KernelExport.h>
#define kprintf printf
#define dprintf printf
#ifdef DEBUG
#define PRINT(x) { __out("udf: "); __out x; }
#define REPORT_ERROR(status) __out("udf: %s:%s:%ld: %s\n", __FILE__, __FUNCTION__, __LINE__, strerror(status));
#define RETURN_ERROR(err) { status_t _status = err; if (_status < B_OK) REPORT_ERROR(_status); return _status;}
#define FATAL(x) { __out("udf: "); __out x; }
#define INFORM(x) { __out("udf: "); __out x; }
#define FUNCTION() __out("udf: %s()\n",__FUNCTION__);
#define FUNCTION_START(x) { __out("udf: %s() ",__FUNCTION__); __out x; }
// #define FUNCTION() ;
// #define FUNCTION_START(x) ;
#define D(x) {x;};
#define ASSERT(x) { if (!(x)) DEBUGGER(("udf: assert failed: " #x "\n")); }
#else
#define PRINT(x) ;
#define REPORT_ERROR(status) ;
#define RETURN_ERROR(status) return status;
#define FATAL(x) { __out("udf: "); __out x; }
#define INFORM(x) { __out("udf: "); __out x; }
#define FUNCTION() ;
#define FUNCTION_START(x) ;
#define D(x) ;
#define ASSERT(x) ;
#endif
#ifdef DEBUG
#endif
#endif /* DEBUG_H */

View File

@ -0,0 +1,31 @@
SubDir OBOS_TOP src tests add-ons kernel file_systems udf udf_shell ;
SubDirHdrs $(OBOS_TOP) src tests add-ons kernel file_systems fs_shell ;
SubDirHdrs $(OBOS_TOP) src add-ons kernel file_systems udf ;
{
local defines = [ FDefines USER DEBUG ] ; # _NO_INLINE_ASM
SubDirCcFlags $(defines) -fno-exceptions -fno-rtti ; #-fcheck-memory-usage
SubDirC++Flags $(defines) -fno-exceptions -fno-rtti ; #-fcheck-memory-usage
}
SimpleTest udf_shell
:
fsh.c rootfs.c initfs.c kernel.c cache.c sl.c stub.c
sysdep.c hexdump.c argv.c
cpp.cpp vfs_interface.cpp
Debug.cpp DiskStructures.cpp Volume.cpp
:
;
# Tell Jam where to find these sources
SEARCH on [ FGristFiles
cpp.cpp vfs_interface.cpp
Debug.cpp DiskStructures.cpp Volume.cpp
] = [ FDirName $(OBOS_TOP) src add-ons kernel file_systems udf ] ;
SEARCH on [ FGristFiles
fsh.c rootfs.c initfs.c kernel.c cache.c sl.c stub.c
sysdep.c hexdump.c argv.c
] = [ FDirName $(OBOS_TOP) src tests add-ons kernel file_systems fs_shell ] ;

View File

@ -0,0 +1,12 @@
/* This file is included in fs_shell:fsh.c
* Insert your implementation of additional commands in here
*
* Format:
*
* static void
* function(int argc, char **argv)
* {
* }
*
*/

View File

@ -0,0 +1,8 @@
/* This file is included in fs_shell:fsh.c
* Insert your definition of additional commands here
*
* Format:
* { commandName, functionName, commandDescription },
*
* And don't forget the comma after the line :-)
*/