diff -rup ../../gdb-public.1/gdb/Makefile.in ./Makefile.in --- ../../gdb-public.1/gdb/Makefile.in 2007-10-28 19:35:43.000000000 -0400 +++ ./Makefile.in 2007-10-30 22:00:50.000000000 -0400 @@ -3114,7 +3114,7 @@ gdbtk-wrapper.o: $(srcdir)/gdbtk/generic mi-cmd-break.o: $(srcdir)/mi/mi-cmd-break.c $(defs_h) $(mi_cmds_h) \ $(ui_out_h) $(mi_out_h) $(breakpoint_h) $(gdb_string_h) \ - $(mi_getopt_h) $(gdb_events_h) $(gdb_h) + $(mi_getopt_h) $(gdb_events_h) $(gdb_h) $(language_h) $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-break.c mi-cmd-disas.o: $(srcdir)/mi/mi-cmd-disas.c $(defs_h) $(target_h) $(value_h) \ $(mi_cmds_h) $(mi_getopt_h) $(gdb_string_h) $(ui_out_h) $(disasm_h) diff -rup ../../gdb-public.1/gdb/breakpoint.c ./breakpoint.c --- ../../gdb-public.1/gdb/breakpoint.c 2007-10-28 19:40:08.000000000 -0400 +++ ./breakpoint.c 2007-10-30 22:00:50.000000000 -0400 @@ -90,11 +90,13 @@ static void watch_command (char *, int); static int can_use_hardware_watchpoint (struct value *); -static int break_command_1 (char *, int, int, struct breakpoint *); +static int break_command_1 (char *, int, int, struct breakpoint *, + const struct language_defn *); static void mention (struct breakpoint *); -struct breakpoint *set_raw_breakpoint (struct symtab_and_line, enum bptype); +struct breakpoint *set_raw_breakpoint (struct symtab_and_line, enum bptype, + const struct language_defn *); static void check_duplicates (struct breakpoint *); @@ -161,7 +163,7 @@ static void hbreak_command (char *, int) static void thbreak_command (char *, int); -static void watch_command_1 (char *, int, int); +static void watch_command_1 (char *, int, int, const struct language_defn *); static void rwatch_command (char *, int); @@ -4326,7 +4328,8 @@ static void free_bp_location (struct bp_ that has type BPTYPE and has no locations as yet. */ struct breakpoint * -set_raw_breakpoint_without_location (enum bptype bptype) +set_raw_breakpoint_without_location (enum bptype bptype, + const struct language_defn *language) { struct breakpoint *b, *b1; @@ -4334,7 +4337,7 @@ set_raw_breakpoint_without_location (enu memset (b, 0, sizeof (*b)); b->type = bptype; - b->language = current_language->la_language; + b->language = language->la_language; b->input_radix = input_radix; b->thread = -1; b->enable_state = bp_enabled; @@ -4396,9 +4399,11 @@ set_breakpoint_location_function (struct should happen, a bogus breakpoint will be left on the chain. */ struct breakpoint * -set_raw_breakpoint (struct symtab_and_line sal, enum bptype bptype) +set_raw_breakpoint (struct symtab_and_line sal, enum bptype bptype, + const struct language_defn *language) { - struct breakpoint *b = set_raw_breakpoint_without_location (bptype); + struct breakpoint *b = + set_raw_breakpoint_without_location (bptype, language); CORE_ADDR adjusted_address; /* Adjust the breakpoint's address prior to allocating a location. @@ -4459,7 +4464,7 @@ create_internal_breakpoint (CORE_ADDR ad sal.pc = address; sal.section = find_pc_overlay (sal.pc); - b = set_raw_breakpoint (sal, type); + b = set_raw_breakpoint (sal, type, language_def (language_c)); b->number = internal_breakpoint_number--; b->disposition = disp_donttouch; @@ -4751,7 +4756,7 @@ solib_load_unload_1 (char *hookname, int if (canonical != (char **) NULL) discard_cleanups (canonical_strings_chain); - b = set_raw_breakpoint (sals.sals[0], bp_kind); + b = set_raw_breakpoint (sals.sals[0], bp_kind, language_def (language_c)); set_breakpoint_count (breakpoint_count + 1); b->number = breakpoint_count; b->cond_string = (cond_string == NULL) ? @@ -4807,7 +4812,7 @@ create_fork_vfork_event_catchpoint (int sal.symtab = NULL; sal.line = 0; - b = set_raw_breakpoint (sal, bp_kind); + b = set_raw_breakpoint (sal, bp_kind, language_def (language_c)); set_breakpoint_count (breakpoint_count + 1); b->number = breakpoint_count; b->cond_string = (cond_string == NULL) ? @@ -4845,7 +4850,7 @@ create_exec_event_catchpoint (int tempfl sal.symtab = NULL; sal.line = 0; - b = set_raw_breakpoint (sal, bp_catch_exec); + b = set_raw_breakpoint (sal, bp_catch_exec, language_def (language_c)); set_breakpoint_count (breakpoint_count + 1); b->number = breakpoint_count; b->cond_string = (cond_string == NULL) ? @@ -4969,7 +4974,7 @@ set_momentary_breakpoint (struct symtab_ enum bptype type) { struct breakpoint *b; - b = set_raw_breakpoint (sal, type); + b = set_raw_breakpoint (sal, type, current_language); b->enable_state = bp_enabled; b->disposition = disp_donttouch; b->frame_id = frame_id; @@ -5173,7 +5178,8 @@ create_breakpoint (struct symtabs_and_li char *cond_string, enum bptype type, enum bpdisp disposition, int thread, int ignore_count, int from_tty, - struct breakpoint *pending_bp) + struct breakpoint *pending_bp, + const struct language_defn *language) { struct breakpoint *b = NULL; int i; @@ -5200,7 +5206,7 @@ create_breakpoint (struct symtabs_and_li if (i == 0) { - b = set_raw_breakpoint (sal, type); + b = set_raw_breakpoint (sal, type, language); set_breakpoint_count (breakpoint_count + 1); b->number = breakpoint_count; b->thread = thread; @@ -5389,7 +5395,8 @@ create_breakpoints (struct symtabs_and_l char *cond_string, enum bptype type, enum bpdisp disposition, int thread, int ignore_count, int from_tty, - struct breakpoint *pending_bp) + struct breakpoint *pending_bp, + const struct language_defn *language) { int i; for (i = 0; i < sals.nelts; ++i) @@ -5400,7 +5407,7 @@ create_breakpoints (struct symtabs_and_l create_breakpoint (expanded, addr_string[i], cond_string, type, disposition, thread, ignore_count, from_tty, - pending_bp); + pending_bp, language); } } @@ -5505,7 +5512,8 @@ do_captured_parse_breakpoint (struct ui_ If no thread is found, *THREAD is set to -1. */ static void find_condition_and_thread (char *tok, CORE_ADDR pc, - char **cond_string, int *thread) + char **cond_string, int *thread, + const struct language_defn *language) { *cond_string = NULL; *thread = -1; @@ -5528,7 +5536,7 @@ find_condition_and_thread (char *tok, CO if (toklen >= 1 && strncmp (tok, "if", toklen) == 0) { tok = cond_start = end_tok + 1; - parse_exp_1 (&tok, block_for_pc (pc), 0, curr_language ()); + parse_exp_1 (&tok, block_for_pc (pc), 0, language); cond_end = tok; *cond_string = savestring (cond_start, cond_end - cond_start); @@ -5558,7 +5566,9 @@ find_condition_and_thread (char *tok, CO a pending breakpoint. */ static int -break_command_1 (char *arg, int flag, int from_tty, struct breakpoint *pending_bp) +break_command_1 (char *arg, int flag, int from_tty, + struct breakpoint *pending_bp, + const struct language_defn *language) { struct gdb_exception e; int tempflag, hardwareflag; @@ -5683,7 +5693,8 @@ break_command_1 (char *arg, int flag, in from thread number, so parsing in context of first sal is OK. When setting the breakpoint we'll re-parse it in context of each sal. */ - find_condition_and_thread (arg, sals.sals[0].pc, &cond_string, &thread); + find_condition_and_thread (arg, sals.sals[0].pc, &cond_string, &thread, + language); if (cond_string) make_cleanup (xfree, cond_string); create_breakpoints (sals, addr_string, cond_string, @@ -5691,7 +5702,7 @@ break_command_1 (char *arg, int flag, in : bp_breakpoint, tempflag ? disp_del : disp_donttouch, thread, ignore_count, from_tty, - pending_bp); + pending_bp, language); } else { @@ -5702,7 +5713,7 @@ break_command_1 (char *arg, int flag, in b = set_raw_breakpoint_without_location (hardwareflag ? bp_hardware_breakpoint - : bp_breakpoint); + : bp_breakpoint, language); set_breakpoint_count (breakpoint_count + 1); b->number = breakpoint_count; b->thread = thread; @@ -5739,6 +5750,7 @@ struct captured_breakpoint_args int tempflag; int thread; int ignore_count; + const struct language_defn *language; }; static int @@ -5814,7 +5826,7 @@ do_captured_breakpoint (struct ui_out *u args->hardwareflag ? bp_hardware_breakpoint : bp_breakpoint, args->tempflag ? disp_del : disp_donttouch, args->thread, args->ignore_count, 0/*from-tty*/, - NULL/*pending_bp*/); + NULL/*pending_bp*/, args->language); /* That's it. Discard the cleanups for data inserted into the breakpoint. */ @@ -5828,7 +5840,8 @@ enum gdb_rc gdb_breakpoint (char *address, char *condition, int hardwareflag, int tempflag, int thread, int ignore_count, - char **error_message) + char **error_message, + const struct language_defn *language) { struct captured_breakpoint_args args; args.address = address; @@ -5837,6 +5850,7 @@ gdb_breakpoint (char *address, char *con args.tempflag = tempflag; args.thread = thread; args.ignore_count = ignore_count; + args.language = language; if (catch_exceptions_with_msg (uiout, do_captured_breakpoint, &args, error_message, RETURN_MASK_ALL) < 0) return GDB_RC_FAIL; @@ -5897,25 +5911,26 @@ resolve_sal_pc (struct symtab_and_line * void break_command (char *arg, int from_tty) { - break_command_1 (arg, 0, from_tty, NULL); + break_command_1 (arg, 0, from_tty, NULL, current_language); } void tbreak_command (char *arg, int from_tty) { - break_command_1 (arg, BP_TEMPFLAG, from_tty, NULL); + break_command_1 (arg, BP_TEMPFLAG, from_tty, NULL, current_language); } static void hbreak_command (char *arg, int from_tty) { - break_command_1 (arg, BP_HARDWAREFLAG, from_tty, NULL); + break_command_1 (arg, BP_HARDWAREFLAG, from_tty, NULL, current_language); } static void thbreak_command (char *arg, int from_tty) { - break_command_1 (arg, (BP_TEMPFLAG | BP_HARDWAREFLAG), from_tty, NULL); + break_command_1 (arg, (BP_TEMPFLAG | BP_HARDWAREFLAG), from_tty, NULL, + current_language); } static void @@ -5956,7 +5971,7 @@ stopin_command (char *arg, int from_tty) if (badInput) printf_filtered (_("Usage: stop in \n")); else - break_command_1 (arg, 0, from_tty, NULL); + break_command_1 (arg, 0, from_tty, NULL, current_language); } static void @@ -5988,14 +6003,15 @@ stopat_command (char *arg, int from_tty) if (badInput) printf_filtered (_("Usage: stop at \n")); else - break_command_1 (arg, 0, from_tty, NULL); + break_command_1 (arg, 0, from_tty, NULL, current_language); } /* accessflag: hw_write: watch write, hw_read: watch read, hw_access: watch access (read or write) */ static void -watch_command_1 (char *arg, int accessflag, int from_tty) +watch_command_1 (char *arg, int accessflag, int from_tty, + const struct language_defn *language) { struct breakpoint *b, *scope_breakpoint = NULL; struct symtab_and_line sal; @@ -6020,7 +6036,7 @@ watch_command_1 (char *arg, int accessfl /* Parse arguments. */ innermost_block = NULL; exp_start = arg; - exp = parse_exp_1 (&arg, 0, 0, curr_language ()); + exp = parse_exp_1 (&arg, 0, 0, language); exp_end = arg; exp_valid_block = innermost_block; mark = value_mark (); @@ -6041,7 +6057,7 @@ watch_command_1 (char *arg, int accessfl if (toklen >= 1 && strncmp (tok, "if", toklen) == 0) { tok = cond_start = end_tok + 1; - cond = parse_exp_1 (&tok, 0, 0, curr_language ()); + cond = parse_exp_1 (&tok, 0, 0, language); cond_end = tok; } if (*tok) @@ -6107,7 +6123,7 @@ watch_command_1 (char *arg, int accessfl } /* Now set up the breakpoint. */ - b = set_raw_breakpoint (sal, bp_type); + b = set_raw_breakpoint (sal, bp_type, language); set_breakpoint_count (breakpoint_count + 1); b->number = breakpoint_count; b->disposition = disp_donttouch; @@ -6224,7 +6240,7 @@ watch_command_wrapper (char *arg, int fr static void watch_command (char *arg, int from_tty) { - watch_command_1 (arg, hw_write, from_tty); + watch_command_1 (arg, hw_write, from_tty, current_language); } void @@ -6236,7 +6252,7 @@ rwatch_command_wrapper (char *arg, int f static void rwatch_command (char *arg, int from_tty) { - watch_command_1 (arg, hw_read, from_tty); + watch_command_1 (arg, hw_read, from_tty, current_language); } void @@ -6248,7 +6264,7 @@ awatch_command_wrapper (char *arg, int f static void awatch_command (char *arg, int from_tty) { - watch_command_1 (arg, hw_access, from_tty); + watch_command_1 (arg, hw_access, from_tty, current_language); } @@ -6643,7 +6659,7 @@ create_exception_catchpoint (int tempfla error (_("Internal error -- invalid catchpoint kind")); } - b = set_raw_breakpoint (*sal, bptype); + b = set_raw_breakpoint (*sal, bptype, language_def (language_cplus)); set_breakpoint_count (breakpoint_count + 1); b->number = breakpoint_count; b->cond_string = (cond_string == NULL) ? @@ -6722,7 +6738,8 @@ handle_gnu_v3_exceptions (int tempflag, return 0; } - b = set_raw_breakpoint (sals.sals[0], bp_breakpoint); + b = set_raw_breakpoint (sals.sals[0], bp_breakpoint, + language_def (language_cplus)); set_breakpoint_count (breakpoint_count + 1); b->number = breakpoint_count; b->cond_string = (cond_string == NULL) ? @@ -6804,7 +6821,7 @@ create_ada_exception_breakpoint (struct enough for now, though. */ } - b = set_raw_breakpoint (sal, bp_breakpoint); + b = set_raw_breakpoint (sal, bp_breakpoint, language_def (language_ada)); set_breakpoint_count (breakpoint_count + 1); b->enable_state = bp_enabled; @@ -6990,7 +7007,7 @@ struct breakpoint * set_breakpoint_sal (struct symtab_and_line sal) { struct breakpoint *b; - b = set_raw_breakpoint (sal, bp_breakpoint); + b = set_raw_breakpoint (sal, bp_breakpoint, curr_language ()); set_breakpoint_count (breakpoint_count + 1); b->number = breakpoint_count; b->thread = -1; @@ -7668,7 +7685,8 @@ breakpoint_re_set_one (void *bint) char *cond_string = 0; int thread = -1; find_condition_and_thread (s, sals.sals[0].pc, - &cond_string, &thread); + &cond_string, &thread, + language_def (b->language)); if (cond_string) b->cond_string = cond_string; b->thread = thread; diff -rup ../../gdb-public.1/gdb/gdb.h ./gdb.h --- ../../gdb-public.1/gdb/gdb.h 2007-10-28 19:35:43.000000000 -0400 +++ ./gdb.h 2007-10-30 22:00:51.000000000 -0400 @@ -20,6 +20,7 @@ #define GDB_H struct ui_out; +struct language_defn; /* Return-code (RC) from a gdb library call. (The abreviation RC is taken from the sim/common directory.) */ @@ -51,7 +52,8 @@ enum gdb_rc gdb_breakpoint_query (struct enum gdb_rc gdb_breakpoint (char *address, char *condition, int hardwareflag, int tempflag, int thread, int ignore_count, - char **error_message); + char **error_message, + const struct language_defn *language); /* Switch thread and print notification. */ enum gdb_rc gdb_thread_select (struct ui_out *uiout, char *tidstr, diff -rup ../../gdb-public.1/gdb/mi/mi-cmd-break.c ./mi/mi-cmd-break.c --- ../../gdb-public.1/gdb/mi/mi-cmd-break.c 2007-10-28 19:35:43.000000000 -0400 +++ ./mi/mi-cmd-break.c 2007-10-30 22:00:52.000000000 -0400 @@ -26,6 +26,7 @@ #include "mi-getopt.h" #include "gdb-events.h" #include "gdb.h" +#include "language.h" enum { @@ -139,13 +140,13 @@ mi_cmd_break_insert (char *command, char rc = gdb_breakpoint (address, condition, 0 /*hardwareflag */ , temp_p, thread, ignore_count, - &mi_error_message); + &mi_error_message, current_language); break; case HW_BP: rc = gdb_breakpoint (address, condition, 1 /*hardwareflag */ , temp_p, thread, ignore_count, - &mi_error_message); + &mi_error_message, current_language); break; #if 0 case REGEXP_BP: