473,569 Members | 2,593 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2212

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
2677
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 with and implement some Custom COM interfaces. All is well with the basic operation of the control using Python. Basically, I want to take over...
8
5459
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 -------------------------------------------------------------------------------- Hello, I have a very simple problem but cannot seem to figure it out. I have a very simple php script that sends a test email to myself. When I...
2
1794
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, which calls another function in another library, which calls another function, which calls fmod from the standard C math library. All of these are...
10
17823
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 expecting 0x55 in return from a function whereas I am getting -91 every time.. does this mean anything? Thanks Sona
1
1740
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 involved extending explorer by creating a context-menu extension and allow certain actions to be performed on certain files. I was able to get that up...
4
5790
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 contains .Net functions wrapped in C++ (as described by Paul DiLascia -- see http://msdn.microsoft.com/msdnmag/issues/06/06/CAtWork/default.aspx)....
1
2216
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 Preferences/Language/PHP in debugger configuration, I am getting the following error message: WARNING! PHP is not configured for debugging. You can...
12
1594
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 app isnt finished and theres still a lot of things it gets wrong. the processing is so complex its hard to determine where the difference can be...
7
3233
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 Apache2 handler. Okay, I've intalled the APD extension by pecl install apd and also by
0
7700
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7676
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7974
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6284
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5219
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3642
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.