Posts: 2
Threads: 1
Joined: Jan 2022
Reputation:
0
How to enable debug/breakpoints inside assembler source files (*.S)?
I can set the breakpoint by F9, but if I run the debug session by Ctrl+F5, these breakpoints are removed.
Posts: 246
Threads: 14
Joined: Apr 2020
Reputation:
16
03-01-2022, 07:37 AM
(This post was last modified: 03-01-2022, 09:48 AM by embitz.)
I can't reproduce this, it works here like it should.
Are you sure that that source file is part of your active target?
Posts: 2
Threads: 1
Joined: Jan 2022
Reputation:
0
I fixed it.
In my case, I use some sections of flash.
Exsample:
.syntax unified
.arch armv7-m
.thumb
.thumb_func
// .section .fixedcode
//---------------------------------
// mcpy
//---------------------------------
.align 4
.globl mcpy
.type mcpy, %function
mcpy:
cmp R2,#4
blo mcpy_last_bytes
ldr R3,[R1],#4
str R3,[R0],#4
subs R2,#4
b mcpy
mcpy_last_bytes:
cbz R2,mcpy_finish
ldrb R3,[R1],#1
strb R3,[R0],#1
subs R2,#1
b mcpy_last_bytes
mcpy_finish:
bx lr
If uncomment the line // .section .fixedcode the debug not work in this source file
linker script:
SECTIONS
{
.text :
{
KEEP(*(.isr_vector))
KEEP(*(.fixedcode))
. = 0x4000;
KEEP(*(.calltable))
. = 0x4100;
*(.text*)
*(.rodata*)
} > ROM
...
Posts: 246
Threads: 14
Joined: Apr 2020
Reputation:
16
Ah, non debuggable code.
Yes, if GDB gives an error back that it can't set the breakpoint at that particular location, EB will remove it.
You can check this in the debugger log windows.