有没有人通过运行/附加到64位应用程序来成功调试64位dll?我有应用程序和DLL的Delphi代码.我可以用32位和64位调试应用程序.我也可以通过使用Run- > Parameters来调试32位dll 来选择32位版本的应用程序.
但是,我似乎无法通过运行64位应用程序调试我的64位DLL,有没有人让这个工作?
鉴于以下Delphi代码,Foo是Free'开启FormClose,但TFoo.Destroy未被调用 - 因此Bar不是Free'd,导致内存泄漏?
我在这里错过了什么或者不应该Foo.Free在某些时候调用Foo.Destroy?
type
TBar = class
SomeInteger : integer;
end;
TFoo = class
Bar : TBar;
constructor Create();
destructor Destroy();
end;
var
Foo : TFoo;
implementation
constructor TFoo.Create;
begin
Bar := TBar.Create;
Bar.SomeInteger := 2;
end;
destructor TFoo.Destroy;
begin
Bar.Free;
Bar := nil;
showmessage('Destroyed!');
end;
procedure TForm10.FormCreate(Sender: TObject);
begin
Foo := TFoo.Create;
showmessage('Foo created');
end;
procedure TForm10.FormDestroy(Sender: TObject);
begin
Foo.Free;
Foo := nil;
end;
Run Code Online (Sandbox Code Playgroud) 我正在运行带有 'Debugger for Chrome' 扩展的 Visual Studio Code 来调试一些 javascript。但是,我想在调试时运行一个进程外的胡椒插件。
在 Visual Studio Code 之外,我们通过将以下命令行标志传递给 chrome.exe(以及其他)来做到这一点:
--register-pepper-plugins="path_to_plugin";mime_type
Run Code Online (Sandbox Code Playgroud)
注意:需要双引号
为了通过 Visual Studio Code 将命令行参数传递给 Chrome,我设置了一个 launch.json 并添加以下内容:
"runtimeArgs" : ["--register-pepper-plugins=\"path_to_plugin\";mime_type"]
Run Code Online (Sandbox Code Playgroud)
我可以使用 ProcessExplorer 看到我的 runtimeArgs 被传递给 Chrome,但转义字符 \ 完好无损,所以 chrome 实际收到的是:
--register-pepper-plugins=\"path_to_plugin\";mime_type
Run Code Online (Sandbox Code Playgroud)
而不是
--register-pepper-plugins="path_to_plugin";mime_type
Run Code Online (Sandbox Code Playgroud)
如果我删除转义字符,我只会得到
--register_pepper_plugins=
Run Code Online (Sandbox Code Playgroud)
因为第二个双引号匹配第一个。
我在这里做了一些明显明显的错误吗?
我正在使用Delphi XE2并尝试将我们的usb通信dll升级到64位.我们正在使用JVCL SetupAPI和Hid单元.所有工作完全使用32位编译器,可以看到我附加的HID设备.我切换到64位,我再也看不到任何我知道的HID设备了.
我遇到有人提到需要以64位不同的方式调整某些数据结构的大小(请参阅https://forums.embarcadero.com/thread.jspa?messageID=408473#408473),这有所帮助但我现在正式难倒.
目前我的代码返回从SetupDiGetDeviceInterfaceDetail函数读取的0字节.注释掉的SizeOf()适用于32位但不适用于64位.
任何帮助将非常感激.
repeat
TmpDeviceInterfaceData.cbSize := SizeOf(TSPDeviceInterfaceData);
TmpDeviceInterfaceData.cbSize := 32; // SizeOf(TmpDeviceInterfaceData);
TmpSuccess := SetupDiEnumDeviceInterfaces(TmpDevInfo, nil, TmpDevHidGuid, TmpDevn, TmpDeviceInterfaceData);
if TmpSuccess then
begin
TmpDevData.cbSize := 32; //SizeOf(TmpDevData);
showmessage(inttostr(tmpdevdata.cbsize));
TmpBytesReturned := 0;
SetupDiGetDeviceInterfaceDetail(TmpDevInfo, @TmpDeviceInterfaceData, nil, 0, TmpBytesReturned, @TmpDevData);
showmessage('bytes returned = ' + inttostr(TmpBytesReturned));
if (TmpBytesReturned <> 0) and (GetLastError = ERROR_INSUFFICIENT_BUFFER) then
begin
// showmessage('hello');
TmpFunctionClassDeviceData := AllocMem(TmpBytesReturned);
TmpFunctionClassDeviceData.cbSize := sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA_A);
TmpFunctionClassDeviceData.cbSize := 8;
// showmessage(inttostr(TmpFunctionClassDeviceData.cbSize));
if SetupDiGetDeviceInterfaceDetail(TmpDevInfo, @TmpDeviceInterfaceData, TmpFunctionClassDeviceData, TmpBytesReturned, TmpBytesReturned, @TmpDevData) then
begin …Run Code Online (Sandbox Code Playgroud) 在脚本化的 Jenkinsfile 中,您可以通过设置在“上游”项目上设置构建触发器:
properties([
pipelineTriggers([
upstream(
threshold: 'SUCCESS',
upstreamProjects: 'UpstreamJob\master'
)
])
])
Run Code Online (Sandbox Code Playgroud)
如何在多分支管道作业中使用声明性 Jenkinsfile 设置等效的管道触发器?
如果我将 pipelineTriggers 放在“选项”部分,则会出现以下错误:
WorkflowScript: 20: Invalid option type "pipelineTriggers". Valid option types: [buildDiscarder, catchError, disableConcurrentBuilds, overrideIndexTriggers, retry, script, skipDefaultCheckout, skipStagesAfterUnstable, timeout, timestamps, waitUntil, withContext, withCredentials, withEnv, ws]
Run Code Online (Sandbox Code Playgroud) 我正在写一些通过dll与外部硬件通信的软件(移动一些电机并读回一些值).对dll的调用是阻塞的,可能不会以10秒的顺序返回.该软件通过移动硬件,读取并重复多个点来执行扫描.一次扫描可能需要30分钟才能完成.在扫描运行时,我显然希望GUI能够响应,并且在每个点都要更新输入数据的实时图形(在MDI子项中).多线程似乎是这个问题的明显选择.
我的问题是,什么是最好的方法来解决这个问题并与主VCL线程交谈以在扫描期间更新图表?
我目前有一个TThread后代,它在ChildForm的public var部分执行'scan logic'和一系列双精度.我需要从线程中填写此数组,但我不知道是使用Synchronize或CriticalSection还是PostMessage或其他方法.每次添加新值时,主VCL线程都需要更新图形.我真的应该有一个全局变量数据的中间对象,并以某种方式单独从Thread和ChildForm访问它吗?