1999-04-16 01:35:26 +00:00
|
|
|
.include "common.inc"
|
|
|
|
.include "arch.inc"
|
|
|
|
|
2005-12-09 11:02:09 +00:00
|
|
|
comment "WARNING: asm-source.exp checks for line numbers printed by gdb."
|
|
|
|
comment "Be careful about changing this file without also changing"
|
|
|
|
comment "asm-source.exp."
|
2000-07-04 02:47:08 +00:00
|
|
|
|
|
|
|
|
2005-12-09 11:02:09 +00:00
|
|
|
comment "This file is not linked with crt0."
|
|
|
|
comment "Provide very simplistic equivalent."
|
2000-07-04 02:47:08 +00:00
|
|
|
|
|
|
|
.global _start
|
2005-12-09 11:02:09 +00:00
|
|
|
gdbasm_declare _start
|
2001-11-10 17:55:48 +00:00
|
|
|
gdbasm_startup
|
|
|
|
gdbasm_call main
|
|
|
|
gdbasm_exit0
|
2002-10-22 01:43:37 +00:00
|
|
|
gdbasm_end _start
|
2000-07-04 02:47:08 +00:00
|
|
|
|
2005-12-09 11:02:09 +00:00
|
|
|
comment "main routine for assembly source debugging test"
|
|
|
|
comment "This particular testcase uses macros in <arch>.inc to achieve"
|
|
|
|
comment "machine independence."
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
.global main
|
2005-12-09 11:02:09 +00:00
|
|
|
gdbasm_declare main
|
2001-11-10 17:55:48 +00:00
|
|
|
gdbasm_enter
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2005-12-09 11:02:09 +00:00
|
|
|
comment "Call a macro that consists of several lines of assembler code."
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2001-11-10 17:55:48 +00:00
|
|
|
gdbasm_several_nops
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2005-12-09 11:02:09 +00:00
|
|
|
comment "Call a subroutine in another file."
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2001-11-10 17:55:48 +00:00
|
|
|
gdbasm_call foo2
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2005-12-09 11:02:09 +00:00
|
|
|
comment "All done."
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2001-11-10 17:55:48 +00:00
|
|
|
gdbasm_exit0
|
2002-10-22 01:43:37 +00:00
|
|
|
gdbasm_end main
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2005-12-09 11:02:09 +00:00
|
|
|
comment "A routine for foo2 to call."
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
.global foo3
|
2005-12-09 11:02:09 +00:00
|
|
|
gdbasm_declare foo3
|
2001-11-10 17:55:48 +00:00
|
|
|
gdbasm_enter
|
|
|
|
gdbasm_leave
|
2002-10-22 01:43:37 +00:00
|
|
|
gdbasm_end foo3
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
.global exit
|
2005-12-09 11:02:09 +00:00
|
|
|
gdbasm_declare exit
|
2001-11-10 17:55:48 +00:00
|
|
|
gdbasm_exit0
|
2002-10-22 01:43:37 +00:00
|
|
|
gdbasm_end exit
|
2001-12-04 19:45:57 +00:00
|
|
|
|
2005-12-09 11:02:09 +00:00
|
|
|
comment "A static function"
|
2001-12-04 19:45:57 +00:00
|
|
|
|
2005-12-09 11:02:09 +00:00
|
|
|
gdbasm_declare foostatic
|
2001-12-04 19:45:57 +00:00
|
|
|
gdbasm_enter
|
|
|
|
gdbasm_leave
|
2002-10-22 01:43:37 +00:00
|
|
|
gdbasm_end foostatic
|
2001-12-04 19:45:57 +00:00
|
|
|
|
2005-12-09 11:02:09 +00:00
|
|
|
comment "A global variable"
|
2001-12-04 19:45:57 +00:00
|
|
|
|
|
|
|
.global globalvar
|
2005-12-09 11:02:09 +00:00
|
|
|
gdbasm_datavar globalvar 11
|
2001-12-04 19:45:57 +00:00
|
|
|
|
2005-12-09 11:02:09 +00:00
|
|
|
comment "A static variable"
|
2001-12-04 19:45:57 +00:00
|
|
|
|
2005-12-09 11:02:09 +00:00
|
|
|
gdbasm_datavar staticvar 5
|
2003-11-29 13:55:17 +00:00
|
|
|
|
|
|
|
.include "note.inc"
|