* [patch] Missing UNOP_PLUS handler in c-lang.c
@ 2013-02-12 14:38 Hafiz Abid Qadeer
2013-02-12 19:56 ` Tom Tromey
0 siblings, 1 reply; 2+ messages in thread
From: Hafiz Abid Qadeer @ 2013-02-12 14:38 UTC (permalink / raw)
To: gdb-patches, palves
[-- Attachment #1: Type: text/plain, Size: 961 bytes --]
Hi All,
This patch fixes the problem shown in the session below. The fix was
originally created by Pedro a few years ago. I have updated it with the
current code and regtested it. Is it OK?
(gdb) set debug expression 1
(gdb) p +1
Dump of expression @ 0x8840908, before conversion to prefix form:
Language c, 5 elements, 16 bytes each.
Index Opcode Hex Value String Value
0 OP_LONG 40 (...............
1 <unknown 142879800> 142879800 8,..............
2 BINOP_ADD 1 ................
3 OP_LONG 40 (...............
4 UNOP_PLUS 70 F...............
Dump of expression @ 0x8840908, after conversion to prefix form:
Expression: `Invalid expression
Regards,
Abid
gdb:
2013-02-12 Pedro Alves <palves@redhat.com>
Hafiz Abid Qadeer <abidh@codesourcery.com>
* c-lang.c (c_op_print_tab): Add entry for UNOP_PLUS.
[-- Attachment #2: c-lang.patch --]
[-- Type: text/x-patch, Size: 438 bytes --]
diff --git a/gdb/c-lang.c b/gdb/c-lang.c
index 3a7d6f1..91cb21e 100644
--- a/gdb/c-lang.c
+++ b/gdb/c-lang.c
@@ -732,6 +732,7 @@ const struct op_print c_op_print_tab[] =
{"/", BINOP_DIV, PREC_MUL, 0},
{"%", BINOP_REM, PREC_MUL, 0},
{"@", BINOP_REPEAT, PREC_REPEAT, 0},
+ {"+", UNOP_PLUS, PREC_PREFIX, 0},
{"-", UNOP_NEG, PREC_PREFIX, 0},
{"!", UNOP_LOGICAL_NOT, PREC_PREFIX, 0},
{"~", UNOP_COMPLEMENT, PREC_PREFIX, 0},
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [patch] Missing UNOP_PLUS handler in c-lang.c
2013-02-12 14:38 [patch] Missing UNOP_PLUS handler in c-lang.c Hafiz Abid Qadeer
@ 2013-02-12 19:56 ` Tom Tromey
0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2013-02-12 19:56 UTC (permalink / raw)
To: Hafiz Abid Qadeer; +Cc: gdb-patches, palves
>>>>> ">" == Hafiz Abid Qadeer <hafiz_abid@mentor.com> writes:
>> 2013-02-12 Pedro Alves <palves@redhat.com>
>> Hafiz Abid Qadeer <abidh@codesourcery.com>
>> * c-lang.c (c_op_print_tab): Add entry for UNOP_PLUS.
This is ok.
Tom
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-02-12 19:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-12 14:38 [patch] Missing UNOP_PLUS handler in c-lang.c Hafiz Abid Qadeer
2013-02-12 19:56 ` Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox