On 05/23/2017 06:07 PM, Tobias Boege wrote:
> On Tue, 23 May 2017, T Lee Davidson wrote:
>> Hello folks,
>>
>> I am trying to see if gb.debug will help me diagnose why HttpClient does not 
>> properly expose redirect response codes on my
>> system (and reportedly Tobi's system) while it does so correctly on Benoît's 
>> system.
>>
>> However, the documentation for gb.debug is so sparse that I am having to 
>> experiment and, of course, having a problem.
>>
>> With the following command-line application code (using the gb.debug 
>> component):
>> ' Gambas module file
>>
>> Public Sub Main()
>>
>>     Dim sName As String
>>
>>     sName = Debug.Begin()
>>     Print sName
>>     Debug.Start ' Unable to open fifo
>>     Debug.Write("Hello world")
>>     Debug.Stop
>>     Debug.End
>>
>> End
>>
>> Public Sub Debug_Read(Data As String)
>>
>>     Print Data
>>
>> End
>> ' End Gambas module file
>>
>> Debug.Start causes an exception: "Unable to open fifo". By looking in 
>> /tmp/gambas.1000/, I can see that the process id input and
>> output pipes are successfully created with the correct file mode permissions 
>> (600) for my user as owner. But, the Start
>> procedure apparently cannot open the output fifo (ref.
>> https://sourceforge.net/p/gambas/code/HEAD/tree/gambas/trunk/main/lib/debug/CDebug.c).
>>
>> Am I attempting to use this component incorrectly?
>>
> 
> I think you're attempting to use the wrong component. gb.debug is meant for
> the Gambas IDE to debug a Gambas project. You can look at the source code of
> the IDE to try to figure out how to use it. I don't understand its protocol
> at all. My wild guess is that your error comes from not having started the
> application in debug mode (gbx3 -g)?
> 
> In any case, I doubt debugging your *Gambas* code will give you any insight
> into the gb.net.curl issue, as gb.net.curl and curl itself are not written
> in Gambas.
> 
> Regards,
> Tobi
> 

Thank you for your response, Tobi.

I was actually running the application from within the IDE. Making an 
executable and then executing that with "gbx3 -g" resulted in:
Welcome to the Gambas debugger.
*[15488]                ?

followed by the greater-than symbol (>) which is obviously an input prompt. 
"OK, now what?" (Since I find no documentation 
for gbx3.)

Typing "help" at the prompt gave, "W       Unknown command: help". Hmmm ... 
maybe "step"? Ooo, that does something:

> step
*[15488]                Main.Main.7     sName   S: s:
> step
*[15488]                Main.Main.8     sName   S: s: 

> step
15488 

*[15488]                Main.Main.9     sName   S: s: 

> step
*[15488]        Unable to open fifo     Main.Main.9     sName   S: s:

And I discovered that there is a "quit" command that works too.

Given that Debug.Begin creates pipe files named according to the current 
process' ID (PID) and that the IDE and the executable 
would always have different PIDs, I cannot fathom how the two could "talk". Nor 
do I, at this point, have any clue whatsoever 
how the gb.debug component is intended to be used.

I was hoping it might give me access to the running properties of the 
HttpClient object. But, I am not going to spend any more 
time on this groping in the dark. I'll just have to look in a different 
direction, or wait until the issue somehow magically 
fixes itself.


-- 
Lee

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to