public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/13483] New: gdb not taking 0 for pointer and boolean values
@ 2011-12-07 19:36 dnovillo at google dot com
  2011-12-07 20:15 ` [Bug gdb/13483] " keiths at redhat dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: dnovillo at google dot com @ 2011-12-07 19:36 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=13483

             Bug #: 13483
           Summary: gdb not taking 0 for pointer and boolean values
           Product: gdb
           Version: unknown
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
        AssignedTo: unassigned@sourceware.org
        ReportedBy: dnovillo@google.com
    Classification: Unclassified


I'm debugging cc1plus from GCC trunk (as of 2-3 weeks ago).  I'm trying to make
an inferior call to the function libcpp/line-map.c:linemap_dump:

1160    void
1161    linemap_dump (FILE *stream, struct line_maps *set, unsigned ix, bool
is_macro)


(gdb) call linemap_dump(0,line_table,ix,0)
Cannot resolve function linemap_dump to any overloaded instance

But if I use typecasts, it works:

(gdb) call linemap_dump((FILE *)0,line_table,ix,(bool)0)
Map #0 [0x7ffff7fc2000] - LOC: 2 - REASON: LC_ENTER - SYSP: no
File: /usr/include/bits/posix1_lim.h:1
Included from: [-1] None

I suppose this is intended behaviour, but it is rather irritating.  There is
exactly one linemap_dump function, and I would expect 0 to be trivially
convertible to those types:

(gdb) l linemap_dum<TAB>
linemap_dump(_IO_FILE*, line_maps*, unsigned int, bool)
linemap_dump_location(line_maps*, unsigned int, _IO_FILE*)


Thanks.  Diego.

-- 
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.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug gdb/13483] gdb not taking 0 for pointer and boolean values
  2011-12-07 19:36 [Bug gdb/13483] New: gdb not taking 0 for pointer and boolean values dnovillo at google dot com
@ 2011-12-07 20:15 ` keiths at redhat dot com
  2011-12-07 20:19 ` dnovillo at google dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: keiths at redhat dot com @ 2011-12-07 20:15 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=13483

Keith Seitz <keiths at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |keiths at redhat dot com

--- Comment #1 from Keith Seitz <keiths at redhat dot com> 2011-12-07 20:14:13 UTC ---
What version of gdb? I checked in a patch for 13225 which should at least allow
the pointer to work without a cast. I suspect "bool" needs similar treatment.
Does just casting the bool work?

-- 
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.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug gdb/13483] gdb not taking 0 for pointer and boolean values
  2011-12-07 19:36 [Bug gdb/13483] New: gdb not taking 0 for pointer and boolean values dnovillo at google dot com
  2011-12-07 20:15 ` [Bug gdb/13483] " keiths at redhat dot com
@ 2011-12-07 20:19 ` dnovillo at google dot com
  2012-09-10 17:13 ` cvs-commit at gcc dot gnu.org
  2012-09-12 18:44 ` keiths at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: dnovillo at google dot com @ 2011-12-07 20:19 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=13483

--- Comment #2 from Diego Novillo <dnovillo at google dot com> 2011-12-07 20:18:45 UTC ---
On 12/07/11 15:14, keiths at redhat dot com wrote:
> http://sourceware.org/bugzilla/show_bug.cgi?id=13483
>
> Keith Seitz<keiths at redhat dot com>  changed:
>
>             What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                   CC|                            |keiths at redhat dot com
>
> --- Comment #1 from Keith Seitz<keiths at redhat dot com>  2011-12-07 20:14:13 UTC ---
> What version of gdb? I checked in a patch for 13225 which should at least allow
> the pointer to work without a cast. I suspect "bool" needs similar treatment.
> Does just casting the bool work?


Sorry, forgot to include that.  We are using a slightly modified version 
of 7.3.1:

$ gdb --version
GNU gdb (GDB) 7.3.1

If I cast the bool argument, it works fine, yes.



Diego.

-- 
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.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug gdb/13483] gdb not taking 0 for pointer and boolean values
  2011-12-07 19:36 [Bug gdb/13483] New: gdb not taking 0 for pointer and boolean values dnovillo at google dot com
  2011-12-07 20:15 ` [Bug gdb/13483] " keiths at redhat dot com
  2011-12-07 20:19 ` dnovillo at google dot com
@ 2012-09-10 17:13 ` cvs-commit at gcc dot gnu.org
  2012-09-12 18:44 ` keiths at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2012-09-10 17:13 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=13483

--- Comment #3 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> 2012-09-10 17:13:01 UTC ---
CVSROOT:    /cvs/src
Module name:    src
Changes by:    kseitz@sourceware.org    2012-09-10 17:12:53

Modified files:
    gdb            : ChangeLog gdbtypes.h gdbtypes.c 
    gdb/testsuite  : ChangeLog 
    gdb/testsuite/gdb.cp: converts.cc converts.exp 

Log message:
    PR gdb/13483
    * gdbtypes.h (BOOL_PTR_CONVERSION_BADNESS): Rename to ...
    (BOOL_CONVERSION_BADNESS): ... this.
    * gdbtypes.c (BOOL_PTR_CONVERSION_BADNESS): Likewise.
    (rank_one_type): Allow all boolean conversions
    permitted by the standard.

    * gdb.cp/converts.cc (A::A): Add ctor.
    (A::member_): Add member.
    (enum my_enum): New enumeration.
    (main): Add calls to foo1_7 with various
    permitted arguments.
    * gdb.cp/converts.exp: Add tests for boolean
    conversions permitted by the standard.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.14645&r2=1.14646
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/gdbtypes.h.diff?cvsroot=src&r1=1.171&r2=1.172
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/gdbtypes.c.diff?cvsroot=src&r1=1.241&r2=1.242
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.3362&r2=1.3363
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.cp/converts.cc.diff?cvsroot=src&r1=1.4&r2=1.5
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.cp/converts.exp.diff?cvsroot=src&r1=1.7&r2=1.8

-- 
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.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug gdb/13483] gdb not taking 0 for pointer and boolean values
  2011-12-07 19:36 [Bug gdb/13483] New: gdb not taking 0 for pointer and boolean values dnovillo at google dot com
                   ` (2 preceding siblings ...)
  2012-09-10 17:13 ` cvs-commit at gcc dot gnu.org
@ 2012-09-12 18:44 ` keiths at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: keiths at redhat dot com @ 2012-09-12 18:44 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=13483

Keith Seitz <keiths at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
         AssignedTo|unassigned at sourceware    |keiths at redhat dot com
                   |dot org                     |
   Target Milestone|---                         |7.6

--- Comment #4 from Keith Seitz <keiths at redhat dot com> 2012-09-12 18:43:59 UTC ---
I've committed patches for this. Please let me know if there are any further
issues.

-- 
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.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-09-12 18:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-07 19:36 [Bug gdb/13483] New: gdb not taking 0 for pointer and boolean values dnovillo at google dot com
2011-12-07 20:15 ` [Bug gdb/13483] " keiths at redhat dot com
2011-12-07 20:19 ` dnovillo at google dot com
2012-09-10 17:13 ` cvs-commit at gcc dot gnu.org
2012-09-12 18:44 ` keiths at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).