Forum > Debugger
"-stack-list-arguments 1 0 2" did not return any resul
Martin_fr:
--- Quote ---Lazarus 1.8.4, so FPC 3.0.4
I try all type of debug info (early "Any changes to the "Debugging" tab in the project option").
--- End quote ---
This still leaves packages compiled with other debug info.
Using "Additions and Overrides" you can set options for all packages. (Or change it for the package in which the breakpoint is, including 2 level of callers)
I uploaded 8.1 for 64 bit https://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2064%20bits/Alternative%20GDB/
But I doubt it will make a difference.
--- Quote ---What is arguments for -stack-list ?
--- End quote ---
https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Stack-Manipulation.html
-stack-list-arguments 1 0 2
request names and values (1) of arguments (function parameters) for frames 0 to 2.
-------
Do you have any "large" values as parameters (or (maybe) even local vars)?
e.g pointer to array[0..maxint] of foo
I know sometimes types like this are used with memalloc, so there never is on array this size. But GDB will try to alloc that memory.
There are settings in Lazarus trunk, to tell gdb otherwise
You may try and go to the debugger options and in the field "debugger_startup_options" enter:
--eval-command="set max-value-size 50000"
------------
What is the output (last couple of lines) in Menu: View > Debugger > Debug Output?
I am afraid , but it is gonna be a bit of a guessing game, since the error is in gdb.
Martin_fr:
--- Quote from: Thaddy on July 10, 2018, 04:30:02 pm ---"shamanism" :D I agree.
Anyway, although -O2 should be very friendly to GDB can you still debug in = -01? It is not my (main) platform, but I can try tomorrow.
--- End quote ---
You will get errors even with -O1.
For line info, and breakpoints it hardly makes a difference (as long as no inlining happens).
But values are affected.
Afaik -O1 activates the peep hole optimizer. This prevents in rare cases that a variable is written back to memory in the current statement. The write back will instead happen one statement later. Therefore the value will be wrongly displayed for the duration of one statement.
-O2 will have more side effects.
This may also be why there was no crash with O2. GDB did not see the value that crashed it.
ASerge:
--- Quote from: Martin_fr on July 10, 2018, 04:44:01 pm ---This still leaves packages compiled with other debug info.
Using "Additions and Overrides" you can set options for all packages. (Or change it for the package in which the breakpoint is, including 2 level of callers)
--- End quote ---
A very simple project without any packages. I attached it to the message.
--- Quote ---I uploaded 8.1 for 64 bit https://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2064%20bits/Alternative%20GDB/
But I doubt it will make a difference.
--- End quote ---
Yes, you're right, no change.
--- Quote ---You may try and go to the debugger options and in the field "debugger_startup_options" enter:
--eval-command="set max-value-size 50000"
--- End quote ---
No changes
--- Quote ---What is the output (last couple of lines) in Menu: View > Debugger > Debug Output?
--- End quote ---
I finally the compared logs in normal case and erroneous. This is similar to GDB failing when trying to get a value from a complex structure variable if its value is not yet defined (out parameter).
Wait, wait... Yes!!!! After the next code rewriting, the debugger always works.
I decided to rewrite FmtBCD. I really don't like the current code. In the nested module, I debugged TryStrToBCD. A breakpoint on the first line of procedure and led to the debugger stop.
Project is very simple, init included.
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---program Project1;{$MODE OBJFPC}{$APPTYPE CONSOLE} uses FmtBcdNew; var V: TBCD; S: FmtBCDStringType = '12.34E5';begin if TryStrToBCD(S, V) then Writeln('OK'); Readln;end.
Martin_fr:
I can reproduce it with different gdb versions (haven't tried 32 bit yet).
Anyway debugging gdb itself is not currently something I have time to put on my list...
Btw, If you go for Lazarus trunk, you may want to try LazDebuggerFp
Thaddy:
--- Quote from: Martin_fr on July 10, 2018, 06:12:14 pm ---I can reproduce it with different gdb versions (haven't tried 32 bit yet).
Anyway debugging gdb itself is not currently something I have time to put on my list...
Btw, If you go for Lazarus trunk, you may want to try LazDebuggerFp
--- End quote ---
Can you give us what gdb version? <smile> Keeps people from their normal work....
Navigation
[0] Message Index
[#] Next page
[*] Previous page