Removed category stuff from UdfDebug.h since it ended
up not being as useful as I'd hoped, and I need to use the same debugging macros for makeudfimage as for udf. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5544 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -48,7 +48,7 @@ public:
|
||||
, fDescriptorNumber(0)
|
||||
, fBlockIndex(0)
|
||||
{
|
||||
DEBUG_INIT(CF_PUBLIC | CF_FILE_OPS | CF_HIGH_VOLUME, "AllocationDescriptorList<>");
|
||||
DEBUG_INIT("AllocationDescriptorList<>");
|
||||
_WalkContinuationChain(_CurrentDescriptor());
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
and thus its contents should be interpreted as all zeros.
|
||||
*/
|
||||
status_t FindExtent(off_t start, long_address *extent, bool *isEmpty) {
|
||||
DEBUG_INIT_ETC(CF_PUBLIC | CF_FILE_OPS | CF_HIGH_VOLUME, "AllocationDescriptorList<>",
|
||||
DEBUG_INIT_ETC("AllocationDescriptorList<>",
|
||||
("start: %Ld, extent: %p, isEmpty: %p", start, extent, isEmpty));
|
||||
off_t startBlock = start >> fVolume->BlockShift();
|
||||
|
||||
@@ -102,7 +102,7 @@ public:
|
||||
private:
|
||||
|
||||
Descriptor* _CurrentDescriptor() const {
|
||||
DEBUG_INIT(CF_PUBLIC | CF_FILE_OPS | CF_HIGH_VOLUME, "AllocationDescriptorList<>");
|
||||
DEBUG_INIT("AllocationDescriptorList<>");
|
||||
PRINT(("(_DescriptorIndex()+1)*sizeof(Descriptor) = %ld\n", (_DescriptorIndex()+1)*sizeof(Descriptor)));
|
||||
PRINT(("_DescriptorArraySize() = %ld\n", _DescriptorArraySize()));
|
||||
PRINT(("_DescriptorArray() = %p\n", _DescriptorArray()));
|
||||
@@ -112,7 +112,7 @@ private:
|
||||
}
|
||||
|
||||
status_t _MoveToNextDescriptor() {
|
||||
DEBUG_INIT(CF_PRIVATE | CF_HIGH_VOLUME, "AllocationDescriptorList<>");
|
||||
DEBUG_INIT("AllocationDescriptorList<>");
|
||||
|
||||
Descriptor* descriptor = _CurrentDescriptor();
|
||||
if (!descriptor) {
|
||||
@@ -142,7 +142,7 @@ private:
|
||||
}
|
||||
|
||||
void _WalkContinuationChain(Descriptor *descriptor) {
|
||||
DEBUG_INIT_ETC(CF_PUBLIC | CF_FILE_OPS | CF_HIGH_VOLUME, "AllocationDescriptorList<>",
|
||||
DEBUG_INIT_ETC("AllocationDescriptorList<>",
|
||||
("descriptor: %p", descriptor));
|
||||
if (descriptor && fAccessor.GetType(*descriptor) == EXTENT_TYPE_CONTINUATION) {
|
||||
// Load the new block, make sure we're not trying
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "kernel_cpp.h"
|
||||
|
||||
#include "SupportDefs.h"
|
||||
#include "UdfDebug.h"
|
||||
|
||||
namespace Udf {
|
||||
|
||||
@@ -48,7 +49,7 @@ struct array<uint8, arrayLength> {
|
||||
char classname[40];
|
||||
sprintf(classname, "array<uint8, %ld>", arrayLength);
|
||||
|
||||
DUMP_INIT(CF_PUBLIC | CF_DUMP | CF_HIGH_VOLUME, classname);
|
||||
DUMP_INIT(classname);
|
||||
|
||||
for (uint32 i = 0; i < arrayLength; i++) {
|
||||
if (i % bytesPerRow == 0)
|
||||
@@ -71,7 +72,7 @@ struct array<char, arrayLength> {
|
||||
char classname[40];
|
||||
sprintf(classname, "array<uint8, %ld>", arrayLength);
|
||||
|
||||
DUMP_INIT(CF_PUBLIC | CF_DUMP | CF_HIGH_VOLUME, classname);
|
||||
DUMP_INIT(classname);
|
||||
|
||||
for (uint32 i = 0; i < arrayLength; i++) {
|
||||
if (i % bytesPerRow == 0)
|
||||
|
||||
@@ -49,7 +49,7 @@ CS0String::CS0String(const char *cs0, uint32 length)
|
||||
|
||||
CS0String::~CS0String()
|
||||
{
|
||||
DEBUG_INIT(CF_HELPER | CF_HIGH_VOLUME, "CS0String");
|
||||
DEBUG_INIT("CS0String");
|
||||
|
||||
_Clear();
|
||||
}
|
||||
@@ -63,7 +63,7 @@ CS0String::SetTo(const char *cs0)
|
||||
void
|
||||
CS0String::SetTo(const char *cs0, uint32 length)
|
||||
{
|
||||
DEBUG_INIT(CF_HELPER | CF_HIGH_VOLUME, "CS0String");
|
||||
DEBUG_INIT("CS0String");
|
||||
|
||||
_Clear();
|
||||
|
||||
@@ -125,7 +125,7 @@ CS0String::SetTo(const char *cs0, uint32 length)
|
||||
void
|
||||
CS0String::_Clear()
|
||||
{
|
||||
DEBUG_INIT(CF_HELPER | CF_HIGH_VOLUME, "CS0String");
|
||||
DEBUG_INIT("CS0String");
|
||||
|
||||
delete [] fUtf8String;
|
||||
fUtf8String = NULL;
|
||||
|
||||
@@ -54,7 +54,7 @@ template <uint32 length>
|
||||
CS0String::CS0String(const array<char, length> &cs0)
|
||||
: fUtf8String(NULL)
|
||||
{
|
||||
DEBUG_INIT(CF_HELPER | CF_HIGH_VOLUME, "CS0String");
|
||||
DEBUG_INIT("CS0String");
|
||||
|
||||
SetTo(cs0);
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ CachedBlock::Keep()
|
||||
inline void
|
||||
CachedBlock::Unset()
|
||||
{
|
||||
DEBUG_INIT(CF_HIGH_VOLUME | CF_PUBLIC, "CachedBlock");
|
||||
DEBUG_INIT("CachedBlock");
|
||||
if (fBlock) {
|
||||
PRINT(("releasing block #%Ld\n", BlockNumber()));
|
||||
release_block(fVolume->Device(), fBlockNumber);
|
||||
@@ -116,7 +116,7 @@ CachedBlock::Unset()
|
||||
inline uint8 *
|
||||
CachedBlock::SetTo(off_t block, bool empty = false)
|
||||
{
|
||||
DEBUG_INIT_ETC(CF_HIGH_VOLUME | CF_PUBLIC, "CachedBlock", ("block: %Ld, empty: %s",
|
||||
DEBUG_INIT_ETC("CachedBlock", ("block: %Ld, empty: %s",
|
||||
block, (empty ? "true" : "false")));
|
||||
Unset();
|
||||
fBlockNumber = block;
|
||||
|
||||
@@ -23,7 +23,7 @@ using namespace Udf;
|
||||
status_t
|
||||
DirectoryIterator::GetNextEntry(char *name, uint32 *length, vnode_id *id)
|
||||
{
|
||||
DEBUG_INIT_ETC(CF_PUBLIC | CF_DIRECTORY_OPS, "DirectoryIterator",
|
||||
DEBUG_INIT_ETC("DirectoryIterator",
|
||||
("name: %p, length: %p, id: %p", name, length, id));
|
||||
|
||||
if (!id || !name || !length)
|
||||
|
||||
@@ -23,7 +23,7 @@ Icb::Icb(Volume *volume, long_address address)
|
||||
, fFileEntry(&fData)
|
||||
, fExtendedEntry(&fData)
|
||||
{
|
||||
DEBUG_INIT_ETC(CF_PUBLIC, "Icb", ("volume: %p, address(block: %ld, "
|
||||
DEBUG_INIT_ETC("Icb", ("volume: %p, address(block: %ld, "
|
||||
"partition: %d, length: %ld)", volume, address.block(),
|
||||
address.partition(), address.length()));
|
||||
status_t error = volume ? B_OK : B_BAD_VALUE;
|
||||
@@ -60,7 +60,7 @@ Icb::ModificationTime()
|
||||
status_t
|
||||
Icb::Read(off_t pos, void *buffer, size_t *length, uint32 *block)
|
||||
{
|
||||
DEBUG_INIT_ETC(CF_PUBLIC | CF_HIGH_VOLUME, "Icb",
|
||||
DEBUG_INIT_ETC("Icb",
|
||||
("pos: %Ld, buffer: %p, length: (%p)->%ld", pos, buffer, length, (length ? *length : 0)));
|
||||
|
||||
if (!buffer || !length || pos < 0)
|
||||
@@ -127,7 +127,7 @@ Icb::GetDirectoryIterator(DirectoryIterator **iterator)
|
||||
status_t
|
||||
Icb::Find(const char *filename, vnode_id *id)
|
||||
{
|
||||
DEBUG_INIT_ETC(CF_PUBLIC | CF_DIRECTORY_OPS | CF_HIGH_VOLUME, "Icb",
|
||||
DEBUG_INIT_ETC("Icb",
|
||||
("filename: `%s', id: %p", filename, id));
|
||||
|
||||
if (!filename || !id)
|
||||
|
||||
@@ -97,7 +97,7 @@ private:
|
||||
descriptor_tag & Tag() { return (reinterpret_cast<icb_header*>(fData.Block()))->tag(); }
|
||||
icb_entry_tag& IcbTag() { return (reinterpret_cast<icb_header*>(fData.Block()))->icb_tag(); }
|
||||
AbstractFileEntry* AbstractEntry() {
|
||||
DEBUG_INIT(CF_PRIVATE | CF_HIGH_VOLUME, "Icb");
|
||||
DEBUG_INIT("Icb");
|
||||
return (Tag().id() == TAGID_EXTENDED_FILE_ENTRY)
|
||||
// ? reinterpret_cast<extended_file_icb_entry*>(fData.Block())
|
||||
// : reinterpret_cast<file_icb_entry*>(fData.Block()));
|
||||
@@ -128,7 +128,7 @@ template <class DescriptorList>
|
||||
status_t
|
||||
Icb::_Read(DescriptorList &list, off_t pos, void *_buffer, size_t *length, uint32 *block)
|
||||
{
|
||||
DEBUG_INIT_ETC(CF_PRIVATE | CF_HIGH_VOLUME, "Icb", ("list: %p, pos: %Ld, buffer: %p, length: (%p)->%ld",
|
||||
DEBUG_INIT_ETC("Icb", ("list: %p, pos: %Ld, buffer: %p, length: (%p)->%ld",
|
||||
&list, pos, _buffer, length, (length ? *length : 0)));
|
||||
if (!_buffer || !length)
|
||||
RETURN(B_BAD_VALUE);
|
||||
|
||||
@@ -27,7 +27,7 @@ PhysicalPartition::~PhysicalPartition()
|
||||
status_t
|
||||
PhysicalPartition::MapBlock(uint32 logicalBlock, off_t &physicalBlock)
|
||||
{
|
||||
DEBUG_INIT_ETC(CF_PUBLIC, "PhysicalPartition", ("%ld", logicalBlock));
|
||||
DEBUG_INIT_ETC("PhysicalPartition", ("%ld", logicalBlock));
|
||||
if (logicalBlock >= fLength)
|
||||
return B_BAD_ADDRESS;
|
||||
else {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "CS0String.h"
|
||||
#include "MemoryChunk.h"
|
||||
#include "Utils.h"
|
||||
|
||||
using namespace Udf;
|
||||
|
||||
@@ -36,7 +37,7 @@ Udf::udf_recognize(int device, off_t offset, off_t length, uint32 blockSize,
|
||||
partition_descriptor partitionDescriptors[],
|
||||
uint8 &partitionDescriptorCount)
|
||||
{
|
||||
DEBUG_INIT_ETC(CF_PRIVATE, NULL, ("device: %d, offset: %Ld, length: %Ld, "
|
||||
DEBUG_INIT_ETC(NULL, ("device: %d, offset: %Ld, length: %Ld, "
|
||||
"blockSize: %ld, [...descriptors, etc...]", device, offset,
|
||||
length, blockSize));
|
||||
|
||||
@@ -68,7 +69,7 @@ status_t
|
||||
Udf::udf_recognize(int device, off_t offset, off_t length, uint32 blockSize,
|
||||
char *volumeName)
|
||||
{
|
||||
DEBUG_INIT_ETC(CF_PRIVATE, NULL, ("device: %d, offset: %Ld, length: %Ld, "
|
||||
DEBUG_INIT_ETC(NULL, ("device: %d, offset: %Ld, length: %Ld, "
|
||||
"blockSize: %ld, volumeName: %p", device, offset, length,
|
||||
blockSize, volumeName));
|
||||
logical_volume_descriptor logicalVolumeDescriptor;
|
||||
@@ -93,7 +94,7 @@ static
|
||||
status_t
|
||||
walk_volume_recognition_sequence(int device, off_t offset, uint32 blockSize, uint32 blockShift)
|
||||
{
|
||||
DEBUG_INIT(CF_PRIVATE, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
// vrs starts at block 16. Each volume structure descriptor (vsd)
|
||||
// should be one block long. We're expecting to find 0 or more iso9660
|
||||
// vsd's followed by some ECMA-167 vsd's.
|
||||
@@ -163,7 +164,7 @@ walk_anchor_volume_descriptor_sequences(int device, off_t offset, off_t length,
|
||||
partition_descriptor partitionDescriptors[],
|
||||
uint8 &partitionDescriptorCount)
|
||||
{
|
||||
DEBUG_INIT(CF_PRIVATE, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
const uint8 avds_location_count = 4;
|
||||
const off_t avds_locations[avds_location_count] = {
|
||||
256,
|
||||
@@ -234,7 +235,7 @@ walk_volume_descriptor_sequence(extent_address descriptorSequence,
|
||||
partition_descriptor partitionDescriptors[],
|
||||
uint8 &partitionDescriptorCount)
|
||||
{
|
||||
DEBUG_INIT_ETC(CF_PRIVATE, NULL, ("descriptorSequence.loc:%ld, descriptorSequence.len:%ld",
|
||||
DEBUG_INIT_ETC(NULL, ("descriptorSequence.loc:%ld, descriptorSequence.len:%ld",
|
||||
descriptorSequence.location(), descriptorSequence.length()));
|
||||
uint32 count = descriptorSequence.length() >> blockShift;
|
||||
|
||||
|
||||
@@ -2,24 +2,25 @@
|
||||
// This software is part of the OpenBeOS distribution and is covered
|
||||
// by the OpenBeOS license.
|
||||
//
|
||||
// UDF version copyright (c) 2003 Tyler Dauwalder, [email protected]
|
||||
// This version copyright (c) 2003 Tyler Dauwalder, [email protected]
|
||||
// Initial version copyright (c) 2002 Axel Dörfler, [email protected]
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
/*! \file UdfDebug.cpp
|
||||
/*! \file Debug.cpp
|
||||
|
||||
Support code for handy debugging macros.
|
||||
*/
|
||||
|
||||
#include "UdfDebug.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <KernelExport.h>
|
||||
#include <TLS.h>
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Long-winded overview of the debug output macros:
|
||||
//----------------------------------------------------------------------
|
||||
/*! \def DEBUG_INIT(categoryFilter)
|
||||
/*! \def DEBUG_INIT()
|
||||
\brief Increases the indentation level, prints out the enclosing function's
|
||||
name, and creates a \c DebugHelper object on the stack to automatically
|
||||
decrease the indentation level upon function exit.
|
||||
@@ -27,13 +28,7 @@
|
||||
This macro should be called at the very beginning of any function in
|
||||
which you wish to use any of the other debugging macros.
|
||||
|
||||
\param categoryFilter Combination of _DebugCategoryFlags values specifying
|
||||
the category of the enclosing function.
|
||||
|
||||
If DEBUG is undefined, does nothing.
|
||||
|
||||
\note If the enclosing function's category flags are not part of the currently
|
||||
defined CATEGORY_FILTER, printing will be suppressed.
|
||||
*/
|
||||
//----------------------------------------------------------------------
|
||||
/*! \def PRINT(x)
|
||||
@@ -44,9 +39,6 @@
|
||||
e.g. PRINT(("%d\n", 0));
|
||||
|
||||
If DEBUG is undefined, does nothing.
|
||||
|
||||
\note If the enclosing function's category flags are not part of the currently
|
||||
defined CATEGORY_FILTER, printing will be suppressed.
|
||||
*/
|
||||
//----------------------------------------------------------------------
|
||||
/*! \def LPRINT(x)
|
||||
@@ -57,9 +49,6 @@
|
||||
e.g. PRINT(("%d\n", 0));
|
||||
|
||||
If DEBUG is undefined, does nothing.
|
||||
|
||||
\note If the enclosing function's category flags are not part of the currently
|
||||
defined CATEGORY_FILTER, printing will be suppressed.
|
||||
*/
|
||||
//----------------------------------------------------------------------
|
||||
/*! \def SIMPLE_PRINT(x)
|
||||
@@ -70,9 +59,6 @@
|
||||
e.g. PRINT(("%d\n", 0));
|
||||
|
||||
If DEBUG is undefined, does nothing.
|
||||
|
||||
\note If the enclosing function's category flags are not part of the currently
|
||||
defined CATEGORY_FILTER, printing will be suppressed.
|
||||
*/
|
||||
//----------------------------------------------------------------------
|
||||
/*! \def PRINT_INDENT()
|
||||
@@ -84,9 +70,6 @@
|
||||
intended for general consumption, but you might find it useful.
|
||||
|
||||
If DEBUG is undefined, does nothing.
|
||||
|
||||
\note If the enclosing function's category flags are not part of the currently
|
||||
defined CATEGORY_FILTER, printing will be suppressed.
|
||||
*/
|
||||
//----------------------------------------------------------------------
|
||||
/*! \def REPORT_ERROR(error)
|
||||
@@ -100,9 +83,6 @@
|
||||
\param error A \c status_t error code to report.
|
||||
|
||||
If DEBUG is undefined, does nothing.
|
||||
|
||||
\note If the enclosing function's category flags are not part of the currently
|
||||
defined CATEGORY_FILTER, printing will be suppressed.
|
||||
*/
|
||||
//----------------------------------------------------------------------
|
||||
/*! \def RETURN_ERROR(error)
|
||||
@@ -113,9 +93,6 @@
|
||||
\param error A \c status_t error code to report (if negative) and return.
|
||||
|
||||
If DEBUG is undefined, silently returns the value in \c error.
|
||||
|
||||
\note If the enclosing function's category flags are not part of the currently
|
||||
defined CATEGORY_FILTER, printing will be suppressed.
|
||||
*/
|
||||
//----------------------------------------------------------------------
|
||||
/*! \def RETURN(error)
|
||||
@@ -126,9 +103,6 @@
|
||||
\param error A \c status_t error code to report and return.
|
||||
|
||||
If DEBUG is undefined, silently returns the value in \c error.
|
||||
|
||||
\note If the enclosing function's category flags are not part of the currently
|
||||
defined CATEGORY_FILTER, printing will be suppressed.
|
||||
*/
|
||||
//----------------------------------------------------------------------
|
||||
/*! \def FATAL(x)
|
||||
@@ -140,8 +114,6 @@
|
||||
e.g. PRINT(("%d\n", 0));
|
||||
|
||||
If DEBUG is undefined, does nothing.
|
||||
|
||||
\note Category flags have no effect on this macro.
|
||||
*/
|
||||
//----------------------------------------------------------------------
|
||||
/*! \def INFORM(x)
|
||||
@@ -154,8 +126,6 @@
|
||||
|
||||
I'll say it again: Prints its output regardless to DEBUG being defined or
|
||||
undefined.
|
||||
|
||||
\note Category flags have no effect on this macro.
|
||||
*/
|
||||
//----------------------------------------------------------------------
|
||||
/*! \def DBG(x)
|
||||
@@ -164,8 +134,6 @@
|
||||
\a x disappear into the ether.
|
||||
|
||||
\param x Damn near anything resembling valid C\C++.
|
||||
|
||||
\note Category flags have no effect on this macro.
|
||||
*/
|
||||
//----------------------------------------------------------------------
|
||||
/*! \def DIE(x)
|
||||
@@ -336,7 +304,7 @@ dbg_printf(const char *format,...)
|
||||
char buffer[1024];
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
// no vsnprintf() on PPC and in kernel
|
||||
// no vsnprintf() on PPC
|
||||
#if defined(__INTEL__) && USER
|
||||
vsnprintf(buffer, sizeof(buffer) - 1, format, args);
|
||||
#else
|
||||
@@ -354,13 +322,11 @@ dbg_printf(const char *format,...)
|
||||
|
||||
/*! \brief Increases the current indentation level.
|
||||
*/
|
||||
DebugHelper::DebugHelper(uint32 categoryFlags, const char *className, uint8 tabCount)
|
||||
: fCategoryFlags(categoryFlags)
|
||||
, fTabCount(tabCount)
|
||||
DebugHelper::DebugHelper(const char *className, uint8 tabCount)
|
||||
: fTabCount(tabCount)
|
||||
, fClassName(NULL)
|
||||
{
|
||||
if ((CategoryFlags() & CATEGORY_FILTER) == CategoryFlags())
|
||||
indent(fTabCount);
|
||||
indent(fTabCount);
|
||||
if (className) {
|
||||
fClassName = (char*)malloc(strlen(className)+1);
|
||||
if (fClassName)
|
||||
@@ -372,8 +338,7 @@ DebugHelper::DebugHelper(uint32 categoryFlags, const char *className, uint8 tabC
|
||||
*/
|
||||
DebugHelper::~DebugHelper()
|
||||
{
|
||||
if ((CategoryFlags() & CATEGORY_FILTER) == CategoryFlags())
|
||||
unindent(fTabCount);
|
||||
unindent(fTabCount);
|
||||
free(fClassName);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
// This software is part of the OpenBeOS distribution and is covered
|
||||
// by the OpenBeOS license.
|
||||
//
|
||||
// UDF version copyright (c) 2003 Tyler Dauwalder, [email protected]
|
||||
// This version copyright (c) 2003 Tyler Dauwalder, [email protected]
|
||||
// Initial version copyright (c) 2002 Axel Dörfler, [email protected]
|
||||
// dbg_printf() function copyright (c) 2003 Ingo Weinhold, [email protected]
|
||||
//----------------------------------------------------------------------
|
||||
#ifndef UDF_DEBUG_H
|
||||
#define UDF_DEBUG_H
|
||||
#ifndef _UDF_DEBUG_H
|
||||
#define _UDF_DEBUG_H
|
||||
|
||||
/*! \file UdfDebug.h
|
||||
/*! \file Debug.h
|
||||
|
||||
Handy debugging macros.
|
||||
*/
|
||||
@@ -31,13 +31,9 @@
|
||||
void dbg_printf(const char *format,...);
|
||||
void initialize_debugger(const char *filename);
|
||||
#else
|
||||
# ifdef USER
|
||||
# include <stdio.h>
|
||||
# define __out printf
|
||||
# else
|
||||
# include <null.h>
|
||||
# define __out dprintf
|
||||
# endif
|
||||
# include <stdio.h>
|
||||
# include <malloc.h>
|
||||
# define __out printf
|
||||
#endif
|
||||
|
||||
#include "kernel_cpp.h"
|
||||
@@ -46,80 +42,28 @@ class DebugHelper;
|
||||
|
||||
int32 _get_debug_indent_level();
|
||||
|
||||
/*! \brief Categories specifiable via the categoryFlags parameter to DEBUG_INIT()
|
||||
*/
|
||||
enum _DebugCategoryFlags {
|
||||
// Function visibility categories
|
||||
CF_ENTRY = 0x00000001, //!< fs entry functions
|
||||
CF_PUBLIC = 0x00000002, //!< public methods and global functions
|
||||
CF_PRIVATE = 0x00000004, //!< private methods
|
||||
|
||||
// Function type categories
|
||||
CF_VOLUME_OPS = 0x00000008,
|
||||
CF_FILE_OPS = 0x00000010,
|
||||
CF_DIRECTORY_OPS = 0x00000020,
|
||||
CF_ATTRIBUTE_OPS = 0x00000040,
|
||||
CF_INDEX_OPS = 0x00000080,
|
||||
CF_QUERY_OPS = 0x00000100,
|
||||
|
||||
|
||||
// Misc categories
|
||||
CF_HIGH_VOLUME = 0x00000200, //!< often-called functions
|
||||
CF_HELPER = 0x00000400, //!< helper functions and classes (i.e. Array, CS0String, etc.)
|
||||
CF_DEBUGGING = 0x00000800, //!< internal debugging functions
|
||||
CF_DUMP = 0x00001000, //!< dump() functions
|
||||
|
||||
// Specific entry functions
|
||||
CF_UDF_READ_FS_STAT = 0x00002000,
|
||||
CF_UDF_READ = 0x00004000,
|
||||
|
||||
//-------------------------------
|
||||
|
||||
// Handy combinations
|
||||
CF_ALL = 0xffffffff,
|
||||
CF_ALL_LOW_VOLUME = ~CF_HIGH_VOLUME,
|
||||
|
||||
CF_ANY_VISIBILITY = 0x00000007,
|
||||
CF_ANY_OP = 0x000001f8,
|
||||
CF_ALL_STANDARD = CF_ANY_VISIBILITY | CF_ANY_OP,
|
||||
};
|
||||
|
||||
/*! \def CATEGORY_FILTER
|
||||
\brief Bitmask of currently enabled debugging categories.
|
||||
*/
|
||||
#define CATEGORY_FILTER CF_ALL
|
||||
//#define CATEGORY_FILTER ~CF_DIRECTORY_OPS & ~CF_HIGH_VOLUME & ~CF_HELPER
|
||||
//#define CATEGORY_FILTER CF_UDF_READ
|
||||
//#define CATEGORY_FILTER ~CF_DUMP
|
||||
//#define CATEGORY_FILTER ~CF_DUMP & ~CF_HIGH_VOLUME
|
||||
//#define CATEGORY_FILTER CF_ALL_STANDARD
|
||||
//#define CATEGORY_FILTER CF_ENTRY
|
||||
//#define CATEGORY_FILTER (CF_ENTRY | CF_PUBLIC)
|
||||
//#define CATEGORY_FILTER (CF_ENTRY | CF_PUBLIC | CF_PRIVATE)
|
||||
//#define CATEGORY_FILTER (CF_ENTRY | CF_PUBLIC | CF_PRIVATE | CF_HIGH_VOLUME)
|
||||
|
||||
/*! \brief Helper class that is allocated on the stack by
|
||||
the \c DEBUG_INIT() macro. On creation, it increases the
|
||||
current indentation level by 1; on destruction, it decreases
|
||||
it by 1.
|
||||
current indentation level by the amount specified via its
|
||||
constructor's \c tabCount parameter; on destruction, it
|
||||
decreases it.
|
||||
*/
|
||||
class DebugHelper
|
||||
{
|
||||
public:
|
||||
DebugHelper(uint32 categoryFlags, const char *className = NULL, uint8 tabCount = 1);
|
||||
DebugHelper(const char *className = NULL, uint8 tabCount = 1);
|
||||
~DebugHelper();
|
||||
|
||||
uint32 CategoryFlags() const { return fCategoryFlags; }
|
||||
uint8 TabCount() const { return fTabCount; }
|
||||
const char* ClassName() const { return fClassName; }
|
||||
|
||||
private:
|
||||
uint32 fCategoryFlags;
|
||||
uint8 fTabCount;
|
||||
char *fClassName;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// NOTE: See UdfDebug.cpp for complete descriptions of the following
|
||||
// NOTE: See Debug.cpp for complete descriptions of the following
|
||||
// debug macros.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
@@ -144,57 +88,51 @@ private:
|
||||
#define INITIALIZE_DEBUGGING_OUTPUT_FILE(filename) ;
|
||||
#endif
|
||||
|
||||
#define DEBUG_INIT_SILENT(categoryFlags, className) \
|
||||
DebugHelper _debugHelper((categoryFlags), className, 2);
|
||||
#define DEBUG_INIT_SILENT(className) \
|
||||
DebugHelper _debugHelper(className, 2);
|
||||
|
||||
#define DEBUG_INIT(categoryFlags, className) \
|
||||
DEBUG_INIT_SILENT(categoryFlags, className); \
|
||||
#define DEBUG_INIT(className) \
|
||||
DEBUG_INIT_SILENT(className); \
|
||||
PRINT(("\n"));
|
||||
|
||||
#define DEBUG_INIT_ETC(categoryFlags, className, arguments) \
|
||||
DEBUG_INIT_SILENT(categoryFlags, className) \
|
||||
if ((_debugHelper.CategoryFlags() & CATEGORY_FILTER) \
|
||||
== _debugHelper.CategoryFlags()) \
|
||||
#define DEBUG_INIT_ETC(className, arguments) \
|
||||
DEBUG_INIT_SILENT(className) \
|
||||
{ \
|
||||
PRINT_INDENT(); \
|
||||
if (_debugHelper.ClassName()) { \
|
||||
__out("udf(%ld): %s::%s(", find_thread(NULL), \
|
||||
__out("udf: %s::%s(", \
|
||||
_debugHelper.ClassName(), __FUNCTION__); \
|
||||
} else { \
|
||||
__out("udf(%ld): %s(", find_thread(NULL), __FUNCTION__); \
|
||||
__out("udf: %s(", __FUNCTION__); \
|
||||
} \
|
||||
__out arguments; \
|
||||
__out("):\n"); \
|
||||
}
|
||||
|
||||
#define DUMP_INIT(categoryFlags, className) \
|
||||
DEBUG_INIT_SILENT((categoryFlags) | CF_DUMP , className);
|
||||
#define DUMP_INIT(className) \
|
||||
DEBUG_INIT_SILENT(className);
|
||||
|
||||
#define PRINT(x) { \
|
||||
if ((_debugHelper.CategoryFlags() & CATEGORY_FILTER) \
|
||||
== _debugHelper.CategoryFlags()) \
|
||||
{ \
|
||||
PRINT_INDENT(); \
|
||||
if (_debugHelper.ClassName()) { \
|
||||
__out("udf(%ld): %s::%s(): ", find_thread(NULL), \
|
||||
__out("udf: %s::%s(): ", \
|
||||
_debugHelper.ClassName(), __FUNCTION__); \
|
||||
} else { \
|
||||
__out("udf(%ld): %s(): ", find_thread(NULL), __FUNCTION__); \
|
||||
__out("udf: %s(): ", __FUNCTION__); \
|
||||
} \
|
||||
__out x; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define LPRINT(x) { \
|
||||
if ((_debugHelper.CategoryFlags() & CATEGORY_FILTER) \
|
||||
== _debugHelper.CategoryFlags()) \
|
||||
{ \
|
||||
PRINT_INDENT(); \
|
||||
if (_debugHelper.ClassName()) { \
|
||||
__out("udf(%ld): %s::%s(): line %d: ", find_thread(NULL), \
|
||||
__out("udf: %s::%s(): line %d: ", \
|
||||
_debugHelper.ClassName(), __FUNCTION__, __LINE__); \
|
||||
} else { \
|
||||
__out("udf(%ld): %s(): line %d: ", find_thread(NULL), \
|
||||
__out("udf: %s(): line %d: ", \
|
||||
__FUNCTION__, __LINE__); \
|
||||
} \
|
||||
__out x; \
|
||||
@@ -202,19 +140,15 @@ private:
|
||||
}
|
||||
|
||||
#define SIMPLE_PRINT(x) { \
|
||||
if ((_debugHelper.CategoryFlags() & CATEGORY_FILTER) \
|
||||
== _debugHelper.CategoryFlags()) \
|
||||
{ \
|
||||
__out x; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define PRINT_INDENT() { \
|
||||
if ((_debugHelper.CategoryFlags() & CATEGORY_FILTER) \
|
||||
== _debugHelper.CategoryFlags()) \
|
||||
{ \
|
||||
int32 _level = _get_debug_indent_level(); \
|
||||
for (int32 i = 0; i < _level-1; i++) { \
|
||||
for (int32 i = 0; i < _level-_debugHelper.TabCount(); i++) { \
|
||||
__out(" "); \
|
||||
} \
|
||||
} \
|
||||
@@ -224,18 +158,14 @@ private:
|
||||
PRINT_INDENT(); \
|
||||
SIMPLE_PRINT(("------------------------------------------------------------\n"));
|
||||
|
||||
#define DUMP(object) \
|
||||
if ((_debugHelper.CategoryFlags() & CATEGORY_FILTER) \
|
||||
== _debugHelper.CategoryFlags()) \
|
||||
{ \
|
||||
(object).dump(); \
|
||||
#define DUMP(object) \
|
||||
{ \
|
||||
(object).dump(); \
|
||||
}
|
||||
|
||||
#define PDUMP(objectPointer) \
|
||||
if ((_debugHelper.CategoryFlags() & CATEGORY_FILTER) \
|
||||
== _debugHelper.CategoryFlags()) \
|
||||
{ \
|
||||
(objectPointer)->dump(); \
|
||||
#define PDUMP(objectPointer) \
|
||||
{ \
|
||||
(objectPointer)->dump(); \
|
||||
}
|
||||
|
||||
#define REPORT_ERROR(error) { \
|
||||
@@ -249,7 +179,7 @@ private:
|
||||
return _status; \
|
||||
}
|
||||
|
||||
#define RETURN(error) { \
|
||||
#define RETURN(error) { \
|
||||
status_t _status = error; \
|
||||
if (_status < (status_t)B_OK) { \
|
||||
REPORT_ERROR(_status); \
|
||||
@@ -269,10 +199,10 @@ private:
|
||||
|
||||
#else // ifdef DEBUG
|
||||
#define INITIALIZE_DEBUGGING_OUTPUT_FILE(filename) ;
|
||||
#define DEBUG_INIT_SILENT(categoryFlags, className) ;
|
||||
#define DEBUG_INIT(categoryFlags, className) ;
|
||||
#define DEBUG_INIT_ETC(categoryFlags, className, arguments) ;
|
||||
#define DUMP_INIT(categoryFlags, className) ;
|
||||
#define DEBUG_INIT_SILENT(className) ;
|
||||
#define DEBUG_INIT(className) ;
|
||||
#define DEBUG_INIT_ETC(className, arguments) ;
|
||||
#define DUMP_INIT(className) ;
|
||||
#define PRINT(x) ;
|
||||
#define LPRINT(x) ;
|
||||
#define SIMPLE_PRINT(x) ;
|
||||
@@ -288,4 +218,12 @@ private:
|
||||
#define DUMP(x) ;
|
||||
#endif // ifdef DEBUG else
|
||||
|
||||
#endif // DEBUG_H
|
||||
#define TRACE(x) DBG(dprintf x)
|
||||
|
||||
// These macros turn on or off extensive and generally unnecessary
|
||||
// debugging output regarding table of contents parsing
|
||||
//#define WARN(x) (dprintf x)
|
||||
//#define WARN(x)
|
||||
#define WARN(x) DBG(dprintf x)
|
||||
|
||||
#endif // _UDF_DEBUG_H
|
||||
|
||||
@@ -122,7 +122,7 @@ volume_structure_descriptor_header::id_matches(const char *id)
|
||||
void
|
||||
charspec::dump() const
|
||||
{
|
||||
DUMP_INIT(CF_PUBLIC | CF_DUMP, "charspec");
|
||||
DUMP_INIT("charspec");
|
||||
PRINT(("character_set_type: %d\n", character_set_type()));
|
||||
PRINT(("character_set_info: `%s'\n", character_set_info()));
|
||||
}
|
||||
@@ -135,7 +135,7 @@ charspec::dump() const
|
||||
void
|
||||
timestamp::dump() const
|
||||
{
|
||||
DUMP_INIT(CF_PUBLIC | CF_DUMP, "timestamp");
|
||||
DUMP_INIT("timestamp");
|
||||
PRINT(("type: %d\n", type()));
|
||||
PRINT(("timezone: %d\n", timezone()));
|
||||
PRINT(("year: %d\n", year()));
|
||||
@@ -169,7 +169,7 @@ entity_id::entity_id(uint8 flags, char *identifier, char *identifier_suffix)
|
||||
void
|
||||
entity_id::dump() const
|
||||
{
|
||||
DUMP_INIT(CF_PUBLIC | CF_DUMP, "entity_id");
|
||||
DUMP_INIT("entity_id");
|
||||
PRINT(("flags: %d\n", flags()));
|
||||
PRINT(("identifier: `%.23s'\n", identifier()));
|
||||
PRINT(("identifier_suffix: `%s'\n", identifier_suffix()));
|
||||
@@ -201,7 +201,7 @@ extent_address::extent_address(uint32 location, uint32 length)
|
||||
void
|
||||
extent_address::dump() const
|
||||
{
|
||||
DUMP_INIT(CF_PUBLIC | CF_DUMP, "extent_address");
|
||||
DUMP_INIT("extent_address");
|
||||
PRINT(("length: %ld\n", length()));
|
||||
PRINT(("location: %ld\n", location()));
|
||||
}
|
||||
@@ -209,7 +209,7 @@ extent_address::dump() const
|
||||
void
|
||||
logical_block_address::dump() const
|
||||
{
|
||||
DUMP_INIT(CF_PUBLIC | CF_DUMP, "logical_block_address");
|
||||
DUMP_INIT("logical_block_address");
|
||||
PRINT(("block: %ld\n", block()));
|
||||
PRINT(("partition: %d\n", partition()));
|
||||
}
|
||||
@@ -217,7 +217,7 @@ logical_block_address::dump() const
|
||||
void
|
||||
long_address::dump() const
|
||||
{
|
||||
DUMP_INIT(CF_PUBLIC | CF_DUMP, "long_address");
|
||||
DUMP_INIT("long_address");
|
||||
PRINT(("length: %ld\n", length()));
|
||||
PRINT(("block: %ld\n", block()));
|
||||
PRINT(("partiton: %d\n", partition()));
|
||||
@@ -232,7 +232,7 @@ long_address::dump() const
|
||||
void
|
||||
descriptor_tag ::dump() const
|
||||
{
|
||||
DUMP_INIT(CF_PUBLIC | CF_VOLUME_OPS | CF_DUMP, "descriptor_tag");
|
||||
DUMP_INIT("descriptor_tag");
|
||||
PRINT(("id: %d (%s)\n", id(), tag_id_to_string(tag_id(id()))));
|
||||
PRINT(("version: %d\n", version()));
|
||||
PRINT(("checksum: %d\n", checksum()));
|
||||
@@ -251,7 +251,7 @@ descriptor_tag ::dump() const
|
||||
status_t
|
||||
descriptor_tag ::init_check(uint32 diskBlock)
|
||||
{
|
||||
DEBUG_INIT(CF_PUBLIC | CF_VOLUME_OPS | CF_HIGH_VOLUME, "descriptor_tag");
|
||||
DEBUG_INIT("descriptor_tag");
|
||||
PRINT(("location (paramater) == %ld\n", diskBlock));
|
||||
PRINT(("location (in structure) == %ld\n", location()));
|
||||
status_t error = (diskBlock == location()) ? B_OK : B_NO_INIT;
|
||||
@@ -277,7 +277,7 @@ descriptor_tag ::init_check(uint32 diskBlock)
|
||||
void
|
||||
primary_volume_descriptor::dump() const
|
||||
{
|
||||
DUMP_INIT(CF_PUBLIC | CF_VOLUME_OPS | CF_DUMP, "primary_volume_descriptor");
|
||||
DUMP_INIT("primary_volume_descriptor");
|
||||
|
||||
CS0String string;
|
||||
|
||||
@@ -321,7 +321,7 @@ primary_volume_descriptor::dump() const
|
||||
void
|
||||
anchor_volume_descriptor::dump() const
|
||||
{
|
||||
DUMP_INIT(CF_PUBLIC | CF_VOLUME_OPS | CF_DUMP, "anchor_volume_descriptor");
|
||||
DUMP_INIT("anchor_volume_descriptor");
|
||||
PRINT(("tag:\n"));
|
||||
DUMP(tag());
|
||||
PRINT(("main_vds:\n"));
|
||||
@@ -338,7 +338,7 @@ anchor_volume_descriptor::dump() const
|
||||
void
|
||||
implementation_use_descriptor::dump() const
|
||||
{
|
||||
DUMP_INIT(CF_PUBLIC | CF_VOLUME_OPS | CF_DUMP, "implementation_use_descriptor");
|
||||
DUMP_INIT("implementation_use_descriptor");
|
||||
PRINT(("tag:\n"));
|
||||
DUMP(tag());
|
||||
PRINT(("vds_number: %ld\n", vds_number()));
|
||||
@@ -357,7 +357,7 @@ const uint8 Udf::kMaxPartitionDescriptors = 2;
|
||||
void
|
||||
partition_descriptor::dump() const
|
||||
{
|
||||
DUMP_INIT(CF_PUBLIC | CF_VOLUME_OPS | CF_DUMP, "partition_descriptor");
|
||||
DUMP_INIT("partition_descriptor");
|
||||
PRINT(("tag:\n"));
|
||||
DUMP(tag());
|
||||
PRINT(("vds_number: %ld\n", vds_number()));
|
||||
@@ -384,7 +384,7 @@ partition_descriptor::dump() const
|
||||
void
|
||||
logical_volume_descriptor::dump() const
|
||||
{
|
||||
DUMP_INIT(CF_PUBLIC | CF_VOLUME_OPS | CF_DUMP, "logical_volume_descriptor");
|
||||
DUMP_INIT("logical_volume_descriptor");
|
||||
PRINT(("tag:\n"));
|
||||
DUMP(tag());
|
||||
PRINT(("vds_number: %ld\n", vds_number()));
|
||||
@@ -471,7 +471,7 @@ logical_volume_descriptor::operator=(const logical_volume_descriptor &rhs)
|
||||
void
|
||||
physical_partition_map::dump()
|
||||
{
|
||||
DUMP_INIT(CF_PUBLIC | CF_VOLUME_OPS | CF_DUMP, "physical_partition_map");
|
||||
DUMP_INIT("physical_partition_map");
|
||||
PRINT(("type: %d\n", type()));
|
||||
PRINT(("length: %d\n", length()));
|
||||
PRINT(("volume_sequence_number: %d\n", volume_sequence_number()));
|
||||
@@ -485,7 +485,7 @@ physical_partition_map::dump()
|
||||
void
|
||||
sparable_partition_map::dump()
|
||||
{
|
||||
DUMP_INIT(CF_PUBLIC | CF_VOLUME_OPS | CF_DUMP, "sparable_partition_map");
|
||||
DUMP_INIT("sparable_partition_map");
|
||||
PRINT(("type: %d\n", type()));
|
||||
PRINT(("length: %d\n", length()));
|
||||
PRINT(("partition_type_id:"));
|
||||
@@ -506,7 +506,7 @@ sparable_partition_map::dump()
|
||||
void
|
||||
unallocated_space_descriptor::dump() const
|
||||
{
|
||||
DUMP_INIT(CF_PUBLIC | CF_VOLUME_OPS | CF_DUMP, "unallocated_space_descriptor");
|
||||
DUMP_INIT("unallocated_space_descriptor");
|
||||
PRINT(("tag:\n"));
|
||||
DUMP(tag());
|
||||
PRINT(("vds_number: %ld\n", vds_number()));
|
||||
@@ -522,7 +522,7 @@ unallocated_space_descriptor::dump() const
|
||||
void
|
||||
terminating_descriptor::dump() const
|
||||
{
|
||||
DUMP_INIT(CF_PUBLIC | CF_VOLUME_OPS | CF_DUMP, "terminating_descriptor");
|
||||
DUMP_INIT("terminating_descriptor");
|
||||
PRINT(("tag:\n"));
|
||||
DUMP(tag());
|
||||
}
|
||||
@@ -534,7 +534,7 @@ terminating_descriptor::dump() const
|
||||
void
|
||||
file_set_descriptor::dump() const
|
||||
{
|
||||
DUMP_INIT(CF_PUBLIC | CF_VOLUME_OPS | CF_DUMP, "file_set_descriptor");
|
||||
DUMP_INIT("file_set_descriptor");
|
||||
PRINT(("tag:\n"));
|
||||
DUMP(tag());
|
||||
PRINT(("recording_date_and_time:\n"));
|
||||
@@ -570,7 +570,7 @@ file_set_descriptor::dump() const
|
||||
void
|
||||
file_id_descriptor::dump() const
|
||||
{
|
||||
DUMP_INIT(CF_PUBLIC | CF_VOLUME_OPS, "file_id_descriptor");
|
||||
DUMP_INIT("file_id_descriptor");
|
||||
PRINT(("tag:\n"));
|
||||
DUMP(tag());
|
||||
PRINT(("version_number: %d\n", version_number()));
|
||||
@@ -592,7 +592,7 @@ file_id_descriptor::dump() const
|
||||
void
|
||||
icb_entry_tag::dump() const
|
||||
{
|
||||
DUMP_INIT(CF_PUBLIC, "icb_entry_tag");
|
||||
DUMP_INIT("icb_entry_tag");
|
||||
PRINT(("prior_entries: %ld\n", prior_recorded_number_of_direct_entries()));
|
||||
PRINT(("strategy_type: %d\n", strategy_type()));
|
||||
PRINT(("strategy_parameters:\n"));
|
||||
@@ -637,7 +637,7 @@ icb_entry_tag::dump() const
|
||||
void
|
||||
icb_header::dump() const
|
||||
{
|
||||
DUMP_INIT(CF_PUBLIC | CF_DUMP, "icb_header");
|
||||
DUMP_INIT("icb_header");
|
||||
|
||||
PRINT(("tag:\n"));
|
||||
DUMP(tag());
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace Udf {
|
||||
long_address
|
||||
to_long_address(vnode_id id, uint32 length)
|
||||
{
|
||||
DEBUG_INIT_ETC(CF_PUBLIC | CF_HELPER, NULL, ("vnode_id: %Ld (0x%Lx), length: %ld", id, id, length));
|
||||
DEBUG_INIT_ETC(NULL, ("vnode_id: %Ld (0x%Lx), length: %ld", id, id, length));
|
||||
long_address result;
|
||||
result.set_block((id >> 16) & 0xffffffff);
|
||||
result.set_partition(id & 0xffff);
|
||||
@@ -38,7 +38,7 @@ to_long_address(vnode_id id, uint32 length)
|
||||
vnode_id
|
||||
to_vnode_id(long_address address)
|
||||
{
|
||||
DEBUG_INIT(CF_PUBLIC | CF_HELPER, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
vnode_id result = address.block();
|
||||
result <<= 16;
|
||||
result |= address.partition();
|
||||
@@ -52,7 +52,7 @@ to_vnode_id(long_address address)
|
||||
time_t
|
||||
make_time(timestamp ×tamp)
|
||||
{
|
||||
DEBUG_INIT_ETC(CF_HELPER | CF_HIGH_VOLUME, NULL, ("timestamp: (tnt: 0x%x, type: %d, timezone: %d = 0x%x, year: %d, "
|
||||
DEBUG_INIT_ETC(NULL, ("timestamp: (tnt: 0x%x, type: %d, timezone: %d = 0x%x, year: %d, "
|
||||
"month: %d, day: %d, hour: %d, minute: %d, second: %d)", timestamp.type_and_timezone(),
|
||||
timestamp.type(), timestamp.timezone(),
|
||||
timestamp.timezone(),timestamp.year(),
|
||||
|
||||
@@ -45,7 +45,7 @@ status_t
|
||||
Volume::Mount(const char *deviceName, off_t offset, off_t length,
|
||||
uint32 blockSize, uint32 flags)
|
||||
{
|
||||
DEBUG_INIT_ETC(CF_PUBLIC | CF_VOLUME_OPS, "Volume",
|
||||
DEBUG_INIT_ETC("Volume",
|
||||
("deviceName: `%s', offset: %Ld, length: %Ld, blockSize: %ld, "
|
||||
"flags: %ld", deviceName, offset, length, blockSize, flags));
|
||||
if (!deviceName)
|
||||
@@ -271,7 +271,7 @@ Volume::Name() const {
|
||||
status_t
|
||||
Volume::MapBlock(long_address address, off_t *mappedBlock)
|
||||
{
|
||||
DEBUG_INIT_ETC(CF_PRIVATE | CF_HIGH_VOLUME, "Volume",
|
||||
DEBUG_INIT_ETC("Volume",
|
||||
("partition: %d, block: %ld, mappedBlock: %p",
|
||||
address.partition(), address.block(), mappedBlock));
|
||||
status_t error = mappedBlock ? B_OK : B_BAD_VALUE;
|
||||
|
||||
@@ -39,13 +39,14 @@ Addon i-udf-ds : [ FDirName drive_setup fs ] :
|
||||
Recognition.cpp
|
||||
UdfDebug.cpp
|
||||
UdfStructures.cpp
|
||||
Utils.cpp
|
||||
|
||||
: false
|
||||
:
|
||||
;
|
||||
|
||||
SEARCH on [ FGristFiles
|
||||
CS0String.cpp Recognition.cpp UdfDebug.cpp UdfStructures.cpp
|
||||
CS0String.cpp Recognition.cpp UdfDebug.cpp UdfStructures.cpp Utils.cpp
|
||||
] = [ FDirName $(OBOS_TOP) src add-ons kernel file_systems udf ] ;
|
||||
|
||||
rule InstallUDFDS
|
||||
|
||||
@@ -38,7 +38,7 @@ bool
|
||||
ds_fs_id(partition_data *data, int32 device, uint64 sessionOffset,
|
||||
int32 blockSize)
|
||||
{
|
||||
DEBUG_INIT_ETC(CF_HELPER, NULL, ("%p, %ld, %Lu, %ld", data,
|
||||
DEBUG_INIT_ETC(NULL, ("%p, %ld, %Lu, %ld", data,
|
||||
device, sessionOffset, blockSize));
|
||||
|
||||
if (!data || device < 0)
|
||||
|
||||
@@ -238,7 +238,7 @@ udf_mount(nspace_id nsid, const char *name, ulong flags, void *parms,
|
||||
size_t parmsLength, void **volumeCookie, vnode_id *rootID)
|
||||
{
|
||||
INITIALIZE_DEBUGGING_OUTPUT_FILE("/boot/home/Desktop/udf_debug.txt");
|
||||
DEBUG_INIT_ETC(CF_ENTRY | CF_VOLUME_OPS, NULL, ("name: `%s'", name));
|
||||
DEBUG_INIT_ETC(NULL, ("name: `%s'", name));
|
||||
|
||||
status_t error = B_OK;
|
||||
char *deviceName = (char*)name;
|
||||
@@ -330,7 +330,7 @@ udf_mount(nspace_id nsid, const char *name, ulong flags, void *parms,
|
||||
int
|
||||
udf_unmount(void *ns)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_VOLUME_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
RETURN(B_OK);
|
||||
}
|
||||
|
||||
@@ -338,7 +338,7 @@ udf_unmount(void *ns)
|
||||
int
|
||||
udf_read_fs_stat(void *ns, struct fs_info *info)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_VOLUME_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
if (ns == NULL || info == NULL)
|
||||
return B_BAD_VALUE;
|
||||
|
||||
@@ -367,7 +367,7 @@ udf_read_fs_stat(void *ns, struct fs_info *info)
|
||||
int
|
||||
udf_write_fs_stat(void *ns, struct fs_info *info, long mask)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_VOLUME_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
// FUNCTION_START(("mask: %ld\n",mask));
|
||||
RETURN(B_ERROR);
|
||||
}
|
||||
@@ -376,7 +376,7 @@ udf_write_fs_stat(void *ns, struct fs_info *info, long mask)
|
||||
int
|
||||
udf_initialize(const char *deviceName, void *parms, size_t parmsLength)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_VOLUME_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
// FUNCTION_START(("deviceName: %s, parameter len: %ld\n", deviceName, parmsLength));
|
||||
RETURN(B_ERROR);
|
||||
}
|
||||
@@ -385,7 +385,7 @@ udf_initialize(const char *deviceName, void *parms, size_t parmsLength)
|
||||
int
|
||||
udf_sync(void *ns)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_VOLUME_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
@@ -393,7 +393,7 @@ udf_sync(void *ns)
|
||||
int
|
||||
udf_read_vnode(void *ns, vnode_id id, char reenter, void **node)
|
||||
{
|
||||
DEBUG_INIT_ETC(CF_ENTRY | CF_VOLUME_OPS, NULL, ("id: %Ld, reenter: %s", id, (reenter ? "true" : "false")));
|
||||
DEBUG_INIT_ETC(NULL, ("id: %Ld, reenter: %s", id, (reenter ? "true" : "false")));
|
||||
|
||||
if (!ns)
|
||||
RETURN(B_BAD_VALUE);
|
||||
@@ -421,7 +421,7 @@ udf_read_vnode(void *ns, vnode_id id, char reenter, void **node)
|
||||
int
|
||||
udf_release_vnode(void *ns, void *node, char reenter)
|
||||
{
|
||||
DEBUG_INIT_ETC(CF_ENTRY | CF_VOLUME_OPS, NULL, ("node: %p", node));
|
||||
DEBUG_INIT_ETC(NULL, ("node: %p", node));
|
||||
|
||||
Udf::Icb *icb = reinterpret_cast<Udf::Icb*>(node);
|
||||
delete icb;
|
||||
@@ -432,7 +432,7 @@ udf_release_vnode(void *ns, void *node, char reenter)
|
||||
int
|
||||
udf_remove_vnode(void *ns, void *node, char reenter)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_VOLUME_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
RETURN(B_ERROR);
|
||||
}
|
||||
|
||||
@@ -440,7 +440,7 @@ udf_remove_vnode(void *ns, void *node, char reenter)
|
||||
int
|
||||
udf_wake_vnode(void *ns, void *node)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_VOLUME_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
RETURN(B_ERROR);
|
||||
}
|
||||
|
||||
@@ -448,7 +448,7 @@ udf_wake_vnode(void *ns, void *node)
|
||||
int
|
||||
udf_suspend_vnode(void *ns, void *node)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_VOLUME_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
RETURN(B_ERROR);
|
||||
}
|
||||
|
||||
@@ -456,7 +456,7 @@ udf_suspend_vnode(void *ns, void *node)
|
||||
int
|
||||
udf_walk(void *ns, void *_dir, const char *filename, char **resolvedPath, vnode_id *vnodeId)
|
||||
{
|
||||
DEBUG_INIT_ETC(CF_ENTRY | CF_VOLUME_OPS, NULL, ("dir: %p, filename = `%s'", _dir, filename));
|
||||
DEBUG_INIT_ETC(NULL, ("dir: %p, filename = `%s'", _dir, filename));
|
||||
|
||||
if (!ns || !_dir || !filename || !vnodeId)
|
||||
RETURN(B_BAD_VALUE);
|
||||
@@ -487,7 +487,7 @@ udf_walk(void *ns, void *_dir, const char *filename, char **resolvedPath, vnode_
|
||||
int
|
||||
udf_ioctl(void *ns, void *node, void *cookie, int cmd, void *buffer, size_t bufferLength)
|
||||
{
|
||||
DEBUG_INIT_ETC(CF_ENTRY | CF_VOLUME_OPS, NULL, ("node: %p, cmd: 0x%x, "
|
||||
DEBUG_INIT_ETC(NULL, ("node: %p, cmd: 0x%x, "
|
||||
"buf: %p, len: %ld\n", node, cmd, buffer, bufferLength));
|
||||
// FUNCTION_START(("node: %p, cmd: %d, buf: %p, len: %ld\n", node, cmd, buffer, bufferLength));
|
||||
RETURN(B_ERROR);
|
||||
@@ -497,7 +497,7 @@ udf_ioctl(void *ns, void *node, void *cookie, int cmd, void *buffer, size_t buff
|
||||
int
|
||||
udf_setflags(void *ns, void *node, void *cookie, int flags)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_VOLUME_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
// FUNCTION_START(("node: %p, flags: %d", node, flags));
|
||||
RETURN(B_ERROR);
|
||||
}
|
||||
@@ -506,7 +506,7 @@ udf_setflags(void *ns, void *node, void *cookie, int flags)
|
||||
int
|
||||
udf_select(void *ns, void *node, void *cookie, uint8 event, uint32 ref, selectsync *sync)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_VOLUME_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
// FUNCTION_START(("event: %d, ref: %lu, sync: %p\n", event, ref, sync));
|
||||
RETURN(B_ERROR);
|
||||
}
|
||||
@@ -515,7 +515,7 @@ udf_select(void *ns, void *node, void *cookie, uint8 event, uint32 ref, selectsy
|
||||
int
|
||||
udf_deselect(void *ns, void *node, void *cookie, uint8 event, selectsync *sync)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_VOLUME_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
RETURN(B_ERROR);
|
||||
}
|
||||
|
||||
@@ -523,7 +523,7 @@ udf_deselect(void *ns, void *node, void *cookie, uint8 event, selectsync *sync)
|
||||
int
|
||||
udf_fsync(void *_ns, void *_node)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_VOLUME_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
RETURN(B_ERROR);
|
||||
}
|
||||
|
||||
@@ -531,7 +531,7 @@ udf_fsync(void *_ns, void *_node)
|
||||
int
|
||||
udf_read_stat(void *ns, void *node, struct stat *st)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_VOLUME_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
|
||||
if (!ns || !node || !st)
|
||||
RETURN(B_BAD_VALUE);
|
||||
@@ -566,7 +566,7 @@ udf_read_stat(void *ns, void *node, struct stat *st)
|
||||
int
|
||||
udf_write_stat(void *ns, void *node, struct stat *stat, long mask)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_VOLUME_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
RETURN(B_ERROR);
|
||||
}
|
||||
|
||||
@@ -580,7 +580,7 @@ int
|
||||
udf_create(void *ns, void *dir, const char *name, int omode, int mode,
|
||||
vnode_id *newID, void **newNode)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_FILE_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
// FUNCTION_START(("name: `%s\', perms: %d, omode: %d\n", name, mode, omode));
|
||||
RETURN(B_ERROR);
|
||||
}
|
||||
@@ -589,7 +589,7 @@ udf_create(void *ns, void *dir, const char *name, int omode, int mode,
|
||||
int
|
||||
udf_symlink(void *ns, void *dir, const char *name, const char *path)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_FILE_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
RETURN(B_ERROR);
|
||||
}
|
||||
|
||||
@@ -597,7 +597,7 @@ udf_symlink(void *ns, void *dir, const char *name, const char *path)
|
||||
int
|
||||
udf_link(void *ns, void *dir, const char *name, void *node)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_FILE_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
// FUNCTION_START(("name = `%s\'\n", name));
|
||||
RETURN(B_ERROR);
|
||||
}
|
||||
@@ -606,7 +606,7 @@ udf_link(void *ns, void *dir, const char *name, void *node)
|
||||
int
|
||||
udf_unlink(void *ns, void *dir, const char *name)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_FILE_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
// FUNCTION_START(("name: `%s'\n",name));
|
||||
RETURN(B_ERROR);
|
||||
}
|
||||
@@ -615,7 +615,7 @@ udf_unlink(void *ns, void *dir, const char *name)
|
||||
int
|
||||
udf_rename(void *ns, void *oldDir, const char *oldName, void *newDir, const char *newName)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_FILE_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
// FUNCTION_START(("oldDir: %p, oldName: `%s', newDir: %p, newName: `%s'\n", oldDir, oldName, newDir, newName));
|
||||
RETURN(B_ERROR);
|
||||
}
|
||||
@@ -623,14 +623,14 @@ udf_rename(void *ns, void *oldDir, const char *oldName, void *newDir, const char
|
||||
int
|
||||
udf_open(void *_ns, void *_node, int omode, void **_cookie)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_FILE_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
RETURN(B_OK);
|
||||
}
|
||||
|
||||
int
|
||||
udf_read(void *_ns, void *_node, void *_cookie, off_t pos, void *buffer, size_t *_length)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_FILE_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
Udf::Icb *icb = reinterpret_cast<Udf::Icb*>(_node);
|
||||
|
||||
// if (!inode->HasUserAccessableStream()) {
|
||||
@@ -645,7 +645,7 @@ udf_read(void *_ns, void *_node, void *_cookie, off_t pos, void *buffer, size_t
|
||||
int
|
||||
udf_write(void *_ns, void *_node, void *_cookie, off_t pos, const void *buffer, size_t *_length)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_FILE_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
RETURN(B_ERROR);
|
||||
}
|
||||
|
||||
@@ -653,7 +653,7 @@ udf_write(void *_ns, void *_node, void *_cookie, off_t pos, const void *buffer,
|
||||
int
|
||||
udf_close(void *_ns, void *_node, void *_cookie)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_FILE_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
RETURN(B_OK);
|
||||
}
|
||||
|
||||
@@ -661,7 +661,7 @@ udf_close(void *_ns, void *_node, void *_cookie)
|
||||
int
|
||||
udf_free_cookie(void *_ns, void *_node, void *_cookie)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_FILE_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
RETURN(B_OK);
|
||||
}
|
||||
|
||||
@@ -669,7 +669,7 @@ udf_free_cookie(void *_ns, void *_node, void *_cookie)
|
||||
int
|
||||
udf_access(void *_ns, void *_node, int accessMode)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_FILE_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
RETURN(B_OK);
|
||||
}
|
||||
|
||||
@@ -677,7 +677,7 @@ udf_access(void *_ns, void *_node, int accessMode)
|
||||
int
|
||||
udf_read_link(void *_ns, void *_node, char *buffer, size_t *bufferSize)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_FILE_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
RETURN(B_ERROR);
|
||||
}
|
||||
|
||||
@@ -690,7 +690,7 @@ udf_read_link(void *_ns, void *_node, char *buffer, size_t *bufferSize)
|
||||
int
|
||||
udf_mkdir(void *ns, void *dir, const char *name, int mode)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_DIRECTORY_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
// FUNCTION_START(("name: `%s', perms: %d\n", name, mode));
|
||||
RETURN(B_ERROR);
|
||||
}
|
||||
@@ -699,7 +699,7 @@ udf_mkdir(void *ns, void *dir, const char *name, int mode)
|
||||
int
|
||||
udf_rmdir(void *ns, void *dir, const char *name)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_DIRECTORY_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
// FUNCTION_START(("name: `%s'\n", name));
|
||||
RETURN(B_ERROR);
|
||||
}
|
||||
@@ -708,7 +708,7 @@ udf_rmdir(void *ns, void *dir, const char *name)
|
||||
int
|
||||
udf_open_dir(void *ns, void *node, void **cookie)
|
||||
{
|
||||
DEBUG_INIT_ETC(CF_ENTRY | CF_DIRECTORY_OPS, NULL, ("node: %p, cookie: %p", node, cookie));
|
||||
DEBUG_INIT_ETC(NULL, ("node: %p, cookie: %p", node, cookie));
|
||||
|
||||
if (!ns || !node || !cookie)
|
||||
RETURN(B_BAD_VALUE);
|
||||
@@ -738,7 +738,7 @@ int
|
||||
udf_read_dir(void *ns, void *node, void *cookie, long *num,
|
||||
struct dirent *dirent, size_t bufferSize)
|
||||
{
|
||||
DEBUG_INIT_ETC(CF_ENTRY | CF_DIRECTORY_OPS, NULL,
|
||||
DEBUG_INIT_ETC(NULL,
|
||||
("dir: %p, iterator: %p, bufferSize: %ld", node, cookie, bufferSize));
|
||||
|
||||
if (!ns || !node || !cookie || !num || bufferSize < sizeof(dirent))
|
||||
@@ -775,7 +775,7 @@ udf_read_dir(void *ns, void *node, void *cookie, long *num,
|
||||
int
|
||||
udf_rewind_dir(void *ns, void *node, void *cookie)
|
||||
{
|
||||
DEBUG_INIT_ETC(CF_ENTRY | CF_DIRECTORY_OPS, NULL,
|
||||
DEBUG_INIT_ETC(NULL,
|
||||
("dir: %p, iterator: %p", node, cookie));
|
||||
|
||||
if (!ns || !node || !cookie)
|
||||
@@ -799,7 +799,7 @@ udf_rewind_dir(void *ns, void *node, void *cookie)
|
||||
int
|
||||
udf_close_dir(void *ns, void *node, void *cookie)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_DIRECTORY_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
RETURN(B_ERROR);
|
||||
}
|
||||
|
||||
@@ -807,7 +807,7 @@ udf_close_dir(void *ns, void *node, void *cookie)
|
||||
int
|
||||
udf_free_dir_cookie(void *ns, void *node, void *cookie)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_DIRECTORY_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
delete reinterpret_cast<Udf::DirectoryIterator*>(cookie);
|
||||
RETURN(B_ERROR);
|
||||
}
|
||||
@@ -821,7 +821,7 @@ udf_free_dir_cookie(void *ns, void *node, void *cookie)
|
||||
int
|
||||
udf_open_attrdir(void *ns, void *node, void **cookie)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_ATTRIBUTE_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
RETURN(B_ERROR);
|
||||
}
|
||||
|
||||
@@ -829,7 +829,7 @@ udf_open_attrdir(void *ns, void *node, void **cookie)
|
||||
int
|
||||
udf_close_attrdir(void *ns, void *node, void *cookie)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_ATTRIBUTE_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
RETURN(B_ERROR);
|
||||
}
|
||||
|
||||
@@ -837,7 +837,7 @@ udf_close_attrdir(void *ns, void *node, void *cookie)
|
||||
int
|
||||
udf_free_attrdir_cookie(void *ns, void *node, void *_cookie)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_ATTRIBUTE_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
RETURN(B_ERROR);
|
||||
}
|
||||
|
||||
@@ -845,7 +845,7 @@ udf_free_attrdir_cookie(void *ns, void *node, void *_cookie)
|
||||
int
|
||||
udf_rewind_attrdir(void *_ns, void *_node, void *_cookie)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_ATTRIBUTE_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
RETURN(B_ERROR);
|
||||
}
|
||||
|
||||
@@ -853,7 +853,7 @@ udf_rewind_attrdir(void *_ns, void *_node, void *_cookie)
|
||||
int
|
||||
udf_read_attrdir(void *_ns, void *node, void *_cookie, long *num, struct dirent *dirent, size_t bufsize)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_ATTRIBUTE_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
RETURN(B_ERROR);
|
||||
}
|
||||
|
||||
@@ -861,7 +861,7 @@ udf_read_attrdir(void *_ns, void *node, void *_cookie, long *num, struct dirent
|
||||
int
|
||||
udf_remove_attr(void *_ns, void *_node, const char *name)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_ATTRIBUTE_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
// FUNCTION_START(("name: `%s'\n",name));
|
||||
RETURN(B_ERROR);
|
||||
}
|
||||
@@ -870,7 +870,7 @@ udf_remove_attr(void *_ns, void *_node, const char *name)
|
||||
int
|
||||
udf_rename_attr(void *ns, void *node, const char *oldname, const char *newname)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_ATTRIBUTE_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
// FUNCTION_START(("name: `%s',to: `%s'\n", oldname, newname));
|
||||
RETURN(B_ERROR);
|
||||
}
|
||||
@@ -879,7 +879,7 @@ udf_rename_attr(void *ns, void *node, const char *oldname, const char *newname)
|
||||
int
|
||||
udf_stat_attr(void *ns, void *_node, const char *name, struct attr_info *attrInfo)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_ATTRIBUTE_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
// FUNCTION_START(("name: `%s'\n",name));
|
||||
RETURN(B_ERROR);
|
||||
}
|
||||
@@ -889,7 +889,7 @@ int
|
||||
udf_write_attr(void *_ns, void *_node, const char *name, int type, const void *buffer,
|
||||
size_t *_length, off_t pos)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_ATTRIBUTE_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
// FUNCTION_START(("name: `%s'\n",name));
|
||||
RETURN(B_ERROR);
|
||||
}
|
||||
@@ -899,7 +899,7 @@ int
|
||||
udf_read_attr(void *_ns, void *_node, const char *name, int type, void *buffer,
|
||||
size_t *_length, off_t pos)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_ATTRIBUTE_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
RETURN(B_ERROR);
|
||||
}
|
||||
|
||||
@@ -912,7 +912,7 @@ udf_read_attr(void *_ns, void *_node, const char *name, int type, void *buffer,
|
||||
int
|
||||
udf_open_indexdir(void *_ns, void **_cookie)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_INDEX_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
RETURN(B_ERROR);
|
||||
}
|
||||
|
||||
@@ -920,7 +920,7 @@ udf_open_indexdir(void *_ns, void **_cookie)
|
||||
int
|
||||
udf_close_indexdir(void *_ns, void *_cookie)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_INDEX_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
RETURN(B_ERROR);
|
||||
}
|
||||
|
||||
@@ -928,7 +928,7 @@ udf_close_indexdir(void *_ns, void *_cookie)
|
||||
int
|
||||
udf_free_indexdir_cookie(void *_ns, void *_node, void *_cookie)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_INDEX_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
RETURN(B_ERROR);
|
||||
}
|
||||
|
||||
@@ -936,7 +936,7 @@ udf_free_indexdir_cookie(void *_ns, void *_node, void *_cookie)
|
||||
int
|
||||
udf_rewind_indexdir(void *_ns, void *_cookie)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_INDEX_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
RETURN(B_ERROR);
|
||||
}
|
||||
|
||||
@@ -944,7 +944,7 @@ udf_rewind_indexdir(void *_ns, void *_cookie)
|
||||
int
|
||||
udf_read_indexdir(void *_ns, void *_cookie, long *num, struct dirent *dirent, size_t bufferSize)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_INDEX_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
RETURN(B_ERROR);
|
||||
}
|
||||
|
||||
@@ -952,7 +952,7 @@ udf_read_indexdir(void *_ns, void *_cookie, long *num, struct dirent *dirent, si
|
||||
int
|
||||
udf_create_index(void *_ns, const char *name, int type, int flags)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_INDEX_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
// FUNCTION_START(("name: `%s', type: %d, flags: %d\n", name, type, flags));
|
||||
RETURN(B_ERROR);
|
||||
}
|
||||
@@ -961,7 +961,7 @@ udf_create_index(void *_ns, const char *name, int type, int flags)
|
||||
int
|
||||
udf_remove_index(void *_ns, const char *name)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_INDEX_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
RETURN(B_ERROR);
|
||||
}
|
||||
|
||||
@@ -969,7 +969,7 @@ udf_remove_index(void *_ns, const char *name)
|
||||
int
|
||||
udf_rename_index(void *ns, const char *oldname, const char *newname)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_INDEX_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
// FUNCTION_START(("from: %s, to: %s\n", oldname, newname));
|
||||
RETURN(B_ERROR);
|
||||
}
|
||||
@@ -978,7 +978,7 @@ udf_rename_index(void *ns, const char *oldname, const char *newname)
|
||||
int
|
||||
udf_stat_index(void *_ns, const char *name, struct index_info *indexInfo)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_INDEX_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
// FUNCTION_START(("name: %s\n",name));
|
||||
RETURN(B_ERROR);
|
||||
}
|
||||
@@ -991,7 +991,7 @@ int
|
||||
udf_open_query(void *_ns, const char *queryString, ulong flags, port_id port,
|
||||
long token, void **cookie)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_QUERY_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
RETURN(B_ERROR);
|
||||
}
|
||||
|
||||
@@ -999,7 +999,7 @@ udf_open_query(void *_ns, const char *queryString, ulong flags, port_id port,
|
||||
int
|
||||
udf_close_query(void *ns, void *cookie)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_QUERY_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
RETURN(B_ERROR);
|
||||
}
|
||||
|
||||
@@ -1007,7 +1007,7 @@ udf_close_query(void *ns, void *cookie)
|
||||
int
|
||||
udf_free_query_cookie(void *ns, void *node, void *cookie)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_QUERY_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
RETURN(B_ERROR);
|
||||
}
|
||||
|
||||
@@ -1015,7 +1015,7 @@ udf_free_query_cookie(void *ns, void *node, void *cookie)
|
||||
int
|
||||
udf_read_query(void *ns, void *cookie, long *num, struct dirent *dirent, size_t bufferSize)
|
||||
{
|
||||
DEBUG_INIT(CF_ENTRY | CF_QUERY_OPS, NULL);
|
||||
DEBUG_INIT(NULL);
|
||||
RETURN(B_ERROR);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,329 +0,0 @@
|
||||
//----------------------------------------------------------------------
|
||||
// This software is part of the OpenBeOS distribution and is covered
|
||||
// by the OpenBeOS license.
|
||||
//
|
||||
// This version copyright (c) 2003 Tyler Dauwalder, [email protected]
|
||||
// Initial version copyright (c) 2002 Axel Dörfler, [email protected]
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
/*! \file Debug.cpp
|
||||
|
||||
Support code for handy debugging macros.
|
||||
*/
|
||||
|
||||
#include "Debug.h"
|
||||
|
||||
#include <KernelExport.h>
|
||||
#include <TLS.h>
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Long-winded overview of the debug output macros:
|
||||
//----------------------------------------------------------------------
|
||||
/*! \def DEBUG_INIT()
|
||||
\brief Increases the indentation level, prints out the enclosing function's
|
||||
name, and creates a \c DebugHelper object on the stack to automatically
|
||||
decrease the indentation level upon function exit.
|
||||
|
||||
This macro should be called at the very beginning of any function in
|
||||
which you wish to use any of the other debugging macros.
|
||||
|
||||
If DEBUG is undefined, does nothing.
|
||||
*/
|
||||
//----------------------------------------------------------------------
|
||||
/*! \def PRINT(x)
|
||||
\brief Prints out the enclosing function's name followed by the contents
|
||||
of \a x at the current indentation level.
|
||||
|
||||
\param x A printf-style format string enclosed in an extra set of parenteses,
|
||||
e.g. PRINT(("%d\n", 0));
|
||||
|
||||
If DEBUG is undefined, does nothing.
|
||||
*/
|
||||
//----------------------------------------------------------------------
|
||||
/*! \def LPRINT(x)
|
||||
\brief Identical to \c PRINT(x), except that the line number in the source
|
||||
file at which the macro is invoked is also printed.
|
||||
|
||||
\param x A printf-style format string enclosed in an extra set of parenteses,
|
||||
e.g. PRINT(("%d\n", 0));
|
||||
|
||||
If DEBUG is undefined, does nothing.
|
||||
*/
|
||||
//----------------------------------------------------------------------
|
||||
/*! \def SIMPLE_PRINT(x)
|
||||
\brief Directly prints the contents of \a x with no extra formatting or
|
||||
information included (just like a straight \c printf() call).
|
||||
|
||||
\param x A printf-style format string enclosed in an extra set of parenteses,
|
||||
e.g. PRINT(("%d\n", 0));
|
||||
|
||||
If DEBUG is undefined, does nothing.
|
||||
*/
|
||||
//----------------------------------------------------------------------
|
||||
/*! \def PRINT_INDENT()
|
||||
\brief Prints out enough indentation characters to indent the current line
|
||||
to the current indentation level (assuming the cursor was flush left to
|
||||
begin with...).
|
||||
|
||||
This function is called by the other \c *PRINT* macros, and isn't really
|
||||
intended for general consumption, but you might find it useful.
|
||||
|
||||
If DEBUG is undefined, does nothing.
|
||||
*/
|
||||
//----------------------------------------------------------------------
|
||||
/*! \def REPORT_ERROR(error)
|
||||
\brief Calls \c LPRINT(x) with a format string listing the error
|
||||
code in \c error (assumed to be a \c status_t value) and the
|
||||
corresponding text error code returned by a call to \c strerror().
|
||||
|
||||
This function is called by the \c RETURN* macros, and isn't really
|
||||
intended for general consumption, but you might find it useful.
|
||||
|
||||
\param error A \c status_t error code to report.
|
||||
|
||||
If DEBUG is undefined, does nothing.
|
||||
*/
|
||||
//----------------------------------------------------------------------
|
||||
/*! \def RETURN_ERROR(error)
|
||||
\brief Calls \c REPORT_ERROR(error) if error is a an error code (i.e.
|
||||
negative), otherwise remains silent. In either case, the enclosing
|
||||
function is then exited with a call to \c "return error;".
|
||||
|
||||
\param error A \c status_t error code to report (if negative) and return.
|
||||
|
||||
If DEBUG is undefined, silently returns the value in \c error.
|
||||
*/
|
||||
//----------------------------------------------------------------------
|
||||
/*! \def RETURN(error)
|
||||
\brief Prints out a description of the error code being returned
|
||||
(which, in this case, may be either "erroneous" or "successful")
|
||||
and then exits the enclosing function with a call to \c "return error;".
|
||||
|
||||
\param error A \c status_t error code to report and return.
|
||||
|
||||
If DEBUG is undefined, silently returns the value in \c error.
|
||||
*/
|
||||
//----------------------------------------------------------------------
|
||||
/*! \def FATAL(x)
|
||||
\brief Prints out a fatal error message.
|
||||
|
||||
This one's still a work in progress...
|
||||
|
||||
\param x A printf-style format string enclosed in an extra set of parenteses,
|
||||
e.g. PRINT(("%d\n", 0));
|
||||
|
||||
If DEBUG is undefined, does nothing.
|
||||
*/
|
||||
//----------------------------------------------------------------------
|
||||
/*! \def INFORM(x)
|
||||
\brief Directly prints the contents of \a x with no extra formatting or
|
||||
information included (just like a straight \c printf() call). Does so
|
||||
whether \c DEBUG is defined or not.
|
||||
|
||||
\param x A printf-style format string enclosed in an extra set of parenteses,
|
||||
e.g. PRINT(("%d\n", 0));
|
||||
|
||||
I'll say it again: Prints its output regardless to DEBUG being defined or
|
||||
undefined.
|
||||
*/
|
||||
//----------------------------------------------------------------------
|
||||
/*! \def DBG(x)
|
||||
\brief If debug is defined, \a x is passed along to the code and
|
||||
executed unmodified. If \c DEBUG is undefined, the contents of
|
||||
\a x disappear into the ether.
|
||||
|
||||
\param x Damn near anything resembling valid C\C++.
|
||||
*/
|
||||
//----------------------------------------------------------------------
|
||||
/*! \def DIE(x)
|
||||
\brief Drops the user into the appropriate debugger (user or kernel)
|
||||
after printing out the handy message bundled in the parenthesee
|
||||
enclosed printf-style format string found in \a x.
|
||||
|
||||
\param x A printf-style format string enclosed in an extra set of parenteses,
|
||||
e.g. PRINT(("%d\n", 0));
|
||||
*/
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// declarations
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
static void indent(uint8 tabCount);
|
||||
static void unindent(uint8 tabCount);
|
||||
static int32 get_tls_handle();
|
||||
|
||||
//! Used to keep the tls handle from being allocated more than once.
|
||||
vint32 tls_spinlock = 0;
|
||||
|
||||
/*! \brief Used to flag whether the tls handle has been allocated yet.
|
||||
|
||||
Not sure if this really needs to be \c volatile or not...
|
||||
*/
|
||||
volatile bool tls_handle_initialized = false;
|
||||
|
||||
//! The tls handle of the tls var used to store indentation info.
|
||||
int32 tls_handle = 0;
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// public functions
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
/*! \brief Returns the current debug indentation level for the
|
||||
current thread.
|
||||
|
||||
NOTE: indentation is currently unsupported for R5::kernelland due
|
||||
to lack of thread local storage support.
|
||||
*/
|
||||
int32
|
||||
_get_debug_indent_level()
|
||||
{
|
||||
return (int32)tls_get(get_tls_handle());
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// static functions
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
/*! \brief Increases the current debug indentation level for
|
||||
the current thread by 1.
|
||||
*/
|
||||
void
|
||||
indent(uint8 tabCount)
|
||||
{
|
||||
tls_set(get_tls_handle(), (void*)(_get_debug_indent_level()+tabCount));
|
||||
}
|
||||
|
||||
/*! \brief Decreases the current debug indentation level for
|
||||
the current thread by 1.
|
||||
*/
|
||||
void
|
||||
unindent(uint8 tabCount)
|
||||
{
|
||||
tls_set(get_tls_handle(), (void*)(_get_debug_indent_level()-tabCount));
|
||||
}
|
||||
|
||||
/*! \brief Returns the thread local storage handle used to store
|
||||
indentation information, allocating the handle first if
|
||||
necessary.
|
||||
*/
|
||||
int32
|
||||
get_tls_handle()
|
||||
{
|
||||
// Init the tls handle if this is the first call.
|
||||
if (!tls_handle_initialized) {
|
||||
if (atomic_or(&tls_spinlock, 1) == 0) {
|
||||
// First one in gets to init
|
||||
tls_handle = tls_allocate();
|
||||
tls_handle_initialized = true;
|
||||
atomic_and(&tls_spinlock, 0);
|
||||
} else {
|
||||
// All others must wait patiently
|
||||
while (!tls_handle_initialized) {
|
||||
snooze(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
return tls_handle;
|
||||
}
|
||||
|
||||
/*! \brief Helper class for initializing the debugging output
|
||||
file.
|
||||
|
||||
Note that this hummer isn't threadsafe, but it doesn't really
|
||||
matter for our concerns, since the worst it'll result in is
|
||||
a dangling file descriptor, and that would be in the case of
|
||||
two or more volumes being mounted almost simultaneously...
|
||||
not too big of a worry.
|
||||
*/
|
||||
class DebugOutputFile {
|
||||
public:
|
||||
DebugOutputFile(const char *filename = NULL)
|
||||
: fFile(-1)
|
||||
{
|
||||
Init(filename);
|
||||
}
|
||||
|
||||
~DebugOutputFile() {
|
||||
if (fFile >= 0)
|
||||
close(fFile);
|
||||
}
|
||||
|
||||
void Init(const char *filename) {
|
||||
if (fFile < 0 && filename)
|
||||
fFile = open(filename, O_RDWR | O_CREAT | O_TRUNC);
|
||||
}
|
||||
|
||||
int File() const { return fFile; }
|
||||
private:
|
||||
int fFile;
|
||||
};
|
||||
|
||||
DebugOutputFile *out = NULL;
|
||||
|
||||
/*! \brief It doesn't appear that the constructor for the global
|
||||
\c out variable is called when built as an R5 filesystem add-on,
|
||||
so this function needs to be called in udf_mount to let the
|
||||
magic happen.
|
||||
*/
|
||||
void initialize_debugger(const char *filename)
|
||||
{
|
||||
#if DEBUG_TO_FILE
|
||||
if (!out) {
|
||||
out = new DebugOutputFile(filename);
|
||||
dbg_printf("out was NULL!\n");
|
||||
} else {
|
||||
DebugOutputFile *temp = out;
|
||||
out = new DebugOutputFile(filename);
|
||||
dbg_printf("out was %p!\n", temp);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// dbg_printf, stolen from Ingo's ReiserFS::Debug.cpp.
|
||||
void
|
||||
dbg_printf(const char *format,...)
|
||||
{
|
||||
#if DEBUG_TO_FILE
|
||||
if (!out)
|
||||
return;
|
||||
|
||||
char buffer[1024];
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
// no vsnprintf() on PPC
|
||||
#if defined(__INTEL__)
|
||||
vsnprintf(buffer, sizeof(buffer) - 1, format, args);
|
||||
#endif
|
||||
va_end(args);
|
||||
buffer[sizeof(buffer) - 1] = '\0';
|
||||
write(out->File(), buffer, strlen(buffer));
|
||||
#endif
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// DebugHelper
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
/*! \brief Increases the current indentation level.
|
||||
*/
|
||||
DebugHelper::DebugHelper(const char *className, uint8 tabCount)
|
||||
: fTabCount(tabCount)
|
||||
, fClassName(NULL)
|
||||
{
|
||||
indent(fTabCount);
|
||||
if (className) {
|
||||
fClassName = (char*)malloc(strlen(className)+1);
|
||||
if (fClassName)
|
||||
strcpy(fClassName, className);
|
||||
}
|
||||
}
|
||||
|
||||
/*! \brief Decreases the current indentation level.
|
||||
*/
|
||||
DebugHelper::~DebugHelper()
|
||||
{
|
||||
unindent(fTabCount);
|
||||
free(fClassName);
|
||||
}
|
||||
|
||||
@@ -1,227 +0,0 @@
|
||||
//----------------------------------------------------------------------
|
||||
// This software is part of the OpenBeOS distribution and is covered
|
||||
// by the OpenBeOS license.
|
||||
//
|
||||
// This version copyright (c) 2003 Tyler Dauwalder, [email protected]
|
||||
// Initial version copyright (c) 2002 Axel Dörfler, [email protected]
|
||||
// dbg_printf() function copyright (c) 2003 Ingo Weinhold, [email protected]
|
||||
//----------------------------------------------------------------------
|
||||
#ifndef MY_DEBUG_H
|
||||
#define MY_DEBUG_H
|
||||
|
||||
/*! \file Debug.h
|
||||
|
||||
Handy debugging macros.
|
||||
*/
|
||||
|
||||
#include <KernelExport.h>
|
||||
|
||||
#include <OS.h>
|
||||
#ifdef DEBUG
|
||||
# include <string.h>
|
||||
#endif
|
||||
#include <unistd.h>
|
||||
|
||||
#define DEBUG_TO_FILE 0
|
||||
|
||||
#if DEBUG_TO_FILE
|
||||
# include <stdio.h>
|
||||
# include <fcntl.h>
|
||||
# define __out dbg_printf
|
||||
void dbg_printf(const char *format,...);
|
||||
void initialize_debugger(const char *filename);
|
||||
#else
|
||||
# include <stdio.h>
|
||||
# include <malloc.h>
|
||||
# define __out printf
|
||||
#endif
|
||||
|
||||
class DebugHelper;
|
||||
|
||||
int32 _get_debug_indent_level();
|
||||
|
||||
/*! \brief Helper class that is allocated on the stack by
|
||||
the \c DEBUG_INIT() macro. On creation, it increases the
|
||||
current indentation level by the amount specified via its
|
||||
constructor's \c tabCount parameter; on destruction, it
|
||||
decreases it.
|
||||
*/
|
||||
class DebugHelper
|
||||
{
|
||||
public:
|
||||
DebugHelper(const char *className = NULL, uint8 tabCount = 1);
|
||||
~DebugHelper();
|
||||
|
||||
uint8 TabCount() const { return fTabCount; }
|
||||
const char* ClassName() const { return fClassName; }
|
||||
|
||||
private:
|
||||
uint8 fTabCount;
|
||||
char *fClassName;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// NOTE: See Debug.cpp for complete descriptions of the following
|
||||
// debug macros.
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// DEBUG-independent macros
|
||||
//----------------------------------------------------------------------
|
||||
#define INFORM(x) { __out("mkudf: "); __out x; }
|
||||
#ifdef USER
|
||||
# define DIE(x) debugger x
|
||||
#else
|
||||
# define DIE(x) kernel_debugger x
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// DEBUG-dependent macros
|
||||
//----------------------------------------------------------------------
|
||||
#ifdef DEBUG
|
||||
#if DEBUG_TO_FILE
|
||||
#define INITIALIZE_DEBUGGING_OUTPUT_FILE(filename) initialize_debugger(filename);
|
||||
#else
|
||||
#define INITIALIZE_DEBUGGING_OUTPUT_FILE(filename) ;
|
||||
#endif
|
||||
|
||||
#define DEBUG_INIT_SILENT(className) \
|
||||
DebugHelper _debugHelper(className, 2);
|
||||
|
||||
#define DEBUG_INIT(className) \
|
||||
DEBUG_INIT_SILENT(className); \
|
||||
PRINT(("\n"));
|
||||
|
||||
#define DEBUG_INIT_ETC(className, arguments) \
|
||||
DEBUG_INIT_SILENT(className) \
|
||||
{ \
|
||||
PRINT_INDENT(); \
|
||||
if (_debugHelper.ClassName()) { \
|
||||
__out("mkudf: %s::%s(", \
|
||||
_debugHelper.ClassName(), __FUNCTION__); \
|
||||
} else { \
|
||||
__out("mkudf: %s(", __FUNCTION__); \
|
||||
} \
|
||||
__out arguments; \
|
||||
__out("):\n"); \
|
||||
}
|
||||
|
||||
#define DUMP_INIT(categoryFlags, className) \
|
||||
DEBUG_INIT_SILENT(className);
|
||||
|
||||
#define PRINT(x) { \
|
||||
{ \
|
||||
PRINT_INDENT(); \
|
||||
if (_debugHelper.ClassName()) { \
|
||||
__out("mkudf: %s::%s(): ", \
|
||||
_debugHelper.ClassName(), __FUNCTION__); \
|
||||
} else { \
|
||||
__out("mkudf: %s(): ", __FUNCTION__); \
|
||||
} \
|
||||
__out x; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define LPRINT(x) { \
|
||||
{ \
|
||||
PRINT_INDENT(); \
|
||||
if (_debugHelper.ClassName()) { \
|
||||
__out("mkudf: %s::%s(): line %d: ", \
|
||||
_debugHelper.ClassName(), __FUNCTION__, __LINE__); \
|
||||
} else { \
|
||||
__out("mkudf: %s(): line %d: ", \
|
||||
__FUNCTION__, __LINE__); \
|
||||
} \
|
||||
__out x; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define SIMPLE_PRINT(x) { \
|
||||
{ \
|
||||
__out x; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define PRINT_INDENT() { \
|
||||
{ \
|
||||
int32 _level = _get_debug_indent_level(); \
|
||||
for (int32 i = 0; i < _level-_debugHelper.TabCount(); i++) { \
|
||||
__out(" "); \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
#define PRINT_DIVIDER() \
|
||||
PRINT_INDENT(); \
|
||||
SIMPLE_PRINT(("------------------------------------------------------------\n"));
|
||||
|
||||
#define DUMP(object) \
|
||||
{ \
|
||||
(object).dump(); \
|
||||
}
|
||||
|
||||
#define PDUMP(objectPointer) \
|
||||
{ \
|
||||
(objectPointer)->dump(); \
|
||||
}
|
||||
|
||||
#define REPORT_ERROR(error) { \
|
||||
LPRINT(("returning error 0x%lx, `%s'\n", error, strerror(error))); \
|
||||
}
|
||||
|
||||
#define RETURN_ERROR(error) { \
|
||||
status_t _status = error; \
|
||||
if (_status < (status_t)B_OK) \
|
||||
REPORT_ERROR(_status); \
|
||||
return _status; \
|
||||
}
|
||||
|
||||
#define RETURN(error) { \
|
||||
status_t _status = error; \
|
||||
if (_status < (status_t)B_OK) { \
|
||||
REPORT_ERROR(_status); \
|
||||
} else if (_status == (status_t)B_OK) { \
|
||||
LPRINT(("returning B_OK\n")); \
|
||||
} else { \
|
||||
LPRINT(("returning 0x%lx = %ld\n", _status, _status)); \
|
||||
} \
|
||||
return _status; \
|
||||
}
|
||||
|
||||
#define FATAL(x) { \
|
||||
PRINT(("fatal error: ")); SIMPLE_PRINT(x); \
|
||||
}
|
||||
|
||||
#define DBG(x) x ;
|
||||
|
||||
#else // ifdef DEBUG
|
||||
#define INITIALIZE_DEBUGGING_OUTPUT_FILE(filename) ;
|
||||
#define DEBUG_INIT_SILENT(className) ;
|
||||
#define DEBUG_INIT(className) ;
|
||||
#define DEBUG_INIT_ETC(className, arguments) ;
|
||||
#define DUMP_INIT(className) ;
|
||||
#define PRINT(x) ;
|
||||
#define LPRINT(x) ;
|
||||
#define SIMPLE_PRINT(x) ;
|
||||
#define PRINT_INDENT(x) ;
|
||||
#define PRINT_DIVIDER() ;
|
||||
#define DUMP(object) ;
|
||||
#define PDUMP(objectPointer) ;
|
||||
#define REPORT_ERROR(status) ;
|
||||
#define RETURN_ERROR(status) return status;
|
||||
#define RETURN(status) return status;
|
||||
#define FATAL(x) { __out("mkudf: fatal error: "); __out x; }
|
||||
#define DBG(x) ;
|
||||
#define DUMP(x) ;
|
||||
#endif // ifdef DEBUG else
|
||||
|
||||
#define TRACE(x) DBG(dprintf x)
|
||||
|
||||
// These macros turn on or off extensive and generally unnecessary
|
||||
// debugging output regarding table of contents parsing
|
||||
//#define WARN(x) (dprintf x)
|
||||
//#define WARN(x)
|
||||
#define WARN(x) DBG(dprintf x)
|
||||
|
||||
#endif // MY_DEBUG_H
|
||||
@@ -13,18 +13,19 @@ BinCommand makeudfimage
|
||||
: makeudfimage.cpp
|
||||
Allocator.cpp
|
||||
ConsoleListener.cpp
|
||||
Debug.cpp
|
||||
Shell.cpp
|
||||
UdfBuilder.cpp
|
||||
|
||||
# Common Udf source files
|
||||
CS0String.cpp
|
||||
UdfDebug.cpp
|
||||
UdfStructures.cpp
|
||||
Utils.cpp
|
||||
|
||||
: stdc++.r4
|
||||
|
||||
;
|
||||
|
||||
SEARCH on [ FGristFiles CS0String.cpp UdfStructures.cpp ]
|
||||
SEARCH on [ FGristFiles CS0String.cpp UdfDebug.cpp UdfStructures.cpp Utils.cpp ]
|
||||
= [ FDirName $(OBOS_TOP) src add-ons kernel file_systems udf ] ;
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include "ConsoleListener.h"
|
||||
#include "Debug.h"
|
||||
#include "UdfDebug.h"
|
||||
#include "UdfBuilder.h"
|
||||
|
||||
Shell::Shell()
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "Debug.h"
|
||||
#include "UdfDebug.h"
|
||||
|
||||
UdfBuilder::UdfBuilder(const ProgressListener &listener)
|
||||
: fListener(listener)
|
||||
|
||||
Reference in New Issue
Block a user