[9/9] expand locations

Vladimir Prus vladimir@codesourcery.com
Sun Sep 23 08:22:00 GMT 2007


On Saturday 08 September 2007 15:50:24 Eli Zaretskii wrote:
> > From: Vladimir Prus <vladimir@codesourcery.com>
> > Date: Sat, 8 Sep 2007 03:13:33 +0400
> > 
> > +     One case I'm not sure about is where originally we've
> > +     set breakpoint at file:line. There were several PC values
> > +     for that file:line, due to optimization, all in one block.
> > +     We've picked on PC value. If "clear" is issued with another
> > +     PC corresponding to the same file:line, what should we do?  */
> 
> I think we should ask the user what she meant.

I have pondered about this, and I no longer thing we have much choice,
or that we really need to ask the user.

The situation comment talks about is this:

	- User sets breakpoints at some line
	- Due to optimization, there are two PC corresponding to that line
	-- PC1 and PC2
	- With my patches, the first PC is selected.
	- User says 'clear PC2'.

What user just did does not seem a common use case. Typically, user will just use
'clear' (without parameter) after hitting a breakpoint.  And we set breakpoint
on PC1, so no problem. Another possible, though less likely case, is when user
looks at breakpoint table, notes PC, and says "clear PC". But the breakpoint
table will only list PC1. So, the only possibility for user to issue 'clear PC2'
is when user guessed that PC2 is also PC corresponding to original line. This
does not seem very important case to support.

I've clarified the comment to reflect this. 

I have also fixed license/copyright years on the new test files. The
revised patch is attached, OK?

- Volodya


 


-------------- next part --------------
	gdb/
	* breakpoint.c (remove_sal): New.
	(expand_line_sal_maybe): New.
	(create_breakpoints): Call expand_line_sal_maybe.
	(clear_command): Add comment.
	(breakpoint_re_set_one): Call expand_line_sal_maybe.
	* linespec.c (decode_indirect): Set explicit_pc to 1.
	(decode_all_digits): Set explicit_line to 1.
	(append_expanded_sal): New.
	(expand_line_sal): New.
	* linespec.h (expand_line_sal): Declare.
	* symtab.c (init_sal): Initialize explicit_pc 
	and explicit_line.
	* symtab.h (struct symtab_and_line): New fields
	explicit_pc and explicit_line.	
	
	gdb/testsuite/
	* gdb.cp/mb-ctor.cc: New.
	* gdb.cp/mb-ctor.exp: New.
	* gdb.cp/mb-templates.cc: New.
	* gdb.cp/mb-templates.exp: New.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mainline_9_expansion.diff
Type: text/x-diff
Size: 21946 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20070923/622d3caa/attachment.bin>


More information about the Gdb-patches mailing list