From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12945 invoked by alias); 22 Sep 2003 06:46:19 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 12937 invoked from network); 22 Sep 2003 06:46:15 -0000 Received: from unknown (HELO localhost.redhat.com) (65.49.0.121) by sources.redhat.com with SMTP; 22 Sep 2003 06:46:15 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 884782B89; Mon, 22 Sep 2003 02:46:14 -0400 (EDT) Message-ID: <3F6E9AB6.3020900@redhat.com> Date: Mon, 22 Sep 2003 06:46:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030820 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jafa Cc: gdb@sources.redhat.com Subject: Re: ip2k port References: <03a701c37bc1$037ca1f0$0502a8c0@scenix.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-09/txt/msg00270.txt.bz2 This isn't needed. All targets a bi-endian. Even the i386: > /* Define the bit, byte, and word ordering of the machine. */ > #define TARGET_BYTE_ORDER BFD_ENDIAN_BIG Ok, looks like this will need multi-arching. Can you file a bug report to track this? > /* Functions for dealing with epilogue call and return stubs. */ > #define IGNORE_HELPER_CALL(pc) ip2k_ignore_helper (pc) > extern int ip2k_ignore_helper (CORE_ADDR pc); This thread stuff could do with some comments, I'm also wondering if these constants belong in a header somewhere: /* Threads. */ #define IP2K_ISR_THREAD 1 #define IP2K_MAIN_THREAD 2 #define IP2K_VM_THREAD 3 Where sensible, use enums, rather than #define's: #define DEBUG_NONE 0 #define DEBUG_NORMAL 1 #define DEBUG_EXTRA 2 #define DEBUG_MAX 3 Use NOINDENT (Ref: defs.h), otherwize, gdb_indent.sh will muck up these tables: /* Prologue instructions - return address. push CALLL (0x447f) push CALLH (0x447e) */ Debug output is printed with "fprintf_unfiltered (gdb_stdlog, ...): if (debug_level >= DEBUG_MAX) printf_filtered ("ip2k_address_to_pointer\n"); Print CORE_ADDRS using "0x%s", paddr[_nz](): warning ("invalid instruction pointer: 0x%08lx", addr); Don't print internal errors using warning, call internal_error, or even just use ARRAY_SIZE in an assert: warning ("internal error: ip2k_register_name: invalid register: 0x%08x", r Use warning(), not printf_filtered for warnings: printf_filtered ("warning: unable to find start of function of pc: 0x%08lx\n", pc); Call error() for errors: printf_unfiltered ("Error: Return values longer than 8 bytes are not suppo rted.\n"); If you re-factor the function (spliting it into two), the "goto" can be replaced by a "return: finish: I've fixed frame.c, so this is no longer needed: /* Check that we're not going round in circles with the same frame ID (but avoid applying the test to sentinel frames which do go round in circles). Can't use frame_id_eq() as that doesn't yet compare the frame's PC value. */ In the frame code, frame*memory, instead of target_read_memory, should be used: if (target_read_memory (info->current_sp + 1, buf, 1) != 0) finish: It all looks byte order clean (which is the most common problem) and not to scary. The above are all minor tweaks. BTW, do you have a list of people that contributed to the file? Andrew