-
Notifications
You must be signed in to change notification settings - Fork 15
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
How to acceess sapi_request_info during profiling? #403
Comments
@lighthuter In that code you first dereferences sapi_request_info.query_string as a pointer to another pointer, and then dereferences the retrieved pointer as a pointer to Char. But actually sapi_request_info.query_string is From what I see, you don't need the |
Hey @sj-i! Thanks for your answer! I tried to do what you explained, but it seems I'm understanding your explanation wrong. Could you please point to what I'm doing wrong here?
Char.php
As a result I would get something like |
@lighthuter Oh, I have overlooked a number of things. You were right about trying to get the pointer value as a 64-bit value first. Currently maybe you use the address of SG as an address of SG(request_info). The offset to the query_string field is
This must start from 0.
You should not rewrite the
I haven't been able to check it properly due to machine trouble, but if it doesn't work, please let me know again! |
Thank you a lot, it worked! |
@sj-i I have another question if you don't mind :) Could you please give a suggestion on how to access $_SERVER values? Basically I'm interested in request URL, but since |
@lighthuter You can read the super globals via The code would be like this.
BTW, you can read |
Hi, @sj-i ! No worries, I really appreciate your help! I tried to use the code you provided but unfortunately, I get an error |
@lighthuter
This code pulls a Bucket from the hash table, but as it is only used as a temporary object, the Bucket object is immediately freed with the corresponding internal We have to keep the reference to the Bucket until we pull its value.
Also, I've found a bug in the implementation of Be aware that |
@sj-i , thanks, this works! I have a question though. While debugging my changes, I've found out that there are a ton of errors like
Is this expected? |
@lighthuter Hi! If you use Reli without stopping the target process via The state of the target process continues to change while Reli is reading its memory, which can naturally lead to inconsistencies in the memory contents being read. Reli is a follower of phpspy. And phpspy itself is a follower of rbspy. This same behavior is the default of both phpspy and old rbspy. But honestly, I rarely use Reli without |
@sj-i I see, thanks for the explanation! I tried with |
@lighthuter Hmm, then there should not be so much. Is it possible to give me simple reproduction steps? If so, please open another issue as a bug report. |
I want to access request query params during profiling to implement trigger functionality similar to the xDebug one. I'm trying to access
sapi_request_info.query_string
to do this. I tried to create new "intptr_t" and "char" types and combine them with Pointer::indexedAt(), but as a result I get some random charactersExample
Is it possible to do something like this?
The text was updated successfully, but these errors were encountered: