Bug 11926 - "p 0x1.1" crashes gdb
Summary: "p 0x1.1" crashes gdb
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: exp (show other bugs)
Version: unknown
: P2 normal
Target Milestone: 7.2
Assignee: dje
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-18 20:27 UTC by dje
Modified: 2012-02-06 15:25 UTC (History)
2 users (show)

See Also:
Host: amd64-linux
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dje 2010-08-18 20:27:37 UTC
bash$ ./gdb -nx
... 7.2.50.20100817-cvs
(gdb) p 0x1.1
../../../src/gdb/gdbtypes.c:1385: internal-error: check_typedef: Assertion `type' 
failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n)
Comment 1 dje 2010-08-18 20:37:19 UTC
Related problems:

(gdb) set lang java
(gdb) p 1.1f
Invalid number "1.1f"
(gdb) set lang pascal
(gdb) p 1.1f
Invalid number "1.1f".

These are also due to invalid suffix handling in the language's respective 
parse_number routines.
Comment 2 Sourceware Commits 2010-08-19 13:33:29 UTC
Subject: Bug 11926

CVSROOT:	/cvs/src
Module name:	src
Changes by:	devans@sourceware.org	2010-08-19 13:33:15

Modified files:
	gdb            : ChangeLog c-exp.y jv-exp.y objc-exp.y p-exp.y 
	                 parse.c parser-defs.h 
	gdb/testsuite  : ChangeLog 
	gdb/testsuite/gdb.base: printcmds.exp 
	gdb/testsuite/gdb.java: jv-print.exp 
Added files:
	gdb/testsuite/gdb.objc: print.exp 
	gdb/testsuite/gdb.pascal: print.exp 
	gdb/testsuite/lib: objc.exp 

Log message:
	PR exp/11926
	* parser-defs.h (parse_float, parse_c_float): Declare.
	* parse.c (parse_float, parse_c_float): New function.
	* c-exp.y (parse_number): Call parse_c_float.
	* objc-exp.y (parse_number): Ditto.
	* p-exp.y (parse_number): Ditto.  Use ANSI/ISO-style definition.
	* jv-exp.y (parse_number): Call parse_float, fix suffix handling.
	
	testsuite/
	* gdb.base/printcmds.exp (test_float_accepted): New function.
	Move existing float tests there.  Add tests for floats with suffixes.
	(test_float_rejected): New function.
	* gdb.java/jv-print.exp (test_float_accepted): New function.
	(test_float_rejected): New function.
	* gdb.objc/print.exp: New file.
	* gdb.pascal/print.exp: New file.
	* lib/objc.exp: New file.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.12099&r2=1.12100
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/c-exp.y.diff?cvsroot=src&r1=1.76&r2=1.77
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/jv-exp.y.diff?cvsroot=src&r1=1.39&r2=1.40
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/objc-exp.y.diff?cvsroot=src&r1=1.38&r2=1.39
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/p-exp.y.diff?cvsroot=src&r1=1.50&r2=1.51
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/parse.c.diff?cvsroot=src&r1=1.103&r2=1.104
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/parser-defs.h.diff?cvsroot=src&r1=1.36&r2=1.37
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.2420&r2=1.2421
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.base/printcmds.exp.diff?cvsroot=src&r1=1.36&r2=1.37
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.java/jv-print.exp.diff?cvsroot=src&r1=1.14&r2=1.15
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.objc/print.exp.diff?cvsroot=src&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.pascal/print.exp.diff?cvsroot=src&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/lib/objc.exp.diff?cvsroot=src&r1=NONE&r2=1.1

Comment 3 Sourceware Commits 2010-08-19 15:50:38 UTC
Subject: Bug 11926

CVSROOT:	/cvs/src
Module name:	src
Branch: 	gdb_7_2-branch
Changes by:	devans@sourceware.org	2010-08-19 15:50:03

Modified files:
	gdb            : ChangeLog c-exp.y 
	gdb/testsuite  : ChangeLog 
	gdb/testsuite/gdb.base: printcmds.exp 

Log message:
	PR exp/11926
	* c-exp.y (parse_number): Handle 0 return from sscanf.
	
	testsuite/
	* gdb.base/printcmds.exp (test_integer_literals_rejected): Add
	test of "p 0x1.1".

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&only_with_tag=gdb_7_2-branch&r1=1.11973.2.32&r2=1.11973.2.33
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/c-exp.y.diff?cvsroot=src&only_with_tag=gdb_7_2-branch&r1=1.76&r2=1.76.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&only_with_tag=gdb_7_2-branch&r1=1.2376.2.9&r2=1.2376.2.10
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.base/printcmds.exp.diff?cvsroot=src&only_with_tag=gdb_7_2-branch&r1=1.34.2.1&r2=1.34.2.2

Comment 4 Tom Tromey 2012-02-06 15:25:23 UTC
Fix was committed a while ago.