From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17205 invoked by alias); 6 Mar 2013 18:52:31 -0000 Received: (qmail 17187 invoked by uid 48); 6 Mar 2013 18:52:30 -0000 From: "palves at redhat dot com" To: gdb-prs@sourceware.org Subject: [Bug exp/15238] New: odd things with printing function types (p *****************_start) Date: Wed, 06 Mar 2013 18:52:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: exp X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: palves at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org X-SW-Source: 2013-q1/txt/msg00392.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=15238 Bug #: 15238 Summary: odd things with printing function types (p *****************_start) Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: exp AssignedTo: unassigned@sourceware.org ReportedBy: palves@redhat.com Classification: Unclassified $ gdb ... ... 0x0000003d25a01530 in _start () from /lib64/ld-linux-x86-64.so.2 (gdb) p _start $1 = {} 0x402860 <_start> I was trying to poke at the first address of _start. I forgot one needs to write "p *(char *)_start = 1", and got: (gdb) p *_start = 1 Invalid cast. Trying to recall the correct syntax, I noticed that dereferencing a function yields back the same thing: (gdb) p *_start $2 = {} 0x402860 <_start> and on: (gdb) p **_start $3 = {} 0x402860 <_start> and on... : (gdb) p *****************************************_start $30 = {} 0x402860 <_start> That looks bizarre. I don't have debug info for _start, so GDB assumes 'int()': (gdb) ptype _start type = int () But: (gdb) ptype *_start Attempt to take contents of a non-pointer value. I _think_ ptype is right in erroring out. Maybe the print behavior is intended though, not sure, haven't looked at the code. But then I'm surprised that print "works" and ptype doesn't. If an expression works with one, it should work with the other, and the inverse too. -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.