Compare commits

...

421 Commits

Author SHA1 Message Date
(no author)
b635ac6602 This commit was manufactured by cvs2svn to create tag 'JS14_990302'.
git-svn-id: svn://10.0.0.236/tags/JS14_990302@22549 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 08:28:00 +00:00
brendan%netscape.com
a198deb328 Avoid dangling else (egcs warns about it) and else-after-return.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@22548 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 08:27:59 +00:00
brendan%netscape.com
ad167c6106 - Added 'W' format to JS_ConvertArguments, for conversion to string and return
via a jschar* out parameter.
- Fused common string conversion and argv[i] GC-rooting code in JS_ConvertArgs.
- Added to cvtargs test command, which really needs to stop using a hardwired
  format string!
- Fixed char-typed fgetc-receiving variable to be of int type for correct EOF
  comparison on machines with unsigned chars.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@22509 18797224-902f-48f8-a5cc-f745e15eee43
1999-03-02 02:38:45 +00:00
wynholds%netscape.com
6cc77db7b6 need to add the jar path for the class files. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@22235 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-26 23:04:36 +00:00
wynholds%netscape.com
c8d1223362 making depedency checking work on java files. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@22232 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-26 22:56:50 +00:00
wynholds%netscape.com
f0c9781f09 gotta point to the jar executable. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@22116 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-26 16:45:13 +00:00
wynholds%netscape.com
3f3ecbc08a getting NT to build java classes. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@22018 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-26 02:02:25 +00:00
wynholds%netscape.com
6b9bdfec42 adding java classes to build and putting jar file in distribution. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@22013 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-26 01:28:53 +00:00
rogerl%netscape.com
b5361f54b7 Moved anchoring from EOL and into mainstream, fixed some weird edge case
behaviours from BOL and EOL.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@21778 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-24 19:21:42 +00:00
wynholds%netscape.com
31431e4dcd i guess we are staying with ld for linking. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@21661 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-23 23:51:12 +00:00
wynholds%netscape.com
3c0b753eb3 using NT version of NSPR now, not 95 version. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@21660 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-23 23:48:15 +00:00
wynholds%netscape.com
6c4639603b getting things inline with ES4.0. hope MS likes this, too. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@21655 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-23 22:10:11 +00:00
fur%netscape.com
6135a00aba Get rid of useless platform ifdef tests
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@21649 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-23 20:20:36 +00:00
wynholds%netscape.com
7e021bc7b6 nspr lib is now nspr3.lib on NT, not libnspr3.lib. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@21344 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-19 22:20:16 +00:00
wynholds%netscape.com
e72e613ee4 changes to nspr 3.1beta -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@21340 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-19 21:44:01 +00:00
wynholds%netscape.com
0f8ee32b40 more name things. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@21335 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-19 21:28:47 +00:00
wynholds%netscape.com
d469ea9fb0 fixes for 3.1 beta NSPR drop. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@21334 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-19 21:25:22 +00:00
wynholds%netscape.com
6563f56749 going to nspr 3.1beta -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@21268 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-19 03:02:24 +00:00
wynholds%netscape.com
7cfa27ae3e new name for jsj. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@21145 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-18 16:34:50 +00:00
jband%netscape.com
df2143dd3e changed MAP_IS_NATIVE to allow for objects that have their own jsObjectOps but still use the slots in the 'normal' manner - same change as made on SpiderMonkeyDev_BRANCH
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@21127 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-18 04:58:46 +00:00
fur%netscape.com
8f5eecd125 Build jsj.dll w/o linking to a specific Java DLL
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@21089 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-18 02:02:16 +00:00
fur%netscape.com
f5bd095197 Really, this time: Don't put debug information in PDB files. Leave it in the
DLL's and OBJ's.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@21082 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-18 01:04:11 +00:00
fur%netscape.com
bb573693da It's now possible to build the LiveConnect library without linking to a
particular Java library.  Now, the same jsj.dll can work with either JDK1.1
or JDK1.2.  Note that the LC shell must still link with Java.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@21081 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-18 01:03:25 +00:00
fur%netscape.com
6b0ec81b7d Don't create PDB file when linking
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@21040 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-17 23:20:45 +00:00
brendan%netscape.com
a298bbdd7a QuoteString must escape backslash (duh; thanks to mccabe).
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@21029 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-17 22:36:49 +00:00
wynholds%netscape.com
4704eaa6b0 adding support for IRIX 6.5 n32. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@20855 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-17 02:20:08 +00:00
wynholds%netscape.com
27b2b41087 adding file for IRIX 6.5. for now, the same as 6.2 and 6.3 -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@20843 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-17 01:38:51 +00:00
wynholds%netscape.com
5482ed1dd6 only add jsautocfg.h to HFILES if it is not prebuilt. but if it is, where is it?
-mw


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@20603 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-12 19:19:01 +00:00
wynholds%netscape.com
18990eae9f adding jsautocfg.h to package. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@20593 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-12 18:56:35 +00:00
wynholds%netscape.com
98fed0e388 1) HP shared libraries use .sl now (not .so)
2) liveconnect libraries called libjsj now (not jsj)
-mw


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@20501 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-12 02:25:28 +00:00
wynholds%netscape.com
05b3c1feba now packaging all .h, .tbl, and .msg files in include directory. also including static libraries in lib directory. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@20496 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-12 01:57:59 +00:00
wynholds%netscape.com
763a52754a not including libnspr anymore. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@20446 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-11 23:07:34 +00:00
shaver%netscape.com
869b786447 fix leaking of object lock count during XDR function decode
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@20111 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-09 05:08:40 +00:00
wynholds%netscape.com
877ec80ac9 fixing linux NSPR-getting problem. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@19857 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-05 16:39:04 +00:00
shaver%netscape.com
2d4fb99438 XDR should know about exceptions, and should also correctly handle source notes
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@19467 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-03 17:32:36 +00:00
wynholds%netscape.com
8937da7e07 NSPR_VERSION 19980120 -> v3.0 -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@19366 18797224-902f-48f8-a5cc-f745e15eee43
1999-02-02 20:09:04 +00:00
brendan%netscape.com
c1ae1240f0 - Fix egregious bug: missing 0 terminator at end of js_EscapeMap.
- Fix QuoteString so it doesn't stop on an embedded \u0000 in its input string.
- Add some comments to QuoteString.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@19073 18797224-902f-48f8-a5cc-f745e15eee43
1999-01-30 01:42:33 +00:00
fur%netscape.com
39978272c7 Build with debug information embedded inside DLL instead of separate .pdb file.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@18915 18797224-902f-48f8-a5cc-f745e15eee43
1999-01-28 07:43:22 +00:00
rogerl%netscape.com
e35e5fc1a2 Bug #331783 - separate initialization from increment for 'for in' loop
with index expression in order to prevent side-effects from occuring
when the for loop stops (as in 'for (p[i++] in obj)...')


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@18831 18797224-902f-48f8-a5cc-f745e15eee43
1999-01-28 00:07:24 +00:00
rogerl%netscape.com
72970118bb Forgive EOLONLY from having to be anchored as it handles it itself.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@18040 18797224-902f-48f8-a5cc-f745e15eee43
1999-01-19 23:49:07 +00:00
rogerl%netscape.com
0b8141bb35 Merged bug fixes back from Dev branch :
- /|a/ was interpreted as literal
- {} didn't back-track
- NONxxx opcodes didn't handle end of string
- NCCLASS allowed end of string
- /(a*)/ didn't have ANCHOR opcode


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@18024 18797224-902f-48f8-a5cc-f745e15eee43
1999-01-19 20:15:47 +00:00
rogerl%netscape.com
cf6032ba80 Changed GrowBuffer to double the existing length of the token buffer instead
of growing linearally. This helps for really, really big string literals.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@17910 18797224-902f-48f8-a5cc-f745e15eee43
1999-01-16 02:51:11 +00:00
brendan%netscape.com
f4d17774f7 Fix anchoring and multiline bol-matching to handle empty match at end (mozilla bug 2157).
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@17210 18797224-902f-48f8-a5cc-f745e15eee43
1999-01-06 00:38:00 +00:00
fur%netscape.com
fbdad4090a Use new -n32 ABI instead of old, -32 one
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@16629 18797224-902f-48f8-a5cc-f745e15eee43
1998-12-18 02:20:19 +00:00
shaver%netscape.com
2a051d9305 fix up AddRoot handling
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@16572 18797224-902f-48f8-a5cc-f745e15eee43
1998-12-17 16:23:56 +00:00
rogerl%netscape.com
49a03a8d3a Fixes for wide chars, debugging output + handling ucflats in alternates.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@16358 18797224-902f-48f8-a5cc-f745e15eee43
1998-12-14 19:31:46 +00:00
rogerl%netscape.com
e8c1dbab30 Moving into release branch - no line number for not a function error
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@16357 18797224-902f-48f8-a5cc-f745e15eee43
1998-12-14 19:22:50 +00:00
rogerl%netscape.com
134056767c Moving fix into release branch - bug #336744, decompile of function
containing eval


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@16356 18797224-902f-48f8-a5cc-f745e15eee43
1998-12-14 19:20:20 +00:00
fur%netscape.com
5d4f73f8d9 Minor changes to exception-handling code:
+ Cleanup unused variables
  + Fix use of uninitialized variable class_descriptor
  + Fix release of reference to java_class.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@16075 18797224-902f-48f8-a5cc-f745e15eee43
1998-12-09 19:25:45 +00:00
coop%netscape.com
2c0f27d985 Added support for "throw null". Surfaced GC problem.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@16059 18797224-902f-48f8-a5cc-f745e15eee43
1998-12-09 16:56:34 +00:00
coop%netscape.com
440708a434 Replace superfluous do_report code with call to jsj_ReportError.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@15962 18797224-902f-48f8-a5cc-f745e15eee43
1998-12-08 04:04:15 +00:00
coop%netscape.com
adb1a82ea5 Removed case for JSTYPE_LIMIT and added special case for JSTYPE_VOID.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@15943 18797224-902f-48f8-a5cc-f745e15eee43
1998-12-08 00:21:03 +00:00
coop%netscape.com
a7d94f9340 Get proper class descriptor from java_obj in vreport_java_error - allows for
proper unwrapping of exceptions held in JSException objects.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@15788 18797224-902f-48f8-a5cc-f745e15eee43
1998-12-04 17:30:41 +00:00
coop%netscape.com
a99d73f83f Trimmed exception code.
Replaced comment reference to JSTYPE_LIMIT.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@15644 18797224-902f-48f8-a5cc-f745e15eee43
1998-12-02 20:05:32 +00:00
fur%netscape.com
8b62670504 Added JavaClass constructor, which takes an instance of java.lang.Class as
an argument and returns the corresponding JavaClass object.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@15615 18797224-902f-48f8-a5cc-f745e15eee43
1998-12-02 03:59:41 +00:00
fur%netscape.com
ca76e82e7a Compiler-generated file shouldn't be checked in
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@15502 18797224-902f-48f8-a5cc-f745e15eee43
1998-12-01 04:23:35 +00:00
wynholds%netscape.com
e53f7bebb4 getting rid of nsinstall-target dependency. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@15210 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-24 00:58:33 +00:00
fur%netscape.com
e3f7dcc298 JRI not used anymore
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@15143 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-23 00:04:40 +00:00
fur%netscape.com
b2663eab6a Initialization of Java object->JSObject hash table was occurring in the wrong
place, resulting in new hash tables created for every JSContext.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@15141 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-22 23:27:59 +00:00
fur%netscape.com
3afc15660d Added more paranoid DEBUG-only code.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@15140 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-22 23:26:13 +00:00
fur%netscape.com
e4c99be06d Get rid of 16-bit resource definition file
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@15139 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-22 23:25:37 +00:00
fur%netscape.com
34d98661bc No more non-threadsafe JavaToJSSavedState struct
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@15138 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-22 23:24:57 +00:00
fur%netscape.com
75d9ce90d0 Added OJI-include of prtypes.h, because OJI's version of jni.h depends on
HAVE_LONG_LONG.  (Why aren't we using the standard jni.h ?)


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@15114 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-21 23:28:20 +00:00
fur%netscape.com
c28d22e190 No longer needed
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@15113 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-21 22:54:17 +00:00
fur%netscape.com
d763678802 JSException JNI header file is not needed.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@15112 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-21 22:53:39 +00:00
fur%netscape.com
d2ec51db02 Changed some ifdef JSJ_THREADSAFE code back to JS_THREADSAFE, as it shouldn't
have changed in the first place.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@15111 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-21 22:52:53 +00:00
fur%netscape.com
8118d76c54 Was out of sync with .java file
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@15110 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-21 21:49:33 +00:00
fur%netscape.com
1e545e45f4 + Fix the last few thread-safety nits.
+ Allow LiveConnect thread-safety to be turned off, even
  if JS_THREADSAFE is set (for OJI, which supplies their own thread-safety)


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@15039 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-20 20:15:44 +00:00
fur%netscape.com
773987c3dc Fix bug #335589: Rounding should be done *before* out-of-range check
when converting JS number to Java integral type.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@14969 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-20 00:16:40 +00:00
fur%netscape.com
0405c4e93f Fix #335449:
ECMA's [[DefaultValue]] operator is busted for functions & closures
  when hint != String


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@14942 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-19 09:10:00 +00:00
fur%netscape.com
88ac0c1df0 Added explicit method overload resolution for Java constructors in addition
to the existing schemes for instance and static methods.  (Originally, this
was not going to be a feature of LC3, but cbegle demonstrated why it was
necessary.)


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@14916 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-19 00:03:03 +00:00
fur%netscape.com
b3e84af06b Fix bug #335392. (Assert-botch when explicitly resolving a non-overloaded
static method.)


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@14897 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-18 22:18:04 +00:00
fur%netscape.com
7aed5cdcb5 Merge changes from 9/20/98 OJI version of LiveConnect.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@14886 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-18 20:37:30 +00:00
fur%netscape.com
90daf10163 *** empty log message ***
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@14752 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-16 21:33:09 +00:00
fur%netscape.com
f5156071db Eliminate string=>boolean conversions
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@14751 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-16 21:32:52 +00:00
(no author)
3f66410d0e This commit was manufactured by cvs2svn to create branch
'SpiderMonkey140_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@14630 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-13 22:49:03 +00:00
fur%netscape.com
68da4b0d15 Conversion of JS NaN to any Java integral type now results in an error.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@14496 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-12 04:55:38 +00:00
fur%netscape.com
b247b70b8f Eliminated the following as legal conversions:
JS null    ==> any Java primitive type
  JS number  ==> boolean
  JavaObject ==> boolean
  JavaArray  ==> boolean


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@14495 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-12 04:54:57 +00:00
fur%netscape.com
61a8633ee5 Changed the rules for LC3 conversion from JS undefined to be more like LC1 and
less like LC2.  To wit, converting from JS undefined to any Java value except
a java.lang.String results in an error.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@14493 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-12 03:35:37 +00:00
fur%netscape.com
195415f91a Fix possible use before set
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@14492 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-12 03:33:53 +00:00
fur%netscape.com
2245830eca Propagating fix to 333916 from SpiderMonkeyDev_BRANCH
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@14410 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-11 04:20:03 +00:00
fur%netscape.com
226e7c6182 + Be aggressive about deleting local JNI references. (Theoretically, it
shouldn't be necessary to free such references, but otherwise they might
  only be collected if the JVM uses a conservative stack-scanning GC.)

+ Fix problem in which JavaClassDescriptor's were not being fully free'ed at
  shutdown.

+ Disabled ref-counting of JavaClassDescriptors.  It's relatively common
  to develop cycles in the graph of JavaClassDescriptors, which leads to
  unused JavaClassDescriptors.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@14409 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-11 04:13:10 +00:00
fur%netscape.com
759f28cd80 Be aggressive about deleting local JNI references. (Theoretically, it
shouldn't be necessary to free such references, but otherwise they might
only be collected if the JVM uses a conservative stack-scanning GC.)


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@14365 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-10 21:51:08 +00:00
coop%netscape.com
d34d20f735 Implemented changes to primitve type exception throwing as suggested by fur.
Namely:
- poke Java fields directly (native code) rather than with Java accessor methods
- handling of NULL as object
- proper use of class_descriptor


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@14362 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-10 20:08:29 +00:00
fur%netscape.com
8d3b460728 + Be aggressive about deleting local JNI references. (Theoretically, it
shouldn't be necessary to free such references, but otherwise they might
  only be collected if the JVM uses a conservative stack-scanning GC.)
+ Don't propagate reported JS warnings as JSExceptions.
+ Don't propagate JS error reports that are the result of JS exceptions,
  since the originating exception will later be processed.
+ Touched up white-space, formatting, comments


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@14357 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-10 18:24:36 +00:00
fur%netscape.com
e888619c62 Be aggressive about deleting local JNI references. (Theoretically, it
shouldn't be necessary to free such references, but otherwise they might
only be collected if the JVM uses a conservative stack-scanning GC.)


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@14356 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-10 18:19:55 +00:00
fur%netscape.com
ccaa088be9 Renumbered to eliminate gap in numerical sequence. The gap was causing
the wrong error string to be displayed in some cases.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@14354 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-10 18:09:32 +00:00
fur%netscape.com
02417b3d15 + Fixed leakage of fatal initialization error string
+ Cleaned up formatting, white-space, comments


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@14353 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-10 18:09:18 +00:00
fur%netscape.com
e0cf93383f + Improved error message when failing to convert from a non-numeric JS
type to a numeric Java type
+ Be aggressive about deleting local JNI references.  (Theoretically, it
  shouldn't be necessary to free such references, but otherwise they might
  only be collected if the JVM uses a conservative stack-scanning GC.)
+ Eliminated 'ifdef LIVECONNECT_IMPROVEMENTS' code, since it was all unused
+ Cleaned up formatting, white-space, comments


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@14352 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-10 18:08:46 +00:00
fur%netscape.com
93b52b4c6b Be aggressive about deleting local JNI references. (Theoretically, it
shouldn't be necessary to free such references, but otherwise they might
only be collected if the JVM uses a conservative stack-scanning GC.)


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@14351 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-10 18:08:11 +00:00
fur%netscape.com
524971b786 + Eliminated undesirable tab characters
+ Free local JNI reference to Java class.  (Theoretically, it shouldn't be
  necessary to free such references, but otherwise they are only collected
  if the JVM uses a conservative stack-scanning GC.)


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@14350 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-10 18:06:41 +00:00
fur%netscape.com
0feefb7733 Eliminated undesirable tab characters
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@14349 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-10 18:06:16 +00:00
fur%netscape.com
df197a44ac Added note about dual-GC problem
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@14254 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-08 02:01:55 +00:00
fur%netscape.com
2cc51c1051 Added new sections:
+ Table of Contents
  + Limitations/To-Do
  + Sample LiveConnect shell interactions

Updated sections:

  + Build instructions
  + Introduction
  + Compatibility


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@14252 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-08 01:49:47 +00:00
fur%netscape.com
b8cb580424 1) Fixed bug when converting from java.lang.Boolean to JS boolean that
affected only JS1.2 and older (non-ECMA mode).

2) Conversion of JS underfined to Java boolean is now an error (previously
   converted to false).


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@14229 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-07 03:11:40 +00:00
coop%netscape.com
712ca7d5ca Added basic support for proper native type throwing/handling.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@14195 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-06 15:18:41 +00:00
shaver%netscape.com
3dc5e3dd91 added new jsXPCOM stuff from bjorn
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@14158 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-05 20:55:16 +00:00
mang%netscape.com
f140c0c81b Fixed path problems. Now works and stuff.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@14029 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-04 02:01:56 +00:00
mang%netscape.com
52d6b91235 Recur into fdlibm directory.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@14017 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-03 23:12:56 +00:00
mccabe%netscape.com
55dc58958a Propagate cls@seawood.org fix:
Removed some MKLINUX & MACLINUX ifdefs. Replace a couple with
(defined(linux) && defined(__powerpc__)).  Added glibc ifndefs to
strdup declarations.  Fixed problem with stderr under glibc 2.1.

Patch submitted by Tom Rini <trini@kernel.crashing.org>.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@14015 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-03 22:51:28 +00:00
mang%netscape.com
682df8db3e For autoconf.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13984 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-03 14:21:21 +00:00
mang%netscape.com
8ed39db9a8 Revved to match Makefile
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13983 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-03 14:08:14 +00:00
mang%netscape.com
33d0464867 More cruft removal.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13982 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-03 13:39:35 +00:00
mang%netscape.com
490b91850b Added dependency on jslibmath.h
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13981 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-03 13:30:38 +00:00
mang%netscape.com
25da940352 Don't build or link useless files.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13980 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-03 13:16:04 +00:00
mang%netscape.com
f0ca36ba7d Need the real ld. Available on most (all?) platforms.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13979 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-03 12:27:16 +00:00
mang%netscape.com
480dbe043f fdlibm makefile.win
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13978 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-03 12:02:26 +00:00
mang%netscape.com
19b9471938 fdlibm Makefile
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13973 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-03 09:35:31 +00:00
mang%netscape.com
68fe0d88b6 Statically link jsmath.o against libfdm.a so as to link in only those
math routines that are needed.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13952 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-03 05:57:54 +00:00
mang%netscape.com
a6fcbc6e38 Sometimes I forget that the whole world doesn't use GNU tools.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13950 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-03 05:45:11 +00:00
mang%netscape.com
a0f85cea3a Post release cleanup.
Removed unnecessary defines (fd_fmod will be used later).
Removal of unnecessary files in fdlibm to follow.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13947 18797224-902f-48f8-a5cc-f745e15eee43
1998-11-03 01:29:14 +00:00
fur%netscape.com
3f5735fcf7 Added more compiler build flags so that we use the correct libc DLL and optimization settings
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13784 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-31 02:58:41 +00:00
mang%netscape.com
0ab0796234 Backed out use of fd_floor on IRIX. See bugsplat bug #332475.
IRIX system floor now fails this special case:
Infinity/Math.floor(-0) = Infinity  FAILED! expected: -Infinity


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13780 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-31 01:32:50 +00:00
jband%netscape.com
0e145d79c2 modified makefile and readme to more easily support tree structure in jsjava.jar
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13776 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-31 00:54:54 +00:00
jband%netscape.com
3e89c252c4 updated README
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13741 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-30 21:41:20 +00:00
jband%netscape.com
6e0204a004 improved comments
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13740 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-30 21:38:52 +00:00
shaver%netscape.com
4b9ed1baa8 allow additional flags to the linker, so we can specify soname and such; need variants for other Unix platforms, but do those later
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13728 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-30 18:09:50 +00:00
norris%netscape.com
b9f4c69e12 Update release string format.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13687 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-29 23:31:24 +00:00
bjorn%netscape.com
5f6a0b9c3a Patch which fixes a problem in the alignment code. I wasn't taking sizeof(JSString)
properly.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13683 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-29 22:38:41 +00:00
fur%netscape.com
f68735a6bb wtc sez': Get rid of use of obsolete NSPR20 build var.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13676 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-29 21:59:30 +00:00
fur%netscape.com
8616bd54f5 Removing obsolete file
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13675 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-29 21:51:46 +00:00
fur%netscape.com
09e0785f68 Removing obsolete/unused files.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13674 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-29 21:50:22 +00:00
fur%netscape.com
dd8953010a Removed uses of obsolete NSPR20 build variable
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13673 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-29 21:43:17 +00:00
fur%netscape.com
a67d8ed2fe + Updated build directions for all platforms.
+ Added table of contents.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13663 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-29 20:00:58 +00:00
shaver%netscape.com
935f0e5ac8 need to poke the GC when hitting the cache on a set
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13645 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-29 03:55:53 +00:00
fur%netscape.com
97aa1f7699 Ignore generated files
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13643 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-29 02:15:23 +00:00
fur%netscape.com
f399e21216 Reporting of uncaught exceptions should occur when JS_HAS_EXCEPTIONS is set,
even if JS_HAS_ERROR_EXCEPTIONS is not.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13642 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-29 02:09:34 +00:00
coop%netscape.com
823cb6e29e Made constructor for wrappedException private and removed deprecation warning.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13638 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-29 00:43:38 +00:00
fur%netscape.com
84e135cd01 Restore build prosperity for Mac LiveConnect after ref/src merge.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13637 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-29 00:24:05 +00:00
fur%netscape.com
ac3516411a No real change: Reorganized a few .c files that had fallen out of their folder.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13636 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-29 00:23:02 +00:00
mang%netscape.com
db237360fa Added section for AIX, thus fixing several bugs.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13634 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-29 00:16:38 +00:00
fur%netscape.com
92e443d317 Restore Mac-specific Java file, lost in the ref/src transition
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13633 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-29 00:12:41 +00:00
rogerl%netscape.com
87c9e8ae4d Changed references to stdout and stderr to generic file handles so that all
output can be redirected to a file. This is needed for the mac where shell
redirection is not an option.
Added MAC_TEST_HACK that uses this redirection and also parses a text file
to build the argv/argc values.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13632 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-28 22:12:01 +00:00
fur%netscape.com
3fa38c1d6a Added a workaround for a bug in AIX JDK1.1.6 (See #331620), in which
static initializers are not run when a static field is referenced from
native code.  The problem does not manifest itself if the field is
accessed from Java code, so we first call some Java code to access
the fields of interest before attempting to read them from native code.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13621 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-28 20:22:22 +00:00
norris%netscape.com
ce487f127c Fix 331720 Continue to label in for..in doesn't work
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13612 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-28 20:13:50 +00:00
fur%netscape.com
cc1651828e We allow conversion from NaN numbers to Java integral types, but not when
the NaN is the result of conversion from a non-number, e.g. a string.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13609 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-28 17:59:10 +00:00
fur%netscape.com
22f7fd9b4a Fixed two related bugs in overloaded method resolution:
+ The precedence of java.lang.String was higher than it should have been
  + When an ambiguous method match was reported, the best-matching method
    was being left off the list.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13605 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-28 17:06:01 +00:00
mccabe%netscape.com
ad72e12927 Added proposed methods Object.prototype.hasOwnProperty,
Object.prototype.propertyIsEnumerable,
Object.prototype.isPrototypeOf... all turned off for v140 in
jsconfig.h.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13603 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-28 06:31:55 +00:00
fur%netscape.com
b6ada3318c Fix for #331634: Inability to invoke Java method when a method and field have
the same name.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13598 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-28 05:26:58 +00:00
bjorn%netscape.com
82ac5c4e2f Fixes for AIX and SunOS. AIX now compiles and runs in optimized mode as well,
and SunOS now compiles for common architecture when JS_THREADSAFE is not set.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13595 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-28 04:07:35 +00:00
wynholds%netscape.com
5430e4b688 for use with creating source jar file. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13586 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-28 02:25:31 +00:00
wynholds%netscape.com
33219cbcb1 adding shipSource target which will, yep, you guessed it, ship the source. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13582 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-28 02:03:45 +00:00
mang%netscape.com
e10c7eb54b Replace native exp on Linux opt build.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13578 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-28 00:39:25 +00:00
mang%netscape.com
70bd48b576 Math.toSource() == 'Math'
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13577 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-27 23:56:19 +00:00
bjorn%netscape.com
6bc17963c7 *** empty log message ***
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13576 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-27 23:53:01 +00:00
mang%netscape.com
168c0f6f50 Want to use some fdlibm functions but fdlibm broken on OSF1/alpha.
See bugsplat bugs 331500, 332038


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13572 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-27 23:07:40 +00:00
fur%netscape.com
eef72a91bc More LC3 features:
+ The __proto__ property of JavaObjects can be assigned and the
  prototype chain of these objects is searched, just as the engine's
  built-in js_ObjectOps routines do.  This is a featurette for the
  NGLayout DOM.

+ Static Java methods and fields can now be accessed via LiveConnect
  through an instance of a Java class, just as in Java itself.

+ Instances of java.lang.String "inherit" the standard ECMA string
  methods of String.prototype.  (All of the ECMA string methods
  convert the Java string to a JS string before operating on it.)

+ Similarly, instances of Java arrays "inherit" the standard ECMA
  array methods of Array.prototype.  (Not all of these methods work
  properly on JavaArray objects, however, since the 'length' property
  is read-only.)


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13571 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-27 22:28:03 +00:00
rogerl%netscape.com
76e06e7e4d Bug from field - unicode handling messed up with 2 or more unicode literal
characters ("i" only) - missing multiply and endian problem.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13570 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-27 21:57:10 +00:00
rogerl%netscape.com
6d03a825d3 Bug #331349, previous fix to disallow object to function conversion was too
sweeping, screwing up closures. Now we proceed with the convert if a call op
exists in the class.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13567 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-27 18:45:54 +00:00
shaver%netscape.com
9a0cc72a2d quell (spurious) warnings
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13565 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-27 16:57:19 +00:00
norris%netscape.com
6139484b7e Fix warnings.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13548 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-27 04:53:40 +00:00
fur%netscape.com
b576db0575 Eliminated gcc warnings, some spurious, some indicative of real bugs:
Spurious warnings:
jsobj.c: In function `js_EnterSharpObject':
    jsobj.c: In function `js_obj_toSource':
    jsobj.c:365: warning: `nchars' might be used uninitialized in this function
    jsobj.c: In function `obj_eval':
    jsobj.c:588: warning: `implicitWith' might be used uninitialized in this function
    jsobj.c: In function `js_DefineProperty':
    jsobj.c:1323: warning: `_c' might be used uninitialized in this function
    jsobj.c: In function `js_LookupProperty':
    jsobj.c:1394: warning: `_c' might be used uninitialized in this function
    jsobj.c: In function `js_FindProperty':
    jsobj.c:1472: warning: `lastobj' might be used uninitialized in this function
    jsobj.c: In function `js_GetProperty':
    jsobj.c:1599: warning: `_c' might be used uninitialized in this function
    jsobj.c: In function `js_SetProperty':
    jsobj.c:1645: warning: `protoid' might be used uninitialized in this function
    jsobj.c:1646: warning: `protogetter' might be used uninitialized in this function
    jsobj.c:1646: warning: `protosetter' might be used uninitialized in this function
    jsobj.c:1647: warning: `protoattrs' might be used uninitialized in this function
    jsobj.c:1665: warning: `_c' might be used uninitialized in this function
    jsobj.c: In function `js_DeleteProperty':
    jsobj.c:1939: warning: `_c' might be used uninitialized in this function

Warnings indicating real bugs:
jsobj.c: In function `js_EnterSharpObject':
    jsobj.c:252: warning: `sharpid' might be used uninitialized in this function


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13547 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-27 04:35:50 +00:00
fur%netscape.com
1858d69e49 Fixed gcc warnings (and real bugs indicated by warnings)
Spurious warnings:
jsdtoa.c: In function `JS_strtod':
    jsdtoa.c:1210: warning: `bb' might be used uninitialized in this function
    jsdtoa.c:1210: warning: `bd' might be used uninitialized in this function
    jsdtoa.c:1210: warning: `bs' might be used uninitialized in this function
    jsdtoa.c:1210: warning: `delta' might be used uninitialized in this function
    jsdtoa.c: In function `JS_dtoa':
    jsdtoa.c:1913: warning: `ilim1' might be used uninitialized in this function

Real errors:
    jsdtoa.c: In function `JS_dtoa':
    jsdtoa.c:1913: warning: `ilim' might be used uninitialized in this function
    jsdtoa.c:1915: warning: `spec_case' might be used uninitialized in this function
    jsdtoa.c:1921: warning: `mlo' might be used uninitialized in this function


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13539 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-27 03:10:55 +00:00
mccabe%netscape.com
76326b2efb Warning fix to 331245.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13536 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-27 02:53:22 +00:00
fur%netscape.com
06a7abeacf Fix allocation bug caused by use of initialized variable, discovered via gcc warning
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13531 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-27 01:21:16 +00:00
mang%netscape.com
2ae04afc70 Added section for OSF1. Fixes lots of ecma math bugs.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13526 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-27 00:18:43 +00:00
norris%netscape.com
754415d2a7 Fix "js -f x.js" for Christine.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13496 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-26 22:59:10 +00:00
norris%netscape.com
d719a6f851 Fix warnings, and clean up memory leak.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13482 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-26 21:23:56 +00:00
waldemar%netscape.com
cdcef88024 Fixed Mac warnings
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13479 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-26 21:16:28 +00:00
jband%netscape.com
34fd322859 adding READMEs
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13478 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-26 21:09:49 +00:00
jband%netscape.com
d848312079 adding a doc
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13475 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-26 20:45:49 +00:00
mccabe%netscape.com
cdc32c49b5 Fix warnings:
jsstr.c: In function `str_escape':
jsstr.c💯 warning: `mask' might be used uninitialized in this function
jsstr.c: In function `str_split':
jsstr.c:1415: warning: `limit' might be used uninitialized in this function
jsstr.c: In function `tagify':
jsstr.c:1746: warning: `parlen' might be used uninitialized in this function


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13473 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-26 20:22:17 +00:00
jband%netscape.com
93a992bb20 fixed compile error when JS_THREADSAFE used
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13470 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-26 20:13:52 +00:00
mccabe%netscape.com
256ad44f6c Quiet these warnings:
jsarray.c: In function `IdIsIndex':
jsarray.c:81: warning: `c' might be used uninitialized in this function
jsarray.c: In function `array_splice':
jsarray.c:948: warning: `obj2' might be used uninitialized in this function


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13469 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-26 20:10:29 +00:00
jband%netscape.com
c76f45fb75 adding two helper batchfiles
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13468 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-26 20:09:33 +00:00
norris%netscape.com
a7a3555cc8 Fix warnings.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13466 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-26 19:39:13 +00:00
rogerl%netscape.com
3140821cd1 #318482, recursive death arising from defining valueOf to be the this object
is now a version 1.2 feature only.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13462 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-26 19:16:08 +00:00
rogerl%netscape.com
befd55d8ba #318482, recursive death arising from defining valueOf to be the this object
is now only a version 1.2 feature, but the error mechanism needed to be
protected from failure even so.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13460 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-26 19:15:01 +00:00
norris%netscape.com
3962bfda99 Fix warnings under gcc.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13458 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-26 18:39:01 +00:00
norris%netscape.com
faca6b626e "js -f foo.js" wasn't working correctly.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13455 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-26 18:13:40 +00:00
fur%netscape.com
8c1af11605 Eliminate gcc warnings
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13452 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-26 17:41:35 +00:00
fur%netscape.com
6c8f42225c + Eliminated unused JavaMemberVal struct/type
+ Tweaked JS->Java method overload resolution
   + Don't allow JavaArrays to be passed as arguments to Java methods
     that accept scalar numeric types, since there's no meaningful
     conversion available.
   + Permit JavaObjects and JavaArrays to be passed to Java methods
     that accept a boolean argument for backward-compatibility.

+ Added explicit overload-method resolution to override ambiguous cases, e.g.
  m = java.lang.String["valueOf(char[],int,int)"]
  return m(myCharArray, 3, 7);


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13443 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-26 07:03:41 +00:00
norris%netscape.com
847bebb065 Implement X.Y.Z implementation version.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13442 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-26 05:44:04 +00:00
norris%netscape.com
2c9b897958 Fix 330840 monkey - assertion failure in import expression decompilation
Wrong length for JSOP_IMPORTELEM.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13440 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-26 05:38:22 +00:00
bjorn%netscape.com
b01cc3080f Added volatile to avoid bug in gcc
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13434 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-25 22:45:22 +00:00
bjorn%netscape.com
9cd7750dd1 move_sym_to_front avoids aliasing problem on AIX
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13432 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-25 22:17:57 +00:00
mang%netscape.com
ed9c4d7ee1 Don't use fdlibm by default.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13408 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-24 01:49:17 +00:00
bjorn%netscape.com
ceb34941c8 Changed the typedef of JSCList to work around what seems to be a bug in gcc and xlc (AIX).
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13407 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-23 23:56:29 +00:00
mang%netscape.com
f20e53875b Don't use fdlibm by default.
There can be problems with endian-ness.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13406 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-23 23:53:45 +00:00
norris%netscape.com
7c8275aae3 Use %p to print out pointer values: works better on 64 bit machines.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13405 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-23 21:35:56 +00:00
jband%netscape.com
30e0d801a7 fix default target - msdev bug in writing out .mak file!
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13397 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-23 20:34:18 +00:00
fur%netscape.com
a899984e09 Added fdlibm
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13393 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-23 19:43:52 +00:00
coop%netscape.com
54e5a64304 Constructors are once again public, but have been marked as deprecated so
that people won't get too fond of using them.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13392 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-23 19:23:36 +00:00
fur%netscape.com
4016979d0d Added fdlibm
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13391 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-23 19:16:28 +00:00
fur%netscape.com
663693cafe Ignore .pdb files
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13388 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-23 18:24:44 +00:00
wynholds%netscape.com
aed4dd4310 fixing NT build with new fdlibm stuff and an old error gone unnoticed until now. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13379 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-23 17:30:41 +00:00
norris%netscape.com
6c7c73d822 Fix 330845 digital unix: arithmetic exception in string stuff:
Expression "argv[argc-1]", where argc == 0 and argc was a 32 bit unsigned quantity,
was causing a memory exception on the 64 bit machine because it was evaluating as
argv[0xffffffff] rather than argv[-1].


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13376 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-23 16:51:08 +00:00
wynholds%netscape.com
28c93d2218 fixing fdlibm stuff. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13374 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-23 16:35:58 +00:00
norris%netscape.com
ca95b9b63a Add patch number.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13373 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-23 15:35:41 +00:00
mang%netscape.com
67d738630a Landing of MANG_MATH_10231998
Replaces many system math routines with ECMA/IEEE compliant routines
from fdlibm.
These new routines are big and slow, so there are platform specific
defines in jslibmath.h that determine which fdlibm routines to use.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13372 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-23 10:16:50 +00:00
(no author)
f018a06aa7 This commit was manufactured by cvs2svn to create branch
'SpiderMonkey140_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13371 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-23 09:14:03 +00:00
norris%netscape.com
eb89b3d136 Fix 330071 Remove catch condition support from 1.4
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13364 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-23 05:51:29 +00:00
wynholds%netscape.com
6c156d7134 fixed ship target to correctly take into account any variation of JS_THREADSAFE and JS_LIVECONNECT. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13354 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-23 01:20:32 +00:00
mccabe%netscape.com
7f123a804d Sigh. Turn of reflection of runtime errors as exceptions.
Because the immediate demand for it in the client seems to have
lessened somewhat, and because it makes our cross-engine story make
more sense for external customers if we wait 'till it's implemented
for both engines.

Also, attempting to make exceptions work cleanly in a cross-context way
turned out to be difficult; it probably makes sense to take a step
back and look at how to find the best solution for the long term
development of the language.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13353 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-23 00:37:15 +00:00
wynholds%netscape.com
ec0edbcba0 adding HPUX 10.20 config makefiles. they are just copies of HPUX 10.10 makefiles. hope they work. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13351 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-23 00:30:46 +00:00
norris%netscape.com
2687debc8e Fix bug 330462 monkey: decompilation of comma op causes ASSERT/script failure
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13347 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-22 23:55:09 +00:00
mccabe%netscape.com
5fb184d473 Another fix to 329807.
Rather than nulling out the error reporter during the execution of
'load', replace it with a new error reporter that ignores all error
reports with the JSREPORT_EXCEPTION flag set.

Also fix a bug in jsexn.c where I was failing to actually set that
flag, and Eich-ify a few curly-brace placements.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13313 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-22 19:55:11 +00:00
mccabe%netscape.com
4885772ba8 Fix to 330589. Back out a tree-rewriting of foo[0] -> foo.0 because
the resulting code decompiles to foo.0.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13301 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-22 03:44:56 +00:00
rogerl%netscape.com
3d0da2df12 Bug #310514 - for eror report on calling toString on a not-function, was
calling toString to get the name of the object. Duh. Now calls getTypeName.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13290 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-22 00:05:16 +00:00
rogerl%netscape.com
030655be79 Bug #324451 - eval was bailing out early if the arg was not a string, and
so skipping the indirect-eval check.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13289 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-22 00:01:49 +00:00
fur%netscape.com
c21e3de07e Match changes in Makefile for auto-generating jsautocfg.h
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13279 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-21 21:43:59 +00:00
mccabe%netscape.com
f654a47a49 Fix to 329807.
'load' in the shell makes 'toplevel' calls to the js interpreter, so
the mechanism for detecting and reporting uncaught exceptions at the
top level kicks in prematurely.  To work around this problem, I set
the error reporter to NULL.  A better fix might be to use a custom
error reporter for load that knew to ignore exception error reports,
expecting that the javascript context calling load would catch or
report them.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13276 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-21 20:52:43 +00:00
norris%netscape.com
c11ef38890 Fix 330074 arguments object uses Array.prototype.toString
Unfortunately, I can see no way to version this behavior.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13275 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-21 20:45:41 +00:00
norris%netscape.com
d8f121d794 Better debugging code for printing objects.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13273 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-21 20:19:46 +00:00
rogerl%netscape.com
47f4088f27 Bug #330051 - previous fix for end of string with empty sep. should have
been 1.2 only and should have set the sep->length to 1 in order to break
out of the split loop.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13264 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-21 18:02:24 +00:00
rogerl%netscape.com
9d8444be44 Plugging a memory leak whenever an error is reported.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13261 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-21 17:54:30 +00:00
wynholds%netscape.com
0bd94e4384 CFLAGS needs to be +='ed, not ='ed. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13206 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-20 17:02:13 +00:00
wynholds%netscape.com
e0a486e300 need another include directory in liveconnect directory. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13205 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-20 16:47:16 +00:00
fur%netscape.com
4bf9c6a227 Fixed INCLUDES problem when JS_THREADSAFE is set
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13199 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-20 15:32:46 +00:00
fur%netscape.com
3277bdac18 Auto-generate jsautocfg.h instead of using checked-in jscpucfg.h file
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13192 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-20 07:32:26 +00:00
fur%netscape.com
87c868ffbe Improve clobber rule
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13191 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-20 07:31:21 +00:00
fur%netscape.com
5f6bbab561 Eliminate dependency on jscpucfg.h for Windows
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13186 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-20 05:00:16 +00:00
fur%netscape.com
55cebfe0cb It turns out that even though we were generating jscpucfg.h, we weren't
using it.  Rather the static, checked-in version was being used.  Fixed, now.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13185 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-20 04:42:33 +00:00
fur%netscape.com
26c815ff77 Generate jscpucfg.h on Unix platforms rather than relying on per-platform
static definitions.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13181 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-20 03:24:47 +00:00
fur%netscape.com
facfc365cb Ignore generated files
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13143 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-20 00:09:26 +00:00
fur%netscape.com
63ace590d6 Get rid of -D_SVID_GETTOD
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13142 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-19 23:59:29 +00:00
mccabe%netscape.com
31c250eee9 Fix from Joe Keane to avoid reiniting the scanner except when
necessary.  Thanks!

From: Joe Keane <jgk@jgk.org>  Fri 19:11
Subject:                       Re: JS_SetVersion not
To:                            Mike McCabe <mccabe@netscape.com>

The main caller i saw was libmocha.  In `win_run_timeout', it calls
`JS_SetVersion' twice every time there's a JavaScript timeout; it sets
the version before running the expression, then it sets it back when
it's done.  It looks like a couple times per second, not the worst
thing in the world, but nice to get rid of if it's easy enough.

I had some question about whether it's doing something dumb and it can
be improved.  This may be true, but there are some other callers, for
example it gets called indirectly by `PL_HandleEvent'.  Overall it
seems like a simple and pretty right thing to do anyway.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13134 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-19 22:15:39 +00:00
jband%netscape.com
60b5308f58 Added JSD support for DebugErrorHook
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13069 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-17 06:18:16 +00:00
jband%netscape.com
d2b9c6a168 - added 'DebugErrorHook' which (when present) is called before the ErrorReporter. And in cases where an error exception is raised but the ErrorReporter is not called. This allows for the debugger catching errors when they happen that the ErrorReporter will not now see until they become uncaught errors. This also simplifies the debugger by not having it try to track an ErrorReporter chain. This now works more like the Rhino system.
- #if 0'd js_ReportCompileError which is no longer used (replaced by js_ReportCompileErrorNumber). I'm all for cutting this out of the codebase. Shall we just do that?


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13061 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-17 02:26:19 +00:00
jband%netscape.com
b6525cde8b fix script leakage if !JS_HAS_ERROR_EXCEPTIONS
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13060 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-17 02:11:27 +00:00
bjorn%netscape.com
c4741a81fe Made cc be the default.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13022 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-16 21:47:52 +00:00
bjorn%netscape.com
0649a670ac Moved declaration of FAR to satisfy 'cc' on Dec Unix.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@13020 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-16 21:45:44 +00:00
bjorn%netscape.com
d418df2eb7 Extra config stuff for cc on OSF.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12998 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-16 18:16:26 +00:00
bjorn%netscape.com
e86bd6fd57 switch for OSF1.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12997 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-16 18:13:53 +00:00
jband%netscape.com
6d79b5ec64 fix 'typedef struct' redefinition - problem for jsd too before it becomes a build issue
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12992 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-16 10:36:20 +00:00
jband%netscape.com
46800959c2 fix build bustage on Unix due to 'typedef struct' redefinition - the Windows compiler didn't mind
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12991 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-16 10:26:22 +00:00
mccabe%netscape.com
e29596b37b Fix the javascript-visible Exception constructor to make objects of
jsclass Exception.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12987 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-16 09:34:29 +00:00
mccabe%netscape.com
1419ca574a Make the toSource stuff #if JS_HAS_TOSOURCE
Viva jsconfig.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12985 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-16 09:21:22 +00:00
jband%netscape.com
e5892b8370 Added support for throw hook. Added locals() and args() to jsdb to demonstrate/test JSDValue/JSDProperty stuff
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12972 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-16 04:07:41 +00:00
jband%netscape.com
60fe37f18d added save/restore/drop of JSExceptionState. This allows opaque scheme for doing evals and stuff on a context without screwing up the state of the exception information. This helps now with rooting the saved exception and will help more later if additional hidden exception information is added to the context; e.g. source location of thrown exception, etc. Also added throw hook. This is necessary since the relationship between the exceptions and error reporter changed
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12971 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-16 04:03:46 +00:00
fur%netscape.com
98c0f47746 Fix AIX build bustage
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12970 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-16 03:58:25 +00:00
fur%netscape.com
55a926e2c4 Fix gcc warning
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12969 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-16 03:58:07 +00:00
fur%netscape.com
f7387ecdae Fix gettimeofday() on Solaris for the umpteenth time
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12968 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-16 03:51:56 +00:00
fur%netscape.com
ecf83e4f36 + HAVE_LONG_LONG ==> JS_HAVE_LONG_LONG, so as to avoid conflict with NSPR
macro of the same name.
+ Changed JS_HAVE_LONG_LONG to be defined on Linux, since we compile with
  gcc on that platform.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12963 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-16 03:42:06 +00:00
bjorn%netscape.com
7d02cdd1c2 changed from int to unsigned int in alignment code.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12921 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-15 21:06:57 +00:00
mang%netscape.com
0bd5df16b7 Include jsfile.h only when building with JS_HAS_FILE_OBJECT
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12917 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-15 20:55:02 +00:00
mccabe%netscape.com
145eb6f922 Toss the cx->exceptionProtos vector and go to looking up exception
prototypes by using the the constructor names in the current context.
This has some failure modes if users have overwritten the
constructors, but they seem tolerable:

js> sil
1: ReferenceError: sil is not defined
js> ReferenceError = 'foo'
foo
js> sil
3: Exception: sil is not defined
js> Exception = 'bar'
bar
js> sil
5: [object Exception]


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12878 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-15 08:46:59 +00:00
mccabe%netscape.com
f98b15d6d3 Update js.c from the previous behavior of ignoring errors tagged as
exceptions - this caused toplevel compile errors to be ignored.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12877 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-15 08:35:03 +00:00
fur%netscape.com
da9f65325b Propagated changes from JS_STABLE_10131998_BRANCH, required to build mozilla.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12861 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-15 03:07:09 +00:00
mang%netscape.com
25bbd958a9 Now duplicate string instead of trying to modify read-only memory on Unix
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12860 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-15 02:58:12 +00:00
bjorn%netscape.com
3e8f4b2074 Change so that the local structure used to represent a JS pointer is aligned
modulo 8 rather than 4.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12852 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-15 01:22:15 +00:00
mang%netscape.com
6547ff01ff Added NPL
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12834 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-14 22:04:23 +00:00
wynholds%netscape.com
dd55af2615 xlC_r on AIX seems to not be able to hand C++ comments. seems kinds stupid, but what the hell? so i changed it to a C-style comment. no hard no foul.
-mw


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12831 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-14 21:42:37 +00:00
wynholds%netscape.com
619f867c2d ship target now supports JS_LIVECONNECT to be defined or undefined. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12829 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-14 21:36:29 +00:00
rogerl%netscape.com
2ffc6eb8cf Bug #315139 - for character split and empty separator, return string length
for end of string.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12828 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-14 21:32:11 +00:00
rogerl%netscape.com
444ed356ed Fix precedence issue (inappropriate distributive use)
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12826 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-14 20:58:31 +00:00
mccabe%netscape.com
ad709b1cfa GC_MARK the pending exception as a GCTHING rather than as a jsval
during garbage collection.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12794 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-14 07:13:34 +00:00
mccabe%netscape.com
90dc42fec0 Fix warnings.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12714 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-13 19:44:39 +00:00
mccabe%netscape.com
7b3a25dde6 Further work on errors as exceptions -
Changes to js.c back out much of the error-checking code of the
previous checkin; proper exception handling now requires fewer changes
to the host.

Exception prototypes are per-context, with no way (yet) to have
instanceof work properly with exceptions from other contexts.
Per-runtime prototypes (to make instanceof work naturally) worked OK,
but sealing these objects to prevent leaking information between
threads turned out to be hairy.  (Because Exception.prototype.toString
needed sealing too...)

Errors for which a corresponding exception is thrown are suppressed,
and compile errors are always suppressed except at the top level.
Entry functions in jsapi.c now detect failure of calls to the
interpreter and call the error reporter if an exception was raised;
exception-savvy hosts may provide an error reporter that ignores these
reports by checking JSREPORT_EXCEPTION in the report flags.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12686 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-13 09:58:28 +00:00
mang%netscape.com
3b086e1130 JS File Object (not fully implemented yet)
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12662 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-13 03:20:37 +00:00
jband%netscape.com
43ea6c73ea Added reflection of JSDValue, JSDProperty, and JSDObject stuff to jsdb. Initial support for this in debugger.js
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12646 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-13 01:02:25 +00:00
jband%netscape.com
8b37303301 added a comment
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12644 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-13 00:57:53 +00:00
bjorn%netscape.com
a9d4091b08 Updated js_list_scope_lookup() to use void pointers for casting, instead
of JSSymbol. This removed a problem on AIX where the compiler shuffled
code around, thinking that it was safe to do so. Waldemar helped me
track this one down.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12638 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-13 00:17:36 +00:00
fur%netscape.com
0e74fd5849 Merge changes from trunk
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12621 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-12 22:32:49 +00:00
fur%netscape.com
9bbc9990a2 Fix JS_FRIEND_DATA for Mac
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12614 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-12 22:12:08 +00:00
fur%netscape.com
5cea729be2 Updated file for JS1.4
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12606 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-12 21:01:57 +00:00
fur%netscape.com
c7838f766a Get rid of obsolete files
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12588 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-12 18:40:42 +00:00
norris%netscape.com
d6adc823ec Fix bug 299903 Inheriting from a Date object causes crash
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12582 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-12 17:54:44 +00:00
fur%netscape.com
65fea2e956 Remove out-of-date MSVC5 project files
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12580 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-12 17:37:11 +00:00
fur%netscape.com
bc6d33a86b Get rid of isatty() warning on Windows
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12577 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-12 16:43:17 +00:00
(no author)
f9446c3323 This commit was manufactured by cvs2svn to create branch
'SpiderMonkey140_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12554 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-12 08:05:38 +00:00
fur%netscape.com
f2dde02af9 1) Fixed bug in which incorrect netscape.javascript.JSException constructor
was being called when wrapping JavaScript exception objects thrown as
   a result of evaluating JavaScript from Java.

2) Implemented improved LiveConnect overloaded method resolution as described
   in the spec: http://www.mozilla.org/js/liveconnect/lc3_method_overloading.html
   (Explicit method specification not yet implemented, however).


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12551 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-12 07:32:14 +00:00
jband%netscape.com
41ebf8c0e0 Added type info to handles to support automatic 'dropping' of JSDValues (to be supported soon). Added name prop to handles to avoid toString having to repeatedly create the name on the fly. Also misc cleanup.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12545 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-12 02:39:27 +00:00
fur%netscape.com
ab971b977f Changed files for building JS for Mac after js ref/src merge
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12499 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-10 03:17:19 +00:00
fur%netscape.com
9c77f182aa Fix use of uninitialized variable.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12498 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-10 03:16:23 +00:00
fur%netscape.com
b25aef6c55 Privatize some names that conflict with NSPR identifiers missed in the first round of js ref/src merging.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12497 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-10 03:13:38 +00:00
fur%netscape.com
a82b563a25 Kill Mac warnings
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12496 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-10 03:11:30 +00:00
jband%netscape.com
02314c78f6 turn off debug tracing output
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12490 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-10 02:23:56 +00:00
jband%netscape.com
425d07341a added JSObject tracking system that supports iterating all JSObjects with info about the source line that created them and the source line and name of their constructors
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12488 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-10 02:10:07 +00:00
fur%netscape.com
268dfb88cb Fix to make JSObject native methods load on unix
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12485 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-10 00:53:33 +00:00
fur%netscape.com
bc2ec58a7b Get rid of outdated Java implementation of JSObject.equals(). It was replaced by native code a long time ago.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12483 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-10 00:53:05 +00:00
fur%netscape.com
cf373daa53 Don't use deprecated PrintStream API
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12482 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-10 00:52:03 +00:00
coop%netscape.com
7fe8465ded Changed constructor JSException(Object) to public so that Java users can
throw exceptions to JS cleanly.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12427 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-09 15:38:08 +00:00
mccabe%netscape.com
37ec2963c9 Added NPL.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12421 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-09 08:11:32 +00:00
fur%netscape.com
5ea0bc5e25 Revert to my non-standard, but more tabular white-space formatting
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12385 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-09 01:17:24 +00:00
fur%netscape.com
a492c3a964 Fix for #328274 (Unable to pass JS objects to Java)
Thanks to coop for noticing the problem.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12384 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-09 01:16:45 +00:00
rogerl%netscape.com
a256793772 #324451 - disallow indirect calls to eval
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12367 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-08 23:51:18 +00:00
rogerl%netscape.com
fa7759865b #324451 - if eval not invoked with CALLSPECIAL, then complain that it was
called indirectly, not allowed for new ECMA.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12366 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-08 23:50:06 +00:00
rogerl%netscape.com
7a57c4b47a #324451 - CALLSPECIAL opcode for detecting indirect calls to eval
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12365 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-08 23:48:57 +00:00
rogerl%netscape.com
a2ebae060e #324451 - detect direct call of eval and use CALLSPECIAl opcode instead
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12364 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-08 23:48:14 +00:00
rogerl%netscape.com
a8dc44aaa9 #324451 - Added callSpecial opcode to identify indirect eval calls
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12363 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-08 23:46:29 +00:00
rogerl%netscape.com
3c18b0c3ba #324451 Added eval to atomState so that we can detect indirect calls to eval
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12362 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-08 23:42:03 +00:00
coop%netscape.com
c122de69b8 Made all constructors private.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12347 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-08 21:57:30 +00:00
coop%netscape.com
4a3d57e324 Changed references to JSWrappedException to point to JSException instead.
Fixed nesting for vreport_java_error that prevented pending exception from
being set or cleared properly.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12306 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-08 20:16:51 +00:00
coop%netscape.com
a3f846bbf0 Changed references to JSWrappedException to point to JSException instead.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12305 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-08 20:12:36 +00:00
coop%netscape.com
189fd42355 JSWrappedException: removed
JSException: now extends RuntimeException
	     added Object wrappedException
	     added new constructor that takes an Object
	     added instance method getWrappedException(), returns wrappedException.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12304 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-08 20:08:01 +00:00
jband%netscape.com
63410ef469 added debug hook for notification of JSObject new and finalize
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12229 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-07 22:07:37 +00:00
norris%netscape.com
7f25afca90 Sigh. Back out fix that caused regressions.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12224 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-07 21:34:44 +00:00
jband%netscape.com
81d08cb271 support for resume with returnVal or throwVal
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12148 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-07 01:55:53 +00:00
jband%netscape.com
deefcc6b8d support for throwing from hook, prep for client checkin: fix locks, mods to makefile.win
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12147 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-07 01:52:25 +00:00
jband%netscape.com
e9b1c82736 added JSTRAP_THROW -- support for throwing an exception from any of the three kinds of interpreter hooks: interrupt, pc trap, debugger keyword
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12146 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-07 01:39:30 +00:00
wynholds%netscape.com
27a80cf6d2 some hacky stuff to get NT building right with gmake -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12141 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-07 01:15:11 +00:00
mccabe%netscape.com
1022f9e0ce Initialize cx->throwing to JS_FALSE #if JS_HAS_EXCEPTIONS!
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12139 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-07 00:54:26 +00:00
jband%netscape.com
c9bb9195dd only call JS_DestroyScript on non-NULL script in shell Load
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12138 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-07 00:43:20 +00:00
wynholds%netscape.com
095999e32b getting NT stuff build build EXEs correctly/at all -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12136 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-07 00:40:51 +00:00
wynholds%netscape.com
d76a5a9080 oops, typo for HP package. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12127 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-06 23:52:55 +00:00
wynholds%netscape.com
a70e9a2aaa NT executables end in .exe ! -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12126 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-06 23:51:33 +00:00
wynholds%netscape.com
e359fd71fc HP uses libnspr21.sl -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12124 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-06 23:47:50 +00:00
wynholds%netscape.com
04e1b5c3d1 NT uses a different nsinstall (built into shmsdos.exe) -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12122 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-06 23:44:53 +00:00
wynholds%netscape.com
fa2407ee2e don't forget this header file. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12121 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-06 23:32:06 +00:00
wynholds%netscape.com
49bb4bd95c package the right files on NT. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12120 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-06 23:30:18 +00:00
wynholds%netscape.com
3c49adc57b packaging libnspr21.so now. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12116 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-06 23:26:34 +00:00
wynholds%netscape.com
3f7cdf786b only use EXPORT_JS_API while building libjs.dll -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12113 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-06 23:07:41 +00:00
wynholds%netscape.com
78fba657bd LOOP_OVER_DIRS now can go only one level deep at a time -m
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12112 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-06 23:05:04 +00:00
wynholds%netscape.com
5b6a656e48 now NT's link line will create the right .lib and .pdb -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12091 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-06 21:42:00 +00:00
wynholds%netscape.com
fbbe5d2674 we need to use a JDK built especially for HP-UX10 (not 11) because on 11 it links with libm.sl.2, and on 10 it links with libm.sl.1. anyway, on 10, we don't have libm.2 so we obviously need the right one. i put it in /share/builds/components/jdk/1.1.5/HP-UX10/... -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12086 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-06 21:23:42 +00:00
wynholds%netscape.com
d9d717001f using cc instead of gcc (stupid gcc on HP). -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12085 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-06 21:21:08 +00:00
wynholds%netscape.com
1dde42d623 HP has to use native c compiler now, but hey, gcc just wasn't cutting it. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12049 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-06 19:39:46 +00:00
wynholds%netscape.com
1ed0446da5 get the link line right for NT. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12046 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-06 16:29:47 +00:00
wynholds%netscape.com
3fd73fdffd jsref_opt.jar and jsref_dbg.jar -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12045 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-06 16:18:16 +00:00
wynholds%netscape.com
cfa1a86909 a fix for UNIX on LOOP_OVER_DIRS -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12044 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-06 15:53:36 +00:00
coop%netscape.com
6b78529f1f Removed references to getWrappedException java method.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12043 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-06 14:46:50 +00:00
norris%netscape.com
4fd0fc55ca Fix bug 327540 "monkey: crash in some negative tests"
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@12025 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-06 04:08:25 +00:00
norris%netscape.com
b1e460a74a Fix 325843 "function f(a){var a,b;} asserts/crashes"
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11980 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-06 00:26:15 +00:00
wynholds%netscape.com
a5a20628a0 HP 10.10 stuff -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11977 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-06 00:19:22 +00:00
wynholds%netscape.com
d9eb58cdec need this to get HP linking. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11976 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-06 00:18:34 +00:00
wynholds%netscape.com
037c43596e uses reltools now
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11974 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 23:59:25 +00:00
wynholds%netscape.com
79b38ca130 get liveconnect building on NT
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11973 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 23:52:02 +00:00
wynholds%netscape.com
2f59039158 NT specific stuff
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11972 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 23:50:12 +00:00
wynholds%netscape.com
d32e31eda5 make DIRS NT friendly
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11971 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 23:49:23 +00:00
wynholds%netscape.com
ccf4b130af links correctly with NSPR on NT
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11970 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 23:46:20 +00:00
coop%netscape.com
c66acfa187 JSWrappedException wraps a JavaScript exception in a java.lang.Object wrapper.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11968 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 23:39:09 +00:00
coop%netscape.com
89d32f85be Removed "if 0"s referencing JSWrappedException code.
Changed references to JSWrappedException to reflect changes to that objects
structure, ie. JSWrappedException now contains a java.lang.Object instead
of an integer.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11967 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 23:35:22 +00:00
coop%netscape.com
0f8d890868 Removed "if 0"s referencing JSWrappedException code.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11966 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 23:32:28 +00:00
coop%netscape.com
3c8ae5aafe Removed "if 0"s referencing JSWrapped exception code.
Changed throw_any_pending_js_error_as_a_java_exception to reflect the
new make-up/construction of JSWrappedException (contains an java.lang.Object
instead of an integer).


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11965 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 23:31:35 +00:00
coop%netscape.com
f909920e91 Removed "if 0"s for references to JSWrappedException.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11963 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 23:27:26 +00:00
wynholds%netscape.com
ad73f38c85 installing programs to dist/bin directory now, and giving the owner write permissions. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11945 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 21:58:28 +00:00
wynholds%netscape.com
e18fa8a56f added ship target for packaging. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11944 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 21:57:50 +00:00
wynholds%netscape.com
e81b4d3657 this is the right config file for DEC, not dgux.mk. i dunno what version of uname that comes from. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11940 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 21:23:13 +00:00
wynholds%netscape.com
19c49a56be get DEC building -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11939 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 21:22:33 +00:00
wynholds%netscape.com
3e2489f92c point to java stuff for HP. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11934 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 20:55:29 +00:00
wynholds%netscape.com
b9e217c7e8 get HP 11 to link shared libraries. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11933 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 20:53:57 +00:00
wynholds%netscape.com
940ee6966f using /share/builds/components/jdk/1.1.6/IRIX instead of /usr/java so everybody can use it!. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11925 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 19:30:18 +00:00
wynholds%netscape.com
13337f0a89 using /share/builds/components/jdk/1.1.6/IRIX instead of /usr/java so we can all use it! -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11924 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 19:29:04 +00:00
wynholds%netscape.com
aabb8920ae need to hack AIX 4.1 to grab 4.2 because 4.1 doesn't exist. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11918 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 19:15:11 +00:00
wynholds%netscape.com
bd32e33753 trying to get AIX 4.1 to build, but no real luck yet. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11917 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 19:13:14 +00:00
wynholds%netscape.com
c68e984b99 link with libdl.a when doing threadsafe builds (NSPR needs it). -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11912 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 18:34:01 +00:00
wynholds%netscape.com
35b4a8183d get AIX 4.1.5 building. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11911 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 18:33:22 +00:00
wynholds%netscape.com
f746d5d6c5 added SunOS5.6.mk file to get it building. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11910 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 18:07:21 +00:00
wynholds%netscape.com
dccd95eeaa new target to grab NSPR from /share/builds/components. for use with JS_THREADSAFE standalone builds. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11909 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 17:46:30 +00:00
mccabe%netscape.com
0dc9a5a868 Be more paranoid in various ways about properly handling exceptions,
from compilation or execution.  Load is now somewhat more exception-savvy.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11899 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 09:56:06 +00:00
mccabe%netscape.com
f46f66eea8 Change some engine semantics to propagate exceptions better.
js_DefaultValue and a few other places used js_TryMethod,
js_TryValueOf.  The return value of these functions was always ignored
(well, was void) even if they found a method to call and that method
raised an exception.  As a result, functions like valueOf which might
have been user-defined to throw an exception didn't end up propagating
the exception.

I changed js_TryMethod, js_TryValueOf, and JS_ConvertStub (which calls
js_TryValueOf) to propagate failure.  Note that they'll still succeed
if they fail to find an appropriate method value to call.  (so 'Try'
still means something in this context.)  js_DefaultValue now uses
these return values to decide how to proceed.

As a result js_DefaultValue and obj->convert now may fail in a few
places where they previously did not.  I think that this is best in
terms of making the engine interpret a consistent language, but it
might trip us up on old code.  Fingers now crossed.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11898 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 09:40:59 +00:00
mccabe%netscape.com
8ade5f78d3 If compiletime errors are already reflected as exceptions, suppress
any compiletime errors that don't occur at the top level.  The intent
is to retain as much as possible the existing behavior of giving
multiple compile error messages for toplevel compiles.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11897 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 09:16:07 +00:00
mccabe%netscape.com
58a8a3d984 Only look for enclosing try/catch statements on abrupt frame exit when
returning failure with a pending exception, not just when there's a
pending exception.  (The pending exception could have been an
uncleared exception another script in the same context.)


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11896 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 09:07:48 +00:00
mccabe%netscape.com
e539af4e6f Fix to 318250. Disable an assert that was firing for a
default-value-throws-exn object used in an expression.  Code exists to
handle the case for which the assertion failed, but it was effectively
disabled in debug builds.  Anybody know the history of this one?


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11895 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 08:17:48 +00:00
norris%netscape.com
27e172913a Fix 299903 Inheriting from a Date object causes crash
and Actra global regexp problem (Function clone of regexp object because
it is of type Function).


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11894 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-05 06:32:34 +00:00
fur%netscape.com
b54505be31 Changed PR_* to JS_* names
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11890 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-04 23:18:51 +00:00
fur%netscape.com
2433dae015 Propagating README from js/ref
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11889 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-04 23:16:44 +00:00
mccabe%netscape.com
c2bcde8466 Only raise an exception for the first syntax error that's reported on
any given compile.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11843 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-03 03:27:13 +00:00
mccabe%netscape.com
90fb1dfb90 Comment fix.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11842 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-03 03:23:08 +00:00
val4%cornell.edu
132d1f5b26 Minor modification to readme reflecting the changes in the directory structure.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11791 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-02 19:42:37 +00:00
val4%cornell.edu
4c69c950da Looks like CRs on this file were scred up, which didn't allow MSDEV to
open them properly. Hopefully, it will work now.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11781 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-02 18:35:59 +00:00
coop%netscape.com
d5329cfd00 Added NPL.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11772 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-02 15:30:56 +00:00
coop%netscape.com
83cb0cf419 Added code to vreport_java_error that reports, sets and clears JS exceptions
based on the type of java exception encountered. Parts referencing
JSWrappedException are currently commented out.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11771 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-02 15:30:11 +00:00
coop%netscape.com
d3eee3f5c6 Added extern references for class JSWrappedException. Currently commented out.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11770 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-02 15:27:48 +00:00
coop%netscape.com
c78787a61a Added code to throw_any_pending_js_error_as_a_java_exception which
wraps an exception in a JSWrappedException wrapper. Currently commented
out.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11769 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-02 15:26:18 +00:00
coop%netscape.com
fd99e42a1e Added references (jclass, jmethodID, etc.) for JSWrappedException class.
Class does not currently exist, so references are commented out.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11768 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-02 15:23:46 +00:00
coop%netscape.com
f536714915 Added NPL for all classes.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11767 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-02 15:21:41 +00:00
shaver%netscape.com
16977a5881 fix Linux build of shared JS
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11740 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-02 02:02:23 +00:00
(no author)
d58d92ba30 This commit was manufactured by cvs2svn to create branch
'SpiderMonkey140_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11725 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-01 23:57:01 +00:00
bjorn%netscape.com
70aa311f1a Some final touches to the make system, just when you thought they
were all over... I got rid of the silly JS_STATIC. More pain than
pleasure, really.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11713 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-01 22:11:21 +00:00
wynholds%netscape.com
d6d4547e60 adding nsinstall-target target which will build the nsinstall executable needed for gmake export. -mw
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11678 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-01 19:32:00 +00:00
bjorn%netscape.com
cddb4bee49 Changed environment flag from JS_THREADSAFE to USE_NSPR.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11670 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-01 17:53:22 +00:00
bjorn%netscape.com
215e4f521a Added '+' to CFLAGS definition.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11649 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-01 04:52:28 +00:00
bjorn%netscape.com
b374ece734 Added JS_STATIC flag which, when set, links LiveConnect statically with JS.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11648 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-01 04:47:20 +00:00
bjorn%netscape.com
db88d15e60 IRIX 6.2 support for LiveConnect.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11620 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-30 23:30:52 +00:00
bjorn%netscape.com
17a3a3fede IRIX6.2 support.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11619 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-30 23:30:14 +00:00
bjorn%netscape.com
802ea94da2 Changes to make export work from inside liveconnect.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11618 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-30 23:28:20 +00:00
bjorn%netscape.com
87987c22eb LC support for IRIX.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11617 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-30 23:24:05 +00:00
mccabe%netscape.com
92e75b047c Fix to 320443. Restructure jsinterp.c to always check a raised
exception against any enclosing try statement within the current frame
before attempting to return from the frame.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11612 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-30 22:34:13 +00:00
bjorn%netscape.com
d72d172d7a Fixes to properly generate the executable 'jsj'.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11611 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-30 22:33:44 +00:00
rogerl%netscape.com
8e7b173eef ErrorNumber handling changes to support UC
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11607 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-30 21:51:59 +00:00
rogerl%netscape.com
d898e8430d Fixed bug #104766. DecompileFunctionBody needs to set the scope in its
JSPrinter arg.
Changed error number handling code to support UC version as well.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11606 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-30 21:50:52 +00:00
rogerl%netscape.com
55edce6a15 Fixed bug #104766. DecompileFunctionBody needs to set the scope in its
JSPrinter arg.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11603 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-30 21:48:00 +00:00
rogerl%netscape.com
f962f59ccc Fixing bugs #310514, 310502 - calling function.toString, .call & .apply
on non-function objects now results in a runtime error.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11599 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-30 21:30:26 +00:00
bjorn%netscape.com
75187e5e57 DIST is now a variable set in Makefile.ref so that the export rule
can be made to export to a chosen directory.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11572 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-30 18:13:50 +00:00
bjorn%netscape.com
3522f2112e Removed JDK include.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11566 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-30 17:14:29 +00:00
bjorn%netscape.com
b2bc5afac7 New support for AIX.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11565 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-30 17:14:12 +00:00
bjorn%netscape.com
1b857628d4 AIX 4.2 make support.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11564 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-30 16:59:47 +00:00
fur%netscape.com
4034d6af4c Added MKSHLIB macro
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11528 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-30 03:45:54 +00:00
bjorn%netscape.com
1d5e647e2c Added includes.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11527 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-30 03:10:19 +00:00
bjorn%netscape.com
2aabababd7 New support for standalone make system.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11526 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-30 03:08:00 +00:00
fur%netscape.com
024311a2ab Fixed an incorrect assertion that I believe was intended to confirm that
all JS roots pointed into the GC'able JS arena, but which wasn't coded correctly.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11525 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-30 03:03:15 +00:00
mccabe%netscape.com
55fcddec90 Changed some remaining messages from js_ReportCompileError(<hardcoded
string>) to js_ReportCompileErrorNumber(<error number>).  To make
runtime exceptions work for lexical errors, because the mechanism
piggybacks off of js_ReportCompileErrorNumber.

Also propagated a free->JS_free change.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11522 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-30 01:53:45 +00:00
bjorn%netscape.com
0c95c94909 Fixes to the assembly for SPARC v8, and to accommodate for new source
tree.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11478 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-29 23:32:29 +00:00
bjorn%netscape.com
8da98334c6 Fixed the test when the pointer is busy (tst -> cmp)
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11474 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-29 23:18:26 +00:00
shaver%netscape.com
defa10fc43 added Linux config file
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11469 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-29 22:54:37 +00:00
bjorn%netscape.com
f0cdddb20c Changed assertion in CompareAndSwap to look for nv != -1.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11465 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-29 22:47:27 +00:00
fur%netscape.com
a17e03c381 Re-fixed comment
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11419 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-29 20:35:44 +00:00
shaver%netscape.com
595794ecfe don't overwrite catchall jump with rethrow address
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11414 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-29 19:14:36 +00:00
shaver%netscape.com
1a0b1b8a29 fix catchall-after-catchguard spurious error
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11347 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-29 09:50:04 +00:00
fur%netscape.com
670d4d69fa Moved from js/ref to js/src
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11326 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-29 05:56:30 +00:00
fur%netscape.com
c5a6bb1af7 Migrated LiveConnect from js/ref to js/src.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11325 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-29 05:55:25 +00:00
jband%netscape.com
00a574acf2 added call to new JSD unicode function JSD_AppendUCSourceText to simplify shell and remove truncation hackery (which really just got pushed into JSD)
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11257 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-28 20:37:22 +00:00
jband%netscape.com
68900225d1 - removed MY_XP junk, abandon Win16, assume that realloc works
- removed HACK_FOR_OLD_JS
- made JS_LOWLEVEL_SOURCE work in jsdb
- added Unicode JSD_AppendUCSourceText to simplify shells
- some gratuitous whitespace reformatting


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11256 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-28 20:34:46 +00:00
mccabe%netscape.com
97a1eacae2 Propagate mcafee fix: Added Rhapsody to the long list of OS's that
can't handle localtime_r().


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11235 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-28 19:41:17 +00:00
jband%netscape.com
1061a7961a Source notes for line numbers are generated at the top of js_EmitTree. The code generation in the TOK_TRY case was bypassing this code (i.e. emitting code for source lines before recursing into js_EmitTree). So, I brokeout that linenumber code into a macro to be inlined at the top of js_EmitTree and also into a static function that can be called elsewhere -- I didn't want to force an extra (and often unneeded) function call at the top of each invocation of js_EmitTree, nor inline 15 lines of code in a bunch of places, so this seemed a good compromise. This substantially fixes lineno errors in try/catch/finally code. There are still non-lineno problems in that code that shaver and coop are looking at - so this code in not final.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11210 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-28 08:02:43 +00:00
jband%netscape.com
95f197f31a function mis-declared as JS_FRIEND_DATA. changed to JS_FRIEND_API
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11209 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-28 07:51:21 +00:00
jband%netscape.com
aeb19b804e fix CompileTokenStream to always call js_CloseTokenStream. It was not doing so on syntax errors. This caused .js files loaded in the shell to be left open and would also fail to have JSPRINCIPALS_DROP be called in cases where principles are used.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11069 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-25 21:15:49 +00:00
norris%netscape.com
22b83ef992 Back out breaking change.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11017 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-25 04:36:13 +00:00
mccabe%netscape.com
cf89f9dbea Fix to xp problem on solaris. Use 1-argument form of gettimeofday #if
defined( SOLARIS ) - hack borrowed from ref/prtime.c.  Why wasn't it
needed in src/prmjtime.c previously?


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@11006 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-25 00:58:26 +00:00
norris%netscape.com
b9f52d961c Fix bug 299903 Inheriting from a Date object causes crash.
The test code is

     function MyDate() { this.foo = "bar"; }
     MyDate.prototype = new Date();
     x = new MyDate();
     print(x.toString())

The problem is that object x is created with an associated class of date_class, but with an undefined value in the private slot. Then when
date_getProlog is called on x, the JS_InstanceOf test passes since the class of the object is date_class, but then a bogus pointer is returned
since there isn't really a double in the private data slot.


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10983 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-24 23:30:36 +00:00
jband%netscape.com
b9b66713eb added build() to js.c to display date/time of build in shell. Uses __DATE__ and __TIME__ which are supposed to be ansi C -- tested on Windows and Linux
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10975 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-24 22:52:07 +00:00
fur%netscape.com
3287009b56 Added/deleted files to accomodate ref/src merge.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10903 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-24 07:44:22 +00:00
jband%netscape.com
d0ad9c946c last automatic conversion of js/ref/jsd to js/jsd based on fur's conversion system of js/ref to js/src
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10900 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-24 07:22:17 +00:00
jband%netscape.com
b3c707fd61 removed NETSCAPE_INTERNAL. Made JS_IsAssigning a JS_FRIEND_API with a warning in jsapi.h that the function might be removed in the future
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10899 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-24 07:17:59 +00:00
fur%netscape.com
03332fd3ac Final changes merged from js/ref
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10897 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-24 05:40:16 +00:00
fur%netscape.com
ef97812295 + Make JS1.4 build in Mozilla
+ Get rid of all uses of NSPR20 macro


git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10893 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-24 04:16:35 +00:00
fur%netscape.com
ca0614a7b6 Converted README to README.html
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10892 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-24 04:15:15 +00:00
fur%netscape.com
4c1594b677 Changes for merged js ref/src.
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10886 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-24 03:55:11 +00:00
fur%netscape.com
914637bd3e Fixed JS_FRIEND_* macros
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10882 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-24 03:18:10 +00:00
fur%netscape.com
91dbe3c171 Added extern C declarations for inclusion into C++
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10881 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-24 03:17:55 +00:00
fur%netscape.com
c3bd0c5f7d Fix PR_EXTERN
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10878 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-24 02:41:11 +00:00
jband%netscape.com
cff140c431 adding a PR_PUBLIC_XXX conversions back in
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10809 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-23 18:45:12 +00:00
fur%netscape.com
923990dd99 Updated dependencies
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10785 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-23 07:44:40 +00:00
fur%netscape.com
45291c870a More name substitutions for ref/src merge
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10784 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-23 07:40:51 +00:00
jband%netscape.com
33d0d8a72b improved makefiles. added javawrap
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10768 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-23 04:01:03 +00:00
fur%netscape.com
2066c6b9ce Got rid of OS-dependent header files. Everything is in jsosdep.h now
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10765 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-23 02:37:53 +00:00
jband%netscape.com
46e77ac0e1 change path make standalone debugger work
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10735 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-23 01:42:03 +00:00
jband%netscape.com
7507e060b5 moved from ref/samples. work with ref/src merged js. ripped out jsd and jsdebugger build stuff
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10734 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-23 01:23:33 +00:00
jband%netscape.com
1cc86f1b54 jsd to go with ref/src merge. first checkin of new java stuff and jsdb
git-svn-id: svn://10.0.0.236/branches/SpiderMonkey140_BRANCH@10733 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-23 01:22:09 +00:00
818 changed files with 28766 additions and 62375 deletions

View File

@@ -1,5 +0,0 @@
#
# This is a list of local files which get copied to the mozilla:dist directory
#
jsdebug.h

View File

@@ -1,73 +0,0 @@
#!gmake
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
DEPTH = ../..
MODULE = jsdebug
LIBRARY_NAME = jsd
# Switching on MOZ_JAVA is a short-term hack. This is really for no Java/IFC
ifdef MOZ_JAVA
JAVA_OR_OJI = 1
endif
ifdef MOZ_OJI
JAVA_OR_OJI = 1
endif
ifdef JAVA_OR_OJI
DIRS = classes
endif
REQUIRES = java js nspr
EXPORTS = jsdebug.h
CSRCS = \
jsdebug.c \
jsd_high.c \
jsd_hook.c \
jsd_scpt.c \
jsd_stak.c \
jsd_text.c \
jsd_lock.c \
$(NULL)
ifndef MOZ_JSD
CSRCS += jsdstubs.c jsd_java.c
JDK_GEN = \
netscape.jsdebug.Script \
netscape.jsdebug.DebugController \
netscape.jsdebug.JSThreadState \
netscape.jsdebug.JSStackFrameInfo \
netscape.jsdebug.JSPC \
netscape.jsdebug.JSSourceTextProvider \
netscape.jsdebug.JSErrorReporter \
$(NULL)
endif
include $(DEPTH)/config/rules.mk
$(OBJDIR)\jsdstubs.o: \
$(JDK_STUB_DIR)\netscape_jsdebug_Script.c \
$(JDK_STUB_DIR)\netscape_jsdebug_DebugController.c \
$(JDK_STUB_DIR)\netscape_jsdebug_JSThreadState.c \
$(JDK_STUB_DIR)\netscape_jsdebug_JSStackFrameInfo.c \
$(JDK_STUB_DIR)\netscape_jsdebug_JSPC.c \
$(JDK_STUB_DIR)\netscape_jsdebug_JSSourceTextProvider.c

View File

@@ -1,78 +0,0 @@
#!gmake
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
DEPTH = ../..
topsrcdir = @top_srcdir@
VPATH = @srcdir@
srcdir = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = jsdebug
LIBRARY_NAME = jsd
# Switching on MOZ_JAVA is a short-term hack. This is really for no Java/IFC
ifdef MOZ_JAVA
JAVA_OR_OJI = 1
endif
ifdef MOZ_OJI
JAVA_OR_OJI = 1
endif
ifdef JAVA_OR_OJI
DIRS = classes
endif
REQUIRES = java js nspr
EXPORTS = $(srcdir)/jsdebug.h
CSRCS = \
jsdebug.c \
jsd_high.c \
jsd_hook.c \
jsd_scpt.c \
jsd_stak.c \
jsd_text.c \
jsd_lock.c \
$(NULL)
ifndef MOZ_JSD
CSRCS += jsdstubs.c jsd_java.c
JDK_GEN = \
netscape.jsdebug.Script \
netscape.jsdebug.DebugController \
netscape.jsdebug.JSThreadState \
netscape.jsdebug.JSStackFrameInfo \
netscape.jsdebug.JSPC \
netscape.jsdebug.JSSourceTextProvider \
netscape.jsdebug.JSErrorReporter \
$(NULL)
endif
include $(topsrcdir)/config/rules.mk
$(OBJDIR)\jsdstubs.o: \
$(JDK_STUB_DIR)\netscape_jsdebug_Script.c \
$(JDK_STUB_DIR)\netscape_jsdebug_DebugController.c \
$(JDK_STUB_DIR)\netscape_jsdebug_JSThreadState.c \
$(JDK_STUB_DIR)\netscape_jsdebug_JSStackFrameInfo.c \
$(JDK_STUB_DIR)\netscape_jsdebug_JSPC.c \
$(JDK_STUB_DIR)\netscape_jsdebug_JSSourceTextProvider.c

View File

@@ -1,59 +0,0 @@
#!gmake
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
DEPTH = ../../..
MODULE = java
JJSD = netscape/jsdebug
#
# JDIRS is dependant on JAVA_DESTPATH in config/rules.m[a]k.
# Be sure to touch that directory if you add a new directory to
# JDIRS, or else it will not build. XXX
#
JDIRS = $(JJSD)
JAR_JSD = jsd10.jar
JAR_JSD_CLASSES = $(JJSD)
#
# jars to build at install time
#
JARS = $(JAR_JSD)
include $(DEPTH)/config/rules.mk
JAVA_SOURCEPATH = $(DEPTH)/js/jsd/classes
doc::
$(JAVADOC) -d $(DIST)/doc netscape.jsdebug
natives_list:: FORCE
rm -rf $@
find . -name "*.class" -print | sed 's@\./\(.*\)\.class$$@\1@' | \
sed 's@/@.@g' | xargs $(JVH) -natives | sort > $@
check_natives:: natives_list
rm -f found_natives
nm -B ../$(OBJDIR)/*.o \
| egrep "Java.*_stub" | awk '{ print $$3; }' | sort > found_natives
diff found_natives natives_list
FORCE:

View File

@@ -1,64 +0,0 @@
#!gmake
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
DEPTH = ../../..
topsrcdir = @top_srcdir@
VPATH = @srcdir@
srcdir = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = java
JJSD = netscape/jsdebug
#
# JDIRS is dependant on JAVA_DESTPATH in config/rules.m[a]k.
# Be sure to touch that directory if you add a new directory to
# JDIRS, or else it will not build. XXX
#
JDIRS = $(JJSD)
JAR_JSD = jsd10.jar
JAR_JSD_CLASSES = $(JJSD)
#
# jars to build at install time
#
JARS = $(JAR_JSD)
include $(topsrcdir)/config/rules.mk
JAVA_SOURCEPATH = $(DEPTH)/js/jsd/classes
doc::
$(JAVADOC) -d $(DIST)/doc netscape.jsdebug
natives_list:: FORCE
rm -rf $@
find . -name "*.class" -print | sed 's@\./\(.*\)\.class$$@\1@' | \
sed 's@/@.@g' | xargs $(JVH) -natives | sort > $@
check_natives:: natives_list
rm -f found_natives
nm -B ../$(OBJDIR)/*.o \
| egrep "Java.*_stub" | awk '{ print $$3; }' | sort > found_natives
diff found_natives natives_list
FORCE:

View File

@@ -1,64 +0,0 @@
#!gmake
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
IGNORE_MANIFEST=1
#
#//------------------------------------------------------------------------
#//
#// Makefile to build the JavaScriptDebug tree
#//
#//------------------------------------------------------------------------
DEPTH = ..\..\..
JAVA_SOURCEPATH=$(DEPTH)\js\jsd\classes
#//------------------------------------------------------------------------
#//
#// Define the files necessary to build the target (ie. OBJS)
#//
#//------------------------------------------------------------------------
include <$(DEPTH)\config\config.mak>
all::
MODULE=java
JJSD=netscape/jsdebug
JDIRS=$(JJSD)
JAR_JSD=jsd10.jar
JAR_JSD_CLASSES=$(JJSD)
JARS=$(JAR_JSD)
include <$(DEPTH)\config\rules.mak>
!if "$(MOZ_BITS)" == "32"
$(JAR_JSD):
cd $(JAVA_DESTPATH)
@echo +++ building/updating $@
$(ZIP_PROG) -$(COMP_LEVEL)qu $@ META-INF\build
-for %i in ($(JAR_JSD_CLASSES:/=\)) do @$(ZIP_PROG) -$(COMP_LEVEL)qu $@ %i\*.class
cd $(MAKEDIR)
!endif
jars: $(JARS)
install:: jars
javadoc:
-mkdir $(XPDIST)\javadoc 2> NUL
echo $(JAVADOC) -sourcepath . -d $(XPDIST)\javadoc $(JDIRS:/=.)
$(JAVADOC) -sourcepath . -d $(XPDIST)\javadoc $(JDIRS:/=.)

View File

@@ -1,41 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
package netscape.jsdebug;
/**
* DebugBreakHook must be subclassed to respond when a debug break is
* requested
*
* @author John Bandhauer
* @version 1.0
* @since 1.0
*/
public class DebugBreakHook extends Hook {
/**
* Override this method to respond just before a thread
* reaches a particular instruction.
* <p>
* @param debug ThreadState representing the current state
* @param pc the location of the instruction about to be executed
*/
public void aboutToExecute(ThreadStateBase debug, PC pc) {
// defaults to no action
}
}

View File

@@ -1,374 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
package netscape.jsdebug;
import netscape.util.Hashtable;
import netscape.security.PrivilegeManager;
import netscape.security.ForbiddenTargetException;
/**
* This is the master control panel for observing events in the VM.
* Each method setXHook() must be passed an object that extends
* the class XHook. When an event of the specified type
* occurs, a well-known method on XHook will be called (see the
* various XHook classes for details). The method call takes place
* on the same thread that triggered the event in the first place,
* so that any monitors held by the thread which triggered the hook
* will still be owned in the hook method.
* <p>
* This class is meant to be a singleton and has a private constructor.
* Call the static <code>getDebugController()</code> to get this object.
* <p>
* Note that all functions use netscape.security.PrivilegeManager to verify
* that the caller has the "Debugger" privilege. The exception
* netscape.security.ForbiddenTargetException will be throw if this is
* not enabled.
*
* @author John Bandhauer
* @author Nick Thompson
* @version 1.0
* @since 1.0
* @see netscape.security.PrivilegeManager
* @see netscape.security.ForbiddenTargetException
*/
public final class DebugController {
private static final int majorVersion = 1;
private static final int minorVersion = 0;
private static DebugController controller;
private ScriptHook scriptHook;
private Hashtable instructionHookTable;
private InterruptHook interruptHook;
private DebugBreakHook debugBreakHook;
private JSErrorReporter errorReporter;
/**
* Get the DebugController object for the current VM.
* <p>
* @return the singleton DebugController
*/
public static synchronized DebugController getDebugController()
throws ForbiddenTargetException
{
try {
PrivilegeManager.checkPrivilegeEnabled("Debugger");
if (controller == null)
controller = new DebugController();
return controller;
} catch (ForbiddenTargetException e) {
System.out.println("failed in check Priv in DebugController.getDebugController()");
e.printStackTrace(System.out);
throw e;
}
}
private DebugController()
{
scriptTable = new Hashtable();
_setController(true);
}
/**
* Request notification of Script loading events.
* <p>
* Whenever a Script is loaded into or unloaded from the VM
* the appropriate method of the ScriptHook argument will be called.
* Callers are responsible for chaining hooks if chaining is required.
*
* @param h new script hook
* @return the previous hook object (null if none)
*/
public synchronized ScriptHook setScriptHook(ScriptHook h)
throws ForbiddenTargetException
{
PrivilegeManager.checkPrivilegeEnabled("Debugger");
ScriptHook oldHook = scriptHook;
scriptHook = h;
return oldHook;
}
/**
* Get the current observer of Script events.
* <p>
* @return the current script hook (null if none)
*/
public ScriptHook getScriptHook()
throws ForbiddenTargetException
{
PrivilegeManager.checkPrivilegeEnabled("Debugger");
return scriptHook;
}
/**
* Set a hook at the given program counter value.
* <p>
* When a thread reaches that instruction, a ThreadState
* object will be created and the appropriate method
* of the hook object will be called. Callers are responsible
* for chaining hooks if chaining is required.
*
* @param pc pc at which hook should be set
* @param h new hook for this pc
* @return the previous hook object (null if none)
*/
public synchronized InstructionHook setInstructionHook(
PC pc,
InstructionHook h)
throws ForbiddenTargetException
{
PrivilegeManager.checkPrivilegeEnabled("Debugger");
InstructionHook oldHook;
if (instructionHookTable == null) {
instructionHookTable = new Hashtable();
}
oldHook = (InstructionHook) instructionHookTable.get(pc);
instructionHookTable.put(pc, h);
setInstructionHook0(pc);
return oldHook;
}
private native void setInstructionHook0(PC pc);
/**
* Get the hook at the given program counter value.
* <p>
* @param pc pc for which hook should be found
* @return the hook (null if none)
*/
public InstructionHook getInstructionHook(PC pc)
throws ForbiddenTargetException
{
PrivilegeManager.checkPrivilegeEnabled("Debugger");
return getInstructionHook0(pc);
}
// called by native function
private InstructionHook getInstructionHook0(PC pc)
{
if (instructionHookTable == null)
return null;
else
return (InstructionHook) instructionHookTable.get(pc);
}
/**************************************************************/
/**
* Set the hook at to be called when interrupts occur.
* <p>
* The next instruction which starts to execute after
* <code>sendInterrupt()</code> has been called will
* trigger a call to this hook. A ThreadState
* object will be created and the appropriate method
* of the hook object will be called. Callers are responsible
* for chaining hooks if chaining is required.
*
* @param h new hook
* @return the previous hook object (null if none)
* @see netscape.jsdebug.DebugController#sendInterrupt
*/
public synchronized InterruptHook setInterruptHook( InterruptHook h )
throws ForbiddenTargetException
{
PrivilegeManager.checkPrivilegeEnabled("Debugger");
InterruptHook oldHook = interruptHook;
interruptHook = h;
return oldHook;
}
/**
* Get the current hook to be called on interrupt
* <p>
* @return the hook (null if none)
*/
public InterruptHook getInterruptHook()
throws ForbiddenTargetException
{
PrivilegeManager.checkPrivilegeEnabled("Debugger");
return interruptHook;
}
/**
* Cause the interrupt hook to be called when the next
* JavaScript instruction starts to execute.
* <p>
* The interrupt is self clearing
* @see netscape.jsdebug.DebugController#setInterruptHook
*/
public void sendInterrupt()
throws ForbiddenTargetException
{
PrivilegeManager.checkPrivilegeEnabled("Debugger");
sendInterrupt0();
}
private native void sendInterrupt0();
/**************************************************************/
/**
* Set the hook at to be called when a <i>debug break</i> is requested
* <p>
* Set the hook to be called when <i>JSErrorReporter.DEBUG</i> is returned
* by the <i>error reporter</i> hook. When that happens a ThreadState
* object will be created and the appropriate method
* of the hook object will be called. Callers are responsible
* for chaining hooks if chaining is required.
*
* @param h new hook
* @return the previous hook object (null if none)
* @see netscape.jsdebug.DebugController#setErrorReporter
* @see netscape.jsdebug.JSErrorReporter
*/
public synchronized DebugBreakHook setDebugBreakHook( DebugBreakHook h )
throws ForbiddenTargetException
{
PrivilegeManager.checkPrivilegeEnabled("Debugger");
DebugBreakHook oldHook = debugBreakHook;
debugBreakHook = h;
return oldHook;
}
/**
* Get the current hook to be called on debug break
* <p>
* @return the hook (null if none)
*/
public DebugBreakHook getDebugBreakHook()
throws ForbiddenTargetException
{
PrivilegeManager.checkPrivilegeEnabled("Debugger");
return debugBreakHook;
}
/**************************************************************/
/**
* Get the 'handle' which cooresponds to the native code representing the
* instance of the underlying JavaScript Debugger context.
* <p>
* This would not normally be useful in java. Some of the other classes
* in this package need this. It remains public mostly for historical
* reasons. It serves as a check to see that the native classes have been
* loaded and the built-in native JavaScript Debugger support has been
* initialized. This DebugController is not valid (or useful) when it is
* in a state where this native context equals 0.
*
* @return the native context (0 if none)
*/
public int getNativeContext()
throws ForbiddenTargetException
{
PrivilegeManager.checkPrivilegeEnabled("Debugger");
// System.out.println( "nativecontext = " + _nativeContext + "\n" );
return _nativeContext;
}
private native void _setController( boolean set );
private Hashtable scriptTable;
private int _nativeContext;
/**
* Execute a string as a JavaScript script within a stack frame
* <p>
* This method can be used to execute arbitrary sets of statements on a
* stopped thread. It is useful for inspecting and modifying data.
* <p>
* This method can only be called while the JavaScript thread is stopped
* - i.e. as part of the code responding to a hook. Thgis method
* <b>must</b> be called on the same thread as was executing when the
* hook was called.
* <p>
* If an error occurs while execuing this code, then the error
* reporter hook will be called if present.
*
* @param frame the frame context in which to evaluate this script
* @param text the script text
* @param filename where to tell the JavaScript engine this code came
* from (it is usually best to make this the same as the filename of
* code represented by the frame)
* @param lineno the line number to pass to JS ( >=1 )
* @return The result of the script execution converted to a string.
* (null if the result was null or void)
*/
public String executeScriptInStackFrame( JSStackFrameInfo frame,
String text,
String filename,
int lineno )
throws ForbiddenTargetException
{
PrivilegeManager.checkPrivilegeEnabled("Debugger");
return executeScriptInStackFrame0( frame, text, filename, lineno );
}
private native String executeScriptInStackFrame0( JSStackFrameInfo frame,
String text,
String filename,
int lineno );
/**
* Set the hook at to be called when a JavaScript error occurs
* <p>
* @param er new error reporter hook
* @return the previous hook object (null if none)
* @see netscape.jsdebug.JSErrorReporter
*/
public JSErrorReporter setErrorReporter(JSErrorReporter er)
throws ForbiddenTargetException
{
PrivilegeManager.checkPrivilegeEnabled("Debugger");
JSErrorReporter old = errorReporter;
errorReporter = er;
return old;
}
/**
* Get the hook at to be called when a JavaScript error occurs
* <p>
* @return the hook object (null if none)
* @see netscape.jsdebug.JSErrorReporter
*/
public JSErrorReporter getErrorReporter()
throws ForbiddenTargetException
{
PrivilegeManager.checkPrivilegeEnabled("Debugger");
return errorReporter;
}
/**
* Get the major version number of this module
* <p>
* @return the version number
*/
public static int getMajorVersion() {return majorVersion;}
/**
* Get the minor version number of this module
* <p>
* @return the version number
*/
public static int getMinorVersion() {return minorVersion;}
private static native int getNativeMajorVersion();
private static native int getNativeMinorVersion();
}

View File

@@ -1,32 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
package netscape.jsdebug;
/**
* An instance of this class is returned for each hook set by
* the debugger as a handle for removing the hook later.
*
* @author John Bandhauer
* @author Nick Thompson
* @version 1.0
* @since 1.0
*/
public abstract class Hook {
}

View File

@@ -1,55 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
package netscape.jsdebug;
/**
* InstructionHook must be subclassed to respond to hooks
* at a particular program instruction.
*
* @author John Bandhauer
* @author Nick Thompson
* @version 1.0
* @since 1.0
*/
public class InstructionHook extends Hook {
private PC pc;
/**
* Create an InstructionHook at the given PC value.
*/
public InstructionHook(PC pc) {
this.pc = pc;
}
/**
* Get the instruction that the hook is set at.
*/
public PC getPC() {
return pc;
}
/**
* Override this method to respond just before a thread
* reaches a particular instruction.
*/
/* jband - 03/31/97 - I made this public to allow chaining */
public void aboutToExecute(ThreadStateBase debug) {
// defaults to no action
}
}

View File

@@ -1,39 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
package netscape.jsdebug;
/**
* InterruptHook must be subclassed to respond when interrupts occur
*
* @author John Bandhauer
* @author Nick Thompson
* @version 1.0
* @since 1.0
*/
public class InterruptHook extends Hook {
/**
* Override this method to respond when interrupts occur
* @param debug the state of this thread
* @param pc the pc of the instruction about to execute
*/
public void aboutToExecute(ThreadStateBase debug, PC pc) {
// defaults to no action
}
}

View File

@@ -1,46 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
package netscape.jsdebug;
/**
* Exception to indicate bad thread state etc...
*
* @author John Bandhauer
* @author Nick Thompson
* @version 1.0
* @since 1.0
*/
public class InvalidInfoException extends Exception {
/**
* Constructs a InvalidInfoException without a detail message.
* A detail message is a String that describes this particular exception.
*/
public InvalidInfoException() {
super();
}
/**
* Constructs a InvalidInfoException with a detail message.
* A detail message is a String that describes this particular exception.
* @param s the detail message
*/
public InvalidInfoException(String s) {
super(s);
}
}

View File

@@ -1,70 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
package netscape.jsdebug;
/**
* This is a special kind of hook to respond to JavaScript errors
*
* @author John Bandhauer
* @version 1.0
* @since 1.0
*/
public interface JSErrorReporter
{
/* keep these in sync with the numbers in jsdebug.h */
/**
* returned by <code>reportError()</code> to indicate that the error
* should be passed along to the error reporter that would have been
* called had the debugger not been running
*/
public static final int PASS_ALONG = 0;
/**
* returned by <code>reportError()</code> to indicate that the
* normal error reporter should not be called and that the JavaScript
* engine should do whatever it would normally do after calling the
* error reporter.
*/
public static final int RETURN = 1;
/**
* returned by <code>reportError()</code> to indicate that the
* 'debug break' hook should be called to allow the debugger to
* investigate the state of the process when the error occured
*/
public static final int DEBUG = 2;
/**
* This hook is called when a JavaScript error (compile or runtime) occurs
* <p>
* One of the codes above should be returned to tell the engine how to
* proceed.
* @param msg error message passed through from the JavaScript engine
* @param filename filename (or url) of the code with the error
* @param lineno line number where error was detected
* @param linebuf a copy of the line where the error was detected
* @param tokenOffset the offset into <i>linebuf</i> where the error
* was detected
* @returns one of the codes above
*/
public int reportError( String msg,
String filename,
int lineno,
String linebuf,
int tokenOffset );
}

View File

@@ -1,76 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
package netscape.jsdebug;
/**
* This subclass of PC provides JavaScript-specific information.
*
* @author John Bandhauer
* @version 1.0
* @since 1.0
*/
public final class JSPC extends PC {
private Script script;
private int pc;
public JSPC(Script script, int pc) {
this.script = script;
this.pc = pc;
}
public Script getScript() {
return script;
}
public int getPC() {
return pc;
}
public boolean isValid()
{
return script.isValid();
}
/**
* Get the SourceLocation associated with this PC value.
* returns null if the source location is unavailable.
*/
public native SourceLocation getSourceLocation();
/**
* Ask whether two program counter values are equal.
*/
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!(obj instanceof JSPC))
return false;
JSPC jspc = (JSPC) obj;
return (jspc.script == script && jspc.pc == pc);
}
public int hashCode() {
return script.hashCode() + pc;
}
public String toString() {
return "<PC "+script+"+"+pc+">";
}
}

View File

@@ -1,63 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
package netscape.jsdebug;
/**
* JAvaScript specific SourceLocation
*
* @author John Bandhauer
* @version 1.0
* @since 1.0
*/
public class JSSourceLocation extends SourceLocation
{
public JSSourceLocation( JSPC pc, int line )
{
_pc = pc;
_line = line;
_url = pc.getScript().getURL();
}
/**
* Gets the first line number associated with this SourceLocation.
* This is the lowest common denominator information that will be
* available: some implementations may choose to include more
* specific location information in a subclass of SourceLocation.
*/
public int getLine() {return _line;}
public String getURL() {return _url;}
/**
* Get the first PC associated with a given SourceLocation.
* This is the place to set a breakpoint at that location.
* returns null if there is no code corresponding to that source
* location.
*/
public PC getPC() {return _pc;}
public String toString()
{
return "<SourceLocation "+_url+"#"+_line+">";
}
private JSPC _pc;
private int _line;
private String _url;
}

View File

@@ -1,130 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
package netscape.jsdebug;
import netscape.util.Vector;
import netscape.security.PrivilegeManager;
import netscape.security.ForbiddenTargetException;
/**
* This class provides access to SourceText items.
* <p>
* This class is meant to be a singleton and has a private constructor.
* Call the static <code>getSourceTextProvider()</code> to get this object.
* <p>
* Note that all functions use netscape.security.PrivilegeManager to verify
* that the caller has the "Debugger" privilege. The exception
* netscape.security.ForbiddenTargetException will be throw if this is
* not enabled.
*
* @author John Bandhauer
* @version 1.0
* @since 1.0
* @see netscape.security.PrivilegeManager
* @see netscape.security.ForbiddenTargetException
*/
public final class JSSourceTextProvider extends SourceTextProvider
{
private JSSourceTextProvider( long nativeContext )
{
_sourceTextVector = new Vector();
_nativeContext = nativeContext;
}
/**
* Get the SourceTextProvider object for the current VM.
* <p>
* @return the singleton SourceTextProvider
*/
public static synchronized SourceTextProvider getSourceTextProvider()
throws ForbiddenTargetException
{
PrivilegeManager.checkPrivilegeEnabled("Debugger");
if( null == _sourceTextProvider )
{
long nativeContext = DebugController.getDebugController().getNativeContext();
if( 0 != nativeContext )
_sourceTextProvider = new JSSourceTextProvider(nativeContext);
}
return _sourceTextProvider;
}
/**
* Get the SourceText item for the given URL
*/
public SourceTextItem findSourceTextItem( String url )
throws ForbiddenTargetException
{
PrivilegeManager.checkPrivilegeEnabled("Debugger");
return findSourceTextItem0(url);
}
// also called from native code...
private SourceTextItem findSourceTextItem0( String url )
{
synchronized( _sourceTextVector )
{
for (int i = 0; i < _sourceTextVector.size(); i++)
{
SourceTextItem src = (SourceTextItem) _sourceTextVector.elementAt(i);
if( src.getURL().equals(url) )
return src;
}
return null;
}
}
/**
* Return the vector of SourceTextItems.
* <p>
* This is NOT a copy. nor is it necessarily current
*/
public Vector getSourceTextVector()
throws ForbiddenTargetException
{
PrivilegeManager.checkPrivilegeEnabled("Debugger");
return _sourceTextVector;
}
/**
* Load the SourceText item for the given URL
* <p>
* <B>This is not guaranteed to be implemented</B>
*/
public synchronized SourceTextItem loadSourceTextItem( String url )
throws ForbiddenTargetException
{
PrivilegeManager.checkPrivilegeEnabled("Debugger");
return loadSourceTextItem0( url );
}
private native SourceTextItem loadSourceTextItem0( String url );
/**
* Refresh the vector to reflect any changes made in the
* underlying native system
*/
public synchronized native void refreshSourceTextVector();
private static SourceTextProvider _sourceTextProvider = null;
private Vector _sourceTextVector;
private long _nativeContext;
}

View File

@@ -1,51 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
package netscape.jsdebug;
/**
* This interface provides access to the execution stack of a thread.
* It has several subclasses to distinguish between different kinds of
* stack frames: these currently include activations of Java methods
* or JavaScript functions.
* It is possible that synchronize blocks and try blocks deserve their own
* stack frames - to allow for later extensions a debugger should skip over
* stack frames it doesn't understand.
* Note that this appears very Java-specific. However, multiple threads and
* exceptions are relevant to JavaScript as well because of its
* interoperation with Java.
*
* @author John Bandhauer
* @version 1.0
* @since 1.0
*/
public final class JSStackFrameInfo extends StackFrameInfo
{
public JSStackFrameInfo(JSThreadState threadState) {
super(threadState);
}
protected native StackFrameInfo getCaller0()
throws InvalidInfoException;
public native PC getPC()
throws InvalidInfoException;
private int _nativePtr; // used internally
}

View File

@@ -1,80 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
package netscape.jsdebug;
/**
* This is the JavaScript specific implementation of the thread state
*
* @author John Bandhauer
* @version 1.0
* @since 1.0
*/
public final class JSThreadState extends ThreadStateBase
{
/**
* <B><font color="red">Not Implemented.</font></B>
* Always throws <code>InternalError("unimplemented")</code>
*/
public static ThreadStateBase getThreadState(Thread t)
throws InvalidInfoException
{
throw new InternalError("unimplemented");
}
/**
* get the count of frames
*/
public native int countStackFrames()
throws InvalidInfoException;
/**
* get the 'top' frame
*/
public native StackFrameInfo getCurrentFrame()
throws InvalidInfoException;
/**
* <B><font color="red">Not Implemented.</font></B>
* Always throws <code>InternalError("unimplemented")</code>
*/
public Thread getThread()
{
throw new InternalError("unimplemented");
}
/**
* <B><font color="red">Not Implemented.</font></B>
* Always throws <code>InternalError("unimplemented")</code>
*/
public void leaveSuspended()
{
throw new InternalError("unimplemented");
}
/**
* <B><font color="red">Not Implemented.</font></B>
* Always throws <code>InternalError("unimplemented")</code>
*/
protected void resume0()
{
throw new InternalError("unimplemented");
}
protected int nativeThreadState; /* used internally */
}

View File

@@ -1,42 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
package netscape.jsdebug;
/**
* The PC class is an opaque representation of a program counter. It
* may have different implementations for interpreted Java methods,
* methods compiled by the JIT, JavaScript methods, etc.
*
* @author John Bandhauer
* @author Nick Thompson
* @version 1.0
* @since 1.0
*/
public abstract class PC {
/**
* Get the SourceLocation associated with this PC value.
* returns null if the source location is unavailable.
*/
public abstract SourceLocation getSourceLocation();
/**
* Ask whether two program counter values are equal.
*/
public abstract boolean equals(Object obj);
}

View File

@@ -1,82 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
package netscape.jsdebug;
/**
* This instances of this class represent the JavaScript string object. This
* class is intended to only be constructed by the underlying native code.
* The DebugController will construct an instance of this class when scripts
* are created and that instance will always be used to reference the underlying
* script throughout the lifetime of that script.
*
* @author John Bandhauer
* @version 1.0
* @since 1.0
*/
public final class Script
{
public String getURL() {return _url; }
public String getFunction() {return _function; }
public int getBaseLineNumber() {return _baseLineNumber;}
public int getLineExtent() {return _lineExtent; }
public boolean isValid() {return 0 != _nativePtr;}
/**
* Get the PC of the first executable code on or after the given
* line in this script. returns null if none
*/
public native JSPC getClosestPC(int line);
public String toString()
{
int end = _baseLineNumber+_lineExtent-1;
if( null == _function )
return "<Script "+_url+"["+_baseLineNumber+","+end+"]>";
else
return "<Script "+_url+"#"+_function+"()["+_baseLineNumber+","+end+"]>";
}
public int hashCode()
{
return _nativePtr;
}
public boolean equals(Object obj)
{
if( obj == this )
return true;
// In our system the native code is the only code that generates
// these objects. They are never duplicated
return false;
/*
if( !(obj instanceof Script) )
return false;
return 0 != _nativePtr && _nativePtr == ((Script)obj)._nativePtr;
*/
}
private synchronized void _setInvalid() {_nativePtr = 0;}
private String _url;
private String _function;
private int _baseLineNumber;
private int _lineExtent;
private int _nativePtr; // used internally
}

View File

@@ -1,57 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
package netscape.jsdebug;
/**
* ScriptHook must be subclassed to respond to loading and
* unloading of scripts
*
* @author John Bandhauer
* @version 1.0
* @since 1.0
*/
public class ScriptHook extends Hook
{
/**
* Create a ScriptHook for current the current VM.
*/
public ScriptHook() {}
/**
* Override this method to respond when a new script is
* loaded into the VM.
*
* @param script a script object created by the controller to
* represent this script. This exact same object will be used
* in all further references to the script.
*/
public void justLoadedScript(Script script) {
// defaults to no action
}
/**
* Override this method to respond when a class is
* about to be unloaded from the VM.
*
* @param script which will be unloaded
*/
public void aboutToUnloadScript(Script script) {
// defaults to no action
}
}

View File

@@ -1,53 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
package netscape.jsdebug;
/**
* An implementation of the SourceLocation interface is used to represent
* a location in a source file. Java classfiles only make source locations
* available at the line-by-line granularity, but other languages may
* include finer-grain information. At this time only line number
* information is included.
*
* @author John Bandhauer
* @author Nick Thompson
* @version 1.0
* @since 1.0
*/
/* XXX must source locations be contiguous? */
public abstract class SourceLocation {
/**
* Gets the first line number associated with this SourceLocation.
* This is the lowest common denominator information that will be
* available: some implementations may choose to include more
* specific location information in a subclass of SourceLocation.
*
* @returns source line number cooresponding to this location
*/
public abstract int getLine();
/**
* Get the first PC associated with a given SourceLocation.
* This is the place to set a breakpoint at that location.
*
* @returns pc object or null if there is no code corresponding
* to this source location.
*/
public abstract PC getPC();
}

View File

@@ -1,107 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
package netscape.jsdebug;
/**
* This class is used to represent a file or url which contains
* JavaScript source text. The actual JavaScript source may be intermixed
* with other text (as in an html file) or raw. The debugger uses this
* interface to access the source. The file of the actual source need
* not physially exist anywhere; i.e. the underlying engine might synthesize
* it as needed.
* <p>
* The <i>url</i> of this class is immutable -- it represents a key in
* collections of these objects
*
* @author John Bandhauer
* @version 1.0
* @since 1.0
*/
public class SourceTextItem
{
/* these coorespond to jsdebug.h values - change in both places if anywhere */
/**
* This object is initialized, but contains no text
*/
public static final int INITED = 0;
/**
* This object contains the full text
*/
public static final int FULL = 1;
/**
* This object contains the partial text (valid , but more may come later)
*/
public static final int PARTIAL = 2;
/**
* This object may contain partial text, but loading was aborted (by user?)
*/
public static final int ABORTED = 3;
/**
* This object may contain partial text, but loading failed (or the
* underlying debugger support was unable to capture it; e.g.
* not enough memory...)
*/
public static final int FAILED = 4;
/**
* This object contains no text because the debugger has signaled that
* the text is no longer needed
*/
public static final int CLEARED = 5;
/**
* Constuct for url (which is immutable during the lifetime of the object)
* <p>
* Presumably, text will be added later
* @param url url or filename by which this object will be known
*/
public SourceTextItem( String url )
{
this( url, (String)null, INITED );
}
/**
* Constuct for url with text and status
* <p>
* @param url url or filename by which this object will be known
* @param text source text this object should start with
* @param status status this object should start with
*/
public SourceTextItem( String url, String text, int status )
{
_url = url;
_text = text;
_status = status;
_dirty = true;
}
public String getURL() {return _url; }
public String getText() {return _text; }
public int getStatus() {return _status;}
public boolean getDirty() {return _dirty; }
public void setText(String text) {_text = text;}
public void setStatus(int status) {_status = status;}
public void setDirty(boolean b) {_dirty = b; }
private String _url;
private String _text;
private int _status;
private boolean _dirty;
}

View File

@@ -1,58 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
package netscape.jsdebug;
import netscape.util.Vector;
import netscape.security.ForbiddenTargetException;
/**
* Abstract class to represent entity capable of providing access to source text
*
* @author John Bandhauer
* @version 1.0
* @since 1.0
*/
public abstract class SourceTextProvider
{
public static SourceTextProvider getSourceTextProvider() throws Exception
{
return null;
}
/**
* Return the vector of SourceTextItems.
* <p>
* This is not liekly to be a copy. nor is it necessarily current
*/
public abstract Vector getSourceTextVector() throws ForbiddenTargetException;
/**
* Refresh the vector by whatever means to reflect any changes made in the
* underlying native system
*/
public abstract void refreshSourceTextVector();
/**
* Get the SourceText item for the given URL
*/
public abstract SourceTextItem findSourceTextItem( String url ) throws ForbiddenTargetException;
/**
* Load the SourceText item for the given URL
* <p>
* <B>This is not guaranteed to be implemented</B>
*/
public abstract SourceTextItem loadSourceTextItem( String url ) throws ForbiddenTargetException;
}

View File

@@ -1,94 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
package netscape.jsdebug;
/**
* This interface provides access to the execution stack of a thread.
* It has several subclasses to distinguish between different kinds of
* stack frames: these currently include activations of Java methods
* or JavaScript functions.
* It is possible that synchronize blocks and try blocks deserve their own
* stack frames - to allow for later extensions a debugger should skip over
* stack frames it doesn't understand.
* Note that this appears very Java-specific. However, multiple threads and
* exceptions are relevant to JavaScript as well because of its
* interoperation with Java.
*
* @author John Bandhauer
* @author Nick Thompson
* @version 1.0
* @since 1.0
*/
public abstract class StackFrameInfo {
ThreadStateBase threadState;
StackFrameInfo caller;
protected StackFrameInfo(ThreadStateBase threadState) {
this.threadState = threadState;
}
/**
* Return true if this stack frame is still valid. Stack frames
* may become invalid when the thread is resumed (this is more
* conservative than invalidating the frame only when it actually
* returns).
*/
public boolean isValid() {
return threadState.isValid();
}
/**
* Get the stack frame where this one was built, or null for the
* start of the stack.
*/
public synchronized StackFrameInfo getCaller()
throws InvalidInfoException {
if (caller == null)
caller = getCaller0();
if (!isValid())
throw new InvalidInfoException("invalid StackFrameInfo");
return caller;
}
protected abstract StackFrameInfo getCaller0()
throws InvalidInfoException;
/**
* Get the thread that this stack frame is a part of.
*/
public Thread getThread() {
return threadState.getThread();
}
/**
* Get the 'enclosing' thread state
*/
public ThreadStateBase getThreadState() {
return threadState;
}
/**
* Get the current program counter value. Note that the
* class JavaPC supports the getMethod() operation.
*/
public abstract PC getPC()
throws InvalidInfoException;
}

View File

@@ -1,241 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
package netscape.jsdebug;
/*
* jband - 03/19/97
*
* This is an 'abstracted version of netscape.debug.ThreadState
*
* The methods that were 'native' there are 'abstract' here.
* Changed 'private' data to 'protected' (though native access is immune)
* Changed 'private' resume0() to 'protected'
* Removed ThreadHook referneces
*
*/
/**
* When a hook is hit, the debugger records the state of the
* thread before the hook in a ThreadState object. This object
* is then passed to any hook methods that are called, and can
* be used to change the state of the thread when it resumes from the
* hook.
*
* @author John Bandhauer
* @author Nick Thompson
* @version 1.0
* @since 1.0
*/
public abstract class ThreadStateBase {
protected Thread thread;
protected boolean valid;
protected boolean runningHook;
protected boolean resumeWhenDone;
protected int status;
protected int continueState;
protected StackFrameInfo[] stack; /* jband - 03/19/97 - had no access modifier */
protected Object returnValue;
protected Throwable currentException;
protected int currentFramePtr; /* used internally */
protected ThreadStateBase previous;
/**
* <B><font color="red">Not Implemented.</font></B>
* Always throws <code>InternalError("unimplemented")</code>
*/
public static ThreadStateBase getThreadState(Thread t)
throws InvalidInfoException
{
throw new InternalError("unimplemented");
}
/**
* Get the Thread that this ThreadState came from.
*/
public Thread getThread() {
return thread;
}
/**
* Return true if the Thread hasn't been resumed since this ThreadState
* was made.
*/
public boolean isValid() {
return valid;
}
/**
* Return true if the thread is currently running a hook
* for this ThreadState
*/
public boolean isRunningHook() {
return runningHook;
}
/**
* partial list of thread states from sun.debug.ThreadInfo.
* XXX some of these don't apply.
*/
public final static int THR_STATUS_UNKNOWN = 0x01;
public final static int THR_STATUS_ZOMBIE = 0x02;
public final static int THR_STATUS_RUNNING = 0x03;
public final static int THR_STATUS_SLEEPING = 0x04;
public final static int THR_STATUS_MONWAIT = 0x05;
public final static int THR_STATUS_CONDWAIT = 0x06;
public final static int THR_STATUS_SUSPENDED = 0x07;
public final static int THR_STATUS_BREAK = 0x08;
/**
* Get the state of the thread at the time it entered debug mode.
* This can't be modified directly.
*/
public int getStatus() {
return status;
}
/**
* Get the count of the stackframes
*/
public abstract int countStackFrames()
throws InvalidInfoException;
/**
* Get the 'top' stackframe; i.e. the one with the current instruction
*/
public abstract StackFrameInfo getCurrentFrame()
throws InvalidInfoException;
/**
* Get the thread's stack as an array. stack[stack.length-1] is the
* current frame, and stack[0] is the beginning of the stack.
*/
public synchronized StackFrameInfo[] getStack()
throws InvalidInfoException {
// XXX check valid?
if (stack == null) {
stack = new StackFrameInfo[countStackFrames()];
}
if (stack.length == 0)
return stack;
StackFrameInfo frame = getCurrentFrame();
stack[stack.length - 1] = frame;
for (int i = stack.length - 2; i >= 0; i--) {
frame = frame.getCaller();
stack[i] = frame;
}
// should really be read-only for safety
return stack;
}
/**
* Leave the thread in a suspended state when the hook method(s)
* finish. This can be undone by calling resume(). This is the
* default only if the break was the result of
* DebugController.sendInterrupt().
*/
public void leaveSuspended() {
resumeWhenDone = false;
}
/**
* Resume the thread. This is the default unless the break was the result
* of DebugController.sendInterrupt(). This method may be called from a
* hook method, in which case the thread will resume when the
* method returns.
* Alternatively, if there is no active hook method and
* the thread is suspended around in the DebugFrame, this resumes it
* immediately.
*/
public synchronized void resume() {
if (runningHook)
resumeWhenDone = true;
else
resume0();
}
protected abstract void resume0();
/**
* if the continueState is DEAD, the thread cannot
* be restarted.
*/
public final static int DEBUG_STATE_DEAD = 0x01;
/**
* if the continueState is RUN, the thread will
* proceed to the next program counter value when it resumes.
*/
public final static int DEBUG_STATE_RUN = 0x02;
/**
* if the continueState is RETURN, the thread will
* return from the current method with the value in getReturnValue()
* when it resumes.
*/
public final static int DEBUG_STATE_RETURN = 0x03;
/**
* if the continueState is THROW, the thread will
* throw an exception (accessible with getException()) when it
* resumes.
*/
public final static int DEBUG_STATE_THROW = 0x04;
/**
* This gets the current continue state of the debug frame, which
* will be one of the DEBUG_STATE_* values above.
*/
public int getContinueState() {
return continueState;
}
public int setContinueState(int state) {
int old = continueState;
continueState = state;
return old;
}
/**
* If the thread was stopped while in the process of returning
* a value, this call returns an object representing that value.
* non-Object values are wrapped as in the java.lang.reflect api.
* This is only relevant if the continue state is RETURN, and the
* method throws an IllegalStateException otherwise.
*/
public Object getReturnValue() throws IllegalStateException {
if (continueState != DEBUG_STATE_RETURN)
throw new IllegalStateException("no value being returned");
return returnValue;
}
/**
* If the thread was stopped while in the process of throwing an
* exception, this call returns that exception.
* This is only relevant if the continue state is THROW, and it
* throws an IllegalStateException otherwise.
*/
public Throwable getException() throws IllegalStateException {
if (continueState != DEBUG_STATE_THROW)
throw new IllegalStateException("no exception throw in progress");
return currentException;
}
}

View File

@@ -1,190 +0,0 @@
struct Thing {
string s;
long i;
};
interface StringReciever {
void recieveString(
in string arg0
);
void bounce(
in long arg0
);
};
interface TestInterface {
string getFirstAppInList();
void getAppNames(
in ::StringReciever arg0
);
typedef sequence<::Thing> sequence_of_Thing;
::TestInterface::sequence_of_Thing getThings();
void callBounce(
in ::StringReciever arg0,
in long arg1
);
};
interface ISourceTextProvider {
typedef sequence<string> sequence_of_string;
::ISourceTextProvider::sequence_of_string getAllPages();
void refreshAllPages();
boolean hasPage(
in string arg0
);
boolean loadPage(
in string arg0
);
void refreshPage(
in string arg0
);
string getPageText(
in string arg0
);
long getPageStatus(
in string arg0
);
long getPageAlterCount(
in string arg0
);
};
struct IScriptSection {
long base;
long extent;
};
typedef sequence<::IScriptSection> sequence_of_IScriptSection;
struct IScript {
string url;
string funname;
long base;
long extent;
long jsdscript;
::sequence_of_IScriptSection sections;
};
struct IJSPC {
::IScript script;
long offset;
};
struct IJSSourceLocation {
long line;
::IJSPC pc;
};
interface IJSErrorReporter {
long reportError(
in string arg0,
in string arg1,
in long arg2,
in string arg3,
in long arg4
);
};
interface IScriptHook {
void justLoadedScript(
in ::IScript arg0
);
void aboutToUnloadScript(
in ::IScript arg0
);
};
struct IJSStackFrameInfo {
::IJSPC pc;
long jsdframe;
};
typedef sequence<::IJSStackFrameInfo> sequence_of_IJSStackFrameInfo;
struct IJSThreadState {
::sequence_of_IJSStackFrameInfo stack;
long continueState;
string returnValue;
long status;
long jsdthreadstate;
long id;
};
interface IJSExecutionHook {
void aboutToExecute(
in ::IJSThreadState arg0,
in ::IJSPC arg1
);
};
struct IExecResult {
string result;
boolean errorOccured;
string errorMessage;
string errorFilename;
long errorLineNumber;
string errorLineBuffer;
long errorTokenOffset;
};
interface IDebugController {
long getMajorVersion();
long getMinorVersion();
::IJSErrorReporter setErrorReporter(
in ::IJSErrorReporter arg0
);
::IJSErrorReporter getErrorReporter();
::IScriptHook setScriptHook(
in ::IScriptHook arg0
);
::IScriptHook getScriptHook();
::IJSPC getClosestPC(
in ::IScript arg0,
in long arg1
);
::IJSSourceLocation getSourceLocation(
in ::IJSPC arg0
);
::IJSExecutionHook setInterruptHook(
in ::IJSExecutionHook arg0
);
::IJSExecutionHook getInterruptHook();
::IJSExecutionHook setDebugBreakHook(
in ::IJSExecutionHook arg0
);
::IJSExecutionHook getDebugBreakHook();
::IJSExecutionHook setInstructionHook(
in ::IJSExecutionHook arg0,
in ::IJSPC arg1
);
::IJSExecutionHook getInstructionHook(
in ::IJSPC arg0
);
void setThreadContinueState(
in long arg0,
in long arg1
);
void setThreadReturnValue(
in long arg0,
in string arg1
);
void sendInterrupt();
void sendInterruptStepInto(
in long arg0
);
void sendInterruptStepOver(
in long arg0
);
void sendInterruptStepOut(
in long arg0
);
void reinstateStepper(
in long arg0
);
::IExecResult executeScriptInStackFrame(
in long arg0,
in ::IJSStackFrameInfo arg1,
in string arg2,
in string arg3,
in long arg4
);
boolean isRunningHook(
in long arg0
);
boolean isWaitingForResume(
in long arg0
);
void leaveThreadSuspended(
in long arg0
);
void resumeThread(
in long arg0
);
void iterateScripts(
in ::IScriptHook arg0
);
};

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,777 +0,0 @@
#ifndef _ifaces_s_hh
#define _ifaces_s_hh
#include "ifaces_c.hh"
/************************************************************************/
/* */
/* This file is automatically generated by ORBeline IDL compiler */
/* Do not modify this file. */
/* */
/* ORBeline (c) is copyrighted by PostModern Computing, Inc. */
/* */
/* The generated code conforms to OMG's IDL C++ mapping as */
/* specified in OMG Document Number: 94-9-14. */
/* */
/************************************************************************/
class _sk_StringReciever : public StringReciever
{
protected:
_sk_StringReciever(const char *object_name = (const char *)NULL);
_sk_StringReciever(const char *service_name, const CORBA::ReferenceData& data);
virtual ~_sk_StringReciever() {}
public:
static const CORBA::TypeInfo _skel_info;
// The following operations need to be implemented by the server.
virtual void recieveString(const char * arg0) = 0;
virtual void bounce(CORBA::Long arg0) = 0;
// Skeleton Operations implemented automatically
static void _recieveString(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
static void _bounce(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
};
template <class T>
class _tie_StringReciever : public StringReciever
{
public:
_tie_StringReciever(T& t, const char *obj_name=(char*)NULL) :
StringReciever(obj_name),
_ref(t) {
_object_name(obj_name);
}
_tie_StringReciever(T& t, const char *service_name,
const CORBA::ReferenceData& id)
:_ref(t) {
_service(service_name, id);
}
~_tie_StringReciever() {}
void recieveString(const char * arg0) {
_ref.recieveString(
arg0);
}
void bounce(CORBA::Long arg0) {
_ref.bounce(
arg0);
}
private:
T& _ref;
};
class _sk_TestInterface : public TestInterface
{
protected:
_sk_TestInterface(const char *object_name = (const char *)NULL);
_sk_TestInterface(const char *service_name, const CORBA::ReferenceData& data);
virtual ~_sk_TestInterface() {}
public:
static const CORBA::TypeInfo _skel_info;
// The following operations need to be implemented by the server.
virtual char * getFirstAppInList() = 0;
virtual void getAppNames(StringReciever_ptr arg0) = 0;
virtual TestInterface::sequence_of_Thing * getThings() = 0;
virtual void callBounce(StringReciever_ptr arg0,
CORBA::Long arg1) = 0;
// Skeleton Operations implemented automatically
static void _getFirstAppInList(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
static void _getAppNames(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
static void _getThings(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
static void _callBounce(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
};
template <class T>
class _tie_TestInterface : public TestInterface
{
public:
_tie_TestInterface(T& t, const char *obj_name=(char*)NULL) :
TestInterface(obj_name),
_ref(t) {
_object_name(obj_name);
}
_tie_TestInterface(T& t, const char *service_name,
const CORBA::ReferenceData& id)
:_ref(t) {
_service(service_name, id);
}
~_tie_TestInterface() {}
char * getFirstAppInList() {
return _ref.getFirstAppInList();
}
void getAppNames(StringReciever_ptr arg0) {
_ref.getAppNames(
arg0);
}
TestInterface::sequence_of_Thing * getThings() {
return _ref.getThings();
}
void callBounce(StringReciever_ptr arg0,
CORBA::Long arg1) {
_ref.callBounce(
arg0,
arg1);
}
private:
T& _ref;
};
class _sk_ISourceTextProvider : public ISourceTextProvider
{
protected:
_sk_ISourceTextProvider(const char *object_name = (const char *)NULL);
_sk_ISourceTextProvider(const char *service_name, const CORBA::ReferenceData& data);
virtual ~_sk_ISourceTextProvider() {}
public:
static const CORBA::TypeInfo _skel_info;
// The following operations need to be implemented by the server.
virtual ISourceTextProvider::sequence_of_string * getAllPages() = 0;
virtual void refreshAllPages() = 0;
virtual CORBA::Boolean hasPage(const char * arg0) = 0;
virtual CORBA::Boolean loadPage(const char * arg0) = 0;
virtual void refreshPage(const char * arg0) = 0;
virtual char * getPageText(const char * arg0) = 0;
virtual CORBA::Long getPageStatus(const char * arg0) = 0;
virtual CORBA::Long getPageAlterCount(const char * arg0) = 0;
// Skeleton Operations implemented automatically
static void _getAllPages(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
static void _refreshAllPages(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
static void _hasPage(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
static void _loadPage(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
static void _refreshPage(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
static void _getPageText(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
static void _getPageStatus(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
static void _getPageAlterCount(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
};
template <class T>
class _tie_ISourceTextProvider : public ISourceTextProvider
{
public:
_tie_ISourceTextProvider(T& t, const char *obj_name=(char*)NULL) :
ISourceTextProvider(obj_name),
_ref(t) {
_object_name(obj_name);
}
_tie_ISourceTextProvider(T& t, const char *service_name,
const CORBA::ReferenceData& id)
:_ref(t) {
_service(service_name, id);
}
~_tie_ISourceTextProvider() {}
ISourceTextProvider::sequence_of_string * getAllPages() {
return _ref.getAllPages();
}
void refreshAllPages() {
_ref.refreshAllPages();
}
CORBA::Boolean hasPage(const char * arg0) {
return _ref.hasPage(
arg0);
}
CORBA::Boolean loadPage(const char * arg0) {
return _ref.loadPage(
arg0);
}
void refreshPage(const char * arg0) {
_ref.refreshPage(
arg0);
}
char * getPageText(const char * arg0) {
return _ref.getPageText(
arg0);
}
CORBA::Long getPageStatus(const char * arg0) {
return _ref.getPageStatus(
arg0);
}
CORBA::Long getPageAlterCount(const char * arg0) {
return _ref.getPageAlterCount(
arg0);
}
private:
T& _ref;
};
class _sk_IJSErrorReporter : public IJSErrorReporter
{
protected:
_sk_IJSErrorReporter(const char *object_name = (const char *)NULL);
_sk_IJSErrorReporter(const char *service_name, const CORBA::ReferenceData& data);
virtual ~_sk_IJSErrorReporter() {}
public:
static const CORBA::TypeInfo _skel_info;
// The following operations need to be implemented by the server.
virtual CORBA::Long reportError(const char * arg0,
const char * arg1,
CORBA::Long arg2,
const char * arg3,
CORBA::Long arg4) = 0;
// Skeleton Operations implemented automatically
static void _reportError(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
};
template <class T>
class _tie_IJSErrorReporter : public IJSErrorReporter
{
public:
_tie_IJSErrorReporter(T& t, const char *obj_name=(char*)NULL) :
IJSErrorReporter(obj_name),
_ref(t) {
_object_name(obj_name);
}
_tie_IJSErrorReporter(T& t, const char *service_name,
const CORBA::ReferenceData& id)
:_ref(t) {
_service(service_name, id);
}
~_tie_IJSErrorReporter() {}
CORBA::Long reportError(const char * arg0,
const char * arg1,
CORBA::Long arg2,
const char * arg3,
CORBA::Long arg4) {
return _ref.reportError(
arg0,
arg1,
arg2,
arg3,
arg4);
}
private:
T& _ref;
};
class _sk_IScriptHook : public IScriptHook
{
protected:
_sk_IScriptHook(const char *object_name = (const char *)NULL);
_sk_IScriptHook(const char *service_name, const CORBA::ReferenceData& data);
virtual ~_sk_IScriptHook() {}
public:
static const CORBA::TypeInfo _skel_info;
// The following operations need to be implemented by the server.
virtual void justLoadedScript(const IScript& arg0) = 0;
virtual void aboutToUnloadScript(const IScript& arg0) = 0;
// Skeleton Operations implemented automatically
static void _justLoadedScript(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
static void _aboutToUnloadScript(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
};
template <class T>
class _tie_IScriptHook : public IScriptHook
{
public:
_tie_IScriptHook(T& t, const char *obj_name=(char*)NULL) :
IScriptHook(obj_name),
_ref(t) {
_object_name(obj_name);
}
_tie_IScriptHook(T& t, const char *service_name,
const CORBA::ReferenceData& id)
:_ref(t) {
_service(service_name, id);
}
~_tie_IScriptHook() {}
void justLoadedScript(const IScript& arg0) {
_ref.justLoadedScript(
arg0);
}
void aboutToUnloadScript(const IScript& arg0) {
_ref.aboutToUnloadScript(
arg0);
}
private:
T& _ref;
};
class _sk_IJSExecutionHook : public IJSExecutionHook
{
protected:
_sk_IJSExecutionHook(const char *object_name = (const char *)NULL);
_sk_IJSExecutionHook(const char *service_name, const CORBA::ReferenceData& data);
virtual ~_sk_IJSExecutionHook() {}
public:
static const CORBA::TypeInfo _skel_info;
// The following operations need to be implemented by the server.
virtual void aboutToExecute(const IJSThreadState& arg0,
const IJSPC& arg1) = 0;
// Skeleton Operations implemented automatically
static void _aboutToExecute(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
};
template <class T>
class _tie_IJSExecutionHook : public IJSExecutionHook
{
public:
_tie_IJSExecutionHook(T& t, const char *obj_name=(char*)NULL) :
IJSExecutionHook(obj_name),
_ref(t) {
_object_name(obj_name);
}
_tie_IJSExecutionHook(T& t, const char *service_name,
const CORBA::ReferenceData& id)
:_ref(t) {
_service(service_name, id);
}
~_tie_IJSExecutionHook() {}
void aboutToExecute(const IJSThreadState& arg0,
const IJSPC& arg1) {
_ref.aboutToExecute(
arg0,
arg1);
}
private:
T& _ref;
};
class _sk_IDebugController : public IDebugController
{
protected:
_sk_IDebugController(const char *object_name = (const char *)NULL);
_sk_IDebugController(const char *service_name, const CORBA::ReferenceData& data);
virtual ~_sk_IDebugController() {}
public:
static const CORBA::TypeInfo _skel_info;
// The following operations need to be implemented by the server.
virtual CORBA::Long getMajorVersion() = 0;
virtual CORBA::Long getMinorVersion() = 0;
virtual IJSErrorReporter_ptr setErrorReporter(IJSErrorReporter_ptr arg0) = 0;
virtual IJSErrorReporter_ptr getErrorReporter() = 0;
virtual IScriptHook_ptr setScriptHook(IScriptHook_ptr arg0) = 0;
virtual IScriptHook_ptr getScriptHook() = 0;
virtual IJSPC * getClosestPC(const IScript& arg0,
CORBA::Long arg1) = 0;
virtual IJSSourceLocation * getSourceLocation(const IJSPC& arg0) = 0;
virtual IJSExecutionHook_ptr setInterruptHook(IJSExecutionHook_ptr arg0) = 0;
virtual IJSExecutionHook_ptr getInterruptHook() = 0;
virtual IJSExecutionHook_ptr setDebugBreakHook(IJSExecutionHook_ptr arg0) = 0;
virtual IJSExecutionHook_ptr getDebugBreakHook() = 0;
virtual IJSExecutionHook_ptr setInstructionHook(IJSExecutionHook_ptr arg0,
const IJSPC& arg1) = 0;
virtual IJSExecutionHook_ptr getInstructionHook(const IJSPC& arg0) = 0;
virtual void setThreadContinueState(CORBA::Long arg0,
CORBA::Long arg1) = 0;
virtual void setThreadReturnValue(CORBA::Long arg0,
const char * arg1) = 0;
virtual void sendInterrupt() = 0;
virtual void sendInterruptStepInto(CORBA::Long arg0) = 0;
virtual void sendInterruptStepOver(CORBA::Long arg0) = 0;
virtual void sendInterruptStepOut(CORBA::Long arg0) = 0;
virtual void reinstateStepper(CORBA::Long arg0) = 0;
virtual IExecResult * executeScriptInStackFrame(CORBA::Long arg0,
const IJSStackFrameInfo& arg1,
const char * arg2,
const char * arg3,
CORBA::Long arg4) = 0;
virtual CORBA::Boolean isRunningHook(CORBA::Long arg0) = 0;
virtual CORBA::Boolean isWaitingForResume(CORBA::Long arg0) = 0;
virtual void leaveThreadSuspended(CORBA::Long arg0) = 0;
virtual void resumeThread(CORBA::Long arg0) = 0;
virtual void iterateScripts(IScriptHook_ptr arg0) = 0;
// Skeleton Operations implemented automatically
static void _getMajorVersion(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
static void _getMinorVersion(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
static void _setErrorReporter(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
static void _getErrorReporter(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
static void _setScriptHook(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
static void _getScriptHook(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
static void _getClosestPC(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
static void _getSourceLocation(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
static void _setInterruptHook(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
static void _getInterruptHook(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
static void _setDebugBreakHook(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
static void _getDebugBreakHook(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
static void _setInstructionHook(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
static void _getInstructionHook(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
static void _setThreadContinueState(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
static void _setThreadReturnValue(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
static void _sendInterrupt(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
static void _sendInterruptStepInto(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
static void _sendInterruptStepOver(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
static void _sendInterruptStepOut(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
static void _reinstateStepper(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
static void _executeScriptInStackFrame(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
static void _isRunningHook(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
static void _isWaitingForResume(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
static void _leaveThreadSuspended(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
static void _resumeThread(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
static void _iterateScripts(void *obj,
CORBA::MarshalStream &strm,
CORBA::Principal_ptr principal,
const char *oper,
void *priv_data);
};
template <class T>
class _tie_IDebugController : public IDebugController
{
public:
_tie_IDebugController(T& t, const char *obj_name=(char*)NULL) :
IDebugController(obj_name),
_ref(t) {
_object_name(obj_name);
}
_tie_IDebugController(T& t, const char *service_name,
const CORBA::ReferenceData& id)
:_ref(t) {
_service(service_name, id);
}
~_tie_IDebugController() {}
CORBA::Long getMajorVersion() {
return _ref.getMajorVersion();
}
CORBA::Long getMinorVersion() {
return _ref.getMinorVersion();
}
IJSErrorReporter_ptr setErrorReporter(IJSErrorReporter_ptr arg0) {
return _ref.setErrorReporter(
arg0);
}
IJSErrorReporter_ptr getErrorReporter() {
return _ref.getErrorReporter();
}
IScriptHook_ptr setScriptHook(IScriptHook_ptr arg0) {
return _ref.setScriptHook(
arg0);
}
IScriptHook_ptr getScriptHook() {
return _ref.getScriptHook();
}
IJSPC * getClosestPC(const IScript& arg0,
CORBA::Long arg1) {
return _ref.getClosestPC(
arg0,
arg1);
}
IJSSourceLocation * getSourceLocation(const IJSPC& arg0) {
return _ref.getSourceLocation(
arg0);
}
IJSExecutionHook_ptr setInterruptHook(IJSExecutionHook_ptr arg0) {
return _ref.setInterruptHook(
arg0);
}
IJSExecutionHook_ptr getInterruptHook() {
return _ref.getInterruptHook();
}
IJSExecutionHook_ptr setDebugBreakHook(IJSExecutionHook_ptr arg0) {
return _ref.setDebugBreakHook(
arg0);
}
IJSExecutionHook_ptr getDebugBreakHook() {
return _ref.getDebugBreakHook();
}
IJSExecutionHook_ptr setInstructionHook(IJSExecutionHook_ptr arg0,
const IJSPC& arg1) {
return _ref.setInstructionHook(
arg0,
arg1);
}
IJSExecutionHook_ptr getInstructionHook(const IJSPC& arg0) {
return _ref.getInstructionHook(
arg0);
}
void setThreadContinueState(CORBA::Long arg0,
CORBA::Long arg1) {
_ref.setThreadContinueState(
arg0,
arg1);
}
void setThreadReturnValue(CORBA::Long arg0,
const char * arg1) {
_ref.setThreadReturnValue(
arg0,
arg1);
}
void sendInterrupt() {
_ref.sendInterrupt();
}
void sendInterruptStepInto(CORBA::Long arg0) {
_ref.sendInterruptStepInto(
arg0);
}
void sendInterruptStepOver(CORBA::Long arg0) {
_ref.sendInterruptStepOver(
arg0);
}
void sendInterruptStepOut(CORBA::Long arg0) {
_ref.sendInterruptStepOut(
arg0);
}
void reinstateStepper(CORBA::Long arg0) {
_ref.reinstateStepper(
arg0);
}
IExecResult * executeScriptInStackFrame(CORBA::Long arg0,
const IJSStackFrameInfo& arg1,
const char * arg2,
const char * arg3,
CORBA::Long arg4) {
return _ref.executeScriptInStackFrame(
arg0,
arg1,
arg2,
arg3,
arg4);
}
CORBA::Boolean isRunningHook(CORBA::Long arg0) {
return _ref.isRunningHook(
arg0);
}
CORBA::Boolean isWaitingForResume(CORBA::Long arg0) {
return _ref.isWaitingForResume(
arg0);
}
void leaveThreadSuspended(CORBA::Long arg0) {
_ref.leaveThreadSuspended(
arg0);
}
void resumeThread(CORBA::Long arg0) {
_ref.resumeThread(
arg0);
}
void iterateScripts(IScriptHook_ptr arg0) {
_ref.iterateScripts(
arg0);
}
private:
T& _ref;
};
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -1,68 +0,0 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
public interface IDebugController extends org.omg.CORBA.Object
{
public int getMajorVersion();
public int getMinorVersion();
public IJSErrorReporter setErrorReporter(IJSErrorReporter er);
public IJSErrorReporter getErrorReporter();
public IScriptHook setScriptHook(IScriptHook h);
public IScriptHook getScriptHook();
public IJSPC getClosestPC(IScript script, int line);
public IJSSourceLocation getSourceLocation(IJSPC pc);
public IJSExecutionHook setInterruptHook(IJSExecutionHook hook);
public IJSExecutionHook getInterruptHook();
public IJSExecutionHook setDebugBreakHook(IJSExecutionHook hook);
public IJSExecutionHook getDebugBreakHook();
public IJSExecutionHook setInstructionHook(IJSExecutionHook hook, IJSPC pc);
public IJSExecutionHook getInstructionHook(IJSPC pc);
public void setThreadContinueState(int threadID, int state);
public void setThreadReturnValue(int threadID, String value);
public void sendInterrupt();
public void sendInterruptStepInto(int threadID);
public void sendInterruptStepOver(int threadID);
public void sendInterruptStepOut(int threadID);
public void reinstateStepper(int threadID);
public IExecResult executeScriptInStackFrame(int threadID,
IJSStackFrameInfo frame,
String text,
String filename,
int lineno);
public boolean isRunningHook(int threadID);
public boolean isWaitingForResume(int threadID);
public void leaveThreadSuspended(int threadID);
public void resumeThread(int threadID);
public void iterateScripts(IScriptHook h);
}

View File

@@ -1,29 +0,0 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
public final class IExecResult
{
public String result;
public boolean errorOccured;
public String errorMessage;
public String errorFilename;
public int errorLineNumber;
public String errorLineBuffer;
public int errorTokenOffset;
}

View File

@@ -1,32 +0,0 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
public interface IJSErrorReporter extends org.omg.CORBA.Object
{
/* keep these in sync with the numbers in jsdebug.h */
public static final int PASS_ALONG = 0;
public static final int RETURN = 1;
public static final int DEBUG = 2;
public int reportError( String msg,
String filename,
int lineno,
String linebuf,
int tokenOffset );
}

View File

@@ -1,22 +0,0 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
public interface IJSExecutionHook extends org.omg.CORBA.Object
{
public void aboutToExecute(IJSThreadState debug, IJSPC pc);
}

View File

@@ -1,24 +0,0 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
public final class IJSPC
{
public IScript script;
public int offset;
}

View File

@@ -1,23 +0,0 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
public final class IJSSourceLocation
{
public int line;
public IJSPC pc;
}

View File

@@ -1,23 +0,0 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
public final class IJSStackFrameInfo
{
public IJSPC pc;
public int jsdframe;
}

View File

@@ -1,65 +0,0 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
public final class IJSThreadState
{
/**
* partial list of thread states from sun.debug.ThreadInfo.
* XXX some of these don't apply.
*/
public final static int THR_STATUS_UNKNOWN = 0x01;
public final static int THR_STATUS_ZOMBIE = 0x02;
public final static int THR_STATUS_RUNNING = 0x03;
public final static int THR_STATUS_SLEEPING = 0x04;
public final static int THR_STATUS_MONWAIT = 0x05;
public final static int THR_STATUS_CONDWAIT = 0x06;
public final static int THR_STATUS_SUSPENDED = 0x07;
public final static int THR_STATUS_BREAK = 0x08;
public final static int DEBUG_STATE_DEAD = 0x01;
/**
* if the continueState is RUN, the thread will
* proceed to the next program counter value when it resumes.
*/
public final static int DEBUG_STATE_RUN = 0x02;
/**
* if the continueState is RETURN, the thread will
* return from the current method with the value in getReturnValue()
* when it resumes.
*/
public final static int DEBUG_STATE_RETURN = 0x03;
/**
* if the continueState is THROW, the thread will
* throw an exception (accessible with getException()) when it
* resumes.
*/
public final static int DEBUG_STATE_THROW = 0x04;
public IJSStackFrameInfo[] stack;
public int continueState;
public String returnValue;
public int status;
public int jsdthreadstate;
public int id; // used for referencing this object
}

View File

@@ -1,28 +0,0 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
public final class IScript
{
public String url;
public String funname;
public int base;
public int extent;
public int jsdscript;
public IScriptSection[] sections;
}

View File

@@ -1,24 +0,0 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
public interface IScriptHook extends org.omg.CORBA.Object
{
public void justLoadedScript(IScript script);
public void aboutToUnloadScript(IScript script);
}

View File

@@ -1,23 +0,0 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
public final class IScriptSection
{
public int base;
public int extent;
}

View File

@@ -1,37 +0,0 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
public interface ISourceTextProvider extends org.omg.CORBA.Object
{
/* these coorespond to jsdebug.h values - change in both places if anywhere */
public static final int INITED = 0;
public static final int FULL = 1;
public static final int PARTIAL = 2;
public static final int ABORTED = 3;
public static final int FAILED = 4;
public static final int CLEARED = 5;
public String[] getAllPages();
public void refreshAllPages();
public boolean hasPage(String url);
public boolean loadPage(String url);
public void refreshPage(String url);
public String getPageText(String url);
public int getPageStatus(String url);
public int getPageAlterCount(String url);
}

View File

@@ -1,25 +0,0 @@
/* jband - 09/09/97 - readme for the dreaded js/jsd/corba system */
This stuff in js/jsd/corba/src is used to generate corba source in IDL, Java,
and C++. The raw source is all Java. The 'makefile' is mk.bat which is currently
expected to run only on jband's NT box. All of the important output of this
process should be checked in to cvs. mk.bat is only needed to regenerate new
sources as the interfaces change. Those new sources should then be committed to
cvs.
The main scheme here is to use the Java code in js/jsd/corba/src as idl.
mk.bat uses java2idl, orbeline, and idl2java to generate IDL and stubs and
skeletons in C++ and Java. There are a few hacks to deal with limitations of
these tools.
The C++ output is copied to js/jsd/corba.
The Java output is copied to
js/jsdj/classes/com/netscape/jsdebugging/remote/corba.
Note that the files:
StringReciever.java
TestInterface.java
Thing.java
are used only in test programs and are not part of the product

View File

@@ -1,24 +0,0 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
public interface StringReciever extends org.omg.CORBA.Object
{
public void recieveString(String s);
public void bounce(int count);
}

View File

@@ -1,26 +0,0 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
public interface TestInterface extends org.omg.CORBA.Object
{
public String getFirstAppInList();
public void getAppNames( StringReciever sr );
public Thing[] getThings();
public void callBounce( StringReciever sr, int count );
}

Binary file not shown.

View File

@@ -1,31 +0,0 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
//
// This class only exist to force a forward declaration in the outputed
// idl file.
//
// It should be handed to java2idl after IScriptSection.class but before
// IScript.class
//
public final class bogus0
{
public IScriptSection[] bogus;
}

View File

@@ -1,31 +0,0 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
//
// This class only exist to force a forward declaration in the outputed
// idl file.
//
// It should be handed to java2idl after IJSStackFrameInfo.class but before
// IJSThreadState.class
//
public final class bogus1
{
public IJSStackFrameInfo[] bogus;
}

View File

@@ -1,143 +0,0 @@
@echo off
REM
REM This needs to be run from the src dir. It generates sibling dirs and their
REM contents.
REM
set base_package=com.netscape.jsdebugging.remote.corba
set base_packslash=com\netscape\jsdebugging\remote\corba
set jsdj_classes_dir=..\..\..\jsdj\classes
set DELAY=6
rem -------------------------------------------------------------------------
rem -- show settings
echo.
echo commandline: %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
echo.
echo ES3_ROOT = %ES3_ROOT%
echo base_package = %base_package% // set in this file
echo jsdj_classes_dir = %jsdj_classes_dir% // set in this file
echo.
rem -------------------------------------------------------------------------
rem -- check for environment settings
if "%ES3_ROOT%" == "" goto usage
set jc=sj.exe
set cp=.;%ES3_ROOT%\wai\java\nisb.zip;%ES3_ROOT%\wai\java\WAI.zip;%ES3_ROOT%\plugins\Java\classes\serv3_0.zip
set old_classpath=%CLASSPATH%
set CLASSPATH=%CLASSPATH%;%ES3_ROOT%\wai\java\nisb.zip;%ES3_ROOT%\wai\java\WAI.zip
echo.
echo creating output dirs
if not exist ..\class\NUL mkdir ..\class
if not exist ..\idl\NUL mkdir ..\idl
if not exist ..\java\NUL mkdir ..\java
if not exist ..\cpp\NUL mkdir ..\cpp
echo.
echo compiling raw Java interfaces
%jc% -classpath %cp% *.java -d ..\class
..\src\wait %DELAY%
cd ..\class
echo.
echo.
echo generating idl
echo.
REM
REM THESE ARE HAND ORDERED TO DEAL WITH DEPENDENCIES
REM
%ES3_ROOT%\wai\bin\java2idl Thing.class StringReciever.class TestInterface.class ISourceTextProvider.class IScriptSection.class bogus0.class IScript.class IJSPC.class IJSSourceLocation.class IJSErrorReporter.class IScriptHook.class IJSStackFrameInfo.class bogus1.class IJSThreadState.class IJSExecutionHook.class IExecResult.class IDebugController.class > ..\idl\ifaces.idl
..\src\wait %DELAY%
cd ..\idl
echo.
echo.
echo stripping lines from idl which were added to correctly order declarations
echo.
copy ifaces.idl ifaces_original.idl
REM
REM since we currenly have 2 of these, we can avoid the copy
REM
gawk -v pat="struct bogus0" -v lines=3 -f ..\src\cutlines.awk < ifaces.idl > temp.idl
gawk -v pat="struct bogus1" -v lines=3 -f ..\src\cutlines.awk < temp.idl > ifaces.idl
REM copy temp.idl ifaces.idl
REM ..\src\wait %DELAY%
cd ..\cpp
echo.
echo.
echo generating cpp
echo.
%ES3_ROOT%\wai\bin\orbeline ..\idl\ifaces.idl
..\src\wait %DELAY%
cd ..\java
echo.
echo.
echo generating java
echo.
%ES3_ROOT%\wai\bin\idl2java ..\idl\ifaces.idl -package %base_package% -no_examples -no_tie -no_comments
..\src\wait %DELAY%
cd ..\src
echo.
echo. copying generated files
echo.
REM
REM preserve generated java, but put ours in the outdir
REM
xcopy /Q ..\java\%base_packslash%\*.java ..\java\%base_packslash%\_unused\*.jav
REM
REM *****CUSTOMIZE HERE AS NEW INTERFACES WITH static ints ARE ADDED*****
REM
copy ..\src\package_header.h+..\src\ISourceTextProvider.java ..\java\%base_packslash%\ISourceTextProvider.java
copy ..\src\package_header.h+..\src\IJSErrorReporter.java ..\java\%base_packslash%\IJSErrorReporter.java
copy ..\src\package_header.h+..\src\IJSThreadState.java ..\java\%base_packslash%\IJSThreadState.java
copy ..\src\package_header.h+..\src\IDebugController.java ..\java\%base_packslash%\IDebugController.java
REM
REM
xcopy /Q ..\cpp\ifaces_c.hh ..\
xcopy /Q ..\cpp\ifaces_s.hh ..\
xcopy /Q ..\cpp\ifaces_c.cc ..\ifaces_c.cpp
xcopy /Q ..\cpp\ifaces_s.cc ..\ifaces_s.cpp
if "%jsdj_classes_dir%" == "" goto done
if not exist %jsdj_classes_dir%\NUL goto done
xcopy /Q /S ..\java\*.java %jsdj_classes_dir%
goto done
:usage
echo.
echo usage:
echo mk
echo.
echo See "readme.txt" for details...
echo.
echo Rules:
echo.
echo These must be defined in environment:
echo ES3_ROOT // location of Enterprise Server (e.g. e:\Netscape\SuiteSpot)
echo.
:done
..\src\wait %DELAY%
cd ..\src
set base_package=
set base_packslash=
set jsdj_classes_dir=
set cp=
set jc=
set DELAY=
set CLASSPATH=%old_classpath%
set old_classpath=
echo.
echo.
echo done
echo.

View File

@@ -1,3 +0,0 @@
package com.netscape.jsdebugging.remote.corba;

View File

@@ -1,5 +0,0 @@
#
# This is a list of local files which get copied to the mozilla:dist directory
#
jsdebug.h

View File

@@ -1,417 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
** Header for JavaScript Debugger for Navigator internal protos
*/
#ifndef jsd_h___
#define jsd_h___
#include "jsdebug.h"
#include "jsdbgapi.h"
#include "prmem.h"
#include "prprf.h"
#include "prmon.h"
#include "prtypes.h"
#include "prlog.h" /* for PR_ASSERT */
#ifndef NSPR20
#include "prhash.h"
#else
#include "plhash.h"
#endif
#include "prclist.h"
#include "prthread.h"
/* #include "xp.h" */
NSPR_BEGIN_EXTERN_C
#define JSD_MAJOR_VERSION 1
#define JSD_MINOR_VERSION 0
#define MY_XP_STRDUP strdup
#define MY_XP_FREE free
#define MY_XP_STRNCASECMP strncasecomp
#define MY_XP_TO_LOWER tolower
#ifdef XP_WIN16
#define MY_XP_HUGE __huge
#define MY_XP_HUGE_ALLOC(SIZE) halloc(SIZE,1)
#define MY_XP_HUGE_FREE(SIZE) hfree(SIZE)
#define MY_XP_HUGE_MEMCPY(DEST, SOURCE, LEN) hmemcpy(DEST, SOURCE, LEN)
#else
#define MY_XP_HUGE
#define MY_XP_HUGE_ALLOC(SIZE) malloc(SIZE)
#define MY_XP_HUGE_FREE(SIZE) free(SIZE)
#define MY_XP_HUGE_MEMCPY(DEST, SOURCE, LEN) memcpy(DEST, SOURCE, LEN)
#endif
#define MY_XP_HUGE_CHAR_PTR char MY_XP_HUGE *
/***************************************************************************/
/* Our structures */
/**
* XXX This is lame. What I'm calling a JSDContext is really more of a
* TaskState. I should use 'JSDContext' for the thing I'm now calling
* a JSDContextWrapper. arg!
*/
struct JSDContext
{
JSBool inited;
JSD_ScriptHookProc scriptHook;
void* scriptHookData;
JSD_ExecutionHookProc interruptHook;
void* interruptHookData;
JSTaskState* jstaskstate;
PRHashTable* jscontexts;
JSD_ErrorReporter errorReporter;
void* errorReporterData;
PRCList threadsStates;
JSD_ExecutionHookProc debugBreakHook;
void* debugBreakHookData;
JSContext* dumbContext;
JSObject* glob;
};
typedef struct
{
JSContext* context;
JSDContext* jsdc;
JSErrorReporter originalErrorReporter;
} JSDContextWrapper;
struct JSDScript
{
PRCList links; /* we are part of a PRCList */
JSDContext* jsdc; /* JSDContext for this jsdscript */
JSScript* script; /* script we are wrapping */
JSFunction* function; /* back pointer to owning function (can be NULL) */
PRUintn lineBase; /* we cache this */
PRUintn lineExtent; /* we cache this */
PRCList hooks; /* PRCList of JSDExecHooks for this script */
char* url;
};
struct JSDSourceText
{
PRCList links; /* we are part of a PRCList */
char* url;
MY_XP_HUGE_CHAR_PTR text;
PRUintn textLength;
PRUintn textSpace;
JSBool dirty;
JSDSourceStatus status;
PRUintn alterCount;
};
typedef struct JSDExecHook
{
PRCList links; /* we are part of a PRCList */
JSDScript* jsdscript;
prword_t pc;
JSD_ExecutionHookProc hook;
void* callerdata;
} JSDExecHook;
struct JSDThreadState
{
PRCList links; /* we are part of a PRCList */
JSContext* context;
PRThread* thread;
PRCList stack;
PRUintn stackDepth;
PRUintn wait;
};
struct JSDStackFrameInfo
{
PRCList links; /* we are part of a PRCList */
JSDThreadState* jsdthreadstate;
JSDScript* jsdscript;
prword_t pc;
JSObject* object;
JSObject* thisp;
JSStackFrame* fp;
};
/***************************************************************************/
/* Code validation support */
#ifdef DEBUG
extern void JSD_ASSERT_VALID_CONTEXT( JSDContext* jsdc );
extern void JSD_ASSERT_VALID_SCRIPT( JSDScript* jsdscript );
extern void JSD_ASSERT_VALID_SOURCE_TEXT( JSDSourceText* jsdsrc );
extern void JSD_ASSERT_VALID_THREAD_STATE( JSDThreadState* jsdthreadstate );
extern void JSD_ASSERT_VALID_STACK_FRAME( JSDStackFrameInfo* jsdframe );
extern void JSD_ASSERT_VALID_EXEC_HOOK( JSDExecHook* jsdhook );
#else
#define JSD_ASSERT_VALID_CONTEXT(x) ((void)x)
#define JSD_ASSERT_VALID_SCRIPT(x) ((void)x)
#define JSD_ASSERT_VALID_SOURCE_TEXT(x) ((void)x)
#define JSD_ASSERT_VALID_THREAD_STATE(x)((void)x)
#define JSD_ASSERT_VALID_STACK_FRAME(x) ((void)x)
#define JSD_ASSERT_VALID_EXEC_HOOK(x) ((void)x)
#endif
/***************************************************************************/
/* higher level functions */
extern JSDContext*
jsd_DebuggerOn(void);
extern void
jsd_DebuggerOff(JSDContext* jsdc);
extern void
jsd_SetUserCallbacks(JSTaskState* jstaskstate, JSD_UserCallbacks* callbacks, void* user);
extern void
jsd_JSContextUsed( JSDContext* jsdc, JSContext* context );
extern JSDContext*
jsd_GetDefaultJSDContext(void);
extern JSD_ErrorReporter
jsd_SetErrorReporter( JSDContext* jsdc, JSD_ErrorReporter reporter, void* callerdata);
extern JSBool
jsd_IsCurrentThreadDangerous(void);
/***************************************************************************/
/* Script functions */
extern void
jsd_LockScriptSubsystem(JSDContext* jsdc);
extern void
jsd_UnlockScriptSubsystem(JSDContext* jsdc);
extern void
jsd_DestroyAllJSDScripts( JSDContext* jsdc );
extern JSDScript*
jsd_FindJSDScript( JSDContext* jsdc,
JSScript *script );
extern JSDScript*
jsd_IterateScripts(JSDContext* jsdc, JSDScript **iterp);
extern const char*
jsd_GetScriptFilename(JSDContext* jsdc, JSDScript *jsdscript);
extern const char*
jsd_GetScriptFunctionName(JSDContext* jsdc, JSDScript *jsdscript);
extern PRUintn
jsd_GetScriptBaseLineNumber(JSDContext* jsdc, JSDScript *jsdscript);
extern PRUintn
jsd_GetScriptLineExtent(JSDContext* jsdc, JSDScript *jsdscript);
extern JSD_ScriptHookProc
jsd_SetScriptHook(JSDContext* jsdc, JSD_ScriptHookProc hook, void* callerdata);
extern JSD_ScriptHookProc
jsd_GetScriptHook(JSDContext* jsdc);
extern prword_t
jsd_GetClosestPC(JSDContext* jsdc, JSDScript* jsdscript, PRUintn line);
extern PRUintn
jsd_GetClosestLine(JSDContext* jsdc, JSDScript* jsdscript, prword_t pc);
extern void PR_CALLBACK
jsd_NewScriptHookProc(
JSContext *cx,
const char *filename, /* URL this script loads from */
PRUintn lineno, /* line where this script starts */
JSScript *script,
JSFunction *fun,
void* callerdata );
extern void PR_CALLBACK
jsd_DestroyScriptHookProc(
JSContext *cx,
JSScript *script,
void* callerdata );
/* Script execution hook functions */
extern JSBool
jsd_SetExecutionHook(JSDContext* jsdc,
JSDScript* jsdscript,
prword_t pc,
JSD_ExecutionHookProc hook,
void* callerdata);
extern JSBool
jsd_ClearExecutionHook(JSDContext* jsdc,
JSDScript* jsdscript,
prword_t pc);
extern JSBool
jsd_ClearAllExecutionHooksForScript(JSDContext* jsdc, JSDScript* jsdscript);
extern JSBool
jsd_ClearAllExecutionHooks(JSDContext* jsdc);
/***************************************************************************/
/* Source Text functions */
extern void
jsd_LockSourceTextSubsystem(JSDContext* jsdc);
extern void
jsd_UnlockSourceTextSubsystem(JSDContext* jsdc);
extern JSDSourceText*
jsd_IterateSources(JSDContext* jsdc, JSDSourceText **iterp);
extern JSDSourceText*
jsd_FindSourceForURL(JSDContext* jsdc, const char* url);
extern const char*
jsd_GetSourceURL(JSDContext* jsdc, JSDSourceText* jsdsrc);
extern JSBool
jsd_GetSourceText(JSDContext* jsdc, JSDSourceText* jsdsrc,
const char** ppBuf, int* pLen);
extern void
jsd_ClearSourceText(JSDContext* jsdc, JSDSourceText* jsdsrc);
extern JSDSourceStatus
jsd_GetSourceStatus(JSDContext* jsdc, JSDSourceText* jsdsrc);
extern JSBool
jsd_IsSourceDirty(JSDContext* jsdc, JSDSourceText* jsdsrc);
extern void
jsd_SetSourceDirty(JSDContext* jsdc, JSDSourceText* jsdsrc, JSBool dirty);
extern PRUintn
jsd_GetSourceAlterCount(JSDContext* jsdc, JSDSourceText* jsdsrc);
extern PRUintn
jsd_IncrementSourceAlterCount(JSDContext* jsdc, JSDSourceText* jsdsrc);
extern JSDSourceText*
jsd_NewSourceText(JSDContext* jsdc, const char* url);
extern JSDSourceText*
jsd_AppendSourceText(JSDContext* jsdc,
JSDSourceText* jsdsrc,
const char* text, /* *not* zero terminated */
size_t length,
JSDSourceStatus status);
extern void
jsd_DestroyAllSources( JSDContext* jsdc );
extern const char*
jsd_BuildNormalizedURL( const char* url_string );
/***************************************************************************/
/* Interrupt Hook functions */
extern JSBool
jsd_SetInterruptHook(JSDContext* jsdc,
JSD_ExecutionHookProc hook,
void* callerdata);
extern JSBool
jsd_ClearInterruptHook(JSDContext* jsdc);
extern JSBool
jsd_SetDebugBreakHook(JSDContext* jsdc,
JSD_ExecutionHookProc hook,
void* callerdata);
extern JSBool
jsd_ClearDebugBreakHook(JSDContext* jsdc);
/***************************************************************************/
/* Stack Frame functions */
extern PRUintn
jsd_GetCountOfStackFrames(JSDContext* jsdc, JSDThreadState* jsdthreadstate);
extern JSDStackFrameInfo*
jsd_GetStackFrame(JSDContext* jsdc, JSDThreadState* jsdthreadstate);
extern JSDStackFrameInfo*
jsd_GetCallingStackFrame(JSDContext* jsdc,
JSDThreadState* jsdthreadstate,
JSDStackFrameInfo* jsdframe);
extern JSDScript*
jsd_GetScriptForStackFrame(JSDContext* jsdc,
JSDThreadState* jsdthreadstate,
JSDStackFrameInfo* jsdframe);
extern prword_t
jsd_GetPCForStackFrame(JSDContext* jsdc,
JSDThreadState* jsdthreadstate,
JSDStackFrameInfo* jsdframe);
extern JSDThreadState*
jsd_NewThreadState(JSDContext* jsdc, JSContext *cx);
extern void
jsd_DestroyThreadState(JSDContext* jsdc, JSDThreadState* jsdthreadstate);
extern JSBool
jsd_EvaluateScriptInStackFrame(JSDContext* jsdc,
JSDThreadState* jsdthreadstate,
JSDStackFrameInfo* jsdframe,
const char *bytes, PRUintn length,
const char *filename, PRUintn lineno, jsval *rval);
extern JSString*
jsd_ValToStringInStackFrame(JSDContext* jsdc,
JSDThreadState* jsdthreadstate,
JSDStackFrameInfo* jsdframe,
jsval val);
extern void
jsd_LockThreadsStates(JSDContext* jsdc);
extern void
jsd_UnlockThreadStates(JSDContext* jsdc);
extern JSBool
jsd_ThreadStatesIsLocked(JSDContext* jsdc);
extern JSBool
jsd_IsValidThreadState(JSDContext* jsdc,
JSDThreadState* jsdthreadstate);
extern JSBool
jsd_IsValidFrameInThreadState(JSDContext* jsdc,
JSDThreadState* jsdthreadstate,
JSDStackFrameInfo* jsdframe);
/***************************************************************************/
NSPR_END_EXTERN_C
#endif /* jsd_h___ */

View File

@@ -1,89 +0,0 @@
; -*- Mode: Fundamental; tab-width: 4; indent-tabs-mode: nil -*-
;
; The contents of this file are subject to the Netscape Public License
; Version 1.0 (the "NPL"); you may not use this file except in
; compliance with the NPL. You may obtain a copy of the NPL at
; http://www.mozilla.org/NPL/
;
; Software distributed under the NPL is distributed on an "AS IS" basis,
; WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
; for the specific language governing rights and limitations under the
; NPL.
;
; The Initial Developer of this code under the NPL is Netscape
; Communications Corporation. Portions created by Netscape are
; Copyright (C) 1998 Netscape Communications Corporation. All Rights
; Reserved.
LIBRARY JSD1640.DLL
EXETYPE WINDOWS
PROTMODE
DESCRIPTION 'Netscape 16-bit JavaScript Debugger Library'
CODE LOADONCALL MOVEABLE DISCARDABLE
DATA PRELOAD MOVEABLE SINGLE
HEAPSIZE 8192
EXPORTS
WEP @1 RESIDENTNAME NONAME
_JSD_AppendSourceText
_JSD_ClearAllExecutionHooks
_JSD_ClearAllExecutionHooksForScript
_JSD_ClearDebugBreakHook
_JSD_ClearExecutionHook
_JSD_ClearInterruptHook
_JSD_ClearSourceText
_JSD_DebuggerOff
_JSD_DebuggerOn
_JSD_EvaluateScriptInStackFrame
_JSD_FindSourceForURL
_JSD_GetCallingStackFrame
_JSD_GetClosestLine
_JSD_GetClosestPC
_JSD_GetCountOfStackFrames
_JSD_GetDefaultJSContext
_JSD_GetMajorVersion
_JSD_GetMinorVersion
_JSD_GetPCForStackFrame
_JSD_GetScriptBaseLineNumber
_JSD_GetScriptFilename
_JSD_GetScriptForStackFrame
_JSD_GetScriptFunctionName
_JSD_GetScriptHook
_JSD_GetScriptLineExtent
_JSD_GetSourceAlterCount
_JSD_GetSourceStatus
_JSD_GetSourceText
_JSD_GetSourceURL
_JSD_GetStackFrame
_JSD_IncrementSourceAlterCount
_JSD_IsSourceDirty
_JSD_IterateScripts
_JSD_IterateSources
_JSD_LockScriptSubsystem
_JSD_LockSourceTextSubsystem
_JSD_NewSourceText
_JSD_SetDebugBreakHook
_JSD_SetErrorReporter
_JSD_SetExecutionHook
_JSD_SetInterruptHook
_JSD_SetScriptHook
_JSD_SetSourceDirty
_JSD_SetUserCallbacks
_JSD_UnlockScriptSubsystem
_JSD_UnlockSourceTextSubsystem
_Java_netscape_jsdebug_DebugController__0005fsetController_stub
_Java_netscape_jsdebug_DebugController_executeScriptInStackFrame_stub
_Java_netscape_jsdebug_DebugController_sendInterrupt_stub
_Java_netscape_jsdebug_DebugController_setInstructionHook0_stub
_Java_netscape_jsdebug_JSPC_getSourceLocation_stub
_Java_netscape_jsdebug_JSSourceTextProvider_loadSourceTextItem_stub
_Java_netscape_jsdebug_JSSourceTextProvider_refreshSourceTextVector_stub
_Java_netscape_jsdebug_JSStackFrameInfo_getCaller0_stub
_Java_netscape_jsdebug_JSStackFrameInfo_getPC_stub
_Java_netscape_jsdebug_JSThreadState_countStackFrames_stub
_Java_netscape_jsdebug_JSThreadState_getCurrentFrame_stub
_Java_netscape_jsdebug_Script_getClosestPC_stub

View File

@@ -1,80 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/////////////////////////////////////////////////////////////////////////////
// Version stamp for this .DLL
#include <windows.h>
#include <ver.h>
VS_VERSION_INFO VERSIONINFO
FILEVERSION 4 // major, minor, release (alpha 1), build #
PRODUCTVERSION 4
FILEFLAGSMASK 0
FILEFLAGS 0 // final version
FILEOS VOS_DOS_WINDOWS16
FILETYPE VFT_DLL
FILESUBTYPE 0 // not used
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4" // Lang=US English, CharSet=Windows Multilingual
BEGIN
VALUE "CompanyName", "Netscape Communications Corporation\0"
VALUE "FileDescription", "Netscape 16-bit JavaScript Debugger Module\0"
VALUE "FileVersion", "4.0\0"
VALUE "InternalName", "JSD1640\0"
VALUE "LegalCopyright", "Copyright Netscape Communications. 1994-96\0"
VALUE "LegalTrademarks", "Netscape, Mozilla\0"
VALUE "OriginalFilename","JSD1640.DLL\0"
VALUE "ProductName", "NETSCAPE\0"
VALUE "ProductVersion", "4.0\0"
END
END
END

View File

@@ -1,99 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "winver.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 4,0,0,0
PRODUCTVERSION 4,0,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x10004L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904e4"
BEGIN
VALUE "CompanyName", "Netscape Communications Corporation\0"
VALUE "FileDescription", "Netscape 32-bit JavaScript Debugger Module\0"
VALUE "FileVersion", "4.0\0"
VALUE "InternalName", "JSD3240\0"
VALUE "LegalCopyright", "Copyright Netscape Communications. 1994-96\0"
VALUE "LegalTrademarks", "Netscape, Mozilla\0"
VALUE "OriginalFilename", "jsd3240.dll\0"
VALUE "ProductName", "NETSCAPE\0"
VALUE "ProductVersion", "4.0\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1252
END
END
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""winver.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////

View File

@@ -1,298 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
** JavaScript Debugger Navigator API - 'High Level' functions
*/
#include "jsd.h"
/***************************************************************************/
/* use a global context for now (avoid direct references to it!) */
static JSDContext _static_context;
/* these are global now, they transcend our concept of JSDContext...*/
static JSD_UserCallbacks _callbacks;
static void* _user;
static JSTaskState* _jstaskstate;
static PRThread * _dangerousThread1;
#ifdef DEBUG
void JSD_ASSERT_VALID_CONTEXT( JSDContext* jsdc )
{
PR_ASSERT( jsdc == &_static_context );
PR_ASSERT( jsdc->inited );
PR_ASSERT( jsdc->jstaskstate );
PR_ASSERT( jsdc->jscontexts );
}
#endif
static PRHashNumber
_hash_root(const void *key)
{
PRHashNumber num = (PRHashNumber) key;
return num >> 2;
}
static JSClass global_class = {
"JSDGlobal", 0,
JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub
};
static JSDContext*
NewJSDContext(void)
{
JSDContext* jsdc = &_static_context;
if( jsdc->inited )
return NULL;
if( ! _jstaskstate )
return NULL;
memset( jsdc, 0, sizeof(JSDContext) );
jsdc->jstaskstate = _jstaskstate;
PR_INIT_CLIST(&jsdc->threadsStates);
jsdc->dumbContext = JS_NewContext( _jstaskstate, 256 );
if( ! jsdc->dumbContext )
return NULL;
jsdc->glob = JS_NewObject(jsdc->dumbContext, &global_class, NULL, NULL);
if( ! jsdc->glob )
return NULL;
if( ! JS_InitStandardClasses(jsdc->dumbContext, jsdc->glob) )
return NULL;
jsdc->jscontexts = PR_NewHashTable(256, _hash_root,
PR_CompareValues, PR_CompareValues,
NULL, NULL);
if( ! jsdc->jscontexts )
return NULL;
jsdc->inited = JS_TRUE;
return jsdc;
}
PR_STATIC_CALLBACK(PRIntn)
_hash_entry_zapper(PRHashEntry *he, PRIntn i, void *arg)
{
PR_FREEIF(he->value);
he->value = NULL;
he->key = NULL;
return HT_ENUMERATE_NEXT;
}
static void
DestroyJSDContext( JSDContext* jsdc )
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
if( jsdc->jscontexts )
{
PR_HashTableEnumerateEntries(jsdc->jscontexts, _hash_entry_zapper, NULL);
PR_HashTableDestroy(jsdc->jscontexts);
}
jsdc->inited = JS_FALSE;
}
JSDContext*
jsd_GetDefaultJSDContext(void)
{
JSDContext* jsdc = &_static_context;
if( ! jsdc->inited )
return NULL;
return jsdc;
}
/***************************************************************************/
JSDContext*
jsd_DebuggerOn(void)
{
JSDContext* jsdc = NewJSDContext();
JSContext* iter = NULL;
JSContext* cx;
if( ! jsdc )
return NULL;
/* set hooks here */
JS_SetNewScriptHookProc( jsdc->jstaskstate, jsd_NewScriptHookProc, jsdc );
JS_SetDestroyScriptHookProc( jsdc->jstaskstate, jsd_DestroyScriptHookProc, jsdc );
/* enumerate contexts for JSTaskState and add them to our table */
while( NULL != (cx = JS_ContextIterator(jsdc->jstaskstate, &iter)) )
jsd_JSContextUsed( jsdc, cx );
if( _callbacks.setContext )
_callbacks.setContext( jsdc, _user );
return jsdc;
}
void
jsd_DebuggerOff(JSDContext* jsdc)
{
/* clear hooks here */
JS_SetNewScriptHookProc( jsdc->jstaskstate, NULL, NULL );
JS_SetDestroyScriptHookProc( jsdc->jstaskstate, NULL, NULL );
/* clean up */
jsd_DestroyAllJSDScripts( jsdc );
jsd_DestroyAllSources( jsdc );
DestroyJSDContext( jsdc );
if( _callbacks.setContext )
_callbacks.setContext( NULL, _user );
}
void
jsd_SetUserCallbacks(JSTaskState* jstaskstate, JSD_UserCallbacks* callbacks, void* user)
{
_jstaskstate = jstaskstate;
_user = user;
_dangerousThread1 = PR_CurrentThread();
if( callbacks )
memcpy( &_callbacks, callbacks, sizeof(JSD_UserCallbacks) );
else
memset( &_callbacks, 0 , sizeof(JSD_UserCallbacks) );
if( _callbacks.setContext && _static_context.inited )
_callbacks.setContext( &_static_context, _user );
}
JSDContextWrapper*
jsd_JSDContextWrapperForJSContext( JSDContext* jsdc, JSContext* context )
{
return (JSDContextWrapper*) PR_HashTableLookup(jsdc->jscontexts, context);
}
PR_STATIC_CALLBACK(void)
jsd_ErrorReporter(JSContext *cx, const char *message, JSErrorReport *report)
{
JSDContextWrapper* wrapper;
JSDContext* jsdc;
PRUintn action = JSD_ERROR_REPORTER_PASS_ALONG;
jsdc = jsd_GetDefaultJSDContext();
if( ! jsdc )
{
PR_ASSERT(0);
return;
}
wrapper = jsd_JSDContextWrapperForJSContext( jsdc, cx );
if( ! wrapper )
{
PR_ASSERT(0);
return;
}
if( jsdc->errorReporter && ! jsd_IsCurrentThreadDangerous() )
action = jsdc->errorReporter(jsdc, cx, message, report,
jsdc->errorReporterData);
switch(action)
{
case JSD_ERROR_REPORTER_PASS_ALONG:
if( wrapper->originalErrorReporter )
wrapper->originalErrorReporter(cx, message, report);
break;
case JSD_ERROR_REPORTER_RETURN:
break;
case JSD_ERROR_REPORTER_DEBUG:
{
JSDThreadState* jsdthreadstate;
if( ! jsdc->debugBreakHook )
return;
jsdthreadstate = jsd_NewThreadState(jsdc,cx);
if( jsdthreadstate )
{
(*jsdc->debugBreakHook)(jsdc, jsdthreadstate,
JSD_HOOK_DEBUG_REQUESTED,
jsdc->debugBreakHookData );
jsd_DestroyThreadState(jsdc, jsdthreadstate);
}
}
default:;
}
}
void
jsd_JSContextUsed( JSDContext* jsdc, JSContext* context )
{
JSDContextWrapper* wrapper;
wrapper = jsd_JSDContextWrapperForJSContext(jsdc, context);
if( wrapper )
{
/* error reporters are sometimes overwritten by other code... */
JSErrorReporter oldrep = JS_SetErrorReporter(context, jsd_ErrorReporter);
if( jsd_ErrorReporter != oldrep )
wrapper->originalErrorReporter = oldrep;
return;
}
/* else... */
wrapper = PR_NEWZAP(JSDContextWrapper);
if( ! wrapper )
return;
if( ! PR_HashTableAdd(jsdc->jscontexts, context, wrapper ) )
{
PR_FREEIF(wrapper);
return;
}
wrapper->context = context;
wrapper->jsdc = jsdc;
/* add our error reporter */
wrapper->originalErrorReporter = JS_SetErrorReporter(context, jsd_ErrorReporter);
/* add our printer */
/* add our loader */
}
JSD_ErrorReporter
jsd_SetErrorReporter( JSDContext* jsdc, JSD_ErrorReporter reporter, void* callerdata)
{
JSD_ErrorReporter old = jsdc->errorReporter;
jsdc->errorReporter = reporter;
jsdc->errorReporterData = callerdata;
return old;
}
JSBool
jsd_IsCurrentThreadDangerous()
{
return PR_CurrentThread() == _dangerousThread1;
}

View File

@@ -1,101 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
** JavaScript Debugger Navigator API - Hook support
*/
#include "jsd.h"
JSTrapStatus PR_CALLBACK
jsd_InterruptHandler(JSContext *cx, JSScript *script, jsbytecode *pc, jsval *rval,
void *closure)
{
PRUintn hookanswer = JSD_HOOK_RETURN_CONTINUE;
JSDThreadState* jsdthreadstate;
JSDScript* jsdscript;
JSDContext* jsdc = (JSDContext*) closure;
if( jsd_IsCurrentThreadDangerous() )
return JSTRAP_CONTINUE;
if( ! jsdc || ! jsdc->inited )
return JSTRAP_CONTINUE;
jsd_JSContextUsed(jsdc, cx);
if( ! jsdc->interruptHook )
return JSTRAP_CONTINUE;
jsdscript = jsd_FindJSDScript(jsdc, script);
if( ! jsdscript )
return JSTRAP_CONTINUE;
jsdthreadstate = jsd_NewThreadState(jsdc,cx);
if( jsdthreadstate )
{
hookanswer =
(*jsdc->interruptHook)(jsdc, jsdthreadstate,
JSD_HOOK_INTERRUPTED,
jsdc->interruptHookData );
jsd_DestroyThreadState(jsdc, jsdthreadstate);
}
*rval = NULL; /* XXX fix this!!! */
if( JSD_HOOK_RETURN_ABORT == hookanswer )
return JSTRAP_ERROR;
return JSTRAP_CONTINUE; /* XXX fix this!!! */
}
JSBool
jsd_SetInterruptHook(JSDContext* jsdc,
JSD_ExecutionHookProc hook,
void* callerdata)
{
jsdc->interruptHook = hook;
jsdc->interruptHookData = callerdata;
return JS_SetInterrupt(jsdc->jstaskstate, jsd_InterruptHandler, (void*) jsdc);
}
JSBool
jsd_ClearInterruptHook(JSDContext* jsdc)
{
jsdc->interruptHook = NULL;
return JS_ClearInterrupt(jsdc->jstaskstate, NULL, NULL );
}
JSBool
jsd_SetDebugBreakHook(JSDContext* jsdc,
JSD_ExecutionHookProc hook,
void* callerdata)
{
jsdc->debugBreakHook = hook;
jsdc->debugBreakHookData = callerdata;
return JS_TRUE;
}
JSBool
jsd_ClearDebugBreakHook(JSDContext* jsdc)
{
jsdc->debugBreakHook = NULL;
return JS_TRUE;
}

View File

@@ -1,797 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "native.h"
#include "jsdebug.h"
#ifndef XP_MAC
#include "_gen/netscape_jsdebug_DebugController.h"
#include "_gen/netscape_jsdebug_Script.h"
#include "_gen/netscape_jsdebug_JSThreadState.h"
#include "_gen/netscape_jsdebug_JSStackFrameInfo.h"
#include "_gen/netscape_jsdebug_JSPC.h"
#include "_gen/netscape_jsdebug_JSSourceTextProvider.h"
#include "_gen/netscape_jsdebug_JSErrorReporter.h"
#else
#include "n_jsdebug_DebugController.h"
#include "netscape_jsdebug_Script.h"
#include "n_jsdebug_JSThreadState.h"
#include "n_jsdebug_JSStackFrameInfo.h"
#include "netscape_jsdebug_JSPC.h"
#include "n_j_JSSourceTextProvider.h"
#include "n_jsdebug_JSErrorReporter.h"
#endif
static JSDContext* context = 0;
static struct Hnetscape_jsdebug_DebugController* controller = 0;
/***************************************************************************/
/* helpers */
static JHandle*
_constructInteger(ExecEnv *ee, long i)
{
return (JHandle*)
execute_java_constructor(ee, "java/lang/Integer", 0, "(I)", i);
}
static JHandle*
_putHash(ExecEnv *ee, JHandle* tbl, JHandle* key, JHandle* ob)
{
return (JHandle*)
execute_java_dynamic_method(
ee, tbl, "put",
"(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;",
key, ob );
}
static JHandle*
_getHash(ExecEnv *ee, JHandle* tbl, JHandle* key)
{
return (JHandle*)
execute_java_dynamic_method(
ee, tbl, "get",
"(Ljava/lang/Object;)Ljava/lang/Object;",
key );
}
static JHandle*
_removeHash(ExecEnv *ee, JHandle* tbl, JHandle* key)
{
return (JHandle*)
execute_java_dynamic_method(
ee, tbl, "remove",
"(Ljava/lang/Object;)Ljava/lang/Object;",
key );
}
struct Hnetscape_jsdebug_JSStackFrameInfo*
_constructJSStackFrameInfo( ExecEnv* ee, JSDStackFrameInfo* jsdframe,
struct Hnetscape_jsdebug_JSThreadState* threadState )
{
struct Hnetscape_jsdebug_JSStackFrameInfo* frame;
frame = (struct Hnetscape_jsdebug_JSStackFrameInfo*)
execute_java_constructor( ee, "netscape/jsdebug/JSStackFrameInfo", 0,
"(Lnetscape/jsdebug/JSThreadState;)",
threadState );
if( ! frame )
return NULL;
/* XXX fill in additional fields */
unhand(frame)->_nativePtr = (long) jsdframe;
return frame;
}
struct Hnetscape_jsdebug_JSPC*
_constructJSPC( ExecEnv* ee, struct Hnetscape_jsdebug_Script* script, long pc )
{
struct Hnetscape_jsdebug_JSPC * pcOb;
pcOb = (struct Hnetscape_jsdebug_JSPC *)
execute_java_constructor( ee, "netscape/jsdebug/JSPC", 0,
"(Lnetscape/jsdebug/Script;I)",
script, pc );
if( ! pcOb )
return NULL;
/* XXX fill in additional fields */
return pcOb;
}
static Hnetscape_jsdebug_Script*
_scriptObFromJSDScriptPtr( ExecEnv* ee, JSDScript* jsdscript )
{
JHandle* tbl = (JHandle*) unhand(controller)->scriptTable;
JHandle* key = _constructInteger(ee,(long)jsdscript);
return (Hnetscape_jsdebug_Script*) _getHash( ee, tbl, key );
}
/***************************************************************************/
void PR_CALLBACK
_scriptHook( JSDContext* jsdc,
JSDScript* jsdscript,
JSBool creating,
void* callerdata )
{
Hnetscape_jsdebug_Script* script;
ExecEnv* ee = EE();
if( ! context || ! controller || ! ee )
return;
if( creating )
{
char* url = (char*)JSD_GetScriptFilename (jsdc, jsdscript);
char* function = (char*)JSD_GetScriptFunctionName (jsdc, jsdscript);
int base = JSD_GetScriptBaseLineNumber (jsdc, jsdscript);
int extent = JSD_GetScriptLineExtent (jsdc, jsdscript);
if( ! url )
{
return;
/* url = ""; */
}
/* create Java Object for Script */
script = (Hnetscape_jsdebug_Script*)
execute_java_constructor(ee, "netscape/jsdebug/Script", 0, "()");
if( ! script )
return;
/* set the members */
unhand(script)->_url = makeJavaString(url,strlen(url));
unhand(script)->_function = function ? makeJavaString(function,strlen(function)) : 0;
unhand(script)->_baseLineNumber = base;
unhand(script)->_lineExtent = extent;
unhand(script)->_nativePtr = (long)jsdscript;
/* add it to the hash table */
_putHash( ee, (JHandle*) unhand(controller)->scriptTable,
_constructInteger(ee, (long)jsdscript), (JHandle*)script );
/* call the hook */
if( unhand(controller)->scriptHook )
{
execute_java_dynamic_method( ee,(JHandle*)unhand(controller)->scriptHook,
"justLoadedScript",
"(Lnetscape/jsdebug/Script;)V",
script );
}
}
else
{
JHandle* tbl = (JHandle*) unhand(controller)->scriptTable;
JHandle* key = _constructInteger(ee,(long)jsdscript);
/* find Java Object for Script */
script = (Hnetscape_jsdebug_Script*) _getHash( ee, tbl, key );
if( ! script )
return;
/* remove it from the hash table */
_removeHash( ee, tbl, key );
/* call the hook */
if( unhand(controller)->scriptHook )
{
execute_java_dynamic_method( ee,(JHandle*)unhand(controller)->scriptHook,
"aboutToUnloadScript",
"(Lnetscape/jsdebug/Script;)V",
script );
}
/* set the Script as invalid */
execute_java_dynamic_method( ee,(JHandle*)script,
"_setInvalid",
"()V" );
}
}
/***************************************************************************/
PRUintn PR_CALLBACK
_executionHook( JSDContext* jsdc,
JSDThreadState* jsdstate,
PRUintn type,
void* callerdata )
{
Hnetscape_jsdebug_JSThreadState* threadState;
Hnetscape_jsdebug_Script* script;
JHandle* pcOb;
JSDStackFrameInfo* jsdframe;
JSDScript* jsdscript;
int pc;
JHandle* tblScript;
JHandle* keyScript;
ExecEnv* ee = EE();
if( ! context || ! controller || ! ee )
return JSD_HOOK_RETURN_HOOK_ERROR;
/* get the JSDStackFrameInfo */
jsdframe = JSD_GetStackFrame(jsdc, jsdstate);
if( ! jsdframe )
return JSD_HOOK_RETURN_HOOK_ERROR;
/* get the JSDScript */
jsdscript = JSD_GetScriptForStackFrame(jsdc, jsdstate, jsdframe);
if( ! jsdscript )
return JSD_HOOK_RETURN_HOOK_ERROR;
/* find Java Object for Script */
tblScript = (JHandle*) unhand(controller)->scriptTable;
keyScript = _constructInteger(ee, (long)jsdscript);
script = (Hnetscape_jsdebug_Script*) _getHash( ee, tblScript, keyScript );
if( ! script )
return JSD_HOOK_RETURN_HOOK_ERROR;
/* generate a JSPC */
pc = JSD_GetPCForStackFrame(jsdc, jsdstate, jsdframe);
pcOb = (JHandle*)
_constructJSPC(ee, script, pc);
if( ! pcOb )
return JSD_HOOK_RETURN_HOOK_ERROR;
/* build a JSThreadState */
threadState = (struct Hnetscape_jsdebug_JSThreadState*)
execute_java_constructor( ee, "netscape/jsdebug/JSThreadState",0,"()");
if( ! threadState )
return JSD_HOOK_RETURN_HOOK_ERROR;
/* populate the ThreadState */
/* XXX FILL IN THE REST... */
unhand(threadState)->valid = 1; /* correct value for true? */
unhand(threadState)->currentFramePtr = (long) jsdframe;
unhand(threadState)->nativeThreadState = (long) jsdstate;
unhand(threadState)->continueState = netscape_jsdebug_JSThreadState_DEBUG_STATE_RUN;
/* XXX FILL IN THE REST... */
/* find and call the appropriate Hook */
if( JSD_HOOK_INTERRUPTED == type )
{
JHandle* hook;
/* clear the JSD level hook (must reset on next sendInterrupt0()*/
JSD_ClearInterruptHook(context);
hook = (JHandle*) unhand(controller)->interruptHook;
if( ! hook )
return JSD_HOOK_RETURN_HOOK_ERROR;
/* call the hook */
execute_java_dynamic_method(
ee, hook, "aboutToExecute",
"(Lnetscape/jsdebug/ThreadStateBase;Lnetscape/jsdebug/PC;)V",
threadState, pcOb );
}
else if( JSD_HOOK_DEBUG_REQUESTED == type )
{
JHandle* hook;
hook = (JHandle*) unhand(controller)->debugBreakHook;
if( ! hook )
return JSD_HOOK_RETURN_HOOK_ERROR;
/* call the hook */
execute_java_dynamic_method(
ee, hook, "aboutToExecute",
"(Lnetscape/jsdebug/ThreadStateBase;Lnetscape/jsdebug/PC;)V",
threadState, pcOb );
}
else if( JSD_HOOK_BREAKPOINT == type )
{
JHandle* hook;
hook = (JHandle*)
execute_java_dynamic_method(
ee,(JHandle*)controller,
"getInstructionHook0",
"(Lnetscape/jsdebug/PC;)Lnetscape/jsdebug/InstructionHook;",
pcOb );
if( ! hook )
return JSD_HOOK_RETURN_HOOK_ERROR;
/* call the hook */
execute_java_dynamic_method(
ee, hook, "aboutToExecute",
"(Lnetscape/jsdebug/ThreadStateBase;)V",
threadState );
}
if( netscape_jsdebug_JSThreadState_DEBUG_STATE_THROW ==
unhand(threadState)->continueState )
return JSD_HOOK_RETURN_ABORT;
return JSD_HOOK_RETURN_CONTINUE;
}
PRUintn PR_CALLBACK
_errorReporter( JSDContext* jsdc,
JSContext* cx,
const char* message,
JSErrorReport* report,
void* callerdata )
{
JHandle* reporter;
JHandle* msg = NULL;
JHandle* filename = NULL;
int lineno = 0;
JHandle* linebuf = NULL;
int tokenOffset = 0;
ExecEnv* ee = EE();
if( ! context || ! controller || ! ee )
return JSD_ERROR_REPORTER_PASS_ALONG;
reporter = (JHandle*) unhand(controller)->errorReporter;
if( ! reporter )
return JSD_ERROR_REPORTER_PASS_ALONG;
if( message )
msg = (JHandle*) makeJavaString((char*)message, strlen(message));
if( report && report->filename )
filename = (JHandle*) makeJavaString((char*)report->filename, strlen(report->filename));
if( report && report->linebuf )
linebuf = (JHandle*) makeJavaString((char*)report->linebuf, strlen(report->linebuf));
if( report )
lineno = report->lineno;
if( report && report->linebuf && report->tokenptr )
tokenOffset = report->tokenptr - report->linebuf;
return (int)
execute_java_dynamic_method(
ee, reporter, "reportError",
"(Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;I)I",
msg,
filename,
lineno,
linebuf,
tokenOffset );
}
/***************************************************************************/
/* from "_gen\netscape_jsdebug_DebugController.h" */
/* XXX HACK */
JSDContext* _simContext = 0;
void netscape_jsdebug_DebugController__setController(struct Hnetscape_jsdebug_DebugController * self,/*boolean*/ long on)
{
if(on)
{
context = JSD_DebuggerOn();
if( ! context )
return;
_simContext = context; /* XXX HACK */
unhand(self)->_nativeContext = (long) context;
controller = self;
JSD_SetScriptHook(context, _scriptHook, (void*)1 );
JSD_SetErrorReporter(context, _errorReporter, (void*)1 );
JSD_SetDebugBreakHook(context, _executionHook, (void*)1 );
}
else
{
/* XXX stop somehow... */
/* kill context */
JSD_SetDebugBreakHook(context, NULL, NULL );
JSD_SetErrorReporter(context, NULL, NULL);
JSD_SetScriptHook(context, NULL, NULL);
context = 0;
controller = 0;
}
}
void netscape_jsdebug_DebugController_setInstructionHook0(struct Hnetscape_jsdebug_DebugController * self,struct Hnetscape_jsdebug_PC * pcOb)
{
Hnetscape_jsdebug_Script* script;
JSDScript* jsdscript;
PRUintn pc;
ExecEnv* ee = EE();
if( ! context || ! controller || ! ee )
return;
script = (Hnetscape_jsdebug_Script*)
execute_java_dynamic_method(ee, (JHandle*)pcOb, "getScript","()Lnetscape/jsdebug/Script;");
if( ! script )
return;
jsdscript = (JSDScript*) unhand(script)->_nativePtr;
if( ! jsdscript )
return;
pc = (PRUintn)
execute_java_dynamic_method(ee, (JHandle*)pcOb, "getPC","()I");
JSD_SetExecutionHook(context, jsdscript, pc, _executionHook, 0);
}
void netscape_jsdebug_DebugController_sendInterrupt0(struct Hnetscape_jsdebug_DebugController * self)
{
if( ! context || ! controller )
return;
JSD_SetInterruptHook(context, _executionHook, 0);
}
struct Hjava_lang_String *netscape_jsdebug_DebugController_executeScriptInStackFrame0(struct Hnetscape_jsdebug_DebugController *self,struct Hnetscape_jsdebug_JSStackFrameInfo *frame,struct Hjava_lang_String *src,struct Hjava_lang_String *filename,long lineno)
{
struct Hnetscape_jsdebug_JSThreadState* threadStateOb;
JSDThreadState* jsdthreadstate;
JSDStackFrameInfo* jsdframe;
char* filenameC;
char* srcC;
JSString* jsstr;
jsval rval;
JSBool success;
int srclen;
threadStateOb = (struct Hnetscape_jsdebug_JSThreadState*)unhand(frame)->threadState;
jsdthreadstate = (JSDThreadState*) unhand(threadStateOb)->nativeThreadState;
jsdframe = (JSDStackFrameInfo*) unhand(frame)->_nativePtr;
if( ! context || ! controller || ! jsdframe )
return NULL;
filenameC = allocCString(filename);
if( ! filenameC )
return NULL;
srcC = allocCString(src);
if( ! srcC )
{
free(filenameC);
return NULL;
}
srclen = strlen(srcC);
success = JSD_EvaluateScriptInStackFrame(context, jsdthreadstate, jsdframe,
srcC, srclen,
filenameC, lineno, &rval);
/* XXX crashing on Windows under Symantec (though I can't see why!)*/
free(filenameC);
free(srcC);
if( ! success )
return NULL;
if( JSVAL_IS_NULL(rval) || JSVAL_IS_VOID(rval) )
return NULL;
jsstr = JSD_ValToStringInStackFrame(context,jsdthreadstate,jsdframe,rval);
if( ! jsstr )
return NULL;
/* XXXbe should use JS_GetStringChars and preserve Unicode. */
return makeJavaString((char*)JS_GetStringBytes(jsstr), JS_GetStringLength(jsstr));
}
long netscape_jsdebug_DebugController_getNativeMajorVersion(struct Hnetscape_jsdebug_DebugController* self)
{
return (long) JSD_GetMajorVersion();
}
long netscape_jsdebug_DebugController_getNativeMinorVersion(struct Hnetscape_jsdebug_DebugController* self)
{
return (long) JSD_GetMinorVersion();
}
/***************************************************************************/
/* from "_gen\netscape_jsdebug_Script.h" */
struct Hnetscape_jsdebug_JSPC *netscape_jsdebug_Script_getClosestPC(struct Hnetscape_jsdebug_Script * self,long line)
{
PRUintn pc;
JSDScript* jsdscript;
if( ! context || ! controller )
return 0;
jsdscript = (JSDScript*) unhand(self)->_nativePtr;
if( ! jsdscript )
return 0;
pc = JSD_GetClosestPC(context, jsdscript, line);
if( -1 == pc )
return 0;
return _constructJSPC( 0, self, pc);
}
/***************************************************************************/
/* from "_gen\netscape_jsdebug_JSThreadState.h" */
long netscape_jsdebug_JSThreadState_countStackFrames(struct Hnetscape_jsdebug_JSThreadState * self)
{
JSDThreadState* jsdstate;
if( ! context || ! controller )
return 0;
jsdstate = (JSDThreadState*) unhand(self)->nativeThreadState;
if( ! jsdstate )
return 0;
return (long) JSD_GetCountOfStackFrames(context, jsdstate);
}
struct Hnetscape_jsdebug_StackFrameInfo *netscape_jsdebug_JSThreadState_getCurrentFrame(struct Hnetscape_jsdebug_JSThreadState * self)
{
JSDThreadState* jsdstate;
JSDStackFrameInfo* jsdframe;
if( ! context || ! controller )
return NULL;
jsdstate = (JSDThreadState*) unhand(self)->nativeThreadState;
if( ! jsdstate )
return NULL;
jsdframe = JSD_GetStackFrame(context, jsdstate);
if( ! jsdframe )
return NULL;
return (struct Hnetscape_jsdebug_StackFrameInfo*)
_constructJSStackFrameInfo( 0, jsdframe, self );
}
/***************************************************************************/
/* from "_gen\netscape_jsdebug_JSStackFrameInfo.h" */
struct Hnetscape_jsdebug_StackFrameInfo *netscape_jsdebug_JSStackFrameInfo_getCaller0(struct Hnetscape_jsdebug_JSStackFrameInfo * self)
{
JSDStackFrameInfo* jsdframeCur;
JSDStackFrameInfo* jsdframeCaller;
struct Hnetscape_jsdebug_JSThreadState* threadState;
JSDThreadState* jsdthreadstate;
if( ! context || ! controller )
return NULL;
jsdframeCur = (JSDStackFrameInfo*) unhand(self)->_nativePtr;
if( ! jsdframeCur )
return NULL;
threadState = (struct Hnetscape_jsdebug_JSThreadState*) unhand(self)->threadState;
if( ! threadState )
return NULL;
jsdthreadstate = (JSDThreadState*) unhand(threadState)->nativeThreadState;
if( ! jsdthreadstate )
return NULL;
jsdframeCaller = JSD_GetCallingStackFrame(context, jsdthreadstate, jsdframeCur);
if( ! jsdframeCaller )
return NULL;
return (struct Hnetscape_jsdebug_StackFrameInfo*)
_constructJSStackFrameInfo( 0, jsdframeCaller, threadState );
}
struct Hnetscape_jsdebug_PC *netscape_jsdebug_JSStackFrameInfo_getPC(struct Hnetscape_jsdebug_JSStackFrameInfo * self)
{
JSDScript* jsdscript;
JSDStackFrameInfo* jsdframe;
struct Hnetscape_jsdebug_Script* script;
struct Hnetscape_jsdebug_JSThreadState* threadState;
JSDThreadState* jsdthreadstate;
int pc;
ExecEnv* ee = EE();
if( ! context || ! controller || ! ee )
return NULL;
jsdframe = (JSDStackFrameInfo*) unhand(self)->_nativePtr;
if( ! jsdframe )
return NULL;
threadState = (struct Hnetscape_jsdebug_JSThreadState*) unhand(self)->threadState;
if( ! threadState )
return NULL;
jsdthreadstate = (JSDThreadState*) unhand(threadState)->nativeThreadState;
if( ! jsdthreadstate )
return NULL;
jsdscript = JSD_GetScriptForStackFrame(context, jsdthreadstate, jsdframe );
if( ! jsdscript )
return NULL;
script = _scriptObFromJSDScriptPtr(ee, jsdscript);
if( ! script )
return NULL;
pc = JSD_GetPCForStackFrame(context, jsdthreadstate, jsdframe);
if( ! pc )
return NULL;
return (struct Hnetscape_jsdebug_PC*) _constructJSPC(ee, script, pc);
}
/***************************************************************************/
/* from "_gen\netscape_jsdebug_JSPC.h" */
struct Hnetscape_jsdebug_SourceLocation *netscape_jsdebug_JSPC_getSourceLocation(struct Hnetscape_jsdebug_JSPC * self)
{
JSDScript* jsdscript;
struct Hnetscape_jsdebug_Script* script;
struct Hnetscape_jsdebug_JSPC* newPCOb;
int line;
int newpc;
int pc;
ExecEnv* ee = EE();
if( ! context || ! controller || ! ee )
return NULL;
script = unhand(self)->script;
if( ! script )
return NULL;
jsdscript = (JSDScript*) unhand(script)->_nativePtr;
if( ! jsdscript )
return NULL;
pc = unhand(self)->pc;
line = JSD_GetClosestLine(context, jsdscript, pc);
newpc = JSD_GetClosestPC(context, jsdscript, line);
newPCOb = _constructJSPC(ee, script, newpc );
if( ! newPCOb )
return NULL;
return (struct Hnetscape_jsdebug_SourceLocation *)
execute_java_constructor( ee, "netscape/jsdebug/JSSourceLocation", 0,
"(Lnetscape/jsdebug/JSPC;I)",
newPCOb, line );
}
/***************************************************************************/
/* from "_gen\netscape_jsdebug_JSSourceTextProvider.h" */
struct Hnetscape_jsdebug_SourceTextItem *netscape_jsdebug_JSSourceTextProvider_loadSourceTextItem0(struct Hnetscape_jsdebug_JSSourceTextProvider * self,struct Hjava_lang_String * url)
{
/* this should attempt to load the source for the indicated URL */
return NULL;
}
void netscape_jsdebug_JSSourceTextProvider_refreshSourceTextVector(struct Hnetscape_jsdebug_JSSourceTextProvider * self)
{
JHandle* vec;
JHandle* itemOb;
JSDSourceText* iterp = 0;
JSDSourceText* item;
const char* url;
struct Hjava_lang_String* urlOb;
ExecEnv* ee = EE();
if( ! context || ! controller || ! ee )
return;
/* create new vector */
vec = (JHandle*) execute_java_constructor(ee, "netscape/util/Vector", 0, "()");
if( ! vec )
return;
/* lock the native subsystem */
JSD_LockSourceTextSubsystem(context);
/* iterate through the native items */
while( 0 != (item = JSD_IterateSources(context, &iterp)) )
{
int urlStrLen;
int status = JSD_GetSourceStatus(context,item);
/* try to find Java object */
url = JSD_GetSourceURL(context, item);
if( ! url || 0 == (urlStrLen = strlen(url)) ) /* ignoring those with no url */
continue;
urlOb = makeJavaString((char*)url,urlStrLen);
if( ! urlOb )
continue;
itemOb = (JHandle*)
execute_java_dynamic_method( ee, (JHandle*)self, "findSourceTextItem0",
"(Ljava/lang/String;)Lnetscape/jsdebug/SourceTextItem;",
urlOb );
if( ! itemOb )
{
/* if not found then generate new item */
struct Hjava_lang_String* textOb;
const char* str;
int length;
if( ! JSD_GetSourceText(context, item, &str, &length ) )
{
str = "";
length = 0;
}
textOb = makeJavaString((char*)str, length);
itemOb = (JHandle*)
execute_java_constructor(ee, "netscape/jsdebug/SourceTextItem",0,
"(Ljava/lang/String;Ljava/lang/String;I)",
urlOb, textOb, status );
}
else if( JSD_IsSourceDirty(context, item) &&
JSD_SOURCE_CLEARED != status )
{
/* if found and dirty then update */
struct Hjava_lang_String* textOb;
const char* str;
int length;
if( ! JSD_GetSourceText(context, item, &str, &length ) )
{
str = "";
length = 0;
}
textOb = makeJavaString((char*)str, length);
execute_java_dynamic_method(ee, itemOb, "setText",
"(Ljava/lang/String;)V", textOb);
execute_java_dynamic_method(ee, itemOb, "setStatus",
"(I)V", status );
execute_java_dynamic_method(ee, itemOb, "setDirty", "(Z)V", 1 );
}
/* we have our copy; clear the native cached text */
if( JSD_SOURCE_INITED != status &&
JSD_SOURCE_PARTIAL != status &&
JSD_SOURCE_CLEARED != status )
{
JSD_ClearSourceText(context, item);
}
/* set the item clean */
JSD_SetSourceDirty(context, item, FALSE );
/* add the item to the vector */
if( itemOb )
execute_java_dynamic_method(ee, vec, "addElement",
"(Ljava/lang/Object;)V", itemOb );
}
/* unlock the native subsystem */
JSD_UnlockSourceTextSubsystem(context);
/* set main vector to our new vector */
unhand(self)->_sourceTextVector = (struct Hnetscape_util_Vector*) vec;
}

View File

@@ -1,24 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
* 2/17/98 jband
* This is a temporary placeholder for this file
* to supporet adding this file to existing makefiles before
* the real file is pulled in off of a branch
*/

View File

@@ -1,508 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
** JavaScript Debugger Navigator API - Script support
*/
#include "jsd.h"
#ifdef NSPR20
#ifdef XP_MAC
#include "prpriv.h"
#else
#include "private/prpriv.h"
#endif
#endif
/* Comment this out to disable (NT specific) dumping as we go */
/*
** #ifdef DEBUG
** #define JSD_DUMP 1
** #endif
*/
#define NOT_SET_YET -1
/***************************************************************************/
PRCList jsd_script_list = PR_INIT_STATIC_CLIST(&jsd_script_list);
#ifdef DEBUG
void JSD_ASSERT_VALID_SCRIPT( JSDScript* jsdscript )
{
PR_ASSERT( jsdscript );
PR_ASSERT( jsdscript->script );
}
void JSD_ASSERT_VALID_EXEC_HOOK( JSDExecHook* jsdhook )
{
PR_ASSERT( jsdhook );
PR_ASSERT( jsdhook->hook );
}
#endif
static JSDScript*
NewJSDScript( JSDContext* jsdc,
JSContext *cx,
JSScript *script,
JSFunction* function )
{
JSDScript* jsdscript;
PRUintn lineno;
/* these are inlined javascript: urls and we can't handle them now */
lineno = (PRUintn) JS_GetScriptBaseLineNumber(cx, script);
if( lineno == 0 )
return NULL;
jsdscript = PR_NEWZAP(JSDScript);
if( ! jsdscript )
return NULL;
PR_APPEND_LINK(&jsdscript->links, &jsd_script_list);
jsdscript->jsdc = jsdc;
jsdscript->script = script;
jsdscript->function = function;
jsdscript->lineBase = lineno;
jsdscript->lineExtent = (PRUintn)NOT_SET_YET;
jsdscript->url = (char*)jsd_BuildNormalizedURL(JS_GetScriptFilename(cx,script));
PR_INIT_CLIST(&jsdscript->hooks);
return jsdscript;
}
static void
DestroyJSDScript( JSDContext* jsdc,
JSDScript* jsdscript )
{
/* destroy all hooks */
jsd_ClearAllExecutionHooksForScript(jsdc, jsdscript);
PR_REMOVE_LINK(&jsdscript->links);
PR_FREEIF(jsdscript->url);
PR_FREEIF(jsdscript);
}
/***************************************************************************/
#ifdef JSD_DUMP
static void
DumpJSDScript( JSDContext* jsdc, JSDScript* jsdscript, const char* leadingtext)
{
const char* name;
const char* fun;
PRUintn base;
PRUintn extent;
char Buf[256];
name = jsd_GetScriptFilename(jsdc, jsdscript);
fun = jsd_GetScriptFunctionName(jsdc, jsdscript);
base = jsd_GetScriptBaseLineNumber(jsdc, jsdscript);
extent = jsd_GetScriptLineExtent(jsdc, jsdscript);
sprintf( Buf, "%sscript=%08X, %s, %s, %d-%d\n",
leadingtext,
(unsigned) jsdscript->script,
name ? name : "no URL",
fun ? fun : "no fun",
base, base + extent - 1 );
OutputDebugString( Buf );
}
static void
DumpJSDScriptList( JSDContext* jsdc )
{
JSDScript* iterp = NULL;
JSDScript* jsdscript = NULL;
OutputDebugString( "*** JSDScriptDump\n" );
while( NULL != (jsdscript = jsd_IterateScripts(jsdc, &iterp)) )
DumpJSDScript( jsdc, jsdscript, " script: " );
}
#endif /* JSD_DUMP */
/***************************************************************************/
#ifndef JSD_SIMULATION
static PRMonitor *jsd_script_mon = NULL;
#endif /* JSD_SIMULATION */
void
jsd_LockScriptSubsystem(JSDContext* jsdc)
{
#ifndef JSD_SIMULATION
if (jsd_script_mon == NULL)
jsd_script_mon = PR_NewNamedMonitor("jsd-script-monitor");
PR_EnterMonitor(jsd_script_mon);
#endif /* JSD_SIMULATION */
}
void
jsd_UnlockScriptSubsystem(JSDContext* jsdc)
{
#ifndef JSD_SIMULATION
PR_ExitMonitor(jsd_script_mon);
#endif /* JSD_SIMULATION */
}
void
jsd_DestroyAllJSDScripts( JSDContext* jsdc )
{
JSDScript *jsdscript;
JSDScript *next;
for (jsdscript = (JSDScript*)jsd_script_list.next;
jsdscript != (JSDScript*)&jsd_script_list;
jsdscript = next)
{
next = (JSDScript*)jsdscript->links.next;
DestroyJSDScript( jsdc, jsdscript );
}
}
JSDScript*
jsd_FindJSDScript( JSDContext* jsdc,
JSScript *script )
{
JSDScript *jsdscript;
for (jsdscript = (JSDScript *)jsd_script_list.next;
jsdscript != (JSDScript *)&jsd_script_list;
jsdscript = (JSDScript *)jsdscript->links.next) {
if (jsdscript->script == script)
return jsdscript;
}
return NULL;
}
JSDScript*
jsd_IterateScripts(JSDContext* jsdc, JSDScript **iterp)
{
JSDScript *jsdscript = *iterp;
if (!jsdscript)
jsdscript = (JSDScript *)jsd_script_list.next;
if (jsdscript == (JSDScript *)&jsd_script_list)
return NULL;
*iterp = (JSDScript *)jsdscript->links.next;
return jsdscript;
}
const char*
jsd_GetScriptFilename(JSDContext* jsdc, JSDScript *jsdscript)
{
return jsdscript->url;
}
const char*
jsd_GetScriptFunctionName(JSDContext* jsdc, JSDScript *jsdscript)
{
if( ! jsdscript->function )
return NULL;
return JS_GetFunctionName(jsdscript->function);
}
PRUintn
jsd_GetScriptBaseLineNumber(JSDContext* jsdc, JSDScript *jsdscript)
{
return jsdscript->lineBase;
}
PRUintn
jsd_GetScriptLineExtent(JSDContext* jsdc, JSDScript *jsdscript)
{
if( NOT_SET_YET == jsdscript->lineExtent )
jsdscript->lineExtent = JS_GetScriptLineExtent(jsdc->dumbContext, jsdscript->script);
return jsdscript->lineExtent;
}
prword_t
jsd_GetClosestPC(JSDContext* jsdc, JSDScript* jsdscript, PRUintn line)
{
return (prword_t) JS_LineNumberToPC(jsdc->dumbContext,
jsdscript->script, line );
}
PRUintn
jsd_GetClosestLine(JSDContext* jsdc, JSDScript* jsdscript, prword_t pc)
{
PRUintn first = jsdscript->lineBase;
PRUintn last = first + jsd_GetScriptLineExtent(jsdc, jsdscript) - 1;
PRUintn line = JS_PCToLineNumber(jsdc->dumbContext,
jsdscript->script, (jsbytecode*)pc);
if( line < first )
return first;
if( line > last )
return last;
return line;
}
JSD_ScriptHookProc
jsd_SetScriptHook(JSDContext* jsdc, JSD_ScriptHookProc hook, void* callerdata)
{
JSD_ScriptHookProc oldHook = jsdc->scriptHook;
jsdc->scriptHook = hook;
jsdc->scriptHookData = callerdata;
return oldHook;
}
JSD_ScriptHookProc
jsd_GetScriptHook(JSDContext* jsdc)
{
return jsdc->scriptHook;
}
/***************************************************************************/
void PR_CALLBACK
jsd_NewScriptHookProc(
JSContext *cx,
const char *filename, /* URL this script loads from */
PRUintn lineno, /* line where this script starts */
JSScript *script,
JSFunction *fun,
void* callerdata )
{
JSDScript* jsdscript = NULL;
JSDContext* jsdc = (JSDContext*) callerdata;
if( jsd_IsCurrentThreadDangerous() )
return;
JSD_ASSERT_VALID_CONTEXT(jsdc);
jsd_LockScriptSubsystem(jsdc);
jsd_JSContextUsed(jsdc, cx);
jsdscript = NewJSDScript( jsdc, cx, script, fun );
if( ! jsdscript )
{
jsd_UnlockScriptSubsystem(jsdc);
return;
}
#ifdef JSD_DUMP
if( jsdscript )
{
DumpJSDScript( jsdc, jsdscript, "***NEW Script: " );
DumpJSDScriptList( jsdc );
}
#endif /* JSD_DUMP */
if( jsdc->scriptHook )
jsdc->scriptHook( jsdc, jsdscript, TRUE, jsdc->scriptHookData );
jsd_UnlockScriptSubsystem(jsdc);
}
void PR_CALLBACK
jsd_DestroyScriptHookProc(
JSContext *cx,
JSScript *script,
void* callerdata )
{
JSDScript* jsdscript = NULL;
JSDContext* jsdc = (JSDContext*) callerdata;
if( jsd_IsCurrentThreadDangerous() )
return;
JSD_ASSERT_VALID_CONTEXT(jsdc);
jsd_LockScriptSubsystem(jsdc);
jsd_JSContextUsed(jsdc, cx);
jsdscript = jsd_FindJSDScript( jsdc, script );
if( ! jsdscript )
{
jsd_UnlockScriptSubsystem(jsdc);
return;
}
#ifdef JSD_DUMP
DumpJSDScript( jsdc, jsdscript, "***DESTROY Script: " );
#endif /* JSD_DUMP */
if( jsdc->scriptHook )
jsdc->scriptHook( jsdc, jsdscript, FALSE, jsdc->scriptHookData );
DestroyJSDScript( jsdc, jsdscript );
#ifdef JSD_DUMP
DumpJSDScriptList( jsdc );
#endif /* JSD_DUMP */
jsd_UnlockScriptSubsystem(jsdc);
}
/***************************************************************************/
static JSDExecHook*
FindHook( JSDContext* jsdc, JSDScript* jsdscript, prword_t pc)
{
JSDExecHook* jsdhook;
PRCList* list = &jsdscript->hooks;
for (jsdhook = (JSDExecHook*)list->next;
jsdhook != (JSDExecHook*)list;
jsdhook = (JSDExecHook*)jsdhook->links.next)
{
if (jsdhook->pc == pc)
return jsdhook;
}
return NULL;
}
JSTrapStatus PR_CALLBACK
jsd_TrapHandler(JSContext *cx, JSScript *script, jsbytecode *pc, jsval *rval,
void *closure)
{
PRUintn hookanswer = JSD_HOOK_RETURN_CONTINUE;
JSDThreadState* jsdthreadstate;
JSDExecHook* jsdhook = (JSDExecHook*) closure;
JSDContext* jsdc;
if( jsd_IsCurrentThreadDangerous() )
return JSTRAP_CONTINUE;
JSD_ASSERT_VALID_EXEC_HOOK(jsdhook);
PR_ASSERT(jsdhook->pc == (prword_t)pc);
PR_ASSERT(jsdhook->jsdscript->script == script);
jsdc = jsdhook->jsdscript->jsdc;
if( ! jsdc || ! jsdc->inited )
return JSTRAP_CONTINUE;
jsd_JSContextUsed(jsdc, cx);
jsdthreadstate = jsd_NewThreadState(jsdc,cx);
if( jsdthreadstate )
{
hookanswer =
(*jsdhook->hook)(jsdc, jsdthreadstate,
JSD_HOOK_BREAKPOINT,
jsdhook->callerdata );
jsd_DestroyThreadState(jsdc, jsdthreadstate);
}
*rval = NULL; /* XXX fix this!!! */
if( JSD_HOOK_RETURN_ABORT == hookanswer )
return JSTRAP_ERROR;
return JSTRAP_CONTINUE; /* XXX fix this!!! */
}
JSBool
jsd_SetExecutionHook(JSDContext* jsdc,
JSDScript* jsdscript,
prword_t pc,
JSD_ExecutionHookProc hook,
void* callerdata)
{
JSDExecHook* jsdhook;
if( ! hook )
return jsd_ClearExecutionHook(jsdc, jsdscript, pc);
jsdhook = FindHook(jsdc, jsdscript, pc);
if( jsdhook )
{
jsdhook->hook = hook;
jsdhook->callerdata = callerdata;
return JS_TRUE;
}
/* else... */
jsdhook = PR_NEWZAP(JSDExecHook);
if( ! jsdhook )
return JS_FALSE;
jsdhook->jsdscript = jsdscript;
jsdhook->pc = pc;
jsdhook->hook = hook;
jsdhook->callerdata = callerdata;
if( ! JS_SetTrap(jsdc->dumbContext, jsdscript->script,
(jsbytecode*)pc, jsd_TrapHandler, (void*) jsdhook) )
{
PR_FREEIF(jsdhook);
return JS_FALSE;
}
PR_APPEND_LINK(&jsdhook->links, &jsdscript->hooks);
return JS_TRUE;
}
JSBool
jsd_ClearExecutionHook(JSDContext* jsdc,
JSDScript* jsdscript,
prword_t pc)
{
JSDExecHook* jsdhook;
jsdhook = FindHook(jsdc, jsdscript, pc);
if( ! jsdhook )
{
PR_ASSERT(0);
return JS_FALSE;
}
JS_ClearTrap(jsdc->dumbContext, jsdscript->script,
(jsbytecode*)pc, NULL, NULL );
PR_REMOVE_LINK(&jsdhook->links);
PR_FREEIF(jsdhook);
return JS_TRUE;
}
JSBool
jsd_ClearAllExecutionHooksForScript(JSDContext* jsdc, JSDScript* jsdscript)
{
JSDExecHook* jsdhook;
PRCList* list = &jsdscript->hooks;
while( (JSDExecHook*)list != (jsdhook = (JSDExecHook*)list->next) )
{
PR_REMOVE_LINK(&jsdhook->links);
PR_FREEIF(jsdhook);
}
JS_ClearScriptTraps(jsdc->dumbContext, jsdscript->script);
return JS_TRUE;
}
JSBool
jsd_ClearAllExecutionHooks(JSDContext* jsdc)
{
JSDScript* jsdscript;
JSDScript* iterp = NULL;
while( NULL != (jsdscript = jsd_IterateScripts(jsdc, &iterp)) )
jsd_ClearAllExecutionHooksForScript(jsdc, jsdscript);
return JS_TRUE;
}

View File

@@ -1,369 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
** JavaScript Debugger Navigator API - Call Stack support
*/
#include "jsd.h"
#ifdef NSPR20
#ifdef XP_MAC
#include "prpriv.h"
#else
#include "private/prpriv.h"
#endif
#endif
#ifdef DEBUG
void JSD_ASSERT_VALID_THREAD_STATE( JSDThreadState* jsdthreadstate )
{
PR_ASSERT(jsdthreadstate);
PR_ASSERT(jsdthreadstate->stackDepth > 0);
}
void JSD_ASSERT_VALID_STACK_FRAME( JSDStackFrameInfo* jsdframe )
{
PR_ASSERT(jsdframe);
PR_ASSERT(jsdframe->jsdthreadstate);
}
#endif
static JSDStackFrameInfo*
AddNewFrame( JSDContext* jsdc,
JSDThreadState* jsdthreadstate,
JSScript* script,
prword_t pc,
JSObject* object,
JSObject* thisp,
JSStackFrame* fp )
{
JSDStackFrameInfo* jsdframe;
JSDScript* jsdscript;
jsdscript = jsd_FindJSDScript(jsdc, script);
if( ! jsdscript )
return NULL;
jsdframe = PR_NEWZAP(JSDStackFrameInfo);
if( ! jsdframe )
return NULL;
jsdframe->jsdthreadstate = jsdthreadstate;
jsdframe->jsdscript = jsdscript ;
jsdframe->pc = pc ;
jsdframe->object = object ;
jsdframe->thisp = thisp ;
jsdframe->fp = fp ;
PR_APPEND_LINK(&jsdframe->links, &jsdthreadstate->stack);
jsdthreadstate->stackDepth++;
return jsdframe;
}
static void
DestroyFrame(JSDStackFrameInfo* jsdframe)
{
/* kill any alloc'd objects in frame here... */
PR_FREEIF(jsdframe);
}
JSDThreadState*
jsd_NewThreadState(JSDContext* jsdc, JSContext *cx )
{
JSDThreadState* jsdthreadstate;
JSStackFrame * iter = NULL;
JSStackFrame * fp;
jsdthreadstate = PR_NEWZAP(JSDThreadState);
if( ! jsdthreadstate )
return NULL;
jsdthreadstate->context = cx;
jsdthreadstate->thread = PR_CurrentThread();
PR_INIT_CLIST(&jsdthreadstate->stack);
jsdthreadstate->stackDepth = 0;
while( NULL != (fp = JS_FrameIterator(cx, &iter)) )
{
JSScript* script = JS_GetFrameScript(cx, fp);
prword_t pc = (prword_t) JS_GetFramePC(cx, fp);
if( ! script || ! pc || JS_IsNativeFrame(cx, fp) )
continue;
AddNewFrame( jsdc, jsdthreadstate, script, pc,
JS_GetFrameObject(cx, fp),
JS_GetFrameThis(cx, fp), fp );
}
jsd_LockThreadsStates(jsdc);
PR_APPEND_LINK(&jsdthreadstate->links, &jsdc->threadsStates);
jsd_UnlockThreadStates(jsdc);
return jsdthreadstate;
}
void
jsd_DestroyThreadState(JSDContext* jsdc, JSDThreadState* jsdthreadstate)
{
JSDStackFrameInfo* jsdframe;
PRCList* list;
int64 i;
#ifndef NSPR20
LL_I2L(i,100);
#endif
/* we need to wait if someone else is using the threadstate */
jsd_LockThreadsStates(jsdc);
while( jsdthreadstate->wait )
{
jsd_UnlockThreadStates(jsdc);
#ifndef NSPR20
PR_Sleep(i);
#else
PR_Sleep(PR_MicrosecondsToInterval(100));
#endif
jsd_LockThreadsStates(jsdc);
}
PR_REMOVE_LINK(&jsdthreadstate->links);
jsd_UnlockThreadStates(jsdc);
list = &jsdthreadstate->stack;
while( (JSDStackFrameInfo*)list != (jsdframe = (JSDStackFrameInfo*)list->next) )
{
PR_REMOVE_LINK(&jsdframe->links);
DestroyFrame(jsdframe);
}
PR_FREEIF(jsdthreadstate);
}
PRUintn
jsd_GetCountOfStackFrames(JSDContext* jsdc, JSDThreadState* jsdthreadstate)
{
PRUintn count = 0;
jsd_LockThreadsStates(jsdc);
if( jsd_IsValidThreadState(jsdc, jsdthreadstate) )
count = jsdthreadstate->stackDepth;
jsd_UnlockThreadStates(jsdc);
return count;
}
JSDStackFrameInfo*
jsd_GetStackFrame(JSDContext* jsdc, JSDThreadState* jsdthreadstate)
{
JSDStackFrameInfo* jsdframe = NULL;
jsd_LockThreadsStates(jsdc);
if( jsd_IsValidThreadState(jsdc, jsdthreadstate) )
jsdframe = (JSDStackFrameInfo*) PR_LIST_HEAD(&jsdthreadstate->stack);
jsd_UnlockThreadStates(jsdc);
return jsdframe;
}
JSDStackFrameInfo*
jsd_GetCallingStackFrame(JSDContext* jsdc,
JSDThreadState* jsdthreadstate,
JSDStackFrameInfo* jsdframe)
{
JSDStackFrameInfo* nextjsdframe = NULL;
jsd_LockThreadsStates(jsdc);
if( jsd_IsValidFrameInThreadState(jsdc, jsdthreadstate, jsdframe) )
if( PR_LIST_HEAD(&jsdframe->links) != &jsdframe->jsdthreadstate->stack )
nextjsdframe = (JSDStackFrameInfo*) PR_LIST_HEAD(&jsdframe->links);
jsd_UnlockThreadStates(jsdc);
return nextjsdframe;
}
JSDScript*
jsd_GetScriptForStackFrame(JSDContext* jsdc,
JSDThreadState* jsdthreadstate,
JSDStackFrameInfo* jsdframe)
{
JSDScript* jsdscript = NULL;
jsd_LockThreadsStates(jsdc);
if( jsd_IsValidFrameInThreadState(jsdc, jsdthreadstate, jsdframe) )
jsdscript = jsdframe->jsdscript;
jsd_UnlockThreadStates(jsdc);
return jsdscript;
}
prword_t
jsd_GetPCForStackFrame(JSDContext* jsdc,
JSDThreadState* jsdthreadstate,
JSDStackFrameInfo* jsdframe)
{
prword_t pc = 0;
jsd_LockThreadsStates(jsdc);
if( jsd_IsValidFrameInThreadState(jsdc, jsdthreadstate, jsdframe) )
pc = jsdframe->pc;
jsd_UnlockThreadStates(jsdc);
return pc;
}
JSBool
jsd_EvaluateScriptInStackFrame(JSDContext* jsdc,
JSDThreadState* jsdthreadstate,
JSDStackFrameInfo* jsdframe,
const char *bytes, PRUintn length,
const char *filename, PRUintn lineno, jsval *rval)
{
JSBool retval;
jsd_LockThreadsStates(jsdc);
if( ! jsd_IsValidFrameInThreadState(jsdc, jsdthreadstate, jsdframe) )
{
jsd_UnlockThreadStates(jsdc);
return JS_FALSE;
}
jsdthreadstate->wait++ ;
jsd_UnlockThreadStates(jsdc);
retval = JS_EvaluateInStackFrame(jsdthreadstate->context, jsdframe->fp,
bytes, length, filename, lineno, rval);
jsd_LockThreadsStates(jsdc);
jsdthreadstate->wait-- ;
jsd_UnlockThreadStates(jsdc);
return retval;
}
JSString*
jsd_ValToStringInStackFrame(JSDContext* jsdc,
JSDThreadState* jsdthreadstate,
JSDStackFrameInfo* jsdframe,
jsval val)
{
JSString* jsstr = NULL;
jsd_LockThreadsStates(jsdc);
if( ! jsd_IsValidFrameInThreadState(jsdc, jsdthreadstate, jsdframe) )
{
jsd_UnlockThreadStates(jsdc);
return NULL;
}
jsdthreadstate->wait++ ;
jsd_UnlockThreadStates(jsdc);
jsstr = JS_ValueToString(jsdthreadstate->context, val);
jsd_LockThreadsStates(jsdc);
jsdthreadstate->wait-- ;
jsd_UnlockThreadStates(jsdc);
return jsstr;
}
/***************************************************************************/
#ifndef JSD_SIMULATION
static PRMonitor *jsd_threadstate_mon = NULL;
#endif /* JSD_SIMULATION */
void
jsd_LockThreadsStates(JSDContext* jsdc)
{
#ifndef JSD_SIMULATION
if (jsd_threadstate_mon == NULL)
jsd_threadstate_mon = PR_NewNamedMonitor("jsd-threadstate-monitor");
PR_EnterMonitor(jsd_threadstate_mon);
#endif /* JSD_SIMULATION */
}
void
jsd_UnlockThreadStates(JSDContext* jsdc)
{
#ifndef JSD_SIMULATION
PR_ExitMonitor(jsd_threadstate_mon);
#endif /* JSD_SIMULATION */
}
JSBool
jsd_ThreadStatesIsLocked(JSDContext* jsdc)
{
#ifndef JSD_SIMULATION
return jsd_threadstate_mon && PR_InMonitor(jsd_threadstate_mon);
#else
return JS_TRUE;
#endif /* JSD_SIMULATION */
}
JSBool
jsd_IsValidThreadState(JSDContext* jsdc,
JSDThreadState* jsdthreadstate )
{
JSDThreadState *cur;
PR_ASSERT( jsd_ThreadStatesIsLocked(jsdc) );
for (cur = (JSDThreadState*)jsdc->threadsStates.next;
cur != (JSDThreadState*)&jsdc->threadsStates;
cur = (JSDThreadState*)cur->links.next )
{
if( cur == jsdthreadstate )
return JS_TRUE;
}
return JS_FALSE;
}
JSBool
jsd_IsValidFrameInThreadState(JSDContext* jsdc,
JSDThreadState* jsdthreadstate,
JSDStackFrameInfo* jsdframe )
{
PR_ASSERT( jsd_ThreadStatesIsLocked(jsdc) );
if( ! jsd_IsValidThreadState(jsdc, jsdthreadstate) )
return JS_FALSE;
if( jsdframe->jsdthreadstate != jsdthreadstate )
return JS_FALSE;
JSD_ASSERT_VALID_THREAD_STATE(jsdthreadstate);
JSD_ASSERT_VALID_STACK_FRAME(jsdframe);
return JS_TRUE;
}

View File

@@ -1,471 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
** JavaScript Debugger Navigator API - Source Text functions
*/
#include "jsd.h"
#ifdef NSPR20
#ifdef XP_MAC
#include "prpriv.h"
#else
#include "private/prpriv.h"
#endif
#endif
/**
* XXX convert this and jsd_conv so that all accumulation of text done here
* Also, use handle oriented alloc for Win16 64k limit problem
*/
PRCList jsd_source_list = PR_INIT_STATIC_CLIST(&jsd_source_list);
PRCList jsd_removed_source_list = PR_INIT_STATIC_CLIST(&jsd_removed_source_list);
/***************************************************************************/
/*
* typedef enum
* {
* JSD_SOURCE_INITED,
* JSD_SOURCE_PARTIAL,
* JSD_SOURCE_COMPLETED,
* JSD_SOURCE_ABORTED,
* JSD_SOURCE_FAILED
*
* } JSDSourceStatus;
*/
#ifdef DEBUG
void JSD_ASSERT_VALID_SOURCE_TEXT( JSDSourceText* jsdsrc )
{
PR_ASSERT( jsdsrc );
PR_ASSERT( jsdsrc->url );
}
#endif
/***************************************************************************/
/* XXX add serial number instead of dirty */
/* XXX add notification */
static PRUintn g_alterCount = 1;
static void
ClearText( JSDContext* jsdc, JSDSourceText* jsdsrc )
{
if( jsdsrc->text )
MY_XP_HUGE_FREE(jsdsrc->text);
jsdsrc->text = NULL;
jsdsrc->textLength = 0;
jsdsrc->textSpace = 0;
jsdsrc->status = JSD_SOURCE_CLEARED;
jsdsrc->dirty = JS_TRUE;
jsdsrc->alterCount = g_alterCount++ ;
}
static JSBool
AppendText( JSDContext* jsdc, JSDSourceText* jsdsrc,
const char* text, size_t length )
{
#define MEMBUF_GROW 1000
PRUintn neededSize = jsdsrc->textLength + length;
if( neededSize > jsdsrc->textSpace )
{
MY_XP_HUGE_CHAR_PTR pBuf;
PRUintn iNewSize;
/* if this is the first alloc, the req might be all that's needed*/
if( ! jsdsrc->textSpace )
iNewSize = length;
else
iNewSize = (neededSize * 5 / 4) + MEMBUF_GROW;
pBuf = (MY_XP_HUGE_CHAR_PTR) MY_XP_HUGE_ALLOC(iNewSize);
if( pBuf )
{
if( jsdsrc->text )
{
MY_XP_HUGE_MEMCPY(pBuf, jsdsrc->text, jsdsrc->textLength);
MY_XP_HUGE_FREE(jsdsrc->text);
}
jsdsrc->text = pBuf;
jsdsrc->textSpace = iNewSize;
}
else
{
/* LTNOTE: throw an out of memory exception */
ClearText( jsdc, jsdsrc );
jsdsrc->status = JSD_SOURCE_FAILED;
return JS_FALSE;
}
}
MY_XP_HUGE_MEMCPY( &jsdsrc->text[jsdsrc->textLength], text, length );
jsdsrc->textLength += length;
return JS_TRUE;
}
static JSDSourceText*
NewSource( JSDContext* jsdc, const char* url )
{
JSDSourceText* jsdsrc = PR_NEWZAP(JSDSourceText);
if( ! jsdsrc )
return NULL;
jsdsrc->url = (char*) url; /* already a copy */
jsdsrc->status = JSD_SOURCE_INITED;
jsdsrc->dirty = JS_TRUE;
jsdsrc->alterCount = g_alterCount++ ;
return jsdsrc;
}
static void
DestroySource( JSDContext* jsdc, JSDSourceText* jsdsrc )
{
PR_ASSERT( NULL == jsdsrc->text ); /* must ClearText() first */
MY_XP_FREE(jsdsrc->url);
MY_XP_FREE(jsdsrc);
}
static void
RemoveSource( JSDContext* jsdc, JSDSourceText* jsdsrc )
{
PR_REMOVE_LINK(&jsdsrc->links);
ClearText( jsdc, jsdsrc );
DestroySource( jsdc, jsdsrc );
}
static JSDSourceText*
AddSource( JSDContext* jsdc, const char* url )
{
JSDSourceText* jsdsrc = NewSource( jsdc, url );
if( ! jsdsrc )
return NULL;
PR_INSERT_LINK(&jsdsrc->links, &jsd_source_list);
return jsdsrc;
}
static void
MoveSourceToFront( JSDContext* jsdc, JSDSourceText* jsdsrc )
{
PR_REMOVE_LINK(&jsdsrc->links);
PR_INSERT_LINK(&jsdsrc->links, &jsd_source_list);
}
static void
MoveSourceToRemovedList( JSDContext* jsdc, JSDSourceText* jsdsrc )
{
ClearText(jsdc, jsdsrc);
PR_REMOVE_LINK(&jsdsrc->links);
PR_INSERT_LINK(&jsdsrc->links, &jsd_removed_source_list);
}
static void
RemoveSourceFromRemovedList( JSDContext* jsdc, JSDSourceText* jsdsrc )
{
PR_REMOVE_LINK(&jsdsrc->links);
DestroySource( jsdc, jsdsrc );
}
static JSBool
IsSourceInSourceList( JSDContext* jsdc, JSDSourceText* jsdsrcToFind )
{
JSDSourceText *jsdsrc;
for (jsdsrc = (JSDSourceText*)jsd_source_list.next;
jsdsrc != (JSDSourceText*)&jsd_source_list;
jsdsrc = (JSDSourceText*)jsdsrc->links.next )
{
if( jsdsrc == jsdsrcToFind )
return JS_TRUE;
}
return JS_FALSE;
}
/* compare strings in a case insensitive manner with a length limit
*/
static int
strncasecomp (const char* one, const char * two, int n)
{
const char *pA;
const char *pB;
for(pA=one, pB=two;; pA++, pB++)
{
int tmp;
if (pA == one+n)
return 0;
if (!(*pA && *pB))
return *pA - *pB;
tmp = MY_XP_TO_LOWER(*pA) - MY_XP_TO_LOWER(*pB);
if (tmp)
return tmp;
}
}
static char file_url_prefix[] = "file:";
#define FILE_URL_PREFIX_LEN (sizeof file_url_prefix - 1)
const char*
jsd_BuildNormalizedURL( const char* url_string )
{
char *new_url_string;
if( ! url_string )
return NULL;
if (!MY_XP_STRNCASECMP(url_string, file_url_prefix, FILE_URL_PREFIX_LEN) &&
url_string[FILE_URL_PREFIX_LEN + 0] == '/' &&
url_string[FILE_URL_PREFIX_LEN + 1] == '/') {
new_url_string = PR_smprintf("%s%s",
file_url_prefix,
url_string + FILE_URL_PREFIX_LEN + 2);
} else {
new_url_string = MY_XP_STRDUP(url_string);
}
return new_url_string;
}
/***************************************************************************/
#ifndef JSD_SIMULATION
static PRMonitor *jsd_text_mon = NULL;
#endif /* JSD_SIMULATION */
void
jsd_LockSourceTextSubsystem(JSDContext* jsdc)
{
#ifndef JSD_SIMULATION
if (jsd_text_mon == NULL)
jsd_text_mon = PR_NewNamedMonitor("jsd-text-monitor");
PR_EnterMonitor(jsd_text_mon);
#endif /* JSD_SIMULATION */
}
void
jsd_UnlockSourceTextSubsystem(JSDContext* jsdc)
{
#ifndef JSD_SIMULATION
PR_ExitMonitor(jsd_text_mon);
#endif /* JSD_SIMULATION */
}
void
jsd_DestroyAllSources( JSDContext* jsdc )
{
JSDSourceText *jsdsrc;
JSDSourceText *next;
for (jsdsrc = (JSDSourceText*)jsd_source_list.next;
jsdsrc != (JSDSourceText*)&jsd_source_list;
jsdsrc = next)
{
next = (JSDSourceText*)jsdsrc->links.next;
RemoveSource( jsdc, jsdsrc );
}
for (jsdsrc = (JSDSourceText*)jsd_removed_source_list.next;
jsdsrc != (JSDSourceText*)&jsd_removed_source_list;
jsdsrc = next)
{
next = (JSDSourceText*)jsdsrc->links.next;
RemoveSourceFromRemovedList( jsdc, jsdsrc );
}
}
JSDSourceText*
jsd_IterateSources(JSDContext* jsdc, JSDSourceText **iterp)
{
JSDSourceText *jsdsrc = *iterp;
if (!jsdsrc)
jsdsrc = (JSDSourceText *)jsd_source_list.next;
if (jsdsrc == (JSDSourceText *)&jsd_source_list)
return NULL;
*iterp = (JSDSourceText *)jsdsrc->links.next;
return jsdsrc;
}
JSDSourceText*
jsd_FindSourceForURL(JSDContext* jsdc, const char* url)
{
JSDSourceText *jsdsrc;
for (jsdsrc = (JSDSourceText *)jsd_source_list.next;
jsdsrc != (JSDSourceText *)&jsd_source_list;
jsdsrc = (JSDSourceText *)jsdsrc->links.next) {
if (0 == strcmp(jsdsrc->url, url))
return jsdsrc;
}
return NULL;
}
const char*
jsd_GetSourceURL(JSDContext* jsdc, JSDSourceText* jsdsrc)
{
return jsdsrc->url;
}
JSBool
jsd_GetSourceText(JSDContext* jsdc, JSDSourceText* jsdsrc,
const char** ppBuf, int* pLen )
{
*ppBuf = jsdsrc->text;
*pLen = jsdsrc->textLength;
return JS_TRUE;
}
void
jsd_ClearSourceText(JSDContext* jsdc, JSDSourceText* jsdsrc)
{
if( JSD_SOURCE_INITED != jsdsrc->status &&
JSD_SOURCE_PARTIAL != jsdsrc->status )
{
ClearText(jsdc, jsdsrc);
}
}
JSDSourceStatus
jsd_GetSourceStatus(JSDContext* jsdc, JSDSourceText* jsdsrc)
{
return jsdsrc->status;
}
JSBool
jsd_IsSourceDirty(JSDContext* jsdc, JSDSourceText* jsdsrc)
{
return jsdsrc->dirty;
}
void
jsd_SetSourceDirty(JSDContext* jsdc, JSDSourceText* jsdsrc, JSBool dirty)
{
jsdsrc->dirty = dirty;
}
PRUintn
jsd_GetSourceAlterCount(JSDContext* jsdc, JSDSourceText* jsdsrc)
{
return jsdsrc->alterCount;
}
PRUintn
jsd_IncrementSourceAlterCount(JSDContext* jsdc, JSDSourceText* jsdsrc)
{
return ++jsdsrc->alterCount;
}
/***************************************************************************/
#if defined(DEBUG) && 0
void DEBUG_ITERATE_SOURCES( JSDContext* jsdc )
{
JSDSourceText* iterp = NULL;
JSDSourceText* jsdsrc = NULL;
int dummy;
while( NULL != (jsdsrc = jsd_IterateSources(jsdc, &iterp)) )
{
const char* url;
const char* text;
int len;
JSBool dirty;
JSDStreamStatus status;
JSBool gotSrc;
url = JSD_GetSourceURL(jsdc, jsdsrc);
dirty = JSD_IsSourceDirty(jsdc, jsdsrc);
status = JSD_GetSourceStatus(jsdc, jsdsrc);
gotSrc = JSD_GetSourceText(jsdc, jsdsrc, &text, &len );
dummy = 0; /* gives us a line to set breakpoint... */
}
}
#else
#define DEBUG_ITERATE_SOURCES(x) ((void)x)
#endif
/***************************************************************************/
JSDSourceText*
jsd_NewSourceText(JSDContext* jsdc, const char* url)
{
JSDSourceText* jsdsrc;
const char* new_url_string;
jsd_LockSourceTextSubsystem(jsdc);
new_url_string = jsd_BuildNormalizedURL(url);
if( ! new_url_string )
return NULL;
jsdsrc = jsd_FindSourceForURL(jsdc, new_url_string);
if( jsdsrc )
MoveSourceToRemovedList(jsdc, jsdsrc);
jsdsrc = AddSource( jsdc, new_url_string );
jsd_UnlockSourceTextSubsystem(jsdc);
return jsdsrc;
}
JSDSourceText*
jsd_AppendSourceText(JSDContext* jsdc,
JSDSourceText* jsdsrc,
const char* text, /* *not* zero terminated */
size_t length,
JSDSourceStatus status)
{
jsd_LockSourceTextSubsystem(jsdc);
if( ! IsSourceInSourceList( jsdc, jsdsrc ) )
{
RemoveSourceFromRemovedList( jsdc, jsdsrc );
jsd_UnlockSourceTextSubsystem(jsdc);
return NULL;
}
if( text && length && ! AppendText( jsdc, jsdsrc, text, length ) )
{
jsdsrc->dirty = JS_TRUE;
jsdsrc->alterCount = g_alterCount++ ;
jsdsrc->status = JSD_SOURCE_FAILED;
MoveSourceToRemovedList(jsdc, jsdsrc);
jsd_UnlockSourceTextSubsystem(jsdc);
return NULL;
}
jsdsrc->dirty = JS_TRUE;
jsdsrc->alterCount = g_alterCount++ ;
jsdsrc->status = status;
DEBUG_ITERATE_SOURCES(jsdc);
jsd_UnlockSourceTextSubsystem(jsdc);
return jsdsrc;
}
/***************************************************************************/

View File

@@ -1,432 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
** JavaScript Debugger Navigator API - All public functions
*/
#include "jsd.h"
/* use a global context for now (avoid direct references to it!) */
static JSDContext _static_context;
/***************************************************************************/
/* High Level calls */
PR_PUBLIC_API(JSDContext*)
JSD_DebuggerOn(void)
{
return jsd_DebuggerOn();
}
PR_PUBLIC_API(void)
JSD_DebuggerOff(JSDContext* jsdc)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
jsd_DebuggerOff(jsdc);
}
PR_PUBLIC_API(PRUintn)
JSD_GetMajorVersion(void)
{
return JSD_MAJOR_VERSION;
}
PR_PUBLIC_API(PRUintn)
JSD_GetMinorVersion(void)
{
return JSD_MINOR_VERSION;
}
PR_PUBLIC_API(JSContext*)
JSD_GetDefaultJSContext(JSDContext* jsdc)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
return jsdc->dumbContext;
}
PR_PUBLIC_API(void)
JSD_SetUserCallbacks(JSTaskState* jstaskstate, JSD_UserCallbacks* callbacks, void* user)
{
jsd_SetUserCallbacks(jstaskstate, callbacks, user);
}
/***************************************************************************/
/* Script functions */
PR_PUBLIC_API(void)
JSD_LockScriptSubsystem(JSDContext* jsdc)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
jsd_LockScriptSubsystem(jsdc);
}
PR_PUBLIC_API(void)
JSD_UnlockScriptSubsystem(JSDContext* jsdc)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
jsd_UnlockScriptSubsystem(jsdc);
}
PR_PUBLIC_API(JSDScript*)
JSD_IterateScripts(JSDContext* jsdc, JSDScript **iterp)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
return jsd_IterateScripts(jsdc, iterp);
}
PR_PUBLIC_API(const char*)
JSD_GetScriptFilename(JSDContext* jsdc, JSDScript *jsdscript)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
JSD_ASSERT_VALID_SCRIPT(jsdscript);
return jsd_GetScriptFilename(jsdc, jsdscript);
}
PR_PUBLIC_API(const char*)
JSD_GetScriptFunctionName(JSDContext* jsdc, JSDScript *jsdscript)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
JSD_ASSERT_VALID_SCRIPT(jsdscript);
return jsd_GetScriptFunctionName(jsdc, jsdscript);
}
PR_PUBLIC_API(PRUintn)
JSD_GetScriptBaseLineNumber(JSDContext* jsdc, JSDScript *jsdscript)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
JSD_ASSERT_VALID_SCRIPT(jsdscript);
return jsd_GetScriptBaseLineNumber(jsdc, jsdscript);
}
PR_PUBLIC_API(PRUintn)
JSD_GetScriptLineExtent(JSDContext* jsdc, JSDScript *jsdscript)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
JSD_ASSERT_VALID_SCRIPT(jsdscript);
return jsd_GetScriptLineExtent(jsdc, jsdscript);
}
PR_PUBLIC_API(JSD_ScriptHookProc)
JSD_SetScriptHook(JSDContext* jsdc, JSD_ScriptHookProc hook, void* callerdata)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
return jsd_SetScriptHook(jsdc, hook, callerdata);
}
PR_PUBLIC_API(JSD_ScriptHookProc)
JSD_GetScriptHook(JSDContext* jsdc)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
return jsd_GetScriptHook(jsdc);
}
PR_PUBLIC_API(prword_t)
JSD_GetClosestPC(JSDContext* jsdc, JSDScript* jsdscript, PRUintn line)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
JSD_ASSERT_VALID_SCRIPT(jsdscript);
return jsd_GetClosestPC(jsdc, jsdscript, line);
}
PR_PUBLIC_API(PRUintn)
JSD_GetClosestLine(JSDContext* jsdc, JSDScript* jsdscript, prword_t pc)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
JSD_ASSERT_VALID_SCRIPT(jsdscript);
return jsd_GetClosestLine(jsdc, jsdscript, pc);
}
/***************************************************************************/
/* Source Text functions */
PR_PUBLIC_API(void)
JSD_LockSourceTextSubsystem(JSDContext* jsdc)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
jsd_LockSourceTextSubsystem(jsdc);
}
PR_PUBLIC_API(void)
JSD_UnlockSourceTextSubsystem(JSDContext* jsdc)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
jsd_UnlockSourceTextSubsystem(jsdc);
}
PR_PUBLIC_API(JSDSourceText*)
JSD_IterateSources(JSDContext* jsdc, JSDSourceText **iterp)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
return jsd_IterateSources(jsdc, iterp);
}
PR_PUBLIC_API(JSDSourceText*)
JSD_FindSourceForURL(JSDContext* jsdc, const char* url)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
PR_ASSERT(url);
return jsd_FindSourceForURL(jsdc, url);
}
PR_PUBLIC_API(const char*)
JSD_GetSourceURL(JSDContext* jsdc, JSDSourceText* jsdsrc)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc);
return jsd_GetSourceURL(jsdc,jsdsrc);
}
PR_PUBLIC_API(JSBool)
JSD_GetSourceText(JSDContext* jsdc, JSDSourceText* jsdsrc,
const char** ppBuf, int* pLen)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc);
PR_ASSERT(ppBuf);
PR_ASSERT(pLen);
return jsd_GetSourceText(jsdc, jsdsrc, ppBuf, pLen);
}
PR_PUBLIC_API(void)
JSD_ClearSourceText(JSDContext* jsdc, JSDSourceText* jsdsrc)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc);
jsd_ClearSourceText(jsdc, jsdsrc);
}
PR_PUBLIC_API(JSDSourceStatus)
JSD_GetSourceStatus(JSDContext* jsdc, JSDSourceText* jsdsrc)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc);
return jsd_GetSourceStatus(jsdc, jsdsrc);
}
PR_PUBLIC_API(JSBool)
JSD_IsSourceDirty(JSDContext* jsdc, JSDSourceText* jsdsrc)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc);
return jsd_IsSourceDirty(jsdc, jsdsrc);
}
PR_PUBLIC_API(void)
JSD_SetSourceDirty(JSDContext* jsdc, JSDSourceText* jsdsrc, JSBool dirty)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc);
jsd_SetSourceDirty(jsdc, jsdsrc, dirty);
}
PR_PUBLIC_API(PRUintn)
JSD_GetSourceAlterCount(JSDContext* jsdc, JSDSourceText* jsdsrc)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc);
return jsd_GetSourceAlterCount(jsdc, jsdsrc);
}
PR_PUBLIC_API(PRUintn)
JSD_IncrementSourceAlterCount(JSDContext* jsdc, JSDSourceText* jsdsrc)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc);
return jsd_IncrementSourceAlterCount(jsdc, jsdsrc);
}
PR_PUBLIC_API(JSDSourceText*)
JSD_NewSourceText(JSDContext* jsdc, const char* url)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
return jsd_NewSourceText(jsdc, url);
}
PR_PUBLIC_API(JSDSourceText*)
JSD_AppendSourceText(JSDContext* jsdc,
JSDSourceText* jsdsrc,
const char* text, /* *not* zero terminated */
size_t length,
JSDSourceStatus status)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc);
return jsd_AppendSourceText(jsdc, jsdsrc, text, length, status);
}
/***************************************************************************/
/* Execution/Interrupt Hook functions */
PR_PUBLIC_API(JSBool)
JSD_SetExecutionHook(JSDContext* jsdc,
JSDScript* jsdscript,
prword_t pc,
JSD_ExecutionHookProc hook,
void* callerdata)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
JSD_ASSERT_VALID_SCRIPT(jsdscript);
return jsd_SetExecutionHook(jsdc, jsdscript, pc, hook, callerdata);
}
PR_PUBLIC_API(JSBool)
JSD_ClearExecutionHook(JSDContext* jsdc,
JSDScript* jsdscript,
prword_t pc)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
JSD_ASSERT_VALID_SCRIPT(jsdscript);
return jsd_ClearExecutionHook(jsdc, jsdscript, pc);
}
PR_PUBLIC_API(JSBool)
JSD_ClearAllExecutionHooksForScript(JSDContext* jsdc, JSDScript* jsdscript)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
JSD_ASSERT_VALID_SCRIPT(jsdscript);
return jsd_ClearAllExecutionHooksForScript(jsdc, jsdscript);
}
PR_PUBLIC_API(JSBool)
JSD_ClearAllExecutionHooks(JSDContext* jsdc)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
return jsd_ClearAllExecutionHooks(jsdc);
}
PR_PUBLIC_API(JSBool)
JSD_SetInterruptHook(JSDContext* jsdc,
JSD_ExecutionHookProc hook,
void* callerdata)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
return jsd_SetInterruptHook(jsdc, hook, callerdata);
}
PR_PUBLIC_API(JSBool)
JSD_ClearInterruptHook(JSDContext* jsdc)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
return jsd_ClearInterruptHook(jsdc);
}
PR_PUBLIC_API(JSBool)
JSD_SetDebugBreakHook(JSDContext* jsdc,
JSD_ExecutionHookProc hook,
void* callerdata)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
return jsd_SetDebugBreakHook(jsdc, hook, callerdata);
}
PR_PUBLIC_API(JSBool)
JSD_ClearDebugBreakHook(JSDContext* jsdc)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
return jsd_ClearDebugBreakHook(jsdc);
}
/***************************************************************************/
/* Stack Frame functions */
PR_PUBLIC_API(PRUintn)
JSD_GetCountOfStackFrames(JSDContext* jsdc, JSDThreadState* jsdthreadstate)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
return jsd_GetCountOfStackFrames(jsdc, jsdthreadstate);
}
PR_PUBLIC_API(JSDStackFrameInfo*)
JSD_GetStackFrame(JSDContext* jsdc, JSDThreadState* jsdthreadstate)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
return jsd_GetStackFrame(jsdc, jsdthreadstate);
}
PR_PUBLIC_API(JSDStackFrameInfo*)
JSD_GetCallingStackFrame(JSDContext* jsdc,
JSDThreadState* jsdthreadstate,
JSDStackFrameInfo* jsdframe)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
return jsd_GetCallingStackFrame(jsdc, jsdthreadstate, jsdframe);
}
PR_PUBLIC_API(JSDScript*)
JSD_GetScriptForStackFrame(JSDContext* jsdc,
JSDThreadState* jsdthreadstate,
JSDStackFrameInfo* jsdframe)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
return jsd_GetScriptForStackFrame(jsdc, jsdthreadstate, jsdframe);
}
PR_PUBLIC_API(prword_t)
JSD_GetPCForStackFrame(JSDContext* jsdc,
JSDThreadState* jsdthreadstate,
JSDStackFrameInfo* jsdframe)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
return jsd_GetPCForStackFrame(jsdc, jsdthreadstate, jsdframe);
}
PR_PUBLIC_API(JSBool)
JSD_EvaluateScriptInStackFrame(JSDContext* jsdc,
JSDThreadState* jsdthreadstate,
JSDStackFrameInfo* jsdframe,
const char *bytes, PRUintn length,
const char *filename, PRUintn lineno, jsval *rval)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
PR_ASSERT(bytes);
PR_ASSERT(length);
PR_ASSERT(filename);
PR_ASSERT(rval);
return jsd_EvaluateScriptInStackFrame(jsdc, jsdthreadstate,jsdframe,
bytes, length,
filename, lineno, rval);
}
PR_PUBLIC_API(JSString*)
JSD_ValToStringInStackFrame(JSDContext* jsdc,
JSDThreadState* jsdthreadstate,
JSDStackFrameInfo* jsdframe,
jsval val)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
return jsd_ValToStringInStackFrame(jsdc, jsdthreadstate, jsdframe, val);
}
/***************************************************************************/
PR_PUBLIC_API(JSD_ErrorReporter)
JSD_SetErrorReporter( JSDContext* jsdc, JSD_ErrorReporter reporter, void* callerdata)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
return jsd_SetErrorReporter(jsdc, reporter, callerdata);
}

View File

@@ -1,293 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/*
** Header for JavaScript Debugger for Navigator interfaces
*/
#ifndef jsdebug_h___
#define jsdebug_h___
#include "ntypes.h"
#ifndef NSPR20
#include "prmacros.h"
#else
#include "prtypes.h"
#endif
#include "jsapi.h"
NSPR_BEGIN_EXTERN_C
/***************************************************************************/
/* Opaque typdefs for handles */
typedef struct JSDContext JSDContext;
typedef struct JSDScript JSDScript;
typedef struct JSDSourceText JSDSourceText;
typedef struct JSDThreadState JSDThreadState;
typedef struct JSDStackFrameInfo JSDStackFrameInfo;
/***************************************************************************/
/* High Level calls */
PR_PUBLIC_API(JSDContext*)
JSD_DebuggerOn(void);
PR_PUBLIC_API(void)
JSD_DebuggerOff(JSDContext* jsdc);
PR_PUBLIC_API(PRUintn)
JSD_GetMajorVersion(void);
PR_PUBLIC_API(PRUintn)
JSD_GetMinorVersion(void);
PR_PUBLIC_API(JSContext*)
JSD_GetDefaultJSContext(JSDContext* jsdc);
/* callback stuff for calls in EXE to be accessed by this code in a DLL */
typedef void
(*JSD_SetContextProc)(JSDContext* jsdc, void* user);
typedef struct
{
PRUintn size; /* size of this struct (init before use)*/
JSD_SetContextProc setContext;
} JSD_UserCallbacks;
PR_PUBLIC_API(void)
JSD_SetUserCallbacks(JSTaskState* jstaskstate, JSD_UserCallbacks* callbacks, void* user);
/***************************************************************************/
/* Script functions */
PR_PUBLIC_API(void)
JSD_LockScriptSubsystem(JSDContext* jsdc);
PR_PUBLIC_API(void)
JSD_UnlockScriptSubsystem(JSDContext* jsdc);
PR_PUBLIC_API(JSDScript*)
JSD_IterateScripts(JSDContext* jsdc, JSDScript **iterp);
PR_PUBLIC_API(const char*)
JSD_GetScriptFilename(JSDContext* jsdc, JSDScript *jsdscript);
PR_PUBLIC_API(const char*)
JSD_GetScriptFunctionName(JSDContext* jsdc, JSDScript *jsdscript);
PR_PUBLIC_API(PRUintn)
JSD_GetScriptBaseLineNumber(JSDContext* jsdc, JSDScript *jsdscript);
PR_PUBLIC_API(PRUintn)
JSD_GetScriptLineExtent(JSDContext* jsdc, JSDScript *jsdscript);
typedef void
(*JSD_ScriptHookProc)( JSDContext* jsdc,
JSDScript* jsdscript,
JSBool creating,
void* callerdata );
PR_PUBLIC_API(JSD_ScriptHookProc)
JSD_SetScriptHook(JSDContext* jsdc, JSD_ScriptHookProc hook, void* callerdata);
PR_PUBLIC_API(JSD_ScriptHookProc)
JSD_GetScriptHook(JSDContext* jsdc);
PR_PUBLIC_API(prword_t)
JSD_GetClosestPC(JSDContext* jsdc, JSDScript* jsdscript, PRUintn line);
PR_PUBLIC_API(PRUintn)
JSD_GetClosestLine(JSDContext* jsdc, JSDScript* jsdscript, prword_t pc);
/***************************************************************************/
/* Source Text functions */
/* these coorespond to netscape.jsdebug.SourceTextItem.java values -
* change in both places if anywhere
*/
typedef enum
{
JSD_SOURCE_INITED,
JSD_SOURCE_PARTIAL,
JSD_SOURCE_COMPLETED,
JSD_SOURCE_ABORTED,
JSD_SOURCE_FAILED,
JSD_SOURCE_CLEARED
} JSDSourceStatus;
PR_PUBLIC_API(void)
JSD_LockSourceTextSubsystem(JSDContext* jsdc);
PR_PUBLIC_API(void)
JSD_UnlockSourceTextSubsystem(JSDContext* jsdc);
PR_PUBLIC_API(JSDSourceText*)
JSD_IterateSources(JSDContext* jsdc, JSDSourceText **iterp);
PR_PUBLIC_API(JSDSourceText*)
JSD_FindSourceForURL(JSDContext* jsdc, const char* url);
PR_PUBLIC_API(const char*)
JSD_GetSourceURL(JSDContext* jsdc, JSDSourceText* jsdsrc);
PR_PUBLIC_API(JSBool)
JSD_GetSourceText(JSDContext* jsdc, JSDSourceText* jsdsrc,
const char** ppBuf, int* pLen);
PR_PUBLIC_API(void)
JSD_ClearSourceText(JSDContext* jsdc, JSDSourceText* jsdsrc);
PR_PUBLIC_API(JSDSourceStatus)
JSD_GetSourceStatus(JSDContext* jsdc, JSDSourceText* jsdsrc);
PR_PUBLIC_API(JSBool)
JSD_IsSourceDirty(JSDContext* jsdc, JSDSourceText* jsdsrc);
PR_PUBLIC_API(void)
JSD_SetSourceDirty(JSDContext* jsdc, JSDSourceText* jsdsrc, JSBool dirty);
PR_PUBLIC_API(PRUintn)
JSD_GetSourceAlterCount(JSDContext* jsdc, JSDSourceText* jsdsrc);
PR_PUBLIC_API(PRUintn)
JSD_IncrementSourceAlterCount(JSDContext* jsdc, JSDSourceText* jsdsrc);
/* functions for adding source items */
PR_PUBLIC_API(JSDSourceText*)
JSD_NewSourceText(JSDContext* jsdc, const char* url);
PR_PUBLIC_API(JSDSourceText*)
JSD_AppendSourceText(JSDContext* jsdc,
JSDSourceText* jsdsrc,
const char* text, /* *not* zero terminated */
size_t length,
JSDSourceStatus status);
/***************************************************************************/
/* Execution/Interrupt Hook functions */
#define JSD_HOOK_INTERRUPTED 0
#define JSD_HOOK_BREAKPOINT 1
#define JSD_HOOK_DEBUG_REQUESTED 2
#define JSD_HOOK_RETURN_HOOK_ERROR 0
#define JSD_HOOK_RETURN_CONTINUE 1
#define JSD_HOOK_RETURN_ABORT 2
#define JSD_HOOK_RETURN_RET_WITH_VAL 3 /* not yet supported */
typedef PRUintn
(*JSD_ExecutionHookProc)( JSDContext* jsdc,
JSDThreadState* jsdthreadstate,
PRUintn type,
void* callerdata );
PR_PUBLIC_API(JSBool)
JSD_SetExecutionHook(JSDContext* jsdc,
JSDScript* jsdscript,
prword_t pc,
JSD_ExecutionHookProc hook,
void* callerdata);
PR_PUBLIC_API(JSBool)
JSD_ClearExecutionHook(JSDContext* jsdc,
JSDScript* jsdscript,
prword_t pc);
PR_PUBLIC_API(JSBool)
JSD_ClearAllExecutionHooksForScript(JSDContext* jsdc, JSDScript* jsdscript);
PR_PUBLIC_API(JSBool)
JSD_ClearAllExecutionHooks(JSDContext* jsdc);
PR_PUBLIC_API(JSBool)
JSD_SetInterruptHook(JSDContext* jsdc,
JSD_ExecutionHookProc hook,
void* callerdata);
PR_PUBLIC_API(JSBool)
JSD_ClearInterruptHook(JSDContext* jsdc);
PR_PUBLIC_API(JSBool)
JSD_SetDebugBreakHook(JSDContext* jsdc,
JSD_ExecutionHookProc hook,
void* callerdata);
PR_PUBLIC_API(JSBool)
JSD_ClearDebugBreakHook(JSDContext* jsdc);
/***************************************************************************/
/* Stack Frame functions */
PR_PUBLIC_API(PRUintn)
JSD_GetCountOfStackFrames(JSDContext* jsdc, JSDThreadState* jsdthreadstate);
PR_PUBLIC_API(JSDStackFrameInfo*)
JSD_GetStackFrame(JSDContext* jsdc, JSDThreadState* jsdthreadstate);
PR_PUBLIC_API(JSDStackFrameInfo*)
JSD_GetCallingStackFrame(JSDContext* jsdc,
JSDThreadState* jsdthreadstate,
JSDStackFrameInfo* jsdframe);
PR_PUBLIC_API(JSDScript*)
JSD_GetScriptForStackFrame(JSDContext* jsdc,
JSDThreadState* jsdthreadstate,
JSDStackFrameInfo* jsdframe);
PR_PUBLIC_API(prword_t)
JSD_GetPCForStackFrame(JSDContext* jsdc,
JSDThreadState* jsdthreadstate,
JSDStackFrameInfo* jsdframe);
PR_PUBLIC_API(JSBool)
JSD_EvaluateScriptInStackFrame(JSDContext* jsdc,
JSDThreadState* jsdthreadstate,
JSDStackFrameInfo* jsdframe,
const char *bytes, PRUintn length,
const char *filename, PRUintn lineno, jsval *rval);
PR_PUBLIC_API(JSString*)
JSD_ValToStringInStackFrame(JSDContext* jsdc,
JSDThreadState* jsdthreadstate,
JSDStackFrameInfo* jsdframe,
jsval val);
/***************************************************************************/
/* Error Reporter functions */
#define JSD_ERROR_REPORTER_PASS_ALONG 0
#define JSD_ERROR_REPORTER_RETURN 1
#define JSD_ERROR_REPORTER_DEBUG 2
typedef PRUintn
(*JSD_ErrorReporter)( JSDContext* jsdc,
JSContext* cx,
const char* message,
JSErrorReport* report,
void* callerdata );
PR_PUBLIC_API(JSD_ErrorReporter)
JSD_SetErrorReporter( JSDContext* jsdc, JSD_ErrorReporter reporter, void* callerdata);
NSPR_END_EXTERN_C
#endif /* jsdebug_h___ */

View File

@@ -1,33 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#ifndef XP_MAC
#include "_stubs/netscape_jsdebug_Script.c"
#include "_stubs/netscape_jsdebug_DebugController.c"
#include "_stubs/netscape_jsdebug_JSThreadState.c"
#include "_stubs/netscape_jsdebug_JSStackFrameInfo.c"
#include "_stubs/netscape_jsdebug_JSPC.c"
#include "_stubs/netscape_jsdebug_JSSourceTextProvider.c"
#else
#include "netscape_jsdebug_Script.c"
#include "n_jsdebug_DebugController.c"
#include "n_jsdebug_JSThreadState.c"
#include "n_jsdebug_JSStackFrameInfo.c"
#include "netscape_jsdebug_JSPC.c"
#include "n_j_JSSourceTextProvider.c"
#endif

View File

@@ -1,10 +0,0 @@
//
// JSD.Prefix
//
// Global prefix file for the non-debug JSD project.
//
//
#include "MacPrefix.h"
#include "JSDConfig.h"

Binary file not shown.

View File

@@ -1,5 +0,0 @@
#include "JavaDefines.h"
/* Nothing to do here. If you need JSD-specific defines, add them here */

View File

@@ -1,10 +0,0 @@
//
// JSDDebug.Prefix
//
// Global prefix file for the debug JSD project.
//
//
#include "MacPrefix_debug.h"
#include "JSDConfig.h"

View File

@@ -1,150 +0,0 @@
#!gmake
#
# The contents of this file are subject to the Netscape Public License
# Version 1.0 (the "NPL"); you may not use this file except in
# compliance with the NPL. You may obtain a copy of the NPL at
# http://www.mozilla.org/NPL/
#
# Software distributed under the NPL is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
# for the specific language governing rights and limitations under the
# NPL.
#
# The Initial Developer of this code under the NPL is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
# Reserved.
IGNORE_MANIFEST=1
#
#//------------------------------------------------------------------------
#//
#// Specify the depth of the current directory relative to the
#// root of NS
#//
#//------------------------------------------------------------------------
DEPTH = ..\..
# Turn on/off depending on
!ifdef MOZ_JSD
DIRS = classes
!endif
#//------------------------------------------------------------------------
#//
#// Define any Public Make Variables here: (ie. PDFFILE, MAPFILE, ...)
#//
#//------------------------------------------------------------------------
DLLNAME = jsd$(MOZ_BITS)$(VERSION_NUMBER)
PDBFILE = $(DLLNAME).pdb
MAPFILE = $(DLLNAME).map
RESFILE = $(DLLNAME).res
DLL =.\$(OBJDIR)\$(DLLNAME).dll
MAKE_OBJ_TYPE = DLL
!if "$(MOZ_BITS)" != "16"
LINCS = -I$(PUBLIC)/java \
-I$(PUBLIC)/applet \
-I$(DEPTH)\include
!endif
!if "$(MOZ_BITS)" == "16"
DEFFILE = $(DLLNAME).def
!endif
LLIBS= $(LIBNSPR) \
$(DIST)\lib\js$(MOZ_BITS)$(VERSION_NUMBER).lib \
$(DIST)\lib\jrt$(MOZ_BITS)$(VERSION_NUMBER).lib
!if "$(MOZ_BITS)"=="32" && defined(MOZ_DEBUG) && defined(GLOWCODE)
LLIBS=$(LLIBS) $(GLOWDIR)\glowcode.lib
!endif
#//------------------------------------------------------------------------
#//
#// install headers
#//
#//------------------------------------------------------------------------
INSTALL_DIR=$(PUBLIC)\jsdebug
INSTALL_FILE_LIST= \
jsdebug.h \
$(NULL)
MODULE=jsdebug
REQUIRES=java js nspr
CSRCS= \
jsdebug.c \
jsd_high.c \
jsd_hook.c \
!ifdef MOZ_JSD
jsdstubs.c \
jsd_java.c \
!endif
jsd_scpt.c \
jsd_stak.c \
jsd_text.c
LIBRARY_NAME=jsd
!ifdef MOZ_JSD
JDK_GEN=netscape.jsdebug.Script netscape.jsdebug.DebugController \
netscape.jsdebug.JSThreadState netscape.jsdebug.JSStackFrameInfo \
netscape.jsdebug.JSPC netscape.jsdebug.JSSourceTextProvider \
netscape.jsdebug.JSErrorReporter
!endif
EXPORTS=jsdebug.h
C_OBJS= \
.\$(OBJDIR)\jsdebug.obj \
.\$(OBJDIR)\jsd_high.obj \
.\$(OBJDIR)\jsd_hook.obj \
!ifdef MOZ_JSD
.\$(OBJDIR)\jsdstubs.obj \
.\$(OBJDIR)\jsd_java.obj \
!endif
.\$(OBJDIR)\jsd_scpt.obj \
.\$(OBJDIR)\jsd_stak.obj \
.\$(OBJDIR)\jsd_text.obj
!if "$(MOZ_BITS)" != "16"
LINCS=-I$(XPDIST)\public\java -I$(XPDIST)\public\js \
-I$(XPDIST)\public\nspr
!endif
#//------------------------------------------------------------------------
#//
#// Include the common makefile rules
#//
#//------------------------------------------------------------------------
include <$(DEPTH)\config\rules.mak>
install:: $(DLL)
$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).dll $(DIST)\bin
$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).lib $(DIST)\lib
clobber::
$(RM_R) _gen
$(RM_R) _stubs
.\$(OBJDIR)\jsdstubs.o: \
$(JDK_STUB_DIR)\netscape_jsdebug_Script.c \
$(JDK_STUB_DIR)\netscape_jsdebug_DebugController.c \
$(JDK_STUB_DIR)\netscape_jsdebug_JSThreadState.c \
$(JDK_STUB_DIR)\netscape_jsdebug_JSStackFrameInfo.c \
$(JDK_STUB_DIR)\netscape_jsdebug_JSPC.c \
$(JDK_STUB_DIR)\netscape_jsdebug_JSSourceTextProvider.c
export:: INSTALL_FILES

View File

@@ -1,33 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by jsd3240.rc
//
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 101
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

View File

@@ -1,30 +0,0 @@
/* jband - 09/14/98 - */
js/jsdj contains virtually all of the Java code for JavaScript Debugging
(native parts of the code for JavaScript can be found in js/jsd).
This includes the full source to Netscape JavaScript Debugger, adapter parts,
jslogger, a simple console debugger, a test system, and some build tools.
The notable subdirs are:
build - stuff to build the code
classes - trees of source files
dist - generated output dir
ifcui - auxilary pieces of the JavaScript Debugger
jslogger - auxilary pieces of a smaple JavaScript logging app
stub_classes - stubbed out mozilla classes to allow standalone debugging
test - a place for subsystem tests
The source to the debugger lives in:
jsdj/classes/com/netscape/jsdebugging/ifcui
All building is done in:
jsdj/build
***************************************************************************
*** 09/15/98
*** NOTE: some of this relates to code in js/jsd that is not yet checked in.
*** New stuff in js/jsd will go in when new js/src lands (later this week).
*** I decided to check this in anyway...
***************************************************************************

View File

@@ -1,33 +0,0 @@
/* jband - 09/14/98 - */
The build system here currently supports only Microsoft nmake (I use the one
from MSDEV 4.2). It assumes that Symantec Visual Cafe is installed (i.e. it uses
sj.exe), and also uses gawk. I mostly use the 4NT shell, but I think that
everything still works with the default NT shell.
This system can build all the Java code here. It can also do jar packaging (with
dependency checks to assure that you have the right stuff) and produce javadocs.
Netscape's JavaScript in Java engine (known as Rhino) is not currently available
to the public. The flag 'NO_RHINO=1' is necessary for many of the makefile
targets when used outside of Netscape.
There is code here to also build a Corba/iiop connection for remote debugging to
a Netscape Internal version of Enterprise Server 3.51. This is not fully
functional on the server side. You should normally use the NO_CORBA=1 build
flag. If you want to play with this stuff then you need an install of ES3.51 and
you need to set the ES3_ROOT environment variable to point to that install.
(e.g. mine is 'set ES3_ROOT=E:\Netscape\SuiteSpot'. NOTE: the code in
com.netscape.jsdebugging.remote.corba is *generated* in an 'interesting' build
system in js/jsd/corba/src -- it would not be a good idea to modify this
generated code.
'nmake -f jsdj.mak help' will display a list of possible targets (might not be
up to date :).
'nmake -f jsdj.mak all NO_RHINO=1 NO_CORBA=1' will build everything.
There are a few .bat files for convenience to build the targets I often build.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 925 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 886 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 896 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 527 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 925 B

View File

@@ -1 +0,0 @@
nmake -f jsdj.mak %1 %2 %3 %4 %5 %6 %7 %8 %9

View File

@@ -1,2 +0,0 @@
nmake -f jsdj.mak INCLUDE_SECURITY=1 INCLUDE_LOCAL_ADAPTER=1 INCLUDE_LOCAL_LAUNCHER=1 INCLUDE_IMAGES=1 INCLUDE_SOUNDS=1 %1 %2 %3 %4 %5 %6 %7 %8 %9

View File

@@ -1 +0,0 @@
call mk_ifcui_std.bat ifcui_fast ifcui_jar

View File

@@ -1,7 +0,0 @@
/* jband - 09/14/98 - */
The 'classes' directory is the root of the JavaScript debugging pacakage space.
Older pacakages begin with 'netscape' (e.g. netscape.jsdebug which shipped - in
eariler form - with Navigator 4.x). Newer packages all start with
'com.netscape'.

Some files were not shown because too many files have changed in this diff Show More