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

Marcos Douglas md at delfire.net
Tue Mar 20 15:52:30 CET 2012


On Tue, Mar 20, 2012 at 11:36 AM, Martin <lazarus at mfriebe.de> wrote:
> On 20/03/2012 14:08, Marcos Douglas wrote:
>>
>> On Tue, Mar 20, 2012 at 9:34 AM, Martin<lazarus at mfriebe.de>  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



More information about the fpc-pascal mailing list