codelldb icon indicating copy to clipboard operation
codelldb copied to clipboard

FreeBSD support?

Open davidchisnall opened this issue 5 years ago • 12 comments

OS: FreeBSD 12 VSCode version: 1.41 Extension version: N/A Python version: 3.7.6 LLDB version: 8.0.1, up to 10 RC1 supported in packages

LLDB is the system debugger for FreeBSD and FreeBSD ships multiple versions in packages, but this extension produces an error on install, saying that FreeBSD is not supported. I believe this is because it is missing the platform-specific binaries for the native adaptor, but falling back to the Python adaptor does not work. I was not able to find a setting to try with a different lldb version, so this may be a problem with the version in the base system only.

davidchisnall avatar Feb 06 '20 14:02 davidchisnall

Sorry, I've no near-future plans for FreeBSD port.

vadimcn avatar Feb 10 '20 19:02 vadimcn

What are the blockers? It appears as if the only thing preventing it from working is the lack of a binary.

davidchisnall avatar Feb 11 '20 10:02 davidchisnall

Well, yes, it's the lack of binaries. I don't have a machine or a docker image to build them and I don't have a machine to test.

vadimcn avatar Feb 11 '20 23:02 vadimcn

I've spent the last couple of days porting it and not a lot of changes need to take place for it to build. Unfortunately, I have found it has the same problem as QTCreator in that LLDB is missing the breakpoints which is the reason I tried porting it in the first place.

I just decided to include everything so you can see some of the changes necessary but also forcing LLVM90 as the version due to the shipped LLVM and LLVM90 from pkg not having scripting support turned on (hint: build it from ports or use devel):

https://github.com/wolfspider/vscode-lldb/commit/05ef6a4d1f5905622c6b0ac94e0d5c49f9c5c90e

It is very WIP obviously here is the release as a VSIX:

https://github.com/wolfspider/vscode-lldb/releases

Also have encountered a strange Rust problem with FreeBSD hence the weird header file in there- yes I actually have to include this header AND the import haven't narrowed this one down quite yet but it builds. Weird huh?

https://github.com/mystor/rust-cpp/issues/70

I'm still trying a thing or two to get this working just let me know what you think, thanks!

wolfspider avatar Feb 12 '20 04:02 wolfspider

Thanks for looking into it, but It's not that simple... I also build a custom version of LLDB, maximally stripped of dependencies, with Rust support and some bug fixes. Which also requires a special build of SWIG, which makes it possible to bind to different versions of Python.

But even if all that were solved, there's still the question of building and testing it. In my experience, platform ports tend to break quite often unless tested by CI.

vadimcn avatar Feb 12 '20 06:02 vadimcn

Cirrus CI provides free FreeBSD CI and can be triggered automatically from GitHub.

davidchisnall avatar Feb 12 '20 10:02 davidchisnall

@vadimcn Oh absolutely I agree, all that I am trying to explain here is that even with it being built LLDB regex breakpoints are problematic right now. I can set regular breakpoints just fine in the terminal however I'm seeing the same behavior across QTCreator, etc.. So this may be similar to the problem MacOS was having and some functionality may be needed in LLDB (for FreeBSD) first before moving forward. Both adapters from your code native and python work just fine as-is from what I can tell.

wolfspider avatar Feb 12 '20 14:02 wolfspider

@wolfspider, did you mean to post in this thread? I'm not quite sure what regex'es have to do with FreeBSD...

vadimcn avatar Feb 12 '20 18:02 vadimcn

@vadimcn Heh, no it's the right thread just getting ahead of myself here. What I was describing was setting regex breakpoints. I need to do more testing with my installation of LLDB. TBH I think it's a permissions issue with FreeBSD and may have something to do with the defaults. Setting breakpoints manually in the terminal works fine but when another process sets them then something is going wrong. Hopefully, I can figure out if this is normal behavior, or a misconfiguration, or an actual issue because everybody who uses 12.1 Release branch of FreeBSD will encounter this. I do have specific examples + questions but want to make sure those go to the right place but IMO it's too early to determine that. To be fair I haven't edited LLDB source code at all here just added the scripting support so that is all stock.

wolfspider avatar Feb 12 '20 20:02 wolfspider

Even setting a regex breakpoint to "." by hand still not getting anything when attaching a function but when not scripting (set breakpoint --file file.c -l 10) it works. Tried with sudo as well.

nocommand

wolfspider avatar Feb 13 '20 06:02 wolfspider

Did anybody make a progress on freeBSD support?

AlexanderYukhanov avatar Feb 10 '22 04:02 AlexanderYukhanov

Did anybody make a progress on freeBSD support?

mitidzi avatar Dec 18 '22 17:12 mitidzi