binutils-gdb/gdb/testsuite/gdb.asm/asmsrc1.s

87 lines
1.8 KiB
ArmAsm
Raw Normal View History

.include "common.inc"
.include "arch.inc"
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."
comment "This file is not linked with crt0."
comment "Provide very simplistic equivalent."
.global _start
gdbasm_declare _start
gdbasm_startup
gdbasm_call main
gdbasm_exit0
gdbasm_end _start
Implement displaced stepping. gdb/ * gdbarch.sh (max_insn_length): New 'variable'. (displaced_step_copy, displaced_step_fixup) (displaced_step_free_closure, displaced_step_location): New functions. (struct displaced_step_closure): Add forward declaration. * gdbarch.c, gdbarch.h: Regenerated. * arch-utils.c: #include "objfiles.h". (simple_displaced_step_copy_insn) (simple_displaced_step_free_closure) (displaced_step_at_entry_point): New functions. * arch-utils.h (simple_displaced_step_copy_insn) (simple_displaced_step_free_closure) (displaced_step_at_entry_point): New prototypes. * i386-tdep.c (I386_MAX_INSN_LEN): Rename to... (I386_MAX_MATCHED_INSN_LEN): ... this. (i386_absolute_jmp_p, i386_absolute_call_p) (i386_ret_p, i386_call_p, i386_breakpoint_p, i386_syscall_p) (i386_displaced_step_fixup): New functions. (struct i386_insn, i386_match_insn): Update. (i386_gdbarch_init): Set gdbarch_max_insn_length. * i386-tdep.h (I386_MAX_INSN_LEN): New. (i386_displaced_step_fixup): New prototype. * i386-linux-tdep.c (i386_linux_init_abi): Include "arch-utils.h". Register gdbarch_displaced_step_copy, gdbarch_displaced_step_fixup, gdbarch_displaced_step_free_closure, and gdbarch_displaced_step_location functions. * infrun.c (debug_displaced): New variable. (show_debug_displaced): New function. (struct displaced_step_request): New struct. (displaced_step_request_queue, displaced_step_ptid) (displaced_step_gdbarch, displaced_step_closure) (displaced_step_original, displaced_step_copy) (displaced_step_saved_copy, can_use_displaced_stepping): New variables. (show_can_use_displaced_stepping, use_displaced_stepping) (displaced_step_clear, cleanup_displaced_step_closure) (displaced_step_dump_bytes, displaced_step_prepare) (displaced_step_clear_cleanup, write_memory_ptid) (displaced_step_fixup): New functions. (resume): Call displaced_step_prepare. (proceed): Call read_pc once, and remember the value. If using displaced stepping, don't remove breakpoints. (handle_inferior_event): Call displaced_step_fixup. Add some debugging output. When we try to step over a breakpoint, but get a signal to deliver to the thread instead, ensure the step-resume breakpoint is actually inserted. If a thread hop is needed, and displaced stepping is enabled, don't remove breakpoints. (init_wait_for_inferior): Call displaced_step_clear. (_initialize_infrun): Add "set debug displaced" command. Add "maint set can-use-displaced-stepping" command. Clear displaced_step_ptid. * inferior.h (debug_displaced): Declare variable. (displaced_step_dump_bytes): Declare function. * Makefile.in (arch-utils.o, i386-linux-tdep.o): Update dependencies. gdb/testsuite/ * gdb.asm/asmsrc1.s: Add scratch space. gdb/doc/ * gdb.texinfo (Debugging Output): Document "set/show debug displaced". (Maintenance Commands): Document "maint set/show can-use-displaced-stepping".
2008-05-02 18:49:54 +02:00
comment "Displaced stepping requires scratch space at _start"
comment "at least as large as the largest instruction. No"
comment "breakpoints should be set within the scratch space."
gdbasm_several_nops
gdbasm_several_nops
gdbasm_several_nops
gdbasm_several_nops
gdbasm_several_nops
gdbasm_several_nops
gdbasm_several_nops
gdbasm_several_nops
comment "main routine for assembly source debugging test"
comment "This particular testcase uses macros in <arch>.inc to achieve"
comment "machine independence."
.global main
gdbasm_declare main
gdbasm_enter
comment "Call a macro that consists of several lines of assembler code."
comment "mark: main start"
gdbasm_several_nops
comment "Call a subroutine in another file."
comment "mark: call foo2"
gdbasm_call foo2
comment "All done."
comment "mark: main exit"
gdbasm_exit0
gdbasm_end main
comment "mark: search"
comment "A routine for foo2 to call."
.global foo3
gdbasm_declare foo3
gdbasm_enter
comment "mark: foo3 start"
gdbasm_leave
gdbasm_end foo3
.global exit
gdbasm_declare exit
gdbasm_exit0
gdbasm_end exit
comment "A static function"
gdbasm_declare foostatic
gdbasm_enter
gdbasm_leave
gdbasm_end foostatic
comment "A global variable"
.global globalvar
gdbasm_datavar globalvar 11
comment "A static variable"
gdbasm_datavar staticvar 5
.include "note.inc"