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

GDB support / debug build #208

Open
ilnytskyi opened this issue Nov 30, 2022 · 2 comments
Open

GDB support / debug build #208

ilnytskyi opened this issue Nov 30, 2022 · 2 comments

Comments

@ilnytskyi
Copy link
Contributor

Is there a way to configure and install this extension with gdb support?
I prepared dev env for php-source, however GDB does not hit breakpoints.

I tried both VScode UI and GDB.
Both say that module is not loaded.

No source file named /home/www/spx-src/src/spx_php.c.
Make breakpoint pending on future shared library load?

Selection_211

In case of VScode it shows message below and never hits breakpoints.

Module containing this breakpoint has not yet loaded or the breakpoint address could not be obtained.

But some mentions of spx.so are seen in stack trace with unknown source.

So only those that were set on core php are hit
Selection_212

As a workaround I tried __asm__("int3"); but it's not that convenient

Selection_213

@NoiseByNorthwest
Copy link
Owner

Adding --enable-debug to ./configure should be enough to build it with debug symbols.

I'm a bit curious, what are you trying to achieve ?

@ilnytskyi
Copy link
Contributor Author

I wanted to set up dev environment to dig into source code of spx and php, and nothing worked :(

--enable-debug did not work.

Thanks for suggestion, I look through the source a bit more and I think it's because in config.m4 https://github.com/NoiseByNorthwest/php-spx/blob/master/config.m4#L17 the -g flag is missing in CFLAGS

I managed to compile with debug symbols by adding -g there and now it's working.
Selection_214

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

No branches or pull requests

2 participants