From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8773 invoked by alias); 16 Nov 2011 19:36:47 -0000 Received: (qmail 8626 invoked by uid 22791); 16 Nov 2011 19:36:46 -0000 X-SWARE-Spam-Status: No, hits=-7.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 16 Nov 2011 19:36:27 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pAGJaMU7014965 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 16 Nov 2011 14:36:22 -0500 Received: from greed.delorie.com ([10.3.113.11]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id pAGJaLSL026459 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 16 Nov 2011 14:36:22 -0500 Received: from greed.delorie.com (greed.delorie.com [127.0.0.1]) by greed.delorie.com (8.14.4/8.14.4) with ESMTP id pAGJaKn2006961; Wed, 16 Nov 2011 14:36:20 -0500 Received: (from dj@localhost) by greed.delorie.com (8.14.4/8.14.4/Submit) id pAGJaKfW006960; Wed, 16 Nov 2011 14:36:20 -0500 Date: Wed, 16 Nov 2011 19:36:00 -0000 Message-Id: <201111161936.pAGJaKfW006960@greed.delorie.com> From: DJ Delorie To: Mike Frysinger CC: gdb-patches@sourceware.org In-reply-to: <201111161409.19823.vapier@gentoo.org> (message from Mike Frysinger on Wed, 16 Nov 2011 14:09:18 -0500) Subject: Re: [sim] new port: Renesas RL78 References: <201111160606.pAG66U4p017015@greed.delorie.com> <201111161409.19823.vapier@gentoo.org> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-11/txt/msg00447.txt.bz2 Replying only to the things that don't require a code change ("yet" perhaps): > > + $(ENDLIST) > > this $(ENDLIST) business looks like dead code ? I've been brainwashed to end lists like this so that new lines always end with a continuation char, which - in ancient and possibly modern source control systems - prevents two independent additions from becoming dependent on each other. It also allows you to sort or otherwise mess with the list, without worrying about which lines have continuation characters and which don't. > > + printf("%s", buf); > > debug code ? trace code. > > + printf ("PSW: \033[31m"); > > + psw_string (old_psw); > > + printf (" \033[32m"); > > yikes, unavoidable ascii escapes ? Yup. I'm a big fan of color when I'm sifting through at megabytes of machine traces. > > +#include > > doesn't seem to be used here A jmp_buf is declared in that file. > > +int > > +main (int argc, char **argv) > > +{ > > ... > > + setbuf(stdout, NULL); > > doesn't this hurt performance ? especially when tracing ? Very important when emulating the target serial port, though. I suppose I could rework that logic, but so far I've mostly been worried about "runs correctly" and not "runs fast". > > --- /dev/null 1 Jan 1970 00:00:00 -0000 > > +++ sim/rl78/mem.c 16 Nov 2011 05:44:54 -0000 > > seems like much of the utility of this file is duplicating the core mapping= > s=20 > logic in like common/sim-core.c :/ It's mostly about emulating memory-mapped hardware and the weird RL78 mapping rules, though. The common parts are a small part of it. > > + fprintf (stack_tty, "\033[1;1H\033[J"); > > +} > > +#endif > > in general though, yikes ... looks like this would be better as a command l= > ine=20 > option specifying the output ... Perhaps. I'm used to being able to just tweak the sources as needed ;-) And again, that's probably not code you *want* the average person to use. What it does is maintain a LIVE stack trace on a tty while the sim is running, so you can spot "stuck" patterns. > > +#if 0 > > + if (trace) > > + { > > + int i; > > + skip_init ++; > > + for (i=3D0; i<8; i++) > > + printf(" %02x", mem_get_qi (0xf0000 | (a + i)) & 0xff); > > + skip_init --; > > + } > > +#endif > > just delete then ? No, I keep chunks like this around if they're useful for exotic debugging needs that don't warrant a command line option. This chunk, for example, dumps the on-stack arguments to the trace for each CALL insn.