Cannot find bounds of current function error lazarus / 12-Debugger ---------------------------------------------------------------------- KMagic · 2014-01-26 13:54 Hi everyone, I wanted to check the value of the variables in each step in my short program, so I opened the watch list and added a variable just like this: http://postimg.org/image/ps7marvlp/    Then I press F7, but this error message appeared:http://postimg.org/image/4jtxtch4t/     When I clicked OK, the Assembler appeared, which I didn't expect: http://postimg.org/image/gvwu6u4zh/   Next, I ignored it then continued pressing F7. This windows appeared: http://postimg.org/image/uaf7fnfbf/   Can anyone help me with this problem? ---------------------------------------------------------------------- Martin_fr · 2014-01-26 14:17 Try to set a breakpoint on the first line of the main code, then press F9. Once the breakpoint is reached, you can use F7/F8 to step. When the application is started directly with F7/F8 it steps into internal code, and that does not work (it's a bug, and someday will get fixed) ---------------------------------------------------------------------- KMagic · 2014-01-26 16:36 Thank you for replying to my thread. However, I still encounter this problem.   When I set a break point and press F9 as you said, the program stopped at the beginning, which is normal: http://postimg.org/image/debaw85rl/  When I closed the black window and pressed F7, the error message appeared again: http://postimg.org/image/yp8v0hnw1/ ---------------------------------------------------------------------- Martin_fr · 2014-01-26 18:11 The black window is the console of your app. When you CLOSE it, you kill your app. Then there is nothing to be debugged. Make sure your setup is correct: http://wiki.lazarus.freepascal.org/Debugger_Setup ---- When you have the breakpoint, and did press F9, and the app starts; Then when the breakpoint is hit: - the IDE should come to the foreground - a green arrow should be on the red dot of the breakpoint Is that the case? ------ Are you using 32 or 64 bit windows? ---------------------------------------------------------------------- KMagic · 2014-01-27 07:18 Yes. I use 32 bit windows. ---------------------------------------------------------------------- KMagic · 2014-01-28 10:41 can you tell me what to do next? ---------------------------------------------------------------------- BigChimp · 2014-01-28 11:26 Please answer all of Martin's question instead of just some. ---------------------------------------------------------------------- KMagic · 2014-01-28 16:21 My setup is correct and everything happened as you said. ---------------------------------------------------------------------- Martin_fr · 2014-01-28 17:16 Quote from: KMagic on January 28, 2014, 05:21:38 pmMy setup is correct and everything happened as you said. 1) So you do close the black window? Then that is the problem. 2) If you do not close the black window then try: http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#gdb.exe_has_stopp ed_working Quotego to the debugger options and in the field "debugger_startup_options" enter:         --eval-command="set auto-solib-add off" 3) If you do NOT close the black window, and (2) does not help, go to the debugger options and in the field "InternalStartBreak" select one of the other Values (e.g. MainAddr, or Entry, but you may have to try them all). 4) If you do NOT close the black window, and (2) and (3) does not help, then a logfile will be needed (since nothing obvious has shown up yet): http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#Log_info_for_debu g_session -------------------------- Note, that if you use CodeTyphon, they probably ship a different GDB, and that GDB may have errors. (I will still try to help) The GDB supplied by Lazarus, can be found here: http://sourceforge.net/projects/mingw/files/MinGW/Extension/gdb/GDB- 7.2/ --- EDIT: Ignore the debugger type in the image, it should be as on the wiki. ---------------------------------------------------------------------- KMagic · 2014-01-29 06:45 I have tried the 1, 2, 3, but it didn't work. For number 4, I don't know where the command line is. Is it in the window that appears after we right-click the shortcut and click properties? ---------------------------------------------------------------------- Martin_fr · 2014-01-29 11:39 See Image ---------------------------------------------------------------------- KMagic · 2014-01-30 11:01 What problem is this after I add: Code: [Select]--debug-log=C:\laz.log --debug-enable=DBG_CMD_ECHO,DBG_S TATE,DBG_DATA_MONITORS,DBGMI_QUEUE_DEBUG,DBGMI_TYPE_INFO ---------------------------------------------------------------------- Martin_fr · 2014-01-30 11:24 Leave a space after the lazarus.exe. Code: [Select]C:\lazarus\lazarus.exe  --debug-log=LOG_FILE  --debug-en able=DBG_CMD_ECHO,DBG_STATE,DBG_DATA_MONITORS,DBGMI_QUEUE_DEBUG,DBGMI_ TYPE_INFO Replace LogFile with where you want it to be. e.g. Code: [Select]C:\lazarus\lazarus.exe  --debug-log=C:\mylazlog.txt  --debug-enable=DBG_CMD_ECHO,DBG_STATE,DBG_DATA_MONITORS,DBGMI_QUEUE_DE BUG,DBGMI_TYPE_INFO ---------------------------------------------------------------------- KMagic · 2014-01-30 20:34 Finally, I got a log file now. What should I do next? ---------------------------------------------------------------------- Martin_fr · 2014-01-30 20:46 Zip it and upload it here. Or email it to me. I send you a message (pm) with my regular email. ---------------------------------------------------------------------- KMagic · 2014-01-31 13:09 I have sent it to your email. ---------------------------------------------------------------------- Martin_fr · 2014-01-31 15:45 Ok,  I got the file, I am looking through it. Before I go into details: In the past this has sometimes happens with some firewalls or antivirus solutions. You can search the forum  for comodo-firewall, and bitdefender (at least in the past) had also had issues. Other may as well. If they allow something like a "game mode" or temporary restriction, or exception of your own file, it might be worth trying. However, the log does NOT look as if it is the AV. --------------------------------------- Also, if you whish to continue this conversation by mail, you can choose to answer this to my email. I will then continue further replies by email too. --------------------------------------- Let's first verify that I interpreted the log correctly: As far as I can see, you do the correct steps. The file has debug info and all. - you run (F9) to the breakpoint at the first line in the main "begin" of the lpr.   I see an assembler output, I GUESS you still had the asm window open from previous? - you pressed F7 - The program continued, but never stopped. (probably it looked like nothing happened at all??) - I ASSUME you pressed the "stop" button?   At least I see that the IDE forcefully stopped the app. Please confirm, or correct me on those steps above. ---- If so: Is the initial breakpoint on a line that calls another function, or procedure? Is that function in the same unit, or a different unit? While still at the breakpoint (before pressing F7), if you look at the code of that function, does it have blue dots? What happens if instead of "stop" (assuming you did press that), you try to press "pause", and then rook at the stack-window (and the thread window, ensuring the thread with ID 1 is selected)? BTW, If this is a line like Code: [Select]readln;then it will only return after you entered something in the console, AND press return in the console. If this is a line like Code: [Select] while condition do foo; // e.g. while a < b do a := 0; where all is on one line, then it will only return, if the condition is true. - Stepping does NOT step between instructions on the same line. - And in my example, if b is greater than 0, it is an endless loop, and the single step (F7) will never return, as the loop continues. The only way out is "pause", and then look at the variables in watches win) --------------- A note on the side / not (yet) important) / you can safely ignore this for now: There is an unexpected internal difference when your app starts, to what happens on many other PC. But it is most likely totally OK, and most likely not the problem. I will still look out for anything on it, just in case. When your app starts, it starts something starts a 2nd thread within your app. (Most likely this is not your code, and not any code by lazarus or FPC). It is normal that windows, and/or other programs, sometimes do this. It does appear to happen in a helper dll from IE. A quick google indicates that this can be affected by the version of IE, by an Antivirus, or by VisualStudio. (I would also guess any IIS related install) But as I said, sofar this does not seem connected to the actual problem.... ---------------------------------------------------------------------- krzynio · 2014-11-25 06:43 Hi! I noticed the same error: 'Cannot find bounds of current function error'. I know that it is to late for solving your problem, but maybe it helps Lazarus developers to correct any errors. I copied TZQuery (dm.q1) from data module to MainForm and called simply q1. Next I replaced earlier used dm.q1 with q1 and I run the program. I could not compile it or trace even if I set break point in first line after begin of the project source. I still noticed the 'Cannot find bounds of current function error' message. Then I saw that during copy process Lasarus cleared Connection property of q1. After assigning the Connection everything started to work fine. In my opinion the message is not appropriate to the error. Should be rather 'Missing connection property in q1" or something like that and should not be listed before opening the query without Connection property assigned. Best regards, Krzysztof