473,408 Members | 1,763 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

php extension debugger

Ben
Hello,

I'm a very, very novice C programmer and I have written an extension
for php that does its purpose well, or at least it used to until they
asked for that one extra feature. It's a very little thing, very easy,
but damn it all, it has a mysterious bug. I tracked it down to one
specific line where the weirdness occurs, but I can't figure out *why*
it is occuring.

This extension uses the php_streams and as such, is wed enough to php
that my first inclination (compile it on its own and debug it that way)
is a no-go. Is there any way to use a debugger on this so I can step
through it?

I only know enough C for it to be painful. Any help would be
appreciated.

Thanks,
Ben

Nov 2 '05 #1
4 2206

Ben wrote:
Hello,

I'm a very, very novice C programmer and I have written an extension
for php that does its purpose well, or at least it used to until they
asked for that one extra feature. It's a very little thing, very easy,
but damn it all, it has a mysterious bug. I tracked it down to one
specific line where the weirdness occurs, but I can't figure out *why*
it is occuring.

This extension uses the php_streams and as such, is wed enough to php
that my first inclination (compile it on its own and debug it that way)
is a no-go. Is there any way to use a debugger on this so I can step
through it?


What platform are you on? If you're using Visual Studio on Windows,
what you do is attach the debugger to the Apache process then set the
break points. Upon hitting the page the debugger will stop the process
at the break point for you to trace through.

Nov 2 '05 #2
Ben
I'm on freeBSD without X11, editing the file on OS X through a samba
mount.

I'll google around for attaching a debugger to an Apache process.
Thanks for the direction.

Nov 2 '05 #3
The thing to remember is that you need to attach to a child process
spawned by the Apache as opposed to the original process. Be sure to
adjust your Apache config so it wouldn't spawn some fifty children.
Otherwise it'd be pretty hard to tell which one is handling a given
request.

It's been ages since I last used gdb. Just look in the manpage. Should
tell you what commands to use.

Nov 2 '05 #4
Ben
Thanks a lot. With some help I managed to solve my problem (very
stupid, naturally) before it got to the interactive debugger phrase,
but I'm sure next time I manage to get myself stuck or even next time I
find myself idly investigating I'll give gdb a shot.

Thanks for the tips.

Nov 4 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Peter Sparago | last post by:
(Sorry in advance for the long post.) Hi, I'm having a great deal of difficulty buiding a Python COM extension. I am using the MSHTML ActiveX control in my application but I need to interact...
8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
2
by: Lonnie Princehouse | last post by:
I've been trying to debug this for two days now, and it's a longshot but I'm hoping that someone here might recognize a solution. I've got a C extension which calls a function in a C library,...
10
by: Sona | last post by:
Hi, Could someone please explain what sign-extension means? If I have a hex number 0x55, how does this get sign-extended? Can a sign-extended counterpart be equal to -91? In a program I'm...
1
by: kmslick | last post by:
Hello all. Not sure which group this problem best relates to, so I'm posting to both with a follow up. I started learning C# and .NET last august for a project for my employer. The project...
4
by: Al Norman | last post by:
We have two separate DLLs that do not interact (directly, at least). One is an MFC extension DLL that was built back in VC++ 6 days (but has been recompiled with VS2005). The other is a DLL that...
1
by: Scubadude | last post by:
I am looking for some assistance in 'fine-tuning' my preferences as I set-up my system to learn PHP. I am running Komodo professional, version 3.5.3, build 262321, platform win32-x86. Under...
12
by: colin | last post by:
Hi, Ive got a difference in results depending on wether I run my app in the debugger, or run it seperatly (or with <ctrl-f5>) the results in the debugger seem to be more correct, although the...
7
by: jabarker1 | last post by:
Hey everyone! First thanks to those of you that try and help me with my problem here. Okay, now on to the issue at hand. My setup is as follows: • OS: Ubuntu Gutsy (6.3) • PHP: 5.2.3 as an...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.