Recent

Author Topic: [SOLVED] Is it possible to jump into C code from Lazarus? If yes, when/how?  (Read 4929 times)

cpicanco

  • Hero Member
  • *****
  • Posts: 655
  • Behavioral Scientist and Programmer
    • Portfolio
Hi everyone,

I am receiving an "ActiveX not available" error from SDL_GetError when calling SDL_Init(SDL_INIT_VIDEO). I am wondering what should I do with Lazarus to known in which line this error is happening in the C code (with step into, F7). Where should I place the header and source SDL files?

Best,
R
« Last Edit: November 12, 2023, 03:37:40 pm by cpicanco »
Be mindful and excellent with each other.
https://github.com/cpicanco/

cpicanco

  • Hero Member
  • *****
  • Posts: 655
  • Behavioral Scientist and Programmer
    • Portfolio
Re: SDL2 debug
« Reply #1 on: September 26, 2023, 03:43:25 pm »
Hi everyone,

Please, shed some light on this. Is it possible to jump into C code (F7)? I am getting a weird "activex not available" error when calling:

if SDL_InitSubSystem(SDL_INIT_VIDEO) < 0 then begin
...
end;

The strange thing is that this error was NOT happening yesterday on my own machine. I found this error running on a Windows 7 machine. And now it happening on my Windows 11 machine. What the hell is happening??
Be mindful and excellent with each other.
https://github.com/cpicanco/

Zvoni

  • Hero Member
  • *****
  • Posts: 2754
Re: SDL2 debug
« Reply #2 on: September 26, 2023, 03:46:21 pm »
Is it possible to jump into C code (F7)? I am getting a weird "activex not available" error when calling:
No
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

cpicanco

  • Hero Member
  • *****
  • Posts: 655
  • Behavioral Scientist and Programmer
    • Portfolio
Re: Is it possible to jump into C code from Lazarus? If yes, when/how?
« Reply #3 on: September 26, 2023, 07:06:25 pm »
I remember lazarus jumping into C code. Am I allucinating?  :o
Be mindful and excellent with each other.
https://github.com/cpicanco/

ccrause

  • Hero Member
  • *****
  • Posts: 970
Re: Is it possible to jump into C code from Lazarus? If yes, when/how?
« Reply #4 on: September 26, 2023, 07:18:15 pm »
I remember lazarus jumping into C code. Am I allucinating?  :o
I think it is possible, but then the C object/library needs to contain the necessary debug information.

zeljko

  • Hero Member
  • *****
  • Posts: 1670
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Is it possible to jump into C code from Lazarus? If yes, when/how?
« Reply #5 on: September 26, 2023, 07:49:23 pm »
Under linux I'm regulary jumping into Qt c-bindings and from there regulary to Qt c++ sources with gdb, and yes, from Lazarus. Of course debug info and dev packages should be installed for that scenario.

Dzandaa

  • Sr. Member
  • ****
  • Posts: 399
  • From C# to Lazarus
Re: Is it possible to jump into C code from Lazarus? If yes, when/how?
« Reply #6 on: September 26, 2023, 07:54:12 pm »
Hi,

Yes, you can :)

read this:

https://downloads.freepascal.org/fpc/docs-pdf/CinFreePascal.pdf

Have a nice day.

B->
Regards,
Dzandaa

cpicanco

  • Hero Member
  • *****
  • Posts: 655
  • Behavioral Scientist and Programmer
    • Portfolio
Re: Is it possible to jump into C code from Lazarus? If yes, when/how?
« Reply #7 on: September 27, 2023, 01:21:48 pm »
Thank you people! You are awesome!

Just to update the SDL2 issue https://github.com/libsdl-org/SDL/issues/8296. It turns out that it was related to SDL_VIDEODRIVER windows system environment variable.
Be mindful and excellent with each other.
https://github.com/cpicanco/

PascalDragon

  • Hero Member
  • *****
  • Posts: 5769
  • Compiler Developer
Re: Is it possible to jump into C code from Lazarus? If yes, when/how?
« Reply #8 on: September 28, 2023, 09:31:58 pm »
Yes, you can :)

read this:

https://downloads.freepascal.org/fpc/docs-pdf/CinFreePascal.pdf

This is a different topic. cpicanco asked to debug into the C-code. Calling it is already obvious by them using SDL functions. And debugging requires the C-code to have (compatible) debug information available.

cpicanco

  • Hero Member
  • *****
  • Posts: 655
  • Behavioral Scientist and Programmer
    • Portfolio
Re: Is it possible to jump into C code from Lazarus? If yes, when/how?
« Reply #9 on: November 12, 2023, 03:37:18 pm »
Under linux I'm regulary jumping into Qt c-bindings and from there regulary to Qt c++ sources with gdb, and yes, from Lazarus. Of course debug info and dev packages should be installed for that scenario.

Thank you, I will keep that information in mind!
Be mindful and excellent with each other.
https://github.com/cpicanco/

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10563
  • Debugger - SynEdit - and more
    • wiki
Re: [SOLVED] Is it possible to jump into C code from Lazarus? If yes, when/how?
« Reply #10 on: November 12, 2023, 05:39:38 pm »
You can step into C code, if you use GDB as debugger backend.

Mind though that for evaluating WATCHES the IDE pre-translates for gdb, so if an expression should be watched you may need to do "pascal style".

---
FpDebug is not tested for that (yet). So maybe, maybe not. 

 

TinyPortal © 2005-2018