Assembler-Debugging macht Probleme

Gast #76816
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
...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
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
Hallo,
gibt es irgendwo ein Dokumentation zu dem Umgang mit den S-Files?
Außer den FAQ's hier auf der Seite habe ich leider noch nichts
gefunden.
Danke
Boris
Gast
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
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
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
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
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.
Gast
Wrong forum, wrong toolchain: this is about Atmel AVR or TI MSP430
microcontrollers, using the GNU toolchain (GCC, GNU binutils).  You
match neither of these criteria (where matching both would be
required).
Gast
The correct interrupt for check active page is 0x0f. Error in
mov al,[es:di] because the correct is
mov al,[di] before setting es segment with
mov ax,0xa000
mov es,ax

Antwort schreiben

Eine eigene Frage? Dieser Thread ist über 22 Jahre alt. Stell sie in einem eigenen Thread – dort lesen mehr Leute mit, und sie wird öfter und schneller beantwortet.

Neuen Thread starten

Eine Lösung, Ergänzung oder Rückmeldung zu diesem Thread? Dann antworte hier.

Formatierung
  • [c]C-Code[/c]
  • [code]Code in anderen Sprachen, ASCII-Zeichnungen[/code]
  • [math]Formel in LaTeX-Syntax[/math]
  • [[Titel]] – Link zu einem Artikel
  • Verweis auf einen anderen Beitrag: Rechtsklick auf dessen Beitrags-ID (#8078628), „Adresse kopieren“, in den Text einfügen

Mehr zur Formatierung

Längeren Sourcecode als Anhang, nicht in den Text. JPG nur für Fotos und Scans; Zeichnungen und Screenshots als PNG oder GIF. Siehe Bildformate.

Schon registriert? Anmelden

Wird nicht angezeigt. Wir schicken dir einen Link; sobald du damit bestätigst, erscheint dein Beitrag.

Mit dem Abschicken legst du einen kostenlosen Account an und erkennst die Nutzungsbedingungen und die Datenschutzerklärung an.