From b64bbf8c48a18ee3e1c158d5df43141033144bbf Mon Sep 17 00:00:00 2001 From: Michal Ludvig Date: Thu, 24 Oct 2002 01:37:40 +0000 Subject: [PATCH] Reindented. --- gdb/dwarf2cfi.c | 6 ++-- gdb/dwarf2cfi.h | 2 +- gdb/gdb_indent.sh | 2 +- gdb/x86-64-linux-tdep.c | 67 ++++++++++++++++++++--------------------- gdb/x86-64-tdep.c | 8 +++-- gdb/x86-64-tdep.h | 2 +- 6 files changed, 43 insertions(+), 44 deletions(-) diff --git a/gdb/dwarf2cfi.c b/gdb/dwarf2cfi.c index 41e645b8866..ddb42ab65f5 100644 --- a/gdb/dwarf2cfi.c +++ b/gdb/dwarf2cfi.c @@ -814,13 +814,13 @@ frame_state_for (struct context *context, struct frame_state *fs) gdb_assert (fde->cie_ptr != NULL); cie = fde->cie_ptr; - + fs->code_align = cie->code_align; fs->data_align = cie->data_align; fs->retaddr_column = cie->ra; fs->addr_encoding = cie->addr_encoding; fs->objfile = cie->objfile; - + execute_cfa_program (cie->objfile, cie->data, cie->data + cie->data_length, context, fs); execute_cfa_program (cie->objfile, fde->data, @@ -1094,7 +1094,7 @@ execute_stack_op (struct objfile *objfile, case DW_OP_deref_size: { int len = *op_ptr++; - if (len != 1 && len != 2 && len != 4 && len !=8) + if (len != 1 && len != 2 && len != 4 && len != 8) internal_error (__FILE__, __LINE__, "execute_stack_op error"); result = read_memory_unsigned_integer (result, len); diff --git a/gdb/dwarf2cfi.h b/gdb/dwarf2cfi.h index b6abbdeebe6..a1cc39cb581 100644 --- a/gdb/dwarf2cfi.h +++ b/gdb/dwarf2cfi.h @@ -84,7 +84,7 @@ CORE_ADDR cfi_get_ra (struct frame_info *fi); The argument RAW_BUFFER must point to aligned memory. */ void cfi_get_saved_register (char *raw_buffer, int *optimized, - CORE_ADDR * addrp, + CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval); diff --git a/gdb/gdb_indent.sh b/gdb/gdb_indent.sh index 0d0829a4a13..c47ef95828d 100755 --- a/gdb/gdb_indent.sh +++ b/gdb/gdb_indent.sh @@ -37,7 +37,7 @@ fi # Different indent versions give different indentation. case `${indent} --version 2>/dev/null < /dev/null` in - GNU*2.2.6 ) ;; + GNU*2.2* ) ;; *GNU* ) echo "Incorrect version of GNU indent" 1>&2 ;; * ) echo "Indent is not GNU" 1>&2 ;; esac diff --git a/gdb/x86-64-linux-tdep.c b/gdb/x86-64-linux-tdep.c index 71e3276c8a2..146a7a0a072 100644 --- a/gdb/x86-64-linux-tdep.c +++ b/gdb/x86-64-linux-tdep.c @@ -35,7 +35,7 @@ #define LINUX_SIGTRAMP_OFFSET1 (7) static const unsigned char linux_sigtramp_code[] = { - /* mov $__NR_rt_sigreturn,%rax */ + /* mov $__NR_rt_sigreturn,%rax */ LINUX_SIGTRAMP_INSN0, 0xc7, 0xc0, 0x0f, 0x00, 0x00, 0x00, /* syscall */ LINUX_SIGTRAMP_INSN1, 0x05 @@ -100,8 +100,7 @@ x86_64_linux_sigcontext_addr (struct frame_info *frame) /* This is the top frame. */ rsp = read_register (SP_REGNUM); - return rsp + LINUX_SIGINFO_SIZE + - LINUX_UCONTEXT_SIGCONTEXT_OFFSET; + return rsp + LINUX_SIGINFO_SIZE + LINUX_UCONTEXT_SIGCONTEXT_OFFSET; } @@ -148,53 +147,51 @@ x86_64_linux_in_sigtramp (CORE_ADDR pc, char *name) { if (name) return STREQ ("__restore_rt", name); - + return (x86_64_linux_sigtramp_start (pc) != 0); } CORE_ADDR x86_64_linux_frame_chain (struct frame_info *fi) { - ULONGEST addr; - CORE_ADDR fp, pc; - - if (! fi->signal_handler_caller) - { - fp = cfi_frame_chain (fi); - if(fp) - return fp; - else - addr = fi->frame; - } - else - addr = fi->next->frame; - - addr += LINUX_SIGINFO_SIZE + LINUX_UCONTEXT_SIGCONTEXT_OFFSET; - - fp = read_memory_integer (addr + LINUX_SIGCONTEXT_FP_OFFSET, 8)+8; - + ULONGEST addr; + CORE_ADDR fp, pc; + + if (!fi->signal_handler_caller) + { + fp = cfi_frame_chain (fi); + if (fp) return fp; + else + addr = fi->frame; + } + else + addr = fi->next->frame; + + addr += LINUX_SIGINFO_SIZE + LINUX_UCONTEXT_SIGCONTEXT_OFFSET; + + fp = read_memory_integer (addr + LINUX_SIGCONTEXT_FP_OFFSET, 8) + 8; + + return fp; } void x86_64_init_frame_pc (int fromleaf, struct frame_info *fi) { - CORE_ADDR addr; - - if(fi->next && fi->next->signal_handler_caller) - { - addr = fi->next->next->frame - + LINUX_SIGINFO_SIZE - + LINUX_UCONTEXT_SIGCONTEXT_OFFSET; - fi->pc = read_memory_integer (addr - + LINUX_SIGCONTEXT_PC_OFFSET, 8); - } - else - cfi_init_frame_pc (fromleaf, fi); + CORE_ADDR addr; + + if (fi->next && fi->next->signal_handler_caller) + { + addr = fi->next->next->frame + + LINUX_SIGINFO_SIZE + LINUX_UCONTEXT_SIGCONTEXT_OFFSET; + fi->pc = read_memory_integer (addr + LINUX_SIGCONTEXT_PC_OFFSET, 8); + } + else + cfi_init_frame_pc (fromleaf, fi); } void x86_64_init_extra_frame_info (int fromleaf, struct frame_info *fi) { - cfi_init_extra_frame_info (fromleaf, fi); + cfi_init_extra_frame_info (fromleaf, fi); } diff --git a/gdb/x86-64-tdep.c b/gdb/x86-64-tdep.c index 5d92a99b140..5f6dd3f2053 100644 --- a/gdb/x86-64-tdep.c +++ b/gdb/x86-64-tdep.c @@ -904,7 +904,7 @@ x86_64_skip_prologue (CORE_ADDR pc) /* Sequence of bytes for breakpoint instruction. */ static unsigned char * -x86_64_breakpoint_from_pc (CORE_ADDR * pc, int *lenptr) +x86_64_breakpoint_from_pc (CORE_ADDR *pc, int *lenptr) { static unsigned char breakpoint[] = { 0xcc }; *lenptr = 1; @@ -1090,12 +1090,14 @@ x86_64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Extract from an array REGBUF containing the (raw) register state a function return value of type TYPE, and copy that, in virtual format, into VALBUF. */ - set_gdbarch_deprecated_extract_return_value (gdbarch, x86_64_extract_return_value); + set_gdbarch_deprecated_extract_return_value (gdbarch, + x86_64_extract_return_value); /* Write into the appropriate registers a function return value stored in VALBUF of type TYPE, given in virtual format. */ - set_gdbarch_deprecated_store_return_value (gdbarch, x86_64_store_return_value); + set_gdbarch_deprecated_store_return_value (gdbarch, + x86_64_store_return_value); /* Offset from address of function to start of its code. */ diff --git a/gdb/x86-64-tdep.h b/gdb/x86-64-tdep.h index fd23a7a7f31..9fb2fd05156 100644 --- a/gdb/x86-64-tdep.h +++ b/gdb/x86-64-tdep.h @@ -30,7 +30,7 @@ extern int x86_64_num_gregs; int x86_64_register_number (const char *name); const char *x86_64_register_name (int reg_nr); - + gdbarch_frame_saved_pc_ftype x86_64_linux_frame_saved_pc; gdbarch_saved_pc_after_call_ftype x86_64_linux_saved_pc_after_call; gdbarch_pc_in_sigtramp_ftype x86_64_linux_in_sigtramp; -- 2.30.2