Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Fernando Nasser <fnasser@redhat.com>
To: Michael Snyder <msnyder@cygnus.com>, Stan Shebs <shebs@apple.com>,
	Fernando Nasser <fnasser@cygnus.com>,
	gdb@sources.redhat.com, vinschen@redhat.com
Subject: Re: Stabs or Dwarf Was: [PATCH]: testsuite/gdb.base/constvars.exp
Date: Thu, 27 Sep 2001 12:58:00 -0000	[thread overview]
Message-ID: <3BB383EF.8DB94CF@redhat.com> (raw)
In-Reply-To: <3BB31D00.71964047@redhat.com>

Well, Jim Blandy pointed out that there is already a get_debug_format
(it is used in ptype.exp, list.exp and in half a dozen of the C++ test
files).

It uses the "info source" command that Michael mentioned (so it is as
reliable
as "info source" is).


For convenience, there is also a setup_xfail_format that causes the
following
test to fail if the debug format is the one specified.  As Michael
Snyder
pointed out in another list, we actually have concluded that we should
do the
opposite: xfail if _not_ the specified format ;-)  Anyway, it is simple
to
test for DWARF2 or any other that we know we can detect more reliably
and that
can accommodate the tests and xfail for all the others.


Thanks to all for the suggestions.


Here is the code for the function:

global debug_format
set debug_format "unknown"

# Run the gdb command "info source" and extract the debugging format
# information from the output and save it in debug_format.

proc get_debug_format { } {
    global gdb_prompt
    global verbose
    global expect_out
    global debug_format

    set debug_format "unknown"
    send_gdb "info source\n"
    gdb_expect 10 {
        -re "Compiled with (.*) debugging format.\r\n$gdb_prompt $" {
            set debug_format $expect_out(1,string)
            verbose "debug format is $debug_format"
            return 1;
        }
        -re "No current source file.\r\n$gdb_prompt $" {
            perror "get_debug_format used when no current source file"
            return 0;
        }
        -re "$gdb_prompt $" {
            warning "couldn't check debug format (no valid response)."
            return 1;
        }
        timeout {
            warning "couldn't check debug format (timed out)."
            return 1;
        }
    }
}

-- 
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9


      reply	other threads:[~2001-09-27 12:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20010925192434.M29024@cygbert.vinschen.de>
     [not found] ` <3BB0C224.AB324D56@cygnus.com>
     [not found]   ` <3BB0CB81.8385E123@redhat.com>
     [not found]     ` <3BB0F122.3E45B3ED@cygnus.com>
2001-09-26 13:16       ` Fernando Nasser
2001-09-26 14:39         ` Stan Shebs
2001-09-26 15:02           ` Fernando Nasser
2001-09-26 15:22             ` Elena Zannoni
2001-09-27  5:44               ` Fernando Nasser
2001-09-27  8:24                 ` Elena Zannoni
2001-09-26 15:23             ` Michael Snyder
2001-09-27  5:39               ` Fernando Nasser
2001-09-27 12:58                 ` Fernando Nasser [this message]

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=3BB383EF.8DB94CF@redhat.com \
    --to=fnasser@redhat.com \
    --cc=fnasser@cygnus.com \
    --cc=gdb@sources.redhat.com \
    --cc=msnyder@cygnus.com \
    --cc=shebs@apple.com \
    --cc=vinschen@redhat.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