From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30103 invoked by alias); 18 Aug 2002 17:56:23 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 30096 invoked from network); 18 Aug 2002 17:56:23 -0000 Received: from unknown (HELO localhost.redhat.com) (66.30.197.194) by sources.redhat.com with SMTP; 18 Aug 2002 17:56:23 -0000 Received: by localhost.redhat.com (Postfix, from userid 469) id 4672B10CC3; Sun, 18 Aug 2002 13:54:30 -0400 (EDT) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15711.57174.599572.257610@localhost.redhat.com> Date: Sun, 18 Aug 2002 10:56:00 -0000 To: gdb-patches@sources.redhat.com Subject: [RFA] rs6000-tdep.c: Remove TDEP macro X-SW-Source: 2002-08/txt/msg00513.txt.bz2 This one is pretty obvious. This macro has been on my list of things to cleanup for a while, so here it goes. Elena 2002-08-18 Elena Zannoni * rs6000-tdep.c (TDEP): Delete macro. (branch_dest): Replace use of TDEP macro with its body. (rs6000_pop_frame): Ditto. (rs6000_push_arguments): Ditto. (rs6000_skip_trampoline_code): Ditto. (rs6000_frame_saved_pc): Ditto. (rs6000_frame_chain): Ditto. (rs6000_register_name): Ditto. (rs6000_register_byte): Ditto. (rs6000_register_raw_size): Ditto. (rs6000_register_virtual_type): Ditto. (rs6000_register_convertible): Ditto. (rs6000_convert_from_func_ptr_addr): Ditto. Index: rs6000-tdep.c =================================================================== RCS file: /cvs/uberbaum/gdb/rs6000-tdep.c,v retrieving revision 1.70 diff -u -p -p -r1.70 rs6000-tdep.c --- rs6000-tdep.c 15 Jul 2002 15:09:55 -0000 1.70 +++ rs6000-tdep.c 18 Aug 2002 17:53:03 -0000 @@ -88,10 +88,6 @@ struct reg unsigned char fpr; /* whether register is floating-point */ }; -/* Return the current architecture's gdbarch_tdep structure. */ - -#define TDEP gdbarch_tdep (current_gdbarch) - /* Breakpoint shadows for the single step instructions will be kept here. */ static struct sstep_breaks @@ -252,7 +248,7 @@ branch_dest (int opcode, int instr, CORE fi = get_current_frame (); if (fi != NULL) dest = read_memory_addr (fi->frame + SIG_FRAME_PC_OFFSET, - TDEP->wordsize); + gdbarch_tdep (current_gdbarch)->wordsize); } } @@ -857,7 +853,7 @@ rs6000_pop_frame (void) addr = get_pc_function_start (frame->pc); (void) skip_prologue (addr, frame->pc, &fdata); - wordsize = TDEP->wordsize; + wordsize = gdbarch_tdep (current_gdbarch)->wordsize; if (fdata.frameless) prev_sp = sp; else @@ -942,7 +938,7 @@ rs6000_push_arguments (int nargs, struct int argbytes; /* current argument byte */ char tmp_buffer[50]; int f_argno = 0; /* current floating point argno */ - int wordsize = TDEP->wordsize; + int wordsize = gdbarch_tdep (current_gdbarch)->wordsize; struct value *arg = 0; struct type *type; @@ -1284,7 +1280,7 @@ rs6000_skip_trampoline_code (CORE_ADDR p return 0; } ii = read_register (11); /* r11 holds destination addr */ - pc = read_memory_addr (ii, TDEP->wordsize); /* (r11) value */ + pc = read_memory_addr (ii, gdbarch_tdep (current_gdbarch)->wordsize); /* (r11) value */ return pc; } @@ -1329,7 +1325,7 @@ rs6000_frame_saved_pc (struct frame_info { CORE_ADDR func_start; struct rs6000_framedata fdata; - struct gdbarch_tdep *tdep = TDEP; + struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); int wordsize = tdep->wordsize; if (fi->signal_handler_caller) @@ -1533,7 +1529,7 @@ CORE_ADDR rs6000_frame_chain (struct frame_info *thisframe) { CORE_ADDR fp, fpp, lr; - int wordsize = TDEP->wordsize; + int wordsize = gdbarch_tdep (current_gdbarch)->wordsize; if (PC_IN_CALL_DUMMY (thisframe->pc, thisframe->frame, thisframe->frame)) return thisframe->frame; /* dummy frame same as caller's frame */ @@ -1578,7 +1574,7 @@ regsize (const struct reg *reg, int word static const char * rs6000_register_name (int n) { - struct gdbarch_tdep *tdep = TDEP; + struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); const struct reg *reg = tdep->regs + n; if (!regsize (reg, tdep->wordsize)) @@ -1592,7 +1588,7 @@ rs6000_register_name (int n) static int rs6000_register_byte (int n) { - return TDEP->regoff[n]; + return gdbarch_tdep (current_gdbarch)->regoff[n]; } /* Return the number of bytes of storage in the actual machine representation @@ -1601,7 +1597,7 @@ rs6000_register_byte (int n) static int rs6000_register_raw_size (int n) { - struct gdbarch_tdep *tdep = TDEP; + struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); const struct reg *reg = tdep->regs + n; return regsize (reg, tdep->wordsize); } @@ -1612,7 +1608,7 @@ rs6000_register_raw_size (int n) static struct type * rs6000_register_virtual_type (int n) { - struct gdbarch_tdep *tdep = TDEP; + struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); const struct reg *reg = tdep->regs + n; if (reg->fpr) @@ -1655,7 +1651,7 @@ rs6000_coerce_float_to_double (struct ty static int rs6000_register_convertible (int n) { - const struct reg *reg = TDEP->regs + n; + const struct reg *reg = gdbarch_tdep (current_gdbarch)->regs + n; return reg->fpr; } @@ -1998,7 +1994,7 @@ rs6000_convert_from_func_ptr_addr (CORE_ return addr; /* ADDR is in the data space, so it's a special function pointer. */ - return read_memory_addr (addr, TDEP->wordsize); + return read_memory_addr (addr, gdbarch_tdep (current_gdbarch)->wordsize); }