+2008-05-03 Pedro Alves <pedro@codesourcery.com>
+
+ * parse.c (parse_exp_in_context): Don't override
+ expression_context_pc if get_selected_block returned a valid
+ block.
+
2008-05-03 Daniel Jacobowitz <dan@codesourcery.com>
* alpha-tdep.h (ALPHA_REGISTER_BYTES): Delete.
old_chain = make_cleanup (free_funcalls, 0 /*ignore*/);
funcall_chain = 0;
- /* If no context specified, try using the current frame, if any. */
+ expression_context_block = block;
- if (!block)
- block = get_selected_block (&expression_context_pc);
+ /* If no context specified, try using the current frame, if any. */
+ if (!expression_context_block)
+ expression_context_block = get_selected_block (&expression_context_pc);
+ else
+ expression_context_pc = BLOCK_START (expression_context_block);
- /* Fall back to using the current source static context, if any. */
+ /* Fall back to using the current source static context, if any. */
- if (!block)
+ if (!expression_context_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);
+ expression_context_block
+ = BLOCKVECTOR_BLOCK (BLOCKVECTOR (cursal.symtab), STATIC_BLOCK);
+ if (expression_context_block)
+ expression_context_pc = BLOCK_START (expression_context_block);
}
expout_size = 10;
+2008-05-03 Pedro Alves <pedro@codesourcery.com>
+
+ * gdb.base/macscp.exp, gdb.base/macscp1.c: Add test for printing
+ expressions with macros.
+
2008-05-03 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.base/dfp-test.exp: Fix random FAIL risk on calling functions.
set prms_id 0
set bug_id 0
+set srcfile macscp1.c
set testfile "macscp"
set binfile ${objdir}/${subdir}/${testfile}
}
}
}
+
+gdb_test "break [gdb_get_line_number "set breakpoint here"]" \
+ "Breakpoint.*at.* file .*, line.*" \
+ "breakpoint macscp_expr"
+
+gdb_test "continue" "foo = 0;.*" "continue to macsp_expr"
+
+gdb_test "print M" \
+ "No symbol \"M\" in current context\." \
+ "print expression with macro before define."
+
+gdb_test "next" "foo = 1;" "next to definition"
+
+gdb_test "print M" \
+ " = 0" \
+ "print expression with macro in scope."
+
+gdb_test "next" "foo = 2;" "next to definition"
+
+gdb_test "print M" \
+ "No symbol \"M\" in current context\." \
+ "print expression with macro after undef."