public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* [gdb]howto specify breakpoints with gdb convenience variables
@ 2009-07-12 15:27 Larry Evans
  2009-07-12 17:38 ` Larry Evans
  0 siblings, 1 reply; 3+ messages in thread
From: Larry Evans @ 2009-07-12 15:27 UTC (permalink / raw)
  To: gcc

My */gcc/.gdbinit contains lines like:

#cp_parser_template_parameter:./* ...we have a template type parameter.
break parser.c:9730
condition $bpnum expand_location(input_location).line>(99)
commands
call expand_location(token->location)
call cp_lexer_start_debugging(parser->lexer)
end

Now, there's several of these, and I wanted to use change:

   cp_lexer_print_token

to print the line and column numbers of the token.  Well,
of course this changed the breakpoint line numbers; so,
I was wondering if there was some way to set a convenience
variable:

http://ftp.sunsite.ualberta.ca/Documentation/Gnu/gdb-4.18/html_node/gdb_60.html#SEC60

so that the breakpoints could conveniently be adjusted
after changes to the source code.  IOW, something like:

   set $lje_bp_line_correction = 5
   set $lje_bp_line_next = (5238+$lje_bp_line_correction)
   break parser.c:$lje_bp_line_next

However, this just resulted in:

Breakpoint 3 at 0x58a5a6: file 
/home/evansl/download/gcc/4.4-20090630/build/../src/gcc/cp/parser.c, 
line 22148.
Breakpoint 4 at 0x0

IOW, it appears the line:

   break parser.c:$lje_bp_line_next

doesn't work.

How do I get it to work?

TIA.

-Larry



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

* Re: [gdb]howto specify breakpoints with gdb convenience variables
  2009-07-12 15:27 [gdb]howto specify breakpoints with gdb convenience variables Larry Evans
@ 2009-07-12 17:38 ` Larry Evans
  2009-07-12 19:01   ` Tom Tromey
  0 siblings, 1 reply; 3+ messages in thread
From: Larry Evans @ 2009-07-12 17:38 UTC (permalink / raw)
  To: gcc

On 07/12/09 10:44, Larry Evans wrote:
[snip]
> I was wondering if there was some way to set a convenience
> variable:
[snip]
> so that the breakpoints could conveniently be adjusted
> after changes to the source code.  IOW, something like:
> 
>   set $lje_bp_line_correction = 5
>   set $lje_bp_line_next = (5238+$lje_bp_line_correction)
>   break parser.c:$lje_bp_line_next
[snip]

Based on:

   http://sourceware.org/ml/gdb/2008-02/msg00070.html

I guess there's no way to do that :(

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

* Re: [gdb]howto specify breakpoints with gdb convenience variables
  2009-07-12 17:38 ` Larry Evans
@ 2009-07-12 19:01   ` Tom Tromey
  0 siblings, 0 replies; 3+ messages in thread
From: Tom Tromey @ 2009-07-12 19:01 UTC (permalink / raw)
  To: Larry Evans; +Cc: gcc

>>>>> "Larry" == Larry Evans <cppljevans@suddenlink.net> writes:

Larry> Based on:
Larry>   http://sourceware.org/ml/gdb/2008-02/msg00070.html
Larry> I guess there's no way to do that :(

If you use the cvs gdb you can do it using python.

In plain gdb you can do it by using set logging to set the output
file, writing the data to it in a source-able form (or using shell sed
or whatever to transform it), then sourcing the file.

Tom

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

end of thread, other threads:[~2009-07-12 19:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-12 15:27 [gdb]howto specify breakpoints with gdb convenience variables Larry Evans
2009-07-12 17:38 ` Larry Evans
2009-07-12 19:01   ` Tom Tromey

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