Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A breakpoint has been triggered. #2831

Closed
chuiliuyiyi opened this issue Mar 23, 2023 · 3 comments
Closed

A breakpoint has been triggered. #2831

chuiliuyiyi opened this issue Mar 23, 2023 · 3 comments
Labels
bug This issue describes a bug

Comments

@chuiliuyiyi
Copy link

chuiliuyiyi commented Mar 23, 2023

Thank you for contributing to Armory!

Description
A breakpoint has been triggered.

To Reproduce
Steps to reproduce the behavior.

Expected behavior

#include "SystemMicrosoft.h"

#include <kinc/error.h>
#include <kinc/libs/stb_sprintf.h>

#define S_OK ((HRESULT)0L)

static void winerror(HRESULT result) {
	LPVOID buffer = NULL;
	DWORD dw = GetLastError();

	__debugbreak();//A breakpoint has been triggered here.
//A breakpoint has been triggered here.
//A breakpoint has been triggered here.
//A breakpoint has been triggered here.

#if defined(KORE_WINDOWS) || defined(KORE_WINDOWSAPP)
	if (dw != 0) {
		FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, dw,
		               MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)&buffer, 0, NULL);

		kinc_error_message("Error: %s", buffer);
	}
	else {
#endif
		kinc_error_message("Unknown Windows error, return value was 0x%x.", result);
#if defined(KORE_WINDOWS) || defined(KORE_WINDOWSAPP)
	}
#endif
}

void kinc_microsoft_affirm(HRESULT result) {
	if (result != S_OK) {
		winerror(result);
	}
}

void kinc_microsoft_affirm_message(HRESULT result, const char *format, ...) {
	va_list args;
	va_start(args, format);
	kinc_affirm_args(result == S_OK, format, args);
	va_end(args);
}

void kinc_microsoft_format(const char *format, va_list args, wchar_t *buffer) {
	char cbuffer[4096];
	vsprintf(cbuffer, format, args);
	MultiByteToWideChar(CP_UTF8, 0, cbuffer, -1, buffer, 4096);
}

System
Blender:3.3.0
Armory:ArmorySDK2303
OS:Windows10,vs2017compiler
Graphics card:integrated graphics

Test File
(drag & drop the zipped .blend file here)
blender.zip

@MoritzBrueckner
Copy link
Collaborator

MoritzBrueckner commented Apr 1, 2023

Hi, I can't reproduce the error with your file (I'm using VS2022 though), could you please share more details? The file you shared is only configured to export to Krom so I added windows-hl as a target. If you changed anything from the default exporter settings for HL and that causes the issue, it will not happen to others.

When Visual Studio reaches a breakpoint, it will usually show you a call stack which looks like this:
Call Stack example

Could you please share the call stack in your case? The position in which the debug break was triggered unfortunately doesn't help, since __debugbreak() is called as part of a routine that reacts to errors (winerror()), but we currently do not know what is leading to that error.

I noticed that you have a file called ╣Ñ╗¸┴ª1.png, please avoid special characters as they are usually prone to issues. The same goes for "球体" as the name of your sphere object, I'm not sure if all parts of Armory and Kha can handle these characters well. However, it works for me, so there might not be an issue with that in this case :)

Edit: I took the liberty of editing your post above in order to properly format/highlight the code you shared.

@MoritzBrueckner
Copy link
Collaborator

Duplicate of #2832.

@MoritzBrueckner MoritzBrueckner closed this as not planned Won't fix, can't repro, duplicate, stale Apr 6, 2023
@chuiliuyiyi
Copy link
Author

I am not very good at operating VS C++. I just open the. sln file, click on compile and run directly, and the breakpoint location will appear

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue describes a bug
Projects
None yet
Development

No branches or pull requests

2 participants