Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Saurabh T <saurabh@hotmail.com>
To: "gdb@sourceware.org" <gdb@sourceware.org>
Subject: Problem calling functions within gdb (version 7.5)
Date: Wed, 24 Apr 2013 21:30:00 -0000	[thread overview]
Message-ID: <DUB123-W3379C1D5569CB0664A9923B1B50@phx.gbl> (raw)

Here's a simple C++ example:
 
#include <stdio.h>
 
void fn(int n, const double (*x)[3])
{
  for (int i=0; i < n; i++)
    printf("%g %g %g\n", x[i][0], x[i][1], x[i][2]);
}
 
void fn2(int *k)
{ printf("%d\n", *k); }
 
int main()
{
  int n = 3;
  const double x[3][3] = {{1, 2, 3}, {3, 4, 5}, {5, 6, 7}};
  fn(3, x);
  int *k = &n;
  fn2(k);
  return 0;
}
 
In gdb, if you put a breakpoint at the return 0 line, run until there, and say:
 
1. call fn(3, x)
gdb says: Cannot resolve function fn to any overloaded instance
This used to work with gdb 7.2. The function signature completely matches the arguments so I dont know what it's complaining about.
 
2. print k
Let's say this prints 0x7ffb24
call fn2(0x7ffb24)
gdb again says: Cannot resolve function fn2 to any overloaded instance
This also used to work with gdb 7.2. Here I can understand if promoting ints to arbitrary pointers is no longer supported.
 
Any thoughts as to whether these are bugs, or how I can get the behaviour I want at least wrt case 1?
 
Thanks. 		 	   		  
From gdb-return-42043-listarch-gdb=sources.redhat.com@sourceware.org Thu Apr 25 06:41:31 2013
Return-Path: <gdb-return-42043-listarch-gdb=sources.redhat.com@sourceware.org>
Delivered-To: listarch-gdb@sources.redhat.com
Received: (qmail 4152 invoked by alias); 25 Apr 2013 06:41:30 -0000
Mailing-List: contact gdb-help@sourceware.org; run by ezmlm
Precedence: bulk
List-Id: <gdb.sourceware.org>
List-Subscribe: <mailto:gdb-subscribe@sourceware.org>
List-Archive: <http://sourceware.org/ml/gdb/>
List-Post: <mailto:gdb@sourceware.org>
List-Help: <mailto:gdb-help@sourceware.org>, <http://sourceware.org/ml/#faqs>
Sender: gdb-owner@sourceware.org
Delivered-To: mailing list gdb@sourceware.org
Received: (qmail 4141 invoked by uid 89); 25 Apr 2013 06:41:30 -0000
X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,SPF_PASS autolearn=ham version=3.3.1
Received: from mail-bk0-f54.google.com (HELO mail-bk0-f54.google.com) (209.85.214.54)    by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 25 Apr 2013 06:41:29 +0000
Received: by mail-bk0-f54.google.com with SMTP id q11so1103858bkw.27        for <gdb@sourceware.org>; Wed, 24 Apr 2013 23:41:27 -0700 (PDT)
X-Received: by 10.205.75.3 with SMTP id yy3mr14279404bkb.80.1366872087083; Wed, 24 Apr 2013 23:41:27 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.205.83.204 with HTTP; Wed, 24 Apr 2013 23:40:46 -0700 (PDT)
From: Hui Zhu <teawater@gmail.com>
Date: Thu, 25 Apr 2013 06:41:00 -0000
Message-ID: <CANFwon0v3pwvC_iJbEnzVp4ZB-B+zphAg-C+hrQqF153P+M_ag@mail.gmail.com>
Subject: New format of 7.6 branch gdb/ChangeLog?
To: gdb@sourceware.org
Content-Type: text/plain; charset=ISO-8859-1
X-SW-Source: 2013-04/txt/msg00078.txt.bz2
Content-length: 490

2013-04-24  Hui Zhu  <hui@codesourcery.com>

	PR gdb/15165

	* breakpoint.c (dprintf_print_recreate): New.
	(save_breakpoints): Let it not save dprintf commands.
	(initialize_breakpoint_ops): Set dprintf_print_recreate.

gdb/
2013-04-19  Vladimir Kargov <kargov@gmail.com>
	    Pedro Alves  <palves@redhat.com>

	* i387-tdep.c (i387_print_float_info): Use gdb_byte for pointer to
	value contents.

"gdb/"
Is this a new format of Changelog?  Do I need move changelog after it?

Thanks,
Hui


             reply	other threads:[~2013-04-24 21:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-24 21:30 Saurabh T [this message]
2013-04-25 13:10 ` Phil Muldoon
2013-04-25 13:26   ` Tom Tromey
2013-04-25 13:25 ` Tom Tromey
2013-04-25 14:24   ` Saurabh T
     [not found]     ` <5179472B.5020107@redhat.com>
2013-04-25 15:45       ` Saurabh T
     [not found]         ` <517955D3.4010101@redhat.com>
2013-04-25 16:35           ` Saurabh T

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=DUB123-W3379C1D5569CB0664A9923B1B50@phx.gbl \
    --to=saurabh@hotmail.com \
    --cc=gdb@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