View Issue Details

IDProjectCategoryView StatusLast Update
0034430LazarusDebuggerpublic2021-01-10 12:07
ReporterCyrax Assigned ToMartin Friebe  
PrioritynormalSeverityminorReproducibilityalways
Status assignedResolutionopen 
PlatformLinux x86_64OSArch 
Product Version2.1 (SVN) 
Summary0034430: Assembler window is empty and "Cannot access memory at address <x>".
DescriptionWhen debugging a simple console program, Assembler Window can't display disassembly at the start of main program.

Debug output window will display these error lines :
<-data-disassemble -s 134516676 -e 134516677 -- 0>
^error,msg="Cannot access memory at address 0x8048fc4"
(gdb)
<-data-disassemble -s 134516560 -e 134517088 -- 0>
^error,msg="Cannot access memory at address 0x8048f50"
(gdb)
<-data-disassemble -s 134516380 -e 134516381 -- 0>
^error,msg="Cannot access memory at address 0x8048e9c"
(gdb)
<-data-disassemble -s 134516264 -e 134516560 -- 0>
^error,msg="Cannot access memory at address 0x8048e28"
(gdb)
<-data-disassemble -s 134516676 -e 134516677 -- 0>
^error,msg="Cannot access memory at address 0x8048fc4"
(gdb)
<-data-disassemble -s 134516560 -e 134517088 -- 0>
^error,msg="Cannot access memory at address 0x8048f50"
(gdb)
<-data-disassemble -s 134516380 -e 134516381 -- 0>
^error,msg="Cannot access memory at address 0x8048e9c"
(gdb)


Only when stepping into subroutine at the different unit, Assembler Window will display correct disassembly. And when going back to main program, Assembler Window will show nothing.

This bad behaviour will disappear when adding additional clauses to the main program.

Steps To ReproduceAttached test project (project1.zip) will demonstrate this problem. It will disappear, when you enable the define DEBUG_PADDING at the main source.
Additional InformationThis was tested by building the attached test project as an 32-bit program on top 64-bit Arch Linux and debugging it via 32-bit Lazarus.

Attached extra files which are debug log from Lazarus and output from Debug output window (debug info.zip) and main program and unit1 assembler files.

----

I have FPC 3.3.1-r39935 and Lazarus 2.1.0 r59300.
TagsNo tags attached.
Fixed in Revision
LazTarget
WidgetsetGTK 2
Attached Files

Relationships

related to 0034475 resolvedFlorian FPC When exception is raised and its not handled properly, the stack trace doesn't show correct file names and their numbers. 
related to 0032240 assignedMartin Friebe Lazarus Continuous attempts to disassemble AVR target in Lazarus when stopped at break point 

Activities

Cyrax

2018-10-18 19:36

reporter  

project1.zip (1,492 bytes)

Cyrax

2018-10-18 19:37

reporter   ~0111457

Link to thread where there is discussion on this : https://forum.lazarus.freepascal.org/index.php/topic,42882.msg299529.html#msg299529

Cyrax

2018-10-18 19:38

reporter  

debug info.zip (21,886 bytes)

Cyrax

2018-10-18 19:38

reporter  

Cyrax

2018-10-18 19:38

reporter  

unit1.s-linux-i386.zip (1,911 bytes)

Cyrax

2018-10-18 19:55

reporter  

Cyrax

2018-10-18 19:55

reporter  

Cyrax

2018-10-18 20:01

reporter  

debug info x86_64.zip (27,863 bytes)

Cyrax

2018-10-18 20:02

reporter   ~0111458

I can't reproduce this bug in the 64-bit environment at all. See attached x86_64 files for more info.

Cyrax

2018-10-20 16:06

reporter   ~0111487

Using GDB 8.2 from Arch repositories.

Cyrax

2018-10-26 16:04

reporter   ~0111580

When running directly at terminal window, GDB shows correct assembler output. No errors are shown.

Cyrax

2018-11-04 04:48

reporter   ~0111774

Related to bug report https://bugs.freepascal.org/view.php?id=34475

Cyrax

2019-06-23 23:07

reporter   ~0116879

As on FPC trunk r42276 and Lazarus trunk r61453, this bug got fixed in the mean time.

GDB is at 8.3 version.
binutils is at 2.32-2 version.

Issue History

Date Modified Username Field Change
2018-10-18 19:36 Cyrax New Issue
2018-10-18 19:36 Cyrax Status new => assigned
2018-10-18 19:36 Cyrax Assigned To => Martin Friebe
2018-10-18 19:36 Cyrax File Added: project1.zip
2018-10-18 19:37 Cyrax Note Added: 0111457
2018-10-18 19:38 Cyrax File Added: debug info.zip
2018-10-18 19:38 Cyrax File Added: project1.s-linux-i386.zip
2018-10-18 19:38 Cyrax File Added: unit1.s-linux-i386.zip
2018-10-18 19:55 Cyrax File Added: project1.s-linux-x86-64.zip
2018-10-18 19:55 Cyrax File Added: unit1.s-linux-x86-64.zip
2018-10-18 20:01 Cyrax File Added: debug info x86_64.zip
2018-10-18 20:02 Cyrax Note Added: 0111458
2018-10-20 16:06 Cyrax Note Added: 0111487
2018-10-26 16:04 Cyrax Note Added: 0111580
2018-11-04 04:48 Cyrax Note Added: 0111774
2018-11-04 08:46 Juha Manninen Relationship added related to 0034475
2019-06-23 23:07 Cyrax Note Added: 0116879
2021-01-10 12:07 Martin Friebe Relationship added related to 0032240