aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2011-07-27 12:25:57 +1000
committerSteve Bennett <steveb@workware.net.au>2011-07-27 12:27:47 +1000
commitbc36d67ba502b3c5a5d141cd716d5cd80f9e60b0 (patch)
tree7226beb11a6d9ad091274569961fa27d04726ef7
parent07919bc624982b7a5ce2ac28975a3c5e39690499 (diff)
downloadjimtcl-bc36d67ba502b3c5a5d141cd716d5cd80f9e60b0.zip
jimtcl-bc36d67ba502b3c5a5d141cd716d5cd80f9e60b0.tar.gz
jimtcl-bc36d67ba502b3c5a5d141cd716d5cd80f9e60b0.tar.bz2
More info in debug show (maintainer mode)
Display refcount and type Signed-off-by: Steve Bennett <steveb@workware.net.au>
-rw-r--r--jim.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/jim.c b/jim.c
index 7b9f164..3671cba 100644
--- a/jim.c
+++ b/jim.c
@@ -145,7 +145,7 @@ static const Jim_HashTableType JimVariablesHashTableType;
/* Fast access to the int (wide) value of an object which is known to be of int type */
#define JimWideValue(objPtr) (objPtr)->internalRep.wideValue
-#define JimObjTypeName(O) (objPtr->typePtr ? objPtr->typePtr->name : "none")
+#define JimObjTypeName(O) ((O)->typePtr ? (O)->typePtr->name : "none")
static int utf8_tounicode_case(const char *s, int *uc, int upper)
{
@@ -7188,7 +7188,7 @@ static int JimExprOpIntUnary(Jim_Interp *interp, struct JimExprState *e)
static int JimExprOpNone(Jim_Interp *interp, struct JimExprState *e)
{
- JimPanic((e->opcode != JIM_EXPROP_FUNC_RAND));
+ JimPanic((e->opcode != JIM_EXPROP_FUNC_RAND, interp, "JimExprOpNone only support rand()"));
ExprPush(e, Jim_NewDoubleObj(interp, JimRandDouble(interp)));
@@ -12190,6 +12190,7 @@ static int Jim_DebugCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const *ar
}
s = Jim_GetString(argv[2], &len);
charlen = Jim_Utf8Length(interp, argv[2]);
+ printf("refcount: %d, type: %s\n", argv[2]->refCount, JimObjTypeName(argv[2]));
printf("chars (%d): <<%s>>\n", charlen, s);
printf("bytes (%d):", len);
while (len--) {