Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sourceware.org
Subject: [commit/Ada] Use our builtin type when evaluating conditional 	expressions
Date: Fri, 13 Mar 2009 01:35:00 -0000	[thread overview]
Message-ID: <20090313012134.GA11284@adacore.com> (raw)

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

This is a problem reported by a customer who was debugging a gigantic
application. I think it was on pa-hpux, but it might have been on
x86-linux, and the target is actually not relevant. We reproduced
the problem with the following command:

    (gdb) p null /= null

It first hangs for a while, and then we get:

    utils.c:1020: internal-error: virtual memory exhausted: can't allocate 4072 bytes.
    A problem internal to GDB has been detected,
    further debugging may prove unreliable.

Jerome Guitton did the investigation and said:

The problem comes from the fact that GDB casts "null /= null" into the
language boolean type (i.e. "standard.boolean"). And it lookups the
boolean type into the debug info of the application. As type boolean
is defined in every compilation unit, every psymtabs matchs; as a
consequence, all the corresponding symtabs are built. This roughly
means that the debugger loads every symbols when evaluating a
conditional expression. As the application is really huge, we run
out of memory before completing the operation.

This problem is avoided by making sure that we use our boolean
builtin type rather than trying to look it up...

2009-03-12  Jerome Guitton  <guitton@adacore.com>

        * language.c (lang_bool_type): Set lai->bool_type_symbol to NULL.

Tested on amd64-linux. Checked in.

-- 
Joel

[-- Attachment #2: 06-builtin-boolean.diff --]
[-- Type: text/x-diff, Size: 424 bytes --]

diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 0724804..0ec724f 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -11013,7 +11013,7 @@ ada_language_arch_info (struct gdbarch *gdbarch,
   TYPE_NAME (lai->primitive_type_vector [ada_primitive_type_system_address])
     = "system__address";
 
-  lai->bool_type_symbol = "boolean";
+  lai->bool_type_symbol = NULL;
   lai->bool_type_default = builtin->builtin_bool;
 }
 \f

             reply	other threads:[~2009-03-13  1:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-13  1:35 Joel Brobecker [this message]
2009-03-17 20:12 ` Tom Tromey
2009-03-17 20:13   ` Joel Brobecker

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=20090313012134.GA11284@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /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