Re: [fpc-pascal] Re: timer_create on linux

2011-08-10 Thread Max Vlasov
On Wed, Aug 10, 2011 at 7:28 PM, Helmut Hartl wrote:

> Am 10.08.11 16:56, schrieb Max Vlasov:
>
>  Jonas, I see that you probably have your reasons not to use gdb inside the
>> lazarus, but it was quite decent for me until this strange unavoidable
>> moment :) It still is, hope I will find a work around
>>
>> Max
>>
>
> Max,
>
> This works (for me)
>
> 1) Add a file like :
> /Users/helly/fos_buildsys/**gdbinit
>
> 2) Content of file is:
> handle SIGUSR1 pass noprint nostop
>
> 3) Add in Lazarus at
>
> Debuger_Startup_Options :  --command /Users/helly/fos_buildsys/**gdbinit
>
> 4) Depending on lazarus version -> Reset Debugger via Menu / or restart
>
> ---
>
> I use this to ignore signals, and it works here. (afair under linux/freebsd
> the same way)
> I debug a multithreaded server  hith kevent/kqueue waiting on the signals.
> (hup,kill,usr1,int) in a commandline daemon.
> I am on OSX Lion, fpc 2.5.1 trunk (2 weeks ago) lazarus trunk (2-3 weeks)
> ago.
>
>
Helmut, worked like magic! Thanks :)
In case Graeme see this post (he hates over-quoting desperately), I
intentionally did not cut the quote to make this useful information exist
twice everywhere ;)

Max
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Re: timer_create on linux

2011-08-10 Thread Helmut Hartl

Am 10.08.11 16:56, schrieb Max Vlasov:
Jonas, I see that you probably have your reasons not to use gdb inside 
the lazarus, but it was quite decent for me until this strange 
unavoidable moment :) It still is, hope I will find a work around


Max


Max,

This works (for me)

1) Add a file like :
/Users/helly/fos_buildsys/gdbinit

2) Content of file is:
handle SIGUSR1 pass noprint nostop

3) Add in Lazarus at

Debuger_Startup_Options :  --command /Users/helly/fos_buildsys/gdbinit

4) Depending on lazarus version -> Reset Debugger via Menu / or restart

---

I use this to ignore signals, and it works here. (afair under 
linux/freebsd the same way)
I debug a multithreaded server  hith kevent/kqueue waiting on the 
signals. (hup,kill,usr1,int) in a commandline daemon.
I am on OSX Lion, fpc 2.5.1 trunk (2 weeks ago) lazarus trunk (2-3 
weeks) ago.


helmut


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: timer_create on linux

2011-08-10 Thread Max Vlasov
On Wed, Aug 10, 2011 at 6:20 PM, Jonas Maebe wrote:

>
> On 10 Aug 2011, at 16:12, Max Vlasov wrote:
>
>  SIG35 behaves the same. Strangely, I looked in system monitor for gdb
>> command-line, it looked ok
>>
>> /usr/bin/gdb -silent -i mi -nx --eval-command="handle SIG35 nostop noprint
>> pass"
>>
>> but after the same Initialization output dialog it still stops with
>> "External:SIG35"
>> Actually looking at the -i mi options, I see it's machine interface with
>> all
>> these escaping sequences, so probably lazarus didn't undestand something,
>> but it's strange it still stops
>>
>
> Most commands are different in the machine interface. "handle SIG35 nostop
> noprint pass" is probably only valid when using the default interface. I
> don't know what the MI equivalent is.
>
>
>
If I invoke the same full line in the terminal the output

$ /usr/bin/gdb -silent -i mi -nx --eval-command="handle SIG35 nostop noprint
pass"

=thread-group-added,id="i1"
~"SignalStop\tPrint\tPass to program\tDescription\n"
~"SIG35 No\tNo\tYes\t\tReal-time event 35\n"

So looks like (Stop = No) gdb got the command.
Jonas, I see that you probably have your reasons not to use gdb inside the
lazarus, but it was quite decent for me until this strange unavoidable
moment :) It still is, hope I will find a work around

Max
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Re: timer_create on linux

2011-08-10 Thread Jonas Maebe


On 10 Aug 2011, at 16:12, Max Vlasov wrote:


SIG35 behaves the same. Strangely, I looked in system monitor for gdb
command-line, it looked ok

/usr/bin/gdb -silent -i mi -nx --eval-command="handle SIG35 nostop  
noprint

pass"

but after the same Initialization output dialog it still stops with
"External:SIG35"
Actually looking at the -i mi options, I see it's machine interface  
with all
these escaping sequences, so probably lazarus didn't undestand  
something,

but it's strange it still stops


Most commands are different in the machine interface. "handle SIG35  
nostop noprint pass" is probably only valid when using the default  
interface. I don't know what the MI equivalent is.



Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: timer_create on linux

2011-08-10 Thread Max Vlasov
On Wed, Aug 10, 2011 at 5:43 PM, Jonas Maebe wrote:

>
>
> I tried adding
>> --eval-command="handle SIGUSR1 nostop noprint pass"
>>
>
> While this won't solve your problem, as Michael said you should not use
> SIGUSR1 because it's probably already used by the system.
>
>

SIG35 behaves the same. Strangely, I looked in system monitor for gdb
command-line, it looked ok

/usr/bin/gdb -silent -i mi -nx --eval-command="handle SIG35 nostop noprint
pass"

but after the same Initialization output dialog it still stops with
"External:SIG35"
Actually looking at the -i mi options, I see it's machine interface with all
these escaping sequences, so probably lazarus didn't undestand something,
but it's strange it still stops

Thanks anyway

Max
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Re: timer_create on linux

2011-08-10 Thread Jonas Maebe


On 10 Aug 2011, at 15:32, Max Vlasov wrote:

On Wed, Aug 10, 2011 at 4:34 PM, Jonas Maebe >wrote:



Can I somehow tell it to
ignore some, for example 'SIG35'? I tried to add it to Language  
exceptions
ignore list as 'External: SIG35', 'External:SIG35' (without  
space), SIG35.

Nothing helped.


handle SIG35 nostop noprint pass


Jonas, where am I supposed to add this options?


That's what you can enter on the gdb console after you start it from  
the command line. I've never debugged using Lazarus, so I can't help  
with that.



I tried adding
--eval-command="handle SIGUSR1 nostop noprint pass"


While this won't solve your problem, as Michael said you should not  
use SIGUSR1 because it's probably already used by the system.



Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: timer_create on linux

2011-08-10 Thread Max Vlasov
On Wed, Aug 10, 2011 at 4:34 PM, Jonas Maebe wrote:

>
>
> Can I somehow tell it to
>> ignore some, for example 'SIG35'? I tried to add it to Language exceptions
>> ignore list as 'External: SIG35', 'External:SIG35' (without space), SIG35.
>> Nothing helped.
>>
>
> handle SIG35 nostop noprint pass
>
>
>
Jonas, where am I supposed to add this options?

I tried adding
--eval-command="handle SIGUSR1 nostop noprint pass"
to
Debugger_Startup_Options

but that didn't help. Actually nothing happened until I restarted the IDE.
After the restart the first run showed
---
Initialization output:
&"Undefined command:\"\".Try \"help\".\n"
--

To ensure the string is correct I tried
gdb --eval-command="handle SIGUSR1 nostop noprint pass"
from terminal and it worked.
Is it possible that some procedure makes c-style string translation (" ->
\") while actually it isn't necessary here?

Max
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Re: timer_create on linux

2011-08-10 Thread Jonas Maebe


On 10 Aug 2011, at 14:24, Max Vlasov wrote:

On Wed, Aug 10, 2011 at 1:18 PM, Max Vlasov   
wrote:


I tried to implement linux timer with timer_create and signals, but  
an

exception always fired (External:SIGUSR1).

Hmm, it seems that it's not a 'wrong' exception, I executed the same  
program
from console and it worked. So there's a range of signals that is  
'wrong'

for the debugger/ide and it stops catching them.


It's not considered as "wrong" by gdb. By default it simply catches  
all signals. If you type "cont" at that point, the program will  
continue execution and the signal will be delivered to the program.



Can I somehow tell it to
ignore some, for example 'SIG35'? I tried to add it to Language  
exceptions
ignore list as 'External: SIG35', 'External:SIG35' (without space),  
SIG35.

Nothing helped.


handle SIG35 nostop noprint pass


Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal