This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
Re: breakpoints/1052: GDB 5.3 (macro supporting) - macro value is string without quotes.
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: nobody at sources dot redhat dot com
- Cc: gdb-prs at sources dot redhat dot com,
- Date: 12 Feb 2003 15:18:01 -0000
- Subject: Re: breakpoints/1052: GDB 5.3 (macro supporting) - macro value is string without quotes.
- Reply-to: Daniel Jacobowitz <drow at mvista dot com>
The following reply was made to PR breakpoints/1052; it has been noted by GNATS.
From: Daniel Jacobowitz <drow@mvista.com>
To: sana@stl.sarov.ru
Cc: gdb-gnats@sources.redhat.com, miwako.tokugawa@intel.com
Subject: Re: breakpoints/1052: GDB 5.3 (macro supporting) - macro value is string without quotes.
Date: Wed, 12 Feb 2003 10:16:12 -0500
On Wed, Feb 12, 2003 at 08:28:47AM -0000, sana@stl.sarov.ru wrote:
>
> >Number: 1052
> >Category: breakpoints
> >Synopsis: GDB 5.3 (macro supporting) - macro value is string without quotes.
> >Confidential: no
> >Severity: serious
> >Priority: high
> >Responsible: unassigned
> >State: open
> >Class: sw-bug
> >Submitter-Id: net
> >Arrival-Date: Wed Feb 12 08:38:00 UTC 2003
> >Closed-Date:
> >Last-Modified:
> >Originator: sana@stl.sarov.ru
> >Release: unknown-1.0
> >Organization:
> >Environment:
> 32-bit and 64-bit Linux, GDB 5.3
> >Description:
> GDB 5.3 supports work with section .debug_macinfo.
> During testing it has been found out that GDB 5.3 has problem with printing of macro symbols whose value is string without quotes.
> But it is usual parctice to use such values.
>
> tets.c:
>
> #define PREFIX small
> main()
> {
> int PREFIX_i = 10, PREFIX_j;
>
> PREFIX_j = abs(PREFIX_i);
> return;
> }
>
>
> GDB's output for this test is:
>
> This GDB was configured as "i686-pc-linux-gnu"...
> (gdb) b main
> Breakpoint 1 at 0x8048aef: file test2.c, line 4.
> (gdb) r
> Starting program: /home1/sana/macro/tr/a.out
>
> Breakpoint 1, main () at test2.c:4
> 4 int PREFIX_i = 10, PREFIX_j;
> (gdb) p PREFIX
> No symbol "small" in current context.
> (gdb)
Same question as for your other report - why do you think this is a
bug, and what do you expect GDB to do when you say "p PREFIX"? "macro
expand PREFIX" will work, but "PREFIX" as an expression is a syntax
error because small is undeclared.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer