Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@gnat.com>
To: Michael Elizabeth Chastain <mec.gnu@mindspring.com>
Cc: ezannoni@redhat.com, gdb-patches@sources.redhat.com
Subject: Re: [RFA/dwarf-2] Fix for the null record problem
Date: Thu, 26 Feb 2004 20:23:00 -0000	[thread overview]
Message-ID: <20040226202317.GF1154@gnat.com> (raw)
In-Reply-To: <20040226194953.AB5A74B104@berman.michael-chastain.com>

[-- Attachment #1: Type: text/plain, Size: 630 bytes --]

> I like the idea, but there are two gotchas:
> 
> . update the copyright year in class2.exp
    (sound of a club banging on my head)

> . quote the '{' and '}' chars in class2.exp:
> 
>   "= \{<No data fields>\}"
> 
> With these two changes, and if you re-test, then I approve the patch.

Thanks. Here is what I ended up checking in.

2004-02-26  J. Brobecker  <brobecker@gnat.com>

        * gdb.cp/class2.cc (empty): New class.
        (refer): New function.
        (main): Declare an object of type empty and use it.
        * gdb.cp/class2.exp: Print the value of an object of type empty.

Re-tested on x86-linux.

-- 
Joel

[-- Attachment #2: empty.diff --]
[-- Type: text/plain, Size: 1562 bytes --]

Index: class2.cc
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/class2.cc,v
retrieving revision 1.2
diff -u -r1.2 class2.cc
--- class2.cc	11 Feb 2004 14:01:25 -0000	1.2
+++ class2.cc	26 Feb 2004 20:09:08 -0000
@@ -48,10 +48,19 @@
   ;
 }
 
+struct empty {};
+
+// Stop the compiler from optimizing away data.
+void refer (empty *)
+{
+  ;
+}
+
 int main (void)
 {
   A alpha, *aap, *abp;
   B beta, *bbp;
+  empty e;
 
   alpha.a1 = 100;
   beta.a1 = 200; beta.b1 = 201; beta.b2 = 202;
@@ -59,6 +68,7 @@
   aap = &alpha; refer (aap);
   abp = &beta;  refer (abp);
   bbp = &beta;  refer (bbp);
+  refer (&e);
 
   return 0;  // marker return 0
 } // marker close brace
Index: class2.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/class2.exp,v
retrieving revision 1.1
diff -u -r1.1 class2.exp
--- class2.exp	25 Nov 2003 15:01:31 -0000	1.1
+++ class2.exp	26 Feb 2004 20:09:08 -0000
@@ -1,4 +1,4 @@
-# Copyright 2003 Free Software Foundation, Inc.
+# Copyright 2003, 2004 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -113,3 +113,7 @@
 gdb_test "print * (B *) abp" \
     "= {.*a1 = 200.*b1 = 201.*b2 = 202}" \
     "print * (B *) abp at marker return 0"
+
+# Printing the value of an object containing no data fields:
+
+gdb_test "p e" "= \{<No data fields>\}" "print object with no data fields"

  reply	other threads:[~2004-02-26 20:23 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-26 19:49 Michael Elizabeth Chastain
2004-02-26 20:23 ` Joel Brobecker [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-02-26 21:34 Michael Elizabeth Chastain
2004-02-19 14:01 Joel Brobecker
2004-02-19 21:52 ` Elena Zannoni
2004-02-19 23:29   ` Andrew Cagney
2004-02-19 23:37   ` Joel Brobecker
2004-02-26  2:31   ` Joel Brobecker
2004-02-26  3:27     ` Daniel Jacobowitz
2004-02-26 19:00       ` Joel Brobecker
2004-04-01  1:18   ` Joel Brobecker
2004-04-13  5:26     ` Joel Brobecker
2004-04-14 17:24       ` Jim Blandy
2004-04-14 17:47         ` Daniel Jacobowitz
2004-04-15  5:01           ` Jim Blandy
2004-04-15 20:43             ` Joel Brobecker
2004-04-16  3:18               ` Joel Brobecker
2004-04-16  3:59                 ` Jim Blandy
2004-04-15  5:33           ` Jim Blandy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040226202317.GF1154@gnat.com \
    --to=brobecker@gnat.com \
    --cc=ezannoni@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=mec.gnu@mindspring.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox