General stack info handling improvements

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@6466 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2000-04-14 10:38:22 +00:00
parent aa4b5dc510
commit 5c31e5274d
10 changed files with 59 additions and 9 deletions

View file

@ -1,3 +1,11 @@
2000-04-14 Richard Frith-Macdonald <rfm@gnu.org>
* Source/mframe.m: Update to handle '-' in stack position information
in type encodings.
* Source/Invocation.m: ditto
* Source/objc-gnu2next.m: ditto
* Source/mframe/*/generic: ditto
2000-04-08 Adam Fedor <fedor@gnu.org>
* Source/NSString.m: Include NSISOLatin2StringEncoding coding.

View file

@ -74,6 +74,7 @@
#include <Foundation/NSFileManager.h>
#include <Foundation/NSPathUtilities.h>
#include <Foundation/NSRange.h>
#include <Foundation/NSZone.h>
#include <string.h> /* for memset() */
#include <unistd.h> /* SEEK_* on SunOS 4 */
@ -270,7 +271,7 @@ failure:
}
}
+ (NSData*) allocWithZone: (NSZone*)z
+ (id) allocWithZone: (NSZone*)z
{
return (NSData*)NSAllocateObject(dataMalloc, 0, z);
}
@ -1176,7 +1177,7 @@ failure:
@implementation NSMutableData
+ (NSData*) allocWithZone: (NSZone*)z
+ (id) allocWithZone: (NSZone*)z
{
return (NSData*)NSAllocateObject(mutableDataMalloc, 0, z);
}
@ -1662,7 +1663,7 @@ failure:
*/
@implementation NSDataStatic
+ (NSData*) allocWithZone: (NSZone*)z
+ (id) allocWithZone: (NSZone*)z
{
return (NSData*)NSAllocateObject(self, 0, z);
}
@ -2285,7 +2286,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
#if HAVE_MMAP
@implementation NSDataMappedFile
+ (NSData*) allocWithZone: (NSZone*)z
+ (id) allocWithZone: (NSZone*)z
{
return (NSData*)NSAllocateObject([NSDataMappedFile class], 0, z);
}
@ -2357,7 +2358,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
#if HAVE_SHMCTL
@implementation NSDataShared
+ (NSData*) allocWithZone: (NSZone*)z
+ (id) allocWithZone: (NSZone*)z
{
return (NSData*)NSAllocateObject([NSDataShared class], 0, z);
}
@ -2468,7 +2469,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
}
}
+ (NSData*) allocWithZone: (NSZone*)z
+ (id) allocWithZone: (NSZone*)z
{
return (NSData*)NSAllocateObject(mutableDataMalloc, 0, z);
}
@ -3043,7 +3044,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
#if HAVE_SHMCTL
@implementation NSMutableDataShared
+ (NSData*) allocWithZone: (NSZone*)z
+ (id) allocWithZone: (NSZone*)z
{
return (NSData*)NSAllocateObject([NSMutableDataShared class], 0, z);
}

View file

@ -113,6 +113,10 @@ mframe_build_signature(const char *typePtr, int *size, int *narg, char *buf)
{
types++;
}
if (*types == '-')
{
types++;
}
while (isdigit(*types))
{
types++;
@ -448,6 +452,8 @@ mframe_next_arg(const char *typePtr, NSArgumentInfo *info)
*/
if (info->type[0] != _C_PTR || info->type[1] == '?')
{
BOOL negative = NO;
/*
* May tell the caller if the item is stored in a register.
*/
@ -456,11 +462,18 @@ mframe_next_arg(const char *typePtr, NSArgumentInfo *info)
typePtr++;
info->isReg = YES;
}
else if (info->isReg)
else
{
info->isReg = NO;
}
/*
* Cope with negative offsets.
*/
if (*typePtr == '-')
{
typePtr++;
negative = YES;
}
/*
* May tell the caller what the stack/register offset is for
* this argument.
@ -470,6 +483,10 @@ mframe_next_arg(const char *typePtr, NSArgumentInfo *info)
{
info->offset = info->offset * 10 + (*typePtr++ - '0');
}
if (negative == YES)
{
info->offset = -info->offset;
}
}
return typePtr;

View file

@ -80,6 +80,10 @@ typedef struct alpha_args {
{ \
(TYPE)++; \
} \
if (*(TYPE) == '-') \
{ \
(TYPE)++; \
} \
while (isdigit(*(TYPE))) \
{ \
(TYPE)++; \

View file

@ -33,6 +33,10 @@
{ \
(TYPE)++; \
} \
if (*(TYPE) == '-') \
{ \
(TYPE)++; \
} \
while (isdigit(*(TYPE))) \
{ \
(TYPE)++; \

View file

@ -30,6 +30,7 @@
(TYPE) = objc_skip_typespec(type); \
sprintf((DEST), "%.*s%d", (TYPE)-type, type, (CUM)); \
if (*(TYPE) == '+') (TYPE)++; \
if (*(TYPE) == '-') (TYPE)++; \
while (isdigit(*(TYPE))) \
{ \
(TYPE)++; \

View file

@ -110,6 +110,10 @@ typedef struct rs6000_args
{ \
(TYPE)++; \
} \
if (*(TYPE) == '-') \
{ \
(TYPE)++; \
} \
while (isdigit(*(TYPE))) \
{ \
(TYPE)++; \

View file

@ -65,6 +65,10 @@ struct sparc_args {
{ \
(TYPE)++; \
} \
if (*(TYPE) == '-') \
{ \
(TYPE)++; \
} \
while (isdigit(*(TYPE))) \
{ \
(TYPE)++; \

View file

@ -38,6 +38,10 @@
{ \
(TYPE)++; \
} \
if (*(TYPE) == '-') \
{ \
(TYPE)++; \
} \
while (isdigit(*(TYPE))) \
{ \
(TYPE)++; \

View file

@ -401,6 +401,7 @@ inline const char*
objc_skip_offset (const char* type)
{
if (*type == '+') type++;
if (*type == '-') type++;
while(isdigit(*++type));
return type;
}
@ -507,7 +508,9 @@ sel_types_match (const char* t1, const char* t2)
while (*t1 && *t2)
{
if (*t1 == '+') t1++;
if (*t1 == '-') t1++;
if (*t2 == '+') t2++;
if (*t2 == '-') t2++;
while (isdigit(*t1)) t1++;
while (isdigit(*t2)) t2++;
/* xxx Remove these next two lines when qualifiers are put in