Discussion:
decoding of long Int
PATIL Kailas
2009-10-09 10:51:40 UTC
Permalink
Hi,
I am new to Firefox.
While debugging the Firefox with gdb, I found there are some
variables/objects holds long int value. It is 15 digit value for
example, In XPCWrappedNative::CallMethod, following long Int I found,
Which I cannot decode?
name = 140340262156644
classword = 140340131011560

Does anyone knows how to decode this type of values?

regards,
Kailas
Boris Zbarsky
2009-10-09 14:57:21 UTC
Permalink
Post by PATIL Kailas
name = 140340262156644
classword = 140340131011560
Does anyone knows how to decode this type of values?
Decode in what sense? What the integer means depends on the exact field
you're looking at. Sometimes it's just an integer (e.g. a file size).
In the case of classword, it's a tagged pointer if it came out of a
JSObject.

In your case, |name| is of type jsval; you can use the various JSAPI
macros/functions (JSVAL_IS_*, JSVAL_TO_*, etc) to interrogate it. That
particular jsval happens to be a tagged pointer to a JSString.

Presumably you're on a 64-bit system, which is why the pointers look
like that.

-Boris
Kailas
2009-10-10 01:20:06 UTC
Permalink
Post by PATIL Kailas
name = 140340262156644
classword = 140340131011560
Does anyone knows how to decode this type of values?
Decode in what sense?  What the integer means depends on the exact field
you're looking at.  Sometimes it's just an integer (e.g. a file size).
In the case of classword, it's a tagged pointer if it came out of a
JSObject.
In your case, |name| is of type jsval; you can use the various JSAPI
macros/functions (JSVAL_IS_*, JSVAL_TO_*, etc) to interrogate it.  That
particular jsval happens to be a tagged pointer to a JSString.
Presumably you're on a 64-bit system, which is why the pointers look
like that.
-Boris
Yes, I am on a 64-bit system. Thx for your answer.

Loading...