转储进程内存以从转储文件中归档/重新创建进程(Dump a process memory to file / recreate process from dump file)
只是好奇,也许有人知道一种方式:
是否有可能,在打开进程(应用程序域)时,将其整个内存空间转储到文件,将其通过网络发送到LAN工作站并重新创建第一台计算机上的进程。
假设:
- 应用程序存在于两台计算机上;
- 该过程不会创建任何本地设置/临时文件;
- 两台计算机的操作系统相同;
Just curious, maybe someone knows a way:
Is it possible, while having an opened process (app domain), dump its entire memory space to a file, send it by wire to a LAN workstation and recreate the process as it was on the first computer.
Assumptions:
- the application exists on both computers;
- the process is not creating any local settings/temporary files;
- the OS is the same on both computers;
原文:https://stackoverflow.com/questions/29583122
最满意答案
这取决于 - 属性是否可写/可配置?
以下控制台日志公开了
Infinity
:> Object.getOwnPropertyDescriptor(window,'Infinity') < Object {value: Infinity, writable: false, enumerable: false, configurable: false}
但是,其他全局属性(如
frames
)是可配置的:> Object.getOwnPropertyDescriptor(window,'frames') < Object {value: Window, writable: true, enumerable: true, configurable: true}
所以,基本上,这取决于财产的设置方式。
It depends - is the property writable/configurable or not?
Infinity
is neither, as exposed by the following console log:> Object.getOwnPropertyDescriptor(window,'Infinity') < Object {value: Infinity, writable: false, enumerable: false, configurable: false}
However, other global properties, such as
frames
, are configurable:> Object.getOwnPropertyDescriptor(window,'frames') < Object {value: Window, writable: true, enumerable: true, configurable: true}
So, basically, it depends on how the property is set up.
相关问答
更多-
如何删除/取消设置JavaScript对象的属性?(How to delete/unset the properties of a javascript object? [duplicate])[2021-11-23]
只需使用delete ,但请注意,您应该充分阅读使用以下内容的效果: delete object.index; //true object.index; //undefined 但如果我这样使用: var x = 1; //1 delete x; //false x; //1 但是如果您希望删除全局命名空间中的变量,则可以使用其全局对象(如window ,或者在最外层的范围内使用this var a = 'b'; delete a; //false delete window.a; //true d ... -
通过将对象属性标记为不是“可枚举”,可以将对象属性从迭代机制中隐藏起来: var foo = { a: "Hello", b: "World" }; Object.defineProperty(foo, "c", { value: "where am I?" }); 默认情况下,使用defineProperty()定义的属性不是可枚举的,所以如果你在对象“foo”中运行for ... in循环,则不会看到“c”。 当然,全局对象是具有各种魔法属性的东西,但基本的“可枚举”标志仍然适用。 至于为什么 “pa ...
-
这是解决方案: //Iterates through properties of object for (var property in vm.statesWithCodes) { //Iterates through indices of array f ...
-
然后,如果您尝试删除“test1”属性(顺便说一句,我可以调用一个数组的元素,这是一个对象,数组对象的属性)。 该数组没有名为“test1”的属性。 它有一个名为"0"的属性值为"test1" ,但通常认为数组完全不具有属性。 数组在技术上是对象,并且可以像“常规对象”那样将“test1”等属性添加到它们中,但这几乎总是一个坏主意: var testing = ['a','b','c']; testing.test1 = 'hello'; delete testing.test1; 数组元素不是属性,但是 ...
-
这取决于 - 属性是否可写/可配置? 以下控制台日志公开了Infinity : > Object.getOwnPropertyDescriptor(window,'Infinity') < Object {value: Infinity, writable: false, enumerable: false, configurable: false} 但是,其他全局属性(如frames )是可配置的: > Object.getOwnPropertyDescriptor(window,'frames') < ...
-
您是否能够更改从服务器获得的脚本格式? 如果是这样,请遵循Aadit评论中的建议并让您的服务器发送: context["myVar"] = 314; 要么: context.myVar = 314; 如果你不能改变格式,脚本就像var myVar = 314;一样简单var myVar = 314; ? 如果是,请尝试重新思考方法。 而不是尝试在某个特定上下文中eval()脚本,将脚本解析为可以使用的表单。 例如: var script = 'var myVar = -314.5;'; // what ...
-
对象属性动态删除(Object properties dynamic delete)[2022-12-10]
这是最低要求: function deleteFromObject(keyPart, obj){ for (var k in obj){ // Loop through the object if(~k.indexOf(keyPart)){ // If the current key contains the string we're looking for delete obj[k]; // Delete obj[key]; ... -
问题是您的测试代码错误地使用了in运算符。 它实际测试的是名称“undefined”是否在window定义,而不是“t”。 为什么? 因为in的左侧操作数被强制转换为字符串。 因为“t” undefined ,所以它被强制转换为字符串“undefined”,实际上该属性名称存在于全局上下文中。 将测试更改为 console.log("t" in window, t); The issue is that your test code is using the in operator erroneously ...
-
我需要在全局范围内使用eval()... 如果你的字面意思是你需要在全局范围内评估某些东西,你可以使用间接eval来做到这一点: (0, eval)("your code here"); 它看起来很奇怪,但它使eval在全局范围而不是局部范围内工作。 var n; // A global `n` function direct() { var n; eval("n = 'a';"); console.log("Direct:"); console.log(" lo ...
-
访问页面JavaScript对象中的全局JavaScript变量?(Access page Global JavaScript variable inside my JavaScript object?)[2021-11-26]
在您的代码中,您可以: var $window = $(window) ...然后您尝试访问current_user是: var current_user = $window.current_user; 但$window是一个jQuery对象。 全局变量是window属性,而不是jQuery对象。 你只想要那里的window 。 var current_user = window.current_user; // No $ -----------^ 或者,我只是为局部变量使用不同的名称,并利用curr ...