[fpc-pascal] Re: How to handle SIGPIPE

2012-03-20 Thread Tobias Giesen
Hi,

I think the biggest issue is that MSG_NOSIGNAL is not defined on MAC OS,
even though it was added a few years (?) ago. When I ported Synapse,
unfortunately I defined it as 0. Now I changed that to $2 and I'm
hoping for the best ...

I also added this to my program, is that correct?

var NewSigRecSigActionRec;
res:Integer;

initialization

  with NewSigRec do begin
Integer(@Sa_Handler):=SIG_IGN; // ignore signal
Sa_Mask[0]:=0;
Sa_Flags:=0;
end;
  res:=fpsigaction(SIGPIPE,@NewSigRec,@OldSigRec);

Cheers,
Tobias


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


Re: [fpc-pascal] Re: How to handle SIGPIPE

2012-03-20 Thread michael . vancanneyt



On Tue, 20 Mar 2012, Tobias Giesen wrote:


Hi,

I think the biggest issue is that MSG_NOSIGNAL is not defined on MAC OS,
even though it was added a few years (?) ago. When I ported Synapse,
unfortunately I defined it as 0. Now I changed that to $2 and I'm
hoping for the best ...

I also added this to my program, is that correct?


At first sight: yes.

Michael.



var NewSigRecSigActionRec;
   res:Integer;

initialization

 with NewSigRec do begin
   Integer(@Sa_Handler):=SIG_IGN; // ignore signal
   Sa_Mask[0]:=0;
   Sa_Flags:=0;
   end;
 res:=fpsigaction(SIGPIPE,@NewSigRec,@OldSigRec);

Cheers,
Tobias


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


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


Re: [fpc-pascal] Re: How to handle SIGPIPE

2012-03-20 Thread Jonas Maebe


On 20 Mar 2012, at 08:41, Tobias Giesen wrote:

I think the biggest issue is that MSG_NOSIGNAL is not defined on MAC  
OS,

even though it was added a few years (?) ago. When I ported Synapse,
unfortunately I defined it as 0. Now I changed that to $2 and I'm
hoping for the best ...


Hoping is not enough when changing random values. See http://bugs.freepascal.org/view.php?id=9401 
 for more info.



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

Re: [fpc-pascal] Re: How to handle SIGPIPE

2012-03-20 Thread Tobias Giesen
> Hoping is not enough when changing random values. 
> See http://bugs.freepascal.org/view.php?id=9401 
> for more info.

Wow. Many thanks!

I read that MSG_NOSIGNAL is now supported by MacOS, too, but I don't
really know.

So now I am calling fpsetsockopt with SO_NOSIGPIPE as the first thing
after every fpSocket call. That should probably do it, right?

The bug comments on the above URL are not totally clear because you
cannot actually pass any options to the Connect call. So I assume
you should use fpsetsockopt before the Connect call.

Cheers,
Tobias


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


[fpc-pascal] SQLdb: problem using GDB, but do not have memleak

2012-03-20 Thread Marcos Douglas
Hi,

I was testing the new connector to MSSQL when I found a problem.
If I compile and run in console, I have no memleak. Good. But if I put
a breakpoint in AConnection.Free; and press F8, I got this:

ERROR
,msg="Warning:\nCannot insert breakpoint -237.\nError accessing memory
address 0x7816cd30: Input/output error.\n"

I don't know if this problem happen just in new connector. I don't
have others DBMS installed here, justo MSSQLServer so, could you test
using another class to connect in other DBMS?

The code below is very simple (see http://wiki.freepascal.org/SqlDBHowto).

program t1;

{$mode objfpc}{$H+}

uses
  heaptrc,
  Classes, SysUtils, DB, sqldb,
  mssqlconn; << change

var
  AConnection : TSQLConnection;

Procedure CreateConnection;
begin
  AConnection := TMSSQLConnection.Create(nil);  << change
  AConnection.Hostname := 'localhost';
  AConnection.DatabaseName := 'database';
  AConnection.UserName := 'user';
  AConnection.Password := '**';
end;

begin
  CreateConnection;
  AConnection.Open;
  if Aconnection.Connected then
writeln('Succesful connect!')
  else
writeln('Error');
  AConnection.Close;
  AConnection.Free;  << breakpoint here
  writeln('done');
end.

My ENV is:
Lazarus 0.9.31 r36175 FPC 2.6.1 i386-win32-win32/win64

FPC
URL: http://svn.freepascal.org/svn/fpc/branches/fixes_2_6
Repository Root: http://svn.freepascal.org/svn/fpc
Repository UUID: 3ad0048d-3df7-0310-abae-a5850022a9f2
Revision: 20521
Node Kind: directory
Schedule: normal
Last Changed Author: marco
Last Changed Rev: 20519
Last Changed Date: 2012-03-15 09:18:24 -0300 (Thu, 15 Mar 2012)

GDB
URL: http://svn.freepascal.org/svn/lazarus/binaries
Repository Root: http://svn.freepascal.org/svn/lazarus
Repository UUID: 4005530d-fff6-0310-9dd1-cebe43e6787f
Revision: 36176
Node Kind: directory
Schedule: normal
Last Changed Author: martin
Last Changed Rev: 32524
Last Changed Date: 2011-09-27 13:23:25 -0300 (Tue, 27 Sep 2011)


Thanks,
Marcos Douglas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] SQLdb: problem using GDB, but do not have memleak

2012-03-20 Thread Martin

On 20/03/2012 12:08, Marcos Douglas wrote:

Hi,

I was testing the new connector to MSSQL when I found a problem.
If I compile and run in console, I have no memleak. Good. But if I put
a breakpoint in AConnection.Free; and press F8, I got this:

ERROR
,msg="Warning:\nCannot insert breakpoint -237.\nError accessing memory
address 0x7816cd30: Input/output error.\n"




A negative breakpoint means internal to gdb (like a breakpoint gdb sets 
for stepping). So when you press F8 gdb apparently can't get the correct 
location where the step should end.


Are you sure your app (and package that has debug info) are compiled:
- with either -O0 or -O1 (no other optimization enabled)
- your app is NOT smartlinked

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


Re: [fpc-pascal] SQLdb: problem using GDB, but do not have memleak

2012-03-20 Thread Marcos Douglas
On Tue, Mar 20, 2012 at 9:34 AM, Martin  wrote:
>
> On 20/03/2012 12:08, Marcos Douglas wrote:
>>
>> Hi,
>>
>> I was testing the new connector to MSSQL when I found a problem.
>> If I compile and run in console, I have no memleak. Good. But if I put
>> a breakpoint in AConnection.Free; and press F8, I got this:
>>
>> ERROR
>> ,msg="Warning:\nCannot insert breakpoint -237.\nError accessing memory
>> address 0x7816cd30: Input/output error.\n"
>>
>>
>
> A negative breakpoint means internal to gdb (like a breakpoint gdb sets
> for stepping). So when you press F8 gdb apparently can't get the correct
> location where the step should end.
>
> Are you sure your app (and package that has debug info) are compiled:
> - with either -O0 or -O1 (no other optimization enabled)
> - your app is NOT smartlinked
>
> wiki.lazarus.freepascal.org/GDB_Debugger_Tips

I compile FPC using these options: UPXPROG=echo COPYTREE=echo OPT="-gl"
My applications, in debbuger mode, always use -O1 option.
I use smartlinked option just for release.

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


Re: [fpc-pascal] SQLdb: problem using GDB, but do not have memleak

2012-03-20 Thread Marcos Douglas
Tem umas opções com o novo GDB >6.5 que parece ser a melhor opção.
Vou recompilar o FPC e Lazarus utilizando:
-gl -gw -godwarfsets

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


Re: [fpc-pascal] SQLdb: problem using GDB, but do not have memleak

2012-03-20 Thread Marcos Douglas
On Tue, Mar 20, 2012 at 9:34 AM, Martin  wrote:
> On 20/03/2012 12:08, Marcos Douglas wrote:
>>
>> Hi,
>>
>> I was testing the new connector to MSSQL when I found a problem.
>> If I compile and run in console, I have no memleak. Good. But if I put
>> a breakpoint in AConnection.Free; and press F8, I got this:
>>
>> ERROR
>> ,msg="Warning:\nCannot insert breakpoint -237.\nError accessing memory
>> address 0x7816cd30: Input/output error.\n"
>>
>>
>
> A negative breakpoint means internal to gdb (like a breakpoint gdb sets for
> stepping). So when you press F8 gdb apparently can't get the correct
> location where the step should end.
>
> Are you sure your app (and package that has debug info) are compiled:
> - with either -O0 or -O1 (no other optimization enabled)
> - your app is NOT smartlinked
>
> wiki.lazarus.freepascal.org/GDB_Debugger_Tips

Martin,
I recompiled FPC and Lazarus using -gl -gw2 -godwarfsets options, but
the problem continues.

Marcos Douglas
PS: Guys, sorry about my mail before. It would be for other list, in Portuguese.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] SQLdb: problem using GDB, but do not have memleak

2012-03-20 Thread Martin

On 20/03/2012 14:08, Marcos Douglas wrote:

On Tue, Mar 20, 2012 at 9:34 AM, Martin  wrote:

On 20/03/2012 12:08, Marcos Douglas wrote:

Hi,

I was testing the new connector to MSSQL when I found a problem.
If I compile and run in console, I have no memleak. Good. But if I put
a breakpoint in AConnection.Free; and press F8, I got this:

ERROR
,msg="Warning:\nCannot insert breakpoint -237.\nError accessing memory
address 0x7816cd30: Input/output error.\n"



A negative breakpoint means internal to gdb (like a breakpoint gdb sets for
stepping). So when you press F8 gdb apparently can't get the correct
location where the step should end.

Are you sure your app (and package that has debug info) are compiled:
- with either -O0 or -O1 (no other optimization enabled)
- your app is NOT smartlinked

wiki.lazarus.freepascal.org/GDB_Debugger_Tips

Martin,
I recompiled FPC and Lazarus using -gl -gw2 -godwarfsets options, but
the problem continues.


I don't know where/why it upsets gdb.

The above will allow you to step into RTL/packages.

It certainly is no error in the app, but a problem in the debug info (or 
what gdb makes of it).


There are 3 possibilities:
1) FPC writes bad debug info. You can try -gs versus -gw (stabs/dwarf).
2) The linker gets it wrong. Try -Xe
3) gdb is buggy. Which version are you on?

Do all lines get a blue dot? (except maybe "else" and empty lines)

---
Where to get mssqlcon ?


As workarounds:
1) Try setting a breakpoint on next command and use F9
2) Single step in assembler window (single step asm instructions)

Did you try to continue, after the error (if you are lucky, it might be 
possible)?



For 64 bit, latest gdb (I have not tested it yet)

http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/rubenvb/4.7.0-3/x86_64-w64-mingw32-gcc-4.7.0-3_rubenvb.7z/download

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


Re: [fpc-pascal] SQLdb: problem using GDB, but do not have memleak

2012-03-20 Thread Marcos Douglas
On Tue, Mar 20, 2012 at 11:36 AM, Martin  wrote:
> On 20/03/2012 14:08, Marcos Douglas wrote:
>>
>> On Tue, Mar 20, 2012 at 9:34 AM, Martin  wrote:
>>>
>>> On 20/03/2012 12:08, Marcos Douglas wrote:

 Hi,

 I was testing the new connector to MSSQL when I found a problem.
 If I compile and run in console, I have no memleak. Good. But if I put
 a breakpoint in AConnection.Free; and press F8, I got this:

 ERROR
 ,msg="Warning:\nCannot insert breakpoint -237.\nError accessing memory
 address 0x7816cd30: Input/output error.\n"


>>> A negative breakpoint means internal to gdb (like a breakpoint gdb sets
>>> for
>>> stepping). So when you press F8 gdb apparently can't get the correct
>>> location where the step should end.
>>>
>>> Are you sure your app (and package that has debug info) are compiled:
>>> - with either -O0 or -O1 (no other optimization enabled)
>>> - your app is NOT smartlinked
>>>
>>> wiki.lazarus.freepascal.org/GDB_Debugger_Tips
>>
>> Martin,
>> I recompiled FPC and Lazarus using -gl -gw2 -godwarfsets options, but
>> the problem continues.
>>
> I don't know where/why it upsets gdb.
>
> The above will allow you to step into RTL/packages.
>
> It certainly is no error in the app, but a problem in the debug info (or
> what gdb makes of it).
>
> There are 3 possibilities:
> 1) FPC writes bad debug info. You can try -gs versus -gw (stabs/dwarf).
> 2) The linker gets it wrong. Try -Xe
> 3) gdb is buggy. Which version are you on?

I use gdb 7.3 (http://svn.freepascal.org/svn/lazarus/binaries/) only in 32 bit.

> Do all lines get a blue dot? (except maybe "else" and empty lines)
>

Definitely yes.

> ---
> Where to get mssqlcon ?
>
> 

In trunk 
http://svn.freepascal.org/svn/fpc/trunk/packages/fcl-db/src/sqldb/mssql/
But I had these sources because I tested for LacaK before merged in FPC sources.

> As workarounds:
> 1) Try setting a breakpoint on next command and use F9
> 2) Single step in assembler window (single step asm instructions)

if I use F9 this problem does not occur.

> Did you try to continue, after the error (if you are lucky, it might be
> possible)?

Yes, I tried.
No is possible to continue and the negative number is going
incrementing two by two.

> 
> For 64 bit, latest gdb (I have not tested it yet)
>
> http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/rubenvb/4.7.0-3/x86_64-w64-mingw32-gcc-4.7.0-3_rubenvb.7z/download
>

I only use 32 bit.

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


Re: [fpc-pascal] SQLdb: problem using GDB, but do not have memleak

2012-03-20 Thread Martin

On 20/03/2012 14:52, Marcos Douglas wrote:

On Tue, Mar 20, 2012 at 11:36 AM, Martin  wrote:

On 20/03/2012 14:08, Marcos Douglas wrote:

On Tue, Mar 20, 2012 at 9:34 AM, Martinwrote:

On 20/03/2012 12:08, Marcos Douglas wrote:

Hi,

I was testing the new connector to MSSQL when I found a problem.
If I compile and run in console, I have no memleak. Good. But if I put
a breakpoint in AConnection.Free; and press F8, I got this:

ERROR
,msg="Warning:\nCannot insert breakpoint -237.\nError accessing memory
address 0x7816cd30: Input/output error.\n"



A negative breakpoint means internal to gdb (like a breakpoint gdb sets
for
stepping). So when you press F8 gdb apparently can't get the correct
location where the step should end.

Are you sure your app (and package that has debug info) are compiled:
- with either -O0 or -O1 (no other optimization enabled)
- your app is NOT smartlinked

wiki.lazarus.freepascal.org/GDB_Debugger_Tips

Martin,
I recompiled FPC and Lazarus using -gl -gw2 -godwarfsets options, but
the problem continues.


I don't know where/why it upsets gdb.

The above will allow you to step into RTL/packages.

It certainly is no error in the app, but a problem in the debug info (or
what gdb makes of it).

There are 3 possibilities:
1) FPC writes bad debug info. You can try -gs versus -gw (stabs/dwarf).
2) The linker gets it wrong. Try -Xe
3) gdb is buggy. Which version are you on?

I use gdb 7.3 (http://svn.freepascal.org/svn/lazarus/binaries/) only in 32 bit.


Do all lines get a blue dot? (except maybe "else" and empty lines)


Definitely yes.


---
Where to get mssqlcon ?



In trunk 
http://svn.freepascal.org/svn/fpc/trunk/packages/fcl-db/src/sqldb/mssql/
But I had these sources because I tested for LacaK before merged in FPC sources.


As workarounds:
1) Try setting a breakpoint on next command and use F9
2) Single step in assembler window (single step asm instructions)

if I use F9 this problem does not occur.


Did you try to continue, after the error (if you are lucky, it might be
possible)?

Yes, I tried.
No is possible to continue and the negative number is going
incrementing two by two.


For any kind of stepping yes.

But does F9 run?
e.g. set your own next breakpoint, and use F9

Or try asm steps

---
Both F8 and F7 mean the debugger must work out the address of the next 
statement (or list of possible next statements)


It seems the debugger gets this address wrong, and therefore it can not 
set the breakpoint.
Breakpoint numbers are not re-used. So that is why each time you see a 
new number.


Positive numbers: breakpoints set by you
Negative: breakpoints internally used by GDB




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


Re: [fpc-pascal] SQLdb: problem using GDB, but do not have memleak

2012-03-20 Thread Jonas Maebe


On 20 Mar 2012, at 14:06, Marcos Douglas wrote:

I compile FPC using these options: UPXPROG=echo COPYTREE=echo OPT="- 
gl"


You should use OPT="-O- -gl" if you want to debug standard FPC units.  
The default for building the entire FPC source tree is -O2.  
Optimizations generally have little effect on the line number  
information though.



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

Re: [fpc-pascal] SQLdb: problem using GDB, but do not have memleak

2012-03-20 Thread Martin

On 20/03/2012 14:52, Marcos Douglas wrote:

ERROR
,msg="Warning:\nCannot insert breakpoint -237.\nError accessing memory
address 0x7816cd30: Input/output error.\n"




I use gdb 7.3 (http://svn.freepascal.org/svn/lazarus/binaries/) only in 32 bit.
I only use 32 bit. 


Interesting.  0x7816cd30

I usually get addresses around 0x040 for 32 bit. It can be changed 
by config. But if you have not... Check witth the disassembler where the 
rest of your code is.


Maybe that address is in a DLL or kernel? It still wouldn't explain why 
gdb would try to set a break there, but maybe why it can not.


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


Re: [fpc-pascal] SQLdb: problem using GDB, but do not have memleak

2012-03-20 Thread Marcos Douglas
On Tue, Mar 20, 2012 at 12:24 PM, Martin  wrote:
> On 20/03/2012 14:52, Marcos Douglas wrote:
>>
>> On Tue, Mar 20, 2012 at 11:36 AM, Martin  wrote:
>>>
>>> On 20/03/2012 14:08, Marcos Douglas wrote:

 On Tue, Mar 20, 2012 at 9:34 AM, Martin    wrote:
>
> On 20/03/2012 12:08, Marcos Douglas wrote:
>>
>> Hi,
>>
>> I was testing the new connector to MSSQL when I found a problem.
>> If I compile and run in console, I have no memleak. Good. But if I put
>> a breakpoint in AConnection.Free; and press F8, I got this:
>>
>> ERROR
>> ,msg="Warning:\nCannot insert breakpoint -237.\nError accessing memory
>> address 0x7816cd30: Input/output error.\n"
>>
>>
> A negative breakpoint means internal to gdb (like a breakpoint gdb sets
> for
> stepping). So when you press F8 gdb apparently can't get the correct
> location where the step should end.
>
> Are you sure your app (and package that has debug info) are compiled:
> - with either -O0 or -O1 (no other optimization enabled)
> - your app is NOT smartlinked
>
> wiki.lazarus.freepascal.org/GDB_Debugger_Tips

 Martin,
 I recompiled FPC and Lazarus using -gl -gw2 -godwarfsets options, but
 the problem continues.

>>> I don't know where/why it upsets gdb.
>>>
>>> The above will allow you to step into RTL/packages.
>>>
>>> It certainly is no error in the app, but a problem in the debug info (or
>>> what gdb makes of it).
>>>
>>> There are 3 possibilities:
>>> 1) FPC writes bad debug info. You can try -gs versus -gw (stabs/dwarf).
>>> 2) The linker gets it wrong. Try -Xe
>>> 3) gdb is buggy. Which version are you on?
>>
>> I use gdb 7.3 (http://svn.freepascal.org/svn/lazarus/binaries/) only in 32
>> bit.
>>
>>> Do all lines get a blue dot? (except maybe "else" and empty lines)
>>>
>> Definitely yes.
>>
>>> ---
>>> Where to get mssqlcon ?
>>>
>>> 
>>
>> In trunk
>> http://svn.freepascal.org/svn/fpc/trunk/packages/fcl-db/src/sqldb/mssql/
>> But I had these sources because I tested for LacaK before merged in FPC
>> sources.
>>
>>> As workarounds:
>>> 1) Try setting a breakpoint on next command and use F9
>>> 2) Single step in assembler window (single step asm instructions)
>>
>> if I use F9 this problem does not occur.
>>
>>> Did you try to continue, after the error (if you are lucky, it might be
>>> possible)?
>>
>> Yes, I tried.
>> No is possible to continue and the negative number is going
>> incrementing two by two.
>
>
> For any kind of stepping yes.
>
> But does F9 run?
> e.g. set your own next breakpoint, and use F9

If I have 2 breakpoint:
Stop on the first... F9;
Stop on the second... F9. no errors.

But, in the second, if I use F8 error.

> Or try asm steps
>
> ---
> Both F8 and F7 mean the debugger must work out the address of the next
> statement (or list of possible next statements)
>
> It seems the debugger gets this address wrong, and therefore it can not set
> the breakpoint.
> Breakpoint numbers are not re-used. So that is why each time you see a new
> number.
>
> Positive numbers: breakpoints set by you
> Negative: breakpoints internally used by GDB

Anyway, thanks for the GDB tips.

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


Re: [fpc-pascal] SQLdb: problem using GDB, but do not have memleak

2012-03-20 Thread Marcos Douglas
On Tue, Mar 20, 2012 at 12:35 PM, Jonas Maebe  wrote:
>
> On 20 Mar 2012, at 14:06, Marcos Douglas wrote:
>
> I compile FPC using these options: UPXPROG=echo COPYTREE=echo OPT="-gl"
>
>
> You should use OPT="-O- -gl" if you want to debug standard FPC units. The
> default for building the entire FPC source tree is -O2. Optimizations
> generally have little effect on the line number information though.

Before I used OPT="-gl" and I already debug FPC units.
I recompiled using OPT="-gl -gw2 -godwarfsets"  after read this link:
wiki.lazarus.freepascal.org/GDB_Debugger_Tips

The OPT="-O- -gl" options are better?

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


Re: [fpc-pascal] SQLdb: problem using GDB, but do not have memleak

2012-03-20 Thread Marcos Douglas
On Tue, Mar 20, 2012 at 1:44 PM, Martin  wrote:
> On 20/03/2012 14:52, Marcos Douglas wrote:
>>>
>>> ERROR
>>> ,msg="Warning:\nCannot insert breakpoint -237.\nError accessing memory
>>> address 0x7816cd30: Input/output error.\n"
>>>
>
>> I use gdb 7.3 (http://svn.freepascal.org/svn/lazarus/binaries/) only in 32
>> bit.
>> I only use 32 bit.
>
>
> Interesting.  0x7816cd30
>
> I usually get addresses around 0x040 for 32 bit. It can be changed by
> config. But if you have not... Check witth the disassembler where the rest
> of your code is.
>
> Maybe that address is in a DLL or kernel? It still wouldn't explain why gdb
> would try to set a break there, but maybe why it can not.

Well, SQLdb uses a DLL to connect. Perhaps a clue?
Although some friends also tested using others drivers and got the same problem.

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


Re: [fpc-pascal] SQLdb: problem using GDB, but do not have memleak

2012-03-20 Thread Martin

On 20/03/2012 12:08, Marcos Douglas wrote:

Hi,

I was testing the new connector to MSSQL when I found a problem.
If I compile and run in console, I have no memleak. Good. But if I put
a breakpoint in AConnection.Free; and press F8, I got this:

ERROR
,msg="Warning:\nCannot insert breakpoint -237.\nError accessing memory
address 0x7816cd30: Input/output error.\n"



Does the issue happen the first time you press F8, or to you have to 
press a 2nd time?


In other words: Is it possble the debugger pauses inside free (possible 
in a dll) and that when you hit F8 then, it can not step, because the 
dll has no debug info?


If in stopped in the DLL, it might still put the green arrow on your 
source => first stack with frame debug info...


Open and watch the stack window.

---
Also open the "debug output" window. Open this one before you start your 
app. Then copy the content.


---
If indeed gdb stops inside a dll, then F8 simply can not work

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