This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit] Fix ptype problem printing typedefs defined differently in different compilation units
On Monday 23 January 2006 14:17, Jim Blandy wrote:
> So I don't think there's a problem with your patch.
I've committed the patch.
-Fred
2006-01-24 Fred Fish <fnf@specifix.com>
* parse.c (source.h): Include.
(parse_exp_in_context): Use static source context if no
other context found.
Index: parse.c
===================================================================
RCS file: /cvs/src/src/gdb/parse.c,v
retrieving revision 1.51
diff -c -p -r1.51 parse.c
*** parse.c 17 Dec 2005 22:34:01 -0000 1.51
--- parse.c 24 Jan 2006 14:49:59 -0000
***************
*** 52,57 ****
--- 52,58 ----
#include "doublest.h"
#include "gdb_assert.h"
#include "block.h"
+ #include "source.h"
/* Standard set of definitions for printing, dumping, prefixifying,
* and evaluating expressions. */
*************** parse_exp_in_context (char **stringptr,
*** 1075,1087 ****
old_chain = make_cleanup (free_funcalls, 0 /*ignore*/);
funcall_chain = 0;
if (block)
{
expression_context_block = block;
expression_context_pc = BLOCK_START (block);
}
- else
- expression_context_block = get_selected_block (&expression_context_pc);
expout_size = 10;
expout_ptr = 0;
--- 1076,1102 ----
old_chain = make_cleanup (free_funcalls, 0 /*ignore*/);
funcall_chain = 0;
+ /* If no context specified, try using the current frame, if any. */
+
+ if (!block)
+ block = get_selected_block (&expression_context_pc);
+
+ /* Fall back to using the current source static context, if any. */
+
+ if (!block)
+ {
+ struct symtab_and_line cursal = get_current_source_symtab_and_line ();
+ if (cursal.symtab)
+ block = BLOCKVECTOR_BLOCK (BLOCKVECTOR (cursal.symtab), STATIC_BLOCK);
+ }
+
+ /* Save the context, if specified by caller, or found above. */
+
if (block)
{
expression_context_block = block;
expression_context_pc = BLOCK_START (block);
}
expout_size = 10;
expout_ptr = 0;