mirror of
https://github.com/yrp604/bdump
synced 2026-06-08 18:32:32 +00:00
implement full dump
This commit is contained in:
@@ -301,15 +301,25 @@ function __save_regs(path, regs) {
|
||||
file.Close();
|
||||
}
|
||||
|
||||
function __save_mem(path) {
|
||||
const Control = host.namespace.Debugger.Utility.Control;
|
||||
function __save_mem(dmp_type, path) {
|
||||
const control = host.namespace.Debugger.Utility.Control;
|
||||
const options = new Map([
|
||||
['full', '/f'],
|
||||
['active-kernel', '/ka']
|
||||
]);
|
||||
|
||||
for (let line of Control.ExecuteCommand('.dump /ka ' + path + '\\mem.dmp')) {
|
||||
logln('[bdump] ' + line);
|
||||
const option = options.get(dmp_type);
|
||||
if(option == undefined) {
|
||||
logln(`[bdump] ${dmp_type} is an unknown type`);
|
||||
return;
|
||||
}
|
||||
|
||||
for (const line of control.ExecuteCommand(`dump ${option} ${path}\\mem.dmp`)) {
|
||||
logln(`[bdump] ${line}`);
|
||||
}
|
||||
}
|
||||
|
||||
function __bdump(path) {
|
||||
function __bdump(dmp_type, path) {
|
||||
if (path == undefined) {
|
||||
usage();
|
||||
return;
|
||||
@@ -324,16 +334,27 @@ function __bdump(path) {
|
||||
__fixup_regs(regs);
|
||||
__save_regs(path, regs);
|
||||
logln('[bdump] saving mem, get a coffee or have a smoke, this will probably take around 10-15 minutes...');
|
||||
__save_mem(path);
|
||||
__save_mem(dmp_type, path);
|
||||
|
||||
logln('[bdump] done!');
|
||||
}
|
||||
|
||||
function __bdump_full(path) {
|
||||
return __bdump('full', path);
|
||||
}
|
||||
|
||||
function __bdump_active_kernel(path) {
|
||||
return __bdump('active-kernel', path);
|
||||
}
|
||||
|
||||
function initializeScript() {
|
||||
usage();
|
||||
|
||||
return [
|
||||
new host.apiVersionSupport(1, 2),
|
||||
new host.functionAlias(__bdump, "bdump"),
|
||||
new host.functionAlias(__bdump_full, "bdump_full"),
|
||||
|
||||
new host.functionAlias(__bdump_active_kernel, "bdump_active_kernel"),
|
||||
new host.functionAlias(__bdump_active_kernel, "bdump"),
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user