Assembler-Debugging macht Probleme

Gast #76816
Lesenswert?

Hallo zusammen,

im meine Code sind einige Funktionen in Assembler implementiert, der
überwiegende Teil aber in C.
Um nun Assembler-Debuggen zu können, sind ja die beiden Zeilen:

.stabs  "",100,0,0,NameDerErstenFunktion
.stabs  "Name.S",100,0,0,NameDerErstenFunktion

im S-File am Anfang notwendig.

Als makefile, C-File und S-File noch in einem Ordner waren, hat alles
gut funktioniert.

Jetzt habe ich eine Ordnerstruktur angelegt, und jetzt sind makefile,
C-File und S-File getrennt.
Das makefile habe ich mit Pfadangeben für C-File und S-File erweitert,
Compilieren kann ich auch, der Programm läuft auch, aber
Assembler-Debuggen kann ich nicht mehr.

Wo liegt das Problem ?

Danke und Gruss.
Gast #76818
Lesenswert?

...hört sich einfach an.

Aber

.stabs  "C:/atmel/testprog/asm",100,0,0,NameDerErstenFunktion
.stabs  "Name.S",100,0,0,NameDerErstenFunktion

oder

.stabs  "C:/atmel/testprog/asm/Name.S",100,0,0,NameDerErstenFunktion
.stabs  "Name.S",100,0,0,NameDerErstenFunktion

und auch

.stabs  "asm",100,0,0,NameDerErstenFunktion
.stabs  "Name.S",100,0,0,NameDerErstenFunktion

( im Ordner testprog ist das makefile)

hat nicht Funktioniert. Gross und Kleinschreibung habe ich beachtet.

...heute will mir nichts gelingen.
Gast #76819
Lesenswert?

Hmm, die erste Variante wäre die korrekte.

Schau mal in das COFF-File (avr-objdump -g), dort müßte sich der
Pfadname wiederfinden.  Ach so, »extcoff« benutzt Du aber, oder?  Das
alte (AVR Studio 3.x) COFF konnte keine langen Dateinamen.
Gast #76821
Lesenswert?

Für eine C-Funktionen sieht das ungefähr so aus:

void sendTrace ()
{ /* 0x12e8 */
  /* file C:\test/kernel/trace.c line 80 addr 0x12e8 */
  { /* 0x12fc */
    unsigned int max_index /* 0x1 */;
    static unsigned int send_index /* 0x23e */;
    /* file C:\OS_31/kernel/trace.c line 82 addr 0x12fc */
    /* file C:\OS_31/kernel/trace.c line 84 addr 0x1300 */

    usw.


Der Filename Name.S kommt im gesamten avr-objdump Output nicht vor.
Assembler-Funktionen werden lediglich in der Form

void popAll /* 0x152e */;

aufgeführt.
Gast #76823
Lesenswert?

ist noch drin:

# Optional assembler flags.
#  -Wa,...:   tell GCC to pass this to the assembler.
#  -ahlms:    create listing
#  -gstabs:   have the assembler create line number information; note
that
#             for use in COFF files, additional information about
filenames
#             and function names needs to be present in the assembler
source
#             files -- see avr-libc docs [FIXME: not yet described
there]
ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs
Gast #76825
Lesenswert?

vielleicht noch die Info:


Ein Testprojekt, in dem Assemblerfiles und makefile in einem
Verzeichnis liegen, und Assembler-Debupping möglich ist hat folgenden
output beim konvertieren:

C:\test>make extcoff

Converting to AVR Extended COFF: testprog.cof
avr-objcopy --debugging --change-section-address .data-0x800000
--change-section
-address .bss-0x800000 --change-section-address .noinit-0x800000
--change-sectio
n-address .eeprom-0x810000  -O coff-ext-avr testprog.elf testprog.cof
Discarding local symbol outside any compilation unit:
.__do_copy_data_start
Discarding local symbol outside any compilation unit:
.__do_copy_data_loop
Warning: file C:/test/S_Ordner/asmName.S not found in symbol table, ig
noring
Warning: ignoring function testFunction() outside any compilation unit


Wenn das Assemblerfile in einem anderen Ordner als das makefile liegt,
und Assembler-Debugging nicht funktioniert:

C:\test>make extcoff

Converting to AVR Extended COFF: testprog.cof
avr-objcopy --debugging --change-section-address .data-0x800000
--change-section
-address .bss-0x800000 --change-section-address .noinit-0x800000
--change-sectio
n-address .eeprom-0x810000 -O coff-ext-avr testprog.elf testprog.cof
Discarding local symbol outside any compilation unit:
.__do_copy_data_start
Discarding local symbol outside any compilation unit:
.__do_copy_data_loop
Warning: file C:\DOKUME~1\tim\LOKALE~1\Temp/cccjaaaa.s not found in
symbol table
, ignoring
function testFunction not found in symbol table, defaulting to "text"
section
Gast #76826
Lesenswert?

Hmm bin mir nicht sicher ob ich das gleiche Problem hab, aber ich hab
festgestellt, dass es sich anscheinend um ein Problem mit slasches
"/" und nicht backslashes "\" handelt. Wenn man die .cof Datei mit
einem editor Öffnet, der sonst nichts ändert (PN oder ein Hexeditor)
und bei den Dateiangaben die "/" durch "\" ersetzt (! es darf
sonst nichts geändert werden) dann funktionierts....
Wenn wir von dem selben Problem reden. (Bin noch nicht ganz fit und
mach grad Highspeed einarbeiten)
Gast #76828
Lesenswert?

I debug get pixel code:
mov bx,cx ;y
mov dx,bx
shl bx,8
shl dx,6
add dx,bx
add dx,ax ;x
mov di,dx
mov al,[es:di] ;nasm style [es:di]
cmp al,0x51    ;color 0x51; al don´t correspond to 0x51 color
               ;on screen. Why? I check de active page with
               ;int 10h function 05, it´s appear de same page
               ;before and after.

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren