Recent

Author Topic: How to get rid of the assember window?  (Read 7093 times)

geek893

  • New Member
  • *
  • Posts: 24
How to get rid of the assember window?
« on: January 12, 2017, 02:13:50 pm »
When I try to debug my program by executing it step by step (by pressing F7) this GODDAMNED assember window pops up and I have no idea how to get rid of it. I don't need this window, it only irritates me.

balazsszekely

  • Guest
Re: How to get rid of the assember window?
« Reply #1 on: January 12, 2017, 02:26:07 pm »
Quote
Geek893
When I try to debug my program by executing it step by step (by pressing F7) this GODDAMNED assember window pops up and I have no idea how to get rid of it. I don't need this window, it only irritates me.
Assuming the debugger setup is correct: http://wiki.lazarus.freepascal.org/Debugger_Setup, the assembler window only popups when the GODDAMNED source code is not available :D,  so there is little you can do about it. Are you working with some third party components with reference to external dlls?

geek893

  • New Member
  • *
  • Posts: 24
Re: How to get rid of the assember window?
« Reply #2 on: January 12, 2017, 03:05:02 pm »
Quote
Assuming the debugger setup is correc

Thank you for the link, I have changed some options, but the assembler window still pops up.


Quote
Are you working with some third party components with reference to external dlls?

No, I'm writing my own code.  I use Debian Stable, my copy of Lazarus is from its repository.

Here is an example of code that gets these pop-ups:
Quote
program project1;

begin
write('Hello!');
write('Goodbye!');
end.     


Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9900
  • Debugger - SynEdit - and more
    • wiki
Re: How to get rid of the assember window?
« Reply #3 on: January 13, 2017, 02:18:24 am »
What version of GDB ?

As pointed out the asm win shows up, if you stop at an address for which there is no source (actually for which there is on debug info, so the source can not be found).

If you stop at such a location, then there is nothing else that could be shown, so the asm can not be suppressed. (You can switch its power button off, so it will not spent time loading, but it will still show (with the frozen power off content)).

Usually stopping at such a location happens if an exception occurs...

The odd thing is that you experience it with F7.
on F7 gdb is only to step to locations with debug info.

Actually, except if you step out of a function, into a parent function that has no debug info.
In that case compile the parent function with debug info too. Or if you do not want to step into it, then use F9.

Otherwise check your settings.
Try switching between "stabs" and "dwarf with sets". (dwarf is preferred)

If you have packages that are compiled with debug info, then ensure they all have the same setting !

------------------
your example project has no packages or anything.
That is really odd and should not happen.

Check in IDE options / editor / keymap what is assigned to F7
It should be "step into"
It should NOT be "step into Instruction"
And it should also NOT be "step into (Context)"

The latter 2 can do single assembler steps, and then, yes then you get the asm.

-------------
Another idea: maybe there is an excepiton in write().
Is stdout open? there is menu: view > Debug win > console outpet / or similar. You should see the written text in that window. (on linux only)



geek893

  • New Member
  • *
  • Posts: 24
Re: How to get rid of the assember window?
« Reply #4 on: January 13, 2017, 03:16:01 am »
Version of GDB:7.7.1
Version of Lazarus:1.2.4
Version of FPC:2.6.4

Quote
Try switching between "stabs" and "dwarf with sets". (dwarf is preferred)
I tried, but the window still pops up.

Quote
your example project has no packages or anything.
That is really odd and should not happen.

What are packages and why my program should have them?


Quote
It should be "step into"
Yes, it's "step into".


Quote
Another idea: maybe there is an excepiton in write().
It seems like there is NO messages of any errors/warnings on the console output, the program works just as intended.

Although, there is the debug output if anybody is interested:
Code: Pascal  [Select][+][-]
  1. <-file-exec-and-symbols "/tmp/project1">
  2. ^done
  3. (gdb)
  4. <-gdb-set language pascal>
  5. ^done
  6. (gdb)
  7. <-environment-cd .>
  8. ^done
  9. (gdb)
  10. <-environment-cd "/tmp/">
  11. ^done
  12. (gdb)
  13. <-data-evaluate-expression FPC_THREADVAR_RELOCATE_PROC>
  14. ^error,msg="No symbol \"FPC_THREADVAR_RELOCATE_PROC\" in current context."
  15. (gdb)
  16. <info functions FPC_CPUINIT>
  17. &"info functions FPC_CPUINIT\n"
  18. ~"All functions matching regular expression \"FPC_CPUINIT\":\n"
  19. ~"\nNon-debugging symbols:\n"
  20. ~"0x08049480  SYSTEM_FPC_CPUINIT\n"
  21. ^done
  22. (gdb)
  23. <-exec-arguments >
  24. ^done
  25. (gdb)
  26. <set inferior-tty /dev/pts/0>
  27. &"set inferior-tty /dev/pts/0\n"
  28. ^done
  29. (gdb)
  30. <-gdb-set language pascal>
  31. ^done
  32. (gdb)
  33. <ptype TObject>
  34. &"ptype TObject\n"
  35. &"No symbol \"TObject\" in current context.\n"
  36. ^error,msg="No symbol \"TObject\" in current context."
  37. (gdb)
  38. <ptype Exception>
  39. &"ptype Exception\n"
  40. &"No symbol \"Exception\" in current context.\n"
  41. ^error,msg="No symbol \"Exception\" in current context."
  42. (gdb)
  43. <ptype Shortstring>
  44. &"ptype Shortstring\n"
  45. &"No symbol \"Shortstring\" in current context.\n"
  46. ^error,msg="No symbol \"Shortstring\" in current context."
  47. (gdb)
  48. <ptype pointer>
  49. &"ptype pointer\n"
  50. &"No symbol \"pointer\" in current context.\n"
  51. ^error,msg="No symbol \"pointer\" in current context."
  52. (gdb)
  53. <ptype byte>
  54. &"ptype byte\n"
  55. &"No symbol \"byte\" in current context.\n"
  56. ^error,msg="No symbol \"byte\" in current context."
  57. (gdb)
  58. <set print elements 2500>
  59. &"set print elements 2500\n"
  60. ^done
  61. (gdb)
  62. <info file>
  63. &"info file\n"
  64. ~"Symbols from \"/tmp/project1\".\n"
  65. ~"Local exec file:\n"
  66. ~"\t`/tmp/project1', file type elf32-i386.\n"
  67. ~"\tEntry point: 0x8065590\n"
  68. ~"\t0x080480a0 - 0x08065600 is .text\n"
  69. ~"\t0x08066600 - 0x0806ade0 is .data\n"
  70. ~"\t0x0806ade0 - 0x0806e6d4 is .bss\n"
  71. ^done
  72. (gdb)
  73. <-data-evaluate-expression sizeof(^char)>
  74. ^error,msg="A syntax error in expression, near `char)'."
  75. (gdb)
  76. <-break-insert main>
  77. ^done,bkpt={number="38",type="breakpoint",disp="keep",enabled="y",addr="0x080480ae",func="main",file="project1.lpr",fullname="/tmp/project1.lpr",line="4",thread-groups=["i1"],times="0",original-location="main"}
  78. (gdb)
  79. <-break-insert +0>
  80. ^done,bkpt={number="39",type="breakpoint",disp="keep",enabled="y",addr="0x08048100",func="main",file="project1.lpr",fullname="/tmp/project1.lpr",line="6",thread-groups=["i1"],times="0",original-location="/tmp/project1.lpr:+0"}
  81. (gdb)
  82. <-break-insert *134632848>
  83. ^done,bkpt={number="40",type="breakpoint",disp="keep",enabled="y",addr="0x08065590",at="<SI_PRC__FPC_PROC_START>",thread-groups=["i1"],times="0",original-location="*134632848"}
  84. (gdb)
  85. <-exec-run>
  86. =thread-group-started,id="i1",pid="17466"
  87. =thread-created,id="1",group-id="i1"
  88. ^running
  89. *running,thread-id="all"
  90. (gdb)
  91. =breakpoint-modified,bkpt={number="39",type="breakpoint",disp="keep",enabled="y",addr="0x080480d7",func="main",file="project1.lpr",fullname="/tmp/project1.lpr",line="5",thread-groups=["i1"],times="0",original-location="/tmp/project1.lpr:+0"}
  92. =breakpoint-modified,bkpt={number="40",type="breakpoint",disp="keep",enabled="y",addr="0x08065590",at="<SI_PRC__FPC_PROC_START>",thread-groups=["i1"],times="1",original-location="*134632848"}
  93. *stopped,reason="breakpoint-hit",disp="keep",bkptno="40",frame={addr="0x08065590",func="SI_PRC__FPC_PROC_START",args=[]},thread-id="1",stopped-threads="all",core="2"
  94. (gdb)
  95. <-break-delete 38>
  96. ^done
  97. (gdb)
  98. <-break-delete 40>
  99. ^done
  100. (gdb)
  101. <-break-delete 39>
  102. ^done
  103. (gdb)
  104. <info address FPC_RAISEEXCEPTION>
  105. &"info address FPC_RAISEEXCEPTION\n"
  106. ~"Symbol \"FPC_RAISEEXCEPTION\" is at 0x8057a10 in a file compiled without debugging.\n"
  107. ^done
  108. (gdb)
  109. <-break-insert *134576656>
  110. ^done,bkpt={number="41",type="breakpoint",disp="keep",enabled="y",addr="0x08057a10",at="<fpc_raiseexception>",thread-groups=["i1"],times="0",original-location="*134576656"}
  111. (gdb)
  112. <info address FPC_BREAK_ERROR>
  113. &"info address FPC_BREAK_ERROR\n"
  114. ~"Symbol \"FPC_BREAK_ERROR\" is at 0x805ac30 in a file compiled without debugging.\n"
  115. ^done
  116. (gdb)
  117. <-break-insert *134589488>
  118. ^done,bkpt={number="42",type="breakpoint",disp="keep",enabled="y",addr="0x0805ac30",at="<SYSTEM_HANDLEERRORADDRFRAME$LONGINT$POINTER$POINTER>",thread-groups=["i1"],times="0",original-location="*134589488"}
  119. (gdb)
  120. <info address FPC_RUNERROR>
  121. &"info address FPC_RUNERROR\n"
  122. ~"Symbol \"FPC_RUNERROR\" is at 0x805ad30 in a file compiled without debugging.\n"
  123. ^done
  124. (gdb)
  125. <-break-insert *134589744>
  126. ^done,bkpt={number="43",type="breakpoint",disp="keep",enabled="y",addr="0x0805ad30",at="<SYSTEM_RUNERROR$WORD>",thread-groups=["i1"],times="0",original-location="*134589744"}
  127. (gdb)
  128. <-symbol-list-lines /tmp/project1.lpr>
  129. ^done,lines=[{pc="0x080480a0",line="3"},{pc="0x080480ae",line="4"},{pc="0x080480d7",line="5"},{pc="0x08048100",line="6"}]
  130. (gdb)
  131. <-exec-continue>
  132. ^running
  133. *running,thread-id="all"
  134. (gdb)
  135. =thread-exited,id="1",group-id="i1"
  136. =thread-group-exited,id="i1",exit-code="0"
  137. *stopped,reason="exited-normally"
  138. (gdb)
  139. <-break-delete 41>
  140. ^done
  141. (gdb)
  142. <-break-delete 42>
  143. ^done
  144. (gdb)
  145. <-break-delete 43>
  146. ^done
  147. (gdb)
  148. <-file-exec-and-symbols >
  149. ^done
  150. (gdb)
  151.  
« Last Edit: January 13, 2017, 03:25:32 am by geek893 »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9900
  • Debugger - SynEdit - and more
    • wiki
Re: How to get rid of the assember window?
« Reply #5 on: January 13, 2017, 01:48:30 pm »
Packages are for example the LCL, or RichMemo, database. THere are some for commandline apps too.
See Project Inspector (menu Project), it will show what you include. (Afaik if its only "FCL" you do not need to worry about anything)

gdb 771 is good.

Lazarus 1.2.4 is a bit old (current is 1.6.2). But for the asm win problem, it is unlikely that it will make a difference. So 1.2.4 is ok.

The debug output shows a run(F9) with no stepping, and no asm win opened...


geek893

  • New Member
  • *
  • Posts: 24
Re: How to get rid of the assember window?
« Reply #6 on: January 13, 2017, 02:26:47 pm »
Is there any way to copy my settings to one file, so somebody could check if there is something wrong with them?

Quote
See Project Inspector (menu Project), it will show what you include
I tried, but I'm afraid that it wasn't helpful.
There's a screenshot of the window of my Project Inspector:
https://i.imgur.com/XcfbswU.png

Quote
gdb 771 is good.
I know what "gdb" means, but I have no a clue what you were trying to say by "gdb 771"

« Last Edit: January 13, 2017, 02:28:54 pm by geek893 »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9900
  • Debugger - SynEdit - and more
    • wiki
Re: How to get rid of the assember window?
« Reply #7 on: January 13, 2017, 05:21:14 pm »
I missed the dots "GDB version 7.7.1".

Some GDB versions have known issues. The version you say you have, should be ok. At least I dont (yet) know of any issue of "GDB version 7.7.1" that would affect stepping with F7.

Project Inspector / your image: You do not use any packages, so this is not the issue either.

-----
very far fetched... Extremly far fetched....
you can try this setting http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#gdb.exe_has_stopped_working
    set the field "DisableLoadSymbolsForLibraries" to "True"

---------
Quote
Although, there is the debug output if anybody is interested:
As I said that one did not have the asm win.
You could paste one, where you did get the asm win.


geek893

  • New Member
  • *
  • Posts: 24
Re: How to get rid of the assember window?
« Reply #8 on: January 14, 2017, 05:54:01 am »
Quote
    set the field "DisableLoadSymbolsForLibraries" to "True"
Didn't change anything.

Quote
As I said that one did not have the asm win.
You could paste one, where you did get the asm win.

I don't know what the hell is going on, but there is another try:
http://pastebin.com/XJC0dEGK


I found a workaround: I can get rid of the assembler window by entering the step by step mode with a breakpoint instead of pressing "F7". So I just make the first line of my code as a breakpoin, click "run" and then use "F7" for each step.
« Last Edit: January 14, 2017, 05:55:55 am by geek893 »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9900
  • Debugger - SynEdit - and more
    • wiki
Re: How to get rid of the assember window?
« Reply #9 on: January 14, 2017, 01:38:34 pm »
Quote
I found a workaround: I can get rid of the assembler window by entering the step by step mode with a breakpoint instead of pressing "F7". So I just make the first line of my code as a breakpoin, click "run" and then use "F7" for each step.

Ah, that explains.

Starting an app, using "step" (into or over) is not supported.
(Hence I (and likely others) thought you try to step between lines in an already running app)

Stepping needs a current line, so it can find the next line.

If you use F7 to start the app, it will stop even before your first line (the compiler adds code before your first line). And as that code does not have a source, you get the asm win.

geek893

  • New Member
  • *
  • Posts: 24
Re: How to get rid of the assember window?
« Reply #10 on: January 14, 2017, 01:54:21 pm »
Quote
Starting an app, using "step" (into or over) is not supported.

Then why does it work fine in Turbo Pascal IDE? (and no, I can't use Free Pascal IDE that imitates it because in my distribution it's compiled with disabled debugger support. It was disabled because maintainers found problems between it and current version of GDB)
« Last Edit: January 14, 2017, 01:57:56 pm by geek893 »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9900
  • Debugger - SynEdit - and more
    • wiki
Re: How to get rid of the assember window?
« Reply #11 on: January 14, 2017, 07:34:58 pm »
When I said "is not supported", I meant by the Lazarus IDE. (and native GDB)

It could be implemented. But no one has yet done it.



 

TinyPortal © 2005-2018