Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Benjamin Kosnik <bkoz@redhat.com>
To: Paul Pogonyshev <pogonyshev@gmx.net>
Cc: libstdc++@gcc.gnu.org, gdb@sourceware.org
Subject: setting breakpoints with C++ typedef names [was: Re: debug  information]
Date: Wed, 22 Nov 2006 12:03:00 -0000	[thread overview]
Message-ID: <20061122130341.a4436ce2.bkoz@redhat.com> (raw)
In-Reply-To: <200611212225.28377.pogonyshev@gmx.net>


> 
> But still function names include full type name: `b 'bar(basic_pod<int>)''.
> Not much of a problem in this case, but sometimes the full name is very
> long...

Oh. I finally understand you. Yes, this is a drag.

You want to be able to do:

(gdb) b bar(ipod)

instead of

(gdb) b bar(basic_pod<int>)

As you've noticed, this doesn't currently work. (x86-linux, mainline
gcc, gdb (6.5-13.fc6rh))

(gdb) b bar(ipod)
Function "bar(ipod)" not defined.

As you stated, you have to:

(gdb) b bar(basic_pod<int>)
Breakpoint 4 at 0x80489d7: file debug.cc, line 24.

I suggest reporting this to the gdb list (gdb@sourceware.org). You
might want to title that email something like "setting breakpoints with
C++ typedef names" or something more descriptive. Here, I've done that
for you.

To me, it looks like enough information is present in the debuginfo to
support this kind of usage. However, I am no expert in this area.

-benjamin

ps. Here's the test case

 
template<typename T>
struct basic_pod
{
  typedef T value_type;
  value_type _M_data;
};

typedef basic_pod<int> ipod;

void
bar(ipod p)
{
  p._M_data = 0;
}

void
bar(int i)
{
  ++i;
}

int main()
{
  ipod p;
  bar(p); // b bar(ipod)
  bar(5); // b bar(int)
  return 0;
}


       reply	other threads:[~2006-11-22 12:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200611191342.48724.pogonyshev@gmx.net>
     [not found] ` <20061121100701.6b980f48.bkoz@redhat.com>
     [not found]   ` <200611212225.28377.pogonyshev@gmx.net>
2006-11-22 12:03     ` Benjamin Kosnik [this message]
2006-11-22 13:35       ` Daniel Jacobowitz
2006-11-24 21:11       ` Martin Sebor
2006-11-24 21:28         ` Paul Pogonyshev

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=20061122130341.a4436ce2.bkoz@redhat.com \
    --to=bkoz@redhat.com \
    --cc=gdb@sourceware.org \
    --cc=libstdc++@gcc.gnu.org \
    --cc=pogonyshev@gmx.net \
    /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