<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<br>
Le 26/04/2012 14:30, Martin a écrit :
<blockquote cite="mid:4F993FCE.4080701@mfriebe.de" type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<br>
GDB (used by lazarus) reports breakpoint "-20". The minus
indicates, it is a breakpoint internally handled by gdb (as
opposed to a breakpoint set by the IDE, at a location given by the
IDE).<br>
GDB uses such breakpoints for single stepping. A "pascal
instructions" spans over several asm instr. If the ide sends
"-step-over" (single step) the debugger finds all possible end
locations and set breakpoints (e.g. an if has 2 locations)<br>
<br>
So unfortunately the IDE has no influence on this breakpoint. It
also means it can neither be fixed, nor worked-around in the IDE.
It might be FPC or GDB.<br>
<br>
The only work around, is to open the asm window and use single
assembler step (you can also assign that do a key combo).<br>
Another work around is "run to cursor" (usually F4)<br>
<br>
If you upgraded, please ensure that the config point to the latest
gdb (7.3 should be installed / but you can load 7.4 from mingw)<br>
<br>
----<br>
You specify "Lazarus 1.1 win32" So I assume you do run it on a 32
bit cpu?</blockquote>
Yes, Vista<br>
<blockquote cite="mid:4F993FCE.4080701@mfriebe.de" type="cite"> Or
do you (perfectly ok) run 32bit code on a 64 bit cpu?<br>
</blockquote>
not yet but it is planned in a very near future<br>
<blockquote cite="mid:4F993FCE.4080701@mfriebe.de" type="cite"> <br>
Reason I ask is the address 0x726447b8.<br>
On 32 bit cpu, and unless you did anything special, your app would
be expected to be at addresses like 0x040####### or 0x041#######.<br>
<br>
So on 32 bit cpu this looks like it points to some loaded dll, or
the kernel itself.<br>
<br>
----<br>
The first step is to make sure it is not a configuration issue.
For your project, and for any package that has debug info (any
switch containing -g...) ensure.<br>
- There is no optimization (except -O1)<br>
</blockquote>
Level 0<br>
<blockquote cite="mid:4F993FCE.4080701@mfriebe.de" type="cite">
If you specify options in the build lazarus dialog, then use -O-1<br>
- There is no smart linking (only needs to be checked in the
project)<br>
</blockquote>
no<br>
<blockquote cite="mid:4F993FCE.4080701@mfriebe.de" type="cite"> <br>
---- <br>
Question time ( I can not promise that this will lead to
anything)<br>
<br>
Does the issue happen when stepping in a unit of your project? Or
a unit of a package?<br>
</blockquote>
in a project unit (with a TForm, the main form actually). But there
is funny thing: after having step over (with breakpoints) some cxode
of another unit (the code under the line wDBDef :=
TDataBaseDef.Create(1); ) I recover the step-by-step debugging <span
class="moz-smiley-s8"><span> =-O </span></span> but I have
to execute at least some code in another unit begore gdb records its
walking path. Unfortunately this behaviour appears to be
unpredictable and can happen anywhere in the code. Please note that
with a FPCunit test application the recovery never happens<br>
<blockquote cite="mid:4F993FCE.4080701@mfriebe.de" type="cite"> <br>
Is it just on one or 2 lines, a block of lines, all lines of the
unit, several units?<br>
</blockquote>
one single line<br>
<blockquote cite="mid:4F993FCE.4080701@mfriebe.de" type="cite"> If
only some lines. Are those lines enclosed by try-except/finally
blocks (nested try blocks)?<br>
</blockquote>
no, have a look at tne code below<br>
<blockquote cite="mid:4F993FCE.4080701@mfriebe.de" type="cite"> <br>
Do you compile with "stabs" (automatic) or " dwarf" (dwarf2 or
dwarf+sets / NEVER dwarf3) (see linking tab of project/package
option)?<br>
</blockquote>
automatic<br>
<blockquote cite="mid:4F993FCE.4080701@mfriebe.de" type="cite"> <br>
What happens if you change this (project + package that contains
the unit in question)?<br>
</blockquote>
Nothing but as usual. Changing to another project (console
application) debug, step debug and break points work OK. Coming back
to this project, debugger does not work step by step again.<br>
<blockquote cite="mid:4F993FCE.4080701@mfriebe.de" type="cite"> <br>
Can you attach the source of the procedure in question (or at
least some lines of it) AND the assembler (from asm debug win) for
the line in question and at least the 2 surrounding lines?<br>
</blockquote>
... blablabla ...<br>
procedure TForm1.<b><big>BtnOutLoadClick</big></b>(Sender: TObject);<br>
var<br>
wDBDef: TDataBaseDef;<br>
begin<br>
// simulate main thread execution to load the criteria<br>
wDBDef := TDataBaseDef.Create(1); <--------------------------
IDE break point<br>
try<br>
wDBDef.Separator := ';;';<br>
wDBDef.Definition := EOutDbDefinition.Lines.Text;<br>
Data.LoadDatabaseOutputCriteria(wDBDef);<br>
Data.FilesDir := 'D:\Synchro\Logs';<br>
Data.FilesDir2 := EmptyStr;<br>
Data.FDBThreadPriority := tpNormal;<br>
Data.FDBThreadLoopDelay := 1000;<br>
finally<br>
FreeAndNil(wDBDef)<br>
end;<br>
end;<br>
<br>
procedure TForm1.<b><big>BtnInLoadClick(</big></b>Sender: TObject);<br>
begin <br>
... blablabla ...<br>
<br>
<blockquote cite="mid:4F993FCE.4080701@mfriebe.de" type="cite"> <br>
If you open the assembler win, it has an edit/input on top. Enter
the address. Does it show any info (that is any function name)? <br>
</blockquote>
ASM:<br>
TFORM1__<big><b>BTNOUTLOADCLICK</b></big> <br>
00427BD0 55 push %ebp<br>
00427BD1 89e5 mov %esp,%ebp<br>
00427BD3 83ec68 sub $0x68,%esp<br>
00427BD6 895d98 mov %ebx,-0x68(%ebp)<br>
00427BD9 89759c mov %esi,-0x64(%ebp)<br>
00427BDC 8945f8 mov %eax,-0x8(%ebp)<br>
00427BDF 8955fc mov %edx,-0x4(%ebp)<br>
00427BE2 c745a000000000 movl $0x0,-0x60(%ebp)<br>
00427BE9 8d4de8 lea -0x18(%ebp),%ecx<br>
00427BEC 8d55d0 lea -0x30(%ebp),%edx<br>
00427BEF b801000000 mov $0x1,%eax<br>
00427BF4 e88740feff call 0x40bc80
<fpc_pushexceptaddr><br>
00427BF9 e8c261feff call 0x40ddc0 <fpc_setjmp><br>
00427BFE 50 push %eax<br>
00427BFF 85c0 test %eax,%eax<br>
00427C01 0f8514010000 jne 0x427d1b
<TFORM1__BTNOUTLOADCLICK+331><br>
00427C07 baf0716300 mov $0x6371f0,%edx<br>
00427C0C b901000000 mov $0x1,%ecx<br>
00427C11 b800000000 mov $0x0,%eax<br>
00427C16 e855160000 call 0x429270
<TDATABASEDEF__CREATE><br>
00427C1B 8945f4 mov %eax,-0xc(%ebp)<br>
00427C1E 8d4dc0 lea -0x40(%ebp),%ecx<br>
00427C21 8d55a8 lea -0x58(%ebp),%edx<br>
00427C24 b801000000 mov $0x1,%eax<br>
00427C29 e85240feff call 0x40bc80
<fpc_pushexceptaddr><br>
00427C2E e88d61feff call 0x40ddc0 <fpc_setjmp><br>
00427C33 50 push %eax<br>
00427C34 85c0 test %eax,%eax<br>
00427C36 0f85c3000000 jne 0x427cff
<TFORM1__BTNOUTLOADCLICK+303><br>
00427C3C bef86a6300 mov $0x636af8,%esi<br>
00427C41 8b5df4 mov -0xc(%ebp),%ebx<br>
00427C44 8d4320 lea 0x20(%ebx),%eax<br>
00427C47 e804c2fdff call 0x403e50
<fpc_ansistr_decr_ref><br>
00427C4C 897320 mov %esi,0x20(%ebx)<br>
00427C4F 8d45a0 lea -0x60(%ebp),%eax<br>
00427C52 e8f9c1fdff call 0x403e50
<fpc_ansistr_decr_ref><br>
00427C57 c745a000000000 movl $0x0,-0x60(%ebp)<br>
00427C5E 8b45f8 mov -0x8(%ebp),%eax<br>
00427C61 8b80a4040000 mov 0x4a4(%eax),%eax<br>
00427C67 8b8078030000 mov 0x378(%eax),%eax<br>
00427C6D 8d55a0 lea -0x60(%ebp),%edx<br>
00427C70 8b4df8 mov -0x8(%ebp),%ecx<br>
00427C73 8b89a4040000 mov 0x4a4(%ecx),%ecx<br>
00427C79 8b8978030000 mov 0x378(%ecx),%ecx<br>
00427C7F 8b09 mov (%ecx),%ecx<br>
00427C81 ff9188000000 call *0x88(%ecx)<br>
00427C87 8b55a0 mov -0x60(%ebp),%edx<br>
00427C8A 8b45f4 mov -0xc(%ebp),%eax<br>
00427C8D e88e180000 call 0x429520
<TDATABASEDEF__SETDEFINITION><br>
00427C92 8b45f8 mov -0x8(%ebp),%eax<br>
00427C95 8b80b4040000 mov 0x4b4(%eax),%eax<br>
00427C9B 8b55f4 mov -0xc(%ebp),%edx<br>
00427C9E e87d240000 call 0x42a120
<TSYNCFLATLOADMAINTHREADDATA__LOADDATABASEOUTPUTCRITERIA><br>
00427CA3 bb046b6300 mov $0x636b04,%ebx<br>
00427CA8 8b45f8 mov -0x8(%ebp),%eax<br>
00427CAB 8bb0b4040000 mov 0x4b4(%eax),%esi<br>
00427CB1 8d465c lea 0x5c(%esi),%eax<br>
00427CB4 e897c1fdff call 0x403e50
<fpc_ansistr_decr_ref><br>
00427CB9 895e5c mov %ebx,0x5c(%esi)<br>
00427CBC a1d0946300 mov 0x6394d0,%eax<br>
00427CC1 e81af8fdff call 0x4074e0
<fpc_ansistr_incr_ref><br>
00427CC6 8b45f8 mov -0x8(%ebp),%eax<br>
00427CC9 8b98b4040000 mov 0x4b4(%eax),%ebx<br>
00427CCF 8d4360 lea 0x60(%ebx),%eax<br>
00427CD2 e879c1fdff call 0x403e50
<fpc_ansistr_decr_ref><br>
00427CD7 a1d0946300 mov 0x6394d0,%eax<br>
00427CDC 894360 mov %eax,0x60(%ebx)<br>
00427CDF 8b mov -0x8(%ebp),%eax<br>
00427CE2 8b80b4040000 mov 0x4b4(%eax),%eax<br>
00427CE8 c7405003000000 movl $0x3,0x50(%eax)<br>
00427CEF 8b45f8 mov -0x8(%ebp),%eax<br>
00427CF2 8b80b4040000 mov 0x4b4(%eax),%eax<br>
00427CF8 c74054e8030000 movl $0x3e8,0x54(%eax)<br>
00427CFF e84c42feff call 0x40bf50
<fpc_popaddrstack><br>
00427D04 8d45f4 lea -0xc(%ebp),%eax<br>
00427D07 e854dd0000 call 0x435a60
<SYSUTILS_FREEANDNIL$formal><br>
00427D0C 58 pop %eax<br>
00427D0D 85c0 test %eax,%eax<br>
00427D0F 740a je 0x427d1b
<TFORM1__BTNOUTLOADCLICK+331><br>
00427D11 48 dec %eax<br>
00427D12 85c0 test %eax,%eax<br>
00427D14 74 je 0x427d16
<TFORM1__BTNOUTLOADCLICK+326><br>
00427D16 e8a543feff call 0x40c0c0
<fpc_reraise><br>
00427D1B e83042feff call 0x40bf50
<fpc_popaddrstack><br>
00427D20 8d45a0 lea -0x60(%ebp),%eax<br>
00427D23 e828c1fdff call 0x403e50
<fpc_ansistr_decr_ref><br>
00427D28 c745a000000000 movl $0x0,-0x60(%ebp)<br>
00427D2F 58 pop %eax<br>
00427D30 85c0 test %eax,%eax<br>
00427D32 7405 je 0x427d39
<TFORM1__BTNOUTLOADCLICK+361><br>
00427D34 e88743feff call 0x40c0c0
<fpc_reraise><br>
00427D39 8b5d98 mov -0x68(%ebp),%ebx<br>
00427D3C 8b759c mov -0x64(%ebp),%esi<br>
00427D3F c9 leave <br>
00427D40 c3 ret <br>
00427D41 0000 add %al,(%eax)<br>
00427D43 0000 add %al,(%eax)<br>
00427D45 0000 add %al,(%eax)<br>
00427D47 0000 add %al,(%eax)<br>
00427D49 0000 add %al,(%eax)<br>
00427D4B 0000 add %al,(%eax)<br>
00427D4D 0000 add %al,(%eax)<br>
00427D4F 00 add %dl,-0x77(%ebp)<br>
TFORM1__<b><big>BTNINLOADCLICK <br>
</big></b>... blablabla ...<br>
<br>
at address 0x726447b8 seems rubbish<br>
<br>
00000000 ......<br>
00000000 ......<br>
00000000 ......<br>
00000000 ......<br>
00000000 ......<br>
00000000 ......<br>
00000000 ......<br>
00000000 ......<br>
00000000 ......<br>
00000000 ......<br>
00000000 ......<br>
72644518 <error><br>
00000000 ......<br>
00000000 ......<br>
00000000 ......<br>
00000000 ......<br>
00000000 ......<br>
00000000 ......<br>
00000000 ......<br>
00000000 ......<br>
<br>
<blockquote cite="mid:4F993FCE.4080701@mfriebe.de" type="cite"> <br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">--
_______________________________________________
Lazarus mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Lazarus@lists.lazarus.freepascal.org">Lazarus@lists.lazarus.freepascal.org</a>
<a class="moz-txt-link-freetext" href="http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus">http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus</a>
</pre>
</blockquote>
</body>
</html>