From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9092 invoked by alias); 1 Mar 2003 20:57:17 -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 9084 invoked from network); 1 Mar 2003 20:57:17 -0000 Received: from unknown (HELO duracef.shout.net) (204.253.184.12) by 172.16.49.205 with SMTP; 1 Mar 2003 20:57:17 -0000 Received: (from mec@localhost) by duracef.shout.net (8.11.6/8.11.6) id h21KvFv26400; Sat, 1 Mar 2003 14:57:15 -0600 Date: Sat, 01 Mar 2003 20:57:00 -0000 From: Michael Elizabeth Chastain Message-Id: <200303012057.h21KvFv26400@duracef.shout.net> To: brobecker@gnat.com, kettenis@chello.nl Subject: Re: 8-byte register values on a 32-bit machine Cc: gdb@sources.redhat.com X-SW-Source: 2003-03/txt/msg00010.txt.bz2 For concreteness, suppose that the user has a structure with two integers in it, and sizeof(int) is the natural register size (which of course has been the design principle for C for decades). struct point { int x; int y; }; struct point p1 = { 1234, 5678 }; Everybody's favorite output is: (gdb) print p1 $1 = {1234, 5678} Right now gdb can print lies: (gdb) print p1 $1 = {1234, -8675309} Incorrect data is much worse than no data at all. Instead of iterating over registers, I would like gdb to print: (gdb) print p1 $1 = {1234, } I'm not stuck on "". It can be any string which indicates the debugger can't tell the user what's in p1.y. The heinous part is that gdb *knows* it is pulling some register value out of its ass for p1.y. I understand that on some targets, gcc and gdb might agree on register number allocation (ignore for the moment that there are other compilers besides gcc). Okay, for targets where we have a guarantee about that, then enable sequential register access. But i686-pc-linux-gnu is definitely not such a target. Somewhat worse is: (gdb) print p1 $1 = If the compiler tells us that an 8-byte variable is in a 4-byte register, I feel comfortable printing the first 4 bytes. But I would actually printing no values to printing incorrect values. If a debug format has enough information to print {1234, 5678}, that's great. And we should ask gcc to give us that much information in all the formats we can get to. If we're lucky, then stabs+ will become obsolete faster than people start seeing more multi-register variables. :) Michael C