Commit Graph

3081 Commits

Author SHA1 Message Date
Jan Kratochvil bcd5727bdd Fix a racy FAIL.
* gdb.base/auxv.exp (fetch_auxv): Fix trailing newlines consumption.
	* gdb.base/callfuncs.exp (fetch_all_registers): Likewise.
2009-03-22 21:11:45 +00:00
Thiago Jung Bauermann cc924cad91 gdb/
2009-03-21  Jan Kratochvil  <jan.kratochvil@redhat.com>
	    Jim Blandy  <jimb@red-bean.com>
	    Thiago Jung Bauermann  <bauerman@br.ibm.com>
	    Tom Tromey  <tromey@redhat.com>

	Miscellaneous fixes to the Python code.
	* python/python-cmd.c (cmdpy_init): Accept keyword
	arguments.
	* python/python-value.c (valpy_string): Accept keyword
	arguments.
	(valpy_binop): Use `break' to exit from the TRY_CATCH block.
	Do not call value_to_value_object on NULL RES_VAL.
	(value_object_methods): Change `string' entry to also accept
	keyword arguments.
	(convert_value_from_python): Return a copy of the value if obj is
	a gdb.Value object.
	(value_object_methods): Mark the `string' method as accepting
	keywords, and show method "prototype" in the doc string.
	* python/python.c (get_parameter): Don't return inside a
	TRY_CATCH.

gdb/doc/
2009-03-21  Thiago Jung Bauermann  <bauerman@br.ibm.com>

	* gdb.texinfo (Values From Inferior): Fix optional arguments
	markup.
	(Commands In Python): Adjust argument names of gdb.Command.__init__
	to what the function accepts as keywords.

gdb/testsuite/
2009-03-21  Thiago Jung Bauermann  <bauerman@br.ibm.com>

	* gdb.python/python-cmd.exp: Add tests for keyword arguments.
	* gdb.python/python-function.exp: Add test for function returning
	a GDB value.
2009-03-21 03:13:02 +00:00
Thiago Jung Bauermann bc3b79fd1a gdb/
2009-03-05  Tom Tromey  <tromey@redhat.com>

	Add support for convenience functions in Python.
	* Makefile.in (SUBDIR_PYTHON_OBS): Add python-function.o.
	(SUBDIR_PYTHON_SRCS): Add python-function.c.
	(python-function.o): New target.
	* eval.c: Include "python/python.h" and <ctype.h>.
	(evaluate_subexp_standard): Handle values of type
	TYPE_CODE_INTERNAL_FUNCTION.
	* gdbtypes.h (type_code): Add TYPE_CODE_INTERNAL_FUNCTION.
	* parse.c (write_exp_string): Remove duplicate word in comment.
	* python/python-function.c: New file.
	* python/python-internal.h (gdbpy_initialize_functions): Add
	prototype.
	* python/python.c (_initialize_python): Call
	gdbpy_initialize_functions.
	* valprint.c (value_check_printable): Handle values of type
	TYPE_CODE_INTERNAL_FUNCTION.
	* value.c: Include "cli/cli-decode.h".
	(internal_function): New struct.
	(functionlist, internal_fn_type): New static variables.
	(lookup_only_internalvar,
	lookup_internalvar): Add const qualifier to name argument.
	(create_internalvar): Likewise.  Initialize new field.
	(set_internal_var): Fix typo in comment.  Don't allow assignment
	to canonical variable.
	(value_create_internal_function, value_internal_function_name,
	call_internal_function, function_command, function_destroyer,
	add_internal_function): New functions.
	(_initialize_values): Create `function' placeholder command.
	Initialize internal_fn_type.
	* value.h (lookup_only_internalvar, create_internalvar,
	lookup_internalvar): Add const qualifier to name argument.
	(internal_function_fn, add_internal_function, call_internal_function,
	value_internal_function_name): Add prototypes.
	(struct internalvar) <canonical>: New field.

gdb/doc/
2008-03-05  Tom Tromey  <tromey@redhat.com>

	* gdb.texinfo (Convenience Vars): Document convenience functions.
	(Functions In Python): New node.
	(Python API): Update.

gdb/testsuite/
2009-03-05  Thiago Jung Bauermann  <bauerman@br.ibm.com>

	* gdb.python/python-function.exp: New file.
2009-03-21 03:03:56 +00:00
Tom Tromey 6c7a06a3fa gdb:
2009-03-19  Tom Tromey  <tromey@redhat.com>
	    Julian Brown  <julian@codesourcery.com>

	PR i18n/7220, PR i18n/7821, PR exp/8815, PR exp/9103,
	PR i18n/9401, PR exp/9613:
	* NEWS: Update
	* value.h (value_typed_string): Declare.
	(val_print_string): Update.
	* valprint.h (print_char_chars): Update.
	* valprint.c (print_char_chars): Add type argument.  Update.
	(val_print_string): Likewise.
	* valops.c (value_typed_string): New function.
	* utils.c (host_char_to_target): New function.
	(parse_escape): Use host_char_to_target, host_hex_value.  Update.
	Remove '^' case.
	(no_control_char_error): Remove.
	* typeprint.c (print_type_scalar): Update.
	* scm-valprint.c (scm_scmval_print): Update.
	* scm-lang.h (scm_printchar, scm_printstr): Update.
	* scm-lang.c (scm_printchar): Add type argument.
	(scm_printstr): Likewise.
	* printcmd.c (print_formatted): Update.
	(print_scalar_formatted): Update.
	(printf_command) <wide_string_arg, wide_char_arg>: New constants.
	Handle '%lc' and '%ls'.
	* parser-defs.h (struct typed_stoken): New type.
	(struct stoken_vector): Likewise.
	(write_exp_string_vector): Declare.
	* parse.c (write_exp_string_vector): New function.
	* p-valprint.c (pascal_val_print): Update.
	* p-lang.h (is_pascal_string_type, pascal_printchar,
	pascal_printstr): Update.
	* p-lang.c (is_pascal_string_type): Remove 'char_size' argument.
	Add 'char_type' argument.
	(pascal_emit_char): Add type argument.
	(pascal_printchar): Likewise.
	(pascal_printstr): Likewise.
	* objc-lang.c (objc_emit_char): Add type argument.
	(objc_printchar): Likewise.
	(objc_printstr): Likewise.
	* macroexp.c (get_character_constant): Handle unicode characters.
	Use c_parse_escape.
	(get_string_literal): Handle unicode strings.  Use
	c_parse_escape.
	* m2-valprint.c (print_unpacked_pointer): Update.
	(m2_print_array_contents): Update.
	(m2_val_print): Update.
	* m2-lang.c (m2_emit_char): Add type argument.
	(m2_printchar): Likewise.
	(m2_printstr): Likewise.
	* language.h (struct language_defn) <la_printchar>: Add type
	argument.
	<la_printstr, la_emitchar>: Likewise.
	(LA_PRINT_CHAR): Likewise.
	(LA_PRINT_STRING): Likewise.
	(LA_EMIT_CHAR): Likewise.
	* language.c (unk_lang_emit_char): Add type argument.
	(unk_lang_printchar): Likewise.
	(unk_lang_printstr): Likewise.
	* jv-valprint.c (java_val_print): Update.
	* jv-lang.c (java_emit_char): Add type argument.
	* f-valprint.c (f_val_print): Update.
	* f-lang.c (f_emit_char): Add type argument.
	(f_printchar): Likewise.
	(f_printstr): Likewise.
	* expprint.c (print_subexp_standard): Update.
	* charset.h (target_wide_charset): Declare.
	(c_target_char_has_backslash_escape, c_parse_backslash,
	host_char_print_literally, host_char_to_target,
	target_char_to_host, target_char_to_control_char): Remove.
	(enum transliterations): New type.
	(convert_between_encodings): Declare.
	(HOST_ESCAPE_CHAR): New define.
	(host_letter_to_control_character, host_hex_value): Declare.
	(enum wchar_iterate_result): New enum.
	(struct wchar_iterator): Declare.
	(make_wchar_iterator, make_cleanup_wchar_iterator, wchar_iterator,
	wchar_push_back): Declare.
	* charset-list.h: New file.
	* c-valprint.c (textual_name): New function.
	(textual_element_type): Handle wide character types.
	(c_val_print): Pass original type to textual_element_type.  Handle
	wide character types.
	(c_value_print): Use textual_element_type.  Pass original type of
	value to val_print.
	* c-lang.h (enum c_string_type): New type.
	(c_printchar, c_printstr): Update.
	* c-lang.c (classify_type): New function.
	(print_wchar): Likewise.
	(c_emit_char): Add type argument.  Handle wide characters.
	(c_printchar): Likewise.
	(c_printstr): Add type argument.  Handle wide and multibyte
	character sets.
	(convert_ucn): New function.
	(emit_numeric_character): Likewise.
	(convert_octal): Likewise.
	(convert_hex): Likewise.
	(ADVANCE): New macro.
	(convert_escape): New function.
	(parse_one_string): Likewise.
	(evaluate_subexp_c): Likewise.
	(exp_descriptor_c): New global.
	(c_language_defn): Use exp_descriptor_c.
	(cplus_language_defn): Likewise.
	(asm_language_defn): Likewise.
	(minimal_language_defn): Likewise.
	(charset_for_string_type): New function.
	* c-exp.y (%union): Add 'svec' and 'tsval'.
	(CHAR): New token.
	(exp): Add CHAR production.
	(string_exp): Rewrite.
	(exp) <string_exp>: Rewrite.
	(tempbuf): Now global.
	(tempbuf_init): New global.
	(parse_string_or_char): New function.
	(yylex) <tempbuf>: Now global.
	<tokptr, tempbufindex, tempbufsize, token_string, class_prefix>:
	Remove.
	Handle 'u', 'U', and 'L' prefixes.  Call parse_string_or_char.
	(c_parse_escape): New function.
	* auxv.c (fprint_target_auxv): Update.
	* ada-valprint.c (ada_emit_char): Add type argument.
	(ada_printchar): Likewise.
	(ada_print_scalar): Update.
	(printstr): Add type argument.  Update calls to ada_emit_char.
	(ada_printstr): Add type argument.
	(ada_val_print_array): Update.
	(ada_val_print_1): Likewise.
	* ada-lang.c (emit_char): Add type argument.
	* ada-lang.h (ada_emit_char, ada_printchar, ada_printstr): Add
	type arguments.
	* gdb_locale.h: Include langinfo.h.
	* charset.c (_initialize_charset): Set default host charset from
	the locale.  Don't register charsets.  Add target-wide-charset
	commands.  Call find_charset_names.
	(struct charset, struct translation): Remove.
	(GDB_DEFAULT_HOST_CHARSET): Remove.
	(GDB_DEFAULT_TARGET_WIDE_CHARSET): New define.
	(target_wide_charset_name): New global.
	(show_host_charset_name): Handle "auto".
	(show_target_wide_charset_name): New function.
	(host_charset_enum, target_charset_enum): Remove.
	(charset_enum): New global.
	(all_charsets, register_charset, lookup_charset, all_translations,
	register_translation, lookup_translation): Remove.
	(simple_charset, ascii_print_literally, ascii_to_control): Remove.
	(iso_8859_print_literally, iso_8859_to_control,
	iso_8859_family_charset): Remove.
	(ebcdic_print_literally, ebcdic_to_control,
	ebcdic_family_charset): Remove.
	(struct cached_iconv, check_iconv_cache, cached_iconv_convert,
	register_iconv_charsets): Remove.
	(target_wide_charset_be_name, target_wide_charset_le_name): New
	globals.
	(identity_either_char_to_other): Remove.
	(set_be_le_names, validate): New functions.
	(backslashable, backslashed, represented): Remove.
	(default_c_target_char_has_backslash_escape): Remove.
	(default_c_parse_backslash, iconv_convert): Remove.
	(ascii_to_iso_8859_1_table, ascii_to_ebcdic_us_table,
	ascii_to_ibm1047_table, iso_8859_1_to_ascii_table,
	iso_8859_1_to_ebcdic_us_table, iso_8859_1_to_ibm1047_table,
	ebcdic_us_to_ascii_table, ebcdic_us_to_iso_8859_1_table,
	ebcdic_us_to_ibm1047_table, ibm1047_to_ascii_table,
	ibm1047_to_iso_8859_1_table, ibm1047_to_ebcdic_us_table): Remove.
	(table_convert_char, table_translation, simple_table_translation):
	Remove.
	(current_host_charset, current_target_charset,
	c_target_char_has_backslash_escape_func,
	c_target_char_has_backslash_escape_baton): Remove.
	(c_parse_backslash_func, c_parse_backslash_baton): Remove.
	(host_char_to_target_func, host_char_to_target_baton): Remove.
	(target_char_to_host_func, target_char_to_host_baton): Remove.
	(cached_iconv_host_to_target, cached_iconv_target_to_host):
	Remove.
	(lookup_charset_or_error, check_valid_host_charset): Remove.
	(set_host_and_target_charsets): Remove.
	(set_host_charset, set_target_charset): Remove.
	(set_host_charset_sfunc, set_target_charset_sfunc): Rewrite.
	(set_target_wide_charset_sfunc): New function.
	(show_charset): Print target wide character set.
	(host_charset, target_charset): Rewrite.
	(target_wide_charset): New function.
	(c_target_char_has_backslash_escape): Remove.
	(c_parse_backslash): Remove.
	(host_letter_to_control_character): New function.
	(host_char_print_literally): Remove.
	(host_hex_value): New function.
	(target_char_to_control_char): Remove.
	(cleanup_iconv): New function.
	(convert_between_encodings): New function.
	(target_char_to_host): Remove.
	(struct wchar_iterator): Define.
	(make_wchar_iterator, make_cleanup_wchar_iterator, wchar_iterator,
	wchar_push_back): New functions.
	(do_cleanup_iterator): New function.
	(char_ptr): New typedef.
	(charsets): New global.
	(add_one, find_charset_names): New functions.
	(default_charset_names): New global.
	(auto_host_charset_name): Likewise.
	* aclocal.m4, config.in, configure: Rebuild.
	* configure.ac: Call AM_LANGINFO_CODESET.
	(GDB_DEFAULT_HOST_CHARSET): Default to UTF-8.
	(AM_ICONV): Invoke earlier.
	* acinclude.m4: Include codeset.m4.  Subst LIBICONV_INCLUDE and
	LIBICONV_LIBDIR.  Check for libiconv in build tree.
	* Makefile.in (LIBICONV_LIBDIR, LIBICONV_INCLUDE): New macros.
	(INTERNAL_CFLAGS_BASE): Add LIBICONV_INCLUDE.
	(INTERNAL_LDFLAGS): Add LIBICONV_LIBDIR.
	* gdb_obstack.h (obstack_grow_wstr): New define.
        * gdb_wchar.h: New file.
        * defs.h: Include it.
gdb/testsuite:
	* gdb.base/store.exp: Update for change to escape output.
	* gdb.base/callfuncs.exp (fetch_all_registers): Update for change
	to escape output.
	* gdb.base/pointers.exp: Update for change to escape output.
	* gdb.base/long_long.exp (gdb_test_long_long): Update for change
	to escape output.
	* gdb.base/constvars.exp (do_constvar_tests): Update for change to
	escape output.
	* gdb.base/call-rt-st.exp (print_struct_call): Update for change
	to escape output.
	* gdb.cp/ref-types.exp (gdb_start_again): Update for change to
	escape output.
	* gdb.base/setvar.exp: Update for change to escape output.
	* lib/gdb.exp (default_gdb_start): Set LC_CTYPE to C.
	* gdb.base/printcmds.exp (test_print_all_chars): Update for change
	to escape output.
	(test_print_string_constants): Likewise.
	* gdb.base/charset.exp (valid_host_charset): Check size of
	wchar_t.  Handle UCS-2 and UCS-4.  Add tests for wide and unicode
	cases.  Handle "auto"-related output.
	* gdb.base/charset.c (char16_t, char32_t): New typedefs.
	(uvar, Uvar): New globals.
gdb/doc:
	* gdb.texinfo (Character Sets): Remove obsolete text.  Document
	set target-wide-charset.
	(Requirements): Mention iconv.
2009-03-20 23:04:40 +00:00
Jerome Guitton c31af87b2e * gdb.ada/fixed_points/fixed_points.adb: Add a test on overprecise
deltas.
	* gdb.ada/fixed_points.exp: Ditto.
2009-03-19 14:08:50 +00:00
Pedro Alves 51272cf2e9 * return-nodebug.c: Don't include stdio.h.
(init): Delete.
	(func): Delete definition and provide extern declaration.
	(t): New.
	(main): Don't call printf.  Call func and store its result in t.
	* return-nodebug1.c: New.
	* return-nodebug.exp: Don't expect stdio output.  Instead, print
	the global variable t.  Drop printf formatters and cast types from
	foreach loop.  Don't use prepare_for_testing.  Compile
	return-nodebug.c and return-nodebug1.c in separate steps.  Don't
	define FORMAT or CAST.
2009-03-18 15:36:01 +00:00
Paul Pluzhnikov d24948ac99 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
* gdb.base/solib-display.exp: Disable test for remote targers.
2009-03-18 05:43:55 +00:00
Jan Kratochvil 61ff14c69a gdb/
* stack.c (return_command <retval_exp>): New variables retval_expr
	and old_chain.  Inline parse_and_eval to initialize retval_expr.  Check
	RETVAL_EXPR for UNOP_CAST and set RETURN_TYPE to the RETURN_VALUE type
	if RETURN_TYPE is NULL.

gdb/doc/
	* gdb.texinfo (Returning): New description for missing debug info.

gdb/testsuite/
	* gdb.base/return-nodebug.exp, gdb.base/return-nodebug.c: New.
2009-03-15 09:19:40 +00:00
Jan Kratochvil cb4dce936e Fix a racy FAIL.
* gdb.base/multi-forks.exp (continue_to_exit_bp_loc): New function with
	code from `follow parent, print pids'.
	(`follow child, print pids', `follow parent, print pids'): Call it.
	Replace `gdb_test "break..."' by gdb_breakpoint.
2009-03-14 14:25:55 +00:00
Vladimir Prus f7c60c5e2b * gdb.mi/mi-cli.exp: Adjust for output difference in
sync and async modes.
2009-03-13 10:55:08 +00:00
Joel Brobecker 383ace49f8 * gdb.ada/ptype_arith_binop.exp: Remove some commented-out code
that was checked in by mistake. Remove loading of ada.exp, since
        this is not necessary in this case.
2009-03-13 02:24:38 +00:00
Joel Brobecker 4ce102af1e * gdb.ada/ptype_arith_binop.exp: New testcase. 2009-03-13 02:15:36 +00:00
Joel Brobecker 529a2aefc2 * gdb.ada/mod_from_name: New testcase. 2009-03-12 23:42:05 +00:00
Joel Brobecker 8a38181c39 * gdb.ada/tick_last_segv: New testcase. 2009-03-12 23:19:35 +00:00
Vladimir Prus 11436dee51 * gdb.mi/mi-cli.exp: Remove debug print. 2009-03-12 20:16:06 +00:00
Vladimir Prus 1f31650a61 Include token in ^running notification for CLI commands.
* mi/mi-main.c (mi_execute_command): Set current_token here.
        (mi_cmd_execute): Do not set current_token here.
2009-03-12 20:08:04 +00:00
Paul Pluzhnikov a3247a2213 2009-03-05 Paul Pluzhnikov <ppluzhnikov@google.com>
* printcmd.c (do_one_display): Reparse exp_string.
	(display_uses_solib_p): New function.
	(clear_dangling_display_expressions): New function.
	(_initialize_printcmd): Add observer.
	* solib.c (no_shared_libraries): Swap order of calls to
	clear_solib and objfile_purge_solibs.
2009-03-05 23:45:14 +00:00
Pedro Alves aae6458789 gdb/
2009-03-05  Pedro Alves  <pedro@codesourcery.com>

	* breakpoint.c (check_duplicates_for): Skip permanent breakpoints
	duplicates of permanent breakpoints.

gdb/testsuite/
2009-03-05  Pedro Alves  <pedro@codesourcery.com>

	* gdb.arch/i386-permbkpt.S, gdb.arch/i386-permbkpt.exp: New.
2009-03-05 22:37:11 +00:00
Jan Kratochvil 44aabfbc81 * gdb.base/macscp.exp (objfile): Move it to ${objdir}/${subdir}/.
(list_and_check_macro): Use more specific test name.
	(next to definition): Make the test names unique.
2009-02-18 22:24:37 +00:00
Pierre Muller c087fcd326 * gdb.pascal/floats.exp: Accept approximate results everywhere. 2009-02-18 14:46:14 +00:00
Vladimir Prus c86cf02930 * mi/mi-interp.c (mi_solib_loaded, mi_solib_unloaded): New.
(mi_interpreter_init): Register the above.
	* solib.c (clear_solib): Notify solib unload.
	* breakpoint.c (disable_breakpoints_in_unloaded_shlib): Do not
	disable breakpoints on a.out targets.
2009-02-18 07:28:34 +00:00
Vladimir Prus 3ea85240b3 * observer.c (observer_test_first_notification_function)
(observer_test_second_notification_function)
	(observer_test_third_notification_function): Adjust prototype.
2009-02-17 19:52:27 +00:00
Doug Evans 1903f0e64b * amd64-tdep.c (amd64_skip_prefixes): Renamed from skip_prefixes.
All callers updated.
	(amd64_get_insn_details): Handle more 3-byte opcode insns.
	(amd64_breakpoint_p): Delete.
	(amd64_displaced_step_fixup): When fixing up after stepping an int3,
	don't back up pc to the start of the int3.
	* i386-tdep.c: #include opcode/i386.h.
	(i386_skip_prefixes): New function.
	(i386_absolute_jmp_p): Constify argument.
	(i386_absolute_call_p,i386_ret_p,i386_call_p,i386_syscall_p): Ditto.
	(i386_breakpoint_p): Delete.
	(i386_displaced_step_fixup): Handle unnecessary or redundant prefixes.
	When fixing up after stepping an int3, don't back up pc to the start
	of the int3.

	* gdb.arch/amd64-disp-step.S (test_int3): New test.
	* gdb.arch/amd64-disp-step.exp (test_int3): New test.
	* gdb.arch/i386-disp-step.S (test_prefixed_abs_jump): New test.
	(test_prefixed_syscall,test_int3): New tests.
	* gdb.arch/i386-disp-step.exp (test_prefixed_abs_jump): New test.
	(test_prefixed_syscall,test_int3): New tests.
2009-02-17 06:14:17 +00:00
Thiago Jung Bauermann 6db7e3514c Adding gdb.python/python-cmd.exp which I forgot to commit earlier. 2009-02-14 21:58:29 +00:00
Vladimir Prus 1d33d6baa4 Include frame information for *stopped due to CLI commands.
* ada-tasks.c (ada_normal_stop_observer): Adjust prototype.
        * infcmd.c (finish_command_continuation): Pass '1' for
        'print_frame' parameter to the observer.
        * infrun.c (normal_stop): Don't print mi-specific information
        here. Pass 'stop_print_frame' to the 'print_frame' parameter
        of the observer.
        * mi/mi-interp.c (mi_on_normal_stop): Adjust prototype.
        If we need to print frame, and current uiout is not the MI one,
        print frame again.
2009-02-14 15:24:44 +00:00
Pierre Muller faafb04710 * lib/gdb.exp (get_hexadecimal_valueof): New procedure.
* gdb.base/pc-fp.exp (get_valueofx): Remove.
	Replace calls to get_valueofx by get_hexadecimal_valueof.
2009-02-14 00:27:56 +00:00
Pierre Muller 417e16e2a0 * lib/gdb.exp (get_valueof): Accept anything as a return value.
(get_integer_valueof): New procedure.
	(get_sizeof): Use new get_integer_value_of.
	* gdb.base/sizeof.exp: Replace all uses of get_valueof
	by get_integer_valueof.
2009-02-13 23:37:24 +00:00
Tom Tromey 7065b901d5 * gdb.base/remote.exp (get_sizeof): Remove.
* gdb.base/long_long.exp (get_valueof, get_sizeof): Remove.
	* gdb.base/dfp-test.exp (get_valueof, get_sizeof): Remove.
	* gdb.base/sizeof.exp (get_valueof, get_sizeof): Remove.
	* lib/gdb.exp (get_valueof): Move from long_long.exp.
	(get_sizeof): Likewise.
2009-02-13 16:13:47 +00:00
Jan Kratochvil 5d7cb8dff5 gdb/
PR fortran/9806
	* dwarf2read.c (process_die <DW_TAG_module>, read_module)
	(scan_partial_symbols <DW_TAG_module>, add_partial_module): New.

gdb/testsuite/
	PR fortran/9806
	* gdb.fortran/module.exp, gdb.fortran/module.f90: New.
2009-02-12 09:15:07 +00:00
Paul Pluzhnikov b2febfff46 2009-02-06 Paul Pluzhnikov <ppluzhnikov@google.com>
* gdb.cp/pr9594.cc: Prevent GCC from optimizing 'a' out.
2009-02-10 00:59:27 +00:00
Pedro Alves 4aa995e123 2009-02-06 Pedro Alves <pedro@codesourcery.com>
gdb/
	* target.h (enum target_object): Add new TARGET_OBJECT_SIGNAL_INFO.
	* infrun.c (siginfo_value_read, siginfo_value_write): New.
	(siginfo_value_funcs): New.
	(siginfo_make_value): New.
	(_initialize_infrun): Create the $_siginfo convenience variable.
	* gdbtypes.h (append_composite_type_field_aligned): Declare.
	* gdbtypes.c (append_composite_type_field): Rename to...
	(append_composite_type_field_aligned): ... this.  Add ALIGNMENT
	argument.  Handle it.
	(append_composite_type_field): Rewrite on top of
	append_composite_type_field_aligned.
	* value.h (internalvar_make_value): New typedef.
	(struct internalvar) <make_value>: New field.
	(create_internalvar_type_lazy): Declare.
	* value.c (create_internalvar): Clear make_value.
	(create_internalvar_type_lazy): New.
	(value_of_internalvar): If make_value is set use it.
	(preserve_values): Skip internal variables that don't have a
	value.
	* gdbarch.sh (get_siginfo_type): New.
	* gdbarch.h, gdbarch.c: Regenerate.

	* linux-tdep.h, linux-tdep.c: New.
	* amd64-linux-tdep.c: Include "linux-tdep.h".
	(amd64_linux_init_abi): Register linux_get_siginfo_type and
	linux_get_siginfo_mapper.
	* i386-linux-tdep.c: Include "linux-tdep.h".
	(i386_linux_init_abi): Register linux_get_siginfo_type and
	linux_get_siginfo_mapper.
	* arm-linux-tdep.c: Include "linux-tdep.h".
	(i386_linux_init_abi): Register linux_get_siginfo_type and
	linux_get_siginfo_mapper.

	* linux-nat.c (linux_xfer_siginfo): New.
	(linux_nat_xfer_partial): Handle TARGET_OBJECT_SIGNAL_INFO.
	* remote.c (PACKET_qXfer_siginfo_read)
	(PACKET_qXfer_siginfo_write): New.
	(feature remote_protocol_features): Add "qXfer:siginfo:read" and
	"qXfer:siginfo:write" features.
	(remote_xfer_partial): Handle TARGET_OBJECT_SIGNAL_INFO.
	(_initialize_remote): Add "set/show remote read-siginfo-object"
	and "set/show remote write-siginfo-object" commands.

	* Makefile.in (ALL_TARGET_OBS): Add linux-tdep.o.
	(HFILES_NO_SRCDIR): Add linux-tdep.h.
	(ALLDEPFILES): Add linux-tdep.c.

	* configure.tgt (arm*-*-linux* | arm*-*-uclinux*)
	(i[34567]86-*-linux*, x86_64-*-linux*): Add linux-tdep.o to
	gdb_target_obs.

2009-02-06  Pedro Alves  <pedro@codesourcery.com>

	gdb/gdbserver/
	* server.c (handle_query): Report qXfer:siginfo:read and
	qXfer:siginfo:write as supported and handle them.
	* target.h (struct target_ops) <qxfer_siginfo>: New field.
	* linux-low.c (linux_xfer_siginfo): New.
	(linux_target_ops): Set it.

2009-02-06  Pedro Alves  <pedro@codesourcery.com>

	gdb/doc/
	* gdb.texinfo (Signals): Document $_siginfo.
	(Convenience Variables): Mention $_siginfo.
	(Remote Configuration): Document qXfer:siginfo:read,
	qXfer:siginfo:write packets, and the read-siginfo-object,
	write-siginfo-object commands.

2009-02-06  Pedro Alves  <pedro@codesourcery.com>

	gdb/testsuite/
	* gdb.base/siginfo-obj.c, gdb.base/siginfo-obj.exp: New.
2009-02-06 22:59:01 +00:00
Thiago Jung Bauermann d8906c6f0e gdb/
2009-02-06  Tom Tromey  <tromey@redhat.com>

	* Makefile.in (SUBDIR_PYTHON_OBS): Add python-cmd.o.
	(SUBDIR_PYTHON_SRCS): Add python-cmd.c.
	(python-cmd.o): New target.
	* cli/cli-decode.c (set_cmd_completer): Add self parameter to
	completer prototype.
	(add_cmd): Initialize destroyer member of cmd_list_element. Use
	make_symbol_completion_list_fn as completer.
	(delete_cmd): Call destroyer if one is set.
	* cli/cli-decode.h (cmd_list_element): Add cmd parameter to
	completer member.  Add destroyer member.
	(set_cmd_completer): Add self parameter to
	completer prototype.
	* command.h (set_cmd_completer): Add cmd parameter to
	completer prototype.
	* completer.c (noop_completer, filename_completer,
	location_completer, expression_completer, command_completer): Adapt
	to new completer prototype.
	(complete_line_internal): Pass new parameter to completer function.
	* completer.h (noop_completer, filename_completer,
	location_completer, expression_completer, command_completer): Adapt
	prototypes to new completer prototype.
	* interps.c (interpreter_completer): Adapt to new completer
	prototype.
	* python/python-cmd.c: New file.
	* python/python-internal.h (gdbpy_initialize_commands): Add
	prototype.
	(gdbpy_doc_cst): Add forward declaration.
	* python/python.c (gdbpy_doc_cst): Declare.
	(_initialize_python): Call gdbpy_initialize_commands.  Initialize
	gdbpy_doc_cst.
	* symtab.c (make_symbol_completion_list_fn): New function.
	* symtab.h (make_symbol_completion_list_fn): Add prototype.

gdb/doc/
2009-02-06  Tom Tromey  <tromey@redhat.com>

	* gdb.texinfo (Python API): Add entry for Commands In Python.
	(Commands In Python): New node.

gdb/testsuite/
2009-02-06  Thiago Jung Bauermann  <bauerman@br.ibm.com>

	* gdb.python/python-cmd.exp: New file.
2009-02-06 21:33:59 +00:00
Tristan Gingold ff4ab08db9 2009-02-06 Tristan Gingold <gingold@adacore.com>
* gdb.arch/i386-sse.c (main): Replace call to puts by an nop asm.
2009-02-06 08:48:29 +00:00
Tristan Gingold aacd552b10 2009-02-05 Tristan Gingold <gingold@adacore.com>
* gdb.base/sigbpt.exp: Detect which signal is received when a NULL
	pointer is dereferenced and use this signal name in regexp.
	* gdb.base/signull.exp: Ditto.
	* gdb.base/sigbpt.c (main): Catch SIGBUS too.
	* gdb.base/signull.c (main): Ditto.
2009-02-05 13:59:18 +00:00
Thiago Jung Bauermann 08c637dee2 gdb/
2009-02-04  Tom Tromey  <tromey@redhat.com>
	    Thiago Jung Bauermann  <bauerman@br.ibm.com>
	    Phil Muldoon  <pmuldoon@redhat.com>

	* python/python-internal.h (gdbpy_get_value_from_history): Rename
	prototype to gdbpy_history.
	(gdbpy_is_string): Declare.
	(python_string_to_host_string): Declare.
	* python/python-utils.c (gdbpy_is_string): New function.
	(unicode_to_encoded_string): New function.
	(unicode_to_target_string): Use it.
	(python_string_to_host_string): New function.
	* python/python-value.c (valpy_address): New function.
	(convert_value_from_python): Use gdbpy_is_string.  Change to throw
	Python exception instead of a GDB exception on error.  Properly check
	Python booleans.
	(valpy_getitem): Convert field name to host string.  Handle array
	accesses.  Adapt to new behaviour of convert_value_from_python.
	(valpy_new): Adapt to new behaviour of convert_value_from_python.
	(enum valpy_opcode) <VALPY_LSH, VALPY_RSH, VALPY_BITAND,
	VALPY_BITXOR, VALPY_BITOR>: New constants.
	(valpy_binop): Update.  Adapt to new behaviour of
	convert_value_from_python.
	(valpy_invert): New function.
	(valpy_lsh): Likewise.
	(valpy_rsh): Likewise.
	(valpy_and): Likewise.
	(valpy_or): Likewise.
	(valpy_xor): Likewise.
	(valpy_richcompare): Call convert_value_from_python instead of doing
	conversions itself.
	(is_intlike, valpy_int, valpy_long, valpy_float): New functions.
	(gdbpy_get_value_from_history): Rename
	function to gdbpy_history.
	(gdbpy_initialize_values): Don't set tp_new.
	(value_object_type): Add valpy_new.
	(value_object_methods): Add `address' entry.
	(value_object_as_number): Update for new methods.
	* python/python.c (GdbMethods): Rename entry from
	`get_value_from_history' to `history'.

gdb/doc/
2009-02-04  Tom Tromey  <tromey@redhat.com>

	* gdb.texinfo (Basic Python): Document gdb.history.

gdb/testsuite/
2009-02-04  Tom Tromey  <tromey@redhat.com>
	    Thiago Jung Bauermann  <bauerman@br.ibm.com>

	* gdb.python/python-value.exp: Use `gdb.history' instead of
	`gdb.value_from_history'.
	(test_value_numeric_ops): Add test for conversion of enum constant.
	* gdb.python/python-value.c (enum e): New type.
	(evalue): New global.
	(main): Use argv.
2009-02-04 21:55:40 +00:00
Jerome Guitton 20261af84c * gdb.ada/uninitialized_vars: New test program.
* gdb.ada/uninitialized_vars.exp: New testcase.
2009-02-04 18:09:38 +00:00
Tom Tromey 52e44b4398 Fix ChangeLog to point to the correct bug, PR gdb/9594.
gdb/testsuite
	* gdb.cp/cpcompletion.exp: Name the test "pr9594".
	* gdb.cp/pr2489.cc: Rename...
	* gdb.cp/pr9594.cc: ... to this.
2009-02-03 01:09:01 +00:00
Tom Tromey 1c71341a8f gdb
PR gdb/2489:
	* completer.c (count_struct_fields): Count method names.
	(add_struct_fields): Add matching method names.
gdb/testsuite
	* gdb.cp/Makefile.in (EXECUTABLES): Add pr2489.
	* gdb.cp/pr2489.cc: New file.
	* gdb.cp/cpcompletion.exp: New file.
2009-02-03 01:00:40 +00:00
Tom Tromey a42952252f gdb
PR exp/9059:
	* valops.c (find_overload_match): Follow typedefs before taking
	address of object argument.
gdb/testsuite
	PR exp/9059:
	* gdb.cp/call-c.exp: Add regression test.
	* gdb.cp/call-c.cc (FooHandle): New typedef.
	(main): New variable 'handle'.
2009-02-02 21:50:13 +00:00
Vladimir Prus 592375cda9 PR 8145.
* thread.c (do_captured_list_thread_ids): Report the current
	thread id.
2009-01-30 18:43:05 +00:00
Vladimir Prus 41447f92e2 * breakpoint.c (create_breakpoint, create_breakpoints)
(break_command_really, set_breakpoint): New parameter enabled.
	(create_breakpoint, break_command_really): Make breakpoint
	disabled if so requested.
	* breakpoint.h (set_breakpoint): New parameter enabled.
	* mi/mi-cmd-break.c (mi_cmd_break_insert): Handle the -d option.
2009-01-30 18:28:01 +00:00
Doug Evans 35669430c8 * opcode/i386.h: Add multiple inclusion protection.
(EAX_REG_NUM,ECX_REG_NUM,EDX_REGNUM,EBX_REG_NUM,ESI_REG_NUM)
	(EDI_REG_NUM): New macros.
	(MODRM_MOD_FIELD,MODRM_REG_FIELD,MODRM_RM_FIELD): New macros.
	(SIB_SCALE_FIELD,SIB_INDEX_FIELD,SIB_BASE_FIELD): New macros.
	(REG_PREFIX_P): New macro.

	* amd64-tdep.h (amd64_displaced_step_copy_insn): Declare.
	(amd64_displaced_step_fixup): Declare.
	* amd64-tdep.c: #include opcode/i386.h, dis-asm.h.
	(amd64_arch_regmap): Move out of amd64_analyze_stack_align
	and make static global.
	(amd64_arch_regmap_len): New static global.
	(amd64_arch_reg_to_regnum): New function.
	(struct amd64_insn): New struct.
	(struct displaced_step_closure): New struct.
	(onebyte_has_modrm,twobyte_has_modrm): New static globals.
	(rex_prefix_p,skip_prefixes)
	(amd64_insn_length_fprintf,amd64_insn_length_init_dis)
	(amd64_insn_length,amd64_get_unused_input_int_reg)
	(amd64_get_insn_details,fixup_riprel,fixup_displaced_copy)
	(amd64_displaced_step_copy_insn)
	(amd64_absolute_jmp_p,amd64_absolute_call_p,amd64_ret_p)
	(amd64_call_p,amd64_breakpoint_p,amd64_syscall_p)
	(amd64_displaced_step_fixup): New functions.
	* amd64-linux-tdep.c: #include arch-utils.h.
	(amd64_linux_init_abi): Install displaced stepping support.

	* gdb.arch/amd64-disp-step.S: New file.
	* gdb.arch/amd64-disp-step.exp: New file.
	* gdb.arch/i386-disp-step.S: New file.
	* gdb.arch/i386-disp-step.exp: New file.
2009-01-29 00:29:57 +00:00
Pierre Muller 09f00d9a9c * gdb.base/find.exp: Set newline variable
using quotes instead of braces to fix cygwin failures.
2009-01-27 08:22:23 +00:00
Pedro Alves 1e8fb9762b 2009-01-23 Pedro Alves <pedro@codesourcery.com>
* cli/cli-decode.c (add_setshow_zuinteger_cmd): New.
	* cli/cli-setshow.c (do_setshow_command): Handle it.
	* command.h (enum var_types): Add var_zuinteger.
	(add_setshow_zuinteger_cmd): Declare.

	* valprint.c (_initialize_valprint): Change the set input-radix
	and set output-radix commands to zuinteger type.

2009-01-23  Pedro Alves  <pedro@codesourcery.com>

	* gdb.base/radix.exp: Add tests to ensure that that set
	input-radix 0 and set output-radix 0 are really rejected.
2009-01-23 18:47:46 +00:00
Pedro Alves da06171272 * gdb.base/hook-stop-frame.c, gdb.base/hook-stop-frame.exp: Update
copyright years.
2009-01-23 16:01:46 +00:00
Pedro Alves dd7e2d2bc7 2009-01-23 Pedro Alves <pedro@codesourcery.com>
PR gdb/9664:
	* infrun.c (normal_stop): Tag threads as stopped, and run the
	hook-stop before printing the stack frame.

2009-01-23  Pedro Alves  <pedro@codesourcery.com>

	PR gdb/9664:
	* gdb.base/hook-stop-frame.c, gdb.base/hook-stop-frame.exp: New.
2009-01-23 15:47:03 +00:00
Pedro Alves 392452f69e 2009-01-22 Pedro Alves <pedro@codesourcery.com>
PR c++/9631:
	* gnu-v3-abi.c (gnuv3_baseclass_offset): Call check_typedef on
	vbasetype.

2009-01-22  Pedro Alves  <pedro@codesourcery.com>

	PR c++/9631:
	* gdb.cp/pr9631.cc, gdb.cp/pr9631.exp: New.
2009-01-22 22:50:39 +00:00
Pierre Muller 8653e71c5e 2009-01-22 Pierre Muller <muller@ics.u-strasbg.fr>
* gdb.server/file-transfer.exp: Use EXEEXT variable for
	binfile definition to fix Windows OS failure.
2009-01-22 16:01:10 +00:00
Daniel Jacobowitz a12cc160ab PR gdb/9346
* infcmd.c (signal_command): Do not specify a resume PC.

	testsuite/
	PR gdb/9346
	* gdb.base/interrupt.c (sigint_handler): New.
	(main): Install a SIGINT handler if SIGNALS is defined.  Exit
	on error.
	* gdb.base/interrupt.exp: Define SIGNALS unless gdb,nosignals.
	Test "signal SIGINT".
2009-01-20 15:33:14 +00:00
Doug Evans b89667ebd4 * dummy-frame.c (dummy_frame): Replace regcache member with
caller_state.
	(dummy_frame_push): Replace caller_regcache arg with caller_state.
	All callers updated.
	(remove_dummy_frame,pop_dummy_frame,lookup_dummy_frame): New fns.
	(dummy_frame_pop): Rewrite.  Verify requested frame is in the
	dummy frame stack.  Restore program state.
	(cleanup_dummy_frames): Rewrite.
	(dummy_frame_sniffer): Update.  Make static.
	* dummy-frame.h (regcache,frame_info): Delete forward decls.
	(inferior_thread_state): New forward decl.
	(dummy_frame_push): Update prototype.
	* frame.c (frame_pop): dummy_frame_pop now does all the work for
	DUMMY_FRAMEs.
	* infcall.c (breakpoint_auto_delete_contents): Delete.
	(get_function_name,run_inferior_call): New fns.
	(call_function_by_hand): Simplify by moving some code to
	get_function_name, run_inferior_call.  Inferior function call wrapped
	in TRY_CATCH so there's less need for cleanups and all exits from
	proceed are handled similarily.  Detect program exit.
	Detect program stopping in a different thread.
	Make error messages more consistent.
	* inferior.h (inferior_thread_state): Declare (opaque type).
	(save_inferior_thread_state,restore_inferior_thread_state,
	make_cleanup_restore_inferior_thread_state,
	discard_inferior_thread_state, get_inferior_thread_state_regcache):
	Declare.
	(save_inferior_status): Update prototype.
	* infrun.c: (normal_stop): When stopped for the completion of an
	inferior function call, verify the expected stack frame kind.
	(inferior_thread_state): New struct.
	(save_inferior_thread_state,restore_inferior_thread_state,
	do_restore_inferior_thread_state_cleanup,
	make_cleanup_restore_inferior_thread_state,
	discard_inferior_thread_state,
	get_inferior_thread_state_regcache): New functions.
	(inferior_status): Move stop_signal, stop_pc, registers to
	inferior_thread_state.  Remove restore_stack_info.
	(save_inferior_status): Remove arg restore_stack_info.
	All callers updated.  Remove saving of state now saved by
	save_inferior_thread_state.
	(restore_inferior_status): Remove restoration of state now done by
	restore_inferior_thread_state.
	(discard_inferior_status): Remove freeing of registers, now done by
	discard_inferior_thread_state.

	* gdb.base/break.exp: Update expected gdb output.
	* gdb.base/sepdebug.exp: Ditto.
	* gdb.mi/mi-syn-frame.exp: Ditto.
	* gdb.mi/mi2-syn-frame.exp: Ditto.

	* gdb.base/call-signal-resume.exp: New file.
	* gdb.base/call-signals.c: New file.
	* gdb.base/unwindonsignal.exp: New file.
	* gdb.base/unwindonsignal.c: New file.
	* gdb.threads/interrupted-hand-call.exp: New file.
	* gdb.threads/interrupted-hand-call.c: New file.
	* gdb.threads/thread-unwindonsignal.exp: New file.
2009-01-19 19:05:01 +00:00