This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch 2/2] Speed up JIT support


On Friday 04 February 2011 21:58:06, Paul Pluzhnikov wrote:

> This is the second part of the JIT speedup patch (applies on top of the
> first patch).
> 
> I vaguely remember (but can't find a reference) that there is no CORE_ADDR
> that is guaranteed to always be invalid, and so my use of -1 for
> INVALID_CORE_ADDR may be problematic.

Yeah... In this case, I don't think it's problematic, but
it's certainly bad practice to assume -1 or 0 are special.
The "right" way to do this is to use an auxiliary variable
recording for example 'looked up' | 'looked up and
not found' | 'looked up and valid'.  Different states, but
see for example frame.h:struct frame_info->stack_addr|stack_addr_p.

Please don't be shy in documenting each field of
new structures.

> 2010-02-03  Paul Pluzhnikov  <ppluzhnikov@google.com>
> 
> 	* breakpoint.c (longjmp_names): New variable.
> 	(struct breakpoint_objfile_data): New type.
> 	(breakpoint_objfile_key): New variable.
> 	(get_breakpoint_objfile_data): New function.
> 	(create_overlay_event_breakpoint): Adjust.
> 	(create_longjmp_master_breakpoint): Adjust.
> 	(create_std_terminate_master_breakpoint): Adjust.
> 	(create_exception_master_breakpoint): Adjust.
> 	(_initialize_breakpoint): Adjust.

Please expands those "Adjust"s a bit...  Examples:

...
	(create_exception_master_breakpoint): Check per-objfile cache
   for symbols first.
	(_initialize_breakpoint): Register per-objfile data key.
...

Otherwise looks okay to me.

-- 
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]