Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: mike tiberium <mike.tiberium@gmail.com>
Cc: gdb@sourceware.org
Subject: Re: GDB with Ada doesn't print variables neither works with GPS
Date: Wed, 01 Aug 2007 06:40:00 -0000	[thread overview]
Message-ID: <20070801064404.GA3619@adacore.com> (raw)
In-Reply-To: <5fd4beb00707311220s36442a40lf45b0857bfa9196d@mail.gmail.com>

> I've built my application like this:
> gnatmake -f -g hello
> And also tried:
> gnatmake -f -g -gnatdA -gnatdV hello
> What am I missing here?

Nothing. This is the proper way to build your program. But the compiler
you are using is producing incomplete debugging information. I get
the proper result when I use GNAT Pro (the compiler supported by Ada
Core).

This is confirmed by:

> > What does ptype Hello_String.all say? It should say "array of
> > character". If it doesn't then, the GDB output is expected.
> 
> 
> For these variables I get:
> 
> Hello_String: constant STRING := "Hello, world! - string variable";
> (gdb) ptype Hello_String
> type = array (1 .. 31) of <1-byte integer>
> 
> Bye_String : String_Access := new String'("Bye! - string access");
> (gdb) ptype Bye_String
> type = array (<>) of <1-byte integer>

This confirms that the debugging info is incomplete. The debugger
cannot guess that the "1-byte integer" is a character, and thus
prints the array as an array rather than a string.

-- 
Joel


  parent reply	other threads:[~2007-08-01  6:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5fd4beb00707291452j430533b1q37f924b63fdc456c@mail.gmail.com>
2007-07-29 23:20 ` mike tiberium
2007-07-30  3:21   ` Joel Brobecker
     [not found]     ` <5fd4beb00707311220s36442a40lf45b0857bfa9196d@mail.gmail.com>
2007-08-01  6:40       ` Joel Brobecker [this message]
2007-08-01  0:10   ` debugging the multithreads on PPC embedded platfom Jayasri Sangu
2007-08-01  3:15     ` Eli Zaretskii
2007-08-01  3:22     ` Daniel Jacobowitz

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=20070801064404.GA3619@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb@sourceware.org \
    --cc=mike.tiberium@gmail.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